rich 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rich/version.rb +1 -1
- data/vendor/assets/ckeditor/ckeditor/CHANGES.md +60 -56
- data/vendor/assets/ckeditor/ckeditor/README.md +1 -1
- data/vendor/assets/ckeditor/ckeditor/build-config.js +2 -1
- data/vendor/assets/ckeditor/ckeditor/ckeditor.js +15 -10
- data/vendor/assets/ckeditor/ckeditor/config.js +1 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/autogrow/plugin.js +178 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/autogrow/samples/autogrow.html +99 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.css +10 -9
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +3 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +2 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +1 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +4 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/format/formatting.js +5 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.js +168 -160
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/css.js +3 -3
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/javascript.js +13 -12
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/theme/rubyblue.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/ckeditor/ckeditor/samples/assets/posteddata.php +59 -59
- data/vendor/assets/ckeditor/ckeditor/samples/index.html +3 -0
- data/vendor/assets/ckeditor/ckeditor/samples/plugins/autogrow/autogrow.html +99 -0
- data/vendor/assets/ckeditor/ckeditor/skins/moono/dialog_iequirks.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/icons.png +0 -0
- metadata +10 -2
@@ -39,14 +39,14 @@
|
|
39
39
|
|
40
40
|
/* CURSOR */
|
41
41
|
|
42
|
-
.CodeMirror
|
42
|
+
.CodeMirror div.CodeMirror-cursor {
|
43
43
|
border-left: 1px solid black;
|
44
44
|
}
|
45
45
|
/* Shown when moving in bi-directional text */
|
46
|
-
.CodeMirror
|
46
|
+
.CodeMirror div.CodeMirror-secondarycursor {
|
47
47
|
border-left: 1px solid silver;
|
48
48
|
}
|
49
|
-
.cm-keymap-fat-cursor
|
49
|
+
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
50
50
|
width: auto;
|
51
51
|
border: 0;
|
52
52
|
background: transparent;
|
@@ -54,11 +54,11 @@
|
|
54
54
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
55
55
|
}
|
56
56
|
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
57
|
-
.cm-keymap-fat-cursor
|
57
|
+
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
|
58
58
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
59
59
|
}
|
60
60
|
/* Can style cursor different in overwrite (non-insert) mode */
|
61
|
-
.CodeMirror
|
61
|
+
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
62
62
|
|
63
63
|
/* DEFAULT THEME */
|
64
64
|
.cm-s-default { font:13px/1.4em monospace; }
|
@@ -196,6 +196,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
196
196
|
.CodeMirror-linewidget {
|
197
197
|
position: relative;
|
198
198
|
z-index: 2;
|
199
|
+
overflow: auto;
|
199
200
|
}
|
200
201
|
|
201
202
|
.CodeMirror-wrap .CodeMirror-scroll {
|
@@ -210,20 +211,20 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
210
211
|
}
|
211
212
|
.CodeMirror-measure pre { position: static; }
|
212
213
|
|
213
|
-
.CodeMirror
|
214
|
+
.CodeMirror div.CodeMirror-cursor {
|
214
215
|
position: absolute;
|
215
216
|
visibility: hidden;
|
216
217
|
border-right: none;
|
217
218
|
width: 0;
|
218
219
|
}
|
219
|
-
.CodeMirror-focused
|
220
|
+
.CodeMirror-focused div.CodeMirror-cursor {
|
220
221
|
visibility: visible;
|
221
222
|
}
|
222
223
|
|
223
224
|
.CodeMirror-selected { background: #d9d9d9; }
|
224
225
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
225
226
|
|
226
|
-
.
|
227
|
+
.cm-searching {
|
227
228
|
background: #ffa;
|
228
229
|
background: rgba(255, 255, 0, .4);
|
229
230
|
}
|
@@ -233,7 +234,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
233
234
|
|
234
235
|
@media print {
|
235
236
|
/* Hide the cursor when printing */
|
236
|
-
.CodeMirror
|
237
|
+
.CodeMirror div.CodeMirror-cursor {
|
237
238
|
visibility: hidden;
|
238
239
|
}
|
239
240
|
}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
(function(){function g(b,d){var a=b.getCursor(),c=b.getTokenAt(a),f=CodeMirror.innerMode(b.getMode(),c.state),h=f.state;if("xml"!=f.mode.name)throw CodeMirror.Pass;var e=b.getOption("autoCloseTags"),i="html"==f.mode.configuration,f="object"==typeof e&&e.dontCloseTags||i&&k,i="object"==typeof e&&e.indentTags||i&&l;if(">"==d&&h.tagName){e=h.tagName;c.end>a.ch&&(e=e.slice(0,e.length-c.end+a.ch));var g=e.toLowerCase();if("tag"==c.type&&"closeTag"==h.type||/\/\s*$/.test(c.string)||f&&-1<j(f,g))throw CodeMirror.Pass;
|
2
|
+
c=i&&-1<j(i,g);b.replaceSelection(">"+(c?"\n\n":"")+"</"+e+">",c?{line:a.line+1,ch:0}:{line:a.line,ch:a.ch+1});c&&(b.indentLine(a.line+1),b.indentLine(a.line+2))}else if("/"==d&&"tag"==c.type&&"<"==c.string)(e=h.context&&h.context.tagName)&&b.replaceSelection("/"+e+">","end");else throw CodeMirror.Pass;}function j(b,d){if(b.indexOf)return b.indexOf(d);for(var a=0,c=b.length;a<c;++a)if(b[a]==d)return a;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(b,d,a){if(d&&(a==CodeMirror.Init||!a)){a=
|
3
|
+
{name:"autoCloseTags"};if(typeof d!="object"||d.whenClosing)a["'/'"]=function(a){g(a,"/")};if(typeof d!="object"||d.whenOpening)a["'>'"]=function(a){g(a,">")};b.addKeyMap(a)}else!d&&(a!=CodeMirror.Init&&a)&&b.removeKeyMap("autoCloseTags")});var k="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),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".split(" ")})();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
(function(){for(var i=["clike","css","javascript"],h=0;h<i.length;++h)CodeMirror.extendMode(i[h],{blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * "});CodeMirror.commands.newlineAndIndentContinueComment=function(e){var b=e.getCursor(),a=e.getTokenAt(b),d=CodeMirror.innerMode(e.getMode(),a.state).mode,c;if("comment"==a.type&&d.blockCommentStart){var f=a.string.indexOf(d.blockCommentEnd),b=e.getRange({line:b.line,ch:0},{line:b.line,ch:a.end}),g;if(!(-1!=f&&f==a.string.length-d.blockCommentEnd.length))if(0==
|
2
|
+
a.string.indexOf(d.blockCommentStart)){if(c=b.slice(0,a.start),!/^\s*$/.test(c)){c="";for(f=0;f<a.start;++f)c+=" "}}else if(-1!=(g=b.indexOf(d.blockCommentContinue))&&g+d.blockCommentContinue.length>a.start&&/^\s*$/.test(b.slice(0,g)))c=b.slice(0,g)}null!=c?e.replaceSelection("\n"+c+d.blockCommentContinue,"end"):e.execCommand("newlineAndIndent")}})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){CodeMirror.commands.newlineAndIndentContinueMarkdownList=function(c){var a=c.getCursor(),d=c.getTokenAt(a),b;if("string"==d.className){var a=c.getRange({line:a.line,ch:0},{line:a.line,ch:d.end}),e;if(0==d.string.search(/\*|\d+\./)&&(e=(b=/^[\W]*(\d+)\./g.exec(a))?parseInt(b[1])+1+". ":"* ",b=a.slice(0,d.start),!/^\s*$/.test(b))){b="";for(a=0;a<d.start;++a)b+=" "}}null!=b?c.replaceSelection("\n"+b+e,"end"):c.execCommand("newlineAndIndent")}})();
|
@@ -0,0 +1,4 @@
|
|
1
|
+
(function(){function k(b){function e(a,c,d){if(a.text){var g=i?0:a.text.length-1,f=i?a.text.length:-1;for(null!=d&&(g=d+h);g!=f;g+=h)if(d=a.text.charAt(g),l.test(d)&&b.getTokenAt({line:c,ch:g+1}).type==k){var e=n[d];if(">"==e.charAt(1)==i)o.push(d);else{if(o.pop()!=e.charAt(0))return{pos:g,match:!1};if(!o.length)return{pos:g,match:!0}}}}}var a=b.getCursor(),f=b.getLineHandle(a.line),d=a.ch-1,c=0<=d&&n[f.text.charAt(d)]||n[f.text.charAt(++d)];if(!c)return null;for(var i=">"==c.charAt(1),h=i?1:-1,k=
|
2
|
+
b.getTokenAt({line:a.line,ch:d+1}).type,o=[f.text.charAt(d)],l=/[(){}[\]]/,c=a.line,j,m=i?Math.min(c+100,b.lineCount()):Math.max(-1,c-100);c!=m&&!(j=c==a.line?e(f,c,d):e(b.getLineHandle(c),c));c+=h);return{from:{line:a.line,ch:d},to:j&&{line:c,ch:j.pos},match:j&&j.match}}function l(b,e){var a=k(b);if(a){var f=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",d=b.markText(a.from,{line:a.from.line,ch:a.from.ch+1},{className:f}),c=a.to&&b.markText(a.to,{line:a.to.line,ch:a.to.ch+1},
|
3
|
+
{className:f}),a=function(){b.operation(function(){d.clear();c&&c.clear()})};if(e)setTimeout(a,800);else return a}}function m(b){b.operation(function(){h&&(h(),h=null);b.somethingSelected()||(h=l(b,!1))})}var n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;CodeMirror.defineOption("matchBrackets",!1,function(b,e){if(e)b.on("cursorActivity",m);else b.off("cursorActivity",m)});CodeMirror.defineExtension("matchBrackets",function(){l(this,!0)});CodeMirror.defineExtension("findMatchingBracket",
|
4
|
+
function(){return k(this)})})();
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,b){return/^[;{}]$/.test(b)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,b,e,a){return this.jsonMode?/^[\[,{]$/.test(b)||/^}/.test(e):";"==b&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(b)&&!/^;/.test(e)}});var m=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;
|
2
|
+
CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(d,b,e,a){var c=!1;"html"==this.configuration&&(c=a.context?m.test(a.context.tagName):!1);return!c&&("tag"==d&&/>$/.test(b)&&a.context||/^</.test(e))}});CodeMirror.defineExtension("commentRange",function(d,b,e){var a=this,c=CodeMirror.innerMode(a.getMode(),a.getTokenAt(b).state).mode;a.operation(function(){if(d)a.replaceRange(c.commentEnd,e),a.replaceRange(c.commentStart,b),b.line==e.line&&b.ch==e.ch&&a.setCursor(b.line,
|
3
|
+
b.ch+c.commentStart.length);else{var f=a.getRange(b,e),g=f.indexOf(c.commentStart),j=f.lastIndexOf(c.commentEnd);-1<g&&(-1<j&&j>g)&&(f=f.substr(0,g)+f.substring(g+c.commentStart.length,j)+f.substr(j+c.commentEnd.length));a.replaceRange(f,b,e)}})});CodeMirror.defineExtension("autoIndentRange",function(d,b){var e=this;this.operation(function(){for(var a=d.line;a<=b.line;a++)e.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(d,b,e){for(var a=this,c=a.getMode(),f=a.getRange(d,
|
4
|
+
b).split("\n"),g=CodeMirror.copyState(c,a.getTokenAt(d).state),j=a.getOption("tabSize"),i="",n=0,k=0==d.ch,l=0;l<f.length;++l){for(var h=new CodeMirror.StringStream(f[l],j);!h.eol();){var o=CodeMirror.innerMode(c,g),m=c.token(h,g),p=h.current();h.start=h.pos;if(!k||/\S/.test(p))i+=p,k=!1;if(!k&&o.mode.newlineAfterToken&&o.mode.newlineAfterToken(m,p,h.string.slice(h.pos)||f[l+1]||"",o.state))i+="\n",k=!0,++n}!h.pos&&c.blankLine&&c.blankLine(g);!k&&l<f.length-1&&(i+="\n",k=!0,++n)}a.operation(function(){a.replaceRange(i,
|
5
|
+
d,b);for(var c=d.line+1,f=d.line+n;c<=f;++c)a.indentLine(c,"smart");e?a.setCursor({line:0,ch:0}):a.setSelection(d,a.getCursor(!1))})})})();
|
@@ -1,160 +1,168 @@
|
|
1
|
-
window.CodeMirror=function(){function
|
2
|
-
|
3
|
-
"overflow: hidden; position: relative; width: 3px; height: 0px;");b.scrollbarH=
|
4
|
-
|
5
|
-
b.scroller=
|
6
|
-
b.showingFrom=b.showingTo=b.lastSizeC=0;b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null;b.prevInput="";b.alignWidgets=!1;b.pollingFast=!1;b.poll=new
|
7
|
-
0),maxLineLength:0,maxLineChanged:!1,suppressEdits:!1,goalColumn:null,cantEdit:!1,keyMaps:[]}}function
|
8
|
-
0;d<c.length;++d){var e=c[d],f=b.appendChild(
|
9
|
-
|
10
|
-
a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?
|
11
|
-
(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=
|
12
|
-
var b=""+a.options.lineNumberFormatter(a.view.doc.size-1+a.options.firstLineNumber),a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(
|
13
|
-
function
|
14
|
-
"px";if(!0!==b&&
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
"
|
22
|
-
q.above?
|
23
|
-
"",d.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
(
|
28
|
-
b.
|
29
|
-
|
30
|
-
d
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"
|
43
|
-
|
44
|
-
|
45
|
-
"
|
46
|
-
(
|
47
|
-
b)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
!
|
62
|
-
"")
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
""
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
m.
|
74
|
-
null
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
"
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
return
|
94
|
-
d
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
if(
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
c;if(
|
108
|
-
|
109
|
-
[],c=
|
110
|
-
b)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
b};
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
"
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
"
|
143
|
-
a.
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
1
|
+
window.CodeMirror=function(){function l(a,b){if(!(this instanceof l))return new l(a,b);this.options=b=b||{};for(var c in rb)!b.hasOwnProperty(c)&&rb.hasOwnProperty(c)&&(b[c]=rb[c]);sb(b);c=this.display=Xc(a);c.wrapper.CodeMirror=this;Ub(this);b.autofocus&&!Vb&&E(this);this.view=Yc(new Ia([new Ja([pa("",null,Z(c))])]));this.nextOpId=0;Ka(this);Wb(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");this.setValue(b.value||"");M&&setTimeout(L(ca,this,!0),20);this.view.history=tb();
|
2
|
+
Zc(this);var d;try{d=document.activeElement==c.input}catch(e){}d||b.autofocus&&!Vb?setTimeout(L($,this),20):ub(this);q(this,function(){for(var a in da)if(da.propertyIsEnumerable(a))da[a](this,b[a],Xb);for(a=0;a<vb.length;++a)vb[a](this)})()}function Xc(a){var b={},c=b.input=n("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");N?c.style.width="1000px":c.setAttribute("wrap","off");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");
|
3
|
+
b.inputDiv=n("div",[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");b.scrollbarH=n("div",[n("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");b.scrollbarV=n("div",[n("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");b.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler");b.lineDiv=n("div");b.selectionDiv=n("div",null,null,"position: relative; z-index: 1");b.cursor=n("div"," ","CodeMirror-cursor");b.otherCursor=n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor");
|
4
|
+
b.measure=n("div",null,"CodeMirror-measure");b.lineSpace=n("div",[b.measure,b.selectionDiv,b.lineDiv,b.cursor,b.otherCursor],null,"position: relative; outline: none");b.mover=n("div",[n("div",[b.lineSpace],"CodeMirror-lines")],null,"position: relative");b.sizer=n("div",[b.mover],"CodeMirror-sizer");b.heightForcer=n("div"," ",null,"position: absolute; height: "+qa+"px");b.gutters=n("div",null,"CodeMirror-gutters");b.lineGutter=null;var d=n("div",[b.sizer,b.heightForcer,b.gutters],null,"position: relative; min-height: 100%");
|
5
|
+
b.scroller=n("div",[d],"CodeMirror-scroll");b.scroller.setAttribute("tabIndex","-1");b.wrapper=n("div",[b.inputDiv,b.scrollbarH,b.scrollbarV,b.scrollbarFiller,b.scroller],"CodeMirror");ea&&(b.gutters.style.zIndex=-1,b.scroller.style.paddingRight=0);a.appendChild?a.appendChild(b.wrapper):a(b.wrapper);La&&(c.style.width="0px");N||(b.scroller.draggable=!0);wb?(b.inputDiv.style.height="1px",b.inputDiv.style.position="absolute"):ea&&(b.scrollbarH.style.minWidth=b.scrollbarV.style.minWidth="18px");b.viewOffset=
|
6
|
+
b.showingFrom=b.showingTo=b.lastSizeC=0;b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null;b.prevInput="";b.alignWidgets=!1;b.pollingFast=!1;b.poll=new xb;b.draggingText=!1;b.cachedCharWidth=b.cachedTextHeight=null;b.measureLineCache=[];b.measureLineCachePos=0;b.inaccurateSelection=!1;b.pasteIncoming=!1;b.wheelDX=b.wheelDY=b.wheelStartX=b.wheelStartY=null;return b}function Yc(a){var b={line:0,ch:0};return{doc:a,frontier:0,highlight:new xb,sel:{from:b,to:b,head:b,anchor:b,shift:!1,extend:!1},scrollTop:0,
|
7
|
+
scrollLeft:0,overwrite:!1,focused:!1,maxLine:o(a,0),maxLineLength:0,maxLineChanged:!1,suppressEdits:!1,goalColumn:null,cantEdit:!1,keyMaps:[],overlays:[],modeGen:0}}function Ka(a){var b=a.view.doc;a.view.mode=l.getMode(a.options,a.options.mode);b.iter(0,b.size,function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.view.frontier=0;Ma(a,100);a.view.modeGen++;a.curOp&&F(a,0,b.size)}function Wb(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+
|
8
|
+
a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ra(a)}function sa(a){Ub(a);O(a,!0)}function Ub(a){var b=a.display.gutters,c=a.options.gutters;Na(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(n("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function Oa(a,b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ta(e);)d=d.find(),e=o(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=
|
9
|
+
b;d=Pa(e);)d=d.find(),c-=e.text.length-d.from.ch,e=o(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Yb(a){a.maxLine=o(a.doc,0);a.maxLineLength=Oa(a.doc,a.maxLine);a.maxLineChanged=!0;a.doc.iter(1,a.doc.size,function(b){var c=Oa(a.doc,b);c>a.maxLineLength&&(a.maxLineLength=c,a.maxLine=b)})}function sb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function Zb(a,
|
10
|
+
b){var c=b+2*a.lineSpace.offsetTop;a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var c=Math.max(c,a.scroller.scrollHeight),d=a.scroller.scrollWidth>a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?Qa(a.measure)+"px":"0",a.scrollbarV.firstChild.style.height=c-a.scroller.clientHeight+a.scrollbarV.clientHeight+"px"):a.scrollbarV.style.display="";d?(a.scrollbarH.style.display="block",a.scrollbarH.style.right=e?Qa(a.measure)+
|
11
|
+
"px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="";d&&e?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=Qa(a.measure)+"px"):a.scrollbarFiller.style.display="";$c&&0===Qa(a.measure)&&(a.scrollbarV.style.minWidth=a.scrollbarH.style.minHeight=ad?"18px":"12px")}function yb(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?
|
12
|
+
d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:Ra(b,d),to:Ra(b,a)}}function bd(a){if(!a.options.lineNumbers)return!1;var b=""+a.options.lineNumberFormatter(a.view.doc.size-1+a.options.firstLineNumber),a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(n("div",[n("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-
|
13
|
+
c);a.lineNumWidth=a.lineNumInnerWidth+c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function zb(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function O(a,b,c){var d=a.display.showingFrom,e=a.display.showingTo;if(b=$b(a,b,c))fa(a,a,"update",a),(a.display.showingFrom!=d||a.display.showingTo!=e)&&fa(a,a,"viewportChange",a,a.display.showingFrom,a.display.showingTo);Ab(a);Zb(a.display,a.view.doc.height);
|
14
|
+
return b}function $b(a,b,c){var d=a.display,e=a.view.doc;if(d.wrapper.clientWidth){var f=yb(d,e,c);if(!(!0!==b&&0==b.length&&f.from>d.showingFrom&&f.to<d.showingTo)){b&&bd(a)&&(b=!0);var g=d.sizer.style.marginLeft=d.gutters.offsetWidth+"px";d.scrollbarH.style.left=a.options.fixedGutter?g:"0";if(!0!==b&&ua)for(var h=0;h<b.length;++h)for(var m=b[h];g=ta(o(e,m.from));)g=g.find().from.line,m.diff&&(m.diff-=m.from-g),m.from=g;m=!0===b?0:Infinity;if(a.options.lineNumbers&&b&&!0!==b)for(h=0;h<b.length;++h)if(b[h].diff){m=
|
15
|
+
b[h].from;break}g=Math.max(f.from-a.options.viewportMargin,0);f=Math.min(e.size,f.to+a.options.viewportMargin);d.showingFrom<g&&20>g-d.showingFrom&&(g=d.showingFrom);d.showingTo>f&&20>d.showingTo-f&&(f=Math.min(e.size,d.showingTo));if(ua)for(g=G(ga(e,o(e,g)));f<e.size&&U(o(e,f));)++f;for(var b=!0===b?[]:cd([{from:d.showingFrom,to:d.showingTo}],b),j=0,h=0;h<b.length;++h){var i=b[h];i.from<g&&(i.from=g);i.to>f&&(i.to=f);i.from>=i.to?b.splice(h--,1):j+=i.to-i.from}if(!(j==f-g&&g==d.showingFrom&&f==d.showingTo)){b.sort(function(a,
|
16
|
+
b){return a.from-b.from});h=document.activeElement;j<0.7*(f-g)&&(d.lineDiv.style.display="none");dd(a,g,f,b,m);d.lineDiv.style.display="";document.activeElement!=h&&h.offsetHeight&&h.focus();if(g!=d.showingFrom||f!=d.showingTo||d.lastSizeC!=d.wrapper.clientHeight)d.lastSizeC=d.wrapper.clientHeight;d.showingFrom=g;d.showingTo=f;Ma(a,100);m=d.lineDiv.offsetTop;for(b=d.lineDiv.firstChild;b;b=b.nextSibling)if(b.lineObj&&(ea?(j=b.offsetTop+b.offsetHeight,h=j-m,m=j):(h=b.getBoundingClientRect(),h=h.bottom-
|
17
|
+
h.top),j=b.lineObj.height-h,2>h&&(h=Z(d)),0.001<j||-0.001>j))if(I(b.lineObj,h),j=b.lineObj.widgets)for(h=0;h<j.length;++h)j[h].height=j[h].node.offsetHeight;d.viewOffset=ha(a,o(e,g));d.mover.style.top=d.viewOffset+"px";yb(d,e,c).to>=f&&$b(a,[],c);return!0}}}else d.showingFrom=d.showingTo=d.viewOffset=0}function cd(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,m=a.length;h<m;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?
|
18
|
+
f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function ed(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:zb(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function dd(a,b,c,d,e){function f(b){var c=b.nextSibling;N&&ia&&a.display.currentWheelTarget==
|
19
|
+
b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=ed(a),h=a.display,m=a.options.lineNumbers;!d.length&&(!N||!a.display.currentWheelTarget)&&Na(h.lineDiv);var j=h.lineDiv,i=j.firstChild,k=d.shift(),r=b;for(a.view.doc.iter(b,c,function(b){k&&k.to==r&&(k=d.shift());if(U(b)){if(0!=b.height&&I(b,0),b.widgets&&i.previousSibling)for(var c=0;c<b.widgets.length;++c)if(b.widgets[c].showIfHidden){var h=i.previousSibling;if("pre"==h.nodeType){var A=n("div",null,null,"position: relative");
|
20
|
+
h.parentNode.replaceChild(A,h);A.appendChild(h);h=A}h.appendChild(ac(b.widgets[c],h,g))}}else if(k&&k.from<=r&&k.to>r){for(;i.lineObj!=b;)i=f(i);m&&(e<=r&&i.lineNumber)&&bc(i.lineNumber,""+a.options.lineNumberFormatter(r+a.options.firstLineNumber));i=i.nextSibling}else{var c=a,v=r,h=cc(c,b),l=b.gutterMarkers,o=c.display;if(!c.options.lineNumbers&&!l&&!b.bgClass&&!b.wrapClass&&(!b.widgets||!b.widgets.length))c=h;else{A=n("div",null,b.wrapClass,"position: relative");if(c.options.lineNumbers||l){var Sa=
|
21
|
+
A.appendChild(n("div",null,null,"position: absolute; left: "+(c.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"));c.options.fixedGutter&&(A.alignable=[Sa]);if(c.options.lineNumbers&&(!l||!l["CodeMirror-linenumbers"]))A.lineNumber=Sa.appendChild(n("div",""+c.options.lineNumberFormatter(v+c.options.firstLineNumber),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+o.lineNumInnerWidth+"px"));if(l)for(v=0;v<c.options.gutters.length;++v){var o=
|
22
|
+
c.options.gutters[v],q=l.hasOwnProperty(o)&&l[o];q&&Sa.appendChild(n("div",[q],"CodeMirror-gutter-elt","left: "+g.gutterLeft[o]+"px; width: "+g.gutterWidth[o]+"px"))}}b.bgClass&&A.appendChild(n("div"," ",b.bgClass+" CodeMirror-linebackground"));A.appendChild(h);if(b.widgets){l=0;for(v=b.widgets;l<v.length;++l)o=v[l],q=ac(o,A,g),o.above?A.insertBefore(q,c.options.lineNumbers&&0!=b.height?Sa:h):A.appendChild(q)}ea&&(A.style.zIndex=2);c=A}j.insertBefore(c,i);c.lineObj=b}++r});i;)i=f(i)}function ac(a,
|
23
|
+
b,c){var d=n("div",[a.node],"CodeMirror-linewidget");d.widget=a;a.noHScroll&&((b.alignable||(b.alignable=[])).push(d),b=c.wrapperWidth,d.style.left=c.fixedPos+"px",a.coverGutter||(b-=c.gutterTotalWidth,d.style.paddingLeft=c.gutterTotalWidth+"px"),d.style.width=b+"px");a.coverGutter&&(d.style.zIndex=5,d.style.position="relative",a.noHScroll||(d.style.marginLeft=-c.gutterTotalWidth+"px"));return d}function Ab(a){var b=a.display,c=u(a.view.sel.from,a.view.sel.to);if(c||a.options.showCursorWhenSelecting){var d=
|
24
|
+
a.display,e=V(a,a.view.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=e.other.top+"px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display=
|
25
|
+
"none":fd(a);a=V(a,a.view.sel.head,"div");c=b.wrapper.getBoundingClientRect();d=b.lineDiv.getBoundingClientRect();b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px";b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px"}function fd(a){function b(a,b,c,d){0>b&&(b=0);g.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,
|
26
|
+
d,f,g){var j=o(e,c),i=j.text.length,k=g?Infinity:-Infinity;gd(P(j),d||0,null==f?i:f,function(e,r,l){var o=Ta(a,{line:c,ch:"rtl"==l?r-1:e},"div",j),l=Ta(a,{line:c,ch:"rtl"==l?e:r-1},"div",j),n=o.left,q=l.right;3<l.top-o.top&&(b(n,o.top,null,o.bottom),n=m,o.bottom<l.top&&b(n,o.bottom,null,l.top));null==f&&r==i&&(q=h);null==d&&0==e&&(n=m);k=g?Math.min(l.top,k):Math.max(l.bottom,k);n<m+1&&(n=m);b(n,l.top,q-n,l.bottom)});return k}var d=a.display,e=a.view.doc,f=a.view.sel,g=document.createDocumentFragment(),
|
27
|
+
h=d.lineSpace.offsetWidth,m=ec(a.display);if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{for(var j=o(e,f.from.line),i=j,k=[f.from.line,f.from.ch],r;i=Pa(i);){i=i.find();k.push(i.from.ch,i.to.line,i.to.ch);if(i.to.line==f.to.line){k.push(f.to.ch);r=!0;break}i=o(e,i.to.line)}if(r)for(f=0;f<k.length;f+=3)c(k[f],k[f+1],k[f+2]);else k=o(e,f.to.line),j=f.from.ch?c(f.from.line,f.from.ch,null,!1):ha(a,j)-d.viewOffset,f=f.to.ch?c(f.to.line,ta(k)?null:0,f.to.ch,!0):ha(a,k)-d.viewOffset,j<f&&
|
28
|
+
b(m,j,null,f)}W(d.selectionDiv,g);d.selectionDiv.style.display=""}function Ua(a){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";b.blinker=setInterval(function(){b.cursor.offsetHeight&&(b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden")},a.options.cursorBlinkRate)}function Ma(a,b){a.view.mode.startState&&a.view.frontier<a.display.showingTo&&a.view.highlight.set(b,L(hd,a))}function hd(a){var b=a.view,c=b.doc;if(!(b.frontier>=
|
29
|
+
a.display.showingTo)){var d=+new Date+a.options.workTime,e=ja(b.mode,va(a,b.frontier)),f=[],g;c.iter(b.frontier,Math.min(c.size,a.display.showingTo+500),function(c){if(b.frontier>=a.display.showingFrom){var m=c.styles;c.styles=fc(a,c,e);for(var j=!m||m.length!=c.styles.length,i=0;!j&&i<m.length;++i)j=m[i]!=c.styles[i];j&&(g&&g.end==b.frontier?g.end++:f.push(g={start:b.frontier,end:b.frontier+1}));c.stateAfter=ja(b.mode,e)}else gc(a,c,e),c.stateAfter=0==b.frontier%5?ja(b.mode,e):null;++b.frontier;
|
30
|
+
if(+new Date>d)return Ma(a,a.options.workDelay),!0});f.length&&q(a,function(){for(var a=0;a<f.length;++a)F(this,f[a].start,f[a].end)})()}}function id(a,b){for(var c,d,e=a.view.doc,f=b,g=b-100;f>g;--f){if(0==f)return 0;var h=o(e,f-1);if(h.stateAfter)return f;h=ka(h.text,null,a.options.tabSize);if(null==d||c>h)d=f-1,c=h}return d}function va(a,b){var c=a.view;if(!c.mode.startState)return!0;var d=id(a,b),e=d&&o(c.doc,d-1).stateAfter,e=e?ja(c.mode,e):hc(c.mode);c.doc.iter(d,b,function(f){gc(a,f,e);f.stateAfter=
|
31
|
+
d==b-1||0==d%5||d>=c.showingFrom&&d<c.showingTo?ja(c.mode,e):null;++d});return e}function ec(a){return W(a.measure,n("pre")).appendChild(n("span","x")).offsetLeft}function Bb(a,b,c,d){for(var e=-1,d=d||Cb(a,b),a=c;;a+=e){var f=d[a];if(f)break;0>e&&0==a&&(e=1)}return{left:a<c?f.right:f.left,right:a>c?f.left:f.right,top:f.top,bottom:f.bottom}}function Cb(a,b){for(var c=a.display,d=a.display.measureLineCache,e=0;e<d.length;++e){var f=d[e];if(f.text==b.text&&f.markedSpans==b.markedSpans&&c.scroller.clientWidth==
|
32
|
+
f.width)return f.measure}var g=a.display,e=ic(b.text.length),h=cc(a,b,e);if(M&&!ea&&!a.options.lineWrapping&&100<h.childNodes.length){for(var m=document.createDocumentFragment(),j=h.childNodes.length,f=0,i=Math.ceil(j/10);f<i;++f){for(var k=n("div",null,null,"display: inline-block"),r=0;10>r&&j;++r)k.appendChild(h.firstChild),--j;m.appendChild(k)}h.appendChild(m)}W(g.measure,h);j=g.lineDiv.getBoundingClientRect();m=[];g=ic(b.text.length);h=h.offsetHeight;for(f=0;f<e.length;++f)if(r=e[f]){for(var i=
|
33
|
+
r.getBoundingClientRect(),k=Math.max(0,i.top-j.top),p=Math.min(i.bottom-j.top,h),r=0;r<m.length;r+=2){var l=m[r],o=m[r+1];if(!(l>p||o<k))if(l<=k&&o>=p||k<=l&&p>=o||Math.min(p,o)-Math.max(k,l)>=p-k>>1){m[r]=Math.min(k,l);m[r+1]=Math.max(p,o);break}}r==m.length&&m.push(k,p);g[f]={left:i.left-j.left,right:i.right-j.left,top:r}}for(f=0;f<g.length;++f)if(r=g[f])e=r.top,r.top=m[e],r.bottom=m[e+1];f={text:b.text,width:c.scroller.clientWidth,markedSpans:b.markedSpans,measure:g};16==d.length?d[++c.measureLineCachePos%
|
34
|
+
16]=f:d.push(f);return g}function ra(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.view.maxLineChanged=!0}function jc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Va(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ha(a,b);"local"!=d&&(b-=a.display.viewOffset);"page"==d&&(a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+(window.pageYOffset||(document.documentElement||
|
35
|
+
document.body).scrollTop),a=a.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=a,c.right+=a);c.top+=b;c.bottom+=b;return c}function Ta(a,b,c,d){d||(d=o(a.view.doc,b.line));return jc(a,d,Bb(a,d,b.ch),c)}function V(a,b,c,d,e){function f(b,f){var g=Bb(a,d,b,e);f?g.left=g.right:g.right=g.left;return jc(a,d,g,c)}d=d||o(a.view.doc,b.line);e||(e=Cb(a,d));var g=P(d),b=b.ch;if(!g)return f(b);for(var h,m,j=g[0].level,i=0;i<g.length;++i){var k=g[i],r=k.level%2,p;if(k.from<
|
36
|
+
b&&k.to>b)return f(b,r);var l=r?k.from:k.to;if((r?k.to:k.from)==b)k=i&&k.level<(p=g[i-1]).level?f(p.level%2?p.from:p.to-1,!0):f(r&&k.from!=k.to?b-1:b),r==j?h=k:m=k;else if(l==b&&(p=i<g.length-1&&g[i+1],r||!(p&&p.from==p.to)))k=p&&k.level<p.level?f(p.level%2?p.to-1:p.from):f(r?b:b-1,!0),r==j?h=k:m=k}j&&!b&&(m=f(g[0].to-1));if(!h)return m;m&&(h.other=m);return h}function Db(a,b,c){var d=a.view.doc,c=c+a.display.viewOffset;if(0>c)return{line:0,ch:0,outside:!0};var e=Ra(d,c);if(e>=d.size)return{line:d.size-
|
37
|
+
1,ch:o(d,d.size-1).text.length};for(0>b&&(b=0);;){var f=o(d,e),e=jd(a,f,e,b,c),g=(f=Pa(f))&&f.find();if(f&&e.ch>=g.from.ch)e=g.to.line;else return e}}function jd(a,b,c,d,e){function f(d){d=V(a,{line:c,ch:d},"line",b,j);h=!0;if(g>d.bottom)return Math.max(0,d.left-m);if(g<d.top)return d.left+m;h=!1;return d.left}var g=e-ha(a,b),h=!1,m=a.display.wrapper.clientWidth,j=Cb(a,b),i=P(b),k=b.text.length,e=Wa(b),r=Xa(b),p=ec(a.display),l=f(r);if(d>l)return{line:c,ch:r,outside:h};for(;;){if(i?r==e||r==Eb(b,
|
38
|
+
e,1):1>=r-e){for(e=(d=d-p<l-d)?e:r;Fb.test(b.text.charAt(e));)++e;return{line:c,ch:e,after:d,outside:h}}var o=Math.ceil(k/2),n=e+o;if(i)for(var n=e,q=0;q<o;++q)n=Eb(b,n,1);q=f(n);q>d?(r=n,l=q,h&&(l+=1E3),k-=o):(e=n,p=q,k=o)}}function Z(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==aa){aa=n("pre");for(var b=0;49>b;++b)aa.appendChild(document.createTextNode("x")),aa.appendChild(n("br"));aa.appendChild(document.createTextNode("x"))}W(a.measure,aa);b=aa.offsetHeight/50;3<b&&(a.cachedTextHeight=
|
39
|
+
b);Na(a.measure);return b||1}function kc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=n("span","x"),c=n("pre",[b]);W(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function Ya(a){a.curOp?++a.curOp.depth:a.curOp={depth:1,changes:[],delayedCallbacks:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,id:++a.nextOpId}}function Za(a){var b=a.curOp;if(!--b.depth){a.curOp=null;var c=a.view,d=a.display;b.updateMaxLine&&Yb(c);
|
40
|
+
if(c.maxLineChanged&&!a.options.lineWrapping){var e=Bb(a,c.maxLine,c.maxLine.text.length).right;d.sizer.style.minWidth=e+3+qa+"px";c.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&la(a,Math.min(d.scroller.scrollLeft,e),!0)}var f,g;b.selectionChanged&&(d=V(a,c.sel.head),f=Gb(a,d.left,d.top,d.left,d.bottom));if(b.changes.length||f&&null!=f.scrollTop)g=O(a,b.changes,f&&f.scrollTop);!g&&b.selectionChanged&&Ab(a);if(f&&(d=a.view,g=lc(a,d.sel.head),
|
41
|
+
d.focused)){d=a.display;e=d.sizer.getBoundingClientRect();f=null;if(0>g.top+e.top)f=!0;else if(g.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight))f=!1;if(null!=f&&!kd){if(e="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=g.left+"px",d.cursor.style.top=g.top-d.viewOffset+"px";d.cursor.scrollIntoView(f);e&&(d.cursor.style.display="none")}}b.selectionChanged&&Ua(a);c.focused&&b.updateInput&&ca(a,b.userSelChange);b.textChanged&&ma(a,"change",a,b.textChanged);
|
42
|
+
b.selectionChanged&&ma(a,"cursorActivity",a);for(c=0;c<b.delayedCallbacks.length;++c)b.delayedCallbacks[c](a)}}function q(a,b){return function(){var c=a||this;Ya(c);try{var d=b.apply(c,arguments)}finally{Za(c)}return d}}function F(a,b,c,d){a.curOp.changes.push({from:b,to:c,diff:d})}function $a(a){a.view.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Hb(a);a.view.focused&&$a(a)})}function wa(a){function b(){!Hb(a)&&!c?(c=!0,a.display.poll.set(60,b)):(a.display.pollingFast=!1,$a(a))}
|
43
|
+
var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Hb(a){var b=a.display.input,c=a.display.prevInput,d=a.view,e=d.sel;if(!d.focused||ld(b)||xa(a))return!1;var f=b.value;if(f==c&&u(e.from,e.to))return!1;Ya(a);d.sel.shift=!1;for(var g=0,h=Math.min(c.length,f.length);g<h&&c[g]==f[g];)++g;h=e.from;e=e.to;g<c.length?h={line:h.line,ch:h.ch-(c.length-g)}:d.overwrite&&(u(h,e)&&!a.display.pasteIncoming)&&(e={line:e.line,ch:Math.min(o(a.view.doc,e.line).text.length,e.ch+(f.length-g))});c=a.curOp.updateInput;
|
44
|
+
Ib(a,h,e,ya(f.slice(g)),"end",a.display.pasteIncoming?"paste":"input",{from:h,to:e});a.curOp.updateInput=c;1E3<f.length?b.value=a.display.prevInput="":a.display.prevInput=f;Za(a);a.display.pasteIncoming=!1;return!0}function ca(a,b){var c=a.view,d,e;u(c.sel.from,c.sel.to)?b&&(a.display.prevInput=a.display.input.value=""):(a.display.prevInput="",d=mc&&(100<c.sel.to.line-c.sel.from.line||1E3<(e=a.getSelection()).length),a.display.input.value=d?"-":e||a.getSelection(),c.focused&&nc(a.display.input));
|
45
|
+
a.display.inaccurateSelection=d}function E(a){"nocursor"!=a.options.readOnly&&(M||document.activeElement!=a.display.input)&&a.display.input.focus()}function xa(a){return a.options.readOnly||a.view.cantEdit}function Zc(a){function b(){a.view.focused&&setTimeout(L(E,a),0)}function c(){f.cachedCharWidth=f.cachedTextHeight=null;ra(a);O(a,!0)}function d(b){(!a.options.onDragEvent||!a.options.onDragEvent(a,za(b)))&&ab(b)}function e(){f.inaccurateSelection&&(f.prevInput="",f.inaccurateSelection=!1,f.input.value=
|
46
|
+
a.getSelection(),nc(f.input))}var f=a.display;s(f.scroller,"mousedown",q(a,md));s(f.scroller,"dblclick",q(a,z));s(f.lineSpace,"selectstart",function(a){na(f,a)||z(a)});X||s(f.scroller,"contextmenu",function(b){oc(a,b)});s(f.scroller,"scroll",function(){Aa(a,f.scroller.scrollTop);la(a,f.scroller.scrollLeft,!0);ma(a,"scroll",a)});s(f.scrollbarV,"scroll",function(){Aa(a,f.scrollbarV.scrollTop)});s(f.scrollbarH,"scroll",function(){la(a,f.scrollbarH.scrollLeft)});s(f.scroller,"mousewheel",function(b){pc(a,
|
47
|
+
b)});s(f.scroller,"DOMMouseScroll",function(b){pc(a,b)});s(f.scrollbarH,"mousedown",b);s(f.scrollbarV,"mousedown",b);s(f.wrapper,"scroll",function(){f.wrapper.scrollTop=f.wrapper.scrollLeft=0});window.registered||(window.registered=0);++window.registered;s(window,"resize",c);setTimeout(function h(){for(var a=f.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);if(a)setTimeout(h,5E3);else{--window.registered;Q(window,"resize",c)}},5E3);s(f.input,"keyup",q(a,function(b){if((!a.options.onKeyEvent||
|
48
|
+
!a.options.onKeyEvent(a,za(b)))&&C(b,"keyCode")==16)a.view.sel.shift=false}));s(f.input,"input",L(wa,a));s(f.input,"keydown",q(a,qc));s(f.input,"keypress",q(a,nd));s(f.input,"focus",L($,a));s(f.input,"blur",L(ub,a));a.options.dragDrop&&(s(f.scroller,"dragstart",function(b){var c=a;if(!na(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",d);if(b.dataTransfer.setDragImage&&!Jb){d=n("img",null,null,"position: fixed; left: 0; top: 0;");if(R){d.width=d.height=1;c.display.wrapper.appendChild(d);
|
49
|
+
d._top=d.offsetTop}b.dataTransfer.setDragImage(d,0,0);R&&d.parentNode.removeChild(d)}}}),s(f.scroller,"dragenter",d),s(f.scroller,"dragover",d),s(f.scroller,"drop",q(a,od)));s(f.scroller,"paste",function(b){if(!na(f,b)){E(a);wa(a)}});s(f.input,"paste",function(){f.pasteIncoming=true;wa(a)});s(f.input,"cut",e);s(f.input,"copy",e);wb&&s(f.sizer,"mouseup",function(){document.activeElement==f.input&&f.input.blur();E(a)})}function na(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||
|
50
|
+
/\bCodeMirror-(?:line)?widget\b/.test(c.className)||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ba(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller))return null;var e,f,d=d.lineSpace.getBoundingClientRect();try{e=b.clientX,f=b.clientY}catch(g){return null}return Db(a,e-d.left,f-d.top)}function md(a){function b(a){if("single"==k)y(e,w(m,j),a);else if(l=w(m,l),n=w(m,n),"double"==
|
51
|
+
k){var b=rc(o(m,a.line).text,a);x(a,l)?y(e,b.from,n):y(e,l,b.to)}else"triple"==k&&(x(a,l)?y(e,n,w(m,{line:a.line,ch:0})):y(e,l,w(m,{line:a.line+1,ch:0})))}function c(a){var d=++v,h=Ba(e,a,!0);if(h)if(u(h,r)){var i=a.clientY<A.top?-20:a.clientY>A.bottom?20:0;i&&setTimeout(q(e,function(){v==d&&(f.scroller.scrollTop+=i,c(a))}),50)}else{g.focused||$(e);r=h;b(h);var j=yb(f,m);(h.line>=j.to||h.line<j.from)&&setTimeout(q(e,function(){v==d&&c(a)}),150)}}function d(a){v=Infinity;var c=Ba(e,a);c&&b(c);z(a);
|
52
|
+
E(e);Q(document,"mousemove",t);Q(document,"mouseup",dc)}var e=this,f=e.display,g=e.view,h=g.sel,m=g.doc;h.shift=C(a,"shiftKey");if(na(f,a))N||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!pd(e,a)){var j=Ba(e,a);switch(sc(a)){case 3:X&&oc.call(e,e,a);return;case 2:j&&y(e,j);setTimeout(L(E,e),20);z(a);return}if(j){g.focused||$(e);var i=+new Date,k="single";bb&&bb.time>i-400&&u(bb.pos,j)?(k="triple",z(a),setTimeout(L(E,e),20),qd(e,j.line)):cb&&cb.time>i-400&&
|
53
|
+
u(cb.pos,j)?(k="double",bb={time:i,pos:j},z(a),i=rc(o(m,j.line).text,j),y(e,i.from,i.to)):cb={time:i,pos:j};var r=j;if(e.options.dragDrop&&rd&&!xa(e)&&!u(h.from,h.to)&&!x(j,h.from)&&!x(h.to,j)&&"single"==k){var p=q(e,function(b){if(N)f.scroller.draggable=false;g.draggingText=false;Q(document,"mouseup",p);Q(f.scroller,"drop",p);if(Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10){z(b);y(e,j);E(e)}});N&&(f.scroller.draggable=!0);g.draggingText=p;f.scroller.dragDrop&&f.scroller.dragDrop();
|
54
|
+
s(document,"mouseup",p);s(f.scroller,"drop",p)}else{z(a);"single"==k&&y(e,w(m,j));var l=h.from,n=h.to,A=f.wrapper.getBoundingClientRect(),v=0,t=q(e,function(a){!M&&!sc(a)?d(a):c(a)}),dc=q(e,d);s(document,"mousemove",t);s(document,"mouseup",dc)}}else(a.target||a.srcElement)==f.scroller&&z(a)}}function od(a){var b=this;if(!(na(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,za(a)))){z(a);var c=Ba(b,a,!0),d=a.dataTransfer.files;if(c&&!xa(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=
|
55
|
+
d.length,f=Array(e),g=0,a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=w(b.view.doc,c),q(b,function(){var a=Y(b,f.join(""),c,c,"paste");S(b,c,a)})())};h.readAsText(a)},h=0;h<e;++h)a(d[h],h);else if(b.view.draggingText&&!x(c,b.view.sel.from)&&!x(b.view.sel.to,c))b.view.draggingText(a),setTimeout(L(E,b),20);else try{if(f=a.dataTransfer.getData("Text")){var h=b.view.sel.from,m=b.view.sel.to;S(b,c,c);b.view.draggingText&&Y(b,"",h,m,"paste");b.replaceSelection(f,null,
|
56
|
+
"paste");E(b);$(b)}}catch(j){}}}function pd(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(c.gutters.getBoundingClientRect().right))return!1;z(b);if(!tc(a,"gutterClick"))return!0;var g=c.lineDiv.getBoundingClientRect();if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=d){c=Ra(a.view.doc,e);fa(a,a,"gutterClick",a,c,a.options.gutters[g],b);break}}return!0}
|
57
|
+
function Aa(a,b){2>Math.abs(a.view.scrollTop-b)||(a.view.scrollTop=b,X||O(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),X&&O(a,[]))}function la(a,b,c){if(!(c?b==a.view.scrollLeft:2>Math.abs(a.view.scrollLeft-b))){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth);a.view.scrollLeft=b;c=a.display;if(c.alignWidgets||c.gutters.firstChild&&a.options.fixedGutter){for(var d=zb(c)-c.scroller.scrollLeft+
|
58
|
+
a.view.scrollLeft,e=c.gutters.offsetWidth,f=d+"px",g=c.lineDiv.firstChild;g;g=g.nextSibling)if(g.alignable)for(var h=0,m=g.alignable;h<m.length;++h)m[h].style.left=f;a.options.fixedGutter&&(c.gutters.style.left=d+e+"px")}a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b);a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b)}}function pc(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&(b.detail&&b.axis==b.HORIZONTAL_AXIS)&&(c=b.detail);null==d&&b.detail&&b.axis==
|
59
|
+
b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);if(d&&ia&&N)for(var e=b.target;e!=g;e=e.parentNode)if(e.lineObj){a.display.currentWheelTarget=e;break}var f=a.display,g=f.scroller;if(c&&!X&&!R&&null!=J)d&&Aa(a,Math.max(0,Math.min(g.scrollTop+d*J,g.scrollHeight-g.clientHeight))),la(a,Math.max(0,Math.min(g.scrollLeft+c*J,g.scrollWidth-g.clientWidth))),z(b),f.wheelStartX=null;else{if(d&&null!=J){var e=d*J,h=a.view.scrollTop,m=h+f.wrapper.clientHeight;0>e?h=Math.max(0,h+e-50):m=Math.min(a.view.doc.height,
|
60
|
+
m+e+50);O(a,[],{top:h,bottom:m})}20>db&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout(function(){if(f.wheelStartX!=null){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,a=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null;if(a){J=(J*db+a)/(db+1);++db}}},200)):(f.wheelDX+=c,f.wheelDY+=d))}}function eb(a,b,c){if("string"==typeof b&&(b=Kb[b],!b))return!1;a.display.pollingFast&&Hb(a)&&(a.display.pollingFast=
|
61
|
+
!1);var d=a.view,e=d.sel.shift;try{xa(a)&&(d.suppressEdits=!0),c&&(d.sel.shift=!1),b(a)}catch(f){if(f!=uc)throw f;return!1}finally{d.sel.shift=e,d.suppressEdits=!1}return!0}function vc(a){var b=a.view.keyMaps.slice(0);b.push(a.options.keyMap);a.options.extraKeys&&b.unshift(a.options.extraKeys);return b}function wc(a,b){function c(){h=!0}var d=Lb(a.options.keyMap),e=d.auto;clearTimeout(xc);e&&!yc(b)&&(xc=setTimeout(function(){Lb(a.options.keyMap)==d&&(a.options.keyMap=e.call?e.call(null,a):e)},50));
|
62
|
+
var f=ba[C(b,"keyCode")],g=!1;if(null==f||b.altGraphKey)return!1;C(b,"altKey")&&(f="Alt-"+f);if(C(b,zc?"metaKey":"ctrlKey"))f="Ctrl-"+f;if(C(b,zc?"ctrlKey":"metaKey"))f="Cmd-"+f;var h=!1,g=vc(a),g=C(b,"shiftKey")?fb("Shift-"+f,g,function(b){return eb(a,b,!0)},c)||fb(f,g,function(b){if("string"==typeof b&&/^go[A-Z]/.test(b))return eb(a,b)},c):fb(f,g,function(b){return eb(a,b)},c);h&&(g=!1);g&&(z(b),Ua(a),gb&&(b.oldKeyCode=b.keyCode,b.keyCode=0));return g}function sd(a,b,c){if(c=fb("'"+c+"'",vc(a),
|
63
|
+
function(b){return eb(a,b,!0)}))z(b),Ua(a);return c}function qc(a){this.view.focused||$(this);M&&27==a.keyCode&&(a.returnValue=!1);if(!this.options.onKeyEvent||!this.options.onKeyEvent(this,za(a))){var b=C(a,"keyCode");this.view.sel.shift=16==b||C(a,"shiftKey");var c=wc(this,a);R&&(Mb=c?b:null,!c&&(88==b&&!mc&&C(a,ia?"metaKey":"ctrlKey"))&&this.replaceSelection(""))}}function nd(a){var b=this;if(!b.options.onKeyEvent||!b.options.onKeyEvent(b,za(a))){var c=C(a,"keyCode"),d=C(a,"charCode");if(R&&c==
|
64
|
+
Mb)Mb=null,z(a);else if(!(R&&(!a.which||10>a.which)||wb)||!wc(b,a))c=String.fromCharCode(null==d?c:d),this.options.electricChars&&(this.view.mode.electricChars&&this.options.smartIndent&&!xa(this)&&-1<this.view.mode.electricChars.indexOf(c))&&setTimeout(q(b,function(){hb(b,b.view.sel.to.line,"smart")}),75),sd(b,a,c)||wa(b)}}function $(a){"nocursor"!=a.options.readOnly&&(a.view.focused||(ma(a,"focus",a),a.view.focused=!0,-1==a.display.scroller.className.search(/\bCodeMirror-focused\b/)&&(a.display.scroller.className+=
|
65
|
+
" CodeMirror-focused"),ca(a,!0)),$a(a),Ua(a))}function ub(a){a.view.focused&&(ma(a,"blur",a),a.view.focused=!1,a.display.scroller.className=a.display.scroller.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){if(!a.view.focused)a.view.sel.shift=false},150)}function oc(a,b){function c(){d.inputDiv.style.position="relative";d.input.style.cssText=h;gb&&(d.scrollbarV.scrollTop=d.scroller.scrollTop=g);$a(a);if(null!=d.input.selectionStart){clearTimeout(Nb);
|
66
|
+
var b=d.input.value=" "+(u(e.from,e.to)?"":d.input.value),c=0;d.prevInput=" ";d.input.selectionStart=1;d.input.selectionEnd=b.length;Nb=setTimeout(function k(){d.prevInput==" "&&d.input.selectionStart==0?q(a,Kb.selectAll)(a):c++<10?Nb=setTimeout(k,500):ca(a)},200)}}var d=a.display;if(!na(d,b)){var e=a.view.sel,f=Ba(a,b),g=d.scroller.scrollTop;if(f&&!R){(u(e.from,e.to)||x(f,e.from)||!x(f,e.to))&&q(a,S)(a,f,f);var h=d.input.style.cssText;d.inputDiv.style.position="absolute";d.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+
|
67
|
+
(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";E(a);ca(a,!0);u(e.from,e.to)&&(d.input.value=d.prevInput=" ");X?(ab(b),s(window,"mouseup",function j(){Q(window,"mouseup",j);setTimeout(c,20)})):setTimeout(c,50)}}}function Ib(a,b,c,d,e,f){var g=Ac&&td(a.view.doc,b,c);if(g){for(b=g.length-1;1<=b;--b)ib(a,g[b].from,g[b].to,[""],f);if(g.length)return ib(a,g[0].from,g[0].to,
|
68
|
+
d,e,f)}else return ib(a,b,c,d,e,f)}function ib(a,b,c,d,e,f){if(!a.view.suppressEdits){var g=a.view,h=[];g.doc.iter(b.line,c.line+1,function(a){h.push(Ca(a.text,a.markedSpans))});var m=g.sel.from,j=g.sel.to,i=ud(H(h[0]),H(K(h)),b.ch,c.ch,d),c=Bc(a,b,c,i,e,f);g.history&&vd(a,b.line,d.length,h,f,m,j,g.sel.from,g.sel.to);return c}}function Cc(a,b){var c=a.view.doc,d=a.view.history,e=("undo"==b?d.done:d.undone).pop();if(e){for(var f={events:[],fromBefore:e.fromAfter,toBefore:e.toAfter,fromAfter:e.fromBefore,
|
69
|
+
toAfter:e.toBefore},g=e.events.length-1;0<=g;g-=1){d.dirtyCounter+="undo"==b?-1:1;var h=e.events[g],m=[],j=h.start+h.added;c.iter(h.start,j,function(a){m.push(Ca(a.text,a.markedSpans))});f.events.push({start:h.start,added:h.old.length,old:m});var i=g?null:{from:e.fromBefore,to:e.toBefore};Bc(a,{line:h.start,ch:0},{line:j-1,ch:o(c,j-1).text.length},h.old,i,b)}("undo"==b?d.undone:d.done).push(f)}}function Bc(a,b,c,d,e,f){var g=a.view,h=g.doc,m=a.display;if(!g.suppressEdits){var j=c.line-b.line,i=o(h,
|
70
|
+
b.line),k=o(h,c.line),r=!1,p=b.line;a.options.lineWrapping||(p=G(ga(h,i)),h.iter(p,c.line+1,function(a){if(a==g.maxLine)return r=!0}));var l=K(d),n=Z(m);if(0==b.ch&&0==c.ch&&""==D(l)){for(var q=[],v=0,s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));oa(a,k,k.text,H(l));j&&h.remove(b.line,j,a);q.length&&h.insert(b.line,q)}else if(i==k)if(1==d.length)oa(a,i,i.text.slice(0,b.ch)+D(d[0])+i.text.slice(c.ch),H(d[0]));else{q=[];v=1;for(s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));q.push(pa(D(l)+
|
71
|
+
i.text.slice(c.ch),H(l),n));oa(a,i,i.text.slice(0,b.ch)+D(d[0]),H(d[0]));h.insert(b.line+1,q)}else if(1==d.length)oa(a,i,i.text.slice(0,b.ch)+D(d[0])+k.text.slice(c.ch),H(d[0])),h.remove(b.line+1,j,a);else{q=[];oa(a,i,i.text.slice(0,b.ch)+D(d[0]),H(d[0]));oa(a,k,D(l)+k.text.slice(c.ch),H(l));v=1;for(s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));1<j&&h.remove(b.line+1,j-1,a);h.insert(b.line+1,q)}if(a.options.lineWrapping){var t=Math.max(5,m.scroller.clientWidth/kc(m)-3);h.iter(b.line,b.line+d.length,
|
72
|
+
function(a){if(a.height!=0){var b=(Math.ceil(a.text.length/t)||1)*n;b!=a.height&&I(a,b)}})}else h.iter(p,b.line+d.length,function(a){var b=Oa(h,a);if(b>g.maxLineLength){g.maxLine=a;g.maxLineLength=b;g.maxLineChanged=true;r=false}}),r&&(a.curOp.updateMaxLine=!0);g.frontier=Math.min(g.frontier,b.line);Ma(a,400);var w=d.length-j-1;F(a,b.line,c.line+1,w);if(tc(a,"change")){for(v=0;v<d.length;++v)"string"!=typeof d[v]&&(d[v]=d[v].text);f={from:b,to:c,text:d,origin:f};if(a.curOp.textChanged){for(m=a.curOp.textChanged;m.next;m=
|
73
|
+
m.next);m.next=f}else a.curOp.textChanged=f}var u={line:b.line+d.length-1,ch:D(l).length+(1==d.length?b.ch:0)};e&&"string"!=typeof e?e.from?(d=e.from,e=e.to):d=e:"end"==e?d=e=u:"start"==e?d=e=b:"around"==e?(d=b,e=u):(e=function(a){if(x(a,b))return a;if(!x(c,a))return u;var d=a.line+w,e=a.ch;a.line==c.line&&(e=e+(D(l).length-(c.ch-(c.line==b.line?b.ch:0))));return{line:d,ch:e}},d=e(g.sel.from),e=e(g.sel.to));S(a,d,e,null,!0);return u}}function Y(a,b,c,d,e){d||(d=c);if(x(d,c))var f=d,d=c,c=f;return Ib(a,
|
74
|
+
c,d,ya(b),null,e)}function u(a,b){return a.line==b.line&&a.ch==b.ch}function x(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function w(a,b){if(0>b.line)return{line:0,ch:0};if(b.line>=a.size)return{line:a.size-1,ch:o(a,a.size-1).text.length};var c=b.ch,d=o(a,b.line).text.length;return null==c||c>d?{line:b.line,ch:d}:0>c?{line:b.line,ch:0}:b}function y(a,b,c,d){var e=a.view.sel;if(e.shift||e.extend){e=e.anchor;if(c){var f=x(b,e);f!=x(c,e)?(e=b,b=c):f!=x(b,c)&&(b=c)}S(a,e,b,d)}else S(a,b,c||
|
75
|
+
b,d);a.curOp.userSelChange=!0}function S(a,b,c,d,e){a.view.goalColumn=null;var f=a.view.sel;if(e||!u(b,f.anchor))b=jb(a,b,d,"push"!=e);if(e||!u(c,f.head))c=jb(a,c,d,"push"!=e);if(!u(f.anchor,b)||!u(f.head,c))f.anchor=b,f.head=c,d=x(c,b),f.from=d?c:b,f.to=d?b:c,a.curOp.updateInput=!0,a.curOp.selectionChanged=!0}function Dc(a){S(a,a.view.sel.from,a.view.sel.to,null,"push")}function jb(a,b,c,d){var e=a.view.doc,f=!1,g=b,h=c||1;a.view.cantEdit=!1;a:for(;;){var m=o(e,g.line),j;if(m.markedSpans){for(var i=
|
76
|
+
0;i<m.markedSpans.length;++i){var k=m.markedSpans[i],r=k.marker;if((null==k.from||(r.inclusiveLeft?k.from<=g.ch:k.from<g.ch))&&(null==k.to||(r.inclusiveRight?k.to>=g.ch:k.to>g.ch)))if(d&&r.clearOnEnter)(j||(j=[])).push(r);else if(r.atomic){i=r.find()[0>h?"from":"to"];if(u(i,g)&&(i.ch+=h,0>i.ch?i=i.line?w(e,{line:i.line-1}):null:i.ch>m.text.length&&(i=i.line<e.size-1?{line:i.line+1,ch:0}:null),!i)){if(f){if(!d)return jb(a,b,c,!0);a.view.cantEdit=!0;return{line:0,ch:0}}f=!0;i=b;h=-h}g=i;continue a}}if(j)for(i=
|
77
|
+
0;i<j.length;++i)j[i].clear()}return g}}function lc(a,b){for(;;){var c=!1,d=V(a,b),e=Gb(a,d.left,d.top,d.left,d.bottom),f=a.view.scrollTop,g=a.view.scrollLeft;null!=e.scrollTop&&(Aa(a,e.scrollTop),1<Math.abs(a.view.scrollTop-f)&&(c=!0));null!=e.scrollLeft&&(la(a,e.scrollLeft),1<Math.abs(a.view.scrollLeft-g)&&(c=!0));if(!c)return d}}function Ec(a,b,c,d,e){b=Gb(a,b,c,d,e);null!=b.scrollTop&&Aa(a,b.scrollTop);null!=b.scrollLeft&&la(a,b.scrollLeft)}function Gb(a,b,c,d,e){var f=a.display,g=f.lineSpace.offsetTop,
|
78
|
+
c=c+g,e=e+g,h=f.scroller.clientHeight-qa,m=f.scroller.scrollTop,j={},a=a.view.doc.height+2*g,i=c<g+10,g=e+g>a-10;c<m?j.scrollTop=i?0:Math.max(0,c):e>m+h&&(j.scrollTop=(g?a:e)-h);c=f.scroller.clientWidth-qa;e=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;h=b<f+10;b<e+f||h?(h&&(b=0),j.scrollLeft=Math.max(0,b-10-f)):d>c+e-3&&(j.scrollLeft=d+10-c);return j}function hb(a,b,c,d){var e=a.view.doc;c||(c="add");if("smart"==c)if(a.view.mode.indent)var f=va(a,
|
79
|
+
b);else c="prev";var g=a.options.tabSize,h=o(e,b),m=ka(h.text,null,g),j=h.text.match(/^\s*/)[0],i;if("smart"==c&&(i=a.view.mode.indent(f,h.text.slice(j.length),h.text),i==uc)){if(!d)return;c="prev"}"prev"==c?i=b?ka(o(e,b-1).text,null,g):0:"add"==c?i=m+a.options.indentUnit:"subtract"==c&&(i=m-a.options.indentUnit);i=Math.max(0,i);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(i/g);e;--e)d+=g,c+="\t";d<i&&(c+=Fc(i-d));c!=j&&Y(a,c,{line:b,ch:0},{line:b,ch:j.length},"input");h.stateAfter=null}
|
80
|
+
function kb(a,b,c){var d=b,e=b,f=a.view.doc;"number"==typeof b?e=o(f,Math.max(0,Math.min(b,f.size-1))):d=G(b);if(null!=d&&c(e,d))F(a,d,d+1);else return null;return e}function Gc(a,b,c,d){function e(a){var c=(d?Eb:Hc)(j,m,b,!0);if(null==c){if(a=!a)a=h+b,0>a||a==f.size?a=!1:(h=a,a=j=o(f,a));if(a)m=d?(0>b?Xa:Wa)(j):0>b?j.text.length:0;else return!1}else m=c;return!0}var f=a.view.doc,g=a.view.sel.head,h=g.line,m=g.ch,j=o(f,h);if("char"==c)e();else if("column"==c)e(!0);else if("word"==c)for(c=!1;!(0>b)||
|
81
|
+
e();){if(lb(j.text.charAt(m)))c=!0;else if(c){0>b&&(b=1,e());break}if(0<b&&!e())break}return jb(a,{line:h,ch:m},b,!0)}function rc(a,b){var c=b.ch,d=b.ch;if(a){!1===b.after||d==a.length?--c:++d;for(var e=a.charAt(c),e=lb(e)?lb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!lb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:{line:b.line,ch:c},to:{line:b.line,ch:d}}}function qd(a,b){y(a,{line:b,ch:0},w(a.view.doc,{line:b+1,ch:0}))}function t(a,
|
82
|
+
b,c,d){l.defaults[a]=b;c&&(da[a]=d?function(a,b,d){d!=Xb&&c(a,b,d)}:c)}function ja(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function hc(a,b,c){return a.startState?a.startState(b,c):!0}function Lb(a){return"string"==typeof a?T[a]:a}function fb(a,b,c,d){function e(b){var b=Lb(b),f=b[a];if(!1===f)return d&&d(),!0;if(null!=f&&c(f))return!0;if(b.nofallthrough)return d&&d(),!0;b=b.fallthrough;if(null==
|
83
|
+
b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return e(b);for(var f=0,m=b.length;f<m;++f)if(e(b[f]))return!0;return!1}for(var f=0;f<b.length;++f)if(e(b[f]))return!0}function yc(a){a=ba[C(a,"keyCode")];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function Da(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8}function Ea(a,b){this.lines=[];this.type=b;this.cm=a}function Ic(a,b,c,d,e){var f=a.view.doc,g=new Ea(a,e);if("range"==e&&!x(b,c))return g;if(d)for(var h in d)d.hasOwnProperty(h)&&
|
84
|
+
(g[h]=d[h]);g.replacedWith&&(g.collapsed=!0,g.replacedWith=n("span",[g.replacedWith],"CodeMirror-widget"));g.collapsed&&(ua=!0);var m=b.line,j=0,i,k;f.iter(m,c.line+1,function(d){if(g.collapsed&&!a.options.lineWrapping&&ga(f,d)==a.view.maxLine)a.curOp.updateMaxLine=true;var e={from:null,to:null,marker:g};j=j+d.text.length;if(m==b.line){e.from=b.ch;j=j-b.ch}if(m==c.line){e.to=c.ch;j=j-(d.text.length-c.ch)}if(g.collapsed){m==c.line&&(k=mb(d,c.ch));m==b.line?i=mb(d,b.ch):I(d,0)}d.markedSpans=d.markedSpans?
|
85
|
+
d.markedSpans.concat([e]):[e];e.marker.lines.push(d);++m});g.collapsed&&f.iter(b.line,c.line+1,function(a){U(a)&&I(a,0)});g.readOnly&&(Ac=!0,(a.view.history.done.length||a.view.history.undone.length)&&a.clearHistory());if(g.collapsed){if(i!=k)throw Error("Inserting collapsed marker overlapping an existing one");g.size=j;g.atomic=!0}(g.className||g.startStyle||g.endStyle||g.collapsed)&&F(a,b.line,c.line+1);g.atomic&&Dc(a);return g}function Fa(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==
|
86
|
+
b)return d}}function ud(a,b,c,d,e){if(!a&&!b)return e;if(a)for(var f=0,g;f<a.length;++f){var h=a[f],m=h.marker;if(null==h.from||(m.inclusiveLeft?h.from<=c:h.from<c)||"bookmark"==m.type&&h.from==c){var j=null==h.to||(m.inclusiveRight?h.to>=c:h.to>c);(g||(g=[])).push({from:h.from,to:j?null:h.to,marker:m})}}a=g;if(b)for(var f=0,i;f<b.length;++f)if(g=b[f],h=g.marker,null==g.to||(h.inclusiveRight?g.to>=d:g.to>d)||"bookmark"==h.type&&g.from==d&&g.from!=c)m=null==g.from||(h.inclusiveLeft?g.from<=d:g.from<
|
87
|
+
d),(i||(i=[])).push({from:m?null:g.from-d,to:null==g.to?null:g.to-d,marker:h});b=i;i=1==e.length;f=K(e).length+(i?c:0);if(a)for(d=0;d<a.length;++d)g=a[d],null==g.to&&((h=Fa(b,g.marker))?i&&(g.to=null==h.to?null:h.to+f):g.to=c);if(b)for(d=0;d<b.length;++d)(g=b[d],null!=g.to&&(g.to+=f),null==g.from)?(h=Fa(a,g.marker),h||(g.from=f,i&&(a||(a=[])).push(g))):(g.from+=f,i&&(a||(a=[])).push(g));c=[Ca(e[0],a)];if(!i){i=e.length-2;var k;if(0<i&&a)for(d=0;d<a.length;++d)null==a[d].to&&(k||(k=[])).push({from:null,
|
88
|
+
to:null,marker:a[d].marker});for(d=0;d<i;++d)c.push(Ca(e[d+1],k));c.push(Ca(K(e),b))}return c}function td(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;if(c.readOnly&&(!d||-1==nb(d,c)))(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b)for(var c=d[b].find(),e=0;e<a.length;++e){var f=a[e];if(x(c.from,f.to)&&!x(c.to,f.from)){var g=[e,1];x(f.from,c.from)&&g.push({from:f.from,to:c.from});
|
89
|
+
x(c.to,f.to)&&g.push({from:c.to,to:f.to});a.splice.apply(a,g);e+=g.length-1}}return a}function mb(a,b){var c=ua&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)if(e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width))d=e.marker;return d}function ta(a){return mb(a,-1)}function Pa(a){return mb(a,a.text.length+1)}function ga(a,b){for(var c;c=ta(b);)b=o(a,c.find().from.line);return b}function U(a){var b=ua&&a.markedSpans;if(b)for(var c,d=0;d<b.length;++d)if(c=
|
90
|
+
b[d],c.marker.collapsed&&(null==c.from||0==c.from&&c.marker.inclusiveLeft&&Ob(a,c)))return!0}function Ob(a,b){if(null==b.to){for(var c=b.marker.find().to,d=a.parent;d.parent;d=d.parent);c=o(d,c.line);return Ob(c,Fa(c.markedSpans,b.marker))}if(b.marker.inclusiveRight&&b.to==a.text.length)return!0;for(d=0;d<a.markedSpans.length;++d)if(c=a.markedSpans[d],c.marker.collapsed&&c.from==b.to&&(c.marker.inclusiveLeft||b.marker.inclusiveRight)&&Ob(a,c))return!0}function D(a){return"string"==typeof a?a:a.text}
|
91
|
+
function H(a){if("string"==typeof a)return null;for(var a=a.markedSpans,b=null,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return!b?a:b.length?b:null}function Ca(a,b){return b?{text:a,markedSpans:b}:a}function Jc(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c){var d=b[c].marker.lines,e=nb(d,a);d.splice(e,1)}a.markedSpans=null}}function Kc(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.lines.push(a);a.markedSpans=b}}function Lc(a){return function(){Ya(this.cm);
|
92
|
+
try{var b=a.apply(this,arguments)}finally{Za(this.cm)}return b}}function Va(a){if(null!=a.height)return a.height;(!a.node.parentNode||1!=a.node.parentNode.nodeType)&&W(a.cm.display.measure,n("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function wd(a,b,c,d){var e=new Pb(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);kb(a,b,function(b){(b.widgets||(b.widgets=[])).push(e);e.line=b;if(!U(b)||e.showIfHidden){var c=ha(a,b)<a.display.scroller.scrollTop;I(b,b.height+Va(e));
|
93
|
+
c&&setTimeout(function(){a.display.scroller.scrollTop=a.display.scroller.scrollTop+e.height})}return true});return e}function pa(a,b,c){a={text:a,height:c};Kc(a,b);U(a)&&(a.height=0);return a}function oa(a,b,c,d){b.text=c;b.stateAfter&&(b.stateAfter=null);b.styles&&(b.styles=null);null!=b.order&&(b.order=null);Jc(b);Kc(b,d);U(b)?b.height=0:b.height||(b.height=Z(a.display));fa(a,b,"change")}function Mc(a,b,c,d,e){var f=a.options.flattenSpans,g="",h=null,a=new Da(b,a.options.tabSize);for(""==b&&c.blankLine&&
|
94
|
+
c.blankLine(d);!a.eol();){var m=c.token(a,d);5E3<a.pos&&(f=!1,a.pos=Math.min(b.length,a.start+5E4),m=null);var j=a.current();a.start=a.pos;!f||h!=m?(g&&e(g,h),g=j,h=m):g+=j}g&&e(g,h)}function fc(a,b,c){var d=[a.view.modeGen];Mc(a,b.text,a.view.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.view.overlays.length;++c){var e=a.view.overlays[c],f=1;Mc(a,b.text,e.mode,!0,function(a,b){for(var c=f,j=a.length;j;){var i=d[f],k=i.length;if(k<=j)j=j-k;else{d.splice(f,1,i.slice(0,j),d[f+1],i.slice(j));j=0}f=
|
95
|
+
f+2}if(b)if(e.opaque){d.splice(c,f-c,a,b);f=c+2}else for(;c<f;c=c+2){i=d[c+1];d[c+1]=i?i+" "+b:b}})}return d}function gc(a,b,c){var d=a.view.mode,a=new Da(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!a.eol()&&5E3>=a.pos;)d.token(a,c),a.start=a.pos}function Nc(a){return!a?null:Oc[a]||(Oc[a]="cm-"+a.replace(/ +/g," cm-"))}function cc(a,b,c){for(var d,e=b,f,g,h=!0;d=ta(e);)h=!1,e=o(a.view.doc,d.find().from.line),f||(f=e);d={pre:n("pre"),col:0,pos:0,display:!c,measure:null,addedOne:!1,
|
96
|
+
cm:a};e.textClass&&(d.pre.className=e.textClass);do{d.measure=e==b&&c;d.pos=0;d.addToken=d.measure?xd:Pc;c&&(g&&e!=b&&!d.addedOne)&&(c[0]=d.pre.appendChild(Qc(a.display.measure)),d.addedOne=!0);var m=e;g=d;var j=e;if(!j.styles||j.styles[0]!=a.view.modeGen)j.styles=fc(a,j,j.stateAfter=va(a,G(j)));a:{var i=m,j=j.styles;if(m=i.markedSpans)for(var i=i.text.length,k=0,r=1,l="",q=void 0,s=0,t=void 0,v=void 0,w=void 0,u=void 0;;){if(s==k){for(var t=v=w="",u=null,s=Infinity,x=null,z=0;z<m.length;++z){var B=
|
97
|
+
m[z],y=B.marker;if(B.from<=k&&(null==B.to||B.to>k)){if(null!=B.to&&s>B.to&&(s=B.to,v=""),y.className&&(t+=" "+y.className),y.startStyle&&B.from==k&&(w+=" "+y.startStyle),y.endStyle&&B.to==s&&(v+=" "+y.endStyle),y.collapsed&&(!u||u.marker.width<y.width))u=B}else B.from>k&&s>B.from&&(s=B.from);"bookmark"==y.type&&(B.from==k&&y.replacedWith)&&(x=y.replacedWith)}if(u&&(u.from||0)==k)if(Rc(g,(null==u.to?i:u.to)-k,null!=u.from&&u.marker.replacedWith),null==u.to){j=u.marker.find();break a}x&&!u&&Rc(g,0,
|
98
|
+
x)}if(k>=i)break;for(x=Math.min(i,s);;){if(l){z=k+l.length;u||(B=z>x?l.slice(0,x-k):l,g.addToken(g,B,q+t,w,k+B.length==s?v:""));if(z>=x){l=l.slice(x-k);k=x;break}k=z;w=""}l=j[r++];q=Nc(j[r++])}}else for(var r=1;r<j.length;r+=2)g.addToken(g,j[r],Nc(j[r+1]));j=void 0}g=e==f;j&&(e=o(a.view.doc,j.to.line),h=!1)}while(j);c&&!d.addedOne&&(c[0]=d.pre.appendChild(h?n("span"," "):Qc(a.display.measure)));!d.pre.firstChild&&!U(b)&&d.pre.appendChild(document.createTextNode(" "));return d.pre}function Pc(a,b,
|
99
|
+
c,d,e){if(b){if(Qb.test(b))for(var f=document.createDocumentFragment(),g=0;;){Qb.lastIndex=g;var h=Qb.exec(b),m=h?h.index-g:b.length-g;m&&(f.appendChild(document.createTextNode(b.slice(g,g+m))),a.col+=m);if(!h)break;g+=m+1;"\t"==h[0]?(h=a.cm.options.tabSize,h-=a.col%h,f.appendChild(n("span",Fc(h),"cm-tab")),a.col+=h):(m=n("span","•","cm-invalidchar"),m.title="\\u"+h[0].charCodeAt(0).toString(16),f.appendChild(m),a.col+=1)}else{a.col+=b.length;var f=document.createTextNode(b)}if(c||d||e||a.measure)return b=
|
100
|
+
c||"",d&&(b+=d),e&&(b+=e),a.pre.appendChild(n("span",[f],b));a.pre.appendChild(f)}}function xd(a,b,c,d,e){for(var f=0;f<b.length;++f)f&&(f<b.length&&a.cm.options.lineWrapping&&ob.test(b.slice(f-1,f+1)))&&a.pre.appendChild(n("wbr")),a.measure[a.pos++]=Pc(a,b.charAt(f),c,0==f&&d,f==b.length-1&&e);b.length&&(a.addedOne=!0)}function Rc(a,b,c){c&&(a.display||(c=c.cloneNode(!0)),a.pre.appendChild(c),a.measure&&b&&(a.measure[a.pos]=c,a.addedOne=!0));a.pos+=b}function Ja(a){this.lines=a;this.parent=null;
|
101
|
+
for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function Ia(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function o(a,b){for(;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function I(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function G(a){if(null==a.parent)return null;for(var b=a.parent,
|
102
|
+
a=nb(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a}function Ra(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function ha(a,b){for(var b=ga(a.view.doc,b),c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;else c+=f.height}for(f=
|
103
|
+
d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function P(a){var b=a.order;null==b&&(b=a.order=yd(a.text));return b}function tb(){return{done:[],undone:[],lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function vd(a,b,c,d,e,f,g,h,m){var j=a.view.history;j.undone.length=0;var i=+new Date,k=K(j.done);if(k&&(j.lastOp==a.curOp.id||j.lastOrigin==e&&("input"==e||"delete"==e)&&j.lastTime>i-600)){f=K(k.events);if(f.start>b+d.length||
|
104
|
+
f.start+f.added<b)k.events.push({start:b,added:c,old:d});else{for(var g=Math.max(0,f.start-b),r=Math.max(0,b+d.length-(f.start+f.added)),l=g;0<l;--l)f.old.unshift(d[l-1]);for(l=r;0<l;--l)f.old.push(d[d.length-l]);g&&(f.start=b);f.added+=c-(d.length-g-r)}k.fromAfter=h;k.toAfter=m}else{k={events:[{start:b,added:c,old:d}],fromBefore:f,toBefore:g,fromAfter:h,toAfter:m};for(j.done.push(k);j.done.length>a.options.undoDepth;)j.done.shift();0>j.dirtyCounter?j.dirtyCounter=NaN:j.dirtyCounter++}j.lastTime=
|
105
|
+
i;j.lastOp=a.curOp.id;j.lastOrigin=e}function zd(){ab(this)}function za(a){a.stop||(a.stop=zd);return a}function z(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Sc(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function ab(a){z(a);Sc(a)}function sc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));ia&&(a.ctrlKey&&1==b)&&(b=3);return b}function C(a,b){return a.override&&a.override.hasOwnProperty(b)?a.override[b]:a[b]}function s(a,b,c){a.addEventListener?
|
106
|
+
a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function Q(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}}function ma(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function fa(a,b,c){function d(a){return function(){a.apply(null,
|
107
|
+
f)}}var e=b._handlers&&b._handlers[c];if(e)for(var f=Array.prototype.slice.call(arguments,3),g=a.curOp&&a.curOp.delayedCallbacks,h=0;h<e.length;++h)g?g.push(d(e[h])):e[h].apply(null,f)}function tc(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function xb(){this.id=null}function ka(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var d=0,e=0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function Fc(a){for(;pb.length<=a;)pb.push(K(pb)+" ");return pb[a]}function K(a){return a[a.length-
|
108
|
+
1]}function nc(a){La?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function nb(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function ic(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function L(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function lb(a){return/\w/.test(a)||""<a&&(a.toUpperCase()!=a.toLowerCase()||Ad.test(a))}function Tc(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&
|
109
|
+
a[c]&&++b;return!b}function n(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)bc(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Na(a){if(M)for(;a.firstChild;)a.removeChild(a.firstChild);else a.innerHTML="";return a}function W(a,b){return Na(a).appendChild(b)}function bc(a,b){gb?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function Qa(a){if(null!=qb)return qb;var b=n("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");
|
110
|
+
W(a,b);b.offsetWidth&&(qb=b.offsetHeight-b.clientHeight);return qb||0}function Qc(a){if(null==Rb){var b=n("span","");W(a,n("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Rb=1>=b.offsetWidth&&2<b.offsetHeight&&!ea)}return Rb?n("span",""):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function gd(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=0;e<a.length;++e){var f=a[e];if(f.from<c&&f.to>b||b==c&&f.to==b)d(Math.max(f.from,b),Math.min(f.to,c),1==
|
111
|
+
f.level?"rtl":"ltr")}}function Sb(a){return a.level%2?a.from:a.to}function Wa(a){return(a=P(a))?a[0].level%2?a[0].to:a[0].from:0}function Xa(a){var b=P(a);return!b?a.text.length:Sb(K(b))}function Uc(a,b){var c=o(a.view.doc,b),d=ga(a.view.doc,c);d!=c&&(b=G(d));c=P(d);d=!c?0:c[0].level%2?Xa(d):Wa(d);return{line:b,ch:d}}function Bd(a,b){for(var c,d;c=Pa(d=o(a.view.doc,b));)b=c.find().to.line;c=P(d);d=!c?d.text.length:c[0].level%2?Wa(d):Xa(d);return{line:b,ch:d}}function Eb(a,b,c,d){var e=P(a);if(!e)return Hc(a,
|
112
|
+
b,c,d);for(var d=d?function(b,c){do b+=c;while(0<b&&Fb.test(a.text.charAt(b)));return b}:function(a,b){return a+b},f=e[0].level,g=0;g<e.length;++g){var h=e[g],m=h.level%2==f;if(h.from<b&&h.to>b||m&&(h.from==b||h.to==b))break}for(b=d(b,h.level%2?-c:c);null!=b;)if(h.level%2==f)if(b<h.from||b>h.to)b=(h=e[g+=c])&&(0<c==h.level%2?d(h.to,-1):d(h.from,1));else break;else if(b==(h.level%2?h.to:h.from))b=(h=e[--g])&&Sb(h);else if(b==Sb(h))b=(h=e[++g])&&(h.level%2?h.to:h.from);else break;return 0>b||b>a.text.length?
|
113
|
+
null:b}function Hc(a,b,c,d){b+=c;if(d)for(;0<b&&Fb.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var X=/gecko\/\d/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),ea=M&&(null==document.documentMode||8>document.documentMode),gb=M&&(null==document.documentMode||9>document.documentMode),N=/WebKit\//.test(navigator.userAgent),Cd=N&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Vc=/Chrome\//.test(navigator.userAgent),R=/Opera\//.test(navigator.userAgent),Jb=/Apple Computer/.test(navigator.vendor),
|
114
|
+
wb=/KHTML\//.test(navigator.userAgent),$c=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),ad=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),kd=/PhantomJS/.test(navigator.userAgent),La=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Vb=La||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ia=La||/Mac/.test(navigator.platform),Dd=/windows/i.test(navigator.platform),Ga=R&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);
|
115
|
+
Ga&&(Ga=Number(Ga[1]));var zc=ia&&(Cd||R&&(null==Ga||12.11>Ga)),Ac=!1,ua=!1,aa,cb,bb,db=0,J=null;M?J=-0.53:X?J=15:Vc?J=-0.7:Jb&&(J=-1/3);var xc,Mb=null,Nb;l.prototype={getValue:function(a){var b=[],c=this.view.doc;c.iter(0,c.size,function(a){b.push(a.text)});return b.join(a||"\n")},setValue:q(null,function(a){var b=this.view.doc,c={line:0,ch:0},d=o(b,b.size-1).text.length;ib(this,c,{line:b.size-1,ch:d},ya(a),c,c,"setValue")}),getSelection:function(a){return this.getRange(this.view.sel.from,this.view.sel.to,
|
116
|
+
a)},replaceSelection:q(null,function(a,b,c){var d=this.view.sel;Ib(this,d.from,d.to,ya(a),b||"around",c)}),focus:function(){window.focus();E(this);$(this);wa(this)},setOption:function(a,b){var c=this.options,d=c[a];c[a]==b&&"mode"!=a||(c[a]=b,da.hasOwnProperty(a)&&q(this,da[a])(this,b,d))},getOption:function(a){return this.options[a]},getMode:function(){return this.view.mode},addKeyMap:function(a){this.view.keyMaps.push(a)},removeKeyMap:function(a){for(var b=this.view.keyMaps,c=0;c<b.length;++c)if(("string"==
|
117
|
+
typeof a?b[c].name:b[c])==a)return b.splice(c,1),!0},addOverlay:q(null,function(a,b){var c=a.token?a:l.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.view.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.view.modeGen++;F(this,0,this.view.doc.size)}),removeOverlay:q(null,function(a){for(var b=this.view.overlays,c=0;c<b.length;++c)if(b[c].modeSpec==a){b.splice(c,1);this.view.modeGen++;F(this,0,this.view.doc.size);break}}),undo:q(null,function(){Cc(this,
|
118
|
+
"undo")}),redo:q(null,function(){Cc(this,"redo")}),indentLine:q(null,function(a,b,c){"string"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");0<=a&&a<this.view.doc.size&&hb(this,a,b,c)}),indentSelection:q(null,function(a){var b=this.view.sel;if(u(b.from,b.to))return hb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)hb(this,b,a)}),historySize:function(){var a=this.view.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.view.history=
|
119
|
+
tb()},markClean:function(){this.view.history.dirtyCounter=0;this.view.history.lastOp=this.view.history.lastOrigin=null},isClean:function(){return 0==this.view.history.dirtyCounter},getHistory:function(){function a(a){for(var b=0,e=[],f;b<a.length;++b){var g=a[b];e.push({events:f=[],fromBefore:g.fromBefore,toBefore:g.toBefore,fromAfter:g.fromAfter,toAfter:g.toAfter});for(var h=0,g=g.events;h<g.length;++h){var m=[],j=g[h];f.push({start:j.start,added:j.added,old:m});for(var i=0;i<j.old.length;++i)m.push(D(j.old[i]))}}return e}
|
120
|
+
var b=this.view.history;return{done:a(b.done),undone:a(b.undone)}},setHistory:function(a){var b=this.view.history=tb();b.done=a.done;b.undone=a.undone},getTokenAt:function(a){for(var b=this.view.doc,a=w(b,a),c=va(this,a.line),d=this.view.mode,b=o(b,a.line),b=new Da(b.text,this.options.tabSize);b.pos<a.ch&&!b.eol();){b.start=b.pos;var e=d.token(b,c)}return{start:b.start,end:b.pos,string:b.current(),className:e||null,type:e||null,state:c}},getStateAfter:function(a){var b=this.view.doc,a=Math.max(0,
|
121
|
+
Math.min(null==a?b.size-1:a,b.size-1));return va(this,a+1)},cursorCoords:function(a,b){var c;c=this.view.sel;c=null==a?c.head:"object"==typeof a?w(this.view.doc,a):a?c.from:c.to;return V(this,c,b||"page")},charCoords:function(a,b){return Ta(this,w(this.view.doc,a),b||"page")},coordsChar:function(a){var b=this.display.lineSpace.getBoundingClientRect();return Db(this,a.left-b.left,a.top-b.top)},defaultTextHeight:function(){return Z(this.display)},markText:q(null,function(a,b,c){return Ic(this,w(this.view.doc,
|
122
|
+
a),w(this.view.doc,b),c,"range")}),setBookmark:q(null,function(a,b){a=w(this.view.doc,a);return Ic(this,a,a,b?{replacedWith:b}:{},"bookmark")}),findMarksAt:function(a){var b=this.view.doc,a=w(b,a),c=[];if(b=o(b,a.line).markedSpans)for(var d=0;d<b.length;++d){var e=b[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&c.push(e.marker)}return c},setGutterMarker:q(null,function(a,b,c){return kb(this,a,function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Tc(e)&&(a.gutterMarkers=null);
|
123
|
+
return!0})}),clearGutter:q(null,function(a){var b=0,c=this,d=c.view.doc;d.iter(0,d.size,function(d){d.gutterMarkers&&d.gutterMarkers[a]&&(d.gutterMarkers[a]=null,F(c,b,b+1),Tc(d.gutterMarkers)&&(d.gutterMarkers=null));++b})}),addLineClass:q(null,function(a,b,c){return kb(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("\\b"+c+"\\b").test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:q(null,function(a,b,c){return kb(this,
|
124
|
+
a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.replace(RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b"),"");if(g==f)return!1;a[e]=g||null}else return!1;return!0})}),addLineWidget:q(null,function(a,b,c){return wd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!(0<=a&&a<this.view.doc.size))return null;var b=a,a=o(this.view.doc,a);if(!a)return null}else if(b=G(a),null==b)return null;
|
125
|
+
return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display,a=V(this,w(this.view.doc,a)),g=a.top,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("near"==d){var d=Math.max(f.wrapper.clientHeight,this.view.doc.height),m=Math.max(f.sizer.clientWidth,
|
126
|
+
f.lineSpace.clientWidth);a.bottom+b.offsetHeight>d&&a.top>b.offsetHeight&&(g=a.top-b.offsetHeight);h+b.offsetWidth>m&&(h=m-b.offsetWidth)}b.style.top=g+f.lineSpace.offsetTop+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&Ec(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},lineCount:function(){return this.view.doc.size},clipPos:function(a){return w(this.view.doc,
|
127
|
+
a)},getCursor:function(a){var b=this.view.sel,a=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from;return{line:a.line,ch:a.ch}},somethingSelected:function(){return!u(this.view.sel.from,this.view.sel.to)},setCursor:q(null,function(a,b,c){a=w(this.view.doc,"number"==typeof a?{line:a,ch:b||0}:a);c?y(this,a):S(this,a,a)}),setSelection:q(null,function(a,b){var c=this.view.doc;S(this,w(c,a),w(c,b||a))}),extendSelection:q(null,function(a,b){var c=this.view.doc;y(this,w(c,a),b&&w(c,
|
128
|
+
b))}),setExtending:function(a){this.view.sel.extend=a},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){var b=this.view.doc;if(0<=a&&a<b.size)return o(b,a)},getLineNumber:function(a){return G(a)},setLine:q(null,function(a,b){0<=a&&a<this.view.doc.size&&Y(this,b,{line:a,ch:0},{line:a,ch:o(this.view.doc,a).text.length})}),removeLine:q(null,function(a){0<=a&&a<this.view.doc.size&&Y(this,"",{line:a,ch:0},w(this.view.doc,{line:a+1,ch:0}))}),replaceRange:q(null,function(a,
|
129
|
+
b,c){var d=this.view.doc,b=w(d,b),c=c?w(d,c):b;return Y(this,a,b,c)}),getRange:function(a,b,c){var d=this.view.doc,a=w(d,a),b=w(d,b),e=a.line,f=b.line;if(e==f)return o(d,e).text.slice(a.ch,b.ch);var g=[o(d,e).text.slice(a.ch)];d.iter(e+1,f,function(a){g.push(a.text)});g.push(o(d,f).text.slice(0,b.ch));return g.join(c||"\n")},triggerOnKeyDown:q(null,qc),execCommand:function(a){return Kb[a](this)},moveH:q(null,function(a,b){var c=this.view.sel,d=0>a?c.from:c.to;if(c.shift||c.extend||u(c.from,c.to))d=
|
130
|
+
Gc(this,a,b,this.options.rtlMoveVisually);y(this,d,d,a)}),deleteH:q(null,function(a,b){var c=this.view.sel;u(c.from,c.to)?Y(this,"",c.from,Gc(this,a,b,!1),"delete"):Y(this,"",c.from,c.to,"delete");this.curOp.userSelChange=!0}),moveV:q(null,function(a,b){var c=this.view,d=c.doc,e=this.display,f=V(this,c.sel.head,"div"),g=f.left,h;null!=c.goalColumn&&(g=c.goalColumn);"page"==b?(h=Math.min(e.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),h=f.top+a*h):"line"==b&&(h=0<
|
131
|
+
a?f.bottom+3:f.top-3);do{var m=Db(this,g,h);h+=5*a}while(m.outside&&(0>a?0<h:h<d.height));"page"==b&&(e.scrollbarV.scrollTop+=Ta(this,m,"div").top-f.top);y(this,m,m,a);c.goalColumn=g}),toggleOverwrite:function(){this.display.cursor.className=(this.view.overwrite=!this.view.overwrite)?this.display.cursor.className+" CodeMirror-overwrite":this.display.cursor.className.replace(" CodeMirror-overwrite","")},posFromIndex:function(a){var b=0,c,d=this.view.doc;d.iter(0,d.size,function(d){d=d.text.length+
|
132
|
+
1;if(d>a)return c=a,!0;a-=d;++b});return w(d,{line:b,ch:c})},indexFromPos:function(a){var a=w(this.view.doc,a),b=a.ch;this.view.doc.iter(0,a.line,function(a){b+=a.text.length+1});return b},scrollTo:function(a,b){null!=a&&(this.display.scrollbarH.scrollLeft=this.display.scroller.scrollLeft=a);null!=b&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=b);O(this,[])},getScrollInfo:function(){var a=this.display.scroller,b=qa;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-
|
133
|
+
b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:function(a){"number"==typeof a&&(a={line:a,ch:0});!a||null!=a.line?(a=a?w(this.view.doc,a):this.view.sel.head,lc(this,a)):Ec(this,a.left,a.top,a.right,a.bottom)},setSize:function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(""+a)?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.refresh()},on:function(a,b){s(this,a,b)},off:function(a,
|
134
|
+
b){Q(this,a,b)},operation:function(a){return q(this,a)()},refresh:function(){ra(this);var a=this.view.scrollTop,b=this.view.scrollLeft;this.display.scroller.scrollHeight>a&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=a);this.display.scroller.scrollWidth>b&&(this.display.scrollbarH.scrollLeft=this.display.scroller.scrollLeft=b);O(this,!0)},getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},
|
135
|
+
getGutterElement:function(){return this.display.gutters}};var da=l.optionHandlers={},rb=l.defaults={},Xb=l.Init={toString:function(){return"CodeMirror.Init"}};t("value","",function(a,b){a.setValue(b)},!0);t("mode",null,Ka,!0);t("indentUnit",2,Ka,!0);t("indentWithTabs",!1);t("smartIndent",!0);t("tabSize",4,function(a){Ka(a);ra(a);O(a,!0)},!0);t("electricChars",!0);t("rtlMoveVisually",!Dd);t("theme","default",function(a){Wb(a);sa(a)},!0);t("keyMap","default",function(a){var b=T[a.options.keyMap].style;
|
136
|
+
a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")});t("extraKeys",null);t("onKeyEvent",null);t("onDragEvent",null);t("lineWrapping",!1,function(a){var b=a.view.doc,c=Z(a.display);if(a.options.lineWrapping){a.display.wrapper.className=a.display.wrapper.className+" CodeMirror-wrap";var d=a.display.scroller.clientWidth/kc(a.display)-3;b.iter(0,b.size,function(a){if(a.height!=0){var b=Math.ceil(a.text.length/d)||1;b!=1&&I(a,b*c)}});a.display.sizer.style.minWidth=
|
137
|
+
""}else{a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap","");Yb(a.view);b.iter(0,b.size,function(a){a.height!=0&&I(a,c)})}F(a,0,b.size);ra(a);setTimeout(function(){Zb(a.display,a.view.doc.height)},100)},!0);t("gutters",[],function(a){sb(a.options);sa(a)},!0);t("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?zb(a.display)+"px":"0";a.refresh()},!0);t("lineNumbers",!1,function(a){sb(a.options);sa(a)},!0);t("firstLineNumber",1,sa,!0);t("lineNumberFormatter",
|
138
|
+
function(a){return a},sa,!0);t("showCursorWhenSelecting",!1,Ab,!0);t("readOnly",!1,function(a,b){if(b=="nocursor"){ub(a);a.display.input.blur()}else b||ca(a,true)});t("dragDrop",!0);t("cursorBlinkRate",530);t("cursorHeight",1);t("workTime",100);t("workDelay",100);t("flattenSpans",!0);t("pollInterval",100);t("undoDepth",40);t("viewportMargin",10,function(a){a.refresh()},!0);t("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});t("autofocus",null);var Wc=l.modes={},Tb=l.mimeModes={};l.defineMode=
|
139
|
+
function(a,b){!l.defaults.mode&&"null"!=a&&(l.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Wc[a]=b};l.defineMIME=function(a,b){Tb[a]=b};l.resolveMode=function(a){if("string"==typeof a&&Tb.hasOwnProperty(a))a=Tb[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return l.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};l.getMode=function(a,b){var b=l.resolveMode(b),c=Wc[b.name];
|
140
|
+
if(!c)return l.getMode(a,"text/plain");c=c(a,b);if(Ha.hasOwnProperty(b.name)){var d=Ha[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};l.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});l.defineMIME("text/plain","null");var Ha=l.modeExtensions={};l.extendMode=function(a,b){var c=Ha.hasOwnProperty(a)?Ha[a]:Ha[a]={},d;for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d])};l.defineExtension=function(a,b){l.prototype[a]=b};
|
141
|
+
l.defineOption=t;var vb=[];l.defineInitHook=function(a){vb.push(a)};l.copyState=ja;l.startState=hc;l.innerMode=function(a,b){for(;a.innerMode;)var c=a.innerMode(b),b=c.state,a=c.mode;return c||{mode:a,state:b}};var Kb=l.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()-1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!u(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0},"delete"):a.replaceRange("",b,d?c:{line:b.line},
|
142
|
+
"delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b},"delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection({line:0,ch:0})},goDocEnd:function(a){a.extendSelection({line:a.lineCount()-1})},goLineStart:function(a){a.extendSelection(Uc(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Uc(a,b.line),d=a.getLineHandle(c.line),e=P(d);!e||0==e[0].level?(d=Math.max(0,d.text.search(/\S/)),
|
143
|
+
a.extendSelection({line:c.line,ch:b.line==c.line&&b.ch<=d&&b.ch?0:d})):a.extendSelection(c)},goLineEnd:function(a){a.extendSelection(Bd(a,a.getCursor().line))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},
|
144
|
+
goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end","input")},defaultTab:function(a){a.somethingSelected()?
|
145
|
+
a.indentSelection("add"):a.replaceSelection("\t","end","input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){q(a,function(){a.replaceSelection("\n","end","input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},T=l.keyMap={};T.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",
|
146
|
+
Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};T.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart",
|
147
|
+
"Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordBefore","Ctrl-Delete":"delWordAfter","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",fallthrough:"basic"};T.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight",
|
148
|
+
"Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordBefore","Ctrl-Alt-Backspace":"delWordAfter","Alt-Delete":"delWordAfter","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",fallthrough:["basic","emacsy"]};T["default"]=ia?T.macDefault:T.pcDefault;T.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight",
|
149
|
+
"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"};l.isModifierKey=yc;l.fromTextArea=function(a,b){function c(){a.value=m.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=
|
150
|
+
d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form){s(a.form,"submit",c);var f=a.form,g=f.submit;try{f.submit=function i(){c();f.submit=g;f.submit();f.submit=i}}catch(h){}}a.style.display="none";var m=l(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);m.save=c;m.getTextArea=function(){return a};m.toTextArea=function(){c();a.parentNode.removeChild(m.getWrapperElement());a.style.display="";if(a.form){Q(a.form,"submit",c);if(typeof a.form.submit=="function")a.form.submit=g}};
|
151
|
+
return m};Da.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;
|
152
|
+
return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return ka(this.string,this.start,this.tabSize)},indentation:function(){return ka(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a=
|
153
|
+
this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};l.StringStream=Da;l.TextMarker=Ea;Ea.prototype.clear=function(){if(!this.explicitlyCleared){Ya(this.cm);for(var a=this.cm.view,b=null,c=null,d=0;d<this.lines.length;++d){var e=this.lines[d],f=Fa(e.markedSpans,this);null!=f.to&&(c=G(e));for(var g=e,h=e.markedSpans,m=f,j=void 0,i=0;i<h.length;++i)h[i]!=m&&(j||(j=[])).push(h[i]);
|
154
|
+
g.markedSpans=j;null!=f.from?b=G(e):this.collapsed&&!U(e)&&I(e,Z(this.cm.display))}if(this.collapsed&&!this.cm.options.lineWrapping)for(d=0;d<this.lines.length;++d)e=ga(a.doc,this.lines[d]),f=Oa(a.doc,e),f>a.maxLineLength&&(a.maxLine=e,a.maxLineLength=f,a.maxLineChanged=!0);null!=b&&F(this.cm,b,c+1);this.lines.length=0;this.explicitlyCleared=!0;this.collapsed&&this.cm.view.cantEdit&&(this.cm.view.cantEdit=!1,Dc(this.cm));Za(this.cm);fa(this.cm,this,"clear")}};Ea.prototype.find=function(){for(var a,
|
155
|
+
b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=Fa(d.markedSpans,this);if(null!=e.from||null!=e.to)d=G(d),null!=e.from&&(a={line:d,ch:e.from}),null!=e.to&&(b={line:d,ch:e.to})}return"bookmark"==this.type?a:a&&{from:a,to:b}};Ea.prototype.getOptions=function(a){var b=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,atomic:this.atomic,collapsed:this.collapsed,clearOnEnter:this.clearOnEnter,replacedWith:a?b&&b.cloneNode(!0):b,readOnly:this.readOnly,
|
156
|
+
startStyle:this.startStyle,endStyle:this.endStyle}};var Pb=l.LineWidget=function(a,b,c){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Pb.prototype.clear=Lc(function(){var a=this.line.widgets,b=G(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);I(this.line,Math.max(0,this.line.height-Va(this)));F(this.cm,b,b+1)}});Pb.prototype.changed=Lc(function(){var a=this.height;this.height=null;if(a=Va(this)-a)I(this.line,this.line.height+a),a=G(this.line),
|
157
|
+
F(this.cm,a,a+1)});var Oc={},Qb=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g;Ja.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,e=a+b;d<e;++d){var f=this.lines[d];this.height-=f.height;var g=f;g.parent=null;Jc(g);fa(c,f,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<
|
158
|
+
c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Ia.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;e.remove(a,g,c);this.height-=h-e.height;f==g&&(this.children.splice(d--,1),e.parent=null);if(0==(b-=g))break;a=0}else a-=f}25>this.size-b&&(a=[],this.collapse(a),this.children=[new Ja(a)],this.children[0].parent=
|
159
|
+
this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertHeight(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new Ja(a),f.height-=a.height,
|
160
|
+
this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Ia(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=nb(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Ia(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,
|
161
|
+
c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};l.e_stop=ab;l.e_preventDefault=z;l.e_stopPropagation=Sc;l.on=s;l.off=Q;l.signal=ma;var qa=30,uc=l.Pass={toString:function(){return"CodeMirror.Pass"}};xb.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};l.countColumn=ka;var pb=[""],Ad=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,Fb=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F]/,
|
162
|
+
rd=function(){if(gb)return!1;var a=n("div");return"draggable"in a||"dragDrop"in a}(),ob=/^$/;X?ob=/$'/:Jb?ob=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:Vc&&(ob=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var qb,Rb,ya=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};
|
163
|
+
l.splitLines=ya;var ld=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:0!=b.compareEndPoints("StartToEnd",b)},mc=function(){var a=n("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),ba={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",
|
164
|
+
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:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};l.keyNames=ba;(function(){for(var a=0;10>a;a++)ba[a+48]=""+a;for(a=65;90>=a;a++)ba[a]=
|
165
|
+
String.fromCharCode(a);for(a=1;12>=a;a++)ba[a+111]=ba[a+63235]="F"+a})();var yd=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",
|
166
|
+
d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,i=[],k=0,l;k<c;++k)i.push(a(b.charCodeAt(k)));for(var k=0,p="L";k<c;++k)l=i[k],"m"==l?i[k]=p:p=l;k=0;for(p="L";k<c;++k)l=i[k],"1"==l&&"r"==p?i[k]="n":f.test(l)&&(p=l,"r"==l&&(i[k]="R"));k=1;for(p=i[0];k<c-1;++k){l=i[k];if("+"==l&&"1"==p&&"1"==i[k+1])i[k]="1";else if(","==l&&p==i[k+1]&&("1"==p||"n"==p))i[k]=p;p=l}for(k=0;k<c;++k)if(l=i[k],","==l)i[k]="N";
|
167
|
+
else if("%"==l){for(p=k+1;p<c&&"%"==i[p];++p);var n=k&&"!"==i[k-1]||p<c-1&&"1"==i[p]?"1":"N";for(l=k;l<p;++l)i[l]=n;k=p-1}k=0;for(p="L";k<c;++k)l=i[k],"L"==p&&"1"==l?i[k]="L":f.test(l)&&(p=l);for(k=0;k<c;++k)if(e.test(i[k])){for(p=k+1;p<c&&e.test(i[p]);++p);l="L"==(p<c-1?i[p]:"L");n="L"==(k?i[k-1]:"L")||l?"L":"R";for(l=k;l<p;++l)i[l]=n;k=p-1}for(var p=[],q,k=0;k<c;)if(g.test(i[k])){l=k;for(++k;k<c&&g.test(i[k]);++k);p.push({from:l,to:k,level:0})}else{var o=k,n=p.length;for(++k;k<c&&"L"!=i[k];++k);
|
168
|
+
for(l=o;l<k;)if(h.test(i[l])){o<l&&p.splice(n,0,{from:o,to:l,level:1});o=l;for(++l;l<k&&h.test(i[l]);++l);p.splice(n,0,{from:o,to:l,level:2});o=l}else++l;o<k&&p.splice(n,0,{from:o,to:k,level:1})}if(1==p[0].level&&(q=b.match(/^\s+/)))p[0].from=q[0].length,p.unshift({from:0,to:q[0].length,level:0});if(1==K(p).level&&(q=b.match(/\s+$/)))K(p).to-=q[0].length,p.push({from:c-q[0].length,to:c,level:0});p[0].level!=K(p).level&&p.push({from:c,to:c,level:p[0].level});return p}}();l.version="3.02";return l}();
|
@@ -1,7 +1,7 @@
|
|
1
1
|
CodeMirror.defineMode("css",function(n){function g(a){for(var c={},b=0;b<a.length;++b)c[a[b]]=!0;return c}function e(a,c){f=c;return a}function h(a,c){var b=a.next();if("@"==b)return a.eatWhile(/[\w\\\-]/),e("def",a.current());if("/"==b&&a.eat("*"))return c.tokenize=j,j(a,c);if("<"==b&&a.eat("!"))return c.tokenize=k,k(a,c);if("="==b)e(null,"compare");else{if(("~"==b||"|"==b)&&a.eat("="))return e(null,"compare");if('"'==b||"'"==b)return c.tokenize=l(b),c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),
|
2
|
-
e("atom","hash");if("!"==b)return a.match(/^\s*\w*/),e("keyword","important");if(/\d/.test(b))return a.eatWhile(/[\w.%]/),e("number","unit");if("-"===b){if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),e("number","unit");if(a.match(/^[^-]+-/))return e("meta",
|
3
|
-
o):a.eatWhile(/[\w\\\-]/);return e("property","variable")}}}function j(a,c){for(var b=!1,d;null!=(d=a.next());){if(b&&"/"==d){c.tokenize=h;break}b="*"==d}return e("comment","comment")}function k(a,c){for(var b=0,d;null!=(d=a.next());){if(2<=b&&">"==d){c.tokenize=h;break}b="-"==d?b+1:0}return e("comment","comment")}function l(a,c){return function(b,d){for(var f=!1,g;null!=(g=b.next())&&(g!=a||f);)f=!f&&"\\"==g;f||(c&&b.backUp(1),d.tokenize=h);return e("string","string")}}function o(a,
|
4
|
-
a.match(/\s*[\"\']/,!1)?h:l(")",!0);return e(null,"(")}var p=n.indentUnit,f,i=g("all aural braille handheld print projection screen tty tv embossed".split(" ")),q=g("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".split(" ")),
|
2
|
+
e("atom","hash");if("!"==b)return a.match(/^\s*\w*/),e("keyword","important");if(/\d/.test(b))return a.eatWhile(/[\w.%]/),e("number","unit");if("-"===b){if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),e("number","unit");if(a.match(/^[^-]+-/))return e("meta","meta")}else{if(/[,+>*\/]/.test(b))return e(null,"select-op");if("."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i))return e("qualifier","qualifier");if(":"==b)return e("operator",b);if(/[;{}\[\]\(\)]/.test(b))return e(null,b);"u"==b&&a.match("rl(")?
|
3
|
+
(a.backUp(1),c.tokenize=o):a.eatWhile(/[\w\\\-]/);return e("property","variable")}}}function j(a,c){for(var b=!1,d;null!=(d=a.next());){if(b&&"/"==d){c.tokenize=h;break}b="*"==d}return e("comment","comment")}function k(a,c){for(var b=0,d;null!=(d=a.next());){if(2<=b&&">"==d){c.tokenize=h;break}b="-"==d?b+1:0}return e("comment","comment")}function l(a,c){return function(b,d){for(var f=!1,g;null!=(g=b.next())&&(g!=a||f);)f=!f&&"\\"==g;f||(c&&b.backUp(1),d.tokenize=h);return e("string","string")}}function o(a,
|
4
|
+
c){a.next();c.tokenize=a.match(/\s*[\"\']/,!1)?h:l(")",!0);return e(null,"(")}var p=n.indentUnit,f,i=g("all aural braille handheld print projection screen tty tv embossed".split(" ")),q=g("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".split(" ")),
|
5
5
|
m=g("align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration 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 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-cell grid-column grid-column-align grid-column-sizing grid-column-span grid-columns grid-flow grid-row grid-row-align grid-row-sizing grid-row-span grid-rows grid-template 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 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 rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span 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-shadow 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".split(" ")),
|
6
6
|
r=g("black silver gray white maroon red purple fuchsia green lime olive yellow navy blue teal aqua".split(" ")),s=g("above absolute activeborder activecaption afar after-white-space ahead alias all all-scroll alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks auto avoid background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break-all break-word button button-bevel buttonface buttonhighlight buttonshadow buttontext cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse compact condensed contain content content-box context-menu continuous copy cover crop cross crosshair currentcolor cursive dashed decimal decimal-leading-zero default default-button destination-atop destination-in destination-out destination-over devanagari disc discard document dot-dash dot-dot-dash dotted double down e-resize ease ease-in ease-in-out ease-out element 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 ew-resize expanded extra-condensed extra-expanded fantasy fast fill fixed flat 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-table inset inside intrinsic invert italic justify kannada katakana katakana-iroha khmer landscape lao large larger left level lighter line-through linear 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 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 navy ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize nw-resize nwse-resize oblique octal open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside overlay overline padding padding-box painted paused persian plus-darker plus-lighter pointer portrait pre pre-line pre-wrap preserve-3d progress push-button radio read-only read-write read-write-plaintext-only relative repeat repeat-x repeat-y reset reverse rgb rgba ridge right round row-resize rtl run-in running s-resize sans-serif scroll scrollbar se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration semi-condensed semi-expanded separate serif show sidama single 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 square square-button start static status-bar stretch stroke sub subpixel-antialiased super sw-resize table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group 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 transparent ultra-condensed ultra-expanded underline up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url vertical vertical-text visible visibleFill visiblePainted visibleStroke visual w-resize wait wave white wider window windowframe windowtext x-large x-small xor xx-large xx-small yellow".split(" "));
|
7
7
|
return{startState:function(a){return{tokenize:h,baseIndent:a||0,stack:[]}},token:function(a,c){if(c.tokenize==h&&a.eatSpace())return null;var b=c.tokenize(a,c),d=c.stack[c.stack.length-1];"property"==b?"propertyValue"==d?b=s[a.current()]?"string-2":r[a.current()]?"keyword":"variable-2":"rule"==d?m[a.current()]||(b+=" error"):!d||"@media{"==d?b="tag":"@media"==d?b=i[a.current()]?"attribute":/^(only|not)$/i.test(a.current())?"keyword":"and"==a.current().toLowerCase()?"error":q[a.current()]?"error":
|
@@ -1,13 +1,14 @@
|
|
1
|
-
CodeMirror.defineMode("javascript",function(R,
|
1
|
+
CodeMirror.defineMode("javascript",function(R,p){var v,j,n,w;function E(a,d){for(var c=!1,f;null!=(f=a.next());){if(f==d&&!c)return!1;c=!c&&"\\"==f}return c}function k(a,d,c){r=a;F=c;return d}function s(a,d){var c=a.next();if('"'==c||"'"==c)return c=S(c),d.tokenize=c,c(a,d);if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),k("number","number");if(/\d/.test(c)||"-"==c&&a.eat(/\d/))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),k("number","number");
|
2
2
|
if("/"==c){if(a.eat("*"))return c=G,d.tokenize=c,c(a,d);if(a.eat("/"))return a.skipToEnd(),k("comment","comment");if("operator"==d.lastType||"keyword c"==d.lastType||/^[\[{}\(,;:]$/.test(d.lastType))return E(a,"/"),a.eatWhile(/[gimy]/),k("regexp","string-2");a.eatWhile(x);return k("operator",null,a.current())}if("#"==c)return a.skipToEnd(),k("error","error");if(x.test(c))return a.eatWhile(x),k("operator",null,a.current());a.eatWhile(/[\w\$_]/);var c=a.current(),f=H.propertyIsEnumerable(c)&&H[c];return f&&
|
3
|
-
"."!=d.lastType?k(f.type,f.style,c):k("variable","variable",c)}function S(a){return function(d,c){E(d,a)||(c.tokenize=s);return k("string","string")}}function G(a,d){for(var c=!1,f;f=a.next();){if("/"==f&&c){d.tokenize=s;break}c="*"==f}return k("comment","comment")}function I(a,d,c,f,b,e){this.indented=a;this.column=d;this.type=c;this.prev=b;this.info=e;null!=f&&(this.align=f)}function l(){for(var a=arguments.length-1;0<=a;a--)v.push(arguments[a])}function b(){l.apply(null,arguments);return!0}function y(a){
|
4
|
-
|
5
|
-
a?b():";"==a?l():b(arguments.callee)}}function o(a){return"var"==a?b(i("vardef"),z,g(";"),e):"keyword a"==a?b(i("form"),h,o,e):"keyword b"==a?b(i("form"),o,e):"{"==a?b(i("}"),A,e):";"==a?b():"function"==a?b(B):"for"==a?b(i("form"),g("("),i(")"),U,g(")"),e,o,e):"variable"==a?b(i("stat"),V):"switch"==a?b(i("form"),h,i("}","switch"),g("{"),A,e,e):"case"==a?b(h,g(":")):"default"==a?b(g(":")):"catch"==a?b(i("form"),
|
6
|
-
b(m):"function"==a?b(B):"keyword c"==a?b(N):"("==a?b(i(")"),N,g(")"),e,m):"operator"==a?b(h):"["==a?b(i("]"),t(h,"]"),e,m):"{"==a?b(i("}"),t(W,"}"),e,m):b()}function N(a){return a.match(/[;\}\)\],]/)?l():l(h)}function m(a,d){if("operator"==a&&/\+\+|--/.test(d))return b(m);if("operator"==a&&"?"==d)return b(h,g(":"),h);if(";"!=a){if("("==a)return b(i(")"),t(h,")"),e,m);if("."==a)return b(X,m);if("["==a)return b(i("]"),
|
7
|
-
a)return n="property",b()}function W(a){"variable"==a&&(n="property");if(M.hasOwnProperty(a))return b(g(":"),h)}function t(a,d){function c(f){return","==f?b(a,c):f==d?b():b(g(d))}return function(f){return f==d?b():l(a,c)}}function A(a){return"}"==a?b():l(o,A)}function O(a){return":"==a?b(Y):l()}function Y(a){return"variable"==a?(n="variable-3",b()):l()}function z(a,d){return"variable"==a?(y(d),C?b(O,D):b(D)):
|
8
|
-
a?b(z,g(";"),u):";"==a?b(u):"variable"==a?b(Z):b(u)}function Z(a,d){return"in"==d?b(h):b(m,u)}function u(a,d){return";"==a?b(P):"in"==d?b(h):b(h,g(";"),P)}function P(a){")"!=a&&b(h)}function B(a,d){if("variable"==a)return y(d),b(B);if("("==a)return b(i(")"),J,t(L,")"),e,o,K)}function L(a,d){if("variable"==a)return y(d),C?b(O):b()}var
|
9
|
-
h={type:"atom",style:"atom"},d={"if":d,"while":d,"with":d,"else":c,"do":c,"try":c,"finally":c,"return":b,"break":b,"continue":b,"new":b,"delete":b,"throw":b,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":h,"false":h,"null":h,undefined:h,NaN:h,Infinity:h};
|
10
|
-
"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:c,number:c,bool:c,any:c},i;for(i in c)d[i]=c[i]}return d}(),x=/[+\-*&%=<>!?|]/,r,F,M={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};v=n=j=null;w=void 0;var T={name:"this",next:{name:"arguments"}};e.lex=!0;return{startState:function(a){return{tokenize:s,
|
11
|
-
|
12
|
-
b.next)if(b.name==i){b=!0;break b}b=void 0}if(b){b="variable-2";break a}b=c;break a}}return b},indent:function(a,b){if(a.tokenize==G)return CodeMirror.Pass;if(a.tokenize!=s)return 0;var c=b&&b.charAt(0),f=a.lexical;"stat"==f.type&&"}"==c&&(f=f.prev);var e=f.type,g=c==e;return"vardef"==e?f.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==e&&"{"==c?f.indented:"form"==e?f.indented+
|
13
|
-
|
3
|
+
"."!=d.lastType?k(f.type,f.style,c):k("variable","variable",c)}function S(a){return function(d,c){E(d,a)||(c.tokenize=s);return k("string","string")}}function G(a,d){for(var c=!1,f;f=a.next();){if("/"==f&&c){d.tokenize=s;break}c="*"==f}return k("comment","comment")}function I(a,d,c,f,b,e){this.indented=a;this.column=d;this.type=c;this.prev=b;this.info=e;null!=f&&(this.align=f)}function l(){for(var a=arguments.length-1;0<=a;a--)v.push(arguments[a])}function b(){l.apply(null,arguments);return!0}function y(a){function d(c){for(;c;c=
|
4
|
+
c.next)if(c.name==a)return!0;return!1}var c=j;c.context?(n="def",d(c.localVars)||(c.localVars={name:a,next:c.localVars})):d(c.globalVars)||(c.globalVars={name:a,next:c.globalVars})}function J(){j.context={prev:j.context,vars:j.localVars};j.localVars=T}function K(){j.localVars=j.context.vars;j.context=j.context.prev}function i(a,d){var c=function(){var c=j;c.lexical=new I(c.indented,w.column(),a,null,c.lexical,d)};c.lex=!0;return c}function e(){var a=j;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=
|
5
|
+
a.lexical.indented),a.lexical=a.lexical.prev)}function g(a){return function(d){return d==a?b():";"==a?l():b(arguments.callee)}}function o(a){return"var"==a?b(i("vardef"),z,g(";"),e):"keyword a"==a?b(i("form"),h,o,e):"keyword b"==a?b(i("form"),o,e):"{"==a?b(i("}"),A,e):";"==a?b():"function"==a?b(B):"for"==a?b(i("form"),g("("),i(")"),U,g(")"),e,o,e):"variable"==a?b(i("stat"),V):"switch"==a?b(i("form"),h,i("}","switch"),g("{"),A,e,e):"case"==a?b(h,g(":")):"default"==a?b(g(":")):"catch"==a?b(i("form"),
|
6
|
+
J,g("("),L,g(")"),o,e,K):l(i("stat"),h,g(";"),e)}function h(a){return M.hasOwnProperty(a)?b(m):"function"==a?b(B):"keyword c"==a?b(N):"("==a?b(i(")"),N,g(")"),e,m):"operator"==a?b(h):"["==a?b(i("]"),t(h,"]"),e,m):"{"==a?b(i("}"),t(W,"}"),e,m):b()}function N(a){return a.match(/[;\}\)\],]/)?l():l(h)}function m(a,d){if("operator"==a&&/\+\+|--/.test(d))return b(m);if("operator"==a&&"?"==d)return b(h,g(":"),h);if(";"!=a){if("("==a)return b(i(")"),t(h,")"),e,m);if("."==a)return b(X,m);if("["==a)return b(i("]"),
|
7
|
+
h,g("]"),e,m)}}function V(a){return":"==a?b(e,o):l(m,g(";"),e)}function X(a){if("variable"==a)return n="property",b()}function W(a){"variable"==a&&(n="property");if(M.hasOwnProperty(a))return b(g(":"),h)}function t(a,d){function c(f){return","==f?b(a,c):f==d?b():b(g(d))}return function(f){return f==d?b():l(a,c)}}function A(a){return"}"==a?b():l(o,A)}function O(a){return":"==a?b(Y):l()}function Y(a){return"variable"==a?(n="variable-3",b()):l()}function z(a,d){return"variable"==a?(y(d),C?b(O,D):b(D)):
|
8
|
+
l()}function D(a,d){if("="==d)return b(h,D);if(","==a)return b(z)}function U(a){return"var"==a?b(z,g(";"),u):";"==a?b(u):"variable"==a?b(Z):b(u)}function Z(a,d){return"in"==d?b(h):b(m,u)}function u(a,d){return";"==a?b(P):"in"==d?b(h):b(h,g(";"),P)}function P(a){")"!=a&&b(h)}function B(a,d){if("variable"==a)return y(d),b(B);if("("==a)return b(i(")"),J,t(L,")"),e,o,K)}function L(a,d){if("variable"==a)return y(d),C?b(O):b()}var q=R.indentUnit,Q=p.json,C=p.typescript,H=function(){function a(a){return{type:a,
|
9
|
+
style:"keyword"}}var d=a("keyword a"),c=a("keyword b"),b=a("keyword c"),e=a("operator"),h={type:"atom",style:"atom"},d={"if":d,"while":d,"with":d,"else":c,"do":c,"try":c,"finally":c,"return":b,"break":b,"continue":b,"new":b,"delete":b,"throw":b,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":h,"false":h,"null":h,undefined:h,NaN:h,Infinity:h};
|
10
|
+
if(C){var c={type:"variable",style:"variable-3"},c={"interface":a("interface"),"class":a("class"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:c,number:c,bool:c,any:c},i;for(i in c)d[i]=c[i]}return d}(),x=/[+\-*&%=<>!?|]/,r,F,M={atom:!0,number:!0,variable:!0,string:!0,regexp:!0};v=n=j=null;w=void 0;var T={name:"this",next:{name:"arguments"}};e.lex=!0;return{startState:function(a){return{tokenize:s,
|
11
|
+
lastType:null,cc:[],lexical:new I((a||0)-q,0,"block",!1),localVars:p.localVars,globalVars:p.globalVars,context:p.localVars&&{vars:p.localVars},indented:0}},token:function(a,d){a.sol()&&(d.lexical.hasOwnProperty("align")||(d.lexical.align=!1),d.indented=a.indentation());if(a.eatSpace())return null;var c=d.tokenize(a,d);if("comment"==r)return c;d.lastType=r;var b;a:{var e=r,i=F,g=d.cc;j=d;w=a;n=null;v=g;d.lexical.hasOwnProperty("align")||(d.lexical.align=!0);for(;;)if((g.length?g.pop():Q?h:o)(e,i)){for(;g.length&&
|
12
|
+
g[g.length-1].lex;)g.pop()();if(n){b=n;break a}if(b="variable"==e)b:{for(b=d.localVars;b;b=b.next)if(b.name==i){b=!0;break b}b=void 0}if(b){b="variable-2";break a}b=c;break a}}return b},indent:function(a,b){if(a.tokenize==G)return CodeMirror.Pass;if(a.tokenize!=s)return 0;var c=b&&b.charAt(0),f=a.lexical;"stat"==f.type&&"}"==c&&(f=f.prev);var e=f.type,g=c==e;return"vardef"==e?f.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==e&&"{"==c?f.indented:"form"==e?f.indented+q:"stat"==e?f.indented+
|
13
|
+
("operator"==a.lastType||","==a.lastType?q:0):"switch"==f.info&&!g?f.indented+(/^(?:case|default)\b/.test(b)?q:2*q):f.align?f.column+(g?0:1):f.indented+(g?0:q)},electricChars:":{}",jsonMode:Q}});CodeMirror.defineMIME("text/javascript","javascript");CodeMirror.defineMIME("text/ecmascript","javascript");CodeMirror.defineMIME("application/javascript","javascript");CodeMirror.defineMIME("application/ecmascript","javascript");CodeMirror.defineMIME("application/json",{name:"javascript",json:!0});
|
14
|
+
CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0});CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0});
|