// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
//
// You can find some technical background for some of the code below
// at http://marijnhaverbeke.nl/blog/#cm-internals .
(function(p){if("object"==typeof exports&&"object"==typeof module)module.exports=p();else{if("function"==typeof define&&define.amd)return define([],p);this.CodeMirror=p()}})(function(){function p(a,b){if(!(this instanceof p))return new p(a,b);this.options=b=b||{};Ta(Te,b,!1);nc(b);var c=b.value;"string"==typeof c&&(c=new O(c,b.mode));this.doc=c;var d=this.display=new Ue(a,c);d.wrapper.CodeMirror=this;nd(this);od(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");b.autofocus&&
!oc&&P(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new pc};ea&&setTimeout(W(X,this,!0),20);Ve(this);pd||(We(),pd=!0);var e=this;fa(this,function(){e.curOp.forceUpdate=!0;qd(e,c);b.autofocus&&!oc||ma()==d.input?setTimeout(W(qc,e),20):yb(e);for(var a in Ia)if(Ia.hasOwnProperty(a))Ia[a](e,b[a],rd);for(a=0;a<rc.length;++a)rc[a](e)})}function Ue(a,b){var c=this.input=t("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
M?c.style.width="1000px":c.setAttribute("wrap","off");Ua&&(c.style.border="1px solid black");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");this.inputDiv=t("div",[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");this.scrollbarH=t("div",[t("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");this.scrollbarV=t("div",[t("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");this.scrollbarFiller=
t("div",null,"CodeMirror-scrollbar-filler");this.gutterFiller=t("div",null,"CodeMirror-gutter-filler");this.lineDiv=t("div",null,"CodeMirror-code");this.selectionDiv=t("div",null,null,"position: relative; z-index: 1");this.cursorDiv=t("div",null,"CodeMirror-cursors");this.measure=t("div",null,"CodeMirror-measure");this.lineMeasure=t("div",null,"CodeMirror-measure");this.lineSpace=t("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");
this.mover=t("div",[t("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=t("div",[this.mover],"CodeMirror-sizer");this.heightForcer=t("div",null,null,"position: absolute; height: "+ga+"px; width: 1px;");this.gutters=t("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=t("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=t("div",[this.inputDiv,this.scrollbarH,this.scrollbarV,
this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");Va&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);Ua&&(c.style.width="0px");M||(this.scroller.draggable=!0);sc&&(this.inputDiv.style.height="1px",this.inputDiv.style.position="absolute");Va&&(this.scrollbarH.style.minHeight=this.scrollbarV.style.minWidth="18px");a.appendChild?a.appendChild(this.wrapper):a(this.wrapper);this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=null;this.lastSizeC=this.viewOffset=
0;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=this.updateLineNumbers=null;this.prevInput="";this.pollingFast=this.alignWidgets=!1;this.poll=new pc;this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.inaccurateSelection=!1;this.maxLine=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.selForContextMenu=null}function tc(a){a.doc.mode=p.getMode(a.options,a.doc.modeOption);Wa(a)}function Wa(a){a.doc.iter(function(a){a.stateAfter&&
(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Xa(a,100);a.state.modeGen++;a.curOp&&R(a)}function sd(a){var b=ta(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ya(a.display)-3);return function(e){if(ua(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function uc(a){var b=a.doc,c=sd(a);b.iter(function(a){var b=c(a);
b!=a.height&&Y(a,b)})}function td(a){var b=ha[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")}function od(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Za(a)}function $a(a){nd(a);R(a);setTimeout(function(){vc(a)},20)}function nd(a){var b=a.display.gutters,c=a.options.gutters;va(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(t("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";wc(a)}function wc(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px";a.display.scrollbarH.style.left=a.options.fixedGutter?b+"px":0}function zb(a){if(0==a.height)return 0;for(var b=a.text.length,c,d=a;c=wa(d,!0);)c=c.find(0,!0),d=c.from.line,b+=c.from.ch-c.to.ch;for(d=a;c=wa(d,!1);)c=c.find(0,!0),b-=d.text.length-
c.from.ch,d=c.to.line,b+=d.text.length-c.to.ch;return b}function xc(a){var b=a.display;a=a.doc;b.maxLine=u(a,a.first);b.maxLineLength=zb(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=zb(a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function nc(a){var b=I(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):-1<b&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function ud(a){var b=a.display.scroller;
return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,barWidth:a.display.scrollbarH.clientWidth,docHeight:Math.round(a.doc.height+vd(a.display))}}function Ab(a,b){b||(b=ud(a));var c=a.display,d=b.docHeight+ga,e=b.scrollWidth>b.clientWidth,f=d>b.clientHeight;f?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=e?ab(c.measure)+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,d-b.clientHeight+(b.barHeight||
c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0");e?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=f?ab(c.measure)+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0");e&&f?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=ab(c.measure)+"px"):
c.scrollbarFiller.style.display="";e&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=ab(c.measure)+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="";!a.state.checkedOverlayScrollbar&&0<b.clientHeight&&(0===ab(c.measure)&&(c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=ia&&!Xe?"12px":"18px",d=function(b){(b.target||b.srcElement)!=c.scrollbarV&&(b.target||b.srcElement)!=
c.scrollbarH&&E(a,wd)(b)},w(c.scrollbarV,"mousedown",d),w(c.scrollbarH,"mousedown",d)),a.state.checkedOverlayScrollbar=!0)}function yc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop),e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,d=xa(b,d),e=xa(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;if(f<d)return{from:f,to:xa(b,Z(u(b,f))+a.wrapper.clientHeight)};if(Math.min(c,b.lastLine())>=e)return{from:xa(b,Z(u(b,c))-a.wrapper.clientHeight),
to:c}}return{from:d,to:Math.max(e,d+1)}}function vc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=zc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function Ac(a,b){return String(a.lineNumberFormatter(b+
a.firstLineNumber))}function zc(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Bb(a,b,c){for(var d=a.display.viewFrom,e=a.display.viewTo,f,g=yc(a.display,a.doc,b),h=!0;;h=!1){var k=a.display.scroller.clientWidth,l;l=a;var m=g,q=c;c=l.display;var n=l.doc;if(c.wrapper.offsetWidth)if(!q&&m.from>=c.viewFrom&&m.to<=c.viewTo&&0==xd(l))l=void 0;else{var r;r=l;if(r.options.lineNumbers){var z=r.doc,z=Ac(r.options,z.first+z.size-1),F=r.display;if(z.length!=F.lineNumChars){var p=
F.measure.appendChild(t("div",[t("div",z)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=p.firstChild.offsetWidth,p=p.offsetWidth-s;F.lineGutter.style.width="";F.lineNumInnerWidth=Math.max(s,F.lineGutter.offsetWidth-p);F.lineNumWidth=F.lineNumInnerWidth+p;F.lineNumChars=F.lineNumInnerWidth?z.length:-1;F.lineGutter.style.width=F.lineNumWidth+"px";wc(r);r=!0}else r=!1}else r=!1;r&&na(l);r=yd(l);s=n.first+n.size;z=Math.max(m.from-l.options.viewportMargin,n.first);F=Math.min(s,m.to+l.options.viewportMargin);
c.viewFrom<z&&20>z-c.viewFrom&&(z=Math.max(n.first,c.viewFrom));c.viewTo>F&&20>c.viewTo-F&&(F=Math.min(s,c.viewTo));oa&&(z=Bc(l.doc,z),F=zd(l.doc,F));m=z!=c.viewFrom||F!=c.viewTo||c.lastSizeC!=c.wrapper.clientHeight;n=l;s=n.display;0==s.view.length||z>=s.viewTo||F<=s.viewFrom?(s.view=Cb(n,z,F),s.viewFrom=z):(s.viewFrom>z?s.view=Cb(n,z,s.viewFrom).concat(s.view):s.viewFrom<z&&(s.view=s.view.slice(bb(n,z))),s.viewFrom=z,s.viewTo<F?s.view=s.view.concat(Cb(n,s.viewTo,F)):s.viewTo>F&&(s.view=s.view.slice(0,
bb(n,F))));s.viewTo=F;c.viewOffset=Z(u(l.doc,c.viewFrom));l.display.mover.style.top=c.viewOffset+"px";n=xd(l);if(m||0!=n||q){q=ma();4<n&&(c.lineDiv.style.display="none");Ye(l,c.updateLineNumbers,r);4<n&&(c.lineDiv.style.display="");q&&ma()!=q&&q.offsetHeight&&q.focus();va(c.cursorDiv);va(c.selectionDiv);m&&(c.lastSizeC=c.wrapper.clientHeight,Xa(l,400));l=l.display;c=l.lineDiv.offsetTop;for(q=0;q<l.view.length;q++)if(m=l.view[q],!m.hidden&&(Va?(r=m.node.offsetTop+m.node.offsetHeight,n=r-c,c=r):(n=
m.node.getBoundingClientRect(),n=n.bottom-n.top),r=m.line.height-n,2>n&&(n=ta(l)),.001<r||-.001>r))if(Y(m.line,n),Ad(m.line),m.rest)for(n=0;n<m.rest.length;n++)Ad(m.rest[n]);l=!0}else l=void 0}else na(l),l=void 0;if(!l)break;f=!0;a.display.maxLineChanged&&!a.options.lineWrapping&&(l=a,c=l.display,q=c.maxLine.text.length,q=Cc(l,Db(l,c.maxLine),q,void 0).left,c.maxLineChanged=!1,q=Math.max(0,q+3),m=Math.max(0,c.sizer.offsetLeft+q+ga-c.scroller.clientWidth),c.sizer.style.minWidth=q+"px",m<l.doc.scrollLeft&&
Ja(l,Math.min(c.scroller.scrollLeft,m),!0));l=ud(a);Dc(a);c=a;q=l;c.display.sizer.style.minHeight=c.display.heightForcer.style.top=q.docHeight+"px";c.display.gutters.style.height=Math.max(q.docHeight,q.clientHeight-ga)+"px";Ab(a,l);M&&a.options.lineWrapping&&(c=a,q=l,c.display.sizer.offsetWidth+c.display.gutters.offsetWidth<c.display.scroller.clientWidth-1&&(c.display.sizer.style.minHeight=c.display.heightForcer.style.top="0px",c.display.gutters.style.height=q.docHeight+"px"));if(h&&a.options.lineWrapping&&
k!=a.display.scroller.clientWidth)c=!0;else if(c=!1,b&&null!=b.top&&(b={top:Math.min(l.docHeight-ga-l.clientHeight,b.top)}),g=yc(a.display,a.doc,b),g.from>=a.display.viewFrom&&g.to<=a.display.viewTo)break}a.display.updateLineNumbers=null;f&&(G(a,"update",a),a.display.viewFrom==d&&a.display.viewTo==e||G(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo));return f}function Ad(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function yd(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:zc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function Ye(a,b,c){function d(b){var c=b.nextSibling;M&&ia&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view,e=
e.viewFrom,l=0;l<k.length;l++){var m=k[l];if(!m.hidden)if(m.node){for(;h!=m.node;)h=d(h);h=f&&null!=b&&b<=e&&m.lineNumber;m.changes&&(-1<I(m.changes,"gutter")&&(h=!1),Bd(a,m,e,c));h&&(va(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(Ac(a.options,e))));h=m.node.nextSibling}else{var q=Ze(a,m,e,c);g.insertBefore(q,h)}e+=m.size}for(;h;)h=d(h)}function Bd(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){var f=b,g=f.text.className,h=Cd(a,f);f.text==f.node&&
(f.node=h.pre);f.text.parentNode.replaceChild(h.pre,f.text);f.text=h.pre;h.bgClass!=f.bgClass||h.textClass!=f.textClass?(f.bgClass=h.bgClass,f.textClass=h.textClass,Ec(f)):g&&(f.text.className=g)}else if("gutter"==f)Dd(a,b,c,d);else if("class"==f)Ec(b);else if("widget"==f){f=b;g=d;f.alignable&&(f.alignable=null);for(var h=f.node.firstChild,k=void 0;h;h=k)k=h.nextSibling,"CodeMirror-linewidget"==h.className&&f.node.removeChild(h);Ed(f,g)}}b.changes=null}function Eb(a){a.node==a.text&&(a.node=t("div",
null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),Va&&(a.node.style.zIndex=2));return a.node}function Cd(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Fd(a,b)}function Ec(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;b&&(b+=" CodeMirror-linebackground");if(a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),
a.background=null);else if(b){var c=Eb(a);a.background=c.insertBefore(t("div",null,b),c.firstChild)}a.line.wrapClass?Eb(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass)||""}function Dd(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=Eb(b),f=b.gutter=f.insertBefore(t("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+
(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px"),b.text);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=f.appendChild(t("div",Ac(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;b<a.options.gutters.length;++b){c=a.options.gutters[b];var g=e.hasOwnProperty(c)&&e[c];g&&f.appendChild(t("div",[g],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+
d.gutterWidth[c]+"px"))}}}function Ze(a,b,c,d){var e=Cd(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);Ec(b);Dd(a,b,c,d);Ed(b,d);return b.node}function Ed(a,b){Gd(a.line,a,b,!0);if(a.rest)for(var c=0;c<a.rest.length;c++)Gd(a.rest[c],a,b,!1)}function Gd(a,b,c,d){if(a.widgets){var e=Eb(b),f=0;for(a=a.widgets;f<a.length;++f){var g=a[f],h=t("div",[g.node],"CodeMirror-linewidget");g.handleMouseEvents||(h.ignoreEvents=!0);var k=g,l=h,m=c;if(k.noHScroll){(b.alignable||
(b.alignable=[])).push(l);var q=m.wrapperWidth;l.style.left=m.fixedPos+"px";k.coverGutter||(q-=m.gutterTotalWidth,l.style.paddingLeft=m.gutterTotalWidth+"px");l.style.width=q+"px"}k.coverGutter&&(l.style.zIndex=5,l.style.position="relative",k.noHScroll||(l.style.marginLeft=-m.gutterTotalWidth+"px"));d&&g.above?e.insertBefore(h,b.gutter||b.text):e.appendChild(h);G(g,"redraw")}}}function Fc(a){return s(a.line,a.ch)}function Gc(a,b){return 0>y(a,b)?b:a}function Hc(a,b){return 0>y(a,b)?a:b}function ja(a,
b){this.ranges=a;this.primIndex=b}function C(a,b){this.anchor=a;this.head=b}function $(a,b){var c=a[b];a.sort(function(a,b){return y(a.from(),b.from())});b=I(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(0<=y(e.to(),d.from())){var f=Hc(e.from(),d.from()),g=Gc(e.to(),d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new C(d?g:f,d?f:g))}}return new ja(a,b)}function pa(a,b){return new ja([new C(a,b||a)],0)}function v(a,b){if(b.line<a.first)return s(a.first,0);var c=
a.first+a.size-1;if(b.line>c)return s(c,u(a,c).text.length);var c=u(a,b.line).text.length,d=b.ch,c=null==d||d>c?s(b.line,c):0>d?s(b.line,0):b;return c}function cb(a,b){return b>=a.first&&b<a.first+a.size}function db(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,d&&(b=0>y(c,a),b!=0>y(d,a)?(a=c,c=d):b!=0>y(c,d)&&(c=d)),new C(a,c)):new C(d||c,c)}function Fb(a,b,c,d){J(a,new ja([db(a,a.sel.primary(),b,c)],0),d)}function Hd(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=db(a,a.sel.ranges[e],
b[e],null);b=$(d,a.sel.primIndex);J(a,b,c)}function Id(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;J(a,$(e,a.sel.primIndex),d)}function $e(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new C(v(a,b[c].anchor),v(a,b[c].head))}};H(a,"beforeSelectionChange",a,c);a.cm&&H(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?$(c.ranges,c.ranges.length-1):b}function Jd(a,b,c){var d=a.history.done,e=A(d);e&&e.ranges?(d[d.length-1]=b,Gb(a,
b,c)):J(a,b,c)}function J(a,b,c){Gb(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,g;if(!(g=d==e.lastOp)&&(g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=A(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:Hb(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastOp=
d;c&&!1!==c.clearRedo&&Kd(e.undone)}function Gb(a,b,c){if(S(a,"beforeSelectionChange")||a.cm&&S(a.cm,"beforeSelectionChange"))b=$e(a,b);var d=c&&c.bias||(0>y(b.primary().head,a.sel.primary().head)?-1:1);Ld(a,Md(a,b,d,!0));c&&!1===c.scroll||!a.cm||Ka(a.cm)}function Ld(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Nd(a.cm)),G(a,"cursorActivity",a))}function Od(a){Ld(a,Md(a,a.sel,null,!1),ya)}function Md(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=
b.ranges[f],h=Ib(a,g.anchor,c,d),k=Ib(a,g.head,c,d);if(e||h!=g.anchor||k!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new C(h,k)}return e?$(e,b.primIndex):b}function Ib(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=u(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var l=h.markedSpans[k],m=l.marker;if((null==l.from||(m.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(m.inclusiveRight?l.to>=f.ch:l.to>f.ch))){if(d&&(H(m,"beforeCursorEnter"),m.explicitlyCleared))if(h.markedSpans){--k;
continue}else break;if(m.atomic){k=m.find(0>g?-1:1);if(0==y(k,f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?v(a,s(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?s(k.line+1,0):null),!k)){if(e){if(!d)return Ib(a,b,c,!0);a.cantEdit=!0;return s(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}function Dc(a){for(var b=a.display,c=a.doc,d=document.createDocumentFragment(),e=document.createDocumentFragment(),f=0;f<c.sel.ranges.length;f++){var g=c.sel.ranges[f],h=g.empty();if(h||a.options.showCursorWhenSelecting){var k=
a,l=d,m=ka(k,g.head,"div"),q=l.appendChild(t("div","\u00a0","CodeMirror-cursor"));q.style.left=m.left+"px";q.style.top=m.top+"px";q.style.height=Math.max(0,m.bottom-m.top)*k.options.cursorHeight+"px";m.other&&(k=l.appendChild(t("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),k.style.display="",k.style.left=m.other.left+"px",k.style.top=m.other.top+"px",k.style.height=.85*(m.other.bottom-m.other.top)+"px")}h||af(a,g,e)}a.options.moveInputWithCursor&&(c=ka(a,c.sel.primary().head,"div"),
f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect(),a=Math.max(0,Math.min(b.wrapper.clientHeight-10,c.top+g.top-f.top)),c=Math.max(0,Math.min(b.wrapper.clientWidth-10,c.left+g.left-f.left)),b.inputDiv.style.top=a+"px",b.inputDiv.style.left=c+"px");aa(b.cursorDiv,d);aa(b.selectionDiv,e)}function af(a,b,c){function d(a,b,c,d){0>b&&(b=0);b=Math.round(b);d=Math.round(d);h.appendChild(t("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==
c?m-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){var f=u(g,b),h=f.text.length,k,q;bf(ba(f),c||0,null==e?h:e,function(g,p,t){var u=Jb(a,s(b,g),"div",f,"left"),v,w;g==p?(v=u,t=w=u.left):(v=Jb(a,s(b,p-1),"div",f,"right"),"rtl"==t&&(t=u,u=v,v=t),t=u.left,w=v.right);null==c&&0==g&&(t=l);3<v.top-u.top&&(d(t,u.top,null,u.bottom),t=l,u.bottom<v.top&&d(t,u.bottom,null,v.top));null==e&&p==h&&(w=m);if(!k||u.top<k.top||u.top==k.top&&u.left<k.left)k=u;if(!q||v.bottom>q.bottom||v.bottom==q.bottom&&v.right>
q.right)q=v;t<l+1&&(t=l);d(t,v.top,w-t,v.bottom)});return{start:k,end:q}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=Pd(a.display),l=k.left,m=f.lineSpace.offsetWidth-k.right,f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var q=u(g,f.line),k=u(g,b.line),k=ca(q)==ca(k),f=e(f.line,f.ch,k?q.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(d(f.right,f.top,null,f.bottom),d(l,b.top,b.left,b.bottom)):d(f.right,f.top,b.left-f.right,f.bottom));f.bottom<
b.top&&d(l,f.bottom,null,b.top)}c.appendChild(h)}function Kb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="";0<a.options.cursorBlinkRate&&(b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Xa(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,W(cf,a))}function cf(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.viewTo)){var c=
+new Date+a.options.workTime,d=eb(b.mode,fb(a,b.frontier));fa(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles,g=Qd(a,e,d,!0);e.styles=g.styles;g.classes?e.styleClasses=g.classes:e.styleClasses&&(e.styleClasses=null);for(var g=!f||f.length!=e.styles.length,h=0;!g&&h<f.length;++h)g=f[h]!=e.styles[h];g&&qa(a,b.frontier,"text");e.stateAfter=eb(b.mode,d)}else Ic(a,e.text,d),e.stateAfter=0==b.frontier%5?eb(b.mode,
d):null;++b.frontier;if(+new Date>c)return Xa(a,a.options.workDelay),!0})})}}function df(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=u(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=T(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function fb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=df(a,b,c),g=f>d.first&&u(d,f-1).stateAfter,g=g?eb(d.mode,g):ef(d.mode);d.iter(f,b,function(c){Ic(a,
c.text,g);c.stateAfter=f==b-1||0==f%5||f>=e.viewFrom&&f<e.viewTo?eb(d.mode,g):null;++f});c&&(d.frontier=f);return g}function vd(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Pd(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=aa(a.measure,t("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function Rd(a,b){if(b>=a.display.viewFrom&&
b<a.display.viewTo)return a.display.view[bb(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function Db(a,b){var c=D(b),d=Rd(a,c);d&&!d.text?d=null:d&&d.changes&&Bd(a,d,c,yd(a));if(!d){var e;e=ca(b);d=D(e);e=a.display.externalMeasured=new Sd(a.doc,e,d);e.lineN=d;d=e.built=Fd(a,e);e.text=d.pre;aa(a.display.lineMeasure,d.pre);d=e}a:if(e=d,e.line==b)c={map:e.measure.map,cache:e.measure.cache};else{for(var f=0;f<e.rest.length;f++)if(e.rest[f]==b){c={map:e.measure.maps[f],
cache:e.measure.caches[f]};break a}for(f=0;f<e.rest.length;f++)if(D(e.rest[f])>c){c={map:e.measure.maps[f],cache:e.measure.caches[f],before:!0};break a}c=void 0}return{line:b,view:d,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function Cc(a,b,c,d){b.before&&(c=-1);var e=c+(d||""),f;if(b.cache.hasOwnProperty(e))f=b.cache[e];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,l=k&&a.display.scroller.clientWidth;
if(!g.measure.heights||k&&g.measure.width!=l){var m=g.measure.heights=[];if(k)for(g.measure.width=l,g=g.text.firstChild.getClientRects(),k=0;k<g.length-1;k++){var l=g[k],q=g[k+1];2<Math.abs(l.bottom-q.bottom)&&m.push((l.bottom+q.top)/2-h.top)}m.push(h.bottom-h.top)}b.hasHeights=!0}var h=d,m=b.map,n,r,z;for(d=0;d<m.length;d+=3){var s=m[d],p=m[d+1];if(c<s)r=0,z=1,f="left";else if(c<p)r=c-s,z=r+1;else if(d==m.length-3||c==p&&m[d+3]>c)z=p-s,r=z-1,c>=p&&(f="right");if(null!=r){n=m[d+2];s==p&&h==(n.insertLeft?
"left":"right")&&(f=h);if("left"==h&&0==r)for(;d&&m[d-2]==m[d-3]&&m[d-1].insertLeft;)n=m[(d-=3)+2],f="left";if("right"==h&&r==p-s)for(;d<m.length-3&&m[d+3]==m[d+4]&&!m[d+5].insertLeft;)n=m[(d+=3)+2],f="right";break}}if(3==n.nodeType){for(;r&&gb(b.line.text.charAt(s+r));)--r;for(;s+z<p&&gb(b.line.text.charAt(s+z));)++z;if(K&&0==r&&z==p-s)c=n.parentNode.getBoundingClientRect();else if(L&&a.options.lineWrapping){var t=hb(n,r,z).getClientRects();c=t.length?t["right"==h?t.length-1:0]:Jc}else c=hb(n,r,
z).getBoundingClientRect()||Jc}else 0<r&&(f=h="right"),c=a.options.lineWrapping&&1<(t=n.getClientRects()).length?t["right"==h?t.length-1:0]:n.getBoundingClientRect();!K||r||c&&(c.left||c.right)||(c=(n=n.parentNode.getClientRects()[0])?{left:n.left,right:n.left+Ya(a.display),top:n.top,bottom:n.bottom}:Jc);n=(c.bottom+c.top)/2-b.rect.top;r=b.view.measure.heights;for(d=0;d<r.length-1&&!(n<r[d]);d++);a=d?r[d-1]:0;n=r[d];f={left:("right"==f?c.right:c.left)-b.rect.left,right:("left"==f?c.left:c.right)-
b.rect.left,top:a,bottom:n};c.left||c.right||(f.bogus=!0);f.bogus||(b.cache[e]=f)}return{left:f.left,right:f.right,top:f.top,bottom:f.bottom}}function Td(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function Ud(a){a.display.externalMeasure=null;va(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)Td(a.display.view[b])}function Za(a){Ud(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=
null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function Kc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=ib(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=Z(b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),
d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function Vd(a,b,c){if("div"==c)return b;var d=b.left;b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=a.display.sizer.getBoundingClientRect(),d+=c.left,b+=c.top);a=a.display.lineSpace.getBoundingClientRect();return{left:d-
a.left,top:b-a.top}}function Jb(a,b,c,d,e){d||(d=u(a.doc,b.line));var f=d;b=b.ch;d=Cc(a,Db(a,d),b,e);return Kc(a,f,d,c)}function ka(a,b,c,d,e){function f(b,f){var g=Cc(a,e,b,f?"right":"left");f?g.left=g.right:g.right=g.left;return Kc(a,d,g,c)}function g(a,b){var c=h[b],d=c.level%2;a==Lc(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=Mc(c)-(c.level%2?0:1),d=!0):a==Mc(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=Lc(c)-c.level%2,d=!1);return d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||u(a.doc,b.line);e||
(e=Db(a,d));var h=ba(d);b=b.ch;if(!h)return f(b);var k=Nc(h,b),k=g(b,k);null!=jb&&(k.other=g(b,jb));return k}function Wd(a,b){var c=0;b=v(a.doc,b);a.options.lineWrapping||(c=Ya(a.display)*b.ch);var d=u(a.doc,b.line),e=Z(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function Lb(a,b,c,d){a=s(a,b);a.xRel=d;c&&(a.outside=!0);return a}function Oc(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return Lb(d.first,0,!0,-1);var e=xa(d,c),f=d.first+d.size-1;if(e>f)return Lb(d.first+
d.size-1,u(d,f).text.length,!0,1);0>b&&(b=0);for(d=u(d,e);;)if(e=ff(a,d,e,b,c),f=(d=wa(d,!1))&&d.find(0,!0),d&&(e.ch>f.from.ch||e.ch==f.from.ch&&0<e.xRel))e=D(d=f.to.line);else return e}function ff(a,b,c,d,e){function f(d){d=ka(a,s(c,d),"line",b,l);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+k;h=!1;return d.left}var g=e-Z(b),h=!1,k=2*a.display.wrapper.clientWidth,l=Db(a,b),m=ba(b),q=b.text.length;e=Mb(b);var n=Nb(b),r=f(e),z=h,p=f(n),t=h;if(d>p)return Lb(c,n,t,1);for(;;){if(m?n==e||
n==Pc(b,e,1):1>=n-e){m=d<r||d-r<=p-d?e:n;for(d-=m==e?r:p;gb(b.text.charAt(m));)++m;return Lb(c,m,m==e?z:t,-1>d?-1:1<d?1:0)}var u=Math.ceil(q/2),v=e+u;if(m)for(var v=e,w=0;w<u;++w)v=Pc(b,v,1);w=f(v);if(w>d){n=v;p=w;if(t=h)p+=1E3;q=u}else e=v,r=w,z=h,q-=u}}function ta(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==za){za=t("pre");for(var b=0;49>b;++b)za.appendChild(document.createTextNode("x")),za.appendChild(t("br"));za.appendChild(document.createTextNode("x"))}aa(a.measure,za);
b=za.offsetHeight/50;3<b&&(a.cachedTextHeight=b);va(a.measure);return b||1}function Ya(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=t("span","xxxxxxxxxx"),c=t("pre",[b]);aa(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function La(a){a.curOp={viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,
scrollToPos:null,id:++gf};Ob++||(ra=[])}function Ma(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&xc(a);if(b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line<d.viewFrom||b.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=Bb(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}!e&&b.selectionChanged&&Dc(a);e||b.startHeight==a.doc.height||
Ab(a);null==d.wheelStartX||null==b.scrollTop&&null==b.scrollLeft&&!b.scrollToPos||(d.wheelStartX=d.wheelStartY=null);null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop&&(e=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop)),d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=e);null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft&&(e=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft)),d.scroller.scrollLeft=d.scrollbarH.scrollLeft=
c.scrollLeft=e,vc(a));if(b.scrollToPos){a:{c=v(a.doc,b.scrollToPos.from);d=v(a.doc,b.scrollToPos.to);e=b.scrollToPos.margin;for(null==e&&(e=0);;){var f=!1,g=ka(a,c),h=d&&d!=c?ka(a,d):g,h=Pb(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-e,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+e),k=a.doc.scrollTop,l=a.doc.scrollLeft;null!=h.scrollTop&&(kb(a,h.scrollTop),1<Math.abs(a.doc.scrollTop-k)&&(f=!0));null!=h.scrollLeft&&(Ja(a,h.scrollLeft),1<Math.abs(a.doc.scrollLeft-l)&&(f=!0));if(!f){c=g;break a}}c=
void 0}b.scrollToPos.isCursor&&a.state.focused&&(d=c,e=a.display,f=e.sizer.getBoundingClientRect(),c=null,0>d.top+f.top?c=!0:d.bottom+f.top>(window.innerHeight||document.documentElement.clientHeight)&&(c=!1),null==c||hf||(d=t("div","\u200b",null,"position: absolute; top: "+(d.top-e.viewOffset-a.display.lineSpace.offsetTop)+"px; height: "+(d.bottom-d.top+ga)+"px; left: "+d.left+"px; width: 2px;"),a.display.lineSpace.appendChild(d),d.scrollIntoView(c),a.display.lineSpace.removeChild(d)))}b.selectionChanged&&
Kb(a);a.state.focused&&b.updateInput&&X(a,b.typing);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(e=0;e<c.length;++e)c[e].lines.length||H(c[e],"hide");if(d)for(e=0;e<d.length;++e)d[e].lines.length&&H(d[e],"unhide");var m;--Ob||(m=ra,ra=null);b.changeObjs&&H(a,"changes",a,b.changeObjs);if(m)for(e=0;e<m.length;++e)m[e]();if(b.cursorActivityHandlers)for(e=0;e<b.cursorActivityHandlers.length;e++)b.cursorActivityHandlers[e](a)}function fa(a,b){if(a.curOp)return b();La(a);try{return b()}finally{Ma(a)}}
function E(a,b){return function(){if(a.curOp)return b.apply(a,arguments);La(a);try{return b.apply(a,arguments)}finally{Ma(a)}}}function B(a){return function(){if(this.curOp)return a.apply(this,arguments);La(this);try{return a.apply(this,arguments)}finally{Ma(this)}}}function Q(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);La(b);try{return a.apply(this,arguments)}finally{Ma(b)}}}function Sd(a,b,c){for(var d=this.line=b,e;d=wa(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);
this.size=(this.rest=e)?D(A(this.rest))-c+1:1;this.node=this.text=null;this.hidden=ua(a,b)}function Cb(a,b,c){var d=[],e;for(e=b;e<c;)b=new Sd(a.doc,u(a.doc,e),e),e+=b.size,d.push(b);return d}function R(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);d||(d=0);var e=a.display;d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)oa&&Bc(a.doc,b)<e.viewTo&&na(a);else if(c<=e.viewFrom)oa&&zd(a.doc,c+d)>e.viewFrom?
na(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)na(a);else if(b<=e.viewFrom){var f=Qb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):na(a)}else if(c>=e.viewTo)(f=Qb(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):na(a);else{var f=Qb(a,b,b,-1),g=Qb(a,c,c+d,1);f&&g?(e.view=e.view.slice(0,f.index).concat(Cb(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):na(a)}if(a=e.externalMeasured)c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&(e.externalMeasured=
null)}function qa(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null);b<d.viewFrom||b>=d.viewTo||(a=d.view[bb(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==I(a,c)&&a.push(c)))}function na(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function bb(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=
c[d].size,0>b)return d}function Qb(a,b,c,d){var e=bb(a,b),f=a.display.view;if(!oa||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=0,h=a.display.viewFrom;g<e;g++)h+=f[g].size;if(h!=b){if(0<d){if(e==f.length-1)return null;b=h+f[e].size-b;e++}else b=h-b;c+=b}for(;Bc(a.doc,c)!=c;){if(e==(0>d?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function xd(a){a=a.display.view;for(var b=0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&!d.changes||++b}return b}function Rb(a){a.display.pollingFast||
a.display.poll.set(a.options.pollInterval,function(){Qc(a);a.state.focused&&Rb(a)})}function lb(a){function b(){Qc(a)||c?(a.display.pollingFast=!1,Rb(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Qc(a){var b=a.display.input,c=a.display.prevInput,d=a.doc;if(!a.state.focused||jf(b)&&!c||Sb(a)||a.options.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);
var e=b.value;if(e==c&&!a.somethingSelected())return!1;if(L&&!K&&a.display.inputHasSelection===e)return X(a),!1;var f=!a.curOp;f&&La(a);a.display.shift=!1;8203!=e.charCodeAt(0)||d.sel!=a.display.selForContextMenu||c||(c="\u200b");for(var g=0,h=Math.min(c.length,e.length);g<h&&c.charCodeAt(g)==e.charCodeAt(g);)++g;for(var h=e.slice(g),k=Na(h),l=a.state.pasteIncoming&&1<k.length&&d.sel.ranges.length==k.length,m=d.sel.ranges.length-1;0<=m;m--){var q=d.sel.ranges[m],n=q.from(),r=q.to();g<c.length?n=s(n.line,
n.ch-(c.length-g)):a.state.overwrite&&q.empty()&&!a.state.pasteIncoming&&(r=s(r.line,Math.min(u(d,r.line).text.length,r.ch+A(k).length)));var z=a.curOp.updateInput,r={from:n,to:r,text:l?[k[m]]:k,origin:a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input"};Oa(a.doc,r);G(a,"inputRead",a,r);if(h&&!a.state.pasteIncoming&&a.options.electricChars&&a.options.smartIndent&&100>q.head.ch&&(!m||d.sel.ranges[m-1].head.line!=q.head.line))if(n=a.getModeAt(q.head),n.electricChars)for(r=0;r<n.electricChars.length;r++){if(-1<
h.indexOf(n.electricChars.charAt(r))){mb(a,q.head.line,"smart");break}}else n.electricInput&&(r=Aa(r),n.electricInput.test(u(d,r.line).text.slice(0,r.ch))&&mb(a,q.head.line,"smart"))}Ka(a);a.curOp.updateInput=z;a.curOp.typing=!0;1E3<e.length||-1<e.indexOf("\n")?b.value=a.display.prevInput="":a.display.prevInput=e;f&&Ma(a);a.state.pasteIncoming=a.state.cutIncoming=!1;return!0}function X(a,b){var c,d,e=a.doc;a.somethingSelected()?(a.display.prevInput="",c=e.sel.primary(),d=(c=Xd&&(100<c.to().line-c.from().line||
1E3<(d=a.getSelection()).length))?"-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&nb(a.display.input),L&&!K&&(a.display.inputHasSelection=d)):b||(a.display.prevInput=a.display.input.value="",L&&!K&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function P(a){"nocursor"==a.options.readOnly||oc&&ma()==a.display.input||a.display.input.focus()}function Rc(a){a.state.focused||(P(a),qc(a))}function Sb(a){return a.options.readOnly||a.doc.cantEdit}function Ve(a){function b(){a.state.focused&&
setTimeout(W(P,a),0)}function c(b){da(a,b)||Sc(b)}function d(b){if(a.somethingSelected())e.inaccurateSelection&&(e.prevInput="",e.inaccurateSelection=!1,e.input.value=a.getSelection(),nb(e.input));else{for(var c="",d=[],k=0;k<a.doc.sel.ranges.length;k++){var l=a.doc.sel.ranges[k].head.line,l={anchor:s(l,0),head:s(l+1,0)};d.push(l);c+=a.getRange(l.anchor,l.head)}"cut"==b.type?a.setSelections(d,null,ya):(e.prevInput="",e.input.value=c,nb(e.input))}"cut"==b.type&&(a.state.cutIncoming=!0)}var e=a.display;
w(e.scroller,"mousedown",E(a,wd));ea?w(e.scroller,"dblclick",E(a,function(b){if(!da(a,b)){var c=Pa(a,b);!c||Tc(a,b,"gutterClick",!0,G)||Ba(a.display,b)||(N(b),b=Uc(a,c),Fb(a.doc,b.anchor,b.head))}})):w(e.scroller,"dblclick",function(b){da(a,b)||N(b)});w(e.lineSpace,"selectstart",function(a){Ba(e,a)||N(a)});Vc||w(e.scroller,"contextmenu",function(b){Yd(a,b)});w(e.scroller,"scroll",function(){e.scroller.clientHeight&&(kb(a,e.scroller.scrollTop),Ja(a,e.scroller.scrollLeft,!0),H(a,"scroll",a))});w(e.scrollbarV,
"scroll",function(){e.scroller.clientHeight&&kb(a,e.scrollbarV.scrollTop)});w(e.scrollbarH,"scroll",function(){e.scroller.clientHeight&&Ja(a,e.scrollbarH.scrollLeft)});w(e.scroller,"mousewheel",function(b){Zd(a,b)});w(e.scroller,"DOMMouseScroll",function(b){Zd(a,b)});w(e.scrollbarH,"mousedown",b);w(e.scrollbarV,"mousedown",b);w(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0});w(e.input,"keyup",E(a,$d));w(e.input,"input",function(){L&&!K&&a.display.inputHasSelection&&(a.display.inputHasSelection=
null);lb(a)});w(e.input,"keydown",E(a,ae));w(e.input,"keypress",E(a,be));w(e.input,"focus",W(qc,a));w(e.input,"blur",W(yb,a));a.options.dragDrop&&(w(e.scroller,"dragstart",function(b){if(L&&(!a.state.draggingText||100>+new Date-ce))Sc(b);else if(!da(a,b)&&!Ba(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.setDragImage&&!de)){var c=t("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
U&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop);b.dataTransfer.setDragImage(c,0,0);U&&c.parentNode.removeChild(c)}}),w(e.scroller,"dragenter",c),w(e.scroller,"dragover",c),w(e.scroller,"drop",E(a,kf)));w(e.scroller,"paste",function(b){Ba(e,b)||(a.state.pasteIncoming=!0,P(a),lb(a))});w(e.input,"paste",function(){if(M&&!a.state.fakedLastChar&&!(200>new Date-a.state.lastMiddleDown)){var b=e.input.selectionStart,c=e.input.selectionEnd;e.input.value+="$";e.input.selectionStart=
b;e.input.selectionEnd=c;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;lb(a)});w(e.input,"cut",d);w(e.input,"copy",d);sc&&w(e.sizer,"mouseup",function(){ma()==e.input&&e.input.blur();P(a)})}function lf(a){var b=a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null;a.setSize()}function Ba(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Pa(a,b,c,d){var e=a.display;if(!c&&(c=b.target||b.srcElement,
c==e.scrollbarH||c==e.scrollbarV||c==e.scrollbarFiller||c==e.gutterFiller))return null;var f,g,e=e.lineSpace.getBoundingClientRect();try{f=b.clientX-e.left,g=b.clientY-e.top}catch(h){return null}b=Oc(a,f,g);var k;d&&1==b.xRel&&(k=u(a.doc,b.line).text).length==b.ch&&(d=T(k,k.length,a.options.tabSize)-k.length,b=s(b.line,Math.max(0,Math.round((f-Pd(a.display).left)/Ya(a.display))-d)));return b}function wd(a){if(!da(this,a)){var b=this.display;b.shift=a.shiftKey;if(Ba(b,a))M||(b.scroller.draggable=!1,
setTimeout(function(){b.scroller.draggable=!0},100));else if(!Tc(this,a,"gutterClick",!0,G)){var c=Pa(this,a);window.focus();switch(ee(a)){case 1:c?mf(this,a,c):(a.target||a.srcElement)==b.scroller&&N(a);break;case 2:M&&(this.state.lastMiddleDown=+new Date);c&&Fb(this.doc,c);setTimeout(W(P,this),20);N(a);break;case 3:Vc&&Yd(this,a)}}}}function mf(a,b,c){setTimeout(W(Rc,a),0);var d=+new Date,e;Tb&&Tb.time>d-400&&0==y(Tb.pos,c)?e="triple":Ub&&Ub.time>d-400&&0==y(Ub.pos,c)?(e="double",Tb={time:d,pos:c}):
(e="single",Ub={time:d,pos:c});var d=a.doc.sel,f=ia?b.metaKey:b.ctrlKey;a.options.dragDrop&&nf&&!Sb(a)&&"single"==e&&-1<d.contains(c)&&d.somethingSelected()?of(a,b,c,f):pf(a,b,c,e,f)}function of(a,b,c,d){var e=a.display,f=E(a,function(g){M&&(e.scroller.draggable=!1);a.state.draggingText=!1;la(document,"mouseup",f);la(e.scroller,"drop",f);10>Math.abs(b.clientX-g.clientX)+Math.abs(b.clientY-g.clientY)&&(N(g),d||Fb(a.doc,c),P(a),ea&&!K&&setTimeout(function(){document.body.focus();P(a)},20))});M&&(e.scroller.draggable=
!0);a.state.draggingText=f;e.scroller.dragDrop&&e.scroller.dragDrop();w(document,"mouseup",f);w(e.scroller,"drop",f)}function pf(a,b,c,d,e){function f(b){if(0!=y(r,b))if(r=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=T(u(l,c.line).text,c.ch,f),h=T(u(l,b.line).text,b.ch,f),k=Math.min(g,h),g=Math.max(g,h),h=Math.min(c.line,b.line),z=Math.min(a.lastLine(),Math.max(c.line,b.line));h<=z;h++){var p=u(l,h).text,t=fe(p,k,f);k==g?e.push(new C(s(h,t),s(h,t))):p.length>t&&e.push(new C(s(h,t),s(h,fe(p,g,f))))}e.length||
e.push(new C(c,c));J(l,$(n.ranges.slice(0,q).concat(e),q),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else e=m,f=e.anchor,k=b,"single"!=d&&(b="double"==d?Uc(a,b):new C(s(b.line,0),v(l,s(b.line+1,0))),0<y(b.anchor,f)?(k=b.head,f=Hc(e.from(),b.anchor)):(k=b.anchor,f=Gc(e.to(),b.head))),e=n.ranges.slice(0),e[q]=new C(v(l,f),k),J(l,$(e,q),Wc)}function g(b){var c=++p,e=Pa(a,b,!0,"rect"==d);if(e)if(0!=y(e,r)){Rc(a);f(e);var h=yc(k,l);(e.line>=h.to||e.line<h.from)&&setTimeout(E(a,function(){p==c&&g(b)}),
150)}else{var m=b.clientY<z.top?-20:b.clientY>z.bottom?20:0;m&&setTimeout(E(a,function(){p==c&&(k.scroller.scrollTop+=m,g(b))}),50)}}function h(b){p=Infinity;N(b);P(a);la(document,"mousemove",t);la(document,"mouseup",x);l.history.lastSelOrigin=null}var k=a.display,l=a.doc;N(b);var m,q,n=l.sel;e&&!b.shiftKey?(q=l.sel.contains(c),m=-1<q?l.sel.ranges[q]:new C(c,c)):m=l.sel.primary();b.altKey?(d="rect",e||(m=new C(c,c)),c=Pa(a,b,!0,!0),q=-1):"double"==d?(b=Uc(a,c),m=a.display.shift||l.extend?db(l,m,b.anchor,
b.head):b):"triple"==d?(b=new C(s(c.line,0),v(l,s(c.line+1,0))),m=a.display.shift||l.extend?db(l,m,b.anchor,b.head):b):m=db(l,m,c);e?-1<q?Id(l,q,m,Wc):(q=l.sel.ranges.length,J(l,$(l.sel.ranges.concat([m]),q),{scroll:!1,origin:"*mouse"})):(q=0,J(l,new ja([m],0),Wc),n=l.sel);var r=c,z=k.wrapper.getBoundingClientRect(),p=0,t=E(a,function(a){(L&&!qf?a.buttons:ee(a))?g(a):h(a)}),x=E(a,h);w(document,"mousemove",t);w(document,"mouseup",x)}function Tc(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(h){return!1}if(f>=
Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&N(b);d=a.display;var k=d.lineDiv.getBoundingClientRect();if(g>k.bottom||!S(a,c))return Xc(b);g-=k.top-d.viewOffset;for(k=0;k<a.options.gutters.length;++k){var l=d.gutters.childNodes[k];if(l&&l.getBoundingClientRect().right>=f)return f=xa(a.doc,g),e(a,c,a,f,a.options.gutters[k],b),Xc(b)}}function kf(a){var b=this;if(!da(b,a)&&!Ba(b.display,a)){N(a);L&&(ce=+new Date);var c=Pa(b,a,!0),d=a.dataTransfer.files;if(c&&!Sb(b))if(d&&d.length&&
window.FileReader&&window.File){var e=d.length,f=Array(e),g=0;a=function(a,d){var h=new FileReader;h.onload=E(b,function(){f[d]=h.result;if(++g==e){c=v(b.doc,c);var a={from:c,to:c,text:Na(f.join("\n")),origin:"paste"};Oa(b.doc,a);Jd(b.doc,pa(c,Aa(a)))}});h.readAsText(a)};for(var h=0;h<e;++h)a(d[h],h)}else if(b.state.draggingText&&-1<b.doc.sel.contains(c))b.state.draggingText(a),setTimeout(W(P,b),20);else try{if(f=a.dataTransfer.getData("Text")){if(b.state.draggingText&&(ia?!a.metaKey:!a.ctrlKey))var k=
b.listSelections();Gb(b.doc,pa(c,c));if(k)for(h=0;h<k.length;++h)Vb(b.doc,"",k[h].anchor,k[h].head,"drag");b.replaceSelection(f,"around","paste");P(b)}}catch(l){}}}function kb(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,ob||Bb(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),ob&&Bb(a),Xa(a,100))}function Ja(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-
a.display.scroller.clientWidth),a.doc.scrollLeft=b,vc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function Zd(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==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);var e=a.display,f=e.scroller;if(c&&f.scrollWidth>f.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&ia&&M){var g=
b.target,h=e.view;a:for(;g!=f;g=g.parentNode)for(var k=0;k<h.length;k++)if(h[k].node==g){a.display.currentWheelTarget=g;break a}}!c||ob||U||null==V?(d&&null!=V&&(g=d*V,h=a.doc.scrollTop,k=h+e.wrapper.clientHeight,0>g?h=Math.max(0,h+g-50):k=Math.min(a.doc.height,k+g+50),Bb(a,{top:h,bottom:k})),20>Wb&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,
a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(V=(V*Wb+a)/(Wb+1),++Wb)}},200)):(e.wheelDX+=c,e.wheelDY+=d))):(d&&kb(a,Math.max(0,Math.min(f.scrollTop+d*V,f.scrollHeight-f.clientHeight))),Ja(a,Math.max(0,Math.min(f.scrollLeft+c*V,f.scrollWidth-f.clientWidth))),N(b),e.wheelStartX=null)}}function Xb(a,b,c){if("string"==typeof b&&(b=Yb[b],!b))return!1;a.display.pollingFast&&Qc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Sb(a)&&(a.state.suppressEdits=
!0),c&&(a.display.shift=!1),e=b(a)!=ge}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function he(a){var b=a.state.keyMaps.slice(0);a.options.extraKeys&&b.push(a.options.extraKeys);b.push(a.options.keyMap);return b}function ie(a,b){var c=Yc(a.options.keyMap),d=c.auto;clearTimeout(je);d&&!rf(b)&&(je=setTimeout(function(){Yc(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,td(a))},50));var e=sf(b,!0),f=!1;if(!e)return!1;f=he(a);if(f=b.shiftKey?Zb("Shift-"+e,f,function(b){return Xb(a,
b,!0)})||Zb(e,f,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Xb(a,b)}):Zb(e,f,function(b){return Xb(a,b)}))N(b),Kb(a),G(a,"keyHandled",a,e,b);return f}function tf(a,b,c){var d=Zb("'"+c+"'",he(a),function(b){return Xb(a,b,!0)});d&&(N(b),Kb(a),G(a,"keyHandled",a,"'"+c+"'",b));return d}function ae(a){Rc(this);if(!da(this,a)){ea&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=ie(this,a);U&&(Zc=c?b:null,!c&&88==b&&!Xd&&(ia?a.metaKey:
a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||uf(this)}}function uf(a){function b(a){18!=a.keyCode&&a.altKey||($b(c,"CodeMirror-crosshair"),la(document,"keyup",b),la(document,"mouseover",b))}var c=a.display.lineDiv;ac(c,"CodeMirror-crosshair");w(document,"keyup",b);w(document,"mouseover",b)}function $d(a){da(this,a)||16!=a.keyCode||(this.doc.sel.shift=!1)}function be(a){if(!da(this,a)){var b=a.keyCode,c=a.charCode;U&&b==Zc?
(Zc=null,N(a)):(U&&(!a.which||10>a.which)||sc)&&ie(this,a)||(b=String.fromCharCode(null==c?b:c),tf(this,a,b)||(L&&!K&&(this.display.inputHasSelection=null),lb(this)))}}function qc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(H(a,"focus",a),a.state.focused=!0,ac(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(X(a),M&&setTimeout(W(X,a,!0),0))),Rb(a),Kb(a))}function yb(a){a.state.focused&&(H(a,"blur",a),a.state.focused=!1,$b(a.display.wrapper,"CodeMirror-focused"));
clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function Yd(a,b){function c(){if(null!=e.input.selectionStart){var b=a.somethingSelected(),c=e.input.value="\u200b"+(b?e.input.value:"");e.prevInput=b?"":"\u200b";e.input.selectionStart=1;e.input.selectionEnd=c.length;e.selForContextMenu=a.doc.sel}}function d(){e.inputDiv.style.position="relative";e.input.style.cssText=h;K&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=g);Rb(a);if(null!=e.input.selectionStart){L&&
!K||c();var b=0,d=function(){e.selForContextMenu==a.doc.sel&&0==e.input.selectionStart?E(a,Yb.selectAll)(a):10>b++?e.detectingSelectAll=setTimeout(d,500):X(a)};e.detectingSelectAll=setTimeout(d,200)}}if(!da(a,b,"contextmenu")){var e=a.display;if(!Ba(e,b)&&!vf(a,b)){var f=Pa(a,b),g=e.scroller.scrollTop;if(f&&!U){a.options.resetSelectionOnContextMenu&&-1==a.doc.sel.contains(f)&&E(a,J)(a.doc,pa(f),ya);var h=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+
(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: "+(L?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";P(a);X(a);a.somethingSelected()||(e.input.value=e.prevInput=" ");e.selForContextMenu=a.doc.sel;clearTimeout(e.detectingSelectAll);L&&!K&&c();if(Vc){Sc(b);var k=function(){la(window,"mouseup",k);setTimeout(d,20)};w(window,"mouseup",k)}else setTimeout(d,50)}}}}function vf(a,
b){return S(a,"gutterContextMenu")?Tc(a,b,"gutterContextMenu",!1,H):!1}function ke(a,b){if(0>y(a,b.from))return a;if(0>=y(a,b.to))return Aa(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=Aa(b).ch-b.to.ch);return s(c,d)}function $c(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new C(ke(e.anchor,b),ke(e.head,b)))}return $(c,a.sel.primIndex)}function le(a,b,c){return a.line==b.line?s(c.line,a.ch-b.ch+c.ch):s(c.line+(a.line-b.line),
a.ch)}function me(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=v(a,b));c&&(this.to=v(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});H(a,"beforeChange",a,b);a.cm&&H(a.cm,"beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Oa(a,b,c){if(a.cm){if(!a.cm.curOp)return E(a.cm,Oa)(a,b,c);if(a.cm.state.suppressEdits)return}if(S(a,"beforeChange")||
a.cm&&S(a.cm,"beforeChange"))if(b=me(a,b,!0),!b)return;if(c=ne&&!c&&wf(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)oe(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else oe(a,b)}function oe(a,b){if(1!=b.text.length||""!=b.text[0]||0!=y(b.from,b.to)){var c=$c(a,b);pe(a,b,c,a.cm?a.cm.curOp.id:NaN);pb(a,b,c,ad(a,b));var d=[];Ca(a,function(a,c){c||-1!=I(d,a.history)||(qe(a.history,b),d.push(a.history));pb(a,b,null,ad(a,b))})}}function bc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d=a.history,
e,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,k=0;k<g.length&&(e=g[k],c?!e.ranges||e.equals(a.sel):e.ranges);k++);if(k!=g.length){for(d.lastOrigin=d.lastSelOrigin=null;;)if(e=g.pop(),e.ranges){Hb(e,h);if(c&&!e.equals(a.sel)){J(a,e,{clearRedo:!1});return}f=e}else break;c=[];Hb(f,h);h.push({changes:c,generation:d.generation});d.generation=e.generation||++d.maxGeneration;d=S(a,"beforeChange")||a.cm&&S(a.cm,"beforeChange");for(k=e.changes.length-1;0<=k;--k){var l=e.changes[k];l.origin=
b;if(d&&!me(a,l,!1)){g.length=0;break}c.push(bd(a,l));f=k?$c(a,l,null):A(g);pb(a,l,f,re(a,l));!k&&a.cm&&a.cm.scrollIntoView(l);var m=[];Ca(a,function(a,b){b||-1!=I(m,a.history)||(qe(a.history,l),m.push(a.history));pb(a,l,null,re(a,l))})}}}}function se(a,b){if(0!=b&&(a.first+=b,a.sel=new ja(cd(a.sel.ranges,function(a){return new C(s(a.anchor.line+b,a.anchor.ch),s(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){R(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)qa(a.cm,
d,"gutter")}}function pb(a,b,c,d){if(a.cm&&!a.cm.curOp)return E(a.cm,pb)(a,b,c,d);if(b.to.line<a.first)se(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);se(a,e);b={from:s(a.first,0),to:s(b.to.line+e,b.to.ch),text:[A(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:s(e,u(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=qb(a,b.from,b.to);c||(c=$c(a,b,null));a.cm?
xf(a.cm,b,d):dd(a,b,d);Gb(a,c,ya)}}function xf(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=D(ca(u(d,f.line))),d.iter(k,g.line+1,function(a){if(a==e.maxLine)return h=!0}));-1<d.sel.contains(b.from,b.to)&&Nd(a);dd(d,b,c,sd(a));a.options.lineWrapping||(d.iter(k,f.line+b.text.length,function(a){var b=zb(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,f.line);Xa(a,
400);c=b.text.length-(g.line-f.line)-1;f.line!=g.line||1!=b.text.length||te(a.doc,b)?R(a,f.line,g.line+1,c):qa(a,f.line,"text");c=S(a,"changes");if((d=S(a,"change"))||c)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},d&&G(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function Vb(a,b,c,d,e){d||(d=c);if(0>y(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=Na(b));Oa(a,{from:c,to:d,text:b,origin:e})}function Pb(a,b,c,d,e){var f=a.display,
g=ta(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,k=f.scroller.clientHeight-ga,l={},m=a.doc.height+vd(f),q=c<g,g=e>m-g;c<h?l.scrollTop=q?0:c:e>h+k&&(c=Math.min(c,(g?m:e)-k),c!=h&&(l.scrollTop=c));a=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft;h=f.scroller.clientWidth-ga;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;c=b<f+10;b<a+f||c?(c&&(b=0),l.scrollLeft=Math.max(0,b-10-f)):d>h+a-3&&(l.scrollLeft=
d+10-h);return l}function cc(a,b,c){null==b&&null==c||dc(a);null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Ka(a){dc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?s(b.line,b.ch-1):b,d=s(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function dc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=
null;var c=Wd(a,b.from),d=Wd(a,b.to),b=Pb(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function mb(a,b,c,d){var e=a.doc,f;null==c&&(c="add");"smart"==c&&(a.doc.mode.indent?f=fb(a,b):c="prev");var g=a.options.tabSize,h=u(e,b),k=T(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var l=h.text.match(/^\s*/)[0],m;if(!d&&!/\S/.test(h.text))m=0,c="not";else if("smart"==c&&(m=a.doc.mode.indent(f,
h.text.slice(l.length),h.text),m==ge)){if(!d)return;c="prev"}"prev"==c?m=b>e.first?T(u(e,b-1).text,null,g):0:"add"==c?m=k+a.options.indentUnit:"subtract"==c?m=k-a.options.indentUnit:"number"==typeof c&&(m=k+c);m=Math.max(0,m);d="";f=0;if(a.options.indentWithTabs)for(c=Math.floor(m/g);c;--c)f+=g,d+="\t";f<m&&(d+=ue(m-f));if(d!=l)Vb(a.doc,d,s(b,0),s(b,l.length),"+input");else for(c=0;c<e.sel.ranges.length;c++)if(a=e.sel.ranges[c],a.head.line==b&&a.head.ch<l.length){f=s(b,l.length);Id(e,c,new C(f,f));
break}h.stateAfter=null}function ec(a,b,c,d){var e=b,f=b,g=a.doc;"number"==typeof b?f=u(g,Math.max(g.first,Math.min(b,g.first+g.size-1))):e=D(b);if(null==e)return null;d(f,e)&&qa(a,e,c);return f}function fc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&0>=y(f.from,A(d).to);){var g=d.pop();if(0>y(g.from,f.from)){f.from=g.from;break}}d.push(f)}fa(a,function(){for(var b=d.length-1;0<=b;b--)Vb(a.doc,"",d[b].from,d[b].to,"+delete");Ka(a)})}function ed(a,b,c,d,e){function f(b){var d=
(e?Pc:ve)(l,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=m=!1:(g=b,b=l=u(a,b));if(b)h=e?(0>c?Nb:Mb)(l):0>c?l.text.length:0;else return m=!1}else h=d;return!0}var g=b.line,h=b.ch,k=c,l=u(a,g),m=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var q=null;d="group"==d;b=a.cm&&a.cm.getHelper(b,"wordChars");for(var n=!0;!(0>c)||f(!n);n=!1){var r=l.text.charAt(h)||"\n",r=gc(r,b)?"w":d&&"\n"==r?"n":!d||/\s/.test(r)?null:"p";!d||n||r||(r="s");if(q&&q!=r){0>
c&&(c=1,f());break}r&&(q=r);if(0<c&&!f(!n))break}}k=Ib(a,s(g,h),k,!0);m||(k.hitSide=!0);return k}function we(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*(d-(0>c?1.5:.5)*ta(a.display))):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){var h=Oc(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function Uc(a,b){var c=u(a.doc,b.line).text,d=b.ch,e=b.ch;if(c){var f=
a.getHelper(b,"wordChars");(0>b.xRel||e==c.length)&&d?--d:++e;for(var g=c.charAt(d),g=gc(g,f)?function(a){return gc(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!gc(a)};0<d&&g(c.charAt(d-1));)--d;for(;e<c.length&&g(c.charAt(e));)++e}return new C(s(b.line,d),s(b.line,e))}function x(a,b,c,d){p.defaults[a]=b;c&&(Ia[a]=d?function(a,b,d){d!=rd&&c(a,b,d)}:c)}function Yc(a){return"string"==typeof a?ha[a]:a}function Qa(a,b,c,d,e){if(d&&d.shared)return yf(a,b,c,d,e);
if(a.cm&&!a.cm.curOp)return E(a.cm,Qa)(a,b,c,d,e);var f=new Da(a,e);e=y(b,c);d&&Ta(d,f,!1);if(0<e||0==e&&!1!==f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=t("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0));if(f.collapsed){if(xe(a,b.line,b,c,f)||b.line!=c.line&&xe(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");oa=!0}f.addToHistory&&pe(a,
{from:b,to:c,origin:"markText"},a.sel,NaN);var g=b.line,h=a.cm,k;a.iter(g,c.line+1,function(a){h&&f.collapsed&&!h.options.lineWrapping&&ca(a)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&Y(a,0);var d=new hc(f,g==b.line?b.ch:null,g==c.line?c.ch:null);a.markedSpans=a.markedSpans?a.markedSpans.concat([d]):[d];d.marker.attachLine(a);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){ua(a,b)&&Y(b,0)});f.clearOnEnter&&w(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(ne=!0,(a.history.done.length||
a.history.undone.length)&&a.clearHistory());f.collapsed&&(f.id=++zf,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)R(h,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(d=b.line;d<=c.line;d++)qa(h,d,"text");f.atomic&&Od(h.doc);G(h,"markerAdded",h,f)}return f}function yf(a,b,c,d,e){d=Ta(d);d.shared=!1;var f=[Qa(a,b,c,d,e)],g=f[0],h=d.widgetNode;Ca(a,function(a){h&&(d.widgetNode=h.cloneNode(!0));f.push(Qa(a,v(a,b),v(a,c),d,e));for(var l=0;l<a.linked.length;++l)if(a.linked[l].isParent)return;
g=A(f)});return new ic(f,g)}function ye(a){return a.findMarks(s(a.first,0),a.clipPos(s(a.lastLine())),function(a){return a.parent})}function Af(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Ca(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==I(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function hc(a,b,c){this.marker=a;this.from=b;this.to=c}function rb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ad(a,
b){var c=cb(a,b.from.line)&&u(a,b.from.line).markedSpans,d=cb(a,b.to.line)&&u(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==y(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var l=c[h],m=l.marker;if(null==l.from||(m.inclusiveLeft?l.from<=e:l.from<e)||!(l.from!=e||"bookmark"!=m.type||g&&l.marker.insertLeft)){var q=null==l.to||(m.inclusiveRight?l.to>=e:l.to>e);(k||(k=[])).push(new hc(m,l.from,q?null:l.to))}}c=k;if(d)for(var h=0,n;h<d.length;++h)if(k=d[h],l=k.marker,null==
k.to||(l.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&"bookmark"==l.type&&(!g||k.marker.insertLeft))m=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(n||(n=[])).push(new hc(l,m?null:k.from-f,null==k.to?null:k.to-f));d=n;g=1==b.text.length;n=A(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=c[f],null==h.to)(k=rb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+n):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=n),null==h.from?(k=rb(c,h.marker),k||(h.from=n,g&&(c||(c=[])).push(h))):
(h.from+=n,g&&(c||(c=[])).push(h));c&&(c=ze(c));d&&d!=c&&(d=ze(d));e=[c];if(!g){var g=b.text.length-2,r;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(r||(r=[])).push(new hc(c[f].marker,null,null));for(f=0;f<g;++f)e.push(r);e.push(d)}return e}function ze(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&!1!==c.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function re(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(Bf(c[d]));c=e}else c=
null;d=ad(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function wf(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;!c.readOnly||d&&-1!=I(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];
for(var e=c.find(0),f=0;f<a.length;++f){var g=a[f];if(!(0>y(g.to,e.from)||0<y(g.from,e.to))){var h=[f,1],k=y(g.from,e.from),l=y(g.to,e.to);(0>k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<l||!c.inclusiveRight&&!l)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function Ae(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Be(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=
b}}function Ce(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=y(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=y(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?c:b.id-a.id}function wa(a,b){var c=oa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||0>Ce(d,e.marker))&&(d=e.marker);return d}function xe(a,b,c,d,e){a=u(a,b);if(a=oa&&a.markedSpans)for(b=0;b<a.length;++b){var f=
a[b];if(f.marker.collapsed){var g=f.marker.find(0),h=y(g.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=y(g.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&0<(y(g.to,c)||(f.marker.inclusiveRight?1:0)-(e.inclusiveLeft?-1:0))||0<=h&&0>(y(g.from,d)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveRight?1:0))))return!0}}}function ca(a){for(var b;b=wa(a,!0);)a=b.find(-1,!0).line;return a}function Bc(a,b){var c=u(a,b),d=ca(c);return c==d?b:D(d)}
function zd(a,b){if(b>a.lastLine())return b;var c=u(a,b),d;if(!ua(a,c))return b;for(;d=wa(c,!1);)c=d.find(1,!0).line;return D(c)+1}function ua(a,b){var c=oa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&fd(a,b,d)))return!0}function fd(a,b,c){if(null==c.to)return b=c.marker.find(1,!0),fd(a,b.line,rb(b.line.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,
e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(null==d.to||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&fd(a,b,d))return!0}function ib(a){if(null!=a.height)return a.height;var b;a:{b=document.body;var c=a.node;if(b.contains)b=b.contains(c);else{for(;c=c.parentNode;)if(c==b){b=!0;break a}b=void 0}}b||aa(a.cm.display.measure,t("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function Cf(a,
b,c,d){var e=new jc(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);ec(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;ua(a.doc,b)||(c=Z(b)<a.doc.scrollTop,Y(b,b.height+ib(e)),c&&cc(a,null,e.height),a.curOp.forceUpdate=!0);return!0});return e}function De(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":
"textClass";null==b[d]?b[d]=c[2]:(new RegExp("(?:^|s)"+c[2]+"(?:$|s)")).test(b[d])||(b[d]+=" "+c[2])}return a}function Ee(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=p.innerMode(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}function gd(a,b,c){for(var d=0;10>d;d++){var e=a.token(b,c);if(b.pos>b.start)return e}throw Error("Mode "+a.name+" failed to advance stream.");}function Fe(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,l=null,m=
new kc(b,a.options.tabSize),q;for(""==b&&De(Ee(c,d),f);!m.eol();){m.pos>a.options.maxHighlightLength?(h=!1,g&&Ic(a,b,d,m.pos),m.pos=b.length,q=null):q=De(gd(c,m,d),f);if(a.options.addModeClass){var n=p.innerMode(c,d).mode.name;n&&(q="m-"+(q?n+" "+q:n))}h&&l==q||(k<m.start&&e(m.start,l),k=m.start,l=q);m.start=m.pos}for(;k<m.pos;)a=Math.min(m.pos,k+5E4),e(a,l),k=a}function Qd(a,b,c,d){var e=[a.state.modeGen],f={};Fe(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(c=0;c<a.state.overlays.length;++c){var g=
a.state.overlays[c],h=1,k=0;Fe(a,b.text,g.mode,!0,function(a,b){for(var c=h;k<a;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d);h+=2;k=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,"cm-overlay "+b),h=c+2;else for(;c<h;c+=2)d=e[c+1],e[c+1]=(d?d+" ":"")+"cm-overlay "+b},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Ge(a,b){if(!b.styles||b.styles[0]!=a.state.modeGen){var c=Qd(a,b,b.stateAfter=fb(a,D(b)));b.styles=c.styles;c.classes?b.styleClasses=c.classes:b.styleClasses&&(b.styleClasses=
null)}return b.styles}function Ic(a,b,c,d){var e=a.doc.mode,f=new kc(b,a.options.tabSize);f.start=f.pos=d||0;for(""==b&&Ee(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)gd(e,f,c),f.start=f.pos}function He(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?Df:Ef;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Fd(a,b){var c=t("span",null,null,M?"padding-right: .1px":null),c={pre:t("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var d=0;d<=(b.rest?b.rest.length:0);d++){var e=
d?b.rest[d-1]:b.line,f;c.pos=0;c.addToken=Ff;(L||M)&&a.getOption("lineWrapping")&&(c.addToken=Gf(c.addToken));var g;if(null!=hd)g=hd;else{g=aa(a.display.measure,document.createTextNode("A\u062eA"));var h=hb(g,0,1).getBoundingClientRect();g=h.left==h.right?!1:hd=3>hb(g,1,2).getBoundingClientRect().right-h.right}g&&(f=ba(e))&&(c.addToken=Hf(c.addToken,f));c.map=[];a:{g=c;var h=Ge(a,e),k=e.markedSpans,l=e.text,m=0;if(k)for(var q=l.length,n=0,r=1,p="",s=void 0,u=0,v=void 0,w=void 0,x=void 0,y=void 0,
A=void 0;;){if(u==n){for(var v=w=x=y="",A=null,u=Infinity,C=[],D=0;D<k.length;++D){var B=k[D],E=B.marker;B.from<=n&&(null==B.to||B.to>n)?(null!=B.to&&u>B.to&&(u=B.to,w=""),E.className&&(v+=" "+E.className),E.startStyle&&B.from==n&&(x+=" "+E.startStyle),E.endStyle&&B.to==u&&(w+=" "+E.endStyle),E.title&&!y&&(y=E.title),E.collapsed&&(!A||0>Ce(A.marker,E))&&(A=B)):B.from>n&&u>B.from&&(u=B.from);"bookmark"==E.type&&B.from==n&&E.widgetNode&&C.push(E)}if(A&&(A.from||0)==n&&(Ie(g,(null==A.to?q+1:A.to)-n,
A.marker,null==A.from),null==A.to))break a;if(!A&&C.length)for(D=0;D<C.length;++D)Ie(g,0,C[D])}if(n>=q)break;for(C=Math.min(q,u);;){if(p){D=n+p.length;A||(B=D>C?p.slice(0,C-n):p,g.addToken(g,B,s?s+v:v,x,n+B.length==u?w:"",y));if(D>=C){p=p.slice(C-n);n=C;break}n=D;x=""}p=l.slice(m,m=h[r++]);s=He(h[r++],g.cm.options)}}else for(var r=1;r<h.length;r+=2)g.addToken(g,l.slice(m,m=h[r]),He(h[r+1],g.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(c.bgClass=id(e.styleClasses.bgClass,c.bgClass||"")),
e.styleClasses.textClass&&(c.textClass=id(e.styleClasses.textClass,c.textClass||"")));0==c.map.length&&c.map.push(0,0,c.content.appendChild(If(a.display.measure)));0==d?(b.measure.map=c.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(c.map),(b.measure.caches||(b.measure.caches=[])).push({}))}H(a,"renderLine",a,b.line,c.pre);c.pre.className&&(c.textClass=id(c.pre.className,c.textClass||""));return c}function Ff(a,b,c,d,e,f){if(b){var g=a.cm.options.specialChars,h=!1;if(g.test(b))for(var k=
document.createDocumentFragment(),l=0;;){g.lastIndex=l;var m=g.exec(b),q=m?m.index-l:b.length-l;if(q){var n=document.createTextNode(b.slice(l,l+q));K?k.appendChild(t("span",[n])):k.appendChild(n);a.map.push(a.pos,a.pos+q,n);a.col+=q;a.pos+=q}if(!m)break;l+=q+1;"\t"==m[0]?(n=a.cm.options.tabSize,m=n-a.col%n,n=k.appendChild(t("span",ue(m),"cm-tab")),a.col+=m):(n=a.cm.options.specialCharPlaceholder(m[0]),K?k.appendChild(t("span",[n])):k.appendChild(n),a.col+=1);a.map.push(a.pos,a.pos+1,n);a.pos++}else{a.col+=
b.length;var k=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,k);K&&(h=!0);a.pos+=b.length}if(c||d||e||h)return b=c||"",d&&(b+=d),e&&(b+=e),d=t("span",[k],b),f&&(d.title=f),a.content.appendChild(d);a.content.appendChild(k)}}function Gf(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":"\u00a0";return b+" "}return function(c,d,e,f,g,h){a(c,d.replace(/ {3,}/g,b),e,f,g,h)}}function Hf(a,b){return function(c,d,e,f,g,h){e=e?e+" cm-force-border":"cm-force-border";for(var k=c.pos,
l=k+d.length;;){for(var m=0;m<b.length;m++){var q=b[m];if(q.to>k&&q.from<=k)break}if(q.to>=l)return a(c,d,e,f,g,h);a(c,d.slice(0,q.to-k),e,f,null,h);f=null;d=d.slice(q.to-k);k=q.to}}}function Ie(a,b,c,d){if(c=!d&&c.widgetNode)a.map.push(a.pos,a.pos+b,c),a.content.appendChild(c);a.pos+=b}function te(a,b){return 0==b.from.ch&&0==b.to.ch&&""==A(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function dd(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);
null!=a.order&&(a.order=null);Ae(a);Be(a,e);c=d?d(a):1;c!=a.height&&Y(a,c);G(a,"change",a,b)}var f=b.from,g=b.to,h=b.text,k=u(a,f.line),l=u(a,g.line),m=A(h),q=c?c[h.length-1]:null,n=g.line-f.line;if(te(a,b)){for(var r=0,p=[];r<h.length-1;++r)p.push(new Ea(h[r],c?c[r]:null,d));e(l,l.text,q);n&&a.remove(f.line,n);p.length&&a.insert(f.line,p)}else if(k==l)if(1==h.length)e(k,k.text.slice(0,f.ch)+m+k.text.slice(g.ch),q);else{p=[];for(r=1;r<h.length-1;++r)p.push(new Ea(h[r],c?c[r]:null,d));p.push(new Ea(m+
k.text.slice(g.ch),q,d));e(k,k.text.slice(0,f.ch)+h[0],c?c[0]:null);a.insert(f.line+1,p)}else if(1==h.length)e(k,k.text.slice(0,f.ch)+h[0]+l.text.slice(g.ch),c?c[0]:null),a.remove(f.line+1,n);else{e(k,k.text.slice(0,f.ch)+h[0],c?c[0]:null);e(l,m+l.text.slice(g.ch),q);r=1;for(p=[];r<h.length-1;++r)p.push(new Ea(h[r],c?c[r]:null,d));1<n&&a.remove(f.line+1,n-1);a.insert(f.line+1,p)}G(a,"change",a,b)}function sb(a){this.lines=a;this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;
this.height=c}function tb(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d],b=b+e.chunkSize(),c=c+e.height;e.parent=this}this.size=b;this.height=c;this.parent=null}function Ca(a,b,c){function d(a,f,g){if(a.linked)for(var h=0;h<a.linked.length;++h){var k=a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function qd(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;uc(a);tc(a);a.options.lineWrapping||xc(a);a.options.mode=
b.modeOption;R(a)}function u(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function qb(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function jd(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function Y(a,
b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function D(a){if(null==a.parent)return null;var b=a.parent;a=I(b.lines,a);for(var 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+b.first}function xa(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+
d}function Z(a){a=ca(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;else b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length&&(e=a.children[d],e!=c);++d)b+=e.height;return b}function ba(a){var b=a.order;null==b&&(b=a.order=Jf(a.text));return b}function lc(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=null;this.generation=this.maxGeneration=a||1}function bd(a,
b){var c={from:Fc(b.from),to:Aa(b),text:qb(a,b.from,b.to)};Je(a,c,b.from.line,b.to.line+1);Ca(a,function(a){Je(a,c,b.from.line,b.to.line+1)},!0);return c}function Kd(a){for(;a.length;)if(A(a).ranges)a.pop();else break}function pe(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g,h;if(h=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==d?(Kd(e.done),g=A(e.done)):e.done.length&&
!A(e.done).ranges?g=A(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),g=A(e.done)):g=void 0,h=g;if(h){var k=A(g.changes);0==y(b.from,b.to)&&0==y(b.from,k.to)?k.to=Aa(b):g.changes.push(bd(a,b))}else for((g=A(e.done))&&g.ranges||Hb(a.sel,e.done),g={changes:[bd(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=d;e.lastOrigin=
e.lastSelOrigin=b.origin;k||H(a,"historyAdded")}function Hb(a,b){var c=A(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Je(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function Bf(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ra(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=
a[d];if(f.ranges)e.push(c?ja.prototype.deepCopy.call(f):f);else{var f=f.changes,g=[];e.push({changes:g});for(var h=0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var m in k)(l=m.match(/^spans_(\d+)$/))&&-1<I(b,Number(l[1]))&&(A(g)[m]=k[m],delete k[m])}}}return e}function Ke(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Le(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<
f.ranges.length;h++)Ke(f.ranges[h].anchor,b,c,d),Ke(f.ranges[h].head,b,c,d)}else{for(h=0;h<f.changes.length;++h){var k=f.changes[h];if(c<k.from.line)k.from=s(k.from.line+d,k.from.ch),k.to=s(k.to.line+d,k.to.ch);else if(b<=k.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function qe(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Le(a.done,c,d,e);Le(a.undone,c,d,e)}function Xc(a){return null!=a.defaultPrevented?a.defaultPrevented:!1==a.returnValue}function ee(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 G(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);ra||(++Ob,ra=[],setTimeout(Kf,0));for(var f=0;f<d.length;++f)ra.push(c(d[f]))}}function Kf(){--Ob;var a=ra;ra=null;for(var b=0;b<a.length;++b)a[b]()}function da(a,b,c){H(a,c||b.type,a,b);return Xc(b)||b.codemirrorIgnore}function Nd(a){var b=a._handlers&&a._handlers.cursorActivity;
if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var c=0;c<b.length;++c)-1==I(a,b[c])&&a.push(b[c])}}function S(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Sa(a){a.prototype.on=function(a,c){w(this,a,c)};a.prototype.off=function(a,c){la(this,a,c)}}function pc(){this.id=null}function fe(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}}
function ue(a){for(;mc.length<=a;)mc.push(A(mc)+" ");return mc[a]}function A(a){return a[a.length-1]}function I(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function cd(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Me(a,b){var c;Object.create?c=Object.create(a):(c=function(){},c.prototype=a,c=new c);b&&Ta(b,c);return c}function Ta(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||!1===c&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function W(a){var b=Array.prototype.slice.call(arguments,
1);return function(){return a.apply(null,b)}}function gc(a,b){return b?-1<b.source.indexOf("\\w")&&Ne(a)?!0:b.test(a):Ne(a)}function Oe(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function gb(a){return 768<=a.charCodeAt(0)&&Lf.test(a)}function t(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function va(a){for(var b=a.childNodes.length;0<
b;--b)a.removeChild(a.firstChild);return a}function aa(a,b){return va(a).appendChild(b)}function ma(){return document.activeElement}function kd(a){return new RegExp("\\b"+a+"\\b\\s*")}function $b(a,b){var c=kd(b);c.test(a.className)&&(a.className=a.className.replace(c,""))}function ac(a,b){kd(b).test(a.className)||(a.className+=" "+b)}function id(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!kd(c[d]).test(b)&&(b+=" "+c[d]);return b}function Pe(a){if(document.body.getElementsByClassName)for(var b=
document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function We(){var a;w(window,"resize",function(){null==a&&(a=setTimeout(function(){ub=a=null;Pe(lf)},100))});w(window,"blur",function(){Pe(yb)})}function ab(a){if(null!=ub)return ub;var b=t("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");aa(a,b);b.offsetWidth&&(ub=b.offsetHeight-b.clientHeight);return ub||0}function If(a){if(null==ld){var b=t("span","\u200b");aa(a,t("span",[b,document.createTextNode("x")]));
0!=a.firstChild.offsetHeight&&(ld=1>=b.offsetWidth&&2<b.offsetHeight&&!Va)}return ld?t("span","\u200b"):t("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}function bf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function Lc(a){return a.level%2?a.to:a.from}function Mc(a){return a.level%2?a.from:a.to}function Mb(a){return(a=
ba(a))?Lc(a[0]):0}function Nb(a){var b=ba(a);return b?Mc(A(b)):a.text.length}function Qe(a,b){var c=u(a.doc,b),d=ca(c);d!=c&&(b=D(d));d=(c=ba(d))?c[0].level%2?Nb(d):Mb(d):0;return s(b,d)}function Nc(a,b){jb=null;for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return c;if(e.from==b||e.to==b)if(null==d)d=c;else{var f;f=e.level;var g=a[d].level,h=a[0].level;f=f==h?!0:g==h?!1:f<g;if(f)return e.from!=e.to&&(jb=d),c;e.from!=e.to&&(jb=c);break}}return d}function md(a,b,c,d){if(!d)return b+c;
do b+=c;while(0<b&&gb(a.text.charAt(b)));return b}function Pc(a,b,c,d){var e=ba(a);if(!e)return ve(a,b,c,d);var f=Nc(e,b),g=e[f];for(b=md(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(Nc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?md(a,g.to,-1,d):md(a,g.from,1,d)}}function ve(a,b,c,d){b+=c;if(d)for(;0<b&&gb(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var ob=/gecko\/\d/i.test(navigator.userAgent),
ea=/MSIE \d/.test(navigator.userAgent),Va=ea&&(null==document.documentMode||8>document.documentMode),K=ea&&(null==document.documentMode||9>document.documentMode),qf=ea&&(null==document.documentMode||10>document.documentMode),Mf=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),L=ea||Mf,M=/WebKit\//.test(navigator.userAgent),Nf=M&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Of=/Chrome\//.test(navigator.userAgent),U=/Opera\//.test(navigator.userAgent),de=/Apple Computer/.test(navigator.vendor),sc=
/KHTML\//.test(navigator.userAgent),Xe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),hf=/PhantomJS/.test(navigator.userAgent),Ua=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),oc=Ua||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ia=Ua||/Mac/.test(navigator.platform),Pf=/win/i.test(navigator.platform),Fa=U&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Fa&&(Fa=Number(Fa[1]));Fa&&15<=Fa&&(U=!1,M=!0);var Re=ia&&(Nf||
U&&(null==Fa||12.11>Fa)),Vc=ob||L&&!K,ne=!1,oa=!1,s=p.Pos=function(a,b){if(!(this instanceof s))return new s(a,b);this.line=a;this.ch=b},y=p.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};ja.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=y(c.anchor,d.anchor)||0!=y(c.head,d.head))return!1}return!0},
deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new C(Fc(this.ranges[b].anchor),Fc(this.ranges[b].head));return new ja(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(0<=y(b,d.from())&&0>=y(a,d.to()))return c}return-1}};C.prototype={from:function(){return Hc(this.anchor,this.head)},to:function(){return Gc(this.anchor,
this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Jc={left:0,right:0,top:0,bottom:0},za,gf=0,Ub,Tb,ce=0,Wb=0,V=null;L?V=-.53:ob?V=15:Of?V=-.7:de&&(V=-1/3);var je,Zc=null,Aa=p.changeEnd=function(a){return a.text?s(a.from.line+a.text.length-1,A(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};p.prototype={constructor:p,focus:function(){window.focus();P(this);lb(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=
b,Ia.hasOwnProperty(a)&&E(this,Ia[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:B(function(a,b){var c=a.token?a:p.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,
modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;R(this)}),removeOverlay:B(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++;R(this);break}}}),indentLine:B(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");cb(this.doc,a)&&mb(this,a,b,c)}),indentSelection:B(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=
b[d];if(e.empty())e.head.line>c&&(mb(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Ka(this));else for(var f=Math.max(c,e.from().line),c=e.to(),c=Math.min(this.lastLine(),c.line-(c.ch?0:1))+1;f<c;++f)mb(this,f,a)}}),getTokenAt:function(a,b){var c=this.doc;a=v(c,a);for(var d=fb(this,a.line,b),e=this.doc.mode,c=u(c,a.line),c=new kc(c.text,this.options.tabSize);c.pos<a.ch&&!c.eol();){c.start=c.pos;var f=gd(e,c,d)}return{start:c.start,end:c.pos,string:c.current(),type:f||null,state:d}},
getTokenTypeAt:function(a){a=v(this.doc,a);var b=Ge(this,u(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;var e;if(0==a)e=b[2];else for(;;){var f=c+d>>1;if((f?b[2*f-1]:0)>=a)d=f;else if(b[2*f+1]<a)c=f+1;else{e=b[2*f+2];break}}b=e?e.indexOf("cm-overlay "):-1;return 0>b?e:0==b?null:e.slice(0,b-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?p.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!Ga.hasOwnProperty(b))return Ga;
var d=Ga[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(f=0;f<d._global.length;f++)g=d._global[f],g.pred(e,this)&&-1==I(c,g.val)&&c.push(g.val);return c},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return fb(this,a+1,b)},cursorCoords:function(a,
b){var c;c=this.doc.sel.primary();c=null==a?c.head:"object"==typeof a?v(this.doc,a):a?c.from():c.to();return ka(this,c,b||"page")},charCoords:function(a,b){return Jb(this,v(this.doc,a),b||"page")},coordsChar:function(a,b){a=Vd(this,a,b||"page");return Oc(this,a.left,a.top)},lineAtHeight:function(a,b){a=Vd(this,{top:a,left:0},b||"page").top;return xa(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,
c=!0);d=u(this.doc,a);return Kc(this,d,{top:0,left:0},b||"page").top+(c?this.doc.height-Z(d):0)},defaultTextHeight:function(){return ta(this.display)},defaultCharWidth:function(){return Ya(this.display)},setGutterMarker:B(function(a,b,c){return ec(this,a,"gutter",function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Oe(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:B(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=
null,qa(b,d,"gutter"),Oe(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:B(function(a,b,c){return ec(this,a,"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if((new RegExp("(?:^|\\s)"+c+"(?:$|\\s)")).test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:B(function(a,b,c){return ec(this,a,"class",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.match(new RegExp("(?:^|\\s+)"+
c+"(?:$|\\s+)"));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:B(function(a,b,c){return Cf(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!cb(this.doc,a))return null;var b=a;a=u(this.doc,a);if(!a)return null}else if(b=D(a),null==b)return null;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.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ka(this,v(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-
b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"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&&(a=Pb(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&kb(this,a.scrollTop),null!=a.scrollLeft&&Ja(this,a.scrollLeft))},triggerOnKeyDown:B(ae),triggerOnKeyPress:B(be),triggerOnKeyUp:B($d),
execCommand:function(a){if(Yb.hasOwnProperty(a))return Yb[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=v(this.doc,a);f<b&&(a=ed(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:B(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?ed(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Ha)}),deleteH:B(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):
fc(this,function(d){var e=ed(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=v(this.doc,a);f<b&&(a=ka(this,a,"div"),null==d?d=a.left:a.left=d,a=we(this,a,e,c),!a.hitSide);++f);return a},moveV:B(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var k=ka(c,g.head,"div");null!=g.goalColumn&&(k.left=g.goalColumn);
e.push(k.left);var l=we(c,k,a,b);"page"==b&&g==d.sel.primary()&&cc(c,null,Jb(c,l,"div").top-k.top);return l},Ha);if(e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?ac(this.display.cursorDiv,"CodeMirror-overwrite"):$b(this.display.cursorDiv,"CodeMirror-overwrite"),H(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return ma()==this.display.input},
scrollTo:B(function(a,b){null==a&&null==b||dc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller,b=ga;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:B(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:s(a,0),to:null}:
null==a.from&&(a={from:a,to:null});a.to||(a.to=a.from);a.margin=b||0;if(null!=a.from.line)dc(this),this.curOp.scrollToPos=a;else{var c=Pb(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:B(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=
c(b));this.options.lineWrapping&&Ud(this);this.curOp.forceUpdate=!0;H(this,"refresh",this)}),operation:function(a){return fa(this,a)},refresh:B(function(){var a=this.display.cachedTextHeight;R(this);this.curOp.forceUpdate=!0;Za(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);wc(this);(null==a||.5<Math.abs(a-ta(this.display)))&&uc(this);H(this,"refresh",this)}),swapDoc:B(function(a){var b=this.doc;b.cm=null;qd(this,a);Za(this);X(this);this.scrollTo(a.scrollLeft,a.scrollTop);G(this,"swapDoc",
this,b);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Sa(p);var Te=p.defaults={},Ia=p.optionHandlers={},rd=p.Init={toString:function(){return"CodeMirror.Init"}};x("value","",function(a,b){a.setValue(b)},!0);x("mode",null,function(a,b){a.doc.modeOption=b;tc(a)},!0);x("indentUnit",2,tc,!0);x("indentWithTabs",
!1);x("smartIndent",!0);x("tabSize",4,function(a){Wa(a);Za(a);R(a)},!0);x("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g");a.refresh()},!0);x("specialCharPlaceholder",function(a){var b=t("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);return b},function(a){a.refresh()},!0);x("electricChars",!0);x("rtlMoveVisually",!Pf);x("wholeLineUpdateBefore",!0);x("theme","default",
function(a){od(a);$a(a)},!0);x("keyMap","default",td);x("extraKeys",null);x("lineWrapping",!1,function(a){a.options.lineWrapping?(ac(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):($b(a.display.wrapper,"CodeMirror-wrap"),xc(a));uc(a);R(a);Za(a);setTimeout(function(){Ab(a)},100)},!0);x("gutters",[],function(a){nc(a.options);$a(a)},!0);x("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?zc(a.display)+"px":"0";a.refresh()},!0);x("coverGutterNextToScrollbar",!1,Ab,
!0);x("lineNumbers",!1,function(a){nc(a.options);$a(a)},!0);x("firstLineNumber",1,$a,!0);x("lineNumberFormatter",function(a){return a},$a,!0);x("showCursorWhenSelecting",!1,Dc,!0);x("resetSelectionOnContextMenu",!0);x("readOnly",!1,function(a,b){"nocursor"==b?(yb(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||X(a))});x("disableInput",!1,function(a,b){b||X(a)},!0);x("dragDrop",!0);x("cursorBlinkRate",530);x("cursorScrollMargin",0);x("cursorHeight",1);x("workTime",100);x("workDelay",
100);x("flattenSpans",!0,Wa,!0);x("addModeClass",!1,Wa,!0);x("pollInterval",100);x("undoDepth",200,function(a,b){a.doc.history.undoDepth=b});x("historyEventDelay",1250);x("viewportMargin",10,function(a){a.refresh()},!0);x("maxHighlightLength",1E4,Wa,!0);x("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});x("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});x("autofocus",null);var Se=p.modes={},vb=p.mimeModes={};p.defineMode=function(a,
b){p.defaults.mode||"null"==a||(p.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Se[a]=b};p.defineMIME=function(a,b){vb[a]=b};p.resolveMode=function(a){if("string"==typeof a&&vb.hasOwnProperty(a))a=vb[a];else if(a&&"string"==typeof a.name&&vb.hasOwnProperty(a.name)){var b=vb[a.name];"string"==typeof b&&(b={name:b});a=Me(b,a);a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return p.resolveMode("application/xml");
return"string"==typeof a?{name:a}:a||{name:"null"}};p.getMode=function(a,b){b=p.resolveMode(b);var c=Se[b.name];if(!c)return p.getMode(a,"text/plain");c=c(a,b);if(wb.hasOwnProperty(b.name)){var d=wb[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;b.helperType&&(c.helperType=b.helperType);if(b.modeProps)for(e in b.modeProps)c[e]=b.modeProps[e];return c};p.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});p.defineMIME("text/plain",
"null");var wb=p.modeExtensions={};p.extendMode=function(a,b){var c=wb.hasOwnProperty(a)?wb[a]:wb[a]={};Ta(b,c)};p.defineExtension=function(a,b){p.prototype[a]=b};p.defineDocExtension=function(a,b){O.prototype[a]=b};p.defineOption=x;var rc=[];p.defineInitHook=function(a){rc.push(a)};var Ga=p.helpers={};p.registerHelper=function(a,b,c){Ga.hasOwnProperty(a)||(Ga[a]=p[a]={_global:[]});Ga[a][b]=c};p.registerGlobalHelper=function(a,b,c,d){p.registerHelper(a,b,d);Ga[a]._global.push({pred:c,val:d})};var eb=
p.copyState=function(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},ef=p.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};p.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var Yb=p.commands={selectAll:function(a){a.setSelection(s(a.firstLine(),0),s(a.lastLine()),ya)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),
a.getCursor("head"),ya)},killLine:function(a){fc(a,function(b){if(b.empty()){var c=u(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:s(b.head.line+1,0)}:{from:b.head,to:s(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){fc(a,function(b){return{from:s(b.from().line,0),to:v(a.doc,s(b.to().line+1,0))}})},delLineLeft:function(a){fc(a,function(a){return{from:s(a.from().line,0),to:a.from()}})},undo:function(a){a.undo()},redo:function(a){a.redo()},
undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(s(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(s(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return Qe(a,b.head.line)},Ha)},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){var c=Qe(a,b.head.line),d=a.getLineHandle(c.line),e=ba(d);return e&&0!=e[0].level?c:(d=Math.max(0,d.text.search(/\S/)),s(c.line,b.head.line==c.line&&
b.head.ch<=d&&b.head.ch?0:d))},Ha)},goLineEnd:function(a){a.extendSelectionsBy(function(b){b=b.head.line;for(var c,d=u(a.doc,b);c=wa(d,!1);)d=c.find(1,!0).line,b=null;c=(c=ba(d))?c[0].level%2?Mb(d):Nb(d):d.text.length;return s(null==b?D(d):b,c)},Ha)},goLineRight:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div")},Ha)},goLineLeft:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,
"div").top+5;return a.coordsChar({left:0,top:b},"div")},Ha)},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")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,
"group")},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")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t")},
insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),f=T(a.getLine(f.line),f.ch,d);b.push(Array(d-f%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){fa(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=u(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new s(e.line,e.ch-1)),0<e.ch)e=new s(e.line,
e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),s(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=u(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+"\n"+g.charAt(g.length-1),s(e.line-1,g.length-1),s(e.line,1),"+transpose")}c.push(new C(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){fa(a,function(){for(var b=a.listSelections().length,c=0;c<b;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input");a.indentLine(d.from().line+1,null,!0);Ka(a)}})},
toggleOverwrite:function(a){a.toggleOverwrite()}},ha=p.keyMap={};ha.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};ha.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo",
"Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection",
"Alt-U":"redoSelection",fallthrough:"basic"};ha.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":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace",
"Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]};ha.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore",
"Ctrl-K":"killLine","Ctrl-T":"transposeChars"};ha["default"]=ia?ha.macDefault:ha.pcDefault;var Zb=p.lookupKey=function(a,b,c){function d(b){b=Yc(b);var e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return d(b);for(e=0;e<b.length;++e){var f=d(b[e]);if(f)return f}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}},rf=p.isModifierKey=function(a){a=
sa[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a},sf=p.keyName=function(a,b){if(U&&34==a.keyCode&&a["char"])return!1;var c=sa[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(Re?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(Re?a.ctrlKey:a.metaKey)c="Cmd-"+c;!b&&a.shiftKey&&(c="Shift-"+c);return c};p.fromTextArea=function(a,b){function c(){a.value=k.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);!b.placeholder&&a.placeholder&&(b.placeholder=
a.placeholder);if(null==b.autofocus){var d=ma();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form&&(w(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var e=a.form,f=e.submit;try{var g=e.submit=function(){c();e.submit=f;e.submit();e.submit=g}}catch(h){}}a.style.display="none";var k=p(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);k.save=c;k.getTextArea=function(){return a};k.toTextArea=function(){c();a.parentNode.removeChild(k.getWrapperElement());a.style.display=
"";a.form&&(la(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=f))};return k};var kc=p.StringStream=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};kc.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){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;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(){this.lastColumnPos<
this.start&&(this.lastColumnValue=T(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?T(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return T(this.string,null,this.tabSize)-(this.lineStart?T(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==
d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=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)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var Da=p.TextMarker=function(a,b){this.lines=[];this.type=b;this.doc=a};Sa(Da);Da.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&La(a);if(S(this,
"clear")){var c=this.find();c&&G(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=rb(f.markedSpans,this);a&&!this.collapsed?qa(a,D(f),"text"):a&&(null!=g.to&&(d=D(f)),null!=g.from&&(c=D(f)));for(var h=f,k=f.markedSpans,l=g,m=void 0,q=0;q<k.length;++q)k[q]!=l&&(m||(m=[])).push(k[q]);h.markedSpans=m;null==g.from&&this.collapsed&&!ua(this.doc,f)&&a&&Y(f,ta(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=ca(this.lines[e]),
g=zb(f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&R(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Od(a.doc));a&&G(a,"markerCleared",a,this);b&&Ma(a);this.parent&&this.parent.clear()}};Da.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=rb(f.markedSpans,this);if(null!=
g.from&&(c=s(b?f:D(f),g.from),-1==a))return c;if(null!=g.to&&(d=s(b?f:D(f),g.to),1==a))return d}return c&&{from:c,to:d}};Da.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&fa(c,function(){var d=a.line,e=D(a.line);if(e=Rd(c,e))Td(e),c.curOp.selectionChanged=c.curOp.forceUpdate=!0;c.curOp.updateMaxLine=!0;ua(b.doc,d)||null==b.height||(e=b.height,b.height=null,(e=ib(b)-e)&&Y(d,d.height+e))})};Da.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=
this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=I(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Da.prototype.detachLine=function(a){this.lines.splice(I(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};var zf=0,ic=p.SharedTextMarker=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Sa(ic);ic.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=
!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();G(this,"clear")}};ic.prototype.find=function(a,b){return this.primary.find(a,b)};var jc=p.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Sa(jc);jc.prototype.clear=function(){var a=this.cm,b=this.line.widgets,c=this.line,d=D(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=ib(this);fa(a,function(){var b=-f;Z(c)<(a.curOp&&
a.curOp.scrollTop||a.doc.scrollTop)&&cc(a,null,b);qa(a,d,"widget");Y(c,Math.max(0,c.height-f))})}};jc.prototype.changed=function(){var a=this.height,b=this.cm,c=this.line;this.height=null;var d=ib(this)-a;d&&fa(b,function(){b.curOp.forceUpdate=!0;Z(c)<(b.curOp&&b.curOp.scrollTop||b.doc.scrollTop)&&cc(b,null,d);Y(c,c.height+d)})};var Ea=p.Line=function(a,b,c){this.text=a;Be(this,b);this.height=c?c(this):1};Sa(Ea);Ea.prototype.lineNo=function(){return D(this)};var Ef={},Df={};sb.prototype={chunkSize:function(){return this.lines.length},
removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Ae(f);G(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};tb.prototype={chunkSize:function(){return this.size},removeInner:function(a,
b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof sb))&&(c=[],this.collapse(c),this.children=[new sb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},
insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<=f){e.insertInner(a,b,c);if(e.lines&&50<e.lines.length){for(;50<e.lines.length;)a=e.lines.splice(e.lines.length-25,25),a=new sb(a),e.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new tb(b);if(a.parent){a.size-=
b.size;a.height-=b.height;var c=I(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new tb(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return!0;if(0==(b-=f))break;a=0}else a-=f}}};var Qf=0,O=p.Doc=function(a,b,c){if(!(this instanceof O))return new O(a,b,c);null==c&&(c=0);tb.call(this,
[new sb([new Ea("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=s(c,0);this.sel=pa(c);this.history=new lc(null);this.id=++Qf;this.modeOption=b;"string"==typeof a&&(a=Na(a));dd(this,{from:c,to:c,text:a});J(this,pa(c),ya)};O.prototype=Me(tb.prototype,{constructor:O,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;
this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=jd(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:Q(function(a){var b=s(this.first,0),c=this.first+this.size-1;Oa(this,{from:b,to:s(c,u(this,c).text.length),text:Na(a),origin:"setValue"},!0);J(this,pa(b))}),replaceRange:function(a,b,c,d){b=v(this,b);c=c?v(this,c):b;Vb(this,a,b,c,d)},getRange:function(a,b,c){a=qb(this,v(this,a),v(this,b));return!1===
c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(cb(this,a))return u(this,a)},getLineNumber:function(a){return D(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=u(this,a));return ca(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return v(this,a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==
a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Q(function(a,b,c){a=v(this,"number"==typeof a?s(a,b||0):a);J(this,pa(a,null),c)}),setSelection:Q(function(a,b,c){var d=v(this,a);a=v(this,b||a);J(this,pa(d,a),c)}),extendSelection:Q(function(a,b,c){Fb(this,v(this,a),b&&v(this,b),c)}),extendSelections:Q(function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=
v(this,a[d]);Hd(this,c)}),extendSelectionsBy:Q(function(a,b){Hd(this,cd(this.sel.ranges,a),b)}),setSelections:Q(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new C(v(this,a[d].anchor),v(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));J(this,$(e,b),c)}}),addSelection:Q(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new C(v(this,a),v(this,b||a)));J(this,$(d,d.length-1),c)}),getSelection:function(a){for(var b=this.sel.ranges,c,d=0;d<b.length;d++){var e=
qb(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return!1===a?c:c.join(a||"\n")},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=qb(this,c[d].from(),c[d].to());!1!==a&&(e=e.join(a||"\n"));b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Q(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),
text:Na(a[f]),origin:c}}if(f=b&&"end"!=b){f=[];c=a=s(this.first,0);for(e=0;e<d.length;e++){var h=d[e],g=le(h.from,a,c),k=le(Aa(h),a,c);a=h.to;c=k;"around"==b?(h=this.sel.ranges[e],h=0>y(h.head,h.anchor),f[e]=new C(h?k:g,h?g:k)):f[e]=new C(g,g)}f=new ja(f,this.sel.primIndex)}b=f;for(f=d.length-1;0<=f;f--)Oa(this,d[f]);b?Jd(this,b):this.cm&&Ka(this.cm)}),undo:Q(function(){bc(this,"undo")}),redo:Q(function(){bc(this,"redo")}),undoSelection:Q(function(){bc(this,"undo",!0)}),redoSelection:Q(function(){bc(this,
"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new lc(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastOrigin=null);return this.history.generation},
isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ra(this.history.done),undone:Ra(this.history.undone)}},setHistory:function(a){var b=this.history=new lc(this.history.maxGeneration);b.done=Ra(a.done.slice(0),null,!0);b.undone=Ra(a.undone.slice(0),null,!0)},markText:function(a,b,c){return Qa(this,v(this,a),v(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,
shared:b&&b.shared};a=v(this,a);return Qa(this,a,a,c,"bookmark")},findMarksAt:function(a){a=v(this,a);var b=[],c=u(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=v(this,a);b=v(this,b);var d=[],e=a.line;this.iter(a.line,b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g<f.length;g++){var h=f[g];e==a.line&&a.ch>h.to||null==h.from&&e!=a.line||e==b.line&&
h.from>b.ch||c&&!c(h.marker)||d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return v(this,s(c,b))},indexFromPos:function(a){a=v(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+
1});return b},copy:function(a){var b=new O(jd(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new O(jd(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);
(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=ye(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from),e=b.clipPos(e.to);y(f,e)&&(f=Qa(b,f,e,d.primary,d.primary.type),d.markers.push(f),f.parent=d)}return b},unlinkDoc:function(a){a instanceof p&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);Af(ye(this));break}if(a.history==
this.history){var c=[a.id];Ca(a,function(a){c.push(a.id)},!0);a.history=new lc(null);a.history.done=Ra(this.history.done,c);a.history.undone=Ra(this.history.undone,c)}},iterLinkedDocs:function(a){Ca(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});O.prototype.eachLine=O.prototype.iter;var Rf=["iter","insert","remove","copy","getEditor"],xb;for(xb in O.prototype)O.prototype.hasOwnProperty(xb)&&0>I(Rf,xb)&&(p.prototype[xb]=function(a){return function(){return a.apply(this.doc,
arguments)}}(O.prototype[xb]));Sa(O);var N=p.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},Sf=p.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},Sc=p.e_stop=function(a){N(a);Sf(a)},w=p.on=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))},la=p.off=function(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}},H=p.signal=function(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)},ra,Ob=0,ga=30,ge=p.Pass={toString:function(){return"CodeMirror.Pass"}},ya={scroll:!1},Wc={origin:"*mouse"},Ha={origin:"+move"};pc.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var T=
p.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(0>f||f>=b)return e+(b-d);e+=f-d;e+=c-e%c;d=f+1}},mc=[""],nb=function(a){a.select()};Ua?nb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:L&&(nb=function(a){try{a.select()}catch(b){}});[].indexOf&&(I=function(a,b){return a.indexOf(b)});[].map&&(cd=function(a,b){return a.map(b)});var Tf=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,
Ne=p.isWordChar=function(a){return/\w/.test(a)||"\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||Tf.test(a))},Lf=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,
hb;hb=document.createRange?function(a,b,c){var d=document.createRange();d.setEnd(a,c);d.setStart(a,b);return d}:function(a,b,c){var d=document.body.createTextRange();d.moveToElementText(a.parentNode);d.collapse(!0);d.moveEnd("character",c);d.moveStart("character",b);return d};ea&&(ma=function(){try{return document.activeElement}catch(a){return document.body}});var pd=!1,nf=function(){if(K)return!1;var a=t("div");return"draggable"in a||"dragDrop"in a}(),ub,ld,hd,Na=p.splitLines=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/)},jf=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?0!=b.compareEndPoints("StartToEnd",b):!1},Xd=
function(){var a=t("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),sa={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",
219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};p.keyNames=sa;(function(){for(var a=0;10>a;a++)sa[a+48]=sa[a+96]=String(a);for(a=65;90>=a;a++)sa[a]=String.fromCharCode(a);for(a=1;12>=a;a++)sa[a+111]=sa[a+63235]="F"+a})();var jb,Jf=function(){function a(a){return 247>=a?c.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1773>=a?d.charAt(a-1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":
8204==a?"b":"L"}function b(a,b,c){this.level=a;this.from=b;this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",
e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,k=/[1n]/;return function(c){if(!e.test(c))return!1;for(var d=c.length,q=[],n=0,r;n<d;++n)q.push(a(c.charCodeAt(n)));for(var n=0,p="L";n<d;++n)r=q[n],"m"==r?q[n]=p:p=r;n=0;for(p="L";n<d;++n)r=q[n],"1"==r&&"r"==p?q[n]="n":g.test(r)&&(p=r,"r"==r&&(q[n]="R"));n=1;for(p=q[0];n<d-1;++n)r=q[n],"+"==r&&"1"==p&&"1"==q[n+1]?q[n]="1":","!=r||p!=q[n+1]||"1"!=p&&"n"!=p||(q[n]=p),p=r;for(n=0;n<d;++n)if(r=q[n],","==r)q[n]="N";else if("%"==
r){for(p=n+1;p<d&&"%"==q[p];++p);var s=n&&"!"==q[n-1]||p<d&&"1"==q[p]?"1":"N";for(r=n;r<p;++r)q[r]=s;n=p-1}n=0;for(p="L";n<d;++n)r=q[n],"L"==p&&"1"==r?q[n]="L":g.test(r)&&(p=r);for(n=0;n<d;++n)if(f.test(q[n])){for(p=n+1;p<d&&f.test(q[p]);++p);r="L"==(p<d?q[p]:"L");s="L"==(n?q[n-1]:"L")||r?"L":"R";for(r=n;r<p;++r)q[r]=s;n=p-1}for(var p=[],t,n=0;n<d;)if(h.test(q[n])){r=n;for(++n;n<d&&h.test(q[n]);++n);p.push(new b(0,r,n))}else{var u=n,s=p.length;for(++n;n<d&&"L"!=q[n];++n);for(r=u;r<n;)if(k.test(q[r])){u<
r&&p.splice(s,0,new b(1,u,r));u=r;for(++r;r<n&&k.test(q[r]);++r);p.splice(s,0,new b(2,u,r));u=r}else++r;u<n&&p.splice(s,0,new b(1,u,n))}1==p[0].level&&(t=c.match(/^\s+/))&&(p[0].from=t[0].length,p.unshift(new b(0,0,t[0].length)));1==A(p).level&&(t=c.match(/\s+$/))&&(A(p).to-=t[0].length,p.push(new b(0,d-t[0].length,d)));p[0].level!=A(p).level&&p.push(new b(p[0].level,d,d));return p}}();p.version="4.2.0";return p});


/*!
 * CodeMirror matchbrackets extension
 */
(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function s(a,c,b,e){var d=a.getLineHandle(c.line),h=c.ch-1,d=0<=h&&r[d.text.charAt(h)]||r[d.text.charAt(++h)];if(!d)return null;var g=">"==d.charAt(1)?1:-1;if(b&&0<g!=(h==c.ch))return null;b=a.getTokenTypeAt(l(c.line,h+1));a=t(a,l(c.line,h+(0<g?1:0)),g,b||null,e);return null==a?null:{from:l(c.line,h),
to:a&&a.pos,match:a&&a.ch==d.charAt(0),forward:0<g}}function t(a,c,b,e,d){var h=d&&d.maxScanLineLength||1E4,g=d&&d.maxScanLines||1E3,f=[];d=d&&d.bracketRegex?d.bracketRegex:/[(){}[\]]/;for(var g=0<b?Math.min(c.line+g,a.lastLine()+1):Math.max(a.firstLine()-1,c.line-g),k=c.line;k!=g;k+=b){var p=a.getLine(k);if(p){var m=0<b?0:p.length-1,n=0<b?p.length:-1;if(!(p.length>h))for(k==c.line&&(m=c.ch-(0>b?1:0));m!=n;m+=b){var q=p.charAt(m);if(d.test(q)&&(void 0===e||a.getTokenTypeAt(l(k,m+1))==e))if(">"==r[q].charAt(1)==
0<b)f.push(q);else if(f.length)f.pop();else return{pos:l(k,m),ch:q}}}}return k-b==(0<b?a.lastLine():a.firstLine())?!1:null}function u(a,c,b){for(var e=a.state.matchBrackets.maxHighlightLineLength||1E3,d=[],h=a.listSelections(),g=0;g<h.length;g++){var f=h[g].empty()&&s(a,h[g].head,!1,b);if(f&&a.getLine(f.from.line).length<=e){var k=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";d.push(a.markText(f.from,l(f.from.line,f.from.ch+1),{className:k}));f.to&&a.getLine(f.to.line).length<=
e&&d.push(a.markText(f.to,l(f.to.line,f.to.ch+1),{className:k}))}}if(d.length)if(w&&a.state.focused&&a.display.input.focus(),b=function(){a.operation(function(){for(var a=0;a<d.length;a++)d[a].clear()})},c)setTimeout(b,800);else return b}function v(a){a.operation(function(){n&&(n(),n=null);n=u(a,!1,a.state.matchBrackets)})}var w=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),l=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},n=null;e.defineOption("matchBrackets",
!1,function(a,c,b){b&&b!=e.Init&&a.off("cursorActivity",v);c&&(a.state.matchBrackets="object"==typeof c?c:{},a.on("cursorActivity",v))});e.defineExtension("matchBrackets",function(){u(this,!0)});e.defineExtension("findMatchingBracket",function(a,c,b){return s(this,a,c,b)});e.defineExtension("scanForBracket",function(a,c,b,e){return t(this,a,c,b,e)})});


/**
 * Tag-closer extension for CodeMirror.
 *
 * This extension adds an "autoCloseTags" option that can be set to
 * either true to get the default behavior, or an object to further
 * configure its behavior.
 *
 * These are supported options:
 *
 * `whenClosing` (default true)
 *   Whether to autoclose when the '/' of a closing tag is typed.
 * `whenOpening` (default true)
 *   Whether to autoclose the tag when the final '>' of an opening
 *   tag is typed.
 * `dontCloseTags` (default is empty tags for HTML, none for XML)
 *   An array of tag names that should not be autoclosed.
 * `indentTags` (default is block tags for HTML, none for XML)
 *   An array of tag names that should, when opened, cause a
 *   blank line to be added inside the tag, and the blank line and
 *   closing line to be indented.
 *
 * See demos/closetag.html for a usage example.
 */
(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)})(function(e){function r(c){if(c.getOption("disableInput"))return e.Pass;for(var f=c.listSelections(),b=[],a=0;a<f.length;a++){if(!f[a].empty())return e.Pass;var g=f[a].head,d=c.getTokenAt(g),m=e.innerMode(c.getMode(),d.state),n=m.state;if("xml"!=m.mode.name||!n.tagName)return e.Pass;
var h=c.getOption("autoCloseTags"),k="html"==m.mode.configuration,m="object"==typeof h&&h.dontCloseTags||k&&s,k="object"==typeof h&&h.indentTags||k&&t,h=n.tagName;d.end>g.ch&&(h=h.slice(0,h.length-d.end+g.ch));var l=h.toLowerCase();if(!h||"string"==d.type&&(d.end!=g.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==n.type||d.string.indexOf("/")==d.string.length-1||m&&-1<p(m,l)||q(c,h,g,n,!0))return e.Pass;d=k&&-1<p(k,l);b[a]={indent:d,text:">"+
(d?"\n\n":"")+"</"+h+">",newPos:d?e.Pos(g.line+1,0):e.Pos(g.line,g.ch+1)}}for(a=f.length-1;0<=a;a--)g=b[a],c.replaceRange(g.text,f[a].head,f[a].anchor,"+insert"),d=c.listSelections().slice(0),d[a]={head:g.newPos,anchor:g.newPos},c.setSelections(d),g.indent&&(c.indentLine(g.newPos.line,null,!0),c.indentLine(g.newPos.line+1,null,!0))}function p(c,e){if(c.indexOf)return c.indexOf(e);for(var b=0,a=c.length;b<a;++b)if(c[b]==e)return b;return-1}function q(c,f,b,a,g){if(!e.scanForClosingTag)return!1;var d=
Math.min(c.lastLine()+1,b.line+500);b=e.scanForClosingTag(c,b,null,d);if(!b||b.tag!=f)return!1;a=a.context;for(g=g?1:0;a&&a.tagName==f;a=a.prev)++g;b=b.to;for(a=1;a<g;a++){b=e.scanForClosingTag(c,b,null,d);if(!b||b.tag!=f)return!1;b=b.to}return!0}e.defineOption("autoCloseTags",!1,function(c,f,b){b!=e.Init&&b&&c.removeKeyMap("autoCloseTags");if(f){b={name:"autoCloseTags"};if("object"!=typeof f||f.whenClosing)b["'/'"]=function(a){a:if(a.getOption("disableInput"))a=e.Pass;else{for(var b=a.listSelections(),
d=[],c=0;c<b.length;c++){if(!b[c].empty()){a=e.Pass;break a}var f=b[c].head,h=a.getTokenAt(f),k=e.innerMode(a.getMode(),h.state),l=k.state;if("string"==h.type||"<"!=h.string.charAt(0)||h.start!=f.ch-1||"xml"!=k.mode.name||!l.context||!l.context.tagName||q(a,l.context.tagName,f,l)){a=e.Pass;break a}d[c]="/"+l.context.tagName+">"}a.replaceSelections(d);a=void 0}return a};if("object"!=typeof f||f.whenOpening)b["'>'"]=function(a){return r(a)};c.addKeyMap(b)}});var s="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),
t="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(" ")});


/*!
 * CodeMirror xml extension
 */
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){f.defineMode("xml",function(A,h){function k(a,c){function b(b){c.tokenize=b;return b(a,c)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?b(p("atom","]]\x3e")):null:a.match("--")?b(p("comment","--\x3e")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),b(q(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),
c.tokenize=p("meta","?>"),"meta";l=a.eat("/")?"closeTag":"openTag";c.tokenize=r;return"tag bracket"}if("&"==d)return(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error";a.eatWhile(/[^&<]/);return null}function r(a,c){var b=a.next();if(">"==b||"/"==b&&a.eat(">"))return c.tokenize=k,l=">"==b?"endTag":"selfcloseTag","tag bracket";if("="==b)return l="equals",null;if("<"==b)return c.tokenize=k,c.state=n,c.tagName=
c.tagStart=null,(b=c.tokenize(a,c))?b+" tag error":"tag error";if(/[\'\"]/.test(b))return c.tokenize=B(b),c.stringStartCol=a.column(),c.tokenize(a,c);a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function B(a){var c=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=r;break}return"string"};c.isInAttribute=!0;return c}function p(a,c){return function(b,d){for(;!b.eol();){if(b.match(c)){d.tokenize=k;break}b.next()}return a}}function q(a){return function(c,b){for(var d;null!=(d=
c.next());){if("<"==d)return b.tokenize=q(a+1),b.tokenize(c,b);if(">"==d)if(1==a){b.tokenize=k;break}else return b.tokenize=q(a-1),b.tokenize(c,b)}return"meta"}}function C(a,c,b){this.prev=a.context;this.tagName=c;this.indent=a.indented;this.startOfLine=b;if(g.doNotIndent.hasOwnProperty(c)||a.context&&a.context.noIndent)this.noIndent=!0}function s(a){a.context&&(a.context=a.context.prev)}function w(a,c){for(var b;a.context;){b=a.context.tagName;if(!g.contextGrabbers.hasOwnProperty(b)||!g.contextGrabbers[b].hasOwnProperty(c))break;
s(a)}}function n(a,c,b){return"openTag"==a?(b.tagStart=c.column(),x):"closeTag"==a?D:n}function x(a,c,b){if("word"==a)return b.tagName=c.current(),e="tag",m;e="error";return x}function D(a,c,b){if("word"==a){a=c.current();b.context&&b.context.tagName!=a&&g.implicitlyClosed.hasOwnProperty(b.context.tagName)&&s(b);if(b.context&&b.context.tagName==a)return e="tag",t;e="tag error";return y}e="error";return y}function t(a,c,b){if("endTag"!=a)return e="error",t;s(b);return n}function y(a,c,b){e="error";
return t(a,c,b)}function m(a,c,b){if("word"==a)return e="attribute",E;if("endTag"==a||"selfcloseTag"==a){c=b.tagName;var d=b.tagStart;b.tagName=b.tagStart=null;"selfcloseTag"==a||g.autoSelfClosers.hasOwnProperty(c)?w(b,c):(w(b,c),b.context=new C(b,c,d==b.indented));return n}e="error";return m}function E(a,c,b){if("equals"==a)return F;g.allowMissing||(e="error");return m(a,c,b)}function F(a,c,b){if("string"==a)return z;if("word"==a&&g.allowUnquoted)return e="string",m;e="error";return m(a,c,b)}function z(a,
c,b){return"string"==a?z:m(a,c,b)}var u=A.indentUnit,G=h.multilineTagIndentFactor||1,v=h.multilineTagIndentPastTag;null==v&&(v=!0);var g=h.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},
optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},
doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},H=h.alignCDATA,l,e;return{startState:function(){return{tokenize:k,state:n,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,c){!c.tagName&&a.sol()&&(c.indented=a.indentation());if(a.eatSpace())return null;l=null;var b=c.tokenize(a,c);(b||l)&&"comment"!=b&&(e=null,c.state=c.state(l||b,a,c),e&&(b="error"==e?b+" error":e));return b},indent:function(a,c,b){var d=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?
a.stringStartCol+1:a.indented+u;if(d&&d.noIndent)return f.Pass;if(a.tokenize!=r&&a.tokenize!=k)return b?b.match(/^(\s*)/)[0].length:0;if(a.tagName)return v?a.tagStart+a.tagName.length+2:a.tagStart+u*G;if(H&&/<!\[CDATA\[/.test(c))return 0;if((a=c&&/^<(\/)?([\w_:\.-]*)/.exec(c))&&a[1])for(;d;)if(d.tagName==a[2]){d=d.prev;break}else if(g.implicitlyClosed.hasOwnProperty(d.tagName))d=d.prev;else break;else if(a)for(;d;)if((c=g.contextGrabbers[d.tagName])&&c.hasOwnProperty(a[2]))d=d.prev;else break;for(;d&&
!d.startOfLine;)d=d.prev;return d?d.indent+u:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:h.htmlMode?"html":"xml",helperType:h.htmlMode?"html":"xml"}});f.defineMIME("text/xml","xml");f.defineMIME("application/xml","xml");f.mimeModes.hasOwnProperty("text/html")||f.defineMIME("text/html",{name:"xml",htmlMode:!0})});


/*!
 * CodeMirror javascript extension
 */
(function(p){"object"==typeof exports&&"object"==typeof module?p(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],p):p(CodeMirror)})(function(p){p.defineMode("javascript",function(ja,r){function n(a,b,e){C=a;E=e;return b}function t(a,b){var e=a.next();if('"'==e||"'"==e)return b.tokenize=ka(e),b.tokenize(a,b);if("."==e&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return n("number","number");if("."==e&&a.match(".."))return n("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(e))return n(e);
if("="==e&&a.eat(">"))return n("=>","operator");if("0"==e&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),n("number","number");if(/\d/.test(e))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),n("number","number");if("/"==e){if(a.eat("*"))return b.tokenize=F,F(a,b);if(a.eat("/"))return a.skipToEnd(),n("comment","comment");if("operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)){a:for(var e=!1,d,c=!1;null!=(d=a.next());){if(!e){if("/"==d&&!c)break a;"["==
d?c=!0:c&&"]"==d&&(c=!1)}e=!e&&"\\"==d}a.eatWhile(/[gimy]/);return n("regexp","string-2")}a.eatWhile(L);return n("operator","operator",a.current())}if("`"==e)return b.tokenize=M,M(a,b);if("#"==e)return a.skipToEnd(),n("error","error");if(L.test(e))return a.eatWhile(L),n("operator","operator",a.current());a.eatWhile(/[\w\$_]/);e=a.current();return(d=W.propertyIsEnumerable(e)&&W[e])&&"."!=b.lastType?n(d.type,d.style,e):n("variable","variable",e)}function ka(a){return function(b,e){var d=!1,c;if(G&&
"@"==b.peek()&&b.match(la))return e.tokenize=t,n("jsonld-keyword","meta");for(;null!=(c=b.next())&&(c!=a||d);)d=!d&&"\\"==c;d||(e.tokenize=t);return n("string","string")}}function F(a,b){for(var e=!1,d;d=a.next();){if("/"==d&&e){b.tokenize=t;break}e="*"==d}return n("comment","comment")}function M(a,b){for(var e=!1,d;null!=(d=a.next());){if(!e&&("`"==d||"$"==d&&a.eat("{"))){b.tokenize=t;break}e=!e&&"\\"==d}return n("quasi","string-2",a.current())}function N(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var e=
a.string.indexOf("=>",a.start);if(!(0>e)){for(var d=0,c=!1,e=e-1;0<=e;--e){var f=a.string.charAt(e),g=ma.indexOf(f);if(0<=g&&3>g){if(!d){++e;break}if(0==--d)break}else if(3<=g&&6>g)++d;else if(/[$\w]/.test(f))c=!0;else if(c&&!d){++e;break}}c&&!d&&(b.fatArrowAt=e)}}function X(a,b,e,d,c,f){this.indented=a;this.column=b;this.type=e;this.prev=c;this.info=f;null!=d&&(this.align=d)}function g(){for(var a=arguments.length-1;0<=a;a--)f.cc.push(arguments[a])}function c(){g.apply(null,arguments);return!0}function u(a){function b(b){for(;b;b=
b.next)if(b.name==a)return!0;return!1}var e=f.state;e.context?(f.marked="def",b(e.localVars)||(e.localVars={name:a,next:e.localVars})):!b(e.globalVars)&&r.globalVars&&(e.globalVars={name:a,next:e.globalVars})}function v(){f.state.context={prev:f.state.context,vars:f.state.localVars};f.state.localVars=na}function w(){f.state.localVars=f.state.context.vars;f.state.context=f.state.context.prev}function k(a,b){var e=function(){var d=f.state,e=d.indented;"stat"==d.lexical.type&&(e=d.lexical.indented);
d.lexical=new X(e,f.stream.column(),a,null,d.lexical,b)};e.lex=!0;return e}function h(){var a=f.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function l(a){function b(e){return e==a?c():";"==a?g():c(b)}return b}function q(a,b){return"var"==a?c(k("vardef",b.length),O,l(";"),h):"keyword a"==a?c(k("form"),m,q,h):"keyword b"==a?c(k("form"),q,h):"{"==a?c(k("}"),P,h):";"==a?c():"if"==a?("else"==f.state.lexical.info&&f.state.cc[f.state.cc.length-1]==
h&&f.state.cc.pop()(),c(k("form"),m,q,h,Y)):"function"==a?c(x):"for"==a?c(k("form"),Z,q,h):"variable"==a?c(k("stat"),oa):"switch"==a?c(k("form"),m,k("}","switch"),l("{"),P,h,h):"case"==a?c(m,l(":")):"default"==a?c(l(":")):"catch"==a?c(k("form"),v,l("("),Q,l(")"),q,h,w):"module"==a?c(k("form"),v,pa,w,h):"class"==a?c(k("form"),qa,ra,h):"export"==a?c(k("form"),sa,h):"import"==a?c(k("form"),ta,h):g(k("stat"),m,l(";"),h)}function m(a){return $(a,!1)}function s(a){return $(a,!0)}function $(a,b){if(f.state.fatArrowAt==
f.stream.start){var e=b?aa:ba;if("("==a)return c(v,k(")"),D(y,")"),h,l("=>"),e,w);if("variable"==a)return g(v,y,l("=>"),e,w)}e=b?R:H;return ca.hasOwnProperty(a)?c(e):"function"==a?c(x,e):"keyword c"==a?c(b?ua:S):"("==a?c(k(")"),S,I,l(")"),h,e):"operator"==a||"spread"==a?c(b?s:m):"["==a?c(k("]"),va,h,e):"{"==a?z(da,"}",null,e):"quasi"==a?g(J,e):c()}function S(a){return a.match(/[;\}\)\],]/)?g():g(m)}function ua(a){return a.match(/[;\}\)\],]/)?g():g(s)}function H(a,b){return","==a?c(m):R(a,b,!1)}function R(a,
b,e){var d=!1==e?H:R,f=!1==e?m:s;if("=>"==b)return c(v,e?aa:ba,w);if("operator"==a)return/\+\+|--/.test(b)?c(d):"?"==b?c(m,l(":"),f):c(f);if("quasi"==a)return g(J,d);if(";"!=a){if("("==a)return z(s,")","call",d);if("."==a)return c(wa,d);if("["==a)return c(k("]"),S,l("]"),h,d)}}function J(a,b){return"quasi"!=a?g():"${"!=b.slice(b.length-2)?c(J):c(m,xa)}function xa(a){if("}"==a)return f.marked="string-2",f.state.tokenize=M,c(J)}function ba(a){N(f.stream,f.state);return"{"==a?g(q):g(m)}function aa(a){N(f.stream,
f.state);return"{"==a?g(q):g(s)}function oa(a){return":"==a?c(h,q):g(H,l(";"),h)}function wa(a){if("variable"==a)return f.marked="property",c()}function da(a,b){if("variable"==a){if(f.marked="property","get"==b||"set"==b)return c(ya)}else if("number"==a||"string"==a)f.marked=G?"property":a+" property";else if("["==a)return c(m,l("]"),T);if(ca.hasOwnProperty(a))return c(T)}function ya(a){if("variable"!=a)return g(T);f.marked="property";return c(x)}function T(a){if(":"==a)return c(s);if("("==a)return g(x)}
function D(a,b){function e(d){return","==d?(d=f.state.lexical,"call"==d.info&&(d.pos=(d.pos||0)+1),c(a,e)):d==b?c():c(l(b))}return function(d){return d==b?c():g(a,e)}}function z(a,b,e){for(var d=3;d<arguments.length;d++)f.cc.push(arguments[d]);return c(k(b,e),D(a,b),h)}function P(a){return"}"==a?c():g(q,P)}function ea(a){if(fa&&":"==a)return c(za)}function za(a){if("variable"==a)return f.marked="variable-3",c()}function O(){return g(y,ea,U,Aa)}function y(a,b){if("variable"==a)return u(b),c();if("["==
a)return z(y,"]");if("{"==a)return z(Ba,"}")}function Ba(a,b){if("variable"==a&&!f.stream.match(/^\s*:/,!1))return u(b),c(U);"variable"==a&&(f.marked="property");return c(l(":"),y,U)}function U(a,b){if("="==b)return c(s)}function Aa(a){if(","==a)return c(O)}function Y(a,b){if("keyword b"==a&&"else"==b)return c(k("form","else"),q,h)}function Z(a){if("("==a)return c(k(")"),Ca,l(")"),h)}function Ca(a){return"var"==a?c(O,l(";"),K):";"==a?c(K):"variable"==a?c(Da):g(m,l(";"),K)}function Da(a,b){return"in"==
b||"of"==b?(f.marked="keyword",c(m)):c(H,K)}function K(a,b){return";"==a?c(ga):"in"==b||"of"==b?(f.marked="keyword",c(m)):g(m,l(";"),ga)}function ga(a){")"!=a&&c(m)}function x(a,b){if("*"==b)return f.marked="keyword",c(x);if("variable"==a)return u(b),c(x);if("("==a)return c(v,k(")"),D(Q,")"),h,q,w)}function Q(a){return"spread"==a?c(Q):g(y,ea)}function qa(a,b){if("variable"==a)return u(b),c(Ea)}function Ea(a,b){if("extends"==b)return c(m)}function ra(a){if("{"==a)return z(da,"}")}function pa(a,b){if("string"==
a)return c(q);if("variable"==a)return u(b),c(V)}function sa(a,b){return"*"==b?(f.marked="keyword",c(V,l(";"))):"default"==b?(f.marked="keyword",c(m,l(";"))):g(q)}function ta(a){return"string"==a?c():g(ha,V)}function ha(a,b){if("{"==a)return z(ha,"}");"variable"==a&&u(b);return c()}function V(a,b){if("from"==b)return f.marked="keyword",c(m)}function va(a){return"]"==a?c():g(s,Fa)}function Fa(a){return"for"==a?g(I,l("]")):","==a?c(D(s,"]")):g(D(s,"]"))}function I(a){if("for"==a)return c(Z,I);if("if"==
a)return c(m,I)}var A=ja.indentUnit,ia=r.statementIndent,G=r.jsonld,B=r.json||G,fa=r.typescript,W=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),e=a("keyword b"),d=a("keyword c"),c=a("operator"),f={type:"atom",style:"atom"},b={"if":a("if"),"while":b,"with":b,"else":e,"do":e,"try":e,"finally":e,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"debugger":d,"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":c,"typeof":c,"instanceof":c,"true":f,"false":f,"null":f,undefined:f,NaN:f,Infinity:f,"this":a("this"),module:a("module"),"class":a("class"),"super":a("atom"),yield:d,"export":a("export"),"import":a("import"),"extends":d};if(fa){var e={type:"variable",style:"variable-3"},e={"interface":a("interface"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),
string:e,number:e,bool:e,any:e},g;for(g in e)b[g]=e[g]}return b}(),L=/[+\-*&%=<>!?|~^]/,la=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,C,E,ma="([{}])",ca={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},f={state:null,column:null,marked:null,cc:null},na={name:"this",next:{name:"arguments"}};h.lex=!0;return{startState:function(a){a={tokenize:t,lastType:"sof",cc:[],lexical:new X((a||0)-A,0,"block",!1),localVars:r.localVars,
context:r.localVars&&{vars:r.localVars},indented:0};r.globalVars&&"object"==typeof r.globalVars&&(a.globalVars=r.globalVars);return a},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),N(a,b));if(b.tokenize!=F&&a.eatSpace())return null;var e=b.tokenize(a,b);if("comment"==C)return e;b.lastType="operator"!=C||"++"!=E&&"--"!=E?C:"incdec";a:{var d=C,c=E,g=b.cc;f.state=b;f.stream=a;f.marked=null;f.cc=g;b.lexical.hasOwnProperty("align")||(b.lexical.align=
!0);for(;;)if((g.length?g.pop():B?m:q)(d,c)){for(;g.length&&g[g.length-1].lex;)g.pop()();if(f.marked){e=f.marked;break a}if(d="variable"==d)b:{for(d=b.localVars;d;d=d.next)if(d.name==c){d=!0;break b}for(g=b.context;g;g=g.prev)for(d=g.vars;d;d=d.next)if(d.name==c){d=!0;break b}d=void 0}if(d){e="variable-2";break a}break a}e=void 0}return e},indent:function(a,b){if(a.tokenize==F)return p.Pass;if(a.tokenize!=t)return 0;var c=b&&b.charAt(0),d=a.lexical;if(!/^\s*else\b/.test(b))for(var f=a.cc.length-1;0<=
f;--f){var g=a.cc[f];if(g==h)d=d.prev;else if(g!=Y)break}"stat"==d.type&&"}"==c&&(d=d.prev);ia&&")"==d.type&&"stat"==d.prev.type&&(d=d.prev);f=d.type;g=c==f;return"vardef"==f?d.indented+("operator"==a.lastType||","==a.lastType?d.info+1:0):"form"==f&&"{"==c?d.indented:"form"==f?d.indented+A:"stat"==f?d.indented+("operator"==a.lastType||","==a.lastType?ia||A:0):"switch"!=d.info||g||!1==r.doubleIndentSwitch?d.align?d.column+(g?0:1):d.indented+(g?0:A):d.indented+(/^(?:case|default)\b/.test(b)?A:2*A)},
electricChars:":{}",blockCommentStart:B?null:"/*",blockCommentEnd:B?null:"*/",lineComment:B?null:"//",fold:"brace",helperType:B?"json":"javascript",jsonldMode:G,jsonMode:B}});p.registerHelper("wordChars","javascript",/[\\w$]/);p.defineMIME("text/javascript","javascript");p.defineMIME("text/ecmascript","javascript");p.defineMIME("application/javascript","javascript");p.defineMIME("application/ecmascript","javascript");p.defineMIME("application/json",{name:"javascript",json:!0});p.defineMIME("application/x-json",
{name:"javascript",json:!0});p.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});p.defineMIME("text/typescript",{name:"javascript",typescript:!0});p.defineMIME("application/typescript",{name:"javascript",typescript:!0})});


/*!
 * CodeMirror css extension
 */
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function l(d){for(var e={},f=0;f<d.length;++f)e[d[f]]=!0;return e}function m(d,e){for(var f=!1,h;null!=(h=d.next());){if(f&&"/"==h){e.tokenize=null;break}f="*"==h}return["comment","comment"]}function A(d,e){d.skipTo("--\x3e")?(d.match("--\x3e"),e.tokenize=null):d.skipToEnd();return["comment","comment"]}
h.defineMode("css",function(d,e){function f(a,c){E=c;return a}function l(a,c){var b=a.next();if(v[b]){var d=v[b](a,c);if(!1!==d)return d}if("@"==b)return a.eatWhile(/[\w\\\-]/),f("def",a.current());if("="==b||("~"==b||"|"==b)&&a.eat("="))return f(null,"compare");if('"'==b||"'"==b)return c.tokenize=m(b),c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),f("atom","hash");if("!"==b)return a.match(/^\s*\w*/),f("keyword","important");if(/\d/.test(b)||"."==b&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),
f("number","unit");if("-"===b){if(/[\d.]/.test(a.peek()))return a.eatWhile(/[\w.%]/),f("number","unit");if(a.match(/^\w+-/))return f("meta","meta")}else return/[,+>*\/]/.test(b)?f(null,"select-op"):"."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?f("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?f(null,b):"u"==b&&a.match("rl(")?(a.backUp(1),c.tokenize=q,f("property","word")):/[\w\\\-]/.test(b)?(a.eatWhile(/[\w\\\-]/),f("property","word")):f(null,null)}function m(a){return function(c,b){for(var d=!1,e;null!=
(e=c.next());){if(e==a&&!d){")"==a&&c.backUp(1);break}d=!d&&"\\"==e}if(e==a||!d&&")"!=a)b.tokenize=null;return f("string","string")}}function q(a,c){a.next();a.match(/\s*[\"\')]/,!1)?c.tokenize=null:c.tokenize=m(")");return f(null,"(")}function r(a,c,b){this.type=a;this.indent=c;this.prev=b}function k(a,c,b){a.context=new r(b,c.indentation()+u,a.context);return b}function n(a){a.context=a.context.prev;return a.context.type}function s(a,c,b,d){for(d=d||1;0<d;d--)b.context=b.context.prev;return p[b.context.type](a,
c,b)}function t(a){a=a.current().toLowerCase();g=C.hasOwnProperty(a)?"atom":B.hasOwnProperty(a)?"keyword":"variable"}e.propertyKeywords||(e=h.resolveMode("text/css"));var u=d.indentUnit,v=e.tokenHooks,x=e.mediaTypes||{},y=e.mediaFeatures||{},z=e.propertyKeywords||{},A=e.nonStandardPropertyKeywords||{},B=e.colorKeywords||{},C=e.valueKeywords||{},D=e.fontProperties||{},w=e.allowNested,E,g,p={top:function(a,c,b){if("{"==a)return k(b,c,"block");if("}"==a&&b.context.prev)return n(b);if("@media"==a)return k(b,
c,"media");if("@font-face"==a)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return k(b,c,"at");if("hash"==a)g="builtin";else if("word"==a)g="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return k(b,c,"interpolation");if(":"==a)return"pseudo";if(w&&"("==a)return k(b,c,"parens")}return b.context.type},block:function(a,c,b){if("word"==a){a=c.current().toLowerCase();if(z.hasOwnProperty(a))return g="property",
"maybeprop";if(A.hasOwnProperty(a))return g="string-2","maybeprop";if(w)return g=c.match(/^\s*:/,!1)?"property":"tag","block";g+=" error";return"maybeprop"}if("meta"==a)return"block";if(w||"hash"!=a&&"qualifier"!=a)return p.top(a,c,b);g="error";return"block"},maybeprop:function(a,c,b){return":"==a?k(b,c,"prop"):p[b.context.type](a,c,b)},prop:function(a,c,b){if(";"==a)return n(b);if("{"==a&&w)return k(b,c,"propBlock");if("}"==a||"{"==a)return s(a,c,b);if("("==a)return k(b,c,"parens");if("hash"==a&&
!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(c.current()))g+=" error";else if("word"==a)t(c);else if("interpolation"==a)return k(b,c,"interpolation");return"prop"},propBlock:function(a,c,b){return"}"==a?n(b):"word"==a?(g="property","maybeprop"):b.context.type},parens:function(a,c,b){if("{"==a||"}"==a)return s(a,c,b);if(")"==a)return n(b);if("("==a)return k(b,c,"parens");"word"==a&&t(c);return"parens"},pseudo:function(a,c,b){return"word"==a?(g="variable-3",b.context.type):p[b.context.type](a,c,b)},media:function(a,
c,b){if("("==a)return k(b,c,"media_parens");if("}"==a)return s(a,c,b);if("{"==a)return n(b)&&k(b,c,w?"block":"top");"word"==a&&(a=c.current().toLowerCase(),g="only"==a||"not"==a||"and"==a?"keyword":x.hasOwnProperty(a)?"attribute":y.hasOwnProperty(a)?"property":"error");return b.context.type},media_parens:function(a,c,b){return")"==a?n(b):"{"==a||"}"==a?s(a,c,b,2):p.media(a,c,b)},font_face_before:function(a,c,b){return"{"==a?k(b,c,"font_face"):p[b.context.type](a,c,b)},font_face:function(a,c,b){return"}"==
a?n(b):"word"==a?(g=D.hasOwnProperty(c.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},keyframes:function(a,c,b){return"word"==a?(g="variable","keyframes"):"{"==a?k(b,c,"top"):p[b.context.type](a,c,b)},at:function(a,c,b){if(";"==a)return n(b);if("{"==a||"}"==a)return s(a,c,b);"word"==a?g="tag":"hash"==a&&(g="builtin");return"at"},interpolation:function(a,c,b){if("}"==a)return n(b);if("{"==a||";"==a)return s(a,c,b);"variable"!=a&&(g="error");return"interpolation"}};return{startState:function(a){return{tokenize:null,
state:"top",context:new r("top",a||0,null)}},token:function(a,c){if(!c.tokenize&&a.eatSpace())return null;var b=(c.tokenize||l)(a,c);b&&"object"==typeof b&&(E=b[1],b=b[0]);g=b;c.state=p[c.state](E,a,c);return g},indent:function(a,c){var b=a.context,d=c&&c.charAt(0),e=b.indent;"prop"!=b.type||"}"!=d&&")"!=d||(b=b.prev);!b.prev||("}"!=d||"block"!=b.type&&"top"!=b.type&&"interpolation"!=b.type&&"font_face"!=b.type)&&(")"!=d||"parens"!=b.type&&"media_parens"!=b.type)&&("{"!=d||"at"!=b.type&&"media"!=
b.type)||(e=b.indent-u);return e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r="all aural braille handheld print projection screen tty tv embossed".split(" "),t=l(r),B="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(" "),
u=l(B),C="align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset flow-from flow-into font font-feature-settings font-family font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-end grid-column-start grid-row grid-row-end grid-row-start grid-template grid-template-areas grid-template-columns grid-template-rows hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align justify-content left letter-spacing line-break line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up object-fit object-position opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during position presentation-level punctuation-trim quotes region-break-after region-break-before region-break-inside region-fragment rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span shape-image-threshold shape-inside shape-margin shape-outside size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-outline text-overflow text-shadow text-size-adjust text-space-collapse text-transform text-underline-position text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width word-break word-spacing word-wrap z-index clip-path clip-rule mask enable-background filter flood-color flood-opacity lighting-color stop-color stop-opacity pointer-events color-interpolation color-interpolation-filters color-rendering fill fill-opacity fill-rule image-rendering marker marker-end marker-mid marker-start shape-rendering stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-rendering baseline-shift dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical text-anchor writing-mode".split(" "),
v=l(C),q="scrollbar-arrow-color scrollbar-base-color scrollbar-dark-shadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-3d-light-color scrollbar-track-color shape-inside searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration zoom".split(" "),q=l(q),D="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
x=l(D),F="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 avoid-column avoid-page avoid-region background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break break-all break-word 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 column 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 ellipse ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig 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 keep-all 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 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 outside-shape overlay overline padding padding-box painted page paused persian plus-darker plus-lighter pointer polygon portrait pre pre-line pre-wrap preserve-3d progress push-button radio read-only read-write read-write-plaintext-only rectangle region 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 wider window windowframe windowtext x-large x-small xor xx-large xx-small".split(" "),
y=l(F),z=l("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),r=r.concat(B).concat(C).concat(q).concat(D).concat(F);h.registerHelper("hintWords","css",r);h.defineMIME("text/css",{mediaTypes:t,mediaFeatures:u,propertyKeywords:v,nonStandardPropertyKeywords:q,colorKeywords:x,valueKeywords:y,fontProperties:z,tokenHooks:{"<":function(d,e){if(!d.match("!--"))return!1;e.tokenize=A;return A(d,e)},"/":function(d,e){if(!d.eat("*"))return!1;e.tokenize=
m;return m(d,e)}},name:"css"});h.defineMIME("text/x-scss",{mediaTypes:t,mediaFeatures:u,propertyKeywords:v,nonStandardPropertyKeywords:q,colorKeywords:x,valueKeywords:y,fontProperties:z,allowNested:!0,tokenHooks:{"/":function(d,e){return d.eat("/")?(d.skipToEnd(),["comment","comment"]):d.eat("*")?(e.tokenize=m,m(d,e)):["operator","operator"]},":":function(d){return d.match(/\s*{/)?[null,"{"]:!1},$:function(d){d.match(/^[\w-]+/);return d.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2",
"variable"]},"#":function(d){return d.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"});h.defineMIME("text/x-less",{mediaTypes:t,mediaFeatures:u,propertyKeywords:v,nonStandardPropertyKeywords:q,colorKeywords:x,valueKeywords:y,fontProperties:z,allowNested:!0,tokenHooks:{"/":function(d,e){return d.eat("/")?(d.skipToEnd(),["comment","comment"]):d.eat("*")?(e.tokenize=m,m(d,e)):["operator","operator"]},"@":function(d){if(d.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,
!1))return!1;d.eatWhile(/[\w\\\-]/);return d.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})});


/*!
 * CodeMirror clike extension
 */
(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function d(a){var b={};a=a.split(" ");for(var d=0;d<a.length;++d)b[a[d]]=!0;return b}function k(a,b){if(!b.startOfLine)return!1;for(;;)if(a.skipTo("\\")){if(a.next(),a.eol()){b.tokenize=k;break}}else{a.skipToEnd();b.tokenize=null;break}return"meta"}function g(a,b){a.backUp(1);if(a.match(/(R|u8R|uR|UR|LR)/)){var d=
a.match(/"(.{0,16})\(/);if(!d)return!1;b.cpp11RawStringDelim=d[1];b.tokenize=n;return n(a,b)}if(a.match(/(u8|u|U|L)/))return a.match(/["']/,!1)?"string":!1;a.next();return!1}function q(a,b){for(var d;null!=(d=a.next());)if('"'==d&&!a.eat('"')){b.tokenize=null;break}return"string"}function n(a,b){a.match(new RegExp(".*?\\)"+b.cpp11RawStringDelim+'"'))?b.tokenize=null:a.skipToEnd();return"string"}function e(a,b){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof a&&(a=
[a]);var e=[];d(b.keywords);d(b.builtin);d(b.atoms);e.length&&(b.helperType=a[0],h.registerHelper("hintWords",a[0],e));for(var l=0;l<a.length;++l)h.defineMIME(a[l],b)}h.defineMode("clike",function(a,b){function d(a,m){var c=a.next();if(s[c]){var b=s[c](a,m);if(!1!==b)return b}if('"'==c||"'"==c)return m.tokenize=e(c),m.tokenize(a,m);if(/[\[\]{}\(\),;\:\.]/.test(c))return f=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return m.tokenize=l,l(a,m);if(a.eat("/"))return a.skipToEnd(),
"comment"}if(t.test(c))return a.eatWhile(t),"operator";a.eatWhile(/[\w\$_]/);c=a.current();return v.propertyIsEnumerable(c)?(u.propertyIsEnumerable(c)&&(f="newstatement"),"keyword"):w.propertyIsEnumerable(c)?(u.propertyIsEnumerable(c)&&(f="newstatement"),"builtin"):x.propertyIsEnumerable(c)?"atom":"variable"}function e(a){return function(b,c){for(var d=!1,f,e=!1;null!=(f=b.next());){if(f==a&&!d){e=!0;break}d=!d&&"\\"==f}if(e||!d&&!y)c.tokenize=null;return"string"}}function l(a,d){for(var c=!1,b;b=
a.next();){if("/"==b&&c){d.tokenize=null;break}c="*"==b}return"comment"}function k(a,b,c,d,f){this.indented=a;this.column=b;this.type=c;this.align=d;this.prev=f}function g(a,b,c){var d=a.indented;a.context&&"statement"==a.context.type&&(d=a.context.indented);return a.context=new k(d,b,c,null,a.context)}function p(a){var d=a.context.type;if(")"==d||"]"==d||"}"==d)a.indented=a.context.indented;return a.context=a.context.prev}var r=a.indentUnit,n=b.statementIndentUnit||r,q=b.dontAlignCalls,v=b.keywords||
{},w=b.builtin||{},u=b.blockKeywords||{},x=b.atoms||{},s=b.hooks||{},y=b.multiLineStrings,t=/[+\-*&%=<>!?|\/]/,f;return{startState:function(a){return{tokenize:null,context:new k((a||0)-r,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0);if(a.eatSpace())return null;f=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;null==c.align&&(c.align=!0);if(";"!=f&&":"!=f&&","!=f||"statement"!=
c.type)if("{"==f)g(b,a.column(),"}");else if("["==f)g(b,a.column(),"]");else if("("==f)g(b,a.column(),")");else if("}"==f){for(;"statement"==c.type;)c=p(b);for("}"==c.type&&(c=p(b));"statement"==c.type;)c=p(b)}else f==c.type?p(b):(("}"==c.type||"top"==c.type)&&";"!=f||"statement"==c.type&&"newstatement"==f)&&g(b,a.column(),"statement");else p(b);b.startOfLine=!1;return e},indent:function(a,b){if(a.tokenize!=d&&null!=a.tokenize)return h.Pass;var c=a.context,e=b&&b.charAt(0);"statement"==c.type&&"}"==
e&&(c=c.prev);var f=e==c.type;return"statement"==c.type?c.indented+("{"==e?0:n):!c.align||q&&")"==c.type?")"!=c.type||f?c.indented+(f?0:r):c.indented+n:c.column+(f?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});e(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:d("auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile"),
blockKeywords:d("case do else for if switch while struct"),atoms:d("null"),hooks:{"#":k},modeProps:{fold:["brace","include"]}});e(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:d("auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),
blockKeywords:d("catch class do else finally for if struct switch try while"),atoms:d("true false null"),hooks:{"#":k,u:g,U:g,L:g,R:g},modeProps:{fold:["brace","include"]}});e("text/x-java",{name:"clike",keywords:d("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),
blockKeywords:d("catch class do else finally for if switch try while"),atoms:d("true false null"),hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"}},modeProps:{fold:["brace","import"]}});e("text/x-csharp",{name:"clike",keywords:d("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),
blockKeywords:d("catch class do else finally for foreach if struct switch try while"),builtin:d("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:d("true false null"),hooks:{"@":function(a,b){if(a.eat('"'))return b.tokenize=q,q(a,b);a.eatWhile(/[\w\$_]/);return"meta"}}});e("text/x-scala",{name:"clike",keywords:d("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),
blockKeywords:d("catch class do else finally for forSome if match switch try while"),atoms:d("true false null"),hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"}}});e(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:d("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadowconst attribute uniform varying break continue discard return for while do if else struct in out inout"),
blockKeywords:d("for while do if else struct"),builtin:d("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smootstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),
atoms:d("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),
hooks:{"#":k},modeProps:{fold:["brace","include"]}})});


/*!
 * CodeMirror PHP extension
 */
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],c):c(CodeMirror)})(function(c){function e(b){var a={};b=b.split(" ");for(var d=0;d<b.length;++d)a[b[d]]=!0;return a}function p(b){return function(a,d){a.match(b)?d.tokenize=null:a.skipToEnd();return"string"}}function k(b){return 0==
b.length?g:function(a,d){for(var c=b[0],h=0;h<c.length;h++)if(a.match(c[h][0]))return d.tokenize=k(b.slice(1)),c[h][1];d.tokenize=g;return"string"}}function g(b,a){var d=!1,c,h=!1;if('"'==b.current())return"string";if(b.match("${",!1)||b.match("{$",!1))return a.tokenize=null,"string";if(b.match(/\$[a-zA-Z_][a-zA-Z0-9_]*/))return b.match("[",!1)&&(a.tokenize=k([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]])),b.match(/\-\>\w/,!1)&&
(a.tokenize=k([[["->",null]],[[/[\w]+/,"variable"]]])),"variable-2";for(;!(b.eol()||b.match("{$",!1)||b.match(/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1)&&!d);){c=b.next();if(!d&&'"'==c){h=!0;break}d=!d&&"\\"==c}h&&(a.tokenize=null,a.phpEncapsStack.pop());return"string"}c.registerHelper("hintWords","php","abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__ func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once".split(" "));
c.registerHelper("wordChars","php",/[\\w$]/);var l={name:"clike",helperType:"php",keywords:e("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally"),
blockKeywords:e("catch do else elseif for foreach if switch try while finally"),atoms:e("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"),builtin:e("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once"),
multiLineStrings:!0,hooks:{$:function(b){b.eatWhile(/[\w\$_]/);return"variable-2"},"<":function(b,a){return b.match(/<</)?(b.eatWhile(/[\w\.]/),a.tokenize=p(b.current().slice(3)),a.tokenize(b,a)):!1},"#":function(b){for(;!b.eol()&&!b.match("?>",!1);)b.next();return"comment"},"/":function(b){if(b.eat("/")){for(;!b.eol()&&!b.match("?>",!1);)b.next();return"comment"}return!1},'"':function(b,a){a.phpEncapsStack||(a.phpEncapsStack=[]);a.phpEncapsStack.push(0);a.tokenize=g;return a.tokenize(b,a)},"{":function(b,
a){a.phpEncapsStack&&0<a.phpEncapsStack.length&&a.phpEncapsStack[a.phpEncapsStack.length-1]++;return!1},"}":function(b,a){a.phpEncapsStack&&0<a.phpEncapsStack.length&&0==--a.phpEncapsStack[a.phpEncapsStack.length-1]&&(a.tokenize=g);return!1}}};c.defineMode("php",function(b,a){var d=c.getMode(b,"text/html"),f=c.getMode(b,l);return{startState:function(){var b=c.startState(d),m=c.startState(f);return{html:b,php:m,curMode:a.startOpen?f:d,curState:a.startOpen?m:b,pending:null}},copyState:function(b){var a=
c.copyState(d,b.html),n=c.copyState(f,b.php);return{html:a,php:n,curMode:b.curMode,curState:b.curMode==d?a:n,pending:b.pending}},token:function(b,a){var c=a.curMode==f;b.sol()&&a.pending&&'"'!=a.pending&&"'"!=a.pending&&(a.pending=null);if(c)return c&&null==a.php.tokenize&&b.match("?>")?(a.curMode=d,a.curState=a.html,"meta"):f.token(b,a.curState);if(b.match(/^<\?\w*/))return a.curMode=f,a.curState=a.php,"meta";if('"'==a.pending||"'"==a.pending){for(;!b.eol()&&b.next()!=a.pending;);c="string"}else a.pending&&
b.pos<a.pending.end?(b.pos=a.pending.end,c=a.pending.style):c=d.token(b,a.curState);a.pending&&(a.pending=null);var e=b.current(),g=e.search(/<\?/),k;-1!=g&&("string"==c&&(k=e.match(/[\'\"]$/))&&!/\?>/.test(e)?a.pending=k[0]:a.pending={end:b.pos,style:c},b.backUp(e.length-g));return c},indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,
mode:a.curMode}}}},"htmlmixed","clike");c.defineMIME("application/x-httpd-php","php");c.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0});c.defineMIME("text/x-php",l)});


/*!
 * CodeMirror htmlmixed extension
 */
(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],c):c(CodeMirror)})(function(c){c.defineMode("htmlmixed",function(g,l){function h(a,b){var c=b.htmlState.tagName,e=d.token(a,b.htmlState);if("script"==c&&/\btag\b/.test(e)&&">"==a.current()){(c=(c=a.string.slice(Math.max(0,
a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i))?c[1]:"")&&/[\"\']/.test(c.charAt(0))&&(c=c.slice(1,c.length-1));for(var m=0;m<k.length;++m){var f=k[m];if("string"==typeof f.matches?c==f.matches:f.matches.test(c)){f.mode&&(b.token=t,b.localMode=f.mode,b.localState=f.mode.startState&&f.mode.startState(d.indent(b.htmlState,"")));break}}}else"style"==c&&/\btag\b/.test(e)&&">"==a.current()&&(b.token=u,b.localMode=n,b.localState=n.startState(d.indent(b.htmlState,"")));return e}function s(a,
b,c){var e=a.current(),d=e.search(b);-1<d?a.backUp(e.length-d):e.match(/<\/?$/)&&(a.backUp(e.length),a.match(b,!1)||a.match(e));return c}function t(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=h,b.localState=b.localMode=null,h(a,b)):s(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function u(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=h,b.localState=b.localMode=null,h(a,b)):s(a,/<\/\s*style\s*>/,n.token(a,b.localState))}var d=c.getMode(g,{name:"xml",htmlMode:!0,multilineTagIndentFactor:l.multilineTagIndentFactor,
multilineTagIndentPastTag:l.multilineTagIndentPastTag}),n=c.getMode(g,"css"),k=[],p=l&&l.scriptTypes;k.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:c.getMode(g,"javascript")});if(p)for(var q=0;q<p.length;++q){var r=p[q];k.push({matches:r.matches,mode:r.mode&&c.getMode(g,r.mode)})}k.push({matches:/./,mode:c.getMode(g,"text/plain")});return{startState:function(){var a=d.startState();return{token:h,localMode:null,localState:null,htmlState:a}},copyState:function(a){if(a.localState)var b=
c.copyState(a.localMode,a.localState);return{token:a.token,localMode:a.localMode,localState:b,htmlState:c.copyState(d,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return!a.localMode||/^\s*<\//.test(b)?d.indent(a.htmlState,b):a.localMode.indent?a.localMode.indent(a.localState,b):c.Pass},innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||d}}}},"xml","javascript","css");c.defineMIME("text/html","htmlmixed")});



/*!
 * CodeMirror placeholder module
 */
(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function e(a){a.state.placeholder&&(a.state.placeholder.parentNode.removeChild(a.state.placeholder),a.state.placeholder=null)}function h(a){e(a);var b=a.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible";b.className="CodeMirror-placeholder";b.appendChild(document.createTextNode(a.getOption("placeholder")));
a.display.lineSpace.insertBefore(b,a.display.lineSpace.firstChild)}function f(a){k(a)&&h(a)}function g(a){var b=a.getWrapperElement(),c=k(a);b.className=b.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":"");c?h(a):e(a)}function k(a){return 1===a.lineCount()&&""===a.getLine(0)}d.defineOption("placeholder","",function(a,b,c){c=c&&c!=d.Init;b&&!c?(a.on("blur",f),a.on("change",g),g(a)):!b&&c&&(a.off("blur",f),a.off("change",g),e(a),c=a.getWrapperElement(),c.className=c.className.replace(" CodeMirror-empty",
""));b&&!a.hasFocus()&&f(a)})});