summaryrefslogtreecommitdiff
path: root/public/vendor
diff options
context:
space:
mode:
authorWu Cheng-Han2015-07-04 11:31:01 +0800
committerWu Cheng-Han2015-07-04 11:31:01 +0800
commit01685c255fda6e13f1cd2980130d2e388d52125c (patch)
treec329610e7011c0d77c55ef54f371181aeb362d13 /public/vendor
parent1d843c8ac257d512a96cf054ab24e6a3c2f34e26 (diff)
Updated codemirror to 5.4.0
Diffstat (limited to 'public/vendor')
-rwxr-xr-xpublic/vendor/codemirror/addon/comment/continuecomment.js2
-rwxr-xr-xpublic/vendor/codemirror/addon/dialog/dialog.css8
-rwxr-xr-xpublic/vendor/codemirror/addon/display/rulers.js3
-rwxr-xr-xpublic/vendor/codemirror/addon/edit/closebrackets.js1
-rwxr-xr-xpublic/vendor/codemirror/addon/edit/closetag.js2
-rwxr-xr-xpublic/vendor/codemirror/addon/edit/continuelist.js9
-rwxr-xr-xpublic/vendor/codemirror/addon/hint/show-hint.js37
-rwxr-xr-xpublic/vendor/codemirror/addon/hint/sql-hint.js17
-rwxr-xr-xpublic/vendor/codemirror/addon/lint/lint.js12
-rwxr-xr-xpublic/vendor/codemirror/addon/runmode/runmode.node.js80
-rwxr-xr-xpublic/vendor/codemirror/addon/search/searchcursor.js4
-rwxr-xr-xpublic/vendor/codemirror/addon/tern/tern.js6
-rwxr-xr-xpublic/vendor/codemirror/addon/tern/worker.js2
-rw-r--r--public/vendor/codemirror/codemirror.min.js22
-rwxr-xr-xpublic/vendor/codemirror/keymap/vim.js158
-rwxr-xr-xpublic/vendor/codemirror/lib/codemirror.css18
-rwxr-xr-xpublic/vendor/codemirror/lib/codemirror.js119
-rwxr-xr-xpublic/vendor/codemirror/mode/apl/apl.js3
-rwxr-xr-xpublic/vendor/codemirror/mode/asn.1/asn.1.js204
-rwxr-xr-xpublic/vendor/codemirror/mode/asn.1/index.html78
-rwxr-xr-xpublic/vendor/codemirror/mode/asterisk/asterisk.js6
-rwxr-xr-xpublic/vendor/codemirror/mode/clike/clike.js183
-rwxr-xr-xpublic/vendor/codemirror/mode/clike/test.js33
-rwxr-xr-xpublic/vendor/codemirror/mode/css/css.js17
-rwxr-xr-xpublic/vendor/codemirror/mode/css/test.js7
-rwxr-xr-xpublic/vendor/codemirror/mode/cypher/cypher.js2
-rwxr-xr-xpublic/vendor/codemirror/mode/dylan/dylan.js44
-rwxr-xr-xpublic/vendor/codemirror/mode/ecl/ecl.js3
-rwxr-xr-xpublic/vendor/codemirror/mode/eiffel/eiffel.js2
-rwxr-xr-xpublic/vendor/codemirror/mode/elm/elm.js205
-rwxr-xr-xpublic/vendor/codemirror/mode/elm/index.html61
-rwxr-xr-xpublic/vendor/codemirror/mode/factor/factor.js83
-rwxr-xr-xpublic/vendor/codemirror/mode/factor/index.html77
-rwxr-xr-xpublic/vendor/codemirror/mode/groovy/groovy.js13
-rwxr-xr-xpublic/vendor/codemirror/mode/htmlmixed/htmlmixed.js4
-rwxr-xr-xpublic/vendor/codemirror/mode/index.html9
-rwxr-xr-xpublic/vendor/codemirror/mode/javascript/javascript.js7
-rwxr-xr-xpublic/vendor/codemirror/mode/javascript/test.js5
-rwxr-xr-xpublic/vendor/codemirror/mode/julia/julia.js2
-rwxr-xr-xpublic/vendor/codemirror/mode/kotlin/kotlin.js7
-rwxr-xr-xpublic/vendor/codemirror/mode/livescript/livescript.js4
-rwxr-xr-xpublic/vendor/codemirror/mode/markdown/markdown.js60
-rwxr-xr-xpublic/vendor/codemirror/mode/markdown/test.js122
-rwxr-xr-xpublic/vendor/codemirror/mode/mathematica/index.html72
-rwxr-xr-xpublic/vendor/codemirror/mode/mathematica/mathematica.js175
-rwxr-xr-xpublic/vendor/codemirror/mode/meta.js8
-rwxr-xr-xpublic/vendor/codemirror/mode/php/php.js38
-rwxr-xr-xpublic/vendor/codemirror/mode/pig/pig.js40
-rwxr-xr-xpublic/vendor/codemirror/mode/python/python.js2
-rwxr-xr-xpublic/vendor/codemirror/mode/sql/sql.js4
-rwxr-xr-xpublic/vendor/codemirror/mode/swift/index.html88
-rwxr-xr-xpublic/vendor/codemirror/mode/swift/swift.js203
-rwxr-xr-xpublic/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js83
-rwxr-xr-xpublic/vendor/codemirror/mode/tiki/tiki.js27
-rwxr-xr-xpublic/vendor/codemirror/mode/ttcn-cfg/index.html115
-rwxr-xr-xpublic/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js214
-rwxr-xr-xpublic/vendor/codemirror/mode/ttcn/index.html118
-rwxr-xr-xpublic/vendor/codemirror/mode/ttcn/ttcn.js283
-rwxr-xr-xpublic/vendor/codemirror/mode/twig/index.html45
-rwxr-xr-xpublic/vendor/codemirror/mode/twig/twig.js132
-rwxr-xr-xpublic/vendor/codemirror/mode/vb/vb.js3
-rwxr-xr-xpublic/vendor/codemirror/mode/xquery/xquery.js70
-rwxr-xr-xpublic/vendor/codemirror/theme/ambiance.css5
-rwxr-xr-xpublic/vendor/codemirror/theme/erlang-dark.css2
-rwxr-xr-xpublic/vendor/codemirror/theme/lesser-dark.css4
-rwxr-xr-xpublic/vendor/codemirror/theme/monokai.css2
-rwxr-xr-xpublic/vendor/codemirror/theme/solarized.css4
-rwxr-xr-xpublic/vendor/codemirror/theme/ttcn.css65
68 files changed, 2986 insertions, 557 deletions
diff --git a/public/vendor/codemirror/addon/comment/continuecomment.js b/public/vendor/codemirror/addon/comment/continuecomment.js
index d0b81d30..b11d51e6 100755
--- a/public/vendor/codemirror/addon/comment/continuecomment.js
+++ b/public/vendor/codemirror/addon/comment/continuecomment.js
@@ -57,7 +57,7 @@
cm.operation(function() {
for (var i = ranges.length - 1; i >= 0; i--)
- cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+input");
+ cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert");
});
}
diff --git a/public/vendor/codemirror/addon/dialog/dialog.css b/public/vendor/codemirror/addon/dialog/dialog.css
index c8c139d9..677c0783 100755
--- a/public/vendor/codemirror/addon/dialog/dialog.css
+++ b/public/vendor/codemirror/addon/dialog/dialog.css
@@ -1,11 +1,11 @@
.CodeMirror-dialog {
position: absolute;
left: 0; right: 0;
- background: white;
+ background: inherit;
z-index: 15;
padding: .1em .8em;
overflow: hidden;
- color: #333;
+ color: inherit;
}
.CodeMirror-dialog-top {
@@ -27,10 +27,6 @@
font-family: monospace;
}
-.CodeMirror-dialog input::selection {
- color: white;
-}
-
.CodeMirror-dialog button {
font-size: 70%;
}
diff --git a/public/vendor/codemirror/addon/display/rulers.js b/public/vendor/codemirror/addon/display/rulers.js
index 13185d30..01f65667 100755
--- a/public/vendor/codemirror/addon/display/rulers.js
+++ b/public/vendor/codemirror/addon/display/rulers.js
@@ -38,7 +38,7 @@
for (var i = 0; i < val.length; i++) {
var elt = document.createElement("div");
elt.className = "CodeMirror-ruler";
- var col, cls = null, conf = val[i];
+ var col, conf = val[i];
if (typeof conf == "number") {
col = conf;
} else {
@@ -47,7 +47,6 @@
if (conf.color) elt.style.borderColor = conf.color;
if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;
if (conf.width) elt.style.borderLeftWidth = conf.width;
- cls = val[i].className;
}
elt.style.left = (left + col * cw) + "px";
elt.style.top = "-50px";
diff --git a/public/vendor/codemirror/addon/edit/closebrackets.js b/public/vendor/codemirror/addon/edit/closebrackets.js
index 35b5b32c..1ceda4e3 100755
--- a/public/vendor/codemirror/addon/edit/closebrackets.js
+++ b/public/vendor/codemirror/addon/edit/closebrackets.js
@@ -147,6 +147,7 @@
cm.replaceSelections(sels, "around", "+input");
} else if (type == "both") {
cm.replaceSelection(left + right, null, "+input");
+ cm.triggerElectric(left + right);
cm.execCommand("goCharLeft");
} else if (type == "addFour") {
cm.replaceSelection(left + left + left + left, "before", "+input");
diff --git a/public/vendor/codemirror/addon/edit/closetag.js b/public/vendor/codemirror/addon/edit/closetag.js
index 4ab36cce..c2d2263e 100755
--- a/public/vendor/codemirror/addon/edit/closetag.js
+++ b/public/vendor/codemirror/addon/edit/closetag.js
@@ -83,7 +83,7 @@
for (var i = ranges.length - 1; i >= 0; i--) {
var info = replacements[i];
- cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+input");
+ cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
var sel = cm.listSelections().slice(0);
sel[i] = {head: info.newPos, anchor: info.newPos};
cm.setSelections(sel);
diff --git a/public/vendor/codemirror/addon/edit/continuelist.js b/public/vendor/codemirror/addon/edit/continuelist.js
index e21d0f95..a0941d4f 100755
--- a/public/vendor/codemirror/addon/edit/continuelist.js
+++ b/public/vendor/codemirror/addon/edit/continuelist.js
@@ -11,8 +11,8 @@
})(function(CodeMirror) {
"use strict";
- var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s|\[x\]\s|\s*)/,
- emptyListRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s*|\[x\]\s|\s*)$/,
+ var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,
+ emptyListRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,
unorderedListRE = /[*+-]\s/;
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
@@ -36,12 +36,11 @@
line: pos.line, ch: pos.ch + 1
}, "+delete");
replacements[i] = "\n";
-
} else {
- var indent = match[1], after = match[4];
+ var indent = match[1], after = match[5];
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
? match[2]
- : (parseInt(match[3], 10) + 1) + ".";
+ : (parseInt(match[3], 10) + 1) + match[4];
replacements[i] = "\n" + indent + bullet + after;
}
diff --git a/public/vendor/codemirror/addon/hint/show-hint.js b/public/vendor/codemirror/addon/hint/show-hint.js
index 539181fd..d228fc88 100755
--- a/public/vendor/codemirror/addon/hint/show-hint.js
+++ b/public/vendor/codemirror/addon/hint/show-hint.js
@@ -33,7 +33,7 @@
if (!completion.options.hint) return;
CodeMirror.signal(this, "startCompletion", this);
- completion.update();
+ completion.update(true);
});
function Completion(cm, options) {
@@ -61,6 +61,7 @@
this.tick = null;
this.cm.off("cursorActivity", this.activityFunc);
+ if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close();
CodeMirror.signal(this.cm, "endCompletion", this.cm);
},
@@ -78,15 +79,6 @@
this.close();
},
- showHints: function(data) {
- if (!data || !data.list.length || !this.active()) return this.close();
-
- if (this.options.completeSingle && data.list.length == 1)
- this.pick(data, 0);
- else
- this.showWidget(data);
- },
-
cursorActivity: function() {
if (this.debounce) {
cancelAnimationFrame(this.debounce);
@@ -105,35 +97,34 @@
}
},
- update: function() {
+ update: function(first) {
if (this.tick == null) return;
if (this.data) CodeMirror.signal(this.data, "update");
if (!this.options.hint.async) {
- this.finishUpdate(this.options.hint(this.cm, this.options), myTick);
+ this.finishUpdate(this.options.hint(this.cm, this.options), first);
} else {
var myTick = ++this.tick, self = this;
this.options.hint(this.cm, function(data) {
- if (self.tick == myTick) self.finishUpdate(data);
+ if (self.tick == myTick) self.finishUpdate(data, first);
}, this.options);
}
},
- finishUpdate: function(data) {
+ finishUpdate: function(data, first) {
this.data = data;
- var picked = this.widget && this.widget.picked;
+
+ var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
if (this.widget) this.widget.close();
if (data && data.list.length) {
- if (picked && data.list.length == 1) this.pick(data, 0);
- else this.widget = new Widget(this, data);
+ if (picked && data.list.length == 1) {
+ this.pick(data, 0);
+ } else {
+ this.widget = new Widget(this, data);
+ CodeMirror.signal(data, "shown");
+ }
}
},
- showWidget: function(data) {
- this.data = data;
- this.widget = new Widget(this, data);
- CodeMirror.signal(data, "shown");
- },
-
buildOptions: function(options) {
var editor = this.cm.options.hintOptions;
var out = {};
diff --git a/public/vendor/codemirror/addon/hint/sql-hint.js b/public/vendor/codemirror/addon/hint/sql-hint.js
index cba27a0b..22124b58 100755
--- a/public/vendor/codemirror/addon/hint/sql-hint.js
+++ b/public/vendor/codemirror/addon/hint/sql-hint.js
@@ -112,9 +112,14 @@
string = nameParts.pop();
var table = nameParts.join(".");
+ var alias = false;
+ var aliasTable = table;
// Check if table is available. If not, find table by Alias
- if (!getItem(tables, table))
+ if (!getItem(tables, table)) {
+ var oldTable = table;
table = findTableByAlias(table, editor);
+ if (table !== oldTable) alias = true;
+ }
var columns = getItem(tables, table);
if (columns && columns.columns)
@@ -122,11 +127,13 @@
if (columns) {
addMatches(result, string, columns, function(w) {
+ var tableInsert = table;
+ if (alias == true) tableInsert = aliasTable;
if (typeof w == "string") {
- w = table + "." + w;
+ w = tableInsert + "." + w;
} else {
w = shallowClone(w);
- w.text = table + "." + w.text;
+ w.text = tableInsert + "." + w.text;
}
return useBacktick ? insertBackticks(w) : w;
});
@@ -205,6 +212,7 @@
CodeMirror.registerHelper("hint", "sql", function(editor, options) {
tables = (options && options.tables) || {};
var defaultTableName = options && options.defaultTable;
+ var disableKeywords = options && options.disableKeywords;
defaultTable = defaultTableName && getItem(tables, defaultTableName);
keywords = keywords || getKeywords(editor);
@@ -237,7 +245,8 @@
} else {
addMatches(result, search, tables, function(w) {return w;});
addMatches(result, search, defaultTable, function(w) {return w;});
- addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
+ if (!disableKeywords)
+ addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
}
return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};
diff --git a/public/vendor/codemirror/addon/lint/lint.js b/public/vendor/codemirror/addon/lint/lint.js
index c7e09396..3eea203c 100755
--- a/public/vendor/codemirror/addon/lint/lint.js
+++ b/public/vendor/codemirror/addon/lint/lint.js
@@ -63,11 +63,9 @@
this.onMouseOver = function(e) { onMouseOver(cm, e); };
}
- function parseOptions(cm, options) {
+ function parseOptions(_cm, options) {
if (options instanceof Function) return {getAnnotations: options};
if (!options || options === true) options = {};
- if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint");
- if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
return options;
}
@@ -120,10 +118,12 @@
function startLinting(cm) {
var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
- if (options.async || options.getAnnotations.async)
- options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
+ var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
+ if (!getAnnotations) return;
+ if (options.async || getAnnotations.async)
+ getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
else
- updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm));
+ updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
}
function updateLinting(cm, annotationsNotSorted) {
diff --git a/public/vendor/codemirror/addon/runmode/runmode.node.js b/public/vendor/codemirror/addon/runmode/runmode.node.js
index 8b8140b4..8f345a32 100755
--- a/public/vendor/codemirror/addon/runmode/runmode.node.js
+++ b/public/vendor/codemirror/addon/runmode/runmode.node.js
@@ -3,19 +3,37 @@
/* Just enough of CodeMirror to run runMode under node.js */
-// declare global: StringStream
+function splitLines(string){return string.split(/\r\n?|\n/);};
-function splitLines(string){ return string.split(/\r?\n|\r/); };
+// Counts the column offset in a string, taking tabs into account.
+// Used mostly to find indentation.
+var countColumn = function(string, end, tabSize, startIndex, startValue) {
+ if (end == null) {
+ end = string.search(/[^\s\u00a0]/);
+ if (end == -1) end = string.length;
+ }
+ for (var i = startIndex || 0, n = startValue || 0;;) {
+ var nextTab = string.indexOf("\t", i);
+ if (nextTab < 0 || nextTab >= end)
+ return n + (end - i);
+ n += nextTab - i;
+ n += tabSize - (n % tabSize);
+ i = nextTab + 1;
+ }
+};
-function StringStream(string) {
+function StringStream(string, tabSize) {
this.pos = this.start = 0;
this.string = string;
+ this.tabSize = tabSize || 8;
+ this.lastColumnPos = this.lastColumnValue = 0;
this.lineStart = 0;
-}
+};
+
StringStream.prototype = {
eol: function() {return this.pos >= this.string.length;},
- sol: function() {return this.pos == 0;},
- peek: function() {return this.string.charAt(this.pos) || null;},
+ sol: function() {return this.pos == this.lineStart;},
+ peek: function() {return this.string.charAt(this.pos) || undefined;},
next: function() {
if (this.pos < this.string.length)
return this.string.charAt(this.pos++);
@@ -42,8 +60,17 @@ StringStream.prototype = {
if (found > -1) {this.pos = found; return true;}
},
backUp: function(n) {this.pos -= n;},
- column: function() {return this.start - this.lineStart;},
- indentation: function() {return 0;},
+ column: function() {
+ if (this.lastColumnPos < this.start) {
+ this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
+ this.lastColumnPos = this.start;
+ }
+ return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);
+ },
+ indentation: function() {
+ return countColumn(this.string, null, this.tabSize) -
+ (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);
+ },
match: function(pattern, consume, caseInsensitive) {
if (typeof pattern == "string") {
var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
@@ -94,11 +121,42 @@ exports.resolveMode = function(spec) {
if (typeof spec == "string") return {name: spec};
else return spec || {name: "null"};
};
+
+function copyObj(obj, target, overwrite) {
+ if (!target) target = {};
+ for (var prop in obj)
+ if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
+ target[prop] = obj[prop];
+ return target;
+}
+
+// This can be used to attach properties to mode objects from
+// outside the actual mode definition.
+var modeExtensions = exports.modeExtensions = {};
+exports.extendMode = function(mode, properties) {
+ var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
+ copyObj(properties, exts);
+};
+
exports.getMode = function(options, spec) {
- spec = exports.resolveMode(spec);
+ var spec = exports.resolveMode(spec);
var mfactory = modes[spec.name];
- if (!mfactory) throw new Error("Unknown mode: " + spec);
- return mfactory(options, spec);
+ if (!mfactory) return exports.getMode(options, "text/plain");
+ var modeObj = mfactory(options, spec);
+ if (modeExtensions.hasOwnProperty(spec.name)) {
+ var exts = modeExtensions[spec.name];
+ for (var prop in exts) {
+ if (!exts.hasOwnProperty(prop)) continue;
+ if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop];
+ modeObj[prop] = exts[prop];
+ }
+ }
+ modeObj.name = spec.name;
+ if (spec.helperType) modeObj.helperType = spec.helperType;
+ if (spec.modeProps) for (var prop in spec.modeProps)
+ modeObj[prop] = spec.modeProps[prop];
+
+ return modeObj;
};
exports.registerHelper = exports.registerGlobalHelper = Math.min;
diff --git a/public/vendor/codemirror/addon/search/searchcursor.js b/public/vendor/codemirror/addon/search/searchcursor.js
index 97088bf1..b70242ee 100755
--- a/public/vendor/codemirror/addon/search/searchcursor.js
+++ b/public/vendor/codemirror/addon/search/searchcursor.js
@@ -177,9 +177,9 @@
});
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
- var ranges = [], next;
+ var ranges = [];
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
- while (next = cur.findNext()) {
+ while (cur.findNext()) {
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
ranges.push({anchor: cur.from(), head: cur.to()});
}
diff --git a/public/vendor/codemirror/addon/tern/tern.js b/public/vendor/codemirror/addon/tern/tern.js
index 99b8a646..dfb19b84 100755
--- a/public/vendor/codemirror/addon/tern/tern.js
+++ b/public/vendor/codemirror/addon/tern/tern.js
@@ -59,6 +59,7 @@
this.options = options || {};
var plugins = this.options.plugins || (this.options.plugins = {});
if (!plugins.doc_comment) plugins.doc_comment = true;
+ this.docs = Object.create(null);
if (this.options.useWorker) {
this.server = new WorkerServer(this);
} else {
@@ -69,7 +70,6 @@
plugins: plugins
});
}
- this.docs = Object.create(null);
this.trackChange = function(doc, change) { trackChange(self, doc, change); };
this.cachedArgHints = null;
@@ -124,6 +124,8 @@
var self = this;
var doc = findDoc(this, cm.getDoc());
var request = buildRequest(this, doc, query, pos);
+ var extraOptions = request.query && this.options.queryOptions && this.options.queryOptions[request.query.type]
+ if (extraOptions) for (var prop in extraOptions) request.query[prop] = extraOptions[prop];
this.server.request(request, function (error, data) {
if (!error && self.options.responseFilter)
@@ -442,7 +444,7 @@
function atInterestingExpression(cm) {
var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos);
- if (tok.start < pos.ch && (tok.type == "comment" || tok.type == "string")) return false;
+ if (tok.start < pos.ch && tok.type == "comment") return false;
return /[\w)\]]/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1));
}
diff --git a/public/vendor/codemirror/addon/tern/worker.js b/public/vendor/codemirror/addon/tern/worker.js
index 48277af8..887f906a 100755
--- a/public/vendor/codemirror/addon/tern/worker.js
+++ b/public/vendor/codemirror/addon/tern/worker.js
@@ -39,6 +39,6 @@ function startServer(defs, plugins, scripts) {
});
}
-var console = {
+this.console = {
log: function(v) { postMessage({type: "debug", message: v}); }
};
diff --git a/public/vendor/codemirror/codemirror.min.js b/public/vendor/codemirror/codemirror.min.js
index 020129ff..a67bd215 100644
--- a/public/vendor/codemirror/codemirror.min.js
+++ b/public/vendor/codemirror/codemirror.min.js
@@ -1,17 +1,17 @@
-!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?qi(r):{},qi(Go,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new va(i,r.mode)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!wo&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Si,keySeq:null,specialChars:null};var s=this;po&&11>ho&&setTimeout(function(){s.display.input.reset(!0)},20),Wt(this),Ui(),yt(this),this.curOp.forceUpdate=!0,Vr(this,i),r.autofocus&&!wo||s.hasFocus()?setTimeout(Ni(pn,this),20):hn(this);for(var u in Ko)Ko.hasOwnProperty(u)&&Ko[u](this,r[u],Xo);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<Jo.length;++f)Jo[f](this);xt(this),mo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=ji("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=ji("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ji("div",null,"CodeMirror-code"),r.selectionDiv=ji("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=ji("div",null,"CodeMirror-cursors"),r.measure=ji("div",null,"CodeMirror-measure"),r.lineMeasure=ji("div",null,"CodeMirror-measure"),r.lineSpace=ji("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=ji("div",[ji("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=ji("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=ji("div",null,null,"position: absolute; height: "+La+"px; width: 1px;"),r.gutters=ji("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=ji("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=ji("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),po&&8>ho&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),mo||co&&wo||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,De(e,100),e.state.modeGen++,e.curOp&&qt(e)}function i(e){e.options.lineWrapping?($a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ha(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),qt(e),ot(e),setTimeout(function(){y(e)},100)}function o(e){var t=gt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/vt(e.display)-3);return function(i){if(yr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&Zr(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ot(e)}function s(e){c(e),qt(e),setTimeout(function(){_(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Ri(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(ji("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=fr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=dr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function d(e){var t=e.display,n=e.doc;t.maxLine=Gr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ai(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+He(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Be(e)+t.barHeight+gt(e.display),nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=ji("div",[ji("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=ji("div",[ji("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),wa(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),wa(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,po&&8>ho&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ha(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),wa(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?en(t,e):Jt(t,e)},t),t.display.scrollbars.addClass&&$a(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&E(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Fe(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Qr(t,r),a=Qr(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=Qr(t,Jr(Gr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Qr(t,Jr(Gr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=w(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(ji("div",[ji("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var r=e.display;this.viewport=t,this.visible=x(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ue(e),this.force=n,this.dims=q(e),this.events=[]}function M(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Be(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Be(e)+"px",t.scrollbarsClipped=!0)}function L(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return It(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Rt(e))return!1;k(e)&&(It(e),t.dims=q(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),zo&&(o=gr(e.doc,o),a=vr(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;jt(e,o,a),n.viewOffset=Jr(Gr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Rt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Fi();return s>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Fi()!=c&&c.offsetHeight&&c.focus(),Ri(n.cursorDiv),Ri(n.selectionDiv),n.gutters.style.height=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,De(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.force,r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Ue(e))n=!0;else if(n=!1,r&&null!=r.top&&(r={top:Math.min(e.doc.height+He(e.display)-Ve(e),r.top)}),t.visible=x(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!L(e,t))break;E(e);var o=h(e);Oe(e),z(e,o),y(e,o)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){E(e),T(e,n);var r=h(e);Oe(e),z(e,r),y(e,r),n.finish()}}function z(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+Be(e),t.clientHeight)+"px"}function E(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(po&&8>ho){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=gt(t)),(s>.001||-.001>s)&&(Zr(o.line,i),O(o.line),o.rest))for(var c=0;c<o.rest.length;c++)O(o.rest[c])}}}function O(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function q(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,n){function r(t){var n=t.nextSibling;return mo&&Co&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var d=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Ai(f.changes,"gutter")>-1&&(d=!1),I(e,f,c,n)),d&&(Ri(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(w(e.options,c)))),l=f.node.nextSibling}else{var p=B(e,f,c,n);a.insertBefore(p,l)}c+=f.size}for(;l;)l=r(l)}function I(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?R(e,t):"gutter"==o?F(e,t,n,r):"class"==o?W(t):"widget"==o&&H(e,t,r)}t.changes=null}function P(e){return e.node==e.text&&(e.node=ji("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),po&&8>ho&&(e.node.style.zIndex=2)),e.node}function D(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=P(e);e.background=n.insertBefore(ji("div",null,t),n.firstChild)}}function j(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Nr(e,t)}function R(e,t){var n=t.text.className,r=j(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,W(t)):n&&(t.text.className=n)}function W(e){D(e),e.line.wrapClass?P(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function F(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=P(t),a=t.gutter=ji("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(ji("div",w(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=i.hasOwnProperty(s)&&i[s];c&&a.appendChild(ji("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function H(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}U(e,t,n)}function B(e,t,n,r){var i=j(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),W(t),F(e,t,n,r),U(e,t,r),t.node}function U(e,t,n){if(V(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)V(e,t.rest[r],t,n,!1)}function V(e,t,n,r,i){if(t.widgets)for(var o=P(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=ji("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),G(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),bi(s,"redraw")}}function G(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function K(e){return Eo(e.line,e.ch)}function X(e,t){return Oo(e,t)<0?t:e}function Z(e,t){return Oo(e,t)<0?e:t}function Y(e){e.state.focused||(e.display.input.focus(),pn(e))}function Q(e){return e.options.readOnly||e.doc.cantEdit}function J(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=Va(t),l=null;e.state.pasteIncoming&&r.ranges.length>1&&(qo&&qo.join("\n")==t?l=r.ranges.length%qo.length==0&&zi(qo,Va):a.length==r.ranges.length&&(l=zi(a,function(e){return[e]})));for(var s=r.ranges.length-1;s>=0;s--){var c=r.ranges[s],u=c.from(),f=c.to();c.empty()&&(n&&n>0?u=Eo(u.line,u.ch-n):e.state.overwrite&&!e.state.pasteIncoming&&(f=Eo(f.line,Math.min(Gr(o,f.line).text.length,f.ch+Ti(a).length))));var d=e.curOp.updateInput,p={from:u,to:f,text:l?l[s%l.length]:a,origin:i||(e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input")};if(kn(e.doc,p),bi(e,"inputRead",e,p),t&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&c.head.ch<100&&(!s||r.ranges[s-1].head.line!=c.head.line)){var h=e.getModeAt(c.head),m=Vo(p),g=!1;if(h.electricChars){for(var v=0;v<h.electricChars.length;v++)if(t.indexOf(h.electricChars.charAt(v))>-1){g=Pn(e,m.line,"smart");break}}else h.electricInput&&h.electricInput.test(Gr(o,m.line).text.slice(0,m.ch))&&(g=Pn(e,m.line,"smart"));g&&bi(e,"electricInput",e,m.line)}}Nn(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function ee(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:Eo(i,0),head:Eo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Si,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function re(){var e=ji("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=ji("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return mo?e.style.width="1000px":e.setAttribute("wrap","off"),ko&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Si,this.gracePeriod=!1}function oe(e,t){var n=Ye(e,t.line);if(!n||n.hidden)return null;var r=Gr(e.doc,t.line),i=Ke(n,r,t.line),o=ei(r),a="left";if(o){var l=oo(o,t.ch);a=l%2?"right":"left"}var s=et(i.map,t.ch,"left");return s.offset="right"==s.collapse?s.end:s.start,s}function ae(e,t){return t&&(e.bad=!0),e}function le(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ae(e.clipPos(Eo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return se(o,t,n)}}function se(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=Yr(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Eo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Ra(i,t))return ae(Eo(Yr(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Ti(e.rest):e.line;return ae(Eo(Yr(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return ae(f,o);for(var d=s.nextSibling,p=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return ae(Eo(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=s.previousSibling,p=n;h;h=h.previousSibling){if(f=r(h,h.firstChild,-1))return ae(Eo(f.line,f.ch+p),o);p+=d.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var c,u=t.getAttribute("cm-marker");if(u){var f=e.findMarks(Eo(r,0),Eo(i+1,0),o(+u));return void(f.length&&(c=f[0].find())&&(l+=Kr(e.doc,c.from,c.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+="\n",s=!1),l+=p}}for(var l="",s=!1;a(t),t!=n;)t=t.nextSibling;return l}function ue(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function de(e,t){var n=e[t];e.sort(function(e,t){return Oo(e.from(),t.from())}),t=Ai(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(Oo(o.to(),i.from())>=0){var a=Z(o.from(),i.from()),l=X(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new ue(e,t)}function pe(e,t){return new ue([new fe(e,t||e)],0)}function he(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return Eo(e.first,0);var n=e.first+e.size-1;return t.line>n?Eo(n,Gr(e,n).text.length):ge(t,Gr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Eo(e.line,t):0>n?Eo(e.line,0):e}function ve(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=me(e,t[r]);return n}function be(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=Oo(n,i)<0;o!=Oo(r,i)<0?(i=n,n=r):o!=Oo(n,r)<0&&(n=r)}return new fe(i,n)}return new fe(r||n,n)}function xe(e,t,n,r){Me(e,new ue([be(e,e.sel.primary(),t,n)],0),r)}function _e(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=be(e,e.sel.ranges[i],t[i],null);var o=de(r,e.sel.primIndex);Me(e,o,n)}function ke(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Me(e,de(i,e.sel.primIndex),r)}function we(e,t,n,r){Me(e,pe(t,n),r)}function Ce(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fe(me(e,t[n].anchor),me(e,t[n].head))}};return Sa(e,"beforeSelectionChange",e,n),e.cm&&Sa(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?de(n.ranges,n.ranges.length-1):t}function Se(e,t,n){var r=e.history.done,i=Ti(r);i&&i.ranges?(r[r.length-1]=t,Le(e,t,n)):Me(e,t,n)}function Me(e,t,n){Le(e,t,n),li(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function Le(e,t,n){(wi(e,"beforeSelectionChange")||e.cm&&wi(e.cm,"beforeSelectionChange"))&&(t=Ce(e,t));var r=n&&n.bias||(Oo(t.primary().head,e.sel.primary().head)<0?-1:1);Te(e,ze(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Nn(e.cm)}function Te(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ki(e.cm)),bi(e,"cursorActivity",e))}function Ae(e){Te(e,ze(e,e.sel,null,!1),Aa)}function ze(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=Ee(e,a.anchor,n,r),s=Ee(e,a.head,n,r);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(l,s))}return i?de(i,t.primIndex):t}function Ee(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var l=Gr(e,o.line);if(l.markedSpans)for(var s=0;s<l.markedSpans.length;++s){var c=l.markedSpans[s],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from<o.ch))&&(null==c.to||(u.inclusiveRight?c.to>=o.ch:c.to>o.ch))){if(r&&(Sa(u,"beforeCursorEnter"),u.explicitlyCleared)){if(l.markedSpans){--s;continue}break}if(!u.atomic)continue;var f=u.find(0>a?-1:1);if(0==Oo(f,o)&&(f.ch+=a,f.ch<0?f=f.line>e.first?me(e,Eo(f.line-1)):null:f.ch>l.text.length&&(f=f.line<e.first+e.size-1?Eo(f.line+1,0):null),!f)){if(i)return r?(e.cantEdit=!0,Eo(e.first,0)):Ee(e,t,n,!0);i=!0,f=t,a=-a}o=f;continue e}}return o}}function Oe(e){e.display.input.showSelection(e.display.input.prepareSelection())}function qe(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&Ne(e,l,i),s||Ie(e,l,o)}return r}function Ne(e,t,n){var r=ft(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(ji("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(ji("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}$(".other-cursor").each(function(t,n){var r=parseInt($(n).attr("data-line")),i=parseInt($(n).attr("data-ch")),o=parseFloat($(n).attr("data-offset-left")),a=parseFloat($(n).attr("data-offset-top")),l=e.charCoords({line:r,ch:i},"windows");$(n)[0].style.left=l.left+o+"px",$(n)[0].style.top=l.top+a+"px"})}function Ie(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(ji("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ut(e,Eo(t,n),"div",f,r)}var l,s,f=Gr(a,t),d=f.text.length;return Zi(ei(f),n||0,null==i?d:i,function(e,t,a){var f,p,h,m=o(e,"left");if(e==t)f=m,p=h=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}p=m.left,h=f.right}null==n&&0==e&&(p=c),f.top-m.top>3&&(r(p,m.top,null,m.bottom),p=c,m.bottom<f.top&&r(p,m.bottom,null,f.top)),null==i&&t==d&&(h=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>p&&(p=c),r(p,f.top,h-p,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=$e(e.display),c=s.left,u=Math.max(o.sizerWidth,Ue(e)-o.sizer.offsetLeft)-s.right,f=t.from(),d=t.to();if(f.line==d.line)i(f.line,f.ch,d.ch);else{var p=Gr(a,f.line),h=Gr(a,d.line),m=hr(p)==hr(h),g=i(f.line,f.ch,m?p.text.length+1:null).end,v=i(d.line,m?0:null,d.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function Pe(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function De(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Ni(je,e))}function je(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ta(t.mode,We(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=zr(e,o,r,!0);o.styles=l.styles;var s=o.styleClasses,c=l.classes;c?o.styleClasses=c:s&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),f=0;!u&&f<a.length;++f)u=a[f]!=o.styles[f];u&&i.push(t.frontier),o.stateAfter=ta(t.mode,r)}else Or(e,o.text,r),o.stateAfter=t.frontier%5==0?ta(t.mode,r):null;return++t.frontier,+new Date>n?(De(e,e.options.workDelay),!0):void 0}),i.length&&Lt(e,function(){for(var t=0;t<i.length;t++)Nt(e,i[t],"text")})}}function Re(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Gr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Oa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function We(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=Re(e,t,n),a=o>r.first&&Gr(r,o-1).stateAfter;return a=a?ta(r.mode,a):na(r.mode),r.iter(o,t,function(n){Or(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?ta(r.mode,a):null,++o}),n&&(r.frontier=o),a}function Fe(e){return e.lineSpace.offsetTop}function He(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $e(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Wi(e.measure,ji("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Be(e){return La-e.display.nativeBarWidth}function Ue(e){return e.display.scroller.clientWidth-Be(e)-e.display.barWidth}function Ve(e){return e.display.scroller.clientHeight-Be(e)-e.display.barHeight}function Ge(e,t,n){var r=e.options.lineWrapping,i=r&&Ue(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ke(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(Yr(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Xe(e,t){t=hr(t);var n=Yr(t),r=e.display.externalMeasured=new Et(e.doc,t,n);r.lineN=n;var i=r.built=Nr(e,r);return r.text=i.pre,Wi(e.display.lineMeasure,i.pre),r}function Ze(e,t,n,r){return Je(e,Qe(e,t),n,r)}function Ye(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Qe(e,t){var n=Yr(t),r=Ye(e,n);r&&!r.text?r=null:r&&r.changes&&I(e,r,n,q(e)),r||(r=Xe(e,t));var i=Ke(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Je(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ge(e,t.view,t.rect),t.hasHeights=!0),o=tt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function et(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function tt(e,t,n,r){var i,o=et(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&Di(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&Di(t.line.text.charAt(o.coverStart+s));)++s;if(po&&9>ho&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(po&&e.options.lineWrapping){var f=Ia(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:Do}else i=Ia(a,l,s).getBoundingClientRect()||Do;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}po&&11>ho&&(i=nt(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect();
+!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Ii(r):{},Ii(Xo,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new ba(i,r.mode)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!So&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Li,keySeq:null,specialChars:null};var s=this;mo&&11>go&&setTimeout(function(){s.display.input.reset(!0)},20),Ht(this),Gi(),xt(this),this.curOp.forceUpdate=!0,Kr(this,i),r.autofocus&&!So||s.hasFocus()?setTimeout(Pi(mn,this),20):gn(this);for(var u in Zo)Zo.hasOwnProperty(u)&&Zo[u](this,r[u],Yo);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<ta.length;++f)ta[f](this);kt(this),vo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=Ri("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=Ri("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=Ri("div",null,"CodeMirror-code"),r.selectionDiv=Ri("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=Ri("div",null,"CodeMirror-cursors"),r.measure=Ri("div",null,"CodeMirror-measure"),r.lineMeasure=Ri("div",null,"CodeMirror-measure"),r.lineSpace=Ri("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=Ri("div",[Ri("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=Ri("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=Ri("div",null,null,"position: absolute; height: "+Aa+"px; width: 1px;"),r.gutters=Ri("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=Ri("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=Ri("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),mo&&8>go&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),vo||fo&&So||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Fe(e,100),e.state.modeGen++,e.curOp&&It(e)}function i(e){e.options.lineWrapping?(Ua(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ba(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),It(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(xr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&Qr(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function s(e){c(e),It(e),setTimeout(function(){_(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Wi(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(Ri("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=pr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=hr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function d(e){var t=e.display,n=e.doc;t.maxLine=Xr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ei(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Be(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ve(e)+t.barHeight+yt(e.display),nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=Ri("div",[Ri("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ri("div",[Ri("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Sa(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Sa(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,mo&&8>go&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ba(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Sa(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?nn(t,e):tn(t,e)},t),t.display.scrollbars.addClass&&Ua(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&E(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$e(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ei(t,r),a=ei(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ei(t,ti(Xr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ei(t,ti(Xr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=w(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Ri("div",[Ri("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var r=e.display;this.viewport=t,this.visible=x(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ge(e),this.force=n,this.dims=O(e),this.events=[]}function M(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ve(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ve(e)+"px",t.scrollbarsClipped=!0)}function L(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Dt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Wt(e))return!1;k(e)&&(Dt(e),t.dims=O(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),qo&&(o=yr(e.doc,o),a=br(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Rt(e,o,a),n.viewOffset=ti(Xr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Wt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=$i();return s>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&$i()!=c&&c.offsetHeight&&c.focus(),Wi(n.cursorDiv),Wi(n.selectionDiv),n.gutters.style.height=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Fe(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Be(e.display)-Ke(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){E(e);var i=h(e);Ne(e),z(e,i),y(e,i)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){E(e),T(e,n);var r=h(e);Ne(e),z(e,r),y(e,r),n.finish()}}function z(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+Ve(e),t.clientHeight)+"px"}function E(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(mo&&8>go){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(Qr(o.line,i),q(o.line),o.rest))for(var c=0;c<o.rest.length;c++)q(o.rest[c])}}}function q(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function O(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,n){function r(t){var n=t.nextSibling;return vo&&Mo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var d=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Ei(f.changes,"gutter")>-1&&(d=!1),I(e,f,c,n)),d&&(Wi(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(w(e.options,c)))),l=f.node.nextSibling}else{var p=B(e,f,c,n);a.insertBefore(p,l)}c+=f.size}for(;l;)l=r(l)}function I(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?F(e,t):"gutter"==o?W(e,t,n,r):"class"==o?R(t):"widget"==o&&H(e,t,r)}t.changes=null}function P(e){return e.node==e.text&&(e.node=Ri("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),mo&&8>go&&(e.node.style.zIndex=2)),e.node}function D(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=P(e);e.background=n.insertBefore(Ri("div",null,t),n.firstChild)}}function j(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Pr(e,t)}function F(e,t){var n=t.text.className,r=j(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,R(t)):n&&(t.text.className=n)}function R(e){D(e),e.line.wrapClass?P(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function W(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=P(t),a=t.gutter=Ri("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Ri("div",w(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=i.hasOwnProperty(s)&&i[s];c&&a.appendChild(Ri("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function H(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}U(e,t,n)}function B(e,t,n,r){var i=j(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),R(t),W(e,t,n,r),U(e,t,r),t.node}function U(e,t,n){if(V(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)V(e,t.rest[r],t,n,!1)}function V(e,t,n,r,i){if(t.widgets)for(var o=P(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=Ri("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),G(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),_i(s,"redraw")}}function G(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function K(e){return Oo(e.line,e.ch)}function X(e,t){return No(e,t)<0?t:e}function Z(e,t){return No(e,t)<0?e:t}function Y(e){e.state.focused||(e.display.input.focus(),mn(e))}function Q(e){return e.options.readOnly||e.doc.cantEdit}function J(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=Ka(t),s=null;a&&r.ranges.length>1&&(Io&&Io.join("\n")==t?s=r.ranges.length%Io.length==0&&qi(Io,Ka):l.length==r.ranges.length&&(s=qi(l,function(e){return[e]})));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],f=u.from(),d=u.to();u.empty()&&(n&&n>0?f=Oo(f.line,f.ch-n):e.state.overwrite&&!a&&(d=Oo(d.line,Math.min(Xr(o,d.line).text.length,d.ch+zi(l).length))));var p=e.curOp.updateInput,h={from:f,to:d,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Cn(e.doc,h),_i(e,"inputRead",e,h)}t&&!a&&te(e,t),Pn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function ee(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),At(t,function(){J(t,n,0,null,"paste")}),!0):void 0}function te(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=jn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=jn(e,i.head.line,"smart"));a&&_i(e,"electricInput",e,i.head.line)}}}function ne(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:Oo(i,0),head:Oo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function re(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ie(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Li,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function oe(){var e=Ri("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Ri("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return vo?e.style.width="1000px":e.setAttribute("wrap","off"),Co&&(e.style.border="1px solid black"),re(e),t}function ae(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Li,this.gracePeriod=!1}function le(e,t){var n=Je(e,t.line);if(!n||n.hidden)return null;var r=Xr(e.doc,t.line),i=Ze(n,r,t.line),o=ni(r),a="left";if(o){var l=lo(o,t.ch);a=l%2?"right":"left"}var s=nt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function se(e,t){return t&&(e.bad=!0),e}function ce(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return se(e.clipPos(Oo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ue(o,t,n)}}function ue(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=Jr(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Oo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Wa(i,t))return se(Oo(Jr(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?zi(e.rest):e.line;return se(Oo(Jr(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return se(f,o);for(var d=s.nextSibling,p=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return se(Oo(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=s.previousSibling,p=n;h;h=h.previousSibling){if(f=r(h,h.firstChild,-1))return se(Oo(f.line,f.ch+p),o);p+=d.textContent.length}}function fe(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var c,u=t.getAttribute("cm-marker");if(u){var f=e.findMarks(Oo(r,0),Oo(i+1,0),o(+u));return void(f.length&&(c=f[0].find())&&(l+=Zr(e.doc,c.from,c.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+="\n",s=!1),l+=p}}for(var l="",s=!1;a(t),t!=n;)t=t.nextSibling;return l}function de(e,t){this.ranges=e,this.primIndex=t}function pe(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return No(e.from(),t.from())}),t=Ei(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(No(o.to(),i.from())>=0){var a=Z(o.from(),i.from()),l=X(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new pe(s?l:a,s?a:l))}}return new de(e,t)}function me(e,t){return new de([new pe(e,t||e)],0)}function ge(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ve(e,t){if(t.line<e.first)return Oo(e.first,0);var n=e.first+e.size-1;return t.line>n?Oo(n,Xr(e,n).text.length):ye(t,Xr(e,t.line).text.length)}function ye(e,t){var n=e.ch;return null==n||n>t?Oo(e.line,t):0>n?Oo(e.line,0):e}function be(e,t){return t>=e.first&&t<e.first+e.size}function xe(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ve(e,t[r]);return n}function _e(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=No(n,i)<0;o!=No(r,i)<0?(i=n,n=r):o!=No(n,r)<0&&(n=r)}return new pe(i,n)}return new pe(r||n,n)}function ke(e,t,n,r){Te(e,new de([_e(e,e.sel.primary(),t,n)],0),r)}function we(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=_e(e,e.sel.ranges[i],t[i],null);var o=he(r,e.sel.primIndex);Te(e,o,n)}function Ce(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Te(e,he(i,e.sel.primIndex),r)}function Se(e,t,n,r){Te(e,me(t,n),r)}function Me(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new pe(ve(e,t[n].anchor),ve(e,t[n].head))}};return La(e,"beforeSelectionChange",e,n),e.cm&&La(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?he(n.ranges,n.ranges.length-1):t}function Le(e,t,n){var r=e.history.done,i=zi(r);i&&i.ranges?(r[r.length-1]=t,Ae(e,t,n)):Te(e,t,n)}function Te(e,t,n){Ae(e,t,n),ci(e,e.sel,e.cm?e.cm.curOp.id:0/0,n)}function Ae(e,t,n){(Si(e,"beforeSelectionChange")||e.cm&&Si(e.cm,"beforeSelectionChange"))&&(t=Me(e,t));var r=n&&n.bias||(No(t.primary().head,e.sel.primary().head)<0?-1:1);ze(e,qe(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Pn(e.cm)}function ze(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ci(e.cm)),_i(e,"cursorActivity",e))}function Ee(e){ze(e,qe(e,e.sel,null,!1),Ea)}function qe(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=Oe(e,a.anchor,n,r),s=Oe(e,a.head,n,r);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new pe(l,s))}return i?he(i,t.primIndex):t}function Oe(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var l=Xr(e,o.line);if(l.markedSpans)for(var s=0;s<l.markedSpans.length;++s){var c=l.markedSpans[s],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from<o.ch))&&(null==c.to||(u.inclusiveRight?c.to>=o.ch:c.to>o.ch))){if(r&&(La(u,"beforeCursorEnter"),u.explicitlyCleared)){if(l.markedSpans){--s;continue}break}if(!u.atomic)continue;var f=u.find(0>a?-1:1);if(0==No(f,o)&&(f.ch+=a,f.ch<0?f=f.line>e.first?ve(e,Oo(f.line-1)):null:f.ch>l.text.length&&(f=f.line<e.first+e.size-1?Oo(f.line+1,0):null),!f)){if(i)return r?(e.cantEdit=!0,Oo(e.first,0)):Oe(e,t,n,!0);i=!0,f=t,a=-a}o=f;continue e}}return o}}function Ne(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ie(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&Pe(e,l,i),s||De(e,l,o)}return r}function Pe(e,t,n){var r=pt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Ri("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(Ri("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}$(".other-cursor").each(function(t,n){var r=parseInt($(n).attr("data-line")),i=parseInt($(n).attr("data-ch")),o=parseFloat($(n).attr("data-offset-left")),a=parseFloat($(n).attr("data-offset-top")),l=e.charCoords({line:r,ch:i},"windows");$(n)[0].style.left=l.left+o+"px",$(n)[0].style.top=l.top+a+"px"})}function De(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(Ri("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return dt(e,Oo(t,n),"div",f,r)}var l,s,f=Xr(a,t),d=f.text.length;return Qi(ni(f),n||0,null==i?d:i,function(e,t,a){var f,p,h,m=o(e,"left");if(e==t)f=m,p=h=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}p=m.left,h=f.right}null==n&&0==e&&(p=c),f.top-m.top>3&&(r(p,m.top,null,m.bottom),p=c,m.bottom<f.top&&r(p,m.bottom,null,f.top)),null==i&&t==d&&(h=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>p&&(p=c),r(p,f.top,h-p,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ue(e.display),c=s.left,u=Math.max(o.sizerWidth,Ge(e)-o.sizer.offsetLeft)-s.right,f=t.from(),d=t.to();if(f.line==d.line)i(f.line,f.ch,d.ch);else{var p=Xr(a,f.line),h=Xr(a,d.line),m=gr(p)==gr(h),g=i(f.line,f.ch,m?p.text.length+1:null).end,v=i(d.line,m?0:null,d.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function je(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Fe(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Pi(Re,e))}function Re(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ra(t.mode,He(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=qr(e,o,r,!0);o.styles=l.styles;var s=o.styleClasses,c=l.classes;c?o.styleClasses=c:s&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),f=0;!u&&f<a.length;++f)u=a[f]!=o.styles[f];u&&i.push(t.frontier),o.stateAfter=ra(t.mode,r)}else Nr(e,o.text,r),o.stateAfter=t.frontier%5==0?ra(t.mode,r):null;return++t.frontier,+new Date>n?(Fe(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;t<i.length;t++)Pt(e,i[t],"text")})}}function We(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Xr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Na(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function He(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=We(e,t,n),a=o>r.first&&Xr(r,o-1).stateAfter;return a=a?ra(r.mode,a):ia(r.mode),r.iter(o,t,function(n){Nr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?ra(r.mode,a):null,++o}),n&&(r.frontier=o),a}function $e(e){return e.lineSpace.offsetTop}function Be(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ue(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Hi(e.measure,Ri("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ve(e){return Aa-e.display.nativeBarWidth}function Ge(e){return e.display.scroller.clientWidth-Ve(e)-e.display.barWidth}function Ke(e){return e.display.scroller.clientHeight-Ve(e)-e.display.barHeight}function Xe(e,t,n){var r=e.options.lineWrapping,i=r&&Ge(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ze(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(Jr(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ye(e,t){t=gr(t);var n=Jr(t),r=e.display.externalMeasured=new Ot(e.doc,t,n);r.lineN=n;var i=r.built=Pr(e,r);return r.text=i.pre,Hi(e.display.lineMeasure,i.pre),r}function Qe(e,t,n,r){return tt(e,et(e,t),n,r)}function Je(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[jt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=Jr(t),r=Je(e,n);r&&!r.text?r=null:r&&r.changes&&I(e,r,n,O(e)),r||(r=Ye(e,t));var i=Ze(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xe(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function nt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function rt(e,t,n,r){var i,o=nt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&Fi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&Fi(t.line.text.charAt(o.coverStart+s));)++s;if(mo&&9>go&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(mo&&e.options.lineWrapping){var f=Da(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:Fo}else i=Da(a,l,s).getBoundingClientRect()||Fo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right";
-}if(po&&9>ho&&!l&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+vt(e.display),top:d.top,bottom:d.bottom}:Do}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=p,b.rbottom=h),b}function nt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Xi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function rt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function it(e){e.display.externalMeasure=null,Ri(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)rt(e.display.view[t])}function ot(e){it(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function at(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function lt(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function st(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=_r(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Jr(t);if("local"==r?a+=Fe(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:lt());var s=l.left+("window"==r?0:at());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ct(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=at(),i-=lt();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ut(e,t,n,r,i){return r||(r=Gr(e.doc,t.line)),st(e,r,Ze(e,r,t.ch,i),n)}function ft(e,t,n,r,i,o){function a(t,a){var l=Je(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,st(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==Yi(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=Qi(n)-(n.level%2?0:1),r=!0):e==Qi(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=Yi(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Gr(e.doc,t.line),i||(i=Qe(e,r));var s=ei(r),c=t.ch;if(!s)return a(c);var u=oo(s,c),f=l(c,u);return null!=Ya&&(f.other=l(c,Ya)),f}function dt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=vt(e.display)*t.ch);var r=Gr(e.doc,t.line),i=Jr(r)+Fe(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function pt(e,t,n,r){var i=Eo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function ht(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return pt(r.first,0,!0,-1);var i=Qr(r,n),o=r.first+r.size-1;if(i>o)return pt(r.first+r.size-1,Gr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Gr(r,i);;){var l=mt(e,a,i,t,n),s=dr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=Yr(a=c.to.line)}}function mt(e,t,n,r,i){function o(r){var i=ft(e,Eo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-Jr(t),l=!1,s=2*e.display.wrapper.clientWidth,c=Qe(e,t),u=ei(t),f=t.text.length,d=Ji(t),p=eo(t),h=o(d),m=l,g=o(p),v=l;if(r>g)return pt(n,p,v,1);for(;;){if(u?p==d||p==lo(t,d,1):1>=p-d){for(var y=h>r||g-r>=r-h?d:p,b=r-(y==d?h:g);Di(t.text.charAt(y));)++y;var x=pt(n,y,y==d?m:v,-1>b?-1:b>1?1:0);return x}var _=Math.ceil(f/2),k=d+_;if(u){k=d;for(var w=0;_>w;++w)k=lo(t,k,1)}var C=o(k);C>r?(p=k,g=C,(v=l)&&(g+=1e3),f=_):(d=k,h=C,m=l,f-=_)}}function gt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==No){No=ji("pre");for(var t=0;49>t;++t)No.appendChild(document.createTextNode("x")),No.appendChild(ji("br"));No.appendChild(document.createTextNode("x"))}Wi(e.measure,No);var n=No.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ri(e.measure),n||1}function vt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ji("span","xxxxxxxxxx"),n=ji("pre",[t]);Wi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function yt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ro},jo?jo.ops.push(e.curOp):e.curOp.ownsGroup=jo={ops:[e.curOp],delayedCallbacks:[]}}function bt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function xt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{bt(n)}finally{jo=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;_t(n)}}function _t(e){for(var t=e.ops,n=0;n<t.length;n++)kt(t[n]);for(var n=0;n<t.length;n++)wt(t[n]);for(var n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)St(t[n]);for(var n=0;n<t.length;n++)Mt(t[n])}function kt(e){var t=e.cm,n=t.display;M(t),e.updateMaxLine&&d(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function wt(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Ct(e){var t=e.cm,n=t.display;e.updatedDisplay&&E(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ze(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Be(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ue(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function St(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&en(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&z(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Pe(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),e.focus&&e.focus==Fi()&&Y(e.cm)}function Mt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&T(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ue(t),e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,_(t)),e.scrollToPos){var i=zn(t,me(r,e.scrollToPos.from),me(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&An(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Sa(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Sa(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Sa(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Lt(e,t){if(e.curOp)return t();yt(e);try{return t()}finally{xt(e)}}function Tt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);yt(e);try{return t.apply(e,arguments)}finally{xt(e)}}}function At(e){return function(){if(this.curOp)return e.apply(this,arguments);yt(this);try{return e.apply(this,arguments)}finally{xt(this)}}}function zt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);yt(t);try{return e.apply(this,arguments)}finally{xt(t)}}}function Et(e,t,n){this.line=t,this.rest=mr(t),this.size=this.rest?Yr(Ti(this.rest))-n+1:1,this.node=this.text=null,this.hidden=yr(e,t)}function Ot(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Et(e.doc,Gr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function qt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)zo&&gr(e.doc,t)<i.viewTo&&It(e);else if(n<=i.viewFrom)zo&&vr(e.doc,n+r)>i.viewFrom?It(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)It(e);else if(t<=i.viewFrom){var o=Dt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):It(e)}else if(n>=i.viewTo){var o=Dt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):It(e)}else{var a=Dt(e,t,t,-1),l=Dt(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Ot(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):It(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Nt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Pt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Ai(a,n)&&a.push(n)}}}function It(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function Dt(e,t,n,r){var i,o=Pt(e,t),a=e.display.view;if(!zo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;gr(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function jt(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Ot(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Ot(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Pt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Ot(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Pt(e,n)))),r.viewTo=n}function Rt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Wt(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;wa(i.scroller,"mousedown",Tt(e,Ut)),po&&11>ho?wa(i.scroller,"dblclick",Tt(e,function(t){if(!_i(e,t)){var n=Bt(e,t);if(n&&!Zt(e,t)&&!$t(e.display,t)){xa(t);var r=e.findWordAt(n);xe(e.doc,r.anchor,r.head)}}})):wa(i.scroller,"dblclick",function(t){_i(e,t)||xa(t)}),To||wa(i.scroller,"contextmenu",function(t){mn(e,t)});var o,a={end:0};wa(i.scroller,"touchstart",function(e){if(!n(e)){clearTimeout(o);var t=+new Date;i.activeTouch={start:t,moved:!1,prev:t-a.end<=300?a:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),wa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),wa(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!$t(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(Eo(l.line,0),me(e.doc,Eo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),xa(n)}t()}),wa(i.scroller,"touchcancel",t),wa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Jt(e,i.scroller.scrollTop),en(e,i.scroller.scrollLeft,!0),Sa(e,"scroll",e))}),wa(i.scroller,"mousewheel",function(t){tn(e,t)}),wa(i.scroller,"DOMMouseScroll",function(t){tn(e,t)}),wa(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={simple:function(t){_i(e,t)||ka(t)},start:function(t){Qt(e,t)},drop:Tt(e,Yt)};var l=i.input.getField();wa(l,"keyup",function(t){un.call(e,t)}),wa(l,"keydown",Tt(e,sn)),wa(l,"keypress",Tt(e,fn)),wa(l,"focus",Ni(pn,e)),wa(l,"blur",Ni(hn,e))}function Ft(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?wa:Ca;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.simple),a(t.display.scroller,"dragover",o.simple),a(t.display.scroller,"drop",o.drop)}}function Ht(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function $t(e,t){for(var n=vi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Bt(e,t,n,r){var i=e.display;if(!n&&"true"==vi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=ht(e,o,a);if(r&&1==c.xRel&&(s=Gr(e.doc,c.line).text).length==c.ch){var u=Oa(s,s.length,e.options.tabSize)-s.length;c=Eo(c.line,Math.max(0,Math.round((o-$e(e.display).left)/vt(e.display))-u))}return c}function Ut(e){var t=this,n=t.display;if(!(n.activeTouch&&n.input.supportsTouch()||_i(t,e))){if(n.shift=e.shiftKey,$t(n,e))return void(mo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Zt(t,e)){var r=Bt(t,e);switch(window.focus(),yi(e)){case 1:r?Vt(t,e,r):vi(e)==n.scroller&&xa(e);break;case 2:mo&&(t.state.lastMiddleDown=+new Date),r&&xe(t.doc,r),setTimeout(function(){n.input.focus()},20),xa(e);break;case 3:To?mn(t,e):dn(t)}}}}function Vt(e,t,n){po?setTimeout(Ni(Y,e),0):e.curOp.focus=Fi();var r,i=+new Date;Po&&Po.time>i-400&&0==Oo(Po.pos,n)?r="triple":Io&&Io.time>i-400&&0==Oo(Io.pos,n)?(r="double",Po={time:i,pos:n}):(r="single",Io={time:i,pos:n});var o,a=e.doc.sel,l=Co?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ua&&!Q(e)&&"single"==r&&(o=a.contains(n))>-1&&!a.ranges[o].empty()?Gt(e,t,n,l):Kt(e,t,n,r,l)}function Gt(e,t,n,r){var i=e.display,o=+new Date,a=Tt(e,function(l){mo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ca(document,"mouseup",a),Ca(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(xa(l),!r&&+new Date-200<o&&xe(e.doc,n),mo||po&&9==ho?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});mo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),wa(document,"mouseup",a),wa(i.scroller,"drop",a)}function Kt(e,t,n,r,i){function o(t){if(0!=Oo(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Oa(Gr(c,n.line).text,n.ch,o),l=Oa(Gr(c,t.line).text,t.ch,o),s=Math.min(a,l),p=Math.max(a,l),h=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=h;h++){var v=Gr(c,h).text,y=Mi(v,s,o);s==p?i.push(new fe(Eo(h,y),Eo(h,y))):v.length>y&&i.push(new fe(Eo(h,y),Eo(h,Mi(v,p,o))))}i.length||i.push(new fe(n,n)),Me(c,de(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,x=b.anchor,_=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new fe(Eo(t.line,0),me(c,Eo(t.line+1,0)));Oo(k.anchor,x)>0?(_=k.head,x=Z(b.from(),k.anchor)):(_=k.anchor,x=X(b.to(),k.head))}var i=d.ranges.slice(0);i[f]=new fe(me(c,x),_),Me(c,de(i,f),za)}}function a(t){var n=++y,i=Bt(e,t,!0,"rect"==r);if(i)if(0!=Oo(i,g)){e.curOp.focus=Fi(),o(i);var l=x(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(Tt(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Tt(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(e){y=1/0,xa(e),s.input.focus(),Ca(document,"mousemove",b),Ca(document,"mouseup",_),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;xa(t);var u,f,d=c.sel,p=d.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?p[f]:new fe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),t.altKey)r="rect",i||(u=new fe(n,n)),n=Bt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?be(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new fe(Eo(n.line,0),me(c,Eo(n.line+1,0)));u=e.display.shift||c.extend?be(c,u,m.anchor,m.head):m}else u=be(c,u,n);i?-1==f?(f=p.length,Me(c,de(p.concat([u]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Me(c,de(p.slice(0,f).concat(p.slice(f+1)),0)),d=c.sel):ke(c,f,u,za):(f=0,Me(c,new ue([u],0),za),d=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,b=Tt(e,function(e){yi(e)?a(e):l(e)}),_=Tt(e,l);wa(document,"mousemove",b),wa(document,"mouseup",_)}function Xt(e,t,n,r,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&xa(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!wi(e,n))return gi(t);a-=s.top-l.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=l.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=o){var f=Qr(e.doc,a),d=e.options.gutters[c];return i(e,n,e,f,d,t),gi(t)}}}function Zt(e,t){return Xt(e,t,"gutterClick",!0,bi)}function Yt(e){var t=this;if(!_i(t,e)&&!$t(t.display,e)){xa(e),po&&(Wo=+new Date);var n=Bt(t,e,!0),r=e.dataTransfer.files;if(n&&!Q(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){var l=new FileReader;l.onload=Tt(t,function(){if(o[r]=l.result,++a==i){n=me(t.doc,n);var e={from:n,to:n,text:Va(o.join("\n")),origin:"paste"};kn(t.doc,e),Se(t.doc,pe(n,Vo(e)))}}),l.readAsText(e)},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Co?e.altKey:e.ctrlKey))var c=t.listSelections();if(Le(t.doc,pe(n,n)),c)for(var s=0;s<c.length;++s)Tn(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Qt(e,t){if(po&&(!e.state.draggingText||+new Date-Wo<100))return void ka(t);if(!_i(e,t)&&!$t(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!bo)){var n=ji("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",yo&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),yo&&n.parentNode.removeChild(n)}}function Jt(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,co||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),co&&A(e),De(e,100))}function en(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,_(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function tn(e,t){var n=$o(t),r=n.x,i=n.y,o=e.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&Co&&mo)e:for(var l=t.target,s=o.view;l!=a;l=l.parentNode)for(var c=0;c<s.length;c++)if(s[c].node==l){e.display.currentWheelTarget=l;break e}if(r&&!co&&!yo&&null!=Ho)return i&&Jt(e,Math.max(0,Math.min(a.scrollTop+i*Ho,a.scrollHeight-a.clientHeight))),en(e,Math.max(0,Math.min(a.scrollLeft+r*Ho,a.scrollWidth-a.clientWidth))),xa(t),void(o.wheelStartX=null);if(i&&null!=Ho){var u=i*Ho,f=e.doc.scrollTop,d=f+o.wrapper.clientHeight;0>u?f=Math.max(0,f+u-50):d=Math.min(e.doc.height,d+u+50),A(e,{top:f,bottom:d})}20>Fo&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ho=(Ho*Fo+n)/(Fo+1),++Fo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function nn(e,t,n){if("string"==typeof t&&(t=ra[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{Q(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ta}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function rn(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=oa(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&oa(t,e.options.extraKeys,n,e)||oa(t,e.options.keyMap,n,e)}function on(e,t,n,r){var i=e.state.keySeq;if(i){if(aa(t))return"handled";Bo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=rn(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&bi(e,"keyHandled",e,t,n),("handled"==o||"multi"==o)&&(xa(n),Pe(e)),i&&!o&&/\'$/.test(t)?(xa(n),!0):!!o}function an(e,t){var n=la(t,!0);return n?t.shiftKey&&!e.state.keySeq?on(e,"Shift-"+n,t,function(t){return nn(e,t,!0)})||on(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?nn(e,t):void 0}):on(e,n,t,function(t){return nn(e,t)}):!1}function ln(e,t,n){return on(e,"'"+n+"'",t,function(t){return nn(e,t,!0)})}function sn(e){var t=this;if(t.curOp.focus=Fi(),!_i(t,e)){po&&11>ho&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=an(t,e);yo&&(Uo=r?n:null,!r&&88==n&&!Ka&&(Co?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||cn(t)}}function cn(e){function t(e){18!=e.keyCode&&e.altKey||(Ha(n,"CodeMirror-crosshair"),Ca(document,"keyup",t),Ca(document,"mouseover",t))}var n=e.display.lineDiv;$a(n,"CodeMirror-crosshair"),wa(document,"keyup",t),wa(document,"mouseover",t)}function un(e){16==e.keyCode&&(this.doc.sel.shift=!1),_i(this,e)}function fn(e){var t=this;if(!($t(t.display,e)||_i(t,e)||e.ctrlKey&&!e.altKey||Co&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(yo&&n==Uo)return Uo=null,void xa(e);if(!yo||e.which&&!(e.which<10)||!an(t,e)){var i=String.fromCharCode(null==r?n:r);ln(t,e,i)||t.display.input.onKeyPress(e)}}}function dn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,hn(e))},100)}function pn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Sa(e,"focus",e),e.state.focused=!0,$a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),mo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pe(e))}function hn(e){e.state.delayingBlurEvent||(e.state.focused&&(Sa(e,"blur",e),e.state.focused=!1,Ha(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function mn(e,t){$t(e.display,t)||gn(e,t)||e.display.input.onContextMenu(t)}function gn(e,t){return wi(e,"gutterContextMenu")?Xt(e,t,"gutterContextMenu",!1,Sa):!1}function vn(e,t){if(Oo(e,t.from)<0)return e;if(Oo(e,t.to)<=0)return Vo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Vo(t).ch-t.to.ch),Eo(n,r)}function yn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fe(vn(i.anchor,t),vn(i.head,t)))}return de(n,e.sel.primIndex)}function bn(e,t,n){return e.line==t.line?Eo(n.line,e.ch-t.ch+n.ch):Eo(n.line+(e.line-t.line),e.ch)}function xn(e,t,n){for(var r=[],i=Eo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=bn(l.from,i,o),c=bn(Vo(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=Oo(u.head,u.anchor)<0;r[a]=new fe(f?c:s,f?s:c)}else r[a]=new fe(s,s)}return new ue(r,e.sel.primIndex)}function _n(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=me(e,t)),n&&(this.to=me(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Sa(e,"beforeChange",e,r),e.cm&&Sa(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function kn(e,t,n){if(e.cm){if(!e.cm.curOp)return Tt(e.cm,kn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(wi(e,"beforeChange")||e.cm&&wi(e.cm,"beforeChange"))||(t=_n(e,t,!0))){var r=Ao&&!n&&ir(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)wn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else wn(e,t)}}function wn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Oo(t.from,t.to)){var n=yn(e,t);oi(e,t,n,e.cm?e.cm.curOp.id:0/0),Mn(e,t,n,tr(e,t));var r=[];Ur(e,function(e,n){n||-1!=Ai(r,e.history)||(mi(e.history,t),r.push(e.history)),Mn(e,t,null,tr(e,t))})}}function Cn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(si(r,l),n&&!r.equals(e.sel))return void Me(e,r,{clearRedo:!1});o=r}var c=[];si(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=wi(e,"beforeChange")||e.cm&&wi(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!_n(e,f,!1))return void(a.length=0);c.push(ni(e,f));var d=s?yn(e,f):Ti(a);Mn(e,f,d,rr(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Vo(f)});var p=[];Ur(e,function(e,t){t||-1!=Ai(p,e.history)||(mi(e.history,f),p.push(e.history)),Mn(e,f,null,rr(e,f))})}}}}function Sn(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(zi(e.sel.ranges,function(e){return new fe(Eo(e.anchor.line+t,e.anchor.ch),Eo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){qt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Nt(e.cm,r,"gutter")}}function Mn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Tt(e.cm,Mn)(e,t,n,r);if(t.to.line<e.first)return void Sn(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Sn(e,i),t={from:Eo(e.first,0),to:Eo(t.to.line+i,t.to.ch),text:[Ti(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Eo(o,Gr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Kr(e,t.from,t.to),n||(n=yn(e,t)),e.cm?Ln(e.cm,t,r):Hr(e,t,r),Le(e,n,Aa)}}function Ln(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=Yr(hr(Gr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&ki(e),Hr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),De(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?qt(e):a.line!=l.line||1!=t.text.length||Fr(e.doc,t)?qt(e,a.line,l.line+1,u):Nt(e,a.line,"text");var d=wi(e,"changes"),p=wi(e,"change");if(p||d){var h={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&bi(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Tn(e,t,n,r,i){if(r||(r=n),Oo(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=Va(t)),kn(e,{from:n,to:r,text:t,origin:i})}function An(e,t){if(!_i(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!_o){var o=ji("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Fe(e.display))+"px; height: "+(t.bottom-t.top+Be(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function zn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=ft(e,t),l=n&&n!=t?ft(e,n):a,s=On(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Jt(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(en(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function En(e,t,n,r,i){var o=On(e,t,n,r,i);null!=o.scrollTop&&Jt(e,o.scrollTop),null!=o.scrollLeft&&en(e,o.scrollLeft)}function On(e,t,n,r,i){var o=e.display,a=gt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ve(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+He(o),f=a>n,d=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var p=Math.min(n,(d?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ue(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:h>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function qn(e,t,n){(null!=t||null!=n)&&In(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Nn(e){In(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Eo(t.line,t.ch-1):t,r=Eo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function In(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=dt(e,t.from),r=dt(e,t.to),i=On(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Pn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=We(e,t):n="prev");var a=e.options.tabSize,l=Gr(o,t),s=Oa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ta||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Oa(Gr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+=" ";if(c>d&&(f+=Li(c-d)),f!=u)return Tn(o,f,Eo(t,0),Eo(t,u.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var h=o.sel.ranges[p];if(h.head.line==t&&h.head.ch<u.length){var d=Eo(t,u.length);ke(o,p,new fe(d,d));break}}}function Dn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Gr(e,he(e,t)):i=Yr(t),null==i?null:(r(o,i)&&e.cm&&Nt(e.cm,i,n),o)}function jn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&Oo(o.from,Ti(r).to)<=0;){var a=r.pop();if(Oo(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Lt(e,function(){for(var t=r.length-1;t>=0;t--)Tn(e.doc,"",r[t].from,r[t].to,"+delete");Nn(e)})}function Rn(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?f=!1:(l=t,u=Gr(e,t))}function a(e){var t=(i?lo:so)(u,s,n,!0);if(null==t){if(e||!o())return f=!1;s=i?(0>n?eo:Ji)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Gr(e,l),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var d=null,p="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(0>n)||a(!m);m=!1){var g=u.text.charAt(s)||"\n",v=Ii(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";
+}mo&&11>go&&(i=it(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(mo&&9>go&&!l&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+bt(e.display),top:d.top,bottom:d.bottom}:Fo}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=p,b.rbottom=h),b}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Yi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function at(e){e.display.externalMeasure=null,Wi(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function lt(e){at(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=wr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ti(t);if("local"==r?a+=$e(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ct());var s=l.left+("window"==r?0:st());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=st(),i-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function dt(e,t,n,r,i){return r||(r=Xr(e.doc,t.line)),ut(e,r,Qe(e,r,t.ch,i),n)}function pt(e,t,n,r,i,o){function a(t,a){var l=tt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ut(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==Ji(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=eo(n)-(n.level%2?0:1),r=!0):e==eo(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=Ji(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Xr(e.doc,t.line),i||(i=et(e,r));var s=ni(r),c=t.ch;if(!s)return a(c);var u=lo(s,c),f=l(c,u);return null!=Ja&&(f.other=l(c,Ja)),f}function ht(e,t){var n=0,t=ve(e.doc,t);e.options.lineWrapping||(n=bt(e.display)*t.ch);var r=Xr(e.doc,t.line),i=ti(r)+$e(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Oo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ei(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Xr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Xr(r,i);;){var l=vt(e,a,i,t,n),s=hr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=Jr(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=pt(e,Oo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ti(t),l=!1,s=2*e.display.wrapper.clientWidth,c=et(e,t),u=ni(t),f=t.text.length,d=to(t),p=no(t),h=o(d),m=l,g=o(p),v=l;if(r>g)return mt(n,p,v,1);for(;;){if(u?p==d||p==co(t,d,1):1>=p-d){for(var y=h>r||g-r>=r-h?d:p,b=r-(y==d?h:g);Fi(t.text.charAt(y));)++y;var x=mt(n,y,y==d?m:v,-1>b?-1:b>1?1:0);return x}var _=Math.ceil(f/2),k=d+_;if(u){k=d;for(var w=0;_>w;++w)k=co(t,k,1)}var C=o(k);C>r?(p=k,g=C,(v=l)&&(g+=1e3),f=_):(d=k,h=C,m=l,f-=_)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Po){Po=Ri("pre");for(var t=0;49>t;++t)Po.appendChild(document.createTextNode("x")),Po.appendChild(Ri("br"));Po.appendChild(document.createTextNode("x"))}Hi(e.measure,Po);var n=Po.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Wi(e.measure),n||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ri("span","xxxxxxxxxx"),n=Ri("pre",[t]);Hi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function xt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wo},Ro?Ro.ops.push(e.curOp):e.curOp.ownsGroup=Ro={ops:[e.curOp],delayedCallbacks:[]}}function _t(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<t.length)}function kt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{_t(n)}finally{Ro=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;wt(n)}}function wt(e){for(var t=e.ops,n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)St(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n])}function Ct(e){var t=e.cm,n=t.display;M(t),e.updateMaxLine&&d(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function St(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Mt(e){var t=e.cm,n=t.display;e.updatedDisplay&&E(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Lt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&z(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&je(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),e.focus&&e.focus==$i()&&Y(e.cm)}function Tt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&T(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Ge(t),e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,_(t)),e.scrollToPos){var i=qn(t,ve(r,e.scrollToPos.from),ve(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&En(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||La(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&La(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&La(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();xt(e);try{return t()}finally{kt(e)}}function zt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);xt(e);try{return t.apply(e,arguments)}finally{kt(e)}}}function Et(e){return function(){if(this.curOp)return e.apply(this,arguments);xt(this);try{return e.apply(this,arguments)}finally{kt(this)}}}function qt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);xt(t);try{return e.apply(this,arguments)}finally{kt(t)}}}function Ot(e,t,n){this.line=t,this.rest=vr(t),this.size=this.rest?Jr(zi(this.rest))-n+1:1,this.node=this.text=null,this.hidden=xr(e,t)}function Nt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Ot(e.doc,Xr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function It(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)qo&&yr(e.doc,t)<i.viewTo&&Dt(e);else if(n<=i.viewFrom)qo&&br(e.doc,n+r)>i.viewFrom?Dt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Dt(e);else if(t<=i.viewFrom){var o=Ft(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Dt(e)}else if(n>=i.viewTo){var o=Ft(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Dt(e)}else{var a=Ft(e,t,t,-1),l=Ft(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Nt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Dt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Pt(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[jt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Ei(a,n)&&a.push(n)}}}function Dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function Ft(e,t,n,r){var i,o=jt(e,t),a=e.display.view;if(!qo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;yr(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Rt(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Nt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Nt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(jt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Nt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,jt(e,n)))),r.viewTo=n}function Wt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Ht(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Sa(i.scroller,"mousedown",zt(e,Gt)),mo&&11>go?Sa(i.scroller,"dblclick",zt(e,function(t){if(!wi(e,t)){var n=Vt(e,t);if(n&&!Qt(e,t)&&!Ut(e.display,t)){ka(t);var r=e.findWordAt(n);ke(e.doc,r.anchor,r.head)}}})):Sa(i.scroller,"dblclick",function(t){wi(e,t)||ka(t)}),zo||Sa(i.scroller,"contextmenu",function(t){vn(e,t)});var o,a={end:0};Sa(i.scroller,"touchstart",function(e){if(!n(e)){clearTimeout(o);var t=+new Date;i.activeTouch={start:t,moved:!1,prev:t-a.end<=300?a:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),Sa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Sa(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Ut(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new pe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new pe(Oo(l.line,0),ve(e.doc,Oo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),ka(n)}t()}),Sa(i.scroller,"touchcancel",t),Sa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(tn(e,i.scroller.scrollTop),nn(e,i.scroller.scrollLeft,!0),La(e,"scroll",e))}),Sa(i.scroller,"mousewheel",function(t){rn(e,t)}),Sa(i.scroller,"DOMMouseScroll",function(t){rn(e,t)}),Sa(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={simple:function(t){wi(e,t)||Ca(t)},start:function(t){en(e,t)},drop:zt(e,Jt)};var l=i.input.getField();Sa(l,"keyup",function(t){dn.call(e,t)}),Sa(l,"keydown",zt(e,un)),Sa(l,"keypress",zt(e,pn)),Sa(l,"focus",Pi(mn,e)),Sa(l,"blur",Pi(gn,e))}function $t(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Sa:Ma;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.simple),a(t.display.scroller,"dragover",o.simple),a(t.display.scroller,"drop",o.drop)}}function Bt(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Ut(e,t){for(var n=bi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vt(e,t,n,r){var i=e.display;if(!n&&"true"==bi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Xr(e.doc,c.line).text).length==c.ch){var u=Na(s,s.length,e.options.tabSize)-s.length;c=Oo(c.line,Math.max(0,Math.round((o-Ue(e.display).left)/bt(e.display))-u))}return c}function Gt(e){var t=this,n=t.display;if(!(n.activeTouch&&n.input.supportsTouch()||wi(t,e))){if(n.shift=e.shiftKey,Ut(n,e))return void(vo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Qt(t,e)){var r=Vt(t,e);switch(window.focus(),xi(e)){case 1:r?Kt(t,e,r):bi(e)==n.scroller&&ka(e);break;case 2:vo&&(t.state.lastMiddleDown=+new Date),r&&ke(t.doc,r),setTimeout(function(){n.input.focus()},20),ka(e);break;case 3:zo?vn(t,e):hn(t)}}}}function Kt(e,t,n){mo?setTimeout(Pi(Y,e),0):e.curOp.focus=$i();var r,i=+new Date;jo&&jo.time>i-400&&0==No(jo.pos,n)?r="triple":Do&&Do.time>i-400&&0==No(Do.pos,n)?(r="double",jo={time:i,pos:n}):(r="single",Do={time:i,pos:n});var o,a=e.doc.sel,l=Mo?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ga&&!Q(e)&&"single"==r&&(o=a.contains(n))>-1&&(No((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(No(o.to(),n)>0||n.xRel<0)?Xt(e,t,n,l):Zt(e,t,n,r,l)}function Xt(e,t,n,r){var i=e.display,o=+new Date,a=zt(e,function(l){vo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ma(document,"mouseup",a),Ma(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ka(l),!r&&+new Date-200<o&&ke(e.doc,n),vo||mo&&9==go?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});vo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),Sa(document,"mouseup",a),Sa(i.scroller,"drop",a)}function Zt(e,t,n,r,i){function o(t){if(0!=No(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Na(Xr(c,n.line).text,n.ch,o),l=Na(Xr(c,t.line).text,t.ch,o),s=Math.min(a,l),p=Math.max(a,l),h=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=h;h++){var v=Xr(c,h).text,y=Ti(v,s,o);s==p?i.push(new pe(Oo(h,y),Oo(h,y))):v.length>y&&i.push(new pe(Oo(h,y),Oo(h,Ti(v,p,o))))}i.length||i.push(new pe(n,n)),Te(c,he(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,x=b.anchor,_=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new pe(Oo(t.line,0),ve(c,Oo(t.line+1,0)));No(k.anchor,x)>0?(_=k.head,x=Z(b.from(),k.anchor)):(_=k.anchor,x=X(b.to(),k.head))}var i=d.ranges.slice(0);i[f]=new pe(ve(c,x),_),Te(c,he(i,f),qa)}}function a(t){var n=++y,i=Vt(e,t,!0,"rect"==r);if(i)if(0!=No(i,g)){e.curOp.focus=$i(),o(i);var l=x(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(zt(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(zt(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(e){y=1/0,ka(e),s.input.focus(),Ma(document,"mousemove",b),Ma(document,"mouseup",_),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;ka(t);var u,f,d=c.sel,p=d.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?p[f]:new pe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),t.altKey)r="rect",i||(u=new pe(n,n)),n=Vt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?_e(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new pe(Oo(n.line,0),ve(c,Oo(n.line+1,0)));u=e.display.shift||c.extend?_e(c,u,m.anchor,m.head):m}else u=_e(c,u,n);i?-1==f?(f=p.length,Te(c,he(p.concat([u]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(p.slice(0,f).concat(p.slice(f+1)),0)),d=c.sel):Ce(c,f,u,qa):(f=0,Te(c,new de([u],0),qa),d=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,b=zt(e,function(e){xi(e)?a(e):l(e)}),_=zt(e,l);Sa(document,"mousemove",b),Sa(document,"mouseup",_)}function Yt(e,t,n,r,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ka(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!Si(e,n))return yi(t);a-=s.top-l.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=l.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=o){var f=ei(e.doc,a),d=e.options.gutters[c];return i(e,n,e,f,d,t),yi(t)}}}function Qt(e,t){return Yt(e,t,"gutterClick",!0,_i)}function Jt(e){var t=this;if(!wi(t,e)&&!Ut(t.display,e)){ka(e),mo&&(Ho=+new Date);var n=Vt(t,e,!0),r=e.dataTransfer.files;if(n&&!Q(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){var l=new FileReader;l.onload=zt(t,function(){if(o[r]=l.result,++a==i){n=ve(t.doc,n);var e={from:n,to:n,text:Ka(o.join("\n")),origin:"paste"};Cn(t.doc,e),Le(t.doc,me(n,Ko(e)))}}),l.readAsText(e)},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Mo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Ae(t.doc,me(n,n)),c)for(var s=0;s<c.length;++s)zn(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(mo&&(!e.state.draggingText||+new Date-Ho<100))return void Ca(t);if(!wi(e,t)&&!Ut(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!_o)){var n=Ri("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",xo&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),xo&&n.parentNode.removeChild(n)}}function tn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,fo||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),fo&&A(e),Fe(e,100))}function nn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,_(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function rn(e,t){var n=Uo(t),r=n.x,i=n.y,o=e.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&Mo&&vo)e:for(var l=t.target,s=o.view;l!=a;l=l.parentNode)for(var c=0;c<s.length;c++)if(s[c].node==l){e.display.currentWheelTarget=l;break e}if(r&&!fo&&!xo&&null!=Bo)return i&&tn(e,Math.max(0,Math.min(a.scrollTop+i*Bo,a.scrollHeight-a.clientHeight))),nn(e,Math.max(0,Math.min(a.scrollLeft+r*Bo,a.scrollWidth-a.clientWidth))),ka(t),void(o.wheelStartX=null);if(i&&null!=Bo){var u=i*Bo,f=e.doc.scrollTop,d=f+o.wrapper.clientHeight;0>u?f=Math.max(0,f+u-50):d=Math.min(e.doc.height,d+u+50),A(e,{top:f,bottom:d})}20>$o&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Bo=(Bo*$o+n)/($o+1),++$o)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function on(e,t,n){if("string"==typeof t&&(t=oa[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{Q(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=za}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function an(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=la(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&la(t,e.options.extraKeys,n,e)||la(t,e.options.keyMap,n,e)}function ln(e,t,n,r){var i=e.state.keySeq;if(i){if(sa(t))return"handled";Vo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=an(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&_i(e,"keyHandled",e,t,n),("handled"==o||"multi"==o)&&(ka(n),je(e)),i&&!o&&/\'$/.test(t)?(ka(n),!0):!!o}function sn(e,t){var n=ca(t,!0);return n?t.shiftKey&&!e.state.keySeq?ln(e,"Shift-"+n,t,function(t){return on(e,t,!0)})||ln(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?on(e,t):void 0}):ln(e,n,t,function(t){return on(e,t)}):!1}function cn(e,t,n){return ln(e,"'"+n+"'",t,function(t){return on(e,t,!0)})}function un(e){var t=this;if(t.curOp.focus=$i(),!wi(t,e)){mo&&11>go&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=sn(t,e);xo&&(Go=r?n:null,!r&&88==n&&!Za&&(Mo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fn(t)}}function fn(e){function t(e){18!=e.keyCode&&e.altKey||(Ba(n,"CodeMirror-crosshair"),Ma(document,"keyup",t),Ma(document,"mouseover",t))}var n=e.display.lineDiv;Ua(n,"CodeMirror-crosshair"),Sa(document,"keyup",t),Sa(document,"mouseover",t)}function dn(e){16==e.keyCode&&(this.doc.sel.shift=!1),wi(this,e)}function pn(e){var t=this;if(!(Ut(t.display,e)||wi(t,e)||e.ctrlKey&&!e.altKey||Mo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(xo&&n==Go)return Go=null,void ka(e);if(!xo||e.which&&!(e.which<10)||!sn(t,e)){var i=String.fromCharCode(null==r?n:r);cn(t,e,i)||t.display.input.onKeyPress(e)}}}function hn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,gn(e))},100)}function mn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(La(e,"focus",e),e.state.focused=!0,Ua(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),vo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),je(e))}function gn(e){e.state.delayingBlurEvent||(e.state.focused&&(La(e,"blur",e),e.state.focused=!1,Ba(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function vn(e,t){Ut(e.display,t)||yn(e,t)||e.display.input.onContextMenu(t)}function yn(e,t){return Si(e,"gutterContextMenu")?Yt(e,t,"gutterContextMenu",!1,La):!1}function bn(e,t){if(No(e,t.from)<0)return e;if(No(e,t.to)<=0)return Ko(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ko(t).ch-t.to.ch),Oo(n,r)}function xn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new pe(bn(i.anchor,t),bn(i.head,t)))}return he(n,e.sel.primIndex)}function _n(e,t,n){return e.line==t.line?Oo(n.line,e.ch-t.ch+n.ch):Oo(n.line+(e.line-t.line),e.ch)}function kn(e,t,n){for(var r=[],i=Oo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=_n(l.from,i,o),c=_n(Ko(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=No(u.head,u.anchor)<0;r[a]=new pe(f?c:s,f?s:c)}else r[a]=new pe(s,s)}return new de(r,e.sel.primIndex)}function wn(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=ve(e,t)),n&&(this.to=ve(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),La(e,"beforeChange",e,r),e.cm&&La(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Cn(e,t,n){if(e.cm){if(!e.cm.curOp)return zt(e.cm,Cn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Si(e,"beforeChange")||e.cm&&Si(e.cm,"beforeChange"))||(t=wn(e,t,!0))){var r=Eo&&!n&&ar(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Sn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Sn(e,t)}}function Sn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=No(t.from,t.to)){var n=xn(e,t);li(e,t,n,e.cm?e.cm.curOp.id:0/0),Tn(e,t,n,rr(e,t));var r=[];Gr(e,function(e,n){n||-1!=Ei(r,e.history)||(vi(e.history,t),r.push(e.history)),Tn(e,t,null,rr(e,t))})}}function Mn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(ui(r,l),n&&!r.equals(e.sel))return void Te(e,r,{clearRedo:!1});o=r}var c=[];ui(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Si(e,"beforeChange")||e.cm&&Si(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!wn(e,f,!1))return void(a.length=0);c.push(ii(e,f));var d=s?xn(e,f):zi(a);Tn(e,f,d,or(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Ko(f)});var p=[];Gr(e,function(e,t){t||-1!=Ei(p,e.history)||(vi(e.history,f),p.push(e.history)),Tn(e,f,null,or(e,f))})}}}}function Ln(e,t){if(0!=t&&(e.first+=t,e.sel=new de(qi(e.sel.ranges,function(e){return new pe(Oo(e.anchor.line+t,e.anchor.ch),Oo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){It(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Pt(e.cm,r,"gutter")}}function Tn(e,t,n,r){if(e.cm&&!e.cm.curOp)return zt(e.cm,Tn)(e,t,n,r);if(t.to.line<e.first)return void Ln(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ln(e,i),t={from:Oo(e.first,0),to:Oo(t.to.line+i,t.to.ch),text:[zi(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Oo(o,Xr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zr(e,t.from,t.to),n||(n=xn(e,t)),e.cm?An(e.cm,t,r):Br(e,t,r),Ae(e,n,Ea)}}function An(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=Jr(gr(Xr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Ci(e),Br(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),Fe(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?It(e):a.line!=l.line||1!=t.text.length||$r(e.doc,t)?It(e,a.line,l.line+1,u):Pt(e,a.line,"text");var d=Si(e,"changes"),p=Si(e,"change");if(p||d){var h={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&_i(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function zn(e,t,n,r,i){if(r||(r=n),No(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=Ka(t)),Cn(e,{from:n,to:r,text:t,origin:i})}function En(e,t){if(!wi(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!wo){var o=Ri("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-$e(e.display))+"px; height: "+(t.bottom-t.top+Ve(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function qn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=pt(e,t),l=n&&n!=t?pt(e,n):a,s=Nn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(tn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(nn(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function On(e,t,n,r,i){var o=Nn(e,t,n,r,i);null!=o.scrollTop&&tn(e,o.scrollTop),null!=o.scrollLeft&&nn(e,o.scrollLeft)}function Nn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ke(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+Be(o),f=a>n,d=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var p=Math.min(n,(d?u:i)-s);p!=l&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:h>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function In(e,t,n){(null!=t||null!=n)&&Dn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Pn(e){Dn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Oo(t.line,t.ch-1):t,r=Oo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Dn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ht(e,t.from),r=ht(e,t.to),i=Nn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function jn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=He(e,t):n="prev");var a=e.options.tabSize,l=Xr(o,t),s=Na(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==za||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Na(Xr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+=" ";if(c>d&&(f+=Ai(c-d)),f!=u)return zn(o,f,Oo(t,0),Oo(t,u.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var h=o.sel.ranges[p];if(h.head.line==t&&h.head.ch<u.length){var d=Oo(t,u.length);Ce(o,p,new pe(d,d));break}}}function Fn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Xr(e,ge(e,t)):i=Jr(t),null==i?null:(r(o,i)&&e.cm&&Pt(e.cm,i,n),o)}function Rn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&No(o.from,zi(r).to)<=0;){var a=r.pop();if(No(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}At(e,function(){for(var t=r.length-1;t>=0;t--)zn(e.doc,"",r[t].from,r[t].to,"+delete");Pn(e)})}function Wn(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?f=!1:(l=t,u=Xr(e,t))}function a(e){var t=(i?co:uo)(u,s,n,!0);if(null==t){if(e||!o())return f=!1;s=i?(0>n?no:to)(u):0>n?u.text.length:0}else s=t;
-if(!p||m||v||(v="s"),d&&d!=v){0>n&&(n=1,a());break}if(v&&(d=v),n>0&&!a(!m))break}var y=Ee(e,Eo(l,s),c,!0);return f||(y.hitSide=!0),y}function Wn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*gt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=ht(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Fn(t,n,r,i){e.defaults[t]=n,r&&(Ko[t]=i?function(e,t,n){n!=Xo&&r(e,t,n)}:r)}function Hn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $n(e){return"string"==typeof e?ia[e]:e}function Bn(e,t,n,r,i){if(r&&r.shared)return Un(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Tt(e.cm,Bn)(e,t,n,r,i);var o=new ua(e,i),a=Oo(t,n);if(r&&qi(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ji("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(pr(e,t.line,t,n,o)||t.line!=n.line&&pr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");zo=!0}o.addToHistory&&oi(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&hr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Zr(e,0),Qn(e,new Xn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){yr(e,t)&&Zr(t,0)}),o.clearOnEnter&&wa(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ao=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ca,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)qt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Nt(c,u,"text");o.atomic&&Ae(c.doc),bi(c,"markerAdded",c,o)}return o}function Un(e,t,n,r,i){r=qi(r),r.shared=!1;var o=[Bn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Ur(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Bn(e,me(e,t),me(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Ti(o)}),new fa(o,a)}function Vn(e){return e.findMarks(Eo(e.first,0),e.clipPos(Eo(e.lastLine())),function(e){return e.parent})}function Gn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(Oo(o,a)){var l=Bn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Kn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Ur(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Ai(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Xn(e,t,n){this.marker=e,this.from=t,this.to=n}function Zn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Yn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Qn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Jn(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Xn(a,o.from,s?null:o.to))}}return r}function er(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Xn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function tr(e,t){if(t.full)return null;var n=ve(e,t.from.line)&&Gr(e,t.from.line).markedSpans,r=ve(e,t.to.line)&&Gr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==Oo(t.from,t.to),l=Jn(n,i,a),s=er(r,o,a),c=1==t.text.length,u=Ti(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var p=Zn(s,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=i}}if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null!=d.to&&(d.to+=u),null==d.from){var p=Zn(l,d.marker);p||(d.from=u,c&&(l||(l=[])).push(d))}else d.from+=u,c&&(l||(l=[])).push(d)}l&&(l=nr(l)),s&&s!=l&&(s=nr(s));var h=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Xn(l[f].marker,null,null));for(var f=0;g>f;++f)h.push(m);h.push(s)}return h}function nr(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function rr(e,t){var n=fi(e,t),r=tr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function ir(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Ai(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(Oo(c.to,l.from)<0||Oo(c.from,l.to)>0)){var u=[s,1],f=Oo(c.from,l.from),d=Oo(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function or(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ar(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function lr(e){return e.inclusiveLeft?-1:0}function sr(e){return e.inclusiveRight?1:0}function cr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=Oo(r.from,i.from)||lr(e)-lr(t);if(o)return-o;var a=Oo(r.to,i.to)||sr(e)-sr(t);return a?a:t.id-e.id}function ur(e,t){var n,r=zo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||cr(n,i.marker)<0)&&(n=i.marker);return n}function fr(e){return ur(e,!0)}function dr(e){return ur(e,!1)}function pr(e,t,n,r,i){var o=Gr(e,t),a=zo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=Oo(c.from,n)||lr(s.marker)-lr(i),f=Oo(c.to,r)||sr(s.marker)-sr(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(Oo(c.to,n)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(Oo(c.from,r)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function hr(e){for(var t;t=fr(e);)e=t.find(-1,!0).line;return e}function mr(e){for(var t,n;t=dr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function gr(e,t){var n=Gr(e,t),r=hr(n);return n==r?t:Yr(r)}function vr(e,t){if(t>e.lastLine())return t;var n,r=Gr(e,t);if(!yr(e,r))return t;for(;n=dr(r);)r=n.find(1,!0).line;return Yr(r)+1}function yr(e,t){var n=zo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&br(e,t,r))return!0}}function br(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return br(e,r.line,Zn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&br(e,t,i))return!0}function xr(e,t,n){Jr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qn(e,null,n)}function _r(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Ra(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Wi(t.display.measure,ji("div",[e.node],null,n))}return e.height=e.node.offsetHeight}function kr(e,t,n,r){var i=new da(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Dn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!yr(e,t)){var r=Jr(t)<e.scrollTop;Zr(t,t.height+_r(i)),r&&qn(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function wr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),or(e),ar(e,n);var i=r?r(e):1;i!=e.height&&Zr(e,i)}function Cr(e){e.parent=null,or(e)}function Sr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Mr(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Lr(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Tr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?ta(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=me(a,t);var s,c=Gr(a,t.line),u=We(e,t.line,n),f=new sa(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Lr(l,f,u),r&&s.push(i(!0));return r?s:i()}function Ar(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new sa(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&Sr(Mr(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Or(e,t,r,f.pos),f.pos=t.length,s=null):s=Sr(Lr(n,f,r,d),o),d){var p=d[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e4);i(h,u),c=h}}function zr(e,t,n,r){var i=[e.state.modeGen],o={};Ar(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Ar(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Er(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=zr(e,t,t.stateAfter=We(e,Yr(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Or(e,t,n,r){var i=e.doc.mode,o=new sa(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Mr(i,n);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Lr(i,o,n),o.start=o.pos}function qr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ma:ha;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Nr(e,t){var n=ji("span",null,null,mo?"padding-right: .1px":null),r={pre:ji("pre",[n]),content:n,col:0,pos:0,cm:e,splitSpaces:(po||mo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Pr,Ki(e.display.measure)&&(o=ei(a))&&(r.addToken=jr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&Yr(a);Wr(a,r,Er(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=$i(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=$i(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Gi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return mo&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),Sa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=$i(r.pre.className,r.textClass||"")),r}function Ir(e){var t=ji("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Pr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,Dr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var d=s.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(l.slice(f,f+p));u.appendChild(po&&9>ho?ji("span",[h]):h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1," "==d[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild(ji("span",Li(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=g}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),u.appendChild(po&&9>ho?ji("span",[h]):h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),po&&9>ho&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=ji("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Dr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function jr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var d=t[f];if(d.to>c&&d.from<=c)break}if(d.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-c),i,o,null,l,s),o=null,r=r.slice(d.to-c),c=d.to}}}function Rr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Wr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=f=l="",d=null,v=1/0;for(var y=[],b=0;b<r.length;++b){var x=r[b],_=x.marker;"bookmark"==_.type&&x.from==h&&_.widgetNode?y.push(_):x.from<=h&&(null==x.to||x.to>h||_.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),_.className&&(s+=" "+_.className),_.css&&(l=_.css),_.startStyle&&x.from==h&&(u+=" "+_.startStyle),_.endStyle&&x.to==v&&(c+=" "+_.endStyle),_.title&&!f&&(f=_.title),_.collapsed&&(!d||cr(d.marker,_)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(d&&(d.from||0)==h){if(Rr(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}if(!d&&y.length)for(var b=0;b<y.length;++b)Rr(t,0,y[b])}if(h>=p)break;for(var k=Math.min(p,v);;){if(g){var w=h+g.length;if(!d){var C=w>k?g.slice(0,k-h):g;t.addToken(t,C,a?a+s:s,u,h+C.length==v?c:"",f,l)}if(w>=k){g=g.slice(k-h),h=k;break}h=w,u=""}g=i.slice(o,o=n[m++]),a=qr(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),qr(n[m+1],t.cm.options))}function Fr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Ti(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Hr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){wr(e,n,i,r),bi(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new pa(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Gr(e,l.line),f=Gr(e,s.line),d=Ti(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Fr(e,t)){var m=a(0,c.length-1);o(f,f.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),p);else{var m=a(1,c.length-1);m.push(new pa(d+u.text.slice(s.ch),p,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,d+f.text.slice(s.ch),p);var m=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,m)}bi(e,"change",e,t)}function $r(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Br(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Ur(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;(!n||s)&&(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Vr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||d(e),e.options.mode=t.modeOption,qt(e)}function Gr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Kr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Xr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Zr(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Yr(e){if(null==e.parent)return null;for(var t=e.parent,n=Ai(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Qr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function Jr(e){e=hr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ei(e){var t=e.order;return null==t&&(t=e.order=Qa(e.text)),t}function ti(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ni(e,t){var n={from:K(t.from),to:Vo(t),text:Kr(e,t.from,t.to)};return ci(e,n,t.from.line,t.to.line+1),Ur(e,function(e){ci(e,n,t.from.line,t.to.line+1)},!0),n}function ri(e){for(;e.length;){var t=Ti(e);if(!t.ranges)break;e.pop()}}function ii(e,t){return t?(ri(e.done),Ti(e.done)):e.done.length&&!Ti(e.done).ranges?Ti(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ti(e.done)):void 0}function oi(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ii(i,i.lastOp==r))){var l=Ti(o.changes);0==Oo(t.from,t.to)&&0==Oo(t.from,l.to)?l.to=Vo(t):o.changes.push(ni(e,t))}else{var s=Ti(i.done);for(s&&s.ranges||si(e.sel,i.done),o={changes:[ni(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Sa(e,"historyAdded")}}function ai(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function li(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ai(e,o,Ti(i.done),t))?i.done[i.done.length-1]=t:si(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ri(i.undone)}function si(e,t){var n=Ti(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ci(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function ui(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function fi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(ui(n[r]));return i}function di(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ue.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Ai(t,Number(c[1]))>-1&&(Ti(l)[f]=u[f],delete u[f])}}}return i}function pi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function hi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)pi(o.ranges[l].anchor,t,n,r),pi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=Eo(s.from.line+r,s.from.ch),s.to=Eo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function mi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;hi(e.done,n,r,i),hi(e.undone,n,r,i)}function gi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function vi(e){return e.target||e.srcElement}function yi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Co&&e.ctrlKey&&1==t&&(t=3),t}function bi(e,t){function n(e){return function(){e.apply(null,o)}}var r=e._handlers&&e._handlers[t];if(r){var i,o=Array.prototype.slice.call(arguments,2);jo?i=jo.delayedCallbacks:Ma?i=Ma:(i=Ma=[],setTimeout(xi,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function xi(){var e=Ma;Ma=null;for(var t=0;t<e.length;++t)e[t]()}function _i(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Sa(e,n||t.type,e,t),gi(t)||t.codemirrorIgnore}function ki(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Ai(n,t[r])&&n.push(t[r])}function wi(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function Ci(e){e.prototype.on=function(e,t){wa(this,e,t)},e.prototype.off=function(e,t){Ca(this,e,t)}}function Si(){this.id=null}function Mi(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function Li(e){for(;qa.length<=e;)qa.push(Ti(qa)+" ");return qa[e]}function Ti(e){return e[e.length-1]}function Ai(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function zi(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Ei(){}function Oi(e,t){var n;return Object.create?n=Object.create(e):(Ei.prototype=e,n=new Ei),t&&qi(t,n),n}function qi(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Ni(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ii(e,t){return t?t.source.indexOf("\\w")>-1&&Da(e)?!0:t.test(e):Da(e)}function Pi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Di(e){return e.charCodeAt(0)>=768&&ja.test(e)}function ji(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Ri(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Wi(e,t){return Ri(e).appendChild(t)}function Fi(){return document.activeElement}function Hi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Hi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Bi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Ui(){Ba||(Vi(),Ba=!0)}function Vi(){var e;wa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Bi(Ht)},100))}),wa(window,"blur",function(){Bi(hn)})}function Gi(e){if(null==Wa){var t=ji("span","​");Wi(e,ji("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Wa=t.offsetWidth<=1&&t.offsetHeight>2&&!(po&&8>ho))}var n=Wa?ji("span","​"):ji("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ki(e){if(null!=Fa)return Fa;var t=Wi(e,document.createTextNode("AخA")),n=Ia(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ia(t,1,2).getBoundingClientRect();return Fa=r.right-n.right<3}function Xi(e){if(null!=Xa)return Xa;var t=Wi(e,ji("span","x")),n=t.getBoundingClientRect(),r=Ia(t,0,1).getBoundingClientRect();return Xa=Math.abs(n.left-r.left)>1}function Zi(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function Yi(e){return e.level%2?e.to:e.from}function Qi(e){return e.level%2?e.from:e.to}function Ji(e){var t=ei(e);return t?Yi(t[0]):0}function eo(e){var t=ei(e);return t?Qi(Ti(t)):e.text.length}function to(e,t){var n=Gr(e.doc,t),r=hr(n);r!=n&&(t=Yr(r));var i=ei(r),o=i?i[0].level%2?eo(r):Ji(r):0;return Eo(t,o)}function no(e,t){for(var n,r=Gr(e.doc,t);n=dr(r);)r=n.find(1,!0).line,t=null;var i=ei(r),o=i?i[0].level%2?Ji(r):eo(r):r.text.length;return Eo(null==t?Yr(r):t,o)}function ro(e,t){var n=to(e,t.line),r=Gr(e.doc,n.line),i=ei(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Eo(n.line,a?0:o)}return n}function io(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function oo(e,t){Ya=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return io(e,i.level,e[n].level)?(i.from!=i.to&&(Ya=n),r):(i.from!=i.to&&(Ya=r),n);n=r}}return n}function ao(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Di(e.text.charAt(t)));return t}function lo(e,t,n,r){var i=ei(e);if(!i)return so(e,t,n,r);for(var o=oo(i,t),a=i[o],l=ao(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return oo(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?ao(e,a.to,-1,r):ao(e,a.from,1,r)}}function so(e,t,n,r){var i=t+n;if(r)for(;i>0&&Di(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var co=/gecko\/\d/i.test(navigator.userAgent),uo=/MSIE \d/.test(navigator.userAgent),fo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),po=uo||fo,ho=po&&(uo?document.documentMode||6:fo[1]),mo=/WebKit\//.test(navigator.userAgent),go=mo&&/Qt\/\d+\.\d+/.test(navigator.userAgent),vo=/Chrome\//.test(navigator.userAgent),yo=/Opera\//.test(navigator.userAgent),bo=/Apple Computer/.test(navigator.vendor),xo=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),_o=/PhantomJS/.test(navigator.userAgent),ko=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wo=ko||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Co=ko||/Mac/.test(navigator.platform),So=/win/i.test(navigator.platform),Mo=yo&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Mo&&(Mo=Number(Mo[1])),Mo&&Mo>=15&&(yo=!1,mo=!0);var Lo=Co&&(go||yo&&(null==Mo||12.11>Mo)),To=co||po&&ho>=9,Ao=!1,zo=!1;m.prototype=qi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==r&&this.overlayHack(),this.checkedOverlay=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=Co&&!xo?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,n=function(e){vi(e)!=t.vert&&vi(e)!=t.horiz&&Tt(t.cm,Ut)(e)};wa(this.vert,"mousedown",n),wa(this.horiz,"mousedown",n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=qi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){wi(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Sa.apply(null,this.events[e])};var Eo=e.Pos=function(e,t){return this instanceof Eo?(this.line=e,void(this.ch=t)):new Eo(e,t)},Oo=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},qo=null;ne.prototype=qi({init:function(e){function t(e){if(r.somethingSelected())qo=r.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=qo.join("\n"),Na(o));else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);qo=t.text,"cut"==e.type?r.setSelections(t.ranges,null,Aa):(n.prevInput="",o.value=t.text.join("\n"),Na(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}var n=this,r=this.cm,i=this.wrapper=re(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),ko&&(o.style.width="0px"),wa(o,"input",function(){po&&ho>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),wa(o,"paste",function(){if(mo&&!r.state.fakedLastChar&&!(new Date-r.state.lastMiddleDown<200)){var e=o.selectionStart,t=o.selectionEnd;o.value+="$",o.selectionEnd=t,o.selectionStart=e,r.state.fakedLastChar=!0}r.state.pasteIncoming=!0,n.fastPoll()}),wa(o,"cut",t),wa(o,"copy",t),wa(e.scroller,"paste",function(t){$t(e,t)||(r.state.pasteIncoming=!0,n.focus())}),wa(e.lineSpace,"selectstart",function(t){$t(e,t)||xa(t)}),wa(o,"compositionstart",function(){var e=r.getCursor("from");n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),wa(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=qe(e);if(e.options.moveInputWithCursor){var i=ft(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Wi(n.cursorDiv,e.cursors),Wi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Ka&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&Na(this.textarea),po&&ho>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),
-po&&ho>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wo||Fi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(!e.state.focused||Ga(t)&&!n||Q(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(po&&ho>=9&&this.hasSelection===r||Co&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return Lt(e,function(){J(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){po&&ho>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.position="relative",a.style.cssText=u,po&&9>ho&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!po||po&&9>ho)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Tt(i,ra.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Bt(i,e),s=o.scroller.scrollTop;if(l&&!yo){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Tt(i,Me)(i.doc,pe(l),Aa);var u=a.style.cssText;if(r.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(po?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",mo)var f=window.scrollY;if(o.input.focus(),mo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),po&&ho>=9&&t(),To){ka(e);var d=function(){Ca(window,"mouseup",d),setTimeout(n,20)};wa(window,"mouseup",d)}else setTimeout(n,50)}},setUneditable:Ei,needsContentAttribute:!1},ne.prototype),ie.prototype=qi({init:function(e){function t(e){if(r.somethingSelected())qo=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);qo=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Aa),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!ko)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",qo.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=qo.join("\n");var o=document.activeElement;Na(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}var n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable="true",te(i),wa(i,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),r.replaceSelection(t,null,"paste"))}),wa(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=pe(Eo(i.head.line,a),Eo(i.head.line,a+t.length)))}}),wa(i,"compositionupdate",function(e){n.composing.data=e.data}),wa(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),wa(i,"touchstart",function(){n.forceCompositionEnd()}),wa(i,"input",function(){n.composing||n.pollContent()||Lt(n.cm,function(){qt(r)})}),wa(i,"copy",t),wa(i,"cut",t)},prepareSelection:function(){var e=qe(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Oo(Z(n,r),t.from())||0!=Oo(X(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Ia(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(e.removeAllRanges(),e.addRange(u),l&&null==e.anchorNode?e.addRange(l):co&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Wi(this.cm.display.cursorDiv,e.cursors),Wi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ra(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Lt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&Lt(t,function(){Me(t.doc,pe(n,r),Aa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Pt(e,r.line)))var a=Yr(t.view[0].line),l=t.view[0].node;else var a=Yr(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Pt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.view[s].node;else var c=Yr(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=Va(ce(e,l,u,a,c)),d=Kr(e.doc,Eo(a,0),Eo(c,Gr(e.doc,c).text.length));f.length>1&&d.length>1;)if(Ti(f)==Ti(d))f.pop(),d.pop(),c--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);v>p&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=Ti(f),b=Ti(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;f[f.length-1]=y.slice(0,y.length-h),f[0]=f[0].slice(p);var _=Eo(a,p),k=Eo(c,d.length?Ti(d).length-h:0);return f.length>1||f[0]||Oo(_,k)?(Tn(e.doc,f,_,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&Tt(this.cm,J)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),Tt(this.cm,J)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:Ei,resetPosition:Ei,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=Oo(n.anchor,r.anchor)||0!=Oo(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe(K(this.ranges[t].anchor),K(this.ranges[t].head));return new ue(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Oo(t,r.from())>=0&&Oo(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return Z(this.anchor,this.head)},to:function(){return X(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var No,Io,Po,Do={left:0,right:0,top:0,bottom:0},jo=null,Ro=0,Wo=0,Fo=0,Ho=null;po?Ho=-.53:co?Ho=15:vo?Ho=-.7:bo&&(Ho=-1/3);var $o=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=$o(e);return t.x*=Ho,t.y*=Ho,t};var Bo=new Si,Uo=null,Vo=e.changeEnd=function(e){return e.text?Eo(e.from.line+e.text.length-1,Ti(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,Ko.hasOwnProperty(e)&&Tt(this,Ko[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($n(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:At(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,qt(this)}),removeOverlay:At(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void qt(this)}}),indentLine:At(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ve(this.doc,e)&&Pn(this,e,t,n)}),indentSelection:At(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Pn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Nn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Pn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new fe(o,c[r].to()),Aa)}}}),getTokenAt:function(e,t){return Tr(this,e,t)},getLineTokens:function(e,t){return Tr(this,Eo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Er(this,Gr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!ea.hasOwnProperty(t))return n;var r=ea[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Ai(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=he(n,null==e?n.first+n.size-1:e),We(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?me(this.doc,e):e?r.from():r.to(),ft(this,n,t||"page")},charCoords:function(e,t){return ut(this,me(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ct(this,e,t||"page"),ht(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ct(this,{top:e,left:0},t||"page").top,Qr(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Gr(this.doc,e)}else n=e;return st(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-Jr(n):0)},defaultTextHeight:function(){return gt(this.display)},defaultCharWidth:function(){return vt(this.display)},setGutterMarker:At(function(e,t,n){return Dn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Pi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:At(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Nt(t,r,"gutter"),Pi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Gr(this.doc,e),!e)return null}else{var t=Yr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=ft(this,me(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&En(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:At(sn),triggerOnKeyPress:At(fn),triggerOnKeyUp:un,execCommand:function(e){return ra.hasOwnProperty(e)?ra[e](this):void 0},findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Rn(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:At(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Rn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},Ea)}),deleteH:At(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):jn(this,function(n){var i=Rn(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=me(this.doc,e);t>a;++a){var s=ft(this,l,"div");if(null==o?o=s.left:s.left=o,l=Wn(this,s,i,n),l.hitSide)break}return l},moveV:At(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=ft(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Wn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&qn(n,null,ut(n,s,"div").top-l.top),s},Ea),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Gr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=Ii(a,o)?function(e){return Ii(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ii(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new fe(Eo(e.line,r),Eo(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?$a(this.display.cursorDiv,"CodeMirror-overwrite"):Ha(this.display.cursorDiv,"CodeMirror-overwrite"),Sa(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Fi()},scrollTo:At(function(e,t){(null!=e||null!=t)&&In(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Be(this)-this.display.barHeight,width:e.scrollWidth-Be(this)-this.display.barWidth,clientHeight:Ve(this),clientWidth:Ue(this)}},scrollIntoView:At(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Eo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)In(this),this.curOp.scrollToPos=e;else{var n=On(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:At(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&it(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Nt(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,Sa(r,"refresh",this)}),operation:function(e){return Lt(this,e)},refresh:At(function(){var e=this.display.cachedTextHeight;qt(this),this.curOp.forceUpdate=!0,ot(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-gt(this.display))>.5)&&a(this),Sa(this,"refresh",this)}),swapDoc:At(function(e){var t=this.doc;return t.cm=null,Vr(this,e),ot(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,bi(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ci(e);var Go=e.defaults={},Ko=e.optionHandlers={},Xo=e.Init={toString:function(){return"CodeMirror.Init"}};Fn("value","",function(e,t){e.setValue(t)},!0),Fn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Fn("indentUnit",2,n,!0),Fn("indentWithTabs",!1),Fn("smartIndent",!0),Fn("tabSize",4,function(e){r(e),ot(e),qt(e)},!0),Fn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Fn("specialCharPlaceholder",Ir,function(e){e.refresh()},!0),Fn("electricChars",!0),Fn("inputStyle",wo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Fn("rtlMoveVisually",!So),Fn("wholeLineUpdateBefore",!0),Fn("theme","default",function(e){l(e),s(e)},!0),Fn("keyMap","default",function(t,n,r){var i=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Fn("extraKeys",null),Fn("lineWrapping",!1,i,!0),Fn("gutters",[],function(e){p(e.options),s(e)},!0),Fn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Fn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Fn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Fn("lineNumbers",!1,function(e){p(e.options),s(e)},!0),Fn("firstLineNumber",1,s,!0),Fn("lineNumberFormatter",function(e){return e},s,!0),Fn("showCursorWhenSelecting",!1,Oe,!0),Fn("resetSelectionOnContextMenu",!0),Fn("lineWiseCopyCut",!0),Fn("readOnly",!1,function(e,t){"nocursor"==t?(hn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),Fn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Fn("dragDrop",!0,Ft),Fn("cursorBlinkRate",530),Fn("cursorScrollMargin",0),Fn("cursorHeight",1,Oe,!0),Fn("singleCursorHeightPerLine",!0,Oe,!0),Fn("workTime",100),Fn("workDelay",100),Fn("flattenSpans",!0,r,!0),Fn("addModeClass",!1,r,!0),Fn("pollInterval",100),Fn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Fn("historyEventDelay",1250),Fn("viewportMargin",10,function(e){e.refresh()},!0),Fn("maxHighlightLength",1e4,r,!0),Fn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Fn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Fn("autofocus",null);var Zo=e.modes={},Yo=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Zo[t]=n},e.defineMIME=function(e,t){Yo[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Yo.hasOwnProperty(t))t=Yo[t];else if(t&&"string"==typeof t.name&&Yo.hasOwnProperty(t.name)){var n=Yo[t.name];"string"==typeof n&&(n={name:n}),t=Oi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=Zo[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(Qo.hasOwnProperty(n.name)){var o=Qo[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var Qo=e.modeExtensions={};e.extendMode=function(e,t){var n=Qo.hasOwnProperty(e)?Qo[e]:Qo[e]={};qi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){va.prototype[e]=t},e.defineOption=Fn;var Jo=[];e.defineInitHook=function(e){Jo.push(e)};var ea=e.helpers={};e.registerHelper=function(t,n,r){ea.hasOwnProperty(t)||(ea[t]=e[t]={_global:[]}),ea[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),ea[t]._global.push({pred:r,val:i})};var ta=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},na=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ra=e.commands={selectAll:function(e){e.setSelection(Eo(e.firstLine(),0),Eo(e.lastLine()),Aa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Aa)},killLine:function(e){jn(e,function(t){if(t.empty()){var n=Gr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Eo(t.head.line+1,0)}:{from:t.head,to:Eo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){jn(e,function(t){return{from:Eo(t.from().line,0),to:me(e.doc,Eo(t.to().line+1,0))}})},delLineLeft:function(e){jn(e,function(e){return{from:Eo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Eo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Eo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return to(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return ro(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return no(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ea)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ea)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ro(e,t.head):r},Ea)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Oa(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Lt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Gr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Eo(i.line,i.ch-1)),i.ch>0)i=new Eo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Eo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Gr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Eo(i.line-1,a.length-1),Eo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){Lt(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0),Nn(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},ia=e.keyMap={};ia.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ia.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ia.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ia.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ia["default"]=Co?ia.macDefault:ia.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=zi(n.split(" "),Hn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=n,a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var oa=e.lookupKey=function(e,t,n,r){t=$n(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return oa(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=oa(e,t.fallthrough[o],n,r);if(a)return a}}},aa=e.isModifierKey=function(e){var t="string"==typeof e?e:Za[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},la=e.keyName=function(e,t){if(yo&&34==e.keyCode&&e["char"])return!1;var n=Za[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Lo?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Lo?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),
-r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?qi(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Fi();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(wa(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ca(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var sa=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};sa.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Oa(this.string,null,this.tabSize)-(this.lineStart?Oa(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ca=0,ua=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ca};Ci(ua),ua.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&yt(e),wi(this,"clear")){var n=this.find();n&&bi(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Zn(a.markedSpans,this);e&&!this.collapsed?Nt(e,Yr(a),"text"):e&&(null!=l.to&&(i=Yr(a)),null!=l.from&&(r=Yr(a))),a.markedSpans=Yn(a.markedSpans,l),null==l.from&&this.collapsed&&!yr(this.doc,a)&&e&&Zr(a,gt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=hr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&qt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&bi(e,"markerCleared",e,this),t&&xt(e),this.parent&&this.parent.clear()}},ua.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Zn(o.markedSpans,this);if(null!=a.from&&(n=Eo(t?o:Yr(o),a.from),-1==e))return n;if(null!=a.to&&(r=Eo(t?o:Yr(o),a.to),1==e))return r}return n&&{from:n,to:r}},ua.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&Lt(n,function(){var r=e.line,i=Yr(e.line),o=Ye(n,i);if(o&&(rt(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!yr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=_r(t)-a;l&&Zr(r,r.height+l)}})},ua.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Ai(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ua.prototype.detachLine=function(e){if(this.lines.splice(Ai(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ca=0,fa=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Ci(fa),fa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();bi(this,"clear")}},fa.prototype.find=function(e,t){return this.primary.find(e,t)};var da=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ci(da),da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Yr(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=_r(this);Zr(n,Math.max(0,n.height-o)),e&&Lt(e,function(){xr(e,n,-o),Nt(e,r,"widget")})}},da.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=_r(this)-e;r&&(Zr(n,n.height+r),t&&Lt(t,function(){t.curOp.forceUpdate=!0,xr(t,n,r)}))};var pa=e.Line=function(e,t,n){this.text=e,ar(this,t),this.height=n?n(this):1};Ci(pa),pa.prototype.lineNo=function(){return Yr(this)};var ha={},ma={};$r.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Cr(i),bi(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Br.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $r))){var l=[];this.collapse(l),this.children=[new $r(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),l=new $r(a);i.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Br(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ai(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Br(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ga=0,va=e.Doc=function(e,t,n){if(!(this instanceof va))return new va(e,t,n);null==n&&(n=0),Br.call(this,[new $r([new pa("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=Eo(n,0);this.sel=pe(r),this.history=new ti(null),this.id=++ga,this.modeOption=t,"string"==typeof e&&(e=Va(e)),Hr(this,{from:r,to:r,text:e}),Me(this,pe(r),Aa)};va.prototype=Oi(Br.prototype,{constructor:va,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Xr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:zt(function(e){var t=Eo(this.first,0),n=this.first+this.size-1;kn(this,{from:t,to:Eo(n,Gr(this,n).text.length),text:Va(e),origin:"setValue",full:!0},!0),Me(this,pe(t))}),replaceRange:function(e,t,n,r){t=me(this,t),n=n?me(this,n):t,Tn(this,e,t,n,r)},getRange:function(e,t,n){var r=Kr(this,me(this,e),me(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ve(this,e)?Gr(this,e):void 0},getLineNumber:function(e){return Yr(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Gr(this,e)),hr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:zt(function(e,t,n){we(this,me(this,"number"==typeof e?Eo(e,t||0):e),null,n)}),setSelection:zt(function(e,t,n){we(this,me(this,e),me(this,t||e),n)}),extendSelection:zt(function(e,t,n){xe(this,me(this,e),t&&me(this,t),n)}),extendSelections:zt(function(e,t){_e(this,ye(this,e,t))}),extendSelectionsBy:zt(function(e,t){_e(this,zi(this.sel.ranges,e),t)}),setSelections:zt(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new fe(me(this,e[r].anchor),me(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Me(this,de(i,t),n)}}),addSelection:zt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fe(me(this,e),me(this,t||e))),Me(this,de(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Kr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Kr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n")),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:zt(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Va(e[o]),origin:n}}for(var l=t&&"end"!=t&&xn(this,r,t),o=r.length-1;o>=0;o--)kn(this,r[o]);l?Se(this,l):this.cm&&Nn(this.cm)}),undo:zt(function(){Cn(this,"undo")}),redo:zt(function(){Cn(this,"redo")}),undoSelection:zt(function(){Cn(this,"undo",!0)}),redoSelection:zt(function(){Cn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ti(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:di(this.history.done),undone:di(this.history.undone)}},setHistory:function(e){var t=this.history=new ti(this.history.maxGeneration);t.done=di(e.done.slice(0),null,!0),t.undone=di(e.undone.slice(0),null,!0)},addLineClass:zt(function(e,t,n){return Dn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Hi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:zt(function(e,t,n){return Dn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Hi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:zt(function(e,t,n){return kr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Bn(this,me(this,e),me(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),Bn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=Gr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];i==e.line&&e.ch>s.to||null==s.from&&i!=e.line||i==t.line&&s.from>t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,void++n)}),me(this,Eo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new va(Xr(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new va(Xr(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Gn(r,Vn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Kn(Vn(this));break}}if(t.history==this.history){var i=[t.id];Ur(t,function(e){i.push(e.id)},!0),t.history=new ti(null),t.history.done=di(this.history.done,i),t.history.undone=di(this.history.undone,i)}},iterLinkedDocs:function(e){Ur(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),va.prototype.eachLine=va.prototype.iter;var ya="iter insert remove copy getEditor".split(" ");for(var ba in va.prototype)va.prototype.hasOwnProperty(ba)&&Ai(ya,ba)<0&&(e.prototype[ba]=function(e){return function(){return e.apply(this.doc,arguments)}}(va.prototype[ba]));Ci(va);var xa=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},_a=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},ka=e.e_stop=function(e){xa(e),_a(e)},wa=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Ca=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},Sa=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ma=null,La=30,Ta=e.Pass={toString:function(){return"CodeMirror.Pass"}},Aa={scroll:!1},za={origin:"*mouse"},Ea={origin:"+move"};Si.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Oa=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},qa=[""],Na=function(e){e.select()};ko?Na=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:po&&(Na=function(e){try{e.select()}catch(t){}});var Ia,Pa=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Da=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Pa.test(e))},ja=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ia=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Ra=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};po&&11>ho&&(Fi=function(){try{return document.activeElement}catch(e){return document.body}});var Wa,Fa,Ha=e.rmClass=function(e,t){var n=e.className,r=Hi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},$a=e.addClass=function(e,t){var n=e.className;Hi(t).test(n)||(e.className+=(n?" ":"")+t)},Ba=!1,Ua=function(){if(po&&9>ho)return!1;var e=ji("div");return"draggable"in e||"dragDrop"in e}(),Va=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ga=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Ka=function(){var e=ji("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Xa=null,Za={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Za,function(){for(var e=0;10>e;e++)Za[e+48]=Za[e+96]=String(e);for(var e=65;90>=e;e++)Za[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Za[e+111]=Za[e+63235]="F"+e}();var Ya,Qa=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],d=0;u>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,p=c;u>d;++d){var r=f[d];"m"==r?f[d]=p:p=r}for(var d=0,h=c;u>d;++d){var r=f[d];"1"==r&&"r"==h?f[d]="n":a.test(r)&&(h=r,"r"==r&&(f[d]="R"))}for(var d=1,p=f[0];u-1>d;++d){var r=f[d];"+"==r&&"1"==p&&"1"==f[d+1]?f[d]="1":","!=r||p!=f[d+1]||"1"!=p&&"n"!=p||(f[d]=p),p=r}for(var d=0;u>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var m=d+1;u>m&&"%"==f[m];++m);for(var g=d&&"!"==f[d-1]||u>m&&"1"==f[m]?"1":"N",v=d;m>v;++v)f[v]=g;d=m-1}}for(var d=0,h=c;u>d;++d){var r=f[d];"L"==h&&"1"==r?f[d]="L":a.test(r)&&(h=r)}for(var d=0;u>d;++d)if(o.test(f[d])){for(var m=d+1;u>m&&o.test(f[m]);++m);for(var y="L"==(d?f[d-1]:c),b="L"==(u>m?f[m]:c),g=y||b?"L":"R",v=d;m>v;++v)f[v]=g;d=m-1}for(var x,_=[],d=0;u>d;)if(l.test(f[d])){var k=d;for(++d;u>d&&l.test(f[d]);++d);_.push(new t(0,k,d))}else{var w=d,C=_.length;for(++d;u>d&&"L"!=f[d];++d);for(var v=w;d>v;)if(s.test(f[v])){v>w&&_.splice(C,0,new t(1,w,v));var S=v;for(++v;d>v&&s.test(f[v]);++v);_.splice(C,0,new t(2,S,v)),w=v}else++v;d>w&&_.splice(C,0,new t(1,w,d))}return 1==_[0].level&&(x=n.match(/^\s+/))&&(_[0].from=x[0].length,_.unshift(new t(0,0,x[0].length))),1==Ti(_).level&&(x=n.match(/\s+$/))&&(Ti(_).to-=x[0].length,_.push(new t(0,u-x[0].length,u))),2==_[0].level&&_.unshift(new t(1,_[0].to,_[0].to)),_[0].level!=Ti(_).level&&_.push(new t(_[0].level,u,u)),_}}();return e.version="5.2.0",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+"in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((t===!1?"":"^")+"(?:"+e+")",n)}function r(e){if(!e)return null;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}function i(e,i){(e.next||e.push)&&t(i,e.next||e.push),this.regex=n(e.regex),this.token=r(e.token),this.data=e}function o(e,t){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var a,o=r.local.mode.token(n,r.localState);return r.local.endScan&&(a=r.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),o}for(var s=e[r.state],c=0;c<s.length;c++){var u=s[c],f=(!u.data.sol||n.sol())&&n.match(u.regex);if(f){if(u.data.next?r.state=u.data.next:u.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=u.data.push):u.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),u.data.mode&&l(t,r,u.data.mode,u.token),u.data.indent&&r.indent.push(n.indentation()+t.indentUnit),u.data.dedent&&r.indent.pop(),f.length>2){r.pending=[];for(var d=2;d<f.length;d++)f[d]&&r.pending.push({text:f[d],token:u.token[d-1]});return n.backUp(f[0].length-(f[1]?f[1].length:0)),u.token[0]}return u.token&&u.token.join?u.token[0]:u.token}}return n.next(),null}}function a(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var r in e)if(e.hasOwnProperty(r)){if(!t.hasOwnProperty(r)||!a(e[r],t[r]))return!1;n++}for(var r in t)t.hasOwnProperty(r)&&n--;return 0==n}function l(t,r,i,o){var l;if(i.persistent)for(var s=r.persistentStates;s&&!l;s=s.next)(i.spec?a(i.spec,s.spec):i.mode==s.mode)&&(l=s);var c=l?l.mode:i.mode||e.getMode(t,i.spec),u=l?l.state:e.startState(c);i.persistent&&!l&&(r.persistentStates={mode:c,spec:i.spec,state:u,next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&i.forceEnd!==!1&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function s(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}function c(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&s(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,l=t[r.state];e:for(;;){for(var c=0;c<l.length;c++){var u=l[c];if(u.data.dedent&&u.data.dedentIfLineStart!==!1){var f=u.regex.exec(i);if(f&&f[0]){a--,(u.next||u.push)&&(l=t[u.next||u.push]),i=i.slice(f[0].length);continue e}}}break}return 0>a?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,"start");var a={},l=r.meta||{},s=!1;for(var u in r)if(u!=l&&r.hasOwnProperty(u))for(var f=a[u]=[],d=r[u],p=0;p<d.length;p++){var h=d[p];f.push(new i(h,r)),(h.indent||h.dedent)&&(s=!0)}var m={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:s?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:c(a,l)};if(l)for(var g in l)l.hasOwnProperty(g)&&(m[g]=l[g]);return m}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?n(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle;s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,f=0;f<r.length;++f){var d=r[f],s=n(l,d.open,i.pos);if(s==i.pos)return d.parseDelimiters||i.match(d.open),o.innerActive=d,o.inner=e.startState(d.mode,t.indent?t.indent(o.outer,""):0),d.delimStyle;-1!=s&&u>s&&(u=s)}u!=1/0&&(i.string=l.slice(0,u));var p=t.token(i,o.outer);return u!=1/0&&(i.string=l),p},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var i=n.innerActive?n.innerActive.mode:t;if(i.blankLine&&i.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var o=0;o<r.length;++o){var a=r[o];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,i.indent?i.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function r(e,r){for(var i=[],l=0;l<r.length;l++){var s=r[l];if(s.empty()){var c=e.getLineHandleVisualStart(s.head.line);i[i.length-1]!=c&&i.push(c)}}n(e.state.activeLines,i)||e.operation(function(){t(e);for(var n=0;n<i.length;n++)e.addLineClass(i[n],"wrap",o),e.addLineClass(i[n],"background",a);e.state.activeLines=i})}function i(e,t){r(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){var l=a&&a!=e.Init;o&&!l?(n.state.activeLines=[],
-r(n,n.listSelections()),n.on("beforeSelectionChange",i)):!o&&l&&(n.off("beforeSelectionChange",i),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):r(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,s=o.index+(o[0].length||1),s==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}return o&&u?{from:r(i.line,a),to:r(i.line,a+u),match:o}:void 0};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)t.length?this.matches=function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=n(s,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=n(s,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=s.length-1;if(t){if(n.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=r(n.line,c[i].length),a=n.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(l(f.slice(d))!=s[0])return;return{from:r(a,d),to:o}}if(!(n.line+(s.length-1)>e.lastLine())){var f=e.getLine(n.line),d=f.length-c[0].length;if(l(f.slice(d))==s[0]){for(var p=r(n.line,d),a=n.line+1,u=1;i>u;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:p,to:r(a,c[i].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(n>i)++r;else{if(!(i>n))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r,i=[],o=this.getSearchCursor(t,this.getCursor("from"),n);(r=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)i.push({anchor:o.from(),head:o.to()});i.length&&this.setSelections(i,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(n){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,n){var o=r(e);if(o.query)return u(e,n);var l=e.getSelection()||o.lastQuery;a(e,p,"Search for:",l,function(r){e.operation(function(){r&&!o.query&&(o.query=s(r),e.removeOverlay(o.overlay,i(o.query)),o.overlay=t(o.query,i(o.query)),e.addOverlay(o.overlay),e.showMatchesOnScrollbar&&(o.annotate&&(o.annotate.clear(),o.annotate=null),o.annotate=e.showMatchesOnScrollbar(o.query,i(o.query))),o.posFrom=o.posTo=e.getCursor(),u(e,n))})})}function u(t,n){t.operation(function(){var i=r(t),a=o(t,i.query,n?i.posFrom:i.posTo);(a.find(n)||(a=o(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),a.find(n)))&&(t.setSelection(a.from(),a.to()),t.scrollIntoView({from:a.from(),to:a.to()}),i.posFrom=a.from(),i.posTo=a.to())})}function f(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function d(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery;a(e,h,"Replace:",n,function(n){n&&(n=s(n),a(e,m,"Replace with:","",function(r){if(t)e.operation(function(){for(var t=o(e,n);t.findNext();)if("string"!=typeof n){var i=e.getRange(t.from(),t.to()).match(n);t.replace(r.replace(/\$(\d)/g,function(e,t){return i[t]}),"+input")}else t.replace(r,"+input")});else{f(e);var i=o(e,n,e.getCursor()),a=function(){var t,r=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||r&&i.from().line==r.line&&i.from().ch==r.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),l(e,g,"Replace?",[function(){s(t)},a]))},s=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]}),"+input"),a()};a()}}))})}}var p='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',h='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){f(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=f,e.commands.replace=d,e.commands.replaceAll=function(e){d(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a<this.matches.length;a++){var l=this.matches[a],s=n(l.from.line,r,o);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var c=n(l.to.line,r,o);c!=l.to.line&&(l.to=e.Pos(c,l.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout(function(){u.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){function i(t){var n=e.wheelEventPixels(t)["horizontal"==o.orientation?"x":"y"],r=o.pos;o.moveTo(o.pos+n),o.pos!=r&&e.e_preventDefault(t)}this.orientation=n,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+n,this.inner=this.node.appendChild(document.createElement("div"));var o=this;e.on(this.inner,"mousedown",function(t){function n(){e.off(document,"mousemove",r),e.off(document,"mouseup",n)}function r(e){return 1!=e.which?n():void o.moveTo(l+(e[i]-a)*(o.total/o.size))}if(1==t.which){e.e_preventDefault(t);var i="horizontal"==o.orientation?"pageX":"pageY",a=t[i],l=o.pos;e.on(document,"mousemove",r),e.on(document,"mouseup",n)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var n,r=o.inner.getBoundingClientRect();n="horizontal"==o.orientation?t.clientX<r.left?-1:t.clientX>r.right?1:0:t.clientY<r.top?-1:t.clientY>r.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))};var r=10;t.prototype.update=function(e,t,n){this.screen=t,this.total=e,this.size=n;var i=this.screen*(this.size/this.total);r>i&&(this.size-=r-i,i=r),this.inner.style["horizontal"==this.orientation?"width":"height"]=i-4+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},n.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var n=this.width||0,r=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},n.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.heightAtLine(e.lastLine()+1,"local");return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(s!=e.line&&(s=e.line,c=n.getLineHandle(s)),a&&c.height>l)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),l=a&&1.5*n.defaultTextHeight(),s=null,c=null;if(n.display.barWidth)for(var u,f=0;f<o.length;f++){for(var d=o[f],p=u||t(d.from,!0)*r,h=t(d.to,!1)*r;f<o.length-1&&(u=t(o[f+1].from,!0)*r,!(u>h+.9));)d=o[++f],h=t(d.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(2*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),n?r.className="CodeMirror-dialog CodeMirror-dialog-bottom":r.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s)}}o||(o={}),n(this,null);var l,s=t(this,r,o.bottom),c=!1,u=this,f=s.getElementsByTagName("input")[0];return f?(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))}),o.closeOnBlur!==!1&&e.on(f,"blur",a),f.focus()):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,l.parentNode.removeChild(l),u.focus())}n(this,null);var l=t(this,r,o&&o.bottom),s=l.getElementsByTagName("button"),c=!1,u=this,f=1;s[0].focus();for(var d=0;d<s.length;++d){var p=s[d];!function(t){e.on(p,"click",function(n){e.e_preventDefault(n),a(),t&&t(u)})}(i[d]),e.on(p,"blur",function(){--f,setTimeout(function(){0>=f&&a()},200)}),e.on(p,"focus",function(){++f})}}),e.defineExtension("openNotification",function(r,i){function o(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}n(this,o);var a,l=t(this,r,i&&i.bottom),s=!1,c=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),s=t.ch-1,c=s>=0&&l[o.text.charAt(s)]||l[o.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(s==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,s+1)),d=n(e,a(t.line,s+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,s),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(0>n?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=l[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var u=s[c].empty()&&t(e,s[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:f})),u.to&&e.getLine(u.to.line).length<=i&&l.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:f}))}}if(l.length){o&&e.state.focused&&e.focus();var d=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(!n)return d;setTimeout(d,800)}}function i(e){e.operation(function(){s&&(s(),s=null),s=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return a(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var u=a[l].head;n.replaceRange("",f(u.line,u.ch-1),f(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null,"+input"),n.execCommand("goCharLeft"),a=n.listSelections();for(var e=0;e<a.length;e++){var t=a[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function a(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var a=t(o,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var u,d,p=t(o,"triples"),h=a.charAt(s+1)==i,m=n.listSelections(),g=s%2==0,v=0;v<m.length;v++){var y,b=m[v],x=b.head,d=n.getRange(x,f(x.line,x.ch+1));if(g&&!b.empty())y="surround";else if(!h&&g||d!=i)if(h&&x.ch>1&&p.indexOf(i)>=0&&n.getRange(f(x.line,x.ch-2),x)==i+i&&(x.ch<=2||n.getRange(f(x.line,x.ch-3),f(x.line,x.ch-2))!=i))y="addFour";else if(h){if(e.isWordChar(d)||!c(n,x,i))return e.Pass;y="both"}else{if(!g||n.getLine(x.line).length!=x.ch&&!l(d,a)&&!/\s/.test(d))return e.Pass;y="both"}else y=p.indexOf(i)>=0&&n.getRange(x,f(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=y)return e.Pass}else u=y}var _=s%2?a.charAt(s-1):i,k=s%2?i:a.charAt(s+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=_+t[e]+k;n.replaceSelections(t,"around","+input")}else"both"==u?(n.replaceSelection(_+k,null,"+input"),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(_+_+_+_,"before","+input"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function s(e,t){var n=e.getRange(f(t.line,t.ch-1),f(t.line,t.ch+1));return 2==n.length?n:null}function c(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var l=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},f=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(p),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(p))});for(var d=u.pairs+"`",p={Backspace:i,Enter:o},h=0;h<d.length;h++)p["'"+d.charAt(h)+"'"]=n(d.charAt(h))}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var o=e.findMatchingTag(n,r,i);if(o){if(n.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),r=[],s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var c=n[s].head,u=t.getTokenAt(c),f=e.innerMode(t.getMode(),u.state),d=f.state;if("xml"!=f.mode.name||!d.tagName)return e.Pass;var p=t.getOption("autoCloseTags"),h="html"==f.mode.configuration,m="object"==typeof p&&p.dontCloseTags||h&&a,g="object"==typeof p&&p.indentTags||h&&l,v=d.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==d.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,d,!0))return e.Pass;var b=g&&i(g,y)>-1;r[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=n.length-1;s>=0;s--){var x=r[s];t.replaceRange(x.text,n[s].head,n[s].anchor,"+input");var _=t.listSelections().slice(0);_[s]={head:x.newPos,anchor:x.newPos},t.setSelections(_),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":"</",l=0;l<r.length;l++){if(!r[l].empty())return e.Pass;var s=r[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),f=u.state;if(n&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)i[l]=a+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;i[l]=a+"style>"}else{if(!f.context||!f.context.tagName||o(t,f.context.tagName,s,f))return e.Pass;i[l]=a+f.context.tagName+">"}}t.replaceSelections(i,null,"+input"),r=t.listSelections();for(var l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&t.indentLine(r[l].head.line)}function r(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=n)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==n;s=s.prev)++c;r=l.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,r,null,a);if(!f||f.tag!=n)return!1;r=f.to}return!0}e.defineOption("autoCloseTags",!1,function(n,i,o){if(o!=e.Init&&o&&n.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return r(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s|\[x\]\s|\s*)/,n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\[\s\]\s*|\[x\]\s|\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,d=i.getLine(s.line),p=t.exec(d);if(!o[l].empty()||!u&&!f||!p)return void i.execCommand("newlineAndIndent");if(n.test(d))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1},"+delete"),a[l]="\n";else{var h=p[1],m=p[4],g=r.test(p[2])||p[2].indexOf(">")>=0?p[2]:parseInt(p[3],10)+1+".";a[l]="\n"+h+g+m}}i.replaceSelections(a,null,"+input")}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(r);return-1==t?0:t}var n={},r=/[^\s\u00a0]/,i=e.Pos;e.commands.toggleComment=function(e){for(var t=1/0,n=e.listSelections(),r=null,o=n.length-1;o>=0;o--){var a=n[o].from(),l=n[o].to();a.line>=t||(l.line>=t&&(l=i(t,0)),t=a.line,null==r?e.uncomment(a,l)?r="un":(e.lineComment(a,l),r="line"):"un"==r?e.uncomment(a,l):e.lineComment(a,l))}},e.defineExtension("lineComment",function(e,o,a){a||(a=n);var l=this,s=l.getModeAt(e),c=a.lineComment||s.lineComment;if(!c)return void((a.blockCommentStart||s.blockCommentStart)&&(a.fullLines=!0,l.blockComment(e,o,a)));var u=l.getLine(e.line);if(null!=u){var f=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,l.lastLine()+1),d=null==a.padding?" ":a.padding,p=a.commentBlankLines||e.line==o.line;l.operation(function(){if(a.indent)for(var n=u.slice(0,t(u)),o=e.line;f>o;++o){var s=l.getLine(o),h=n.length;(p||r.test(s))&&(s.slice(0,h)!=n&&(h=t(s)),l.replaceRange(n+c+d,i(o,0),i(o,h)))}else for(var o=e.line;f>o;++o)(p||r.test(l.getLine(o)))&&l.replaceRange(c+d,i(o,0))})}}),e.defineExtension("blockComment",function(e,t,o){o||(o=n);var a=this,l=a.getModeAt(e),s=o.blockCommentStart||l.blockCommentStart,c=o.blockCommentEnd||l.blockCommentEnd;if(!s||!c)return void((o.lineComment||l.lineComment)&&0!=o.fullLines&&a.lineComment(e,t,o));var u=Math.min(t.line,a.lastLine());u!=e.line&&0==t.ch&&r.test(a.getLine(u))&&--u;var f=null==o.padding?" ":o.padding;e.line>u||a.operation(function(){if(0!=o.fullLines){var n=r.test(a.getLine(u));a.replaceRange(f+c,i(u)),a.replaceRange(s+f,i(e.line,0));var d=o.blockCommentLead||l.blockCommentLead;if(null!=d)for(var p=e.line+1;u>=p;++p)(p!=u||n)&&a.replaceRange(d+f,i(p,0))}else a.replaceRange(c,t),a.replaceRange(s,e)})}),e.defineExtension("uncomment",function(e,t,o){o||(o=n);var a,l=this,s=l.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,l.lastLine()),u=Math.min(e.line,c),f=o.lineComment||s.lineComment,d=[],p=null==o.padding?" ":o.padding;e:if(f){for(var h=u;c>=h;++h){var m=l.getLine(h),g=m.indexOf(f);if(g>-1&&!/comment/.test(l.getTokenTypeAt(i(h,g+1)))&&(g=-1),-1==g&&(h!=c||h==u)&&r.test(m))break e;if(g>-1&&r.test(m.slice(0,g)))break e;d.push(m)}if(l.operation(function(){for(var e=u;c>=e;++e){var t=d[e-u],n=t.indexOf(f),r=n+f.length;0>n||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,l.replaceRange("",i(e,n),i(e,r)))}}),a)return!0}var v=o.blockCommentStart||s.blockCommentStart,y=o.blockCommentEnd||s.blockCommentEnd;if(!v||!y)return!1;var b=o.blockCommentLead||s.blockCommentLead,x=l.getLine(u),_=c==u?x:l.getLine(c),k=x.indexOf(v),w=_.lastIndexOf(y);if(-1==w&&u!=c&&(_=l.getLine(--c),w=_.lastIndexOf(y)),-1==k||-1==w||!/comment/.test(l.getTokenTypeAt(i(u,k+1)))||!/comment/.test(l.getTokenTypeAt(i(c,w+1))))return!1;var C=x.lastIndexOf(v,e.ch),S=-1==C?-1:x.slice(0,e.ch).indexOf(y,C+v.length);if(-1!=C&&-1!=S&&S+y.length!=e.ch)return!1;S=_.indexOf(y,t.ch);var M=_.slice(t.ch).lastIndexOf(v,S-t.ch);return C=-1==S||-1==M?-1:t.ch+M,-1!=S&&-1!=C&&C!=t.ch?!1:(l.operation(function(){l.replaceRange("",i(c,w-(p&&_.slice(w-p.length,w)==p?p.length:0)),i(c,w+y.length));var e=k+v.length;if(p&&x.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",i(u,k),i(u,e)),b)for(var t=u+1;c>=t;++t){var n=l.getLine(t),o=n.indexOf(b);if(-1!=o&&!r.test(n.slice(0,o))){var a=o+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),l.replaceRange("",i(t,o),i(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror);
+return!0}var l=t.line,s=t.ch,c=n,u=Xr(e,l),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var d=null,p="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(0>n)||a(!m);m=!1){var g=u.text.charAt(s)||"\n",v=Di(g,h)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||m||v||(v="s"),d&&d!=v){0>n&&(n=1,a());break}if(v&&(d=v),n>0&&!a(!m))break}var y=Oe(e,Oo(l,s),c,!0);return f||(y.hitSide=!0),y}function Hn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function $n(t,n,r,i){e.defaults[t]=n,r&&(Zo[t]=i?function(e,t,n){n!=Yo&&r(e,t,n)}:r)}function Bn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Un(e){return"string"==typeof e?aa[e]:e}function Vn(e,t,n,r,i){if(r&&r.shared)return Gn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return zt(e.cm,Vn)(e,t,n,r,i);var o=new da(e,i),a=No(t,n);if(r&&Ii(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ri("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(mr(e,t.line,t,n,o)||t.line!=n.line&&mr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");qo=!0}o.addToHistory&&li(e,{from:t,to:n,origin:"markText"},e.sel,0/0);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&gr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Qr(e,0),er(e,new Yn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){xr(e,t)&&Qr(t,0)}),o.clearOnEnter&&Sa(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Eo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)It(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Pt(c,u,"text");o.atomic&&Ee(c.doc),_i(c,"markerAdded",c,o)}return o}function Gn(e,t,n,r,i){r=Ii(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Gr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,ve(e,t),ve(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=zi(o)}),new pa(o,a)}function Kn(e){return e.findMarks(Oo(e.first,0),e.clipPos(Oo(e.lastLine())),function(e){return e.parent})}function Xn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(No(o,a)){var l=Vn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Zn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Gr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Ei(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Yn(e,t,n){this.marker=e,this.from=t,this.to=n}function Qn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Jn(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function er(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function tr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Yn(a,o.from,s?null:o.to))}}return r}function nr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Yn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function rr(e,t){if(t.full)return null;var n=be(e,t.from.line)&&Xr(e,t.from.line).markedSpans,r=be(e,t.to.line)&&Xr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==No(t.from,t.to),l=tr(n,i,a),s=nr(r,o,a),c=1==t.text.length,u=zi(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var d=l[f];if(null==d.to){var p=Qn(s,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=i}}if(s)for(var f=0;f<s.length;++f){var d=s[f];if(null!=d.to&&(d.to+=u),null==d.from){var p=Qn(l,d.marker);p||(d.from=u,c&&(l||(l=[])).push(d))}else d.from+=u,c&&(l||(l=[])).push(d)}l&&(l=ir(l)),s&&s!=l&&(s=ir(s));var h=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Yn(l[f].marker,null,null));for(var f=0;g>f;++f)h.push(m);h.push(s)}return h}function ir(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function or(e,t){var n=pi(e,t),r=rr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function ar(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Ei(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(No(c.to,l.from)<0||No(c.from,l.to)>0)){var u=[s,1],f=No(c.from,l.from),d=No(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function lr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function sr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function cr(e){return e.inclusiveLeft?-1:0}function ur(e){return e.inclusiveRight?1:0}function fr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=No(r.from,i.from)||cr(e)-cr(t);if(o)return-o;var a=No(r.to,i.to)||ur(e)-ur(t);return a?a:t.id-e.id}function dr(e,t){var n,r=qo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||fr(n,i.marker)<0)&&(n=i.marker);return n}function pr(e){return dr(e,!0)}function hr(e){return dr(e,!1)}function mr(e,t,n,r,i){var o=Xr(e,t),a=qo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=No(c.from,n)||cr(s.marker)-cr(i),f=No(c.to,r)||ur(s.marker)-ur(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(No(c.to,n)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||u>=0&&(No(c.from,r)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function gr(e){for(var t;t=pr(e);)e=t.find(-1,!0).line;return e}function vr(e){for(var t,n;t=hr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function yr(e,t){var n=Xr(e,t),r=gr(n);return n==r?t:Jr(r)}function br(e,t){if(t>e.lastLine())return t;var n,r=Xr(e,t);if(!xr(e,r))return t;for(;n=hr(r);)r=n.find(1,!0).line;return Jr(r)+1}function xr(e,t){var n=qo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&_r(e,t,r))return!0}}function _r(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return _r(e,r.line,Qn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&_r(e,t,i))return!0}function kr(e,t,n){ti(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&In(e,null,n)}function wr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Wa(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Hi(t.display.measure,Ri("div",[e.node],null,n))}return e.height=e.node.offsetHeight}function Cr(e,t,n,r){var i=new ha(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Fn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!xr(e,t)){var r=ti(t)<e.scrollTop;Qr(t,t.height+wr(i)),r&&In(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Sr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),lr(e),sr(e,n);var i=r?r(e):1;i!=e.height&&Qr(e,i)}function Mr(e){e.parent=null,lr(e)}function Lr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Tr(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Ar(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function zr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?ra(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=ve(a,t);var s,c=Xr(a,t.line),u=He(e,t.line,n),f=new ua(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Ar(l,f,u),r&&s.push(i(!0));return r?s:i()}function Er(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ua(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&Lr(Tr(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Nr(e,t,r,f.pos),f.pos=t.length,s=null):s=Lr(Ar(n,f,r,d),o),d){var p=d[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var h=Math.min(f.pos,c+5e4);i(h,u),c=h}}function qr(e,t,n,r){var i=[e.state.modeGen],o={};Er(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Er(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Or(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=qr(e,t,t.stateAfter=He(e,Jr(t)));t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Nr(e,t,n,r){var i=e.doc.mode,o=new ua(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Tr(i,n);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Ar(i,o,n),o.start=o.pos}function Ir(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?va:ga;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Pr(e,t){var n=Ri("span",null,null,vo?"padding-right: .1px":null),r={pre:Ri("pre",[n]),content:n,col:0,pos:0,cm:e,splitSpaces:(mo||vo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=jr,Zi(e.display.measure)&&(o=ni(a))&&(r.addToken=Rr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&Jr(a);Hr(a,r,Or(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Ui(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Ui(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Xi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return vo&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),La(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ui(r.pre.className,r.textClass||"")),r}function Dr(e){var t=Ri("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function jr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,Fr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var d=s.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(l.slice(f,f+p));u.appendChild(mo&&9>go?Ri("span",[h]):h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1," "==d[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild(Ri("span",Ai(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=g}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),u.appendChild(mo&&9>go?Ri("span",[h]):h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),mo&&9>go&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=Ri("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Fr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function Rr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var d=t[f];if(d.to>c&&d.from<=c)break}if(d.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,d.to-c),i,o,null,l,s),o=null,r=r.slice(d.to-c),c=d.to}}}function Wr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Hr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){s=c=u=f=l="",d=null,v=1/0;for(var y=[],b=0;b<r.length;++b){var x=r[b],_=x.marker;"bookmark"==_.type&&x.from==h&&_.widgetNode?y.push(_):x.from<=h&&(null==x.to||x.to>h||_.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),_.className&&(s+=" "+_.className),_.css&&(l=_.css),_.startStyle&&x.from==h&&(u+=" "+_.startStyle),_.endStyle&&x.to==v&&(c+=" "+_.endStyle),_.title&&!f&&(f=_.title),_.collapsed&&(!d||fr(d.marker,_)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(d&&(d.from||0)==h){if(Wr(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}if(!d&&y.length)for(var b=0;b<y.length;++b)Wr(t,0,y[b])}if(h>=p)break;for(var k=Math.min(p,v);;){if(g){var w=h+g.length;if(!d){var C=w>k?g.slice(0,k-h):g;t.addToken(t,C,a?a+s:s,u,h+C.length==v?c:"",f,l)}if(w>=k){g=g.slice(k-h),h=k;break}h=w,u=""}g=i.slice(o,o=n[m++]),a=Ir(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Ir(n[m+1],t.cm.options))}function $r(e,t){return 0==t.from.ch&&0==t.to.ch&&""==zi(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Br(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Sr(e,n,i,r),_i(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new ma(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Xr(e,l.line),f=Xr(e,s.line),d=zi(c),p=i(c.length-1),h=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if($r(e,t)){var m=a(0,c.length-1);o(f,f.text,p),h&&e.remove(l.line,h),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),p);else{var m=a(1,c.length-1);m.push(new ma(d+u.text.slice(s.ch),p,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,h);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,d+f.text.slice(s.ch),p);var m=a(1,c.length-1);h>1&&e.remove(l.line+1,h-1),e.insert(l.line+1,m)}_i(e,"change",e,t)}function Ur(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Vr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Gr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;(!n||s)&&(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Kr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||d(e),e.options.mode=t.modeOption,It(e)}function Xr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Zr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Yr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Qr(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Jr(e){if(null==e.parent)return null;for(var t=e.parent,n=Ei(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ei(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ti(e){e=gr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ni(e){var t=e.order;return null==t&&(t=e.order=el(e.text)),t}function ri(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ii(e,t){var n={from:K(t.from),to:Ko(t),text:Zr(e,t.from,t.to)};return fi(e,n,t.from.line,t.to.line+1),Gr(e,function(e){fi(e,n,t.from.line,t.to.line+1)},!0),n}function oi(e){for(;e.length;){var t=zi(e);if(!t.ranges)break;e.pop()}}function ai(e,t){return t?(oi(e.done),zi(e.done)):e.done.length&&!zi(e.done).ranges?zi(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),zi(e.done)):void 0}function li(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ai(i,i.lastOp==r))){var l=zi(o.changes);0==No(t.from,t.to)&&0==No(t.from,l.to)?l.to=Ko(t):o.changes.push(ii(e,t))}else{var s=zi(i.done);for(s&&s.ranges||ui(e.sel,i.done),o={changes:[ii(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||La(e,"historyAdded")}}function si(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ci(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||si(e,o,zi(i.done),t))?i.done[i.done.length-1]=t:ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&oi(i.undone)}function ui(e,t){var n=zi(t);n&&n.ranges&&n.equals(e)||t.push(e)}function fi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function di(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function pi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(di(n[r]));return i}function hi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?de.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Ei(t,Number(c[1]))>-1&&(zi(l)[f]=u[f],delete u[f])}}}return i}function mi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function gi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)mi(o.ranges[l].anchor,t,n,r),mi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=Oo(s.from.line+r,s.from.ch),s.to=Oo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function vi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;gi(e.done,n,r,i),gi(e.undone,n,r,i)}function yi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function bi(e){return e.target||e.srcElement}function xi(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Mo&&e.ctrlKey&&1==t&&(t=3),t}function _i(e,t){function n(e){return function(){e.apply(null,o)}}var r=e._handlers&&e._handlers[t];if(r){var i,o=Array.prototype.slice.call(arguments,2);Ro?i=Ro.delayedCallbacks:Ta?i=Ta:(i=Ta=[],setTimeout(ki,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function ki(){var e=Ta;Ta=null;for(var t=0;t<e.length;++t)e[t]()}function wi(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),La(e,n||t.type,e,t),yi(t)||t.codemirrorIgnore}function Ci(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Ei(n,t[r])&&n.push(t[r])}function Si(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function Mi(e){e.prototype.on=function(e,t){Sa(this,e,t)},e.prototype.off=function(e,t){Ma(this,e,t)}}function Li(){this.id=null}function Ti(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}function Ai(e){for(;Ia.length<=e;)Ia.push(zi(Ia)+" ");return Ia[e]}function zi(e){return e[e.length-1]}function Ei(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function qi(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Oi(){}function Ni(e,t){var n;return Object.create?n=Object.create(e):(Oi.prototype=e,n=new Oi),t&&Ii(t,n),n}function Ii(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Pi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Di(e,t){return t?t.source.indexOf("\\w")>-1&&Fa(e)?!0:t.test(e):Fa(e)}function ji(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Fi(e){return e.charCodeAt(0)>=768&&Ra.test(e)}function Ri(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Wi(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Hi(e,t){return Wi(e).appendChild(t)}function $i(){return document.activeElement}function Bi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Ui(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Bi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Vi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Gi(){Va||(Ki(),Va=!0)}function Ki(){var e;Sa(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Vi(Bt)},100))}),Sa(window,"blur",function(){Vi(gn)})}function Xi(e){if(null==Ha){var t=Ri("span","​");Hi(e,Ri("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ha=t.offsetWidth<=1&&t.offsetHeight>2&&!(mo&&8>go))}var n=Ha?Ri("span","​"):Ri("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Zi(e){if(null!=$a)return $a;var t=Hi(e,document.createTextNode("AخA")),n=Da(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Da(t,1,2).getBoundingClientRect();return $a=r.right-n.right<3}function Yi(e){if(null!=Ya)return Ya;var t=Hi(e,Ri("span","x")),n=t.getBoundingClientRect(),r=Da(t,0,1).getBoundingClientRect();return Ya=Math.abs(n.left-r.left)>1}function Qi(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function Ji(e){return e.level%2?e.to:e.from}function eo(e){return e.level%2?e.from:e.to}function to(e){var t=ni(e);return t?Ji(t[0]):0}function no(e){var t=ni(e);return t?eo(zi(t)):e.text.length}function ro(e,t){var n=Xr(e.doc,t),r=gr(n);r!=n&&(t=Jr(r));var i=ni(r),o=i?i[0].level%2?no(r):to(r):0;return Oo(t,o)}function io(e,t){for(var n,r=Xr(e.doc,t);n=hr(r);)r=n.find(1,!0).line,t=null;var i=ni(r),o=i?i[0].level%2?to(r):no(r):r.text.length;return Oo(null==t?Jr(r):t,o)}function oo(e,t){var n=ro(e,t.line),r=Xr(e.doc,n.line),i=ni(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Oo(n.line,a?0:o)}return n}function ao(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function lo(e,t){Ja=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return ao(e,i.level,e[n].level)?(i.from!=i.to&&(Ja=n),r):(i.from!=i.to&&(Ja=r),n);n=r}}return n}function so(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Fi(e.text.charAt(t)));return t}function co(e,t,n,r){var i=ni(e);if(!i)return uo(e,t,n,r);for(var o=lo(i,t),a=i[o],l=so(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return lo(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?so(e,a.to,-1,r):so(e,a.from,1,r)}}function uo(e,t,n,r){var i=t+n;if(r)for(;i>0&&Fi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var fo=/gecko\/\d/i.test(navigator.userAgent),po=/MSIE \d/.test(navigator.userAgent),ho=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mo=po||ho,go=mo&&(po?document.documentMode||6:ho[1]),vo=/WebKit\//.test(navigator.userAgent),yo=vo&&/Qt\/\d+\.\d+/.test(navigator.userAgent),bo=/Chrome\//.test(navigator.userAgent),xo=/Opera\//.test(navigator.userAgent),_o=/Apple Computer/.test(navigator.vendor),ko=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),wo=/PhantomJS/.test(navigator.userAgent),Co=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),So=Co||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Mo=Co||/Mac/.test(navigator.platform),Lo=/win/i.test(navigator.platform),To=xo&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);To&&(To=Number(To[1])),To&&To>=15&&(xo=!1,vo=!0);var Ao=Mo&&(yo||xo&&(null==To||12.11>To)),zo=fo||mo&&go>=9,Eo=!1,qo=!1;m.prototype=Ii({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==r&&this.overlayHack(),this.checkedOverlay=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=Mo&&!ko?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,n=function(e){bi(e)!=t.vert&&bi(e)!=t.horiz&&zt(t.cm,Gt)(e)};Sa(this.vert,"mousedown",n),Sa(this.horiz,"mousedown",n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Ii({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Si(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)La.apply(null,this.events[e])};var Oo=e.Pos=function(e,t){return this instanceof Oo?(this.line=e,void(this.ch=t)):new Oo(e,t)},No=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Io=null;ie.prototype=Ii({init:function(e){function t(e){if(r.somethingSelected())Io=r.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Io.join("\n"),Pa(o));else{if(!r.options.lineWiseCopyCut)return;var t=ne(r);Io=t.text,"cut"==e.type?r.setSelections(t.ranges,null,Ea):(n.prevInput="",o.value=t.text.join("\n"),Pa(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}var n=this,r=this.cm,i=this.wrapper=oe(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),Co&&(o.style.width="0px"),Sa(o,"input",function(){mo&&go>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Sa(o,"paste",function(e){return ee(e,r)?!0:(r.state.pasteIncoming=!0,void n.fastPoll())}),Sa(o,"cut",t),Sa(o,"copy",t),Sa(e.scroller,"paste",function(t){Ut(e,t)||(r.state.pasteIncoming=!0,n.focus())}),Sa(e.lineSpace,"selectstart",function(t){Ut(e,t)||ka(t)}),Sa(o,"compositionstart",function(){var e=r.getCursor("from");n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Sa(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Ie(e);if(e.options.moveInputWithCursor){var i=pt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Hi(n.cursorDiv,e.cursors),Hi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=Za&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();
+this.composing||(this.textarea.value=a),r.state.focused&&Pa(this.textarea),mo&&go>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),mo&&go>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!So||$i()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Xa(t)&&!n||Q(e)||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(mo&&go>=9&&this.hasSelection===r||Mo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){J(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){mo&&go>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.position="relative",a.style.cssText=u,mo&&9>go&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!mo||mo&&9>go)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?zt(i,oa.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Vt(i,e),s=o.scroller.scrollTop;if(l&&!xo){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&zt(i,Te)(i.doc,me(l),Ea);var u=a.style.cssText;if(r.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(mo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",vo)var f=window.scrollY;if(o.input.focus(),vo&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),mo&&go>=9&&t(),zo){Ca(e);var d=function(){Ma(window,"mouseup",d),setTimeout(n,20)};Sa(window,"mouseup",d)}else setTimeout(n,50)}},setUneditable:Oi,needsContentAttribute:!1},ie.prototype),ae.prototype=Ii({init:function(e){function t(e){if(r.somethingSelected())Io=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ne(r);Io=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Ea),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Co)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Io.join("\n"));else{var n=oe(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Io.join("\n");var o=document.activeElement;Pa(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}var n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable="true",re(i),Sa(i,"paste",function(e){ee(e,r)}),Sa(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=me(Oo(i.head.line,a),Oo(i.head.line,a+t.length)))}}),Sa(i,"compositionupdate",function(e){n.composing.data=e.data}),Sa(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Sa(i,"touchstart",function(){n.forceCompositionEnd()}),Sa(i,"input",function(){n.composing||n.pollContent()||At(n.cm,function(){It(r)})}),Sa(i,"copy",t),Sa(i,"cut",t)},prepareSelection:function(){var e=Ie(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=ce(this.cm,e.anchorNode,e.anchorOffset),r=ce(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=No(Z(n,r),t.from())||0!=No(X(n,r),t.to())){var i=le(this.cm,t.from()),o=le(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Da(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(e.removeAllRanges(),e.addRange(u),l&&null==e.anchorNode?e.addRange(l):fo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Hi(this.cm.display.cursorDiv,e.cursors),Hi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Wa(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=ce(t,e.anchorNode,e.anchorOffset),r=ce(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,me(n,r),Ea),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=jt(e,r.line)))var a=Jr(t.view[0].line),l=t.view[0].node;else var a=Jr(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=jt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=Jr(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=Ka(fe(e,l,u,a,c)),d=Zr(e.doc,Oo(a,0),Oo(c,Xr(e.doc,c).text.length));f.length>1&&d.length>1;)if(zi(f)==zi(d))f.pop(),d.pop(),c--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);v>p&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=zi(f),b=zi(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;f[f.length-1]=y.slice(0,y.length-h),f[0]=f[0].slice(p);var _=Oo(a,p),k=Oo(c,d.length?zi(d).length-h:0);return f.length>1||f[0]||No(_,k)?(zn(e.doc,f,_,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&zt(this.cm,J)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),zt(this.cm,J)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:Oi,resetPosition:Oi,needsContentAttribute:!0},ae.prototype),e.inputStyles={textarea:ie,contenteditable:ae},de.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=No(n.anchor,r.anchor)||0!=No(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new pe(K(this.ranges[t].anchor),K(this.ranges[t].head));return new de(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(No(t,r.from())>=0&&No(e,r.to())<=0)return n}return-1}},pe.prototype={from:function(){return Z(this.anchor,this.head)},to:function(){return X(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Po,Do,jo,Fo={left:0,right:0,top:0,bottom:0},Ro=null,Wo=0,Ho=0,$o=0,Bo=null;mo?Bo=-.53:fo?Bo=15:bo?Bo=-.7:_o&&(Bo=-1/3);var Uo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Uo(e);return t.x*=Bo,t.y*=Bo,t};var Vo=new Li,Go=null,Ko=e.changeEnd=function(e){return e.text?Oo(e.from.line+e.text.length-1,zi(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,Zo.hasOwnProperty(e)&&zt(this,Zo[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Un(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Et(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,It(this)}),removeOverlay:Et(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void It(this)}}),indentLine:Et(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),be(this.doc,e)&&jn(this,e,t,n)}),indentSelection:Et(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(jn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Pn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)jn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&Ce(this.doc,r,new pe(o,c[r].to()),Ea)}}}),getTokenAt:function(e,t){return zr(this,e,t)},getLineTokens:function(e,t){return zr(this,Oo(e),t,!0)},getTokenTypeAt:function(e){e=ve(this.doc,e);var t,n=Or(this,Xr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!na.hasOwnProperty(t))return n;var r=na[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Ei(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=ge(n,null==e?n.first+n.size-1:e),He(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?ve(this.doc,e):e?r.from():r.to(),pt(this,n,t||"page")},charCoords:function(e,t){return dt(this,ve(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ei(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Xr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ti(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Et(function(e,t,n){return Fn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ji(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Et(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Pt(t,r,"gutter"),ji(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!be(this.doc,e))return null;var t=e;if(e=Xr(this.doc,e),!e)return null}else{var t=Jr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=pt(this,ve(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&On(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Et(un),triggerOnKeyPress:Et(pn),triggerOnKeyUp:dn,execCommand:function(e){return oa.hasOwnProperty(e)?oa[e](this):void 0},triggerElectric:Et(function(e){te(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=ve(this.doc,e);t>o&&(a=Wn(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Et(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Wn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},Oa)}),deleteH:Et(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Rn(this,function(n){var i=Wn(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=ve(this.doc,e);t>a;++a){var s=pt(this,l,"div");if(null==o?o=s.left:s.left=o,l=Hn(this,s,i,n),l.hitSide)break}return l},moveV:Et(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=pt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Hn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&In(n,null,dt(n,s,"div").top-l.top),s},Oa),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Xr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=Di(a,o)?function(e){return Di(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Di(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new pe(Oo(e.line,r),Oo(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Ua(this.display.cursorDiv,"CodeMirror-overwrite"):Ba(this.display.cursorDiv,"CodeMirror-overwrite"),La(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==$i()},scrollTo:Et(function(e,t){(null!=e||null!=t)&&Dn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ve(this)-this.display.barHeight,width:e.scrollWidth-Ve(this)-this.display.barWidth,clientHeight:Ke(this),clientWidth:Ge(this)}},scrollIntoView:Et(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Oo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Dn(this),this.curOp.scrollToPos=e;else{var n=Nn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Et(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&at(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Pt(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,La(r,"refresh",this)}),operation:function(e){return At(this,e)},refresh:Et(function(){var e=this.display.cachedTextHeight;It(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&a(this),La(this,"refresh",this)}),swapDoc:Et(function(e){var t=this.doc;return t.cm=null,Kr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_i(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Mi(e);var Xo=e.defaults={},Zo=e.optionHandlers={},Yo=e.Init={toString:function(){return"CodeMirror.Init"}};$n("value","",function(e,t){e.setValue(t)},!0),$n("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),$n("indentUnit",2,n,!0),$n("indentWithTabs",!1),$n("smartIndent",!0),$n("tabSize",4,function(e){r(e),lt(e),It(e)},!0),$n("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),$n("specialCharPlaceholder",Dr,function(e){e.refresh()},!0),$n("electricChars",!0),$n("inputStyle",So?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),$n("rtlMoveVisually",!Lo),$n("wholeLineUpdateBefore",!0),$n("theme","default",function(e){l(e),s(e)},!0),$n("keyMap","default",function(t,n,r){var i=Un(n),o=r!=e.Init&&Un(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),$n("extraKeys",null),$n("lineWrapping",!1,i,!0),$n("gutters",[],function(e){p(e.options),s(e)},!0),$n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),$n("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),$n("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),$n("lineNumbers",!1,function(e){p(e.options),s(e)},!0),$n("firstLineNumber",1,s,!0),$n("lineNumberFormatter",function(e){return e},s,!0),$n("showCursorWhenSelecting",!1,Ne,!0),$n("resetSelectionOnContextMenu",!0),$n("lineWiseCopyCut",!0),$n("readOnly",!1,function(e,t){"nocursor"==t?(gn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),$n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),$n("dragDrop",!0,$t),$n("cursorBlinkRate",530),$n("cursorScrollMargin",0),$n("cursorHeight",1,Ne,!0),$n("singleCursorHeightPerLine",!0,Ne,!0),$n("workTime",100),$n("workDelay",100),$n("flattenSpans",!0,r,!0),$n("addModeClass",!1,r,!0),$n("pollInterval",100),$n("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),$n("historyEventDelay",1250),$n("viewportMargin",10,function(e){e.refresh()},!0),$n("maxHighlightLength",1e4,r,!0),$n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),$n("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),$n("autofocus",null);var Qo=e.modes={},Jo=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Qo[t]=n},e.defineMIME=function(e,t){Jo[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Jo.hasOwnProperty(t))t=Jo[t];else if(t&&"string"==typeof t.name&&Jo.hasOwnProperty(t.name)){var n=Jo[t.name];"string"==typeof n&&(n={name:n}),t=Ni(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=Qo[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(ea.hasOwnProperty(n.name)){var o=ea[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ea=e.modeExtensions={};e.extendMode=function(e,t){var n=ea.hasOwnProperty(e)?ea[e]:ea[e]={};Ii(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){ba.prototype[e]=t},e.defineOption=$n;var ta=[];e.defineInitHook=function(e){ta.push(e)};var na=e.helpers={};e.registerHelper=function(t,n,r){na.hasOwnProperty(t)||(na[t]=e[t]={_global:[]}),na[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),na[t]._global.push({pred:r,val:i})};var ra=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ia=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var oa=e.commands={selectAll:function(e){e.setSelection(Oo(e.firstLine(),0),Oo(e.lastLine()),Ea)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ea)},killLine:function(e){Rn(e,function(t){if(t.empty()){var n=Xr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Oo(t.head.line+1,0)}:{from:t.head,to:Oo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Rn(e,function(t){return{from:Oo(t.from().line,0),to:ve(e.doc,Oo(t.to().line+1,0))}})},delLineLeft:function(e){Rn(e,function(e){return{from:Oo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Rn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Rn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Oo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Oo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return ro(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return io(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Oa)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Oa)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?oo(e,t.head):r},Oa)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Na(e.getLine(o.line),o.ch,r);t.push(new Array(r-a%r+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Xr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Oo(i.line,i.ch-1)),i.ch>0)i=new Oo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Oo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Oo(i.line-1,a.length-1),Oo(i.line,1),"+transpose")}n.push(new pe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange("\n",r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0),Pn(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},aa=e.keyMap={};aa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},aa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},aa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},aa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},aa["default"]=Mo?aa.macDefault:aa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=qi(n.split(" "),Bn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var la=e.lookupKey=function(e,t,n,r){t=Un(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return la(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=la(e,t.fallthrough[o],n,r);if(a)return a}}},sa=e.isModifierKey=function(e){var t="string"==typeof e?e:Qa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ca=e.keyName=function(e,t){if(xo&&34==e.keyCode&&e["char"])return!1;var n=Qa[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Ao?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Ao?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),
+!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?Ii(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=$i();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Sa(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ma(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ua=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ua.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Na(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Na(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Na(this.string,null,this.tabSize)-(this.lineStart?Na(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var fa=0,da=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++fa};Mi(da),da.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Si(this,"clear")){var n=this.find();n&&_i(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Qn(a.markedSpans,this);e&&!this.collapsed?Pt(e,Jr(a),"text"):e&&(null!=l.to&&(i=Jr(a)),null!=l.from&&(r=Jr(a))),a.markedSpans=Jn(a.markedSpans,l),null==l.from&&this.collapsed&&!xr(this.doc,a)&&e&&Qr(a,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=gr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&It(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ee(e.doc)),e&&_i(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},da.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Qn(o.markedSpans,this);if(null!=a.from&&(n=Oo(t?o:Jr(o),a.from),-1==e))return n;if(null!=a.to&&(r=Oo(t?o:Jr(o),a.to),1==e))return r}return n&&{from:n,to:r}},da.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&At(n,function(){var r=e.line,i=Jr(e.line),o=Je(n,i);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!xr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=wr(t)-a;l&&Qr(r,r.height+l)}})},da.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Ei(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},da.prototype.detachLine=function(e){if(this.lines.splice(Ei(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var fa=0,pa=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Mi(pa),pa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_i(this,"clear")}},pa.prototype.find=function(e,t){return this.primary.find(e,t)};var ha=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Mi(ha),ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Jr(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=wr(this);Qr(n,Math.max(0,n.height-o)),e&&At(e,function(){kr(e,n,-o),Pt(e,r,"widget")})}},ha.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=wr(this)-e;r&&(Qr(n,n.height+r),t&&At(t,function(){t.curOp.forceUpdate=!0,kr(t,n,r)}))};var ma=e.Line=function(e,t,n){this.text=e,sr(this,t),this.height=n?n(this):1};Mi(ma),ma.prototype.lineNo=function(){return Jr(this)};var ga={},va={};Ur.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Mr(i),_i(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ur))){var l=[];this.collapse(l),this.children=[new Ur(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),l=new Ur(a);i.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Vr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ei(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Vr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ya=0,ba=e.Doc=function(e,t,n){if(!(this instanceof ba))return new ba(e,t,n);null==n&&(n=0),Vr.call(this,[new Ur([new ma("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=Oo(n,0);this.sel=me(r),this.history=new ri(null),this.id=++ya,this.modeOption=t,"string"==typeof e&&(e=Ka(e)),Br(this,{from:r,to:r,text:e}),Te(this,me(r),Ea)};ba.prototype=Ni(Vr.prototype,{constructor:ba,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Yr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:qt(function(e){var t=Oo(this.first,0),n=this.first+this.size-1;Cn(this,{from:t,to:Oo(n,Xr(this,n).text.length),text:Ka(e),origin:"setValue",full:!0},!0),Te(this,me(t))}),replaceRange:function(e,t,n,r){t=ve(this,t),n=n?ve(this,n):t,zn(this,e,t,n,r)},getRange:function(e,t,n){var r=Zr(this,ve(this,e),ve(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return be(this,e)?Xr(this,e):void 0},getLineNumber:function(e){return Jr(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xr(this,e)),gr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ve(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:qt(function(e,t,n){Se(this,ve(this,"number"==typeof e?Oo(e,t||0):e),null,n)}),setSelection:qt(function(e,t,n){Se(this,ve(this,e),ve(this,t||e),n)}),extendSelection:qt(function(e,t,n){ke(this,ve(this,e),t&&ve(this,t),n)}),extendSelections:qt(function(e,t){we(this,xe(this,e,t))}),extendSelectionsBy:qt(function(e,t){we(this,qi(this.sel.ranges,e),t)}),setSelections:qt(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new pe(ve(this,e[r].anchor),ve(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(i,t),n)}}),addSelection:qt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new pe(ve(this,e),ve(this,t||e))),Te(this,he(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Zr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Zr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||"\n")),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:qt(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Ka(e[o]),origin:n}}for(var l=t&&"end"!=t&&kn(this,r,t),o=r.length-1;o>=0;o--)Cn(this,r[o]);l?Le(this,l):this.cm&&Pn(this.cm)}),undo:qt(function(){Mn(this,"undo")}),redo:qt(function(){Mn(this,"redo")}),undoSelection:qt(function(){Mn(this,"undo",!0)}),redoSelection:qt(function(){Mn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ri(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:hi(this.history.done),undone:hi(this.history.undone)}},setHistory:function(e){var t=this.history=new ri(this.history.maxGeneration);t.done=hi(e.done.slice(0),null,!0),t.undone=hi(e.undone.slice(0),null,!0)},addLineClass:qt(function(e,t,n){return Fn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Bi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:qt(function(e,t,n){return Fn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Bi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:qt(function(e,t,n){return Cr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vn(this,ve(this,e),ve(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ve(this,e),Vn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ve(this,e);var t=[],n=Xr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ve(this,e),t=ve(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];i==e.line&&e.ch>s.to||null==s.from&&i!=e.line||i==t.line&&s.from>t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,void++n)}),ve(this,Oo(n,t))},indexFromPos:function(e){e=ve(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new ba(Yr(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new ba(Yr(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Xn(r,Kn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Zn(Kn(this));break}}if(t.history==this.history){var i=[t.id];Gr(t,function(e){i.push(e.id)},!0),t.history=new ri(null),t.history.done=hi(this.history.done,i),t.history.undone=hi(this.history.undone,i)}},iterLinkedDocs:function(e){Gr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),ba.prototype.eachLine=ba.prototype.iter;var xa="iter insert remove copy getEditor constructor".split(" ");for(var _a in ba.prototype)ba.prototype.hasOwnProperty(_a)&&Ei(xa,_a)<0&&(e.prototype[_a]=function(e){return function(){return e.apply(this.doc,arguments)}}(ba.prototype[_a]));Mi(ba);var ka=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},wa=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Ca=e.e_stop=function(e){ka(e),wa(e)},Sa=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Ma=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},La=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ta=null,Aa=30,za=e.Pass={toString:function(){return"CodeMirror.Pass"}},Ea={scroll:!1},qa={origin:"*mouse"},Oa={origin:"+move"};Li.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Na=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},Ia=[""],Pa=function(e){e.select()};Co?Pa=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:mo&&(Pa=function(e){try{e.select()}catch(t){}});var Da,ja=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Fa=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ja.test(e))},Ra=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Da=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Wa=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};mo&&11>go&&($i=function(){try{return document.activeElement}catch(e){return document.body}});var Ha,$a,Ba=e.rmClass=function(e,t){var n=e.className,r=Bi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ua=e.addClass=function(e,t){var n=e.className;Bi(t).test(n)||(e.className+=(n?" ":"")+t)},Va=!1,Ga=function(){if(mo&&9>go)return!1;var e=Ri("div");return"draggable"in e||"dragDrop"in e}(),Ka=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Xa=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Za=function(){var e=Ri("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ya=null,Qa={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Qa,function(){for(var e=0;10>e;e++)Qa[e+48]=Qa[e+96]=String(e);for(var e=65;90>=e;e++)Qa[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Qa[e+111]=Qa[e+63235]="F"+e}();var Ja,el=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],d=0;u>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,p=c;u>d;++d){var r=f[d];"m"==r?f[d]=p:p=r}for(var d=0,h=c;u>d;++d){var r=f[d];"1"==r&&"r"==h?f[d]="n":a.test(r)&&(h=r,"r"==r&&(f[d]="R"))}for(var d=1,p=f[0];u-1>d;++d){var r=f[d];"+"==r&&"1"==p&&"1"==f[d+1]?f[d]="1":","!=r||p!=f[d+1]||"1"!=p&&"n"!=p||(f[d]=p),p=r}for(var d=0;u>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var m=d+1;u>m&&"%"==f[m];++m);for(var g=d&&"!"==f[d-1]||u>m&&"1"==f[m]?"1":"N",v=d;m>v;++v)f[v]=g;d=m-1}}for(var d=0,h=c;u>d;++d){var r=f[d];"L"==h&&"1"==r?f[d]="L":a.test(r)&&(h=r)}for(var d=0;u>d;++d)if(o.test(f[d])){for(var m=d+1;u>m&&o.test(f[m]);++m);for(var y="L"==(d?f[d-1]:c),b="L"==(u>m?f[m]:c),g=y||b?"L":"R",v=d;m>v;++v)f[v]=g;d=m-1}for(var x,_=[],d=0;u>d;)if(l.test(f[d])){var k=d;for(++d;u>d&&l.test(f[d]);++d);_.push(new t(0,k,d))}else{var w=d,C=_.length;for(++d;u>d&&"L"!=f[d];++d);for(var v=w;d>v;)if(s.test(f[v])){v>w&&_.splice(C,0,new t(1,w,v));var S=v;for(++v;d>v&&s.test(f[v]);++v);_.splice(C,0,new t(2,S,v)),w=v}else++v;d>w&&_.splice(C,0,new t(1,w,d))}return 1==_[0].level&&(x=n.match(/^\s+/))&&(_[0].from=x[0].length,_.unshift(new t(0,0,x[0].length))),1==zi(_).level&&(x=n.match(/\s+$/))&&(zi(_).to-=x[0].length,_.push(new t(0,u-x[0].length,u))),2==_[0].level&&_.unshift(new t(1,_[0].to,_[0].to)),_[0].level!=zi(_).level&&_.push(new t(_[0].level,u,u)),_}}();return e.version="5.4.0",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){if(!e.hasOwnProperty(t))throw new Error("Undefined state "+t+"in simple mode")}function n(e,t){if(!e)return/(?:)/;var n="";return e instanceof RegExp?(e.ignoreCase&&(n="i"),e=e.source):e=String(e),new RegExp((t===!1?"":"^")+"(?:"+e+")",n)}function r(e){if(!e)return null;if("string"==typeof e)return e.replace(/\./g," ");for(var t=[],n=0;n<e.length;n++)t.push(e[n]&&e[n].replace(/\./g," "));return t}function i(e,i){(e.next||e.push)&&t(i,e.next||e.push),this.regex=n(e.regex),this.token=r(e.token),this.data=e}function o(e,t){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var a,o=r.local.mode.token(n,r.localState);return r.local.endScan&&(a=r.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),o}for(var s=e[r.state],c=0;c<s.length;c++){var u=s[c],f=(!u.data.sol||n.sol())&&n.match(u.regex);if(f){if(u.data.next?r.state=u.data.next:u.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=u.data.push):u.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),u.data.mode&&l(t,r,u.data.mode,u.token),u.data.indent&&r.indent.push(n.indentation()+t.indentUnit),u.data.dedent&&r.indent.pop(),f.length>2){r.pending=[];for(var d=2;d<f.length;d++)f[d]&&r.pending.push({text:f[d],token:u.token[d-1]});return n.backUp(f[0].length-(f[1]?f[1].length:0)),u.token[0]}return u.token&&u.token.join?u.token[0]:u.token}}return n.next(),null}}function a(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=0;for(var r in e)if(e.hasOwnProperty(r)){if(!t.hasOwnProperty(r)||!a(e[r],t[r]))return!1;n++}for(var r in t)t.hasOwnProperty(r)&&n--;return 0==n}function l(t,r,i,o){var l;if(i.persistent)for(var s=r.persistentStates;s&&!l;s=s.next)(i.spec?a(i.spec,s.spec):i.mode==s.mode)&&(l=s);var c=l?l.mode:i.mode||e.getMode(t,i.spec),u=l?l.state:e.startState(c);i.persistent&&!l&&(r.persistentStates={mode:c,spec:i.spec,state:u,next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&i.forceEnd!==!1&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function s(e,t){for(var n=0;n<t.length;n++)if(t[n]===e)return!0}function c(t,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&s(r.state,n.dontIndentStates)>-1)return e.Pass;var a=r.indent.length-1,l=t[r.state];e:for(;;){for(var c=0;c<l.length;c++){var u=l[c];if(u.data.dedent&&u.data.dedentIfLineStart!==!1){var f=u.regex.exec(i);if(f&&f[0]){a--,(u.next||u.push)&&(l=t[u.next||u.push]),i=i.slice(f[0].length);continue e}}}break}return 0>a?0:r.indent[a]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,"start");var a={},l=r.meta||{},s=!1;for(var u in r)if(u!=l&&r.hasOwnProperty(u))for(var f=a[u]=[],d=r[u],p=0;p<d.length;p++){var h=d[p];f.push(new i(h,r)),(h.indent||h.dedent)&&(s=!0)}var m={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:s?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,local:t.local,localState:null,indent:t.indent&&t.indent.slice(0)};t.localState&&(n.localState=e.copyState(t.local.mode,t.localState)),t.stack&&(n.stack=t.stack.slice(0));for(var r=t.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==t.localState?n.localState:e.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(e){return e.local&&{mode:e.local.mode,state:e.localState}},indent:c(a,l)};if(l)for(var g in l)l.hasOwnProperty(g)&&(m[g]=l[g]);return m}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,l=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var s=a.close?n(l,a.close,i.pos,a.parseDelimiters):-1;if(s==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle;s>-1&&(i.string=l.slice(0,s));var c=a.mode.token(i,o.inner);return s>-1&&(i.string=l),s==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,l=i.string,f=0;f<r.length;++f){var d=r[f],s=n(l,d.open,i.pos);if(s==i.pos)return d.parseDelimiters||i.match(d.open),o.innerActive=d,o.inner=e.startState(d.mode,t.indent?t.indent(o.outer,""):0),d.delimStyle;-1!=s&&u>s&&(u=s)}u!=1/0&&(i.string=l.slice(0,u));var p=t.token(i,o.outer);return u!=1/0&&(i.string=l),p},indent:function(n,r){var i=n.innerActive?n.innerActive.mode:t;return i.indent?i.indent(n.innerActive?n.inner:n.outer,r):e.Pass},blankLine:function(n){var i=n.innerActive?n.innerActive.mode:t;if(i.blankLine&&i.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var o=0;o<r.length;++o){var a=r[o];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,i.indent?i.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",o),e.removeLineClass(e.state.activeLines[t],"background",a)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function r(e,r){for(var i=[],l=0;l<r.length;l++){var s=r[l];if(s.empty()){var c=e.getLineHandleVisualStart(s.head.line);i[i.length-1]!=c&&i.push(c)}}n(e.state.activeLines,i)||e.operation(function(){t(e);for(var n=0;n<i.length;n++)e.addLineClass(i[n],"wrap",o),e.addLineClass(i[n],"background",a);e.state.activeLines=i})}function i(e,t){r(e,t.ranges)}var o="CodeMirror-activeline",a="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(n,o,a){
+var l=a&&a!=e.Init;o&&!l?(n.state.activeLines=[],r(n,n.listSelections()),n.on("beforeSelectionChange",i)):!o&&l&&(n.off("beforeSelectionChange",i),t(n),delete n.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),i=i?e.clipPos(i):r(0,0),this.pos={from:i,to:i},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,i){if(n){t.lastIndex=0;for(var o,a,l=e.getLine(i.line).slice(0,i.ch),s=0;;){t.lastIndex=s;var c=t.exec(l);if(!c)break;if(o=c,a=o.index,s=o.index+(o[0].length||1),s==l.length)break}var u=o&&o[0].length||0;u||(0==a&&0==l.length?o=void 0:a!=e.getLine(i.line).length&&u++)}else{t.lastIndex=i.ch;var l=e.getLine(i.line),o=t.exec(l),u=o&&o[0].length||0,a=o&&o.index;a+u==l.length||u||(u=1)}return o&&u?{from:r(i.line,a),to:r(i.line,a+u),match:o}:void 0};else{var a=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");if(1==s.length)t.length?this.matches=function(i,o){if(i){var s=e.getLine(o.line).slice(0,o.ch),c=l(s),u=c.lastIndexOf(t);if(u>-1)return u=n(s,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var s=e.getLine(o.line).slice(o.ch),c=l(s),u=c.indexOf(t);if(u>-1)return u=n(s,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=s.length-1;if(t){if(n.line-(s.length-1)<e.firstLine())return;if(l(e.getLine(n.line).slice(0,c[i].length))!=s[s.length-1])return;for(var o=r(n.line,c[i].length),a=n.line-1,u=i-1;u>=1;--u,--a)if(s[u]!=l(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(l(f.slice(d))!=s[0])return;return{from:r(a,d),to:o}}if(!(n.line+(s.length-1)>e.lastLine())){var f=e.getLine(n.line),d=f.length-c[0].length;if(l(f.slice(d))==s[0]){for(var p=r(n.line,d),a=n.line+1,u=1;i>u;++u,++a)if(s[u]!=l(e.getLine(a)))return;if(l(e.getLine(a).slice(0,c[i].length))==s[i])return{from:p,to:r(a,c[i].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(n>i)++r;else{if(!(i>n))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(n){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,n){var o=r(e);if(o.query)return u(e,n);var l=e.getSelection()||o.lastQuery;a(e,p,"Search for:",l,function(r){e.operation(function(){r&&!o.query&&(o.query=s(r),e.removeOverlay(o.overlay,i(o.query)),o.overlay=t(o.query,i(o.query)),e.addOverlay(o.overlay),e.showMatchesOnScrollbar&&(o.annotate&&(o.annotate.clear(),o.annotate=null),o.annotate=e.showMatchesOnScrollbar(o.query,i(o.query))),o.posFrom=o.posTo=e.getCursor(),u(e,n))})})}function u(t,n){t.operation(function(){var i=r(t),a=o(t,i.query,n?i.posFrom:i.posTo);(a.find(n)||(a=o(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),a.find(n)))&&(t.setSelection(a.from(),a.to()),t.scrollIntoView({from:a.from(),to:a.to()}),i.posFrom=a.from(),i.posTo=a.to())})}function f(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function d(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery;a(e,h,"Replace:",n,function(n){n&&(n=s(n),a(e,m,"Replace with:","",function(r){if(t)e.operation(function(){for(var t=o(e,n);t.findNext();)if("string"!=typeof n){var i=e.getRange(t.from(),t.to()).match(n);t.replace(r.replace(/\$(\d)/g,function(e,t){return i[t]}),"+input")}else t.replace(r,"+input")});else{f(e);var i=o(e,n,e.getCursor()),a=function(){var t,r=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||r&&i.from().line==r.line&&i.from().ch==r.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),l(e,g,"Replace?",[function(){s(t)},a]))},s=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]}),"+input"),a()};a()}}))})}}var p='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',h='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){f(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=f,e.commands.replace=d,e.commands.replaceAll=function(e){d(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return t>=e?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a<this.matches.length;a++){var l=this.matches[a],s=n(l.from.line,r,o);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var c=n(l.to.line,r,o);c!=l.to.line&&(l.to=e.Pos(c,l.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout(function(){u.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){function i(t){var n=e.wheelEventPixels(t)["horizontal"==o.orientation?"x":"y"],r=o.pos;o.moveTo(o.pos+n),o.pos!=r&&e.e_preventDefault(t)}this.orientation=n,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+n,this.inner=this.node.appendChild(document.createElement("div"));var o=this;e.on(this.inner,"mousedown",function(t){function n(){e.off(document,"mousemove",r),e.off(document,"mouseup",n)}function r(e){return 1!=e.which?n():void o.moveTo(l+(e[i]-a)*(o.total/o.size))}if(1==t.which){e.e_preventDefault(t);var i="horizontal"==o.orientation?"pageX":"pageY",a=t[i],l=o.pos;e.on(document,"mousemove",r),e.on(document,"mouseup",n)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var n,r=o.inner.getBoundingClientRect();n="horizontal"==o.orientation?t.clientX<r.left?-1:t.clientX>r.right?1:0:t.clientY<r.top?-1:t.clientY>r.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))};var r=10;t.prototype.update=function(e,t,n){this.screen=t,this.total=e,this.size=n;var i=this.screen*(this.size/this.total);r>i&&(this.size-=r-i,i=r),this.inner.style["horizontal"==this.orientation?"width":"height"]=i-4+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},n.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var n=this.width||0,r=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},n.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.heightAtLine(e.lastLine()+1,"local");return t!=this.hScale?(this.hScale=t,!0):void 0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(s!=e.line&&(s=e.line,c=n.getLineHandle(s)),a&&c.height>l)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),l=a&&1.5*n.defaultTextHeight(),s=null,c=null;if(n.display.barWidth)for(var u,f=0;f<o.length;f++){for(var d=o[f],p=u||t(d.from,!0)*r,h=t(d.to,!1)*r;f<o.length-1&&(u=t(o[f+1].from,!0)*r,!(u>h+.9));)d=o[++f],h=t(d.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(2*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),n?r.className="CodeMirror-dialog CodeMirror-dialog-bottom":r.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,s.parentNode.removeChild(s),u.focus(),o.onClose&&o.onClose(s)}}o||(o={}),n(this,null);var l,s=t(this,r,o.bottom),c=!1,u=this,f=s.getElementsByTagName("input")[0];return f?(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))}),o.closeOnBlur!==!1&&e.on(f,"blur",a),f.focus()):(l=s.getElementsByTagName("button")[0])&&(e.on(l,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(l,"blur",a),l.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,l.parentNode.removeChild(l),u.focus())}n(this,null);var l=t(this,r,o&&o.bottom),s=l.getElementsByTagName("button"),c=!1,u=this,f=1;s[0].focus();for(var d=0;d<s.length;++d){var p=s[d];!function(t){e.on(p,"click",function(n){e.e_preventDefault(n),a(),t&&t(u)})}(i[d]),e.on(p,"blur",function(){--f,setTimeout(function(){0>=f&&a()},200)}),e.on(p,"focus",function(){++f})}}),e.defineExtension("openNotification",function(r,i){function o(){s||(s=!0,clearTimeout(a),l.parentNode.removeChild(l))}n(this,o);var a,l=t(this,r,i&&i.bottom),s=!1,c=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(t){e.e_preventDefault(t),o()}),c&&(a=setTimeout(o,c)),o})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,i){var o=e.getLineHandle(t.line),s=t.ch-1,c=s>=0&&l[o.text.charAt(s)]||l[o.text.charAt(++s)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(s==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,s+1)),d=n(e,a(t.line,s+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,s),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(0>n?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=l[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n==(n>0?e.lastLine():e.firstLine())?!1:null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var u=s[c].empty()&&t(e,s[c].head,!1,r);if(u&&e.getLine(u.from.line).length<=i){var f=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(u.from,a(u.from.line,u.from.ch+1),{className:f})),u.to&&e.getLine(u.to.line).length<=i&&l.push(e.markText(u.to,a(u.to.line,u.to.ch+1),{className:f}))}}if(l.length){o&&e.state.focused&&e.focus();var d=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(!n)return d;setTimeout(d,800)}}function i(e){e.operation(function(){s&&(s(),s=null),s=r(e,!1,e.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",i),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:u[t]}function n(e){return function(t){return a(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var u=a[l].head;n.replaceRange("",f(u.line,u.ch-1),f(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=s(n,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null,"+input"),n.execCommand("goCharLeft"),a=n.listSelections();for(var e=0;e<a.length;e++){var t=a[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}function a(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var a=t(o,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var u,d,p=t(o,"triples"),h=a.charAt(s+1)==i,m=n.listSelections(),g=s%2==0,v=0;v<m.length;v++){var y,b=m[v],x=b.head,d=n.getRange(x,f(x.line,x.ch+1));if(g&&!b.empty())y="surround";else if(!h&&g||d!=i)if(h&&x.ch>1&&p.indexOf(i)>=0&&n.getRange(f(x.line,x.ch-2),x)==i+i&&(x.ch<=2||n.getRange(f(x.line,x.ch-3),f(x.line,x.ch-2))!=i))y="addFour";else if(h){if(e.isWordChar(d)||!c(n,x,i))return e.Pass;y="both"}else{if(!g||n.getLine(x.line).length!=x.ch&&!l(d,a)&&!/\s/.test(d))return e.Pass;y="both"}else y=p.indexOf(i)>=0&&n.getRange(x,f(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=y)return e.Pass}else u=y}var _=s%2?a.charAt(s-1):i,k=s%2?i:a.charAt(s+1);n.operation(function(){if("skip"==u)n.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;3>e;e++)n.execCommand("goCharRight");else if("surround"==u){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=_+t[e]+k;n.replaceSelections(t,"around","+input")}else"both"==u?(n.replaceSelection(_+k,null,"+input"),n.triggerElectric(_+k),n.execCommand("goCharLeft")):"addFour"==u&&(n.replaceSelection(_+_+_+_,"before","+input"),n.execCommand("goCharRight"))})}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function s(e,t){var n=e.getRange(f(t.line,t.ch-1),f(t.line,t.ch+1));return 2==n.length?n:null}function c(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var l=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}var u={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},f=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(p),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(p))});for(var d=u.pairs+"`",p={Backspace:i,Enter:o},h=0;h<d.length;h++)p["'"+d.charAt(h)+"'"]=n(d.charAt(h))}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var r=n.getCursor(),i=n.getViewport();i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to);var o=e.findMatchingTag(n,r,i);if(o){if(n.state.matchBothTags){var a="open"==o.at?o.open:o.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==o.at?o.open:o.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,a){a&&a!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),r=[],s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var c=n[s].head,u=t.getTokenAt(c),f=e.innerMode(t.getMode(),u.state),d=f.state;if("xml"!=f.mode.name||!d.tagName)return e.Pass;var p=t.getOption("autoCloseTags"),h="html"==f.mode.configuration,m="object"==typeof p&&p.dontCloseTags||h&&a,g="object"==typeof p&&p.indentTags||h&&l,v=d.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==d.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,d,!0))return e.Pass;var b=g&&i(g,y)>-1;r[s]={indent:b,text:">"+(b?"\n\n":"")+"</"+v+">",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var s=n.length-1;s>=0;s--){var x=r[s];t.replaceRange(x.text,n[s].head,n[s].anchor,"+insert");var _=t.listSelections().slice(0);_[s]={head:x.newPos,anchor:x.newPos},t.setSelections(_),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":"</",l=0;l<r.length;l++){if(!r[l].empty())return e.Pass;var s=r[l].head,c=t.getTokenAt(s),u=e.innerMode(t.getMode(),c.state),f=u.state;if(n&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=s.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)i[l]=a+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;i[l]=a+"style>"}else{if(!f.context||!f.context.tagName||o(t,f.context.tagName,s,f))return e.Pass;i[l]=a+f.context.tagName+">"}}t.replaceSelections(i,null,"+input"),r=t.listSelections();for(var l=0;l<r.length;l++)(l==r.length-1||r[l].head.line<r[l+1].head.line)&&t.indentLine(r[l].head.line)}function r(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=n)return!1;for(var s=i.context,c=o?1:0;s&&s.tagName==n;s=s.prev)++c;r=l.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,r,null,a);if(!f||f.tag!=n)return!1;r=f.to}return!0}e.defineOption("autoCloseTags",!1,function(n,i,o){if(o!=e.Init&&o&&n.removeKeyMap("autoCloseTags"),i){var a={name:"autoCloseTags"};("object"!=typeof i||i.whenClosing)&&(a["'/'"]=function(e){return r(e)}),("object"!=typeof i||i.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,d=i.getLine(s.line),p=t.exec(d);if(!o[l].empty()||!u&&!f||!p)return void i.execCommand("newlineAndIndent");if(n.test(d))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1},"+delete"),a[l]="\n";else{var h=p[1],m=p[5],g=r.test(p[2])||p[2].indexOf(">")>=0?p[2]:parseInt(p[3],10)+1+p[4];a[l]="\n"+h+g+m}}i.replaceSelections(a,null,"+input")}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(r);return-1==t?0:t}var n={},r=/[^\s\u00a0]/,i=e.Pos;e.commands.toggleComment=function(e){for(var t=1/0,n=e.listSelections(),r=null,o=n.length-1;o>=0;o--){var a=n[o].from(),l=n[o].to();a.line>=t||(l.line>=t&&(l=i(t,0)),t=a.line,null==r?e.uncomment(a,l)?r="un":(e.lineComment(a,l),r="line"):"un"==r?e.uncomment(a,l):e.lineComment(a,l))}},e.defineExtension("lineComment",function(e,o,a){a||(a=n);var l=this,s=l.getModeAt(e),c=a.lineComment||s.lineComment;if(!c)return void((a.blockCommentStart||s.blockCommentStart)&&(a.fullLines=!0,l.blockComment(e,o,a)));var u=l.getLine(e.line);if(null!=u){var f=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,l.lastLine()+1),d=null==a.padding?" ":a.padding,p=a.commentBlankLines||e.line==o.line;l.operation(function(){if(a.indent)for(var n=u.slice(0,t(u)),o=e.line;f>o;++o){var s=l.getLine(o),h=n.length;(p||r.test(s))&&(s.slice(0,h)!=n&&(h=t(s)),l.replaceRange(n+c+d,i(o,0),i(o,h)))}else for(var o=e.line;f>o;++o)(p||r.test(l.getLine(o)))&&l.replaceRange(c+d,i(o,0))})}}),e.defineExtension("blockComment",function(e,t,o){o||(o=n);var a=this,l=a.getModeAt(e),s=o.blockCommentStart||l.blockCommentStart,c=o.blockCommentEnd||l.blockCommentEnd;if(!s||!c)return void((o.lineComment||l.lineComment)&&0!=o.fullLines&&a.lineComment(e,t,o));var u=Math.min(t.line,a.lastLine());u!=e.line&&0==t.ch&&r.test(a.getLine(u))&&--u;var f=null==o.padding?" ":o.padding;e.line>u||a.operation(function(){if(0!=o.fullLines){var n=r.test(a.getLine(u));a.replaceRange(f+c,i(u)),a.replaceRange(s+f,i(e.line,0));var d=o.blockCommentLead||l.blockCommentLead;if(null!=d)for(var p=e.line+1;u>=p;++p)(p!=u||n)&&a.replaceRange(d+f,i(p,0))}else a.replaceRange(c,t),a.replaceRange(s,e)})}),e.defineExtension("uncomment",function(e,t,o){o||(o=n);var a,l=this,s=l.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,l.lastLine()),u=Math.min(e.line,c),f=o.lineComment||s.lineComment,d=[],p=null==o.padding?" ":o.padding;e:if(f){for(var h=u;c>=h;++h){var m=l.getLine(h),g=m.indexOf(f);if(g>-1&&!/comment/.test(l.getTokenTypeAt(i(h,g+1)))&&(g=-1),-1==g&&(h!=c||h==u)&&r.test(m))break e;if(g>-1&&r.test(m.slice(0,g)))break e;d.push(m)}if(l.operation(function(){for(var e=u;c>=e;++e){var t=d[e-u],n=t.indexOf(f),r=n+f.length;0>n||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,l.replaceRange("",i(e,n),i(e,r)))}}),a)return!0}var v=o.blockCommentStart||s.blockCommentStart,y=o.blockCommentEnd||s.blockCommentEnd;if(!v||!y)return!1;var b=o.blockCommentLead||s.blockCommentLead,x=l.getLine(u),_=c==u?x:l.getLine(c),k=x.indexOf(v),w=_.lastIndexOf(y);if(-1==w&&u!=c&&(_=l.getLine(--c),w=_.lastIndexOf(y)),-1==k||-1==w||!/comment/.test(l.getTokenTypeAt(i(u,k+1)))||!/comment/.test(l.getTokenTypeAt(i(c,w+1))))return!1;var C=x.lastIndexOf(v,e.ch),S=-1==C?-1:x.slice(0,e.ch).indexOf(y,C+v.length);if(-1!=C&&-1!=S&&S+y.length!=e.ch)return!1;S=_.indexOf(y,t.ch);var M=_.slice(t.ch).lastIndexOf(v,S-t.ch);return C=-1==S||-1==M?-1:t.ch+M,-1!=S&&-1!=C&&C!=t.ch?!1:(l.operation(function(){l.replaceRange("",i(c,w-(p&&_.slice(w-p.length,w)==p?p.length:0)),i(c,w+y.length));var e=k+v.length;if(p&&x.slice(e,e+p.length)==p&&(e+=p.length),l.replaceRange("",i(u,k),i(u,e)),b)for(var t=u+1;c>=t;++t){var n=l.getLine(t),o=n.indexOf(b);if(-1!=o&&!r.test(n.slice(0,o))){var a=o+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),
+l.replaceRange("",i(t,o),i(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a<i.length;a++){var l=i[a].head,s=t.getTokenAt(l);if("comment"!=s.type)return e.Pass;var c=e.innerMode(t.getMode(),s.state).mode;if(r){if(r!=c)return e.Pass}else r=c;var u=null;if(r.blockCommentStart&&r.blockCommentContinue){var f,d=s.string.indexOf(r.blockCommentEnd),p=t.getRange(e.Pos(l.line,0),e.Pos(l.line,s.end));if(-1!=d&&d==s.string.length-r.blockCommentEnd.length&&l.ch>=d);else if(0==s.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,s.start),!/^\s*$/.test(u)){u="";for(var h=0;h<s.start;++h)u+=" "}}else-1!=(f=p.indexOf(r.blockCommentContinue))&&f+r.blockCommentContinue.length>s.start&&/^\s*$/.test(p.slice(0,f))&&(u=p.slice(0,f));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(l.line),f=m.indexOf(r.lineComment);f>-1&&(u=m.slice(0,f),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(f+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return t&&"object"==typeof t?t.continueLineComment!==!1:!0}for(var r=["clike","css","javascript"],i=0;i<r.length;++i)e.extendMode(r[i],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(n,r,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),r){var o="Enter";"string"==typeof r?o=r:"object"==typeof r&&r.key&&(o=r.key);var a={name:"continueComment"};a[o]=t,n.addKeyMap(a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){for(var r=n.paragraphStart||e.getHelper(t,"paragraphStart"),i=t.line,o=e.firstLine();i>o;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var l=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),s=t.line+1,c=e.lastLine();c>=s;++s){var a=e.getLine(s);if(l&&l.test(a)){++s;break}if(!/\S/.test(a))break}return{from:i,to:s}}function n(e,t,n,r){for(var i=t;i>0&&!n.test(e.slice(i-1,i+1));--i);0==i&&(i=t);var o=i;if(r)for(;" "==e.charAt(o-1);)--o;return{from:o,to:i}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var l=a.column||80,s=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],f="",d=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;m<p.length;++m){var g=p[m],v=f.length,y=0;f&&g&&!s.test(f.charAt(f.length-1)+g.charAt(0))&&(f+=" ",y=1);var b="";if(m&&(b=g.match(/^\s*/)[0],g=g.slice(b.length)),f+=g,m){var x=f.length>l&&h==b&&n(f,l,s,c);x&&x.from==v&&x.to==v+y?(f=h+g,++d):u.push({text:[y?" ":""],from:i(d,v),to:i(d+1,b.length)})}for(;f.length>l;){var _=n(f,l,s,c);u.push({text:["",h],from:i(d,_.from),to:i(d,_.to)}),f=h+f.slice(_.to),++d}}return u.length&&t.operation(function(){for(var e=0;e<u.length;++e){var n=u[e];t.replaceRange(n.text,n.from,n.to)}}),u.length?{from:u[0].from,to:e.changeEnd(u[u.length-1])}:null}var i=e.Pos;e.defineExtension("wrapParagraph",function(e,n){n=n||{},e||(e=this.getCursor());var o=t(this,e,n);return r(this,i(o.from,0),i(o.to-1),n)}),e.commands.wrapLines=function(e){e.operation(function(){for(var n=e.listSelections(),o=e.lastLine()+1,a=n.length-1;a>=0;a--){var l,s=n[a];if(s.empty()){var c=t(e,s.head,{});l={from:i(c.from,0),to:i(c.to-1)}}else l={from:s.from(),to:s.to()};l.to.line>=o||(o=l.from.line,r(e,l.from,l.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,l=[],s=e.line;s<=n.line;){var c=t(a,i(s,0),o);l.push(c),s=c.to}var u=!1;return l.length&&a.operation(function(){for(var e=l.length-1;e>=0;--e)u=u||r(a,i(l[e].from,0),i(l[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function l(e){var n=s(t,i);if(!n||n.to.line-n.from.line<c)return null;for(var r=t.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,r[o].clear()}return n}if(o&&o.call){var s=o;o=null}else var s=r(t,o,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var c=r(t,o,"minFoldSize"),u=l(!0);if(r(t,o,"scanUp"))for(;!u&&i.line>t.firstLine();)i=e.Pos(i.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var i={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return r(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function r(r){for(var i=n.ch,s=0;;){var c=0>=i?-1:l.lastIndexOf(r,i-1);if(-1!=c){if(1==s&&c<n.ch)break;if(o=t.getTokenTypeAt(e.Pos(a,c+1)),!/^(comment|string)/.test(o))return c+1;i=c-1}else{if(1==s)break;s=1,i=l.length}}}var i,o,a=n.line,l=t.getLine(a),s="{",c="}",i=r("{");if(null==i&&(s="[",c="]",i=r("[")),null!=i){var u,f,d=1,p=t.lastLine();e:for(var h=a;p>=h;++h)for(var m=t.getLine(h),g=h==a?i:0;;){var v=m.indexOf(s,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(h,g+1))==o)if(g==v)++d;else if(!--d){u=h,f=g;break e}++g}if(null!=u&&(a!=u||f!=i))return{from:e.Pos(a,i),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);o>=i;++i){var a=t.getLine(i),l=a.indexOf(";");if(-1!=l)return{startCh:r.end,end:e.Pos(i,l)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var l=r(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(n,o.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:e.Pos(n,i+1),to:t.clipPos(e.Pos(o))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarksAt(f(t)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==t)return n[r]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,t,n){var o=e.state.foldGutter.options,a=t,l=e.foldOption(o,"minFoldSize"),s=e.foldOption(o,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(r(e,a))n=i(o.indicatorFolded);else{var c=f(a,0),u=s&&s(e,c);u&&u.to.line-u.from.line>=l&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}e.defineOption("foldGutter",!1,function(r,i,o){o&&o!=e.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",l),r.off("change",s),r.off("viewportChange",c),r.off("fold",u),r.off("unfold",u),r.off("swapDoc",a)),i&&(r.state.foldGutter=new t(n(i)),a(r),r.on("gutterClick",l),r.on("change",s),r.on("viewportChange",c),r.on("fold",u),r.on("unfold",u),r.on("swapDoc",a))});var f=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(t,n){function r(n){var r=t.getTokenTypeAt(e.Pos(n,0));return r&&/\bheader\b/.test(r)}function i(e,t,n){var i=t&&t.match(/^#+/);return i&&r(e)?i[0].length:(i=n&&n.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==n[0]?1:2:o)}var o=100,a=t.getLine(n.line),l=t.getLine(n.line+1),s=i(n.line,a,l);if(s===o)return void 0;for(var c=t.lastLine(),u=n.line,f=t.getLine(u+2);c>u&&!(i(u+1,l,f)<=s);)++u,l=f,f=t.getLine(u+2);return{from:e.Pos(n.line,a.length),to:e.Pos(u,t.getLine(u).length)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(d(e.line,t));return n&&/\btag\b/.test(n)}function i(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function o(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(0>c&&(!t||t==i[2]))return{tag:i[2],from:d(o,l),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(0>s&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else l(e)}}var d=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=s(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=d(r.line,r.ch),l=u(r,o[2]);return l&&{from:t,to:l.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&d(o.line,o.ch),p=s&&l(o);if(s&&p&&!(t(o,r)>0)){var h={from:d(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:p[1]?{open:f(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xml",function(t,n){function r(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(a("atom","]]>")):null:e.match("--")?n(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==r){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=r,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"==n){t.tokenize=r,t.state=f,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=o(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=r;break}n.next()}return e}}function l(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=r;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function s(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),d):"closeTag"==e?p:f}function d(e,t,n){return"word"==e?(n.tagName=t.current(),C="tag",g):(C="error",d)}function p(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==r?(C="tag",h):(C="tag error",m)}return C="error",m}function h(e,t,n){return"endTag"!=e?(C="error",h):(c(n),f)}function m(e,t,n){return C="error",h(e,t,n)}function g(e,t,n){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?u(n,r):(u(n,r),n.context=new s(n,r,i==n.indented)),f}return C="error",g}function v(e,t,n){return"equals"==e?y:(S.allowMissing||(C="error"),g(e,t,n))}function y(e,t,n){return"string"==e?b:"word"==e&&S.allowUnquoted?(C="string",g):(C="error",g(e,t,n))}function b(e,t,n){return"string"==e?b:g(e,t,n)}var x=t.indentUnit,_=n.multilineTagIndentFactor||1,k=n.multilineTagIndentPastTag;null==k&&(k=!0);var w,C,S=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(C=null,t.state=t.state(w||n,e,t),C&&(n="error"==C?n+" error":C)),n},indent:function(t,n,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return k?t.tagStart+t.tagName.length+2:t.tagStart+x*_;if(M&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;a;){if(a.tagName==l[2]){a=a.prev;break}if(!S.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(l)for(;a;){var s=S.contextGrabbers[a.tagName];if(!s||!s.hasOwnProperty(l[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,_||e.f!=s||(e.f=p,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function l(e,t){var o=e.sol(),a=t.list!==!1,l=t.indentedCode;t.indentedCode=!1,a&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var s=null;if(t.indentationDiff>=4)return e.skipToEnd(),l||!t.prevLineHasContent?(t.indentation-=4,t.indentedCode=!0,S):null;if(e.eatSpace())return null;if((s=e.match(B))&&s[1].length<=6)return t.header=s[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(t.prevLineHasContent&&!t.quote&&!a&&!l&&(s=e.match(U)))return t.header="="==s[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(e.eat(">"))return t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return i(e,t,v);if(e.match(R,!0))return t.hr=!0,z;if((!t.prevLineHasContent||a)&&(e.match(W,!1)||e.match(H,!1))){var u=null;return e.match(W,!0)?u="ul":(e.match(H,!0),u="ol"),t.indentation+=4,t.list=!0,t.listDepth++,n.taskLists&&e.match($,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+u]),f(t)}return n.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=r(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,f(t)):i(e,t,t.inline)}function s(e,t){var n=k.token(e,t.htmlState);return(_&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=p,t.block=l,t.htmlState=null),n}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=u,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S)}function u(e,t){e.match("```"),t.block=l,t.f=p,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=f(t);return t.code=!1,r}function f(e){var t=[];if(e.formatting){t.push(q),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(q+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(q+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?q+"-"+e.formatting[r]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(P,"url"):(e.strong&&t.push(j),e.em&&t.push(D),e.strikethrough&&t.push(F),e.linkText&&t.push(I),e.code&&t.push(S)),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(M),t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?M+"-"+e.quote:M+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?T:A:L)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(V,!0)?f(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,f(r);if(r.taskList){var a="x"!==t.match($,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,f(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),f(r);var l=t.sol(),c=t.next();if("\\"===c&&(t.next(),n.highlightFormatting)){var u=f(r);return u?u+" formatting-escape":"formatting-escape"}if(r.linkTitle){r.linkTitle=!1;var d=c;"("===c&&(d=")"),d=(d+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var p="^\\s*(?:[^"+d+"\\\\]+|\\\\\\\\|\\\\.)"+d;if(t.match(new RegExp(p),!0))return P}if("`"===c){var g=r.formatting;n.highlightFormatting&&(r.formatting="code");var v=f(r),y=t.pos;t.eatWhile("`");var b=1+t.pos-y;return r.code?b===w?(r.code=!1,v):(r.formatting=g,f(r)):(w=b,r.code=!0,f(r))}if(r.code)return f(r);if("!"===c&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=m,E;if("["===c&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),f(r);if("]"===c&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var u=f(r);return r.linkText=!1,r.inline=r.f=m,u}if("<"===c&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+O}if("<"===c&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+N}if("<"===c&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){var x=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(k),o(t,r,s)}if("<"===c&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var _=!1;if(!n.underscoresBreakWords&&"_"===c&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var S=t.string.charAt(C);"_"!==S&&S.match(/(\w)/,!1)&&(_=!0)}}if("*"===c||"_"===c&&!_)if(l&&" "===t.peek());else{if(r.strong===c&&t.eat(c)){n.highlightFormatting&&(r.formatting="strong");var v=f(r);return r.strong=!1,v}if(!r.strong&&t.eat(c))return r.strong=c,n.highlightFormatting&&(r.formatting="strong"),f(r);if(r.em===c){n.highlightFormatting&&(r.formatting="em");var v=f(r);return r.em=!1,v}if(!r.em)return r.em=c,n.highlightFormatting&&(r.formatting="em"),f(r)}else if(" "===c&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return f(r);t.backUp(1)}if(n.strikethrough)if("~"===c&&t.eatWhile(c)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=f(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),f(r)}else if(" "===c&&t.match(/^~~/,!0)){if(" "===t.peek())return f(r);t.backUp(2)}return" "===c&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),f(r)}function h(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=f(t);return i?i+=" ":i="",i+O}return e.match(/^[^>]+/,!0),O}function m(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=f(r);return r.linkHref=!1,o}return t.match(x(e),!0)&&t.backUp(1),r.linkHref=!0,f(r)}}function v(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=y,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):i(e,t,p)}function y(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=f(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),I}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,P+" url")}function x(e){return G[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),G[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),G[e]}var _=e.modes.hasOwnProperty("xml"),k=e.getMode(t,_?{name:"xml",htmlMode:!0}:"text/plain");void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.fencedCodeBlocks&&(n.fencedCodeBlocks=!1),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1);var w=0,C="header",S="comment",M="quote",L="variable-2",T="variable-3",A="keyword",z="hr",E="tag",q="formatting",O="link",N="link",I="link",P="string",D="em",j="strong",F="strikethrough",R=/^([*\-_])(?:\s*\1){2,}\s*$/,W=/^[*\-+]\s+/,H=/^[0-9]+([.)])\s+/,$=/^\[(x| )\](?=\s)/,B=/^(#+)(?: |$)/,U=/^ *(?:\={1,}|-{1,})\s*$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,G=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(k,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var n=!!t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n)return t.prevLineHasContent=!1,a(t),n?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==s?{state:e.htmlState,mode:k}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:K}},blankLine:a,getType:f,fold:"markdown"};return K},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gfm",function(t,n){function r(e){return e.code=!1,null}var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var r=1+e.pos-n;return t.code?r===i&&(t.code=!1):(i=r,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,
+"link"):(e.next(),null)},blankLine:r},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var l in n)a[l]=n[l];return a.name="markdown",e.defineMIME("gfmBase",a),e.overlayMode(e.getMode(t,"gfmBase"),o)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return ve=e,ye=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=a(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Me),i("operator","operator",e.current()));if("`"==n)return t.tokenize=s,s(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if(Me.test(n))return e.eatWhile(Me),i("operator","operator",e.current());if(Ce.test(n)){e.eatWhile(Ce);var o=e.current(),c=Se.propertyIsEnumerable(o)&&Se[o];return c&&"."!=t.lastType?i(c.type,c.style,o):i("variable","variable",o)}}function a(e){return function(t,n){var r,a=!1;if(_e&&"@"==t.peek()&&t.match(Le))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;return a||(n.tokenize=o),i("string","string")}}function l(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function s(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),l=Te.indexOf(a);if(l>=0&&3>l){if(!r){++o;break}if(0==--r)break}else if(l>=3&&6>l)++r;else if(Ce.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function f(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function d(e,t,n,r,i){var o=e.cc;for(ze.state=e,ze.stream=i,ze.marked=null,ze.cc=o,ze.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():ke?k:_;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return ze.marked?ze.marked:"variable"==n&&f(e,r)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)ze.cc.push(arguments[e])}function h(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=ze.state;if(r.context){if(ze.marked="def",t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function g(){ze.state.context={prev:ze.state.context,vars:ze.state.localVars},ze.state.localVars=Ee}function v(){ze.state.localVars=ze.state.context.vars,ze.state.context=ze.state.context.prev}function y(e,t){var n=function(){var n=ze.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,ze.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=ze.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(n){return n==e?h():";"==e?p():h(t)}return t}function _(e,t){return"var"==e?h(y("vardef",t.length),B,x(";"),b):"keyword a"==e?h(y("form"),k,_,b):"keyword b"==e?h(y("form"),_,b):"{"==e?h(y("}"),R,b):";"==e?h():"if"==e?("else"==ze.state.lexical.info&&ze.state.cc[ze.state.cc.length-1]==b&&ze.state.cc.pop()(),h(y("form"),k,_,b,X)):"function"==e?h(te):"for"==e?h(y("form"),Z,_,b):"variable"==e?h(y("stat"),O):"switch"==e?h(y("form"),k,y("}","switch"),x("{"),R,b,b):"case"==e?h(k,x(":")):"default"==e?h(x(":")):"catch"==e?h(y("form"),g,x("("),ne,x(")"),_,b,v):"module"==e?h(y("form"),g,le,v,b):"class"==e?h(y("form"),re,b):"export"==e?h(y("form"),se,b):"import"==e?h(y("form"),ce,b):p(y("stat"),k,x(";"),b)}function k(e){return C(e,!1)}function w(e){return C(e,!0)}function C(e,t){if(ze.state.fatArrowAt==ze.stream.start){var n=t?q:E;if("("==e)return h(g,y(")"),j(U,")"),b,x("=>"),n,v);if("variable"==e)return p(g,U,x("=>"),n,v)}var r=t?T:L;return Ae.hasOwnProperty(e)?h(r):"function"==e?h(te,r):"keyword c"==e?h(t?M:S):"("==e?h(y(")"),S,me,x(")"),b,r):"operator"==e||"spread"==e?h(t?w:k):"["==e?h(y("]"),pe,b,r):"{"==e?F(I,"}",null,r):"quasi"==e?p(A,r):h()}function S(e){return e.match(/[;\}\)\],]/)?p():p(k)}function M(e){return e.match(/[;\}\)\],]/)?p():p(w)}function L(e,t){return","==e?h(k):T(e,t,!1)}function T(e,t,n){var r=0==n?L:T,i=0==n?k:w;return"=>"==e?h(g,n?q:E,v):"operator"==e?/\+\+|--/.test(t)?h(r):"?"==t?h(k,x(":"),i):h(i):"quasi"==e?p(A,r):";"!=e?"("==e?F(w,")","call",r):"."==e?h(N,r):"["==e?h(y("]"),S,x("]"),b,r):void 0:void 0}function A(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?h(A):h(k,z)}function z(e){return"}"==e?(ze.marked="string-2",ze.state.tokenize=s,h(A)):void 0}function E(e){return c(ze.stream,ze.state),p("{"==e?_:k)}function q(e){return c(ze.stream,ze.state),p("{"==e?_:w)}function O(e){return":"==e?h(b,_):p(L,x(";"),b)}function N(e){return"variable"==e?(ze.marked="property",h()):void 0}function I(e,t){return"variable"==e||"keyword"==ze.style?(ze.marked="property",h("get"==t||"set"==t?P:D)):"number"==e||"string"==e?(ze.marked=_e?"property":ze.style+" property",h(D)):"jsonld-keyword"==e?h(D):"["==e?h(k,x("]"),D):void 0}function P(e){return"variable"!=e?p(D):(ze.marked="property",h(te))}function D(e){return":"==e?h(w):"("==e?p(te):void 0}function j(e,t){function n(r){if(","==r){var i=ze.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),h(e,n)}return r==t?h():h(x(t))}return function(r){return r==t?h():p(e,n)}}function F(e,t,n){for(var r=3;r<arguments.length;r++)ze.cc.push(arguments[r]);return h(y(t,n),j(e,t),b)}function R(e){return"}"==e?h():p(_,R)}function W(e){return we&&":"==e?h($):void 0}function H(e,t){return"="==t?h(w):void 0}function $(e){return"variable"==e?(ze.marked="variable-3",h()):void 0}function B(){return p(U,W,G,K)}function U(e,t){return"variable"==e?(m(t),h()):"["==e?F(U,"]"):"{"==e?F(V,"}"):void 0}function V(e,t){return"variable"!=e||ze.stream.match(/^\s*:/,!1)?("variable"==e&&(ze.marked="property"),h(x(":"),U,G)):(m(t),h(G))}function G(e,t){return"="==t?h(w):void 0}function K(e){return","==e?h(B):void 0}function X(e,t){return"keyword b"==e&&"else"==t?h(y("form","else"),_,b):void 0}function Z(e){return"("==e?h(y(")"),Y,x(")"),b):void 0}function Y(e){return"var"==e?h(B,x(";"),J):";"==e?h(J):"variable"==e?h(Q):p(k,x(";"),J)}function Q(e,t){return"in"==t||"of"==t?(ze.marked="keyword",h(k)):h(L,J)}function J(e,t){return";"==e?h(ee):"in"==t||"of"==t?(ze.marked="keyword",h(k)):p(k,x(";"),ee)}function ee(e){")"!=e&&h(k)}function te(e,t){return"*"==t?(ze.marked="keyword",h(te)):"variable"==e?(m(t),h(te)):"("==e?h(g,y(")"),j(ne,")"),b,_,v):void 0}function ne(e){return"spread"==e?h(ne):p(U,W,H)}function re(e,t){return"variable"==e?(m(t),h(ie)):void 0}function ie(e,t){return"extends"==t?h(k,ie):"{"==e?h(y("}"),oe,b):void 0}function oe(e,t){return"variable"==e||"keyword"==ze.style?"static"==t?(ze.marked="keyword",h(oe)):(ze.marked="property","get"==t||"set"==t?h(ae,te,oe):h(te,oe)):"*"==t?(ze.marked="keyword",h(oe)):";"==e?h(oe):"}"==e?h():void 0}function ae(e){return"variable"!=e?p():(ze.marked="property",h())}function le(e,t){return"string"==e?h(_):"variable"==e?(m(t),h(de)):void 0}function se(e,t){return"*"==t?(ze.marked="keyword",h(de,x(";"))):"default"==t?(ze.marked="keyword",h(k,x(";"))):p(_)}function ce(e){return"string"==e?h():p(ue,de)}function ue(e,t){return"{"==e?F(ue,"}"):("variable"==e&&m(t),"*"==t&&(ze.marked="keyword"),h(fe))}function fe(e,t){return"as"==t?(ze.marked="keyword",h(ue)):void 0}function de(e,t){return"from"==t?(ze.marked="keyword",h(k)):void 0}function pe(e){return"]"==e?h():p(w,he)}function he(e){return"for"==e?p(me,x("]")):","==e?h(j(M,"]")):p(j(w,"]"))}function me(e){return"for"==e?h(Z,me):"if"==e?h(k,me):void 0}function ge(e,t){return"operator"==e.lastType||","==e.lastType||Me.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var ve,ye,be=t.indentUnit,xe=n.statementIndent,_e=n.jsonld,ke=n.json||_e,we=n.typescript,Ce=n.wordCharacters||/[\w$\xa1-\uffff]/,Se=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(we){var l={type:"variable",style:"variable-3"},s={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:l,number:l,bool:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Me=/[+\-*&%=<>!?|~^]/,Le=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Te="([{}])",Ae={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},ze={state:null,column:null,marked:null,cc:null},Ee={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-be,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==ve?n:(t.lastType="operator"!=ve||"++"!=ye&&"--"!=ye?ve:"incdec",d(t,n,ve,ye,e))},indent:function(t,r){if(t.tokenize==l)return e.Pass;if(t.tokenize!=o)return 0;var i=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==b)a=a.prev;else if(c!=X)break}"stat"==a.type&&"}"==i&&(a=a.prev),xe&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,f=i==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==i?a.indented:"form"==u?a.indented+be:"stat"==u?a.indented+(ge(t,r)?xe||be:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:be):a.indented+(/^(?:case|default)\b/.test(r)?be:2*be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ke?null:"/*",blockCommentEnd:ke?null:"*/",lineComment:ke?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ke?"json":"javascript",jsonldMode:_e,jsonMode:ke}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return p=t,e}function i(e,t){var n=e.next();if(g[n]){var i=g[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function s(e,t,n){return e.context=new l(n,t.indentation()+m,e.context),n}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,n){return L[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();h=S.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}n.propertyKeywords||(n=e.resolveMode("text/css"));var p,h,m=t.indentUnit,g=n.tokenHooks,v=n.documentTypes||{},y=n.mediaTypes||{},b=n.mediaFeatures||{},x=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},k=n.fontProperties||{},w=n.counterDescriptors||{},C=n.colorKeywords||{},S=n.valueKeywords||{},M=n.allowNested,L={};return L.top=function(e,t,n){if("{"==e)return s(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(/@(media|supports|(-moz-)?document)/.test(e))return s(n,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(n,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(n,t,"interpolation");if(":"==e)return"pseudo";if(M&&"("==e)return s(n,t,"parens")}return n.context.type},L.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return x.hasOwnProperty(r)?(h="property","maybeprop"):_.hasOwnProperty(r)?(h="string-2","maybeprop"):M?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":M||"hash"!=e&&"qualifier"!=e?L.top(e,t,n):(h="error","block")},L.maybeprop=function(e,t,n){return":"==e?s(n,t,"prop"):u(e,t,n)},L.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&M)return s(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return s(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return s(n,t,"interpolation")}else h+=" error";return"prop"},L.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(h="property","maybeprop"):n.context.type},L.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?s(n,t,"parens"):"interpolation"==e?s(n,t,"interpolation"):("word"==e&&d(t),"parens")},L.pseudo=function(e,t,n){return"word"==e?(h="variable-3",n.context.type):u(e,t,n)},L.atBlock=function(e,t,n){if("("==e)return s(n,t,"atBlock_parens");if("}"==e)return f(e,t,n);if("{"==e)return c(n)&&s(n,t,M?"block":"top");if("word"==e){var r=t.current().toLowerCase();h="only"==r||"not"==r||"and"==r||"or"==r?"keyword":v.hasOwnProperty(r)?"tag":y.hasOwnProperty(r)?"attribute":b.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"property":_.hasOwnProperty(r)?"string-2":S.hasOwnProperty(r)?"atom":"error"}return n.context.type},L.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):L.atBlock(e,t,n)},L.restricted_atBlock_before=function(e,t,n){return"{"==e?s(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(h="variable","restricted_atBlock_before"):u(e,t,n)},L.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(h="@font-face"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!w.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},L.keyframes=function(e,t,n){return"word"==e?(h="variable","keyframes"):"{"==e?s(n,t,"top"):u(e,t,n)},L.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},L.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?h="variable":"variable"!=e&&"("!=e&&")"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),h=n,t.state=L[t.state](p,e,t),h},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),!n.prev||("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type)&&(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=n.indent-m,n=n.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],s=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(c),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],d=t(f),p=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],h=t(p),m=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=t(m),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(v),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],x=t(b),_=r.concat(o).concat(l).concat(c).concat(f).concat(v).concat(b);
-}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a<i.length;a++){var l=i[a].head,s=t.getTokenAt(l);if("comment"!=s.type)return e.Pass;var c=e.innerMode(t.getMode(),s.state).mode;if(r){if(r!=c)return e.Pass}else r=c;var u=null;if(r.blockCommentStart&&r.blockCommentContinue){var f,d=s.string.indexOf(r.blockCommentEnd),p=t.getRange(e.Pos(l.line,0),e.Pos(l.line,s.end));if(-1!=d&&d==s.string.length-r.blockCommentEnd.length&&l.ch>=d);else if(0==s.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,s.start),!/^\s*$/.test(u)){u="";for(var h=0;h<s.start;++h)u+=" "}}else-1!=(f=p.indexOf(r.blockCommentContinue))&&f+r.blockCommentContinue.length>s.start&&/^\s*$/.test(p.slice(0,f))&&(u=p.slice(0,f));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(l.line),f=m.indexOf(r.lineComment);f>-1&&(u=m.slice(0,f),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(f+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+input")})}function n(e){var t=e.getOption("continueComments");return t&&"object"==typeof t?t.continueLineComment!==!1:!0}for(var r=["clike","css","javascript"],i=0;i<r.length;++i)e.extendMode(r[i],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(n,r,i){if(i&&i!=e.Init&&n.removeKeyMap("continueComment"),r){var o="Enter";"string"==typeof r?o=r:"object"==typeof r&&r.key&&(o=r.key);var a={name:"continueComment"};a[o]=t,n.addKeyMap(a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){for(var r=n.paragraphStart||e.getHelper(t,"paragraphStart"),i=t.line,o=e.firstLine();i>o;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var l=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),s=t.line+1,c=e.lastLine();c>=s;++s){var a=e.getLine(s);if(l&&l.test(a)){++s;break}if(!/\S/.test(a))break}return{from:i,to:s}}function n(e,t,n,r){for(var i=t;i>0&&!n.test(e.slice(i-1,i+1));--i);0==i&&(i=t);var o=i;if(r)for(;" "==e.charAt(o-1);)--o;return{from:o,to:i}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var l=a.column||80,s=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],f="",d=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;m<p.length;++m){var g=p[m],v=f.length,y=0;f&&g&&!s.test(f.charAt(f.length-1)+g.charAt(0))&&(f+=" ",y=1);var b="";if(m&&(b=g.match(/^\s*/)[0],g=g.slice(b.length)),f+=g,m){var x=f.length>l&&h==b&&n(f,l,s,c);x&&x.from==v&&x.to==v+y?(f=h+g,++d):u.push({text:[y?" ":""],from:i(d,v),to:i(d+1,b.length)})}for(;f.length>l;){var _=n(f,l,s,c);u.push({text:["",h],from:i(d,_.from),to:i(d,_.to)}),f=h+f.slice(_.to),++d}}return u.length&&t.operation(function(){for(var e=0;e<u.length;++e){var n=u[e];t.replaceRange(n.text,n.from,n.to)}}),u.length?{from:u[0].from,to:e.changeEnd(u[u.length-1])}:null}var i=e.Pos;e.defineExtension("wrapParagraph",function(e,n){n=n||{},e||(e=this.getCursor());var o=t(this,e,n);return r(this,i(o.from,0),i(o.to-1),n)}),e.commands.wrapLines=function(e){e.operation(function(){for(var n=e.listSelections(),o=e.lastLine()+1,a=n.length-1;a>=0;a--){var l,s=n[a];if(s.empty()){var c=t(e,s.head,{});l={from:i(c.from,0),to:i(c.to-1)}}else l={from:s.from(),to:s.to()};l.to.line>=o||(o=l.from.line,r(e,l.from,l.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,l=[],s=e.line;s<=n.line;){var c=t(a,i(s,0),o);l.push(c),s=c.to}var u=!1;return l.length&&a.operation(function(){for(var e=l.length-1;e>=0;--e)u=u||r(a,i(l[e].from,0),i(l[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function l(e){var n=s(t,i);if(!n||n.to.line-n.from.line<c)return null;for(var r=t.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,r[o].clear()}return n}if(o&&o.call){var s=o;o=null}else var s=r(t,o,"rangeFinder");"number"==typeof i&&(i=e.Pos(i,0));var c=r(t,o,"minFoldSize"),u=l(!0);if(r(t,o,"scanUp"))for(;!u&&i.line>t.firstLine();)i=e.Pos(i.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),r=t.lastLine();r>=n;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}});var i={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return r(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function r(r){for(var i=n.ch,s=0;;){var c=0>=i?-1:l.lastIndexOf(r,i-1);if(-1!=c){if(1==s&&c<n.ch)break;if(o=t.getTokenTypeAt(e.Pos(a,c+1)),!/^(comment|string)/.test(o))return c+1;i=c-1}else{if(1==s)break;s=1,i=l.length}}}var i,o,a=n.line,l=t.getLine(a),s="{",c="}",i=r("{");if(null==i&&(s="[",c="]",i=r("[")),null!=i){var u,f,d=1,p=t.lastLine();e:for(var h=a;p>=h;++h)for(var m=t.getLine(h),g=h==a?i:0;;){var v=m.indexOf(s,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(h,g+1))==o)if(g==v)++d;else if(!--d){u=h,f=g;break e}++g}if(null!=u&&(a!=u||f!=i))return{from:e.Pos(a,i),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);o>=i;++i){var a=t.getLine(i),l=a.indexOf(";");if(-1!=l)return{startCh:r.end,end:e.Pos(i,l)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var l=r(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(n,o.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:e.Pos(n,i+1),to:t.clipPos(e.Pos(o))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarksAt(f(t)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==t)return n[r]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,t,n){var o=e.state.foldGutter.options,a=t,l=e.foldOption(o,"minFoldSize"),s=e.foldOption(o,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(r(e,a))n=i(o.indicatorFolded);else{var c=f(a,0),u=s&&s(e,c);u&&u.to.line-u.from.line>=l&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}e.defineOption("foldGutter",!1,function(r,i,o){o&&o!=e.Init&&(r.clearGutter(r.state.foldGutter.options.gutter),r.state.foldGutter=null,r.off("gutterClick",l),r.off("change",s),r.off("viewportChange",c),r.off("fold",u),r.off("unfold",u),r.off("swapDoc",a)),i&&(r.state.foldGutter=new t(n(i)),a(r),r.on("gutterClick",l),r.on("change",s),r.on("viewportChange",c),r.on("fold",u),r.on("unfold",u),r.on("swapDoc",a))});var f=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(t,n){function r(n){var r=t.getTokenTypeAt(e.Pos(n,0));return r&&/\bheader\b/.test(r)}function i(e,t,n){var i=t&&t.match(/^#+/);return i&&r(e)?i[0].length:(i=n&&n.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==n[0]?1:2:o)}var o=100,a=t.getLine(n.line),l=t.getLine(n.line+1),s=i(n.line,a,l);if(s===o)return void 0;for(var c=t.lastLine(),u=n.line,f=t.getLine(u+2);c>u&&!(i(u+1,l,f)<=s);)++u,l=f,f=t.getLine(u+2);return{from:e.Pos(n.line,a.length),to:e.Pos(u,t.getLine(u).length)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?r.from:e.firstLine(),this.max=r?r.to-1:e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(d(e.line,t));return n&&/\btag\b/.test(n)}function i(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function o(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=s(e),o=e.line,l=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(0>c&&(!t||t==i[2]))return{tag:i[2],from:d(o,l),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(0>s&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else l(e)}}var d=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=s(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var t=d(r.line,r.ch),l=u(r,o[2]);return l&&{from:t,to:l.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=a(o),c=s&&d(o.line,o.ch),p=s&&l(o);if(s&&p&&!(t(o,r)>0)){var h={from:d(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:p[1]?{open:f(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),l=u(a,o.tag);if(l)return{open:o,close:l}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xml",function(t,n){function r(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(a("atom","]]>")):null:e.match("--")?n(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(w=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==r){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=r,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"==n){t.tokenize=r,t.state=f,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=o(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=r;break}n.next()}return e}}function l(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=r;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function s(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;c(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),d):"closeTag"==e?p:f}function d(e,t,n){return"word"==e?(n.tagName=t.current(),C="tag",g):(C="error",d)}function p(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&c(n),n.context&&n.context.tagName==r?(C="tag",h):(C="tag error",m)}return C="error",m}function h(e,t,n){return"endTag"!=e?(C="error",h):(c(n),f)}function m(e,t,n){return C="error",h(e,t,n)}function g(e,t,n){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?u(n,r):(u(n,r),n.context=new s(n,r,i==n.indented)),f}return C="error",g}function v(e,t,n){return"equals"==e?y:(S.allowMissing||(C="error"),g(e,t,n))}function y(e,t,n){return"string"==e?b:"word"==e&&S.allowUnquoted?(C="string",g):(C="error",g(e,t,n))}function b(e,t,n){return"string"==e?b:g(e,t,n)}var x=t.indentUnit,_=n.multilineTagIndentFactor||1,k=n.multilineTagIndentPastTag;null==k&&(k=!0);var w,C,S=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var n=t.tokenize(e,t);return(n||w)&&"comment"!=n&&(C=null,t.state=t.state(w||n,e,t),C&&(n="error"==C?n+" error":C)),n},indent:function(t,n,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return k?t.tagStart+t.tagName.length+2:t.tagStart+x*_;if(M&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;a;){if(a.tagName==l[2]){a=a.prev;break}if(!S.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(l)for(;a;){var s=S.contextGrabbers[a.tagName];if(!s||!s.hasOwnProperty(l[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+x:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,_||e.f!=s||(e.f=p,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function l(e,t){var o=e.sol(),a=t.list!==!1;a&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var l=null;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),S;if(e.eatSpace())return null;if(l=e.match(B))return t.header=Math.min(6,-1!==l[0].indexOf(" ")?l[0].length-1:l[0].length),n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(t.prevLineHasContent&&(l=e.match(U)))return t.header="="==l[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(e.eat(">"))return t.indentation++,t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return i(e,t,v);if(e.match(W,!0))return z;if((!t.prevLineHasContent||a)&&(e.match(F,!1)||e.match(H,!1))){var s=null;return e.match(F,!0)?s="ul":(e.match(H,!0),s="ol"),t.indentation+=4,t.list=!0,t.listDepth++,n.taskLists&&e.match($,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+s]),f(t)}return n.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=r(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,f(t)):i(e,t,t.inline)}function s(e,t){var n=k.token(e,t.htmlState);return(_&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=p,t.block=l,t.htmlState=null),n}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=u,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S)}function u(e,t){e.match("```"),t.block=l,t.f=p,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=f(t);return t.code=!1,r}function f(e){var t=[];if(e.formatting){t.push(O),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(O+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(O+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?O+"-"+e.formatting[r]+"-"+e.quote:"error")}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref)return t.push(P),t.length?t.join(" "):null;if(e.strong&&t.push(j),e.em&&t.push(D),e.strikethrough&&t.push(R),e.linkText&&t.push(I),e.code&&t.push(S),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(M),t.push(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?M+"-"+e.quote:M+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;t.push(i?1===i?T:A:L)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(V,!0)?f(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,f(r);if(r.taskList){var a="x"!==t.match($,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,f(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),f(r);var l=t.sol(),c=t.next();if("\\"===c&&(t.next(),n.highlightFormatting)){var u=f(r);return u?u+" formatting-escape":"formatting-escape"}if(r.linkTitle){r.linkTitle=!1;var d=c;"("===c&&(d=")"),d=(d+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var p="^\\s*(?:[^"+d+"\\\\]+|\\\\\\\\|\\\\.)"+d;if(t.match(new RegExp(p),!0))return P}if("`"===c){var g=r.formatting;n.highlightFormatting&&(r.formatting="code");var v=f(r),y=t.pos;t.eatWhile("`");var b=1+t.pos-y;return r.code?b===w?(r.code=!1,v):(r.formatting=g,f(r)):(w=b,r.code=!0,f(r))}if(r.code)return f(r);if("!"===c&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=m,E;if("["===c&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),f(r);if("]"===c&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var u=f(r);return r.linkText=!1,r.inline=r.f=m,u}if("<"===c&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+q}if("<"===c&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link");var u=f(r);return u?u+=" ":u="",u+N}if("<"===c&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){var x=t.string.substring(1,t.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(k),o(t,r,s)}if("<"===c&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var _=!1;if(!n.underscoresBreakWords&&"_"===c&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var S=t.string.charAt(C);"_"!==S&&S.match(/(\w)/,!1)&&(_=!0)}}if("*"===c||"_"===c&&!_)if(l&&" "===t.peek());else{if(r.strong===c&&t.eat(c)){n.highlightFormatting&&(r.formatting="strong");var v=f(r);return r.strong=!1,v}if(!r.strong&&t.eat(c))return r.strong=c,n.highlightFormatting&&(r.formatting="strong"),f(r);if(r.em===c){n.highlightFormatting&&(r.formatting="em");var v=f(r);return r.em=!1,v}if(!r.em)return r.em=c,n.highlightFormatting&&(r.formatting="em"),f(r)}else if(" "===c&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return f(r);t.backUp(1)}if(n.strikethrough)if("~"===c&&t.eatWhile(c)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=f(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),f(r)}else if(" "===c&&t.match(/^~~/,!0)){if(" "===t.peek())return f(r);t.backUp(2)}return" "===c&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),f(r)}function h(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=f(t);return i?i+=" ":i="",i+q}return e.match(/^[^>]+/,!0),q}function m(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=f(r);return r.linkHref=!1,o}return t.match(x(e),!0)&&t.backUp(1),r.linkHref=!0,f(r)}}function v(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=y,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):i(e,t,p)}function y(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=f(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),I}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,P)}function x(e){return G[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),G[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),G[e]}var _=e.modes.hasOwnProperty("xml"),k=e.getMode(t,_?{name:"xml",htmlMode:!0}:"text/plain");void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.fencedCodeBlocks&&(n.fencedCodeBlocks=!1),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1);var w=0,C="header",S="comment",M="quote",L="variable-2",T="variable-3",A="keyword",z="hr",E="tag",O="formatting",q="link",N="link",I="link",P="string",D="em",j="strong",R="strikethrough",W=/^([*\-=_])(?:\s*\1){2,}\s*$/,F=/^[*\-+]\s+/,H=/^[0-9]+\.\s+/,$=/^\[(x| )\](?=\s)/,B=/^#+ ?/,U=/^(?:\={1,}|-{1,})$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,G=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(k,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var n=!!t.header;if(t.header=0,e.match(/^\s*$/,!0)||n)return t.prevLineHasContent=!1,a(t),n?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==s?{state:e.htmlState,mode:k}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:K}},blankLine:a,getType:f,fold:"markdown"};return K},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gfm",function(t,n){function r(e){return e.code=!1,null}var i=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var r=1+e.pos-n;return t.code?r===i&&(t.code=!1):(i=r,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var l in n)a[l]=n[l];return a.name="markdown",
-e.defineMIME("gfmBase",a),e.overlayMode(e.getMode(t,"gfmBase"),o)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return ge=e,ve=n,t}function o(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=a(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&e.eat(">"))return i("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(r(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Se),i("operator","operator",e.current()));if("`"==n)return t.tokenize=s,s(e,t);if("#"==n)return e.skipToEnd(),i("error","error");if(Se.test(n))return e.eatWhile(Se),i("operator","operator",e.current());if(we.test(n)){e.eatWhile(we);var o=e.current(),c=Ce.propertyIsEnumerable(o)&&Ce[o];return c&&"."!=t.lastType?i(c.type,c.style,o):i("variable","variable",o)}}function a(e){return function(t,n){var r,a=!1;if(xe&&"@"==t.peek()&&t.match(Me))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||a);)a=!a&&"\\"==r;return a||(n.tokenize=o),i("string","string")}}function l(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function s(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),l=Le.indexOf(a);if(l>=0&&3>l){if(!r){++o;break}if(0==--r)break}else if(l>=3&&6>l)++r;else if(we.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function f(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function d(e,t,n,r,i){var o=e.cc;for(Ae.state=e,Ae.stream=i,Ae.marked=null,Ae.cc=o,Ae.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():_e?k:_;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Ae.marked?Ae.marked:"variable"==n&&f(e,r)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)Ae.cc.push(arguments[e])}function h(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=Ae.state;if(r.context){if(Ae.marked="def",t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function g(){Ae.state.context={prev:Ae.state.context,vars:Ae.state.localVars},Ae.state.localVars=ze}function v(){Ae.state.localVars=Ae.state.context.vars,Ae.state.context=Ae.state.context.prev}function y(e,t){var n=function(){var n=Ae.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,Ae.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=Ae.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(n){return n==e?h():";"==e?p():h(t)}return t}function _(e,t){return"var"==e?h(y("vardef",t.length),$,x(";"),b):"keyword a"==e?h(y("form"),k,_,b):"keyword b"==e?h(y("form"),_,b):"{"==e?h(y("}"),W,b):";"==e?h():"if"==e?("else"==Ae.state.lexical.info&&Ae.state.cc[Ae.state.cc.length-1]==b&&Ae.state.cc.pop()(),h(y("form"),k,_,b,K)):"function"==e?h(ee):"for"==e?h(y("form"),X,_,b):"variable"==e?h(y("stat"),q):"switch"==e?h(y("form"),k,y("}","switch"),x("{"),W,b,b):"case"==e?h(k,x(":")):"default"==e?h(x(":")):"catch"==e?h(y("form"),g,x("("),te,x(")"),_,b,v):"module"==e?h(y("form"),g,ae,v,b):"class"==e?h(y("form"),ne,b):"export"==e?h(y("form"),le,b):"import"==e?h(y("form"),se,b):p(y("stat"),k,x(";"),b)}function k(e){return C(e,!1)}function w(e){return C(e,!0)}function C(e,t){if(Ae.state.fatArrowAt==Ae.stream.start){var n=t?O:E;if("("==e)return h(g,y(")"),j(B,")"),b,x("=>"),n,v);if("variable"==e)return p(g,B,x("=>"),n,v)}var r=t?T:L;return Te.hasOwnProperty(e)?h(r):"function"==e?h(ee,r):"keyword c"==e?h(t?M:S):"("==e?h(y(")"),S,he,x(")"),b,r):"operator"==e||"spread"==e?h(t?w:k):"["==e?h(y("]"),de,b,r):"{"==e?R(I,"}",null,r):"quasi"==e?p(A,r):h()}function S(e){return e.match(/[;\}\)\],]/)?p():p(k)}function M(e){return e.match(/[;\}\)\],]/)?p():p(w)}function L(e,t){return","==e?h(k):T(e,t,!1)}function T(e,t,n){var r=0==n?L:T,i=0==n?k:w;return"=>"==e?h(g,n?O:E,v):"operator"==e?/\+\+|--/.test(t)?h(r):"?"==t?h(k,x(":"),i):h(i):"quasi"==e?p(A,r):";"!=e?"("==e?R(w,")","call",r):"."==e?h(N,r):"["==e?h(y("]"),S,x("]"),b,r):void 0:void 0}function A(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?h(A):h(k,z)}function z(e){return"}"==e?(Ae.marked="string-2",Ae.state.tokenize=s,h(A)):void 0}function E(e){return c(Ae.stream,Ae.state),p("{"==e?_:k)}function O(e){return c(Ae.stream,Ae.state),p("{"==e?_:w)}function q(e){return":"==e?h(b,_):p(L,x(";"),b)}function N(e){return"variable"==e?(Ae.marked="property",h()):void 0}function I(e,t){return"variable"==e||"keyword"==Ae.style?(Ae.marked="property",h("get"==t||"set"==t?P:D)):"number"==e||"string"==e?(Ae.marked=xe?"property":Ae.style+" property",h(D)):"jsonld-keyword"==e?h(D):"["==e?h(k,x("]"),D):void 0}function P(e){return"variable"!=e?p(D):(Ae.marked="property",h(ee))}function D(e){return":"==e?h(w):"("==e?p(ee):void 0}function j(e,t){function n(r){if(","==r){var i=Ae.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),h(e,n)}return r==t?h():h(x(t))}return function(r){return r==t?h():p(e,n)}}function R(e,t,n){for(var r=3;r<arguments.length;r++)Ae.cc.push(arguments[r]);return h(y(t,n),j(e,t),b)}function W(e){return"}"==e?h():p(_,W)}function F(e){return ke&&":"==e?h(H):void 0}function H(e){return"variable"==e?(Ae.marked="variable-3",h()):void 0}function $(){return p(B,F,V,G)}function B(e,t){return"variable"==e?(m(t),h()):"["==e?R(B,"]"):"{"==e?R(U,"}"):void 0}function U(e,t){return"variable"!=e||Ae.stream.match(/^\s*:/,!1)?("variable"==e&&(Ae.marked="property"),h(x(":"),B,V)):(m(t),h(V))}function V(e,t){return"="==t?h(w):void 0}function G(e){return","==e?h($):void 0}function K(e,t){return"keyword b"==e&&"else"==t?h(y("form","else"),_,b):void 0}function X(e){return"("==e?h(y(")"),Z,x(")"),b):void 0}function Z(e){return"var"==e?h($,x(";"),Q):";"==e?h(Q):"variable"==e?h(Y):p(k,x(";"),Q)}function Y(e,t){return"in"==t||"of"==t?(Ae.marked="keyword",h(k)):h(L,Q)}function Q(e,t){return";"==e?h(J):"in"==t||"of"==t?(Ae.marked="keyword",h(k)):p(k,x(";"),J)}function J(e){")"!=e&&h(k)}function ee(e,t){return"*"==t?(Ae.marked="keyword",h(ee)):"variable"==e?(m(t),h(ee)):"("==e?h(g,y(")"),j(te,")"),b,_,v):void 0}function te(e){return"spread"==e?h(te):p(B,F)}function ne(e,t){return"variable"==e?(m(t),h(re)):void 0}function re(e,t){return"extends"==t?h(k,re):"{"==e?h(y("}"),ie,b):void 0}function ie(e,t){return"variable"==e||"keyword"==Ae.style?"static"==t?(Ae.marked="keyword",h(ie)):(Ae.marked="property","get"==t||"set"==t?h(oe,ee,ie):h(ee,ie)):"*"==t?(Ae.marked="keyword",h(ie)):";"==e?h(ie):"}"==e?h():void 0}function oe(e){return"variable"!=e?p():(Ae.marked="property",h())}function ae(e,t){return"string"==e?h(_):"variable"==e?(m(t),h(fe)):void 0}function le(e,t){return"*"==t?(Ae.marked="keyword",h(fe,x(";"))):"default"==t?(Ae.marked="keyword",h(k,x(";"))):p(_)}function se(e){return"string"==e?h():p(ce,fe)}function ce(e,t){return"{"==e?R(ce,"}"):("variable"==e&&m(t),"*"==t&&(Ae.marked="keyword"),h(ue))}function ue(e,t){return"as"==t?(Ae.marked="keyword",h(ce)):void 0}function fe(e,t){return"from"==t?(Ae.marked="keyword",h(k)):void 0}function de(e){return"]"==e?h():p(w,pe)}function pe(e){return"for"==e?p(he,x("]")):","==e?h(j(M,"]")):p(j(w,"]"))}function he(e){return"for"==e?h(X,he):"if"==e?h(k,he):void 0}function me(e,t){return"operator"==e.lastType||","==e.lastType||Se.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var ge,ve,ye=t.indentUnit,be=n.statementIndent,xe=n.jsonld,_e=n.json||xe,ke=n.typescript,we=n.wordCharacters||/[\w$\xa1-\uffff]/,Ce=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r};if(ke){var l={type:"variable",style:"variable-3"},s={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:l,number:l,bool:l,any:l};for(var c in s)a[c]=s[c]}return a}(),Se=/[+\-*&%=<>!?|~^]/,Me=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Le="([{}])",Te={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Ae={state:null,column:null,marked:null,cc:null},ze={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-ye,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==ge?n:(t.lastType="operator"!=ge||"++"!=ve&&"--"!=ve?ge:"incdec",d(t,n,ge,ve,e))},indent:function(t,r){if(t.tokenize==l)return e.Pass;if(t.tokenize!=o)return 0;var i=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==b)a=a.prev;else if(c!=K)break}"stat"==a.type&&"}"==i&&(a=a.prev),be&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var u=a.type,f=i==u;return"vardef"==u?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==u&&"{"==i?a.indented:"form"==u?a.indented+ye:"stat"==u?a.indented+(me(t,r)?be||ye:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:ye):a.indented+(/^(?:case|default)\b/.test(r)?ye:2*ye)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:_e?null:"/*",blockCommentEnd:_e?null:"*/",lineComment:_e?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:_e?"json":"javascript",jsonldMode:xe,jsonMode:_e}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}function r(e,t){return e.skipTo("-->")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,n){function r(e,t){return p=t,e}function i(e,t){var n=e.next();if(g[n]){var i=g[n](e,t);if(i!==!1)return i}return"@"==n?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?r(null,"compare"):'"'==n||"'"==n?(t.tokenize=o(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function l(e,t,n){this.type=e,this.indent=t,this.prev=n}function s(e,t,n){return e.context=new l(n,t.indentation()+m,e.context),n}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,n){return L[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();h=S.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}n.propertyKeywords||(n=e.resolveMode("text/css"));var p,h,m=t.indentUnit,g=n.tokenHooks,v=n.documentTypes||{},y=n.mediaTypes||{},b=n.mediaFeatures||{},x=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},k=n.fontProperties||{},w=n.counterDescriptors||{},C=n.colorKeywords||{},S=n.valueKeywords||{},M=n.allowNested,L={};return L.top=function(e,t,n){if("{"==e)return s(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(/@(media|supports|(-moz-)?document)/.test(e))return s(n,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(n,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(n,t,"interpolation");if(":"==e)return"pseudo";if(M&&"("==e)return s(n,t,"parens")}return n.context.type},L.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return x.hasOwnProperty(r)?(h="property","maybeprop"):_.hasOwnProperty(r)?(h="string-2","maybeprop"):M?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":M||"hash"!=e&&"qualifier"!=e?L.top(e,t,n):(h="error","block")},L.maybeprop=function(e,t,n){return":"==e?s(n,t,"prop"):u(e,t,n)},L.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&M)return s(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return s(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return s(n,t,"interpolation")}else h+=" error";return"prop"},L.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(h="property","maybeprop"):n.context.type},L.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?s(n,t,"parens"):"interpolation"==e?s(n,t,"interpolation"):("word"==e&&d(t),"parens")},L.pseudo=function(e,t,n){return"word"==e?(h="variable-3",n.context.type):u(e,t,n)},L.atBlock=function(e,t,n){if("("==e)return s(n,t,"atBlock_parens");if("}"==e)return f(e,t,n);if("{"==e)return c(n)&&s(n,t,M?"block":"top");if("word"==e){var r=t.current().toLowerCase();h="only"==r||"not"==r||"and"==r||"or"==r?"keyword":v.hasOwnProperty(r)?"tag":y.hasOwnProperty(r)?"attribute":b.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"property":_.hasOwnProperty(r)?"string-2":S.hasOwnProperty(r)?"atom":"error"}return n.context.type},L.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):L.atBlock(e,t,n)},L.restricted_atBlock_before=function(e,t,n){return"{"==e?s(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(h="variable","restricted_atBlock_before"):u(e,t,n)},L.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(h="@font-face"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!w.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},L.keyframes=function(e,t,n){return"word"==e?(h="variable","keyframes"):"{"==e?s(n,t,"top"):u(e,t,n)},L.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},L.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?h="variable":"variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(p=n[1],n=n[0]),h=n,t.state=L[t.state](p,e,t),h},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),!n.prev||("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type)&&(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=n.indent-m,n=n.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var i=["domain","regexp","url","url-prefix"],o=t(i),a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(a),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(u),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(d),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(h),g=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=t(g),y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],b=t(y),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],_=t(x),k=i.concat(a).concat(s).concat(u).concat(d).concat(y).concat(x);
+e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:x,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:x,fontProperties:h,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:s,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:y,valueKeywords:x,fontProperties:h,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlmixed",function(t,n){function r(e,t){var n=t.htmlState.tagName;n&&(n=n.toLowerCase());var r=l.token(e,t.htmlState);if("script"==n&&/\btag\b/.test(r)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var u=0;u<c.length;++u){var f=c[u];if("string"==typeof f.matches?i==f.matches:f.matches.test(i)){f.mode&&(t.token=o,t.localMode=f.mode,t.localState=f.mode.startState&&f.mode.startState(l.indent(t.htmlState,"")));break}}}else"style"==n&&/\btag\b/.test(r)&&">"==e.current()&&(t.token=a,t.localMode=s,t.localState=s.startState(l.indent(t.htmlState,"")));return r}function i(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*style\s*>/,s.token(e,t.localState))}var l=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),s=e.getMode(t,"css"),c=[],u=n&&n.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var f=0;f<u.length;++f){var d=u[f];c.push({matches:d.matches,mode:d.mode&&e.getMode(t,d.mode)})}return c.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){var e=l.startState();return{token:r,localMode:null,localState:null,htmlState:e}},copyState:function(t){if(t.localState)var n=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=n;break}}return"meta"}function r(e,t){return"variable-3"==t.prevToken?"variable-3":!1}function i(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return n?(t.cpp11RawStringDelim=n[1],t.tokenize=l,l(e,t)):!1}return e.match(/(u8|u|U|L)/)?e.match(/["']/,!1)?"string":!1:(e.next(),!1)}function o(e){var t=/(\w+)::(\w+)$/.exec(e);return t&&t[1]==t[2]}function a(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function l(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function s(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function c(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}e.defineMode("clike",function(t,n){function r(e,t){var n=e.next();if(w[n]){var r=w[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return d=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(T.test(n))return e.eatWhile(T),"operator";if(e.eatWhile(/[\w\$_\xa1-\uffff]/),L)for(;e.match(L);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var a=e.current();return v.propertyIsEnumerable(a)?(x.propertyIsEnumerable(a)&&(d="newstatement"),_.propertyIsEnumerable(a)&&(p=!0),"keyword"):y.propertyIsEnumerable(a)?"variable-3":b.propertyIsEnumerable(a)?(x.propertyIsEnumerable(a)&&(d="newstatement"),"builtin"):k.propertyIsEnumerable(a)?"atom":"variable"}function i(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!C)&&(n.tokenize=null),"string"}}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function a(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e){return"statement"==e||"switchstatement"==e||"namespace"==e}function s(e,t,n){var r=e.indented;return e.context&&l(e.context.type)&&!l(n)&&(r=e.context.indented),e.context=new a(r,t,n,null,e.context)}function c(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}function u(e,t){return"variable"==t.prevToken||"variable-3"==t.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,e.start))?!0:void 0}function f(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.type)return!1;e=e.prev}}var d,p,h=t.indentUnit,m=n.statementIndentUnit||h,g=n.dontAlignCalls,v=n.keywords||{},y=n.types||{},b=n.builtin||{},x=n.blockKeywords||{},_=n.defKeywords||{},k=n.atoms||{},w=n.hooks||{},C=n.multiLineStrings,S=n.indentStatements!==!1,M=n.indentSwitch!==!1,L=n.namespaceSeparator,T=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-h,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=p=null;var o=(t.tokenize||r)(e,t);if("comment"==o||"meta"==o)return o;if(null==i.align&&(i.align=!0),";"==d||":"==d||","==d)for(;l(t.context.type);)c(t);else if("{"==d)s(t,e.column(),"}");else if("["==d)s(t,e.column(),"]");else if("("==d)s(t,e.column(),")");else if("}"==d){for(;l(i.type);)i=c(t);for("}"==i.type&&(i=c(t));l(i.type);)i=c(t)}else if(d==i.type)c(t);else if(S&&(("}"==i.type||"top"==i.type)&&";"!=d||l(i.type)&&"newstatement"==d)){var a="statement";"newstatement"==d&&M&&"switch"==e.current()?a="switchstatement":"keyword"==o&&"namespace"==e.current()&&(a="namespace"),s(t,e.column(),a)}if("variable"==o&&("def"==t.prevToken||n.typeFirstDefinitions&&u(e,t)&&f(t.context)&&e.match(/^\s*\(/,!1))&&(o="def"),w.token){var h=w.token(e,t,o);void 0!==h&&(o=h)}return"def"==o&&n.styleDefs===!1&&(o="variable"),t.startOfLine=!1,t.prevToken=p?"def":o||d,o},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);l(i.type)&&"}"==o&&(i=i.prev);var a=o==i.type,s=i.prev&&"switchstatement"==i.prev.type;return l(i.type)?i.indented+("{"==o?0:m):!i.align||g&&")"==i.type?")"!=i.type||a?i.indented+(a?0:h)+(a||!s||/^(?:case|default)\b/.test(n)?0:h):i.indented+m:i.column+(a?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var u="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile",f="int long char short double float unsigned signed void size_t ptrdiff_t";s(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(u),types:t(f+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:t("case do else for if switch while struct"),defKeywords:t("struct"),typeFirstDefinitions:!0,atoms:t("null true false"),hooks:{"#":n,"*":r},modeProps:{fold:["brace","include"]}}),s(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(u+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:t(f+" bool wchar_t"),blockKeywords:t("catch class do else finally for if struct switch try while"),defKeywords:t("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"#":n,"*":r,u:i,U:i,L:i,R:i,token:function(e,t,n){return"variable"!=n||"("!=e.peek()||";"!=t.prevToken&&null!=t.prevToken&&"}"!=t.prevToken||!o(e.current())?void 0:"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),s("text/x-java",{name:"clike",keywords:t("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:t("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:t("catch class do else finally for if switch try while"),defKeywords:t("class interface package enum"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),s("text/x-csharp",{name:"clike",keywords:t("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:t("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),defKeywords:t("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=a,a(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),s("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:t("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),defKeywords:t("class def object package trait type val var"),atoms:t("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=c,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),s(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":n},modeProps:{fold:["brace","include"]}}),s("text/x-nesc",{name:"clike",keywords:t(u+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:t(f),blockKeywords:t("case do else for if switch while struct"),atoms:t("null true false"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),s("text/x-objectivec",{name:"clike",keywords:t(u+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:t(f),atoms:t("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":n},modeProps:{fold:"brace"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,n){this.indent=e,this.type=t,this.prev=n}function r(e,t,r){e.indentStack=new n(t,r,e.indentStack)}function i(e){e.indentStack=e.indentStack.prev}function o(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(k.hex),!0):("+"!=e&&"-"!=e||!k.digit.test(t.peek())||(t.eat(k.sign),e=t.next()),k.digit.test(e)?(t.eat(e),t.eatWhile(k.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(k.digit)),t.eat(k.exponent)&&(t.eat(k.sign),t.eatWhile(k.digit)),!0):!1)}function a(e){var t=e.next();t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)||"u"===t&&e.match(/[0-9a-z]{4}/i,!0)}var l="builtin",s="comment",c="string",u="string-2",f="atom",d="number",p="bracket",h="keyword",m="variable",g=e.indentUnit||2,v=e.indentUnit||2,y=t("true false nil"),b=t("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),x=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),_=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),k={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var w,C=!1;null!=(w=e.next());){if('"'==w&&!C){t.mode=!1;break}C=!C&&"\\"==w}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||k.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=s;else if(o(S,e))n=d;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(k.keyword_char));)L+=M;L.length>0&&(_.propertyIsEnumerable(L)||/^(?:def|with)/.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(k.symbol),f;e.eatWhile(k.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:x&&x.propertyIsEnumerable(e.current())?l:y&&y.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(s),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var f=0;e.current().length<u;){var d=e.next();if("("==d?f+=1:")"==d&&(f-=1),0>f)break}if(e.backUp(e.current().length-o),0==f)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",m=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(p.propertyIsEnumerable(g)&&(g=p[g]),n(a(g,h,m,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(l(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,l){var s,c=!1;for("read-quoted-paused"===l.context.type&&(l.context=l.context.prev,a.eat("}"));null!=(s=a.next());){if(s==e&&(r||!c)){l.tokenize.pop();break}if(n&&"#"==s&&!c){if(a.eat("{")){"}"==e&&(l.context={prev:l.context,type:"read-quoted-paused"}),l.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){l.tokenize.push(o());break}}c=!c&&"\\"==s}return t}}function l(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function s(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),f=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),d=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,f.propertyIsEnumerable(o)?n="indent":d.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent");
-e.registerHelper("hintWords","css",k),e.defineMIME("text/css",{documentTypes:o,mediaTypes:l,mediaFeatures:c,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:v,colorKeywords:b,valueKeywords:_,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=r,r(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=n,n(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:b,valueKeywords:_,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:b,valueKeywords:_,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlmixed",function(t,n){function r(e,t){var n=t.htmlState.tagName;n&&(n=n.toLowerCase());var r=l.token(e,t.htmlState);if("script"==n&&/\btag\b/.test(r)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var u=0;u<c.length;++u){var f=c[u];if("string"==typeof f.matches?i==f.matches:f.matches.test(i)){f.mode&&(t.token=o,t.localMode=f.mode,t.localState=f.mode.startState&&f.mode.startState(l.indent(t.htmlState,"")));break}}}else"style"==n&&/\btag\b/.test(r)&&">"==e.current()&&(t.token=a,t.localMode=s,t.localState=s.startState(l.indent(t.htmlState,"")));return r}function i(e,t,n){var r,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(r=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i)),n}function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):i(e,/<\/\s*style\s*>/,s.token(e,t.localState))}var l=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),s=e.getMode(t,"css"),c=[],u=n&&n.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var f=0;f<u.length;++f){var d=u[f];c.push({matches:d.matches,mode:d.mode&&e.getMode(t,d.mode)})}return c.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){var e=l.startState();return{token:r,localMode:null,localState:null,htmlState:e}},copyState:function(t){if(t.localState)var n=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?l.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=n;break}}return"meta"}function r(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return n?(t.cpp11RawStringDelim=n[1],t.tokenize=o,o(e,t)):!1}return e.match(/(u8|u|U|L)/)?e.match(/["']/,!1)?"string":!1:(e.next(),!1)}function i(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function o(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function a(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o<t.length;++o)e.defineMIME(t[o],n)}function l(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}e.defineMode("clike",function(t,n){function r(e,t){var n=e.next();if(v[n]){var r=v[n](e,t);if(r!==!1)return r}if('"'==n||"'"==n)return t.tokenize=i(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return c=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if("/"==n){if(e.eat("*"))return t.tokenize=o,o(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(x.test(n))return e.eatWhile(x),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var a=e.current();return p.propertyIsEnumerable(a)?(m.propertyIsEnumerable(a)&&(c="newstatement"),"keyword"):h.propertyIsEnumerable(a)?(m.propertyIsEnumerable(a)&&(c="newstatement"),"builtin"):g.propertyIsEnumerable(a)?"atom":"variable"}function i(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!y)&&(n.tokenize=null),"string"}}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function a(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function l(e,t,n){var r=e.indented;return e.context&&"statement"==e.context.type&&(r=e.context.indented),e.context=new a(r,t,n,null,e.context)}function s(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u=t.indentUnit,f=n.statementIndentUnit||u,d=n.dontAlignCalls,p=n.keywords||{},h=n.builtin||{},m=n.blockKeywords||{},g=n.atoms||{},v=n.hooks||{},y=n.multiLineStrings,b=n.indentStatements!==!1,x=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=n.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else c==n.type?s(t):b&&(("}"==n.type||"top"==n.type)&&";"!=c||"statement"==n.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:f):!i.align||d&&")"==i.type?")"!=i.type||a?i.indented+(a?0:u):i.indented+f:i.column+(a?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break int case long char register continue return default short do sizeof double static else struct switch extern typedef float union for unsigned goto while enum void const signed volatile";a(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(s),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),a(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(s+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":n,u:r,U:r,L:r,R:r},modeProps:{fold:["brace","include"]}}),a("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),a("text/x-csharp",{name:"clike",keywords:t("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=i,i(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),a("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=l,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),a(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),a("text/x-nesc",{name:"clike",keywords:t(s+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":n},modeProps:{fold:["brace","include"]}}),a("text/x-objectivec",{name:"clike",keywords:t(s+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":n},modeProps:{fold:"brace"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,n){this.indent=e,this.type=t,this.prev=n}function r(e,t,r){e.indentStack=new n(t,r,e.indentStack)}function i(e){e.indentStack=e.indentStack.prev}function o(e,t){return"0"===e&&t.eat(/x/i)?(t.eatWhile(k.hex),!0):("+"!=e&&"-"!=e||!k.digit.test(t.peek())||(t.eat(k.sign),e=t.next()),k.digit.test(e)?(t.eat(e),t.eatWhile(k.digit),"."==t.peek()&&(t.eat("."),t.eatWhile(k.digit)),t.eat(k.exponent)&&(t.eat(k.sign),t.eatWhile(k.digit)),!0):!1)}function a(e){var t=e.next();t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)||"u"===t&&e.match(/[0-9a-z]{4}/i,!0)}var l="builtin",s="comment",c="string",u="string-2",f="atom",d="number",p="bracket",h="keyword",m="variable",g=e.indentUnit||2,v=e.indentUnit||2,y=t("true false nil"),b=t("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),x=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),_=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),k={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var w,C=!1;null!=(w=e.next());){if('"'==w&&!C){t.mode=!1;break}C=!C&&"\\"==w}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||k.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=s;else if(o(S,e))n=d;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(k.keyword_char));)L+=M;L.length>0&&(_.propertyIsEnumerable(L)||/^(?:def|with)/.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(k.symbol),f;e.eatWhile(k.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:x&&x.propertyIsEnumerable(e.current())?l:y&&y.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(s),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-o);for(var f=0;e.current().length<u;){var d=e.next();if("("==d?f+=1:")"==d&&(f-=1),0>f)break}if(e.backUp(e.current().length-o),0==f)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var h="string",m=!0;e.eat("s")?h="atom":e.eat(/[WQ]/)?h="string":e.eat(/[r]/)?h="string-2":e.eat(/[wxq]/)&&(h="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(p.propertyIsEnumerable(g)&&(g=p[g]),n(a(g,h,m,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(l(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,l){var s,c=!1;for("read-quoted-paused"===l.context.type&&(l.context=l.context.prev,a.eat("}"));null!=(s=a.next());){if(s==e&&(r||!c)){l.tokenize.pop();break}if(n&&"#"==s&&!c){if(a.eat("{")){"}"==e&&(l.context={prev:l.context,type:"read-quoted-paused"}),l.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){l.tokenize.push(o());break}}c=!c&&"\\"==s}return t}}function l(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function s(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),f=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),d=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,f.propertyIsEnumerable(o)?n="indent":d.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented<t.indented&&(n="indent"):n="indent")}return(c||r&&"comment"!=r)&&(t.lastTok=i),"|"==c&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==p[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de",lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},l={builtins:["ascii","bytes","exec","print"],
-keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(s,c){function u(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?p(e,t,"py"):r>i&&h(e,t)&&(t.errorToken=!0),null}var o=f(e,t);return r>0&&h(e,t)&&(o+=" "+g),o}return f(e,t)}function f(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=d(e.current()),t.tokenize(e,t)):e.match(x)||e.match(b)?null:e.match(y)||e.match(_)?"operator":e.match(v)?null:e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(k)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function d(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=u,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return g;i.tokenize=u}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e,t,r){var i=0,o=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?s.indentUnit:w),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:r,align:o})}function h(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(k,!1)?null:g,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(k,!1)?"meta":"operator":e.match(k,!1)?"meta":g;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&p(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(n(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var g="error",v=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),y=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),b=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),k=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),k=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var w=c.hangingIndent||s.indentUnit,C=i,S=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(S=S.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(l.keywords),S=S.concat(l.builtins);var M=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),S=S.concat(a.builtins);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(C),T=t(S),A={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+g:r},indent:function(t,r){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=n(t),o=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var s=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:s("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),l=e.next();if("\\"===l)return e.next(),null;if("'"===l||'"'===l||"`"===l)return t.tokens.unshift(n(l)),r(e,t);if("#"===l)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===l)return t.tokens.unshift(o),r(e,t);if("+"===l||"="===l)return"operator";if("-"===l)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(l)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var s=e.current();return"="===e.peek()&&/\w+/.test(s)?"def":i.hasOwnProperty(s)?i[s]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return(i||!a)&&n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return 0==e.length?r(t):function(i,o){for(var a=e[0],l=0;l<a.length;l++)if(i.match(a[l][0]))return o.tokenize=n(e.slice(1),t),a[l][1];return o.tokenize=r(t),"string"}}function r(e){return function(t,n){return i(t,n,e)}}function i(e,t,r){if(e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=n([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r)),e.match(/\-\>\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r)),"variable-2";for(var i=!1;!e.eol()&&(i||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<</)){e.eatWhile(/[\w\.]/);var n=e.current().slice(3);if(n)return(t.tokStack||(t.tokStack=[])).push(n,0),t.tokenize=r(n),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(e,t){var n=t.curMode==o;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),n)return n&&null==t.php.tokenize&&e.match("?>")?(t.curMode=i,t.curState=t.html,"meta"):o.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var r=t.pending.style}else var r=i.token(e,t.curState);t.pending&&(t.pending=null);var a,l=e.current(),s=l.search(/<\?/);return-1!=s&&("string"==r&&(a=l.match(/[\'\"]$/))&&!/\?>/.test(l)?t.pending=a[0]:t.pending={end:e.pos,style:r},e.backUp(l.length-s)),r}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),r=e.startState(o);return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),l=t.php,s=e.copyState(o,l);return n=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":f.hasOwnProperty(a)?"keyword":s.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var s=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},f=n.keywords||{},d=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&l(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
-builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(f)?"punctuation":e.match(_)?"atom":e.match(v)?"keyword":e.match(d)?"variable":e.match(p)?"property":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,l=n.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":c;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||a(e,t);var i="[({".indexOf(r);if(-1!==i&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&l(e,t),"dedent"===n&&l(e,t))return c;if(i="])}".indexOf(r),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,x=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],_=n(x),k={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=s(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return k}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Y.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?G:void 0}function l(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,V):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V):void 0}function f(e){return e.match(/^default\b/)?V:void 0}function d(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",V):void 0}function p(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",V):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",V):void 0}function m(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",V):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",V):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,V):void 0}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,V):void 0}function x(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function _(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function k(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,V):void 0}function w(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,V):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,V):void 0}function M(e,t){var n;return(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),W(n,r,i),"atom"}}function T(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function A(e){return e.match(/^#([\w-]+)/)?K:void 0}function z(e){return e.match(/^\.([\w-]+)/)?X:void 0}function E(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function O(e,t){if(t.isAttrs){if(Z[e.peek()]&&t.attrsNest.push(Z[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Y.startState(),"script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?t.attributeIsType=!0:t.attributeIsType=!1),"attribute";var n=Y.token(e,t.jsState);if(t.attributeIsType&&"string"===n&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),O(e,t)}catch(r){}return t.attrValue+=e.current(),n||!0}}function q(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function N(e){return e.sol()&&e.eatSpace()?"indent":void 0}function I(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function P(e){return e.match(/^: */)?"colon":void 0}function D(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(W(e,t,"htmlmixed"),t.innerModeForLine=!0,F(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),W(e,t,n),"dot"}}function R(e){return e.next(),null}function W(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function F(e,t,n){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||n?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function H(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function $(){return new n}function B(e){return e.copy()}function U(e,t){var n=F(e,t)||H(e,t)||s(e,t)||y(e,t)||C(e,t)||O(e,t)||r(e,t)||i(e,t)||_(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||f(e,t)||d(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||x(e,t)||k(e,t)||w(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||z(e,t)||E(e,t)||q(e,t)||N(e,t)||D(e,t)||I(e,t)||P(e,t)||j(e,t)||R(e,t);return n===!0?null:n}var V="keyword",G="meta",K="builtin",X="qualifier",Z={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:$,copyState:B,token:U}}),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=l(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function l(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var s=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),f=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(f.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+s*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),n==t.pending?t.continueString=!1:t.continueString=!0,"string"}function t(t,r){var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return l=t,e}function r(e,t){e.eatWhile(/[\w\$_]/);var r=e.current();if(s.propertyIsEnumerable(r))return"keyword";if(c.propertyIsEnumerable(r))return"variable-2";if(u.propertyIsEnumerable(r))return"string-2";var l=e.next();return"@"==l?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==l&&e.eat("*")?(t.tokenize=i,i(e,t)):"<"==l&&e.eat("!")?(t.tokenize=o,o(e,t)):"="!=l?"~"!=l&&"|"!=l||!e.eat("=")?'"'==l||"'"==l?(t.tokenize=a(l),t.tokenize(e,t)):"#"==l?(e.skipToEnd(),n("comment","comment")):"!"==l?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(l)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(l)?n(null,"select-op"):/[;{}:\[\]]/.test(l)?n(null,l):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var l,s=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=e.indentUnit;
+}return(c||r&&"comment"!=r)&&(t.lastTok=i),"|"==c&&(t.varList=!t.varList),"indent"==n||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||r,indented:t.indented}:("dedent"==n||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==r),r},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var i=n&&n.charAt(0),o=t.context,a=o.type==p[i]||"keyword"==o.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return o.indented+(a?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de",lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],a={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},l={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None","async","await"]};e.registerHelper("hintWords","python",i.concat(o)),e.defineMode("python",function(s,c){function u(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?p(e,t,"py"):r>i&&h(e,t)&&(t.errorToken=!0),null}var o=f(e,t);return r>0&&h(e,t)&&(o+=" "+g),o}return f(e,t)}function f(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=d(e.current()),t.tokenize(e,t)):e.match(x)||e.match(b)?null:e.match(y)||e.match(_)?"operator":e.match(v)?null:e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(k)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function d(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=u,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return g;i.tokenize=u}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function p(e,t,r){var i=0,o=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?s.indentUnit:w),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(o=e.column()+1),t.scopes.push({offset:i,type:r,align:o})}function h(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function m(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(k,!1)?null:g,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(k,!1)?"meta":"operator":e.match(k,!1)?"meta":g;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||p(e,t,"py");var o=1==i.length?"[({".indexOf(i):-1;if(-1!=o&&p(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),-1!=o){if(n(t).type!=i)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var g="error",v=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),y=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),b=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),k=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var _=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),k=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var w=c.hangingIndent||s.indentUnit,C=i,S=o;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(S=S.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(l.keywords),S=S.concat(l.builtins);var M=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(a.keywords),S=S.concat(a.builtins);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(C),T=t(S),A={startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=m(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+g:r},indent:function(t,r){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var i=n(t),o=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(o?1:0):o&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var s=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:s("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r<n.length;r++)i[n[r]]=e}function t(e,t){if(e.eatSpace())return null;var a=e.sol(),l=e.next();if("\\"===l)return e.next(),null;if("'"===l||'"'===l||"`"===l)return t.tokens.unshift(n(l)),r(e,t);if("#"===l)return a&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===l)return t.tokens.unshift(o),r(e,t);if("+"===l||"="===l)return"operator";if("-"===l)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(l)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var s=e.current();return"="===e.peek()&&/\w+/.test(s)?"def":i.hasOwnProperty(s)?i[s]:null}function n(e){return function(t,n){for(var r,i=!1,a=!1;null!=(r=t.next());){if(r===e&&!a){i=!0;break}if("$"===r&&!a&&"'"!==e){a=!0,t.backUp(1),n.tokens.unshift(o);break}a=!a&&"\\"===r}return(i||!a)&&n.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function r(e,n){return(n.tokens[0]||t)(e,n)}var i={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var o=function(e,t){t.tokens.length>1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t,i){return 0==e.length?r(t):function(o,a){for(var l=e[0],s=0;s<l.length;s++)if(o.match(l[s][0]))return a.tokenize=n(e.slice(1),t),l[s][1];return a.tokenize=r(t,i),"string"}}function r(e,t){return function(n,r){return i(n,r,e,t)}}function i(e,t,r,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=n([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,i)),e.match(/\-\>\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",l="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,l].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var s={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(l),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<</)){var n=e.eat("'");e.eatWhile(/[\w\.]/);var i=e.current().slice(3+(n?1:0));if(n&&e.eat("'"),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=r(i,n?!1:!0),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(e,t){var n=t.curMode==o;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),n)return n&&null==t.php.tokenize&&e.match("?>")?(t.curMode=i,t.curState=t.html,"meta"):o.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var r=t.pending.style}else var r=i.token(e,t.curState);t.pending&&(t.pending=null);var a,l=e.current(),s=l.search(/<\?/);return-1!=s&&("string"==r&&(a=l.match(/[\'\"]$/))&&!/\?>/.test(l)?t.pending=a[0]:t.pending={end:e.pos,style:r},e.backUp(l.length-s)),r}var i=e.getMode(t,"text/html"),o=e.getMode(t,s);return{startState:function(){var t=e.startState(i),r=e.startState(o);return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),l=t.php,s=e.copyState(o,l);return n=t.curMode==i?a:s,{html:a,php:s,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",s)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":f.hasOwnProperty(a)?"keyword":s.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function l(e){e.indent=e.context.indent,e.context=e.context.prev}var s=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},f=n.keywords||{},d=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&l(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}var o="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";e.defineMIME("text/x-sql",{name:"sql",keywords:i(o+"begin"),builtin:i("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
+builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&l(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var s=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),e.match(/^-?\d+\.\d*/)&&(s=!0),e.match(/^-?\.\d+/)&&(s=!0),s)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(f)?"punctuation":e.match(_)?"atom":e.match(v)?"keyword":e.match(d)?"variable":e.match(p)?"property":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,l=n.scope;l;l=l.prev)if("coffee"===l.type||"}"==l.type){i=l.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function l(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function s(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":c;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||a(e,t);var i="[({".indexOf(r);if(-1!==i&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&l(e,t),"dedent"===n&&l(e,t))return c;if(i="])}".indexOf(r),-1!==i){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,x=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],_=n(x),k={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=s(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return k}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Y.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){return e.match(/^yield\b/)?"keyword":void 0}function a(e){return e.match(/^(?:doctype) *([^\n]+)?/)?G:void 0}function l(e,t){return e.match("#{")?(t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"):void 0}function s(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){return e.match(/^case\b/)?(t.javaScriptLine=!0,V):void 0}function u(e,t){return e.match(/^when\b/)?(t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V):void 0}function f(e){return e.match(/^default\b/)?V:void 0}function d(e,t){return e.match(/^extends?\b/)?(t.restOfLine="string",V):void 0}function p(e,t){return e.match(/^append\b/)?(t.restOfLine="variable",V):void 0}function h(e,t){return e.match(/^prepend\b/)?(t.restOfLine="variable",V):void 0}function m(e,t){return e.match(/^block\b *(?:(prepend|append)\b)?/)?(t.restOfLine="variable",V):void 0}function g(e,t){return e.match(/^include\b/)?(t.restOfLine="string",V):void 0}function v(e,t){return e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include")?(t.isIncludeFiltered=!0,V):void 0}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){return e.match(/^mixin\b/)?(t.javaScriptLine=!0,V):void 0}function x(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,l(e,t)):void 0}function _(e,t){return t.mixinCallAfter?(t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0):void 0}function k(e,t){return e.match(/^(if|unless|else if|else)\b/)?(t.javaScriptLine=!0,V):void 0}function w(e,t){return e.match(/^(- *)?(each|for)\b/)?(t.isEach=!0,V):void 0}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){return e.match(/^while\b/)?(t.javaScriptLine=!0,V):void 0}function M(e,t){var n;return(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"):void 0}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),R(n,r,i),"atom"}}function T(e,t){return e.match(/^(!?=|-)/)?(t.javaScriptLine=!0,"punctuation"):void 0}function A(e){return e.match(/^#([\w-]+)/)?K:void 0}function z(e){return e.match(/^\.([\w-]+)/)?X:void 0}function E(e,t){return"("==e.peek()?(e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"):void 0}function q(e,t){if(t.isAttrs){if(Z[e.peek()]&&t.attrsNest.push(Z[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return("="===e.peek()||"!"===e.peek())&&(t.inAttributeName=!1,t.jsState=Y.startState(),"script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?t.attributeIsType=!0:t.attributeIsType=!1),"attribute";var n=Y.token(e,t.jsState);if(t.attributeIsType&&"string"===n&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),q(e,t)}catch(r){}return t.attrValue+=e.current(),n||!0}}function O(e,t){return e.match(/^&attributes\b/)?(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"):void 0}function N(e){return e.sol()&&e.eatSpace()?"indent":void 0}function I(e,t){return e.match(/^ *\/\/(-)?([^\n]*)/)?(t.indentOf=e.indentation(),t.indentToken="comment","comment"):void 0}function P(e){return e.match(/^: */)?"colon":void 0}function D(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(R(e,t,"htmlmixed"),t.innerModeForLine=!0,W(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),R(e,t,n),"dot"}}function F(e){return e.next(),null}function R(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function W(e,t,n){return e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||n?t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken):void(e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null))}function H(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function $(){return new n}function B(e){return e.copy()}function U(e,t){var n=W(e,t)||H(e,t)||s(e,t)||y(e,t)||C(e,t)||q(e,t)||r(e,t)||i(e,t)||_(e,t)||o(e,t)||a(e,t)||l(e,t)||c(e,t)||u(e,t)||f(e,t)||d(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||x(e,t)||k(e,t)||w(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||z(e,t)||E(e,t)||O(e,t)||N(e,t)||D(e,t)||I(e,t)||P(e,t)||j(e,t)||F(e,t);return n===!0?null:n}var V="keyword",G="meta",K="builtin",X="qualifier",Z={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:$,copyState:B,token:U}}),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=l(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function l(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var s=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),f=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(f.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+s*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),n==t.pending?t.continueString=!1:t.continueString=!0,"string"}function t(t,r){var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return l=t,e}function r(e,t){e.eatWhile(/[\w\$_]/);var r=e.current();if(s.propertyIsEnumerable(r))return"keyword";if(c.propertyIsEnumerable(r))return"variable-2";if(u.propertyIsEnumerable(r))return"string-2";var l=e.next();return"@"==l?(e.eatWhile(/[\w\\\-]/),n("meta",e.current())):"/"==l&&e.eat("*")?(t.tokenize=i,i(e,t)):"<"==l&&e.eat("!")?(t.tokenize=o,o(e,t)):"="!=l?"~"!=l&&"|"!=l||!e.eat("=")?'"'==l||"'"==l?(t.tokenize=a(l),t.tokenize(e,t)):"#"==l?(e.skipToEnd(),n("comment","comment")):"!"==l?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(l)?(e.eatWhile(/[\w.%]/),n("number","unit")):/[,.+>*\/]/.test(l)?n(null,"select-op"):/[;{}:\[\]]/.test(l)?n(null,l):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var l,s=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=e.indentUnit;
return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;l=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==l&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(l)&&t.stack.pop(),"{"==l?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==l?t.stack.pop():"@media"==l?t.stack.push("@media"):"{"==r&&"comment"!=l&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*f},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&n>t?t:r)}function i(e,t){var n,r=e.pos+t;0>=r?e.pos=0:r>=(n=e.string.length-1)?e.pos=n:e.pos=r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,l=!1,s=0;o=e.next();){if(o===n[s]&&!l)return void 0!==n[++s]?(t.chain=n[s],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;l=!l&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var f=a.next();if('"'==f||"'"==f){if(n(a,3)=="<<"+f){var d=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(f))return o(a,u,p);a.pos=d}return e(a,u,[f],"string")}if("q"==f){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],s,c);if("["==h)return i(a,2),e(a,u,["]"],s,c);if("{"==h)return i(a,2),e(a,u,["}"],s,c);if("<"==h)return i(a,2),e(a,u,[">"],s,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],s,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==f){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],s,c);if("("==h)return e(a,u,[")"],s,c);if("["==h)return e(a,u,["]"],s,c);if("{"==h)return e(a,u,["}"],s,c);if("<"==h)return e(a,u,[">"],s,c)}}if("s"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("y"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("t"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],s,c):"{"==h?e(a,u,["}","}"],s,c):"<"==h?e(a,u,[">",">"],s,c):"("==h?e(a,u,[")",")"],s,c):e(a,u,[h,h],s,c)}if("`"==f)return e(a,u,[f],"variable-2");if("/"==f)return/~\s*$/.test(n(a))?e(a,u,[f],s,c):"operator";if("$"==f){var d=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=d}if(/[$@%]/.test(f)){var d=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(l[h])return"variable-2"}a.pos=d}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return l[h]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var d=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),l[a.current()])return"operator";a.pos=d}if("_"==f&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\x00"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\x00"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\x00"],"string")}if(/\w/.test(f)){var d=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=d}if(/[A-Z]/.test(f)){var m=t(a,-2),d=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=d}if(/[a-zA-Z_]/.test(f)){var m=t(a,-2);a.eatWhile(/\w/);var h=l[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var l={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},s="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=s,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=s,s(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=s):n.skipToEnd(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),l=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&l===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=s,"string"):"#"===a&&"{"===l?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):s(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function l(e){1!=e.scopes.length&&e.scopes.shift()}function s(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(s),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(f))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(p))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(f))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||l(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(p)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if(("@return"===i||"}"===i)&&l(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,s=[],c=0;c<n.scopes.length;c++){var u=n.scopes[c];u.offset<=a&&s.push(u)}n.scopes=s}return r}var u=["true","false","null","auto"],f=new RegExp("^"+u.join("|")),d=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],p=t(d),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:s,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r<t.length;++r)n[t[r]]=!0;return n}function n(e,t){a=null;var n=e.next();if("#"==n)return e.skipToEnd(),"comment";if("0"==n&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==n&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(n))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==n||'"'==n)return t.tokenize=r(n),"string";if("."==n&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(n)&&"_"!=n){e.eatWhile(/[\w\.]/);var i=e.current();return l.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(u.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1)&&(a="block"),"keyword"):s.propertyIsEnumerable(i)?"builtin":"variable"}return"%"==n?(e.skipTo("%")&&e.next(),"variable-2"):"<"==n&&e.eat("-")?"arrow":"="==n&&t.ctx.argList?"arg-is":f.test(n)?"$"==n?"dollar":(e.eatWhile(f),"operator"):/[\(\){}\[\];]/.test(n)?(a=n,";"==n?"semi":null):null}function r(e){return function(t,r){if(t.eat("\\")){var i=t.next();return"x"==i?t.match(/^[a-f0-9]{2}/i):("u"==i||"U"==i)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==i?t.match(/^[a-f0-9]{4}/i):"U"==i?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(i)&&t.match(/^[0-7]{1,2}/),"string-2"}for(var o;null!=(o=t.next());){if(o==e){r.tokenize=n;break}if("\\"==o){t.backUp(1);break}}return"string"}}function i(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function o(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var a,l=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),s=t("list quote bquote eval return call parse deparse"),c=t("if else repeat while function for in next break"),u=t("if else repeat while function for"),f=/[+\-*\/^<>=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var t=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],n="("+t.join("|")+")",r=new RegExp(n+"\\s*$","i"),i=new RegExp(n+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:r,token:"variable-2"},{regex:i,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),e.defineMIME("text/x-dockerfile","dockerfile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(0>r&&0==n.ch)return t.clipPos(d(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(d(n.line+1,0));for(var o,a="start",l=n.ch,s=0>r?0:i.length,c=0;l!=s;l+=r,c++){var u=i.charAt(0>r?l-1:l),f="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==f&&u.toUpperCase()==u&&(f="W"),"start"==a)"o"!=f&&(a="in",o=f);else if("in"==a&&o!=f){if("w"==o&&"W"==f&&0>r&&l--,"W"==o&&"w"==f&&r>0){o="w";continue}break}}return d(n.line,l)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):0>n?r.from():r.to()})}function r(e,t){e.operation(function(){for(var n=e.listSelections().length,r=[],i=-1,o=0;n>o;o++){var a=e.listSelections()[o].head;if(!(a.line<=i)){var l=d(a.line+(t?0:1),0);e.replaceRange("\n",l,null,"+insertLine"),e.indentLine(l.line,null,!0),r.push({head:l,anchor:l}),i=a.line+1}}e.setSelections(r)})}function i(t,n){for(var r=n.ch,i=r,o=t.getLine(n.line);r&&e.isWordChar(o.charAt(r-1));)--r;for(;i<o.length&&e.isWordChar(o.charAt(i));)++i;return{from:d(n.line,r),to:d(n.line,i),word:o.slice(r,i)}}function o(e){var t=e.getCursor(),n=e.scanForBracket(t,-1);if(n)for(;;){var r=e.scanForBracket(t,1);if(!r)return;if(r.ch==m.charAt(m.indexOf(n.ch)+1))return e.setSelection(d(n.pos.line,n.pos.ch+1),r.pos,!1),!0;t=d(r.pos.line,r.pos.ch+1)}}function a(e,t){for(var n,r=e.listSelections(),i=[],o=0;o<r.length;o++){var a=r[o];if(!a.empty()){for(var l=a.from().line,s=a.to().line;o<r.length-1&&r[o+1].from().line==s;)s=a[++o].to().line;i.push(l,s)}}i.length?n=!0:i.push(e.firstLine(),e.lastLine()),e.operation(function(){for(var r=[],o=0;o<i.length;o+=2){var a=i[o],l=i[o+1],s=d(a,0),c=d(l),u=e.getRange(s,c,!1);t?u.sort():u.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),t>e?-1:e==t?0:1}),e.replaceRange(u,s,c,"+sortLines"),n&&r.push({anchor:s,head:c})}n&&e.setSelections(r,0)})}function l(t,n){t.operation(function(){for(var r=t.listSelections(),o=[],a=[],l=0;l<r.length;l++){var s=r[l];s.empty()?(o.push(l),a.push("")):a.push(n(t.getRange(s.from(),s.to())))}t.replaceSelections(a,"around","case");for(var c,l=o.length-1;l>=0;l--){var s=r[o[l]];if(!(c&&e.cmpPos(s.head,c)>0)){var u=i(t,s.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to,"case")}}})}function s(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=s(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},f=e.commands,d=e.Pos,p=e.keyMap["default"]==e.keyMap.macDefault,h=p?"Cmd-":"Ctrl-";f[u["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},f[u["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)},f[u[h+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f[u[h+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)for(var i=t[r].from(),o=t[r].to(),a=i.line;a<=o.line;++a)o.line>i.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",f[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},f[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r];n.push({anchor:d(i.from().line,0),head:d(i.to().line+1,0)})}e.setSelections(n)},u["Shift-"+h+"K"]="deleteLine",f[u[h+"Enter"]="insertLineAfter"]=function(e){r(e,!1)},f[u["Shift-"+h+"Enter"]="insertLineBefore"]=function(e){r(e,!0)},f[u[h+"D"]="selectNextOccurrence"]=function(t){var n=t.getCursor("from"),r=t.getCursor("to"),o=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(n,r)){var a=i(t,n);if(!a.word)return;t.setSelection(a.from,a.to),o=!0}else{var l=t.getRange(n,r),s=o?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(s,r);c.findNext()?t.addSelection(c.from(),c.to()):(c=t.getSearchCursor(s,d(t.firstLine(),0)),c.findNext()&&t.addSelection(c.from(),c.to()))}o&&(t.state.sublimeFindFullWord=t.doc.sel)};var m="(){}[]";f[u["Shift-"+h+"Space"]="selectScope"]=function(e){o(e)||e.execCommand("selectAll")},f[u["Shift-"+h+"M"]="selectBetweenBrackets"]=function(t){return o(t)?void 0:e.Pass},f[u[h+"M"]="goToBracket"]=function(t){t.extendSelectionsBy(function(n){var r=t.scanForBracket(n.head,1);if(r&&0!=e.cmpPos(r.pos,n.head))return r.pos;var i=t.scanForBracket(n.head,-1);return i&&d(i.pos.line,i.pos.ch+1)||n.head})};var g=p?"Cmd-Ctrl-":"Shift-Ctrl-";f[u[g+"Up"]="swapLineUp"]=function(e){for(var t=e.listSelections(),n=[],r=e.firstLine()-1,i=[],o=0;o<t.length;o++){var a=t[o],l=a.from().line-1,s=a.to().line;i.push({anchor:d(a.anchor.line-1,a.anchor.ch),head:d(a.head.line-1,a.head.ch)}),0!=a.to().ch||a.empty()||--s,l>r?n.push(l,s):n.length&&(n[n.length-1]=s),r=s}e.operation(function(){for(var t=0;t<n.length;t+=2){var r=n[t],o=n[t+1],a=e.getLine(r);e.replaceRange("",d(r,0),d(r+1,0),"+swapLine"),o>e.lastLine()?e.replaceRange("\n"+a,d(e.lastLine()),null,"+swapLine"):e.replaceRange(a+"\n",d(o,0),null,"+swapLine")}e.setSelections(i),e.scrollIntoView()})},f[u[g+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],r=e.lastLine()+1,i=t.length-1;i>=0;i--){var o=t[i],a=o.to().line+1,l=o.from().line;0!=o.to().ch||o.empty()||a--,r>a?n.push(a,l):n.length&&(n[n.length-1]=l),r=l}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var r=n[t],i=n[t+1],o=e.getLine(r);r==e.lastLine()?e.replaceRange("",d(r-1),d(r),"+swapLine"):e.replaceRange("",d(r,0),d(r+1,0),"+swapLine"),e.replaceRange(o+"\n",d(i,0),null,"+swapLine")}e.scrollIntoView()})},u[h+"/"]="toggleComment",f[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){for(var i=t[r],o=i.from(),a=o.line,l=i.to().line;r<t.length-1&&t[r+1].from().line==l;)l=t[++r].to().line;n.push({start:a,end:l,anchor:!i.empty()&&o})}e.operation(function(){for(var t=0,r=[],i=0;i<n.length;i++){for(var o,a=n[i],l=a.anchor&&d(a.anchor.line-t,a.anchor.ch),s=a.start;s<=a.end;s++){var c=s-t;s==a.end&&(o=d(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",d(c),d(c+1,/^\s*/.exec(e.getLine(c+1))[0].length),"+joinLines"),++t)}r.push({anchor:l||o,head:o})}e.setSelections(r,0)})},f[u["Shift-"+h+"D"]="duplicateLine"]=function(e){e.operation(function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];r.empty()?e.replaceRange(e.getLine(r.head.line)+"\n",d(r.head.line,0),null,"+duplicateLine"):e.replaceRange(e.getRange(r.from(),r.to()),r.from(),null,"+duplicateLine")}e.scrollIntoView()})},u[h+"T"]="transposeChars",f[u.F9="sortLines"]=function(e){a(e,!0)},f[u[h+"F9"]="sortLinesInsensitive"]=function(e){a(e,!1)},f[u.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},f[u["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},f[u[h+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var i=t[r].from(),o=t[r].to(),a=e.findMarks(i,o),l=0;l<a.length;l++)if(a[l].sublimeBookmark){a[l].clear();for(var s=0;s<n.length;s++)n[s]==a[l]&&n.splice(s--,1);break}l==a.length&&n.push(e.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},f[u["Shift-"+h+"F2"]="clearBookmarks"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},f[u["Alt-F2"]="selectBookmarks"]=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var i=t[r].find();i?n.push({anchor:i.from,head:i.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},u["Alt-Q"]="wrapLines";var v=h+"K ";u[v+h+"Backspace"]="delLineLeft",f[u.Backspace="smartBackspace"]=function(t){if(t.somethingSelected())return e.Pass;var n=t.getCursor(),r=t.getRange({line:n.line,ch:0},n),i=e.countColumn(r,null,t.getOption("tabSize"));return r&&!/\S/.test(r)&&i%t.getOption("indentUnit")==0?t.indentSelection("subtract"):e.Pass},f[u[v+h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,d(t[n].to().line),"+delete");e.scrollIntoView()})},f[u[v+h+"U"]="upcaseAtCursor"]=function(e){l(e,function(e){return e.toUpperCase()})},f[u[v+h+"L"]="downcaseAtCursor"]=function(e){l(e,function(e){return e.toLowerCase()})},f[u[v+h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},f[u[v+h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f[u[v+h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i,"+delete")}},f[u[v+h+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f[u[v+h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},u[v+h+"G"]="clearBookmarks",f[u[v+h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},f[u["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line>e.firstLine()&&e.addSelection(d(r.head.line-1,r.head.ch))}})},f[u["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n<t.length;n++){var r=t[n];r.head.line<e.lastLine()&&e.addSelection(d(r.head.line+1,r.head.ch))}})},f[u[h+"F3"]="findUnder"]=function(e){c(e,!0)},f[u["Shift-"+h+"F3"]="findUnderPrevious"]=function(e){c(e,!1)},f[u["Alt-F3"]="findAllUnder"]=function(e){var t=s(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}},u["Shift-"+h+"["]="fold",u["Shift-"+h+"]"]="unfold",u[v+h+"0"]=u[v+h+"j"]="unfoldAll",u[h+"I"]="findIncremental",u["Shift-"+h+"I"]="findIncrementalReverse",u[h+"H"]="replace",u.F3="findNext",u["Shift-F3"]="findPrev",e.normalizeKeyMap(u)}); \ No newline at end of file
diff --git a/public/vendor/codemirror/keymap/vim.js b/public/vendor/codemirror/keymap/vim.js
index ef5dd8c0..d50cc4af 100755
--- a/public/vendor/codemirror/keymap/vim.js
+++ b/public/vendor/codemirror/keymap/vim.js
@@ -3,42 +3,16 @@
/**
* Supported keybindings:
+ * Too many to list. Refer to defaultKeyMap below.
*
- * Motion:
- * h, j, k, l
- * gj, gk
- * e, E, w, W, b, B, ge, gE
- * f<character>, F<character>, t<character>, T<character>
- * $, ^, 0, -, +, _
- * gg, G
- * %
- * '<character>, `<character>
- *
- * Operator:
- * d, y, c
- * dd, yy, cc
- * g~, g~g~
- * >, <, >>, <<
- *
- * Operator-Motion:
- * x, X, D, Y, C, ~
- *
- * Action:
- * a, i, s, A, I, S, o, O
- * zz, z., z<CR>, zt, zb, z-
- * J
- * u, Ctrl-r
- * m<character>
- * r<character>
- *
- * Modes:
- * ESC - leave insert mode, visual mode, and clear input state.
- * Ctrl-[, Ctrl-c - same as ESC.
+ * Supported Ex commands:
+ * Refer to defaultExCommandMap below.
*
* Registers: unnamed, -, a-z, A-Z, 0-9
* (Does not respect the special case for number registers when delete
* operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
* TODO: Implement the remaining registers.
+ *
* Marks: a-z, A-Z, and 0-9
* TODO: Implement the remaining special marks. They have more complex
* behavior.
@@ -57,6 +31,7 @@
* 6. Motion, operator, and action implementations
* 7. Helper functions for the key handler, motions, operators, and actions
* 8. Set up Vim to work as a keymap for CodeMirror.
+ * 9. Ex command implementations.
*/
(function(mod) {
@@ -227,6 +202,34 @@
{ keys: ':', type: 'ex' }
];
+ /**
+ * Ex commands
+ * Care must be taken when adding to the default Ex command map. For any
+ * pair of commands that have a shared prefix, at least one of their
+ * shortNames must not match the prefix of the other command.
+ */
+ var defaultExCommandMap = [
+ { name: 'colorscheme', shortName: 'colo' },
+ { name: 'map' },
+ { name: 'imap', shortName: 'im' },
+ { name: 'nmap', shortName: 'nm' },
+ { name: 'vmap', shortName: 'vm' },
+ { name: 'unmap' },
+ { name: 'write', shortName: 'w' },
+ { name: 'undo', shortName: 'u' },
+ { name: 'redo', shortName: 'red' },
+ { name: 'set', shortName: 'se' },
+ { name: 'set', shortName: 'se' },
+ { name: 'setlocal', shortName: 'setl' },
+ { name: 'setglobal', shortName: 'setg' },
+ { name: 'sort', shortName: 'sor' },
+ { name: 'substitute', shortName: 's', possiblyAsync: true },
+ { name: 'nohlsearch', shortName: 'noh' },
+ { name: 'delmarks', shortName: 'delm' },
+ { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
+ { name: 'global', shortName: 'g' }
+ ];
+
var Pos = CodeMirror.Pos;
var Vim = function() {
@@ -463,7 +466,7 @@
}
// The 'filetype' option proxies to the CodeMirror 'mode' option.
if (name === undefined) {
- var mode = cm.getMode().name;
+ var mode = cm.getOption('mode');
return mode == 'null' ? '' : mode;
} else {
var mode = name == '' ? 'null' : name;
@@ -689,7 +692,9 @@
getOption: getOption,
defineOption: defineOption,
defineEx: function(name, prefix, func){
- if (name.indexOf(prefix) !== 0) {
+ if (!prefix) {
+ prefix = name;
+ } else if (name.indexOf(prefix) !== 0) {
throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
}
exCommands[name]=func;
@@ -846,6 +851,8 @@
mapCommand: mapCommand,
_mapCommand: _mapCommand,
+ defineRegister: defineRegister,
+
exitVisualMode: exitVisualMode,
exitInsertMode: exitInsertMode
};
@@ -935,6 +942,25 @@
}
};
+ /**
+ * Defines an external register.
+ *
+ * The name should be a single character that will be used to reference the register.
+ * The register should support setText, pushText, clear, and toString(). See Register
+ * for a reference implementation.
+ */
+ function defineRegister(name, register) {
+ var registers = vimGlobalState.registerController.registers[name];
+ if (!name || name.length != 1) {
+ throw Error('Register name must be 1 character');
+ }
+ if (registers[name]) {
+ throw Error('Register already defined ' + name);
+ }
+ registers[name] = register;
+ validRegisters.push(name);
+ }
+
/*
* vim registers allow you to keep many independent copy and paste buffers.
* See http://usevim.com/2012/04/13/registers/ for an introduction.
@@ -3635,13 +3661,17 @@
// Translates the replace part of a search and replace from ex (vim) syntax into
// javascript form. Similar to translateRegex, but additionally fixes back references
// (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'.
+ var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'};
function translateRegexReplace(str) {
var escapeNextChar = false;
var out = [];
for (var i = -1; i < str.length; i++) {
var c = str.charAt(i) || '';
var n = str.charAt(i+1) || '';
- if (escapeNextChar) {
+ if (charUnescapes[c + n]) {
+ out.push(charUnescapes[c+n]);
+ i++;
+ } else if (escapeNextChar) {
// At any point in the loop, escapeNextChar is true if the previous
// character was a '\' and was not escaped.
out.push(c);
@@ -3669,6 +3699,7 @@
}
// Unescape \ and / in the replace part, for PCRE mode.
+ var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'};
function unescapeRegexReplace(str) {
var stream = new CodeMirror.StringStream(str);
var output = [];
@@ -3677,13 +3708,15 @@
while (stream.peek() && stream.peek() != '\\') {
output.push(stream.next());
}
- if (stream.match('\\/', true)) {
- // \/ => /
- output.push('/');
- } else if (stream.match('\\\\', true)) {
- // \\ => \
- output.push('\\');
- } else {
+ var matched = false;
+ for (var matcher in unescapes) {
+ if (stream.match(matcher, true)) {
+ matched = true;
+ output.push(unescapes[matcher]);
+ break;
+ }
+ }
+ if (!matched) {
// Don't change anything
output.push(stream.next());
}
@@ -3913,31 +3946,6 @@
return {top: from.line, bottom: to.line};
}
- // Ex command handling
- // Care must be taken when adding to the default Ex command map. For any
- // pair of commands that have a shared prefix, at least one of their
- // shortNames must not match the prefix of the other command.
- var defaultExCommandMap = [
- { name: 'colorscheme', shortName: 'colo' },
- { name: 'map' },
- { name: 'imap', shortName: 'im' },
- { name: 'nmap', shortName: 'nm' },
- { name: 'vmap', shortName: 'vm' },
- { name: 'unmap' },
- { name: 'write', shortName: 'w' },
- { name: 'undo', shortName: 'u' },
- { name: 'redo', shortName: 'red' },
- { name: 'set', shortName: 'se' },
- { name: 'set', shortName: 'se' },
- { name: 'setlocal', shortName: 'setl' },
- { name: 'setglobal', shortName: 'setg' },
- { name: 'sort', shortName: 'sor' },
- { name: 'substitute', shortName: 's', possiblyAsync: true },
- { name: 'nohlsearch', shortName: 'noh' },
- { name: 'delmarks', shortName: 'delm' },
- { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
- { name: 'global', shortName: 'g' }
- ];
var ExCommandDispatcher = function() {
this.buildCommandMap_();
};
@@ -4483,6 +4491,9 @@
var query = state.getQuery();
var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
var lineEnd = params.lineEnd || lineStart;
+ if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {
+ lineEnd = Infinity;
+ }
if (count) {
lineStart = lineEnd;
lineEnd = lineStart + count - 1;
@@ -4601,10 +4612,9 @@
searchCursor.replace(newText);
}
function next() {
- var found;
// The below only loops to skip over multiple occurrences on the same
// line when 'global' is not true.
- while(found = searchCursor.findNext() &&
+ while(searchCursor.findNext() &&
isInRange(searchCursor.from(), lineStart, lineEnd)) {
if (!global && lastPos && searchCursor.from().line == lastPos.line) {
continue;
@@ -4737,7 +4747,7 @@
}
function _mapCommand(command) {
- defaultKeymap.push(command);
+ defaultKeymap.unshift(command);
}
function mapCommand(keys, type, name, args, extra) {
@@ -4779,6 +4789,14 @@
function executeMacroRegister(cm, vim, macroModeState, registerName) {
var register = vimGlobalState.registerController.getRegister(registerName);
+ if (registerName == ':') {
+ // Read-only register containing last Ex command.
+ if (register.keyBuffer[0]) {
+ exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);
+ }
+ macroModeState.isPlaying = false;
+ return;
+ }
var keyBuffer = register.keyBuffer;
var imc = 0;
macroModeState.isPlaying = true;
@@ -4818,7 +4836,7 @@
if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName);
- if (register) {
+ if (register && register.pushInsertModeChanges) {
register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
}
}
@@ -4827,7 +4845,7 @@
if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName);
- if (register) {
+ if (register && register.pushSearchQuery) {
register.pushSearchQuery(query);
}
}
diff --git a/public/vendor/codemirror/lib/codemirror.css b/public/vendor/codemirror/lib/codemirror.css
index ceacd130..b313b61c 100755
--- a/public/vendor/codemirror/lib/codemirror.css
+++ b/public/vendor/codemirror/lib/codemirror.css
@@ -92,6 +92,15 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
/* DEFAULT THEME */
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+.cm-strikethrough {text-decoration: line-through;}
+
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
@@ -111,18 +120,9 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-.cm-strikethrough {text-decoration: line-through;}
-
.cm-s-default .cm-error {color: #f00;}
.cm-invalidchar {color: #f00;}
diff --git a/public/vendor/codemirror/lib/codemirror.js b/public/vendor/codemirror/lib/codemirror.js
index bd544271..7ba4ffe4 100755
--- a/public/vendor/codemirror/lib/codemirror.js
+++ b/public/vendor/codemirror/lib/codemirror.js
@@ -728,12 +728,9 @@
}
function postUpdateDisplay(cm, update) {
- var force = update.force, viewport = update.viewport;
+ var viewport = update.viewport;
for (var first = true;; first = false) {
- if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) {
- force = true;
- } else {
- force = false;
+ if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
// Clip forced viewport to actual scrollable area.
if (viewport && viewport.top != null)
viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)};
@@ -1084,9 +1081,10 @@
cm.display.shift = false;
if (!sel) sel = doc.sel;
+ var paste = cm.state.pasteIncoming || origin == "paste";
var textLines = splitLines(inserted), multiPaste = null;
// When pasing N lines into N selections, insert one line per selection
- if (cm.state.pasteIncoming && sel.ranges.length > 1) {
+ if (paste && sel.ranges.length > 1) {
if (lastCopied && lastCopied.join("\n") == inserted)
multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);
else if (textLines.length == sel.ranges.length)
@@ -1100,40 +1098,57 @@
if (range.empty()) {
if (deleted && deleted > 0) // Handle deletion
from = Pos(from.line, from.ch - deleted);
- else if (cm.state.overwrite && !cm.state.pasteIncoming) // Handle overwrite
+ else if (cm.state.overwrite && !paste) // Handle overwrite
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
}
var updateInput = cm.curOp.updateInput;
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
- origin: origin || (cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
+ origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
makeChange(cm.doc, changeEvent);
signalLater(cm, "inputRead", cm, changeEvent);
- // When an 'electric' character is inserted, immediately trigger a reindent
- if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&
- cm.options.smartIndent && range.head.ch < 100 &&
- (!i || sel.ranges[i - 1].head.line != range.head.line)) {
- var mode = cm.getModeAt(range.head);
- var end = changeEnd(changeEvent);
- var indented = false;
- if (mode.electricChars) {
- for (var j = 0; j < mode.electricChars.length; j++)
- if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
- indented = indentLine(cm, end.line, "smart");
- break;
- }
- } else if (mode.electricInput) {
- if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))
- indented = indentLine(cm, end.line, "smart");
- }
- if (indented) signalLater(cm, "electricInput", cm, end.line);
- }
}
+ if (inserted && !paste)
+ triggerElectric(cm, inserted);
+
ensureCursorVisible(cm);
cm.curOp.updateInput = updateInput;
cm.curOp.typing = true;
cm.state.pasteIncoming = cm.state.cutIncoming = false;
}
+ function handlePaste(e, cm) {
+ var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
+ if (pasted) {
+ e.preventDefault();
+ runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
+ return true;
+ }
+ }
+
+ function triggerElectric(cm, inserted) {
+ // When an 'electric' character is inserted, immediately trigger a reindent
+ if (!cm.options.electricChars || !cm.options.smartIndent) return;
+ var sel = cm.doc.sel;
+
+ for (var i = sel.ranges.length - 1; i >= 0; i--) {
+ var range = sel.ranges[i];
+ if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue;
+ var mode = cm.getModeAt(range.head);
+ var indented = false;
+ if (mode.electricChars) {
+ for (var j = 0; j < mode.electricChars.length; j++)
+ if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
+ indented = indentLine(cm, range.head.line, "smart");
+ break;
+ }
+ } else if (mode.electricInput) {
+ if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
+ indented = indentLine(cm, range.head.line, "smart");
+ }
+ if (indented) signalLater(cm, "electricInput", cm, range.head.line);
+ }
+ }
+
function copyableRanges(cm) {
var text = [], ranges = [];
for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
@@ -1206,21 +1221,9 @@
input.poll();
});
- on(te, "paste", function() {
- // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206
- // Add a char to the end of textarea before paste occur so that
- // selection doesn't span to the end of textarea.
- if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {
- var start = te.selectionStart, end = te.selectionEnd;
- te.value += "$";
- // The selection end needs to be set before the start, otherwise there
- // can be an intermediate non-empty selection between the two, which
- // can override the middle-click paste buffer on linux and cause the
- // wrong thing to get pasted.
- te.selectionEnd = end;
- te.selectionStart = start;
- cm.state.fakedLastChar = true;
- }
+ on(te, "paste", function(e) {
+ if (handlePaste(e, cm)) return true;
+
cm.state.pasteIncoming = true;
input.fastPoll();
});
@@ -1386,14 +1389,11 @@
// possible when it is clear that nothing happened. hasSelection
// will be the case when there is a lot of text in the textarea,
// in which case reading its value would be expensive.
- if (!cm.state.focused || (hasSelection(input) && !prevInput) ||
+ if (this.contextMenuPending || !cm.state.focused ||
+ (hasSelection(input) && !prevInput) ||
isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)
return false;
- // See paste handler for more on the fakedLastChar kludge
- if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
- input.value = input.value.substring(0, input.value.length - 1);
- cm.state.fakedLastChar = false;
- }
+
var text = input.value;
// If nothing changed, bail.
if (text == prevInput && !cm.somethingSelected()) return false;
@@ -1539,13 +1539,7 @@
div.contentEditable = "true";
disableBrowserMagic(div);
- on(div, "paste", function(e) {
- var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
- if (pasted) {
- e.preventDefault();
- cm.replaceSelection(pasted, null, "paste");
- }
- });
+ on(div, "paste", function(e) { handlePaste(e, cm); })
on(div, "compositionstart", function(e) {
var data = e.data;
@@ -1758,7 +1752,7 @@
var toIndex = findViewIndex(cm, to.line);
if (toIndex == display.view.length - 1) {
var toLine = display.viewTo - 1;
- var toNode = display.view[toIndex].node;
+ var toNode = display.lineDiv.lastChild;
} else {
var toLine = lineNo(display.view[toIndex + 1].line) - 1;
var toNode = display.view[toIndex + 1].node.previousSibling;
@@ -1838,7 +1832,7 @@
var partPos = getBidiPartAt(order, pos.ch);
side = partPos % 2 ? "right" : "left";
}
- var result = nodeAndOffsetInLineMap(info.map, pos.ch, "left");
+ var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
result.offset = result.collapse == "right" ? result.end : result.start;
return result;
}
@@ -3574,7 +3568,8 @@
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) &&
type == "single" && (contained = sel.contains(start)) > -1 &&
- !sel.ranges[contained].empty())
+ (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
+ (cmp(contained.to(), start) > 0 || start.xRel < 0))
leftButtonStartDrag(cm, e, start, modifier);
else
leftButtonSelect(cm, e, start, type, modifier);
@@ -5065,6 +5060,8 @@
return commands[cmd](this);
},
+ triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
+
findPosH: function(from, amount, unit, visually) {
var dir = 1;
if (amount < 0) { dir = -1; amount = -amount; }
@@ -5732,7 +5729,7 @@
for (var i = 0; i < keys.length; i++) {
var val, name;
if (i == keys.length - 1) {
- name = keyname;
+ name = keys.join(" ");
val = value;
} else {
name = keys.slice(0, i + 1).join(" ");
@@ -7592,7 +7589,7 @@
Doc.prototype.eachLine = Doc.prototype.iter;
// Set up methods on CodeMirror's prototype to redirect to the editor's document.
- var dontDelegate = "iter insert remove copy getEditor".split(" ");
+ var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
CodeMirror.prototype[prop] = (function(method) {
return function() {return method.apply(this.doc, arguments);};
@@ -8745,7 +8742,7 @@
// THE END
- CodeMirror.version = "5.2.0";
+ CodeMirror.version = "5.4.0";
return CodeMirror;
});
diff --git a/public/vendor/codemirror/mode/apl/apl.js b/public/vendor/codemirror/mode/apl/apl.js
index 4357bed4..caafe4e9 100755
--- a/public/vendor/codemirror/mode/apl/apl.js
+++ b/public/vendor/codemirror/mode/apl/apl.js
@@ -102,7 +102,7 @@ CodeMirror.defineMode("apl", function() {
};
},
token: function(stream, state) {
- var ch, funcName, word;
+ var ch, funcName;
if (stream.eatSpace()) {
return null;
}
@@ -163,7 +163,6 @@ CodeMirror.defineMode("apl", function() {
return "function jot-dot";
}
stream.eatWhile(/[\w\$_]/);
- word = stream.current();
state.prev = true;
return "keyword";
}
diff --git a/public/vendor/codemirror/mode/asn.1/asn.1.js b/public/vendor/codemirror/mode/asn.1/asn.1.js
new file mode 100755
index 00000000..9600247e
--- /dev/null
+++ b/public/vendor/codemirror/mode/asn.1/asn.1.js
@@ -0,0 +1,204 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("asn.1", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ cmipVerbs = parserConfig.cmipVerbs || {},
+ compareTypes = parserConfig.compareTypes || {},
+ status = parserConfig.status || {},
+ tags = parserConfig.tags || {},
+ storage = parserConfig.storage || {},
+ modifier = parserConfig.modifier || {},
+ accessTypes = parserConfig.accessTypes|| {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[\|\^]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]\(\){}:=,;]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "-"){
+ if (stream.eat("-")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+
+ stream.eatWhile(/[\w\-]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs";
+ if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes";
+ if (status.propertyIsEnumerable(cur)) return "comment status";
+ if (tags.propertyIsEnumerable(cur)) return "variable-3 tags";
+ if (storage.propertyIsEnumerable(cur)) return "builtin storage";
+ if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier";
+ if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterNext = stream.peek();
+ //look if the character if the quote is like the B in '10100010'B
+ if (afterNext){
+ afterNext = afterNext.toLowerCase();
+ if(afterNext == "b" || afterNext == "h" || afterNext == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+ }
+ function pushContext(state, col, type) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ indent = state.context.indented;
+ return state.context = new Context(indent, col, type, null, state.context);
+ }
+ function popContext(state) {
+ var t = state.context.type;
+ if (t == ")" || t == "]" || t == "}")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ //Interface
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ token: function(stream, state) {
+ var ctx = state.context;
+ if (stream.sol()) {
+ if (ctx.align == null) ctx.align = false;
+ state.indented = stream.indentation();
+ state.startOfLine = true;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
+ && curPunc != ';') || (ctx.type == "statement"
+ && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+
+ state.startOfLine = false;
+ return style;
+ },
+
+ electricChars: "{}",
+ lineComment: "--",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+
+ CodeMirror.defineMIME("text/x-ttcn-asn", {
+ name: "asn.1",
+ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" +
+ " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" +
+ " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" +
+ " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" +
+ " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" +
+ " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" +
+ " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" +
+ " IMPLIED EXPORTS"),
+ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
+ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" +
+ " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" +
+ " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" +
+ " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" +
+ " TEXTUAL-CONVENTION"),
+ status: words("current deprecated mandatory obsolete"),
+ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" +
+ " UNIVERSAL"),
+ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" +
+ " UTCTime InterfaceIndex IANAifType CMIP-Attribute" +
+ " REAL PACKAGE PACKAGES IpAddress PhysAddress" +
+ " NetworkAddress BITS BMPString TimeStamp TimeTicks" +
+ " TruthValue RowStatus DisplayString GeneralString" +
+ " GraphicString IA5String NumericString" +
+ " PrintableString SnmpAdminAtring TeletexString" +
+ " UTF8String VideotexString VisibleString StringStore" +
+ " ISO646String T61String UniversalString Unsigned32" +
+ " Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
+ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" +
+ " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" +
+ " DEFINED"),
+ accessTypes: words("not-accessible accessible-for-notify read-only" +
+ " read-create read-write"),
+ multiLineStrings: true
+ });
+});
diff --git a/public/vendor/codemirror/mode/asn.1/index.html b/public/vendor/codemirror/mode/asn.1/index.html
new file mode 100755
index 00000000..8346f8e5
--- /dev/null
+++ b/public/vendor/codemirror/mode/asn.1/index.html
@@ -0,0 +1,78 @@
+<!doctype html>
+
+<title>CodeMirror: ASN.1 mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="asn.1.js"></script>
+<style type="text/css">
+ .CodeMirror {
+ border-top: 1px solid black;
+ border-bottom: 1px solid black;
+ }
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1>
+ <img id=logo src="../../doc/logo.png">
+ </a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One">ASN.1</a>
+ </ul>
+</div>
+<article>
+ <h2>ASN.1 example</h2>
+ <div>
+ <textarea id="ttcn-asn-code">
+ --
+ -- Sample ASN.1 Code
+ --
+ MyModule DEFINITIONS ::=
+ BEGIN
+
+ MyTypes ::= SEQUENCE {
+ myObjectId OBJECT IDENTIFIER,
+ mySeqOf SEQUENCE OF MyInt,
+ myBitString BIT STRING {
+ muxToken(0),
+ modemToken(1)
+ }
+ }
+
+ MyInt ::= INTEGER (0..65535)
+
+ END
+ </textarea>
+ </div>
+
+ <script>
+ var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-asn-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ttcn-asn"
+ });
+ ttcnEditor.setSize(400, 400);
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
+ </script>
+ <br/>
+ <p><strong>Language:</strong> Abstract Syntax Notation One
+ (<a href="http://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx">ASN.1</a>)
+ </p>
+ <p><strong>MIME types defined:</strong> <code>text/x-ttcn-asn</code></p>
+
+ <br/>
+ <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
+ </a>.</p>
+ <p>Coded by Asmelash Tsegay Gebretsadkan </p>
+ </article>
+</article>
+
diff --git a/public/vendor/codemirror/mode/asterisk/asterisk.js b/public/vendor/codemirror/mode/asterisk/asterisk.js
index a1ead115..b7ebfc5a 100755
--- a/public/vendor/codemirror/mode/asterisk/asterisk.js
+++ b/public/vendor/codemirror/mode/asterisk/asterisk.js
@@ -65,8 +65,7 @@ CodeMirror.defineMode("asterisk", function() {
function basicToken(stream,state){
var cur = '';
- var ch = '';
- ch = stream.next();
+ var ch = stream.next();
// comment
if(ch == ";") {
stream.skipToEnd();
@@ -136,7 +135,6 @@ CodeMirror.defineMode("asterisk", function() {
token: function(stream, state) {
var cur = '';
- var ch = '';
if(stream.eatSpace()) return null;
// extension started
if(state.extenStart){
@@ -170,7 +168,7 @@ CodeMirror.defineMode("asterisk", function() {
} else if(state.extenPriority) {
state.extenPriority = false;
state.extenApplication = true;
- ch = stream.next(); // get comma
+ stream.next(); // get comma
if(state.extenSame) return null;
stream.eatWhile(/[^,]/);
return "number";
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js
index b209910b..f1a7e7a9 100755
--- a/public/vendor/codemirror/mode/clike/clike.js
+++ b/public/vendor/codemirror/mode/clike/clike.js
@@ -16,15 +16,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
dontAlignCalls = parserConfig.dontAlignCalls,
keywords = parserConfig.keywords || {},
+ types = parserConfig.types || {},
builtin = parserConfig.builtin || {},
blockKeywords = parserConfig.blockKeywords || {},
+ defKeywords = parserConfig.defKeywords || {},
atoms = parserConfig.atoms || {},
hooks = parserConfig.hooks || {},
multiLineStrings = parserConfig.multiLineStrings,
- indentStatements = parserConfig.indentStatements !== false;
+ indentStatements = parserConfig.indentStatements !== false,
+ indentSwitch = parserConfig.indentSwitch !== false,
+ namespaceSeparator = parserConfig.namespaceSeparator;
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
- var curPunc;
+ var curPunc, isDefKeyword;
function tokenBase(stream, state) {
var ch = stream.next();
@@ -59,11 +63,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "operator";
}
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+ if (namespaceSeparator) while (stream.match(namespaceSeparator))
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+
var cur = stream.current();
if (keywords.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true;
return "keyword";
}
+ if (types.propertyIsEnumerable(cur)) return "variable-3";
if (builtin.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
return "builtin";
@@ -104,9 +113,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
this.align = align;
this.prev = prev;
}
+ function isStatement(type) {
+ return type == "statement" || type == "switchstatement" || type == "namespace";
+ }
function pushContext(state, col, type) {
var indent = state.indented;
- if (state.context && state.context.type == "statement")
+ if (state.context && isStatement(state.context.type) && !isStatement(type))
indent = state.context.indented;
return state.context = new Context(indent, col, type, null, state.context);
}
@@ -117,6 +129,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return state.context = state.context.prev;
}
+ function typeBefore(stream, state) {
+ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
+ if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
+ }
+
+ function isTopScope(context) {
+ for (;;) {
+ if (!context || context.type == "top") return true;
+ if (context.type == "}" && context.prev.type != "namespace") return false;
+ context = context.prev;
+ }
+ }
+
// Interface
return {
@@ -125,7 +150,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
tokenize: null,
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
indented: 0,
- startOfLine: true
+ startOfLine: true,
+ prevToken: null
};
},
@@ -137,41 +163,69 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
state.startOfLine = true;
}
if (stream.eatSpace()) return null;
- curPunc = null;
+ curPunc = isDefKeyword = null;
var style = (state.tokenize || tokenBase)(stream, state);
if (style == "comment" || style == "meta") return style;
if (ctx.align == null) ctx.align = true;
- if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ","))
+ while (isStatement(state.context.type)) popContext(state);
else if (curPunc == "{") pushContext(state, stream.column(), "}");
else if (curPunc == "[") pushContext(state, stream.column(), "]");
else if (curPunc == "(") pushContext(state, stream.column(), ")");
else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
+ while (isStatement(ctx.type)) ctx = popContext(state);
if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
+ while (isStatement(ctx.type)) ctx = popContext(state);
}
else if (curPunc == ctx.type) popContext(state);
else if (indentStatements &&
- (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
- (ctx.type == "statement" && curPunc == "newstatement")))
- pushContext(state, stream.column(), "statement");
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
+ (isStatement(ctx.type) && curPunc == "newstatement"))) {
+ var type = "statement";
+ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
+ type = "switchstatement";
+ else if (style == "keyword" && stream.current() == "namespace")
+ type = "namespace";
+ pushContext(state, stream.column(), type);
+ }
+
+ if (style == "variable" &&
+ ((state.prevToken == "def" ||
+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
+ isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
+ style = "def";
+
+ if (hooks.token) {
+ var result = hooks.token(stream, state, style);
+ if (result !== undefined) style = result;
+ }
+
+ if (style == "def" && parserConfig.styleDefs === false) style = "variable";
+
state.startOfLine = false;
+ state.prevToken = isDefKeyword ? "def" : style || curPunc;
return style;
},
indent: function(state, textAfter) {
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
+ if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
var closing = firstChar == ctx.type;
- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
- else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
- else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
- else return ctx.indented + (closing ? 0 : indentUnit);
+ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
+ if (isStatement(ctx.type))
+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
+ if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
+ return ctx.column + (closing ? 0 : 1);
+ if (ctx.type == ")" && !closing)
+ return ctx.indented + statementIndentUnit;
+
+ return ctx.indented + (closing ? 0 : indentUnit) +
+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
},
- electricChars: "{}",
+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
blockCommentStart: "/*",
blockCommentEnd: "*/",
lineComment: "//",
@@ -184,9 +238,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
- var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
- "double static else struct switch extern typedef float union for unsigned " +
- "goto while enum void const signed volatile";
+ var cKeywords = "auto if break case register continue return default do sizeof " +
+ "static else struct switch extern typedef float union for " +
+ "goto while enum const volatile";
+ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
function cppHook(stream, state) {
if (!state.startOfLine) return false;
@@ -206,6 +261,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "meta";
}
+ function pointerHook(_stream, state) {
+ if (state.prevToken == "variable-3") return "variable-3";
+ return false;
+ }
+
function cpp11StringHook(stream, state) {
stream.backUp(1);
// Raw strings.
@@ -230,6 +290,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return false;
}
+ function cppLooksLikeConstructor(word) {
+ var lastTwo = /(\w+)::(\w+)$/.exec(word);
+ return lastTwo && lastTwo[1] == lastTwo[2];
+ }
+
// C#-style strings where "" escapes a quote.
function tokenAtString(stream, state) {
var next;
@@ -263,6 +328,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
words.push(prop);
}
add(mode.keywords);
+ add(mode.types);
add(mode.builtin);
add(mode.atoms);
if (words.length) {
@@ -277,39 +343,60 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
name: "clike",
keywords: words(cKeywords),
+ types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
+ "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
+ "uint32_t uint64_t"),
blockKeywords: words("case do else for if switch while struct"),
- atoms: words("null"),
- hooks: {"#": cppHook},
+ defKeywords: words("struct"),
+ typeFirstDefinitions: true,
+ atoms: words("null true false"),
+ hooks: {"#": cppHook, "*": pointerHook},
modeProps: {fold: ["brace", "include"]}
});
def(["text/x-c++src", "text/x-c++hdr"], {
name: "clike",
- keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
+ keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
"static_cast typeid catch operator template typename class friend private " +
"this using const_cast inline public throw virtual delete mutable protected " +
- "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " +
+ "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
"static_assert override"),
+ types: words(cTypes + " bool wchar_t"),
blockKeywords: words("catch class do else finally for if struct switch try while"),
+ defKeywords: words("class namespace struct enum union"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"#": cppHook,
+ "*": pointerHook,
"u": cpp11StringHook,
"U": cpp11StringHook,
"L": cpp11StringHook,
- "R": cpp11StringHook
+ "R": cpp11StringHook,
+ token: function(stream, state, style) {
+ if (style == "variable" && stream.peek() == "(" &&
+ (state.prevToken == ";" || state.prevToken == null ||
+ state.prevToken == "}") &&
+ cppLooksLikeConstructor(stream.current()))
+ return "def";
+ }
},
+ namespaceSeparator: "::",
modeProps: {fold: ["brace", "include"]}
});
def("text/x-java", {
name: "clike",
- keywords: words("abstract assert boolean break byte case catch char class const continue default " +
- "do double else enum extends final finally float for goto if implements import " +
- "instanceof int interface long native new package private protected public " +
- "return short static strictfp super switch synchronized this throw throws transient " +
- "try void volatile while"),
+ keywords: words("abstract assert break case catch class const continue default " +
+ "do else enum extends final finally float for goto if implements import " +
+ "instanceof interface native new package private protected public " +
+ "return static strictfp super switch synchronized this throw throws transient " +
+ "try volatile while"),
+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
blockKeywords: words("catch class do else finally for if switch try while"),
+ defKeywords: words("class interface package enum"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"@": function(stream) {
@@ -322,18 +409,20 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def("text/x-csharp", {
name: "clike",
- keywords: words("abstract as base break case catch checked class const continue" +
+ keywords: words("abstract as async await base break case catch checked class const continue" +
" default delegate do else enum event explicit extern finally fixed for" +
" foreach goto if implicit in interface internal is lock namespace new" +
" operator out override params private protected public readonly ref return sealed" +
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
" global group into join let orderby partial remove select set value var yield"),
+ types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
+ " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
+ " UInt64 bool byte char decimal double short int long object" +
+ " sbyte float string ushort uint ulong"),
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
- builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +
- " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +
- " UInt64 bool byte char decimal double short int long object" +
- " sbyte float string ushort uint ulong"),
+ defKeywords: words("class interface namespace struct var"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"@": function(stream, state) {
@@ -366,18 +455,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
/* scala */
"abstract case catch class def do else extends false final finally for forSome if " +
"implicit import lazy match new null object override package private protected return " +
- "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +
+ "sealed super this throw trait try type val var while with yield _ : = => <- <: " +
"<% >: # @ " +
/* package scala */
"assert assume require print println printf readLine readBoolean readByte readShort " +
"readChar readInt readLong readFloat readDouble " +
+ ":: #:: "
+ ),
+ types: words(
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
- "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " +
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
/* package java.lang */
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
@@ -387,8 +479,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
),
multiLineStrings: true,
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
+ defKeywords: words("class def object package trait type val var"),
atoms: words("true false null"),
indentStatements: false,
+ indentSwitch: false,
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$_]/);
@@ -409,15 +503,15 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
name: "clike",
- keywords: words("float int bool void " +
- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
- "mat2 mat3 mat4 " +
- "sampler1D sampler2D sampler3D samplerCube " +
+ keywords: words("sampler1D sampler2D sampler3D samplerCube " +
"sampler1DShadow sampler2DShadow " +
"const attribute uniform varying " +
"break continue discard return " +
"for while do if else struct " +
"in out inout"),
+ types: words("float int bool void " +
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
+ "mat2 mat3 mat4"),
blockKeywords: words("for while do if else struct"),
builtin: words("radians degrees sin cos tan asin acos atan " +
"pow exp log exp2 sqrt inversesqrt " +
@@ -461,6 +555,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
"gl_MaxDrawBuffers"),
+ indentSwitch: false,
hooks: {"#": cppHook},
modeProps: {fold: ["brace", "include"]}
});
@@ -470,8 +565,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
"implementation includes interface module new norace nx_struct nx_union post provides " +
"signal task uses abstract extends"),
+ types: words(cTypes),
blockKeywords: words("case do else for if switch while struct"),
- atoms: words("null"),
+ atoms: words("null true false"),
hooks: {"#": cppHook},
modeProps: {fold: ["brace", "include"]}
});
@@ -480,7 +576,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
name: "clike",
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
- atoms: words("YES NO NULL NILL ON OFF"),
+ types: words(cTypes),
+ atoms: words("YES NO NULL NILL ON OFF true false"),
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$]/);
diff --git a/public/vendor/codemirror/mode/clike/test.js b/public/vendor/codemirror/mode/clike/test.js
new file mode 100755
index 00000000..79b006de
--- /dev/null
+++ b/public/vendor/codemirror/mode/clike/test.js
@@ -0,0 +1,33 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT("indent",
+ "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
+ " [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
+ " [number 1];",
+ " [keyword return] [operator *][variable a];",
+ "}");
+
+ MT("indent_switch",
+ "[keyword switch] ([variable x]) {",
+ " [keyword case] [number 10]:",
+ " [keyword return] [number 20];",
+ " [keyword default]:",
+ " [variable printf]([string \"foo %c\"], [variable x]);",
+ "}");
+
+ MT("def",
+ "[variable-3 void] [def foo]() {}",
+ "[keyword struct] [def bar]{}",
+ "[variable-3 int] [variable-3 *][def baz]() {}");
+
+ MT("double_block",
+ "[keyword for] (;;)",
+ " [keyword for] (;;)",
+ " [variable x][operator ++];",
+ "[keyword return];");
+})();
diff --git a/public/vendor/codemirror/mode/css/css.js b/public/vendor/codemirror/mode/css/css.js
index 7fc9098f..1e6d2ddb 100755
--- a/public/vendor/codemirror/mode/css/css.js
+++ b/public/vendor/codemirror/mode/css/css.js
@@ -329,7 +329,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (type == "}") return popContext(state);
if (type == "{" || type == ";") return popAndPass(type, stream, state);
if (type == "word") override = "variable";
- else if (type != "variable") override = "error";
+ else if (type != "variable" && type != "(" && type != ")") override = "error";
return "interpolation";
};
@@ -653,16 +653,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ["comment", "comment"];
}
- function tokenSGMLComment(stream, state) {
- if (stream.skipTo("-->")) {
- stream.match("-->");
- state.tokenize = null;
- } else {
- stream.skipToEnd();
- }
- return ["comment", "comment"];
- }
-
CodeMirror.defineMIME("text/css", {
documentTypes: documentTypes,
mediaTypes: mediaTypes,
@@ -674,11 +664,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
tokenHooks: {
- "<": function(stream, state) {
- if (!stream.match("!--")) return false;
- state.tokenize = tokenSGMLComment;
- return tokenSGMLComment(stream, state);
- },
"/": function(stream, state) {
if (!stream.eat("*")) return false;
state.tokenize = tokenCComment;
diff --git a/public/vendor/codemirror/mode/css/test.js b/public/vendor/codemirror/mode/css/test.js
index bef71561..55ae676e 100755
--- a/public/vendor/codemirror/mode/css/test.js
+++ b/public/vendor/codemirror/mode/css/test.js
@@ -76,13 +76,6 @@
MT("tagTwoPropertiesURL",
"[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
- MT("commentSGML",
- "[comment <!--comment-->]");
-
- MT("commentSGML2",
- "[comment <!--comment]",
- "[comment -->] [tag div] {}");
-
MT("indent_tagSelector",
"[tag strong], [tag em] {",
" [property background]: [atom rgba](",
diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js
index 9decf307..e218d473 100755
--- a/public/vendor/codemirror/mode/cypher/cypher.js
+++ b/public/vendor/codemirror/mode/cypher/cypher.js
@@ -19,7 +19,7 @@
CodeMirror.defineMode("cypher", function(config) {
var tokenBase = function(stream/*, state*/) {
- var ch = stream.next(), curPunc = null;
+ var ch = stream.next();
if (ch === "\"" || ch === "'") {
stream.match(/.+?["']/);
return "string";
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
index be2986ad..85f0166c 100755
--- a/public/vendor/codemirror/mode/dylan/dylan.js
+++ b/public/vendor/codemirror/mode/dylan/dylan.js
@@ -154,20 +154,12 @@ CodeMirror.defineMode("dylan", function(_config) {
return f(stream, state);
}
- var type, content;
-
- function ret(_type, style, _content) {
- type = _type;
- content = _content;
- return style;
- }
-
function tokenBase(stream, state) {
// String
var ch = stream.peek();
if (ch == "'" || ch == '"') {
stream.next();
- return chain(stream, state, tokenString(ch, "string", "string"));
+ return chain(stream, state, tokenString(ch, "string"));
}
// Comment
else if (ch == "/") {
@@ -176,16 +168,16 @@ CodeMirror.defineMode("dylan", function(_config) {
return chain(stream, state, tokenComment);
} else if (stream.eat("/")) {
stream.skipToEnd();
- return ret("comment", "comment");
+ return "comment";
} else {
stream.skipTo(" ");
- return ret("operator", "operator");
+ return "operator";
}
}
// Decimal
else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
- return ret("number", "number");
+ return "number";
}
// Hash
else if (ch == "#") {
@@ -194,33 +186,33 @@ CodeMirror.defineMode("dylan", function(_config) {
ch = stream.peek();
if (ch == '"') {
stream.next();
- return chain(stream, state, tokenString('"', "symbol", "string-2"));
+ return chain(stream, state, tokenString('"', "string-2"));
}
// Binary number
else if (ch == "b") {
stream.next();
stream.eatWhile(/[01]/);
- return ret("number", "number");
+ return "number";
}
// Hex number
else if (ch == "x") {
stream.next();
stream.eatWhile(/[\da-f]/i);
- return ret("number", "number");
+ return "number";
}
// Octal number
else if (ch == "o") {
stream.next();
stream.eatWhile(/[0-7]/);
- return ret("number", "number");
+ return "number";
}
// Hash symbol
else {
stream.eatWhile(/[-a-zA-Z]/);
- return ret("hash", "keyword");
+ return "keyword";
}
} else if (stream.match("end")) {
- return ret("end", "keyword");
+ return "keyword";
}
for (var name in patterns) {
if (patterns.hasOwnProperty(name)) {
@@ -228,21 +220,21 @@ CodeMirror.defineMode("dylan", function(_config) {
if ((pattern instanceof Array && pattern.some(function(p) {
return stream.match(p);
})) || stream.match(pattern))
- return ret(name, patternStyles[name], stream.current());
+ return patternStyles[name];
}
}
if (stream.match("define")) {
- return ret("definition", "def");
+ return "def";
} else {
stream.eatWhile(/[\w\-]/);
// Keyword
if (wordLookup[stream.current()]) {
- return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current());
+ return styleLookup[stream.current()];
} else if (stream.current().match(symbol)) {
- return ret("variable", "variable");
+ return "variable";
} else {
stream.next();
- return ret("other", "variable-2");
+ return "variable-2";
}
}
}
@@ -257,10 +249,10 @@ CodeMirror.defineMode("dylan", function(_config) {
}
maybeEnd = (ch == "*");
}
- return ret("comment", "comment");
+ return "comment";
}
- function tokenString(quote, type, style) {
+ function tokenString(quote, style) {
return function(stream, state) {
var next, end = false;
while ((next = stream.next()) != null) {
@@ -271,7 +263,7 @@ CodeMirror.defineMode("dylan", function(_config) {
}
if (end)
state.tokenize = tokenBase;
- return ret(type, style);
+ return style;
};
}
diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js
index 18778f16..8df7ebe4 100755
--- a/public/vendor/codemirror/mode/ecl/ecl.js
+++ b/public/vendor/codemirror/mode/ecl/ecl.js
@@ -34,7 +34,6 @@ CodeMirror.defineMode("ecl", function(config) {
var blockKeywords = words("catch class do else finally for if switch try while");
var atoms = words("true false null");
var hooks = {"#": metaHook};
- var multiLineStrings;
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
var curPunc;
@@ -112,7 +111,7 @@ CodeMirror.defineMode("ecl", function(config) {
if (next == quote && !escaped) {end = true; break;}
escaped = !escaped && next == "\\";
}
- if (end || !(escaped || multiLineStrings))
+ if (end || !escaped)
state.tokenize = tokenBase;
return "string";
};
diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js
index fcdf295c..b8b70e36 100755
--- a/public/vendor/codemirror/mode/eiffel/eiffel.js
+++ b/public/vendor/codemirror/mode/eiffel/eiffel.js
@@ -84,7 +84,6 @@ CodeMirror.defineMode("eiffel", function() {
'or'
]);
var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
- var curPunc;
function chain(newtok, stream, state) {
state.tokenize.push(newtok);
@@ -92,7 +91,6 @@ CodeMirror.defineMode("eiffel", function() {
}
function tokenBase(stream, state) {
- curPunc = null;
if (stream.eatSpace()) return null;
var ch = stream.next();
if (ch == '"'||ch == "'") {
diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js
new file mode 100755
index 00000000..7124c50a
--- /dev/null
+++ b/public/vendor/codemirror/mode/elm/elm.js
@@ -0,0 +1,205 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("elm", function() {
+
+ function switchState(source, setState, f) {
+ setState(f);
+ return f(source, setState);
+ }
+
+ // These should all be Unicode extended, as per the Haskell 2010 report
+ var smallRE = /[a-z_]/;
+ var largeRE = /[A-Z]/;
+ var digitRE = /[0-9]/;
+ var hexitRE = /[0-9A-Fa-f]/;
+ var octitRE = /[0-7]/;
+ var idRE = /[a-z_A-Z0-9\']/;
+ var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/;
+ var specialRE = /[(),;[\]`{}]/;
+ var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
+
+ function normal() {
+ return function (source, setState) {
+ if (source.eatWhile(whiteCharRE)) {
+ return null;
+ }
+
+ var ch = source.next();
+ if (specialRE.test(ch)) {
+ if (ch == '{' && source.eat('-')) {
+ var t = "comment";
+ if (source.eat('#')) t = "meta";
+ return switchState(source, setState, ncomment(t, 1));
+ }
+ return null;
+ }
+
+ if (ch == '\'') {
+ if (source.eat('\\'))
+ source.next(); // should handle other escapes here
+ else
+ source.next();
+
+ if (source.eat('\''))
+ return "string";
+ return "error";
+ }
+
+ if (ch == '"') {
+ return switchState(source, setState, stringLiteral);
+ }
+
+ if (largeRE.test(ch)) {
+ source.eatWhile(idRE);
+ if (source.eat('.'))
+ return "qualifier";
+ return "variable-2";
+ }
+
+ if (smallRE.test(ch)) {
+ var isDef = source.pos === 1;
+ source.eatWhile(idRE);
+ return isDef ? "variable-3" : "variable";
+ }
+
+ if (digitRE.test(ch)) {
+ if (ch == '0') {
+ if (source.eat(/[xX]/)) {
+ source.eatWhile(hexitRE); // should require at least 1
+ return "integer";
+ }
+ if (source.eat(/[oO]/)) {
+ source.eatWhile(octitRE); // should require at least 1
+ return "number";
+ }
+ }
+ source.eatWhile(digitRE);
+ var t = "number";
+ if (source.eat('.')) {
+ t = "number";
+ source.eatWhile(digitRE); // should require at least 1
+ }
+ if (source.eat(/[eE]/)) {
+ t = "number";
+ source.eat(/[-+]/);
+ source.eatWhile(digitRE); // should require at least 1
+ }
+ return t;
+ }
+
+ if (symbolRE.test(ch)) {
+ if (ch == '-' && source.eat(/-/)) {
+ source.eatWhile(/-/);
+ if (!source.eat(symbolRE)) {
+ source.skipToEnd();
+ return "comment";
+ }
+ }
+ source.eatWhile(symbolRE);
+ return "builtin";
+ }
+
+ return "error";
+ }
+ }
+
+ function ncomment(type, nest) {
+ if (nest == 0) {
+ return normal();
+ }
+ return function(source, setState) {
+ var currNest = nest;
+ while (!source.eol()) {
+ var ch = source.next();
+ if (ch == '{' && source.eat('-')) {
+ ++currNest;
+ } else if (ch == '-' && source.eat('}')) {
+ --currNest;
+ if (currNest == 0) {
+ setState(normal());
+ return type;
+ }
+ }
+ }
+ setState(ncomment(type, currNest));
+ return type;
+ }
+ }
+
+ function stringLiteral(source, setState) {
+ while (!source.eol()) {
+ var ch = source.next();
+ if (ch == '"') {
+ setState(normal());
+ return "string";
+ }
+ if (ch == '\\') {
+ if (source.eol() || source.eat(whiteCharRE)) {
+ setState(stringGap);
+ return "string";
+ }
+ if (!source.eat('&')) source.next(); // should handle other escapes here
+ }
+ }
+ setState(normal());
+ return "error";
+ }
+
+ function stringGap(source, setState) {
+ if (source.eat('\\')) {
+ return switchState(source, setState, stringLiteral);
+ }
+ source.next();
+ setState(normal());
+ return "error";
+ }
+
+
+ var wellKnownWords = (function() {
+ var wkw = {};
+
+ var keywords = [
+ "case", "of", "as",
+ "if", "then", "else",
+ "let", "in",
+ "infix", "infixl", "infixr",
+ "type", "alias",
+ "input", "output", "foreign", "loopback",
+ "module", "where", "import", "exposing",
+ "_", "..", "|", ":", "=", "\\", "\"", "->", "<-"
+ ];
+
+ for (var i = keywords.length; i--;)
+ wkw[keywords[i]] = "keyword";
+
+ return wkw;
+ })();
+
+
+
+ return {
+ startState: function () { return { f: normal() }; },
+ copyState: function (s) { return { f: s.f }; },
+
+ token: function(stream, state) {
+ var t = state.f(stream, function(s) { state.f = s; });
+ var w = stream.current();
+ return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t;
+ }
+ };
+
+ });
+
+ CodeMirror.defineMIME("text/x-elm", "elm");
+})();
diff --git a/public/vendor/codemirror/mode/elm/index.html b/public/vendor/codemirror/mode/elm/index.html
new file mode 100755
index 00000000..d5cb16ab
--- /dev/null
+++ b/public/vendor/codemirror/mode/elm/index.html
@@ -0,0 +1,61 @@
+<!doctype html>
+
+<title>CodeMirror: Elm mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="elm.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Elm</a>
+ </ul>
+</div>
+
+<article>
+<h2>Elm mode</h2>
+
+<div><textarea id="code" name="code">
+import Color exposing (..)
+import Graphics.Collage exposing (..)
+import Graphics.Element exposing (..)
+import Time exposing (..)
+
+main =
+ Signal.map clock (every second)
+
+clock t =
+ collage 400 400
+ [ filled lightGrey (ngon 12 110)
+ , outlined (solid grey) (ngon 12 110)
+ , hand orange 100 t
+ , hand charcoal 100 (t/60)
+ , hand charcoal 60 (t/720)
+ ]
+
+hand clr len time =
+ let angle = degrees (90 - 6 * inSeconds time)
+ in
+ segment (0,0) (fromPolar (len,angle))
+ |> traced (solid clr)
+</textarea></div>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ mode: "text/x-elm"
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-elm</code>.</p>
+ </article>
diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js
new file mode 100755
index 00000000..86d7adf6
--- /dev/null
+++ b/public/vendor/codemirror/mode/factor/factor.js
@@ -0,0 +1,83 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Factor syntax highlight - simple mode
+//
+// by Dimage Sapelkin (https://github.com/kerabromsmu)
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineSimpleMode("factor", {
+ // The start state contains the rules that are intially used
+ start: [
+ // comments
+ {regex: /#?!.*/, token: "comment"},
+ // strings """, multiline --> state
+ {regex: /"""/, token: "string", next: "string3"},
+ {regex: /"/, token: "string", next: "string"},
+ // numbers: dec, hex, unicode, bin, fractional, complex
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
+ //{regex: /[+-]?/} //fractional
+ // definition: defining word, defined word, etc
+ {regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
+ // vocabulary using --> state
+ {regex: /USING\:/, token: "keyword", next: "vocabulary"},
+ // vocabulary definition/use
+ {regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
+ // <constructors>
+ {regex: /<\S+>/, token: "builtin"},
+ // "keywords", incl. ; t f . [ ] { } defining words
+ {regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
+ // any id (?)
+ {regex: /\S+/, token: "variable"},
+
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ vocabulary: [
+ {regex: /;/, token: "keyword", next: "start"},
+ {regex: /\S+/, token: "variable-2"},
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ string: [
+ {regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
+ {regex: /.*/, token: "string"}
+ ],
+ string3: [
+ {regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
+ {regex: /.*/, token: "string"}
+ ],
+ stack: [
+ {regex: /\)/, token: "meta", next: "start"},
+ {regex: /--/, token: "meta"},
+ {regex: /\S+/, token: "variable-3"},
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ // The meta property contains global information about the mode. It
+ // can contain properties like lineComment, which are supported by
+ // all modes, and also directives like dontIndentStates, which are
+ // specific to simple modes.
+ meta: {
+ dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
+ lineComment: [ "!", "#!" ]
+ }
+ });
+
+ CodeMirror.defineMIME("text/x-factor", "factor");
+});
diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html
new file mode 100755
index 00000000..9f154891
--- /dev/null
+++ b/public/vendor/codemirror/mode/factor/index.html
@@ -0,0 +1,77 @@
+<!doctype html>
+
+<title>CodeMirror: Factor mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/simple.js"></script>
+<script src="factor.js"></script>
+<style>
+.CodeMirror {
+ font-family: 'Droid Sans Mono', monospace;
+ font-size: 14px;
+}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Factor</a>
+ </ul>
+</div>
+
+<article>
+
+<h2>Factor mode</h2>
+
+<form><textarea id="code" name="code">
+! Copyright (C) 2008 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+
+! A simple time server
+
+USING: accessors calendar calendar.format io io.encodings.ascii
+io.servers kernel threads ;
+IN: time-server
+
+: handle-time-client ( -- )
+ now timestamp>rfc822 print ;
+
+: <time-server> ( -- threaded-server )
+ ascii <threaded-server>
+ "time-server" >>name
+ 1234 >>insecure
+ [ handle-time-client ] >>handler ;
+
+: start-time-server ( -- )
+ <time-server> start-server drop ;
+
+MAIN: start-time-server
+</textarea>
+ </form>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ lineWrapping: true,
+ indentUnit: 2,
+ tabSize: 2,
+ autofocus: true,
+ mode: "text/x-factor"
+ });
+</script>
+<p/>
+<p>Simple mode that handles Factor Syntax (<a href="http://en.wikipedia.org/wiki/Factor_(programming_language)">Factor on WikiPedia</a>).</p>
+
+<p><strong>MIME types defined:</strong> <code>text/x-factor</code>.</p>
+
+</article>
diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js
index e3a1db86..721933b0 100755
--- a/public/vendor/codemirror/mode/groovy/groovy.js
+++ b/public/vendor/codemirror/mode/groovy/groovy.js
@@ -24,6 +24,7 @@ CodeMirror.defineMode("groovy", function(config) {
"short static strictfp super switch synchronized threadsafe throw throws transient " +
"try void volatile while");
var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
+ var standaloneKeywords = words("return break continue");
var atoms = words("null true false this");
var curPunc;
@@ -50,7 +51,7 @@ CodeMirror.defineMode("groovy", function(config) {
stream.skipToEnd();
return "comment";
}
- if (expectExpression(state.lastToken)) {
+ if (expectExpression(state.lastToken, false)) {
return startString(ch, stream, state);
}
}
@@ -70,6 +71,7 @@ CodeMirror.defineMode("groovy", function(config) {
if (atoms.propertyIsEnumerable(cur)) { return "atom"; }
if (keywords.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone";
return "keyword";
}
return "variable";
@@ -132,9 +134,10 @@ CodeMirror.defineMode("groovy", function(config) {
return "comment";
}
- function expectExpression(last) {
+ function expectExpression(last, newline) {
return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
- last == "newstatement" || last == "keyword" || last == "proplabel";
+ last == "newstatement" || last == "keyword" || last == "proplabel" ||
+ (last == "standalone" && !newline);
}
function Context(indented, column, type, align, prev) {
@@ -174,7 +177,7 @@ CodeMirror.defineMode("groovy", function(config) {
state.indented = stream.indentation();
state.startOfLine = true;
// Automatic semicolon insertion
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) {
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) {
popContext(state); ctx = state.context;
}
}
@@ -209,7 +212,7 @@ CodeMirror.defineMode("groovy", function(config) {
indent: function(state, textAfter) {
if (!state.tokenize[state.tokenize.length-1].isBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev;
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev;
var closing = firstChar == ctx.type;
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
index 1cc438f0..24552e2d 100755
--- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
+++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
@@ -57,9 +57,9 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
}
function maybeBackup(stream, pat, style) {
var cur = stream.current();
- var close = cur.search(pat), m;
+ var close = cur.search(pat);
if (close > -1) stream.backUp(cur.length - close);
- else if (m = cur.match(/<\/?$/)) {
+ else if (cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur);
}
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
index 245595de..8c6d0a43 100755
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -31,6 +31,7 @@ option.</p>
<div style="-webkit-columns: 100px 2; -moz-columns: 100px 2; columns: 100px 2;">
<ul style="margin-top: 0">
<li><a href="apl/index.html">APL</a></li>
+ <li><a href="asn.1/index.html">ASN.1</a></li>
<li><a href="asterisk/index.html">Asterisk dialplan</a></li>
<li><a href="clike/index.html">C, C++, C#</a></li>
<li><a href="clojure/index.html">Clojure</a></li>
@@ -51,7 +52,9 @@ option.</p>
<li><a href="ebnf/index.html">EBNF</a></li>
<li><a href="ecl/index.html">ECL</a></li>
<li><a href="eiffel/index.html">Eiffel</a></li>
+ <li><a href="elm/index.html">Elm</a></li>
<li><a href="erlang/index.html">Erlang</a></li>
+ <li><a href="factor/index.html">Factor</a></li>
<li><a href="forth/index.html">Forth</a></li>
<li><a href="fortran/index.html">Fortran</a></li>
<li><a href="mllike/index.html">F#</a></li>
@@ -63,6 +66,7 @@ option.</p>
<li><a href="handlebars/index.html">Handlebars</a></li>
<li><a href="haskell/index.html">Haskell</a></li>
<li><a href="haxe/index.html">Haxe</a></li>
+ <li><a href="htmlembedded/index.html">HTML embedded</a> (JSP, ASP.NET)</li>
<li><a href="htmlmixed/index.html">HTML mixed-mode</a></li>
<li><a href="http/index.html">HTTP</a></li>
<li><a href="idl/index.html">IDL</a></li>
@@ -76,6 +80,7 @@ option.</p>
<li><a href="livescript/index.html">LiveScript</a></li>
<li><a href="lua/index.html">Lua</a></li>
<li><a href="markdown/index.html">Markdown</a> (<a href="gfm/index.html">GitHub-flavour</a>)</li>
+ <li><a href="mathematica/index.html">Mathematica</a></li>
<li><a href="mirc/index.html">mIRC</a></li>
<li><a href="modelica/index.html">Modelica</a></li>
<li><a href="mumps/index.html">MUMPS</a></li>
@@ -114,6 +119,7 @@ option.</p>
<li><a href="stylus/index.html">Stylus</a></li>
<li><a href="sql/index.html">SQL</a> (several dialects)</li>
<li><a href="sparql/index.html">SPARQL</a></li>
+ <li><a href="swift/index.html">Swift</a></li>
<li><a href="stex/index.html">sTeX, LaTeX</a></li>
<li><a href="tcl/index.html">Tcl</a></li>
<li><a href="textile/index.html">Textile</a></li>
@@ -122,7 +128,10 @@ option.</p>
<li><a href="toml/index.html">TOML</a></li>
<li><a href="tornado/index.html">Tornado</a> (templating language)</li>
<li><a href="troff/index.html">troff</a> (for manpages)</li>
+ <li><a href="ttcn/index.html">TTCN</a></li>
+ <li><a href="ttcn-cfg/index.html">TTCN Configuration</a></li>
<li><a href="turtle/index.html">Turtle</a></li>
+ <li><a href="twig/index.html">Twig</a></li>
<li><a href="vb/index.html">VB.NET</a></li>
<li><a href="vbscript/index.html">VBScript</a></li>
<li><a href="velocity/index.html">Velocity</a></li>
diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js
index ef018478..c86f49e1 100755
--- a/public/vendor/codemirror/mode/javascript/javascript.js
+++ b/public/vendor/codemirror/mode/javascript/javascript.js
@@ -482,8 +482,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function maybetype(type) {
if (isTS && type == ":") return cont(typedef);
}
+ function maybedefault(_, value) {
+ if (value == "=") return cont(expressionNoComma);
+ }
function typedef(type) {
- if (type == "variable"){cx.marked = "variable-3"; return cont();}
+ if (type == "variable") {cx.marked = "variable-3"; return cont();}
}
function vardef() {
return pass(pattern, maybetype, maybeAssign, vardefCont);
@@ -538,7 +541,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function funarg(type) {
if (type == "spread") return cont(funarg);
- return pass(pattern, maybetype);
+ return pass(pattern, maybetype, maybedefault);
}
function className(type, value) {
if (type == "variable") {register(value); return cont(classNameAfter);}
diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js
index 91b0e89a..092d25dc 100755
--- a/public/vendor/codemirror/mode/javascript/test.js
+++ b/public/vendor/codemirror/mode/javascript/test.js
@@ -160,6 +160,11 @@
"]];",
"[number 10];");
+ MT("param_default",
+ "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
+ " [keyword return] [variable-2 x];",
+ "}");
+
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
index e854988a..d0a74cef 100755
--- a/public/vendor/codemirror/mode/julia/julia.js
+++ b/public/vendor/codemirror/mode/julia/julia.js
@@ -34,7 +34,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
var closers = wordRegexp(blockClosers);
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
- var indentInfo = null;
function in_array(state) {
var ch = cur_scope(state);
@@ -247,7 +246,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
}
function tokenLexer(stream, state) {
- indentInfo = null;
var style = state.tokenize(stream, state);
var current = stream.current();
diff --git a/public/vendor/codemirror/mode/kotlin/kotlin.js b/public/vendor/codemirror/mode/kotlin/kotlin.js
index 1efec85d..e9a6a94e 100755
--- a/public/vendor/codemirror/mode/kotlin/kotlin.js
+++ b/public/vendor/codemirror/mode/kotlin/kotlin.js
@@ -21,7 +21,7 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) {
var multiLineStrings = parserConfig.multiLineStrings;
var keywords = words(
- "package continue return object while break class data trait throw super" +
+ "package continue return object while break class data trait interface throw super" +
" when type this else This try val var fun for is in if do as true false null get set");
var softKeywords = words("import" +
" where by get set abstract enum open annotation override private public internal" +
@@ -272,7 +272,10 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) {
},
closeBrackets: {triples: "'\""},
- electricChars: "{}"
+ electricChars: "{}",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//"
};
});
diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js
index 55882efc..4b26e046 100755
--- a/public/vendor/codemirror/mode/livescript/livescript.js
+++ b/public/vendor/codemirror/mode/livescript/livescript.js
@@ -24,8 +24,8 @@
var nr = Rules[next_rule];
if (nr.splice) {
for (var i$ = 0; i$ < nr.length; ++i$) {
- var r = nr[i$], m;
- if (r.regex && (m = stream.match(r.regex))) {
+ var r = nr[i$];
+ if (r.regex && stream.match(r.regex)) {
state.next = r.next || state.next;
return r.token;
}
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
index bc5314fc..bef37b8a 100755
--- a/public/vendor/codemirror/mode/markdown/markdown.js
+++ b/public/vendor/codemirror/mode/markdown/markdown.js
@@ -68,12 +68,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
, strong = 'strong'
, strikethrough = 'strikethrough';
- var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/
+ var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
, ulRE = /^[*\-+]\s+/
- , olRE = /^[0-9]+\.\s+/
+ , olRE = /^[0-9]+([.)])\s+/
, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE
- , atxHeaderRE = /^#+ ?/
- , setextHeaderRE = /^(?:\={1,}|-{1,})$/
+ , atxHeaderRE = /^(#+)(?: |$)/
+ , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
, textRE = /^[^#!\[\]*_\\<>` "'(~]+/;
function switchInline(stream, state, f) {
@@ -100,6 +100,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.strikethrough = false;
// Reset state.quote
state.quote = 0;
+ // Reset state.indentedCode
+ state.indentedCode = false;
if (!htmlFound && state.f == htmlBlock) {
state.f = inlineNormal;
state.block = blockNormal;
@@ -116,7 +118,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var sol = stream.sol();
- var prevLineIsList = state.list !== false;
+ var prevLineIsList = state.list !== false,
+ prevLineIsIndentedCode = state.indentedCode;
+
+ state.indentedCode = false;
+
if (prevLineIsList) {
if (state.indentationDiff >= 0) { // Continued list
if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
@@ -134,23 +140,27 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var match = null;
if (state.indentationDiff >= 4) {
- state.indentation -= 4;
stream.skipToEnd();
- return code;
+ if (prevLineIsIndentedCode || !state.prevLineHasContent) {
+ state.indentation -= 4;
+ state.indentedCode = true;
+ return code;
+ } else {
+ return null;
+ }
} else if (stream.eatSpace()) {
return null;
- } else if (match = stream.match(atxHeaderRE)) {
- state.header = Math.min(6, match[0].indexOf(" ") !== -1 ? match[0].length - 1 : match[0].length);
+ } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
+ state.header = match[1].length;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
- } else if (state.prevLineHasContent && (match = stream.match(setextHeaderRE))) {
+ } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
state.header = match[0].charAt(0) == '=' ? 1 : 2;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
} else if (stream.eat('>')) {
- state.indentation++;
state.quote = sol ? 1 : state.quote + 1;
if (modeCfg.highlightFormatting) state.formatting = "quote";
stream.eatSpace();
@@ -158,6 +168,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else if (stream.peek() === '[') {
return switchInline(stream, state, footnoteLink);
} else if (stream.match(hrRE, true)) {
+ state.hr = true;
return hr;
} else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
var listType = null;
@@ -262,17 +273,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
if (state.linkHref) {
- styles.push(linkhref);
- return styles.length ? styles.join(' ') : null;
- }
+ styles.push(linkhref, "url");
+ } else { // Only apply inline styles to non-url text
+ if (state.strong) { styles.push(strong); }
+ if (state.em) { styles.push(em); }
+ if (state.strikethrough) { styles.push(strikethrough); }
- if (state.strong) { styles.push(strong); }
- if (state.em) { styles.push(em); }
- if (state.strikethrough) { styles.push(strikethrough); }
+ if (state.linkText) { styles.push(linktext); }
- if (state.linkText) { styles.push(linktext); }
-
- if (state.code) { styles.push(code); }
+ if (state.code) { styles.push(code); }
+ }
if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }
@@ -626,7 +636,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
- return linkhref;
+ return linkhref + " url";
}
var savedInlineRE = [];
@@ -663,6 +673,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
em: false,
strong: false,
header: 0,
+ hr: false,
taskList: false,
list: false,
listDepth: 0,
@@ -695,10 +706,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
strong: s.strong,
strikethrough: s.strikethrough,
header: s.header,
+ hr: s.hr,
taskList: s.taskList,
list: s.list,
listDepth: s.listDepth,
quote: s.quote,
+ indentedCode: s.indentedCode,
trailingSpace: s.trailingSpace,
trailingSpaceNewLine: s.trailingSpaceNewLine,
md_inside: s.md_inside
@@ -711,10 +724,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.formatting = false;
if (stream.sol()) {
- var forceBlankLine = !!state.header;
+ var forceBlankLine = !!state.header || state.hr;
- // Reset state.header
+ // Reset state.header and state.hr
state.header = 0;
+ state.hr = false;
if (stream.match(/^\s*$/, true) || forceBlankLine) {
state.prevLineHasContent = false;
diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js
index 7bc687f0..7cd0bf4b 100755
--- a/public/vendor/codemirror/mode/markdown/test.js
+++ b/public/vendor/codemirror/mode/markdown/test.js
@@ -41,11 +41,11 @@
"[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]");
FT("formatting_link",
- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]");
+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url (][string&url http://example.com/][string&formatting&formatting-link-string&url )]");
FT("formatting_linkReference",
- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]",
- "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]");
+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url [][string&url bar][string&formatting&formatting-link-string&url ]]]",
+ "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string&url http://example.com/]");
FT("formatting_linkWeb",
"[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]");
@@ -85,13 +85,6 @@
" [comment foo]",
"bar");
- // Code blocks using 4 spaces with internal indentation
- MT("codeBlocksUsing4SpacesIndentation",
- " foo",
- " [comment bar]",
- " [comment hello]",
- " [comment world]");
-
// Code blocks should end even after extra indented lines
MT("codeBlocksWithTrailingIndentedLine",
" [comment foo]",
@@ -104,6 +97,12 @@
MT("codeBlocksUsing1Tab",
"\t[comment foo]");
+ // No code blocks directly after paragraph
+ // http://spec.commonmark.org/0.19/#example-65
+ MT("noCodeBlocksAfterParagraph",
+ "Foo",
+ " Bar");
+
// Inline code using backticks
MT("inlineCodeUsingBackticks",
"foo [comment `bar`]");
@@ -166,10 +165,13 @@
MT("atxH6",
"[header&header-6 ###### foo]");
- // H6 - 7x '#' should still be H6, per Dingus
- // http://daringfireball.net/projects/markdown/dingus
- MT("atxH6NotH7",
- "[header&header-6 ####### foo]");
+ // http://spec.commonmark.org/0.19/#example-24
+ MT("noAtxH7",
+ "####### foo");
+
+ // http://spec.commonmark.org/0.19/#example-25
+ MT("noAtxH1WithoutSpace",
+ "#5 bolt");
// Inline styles should be parsed inside headers
MT("atxH1inline",
@@ -202,6 +204,25 @@
"foo",
"[header&header-2 ---]");
+ // http://spec.commonmark.org/0.19/#example-45
+ MT("setextH2AllowSpaces",
+ "foo",
+ " [header&header-2 ---- ]");
+
+ // http://spec.commonmark.org/0.19/#example-44
+ MT("noSetextAfterIndentedCodeBlock",
+ " [comment foo]",
+ "[hr ---]");
+
+ // http://spec.commonmark.org/0.19/#example-51
+ MT("noSetextAfterQuote",
+ "[quote&quote-1 > foo]",
+ "[hr ---]");
+
+ MT("noSetextAfterList",
+ "[variable-2 - foo]",
+ "[hr ---]");
+
// Single-line blockquote with trailing space
MT("blockquoteSpace",
"[quote&quote-1 > foo]");
@@ -251,6 +272,13 @@
"",
"hello");
+ // Header with leading space after continued blockquote (#3287, negative indentation)
+ MT("headerAfterContinuedBlockquote",
+ "[quote&quote-1 > foo]",
+ "[quote&quote-1 bar]",
+ "",
+ " [header&header-1 # hello]");
+
// Check list types
MT("listAsterisk",
@@ -287,11 +315,21 @@
"1. bar",
"2. hello");
+ // List after hr
+ MT("listAfterHr",
+ "[hr ---]",
+ "[variable-2 - bar]");
+
// List after header
MT("listAfterHeader",
"[header&header-1 # foo]",
"[variable-2 - bar]");
+ // hr after list
+ MT("hrAfterList",
+ "[variable-2 - foo]",
+ "[hr -----]");
+
// Formatting in lists (*)
MT("listAsteriskFormatting",
"[variable-2 * ][variable-2&em *foo*][variable-2 bar]",
@@ -498,39 +536,39 @@
// Inline link with title
MT("linkTitle",
- "[link [[foo]]][string (http://example.com/ \"bar\")] hello");
+ "[link [[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Inline link without title
MT("linkNoTitle",
- "[link [[foo]]][string (http://example.com/)] bar");
+ "[link [[foo]]][string&url (http://example.com/)] bar");
// Inline link with image
MT("linkImage",
- "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar");
+ "[link [[][tag ![[foo]]][string&url (http://example.com/)][link ]]][string&url (http://example.com/)] bar");
// Inline link with Em
MT("linkEm",
- "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&em *foo*][link ]]][string&url (http://example.com/)] bar");
// Inline link with Strong
MT("linkStrong",
- "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&strong **foo**][link ]]][string&url (http://example.com/)] bar");
// Inline link with EmStrong
MT("linkEmStrong",
- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar");
// Image with title
MT("imageTitle",
- "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello");
+ "[tag ![[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Image without title
MT("imageNoTitle",
- "[tag ![[foo]]][string (http://example.com/)] bar");
+ "[tag ![[foo]]][string&url (http://example.com/)] bar");
// Image with asterisks
MT("imageAsterisks",
- "[tag ![[*foo*]]][string (http://example.com/)] bar");
+ "[tag ![[*foo*]]][string&url (http://example.com/)] bar");
// Not a link. Should be normal text due to square brackets being used
// regularly in text, especially in quoted material, and no space is allowed
@@ -540,24 +578,24 @@
// Reference-style links
MT("linkReference",
- "[link [[foo]]][string [[bar]]] hello");
+ "[link [[foo]]][string&url [[bar]]] hello");
// Reference-style links with Em
MT("linkReferenceEm",
- "[link [[][link&em *foo*][link ]]][string [[bar]]] hello");
+ "[link [[][link&em *foo*][link ]]][string&url [[bar]]] hello");
// Reference-style links with Strong
MT("linkReferenceStrong",
- "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello");
+ "[link [[][link&strong **foo**][link ]]][string&url [[bar]]] hello");
// Reference-style links with EmStrong
MT("linkReferenceEmStrong",
- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello");
+ "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello");
// Reference-style links with optional space separator (per docuentation)
// "You can optionally use a space to separate the sets of brackets"
MT("linkReferenceSpace",
- "[link [[foo]]] [string [[bar]]] hello");
+ "[link [[foo]]] [string&url [[bar]]] hello");
// Should only allow a single space ("...use *a* space...")
MT("linkReferenceDoubleSpace",
@@ -565,7 +603,7 @@
// Reference-style links with implicit link name
MT("linkImplicit",
- "[link [[foo]]][string [[]]] hello");
+ "[link [[foo]]][string&url [[]]] hello");
// @todo It would be nice if, at some point, the document was actually
// checked to see if the referenced link exists
@@ -573,46 +611,46 @@
// Link label, for reference-style links (taken from documentation)
MT("labelNoTitle",
- "[link [[foo]]:] [string http://example.com/]");
+ "[link [[foo]]:] [string&url http://example.com/]");
MT("labelIndented",
- " [link [[foo]]:] [string http://example.com/]");
+ " [link [[foo]]:] [string&url http://example.com/]");
MT("labelSpaceTitle",
- "[link [[foo bar]]:] [string http://example.com/ \"hello\"]");
+ "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"]");
MT("labelDoubleTitle",
- "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\"");
+ "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"] \"world\"");
MT("labelTitleDoubleQuotes",
- "[link [[foo]]:] [string http://example.com/ \"bar\"]");
+ "[link [[foo]]:] [string&url http://example.com/ \"bar\"]");
MT("labelTitleSingleQuotes",
- "[link [[foo]]:] [string http://example.com/ 'bar']");
+ "[link [[foo]]:] [string&url http://example.com/ 'bar']");
MT("labelTitleParenthese",
- "[link [[foo]]:] [string http://example.com/ (bar)]");
+ "[link [[foo]]:] [string&url http://example.com/ (bar)]");
MT("labelTitleInvalid",
- "[link [[foo]]:] [string http://example.com/] bar");
+ "[link [[foo]]:] [string&url http://example.com/] bar");
MT("labelLinkAngleBrackets",
- "[link [[foo]]:] [string <http://example.com/> \"bar\"]");
+ "[link [[foo]]:] [string&url <http://example.com/> \"bar\"]");
MT("labelTitleNextDoubleQuotes",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string \"bar\"] hello");
MT("labelTitleNextSingleQuotes",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string 'bar'] hello");
MT("labelTitleNextParenthese",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string (bar)] hello");
MT("labelTitleNextMixed",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"(bar\" hello");
MT("linkWeb",
diff --git a/public/vendor/codemirror/mode/mathematica/index.html b/public/vendor/codemirror/mode/mathematica/index.html
new file mode 100755
index 00000000..57c42985
--- /dev/null
+++ b/public/vendor/codemirror/mode/mathematica/index.html
@@ -0,0 +1,72 @@
+<!doctype html>
+
+<title>CodeMirror: Mathematica mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel=stylesheet href=../../lib/codemirror.css>
+<script src=../../lib/codemirror.js></script>
+<script src=../../addon/edit/matchbrackets.js></script>
+<script src=mathematica.js></script>
+<style type=text/css>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Mathematica</a>
+ </ul>
+</div>
+
+<article>
+<h2>Mathematica mode</h2>
+
+
+<textarea id="mathematicaCode">
+(* example Mathematica code *)
+(* Dualisiert wird anhand einer Polarität an einer
+ Quadrik $x^t Q x = 0$ mit regulärer Matrix $Q$ (also
+ mit $det(Q) \neq 0$), z.B. die Identitätsmatrix.
+ $p$ ist eine Liste von Polynomen - ein Ideal. *)
+dualize::"singular" = "Q must be regular: found Det[Q]==0.";
+dualize[ Q_, p_ ] := Block[
+ { m, n, xv, lv, uv, vars, polys, dual },
+ If[Det[Q] == 0,
+ Message[dualize::"singular"],
+ m = Length[p];
+ n = Length[Q] - 1;
+ xv = Table[Subscript[x, i], {i, 0, n}];
+ lv = Table[Subscript[l, i], {i, 1, m}];
+ uv = Table[Subscript[u, i], {i, 0, n}];
+ (* Konstruiere Ideal polys. *)
+ If[m == 0,
+ polys = Q.uv,
+ polys = Join[p, Q.uv - Transpose[Outer[D, p, xv]].lv]
+ ];
+ (* Eliminiere die ersten n + 1 + m Variablen xv und lv
+ aus dem Ideal polys. *)
+ vars = Join[xv, lv];
+ dual = GroebnerBasis[polys, uv, vars];
+ (* Ersetze u mit x im Ergebnis. *)
+ ReplaceAll[dual, Rule[u, x]]
+ ]
+ ]
+</textarea>
+
+<script>
+ var mathematicaEditor = CodeMirror.fromTextArea(document.getElementById('mathematicaCode'), {
+ mode: 'text/x-mathematica',
+ lineNumbers: true,
+ matchBrackets: true
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-mathematica</code> (Mathematica).</p>
+</article>
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
new file mode 100755
index 00000000..5ae6f55c
--- /dev/null
+++ b/public/vendor/codemirror/mode/mathematica/mathematica.js
@@ -0,0 +1,175 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Mathematica mode copyright (c) 2015 by Calin Barbat
+// Based on code by Patrick Scheibe (halirutan)
+// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
+
+ // used pattern building blocks
+ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*';
+ var pBase = "(?:\\d+)";
+ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)";
+ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)";
+ var pPrecision = "(?:`(?:`?"+pFloat+")?)";
+
+ // regular expressions
+ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))');
+ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)');
+ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');
+
+ function tokenBase(stream, state) {
+ var ch;
+
+ // get next character
+ ch = stream.next();
+
+ // string
+ if (ch === '"') {
+ state.tokenize = tokenString;
+ return state.tokenize(stream, state);
+ }
+
+ // comment
+ if (ch === '(') {
+ if (stream.eat('*')) {
+ state.commentLevel++;
+ state.tokenize = tokenComment;
+ return state.tokenize(stream, state);
+ }
+ }
+
+ // go back one character
+ stream.backUp(1);
+
+ // look for numbers
+ // Numbers in a baseform
+ if (stream.match(reBaseForm, true, false)) {
+ return 'number';
+ }
+
+ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition
+ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.
+ if (stream.match(reFloatForm, true, false)) {
+ return 'number';
+ }
+
+ /* In[23] and Out[34] */
+ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) {
+ return 'atom';
+ }
+
+ // usage
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
+ return 'meta';
+ }
+
+ // message
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
+ return 'string-2';
+ }
+
+ // this makes a look-ahead match for something like variable:{_Integer}
+ // the match is then forwarded to the mma-patterns tokenizer.
+ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) {
+ return 'variable-2';
+ }
+
+ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)
+ // Cannot start with a number, but can have numbers at any other position. Examples
+ // blub__Integer, a1_, b34_Integer32
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
+ return 'variable-2';
+ }
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) {
+ return 'variable-2';
+ }
+ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
+ return 'variable-2';
+ }
+
+ // Named characters in Mathematica, like \[Gamma].
+ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) {
+ return 'variable-3';
+ }
+
+ // Match all braces separately
+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
+ return 'bracket';
+ }
+
+ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match
+ // only one.
+ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) {
+ return 'variable-2';
+ }
+
+ // Literals like variables, keywords, functions
+ if (stream.match(reIdInContext, true, false)) {
+ return 'keyword';
+ }
+
+ // operators. Note that operators like @@ or /; are matched separately for each symbol.
+ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
+ return 'operator';
+ }
+
+ // everything else is an error
+ return 'error';
+ }
+
+ function tokenString(stream, state) {
+ var next, end = false, escaped = false;
+ while ((next = stream.next()) != null) {
+ if (next === '"' && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next === '\\';
+ }
+ if (end && !escaped) {
+ state.tokenize = tokenBase;
+ }
+ return 'string';
+ };
+
+ function tokenComment(stream, state) {
+ var prev, next;
+ while(state.commentLevel > 0 && (next = stream.next()) != null) {
+ if (prev === '(' && next === '*') state.commentLevel++;
+ if (prev === '*' && next === ')') state.commentLevel--;
+ prev = next;
+ }
+ if (state.commentLevel <= 0) {
+ state.tokenize = tokenBase;
+ }
+ return 'comment';
+ }
+
+ return {
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ return state.tokenize(stream, state);
+ },
+ blockCommentStart: "(*",
+ blockCommentEnd: "*)"
+ };
+});
+
+CodeMirror.defineMIME('text/x-mathematica', {
+ name: 'mathematica'
+});
+
+});
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
index 6c988e22..bb30c80f 100755
--- a/public/vendor/codemirror/mode/meta.js
+++ b/public/vendor/codemirror/mode/meta.js
@@ -14,6 +14,7 @@
CodeMirror.modeInfo = [
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
{name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
+ {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn, asn1"]},
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
@@ -37,9 +38,11 @@
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
+ {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
+ {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
@@ -72,6 +75,7 @@
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
+ {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps"},
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
@@ -112,6 +116,7 @@
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
+ {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
@@ -123,8 +128,11 @@
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
{name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
+ {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
+ {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
+ {name: "Twig", mime: "text/x-twig", mode: "twig"},
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js
index e112d911..0c3f21e5 100755
--- a/public/vendor/codemirror/mode/php/php.js
+++ b/public/vendor/codemirror/mode/php/php.js
@@ -17,31 +17,31 @@
return obj;
}
- // Helper for stringWithEscapes
- function matchSequence(list, end) {
- if (list.length == 0) return stringWithEscapes(end);
+ // Helper for phpString
+ function matchSequence(list, end, escapes) {
+ if (list.length == 0) return phpString(end);
return function (stream, state) {
var patterns = list[0];
for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {
state.tokenize = matchSequence(list.slice(1), end);
return patterns[i][1];
}
- state.tokenize = stringWithEscapes(end);
+ state.tokenize = phpString(end, escapes);
return "string";
};
}
- function stringWithEscapes(closing) {
- return function(stream, state) { return stringWithEscapes_(stream, state, closing); };
+ function phpString(closing, escapes) {
+ return function(stream, state) { return phpString_(stream, state, closing, escapes); };
}
- function stringWithEscapes_(stream, state, closing) {
+ function phpString_(stream, state, closing, escapes) {
// "Complex" syntax
- if (stream.match("${", false) || stream.match("{$", false)) {
+ if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) {
state.tokenize = null;
return "string";
}
// Simple syntax
- if (stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
+ if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
// After the variable name there may appear array or object operator.
if (stream.match("[", false)) {
// Match array operator
@@ -51,14 +51,14 @@
[/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
[/[\w\$]+/, "variable"]],
[["]", null]]
- ], closing);
+ ], closing, escapes);
}
if (stream.match(/\-\>\w/, false)) {
// Match object operator
state.tokenize = matchSequence([
[["->", null]],
[[/[\w]+/, "variable"]]
- ], closing);
+ ], closing, escapes);
}
return "variable-2";
}
@@ -66,8 +66,9 @@
var escaped = false;
// Normal string
while (!stream.eol() &&
- (escaped || (!stream.match("{$", false) &&
- !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
+ (escaped || escapes === false ||
+ (!stream.match("{$", false) &&
+ !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
if (!escaped && stream.match(closing)) {
state.tokenize = null;
state.tokStack.pop(); state.tokStack.pop();
@@ -94,6 +95,7 @@
helperType: "php",
keywords: keywords(phpKeywords),
blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
+ defKeywords: keywords("class function interface namespace trait"),
atoms: keywords(phpAtoms),
builtin: keywords(phpBuiltin),
multiLineStrings: true,
@@ -104,11 +106,13 @@
},
"<": function(stream, state) {
if (stream.match(/<</)) {
+ var nowDoc = stream.eat("'");
stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(3);
+ var delim = stream.current().slice(3 + (nowDoc ? 1 : 0));
+ if (nowDoc) stream.eat("'");
if (delim) {
(state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = stringWithEscapes(delim);
+ state.tokenize = phpString(delim, nowDoc ? false : true);
return "string";
}
}
@@ -127,7 +131,7 @@
},
'"': function(_stream, state) {
(state.tokStack || (state.tokStack = [])).push('"', 0);
- state.tokenize = stringWithEscapes('"');
+ state.tokenize = phpString('"');
return "string";
},
"{": function(_stream, state) {
@@ -138,7 +142,7 @@
"}": function(_stream, state) {
if (state.tokStack && state.tokStack.length > 0 &&
!--state.tokStack[state.tokStack.length - 1]) {
- state.tokenize = stringWithEscapes(state.tokStack[state.tokStack.length - 2]);
+ state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]);
}
return false;
}
diff --git a/public/vendor/codemirror/mode/pig/pig.js b/public/vendor/codemirror/mode/pig/pig.js
index c74b2cc8..5b567272 100755
--- a/public/vendor/codemirror/mode/pig/pig.js
+++ b/public/vendor/codemirror/mode/pig/pig.js
@@ -30,12 +30,6 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
return f(stream, state);
}
- var type;
- function ret(tp, style) {
- type = tp;
- return style;
- }
-
function tokenComment(stream, state) {
var isEnd = false;
var ch;
@@ -46,7 +40,7 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
isEnd = (ch == "*");
}
- return ret("comment", "comment");
+ return "comment";
}
function tokenString(quote) {
@@ -60,10 +54,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
if (end || !(escaped || multiLineStrings))
state.tokenize = tokenBase;
- return ret("string", "error");
+ return "error";
};
}
+
function tokenBase(stream, state) {
var ch = stream.next();
@@ -72,11 +67,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
return chain(stream, state, tokenString(ch));
// is it one of the special chars
else if(/[\[\]{}\(\),;\.]/.test(ch))
- return ret(ch);
+ return null;
// is it a number?
else if(/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/);
- return ret("number", "number");
+ return "number";
}
// multi line comment or operator
else if (ch == "/") {
@@ -85,47 +80,42 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
else {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
}
// single line comment or operator
else if (ch=="-") {
if(stream.eat("-")){
stream.skipToEnd();
- return ret("comment", "comment");
+ return "comment";
}
else {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
}
// is it an operator
else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
else {
// get the while word
stream.eatWhile(/[\w\$_]/);
// is it one of the listed keywords?
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
- if (stream.eat(")") || stream.eat(".")) {
- //keywords can be used as variables like flatten(group), group.$0 etc..
- }
- else {
- return ("keyword", "keyword");
- }
+ //keywords can be used as variables like flatten(group), group.$0 etc..
+ if (!stream.eat(")") && !stream.eat("."))
+ return "keyword";
}
// is it one of the builtin functions?
if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase()))
- {
- return ("keyword", "variable-2");
- }
+ return "variable-2";
// is it one of the listed types?
if (types && types.propertyIsEnumerable(stream.current().toUpperCase()))
- return ("keyword", "variable-3");
+ return "variable-3";
// default is a 'variable'
- return ret("variable", "pig-word");
+ return "variable";
}
}
diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js
index cdb58bbb..e5a09719 100755
--- a/public/vendor/codemirror/mode/python/python.js
+++ b/public/vendor/codemirror/mode/python/python.js
@@ -37,7 +37,7 @@
"unichr", "unicode", "xrange", "False", "True", "None"],
keywords: ["exec", "print"]};
var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
- keywords: ["nonlocal", "False", "True", "None"]};
+ keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js
index fb1c6cb5..a9082771 100755
--- a/public/vendor/codemirror/mode/sql/sql.js
+++ b/public/vendor/codemirror/mode/sql/sql.js
@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
}
// these keywords are used by all SQL dialects (however, a mode can still overwrite it)
- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";
+ var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";
// turn a space-separated list into an array
function set(str) {
@@ -293,7 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
CodeMirror.defineMIME("text/x-mysql", {
name: "sql",
client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
- keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
+ keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),
atoms: set("false true null unknown"),
operatorChars: /^[*+\-%<>!=&|^]/,
diff --git a/public/vendor/codemirror/mode/swift/index.html b/public/vendor/codemirror/mode/swift/index.html
new file mode 100755
index 00000000..2649dc37
--- /dev/null
+++ b/public/vendor/codemirror/mode/swift/index.html
@@ -0,0 +1,88 @@
+<!doctype html>
+
+<title>CodeMirror: Swift mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="./swift.js"></script>
+<style>
+ .CodeMirror { border: 2px inset #dee; }
+ </style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Swift</a>
+ </ul>
+</div>
+
+<article>
+<h2>Swift mode</h2>
+<form><textarea id="code" name="code">
+//
+// TipCalculatorModel.swift
+// TipCalculator
+//
+// Created by Main Account on 12/18/14.
+// Copyright (c) 2014 Razeware LLC. All rights reserved.
+//
+
+import Foundation
+
+class TipCalculatorModel {
+
+ var total: Double
+ var taxPct: Double
+ var subtotal: Double {
+ get {
+ return total / (taxPct + 1)
+ }
+ }
+
+ init(total: Double, taxPct: Double) {
+ self.total = total
+ self.taxPct = taxPct
+ }
+
+ func calcTipWithTipPct(tipPct: Double) -> Double {
+ return subtotal * tipPct
+ }
+
+ func returnPossibleTips() -> [Int: Double] {
+
+ let possibleTipsInferred = [0.15, 0.18, 0.20]
+ let possibleTipsExplicit:[Double] = [0.15, 0.18, 0.20]
+
+ var retval = [Int: Double]()
+ for possibleTip in possibleTipsInferred {
+ let intPct = Int(possibleTip*100)
+ retval[intPct] = calcTipWithTipPct(possibleTip)
+ }
+ return retval
+
+ }
+
+}
+</textarea></form>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-swift"
+ });
+ </script>
+
+ <p>A simple mode for Swift</p>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-swift</code> (Swift code)</p>
+ </article>
diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js
new file mode 100755
index 00000000..cf784fef
--- /dev/null
+++ b/public/vendor/codemirror/mode/swift/swift.js
@@ -0,0 +1,203 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Swift mode created by Michael Kaminsky https://github.com/mkaminsky11
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object")
+ mod(require("../../lib/codemirror"))
+ else if (typeof define == "function" && define.amd)
+ define(["../../lib/codemirror"], mod)
+ else
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+
+ function trim(str) { return /^\s*(.*?)\s*$/.exec(str)[1] }
+
+ var separators = [" ","\\\+","\\\-","\\\(","\\\)","\\\*","/",":","\\\?","\\\<","\\\>"," ","\\\."]
+ var tokens = new RegExp(separators.join("|"),"g")
+
+ function getWord(string, pos) {
+ var index = -1, count = 1
+ var words = string.split(tokens)
+ for (var i = 0; i < words.length; i++) {
+ for(var j = 1; j <= words[i].length; j++) {
+ if (count==pos) index = i
+ count++
+ }
+ count++
+ }
+ var ret = ["", ""]
+ if (pos == 0) {
+ ret[1] = words[0]
+ ret[0] = null
+ } else {
+ ret[1] = words[index]
+ ret[0] = words[index-1]
+ }
+ return ret
+ }
+
+ CodeMirror.defineMode("swift", function() {
+ var keywords=["var","let","class","deinit","enum","extension","func","import","init","let","protocol","static","struct","subscript","typealias","var","as","dynamicType","is","new","super","self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case","continue","default","do","else","fallthrough","if","in","for","return","switch","where","while","associativity","didSet","get","infix","inout","left","mutating","none","nonmutating","operator","override","postfix","precedence","prefix","right","set","unowned","unowned(safe)","unowned(unsafe)","weak","willSet"]
+ var commonConstants=["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null","this","super"]
+ var types=["String","bool","int","string","double","Double","Int","Float","float","public","private","extension"]
+ var numbers=["0","1","2","3","4","5","6","7","8","9"]
+ var operators=["+","-","/","*","%","=","|","&","<",">"]
+ var punc=[";",",",".","(",")","{","}","[","]"]
+ var delimiters=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/
+ var identifiers=/^[_A-Za-z$][_A-Za-z$0-9]*/
+ var properties=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/
+ var regexPrefixes=/^(\/{3}|\/)/
+
+ return {
+ startState: function() {
+ return {
+ prev: false,
+ string: false,
+ escape: false,
+ inner: false,
+ comment: false,
+ num_left: 0,
+ num_right: 0,
+ doubleString: false,
+ singleString: false
+ }
+ },
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null
+
+ var ch = stream.next()
+ if (state.string) {
+ if (state.escape) {
+ state.escape = false
+ return "string"
+ } else {
+ if ((ch == "\"" && (state.doubleString && !state.singleString) ||
+ (ch == "'" && (!state.doubleString && state.singleString))) &&
+ !state.escape) {
+ state.string = false
+ state.doubleString = false
+ state.singleString = false
+ return "string"
+ } else if (ch == "\\" && stream.peek() == "(") {
+ state.inner = true
+ state.string = false
+ return "keyword"
+ } else if (ch == "\\" && stream.peek() != "(") {
+ state.escape = true
+ state.string = true
+ return "string"
+ } else {
+ return "string"
+ }
+ }
+ } else if (state.comment) {
+ if (ch == "*" && stream.peek() == "/") {
+ state.prev = "*"
+ return "comment"
+ } else if (ch == "/" && state.prev == "*") {
+ state.prev = false
+ state.comment = false
+ return "comment"
+ }
+ return "comment"
+ } else {
+ if (ch == "/") {
+ if (stream.peek() == "/") {
+ stream.skipToEnd()
+ return "comment"
+ }
+ if (stream.peek() == "*") {
+ state.comment = true
+ return "comment"
+ }
+ }
+ if (ch == "(" && state.inner) {
+ state.num_left++
+ return null
+ }
+ if (ch == ")" && state.inner) {
+ state.num_right++
+ if (state.num_left == state.num_right) {
+ state.inner=false
+ state.string=true
+ }
+ return null
+ }
+
+ var ret = getWord(stream.string, stream.pos)
+ var the_word = ret[1]
+ var prev_word = ret[0]
+
+ if (operators.indexOf(ch + "") > -1) return "operator"
+ if (punc.indexOf(ch) > -1) return "punctuation"
+
+ if (typeof the_word != "undefined") {
+ the_word = trim(the_word)
+ if (typeof prev_word != "undefined") prev_word = trim(prev_word)
+ if (the_word.charAt(0) == "#") return null
+
+ if (types.indexOf(the_word) > -1) return "def"
+ if (commonConstants.indexOf(the_word) > -1) return "atom"
+ if (numbers.indexOf(the_word) > -1) return "number"
+
+ if ((numbers.indexOf(the_word.charAt(0) + "") > -1 ||
+ operators.indexOf(the_word.charAt(0) + "") > -1) &&
+ numbers.indexOf(ch) > -1) {
+ return "number"
+ }
+
+ if (keywords.indexOf(the_word) > -1 ||
+ keywords.indexOf(the_word.split(tokens)[0]) > -1)
+ return "keyword"
+ if (keywords.indexOf(prev_word) > -1) return "def"
+ }
+ if (ch == '"' && !state.doubleString) {
+ state.string = true
+ state.doubleString = true
+ return "string"
+ }
+ if (ch == "'" && !state.singleString) {
+ state.string = true
+ state.singleString = true
+ return "string"
+ }
+ if (ch == "(" && state.inner)
+ state.num_left++
+ if (ch == ")" && state.inner) {
+ state.num_right++
+ if (state.num_left == state.num_right) {
+ state.inner = false
+ state.string = true
+ }
+ return null
+ }
+ if (stream.match(/^-?[0-9\.]/, false)) {
+ if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) ||
+ stream.match(/^-?\d+\.\d*/) ||
+ stream.match(/^-?\.\d+/)) {
+ if (stream.peek() == ".") stream.backUp(1)
+ return "number"
+ }
+ if (stream.match(/^-?0x[0-9a-f]+/i) ||
+ stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) ||
+ stream.match(/^-?0(?![\dx])/i))
+ return "number"
+ }
+ if (stream.match(regexPrefixes)) {
+ if (stream.current()!="/" || stream.match(/^.*\//,false)) return "string"
+ else stream.backUp(1)
+ }
+ if (stream.match(delimiters)) return "punctuation"
+ if (stream.match(identifiers)) return "variable"
+ if (stream.match(properties)) return "property"
+ return "variable"
+ }
+ }
+ }
+ })
+
+ CodeMirror.defineMIME("text/x-swift","swift")
+})
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
index 88c9768a..1df01647 100755
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
@@ -71,16 +71,6 @@ CodeMirror.defineMode("tiddlywiki", function () {
return f(stream, state);
}
- // Used as scratch variables to communicate multiple values without
- // consing up tons of objects.
- var type, content;
-
- function ret(tp, style, cont) {
- type = tp;
- content = cont;
- return style;
- }
-
function jsTokenBase(stream, state) {
var sol = stream.sol(), ch;
@@ -95,16 +85,16 @@ CodeMirror.defineMode("tiddlywiki", function () {
return chain(stream, state, twTokenCode);
}
if (stream.match(reBlockQuote)) {
- return ret('quote', 'quote');
+ return 'quote';
}
if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) {
- return ret('code', 'comment');
+ return 'comment';
}
if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) {
- return ret('code', 'comment');
+ return 'comment';
}
if (stream.match(reHR)) {
- return ret('hr', 'hr');
+ return 'hr';
}
} // sol
ch = stream.next();
@@ -112,30 +102,30 @@ CodeMirror.defineMode("tiddlywiki", function () {
if (sol && /[\/\*!#;:>|]/.test(ch)) {
if (ch == "!") { // tw header
stream.skipToEnd();
- return ret("header", "header");
+ return "header";
}
if (ch == "*") { // tw list
stream.eatWhile('*');
- return ret("list", "comment");
+ return "comment";
}
if (ch == "#") { // tw numbered list
stream.eatWhile('#');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ";") { // definition list, term
stream.eatWhile(';');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ":") { // definition list, description
stream.eatWhile(':');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ">") { // single line quote
stream.eatWhile(">");
- return ret("quote", "quote");
+ return "quote";
}
if (ch == '|') {
- return ret('table', 'header');
+ return 'header';
}
}
@@ -146,29 +136,29 @@ CodeMirror.defineMode("tiddlywiki", function () {
// rudimentary html:// file:// link matching. TW knows much more ...
if (/[hf]/i.test(ch)) {
if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) {
- return ret("link", "link");
+ return "link";
}
}
// just a little string indicator, don't want to have the whole string covered
if (ch == '"') {
- return ret('string', 'string');
+ return 'string';
}
if (ch == '~') { // _no_ CamelCase indicator should be bold
- return ret('text', 'brace');
+ return 'brace';
}
if (/[\[\]]/.test(ch)) { // check for [[..]]
if (stream.peek() == ch) {
stream.next();
- return ret('brace', 'brace');
+ return 'brace';
}
}
if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting
stream.eatWhile(isSpaceName);
- return ret("link", "link");
+ return "link";
}
if (/\d/.test(ch)) { // numbers
stream.eatWhile(/\d/);
- return ret("number", "number");
+ return "number";
}
if (ch == "/") { // tw invisible comment
if (stream.eat("%")) {
@@ -191,7 +181,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
return chain(stream, state, twTokenStrike);
// mdash
if (stream.peek() == ' ')
- return ret('text', 'brace');
+ return 'brace';
}
}
if (ch == "'") { // tw bold
@@ -205,7 +195,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
}
else {
- return ret(ch);
+ return null;
}
// core macro handling
@@ -213,8 +203,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
var word = stream.current(),
known = textwords.propertyIsEnumerable(word) && textwords[word];
- return known ? ret(known.type, known.style, word) : ret("text", null, word);
-
+ return known ? known.style : null;
} // jsTokenBase()
// tw invisible comment
@@ -228,7 +217,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "%");
}
- return ret("comment", "comment");
+ return "comment";
}
// tw strong / bold
@@ -242,29 +231,29 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "'");
}
- return ret("text", "strong");
+ return "strong";
}
// tw code
function twTokenCode(stream, state) {
- var ch, sb = state.block;
+ var sb = state.block;
if (sb && stream.current()) {
- return ret("code", "comment");
+ return "comment";
}
if (!sb && stream.match(reUntilCodeStop)) {
state.tokenize = jsTokenBase;
- return ret("code", "comment");
+ return "comment";
}
if (sb && stream.sol() && stream.match(reCodeBlockStop)) {
state.tokenize = jsTokenBase;
- return ret("code", "comment");
+ return "comment";
}
- ch = stream.next();
- return (sb) ? ret("code", "comment") : ret("code", "comment");
+ stream.next();
+ return "comment";
}
// tw em / italic
@@ -278,7 +267,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "/");
}
- return ret("text", "em");
+ return "em";
}
// tw underlined text
@@ -292,7 +281,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "_");
}
- return ret("text", "underlined");
+ return "underlined";
}
// tw strike through text looks ugly
@@ -307,7 +296,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "-");
}
- return ret("text", "strikethrough");
+ return "strikethrough";
}
// macro
@@ -315,19 +304,19 @@ CodeMirror.defineMode("tiddlywiki", function () {
var ch, word, known;
if (stream.current() == '<<') {
- return ret('brace', 'macro');
+ return 'macro';
}
ch = stream.next();
if (!ch) {
state.tokenize = jsTokenBase;
- return ret(ch);
+ return null;
}
if (ch == ">") {
if (stream.peek() == '>') {
stream.next();
state.tokenize = jsTokenBase;
- return ret("brace", "macro");
+ return "macro";
}
}
@@ -336,10 +325,10 @@ CodeMirror.defineMode("tiddlywiki", function () {
known = keywords.propertyIsEnumerable(word) && keywords[word];
if (known) {
- return ret(known.type, known.style, word);
+ return known.style, word;
}
else {
- return ret("macro", null, word);
+ return null, word;
}
}
diff --git a/public/vendor/codemirror/mode/tiki/tiki.js b/public/vendor/codemirror/mode/tiki/tiki.js
index c90aac9e..5e05b1ff 100755
--- a/public/vendor/codemirror/mode/tiki/tiki.js
+++ b/public/vendor/codemirror/mode/tiki/tiki.js
@@ -52,35 +52,27 @@ CodeMirror.defineMode('tiki', function(config) {
case "{": //plugin
stream.eat("/");
stream.eatSpace();
- var tagName = "";
- var c;
- while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c;
+ stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/);
state.tokenize = inPlugin;
return "tag";
- break;
case "_": //bold
- if (stream.eat("_")) {
+ if (stream.eat("_"))
return chain(inBlock("strong", "__", inText));
- }
break;
case "'": //italics
- if (stream.eat("'")) {
- // Italic text
+ if (stream.eat("'"))
return chain(inBlock("em", "''", inText));
- }
break;
case "(":// Wiki Link
- if (stream.eat("(")) {
+ if (stream.eat("("))
return chain(inBlock("variable-2", "))", inText));
- }
break;
case "[":// Weblink
return chain(inBlock("variable-3", "]", inText));
break;
case "|": //table
- if (stream.eat("|")) {
+ if (stream.eat("|"))
return chain(inBlock("comment", "||"));
- }
break;
case "-":
if (stream.eat("=")) {//titleBar
@@ -90,22 +82,19 @@ CodeMirror.defineMode('tiki', function(config) {
}
break;
case "=": //underline
- if (stream.match("==")) {
+ if (stream.match("=="))
return chain(inBlock("tw-underline", "===", inText));
- }
break;
case ":":
- if (stream.eat(":")) {
+ if (stream.eat(":"))
return chain(inBlock("comment", "::"));
- }
break;
case "^": //box
return chain(inBlock("tw-box", "^"));
break;
case "~": //np
- if (stream.match("np~")) {
+ if (stream.match("np~"))
return chain(inBlock("meta", "~/np~"));
- }
break;
}
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/index.html b/public/vendor/codemirror/mode/ttcn-cfg/index.html
new file mode 100755
index 00000000..4a4cd457
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn-cfg/index.html
@@ -0,0 +1,115 @@
+<!doctype html>
+
+<title>CodeMirror: TTCN-CFG mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="ttcn-cfg.js"></script>
+<style type="text/css">
+ .CodeMirror {
+ border-top: 1px solid black;
+ border-bottom: 1px solid black;
+ }
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1>
+ <img id=logo src="../../doc/logo.png">
+ </a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="http://en.wikipedia.org/wiki/TTCN">TTCN-CFG</a>
+ </ul>
+</div>
+<article>
+ <h2>TTCN-CFG example</h2>
+ <div>
+ <textarea id="ttcn-cfg-code">
+[MODULE_PARAMETERS]
+# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
+
+[LOGGING]
+# In this section you can specify the name of the log file and the classes of events
+# you want to log into the file or display on console (standard error).
+
+LogFile := "logs/%e.%h-%r.%s"
+FileMask := LOG_ALL | DEBUG | MATCHING
+ConsoleMask := ERROR | WARNING | TESTCASE | STATISTICS | PORTEVENT
+
+LogSourceInfo := Yes
+AppendFile := No
+TimeStampFormat := DateTime
+LogEventTypes := Yes
+SourceInfoFormat := Single
+LogEntityName := Yes
+
+[TESTPORT_PARAMETERS]
+# In this section you can specify parameters that are passed to Test Ports.
+
+[DEFINE]
+# In this section you can create macro definitions,
+# that can be used in other configuration file sections except [INCLUDE].
+
+[INCLUDE]
+# To use configuration settings given in other configuration files,
+# the configuration files just need to be listed in this section, with their full or relative pathnames.
+
+[EXTERNAL_COMMANDS]
+# This section can define external commands (shell scripts) to be executed by the ETS
+# whenever a control part or test case is started or terminated.
+
+BeginTestCase := ""
+EndTestCase := ""
+BeginControlPart := ""
+EndControlPart := ""
+
+[EXECUTE]
+# In this section you can specify what parts of your test suite you want to execute.
+
+[GROUPS]
+# In this section you can specify groups of hosts. These groups can be used inside the
+# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.
+
+[COMPONENTS]
+# This section consists of rules restricting the location of created PTCs.
+
+[MAIN_CONTROLLER]
+# The options herein control the behavior of MC.
+
+TCPPort := 0
+KillTimer := 10.0
+NumHCs := 0
+LocalAddress :=
+ </textarea>
+ </div>
+
+ <script>
+ var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-cfg-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ttcn-cfg"
+ });
+ ttcnEditor.setSize(600, 860);
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
+ </script>
+ <br/>
+ <p><strong>Language:</strong> Testing and Test Control Notation -
+ Configuration files
+ (<a href="http://en.wikipedia.org/wiki/TTCN">TTCN-CFG</a>)
+ </p>
+ <p><strong>MIME types defined:</strong> <code>text/x-ttcn-cfg</code>.</p>
+
+ <br/>
+ <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
+ </a>.</p>
+ <p>Coded by Asmelash Tsegay Gebretsadkan </p>
+</article>
+
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
new file mode 100755
index 00000000..e1080511
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
@@ -0,0 +1,214 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {},
+ externalCommands = parserConfig.externalCommands || {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[\|]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[:=]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "#"){
+ stream.skipToEnd();
+ return "comment";
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ if (ch == "["){
+ stream.eatWhile(/[\w_\]]/);
+ return "number sectionTitle";
+ }
+
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (fileNCtrlMaskOptions.propertyIsEnumerable(cur))
+ return "negative fileNCtrlMaskOptions";
+ if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterNext = stream.peek();
+ //look if the character if the quote is like the B in '10100010'B
+ if (afterNext){
+ afterNext = afterNext.toLowerCase();
+ if(afterNext == "b" || afterNext == "h" || afterNext == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+ }
+ function pushContext(state, col, type) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ indent = state.context.indented;
+ return state.context = new Context(indent, col, type, null, state.context);
+ }
+ function popContext(state) {
+ var t = state.context.type;
+ if (t == ")" || t == "]" || t == "}")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ //Interface
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ token: function(stream, state) {
+ var ctx = state.context;
+ if (stream.sol()) {
+ if (ctx.align == null) ctx.align = false;
+ state.indented = stream.indentation();
+ state.startOfLine = true;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
+ && curPunc != ';') || (ctx.type == "statement"
+ && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+ state.startOfLine = false;
+ return style;
+ },
+
+ electricChars: "{}",
+ lineComment: "#",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i)
+ obj[words[i]] = true;
+ return obj;
+ }
+
+ CodeMirror.defineMIME("text/x-ttcn-cfg", {
+ name: "ttcn-cfg",
+ keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" +
+ " TimeStampFormat LogEventTypes SourceInfoFormat" +
+ " LogEntityName LogSourceInfo DiskFullAction" +
+ " LogFileNumber LogFileSize MatchingHints Detailed" +
+ " Compact SubCategories Stack Single None Seconds" +
+ " DateTime Time Stop Error Retry Delete TCPPort KillTimer" +
+ " NumHCs UnixSocketsEnabled LocalAddress"),
+ fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" +
+ " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" +
+ " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" +
+ " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" +
+ " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" +
+ " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" +
+ " VERDICTOP DEFAULTOP TESTCASE ACTION USER" +
+ " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" +
+ " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" +
+ " DEBUG_ENCDEC DEBUG_TESTPORT" +
+ " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" +
+ " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" +
+ " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" +
+ " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" +
+ " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" +
+ " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" +
+ " FUNCTION_RND FUNCTION_UNQUALIFIED" +
+ " MATCHING_DONE MATCHING_MCSUCCESS" +
+ " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" +
+ " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" +
+ " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" +
+ " MATCHING_PMUNSUCC MATCHING_PROBLEM" +
+ " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" +
+ " PARALLEL_PORTCONN PARALLEL_PORTMAP" +
+ " PARALLEL_PTC PARALLEL_UNQUALIFIED" +
+ " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" +
+ " PORTEVENT_MCRECV PORTEVENT_MCSEND" +
+ " PORTEVENT_MMRECV PORTEVENT_MMSEND" +
+ " PORTEVENT_MQUEUE PORTEVENT_PCIN" +
+ " PORTEVENT_PCOUT PORTEVENT_PMIN" +
+ " PORTEVENT_PMOUT PORTEVENT_PQUEUE" +
+ " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" +
+ " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" +
+ " TESTCASE_FINISH TESTCASE_START" +
+ " TESTCASE_UNQUALIFIED TIMEROP_GUARD" +
+ " TIMEROP_READ TIMEROP_START TIMEROP_STOP" +
+ " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" +
+ " USER_UNQUALIFIED VERDICTOP_FINAL" +
+ " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" +
+ " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"),
+ externalCommands: words("BeginControlPart EndControlPart BeginTestCase" +
+ " EndTestCase"),
+ multiLineStrings: true
+ });
+}); \ No newline at end of file
diff --git a/public/vendor/codemirror/mode/ttcn/index.html b/public/vendor/codemirror/mode/ttcn/index.html
new file mode 100755
index 00000000..f1ef8113
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn/index.html
@@ -0,0 +1,118 @@
+<!doctype html>
+
+<title>CodeMirror: TTCN mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="ttcn.js"></script>
+<style type="text/css">
+ .CodeMirror {
+ border-top: 1px solid black;
+ border-bottom: 1px solid black;
+ }
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1>
+ <img id=logo src="../../doc/logo.png">
+ </a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="http://en.wikipedia.org/wiki/TTCN">TTCN</a>
+ </ul>
+</div>
+<article>
+ <h2>TTCN example</h2>
+ <div>
+ <textarea id="ttcn-code">
+module Templates {
+ /* import types from ASN.1 */
+ import from Types language "ASN.1:1997" all;
+
+ /* During the conversion phase from ASN.1 to TTCN-3 */
+ /* - the minus sign (Message-Type) within the identifiers will be replaced by underscore (Message_Type)*/
+ /* - the ASN.1 identifiers matching a TTCN-3 keyword (objid) will be postfixed with an underscore (objid_)*/
+
+ // simple types
+
+ template SenderID localObjid := objid {itu_t(0) identified_organization(4) etsi(0)};
+
+ // complex types
+
+ /* ASN.1 Message-Type mapped to TTCN-3 Message_Type */
+ template Message receiveMsg(template (present) Message_Type p_messageType) := {
+ header := p_messageType,
+ body := ?
+ }
+
+ /* ASN.1 objid mapped to TTCN-3 objid_ */
+ template Message sendInviteMsg := {
+ header := inviteType,
+ body := {
+ /* optional fields may be assigned by omit or may be ignored/skipped */
+ description := "Invite Message",
+ data := 'FF'O,
+ objid_ := localObjid
+ }
+ }
+
+ template Message sendAcceptMsg modifies sendInviteMsg := {
+ header := acceptType,
+ body := {
+ description := "Accept Message"
+ }
+ };
+
+ template Message sendErrorMsg modifies sendInviteMsg := {
+ header := errorType,
+ body := {
+ description := "Error Message"
+ }
+ };
+
+ template Message expectedErrorMsg := {
+ header := errorType,
+ body := ?
+ };
+
+ template Message expectedInviteMsg modifies expectedErrorMsg := {
+ header := inviteType
+ };
+
+ template Message expectedAcceptMsg modifies expectedErrorMsg := {
+ header := acceptType
+ };
+
+} with { encode "BER:1997" }
+ </textarea>
+ </div>
+
+ <script>
+ var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ttcn"
+ });
+ ttcnEditor.setSize(600, 860);
+ var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
+ CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
+ </script>
+ <br/>
+ <p><strong>Language:</strong> Testing and Test Control Notation
+ (<a href="http://en.wikipedia.org/wiki/TTCN">TTCN</a>)
+ </p>
+ <p><strong>MIME types defined:</strong> <code>text/x-ttcn,
+ text/x-ttcn3, text/x-ttcnpp</code>.</p>
+ <br/>
+ <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
+ </a>.</p>
+ <p>Coded by Asmelash Tsegay Gebretsadkan </p>
+</article>
+
diff --git a/public/vendor/codemirror/mode/ttcn/ttcn.js b/public/vendor/codemirror/mode/ttcn/ttcn.js
new file mode 100755
index 00000000..30518517
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn/ttcn.js
@@ -0,0 +1,283 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("ttcn", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ builtin = parserConfig.builtin || {},
+ timerOps = parserConfig.timerOps || {},
+ portOps = parserConfig.portOps || {},
+ configOps = parserConfig.configOps || {},
+ verdictOps = parserConfig.verdictOps || {},
+ sutOps = parserConfig.sutOps || {},
+ functionOps = parserConfig.functionOps || {},
+
+ verdictConsts = parserConfig.verdictConsts || {},
+ booleanConsts = parserConfig.booleanConsts || {},
+ otherConsts = parserConfig.otherConsts || {},
+
+ types = parserConfig.types || {},
+ visibilityModifiers = parserConfig.visibilityModifiers || {},
+ templateMatch = parserConfig.templateMatch || {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[+\-*&@=<>!\/]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "#"){
+ stream.skipToEnd();
+ return "atom preprocessor";
+ }
+ if (ch == "%"){
+ stream.eatWhile(/\b/);
+ return "atom ttcn3Macros";
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ if(ch == "@"){
+ if(stream.match("try") || stream.match("catch")
+ || stream.match("lazy")){
+ return "keyword";
+ }
+ }
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+ var cur = stream.current();
+
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (builtin.propertyIsEnumerable(cur)) return "builtin";
+
+ if (timerOps.propertyIsEnumerable(cur)) return "def timerOps";
+ if (configOps.propertyIsEnumerable(cur)) return "def configOps";
+ if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps";
+ if (portOps.propertyIsEnumerable(cur)) return "def portOps";
+ if (sutOps.propertyIsEnumerable(cur)) return "def sutOps";
+ if (functionOps.propertyIsEnumerable(cur)) return "def functionOps";
+
+ if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts";
+ if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts";
+ if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts";
+
+ if (types.propertyIsEnumerable(cur)) return "builtin types";
+ if (visibilityModifiers.propertyIsEnumerable(cur))
+ return "builtin visibilityModifiers";
+ if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterQuote = stream.peek();
+ //look if the character after the quote is like the B in '10100010'B
+ if (afterQuote){
+ afterQuote = afterQuote.toLowerCase();
+ if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = null;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+ }
+
+ function pushContext(state, col, type) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ indent = state.context.indented;
+ return state.context = new Context(indent, col, type, null, state.context);
+ }
+
+ function popContext(state) {
+ var t = state.context.type;
+ if (t == ")" || t == "]" || t == "}")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ //Interface
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ token: function(stream, state) {
+ var ctx = state.context;
+ if (stream.sol()) {
+ if (ctx.align == null) ctx.align = false;
+ state.indented = stream.indentation();
+ state.startOfLine = true;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements &&
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
+ (ctx.type == "statement" && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+
+ state.startOfLine = false;
+
+ return style;
+ },
+
+ electricChars: "{}",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+
+ function def(mimes, mode) {
+ if (typeof mimes == "string") mimes = [mimes];
+ var words = [];
+ function add(obj) {
+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
+ words.push(prop);
+ }
+
+ add(mode.keywords);
+ add(mode.builtin);
+ add(mode.timerOps);
+ add(mode.portOps);
+
+ if (words.length) {
+ mode.helperType = mimes[0];
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
+ }
+
+ for (var i = 0; i < mimes.length; ++i)
+ CodeMirror.defineMIME(mimes[i], mode);
+ }
+
+ def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], {
+ name: "ttcn",
+ keywords: words("activate address alive all alt altstep and and4b any" +
+ " break case component const continue control deactivate" +
+ " display do else encode enumerated except exception" +
+ " execute extends extension external for from function" +
+ " goto group if import in infinity inout interleave" +
+ " label language length log match message mixed mod" +
+ " modifies module modulepar mtc noblock not not4b nowait" +
+ " of on optional or or4b out override param pattern port" +
+ " procedure record recursive rem repeat return runs select" +
+ " self sender set signature system template testcase to" +
+ " type union value valueof var variant while with xor xor4b"),
+ builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" +
+ " decomp decvalue float2int float2str hex2bit hex2int" +
+ " hex2oct hex2str int2bit int2char int2float int2hex" +
+ " int2oct int2str int2unichar isbound ischosen ispresent" +
+ " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" +
+ " oct2str regexp replace rnd sizeof str2bit str2float" +
+ " str2hex str2int str2oct substr unichar2int unichar2char" +
+ " enum2int"),
+ types: words("anytype bitstring boolean char charstring default float" +
+ " hexstring integer objid octetstring universal verdicttype timer"),
+ timerOps: words("read running start stop timeout"),
+ portOps: words("call catch check clear getcall getreply halt raise receive" +
+ " reply send trigger"),
+ configOps: words("create connect disconnect done kill killed map unmap"),
+ verdictOps: words("getverdict setverdict"),
+ sutOps: words("action"),
+ functionOps: words("apply derefers refers"),
+
+ verdictConsts: words("error fail inconc none pass"),
+ booleanConsts: words("true false"),
+ otherConsts: words("null NULL omit"),
+
+ visibilityModifiers: words("private public friend"),
+ templateMatch: words("complement ifpresent subset superset permutation"),
+ multiLineStrings: true
+ });
+});
diff --git a/public/vendor/codemirror/mode/twig/index.html b/public/vendor/codemirror/mode/twig/index.html
new file mode 100755
index 00000000..02493a5c
--- /dev/null
+++ b/public/vendor/codemirror/mode/twig/index.html
@@ -0,0 +1,45 @@
+<!doctype html>
+
+<title>CodeMirror: Twig mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="twig.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Twig</a>
+ </ul>
+</div>
+
+<article>
+<h2>Twig mode</h2>
+<form><textarea id="code" name="code">
+{% extends "layout.twig" %}
+{% block title %}CodeMirror: Twig mode{% endblock %}
+{# this is a comment #}
+{% block content %}
+ {% for foo in bar if foo.baz is divisible by(3) %}
+ Hello {{ foo.world }}
+ {% else %}
+ {% set msg = "Result not found" %}
+ {% include "empty.twig" with { message: msg } %}
+ {% endfor %}
+{% endblock %}
+</textarea></form>
+ <script>
+ var editor =
+ CodeMirror.fromTextArea(document.getElementById("code"), {mode:
+ {name: "twig", htmlMode: true}});
+ </script>
+ </article>
diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js
new file mode 100755
index 00000000..aa676dc4
--- /dev/null
+++ b/public/vendor/codemirror/mode/twig/twig.js
@@ -0,0 +1,132 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineMode("twig", function() {
+ var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"],
+ operator = /^[+\-*&%=<>!?|~^]/,
+ sign = /^[:\[\(\{]/,
+ atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"],
+ number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
+
+ keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
+ atom = new RegExp("((" + atom.join(")|(") + "))\\b");
+
+ function tokenBase (stream, state) {
+ var ch = stream.peek();
+
+ //Comment
+ if (state.incomment) {
+ if (!stream.skipTo("#}")) {
+ stream.skipToEnd();
+ } else {
+ stream.eatWhile(/\#|}/);
+ state.incomment = false;
+ }
+ return "comment";
+ //Tag
+ } else if (state.intag) {
+ //After operator
+ if (state.operator) {
+ state.operator = false;
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ }
+ //After sign
+ if (state.sign) {
+ state.sign = false;
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ }
+
+ if (state.instring) {
+ if (ch == state.instring) {
+ state.instring = false;
+ }
+ stream.next();
+ return "string";
+ } else if (ch == "'" || ch == '"') {
+ state.instring = ch;
+ stream.next();
+ return "string";
+ } else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
+ state.intag = false;
+ return "tag";
+ } else if (stream.match(operator)) {
+ state.operator = true;
+ return "operator";
+ } else if (stream.match(sign)) {
+ state.sign = true;
+ } else {
+ if (stream.eat(" ") || stream.sol()) {
+ if (stream.match(keywords)) {
+ return "keyword";
+ }
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ if (stream.sol()) {
+ stream.next();
+ }
+ } else {
+ stream.next();
+ }
+
+ }
+ return "variable";
+ } else if (stream.eat("{")) {
+ if (ch = stream.eat("#")) {
+ state.incomment = true;
+ if (!stream.skipTo("#}")) {
+ stream.skipToEnd();
+ } else {
+ stream.eatWhile(/\#|}/);
+ state.incomment = false;
+ }
+ return "comment";
+ //Open tag
+ } else if (ch = stream.eat(/\{|%/)) {
+ //Cache close tag
+ state.intag = ch;
+ if (ch == "{") {
+ state.intag = "}";
+ }
+ stream.eat("-");
+ return "tag";
+ }
+ }
+ stream.next();
+ };
+
+ return {
+ startState: function () {
+ return {};
+ },
+ token: function (stream, state) {
+ return tokenBase(stream, state);
+ }
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-twig", "twig");
+});
diff --git a/public/vendor/codemirror/mode/vb/vb.js b/public/vendor/codemirror/mode/vb/vb.js
index 665248f4..d78f91f7 100755
--- a/public/vendor/codemirror/mode/vb/vb.js
+++ b/public/vendor/codemirror/mode/vb/vb.js
@@ -264,8 +264,9 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1);
if(state.currentIndent < 0) return 0;
return state.currentIndent * conf.indentUnit;
- }
+ },
+ lineComment: "'"
};
return external;
});
diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js
index c8f3d90a..c642ee58 100755
--- a/public/vendor/codemirror/mode/xquery/xquery.js
+++ b/public/vendor/codemirror/mode/xquery/xquery.js
@@ -68,15 +68,6 @@ CodeMirror.defineMode("xquery", function() {
return kwObj;
}();
- // Used as scratch variables to communicate multiple values without
- // consing up tons of objects.
- var type, content;
-
- function ret(tp, style, cont) {
- type = tp; content = cont;
- return style;
- }
-
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
@@ -95,7 +86,7 @@ CodeMirror.defineMode("xquery", function() {
if(stream.match("![CDATA", false)) {
state.tokenize = tokenCDATA;
- return ret("tag", "tag");
+ return "tag";
}
if(stream.match("?", false)) {
@@ -112,28 +103,28 @@ CodeMirror.defineMode("xquery", function() {
// start code block
else if(ch == "{") {
pushStateStack(state,{ type: "codeblock"});
- return ret("", null);
+ return null;
}
// end code block
else if(ch == "}") {
popStateStack(state);
- return ret("", null);
+ return null;
}
// if we're in an XML block
else if(isInXmlBlock(state)) {
if(ch == ">")
- return ret("tag", "tag");
+ return "tag";
else if(ch == "/" && stream.eat(">")) {
popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
else
- return ret("word", "variable");
+ return "variable";
}
// if a number
else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/);
- return ret("number", "atom");
+ return "atom";
}
// comment start
else if (ch === "(" && stream.eat(":")) {
@@ -149,27 +140,27 @@ CodeMirror.defineMode("xquery", function() {
}
// assignment
else if(ch ===":" && stream.eat("=")) {
- return ret("operator", "keyword");
+ return "keyword";
}
// open paren
else if(ch === "(") {
pushStateStack(state, { type: "paren"});
- return ret("", null);
+ return null;
}
// close paren
else if(ch === ")") {
popStateStack(state);
- return ret("", null);
+ return null;
}
// open paren
else if(ch === "[") {
pushStateStack(state, { type: "bracket"});
- return ret("", null);
+ return null;
}
// close paren
else if(ch === "]") {
popStateStack(state);
- return ret("", null);
+ return null;
}
else {
var known = keywords.propertyIsEnumerable(ch) && keywords[ch];
@@ -204,15 +195,14 @@ CodeMirror.defineMode("xquery", function() {
// if the previous word was element, attribute, axis specifier, this word should be the name of that
if(isInXmlConstructor(state)) {
popStateStack(state);
- return ret("word", "variable", word);
+ return "variable";
}
// as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and
// push the stack so we know to look for it on the next word
if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"});
// if the word is known, return the details of that else just call this a generic 'word'
- return known ? ret(known.type, known.style, word) :
- ret("word", "variable", word);
+ return known ? known.style : "variable";
}
}
@@ -235,7 +225,7 @@ CodeMirror.defineMode("xquery", function() {
maybeNested = (ch == "(");
}
- return ret("comment", "comment");
+ return "comment";
}
// tokenizer for string literals
@@ -247,7 +237,7 @@ CodeMirror.defineMode("xquery", function() {
if(isInString(state) && stream.current() == quote) {
popStateStack(state);
if(f) state.tokenize = f;
- return ret("string", "string");
+ return "string";
}
pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) });
@@ -255,7 +245,7 @@ CodeMirror.defineMode("xquery", function() {
// if we're in a string and in an XML block, allow an embedded code block
if(stream.match("{", false) && isInXmlAttributeBlock(state)) {
state.tokenize = tokenBase;
- return ret("string", "string");
+ return "string";
}
@@ -269,13 +259,13 @@ CodeMirror.defineMode("xquery", function() {
// if we're in a string and in an XML block, allow an embedded code block in an attribute
if(stream.match("{", false) && isInXmlAttributeBlock(state)) {
state.tokenize = tokenBase;
- return ret("string", "string");
+ return "string";
}
}
}
- return ret("string", "string");
+ return "string";
};
}
@@ -293,7 +283,7 @@ CodeMirror.defineMode("xquery", function() {
}
stream.eatWhile(isVariableChar);
state.tokenize = tokenBase;
- return ret("variable", "variable");
+ return "variable";
}
// tokenizer for XML tags
@@ -303,19 +293,19 @@ CodeMirror.defineMode("xquery", function() {
if(isclose && stream.eat(">")) {
popStateStack(state);
state.tokenize = tokenBase;
- return ret("tag", "tag");
+ return "tag";
}
// self closing tag without attributes?
if(!stream.eat("/"))
pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase});
if(!stream.eat(">")) {
state.tokenize = tokenAttribute;
- return ret("tag", "tag");
+ return "tag";
}
else {
state.tokenize = tokenBase;
}
- return ret("tag", "tag");
+ return "tag";
};
}
@@ -326,14 +316,14 @@ CodeMirror.defineMode("xquery", function() {
if(ch == "/" && stream.eat(">")) {
if(isInXmlAttributeBlock(state)) popStateStack(state);
if(isInXmlBlock(state)) popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
if(ch == ">") {
if(isInXmlAttributeBlock(state)) popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
if(ch == "=")
- return ret("", null);
+ return null;
// quoted string
if (ch == '"' || ch == "'")
return chain(stream, state, tokenString(ch, tokenAttribute));
@@ -351,7 +341,7 @@ CodeMirror.defineMode("xquery", function() {
state.tokenize = tokenBase;
}
- return ret("attribute", "attribute");
+ return "attribute";
}
// handle comments, including nested
@@ -360,7 +350,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "-" && stream.match("->", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment");
+ return "comment";
}
}
}
@@ -372,7 +362,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "]" && stream.match("]", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment");
+ return "comment";
}
}
}
@@ -383,7 +373,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "?" && stream.match(">", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment meta");
+ return "comment meta";
}
}
}
diff --git a/public/vendor/codemirror/theme/ambiance.css b/public/vendor/codemirror/theme/ambiance.css
index afcf15a3..3ab9b254 100755
--- a/public/vendor/codemirror/theme/ambiance.css
+++ b/public/vendor/codemirror/theme/ambiance.css
@@ -2,6 +2,9 @@
/* Color scheme */
+.cm-s-ambiance .cm-header {color: blue;}
+.cm-s-ambiance .cm-quote { color: #24C2C7; }
+
.cm-s-ambiance .cm-keyword { color: #cda869; }
.cm-s-ambiance .cm-atom { color: #CF7EA9; }
.cm-s-ambiance .cm-number { color: #78CF8A; }
@@ -20,8 +23,6 @@
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
.cm-s-ambiance .cm-tag { color: #fee4ff }
.cm-s-ambiance .cm-attribute { color: #9B859D; }
-.cm-s-ambiance .cm-header {color: blue;}
-.cm-s-ambiance .cm-quote { color: #24C2C7; }
.cm-s-ambiance .cm-hr { color: pink; }
.cm-s-ambiance .cm-link { color: #F4C20B; }
.cm-s-ambiance .cm-special { color: #FF9D00; }
diff --git a/public/vendor/codemirror/theme/erlang-dark.css b/public/vendor/codemirror/theme/erlang-dark.css
index 25c7e0a2..e20bf125 100755
--- a/public/vendor/codemirror/theme/erlang-dark.css
+++ b/public/vendor/codemirror/theme/erlang-dark.css
@@ -8,6 +8,7 @@
.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
+.cm-s-erlang-dark span.cm-quote { color: #ccc; }
.cm-s-erlang-dark span.cm-atom { color: #f133f1; }
.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
@@ -20,7 +21,6 @@
.cm-s-erlang-dark span.cm-operator { color: #d55; }
.cm-s-erlang-dark span.cm-property { color: #ccc; }
.cm-s-erlang-dark span.cm-qualifier { color: #ccc; }
-.cm-s-erlang-dark span.cm-quote { color: #ccc; }
.cm-s-erlang-dark span.cm-special { color: #ffbbbb; }
.cm-s-erlang-dark span.cm-string { color: #3ad900; }
.cm-s-erlang-dark span.cm-string-2 { color: #ccc; }
diff --git a/public/vendor/codemirror/theme/lesser-dark.css b/public/vendor/codemirror/theme/lesser-dark.css
index 5af8b7f6..88dff921 100755
--- a/public/vendor/codemirror/theme/lesser-dark.css
+++ b/public/vendor/codemirror/theme/lesser-dark.css
@@ -19,6 +19,8 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
+.cm-s-lesser-dark span.cm-header {color: #a0a;}
+.cm-s-lesser-dark span.cm-quote {color: #090;}
.cm-s-lesser-dark span.cm-keyword { color: #599eff; }
.cm-s-lesser-dark span.cm-atom { color: #C2B470; }
.cm-s-lesser-dark span.cm-number { color: #B35E4D; }
@@ -37,8 +39,6 @@ Ported to CodeMirror by Peter Kroon
.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; }
.cm-s-lesser-dark span.cm-tag { color: #669199; }
.cm-s-lesser-dark span.cm-attribute {color: #00c;}
-.cm-s-lesser-dark span.cm-header {color: #a0a;}
-.cm-s-lesser-dark span.cm-quote {color: #090;}
.cm-s-lesser-dark span.cm-hr {color: #999;}
.cm-s-lesser-dark span.cm-link {color: #00c;}
.cm-s-lesser-dark span.cm-error { color: #9d1e15; }
diff --git a/public/vendor/codemirror/theme/monokai.css b/public/vendor/codemirror/theme/monokai.css
index d70bb86f..cea775f6 100755
--- a/public/vendor/codemirror/theme/monokai.css
+++ b/public/vendor/codemirror/theme/monokai.css
@@ -20,9 +20,11 @@
.cm-s-monokai span.cm-variable {color: #f8f8f2;}
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
+.cm-s-monokai span.cm-variable-3 {color: #66d9ef;}
.cm-s-monokai span.cm-def {color: #fd971f;}
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
.cm-s-monokai span.cm-tag {color: #f92672;}
+.cm-s-monokai span.cm-header {color: #ae81ff;}
.cm-s-monokai span.cm-link {color: #ae81ff;}
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
diff --git a/public/vendor/codemirror/theme/solarized.css b/public/vendor/codemirror/theme/solarized.css
index 9db39515..1f1dedac 100755
--- a/public/vendor/codemirror/theme/solarized.css
+++ b/public/vendor/codemirror/theme/solarized.css
@@ -47,6 +47,8 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
text-shadow: none;
}
+.cm-s-solarized .cm-header { color: #586e75; }
+.cm-s-solarized .cm-quote { color: #93a1a1; }
.cm-s-solarized .cm-keyword { color: #cb4b16 }
.cm-s-solarized .cm-atom { color: #d33682; }
@@ -73,8 +75,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; }
.cm-s-solarized .cm-tag { color: #93a1a1 }
.cm-s-solarized .cm-attribute { color: #2aa198; }
-.cm-s-solarized .cm-header { color: #586e75; }
-.cm-s-solarized .cm-quote { color: #93a1a1; }
.cm-s-solarized .cm-hr {
color: transparent;
border-top: 1px solid #586e75;
diff --git a/public/vendor/codemirror/theme/ttcn.css b/public/vendor/codemirror/theme/ttcn.css
new file mode 100755
index 00000000..9c2e9a61
--- /dev/null
+++ b/public/vendor/codemirror/theme/ttcn.css
@@ -0,0 +1,65 @@
+.cm-quote {color: #090;}
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+.cm-strikethrough {text-decoration: line-through;}
+.cm-header {color: #00f; font-weight: bold;}
+
+.cm-atom {color: #219;}
+.cm-attribute {color: #00c;}
+.cm-bracket {color: #997;}
+.cm-comment {color: #333333;}
+.cm-def {color: #00f;}
+.cm-em {font-style: italic;}
+.cm-error {color: #f00;}
+.cm-hr {color: #999;}
+.cm-invalidchar {color: #f00;}
+.cm-keyword {font-weight:bold}
+.cm-link {color: #00c; text-decoration: underline;}
+.cm-meta {color: #555;}
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-qualifier {color: #555;}
+.cm-strikethrough {text-decoration: line-through;}
+.cm-string {color: #006400;}
+.cm-string-2 {color: #f50;}
+.cm-strong {font-weight: bold;}
+.cm-tag {color: #170;}
+.cm-variable {color: #8B2252;}
+.cm-variable-2 {color: #05a;}
+.cm-variable-3 {color: #085;}
+
+.cm-s-default .cm-error {color: #f00;}
+.cm-invalidchar {color: #f00;}
+
+/* ASN */
+.cm-s-ttcn .cm-accessTypes,
+.cm-s-ttcn .cm-compareTypes {color: #27408B}
+.cm-s-ttcn .cm-cmipVerbs {color: #8B2252}
+.cm-s-ttcn .cm-modifier {color:#D2691E}
+.cm-s-ttcn .cm-status {color:#8B4545}
+.cm-s-ttcn .cm-storage {color:#A020F0}
+.cm-s-ttcn .cm-tags {color:#006400}
+
+/* CFG */
+.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold}
+.cm-s-ttcn .cm-fileNCtrlMaskOptions,
+.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold}
+
+/* TTCN */
+.cm-s-ttcn .cm-booleanConsts,
+.cm-s-ttcn .cm-otherConsts,
+.cm-s-ttcn .cm-verdictConsts {color: #006400}
+.cm-s-ttcn .cm-configOps,
+.cm-s-ttcn .cm-functionOps,
+.cm-s-ttcn .cm-portOps,
+.cm-s-ttcn .cm-sutOps,
+.cm-s-ttcn .cm-timerOps,
+.cm-s-ttcn .cm-verdictOps {color: #0000FF}
+.cm-s-ttcn .cm-preprocessor,
+.cm-s-ttcn .cm-templateMatch,
+.cm-s-ttcn .cm-ttcn3Macros {color: #27408B}
+.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold}
+.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold}