!function(f){if("object"==typeof exports&&"object"==typeof module)module.exports=f();else{if("function"==typeof define&&define.amd)return define([],f);this.CodeMirror=f()}}(function(){function f(a,b){if(!(this instanceof f))return new f(a,b);this.options=b=b||{};Xb(Ye,b,!1);M(b);var c=b.value;"string"==typeof c&&(c=new pa(c,b.mode));this.doc=c;var d=this.display=new y(a,c);d.wrapper.CodeMirror=this;O(this);v(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");b.autofocus&&!ad&&
sa(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new bd};P&&11>W&&setTimeout(Ia(Ja,this,!0),20);Ze(this);Od||($e(),Od=!0);var e=this;z(this,function(){e.curOp.forceUpdate=!0;Pd(e,c);b.autofocus&&!ad||Va()==d.input?setTimeout(Ia(cd,e),20):wc(e);for(var a in Db)Db.hasOwnProperty(a)&&Db[a](e,b[a],Qd);ga(e);for(a=0;a<dd.length;++a)dd[a](e)})}function y(a,b){var c=this.input=B("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
ka?c.style.width="1000px":c.setAttribute("wrap","off");Yb&&(c.style.border="1px solid black");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");this.inputDiv=B("div",[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");this.scrollbarH=B("div",[B("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");this.scrollbarV=B("div",[B("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");this.scrollbarFiller=
B("div",null,"CodeMirror-scrollbar-filler");this.gutterFiller=B("div",null,"CodeMirror-gutter-filler");this.lineDiv=B("div",null,"CodeMirror-code");this.selectionDiv=B("div",null,null,"position: relative; z-index: 1");this.cursorDiv=B("div",null,"CodeMirror-cursors");this.measure=B("div",null,"CodeMirror-measure");this.lineMeasure=B("div",null,"CodeMirror-measure");this.lineSpace=B("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");
this.mover=B("div",[B("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=B("div",[this.mover],"CodeMirror-sizer");this.heightForcer=B("div",null,null,"position: absolute; height: "+ya+"px; width: 1px;");this.gutters=B("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=B("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex","-1");this.wrapper=B("div",[this.inputDiv,this.scrollbarH,this.scrollbarV,
this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");P&&8>W&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);Yb&&(c.style.width="0px");ka||(this.scroller.draggable=!0);ed&&(this.inputDiv.style.height="1px",this.inputDiv.style.position="absolute");P&&8>W&&(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 bd;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 m(a){a.doc.mode=f.getMode(a.options,a.doc.modeOption);
D(a)}function D(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;hb(a,100);a.state.modeGen++;a.curOp&&ua(a)}function r(a){var b=Oa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/ib(a.display)-3);return function(e){if(jb(a.doc,e))return 0;var h=0;if(e.widgets)for(var o=0;o<e.widgets.length;o++)e.widgets[o].height&&(h+=e.widgets[o].height);return c?h+(Math.ceil(e.text.length/d)||1)*b:h+b}}function w(a){var b=
a.doc,c=r(a);b.iter(function(a){var b=c(a);b!=a.height&&Ka(a,b)})}function G(a){var b=Pa[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")}function v(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");va(a)}function N(a){O(a);ua(a);setTimeout(function(){ea(a)},20)}function O(a){var b=a.display.gutters,c=a.options.gutters;kb(b);for(var d=
0;d<c.length;++d){var e=c[d],h=b.appendChild(B("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=h,h.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none";ca(a)}function ca(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 U(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=lb(d,!0);)b=b.find(0,!0),d=b.from.line,c+=b.from.ch-b.to.ch;
for(d=a;b=lb(d,!1);)b=b.find(0,!0),c-=d.text.length-b.from.ch,d=b.to.line,c+=d.text.length-b.to.ch;return c}function aa(a){var b=a.display,a=a.doc;b.maxLine=C(a,a.first);b.maxLineLength=U(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=U(a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function M(a){var b=la(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 Y(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,hScrollbarTakesSpace:a.display.scroller.clientHeight-a.display.wrapper.clientHeight<ya-3,barWidth:a.display.scrollbarH.clientWidth,docHeight:Math.round(a.doc.height+(a.display.mover.offsetHeight-a.display.lineSpace.offsetHeight))}}function x(a,b){b||(b=Y(a));var c=a.display,d=af(c.measure),e=b.docHeight+ya,h=b.scrollWidth>b.clientWidth;
h&&b.scrollWidth<=b.clientWidth+1&&0<d&&!b.hScrollbarTakesSpace&&(h=!1);var o=e>b.clientHeight;if(o?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=h?d+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,e-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),h?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=o?d+"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"),h&&o?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=d+"px"):c.scrollbarFiller.style.display="",h&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",!a.state.checkedOverlayScrollbar&&
0<b.clientHeight)0===d&&(c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=za&&!bf?"12px":"18px",d=function(b){(b.target||b.srcElement)!=c.scrollbarV&&(b.target||b.srcElement)!=c.scrollbarH&&A(a,Rd)(b)},I(c.scrollbarV,"mousedown",d),I(c.scrollbarH,"mousedown",d)),a.state.checkedOverlayScrollbar=!0}function k(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=mb(b,d),e=mb(b,e);if(c&&
c.ensure){var h=c.ensure.from.line,c=c.ensure.to.line;if(d>h)return{from:h,to:mb(b,Qa(C(b,h))+a.wrapper.clientHeight)};if(Math.min(c,b.lastLine())>=e)return{from:mb(b,Qa(C(b,c))-a.wrapper.clientHeight),to:c}}return{from:d,to:Math.max(e,d+1)}}function ea(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=da(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,h=d+"px",o=0;o<c.length;o++)if(!c[o].hidden){a.options.fixedGutter&&c[o].gutter&&
(c[o].gutter.style.left=h);var p=c[o].alignable;if(p)for(var s=0;s<p.length;s++)p[s].style.left=h}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function ga(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=""+a.options.lineNumberFormatter(b.first+b.size-1+a.options.firstLineNumber),c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(B("div",[B("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth,d=d.offsetWidth-e;return c.lineGutter.style.width=
"",c.lineNumInnerWidth=Math.max(e,c.lineGutter.offsetWidth-d),c.lineNumWidth=c.lineNumInnerWidth+d,c.lineNumChars=c.lineNumInnerWidth?b.length:-1,c.lineGutter.style.width=c.lineNumWidth+"px",ca(a),!0}return!1}function da(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Q(a,b,c){var d=a.display;this.viewport=b;this.visible=k(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=d.wrapper.clientHeight;this.oldViewFrom=d.viewFrom;this.oldViewTo=
d.viewTo;this.oldScrollerWidth=d.scroller.clientWidth;this.force=c;this.dims=i(a)}function K(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Wa(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&0==Sd(a))return!1;ga(a)&&(Wa(a),b.dims=i(a));var e=d.first+d.size,h=Math.max(b.visible.from-a.options.viewportMargin,d.first),o=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<h&&20>h-c.viewFrom&&(h=Math.max(d.first,
c.viewFrom));c.viewTo>o&&20>c.viewTo-o&&(o=Math.min(e,c.viewTo));Xa&&(h=fd(a.doc,h),o=Td(a.doc,o));d=h!=c.viewFrom||o!=c.viewTo||c.lastSizeC!=b.wrapperHeight;e=a.display;0==e.view.length||h>=e.viewTo||o<=e.viewFrom?(e.view=xc(a,h,o),e.viewFrom=h):(e.viewFrom>h?e.view=xc(a,h,e.viewFrom).concat(e.view):e.viewFrom<h&&(e.view=e.view.slice(Zb(a,h))),e.viewFrom=h,e.viewTo<o?e.view=e.view.concat(xc(a,e.viewTo,o)):e.viewTo>o&&(e.view=e.view.slice(0,Zb(a,o))));e.viewTo=o;c.viewOffset=Qa(C(a.doc,c.viewFrom));
a.display.mover.style.top=c.viewOffset+"px";o=Sd(a);if(!d&&0==o&&!b.force&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;h=Va();return 4<o&&(c.lineDiv.style.display="none"),j(a,c.updateLineNumbers,b.dims),4<o&&(c.lineDiv.style.display=""),h&&Va()!=h&&h.offsetHeight&&h.focus(),kb(c.cursorDiv),kb(c.selectionDiv),d&&(c.lastSizeC=b.wrapperHeight,hb(a,400)),c.updateLineNumbers=null,!0}function R(a,b){for(var c=b.viewport,d=!0;;d=!1){if(!d||!(a.options.lineWrapping&&b.oldScrollerWidth!=
a.display.scroller.clientWidth))if(c&&null!=c.top&&(c={top:Math.min(a.doc.height+(a.display.mover.offsetHeight-a.display.lineSpace.offsetHeight)-ya-a.display.scroller.clientHeight,c.top)}),b.visible=k(a.display,a.doc,c),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!K(a,b))break;T(a);d=Y(a);Ya(a);E(a,d);x(a,d)}ha(a,"update",a);(a.display.viewFrom!=b.oldViewFrom||a.display.viewTo!=b.oldViewTo)&&ha(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)}function S(a,
b){var c=new Q(a,b);K(a,c)&&(T(a),R(a,c),c=Y(a),Ya(a),E(a,c),x(a,c))}function E(a,b){a.display.sizer.style.minHeight=a.display.heightForcer.style.top=b.docHeight+"px";a.display.gutters.style.height=Math.max(b.docHeight,b.clientHeight-ya)+"px"}function T(a){for(var a=a.display,b=a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d,e=a.view[c];if(!e.hidden){if(P&&8>W){var h=e.node.offsetTop+e.node.offsetHeight;d=h-b;b=h}else d=e.node.getBoundingClientRect(),d=d.bottom-d.top;h=e.line.height-d;if(2>d&&
(d=Oa(a)),(0.001<h||-0.001>h)&&(Ka(e.line,d),Ra(e.line),e.rest))for(d=0;d<e.rest.length;d++)Ra(e.rest[d])}}}function Ra(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function i(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,h=0;e;e=e.nextSibling,++h)c[a.options.gutters[h]]=e.offsetLeft,d[a.options.gutters[h]]=e.offsetWidth;return{fixedPos:da(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}
function j(a,b,c){function d(b){var c=b.nextSibling;return ka&&za&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var e=a.display,h=a.options.lineNumbers,o=e.lineDiv,p=o.firstChild,s=e.view,e=e.viewFrom,gd=0;gd<s.length;gd++){var g=s[gd];if(!g.hidden)if(g.node){for(;p!=g.node;)p=d(p);p=h&&null!=b&&e>=b&&g.lineNumber;g.changes&&(-1<la(g.changes,"gutter")&&(p=!1),ba(a,g,e,c));p&&(kb(g.lineNumber),g.lineNumber.appendChild(document.createTextNode(""+a.options.lineNumberFormatter(e+
a.options.firstLineNumber))));p=g.node.nextSibling}else{var n=Za(a,g,e,c);o.insertBefore(n,p)}e+=g.size}for(;p;)p=d(p)}function ba(a,b,c,d){for(var e=0;e<b.changes.length;e++){var h=b.changes[e];if("text"==h){var h=b,o=h.text.className,p=Aa(a,h);h.text==h.node&&(h.node=p.pre);h.text.parentNode.replaceChild(p.pre,h.text);h.text=p.pre;p.bgClass!=h.bgClass||p.textClass!=h.textClass?(h.bgClass=p.bgClass,h.textClass=p.textClass,nb(h)):o&&(h.text.className=o)}else if("gutter"==h)$a(a,b,c,d);else if("class"==
h)nb(b);else if("widget"==h){h=b;o=d;h.alignable&&(h.alignable=null);for(var p=void 0,s=h.node.firstChild;s;s=p)p=s.nextSibling,"CodeMirror-linewidget"==s.className&&h.node.removeChild(s);Eb(h,o)}}b.changes=null}function ma(a){return a.node==a.text&&(a.node=B("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),P&&8>W&&(a.node.style.zIndex=2)),a.node}function Aa(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?
(a.display.externalMeasured=null,b.measure=c.measure,c.built):Ud(a,b)}function nb(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=ma(a);a.background=c.insertBefore(B("div",null,b),c.firstChild)}a.line.wrapClass?ma(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 $a(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 h=ma(b),h=b.gutter=h.insertBefore(B("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px"),b.text);if(!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=h.appendChild(B("div",""+a.options.lineNumberFormatter(c+a.options.firstLineNumber),
"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),e)for(b=0;b<a.options.gutters.length;++b){var c=a.options.gutters[b],o=e.hasOwnProperty(c)&&e[c];o&&h.appendChild(B("div",[o],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}}function Za(a,b,c,d){var e=Aa(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),nb(b),$a(a,
b,c,d),Eb(b,d),b.node}function Eb(a,b){if(Fb(a.line,a,b,!0),a.rest)for(var c=0;c<a.rest.length;c++)Fb(a.rest[c],a,b,!1)}function Fb(a,b,c,d){if(a.widgets)for(var e=ma(b),h=0,a=a.widgets;h<a.length;++h){var o=a[h],p=B("div",[o.node],"CodeMirror-linewidget");o.handleMouseEvents||(p.ignoreEvents=!0);var s=o,g=p,n=c;if(s.noHScroll){(b.alignable||(b.alignable=[])).push(g);var l=n.wrapperWidth;g.style.left=n.fixedPos+"px";s.coverGutter||(l-=n.gutterTotalWidth,g.style.paddingLeft=n.gutterTotalWidth+"px");
g.style.width=l+"px"}s.coverGutter&&(g.style.zIndex=5,g.style.position="relative",s.noHScroll||(g.style.marginLeft=-n.gutterTotalWidth+"px"));d&&o.above?e.insertBefore(p,b.gutter||b.text):e.appendChild(p);ha(o,"redraw")}}function Sa(a,b){return 0>L(a,b)?b:a}function ra(a,b){return 0>L(a,b)?a:b}function J(a,b){this.ranges=a;this.primIndex=b}function q(a,b){this.anchor=a;this.head=b}function V(a,b){var c=a[b];a.sort(function(a,b){return L(a.from(),b.from())});b=la(a,c);for(c=1;c<a.length;c++){var d=
a[c],e=a[c-1];if(0<=L(e.to(),d.from())){var h=ra(e.from(),d.from()),o=Sa(e.to(),d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;b>=c&&--b;a.splice(--c,2,new q(d?o:h,d?h:o))}}return new J(a,b)}function t(a,b){return new J([new q(a,b||a)],0)}function F(a,b){if(b.line<a.first)return u(a.first,0);var c=a.first+a.size-1;if(b.line>c)c=u(c,C(a,c).text.length);else var c=C(a,b.line).text.length,d=b.ch,c=null==d||d>c?u(b.line,c):0>d?u(b.line,0):b;return c}function Ba(a,b){return b>=a.first&&b<a.first+
a.size}function wa(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,d&&(b=0>L(c,a),b!=0>L(d,a)?(a=c,c=d):b!=0>L(c,d)&&(c=d)),new q(a,c)):new q(d||c,c)}function l(a,b,c,d){fa(a,new J([wa(a,a.sel.primary(),b,c)],0),d)}function g(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=wa(a,a.sel.ranges[e],b[e],null);b=V(d,a.sel.primIndex);fa(a,b,c)}function ia(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;fa(a,V(e,a.sel.primIndex),d)}function hd(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=
[];for(var c=0;c<b.length;c++)this.ranges[c]=new q(F(a,b[c].anchor),F(a,b[c].head))}};return ja(a,"beforeSelectionChange",a,c),a.cm&&ja(a.cm,"beforeSelectionChange",a.cm,c),c.ranges!=b.ranges?V(c.ranges,c.ranges.length-1):b}function $b(a,b,c){var d=a.history.done,e=X(d);e&&e.ranges?(d[d.length-1]=b,Gb(a,b,c)):fa(a,b,c)}function fa(a,b,c){Gb(a,b,c);var b=a.sel,d=a.cm?a.cm.curOp.id:0/0,e=a.history,h=c&&c.origin,o;if(!(o=d==e.lastSelOp))if(o=h)if(o=e.lastSelOrigin==h)if(!(o=e.lastModTime==e.lastSelTime&&
e.lastOrigin==h)){o=X(e.done);var p=h.charAt(0);o="*"==p||"+"==p&&o.ranges.length==b.ranges.length&&o.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}o?e.done[e.done.length-1]=b:yc(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=h;e.lastSelOp=d;c&&!1!==c.clearRedo&&Vd(e.undone)}function Gb(a,b,c){(Ca(a,"beforeSelectionChange")||a.cm&&Ca(a.cm,"beforeSelectionChange"))&&(b=hd(a,b));var d=c&&c.bias||(0>L(b.primary().head,a.sel.primary().head)?
-1:1);zc(a,ac(a,b,d,!0));c&&!1===c.scroll||!a.cm||Hb(a.cm)}function zc(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Wd(a.cm)),ha(a,"cursorActivity",a))}function ob(a){zc(a,ac(a,a.sel,null,!1),ab)}function ac(a,b,c,d){for(var e,h=0;h<b.ranges.length;h++){var o=b.ranges[h],p=ta(a,o.anchor,c,d),s=ta(a,o.head,c,d);(e||p!=o.anchor||s!=o.head)&&(e||(e=b.ranges.slice(0,h)),e[h]=new q(p,s))}return e?V(e,b.primIndex):b}function ta(a,b,c,d){var e=!1,h=b,o=c||1;
a.cantEdit=!1;a:for(;;){var p=C(a,h.line);if(p.markedSpans)for(var s=0;s<p.markedSpans.length;++s){var g=p.markedSpans[s],n=g.marker;if((null==g.from||(n.inclusiveLeft?g.from<=h.ch:g.from<h.ch))&&(null==g.to||(n.inclusiveRight?g.to>=h.ch:g.to>h.ch))){if(d&&(ja(n,"beforeCursorEnter"),n.explicitlyCleared)){if(p.markedSpans){--s;continue}break}if(n.atomic){s=n.find(0>o?-1:1);if(0==L(s,h)&&(s.ch+=o,0>s.ch?s=s.line>a.first?F(a,u(s.line-1)):null:s.ch>p.text.length&&(s=s.line<a.first+a.size-1?u(s.line+1,
0):null),!s)){if(e)return d?(a.cantEdit=!0,u(a.first,0)):ta(a,b,c,!0);e=!0;s=b;o=-o}h=s;continue a}}}return h}}function Ib(a){for(var b=a.display,c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),h=d.selection=document.createDocumentFragment(),o=0;o<c.sel.ranges.length;o++){var p=c.sel.ranges[o],s=p.empty();if(s||a.options.showCursorWhenSelecting){var g=a,n=e,l=xa(g,p.head,"div",null,null,!g.options.singleCursorHeightPerLine),f=n.appendChild(B("div"," ","CodeMirror-cursor"));if(f.style.left=
l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*g.options.cursorHeight+"px",l.other)g=n.appendChild(B("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")),g.style.display="",g.style.left=l.other.left+"px",g.style.top=l.other.top+"px",g.style.height=0.85*(l.other.bottom-l.other.top)+"px"}s||pb(a,p,h)}a.options.moveInputWithCursor&&(a=xa(a,c.sel.primary().head,"div"),c=b.wrapper.getBoundingClientRect(),e=b.lineDiv.getBoundingClientRect(),d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-
10,a.top+e.top-c.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+e.left-c.left)));return d}function Ac(a,b){Da(a.display.cursorDiv,b.cursors);Da(a.display.selectionDiv,b.selection);null!=b.teTop&&(a.display.inputDiv.style.top=b.teTop+"px",a.display.inputDiv.style.left=b.teLeft+"px")}function Ya(a){Ac(a,Ib(a))}function pb(a,b,c){function d(a,b,c,d){0>b&&(b=0);b=Math.round(b);d=Math.round(d);p.appendChild(B("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+
b+"px; width: "+(null==c?n-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){var h,p,s=C(o,b),l=s.text.length;return cf(La(s),c||0,null==e?l:e,function(o,f,q){var i,j,qa=Ea(a,u(b,o),"div",s,"left");if(o==f)i=qa,q=j=qa.left;else{if(i=Ea(a,u(b,f-1),"div",s,"right"),"rtl"==q)q=qa,qa=i,i=q;q=qa.left;j=i.right}null==c&&0==o&&(q=g);3<i.top-qa.top&&(d(q,qa.top,null,qa.bottom),q=g,qa.bottom<i.top&&d(q,qa.bottom,null,i.top));null==e&&f==l&&(j=n);(!h||qa.top<h.top||qa.top==h.top&&qa.left<h.left)&&(h=qa);(!p||
i.bottom>p.bottom||i.bottom==p.bottom&&i.right>p.right)&&(p=i);g+1>q&&(q=g);d(q,i.top,j-q,i.bottom)}),{start:h,end:p}}var h=a.display,o=a.doc,p=document.createDocumentFragment(),s=Jb(a.display),g=s.left,n=h.lineSpace.offsetWidth-s.right,h=b.from(),b=b.to();if(h.line==b.line)e(h.line,h.ch,b.ch);else{var l=C(o,h.line),s=C(o,b.line),s=Ma(l)==Ma(s),h=e(h.line,h.ch,s?l.text.length+1:null).end,b=e(b.line,s?0:null,b.ch).start;s&&(h.top<b.top-2?(d(h.right,h.top,null,h.bottom),d(g,b.top,b.left,b.bottom)):
d(h.right,h.top,b.left-h.right,h.bottom));h.bottom<b.top&&d(g,h.bottom,null,b.top)}c.appendChild(p)}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):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function hb(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,
Ia(id,a))}function id(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=bc(b.mode,bb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(h){if(b.frontier>=a.display.viewFrom){var o=h.styles,p=Xd(a,h,d,!0);h.styles=p.styles;var s=h.styleClasses;(p=p.classes)?h.styleClasses=p:s&&(h.styleClasses=null);s=!o||o.length!=h.styles.length||s!=p&&(!s||!p||s.bgClass!=p.bgClass||s.textClass!=
p.textClass);for(p=0;!s&&p<o.length;++p)s=o[p]!=h.styles[p];s&&e.push(b.frontier);h.stateAfter=bc(b.mode,d)}else jd(a,h.text,d),h.stateAfter=0==b.frontier%5?bc(b.mode,d):null;return++b.frontier,+new Date>c?(hb(a,a.options.workDelay),!0):void 0});e.length&&z(a,function(){for(var b=0;b<e.length;b++)Ta(a,e[b],"text")})}}function kd(a,b,c){for(var d,e,h=a.doc,o=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>o;--b){if(b<=h.first)return h.first;var p=C(h,b-1);if(p.stateAfter&&(!c||b<=h.frontier))return b;p=Fa(p.text,
null,a.options.tabSize);(null==e||d>p)&&(e=b-1,d=p)}return e}function bb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var h=kd(a,b,c),o=h>d.first&&C(d,h-1).stateAfter;return o=o?bc(d.mode,o):df(d.mode),d.iter(h,b,function(c){jd(a,c.text,o);c.stateAfter=h==b-1||0==h%5||h>=e.viewFrom&&h<e.viewTo?bc(d.mode,o):null;++h}),c&&(d.frontier=h),o}function Jb(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Da(a.measure,B("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):
b.currentStyle,b={left:parseInt(b.paddingLeft),right:parseInt(b.paddingRight)};return isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b),b}function Bc(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Zb(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function Lb(a,b){var c=$(b),d=Bc(a,c);d&&!d.text?d=null:d&&d.changes&&ba(a,d,c,i(a));if(!d){var e;e=Ma(b);d=$(e);e=a.display.externalMeasured=new Yd(a.doc,e,d);e.lineN=d;d=e.built=Ud(a,e);
d=(e.text=d.pre,Da(a.display.lineMeasure,d.pre),e)}a:if(e=d,e.line==b)c={map:e.measure.map,cache:e.measure.cache};else{for(var h=0;h<e.rest.length;h++)if(e.rest[h]==b){c={map:e.measure.maps[h],cache:e.measure.caches[h]};break a}for(h=0;h<e.rest.length;h++)if($(e.rest[h])>c){c={map:e.measure.maps[h],cache:e.measure.caches[h],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 cb(a,b,c,d,e){b.before&&(c=-1);var h=c+(d||"");if(b.cache.hasOwnProperty(h))a=
b.cache[h];else{b.rect||(b.rect=b.view.text.getBoundingClientRect());if(!b.hasHeights){var o=b.view,p=b.rect,s=a.options.lineWrapping,g=s&&a.display.scroller.clientWidth;if(!o.measure.heights||s&&o.measure.width!=g){var n=o.measure.heights=[];if(s){o.measure.width=g;o=o.text.firstChild.getClientRects();for(s=0;s<o.length-1;s++){var g=o[s],l=o[s+1];2<Math.abs(g.bottom-l.bottom)&&n.push((g.bottom+l.top)/2-p.top)}}n.push(p.bottom-p.top)}b.hasHeights=!0}for(var p=d,q,f,i,j,n=b.map,d=0;d<n.length;d+=3){var A=
n[d],z=n[d+1];if(A>c?(f=0,i=1,j="left"):z>c?(f=c-A,i=f+1):(d==n.length-3||c==z&&n[d+3]>c)&&(i=z-A,f=i-1,c>=z&&(j="right")),null!=f){if(q=n[d+2],A==z&&p==(q.insertLeft?"left":"right")&&(j=p),"left"==p&&0==f)for(;d&&n[d-2]==n[d-3]&&n[d-1].insertLeft;)q=n[(d-=3)+2],j="left";if("right"==p&&f==z-A)for(;d<n.length-3&&n[d+3]==n[d+4]&&!n[d+5].insertLeft;)q=n[(d+=3)+2],j="right";break}}var t;if(3==q.nodeType){for(d=0;4>d;d++){for(;f&&cc(b.line.text.charAt(A+f));)--f;for(;z>A+i&&cc(b.line.text.charAt(A+i));)++i;
if(P&&9>W&&0==f&&i==z-A)t=q.parentNode.getBoundingClientRect();else if(P&&a.options.lineWrapping){var k=Mb(q,f,i).getClientRects();t=k.length?k["right"==p?k.length-1:0]:ld}else t=Mb(q,f,i).getBoundingClientRect()||ld;if(t.left||t.right||0==f)break;i=f;f-=1;j="right"}if(P&&11>W){if(!(c=!window.screen))if(!(c=null==screen.logicalXDPI))if(!(c=screen.logicalXDPI==screen.deviceXDPI))null!=md?c=md:(i=Da(a.display.measure,B("span","x")),c=i.getBoundingClientRect(),i=Mb(i,0,1).getBoundingClientRect(),c=md=
1<Math.abs(c.left-i.left)),c=!c;c||(c=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI,t={left:t.left*c,right:t.right*c,top:t.top*i,bottom:t.bottom*i})}}else 0<f&&(j=p="right"),t=a.options.lineWrapping&&1<(k=q.getClientRects()).length?k["right"==p?k.length-1:0]:q.getBoundingClientRect();if(P&&9>W&&!f&&(!t||!t.left&&!t.right))t=(q=q.parentNode.getClientRects()[0])?{left:q.left,right:q.left+ib(a.display),top:q.top,bottom:q.bottom}:ld;q=t.top-b.rect.top;f=t.bottom-b.rect.top;
c=(q+f)/2;i=b.view.measure.heights;for(d=0;d<i.length-1&&!(c<i[d]);d++);j={left:("right"==j?t.right:t.left)-b.rect.left,right:("left"==j?t.left:t.right)-b.rect.left,top:d?i[d-1]:0,bottom:i[d]};a=(t.left||t.right||(j.bogus=!0),a.options.singleCursorHeightPerLine||(j.rtop=q,j.rbottom=f),j);a.bogus||(b.cache[h]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function db(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 qb(a){a.display.externalMeasure=null;kb(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)db(a.display.view[b])}function va(a){qb(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function Nb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var h=dc(b.widgets[e]);c.top+=h;c.bottom+=h}if("line"==d)return c;d||(d="local");b=Qa(b);
if("local"==d?b+=a.display.lineSpace.offsetTop:b-=a.display.viewOffset,"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;return c.top+=b,c.bottom+=b,c}function rb(a,b,c){if("div"==c)return b;var d=b.left,b=b.top;if("page"==c)d-=window.pageXOffset||(document.documentElement||
document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop;else if("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 Ea(a,b,c,d,e){return d||(d=C(a.doc,b.line)),Nb(a,d,cb(a,Lb(a,d),b.ch,e),c)}function xa(a,b,c,d,e,h){function o(b,o){var p=cb(a,e,b,o?"right":"left",h);return o?p.left=p.right:p.right=p.left,Nb(a,d,p,c)}function p(a,b){var c=s[b],
d=c.level%2;return a==(c.level%2?c.to:c.from)&&b&&c.level<s[b-1].level?(c=s[--b],a=nd(c)-(c.level%2?0:1),d=!0):a==nd(c)&&b<s.length-1&&c.level<s[b+1].level&&(c=s[++b],a=(c.level%2?c.to:c.from)-c.level%2,d=!1),d&&a==c.to&&a>c.from?o(a-1):o(a,d)}d=d||C(a.doc,b.line);e||(e=Lb(a,d));var s=La(d),b=b.ch;if(!s)return o(b);var g=od(s,b),g=p(b,g);return null!=ec&&(g.other=p(b,ec)),g}function Ob(a,b){var c=0,b=F(a.doc,b);a.options.lineWrapping||(c=ib(a.display)*b.ch);var d=C(a.doc,b.line),e=Qa(d)+a.display.lineSpace.offsetTop;
return{left:c,right:c,top:e,bottom:e+d.height}}function sb(a,b,c,d){a=u(a,b);return a.xRel=d,c&&(a.outside=!0),a}function tb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return sb(d.first,0,!0,-1);var e=mb(d,c),h=d.first+d.size-1;if(e>h)return sb(d.first+d.size-1,C(d,h).text.length,!0,1);0>b&&(b=0);for(d=C(d,e);;){e=pd(a,d,e,b,c);h=(d=lb(d,!1))&&d.find(0,!0);if(!d||!(e.ch>h.from.ch||e.ch==h.from.ch&&0<e.xRel))return e;e=$(d=h.to.line)}}function pd(a,b,c,d,e){function h(d){d=xa(a,u(c,d),"line",
b,g);return p=!0,o>d.bottom?d.left-s:o<d.top?d.left+s:(p=!1,d.left)}var o=e-Qa(b),p=!1,s=2*a.display.wrapper.clientWidth,g=Lb(a,b),n=La(b),l=b.text.length,e=Cc(b),f=Dc(b),q=h(e),i=p,j=h(f),t=p;if(d>j)return sb(c,f,t,1);for(;;){if(n?f==e||f==qd(b,e,1):1>=f-e){n=q>d||j-d>=d-q?e:f;for(d-=n==e?q:j;cc(b.text.charAt(n));)++n;return sb(c,n,n==e?i:t,-1>d?-1:1<d?1:0)}var A=Math.ceil(l/2),z=e+A;if(n)for(var z=e,k=0;A>k;++k)z=qd(b,z,1);k=h(z);k>d?(f=z,j=k,(t=p)&&(j+=1E3),l=A):(e=z,q=k,i=p,l-=A)}}function Oa(a){if(null!=
a.cachedTextHeight)return a.cachedTextHeight;if(null==ub){ub=B("pre");for(var b=0;49>b;++b)ub.appendChild(document.createTextNode("x")),ub.appendChild(B("br"));ub.appendChild(document.createTextNode("x"))}Da(a.measure,ub);b=ub.offsetHeight/50;return 3<b&&(a.cachedTextHeight=b),kb(a.measure),b||1}function ib(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=B("span","xxxxxxxxxx"),c=B("pre",[b]);Da(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;return 2<b&&(a.cachedCharWidth=
b),b||10}function eb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++ef};Pb?Pb.ops.push(a.curOp):a.curOp.ownsGroup=Pb={ops:[a.curOp],delayedCallbacks:[]}}function n(a){if(a=a.curOp.ownsGroup)try{var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c]();for(var d=0;d<a.ops.length;d++){var e=a.ops[d];
if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++](e.cm)}}while(c<b.length)}finally{Pb=null;for(b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++)e=a[b],c=e.cm,d=c.display,e.updateMaxLine&&aa(c),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&c.options.lineWrapping,e.update=
e.mustUpdate&&new Q(c,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate);for(b=0;b<a.length;b++)e=a[b],e.updatedDisplay=e.mustUpdate&&K(e.cm,e.update);for(b=0;b<a.length;b++)e=a[b],c=e.cm,d=c.display,e.updatedDisplay&&T(c),e.barMeasure=Y(c),d.maxLineChanged&&!c.options.lineWrapping&&(e.adjustWidthTo=cb(c,Lb(c,d.maxLine),d.maxLine.text.length,void 0).left+3,e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo+ya-d.scroller.clientWidth)),(e.updatedDisplay||e.selectionChanged)&&
(e.newSelectionNodes=Ib(c));for(b=0;b<a.length;b++)e=a[b],c=e.cm,null!=e.adjustWidthTo&&(c.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<c.doc.scrollLeft&&Qb(c,Math.min(c.display.scroller.scrollLeft,e.maxScrollLeft),!0),c.display.maxLineChanged=!1),e.newSelectionNodes&&Ac(c,e.newSelectionNodes),e.updatedDisplay&&E(c,e.barMeasure),(e.updatedDisplay||e.startHeight!=c.doc.height)&&x(c,e.barMeasure),e.selectionChanged&&Kb(c),c.state.focused&&e.updateInput&&Ja(c,e.typing);for(b=0;b<
a.length;b++){var e=a[b],c=e.cm,d=c.display,h=c.doc;if(null!=e.adjustWidthTo&&1<Math.abs(e.barMeasure.scrollWidth-c.display.scroller.scrollWidth)&&x(c),e.updatedDisplay&&R(c,e.update),null==d.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(d.wheelStartX=d.wheelStartY=null),null!=e.scrollTop&&(d.scroller.scrollTop!=e.scrollTop||e.forceScroll)){var o=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,e.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=h.scrollTop=
o}if(null!=e.scrollLeft&&(d.scroller.scrollLeft!=e.scrollLeft||e.forceScroll))o=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,e.scrollLeft)),d.scroller.scrollLeft=d.scrollbarH.scrollLeft=h.scrollLeft=o,ea(c);if(e.scrollToPos){o=void 0;a:{var o=F(h,e.scrollToPos.from),p=F(h,e.scrollToPos.to),s=e.scrollToPos.margin;for(null==s&&(s=0);;){var g=!1,n=xa(c,o),l=p&&p!=o?xa(c,p):n,l=Ec(c,Math.min(n.left,l.left),Math.min(n.top,l.top)-s,Math.max(n.left,l.left),Math.max(n.bottom,l.bottom)+
s),f=c.doc.scrollTop,q=c.doc.scrollLeft;if(null!=l.scrollTop&&(fc(c,l.scrollTop),1<Math.abs(c.doc.scrollTop-f)&&(g=!0)),null!=l.scrollLeft&&(Qb(c,l.scrollLeft),1<Math.abs(c.doc.scrollLeft-q)&&(g=!0)),!g){o=n;break a}}o=void 0}if(e.scrollToPos.isCursor&&c.state.focused&&(p=o,s=c.display,g=s.sizer.getBoundingClientRect(),o=null,0>p.top+g.top?o=!0:p.bottom+g.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!ff))p=B("div","​",null,"position: absolute; top: "+(p.top-s.viewOffset-
c.display.lineSpace.offsetTop)+"px; height: "+(p.bottom-p.top+ya)+"px; left: "+p.left+"px; width: 2px;"),c.display.lineSpace.appendChild(p),p.scrollIntoView(o),c.display.lineSpace.removeChild(p)}o=e.maybeHiddenMarkers;p=e.maybeUnhiddenMarkers;if(o)for(s=0;s<o.length;++s)o[s].lines.length||ja(o[s],"hide");if(p)for(s=0;s<p.length;++s)p[s].lines.length&&ja(p[s],"unhide");d.wrapper.offsetHeight&&(h.scrollTop=c.display.scroller.scrollTop);e.updatedDisplay&&ka&&(c.options.lineWrapping&&(d=e.barMeasure,
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=d.docHeight+"px")),e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!(c.display.scroller.clientHeight-c.display.wrapper.clientHeight<ya-3)&&x(c));e.changeObjs&&ja(c,"changes",c,e.changeObjs)}}}function z(a,b){if(a.curOp)return b();eb(a);try{return b()}finally{n(a)}}
function A(a,b){return function(){if(a.curOp)return b.apply(a,arguments);eb(a);try{return b.apply(a,arguments)}finally{n(a)}}}function Z(a){return function(){if(this.curOp)return a.apply(this,arguments);eb(this);try{return a.apply(this,arguments)}finally{n(this)}}}function na(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);eb(b);try{return a.apply(this,arguments)}finally{n(b)}}}function Yd(a,b,c){for(var d=this.line=b,e;d=lb(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);
this.size=(this.rest=e)?$(X(this.rest))-c+1:1;this.node=this.text=null;this.hidden=jb(a,b)}function xc(a,b,c){var d,e=[];for(d=b;c>d;)b=new Yd(a.doc,C(a.doc,d),d),d+=b.size,e.push(b);return e}function ua(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;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Xa&&fd(a.doc,b)<e.viewTo&&Wa(a);else if(c<=e.viewFrom)Xa&&Td(a.doc,c+d)>e.viewFrom?
Wa(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Wa(a);else if(b<=e.viewFrom){var h=Fc(a,c,c+d,1);h?(e.view=e.view.slice(h.index),e.viewFrom=h.lineN,e.viewTo+=d):Wa(a)}else if(c>=e.viewTo)(h=Fc(a,b,b,-1))?(e.view=e.view.slice(0,h.index),e.viewTo=h.lineN):Wa(a);else{var h=Fc(a,b,b,-1),o=Fc(a,c,c+d,1);h&&o?(e.view=e.view.slice(0,h.index).concat(xc(a,h.lineN,o.lineN)).concat(e.view.slice(o.index)),e.viewTo+=d):Wa(a)}(a=e.externalMeasured)&&(c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&
(e.externalMeasured=null))}function Ta(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo))a=d.view[Zb(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==la(a,c)&&a.push(c))}function Wa(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function Zb(a,b){if(b>=a.display.viewTo||(b-=a.display.viewFrom,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 Fc(a,b,c,d){var e=Zb(a,b),h=a.display.view;if(!Xa||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var o=0,p=a.display.viewFrom;e>o;o++)p+=h[o].size;if(p!=b){if(0<d){if(e==h.length-1)return null;b=p+h[e].size-b;e++}else b=p-b;c+=b}for(;fd(a.doc,c)!=c;){if(e==(0>d?0:h.length-1))return null;c+=d*h[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Sd(a){for(var a=a.display.view,b=0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&!d.changes||
++b}return b}function Gc(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){rd(a);a.state.focused&&Gc(a)})}function gc(a){function b(){rd(a)||c?(a.display.pollingFast=!1,Gc(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function rd(a){var b=a.display.input,c=a.display.prevInput,d=a.doc;if(!a.state.focused||gf(b)&&!c||Hc(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(P&&9<=W&&a.display.inputHasSelection===e||za&&/[\uf700-\uf7ff]/.test(e))return Ja(a),!1;var h=!a.curOp;h&&eb(a);a.display.shift=!1;8203!=e.charCodeAt(0)||d.sel!=a.display.selForContextMenu||c||(c="​");for(var o=0,p=Math.min(c.length,e.length);p>o&&c.charCodeAt(o)==e.charCodeAt(o);)++o;var p=e.slice(o),g=vb(p),l=null;a.state.pasteIncoming&&1<d.sel.ranges.length&&(wb&&wb.join("\n")==p?l=0==d.sel.ranges.length%
wb.length&&hc(wb,vb):g.length==d.sel.ranges.length&&(l=hc(g,function(a){return[a]})));for(var f=d.sel.ranges.length-1;0<=f;f--){var q=d.sel.ranges[f],i=q.from(),j=q.to();o<c.length?i=u(i.line,i.ch-(c.length-o)):a.state.overwrite&&q.empty()&&!a.state.pasteIncoming&&(j=u(j.line,Math.min(C(d,j.line).text.length,j.ch+X(g).length)));var t=a.curOp.updateInput,i={from:i,to:j,text:l?l[f%l.length]:g,origin:a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input"};if(Rb(a.doc,i),ha(a,"inputRead",a,
i),p&&!a.state.pasteIncoming&&a.options.electricChars&&a.options.smartIndent&&100>q.head.ch&&(!f||d.sel.ranges[f-1].head.line!=q.head.line))if(q=a.getModeAt(q.head),i=fb(i),q.electricChars)for(j=0;j<q.electricChars.length;j++){if(-1<p.indexOf(q.electricChars.charAt(j))){ic(a,i.line,"smart");break}}else q.electricInput&&q.electricInput.test(C(d,i.line).text.slice(0,i.ch))&&ic(a,i.line,"smart")}return Hb(a),a.curOp.updateInput=t,a.curOp.typing=!0,1E3<e.length||-1<e.indexOf("\n")?b.value=a.display.prevInput=
"":a.display.prevInput=e,h&&n(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function Ja(a,b){var c,d,e=a.doc;a.somethingSelected()?(a.display.prevInput="",c=e.sel.primary(),d=(c=Zd&&(100<c.to().line-c.from().line||1E3<(d=a.getSelection()).length))?"-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&jc(a.display.input),P&&9<=W&&(a.display.inputHasSelection=d)):b||(a.display.prevInput=a.display.input.value="",P&&9<=W&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=
c}function sa(a){"nocursor"==a.options.readOnly||ad&&Va()==a.display.input||a.display.input.focus()}function sd(a){a.state.focused||(sa(a),cd(a))}function Hc(a){return a.options.readOnly||a.doc.cantEdit}function Ze(a){function b(){a.state.focused&&setTimeout(Ia(sa,a),0)}function c(b){Na(a,b)||td(b)}function d(b){if(a.somethingSelected())wb=a.getSelections(),e.inaccurateSelection&&(e.prevInput="",e.inaccurateSelection=!1,e.input.value=wb.join("\n"),jc(e.input));else{for(var c=[],d=[],g=0;g<a.doc.sel.ranges.length;g++){var n=
a.doc.sel.ranges[g].head.line,n={anchor:u(n,0),head:u(n+1,0)};d.push(n);c.push(a.getRange(n.anchor,n.head))}"cut"==b.type?a.setSelections(d,null,ab):(e.prevInput="",e.input.value=c.join("\n"),jc(e.input));wb=c}"cut"==b.type&&(a.state.cutIncoming=!0)}var e=a.display;I(e.scroller,"mousedown",A(a,Rd));P&&11>W?I(e.scroller,"dblclick",A(a,function(b){if(!Na(a,b)){var c=Sb(a,b);c&&(!ud(a,b,"gutterClick",!0,ha)&&!xb(a.display,b))&&(oa(b),b=a.findWordAt(c),l(a.doc,b.anchor,b.head))}})):I(e.scroller,"dblclick",
function(b){Na(a,b)||oa(b)});I(e.lineSpace,"selectstart",function(a){xb(e,a)||oa(a)});vd||I(e.scroller,"contextmenu",function(b){$d(a,b)});I(e.scroller,"scroll",function(){e.scroller.clientHeight&&(fc(a,e.scroller.scrollTop),Qb(a,e.scroller.scrollLeft,!0),ja(a,"scroll",a))});I(e.scrollbarV,"scroll",function(){e.scroller.clientHeight&&fc(a,e.scrollbarV.scrollTop)});I(e.scrollbarH,"scroll",function(){e.scroller.clientHeight&&Qb(a,e.scrollbarH.scrollLeft)});I(e.scroller,"mousewheel",function(b){ae(a,
b)});I(e.scroller,"DOMMouseScroll",function(b){ae(a,b)});I(e.scrollbarH,"mousedown",b);I(e.scrollbarV,"mousedown",b);I(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0});I(e.input,"keyup",function(b){be.call(a,b)});I(e.input,"input",function(){P&&9<=W&&a.display.inputHasSelection&&(a.display.inputHasSelection=null);gc(a)});I(e.input,"keydown",A(a,ce));I(e.input,"keypress",A(a,de));I(e.input,"focus",Ia(cd,a));I(e.input,"blur",Ia(wc,a));a.options.dragDrop&&(I(e.scroller,"dragstart",
function(b){var c=a;if(P&&(!c.state.draggingText||100>+new Date-ee))td(b);else if(!Na(c,b)&&!xb(c.display,b)&&(b.dataTransfer.setData("Text",c.getSelection()),b.dataTransfer.setDragImage&&!fe)){var d=B("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";Ga&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop);b.dataTransfer.setDragImage(d,0,0);Ga&&d.parentNode.removeChild(d)}}),I(e.scroller,"dragenter",
c),I(e.scroller,"dragover",c),I(e.scroller,"drop",A(a,hf)));I(e.scroller,"paste",function(b){xb(e,b)||(a.state.pasteIncoming=!0,sa(a),gc(a))});I(e.input,"paste",function(){if(ka&&!a.state.fakedLastChar&&!(200>new Date-a.state.lastMiddleDown)){var b=e.input.selectionStart,c=e.input.selectionEnd;e.input.value+="$";e.input.selectionEnd=c;e.input.selectionStart=b;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;gc(a)});I(e.input,"cut",d);I(e.input,"copy",d);ed&&I(e.sizer,"mouseup",function(){Va()==e.input&&
e.input.blur();sa(a)})}function jf(a){var b=a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null;a.setSize()}function xb(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 Sb(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 h,o,e=e.lineSpace.getBoundingClientRect();try{h=b.clientX-e.left,o=b.clientY-
e.top}catch(p){return null}var g,b=tb(a,h,o);if(d&&1==b.xRel&&(g=C(a.doc,b.line).text).length==b.ch)d=Fa(g,g.length,a.options.tabSize)-g.length,b=u(b.line,Math.max(0,Math.round((h-Jb(a.display).left)/ib(a.display))-d));return b}function Rd(a){if(!Na(this,a)){var b=this.display;if(b.shift=a.shiftKey,xb(b,a))return ka||(b.scroller.draggable=!1,setTimeout(function(){b.scroller.draggable=!0},100)),void 0;if(!ud(this,a,"gutterClick",!0,ha)){var c=Sb(this,a);switch(window.focus(),ge(a)){case 1:c?kf(this,
a,c):(a.target||a.srcElement)==b.scroller&&oa(a);break;case 2:ka&&(this.state.lastMiddleDown=+new Date);c&&l(this.doc,c);setTimeout(Ia(sa,this),20);oa(a);break;case 3:vd&&$d(this,a)}}}}function kf(a,b,c){setTimeout(Ia(sd,a),0);var d,e=+new Date;Ic&&Ic.time>e-400&&0==L(Ic.pos,c)?d="triple":Jc&&Jc.time>e-400&&0==L(Jc.pos,c)?(d="double",Ic={time:e,pos:c}):(d="single",Jc={time:e,pos:c});var e=a.doc.sel,h=za?b.metaKey:b.ctrlKey;a.options.dragDrop&&lf&&!Hc(a)&&"single"==d&&-1<e.contains(c)&&e.somethingSelected()?
mf(a,b,c,h):nf(a,b,c,d,h)}function mf(a,b,c,d){var e=a.display,h=A(a,function(o){ka&&(e.scroller.draggable=!1);a.state.draggingText=!1;Ua(document,"mouseup",h);Ua(e.scroller,"drop",h);10>Math.abs(b.clientX-o.clientX)+Math.abs(b.clientY-o.clientY)&&(oa(o),d||l(a.doc,c),sa(a),P&&9==W&&setTimeout(function(){document.body.focus();sa(a)},20))});ka&&(e.scroller.draggable=!0);a.state.draggingText=h;e.scroller.dragDrop&&e.scroller.dragDrop();I(document,"mouseup",h);I(e.scroller,"drop",h)}function nf(a,b,
c,d,e){function h(b){if(0!=L(j,b))if(j=b,"rect"==d){for(var e=[],h=a.options.tabSize,o=Fa(C(n,c.line).text,c.ch,h),p=Fa(C(n,b.line).text,b.ch,h),g=Math.min(o,p),o=Math.max(o,p),p=Math.min(c.line,b.line),s=Math.min(a.lastLine(),Math.max(c.line,b.line));s>=p;p++){var t=C(n,p).text,z=he(t,g,h);g==o?e.push(new q(u(p,z),u(p,z))):t.length>z&&e.push(new q(u(p,z),u(p,he(t,o,h))))}e.length||e.push(new q(c,c));fa(n,V(i.ranges.slice(0,f).concat(e),f),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else e=l,
h=e.anchor,g=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new q(u(b.line,0),F(n,u(b.line+1,0))),0<L(b.anchor,h)?(g=b.head,h=ra(e.from(),b.anchor)):(g=b.anchor,h=Sa(e.to(),b.head))),e=i.ranges.slice(0),e[f]=new q(F(n,h),g),fa(n,V(e,f),wd)}function o(b){var c=++z,e=Sb(a,b,!0,"rect"==d);if(e)if(0!=L(e,j)){sd(a);h(e);var p=k(g,n);(e.line>=p.to||e.line<p.from)&&setTimeout(A(a,function(){z==c&&o(b)}),150)}else{var l=b.clientY<t.top?-20:b.clientY>t.bottom?20:0;l&&setTimeout(A(a,function(){z==c&&(g.scroller.scrollTop+=
l,o(b))}),50)}}function p(b){z=1/0;oa(b);sa(a);Ua(document,"mousemove",Z);Ua(document,"mouseup",v);n.history.lastSelOrigin=null}var g=a.display,n=a.doc;oa(b);var l,f,i=n.sel;(e&&!b.shiftKey?(f=n.sel.contains(c),l=-1<f?n.sel.ranges[f]:new q(c,c)):l=n.sel.primary(),b.altKey)?(d="rect",e||(l=new q(c,c)),c=Sb(a,b,!0,!0),f=-1):"double"==d?(b=a.findWordAt(c),l=a.display.shift||n.extend?wa(n,l,b.anchor,b.head):b):"triple"==d?(b=new q(u(c.line,0),F(n,u(c.line+1,0))),l=a.display.shift||n.extend?wa(n,l,b.anchor,
b.head):b):l=wa(n,l,c);e?-1<f?ia(n,f,l,wd):(f=n.sel.ranges.length,fa(n,V(n.sel.ranges.concat([l]),f),{scroll:!1,origin:"*mouse"})):(f=0,fa(n,new J([l],0),wd),i=n.sel);var j=c,t=g.wrapper.getBoundingClientRect(),z=0,Z=A(a,function(a){ge(a)?o(a):p(a)}),v=A(a,p);I(document,"mousemove",Z);I(document,"mouseup",v)}function ud(a,b,c,d,e){try{var h=b.clientX,o=b.clientY}catch(p){return!1}if(h>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&oa(b);var d=a.display,g=d.lineDiv.getBoundingClientRect();
if(o>g.bottom||!Ca(a,c))return xd(b);o-=g.top-d.viewOffset;for(g=0;g<a.options.gutters.length;++g){var n=d.gutters.childNodes[g];if(n&&n.getBoundingClientRect().right>=h)return h=mb(a.doc,o),e(a,c,a,h,a.options.gutters[g],b),xd(b)}}function hf(a){var b=this;if(!Na(b,a)&&!xb(b.display,a)){oa(a);P&&(ee=+new Date);var c=Sb(b,a,!0),d=a.dataTransfer.files;if(c&&!Hc(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,h=Array(e),o=0,a=function(a,d){var p=new FileReader;p.onload=A(b,function(){if(h[d]=
p.result,++o==e){c=F(b.doc,c);var a={from:c,to:c,text:vb(h.join("\n")),origin:"paste"};Rb(b.doc,a);$b(b.doc,t(c,fb(a)))}});p.readAsText(a)},p=0;e>p;++p)a(d[p],p);else{if(b.state.draggingText&&-1<b.doc.sel.contains(c))return b.state.draggingText(a),setTimeout(Ia(sa,b),20),void 0;try{if(h=a.dataTransfer.getData("Text")){if(b.state.draggingText&&!(za?a.metaKey:a.ctrlKey))var g=b.listSelections();if(Gb(b.doc,t(c,c)),g)for(p=0;p<g.length;++p)Kc(b.doc,"",g[p].anchor,g[p].head,"drag");b.replaceSelection(h,
"around","paste");sa(b)}}catch(n){}}}}function fc(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,kc||S(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),kc&&S(a),hb(a,100))}function Qb(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,ea(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=
b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function ae(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,h=e.scroller;if(c&&h.scrollWidth>h.clientWidth||d&&h.scrollHeight>h.clientHeight){if(d&&za&&ka){var o=b.target,p=e.view;a:for(;o!=h;o=o.parentNode)for(var g=0;g<p.length;g++)if(p[g].node==o){a.display.currentWheelTarget=
o;break a}}if(c&&!kc&&!Ga&&null!=Ha)return d&&fc(a,Math.max(0,Math.min(h.scrollTop+d*Ha,h.scrollHeight-h.clientHeight))),Qb(a,Math.max(0,Math.min(h.scrollLeft+c*Ha,h.scrollWidth-h.clientWidth))),oa(b),e.wheelStartX=null,void 0;d&&null!=Ha&&(o=d*Ha,p=a.doc.scrollTop,g=p+e.wrapper.clientHeight,0>o?p=Math.max(0,p+o-50):g=Math.min(a.doc.height,g+o+50),S(a,{top:p,bottom:g}));20>Lc&&(null==e.wheelStartX?(e.wheelStartX=h.scrollLeft,e.wheelStartY=h.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=
e.wheelStartX){var a=h.scrollLeft-e.wheelStartX,b=h.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(Ha=(Ha*Lc+a)/(Lc+1),++Lc)}},200)):(e.wheelDX+=c,e.wheelDY+=d))}}function Mc(a,b,c){if("string"==typeof b&&(b=Nc[b],!b))return!1;a.display.pollingFast&&rd(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Hc(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=ie}finally{a.display.shift=d,a.state.suppressEdits=
!1}return e}function je(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function ke(a,b){var c=yd(a.options.keyMap),d=c.auto;clearTimeout(le);d&&!of(b)&&(le=setTimeout(function(){yd(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,G(a))},50));var e=pf(b,!0),h=!1;if(!e)return!1;var o=je(a);return h=b.shiftKey?Oc("Shift-"+e,o,function(b){return Mc(a,b,!0)})||Oc(e,o,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):
b.motion)?Mc(a,b):void 0}):Oc(e,o,function(b){return Mc(a,b)}),h&&(oa(b),Kb(a),ha(a,"keyHandled",a,e,b)),h}function qf(a,b,c){var d=Oc("'"+c+"'",je(a),function(b){return Mc(a,b,!0)});return d&&(oa(b),Kb(a),ha(a,"keyHandled",a,"'"+c+"'",b)),d}function ce(a){if(sd(this),!Na(this,a)){P&&11>W&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=ke(this,a);Ga&&(zd=c?b:null,!c&&88==b&&!Zd&&(za?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||
rf(this)}}function rf(a){function b(a){18!=a.keyCode&&a.altKey||(Pc(c,"CodeMirror-crosshair"),Ua(document,"keyup",b),Ua(document,"mouseover",b))}var c=a.display.lineDiv;Qc(c,"CodeMirror-crosshair");I(document,"keyup",b);I(document,"mouseover",b)}function be(a){16==a.keyCode&&(this.doc.sel.shift=!1);Na(this,a)}function de(a){if(!Na(this,a)&&!(a.ctrlKey&&!a.altKey||za&&a.metaKey)){var b=a.keyCode,c=a.charCode;if(Ga&&b==zd)return zd=null,oa(a),void 0;if(!(Ga&&(!a.which||10>a.which)||ed)||!ke(this,a))b=
String.fromCharCode(null==c?b:c),qf(this,a,b)||(P&&9<=W&&(this.display.inputHasSelection=null),gc(this))}}function cd(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(ja(a,"focus",a),a.state.focused=!0,Qc(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(Ja(a),ka&&setTimeout(Ia(Ja,a,!0),0))),Gc(a),Kb(a))}function wc(a){a.state.focused&&(ja(a,"blur",a),a.state.focused=!1,Pc(a.display.wrapper,"CodeMirror-focused"));clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||
(a.display.shift=!1)},150)}function $d(a,b){function c(){if(null!=e.input.selectionStart){var b=a.somethingSelected(),c=e.input.value="​"+(b?e.input.value:"");e.prevInput=b?"":"​";e.input.selectionStart=1;e.input.selectionEnd=c.length;e.selForContextMenu=a.doc.sel}}function d(){if(e.inputDiv.style.position="relative",e.input.style.cssText=p,P&&9>W&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=o),Gc(a),null!=e.input.selectionStart){(!P||P&&9>W)&&c();var b=0,d=function(){e.selForContextMenu==a.doc.sel&&
0==e.input.selectionStart?A(a,Nc.selectAll)(a):10>b++?e.detectingSelectAll=setTimeout(d,500):Ja(a)};e.detectingSelectAll=setTimeout(d,200)}}if(!Na(a,b,"contextmenu")){var e=a.display;if(!xb(e,b)&&(!Ca(a,"gutterContextMenu")||!ud(a,b,"gutterContextMenu",!1,ja))){var h=Sb(a,b),o=e.scroller.scrollTop;if(h&&!Ga){a.options.resetSelectionOnContextMenu&&-1==a.doc.sel.contains(h)&&A(a,fa)(a.doc,t(h),ab);var p=e.input.style.cssText;if(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: "+(P?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ka)var g=window.scrollY;if(sa(a),ka&&window.scrollTo(null,g),Ja(a),a.somethingSelected()||(e.input.value=e.prevInput=" "),e.selForContextMenu=a.doc.sel,clearTimeout(e.detectingSelectAll),P&&9<=W&&c(),vd){td(b);var n=function(){Ua(window,"mouseup",n);setTimeout(d,20)};I(window,
"mouseup",n)}else setTimeout(d,50)}}}}function me(a,b){if(0>L(a,b.from))return a;if(0>=L(a,b.to))return fb(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=fb(b).ch-b.to.ch),u(c,d)}function Ad(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new q(me(e.anchor,b),me(e.head,b)))}return V(c,a.sel.primIndex)}function ne(a,b,c){return a.line==b.line?u(c.line,a.ch-b.ch+c.ch):u(c.line+(a.line-b.line),a.ch)}function oe(a,b,c){b={canceled:!1,
from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(b.update=function(b,c,h,o){b&&(this.from=F(a,b));c&&(this.to=F(a,c));h&&(this.text=h);void 0!==o&&(this.origin=o)}),ja(a,"beforeChange",a,b),a.cm&&ja(a.cm,"beforeChange",a.cm,b),b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Rb(a,b,c){if(a.cm){if(!a.cm.curOp)return A(a.cm,Rb)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(Ca(a,"beforeChange")||a.cm&&Ca(a.cm,"beforeChange"))||
(b=oe(a,b,!0)))if(c=pe&&!c&&sf(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)qe(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else qe(a,b)}function qe(a,b){if(1!=b.text.length||""!=b.text[0]||0!=L(b.from,b.to)){var c=Ad(a,b);re(a,b,c,a.cm?a.cm.curOp.id:0/0);lc(a,b,c,Bd(a,b));var d=[];yb(a,function(a,c){c||-1!=la(d,a.history)||(se(a.history,b),d.push(a.history));lc(a,b,null,Bd(a,b))})}}function Rc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,h=a.sel,o="undo"==b?e.done:e.undone,
p="undo"==b?e.undone:e.done,g=0;g<o.length&&(d=o[g],c?!d.ranges||d.equals(a.sel):d.ranges);g++);if(g!=o.length){for(e.lastOrigin=e.lastSelOrigin=null;d=o.pop(),d.ranges;){if(yc(d,p),c&&!d.equals(a.sel))return fa(a,d,{clearRedo:!1}),void 0;h=d}c=[];yc(h,p);p.push({changes:c,generation:e.generation});e.generation=d.generation||++e.maxGeneration;e=Ca(a,"beforeChange")||a.cm&&Ca(a.cm,"beforeChange");for(g=d.changes.length-1;0<=g;--g){var n=d.changes[g];if(n.origin=b,e&&!oe(a,n,!1))return o.length=0,void 0;
c.push(Cd(a,n));h=g?Ad(a,n):X(o);lc(a,n,h,te(a,n));!g&&a.cm&&a.cm.scrollIntoView({from:n.from,to:fb(n)});var l=[];yb(a,function(a,b){b||-1!=la(l,a.history)||(se(a.history,n),l.push(a.history));lc(a,n,null,te(a,n))})}}}}function ue(a,b){if(0!=b&&(a.first+=b,a.sel=new J(hc(a.sel.ranges,function(a){return new q(u(a.anchor.line+b,a.anchor.ch),u(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){ua(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Ta(a.cm,d,"gutter")}}function lc(a,
b,c,d){if(a.cm&&!a.cm.curOp)return A(a.cm,lc)(a,b,c,d);if(b.to.line<a.first)return ue(a,b.text.length-1-(b.to.line-b.from.line)),void 0;if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);ue(a,e);b={from:u(a.first,0),to:u(b.to.line+e,b.to.ch),text:[X(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:u(e,C(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=mc(a,b.from,b.to);c||(c=Ad(a,b));a.cm?tf(a.cm,b,d):Dd(a,b,d);
Gb(a,c,ab)}}function tf(a,b,c){var d=a.doc,e=a.display,h=b.from,o=b.to,g=!1,n=h.line;a.options.lineWrapping||(n=$(Ma(C(d,h.line))),d.iter(n,o.line+1,function(a){return a==e.maxLine?(g=!0,!0):void 0}));-1<d.sel.contains(b.from,b.to)&&Wd(a);Dd(d,b,c,r(a));a.options.lineWrapping||(d.iter(n,h.line+b.text.length,function(a){var b=U(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,g=!1)}),g&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,h.line);hb(a,400);c=b.text.length-
(o.line-h.line)-1;h.line!=o.line||1!=b.text.length||ve(a.doc,b)?ua(a,h.line,o.line+1,c):Ta(a,h.line,"text");c=Ca(a,"changes");if((d=Ca(a,"change"))||c)b={from:h,to:o,text:b.text,removed:b.removed,origin:b.origin},d&&ha(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function Kc(a,b,c,d,e){if(d||(d=c),0>L(d,c))var h=d,d=c,c=h;"string"==typeof b&&(b=vb(b));Rb(a,{from:c,to:d,text:b,origin:e})}function Ec(a,b,c,d,e){var h=a.display,o=Oa(a.display);
0>c&&(c=0);var g=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:h.scroller.scrollTop,n=h.scroller.clientHeight-ya,l={};e-c>n&&(e=c+n);var f=a.doc.height+(h.mover.offsetHeight-h.lineSpace.offsetHeight),q=o>c,o=e>f-o;g>c?l.scrollTop=q?0:c:e>g+n&&(e=Math.min(c,(o?f:e)-n),e!=g&&(l.scrollTop=e));a=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:h.scroller.scrollLeft;h=h.scroller.clientWidth-ya-h.gutters.offsetWidth;g=d-b>h;return g&&(d=c+n),10>b?l.scrollLeft=0:a>b?l.scrollLeft=Math.max(0,b-(g?
0:10)):d>h+a-3&&(l.scrollLeft=d+(g?0:10)-h),l}function Ed(a,b,c){(null!=b||null!=c)&&Sc(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 Hb(a){Sc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?u(b.line,b.ch-1):b,d=u(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Sc(a){var b=a.curOp.scrollToPos;
if(b){a.curOp.scrollToPos=null;var c=Ob(a,b.from),d=Ob(a,b.to),b=Ec(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 ic(a,b,c,d){var e,h=a.doc;null==c&&(c="add");"smart"==c&&(h.mode.indent?e=bb(a,b):c="prev");var o=a.options.tabSize,g=C(h,b),n=Fa(g.text,null,o);g.stateAfter&&(g.stateAfter=null);var l,f=g.text.match(/^\s*/)[0];if(d||/\S/.test(g.text)){if("smart"==c&&(l=h.mode.indent(e,
g.text.slice(f.length),g.text),l==ie||150<l)){if(!d)return;c="prev"}}else l=0,c="not";"prev"==c?l=b>h.first?Fa(C(h,b-1).text,null,o):0:"add"==c?l=n+a.options.indentUnit:"subtract"==c?l=n-a.options.indentUnit:"number"==typeof c&&(l=n+c);l=Math.max(0,l);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(l/o);a;--a)d+=o,c+="\t";if(l>d&&(c+=we(l-d)),c!=f)Kc(h,c,u(b,0),u(b,f.length),"+input");else for(a=0;a<h.sel.ranges.length;a++)if(o=h.sel.ranges[a],o.head.line==b&&o.head.ch<f.length){d=u(b,f.length);
ia(h,a,new q(d,d));break}g.stateAfter=null}function Tc(a,b,c,d){var e=b,h=b;return"number"==typeof b?h=C(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=$(b),null==e?null:(d(h,e)&&a.cm&&Ta(a.cm,e,c),h)}function Tb(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var h=b(c[e]);d.length&&0>=L(h.from,X(d).to);){var o=d.pop();if(0>L(o.from,h.from)){h.from=o.from;break}}d.push(h)}z(a,function(){for(var b=d.length-1;0<=b;b--)Kc(a.doc,"",d[b].from,d[b].to,"+delete");Hb(a)})}function Fd(a,
b,c,d,e){function h(b){var d=(e?qd:xe)(l,g,c,!0);if(null==d){b||(b=o+c,b=!(b<a.first||b>=a.first+a.size?f=!1:(o=b,l=C(a,b))));if(b)return f=!1;g=e?(0>c?Dc:Cc)(l):0>c?l.text.length:0}else g=d;return!0}var o=b.line,g=b.ch,n=c,l=C(a,o),f=!0;if("char"==d)h();else if("column"==d)h(!0);else if("word"==d||"group"==d)for(var q=null,d="group"==d,b=a.cm&&a.cm.getHelper(b,"wordChars"),i=!0;!(0>c)||h(!i);i=!1){var j=l.text.charAt(g)||"\n",j=Uc(j,b)?"w":d&&"\n"==j?"n":!d||/\s/.test(j)?null:"p";if(!d||i||j||(j=
"s"),q&&q!=j){0>c&&(c=1,h());break}if(j&&(q=j),0<c&&!h(!i))break}n=ta(a,u(o,g),n,!0);return f||(n.hitSide=!0),n}function ye(a,b,c,d){var e,h=a.doc,o=b.left;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),e=b.top+c*(d-(0>c?1.5:0.5)*Oa(a.display))):"line"==d&&(e=0<c?b.bottom+3:b.top-3);for(;;){var g=tb(a,o,e);if(!g.outside)break;if(0>c?0>=e:e>=h.height){g.hitSide=!0;break}e+=5*c}return g}function H(a,b,c,d){f.defaults[a]=b;c&&(Db[a]=d?
function(a,b,d){d!=Qd&&c(a,b,d)}:c)}function yd(a){return"string"==typeof a?Pa[a]:a}function Ub(a,b,c,d,e){if(d&&d.shared)return uf(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return A(a.cm,Ub)(a,b,c,d,e);var h=new zb(a,e),e=L(b,c);if(d&&Xb(d,h,!1),0<e||0==e&&!1!==h.clearWhenEmpty)return h;if(h.replacedWith&&(h.collapsed=!0,h.widgetNode=B("span",[h.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(h.widgetNode.ignoreEvents=!0),d.insertLeft&&(h.widgetNode.insertLeft=!0)),h.collapsed){if(ze(a,b.line,b,c,
h)||b.line!=c.line&&ze(a,c.line,b,c,h))throw Error("Inserting collapsed marker partially overlapping an existing one");Xa=!0}h.addToHistory&&re(a,{from:b,to:c,origin:"markText"},a.sel,0/0);var o,g=b.line,n=a.cm;if(a.iter(g,c.line+1,function(a){n&&h.collapsed&&!n.options.lineWrapping&&Ma(a)==n.display.maxLine&&(o=!0);h.collapsed&&g!=b.line&&Ka(a,0);var d=new Vc(h,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}),h.collapsed&&
a.iter(b.line,c.line+1,function(b){jb(a,b)&&Ka(b,0)}),h.clearOnEnter&&I(h,"beforeCursorEnter",function(){h.clear()}),h.readOnly&&(pe=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),h.collapsed&&(h.id=++vf,h.atomic=!0),n){if(o&&(n.curOp.updateMaxLine=!0),h.collapsed)ua(n,b.line,c.line+1);else if(h.className||h.title||h.startStyle||h.endStyle)for(d=b.line;d<=c.line;d++)Ta(n,d,"text");h.atomic&&ob(n.doc);ha(n,"markerAdded",n,h)}return h}function uf(a,b,c,d,e){d=Xb(d);d.shared=
!1;var h=[Ub(a,b,c,d,e)],o=h[0],g=d.widgetNode;return yb(a,function(a){g&&(d.widgetNode=g.cloneNode(!0));h.push(Ub(a,F(a,b),F(a,c),d,e));for(var n=0;n<a.linked.length;++n)if(a.linked[n].isParent)return;o=X(h)}),new Wc(h,o)}function Ae(a){return a.findMarks(u(a.first,0),a.clipPos(u(a.lastLine())),function(a){return a.parent})}function wf(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];yb(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var h=c.markers[e];-1==la(d,
h.doc)&&(h.parent=null,c.markers.splice(e--,1))}}}function Vc(a,b,c){this.marker=a;this.from=b;this.to=c}function nc(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Bd(a,b){var c=Ba(a,b.from.line)&&C(a,b.from.line).markedSpans,d=Ba(a,b.to.line)&&C(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,h=b.to.ch,o=0==L(b.from,b.to);if(c)for(var g,n=0;n<c.length;++n){var l=c[n],f=l.marker;if(null==l.from||(f.inclusiveLeft?l.from<=e:l.from<e)||l.from==e&&"bookmark"==
f.type&&(!o||!l.marker.insertLeft)){var q=null==l.to||(f.inclusiveRight?l.to>=e:l.to>e);(g||(g=[])).push(new Vc(f,l.from,q?null:l.to))}}c=g;if(d){var i;for(g=0;g<d.length;++g)if(n=d[g],l=n.marker,null==n.to||(l.inclusiveRight?n.to>=h:n.to>h)||n.from==h&&"bookmark"==l.type&&(!o||n.marker.insertLeft))f=null==n.from||(l.inclusiveLeft?n.from<=h:n.from<h),(i||(i=[])).push(new Vc(l,f?null:n.from-h,null==n.to?null:n.to-h))}d=i;o=1==b.text.length;i=X(b.text).length+(o?e:0);if(c)for(h=0;h<c.length;++h)g=c[h],
null==g.to&&((n=nc(d,g.marker))?o&&(g.to=null==n.to?null:n.to+i):g.to=e);if(d)for(h=0;h<d.length;++h)g=d[h],(null!=g.to&&(g.to+=i),null==g.from)?(n=nc(c,g.marker))||(g.from=i,o&&(c||(c=[])).push(g)):(g.from+=i,o&&(c||(c=[])).push(g));c&&(c=Be(c));d&&d!=c&&(d=Be(d));e=[c];if(!o){var j,o=b.text.length-2;if(0<o&&c)for(h=0;h<c.length;++h)null==c[h].to&&(j||(j=[])).push(new Vc(c[h].marker,null,null));for(h=0;o>h;++h)e.push(j);e.push(d)}return e}function Be(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 te(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(xf(c[d]));c=e}else c=null;d=Bd(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var h=c[e],o=d[e];if(h&&o){var g=0;a:for(;g<o.length;++g){for(var n=o[g],l=0;l<h.length;++l)if(h[l].marker==n.marker)continue a;h.push(n)}}else o&&(c[e]=o)}return c}function sf(a,b,c){var d=null;if(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!=la(d,c)||(d||(d=[])).push(c)}}),!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b)for(var c=d[b],e=c.find(0),h=0;h<a.length;++h){var o=a[h];if(!(0>L(o.to,e.from)||0<L(o.from,e.to))){var g=[h,1],n=L(o.from,e.from),l=L(o.to,e.to);(0>n||!c.inclusiveLeft&&!n)&&g.push({from:o.from,to:e.from});(0<l||!c.inclusiveRight&&!l)&&g.push({from:e.to,to:o.to});a.splice.apply(a,g);h+=g.length-1}}return a}function Ce(a){var b=a.markedSpans;
if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function De(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Ee(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=L(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=L(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?c:b.id-a.id}function lb(a,b){var c,d=Xa&&a.markedSpans;if(d)for(var e,h=0;h<d.length;++h)e=
d[h],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||0>Ee(c,e.marker))&&(c=e.marker);return c}function ze(a,b,c,d,e){a=C(a,b);if(a=Xa&&a.markedSpans)for(b=0;b<a.length;++b){var h=a[b];if(h.marker.collapsed){var o=h.marker.find(0),g=L(o.from,c)||(h.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),n=L(o.to,d)||(h.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=g&&0>=n||0>=g&&0<=n)&&(0>=g&&(0<L(o.to,c)||h.marker.inclusiveRight&&e.inclusiveLeft)||0<=g&&(0>L(o.from,d)||h.marker.inclusiveLeft&&
e.inclusiveRight)))return!0}}}function Ma(a){for(var b;b=lb(a,!0);)a=b.find(-1,!0).line;return a}function fd(a,b){var c=C(a,b),d=Ma(c);return c==d?b:$(d)}function Td(a,b){if(b>a.lastLine())return b;var c,d=C(a,b);if(!jb(a,d))return b;for(;c=lb(d,!1);)d=c.find(1,!0).line;return $(d)+1}function jb(a,b){var c=Xa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed)if(null==d.from||!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&Gd(a,b,d))return!0}function Gd(a,b,c){if(null==
c.to)return b=c.marker.find(1,!0),Gd(a,b.line,nc(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)&&Gd(a,b,d))return!0}function Fe(a,b,c){Qa(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Ed(a,null,c)}function dc(a){if(null!=a.height)return a.height;var b;a:{var c=
document.body,d=a.node;if(c.contains)b=c.contains(d);else for(;d=d.parentNode;)if(d==c){b=!0;break a}}b||(b="position: relative;",a.coverGutter&&(b+="margin-left: -"+a.cm.getGutterElement().offsetWidth+"px;"),Da(a.cm.display.measure,B("div",[a.node],null,b)));return a.height=a.node.offsetHeight}function yf(a,b,c,d){var e=new Xc(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),Tc(a.doc,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-
1,Math.max(0,e.insertAt)),0,e),e.line=b,!jb(a.doc,b))c=Qa(b)<a.doc.scrollTop,Ka(b,b.height+dc(e)),c&&Ed(a,null,e.height),a.curOp.forceUpdate=!0;return!0}),e}function Ge(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;var a=a.slice(0,c.index)+a.slice(c.index+c[0].length),d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function He(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=
f.innerMode(a,b);return c.mode.blankLine?c.mode.blankLine(c.state):void 0}}function Hd(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 Ie(a,b,c,d,e,h,o){var g=c.flattenSpans;null==g&&(g=a.options.flattenSpans);var n,l=0,i=null,q=new Yc(b,a.options.tabSize);for(""==b&&Ge(He(c,d),h);!q.eol();){if(q.pos>a.options.maxHighlightLength?(g=!1,o&&jd(a,b,d,q.pos),q.pos=b.length,n=null):n=Ge(Hd(c,q,d),h),a.options.addModeClass){var j=
f.innerMode(c,d).mode.name;j&&(n="m-"+(n?j+" "+n:j))}g&&i==n||(l<q.start&&e(q.start,i),l=q.start,i=n);q.start=q.pos}for(;l<q.pos;)a=Math.min(q.pos,l+5E4),e(a,i),l=a}function Xd(a,b,c,d){var e=[a.state.modeGen],h={};Ie(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},h,d);for(c=0;c<a.state.overlays.length;++c){var g=a.state.overlays[c],n=1,l=0;Ie(a,b.text,g.mode,!0,function(a,b){for(var c=n;a>l;){var d=e[n];d>a&&e.splice(n,1,a,e[n+1],d);n=n+2;l=Math.min(a,d)}if(b)if(g.opaque){e.splice(c,n-c,a,"cm-overlay "+
b);n=c+2}else for(;n>c;c=c+2){d=e[c+1];e[c+1]=(d?d+" ":"")+"cm-overlay "+b}},h)}return{styles:e,classes:h.bgClass||h.textClass?h:null}}function Je(a,b){if(!b.styles||b.styles[0]!=a.state.modeGen){var c=Xd(a,b,b.stateAfter=bb(a,$(b)));b.styles=c.styles;c.classes?b.styleClasses=c.classes:b.styleClasses&&(b.styleClasses=null)}return b.styles}function jd(a,b,c,d){var e=a.doc.mode,h=new Yc(b,a.options.tabSize);h.start=h.pos=d||0;for(""==b&&He(e,c);!h.eol()&&h.pos<=a.options.maxHighlightLength;)Hd(e,h,
c),h.start=h.pos}function Ke(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?zf:Af;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Ud(a,b){var c=B("span",null,null,ka?"padding-right: .1px":null),c={pre:B("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,h=d?b.rest[d-1]:b.line;c.pos=0;c.addToken=Bf;(P||ka)&&a.getOption("lineWrapping")&&(c.addToken=Cf(c.addToken));var g;if(null!=Id)g=Id;else{g=Da(a.display.measure,document.createTextNode("AخA"));
var n=Mb(g,0,1).getBoundingClientRect();g=!n||n.left==n.right?!1:Id=3>Mb(g,1,2).getBoundingClientRect().right-n.right}g&&(e=La(h))&&(c.addToken=Df(c.addToken,e));c.map=[];a:{g=c;var n=Je(a,h),l=h.markedSpans,f=h.text,q=0;if(l)for(var i=void 0,j=void 0,t=void 0,z=void 0,A=void 0,k=void 0,Z=f.length,v=0,ba=1,m="",V=0;;){if(V==v){for(var j=t=z=A="",k=null,V=1/0,ia=[],r=0;r<l.length;++r){var x=l[r],u=x.marker;x.from<=v&&(null==x.to||x.to>v)?(null!=x.to&&V>x.to&&(V=x.to,t=""),u.className&&(j+=" "+u.className),
u.startStyle&&x.from==v&&(z+=" "+u.startStyle),u.endStyle&&x.to==V&&(t+=" "+u.endStyle),u.title&&!A&&(A=u.title),u.collapsed&&(!k||0>Ee(k.marker,u))&&(k=x)):x.from>v&&V>x.from&&(V=x.from);"bookmark"==u.type&&x.from==v&&u.widgetNode&&ia.push(u)}if(k&&(k.from||0)==v&&(Le(g,(null==k.to?Z+1:k.to)-v,k.marker,null==k.from),null==k.to))break a;if(!k&&ia.length)for(r=0;r<ia.length;++r)Le(g,0,ia[r])}if(v>=Z)break;for(ia=Math.min(Z,V);;){if(m){r=v+m.length;k||(x=r>ia?m.slice(0,ia-v):m,g.addToken(g,x,i?i+j:
j,z,v+x.length==V?t:"",A));if(r>=ia){m=m.slice(ia-v);v=ia;break}v=r;z=""}m=f.slice(q,q=n[ba++]);i=Ke(n[ba++],g.cm.options)}}else for(ba=1;ba<n.length;ba+=2)g.addToken(g,f.slice(q,q=n[ba]),Ke(n[ba+1],g.cm.options))}h.styleClasses&&(h.styleClasses.bgClass&&(c.bgClass=Jd(h.styleClasses.bgClass,c.bgClass||"")),h.styleClasses.textClass&&(c.textClass=Jd(h.styleClasses.textClass,c.textClass||"")));0==c.map.length&&c.map.push(0,0,c.content.appendChild(Ef(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({}))}return ja(a,"renderLine",a,b.line,c.pre),c.pre.className&&(c.textClass=Jd(c.pre.className,c.textClass||"")),c}function Bf(a,b,c,d,e,h){if(b){var g=a.cm.options.specialChars,n=!1;if(g.test(b))for(var l=document.createDocumentFragment(),f=0;;){g.lastIndex=f;var q=g.exec(b),i=q?q.index-f:b.length-f;if(i){var j=document.createTextNode(b.slice(f,f+i));P&&9>W?l.appendChild(B("span",[j])):l.appendChild(j);
a.map.push(a.pos,a.pos+i,j);a.col+=i;a.pos+=i}if(!q)break;(f+=i+1,"\t"==q[0])?(j=a.cm.options.tabSize,q=j-a.col%j,j=l.appendChild(B("span",we(q),"cm-tab")),a.col+=q):(j=a.cm.options.specialCharPlaceholder(q[0]),P&&9>W?l.appendChild(B("span",[j])):l.appendChild(j),a.col+=1);a.map.push(a.pos,a.pos+1,j);a.pos++}else a.col+=b.length,l=document.createTextNode(b),a.map.push(a.pos,a.pos+b.length,l),P&&9>W&&(n=!0),a.pos+=b.length;if(c||d||e||n)return b=c||"",d&&(b+=d),e&&(b+=e),d=B("span",[l],b),h&&(d.title=
h),a.content.appendChild(d);a.content.appendChild(l)}}function Cf(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":" ";return b+" "}return function(c,d,e,h,g,n){a(c,d.replace(/ {3,}/g,b),e,h,g,n)}}function Df(a,b){return function(c,d,e,h,g,n){for(var e=e?e+" cm-force-border":"cm-force-border",l=c.pos,f=l+d.length;;){for(var q=0;q<b.length;q++){var i=b[q];if(i.to>l&&i.from<=l)break}if(i.to>=f)return a(c,d,e,h,g,n);a(c,d.slice(0,i.to-l),e,h,null,n);h=null;d=d.slice(i.to-l);l=i.to}}}function Le(a,
b,c,d){(c=!d&&c.widgetNode)&&(a.map.push(a.pos,a.pos+b,c),a.content.appendChild(c));a.pos+=b}function ve(a,b){return 0==b.from.ch&&0==b.to.ch&&""==X(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Dd(a,b,c,d){function e(a){return c?c[a]:null}function h(a,c,e){var h=d;a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);Ce(a);De(a,e);c=h?h(a):1;c!=a.height&&Ka(a,c);ha(a,"change",a,b)}var g=b.from,n=b.to,l=b.text,f=C(a,g.line),q=C(a,n.line),
i=X(l),j=e(l.length-1),t=n.line-g.line;if(ve(a,b)){for(var z=0,A=[];z<l.length-1;++z)A.push(new Ab(l[z],e(z),d));h(q,q.text,j);t&&a.remove(g.line,t);A.length&&a.insert(g.line,A)}else if(f==q)if(1==l.length)h(f,f.text.slice(0,g.ch)+i+f.text.slice(n.ch),j);else{A=[];for(z=1;z<l.length-1;++z)A.push(new Ab(l[z],e(z),d));A.push(new Ab(i+f.text.slice(n.ch),j,d));h(f,f.text.slice(0,g.ch)+l[0],e(0));a.insert(g.line+1,A)}else if(1==l.length)h(f,f.text.slice(0,g.ch)+l[0]+q.text.slice(n.ch),e(0)),a.remove(g.line+
1,t);else{h(f,f.text.slice(0,g.ch)+l[0],e(0));h(q,i+q.text.slice(n.ch),j);z=1;for(A=[];z<l.length-1;++z)A.push(new Ab(l[z],e(z),d));1<t&&a.remove(g.line+1,t-1);a.insert(g.line+1,A)}ha(a,"change",a,b)}function oc(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 pc(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 yb(a,
b,c){function d(a,h,g){if(a.linked)for(var n=0;n<a.linked.length;++n){var l=a.linked[n];if(l.doc!=h){var f=g&&l.sharedHist;(!c||f)&&(b(l.doc,f),d(l.doc,a,f))}}}d(a,null,!0)}function Pd(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;w(a);m(a);a.options.lineWrapping||aa(a);a.options.mode=b.modeOption;ua(a)}function C(a,b){if(b-=a.first,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],
h=e.chunkSize();if(h>b){c=e;break}b-=h}return c.lines[b]}function mc(a,b,c){var d=[],e=b.line;return 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}),d}function Kd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Ka(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function $(a){if(null==a.parent)return null;for(var b=a.parent,a=la(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=
b;++d)a+=c.children[d].chunkSize();return a+b.first}function mb(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],h=e.height;if(h>b){a=e;continue a}b-=h;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(e>b)break;b-=e}return c+d}function Qa(a){for(var a=Ma(a),b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length;++d){e=a.children[d];
if(e==c)break;b+=e.height}return b}function La(a){var b=a.order;return null==b&&(b=a.order=Ff(a.text)),b}function Zc(a){this.done=[];this.undone=[];this.undoDepth=1/0;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a||1}function Cd(a,b){var c={from:u(b.from.line,b.from.ch),to:fb(b),text:mc(a,b.from,b.to)};return Me(a,c,b.from.line,b.to.line+1),yb(a,function(a){Me(a,c,b.from.line,b.to.line+1)},!0),c}function Vd(a){for(;a.length&&
X(a).ranges;)a.pop()}function re(a,b,c,d){var e=a.history;e.undone.length=0;var h,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(h=e.lastOp==d?(Vd(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0)){var n=X(h.changes);0==L(b.from,b.to)&&0==L(b.from,n.to)?n.to=fb(b):h.changes.push(Cd(a,
b))}else{(h=X(e.done))&&h.ranges||yc(a.sel,e.done);h={changes:[Cd(a,b)],generation:e.generation};for(e.done.push(h);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=g;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;n||ja(a,"historyAdded")}function yc(a,b){var c=X(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Me(a,b,c,d){var e=b["spans_"+a.id],h=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]={}))[h]=c.markedSpans);++h})}function xf(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function Vb(a,b,c){for(var d=0,e=[];d<a.length;++d){var h=a[d];if(h.ranges)e.push(c?J.prototype.deepCopy.call(h):h);else{var h=h.changes,g=[];e.push({changes:g});for(var n=0;n<h.length;++n){var l,f=h[n];if(g.push({from:f.from,to:f.to,text:f.text}),b)for(var q in f)(l=
q.match(/^spans_(\d+)$/))&&-1<la(b,Number(l[1]))&&(X(g)[q]=f[q],delete f[q])}}}return e}function Ne(a,b,c,d){for(var e=0;e<a.length;++e){var h=a[e],g=!0;if(h.ranges){h.copied||(h=a[e]=h.deepCopy(),h.copied=!0);for(var n=0;n<h.ranges.length;n++){var g=h.ranges[n].anchor,l=b;c<g.line?g.line+=d:l<g.line&&(g.line=l,g.ch=0);g=h.ranges[n].head;l=b;c<g.line?g.line+=d:l<g.line&&(g.line=l,g.ch=0)}}else{for(n=0;n<h.changes.length;++n)if(l=h.changes[n],c<l.from.line)l.from=u(l.from.line+d,l.from.ch),l.to=u(l.to.line+
d,l.to.ch);else if(b<=l.to.line){g=!1;break}g||(a.splice(0,e+1),e=0)}}}function se(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Ne(a.done,c,d,e);Ne(a.undone,c,d,e)}function xd(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function ge(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),za&&a.ctrlKey&&1==b&&(b=3),b}function ha(a,b){function c(a){return function(){a.apply(null,h)}}var d=a._handlers&&a._handlers[b];if(d){var e,h=Array.prototype.slice.call(arguments,
2);Pb?e=Pb.delayedCallbacks:qc?e=qc:(e=qc=[],setTimeout(Gf,0));for(var g=0;g<d.length;++g)e.push(c(d[g]))}}function Gf(){var a=qc;qc=null;for(var b=0;b<a.length;++b)a[b]()}function Na(a,b,c){return ja(a,c||b.type,a,b),xd(b)||b.codemirrorIgnore}function Wd(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),c=0;c<b.length;++c)-1==la(a,b[c])&&a.push(b[c])}function Ca(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}
function Wb(a){a.prototype.on=function(a,c){I(this,a,c)};a.prototype.off=function(a,c){Ua(this,a,c)}}function bd(){this.id=null}function he(a,b,c){for(var d=0,e=0;;){var h=a.indexOf("\t",d);-1==h&&(h=a.length);var g=h-d;if(h==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=h-d,e+=c-e%c,d=h+1,e>=b)return d}}function we(a){for(;$c.length<=a;)$c.push(X($c)+" ");return $c[a]}function X(a){return a[a.length-1]}function la(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function hc(a,b){for(var c=
[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Oe(a,b){var c;Object.create?c=Object.create(a):(c=function(){},c.prototype=a,c=new c);return b&&Xb(b,c),c}function Xb(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 Ia(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Uc(a,b){return b?-1<b.source.indexOf("\\w")&&Pe(a)?!0:b.test(a):Pe(a)}function Qe(a){for(var b in a)if(a.hasOwnProperty(b)&&
a[b])return!1;return!0}function cc(a){return 768<=a.charCodeAt(0)&&Hf.test(a)}function B(a,b,c,d){a=document.createElement(a);if(c&&(a.className=c),d&&(a.style.cssText=d),"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 kb(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function Da(a,b){return kb(a).appendChild(b)}function Va(){return document.activeElement}function Ld(a){return RegExp("\\b"+
a+"\\b\\s*")}function Pc(a,b){var c=Ld(b);c.test(a.className)&&(a.className=a.className.replace(c,""))}function Qc(a,b){Ld(b).test(a.className)||(a.className+=" "+b)}function Jd(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Ld(c[d]).test(b)&&(b+=" "+c[d]);return b}function Re(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 $e(){var a;I(window,"resize",function(){null==a&&(a=
setTimeout(function(){rc=a=null;Re(jf)},100))});I(window,"blur",function(){Re(wc)})}function af(a){if(null!=rc)return rc;var b=B("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Da(a,b),b.offsetWidth&&(rc=b.offsetHeight-b.clientHeight),rc||0}function Ef(a){if(null==Md){var b=B("span","​");Da(a,B("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Md=1>=b.offsetWidth&&2<b.offsetHeight&&!(P&&8>W))}return Md?B("span","​"):B("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}
function cf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,h=0;h<a.length;++h){var g=a[h];(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 nd(a){return a.level%2?a.from:a.to}function Cc(a){return(a=La(a))?a[0].level%2?a[0].to:a[0].from:0}function Dc(a){var b=La(a);return b?nd(X(b)):a.text.length}function Se(a,b){var c=C(a.doc,b),d=Ma(c);d!=c&&(b=$(d));d=(c=La(d))?c[0].level%2?Dc(d):Cc(d):0;return u(b,d)}function Te(a,
b){var c=Se(a,b.line),d=C(a.doc,c.line),e=La(d);return!e||0==e[0].level?(d=Math.max(0,d.text.search(/\S/)),u(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d)):c}function od(a,b){ec=null;for(var c,d=0;d<a.length;++d){var e=a[d];if(e.from<b&&e.to>b)return d;if(e.from==b||e.to==b){if(null!=c){var h=e.level,g=a[c].level,n=a[0].level;return h==n||(g==n?0:g>h)?(e.from!=e.to&&(ec=c),d):(e.from!=e.to&&(ec=d),c)}c=d}}return c}function Nd(a,b,c,d){if(!d)return b+c;do b+=c;while(0<b&&cc(a.text.charAt(b)));return b}
function qd(a,b,c,d){var e=La(a);if(!e)return xe(a,b,c,d);for(var h=od(e,b),g=e[h],b=Nd(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to)return od(e,b)==h?b:(g=e[h+c],0<c==g.level%2?g.to:g.from);if(g=e[h+=c],!g)return null;b=0<c==g.level%2?Nd(a,g.to,-1,d):Nd(a,g.from,1,d)}}function xe(a,b,c,d){b+=c;if(d)for(;0<b&&cc(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var kc=/gecko\/\d/i.test(navigator.userAgent),Ue=/MSIE \d/.test(navigator.userAgent),Ve=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),
P=Ue||Ve,W=P&&(Ue?document.documentMode||6:Ve[1]),ka=/WebKit\//.test(navigator.userAgent),If=ka&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Jf=/Chrome\//.test(navigator.userAgent),Ga=/Opera\//.test(navigator.userAgent),fe=/Apple Computer/.test(navigator.vendor),ed=/KHTML\//.test(navigator.userAgent),bf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ff=/PhantomJS/.test(navigator.userAgent),Yb=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ad=Yb||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),
za=Yb||/Mac/.test(navigator.platform),Kf=/win/i.test(navigator.platform),Bb=Ga&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Bb&&(Bb=Number(Bb[1]));Bb&&15<=Bb&&(Ga=!1,ka=!0);var We=za&&(If||Ga&&(null==Bb||12.11>Bb)),vd=kc||P&&9<=W,pe=!1,Xa=!1,u=f.Pos=function(a,b){return this instanceof u?(this.line=a,this.ch=b,void 0):new u(a,b)},L=f.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};J.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!=L(c.anchor,d.anchor)||0!=L(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new q(u(this.ranges[b].anchor.line,this.ranges[b].anchor.ch),u(this.ranges[b].head.line,this.ranges[b].head.ch));return new J(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<=L(b,d.from())&&0>=L(a,d.to()))return c}return-1}};q.prototype={from:function(){return ra(this.anchor,this.head)},to:function(){return Sa(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var ub,Jc,Ic,ld={left:0,right:0,top:0,bottom:0},Pb=null,ef=0,wb=null,ee=0,Lc=0,Ha=null;P?Ha=-0.53:kc?Ha=15:Jf?Ha=-0.7:fe&&(Ha=-1/3);var le,zd=null,
fb=f.changeEnd=function(a){return a.text?u(a.from.line+a.text.length-1,X(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};f.prototype={constructor:f,focus:function(){window.focus();sa(this);gc(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Db.hasOwnProperty(a)&&A(this,Db[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:Z(function(a,b){var c=a.token?a:f.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++;ua(this)}),removeOverlay:Z(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)return b.splice(c,1),this.state.modeGen++,
ua(this),void 0}}),indentLine:Z(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");Ba(this.doc,a)&&ic(this,a,b,c)}),indentSelection:Z(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&&(ic(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Hb(this));else{for(var h=e.from(),e=e.to(),g=Math.max(c,h.line),c=Math.min(this.lastLine(),e.line-(e.ch?0:1))+1,e=g;c>
e;++e)ic(this,e,a);e=this.doc.sel.ranges;0==h.ch&&b.length==e.length&&0<e[d].from().ch&&ia(this.doc,d,new q(h,e[d].to()),ab)}}}),getTokenAt:function(a,b){for(var c=this.doc,a=F(c,a),d=bb(this,a.line,b),e=this.doc.mode,c=C(c,a.line),c=new Yc(c.text,this.options.tabSize);c.pos<a.ch&&!c.eol();){c.start=c.pos;var h=Hd(e,c,d)}return{start:c.start,end:c.pos,string:c.current(),type:h||null,state:d}},getTokenTypeAt:function(a){var a=F(this.doc,a),b,c=Je(this,C(this.doc,a.line)),d=0,e=(c.length-1)/2,a=a.ch;
if(0==a)b=c[2];else for(;;){var h=d+e>>1;if((h?c[2*h-1]:0)>=a)e=h;else{if(!(c[2*h+1]<a)){b=c[2*h+2];break}d=h+1}}c=b?b.indexOf("cm-overlay "):-1;return 0>c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?f.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(!Cb.hasOwnProperty(b))return Cb;var d=Cb[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var h=
0;h<e[b].length;h++){var g=d[e[b][h]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(h=0;h<d._global.length;h++)g=d._global[h],g.pred(e,this)&&-1==la(c,g.val)&&c.push(g.val);return c},getStateAfter:function(a,b){var c=this.doc;return a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1)),bb(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?F(this.doc,a):a?d.from():
d.to(),xa(this,c,b||"page")},charCoords:function(a,b){return Ea(this,F(this.doc,a),b||"page")},coordsChar:function(a,b){return a=rb(this,a,b||"page"),tb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=rb(this,{top:a,left:0},b||"page").top,mb(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=C(this.doc,a);return Nb(this,d,{top:0,left:0},b||"page").top+(c?this.doc.height-Qa(d):0)},defaultTextHeight:function(){return Oa(this.display)},
defaultCharWidth:function(){return ib(this.display)},setGutterMarker:Z(function(a,b,c){return Tc(this.doc,a,"gutter",function(a){var e=a.gutterMarkers||(a.gutterMarkers={});return e[b]=c,!c&&Qe(e)&&(a.gutterMarkers=null),!0})}),clearGutter:Z(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Ta(b,d,"gutter"),Qe(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineWidget:Z(function(a,b,c){return yf(this,a,b,c)}),removeLineWidget:function(a){a.clear()},
lineInfo:function(a){if("number"==typeof a){if(!Ba(this.doc,a))return null;var b=a;if(a=C(this.doc,a),!a)return null}else if(b=$(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 h=this.display,a=xa(this,F(this.doc,a)),g=a.bottom,n=a.left;if(b.style.position="absolute",
h.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var l=Math.max(h.wrapper.clientHeight,this.doc.height),f=Math.max(h.sizer.clientWidth,h.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>l)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=l&&(g=a.bottom);n+b.offsetWidth>f&&(n=f-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(n=h.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?n=0:"middle"==e&&(n=(h.sizer.clientWidth-
b.offsetWidth)/2),b.style.left=n+"px");c&&(a=Ec(this,n,g,n+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&fc(this,a.scrollTop),null!=a.scrollLeft&&Qb(this,a.scrollLeft))},triggerOnKeyDown:Z(ce),triggerOnKeyPress:Z(de),triggerOnKeyUp:be,execCommand:function(a){return Nc.hasOwnProperty(a)?Nc[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var h=0,a=F(this.doc,a);b>h&&(a=Fd(this.doc,a,e,c,d),!a.hitSide);++h);return a},moveH:Z(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||
c.doc.extend||d.empty()?Fd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},sc)}),deleteH:Z(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):Tb(this,function(d){var e=Fd(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);for(var h=0,a=F(this.doc,a);b>h;++h){var g=xa(this,a,"div");if(null==d?d=g.left:g.left=d,a=ye(this,g,e,c),a.hitSide)break}return a},moveV:Z(function(a,
b){var c=this,d=this.doc,e=[],h=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(h)return 0>a?g.from():g.to();var n=xa(c,g.head,"div");null!=g.goalColumn&&(n.left=g.goalColumn);e.push(n.left);var l=ye(c,n,a,b);return"page"==b&&g==d.sel.primary()&&Ed(c,null,Ea(c,l,"div").top-n.top),l},sc),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=C(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var e=this.getHelper(a,
"wordChars");(0>a.xRel||d==b.length)&&c?--c:++d;for(var h=b.charAt(c),h=Uc(h,e)?function(a){return Uc(a,e)}:/\s/.test(h)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Uc(a)};0<c&&h(b.charAt(c-1));)--c;for(;d<b.length&&h(b.charAt(d));)++d}return new q(u(a.line,c),u(a.line,d))},toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Qc(this.display.cursorDiv,"CodeMirror-overwrite"):Pc(this.display.cursorDiv,"CodeMirror-overwrite"),
ja(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return Va()==this.display.input},scrollTo:Z(function(a,b){(null!=a||null!=b)&&Sc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller,b=ya;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:Z(function(a,b){if(null==a?(a={from:this.doc.sel.primary().head,
to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:u(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line)Sc(this),this.curOp.scrollToPos=a;else{var c=Ec(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:Z(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(""+
a)?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a));null!=b&&(d.display.wrapper.style.height=c(b));d.options.lineWrapping&&qb(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Ta(d,e,"widget");break}++e});d.curOp.forceUpdate=!0;ja(d,"refresh",this)}),operation:function(a){return z(this,a)},refresh:Z(function(){var a=this.display.cachedTextHeight;ua(this);this.curOp.forceUpdate=!0;va(this);
this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);ca(this);(null==a||0.5<Math.abs(a-Oa(this.display)))&&w(this);ja(this,"refresh",this)}),swapDoc:Z(function(a){var b=this.doc;return b.cm=null,Pd(this,a),va(this),Ja(this),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,ha(this,"swapDoc",this,b),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}};
Wb(f);var Ye=f.defaults={},Db=f.optionHandlers={},Qd=f.Init={toString:function(){return"CodeMirror.Init"}};H("value","",function(a,b){a.setValue(b)},!0);H("mode",null,function(a,b){a.doc.modeOption=b;m(a)},!0);H("indentUnit",2,m,!0);H("indentWithTabs",!1);H("smartIndent",!0);H("tabSize",4,function(a){D(a);va(a);ua(a)},!0);H("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=RegExp(b.source+(b.test("\t")?"":"|\t"),"g");a.refresh()},!0);H("specialCharPlaceholder",
function(a){var b=B("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b},function(a){a.refresh()},!0);H("electricChars",!0);H("rtlMoveVisually",!Kf);H("wholeLineUpdateBefore",!0);H("theme","default",function(a){v(a);N(a)},!0);H("keyMap","default",G);H("extraKeys",null);H("lineWrapping",!1,function(a){a.options.lineWrapping?(Qc(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):(Pc(a.display.wrapper,"CodeMirror-wrap"),aa(a));w(a);ua(a);va(a);setTimeout(function(){x(a)},
100)},!0);H("gutters",[],function(a){M(a.options);N(a)},!0);H("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?da(a.display)+"px":"0";a.refresh()},!0);H("coverGutterNextToScrollbar",!1,x,!0);H("lineNumbers",!1,function(a){M(a.options);N(a)},!0);H("firstLineNumber",1,N,!0);H("lineNumberFormatter",function(a){return a},N,!0);H("showCursorWhenSelecting",!1,Ya,!0);H("resetSelectionOnContextMenu",!0);H("readOnly",!1,function(a,b){"nocursor"==b?(wc(a),a.display.input.blur(),a.display.disabled=
true):(a.display.disabled=false,b||Ja(a))});H("disableInput",!1,function(a,b){b||Ja(a)},!0);H("dragDrop",!0);H("cursorBlinkRate",530);H("cursorScrollMargin",0);H("cursorHeight",1,Ya,!0);H("singleCursorHeightPerLine",!0,Ya,!0);H("workTime",100);H("workDelay",100);H("flattenSpans",!0,D,!0);H("addModeClass",!1,D,!0);H("pollInterval",100);H("undoDepth",200,function(a,b){a.doc.history.undoDepth=b});H("historyEventDelay",1250);H("viewportMargin",10,function(a){a.refresh()},!0);H("maxHighlightLength",1E4,
D,!0);H("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});H("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});H("autofocus",null);var Xe=f.modes={},tc=f.mimeModes={};f.defineMode=function(a,b){if(f.defaults.mode||"null"==a||(f.defaults.mode=a),2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Xe[a]=b};f.defineMIME=function(a,b){tc[a]=b};f.resolveMode=function(a){if("string"==
typeof a&&tc.hasOwnProperty(a))a=tc[a];else if(a&&"string"==typeof a.name&&tc.hasOwnProperty(a.name)){var b=tc[a.name];"string"==typeof b&&(b={name:b});a=Oe(b,a);a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return f.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};f.getMode=function(a,b){var b=f.resolveMode(b),c=Xe[b.name];if(!c)return f.getMode(a,"text/plain");c=c(a,b);if(uc.hasOwnProperty(b.name)){var d=uc[b.name],e;for(e in d)d.hasOwnProperty(e)&&
(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}if(c.name=b.name,b.helperType&&(c.helperType=b.helperType),b.modeProps)for(e in b.modeProps)c[e]=b.modeProps[e];return c};f.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});f.defineMIME("text/plain","null");var uc=f.modeExtensions={};f.extendMode=function(a,b){var c=uc.hasOwnProperty(a)?uc[a]:uc[a]={};Xb(b,c)};f.defineExtension=function(a,b){f.prototype[a]=b};f.defineDocExtension=function(a,b){pa.prototype[a]=b};f.defineOption=
H;var dd=[];f.defineInitHook=function(a){dd.push(a)};var Cb=f.helpers={};f.registerHelper=function(a,b,c){Cb.hasOwnProperty(a)||(Cb[a]=f[a]={_global:[]});Cb[a][b]=c};f.registerGlobalHelper=function(a,b,c,d){f.registerHelper(a,b,d);Cb[a]._global.push({pred:c,val:d})};var bc=f.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},df=f.startState=function(a,b,c){return a.startState?a.startState(b,
c):!0};f.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 Nc=f.commands={selectAll:function(a){a.setSelection(u(a.firstLine(),0),u(a.lastLine()),ab)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),ab)},killLine:function(a){Tb(a,function(b){if(b.empty()){var c=C(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:u(b.head.line+1,0)}:
{from:b.head,to:u(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Tb(a,function(b){return{from:u(b.from().line,0),to:F(a.doc,u(b.to().line+1,0))}})},delLineLeft:function(a){Tb(a,function(a){return{from:u(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Tb(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},delWrappedLineRight:function(a){Tb(a,function(b){var c=a.charCoords(b.head,"div").top+5,
c=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:c}})},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(u(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(u(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return Se(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return Te(a,
b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){for(var b=b.head.line,c,d=C(a.doc,b);c=lb(d,!1);)d=c.find(1,!0).line,b=null;c=(c=La(d))?c[0].level%2?Cc(d):Dc(d):d.text.length;return u(null==b?$(d):b,c)},{origin:"+move",bias:-1})},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")},sc)},goLineLeft:function(a){a.extendSelectionsBy(function(b){b=
a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},sc)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:0,top:c},"div");return c.ch<a.getLine(c.line).search(/\S/)?Te(a,b.head):c},sc)},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 h=c[e].from(),h=Fa(a.getLine(h.line),h.ch,d);b.push(Array(d-h%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?
a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){z(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,h=C(a.doc,e.line).text;if(h)if(e.ch==h.length&&(e=new u(e.line,e.ch-1)),0<e.ch)e=new u(e.line,e.ch+1),a.replaceRange(h.charAt(e.ch-1)+h.charAt(e.ch-2),u(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=C(a.doc,e.line-1).text;g&&a.replaceRange(h.charAt(0)+"\n"+g.charAt(g.length-1),u(e.line-1,g.length-1),u(e.line,1),"+transpose")}c.push(new q(e,
e))}a.setSelections(c)})},newlineAndIndent:function(a){z(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input");a.indentLine(d.from().line+1,null,!0);Hb(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},Pa=f.keyMap={};Pa.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"};Pa.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"};Pa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight",
"Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]};Pa.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"};Pa["default"]=za?Pa.macDefault:Pa.pcDefault;var Oc=f.lookupKey=function(a,b,c){function d(b){var b=yd(b),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 h=d(b[e]);if(h)return h}return!1}for(var e=0;e<b.length;++e){var h=d(b[e]);if(h)return"stop"!=h}},of=f.isModifierKey=function(a){a=gb[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a},pf=f.keyName=function(a,b){if(Ga&&34==a.keyCode&&a["char"])return!1;var c=gb[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),
(We?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(We?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)};f.fromTextArea=function(a,b){function c(){a.value=l.getValue()}if(b||(b={}),b.value=a.value,!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var d=Va();b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form&&(I(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var e=a.form,h=e.submit;
try{var g=e.submit=function(){c();e.submit=h;e.submit();e.submit=g}}catch(n){}}a.style.display="none";var l=f(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return l.save=c,l.getTextArea=function(){return a},l.toTextArea=function(){c();a.parentNode.removeChild(l.getWrapperElement());a.style.display="";a.form&&(Ua(a.form,"submit",c),"function"==typeof a.form.submit&&(a.form.submit=h))},l};var Yc=f.StringStream=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=
this.lastColumnPos=this.lastColumnValue=0};Yc.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);return("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))?(++this.pos,b):void 0},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);return-1<a?(this.pos=a,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-
(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Fa(this.string,null,this.tabSize)-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a)return(a=this.string.slice(this.pos).match(a))&&0<a.index?null:(a&&!1!==b&&(this.pos+=a[0].length),a);var d=this.string.substr(this.pos,a.length);return(c?d.toLowerCase():d)==(c?a.toLowerCase():a)?(!1!==b&&(this.pos+=a.length),!0):void 0},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 zb=f.TextMarker=function(a,b){this.lines=[];this.type=b;this.doc=a};Wb(zb);zb.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&eb(a),Ca(this,"clear")){var c=this.find();c&&ha(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var h=this.lines[e],g=nc(h.markedSpans,this);a&&!this.collapsed?Ta(a,$(h),"text"):a&&(null!=g.to&&(d=$(h)),
null!=g.from&&(c=$(h)));for(var l=h,f=h.markedSpans,q=g,i=void 0,j=0;j<f.length;++j)f[j]!=q&&(i||(i=[])).push(f[j]);l.markedSpans=i;null==g.from&&this.collapsed&&!jb(this.doc,h)&&a&&Ka(h,Oa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)h=Ma(this.lines[e]),g=U(h),g>a.display.maxLineLength&&(a.display.maxLine=h,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&ua(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&
this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&ob(a.doc));a&&ha(a,"markerCleared",a,this);b&&n(a);this.parent&&this.parent.clear()}};zb.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var h=this.lines[e],g=nc(h.markedSpans,this);if(null!=g.from&&(c=u(b?h:$(h),g.from),-1==a))return c;if(null!=g.to&&(d=u(b?h:$(h),g.to),1==a))return d}return c&&{from:c,to:d}};zb.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&z(c,
function(){var d=a.line,e=$(a.line),e=Bc(c,e);if(e&&(db(e),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!jb(b.doc,d)&&null!=b.height)e=b.height,b.height=null,(e=dc(b)-e)&&Ka(d,d.height+e)})};zb.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=la(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};zb.prototype.detachLine=function(a){if(this.lines.splice(la(this.lines,
a),1),!this.lines.length&&this.doc.cm)a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this)};var vf=0,Wc=f.SharedTextMarker=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Wb(Wc);Wc.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();ha(this,"clear")}};Wc.prototype.find=function(a,b){return this.primary.find(a,b)};var Xc=f.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};Wb(Xc);Xc.prototype.clear=function(){var a=this.cm,b=this.line.widgets,c=this.line,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 h=dc(this);z(a,function(){Fe(a,c,-h);Ta(a,d,"widget");Ka(c,Math.max(0,c.height-h))})}};Xc.prototype.changed=function(){var a=this.height,b=this.cm,c=this.line;this.height=null;var d=dc(this)-a;d&&z(b,function(){b.curOp.forceUpdate=
!0;Fe(b,c,d);Ka(c,c.height+d)})};var Ab=f.Line=function(a,b,c){this.text=a;De(this,b);this.height=c?c(this):1};Wb(Ab);Ab.prototype.lineNo=function(){return $(this)};var Af={},zf={};oc.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height;var h=e;h.parent=null;Ce(h);ha(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;b>a;++a)if(c(this.lines[a]))return!0}};pc.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(e>a){var h=Math.min(b,e-a),g=d.height;if(d.removeInner(a,h),this.height-=g-d.height,e==h&&(this.children.splice(c--,1),d.parent=null),0==(b-=h))break;a=0}else a-=
e}if(25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof oc)))c=[],this.collapse(c),this.children=[new oc(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],h=e.chunkSize();if(h>=a){if(e.insertInner(a,b,c),e.lines&&50<e.lines.length){for(;50<e.lines.length;)a=e.lines.splice(e.lines.length-
25,25),a=new oc(a),e.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=h}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new pc(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=la(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new pc(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],h=e.chunkSize();if(h>a){h=Math.min(b,h-a);if(e.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=h}}};var Lf=0,pa=f.Doc=function(a,b,c){if(!(this instanceof pa))return new pa(a,b,c);null==c&&(c=0);pc.call(this,[new oc([new Ab("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=u(c,0);this.sel=t(c);this.history=new Zc(null);this.id=++Lf;this.modeOption=b;"string"==typeof a&&(a=vb(a));
Dd(this,{from:c,to:c,text:a});fa(this,t(c),ab)};pa.prototype=Oe(pc.prototype,{constructor:pa,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=Kd(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:na(function(a){var b=u(this.first,0),c=this.first+
this.size-1;Rb(this,{from:b,to:u(c,C(this,c).text.length),text:vb(a),origin:"setValue"},!0);fa(this,t(b))}),replaceRange:function(a,b,c,d){b=F(this,b);c=c?F(this,c):b;Kc(this,a,b,c,d)},getRange:function(a,b,c){a=mc(this,F(this,a),F(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){return Ba(this,a)?C(this,a):void 0},getLineNumber:function(a){return $(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=
C(this,a)),Ma(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return F(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:na(function(a,b,c){a=F(this,"number"==typeof a?
u(a,b||0):a);fa(this,t(a,null),c)}),setSelection:na(function(a,b,c){var d=F(this,a),a=F(this,b||a);fa(this,t(d,a),c)}),extendSelection:na(function(a,b,c){l(this,F(this,a),b&&F(this,b),c)}),extendSelections:na(function(a){for(var b=[],c=0;c<a.length;c++)b[c]=F(this,a[c]);g(this,b)}),extendSelectionsBy:na(function(a,b){g(this,hc(this.sel.ranges,a),b)}),setSelections:na(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new q(F(this,a[d].anchor),F(this,a[d].head));null==b&&(b=Math.min(a.length-
1,this.sel.primIndex));fa(this,V(e,b),c)}}),addSelection:na(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new q(F(this,a),F(this,b||a)));fa(this,V(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this.sel.ranges,d=0;d<c.length;d++){var e=mc(this,c[d].from(),c[d].to());b=b?b.concat(e):e}return!1===a?b:b.join(a||"\n")},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=mc(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:na(function(a,b,c){for(var d=[],e=this.sel,h=0;h<e.ranges.length;h++){var g=e.ranges[h];d[h]={from:g.from(),to:g.to(),text:vb(a[h]),origin:c}}if(h=b)if(h="end"!=b){h=[];c=a=u(this.first,0);for(e=0;e<d.length;e++){var n=d[e],g=ne(n.from,a,c),l=ne(fb(n),a,c);(a=n.to,c=l,"around"==b)?(n=this.sel.ranges[e],n=0>L(n.head,n.anchor),h[e]=new q(n?l:g,n?g:l)):h[e]=new q(g,g)}h=new J(h,this.sel.primIndex)}b=
h;for(h=d.length-1;0<=h;h--)Rb(this,d[h]);b?$b(this,b):this.cm&&Hb(this.cm)}),undo:na(function(){Rc(this,"undo")}),redo:na(function(){Rc(this,"redo")}),undoSelection:na(function(){Rc(this,"undo",!0)}),redoSelection:na(function(){Rc(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 Zc(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Vb(this.history.done),undone:Vb(this.history.undone)}},setHistory:function(a){var b=this.history=new Zc(this.history.maxGeneration);
b.done=Vb(a.done.slice(0),null,!0);b.undone=Vb(a.undone.slice(0),null,!0)},addLineClass:na(function(a,b,c){return Tc(this,a,"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:na(function(a,b,c){return Tc(this,a,"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",h=a[e];if(!h)return!1;if(null==c)a[e]=null;else{var g=
h.match(RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!g)return!1;var n=g.index+g[0].length;a[e]=h.slice(0,g.index)+(g.index&&n!=h.length?" ":"")+h.slice(n)||null}return!0})}),markText:function(a,b,c){return Ub(this,F(this,a),F(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};return a=F(this,a),Ub(this,a,a,c,"bookmark")},findMarksAt:function(a){var a=F(this,a),b=[],c=C(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){var a=F(this,a),b=F(this,b),d=[],e=a.line;return this.iter(a.line,b.line+1,function(h){if(h=h.markedSpans)for(var g=0;g<h.length;g++){var n=h[g];e==a.line&&a.ch>n.to||null==n.from&&e!=a.line||e==b.line&&n.from>b.ch||c&&!c(n.marker)||d.push(n.marker.parent||n.marker)}++e}),d},getAllMarks:function(){var a=[];return 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)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){d=d.text.length+1;return d>a?(b=a,!0):(a-=d,++c,void 0)}),F(this,u(c,b))},indexFromPos:function(a){var a=F(this,a),b=a.ch;return a.line<this.first||0>a.ch?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new pa(Kd(this,this.first,this.first+this.size),this.modeOption,this.first);return 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())),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 pa(Kd(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=Ae(this);
for(c=0;c<a.length;c++){var d=a[c],e=d.find(),h=b.clipPos(e.from),e=b.clipPos(e.to);L(h,e)&&(h=Ub(b,h,e,d.primary,d.primary.type),d.markers.push(h),h.parent=d)}return b},unlinkDoc:function(a){if(a instanceof f&&(a=a.doc),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);wf(Ae(this));break}if(a.history==this.history){var c=[a.id];yb(a,function(a){c.push(a.id)},!0);a.history=new Zc(null);a.history.done=Vb(this.history.done,c);a.history.undone=
Vb(this.history.undone,c)}},iterLinkedDocs:function(a){yb(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});pa.prototype.eachLine=pa.prototype.iter;var Mf=["iter","insert","remove","copy","getEditor"],vc;for(vc in pa.prototype)pa.prototype.hasOwnProperty(vc)&&0>la(Mf,vc)&&(f.prototype[vc]=function(a){return function(){return a.apply(this.doc,arguments)}}(pa.prototype[vc]));Wb(pa);var oa=f.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=
!1},Nf=f.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},td=f.e_stop=function(a){oa(a);Nf(a)},I=f.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))},Ua=f.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}},ja=f.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)},qc=null,ya=30,ie=f.Pass={toString:function(){return"CodeMirror.Pass"}},ab={scroll:!1},wd={origin:"*mouse"},sc={origin:"+move"};bd.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var Fa=f.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 h=a.indexOf("\t",
d);if(0>h||h>=b)return e+(b-d);e+=h-d;e+=c-e%c;d=h+1}},$c=[""],jc=function(a){a.select()};Yb?jc=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:P&&(jc=function(a){try{a.select()}catch(b){}});[].indexOf&&(la=function(a,b){return a.indexOf(b)});[].map&&(hc=function(a,b){return a.map(b)});var Mb,Of=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Pe=f.isWordChar=function(a){return/\w/.test(a)||""<a&&(a.toUpperCase()!=a.toLowerCase()||
Of.test(a))},Hf=/[\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]/;
Mb=document.createRange?function(a,b,c){var d=document.createRange();return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};P&&11>W&&(Va=function(){try{return document.activeElement}catch(a){return document.body}});var rc,Md,Id,Od=!1,lf=function(){if(P&&9>W)return!1;var a=B("div");return"draggable"in a||"dragDrop"in a}(),vb=f.splitLines=3!="\n\nb".split(/\n/).length?
function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var h=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=h.indexOf("\r");-1!=g?(c.push(h.slice(0,g)),b+=g+1):(c.push(h),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},gf=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},Zd=
function(){var a=B("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),md=null,gb={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"};f.keyNames=gb;(function(){for(var a=0;10>a;a++)gb[a+48]=gb[a+96]=""+a;for(a=65;90>=a;a++)gb[a]=String.fromCharCode(a);for(a=1;12>=a;a++)gb[a+111]=gb[a+63235]="F"+a})();var ec,Ff=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]/,h=/[stwN]/,g=/[LRr]/,n=/[Lb1n]/,l=/[1n]/;return function(c){if(!e.test(c))return!1;for(var d,f=c.length,q=[],i=0;f>i;++i)q.push(a(c.charCodeAt(i)));for(var i=0,j="L";f>i;++i)d=q[i],"m"==d?q[i]=j:j=d;i=0;for(j="L";f>i;++i)d=q[i],"1"==d&&"r"==j?q[i]="n":g.test(d)&&(j=d,"r"==d&&(q[i]="R"));i=1;for(j=q[0];f-1>i;++i)d=q[i],"+"==d&&"1"==j&&"1"==q[i+1]?q[i]="1":","!=d||j!=q[i+1]||"1"!=j&&"n"!=j||(q[i]=j),j=d;for(i=0;f>i;++i)if(d=q[i],","==d)q[i]="N";else if("%"==
d){for(j=i+1;f>j&&"%"==q[j];++j);var t=i&&"!"==q[i-1]||f>j&&"1"==q[j]?"1":"N";for(d=i;j>d;++d)q[d]=t;i=j-1}i=0;for(j="L";f>i;++i)d=q[i],"L"==j&&"1"==d?q[i]="L":g.test(d)&&(j=d);for(i=0;f>i;++i)if(h.test(q[i])){for(j=i+1;f>j&&h.test(q[j]);++j);d="L"==(f>j?q[j]:"L");t="L"==(i?q[i-1]:"L")||d?"L":"R";for(d=i;j>d;++d)q[d]=t;i=j-1}for(var z,j=[],i=0;f>i;)if(n.test(q[i])){d=i;for(++i;f>i&&n.test(q[i]);++i);j.push(new b(0,d,i))}else{var A=i,t=j.length;for(++i;f>i&&"L"!=q[i];++i);for(d=A;i>d;)if(l.test(q[d])){d>
A&&j.splice(t,0,new b(1,A,d));A=d;for(++d;i>d&&l.test(q[d]);++d);j.splice(t,0,new b(2,A,d));A=d}else++d;i>A&&j.splice(t,0,new b(1,A,i))}return 1==j[0].level&&(z=c.match(/^\s+/))&&(j[0].from=z[0].length,j.unshift(new b(0,0,z[0].length))),1==X(j).level&&(z=c.match(/\s+$/))&&(X(j).to-=z[0].length,j.push(new b(0,f-z[0].length,f))),j[0].level!=X(j).level&&j.push(new b(j[0].level,f,f)),j}}();return f.version="4.6.0",f});
(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){function y(f){for(var m={},f=f.split(" "),r=0;r<f.length;++r)m[f[r]]=!0;return m}function m(f,r){if(!r.startOfLine)return!1;for(;;){if(!f.skipTo("\\")){f.skipToEnd();r.tokenize=null;break}if(f.next(),f.eol()){r.tokenize=m;break}}return"meta"}function D(f,m){if(f.backUp(1),f.match(/(R|u8R|uR|UR|LR)/)){var r=
f.match(/"([^\s\\()]{0,16})\(/);return r?(m.cpp11RawStringDelim=r[1],m.tokenize=w,w(f,m)):!1}return f.match(/(u8|u|U|L)/)?f.match(/["']/,!1)?"string":!1:(f.next(),!1)}function r(f,m){for(var r;null!=(r=f.next());)if('"'==r&&!f.eat('"')){m.tokenize=null;break}return"string"}function w(f,m){var r=m.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return f.match(RegExp(".*?\\)"+r+'"'))?m.tokenize=null:f.skipToEnd(),"string"}function G(m,r){function w(f){if(f)for(var m in f)f.hasOwnProperty(m)&&y.push(m)}
"string"==typeof m&&(m=[m]);var y=[];w(r.keywords);w(r.builtin);w(r.atoms);y.length&&(r.helperType=m[0],f.registerHelper("hintWords",m[0],y));for(var G=0;G<m.length;++G)f.defineMIME(m[G],r)}f.defineMode("clike",function(m,r){function w(f,i){var j=f.next();if(S[j]){var k=S[j](f,i);if(!1!==k)return k}if('"'==j||"'"==j)return i.tokenize=y(j),i.tokenize(f,i);if(/[\[\]{}\(\),;\:\.]/.test(j))return x=j,null;if(/\d/.test(j))return f.eatWhile(/[\w\.]/),"number";if("/"==j){if(f.eat("*"))return i.tokenize=
G,G(f,i);if(f.eat("/"))return f.skipToEnd(),"comment"}if(T.test(j))return f.eatWhile(T),"operator";f.eatWhile(/[\w\$_]/);j=f.current();return da.propertyIsEnumerable(j)?(K.propertyIsEnumerable(j)&&(x="newstatement"),"keyword"):Q.propertyIsEnumerable(j)?(K.propertyIsEnumerable(j)&&(x="newstatement"),"builtin"):R.propertyIsEnumerable(j)?"atom":"variable"}function y(f){return function(i,j){for(var k,m=!1,r=!1;null!=(k=i.next());){if(k==f&&!m){r=!0;break}m=!m&&"\\"==k}return(r||!m&&!E)&&(j.tokenize=null),
"string"}}function G(f,i){for(var j,k=!1;j=f.next();){if("/"==j&&k){i.tokenize=null;break}k="*"==j}return"comment"}function D(f,i,j,k,m){this.indented=f;this.column=i;this.type=j;this.align=k;this.prev=m}function M(f,i,j){var k=f.indented;return f.context&&"statement"==f.context.type&&(k=f.context.indented),f.context=new D(k,i,j,null,f.context)}function Y(f){var i=f.context.type;return(")"==i||"]"==i||"}"==i)&&(f.indented=f.context.indented),f.context=f.context.prev}var x,k=m.indentUnit,ea=r.statementIndentUnit||
k,ga=r.dontAlignCalls,da=r.keywords||{},Q=r.builtin||{},K=r.blockKeywords||{},R=r.atoms||{},S=r.hooks||{},E=r.multiLineStrings,T=/[+\-*&%=<>!?|\/]/;return{startState:function(f){return{tokenize:null,context:new D((f||0)-k,0,"top",!1),indented:0,startOfLine:!0}},token:function(f,i){var j=i.context;if(f.sol()&&(null==j.align&&(j.align=!1),i.indented=f.indentation(),i.startOfLine=!0),f.eatSpace())return null;x=null;var k=(i.tokenize||w)(f,i);if("comment"==k||"meta"==k)return k;if(null==j.align&&(j.align=
!0),";"!=x&&":"!=x&&","!=x||"statement"!=j.type)if("{"==x)M(i,f.column(),"}");else if("["==x)M(i,f.column(),"]");else if("("==x)M(i,f.column(),")");else if("}"==x){for(;"statement"==j.type;)j=Y(i);for("}"==j.type&&(j=Y(i));"statement"==j.type;)j=Y(i)}else x==j.type?Y(i):(("}"==j.type||"top"==j.type)&&";"!=x||"statement"==j.type&&"newstatement"==x)&&M(i,f.column(),"statement");else Y(i);return i.startOfLine=!1,k},indent:function(m,i){if(m.tokenize!=w&&null!=m.tokenize)return f.Pass;var j=m.context,
r=i&&i.charAt(0);"statement"==j.type&&"}"==r&&(j=j.prev);var v=r==j.type;return"statement"==j.type?j.indented+("{"==r?0:ea):!j.align||ga&&")"==j.type?")"!=j.type||v?j.indented+(v?0:k):j.indented+ea:j.column+(v?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});G(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:y("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:y("case do else for if switch while struct"),atoms:y("null"),hooks:{"#":m},modeProps:{fold:["brace","include"]}});G(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:y("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:y("catch class do else finally for if struct switch try while"),atoms:y("true false null"),hooks:{"#":m,u:D,U:D,L:D,R:D},modeProps:{fold:["brace","include"]}});G("text/x-java",{name:"clike",keywords:y("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:y("catch class do else finally for if switch try while"),atoms:y("true false null"),hooks:{"@":function(f){return f.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}});G("text/x-csharp",{name:"clike",keywords:y("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:y("catch class do else finally for foreach if struct switch try while"),builtin:y("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:y("true false null"),hooks:{"@":function(f,m){return f.eat('"')?(m.tokenize=r,r(f,m)):(f.eatWhile(/[\w\$_]/),"meta")}}});G("text/x-scala",{name:"clike",keywords:y("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),
multiLineStrings:!0,blockKeywords:y("catch class do else finally for forSome if match switch try while"),atoms:y("true false null"),hooks:{"@":function(f){return f.eatWhile(/[\w\$_]/),"meta"}}});G(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:y("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:y("for while do if else struct"),builtin:y("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:y("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:{"#":m},modeProps:{fold:["brace","include"]}});G("text/x-nesc",{name:"clike",keywords:y("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 volatileas atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:y("case do else for if switch while struct"),
atoms:y("null"),hooks:{"#":m},modeProps:{fold:["brace","include"]}})});
(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){function y(f){for(var k={},m=0;m<f.length;++m)k[f[m]]=!0;return k}function m(f,k){for(var m,r=!1;null!=(m=f.next());){if(r&&"/"==m){k.tokenize=null;break}r="*"==m}return["comment","comment"]}function D(f,k){return f.skipTo("--\>")?(f.match("--\>"),k.tokenize=null):f.skipToEnd(),["comment","comment"]}f.defineMode("css",
function(k,m){function r(f,j){var t=f.next();if(ma[t]){var k=ma[t](f,j);if(!1!==k)return k}"@"==t?(f.eatWhile(/[\w\\\-]/),t=(i=f.current(),"def")):t="="==t||("~"==t||"|"==t)&&f.eat("=")?(i="compare",null):'"'==t||"'"==t?(j.tokenize=v(t),j.tokenize(f,j)):"#"==t?(f.eatWhile(/[\w\\\-]/),i="hash","atom"):"!"==t?(f.match(/^\s*\w*/),i="important","keyword"):/\d/.test(t)||"."==t&&f.eat(/\d/)?(f.eatWhile(/[\w.%]/),i="unit","number"):"-"!==t?/[,+>*\/]/.test(t)?(i="select-op",null):"."==t&&f.match(/^-?[_a-z][_a-z0-9-]*/i)?
(i="qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(t)?(i=t,null):"u"==t&&f.match("rl(")?(f.backUp(1),j.tokenize=x,i="word","property"):/[\w\\\-]/.test(t)?(f.eatWhile(/[\w\\\-]/),i="word","property"):(i=null,null):/[\d.]/.test(f.peek())?(f.eatWhile(/[\w.%]/),i="unit","number"):f.match(/^\w+-/)?(i="meta","meta"):void 0;return t}function v(f){return function(j,t){for(var k,m=!1;null!=(k=j.next());){if(k==f&&!m){")"==f&&j.backUp(1);break}m=!m&&"\\"==k}return(k==f||!m&&")"!=f)&&(t.tokenize=null),i="string",
"string"}}function x(f,j){return f.next(),j.tokenize=f.match(/\s*[\"\')]/,!1)?null:v(")"),i="(",null}function w(f,i,j){this.type=f;this.indent=i;this.prev=j}function M(f,i,j){return f.context=new w(j,i.indentation()+ba,f.context),j}function G(f){return f.context=f.context.prev,f.context.type}function y(f,i,j,k){for(k=k||1;0<k;k--)j.context=j.context.prev;return J[j.context.type](f,i,j)}function Y(f){f=f.current().toLowerCase();j=ca.hasOwnProperty(f)?"atom":aa.hasOwnProperty(f)?"keyword":"variable"}
m.propertyKeywords||(m=f.resolveMode("text/css"));var i,j,ba=k.indentUnit,ma=m.tokenHooks,D=m.mediaTypes||{},N=m.mediaFeatures||{},O=m.propertyKeywords||{},U=m.nonStandardPropertyKeywords||{},aa=m.colorKeywords||{},ca=m.valueKeywords||{},Sa=m.fontProperties||{},ra=m.allowNested,J={};return J.top=function(f,i,k){if("{"==f)return M(k,i,"block");if("}"==f&&k.context.prev)return G(k);if("@media"==f)return M(k,i,"media");if("@font-face"==f)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(f))return"keyframes";
if(f&&"@"==f.charAt(0))return M(k,i,"at");if("hash"==f)j="builtin";else if("word"==f)j="tag";else{if("variable-definition"==f)return"maybeprop";if("interpolation"==f)return M(k,i,"interpolation");if(":"==f)return"pseudo";if(ra&&"("==f)return M(k,i,"parens")}return k.context.type},J.block=function(f,i,k){return"word"==f?(f=i.current().toLowerCase(),O.hasOwnProperty(f)?(j="property","maybeprop"):U.hasOwnProperty(f)?(j="string-2","maybeprop"):ra?(j=i.match(/^\s*:/,!1)?"property":"tag","block"):(j+=" error",
"maybeprop")):"meta"==f?"block":ra||"hash"!=f&&"qualifier"!=f?J.top(f,i,k):(j="error","block")},J.maybeprop=function(f,i,j){return":"==f?M(j,i,"prop"):J[j.context.type](f,i,j)},J.prop=function(f,i,k){if(";"==f)return G(k);if("{"==f&&ra)return M(k,i,"propBlock");if("}"==f||"{"==f)return y(f,i,k);if("("==f)return M(k,i,"parens");if("hash"!=f||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i.current()))if("word"==f)Y(i);else{if("interpolation"==f)return M(k,i,"interpolation")}else j+=" error";return"prop"},
J.propBlock=function(f,i,k){return"}"==f?G(k):"word"==f?(j="property","maybeprop"):k.context.type},J.parens=function(f,i,j){return"{"==f||"}"==f?y(f,i,j):")"==f?G(j):"("==f?M(j,i,"parens"):("word"==f&&Y(i),"parens")},J.pseudo=function(f,i,k){return"word"==f?(j="variable-3",k.context.type):J[k.context.type](f,i,k)},J.media=function(f,i,k){if("("==f)return M(k,i,"media_parens");if("}"==f)return y(f,i,k);if("{"==f)return G(k)&&M(k,i,ra?"block":"top");"word"==f&&(f=i.current().toLowerCase(),j="only"==
f||"not"==f||"and"==f?"keyword":D.hasOwnProperty(f)?"attribute":N.hasOwnProperty(f)?"property":"error");return k.context.type},J.media_parens=function(f,i,j){return")"==f?G(j):"{"==f||"}"==f?y(f,i,j,2):J.media(f,i,j)},J.font_face_before=function(f,i,j){return"{"==f?M(j,i,"font_face"):J[j.context.type](f,i,j)},J.font_face=function(f,i,k){return"}"==f?G(k):"word"==f?(j=Sa.hasOwnProperty(i.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},J.keyframes=function(f,i,k){return"word"==
f?(j="variable","keyframes"):"{"==f?M(k,i,"top"):J[k.context.type](f,i,k)},J.at=function(f,i,k){return";"==f?G(k):"{"==f||"}"==f?y(f,i,k):("word"==f?j="tag":"hash"==f&&(j="builtin"),"at")},J.interpolation=function(f,i,k){return"}"==f?G(k):"{"==f||";"==f?y(f,i,k):("variable"!=f&&(j="error"),"interpolation")},{startState:function(f){return{tokenize:null,state:"top",context:new w("top",f||0,null)}},token:function(f,k){if(!k.tokenize&&f.eatSpace())return null;var m=(k.tokenize||r)(f,k);return m&&"object"==
typeof m&&(i=m[1],m=m[0]),j=m,k.state=J[k.state](i,f,k),j},indent:function(f,i){var j=f.context,k=i&&i.charAt(0),m=j.indent;return"prop"!=j.type||"}"!=k&&")"!=k||(j=j.prev),!j.prev||("}"!=k||"block"!=j.type&&"top"!=j.type&&"interpolation"!=j.type&&"font_face"!=j.type)&&(")"!=k||"parens"!=j.type&&"media_parens"!=j.type)&&("{"!=k||"at"!=j.type&&"media"!=j.type)||(m=j.indent-ba),m},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r="all aural braille handheld print projection screen tty tv embossed".split(" "),
w=y(r),G="width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid".split(" "),v=y(G),N="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(" "),
O=y(N),ca="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(" "),U=y(ca),aa="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
M=y(aa),Y="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(" "),
x=y(Y),k=y("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),r=r.concat(G).concat(N).concat(ca).concat(aa).concat(Y);f.registerHelper("hintWords","css",r);f.defineMIME("text/css",{mediaTypes:w,mediaFeatures:v,propertyKeywords:O,nonStandardPropertyKeywords:U,colorKeywords:M,valueKeywords:x,fontProperties:k,tokenHooks:{"<":function(f,k){return f.match("!--")?(k.tokenize=D,D(f,k)):!1},"/":function(f,k){return f.eat("*")?(k.tokenize=m,m(f,
k)):!1}},name:"css"});f.defineMIME("text/x-scss",{mediaTypes:w,mediaFeatures:v,propertyKeywords:O,nonStandardPropertyKeywords:U,colorKeywords:M,valueKeywords:x,fontProperties:k,allowNested:!0,tokenHooks:{"/":function(f,k){return f.eat("/")?(f.skipToEnd(),["comment","comment"]):f.eat("*")?(k.tokenize=m,m(f,k)):["operator","operator"]},":":function(f){return f.match(/\s*\{/)?[null,"{"]:!1},$:function(f){return f.match(/^[\w-]+/),f.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2",
"variable"]},"#":function(f){return f.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"});f.defineMIME("text/x-less",{mediaTypes:w,mediaFeatures:v,propertyKeywords:O,nonStandardPropertyKeywords:U,colorKeywords:M,valueKeywords:x,fontProperties:k,allowNested:!0,tokenHooks:{"/":function(f,k){return f.eat("/")?(f.skipToEnd(),["comment","comment"]):f.eat("*")?(k.tokenize=m,m(f,k)):["operator","operator"]},"@":function(f){return f.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,
!1)?!1:(f.eatWhile(/[\w\\\-]/),f.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})});
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],f):f(CodeMirror)})(function(f){f.defineMode("gfm",function(y,m){var D=0,r={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0},w;for(w in m)r[w]=m[w];return r.name="markdown",f.defineMIME("gfmBase",r),f.overlayMode(f.getMode(y,
"gfmBase"),{startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(f){return{code:f.code,codeBlock:f.codeBlock,ateSpace:f.ateSpace}},token:function(f,m){if(m.combineTokens=null,m.codeBlock)return f.match(/^```/)?(m.codeBlock=!1,null):(f.skipToEnd(),null);if(f.sol()&&(m.code=!1),f.sol()&&f.match(/^```/))return f.skipToEnd(),m.codeBlock=!0,null;if("`"===f.peek()){f.next();var r=f.pos;f.eatWhile("`");r=1+f.pos-r;return m.code?r===D&&(m.code=!1):(D=r,m.code=!0),null}if(m.code)return f.next(),
null;if(f.eatSpace())return m.ateSpace=!0,null;if(f.sol()||m.ateSpace)if((m.ateSpace=!1,f.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))||f.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return m.combineTokens=!0,"link";return f.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/i)&&"]("!=f.string.slice(f.start-2,
f.start)?(m.combineTokens=!0,"link"):(f.next(),null)},blankLine:function(f){return f.code=!1,null}})},"markdown")});
(function(f){"object"==typeof exports&&"object"==typeof module?f(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"],f):f(CodeMirror)})(function(f){f.defineMode("htmlmixed",function(y,m){function D(f,m){var r=m.htmlState.tagName;r&&(r=r.toLowerCase());var k=v.token(f,m.htmlState);if("script"==r&&/\btag\b/.test(k)&&">"==
f.current()){(r=(r=f.string.slice(Math.max(0,f.pos-100),f.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i))?r[1]:"")&&/[\"\']/.test(r.charAt(0))&&(r=r.slice(1,r.length-1));for(var y=0;y<O.length;++y){var D=O[y];if("string"==typeof D.matches?r==D.matches:D.matches.test(r)){D.mode&&(m.token=w,m.localMode=D.mode,m.localState=D.mode.startState&&D.mode.startState(v.indent(m.htmlState,"")));break}}}else"style"==r&&/\btag\b/.test(k)&&">"==f.current()&&(m.token=G,m.localMode=N,m.localState=N.startState(v.indent(m.htmlState,
"")));return k}function r(f,m,r){var k=f.current(),v=k.search(m);return-1<v?f.backUp(k.length-v):k.match(/<\/?$/)&&(f.backUp(k.length),f.match(m,!1)||f.match(k)),r}function w(f,m){return f.match(/^<\/\s*script\s*>/i,!1)?(m.token=D,m.localState=m.localMode=null,D(f,m)):r(f,/<\/\s*script\s*>/,m.localMode.token(f,m.localState))}function G(f,m){return f.match(/^<\/\s*style\s*>/i,!1)?(m.token=D,m.localState=m.localMode=null,D(f,m)):r(f,/<\/\s*style\s*>/,N.token(f,m.localState))}var v=f.getMode(y,{name:"xml",
htmlMode:!0,multilineTagIndentFactor:m.multilineTagIndentFactor,multilineTagIndentPastTag:m.multilineTagIndentPastTag}),N=f.getMode(y,"css"),O=[],ca=m&&m.scriptTypes;if(O.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:f.getMode(y,"javascript")}),ca)for(var U=0;U<ca.length;++U){var aa=ca[U];O.push({matches:aa.matches,mode:aa.mode&&f.getMode(y,aa.mode)})}return O.push({matches:/./,mode:f.getMode(y,"text/plain")}),{startState:function(){var f=v.startState();return{token:D,
localMode:null,localState:null,htmlState:f}},copyState:function(m){if(m.localState)var r=f.copyState(m.localMode,m.localState);return{token:m.token,localMode:m.localMode,localState:r,htmlState:f.copyState(v,m.htmlState)}},token:function(f,m){return m.token(f,m)},indent:function(m,r){return!m.localMode||/^\s*<\//.test(r)?v.indent(m.htmlState,r):m.localMode.indent?m.localMode.indent(m.localState,r):f.Pass},innerMode:function(f){return{state:f.localState||f.htmlState,mode:f.localMode||v}}}},"xml","javascript",
"css");f.defineMIME("text/html","htmlmixed")});
(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("javascript",function(y,m){var D,r,w,G,v;function N(g,f,l){return db=g,qb=l,f}function O(g,f){var l=g.next();if('"'==l||"'"==l)return f.tokenize=ca(l),f.tokenize(g,f);if("."==l&&g.match(/^\d+(?:[eE][+\-]?\d+)?/))return N("number","number");if("."==l&&g.match(".."))return N("spread","meta");
if(/[\[\]{}\(\),;\:\.]/.test(l))return N(l);if("="==l&&g.eat(">"))return N("=>","operator");if("0"==l&&g.eat(/x/i))return g.eatWhile(/[\da-f]/i),N("number","number");if(/\d/.test(l))return g.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),N("number","number");if("/"==l){if(g.eat("*"))l=(f.tokenize=U,U(g,f));else if(g.eat("/"))l=(g.skipToEnd(),N("comment","comment"));else if("operator"==f.lastType||"keyword c"==f.lastType||"sof"==f.lastType||/^[\[{}\(,;:]$/.test(f.lastType)){a:for(var i=!1,j=!1;null!=(l=
g.next());){if(!i){if("/"==l&&!j)break a;"["==l?j=!0:j&&"]"==l&&(j=!1)}i=!i&&"\\"==l}l=(g.eatWhile(/[gimy]/),N("regexp","string-2"))}else l=(g.eatWhile(tb),N("operator","operator",g.current()));return l}if("`"==l)return f.tokenize=aa,aa(g,f);if("#"==l)return g.skipToEnd(),N("error","error");if(tb.test(l))return g.eatWhile(tb),N("operator","operator",g.current());if(Ob.test(l))return g.eatWhile(Ob),l=g.current(),(i=sb.propertyIsEnumerable(l)&&sb[l])&&"."!=f.lastType?N(i.type,i.style,l):N("variable",
"variable",l)}function ca(g){return function(f,l){var i,j=!1;if(rb&&"@"==f.peek()&&f.match(pd))return l.tokenize=O,N("jsonld-keyword","meta");for(;null!=(i=f.next())&&(i!=g||j);)j=!j&&"\\"==i;return j||(l.tokenize=O),N("string","string")}}function U(g,f){for(var l,i=!1;l=g.next();){if("/"==l&&i){f.tokenize=O;break}i="*"==l}return N("comment","comment")}function aa(g,f){for(var l,i=!1;null!=(l=g.next());){if(!i&&("`"==l||"$"==l&&g.eat("{"))){f.tokenize=O;break}i=!i&&"\\"==l}return N("quasi","string-2",
g.current())}function M(g,f){f.fatArrowAt&&(f.fatArrowAt=null);var l=g.string.indexOf("=>",g.start);if(!(0>l)){for(var i=0,j=!1,l=l-1;0<=l;--l){var k=g.string.charAt(l),m=Oa.indexOf(k);if(0<=m&&3>m){if(!i){++l;break}if(0==--i)break}else if(3<=m&&6>m)++i;else if(Ob.test(k))j=!0;else if(j&&!i){++l;break}}j&&!i&&(f.fatArrowAt=l)}}function Y(g,f,l,i,j,k){this.indented=g;this.column=f;this.type=l;this.prev=j;this.info=k;null!=i&&(this.align=i)}function x(){for(var g=arguments.length-1;0<=g;g--)D.push(arguments[g])}
function k(){return x.apply(null,arguments),!0}function ea(g){function f(l){for(;l;l=l.next)if(l.name==g)return!0;return!1}var l=r;if(l.context){if(!(w="def",f(l.localVars)))l.localVars={name:g,next:l.localVars}}else f(l.globalVars)||m.globalVars&&(l.globalVars={name:g,next:l.globalVars})}function ga(){r.context={prev:r.context,vars:r.localVars};r.localVars=eb}function da(){r.localVars=r.context.vars;r.context=r.context.prev}function Q(g,f){var l=function(){var l=r,i=l.indented;if("stat"==l.lexical.type)i=
l.lexical.indented;else for(var j=l.lexical;j&&")"==j.type&&j.align;j=j.prev)i=j.indented;l.lexical=new Y(i,G.column(),g,null,l.lexical,f)};return l.lex=!0,l}function K(){var g=r;g.lexical.prev&&(")"==g.lexical.type&&(g.indented=g.lexical.indented),g.lexical=g.lexical.prev)}function R(g){function f(l){return l==g?k():";"==g?x():k(f)}return f}function S(g,f){return"var"==g?k(Q("vardef",f.length),wa,R(";"),K):"keyword a"==g?k(Q("form"),E,S,K):"keyword b"==g?k(Q("form"),S,K):"{"==g?k(Q("}"),t,K):";"==
g?k():"if"==g?("else"==r.lexical.info&&r.cc[r.cc.length-1]==K&&r.cc.pop()(),k(Q("form"),E,S,K,$b)):"function"==g?k(ta):"for"==g?k(Q("form"),fa,S,K):"variable"==g?k(Q("stat"),Eb):"switch"==g?k(Q("form"),E,Q("}","switch"),R("{"),t,K,K):"case"==g?k(E,R(":")):"default"==g?k(R(":")):"catch"==g?k(Q("form"),ga,R("("),Ib,R(")"),S,K,da):"module"==g?k(Q("form"),ga,hb,da,K):"class"==g?k(Q("form"),Ac,K):"export"==g?k(Q("form"),id,K):"import"==g?k(Q("form"),kd,K):x(Q("stat"),E,R(";"),K)}function E(g){return Ra(g,
!1)}function T(g){return Ra(g,!0)}function Ra(g,f){if(r.fatArrowAt==G.start){var m=f?Za:$a;if("("==g)return k(ga,Q(")"),q(l,")"),K,R("=>"),m,da);if("variable"==g)return x(ga,l,R("=>"),m,da)}m=f?ma:ba;return ib.hasOwnProperty(g)?k(m):"function"==g?k(ta,m):"keyword c"==g?k(f?j:i):"("==g?k(Q(")"),i,cb,R(")"),K,m):"operator"==g||"spread"==g?k(f?T:E):"["==g?k(Q("]"),Bc,K,m):"{"==g?V(Sa,"}",null,m):"quasi"==g?x(Aa,m):k()}function i(g){return g.match(/[;\}\)\],]/)?x():x(E)}function j(g){return g.match(/[;\}\)\],]/)?
x():x(T)}function ba(g,f){return","==g?k(E):ma(g,f,!1)}function ma(g,f,l){var j=0==l?ba:ma,m=0==l?E:T;return"=>"==g?k(ga,l?Za:$a,da):"operator"==g?/\+\+|--/.test(f)?k(j):"?"==f?k(E,R(":"),m):k(m):"quasi"==g?x(Aa,j):";"!=g?"("==g?V(T,")","call",j):"."==g?k(Fb,j):"["==g?k(Q("]"),i,R("]"),K,j):void 0:void 0}function Aa(g,f){return"quasi"!=g?x():"${"!=f.slice(f.length-2)?k(Aa):k(E,nb)}function nb(g){return"}"==g?(w="string-2",r.tokenize=aa,k(Aa)):void 0}function $a(g){return M(G,r),x("{"==g?S:E)}function Za(g){return M(G,
r),x("{"==g?S:T)}function Eb(g){return":"==g?k(K,S):x(ba,R(";"),K)}function Fb(g){return"variable"==g?(w="property",k()):void 0}function Sa(g,f){return"variable"==g||"keyword"==v?(w="property","get"==f||"set"==f?k(ra):k(J)):"number"==g||"string"==g?(w=rb?"property":v+" property",k(J)):"jsonld-keyword"==g?k(J):"["==g?k(E,R("]"),J):void 0}function ra(g){return"variable"!=g?x(J):(w="property",k(ta))}function J(g){return":"==g?k(T):"("==g?x(ta):void 0}function q(g,f){function l(i){return","==i?(i=r.lexical,
"call"==i.info&&(i.pos=(i.pos||0)+1),k(g,l)):i==f?k():k(R(f))}return function(i){return i==f?k():x(g,l)}}function V(g,f,l){for(var i=3;i<arguments.length;i++)D.push(arguments[i]);return k(Q(f,l),q(g,f),K)}function t(g){return"}"==g?k():x(S,t)}function F(g){return xa&&":"==g?k(Ba):void 0}function Ba(g){return"variable"==g?(w="variable-3",k()):void 0}function wa(){return x(l,F,ia,hd)}function l(f,i){return"variable"==f?(ea(i),k()):"["==f?V(l,"]"):"{"==f?V(g,"}"):void 0}function g(g,f){return"variable"!=
g||G.match(/^\s*:/,!1)?("variable"==g&&(w="property"),k(R(":"),l,ia)):(ea(f),k(ia))}function ia(g,f){return"="==f?k(T):void 0}function hd(g){return","==g?k(wa):void 0}function $b(g,f){return"keyword b"==g&&"else"==f?k(Q("form","else"),S,K):void 0}function fa(g){return"("==g?k(Q(")"),Gb,R(")"),K):void 0}function Gb(g){return"var"==g?k(wa,R(";"),ob):";"==g?k(ob):"variable"==g?k(zc):x(E,R(";"),ob)}function zc(g,f){return"in"==f||"of"==f?(w="keyword",k(E)):k(ba,ob)}function ob(g,f){return";"==g?k(ac):
"in"==f||"of"==f?(w="keyword",k(E)):x(E,R(";"),ac)}function ac(g){")"!=g&&k(E)}function ta(g,f){return"*"==f?(w="keyword",k(ta)):"variable"==g?(ea(f),k(ta)):"("==g?k(ga,Q(")"),q(Ib,")"),K,S,da):void 0}function Ib(g){return"spread"==g?k(Ib):x(l,F)}function Ac(g,f){return"variable"==g?(ea(f),k(Ya)):void 0}function Ya(g,f){return"extends"==f?k(E,Ya):"{"==g?k(Q("}"),pb,K):void 0}function pb(g,f){return"variable"==g||"keyword"==v?(w="property","get"==f||"set"==f?k(Kb,ta,pb):k(ta,pb)):"*"==f?(w="keyword",
k(pb)):";"==g?k(pb):"}"==g?k():void 0}function Kb(g){return"variable"!=g?x():(w="property",k())}function hb(g,f){return"string"==g?k(S):"variable"==g?(ea(f),k(Jb)):void 0}function id(g,f){return"*"==f?(w="keyword",k(Jb,R(";"))):"default"==f?(w="keyword",k(E,R(";"))):x(S)}function kd(g){return"string"==g?k():x(bb,Jb)}function bb(g,f){return"{"==g?V(bb,"}"):("variable"==g&&ea(f),k())}function Jb(g,f){return"from"==f?(w="keyword",k(E)):void 0}function Bc(g){return"]"==g?k():x(T,Lb)}function Lb(g){return"for"==
g?x(cb,R("]")):","==g?k(q(T,"]")):x(q(T,"]"))}function cb(g){return"for"==g?k(fa,cb):"if"==g?k(E,cb):void 0}var db,qb,va=y.indentUnit,Nb=m.statementIndent,rb=m.jsonld,Ea=m.json||rb,xa=m.typescript,Ob=m.wordCharacters||/[\w$]/,sb=function(){function g(f){return{type:f,style:"keyword"}}var f=g("keyword a"),l=g("keyword b"),i=g("keyword c"),j=g("operator"),k={type:"atom",style:"atom"},f={"if":g("if"),"while":f,"with":f,"else":l,"do":l,"try":l,"finally":l,"return":i,"break":i,"continue":i,"new":i,"delete":i,
"throw":i,"debugger":i,"var":g("var"),"const":g("var"),let:g("var"),"function":g("function"),"catch":g("catch"),"for":g("for"),"switch":g("switch"),"case":g("case"),"default":g("default"),"in":j,"typeof":j,"instanceof":j,"true":k,"false":k,"null":k,undefined:k,NaN:k,Infinity:k,"this":g("this"),module:g("module"),"class":g("class"),"super":g("atom"),yield:i,"export":g("export"),"import":g("import"),"extends":i};if(xa){var l={type:"variable",style:"variable-3"},l={"interface":g("interface"),"extends":g("extends"),
constructor:g("constructor"),"public":g("public"),"private":g("private"),"protected":g("protected"),"static":g("static"),string:l,number:l,bool:l,any:l},m;for(m in l)f[m]=l[m]}return f}(),tb=/[+\-*&%=<>!?|~^]/,pd=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Oa="([{}])",ib={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0};D=w=r=null;v=G=void 0;var eb={name:"this",next:{name:"arguments"}};return K.lex=!0,{startState:function(g){g=
{tokenize:O,lastType:"sof",cc:[],lexical:new Y((g||0)-va,0,"block",!1),localVars:m.localVars,context:m.localVars&&{vars:m.localVars},indented:0};return m.globalVars&&"object"==typeof m.globalVars&&(g.globalVars=m.globalVars),g},token:function(g,f){if(g.sol()&&(f.lexical.hasOwnProperty("align")||(f.lexical.align=!1),f.indented=g.indentation(),M(g,f)),f.tokenize!=U&&g.eatSpace())return null;var l=f.tokenize(g,f);if("comment"!=db){f.lastType="operator"!=db||"++"!=qb&&"--"!=qb?db:"incdec";var i;a:{var j=
db,k=qb,m=f.cc;r=f;G=g;w=null;D=m;v=l;for(f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;)if((m.length?m.pop():Ea?E:S)(j,k)){for(;m.length&&m[m.length-1].lex;)m.pop()();if(w)l=w;else{if(i="variable"==j)b:{for(i=f.localVars;i;i=i.next)if(i.name==k){i=!0;break b}for(j=f.context;j;j=j.prev)for(i=j.vars;i;i=i.next)if(i.name==k){i=!0;break b}i=void 0}l=i?"variable-2":l}i=l;break a}}l=i}return l},indent:function(g,l){if(g.tokenize==U)return f.Pass;if(g.tokenize!=O)return 0;var i=l&&l.charAt(0),
j=g.lexical;if(!/^\s*else\b/.test(l))for(var k=g.cc.length-1;0<=k;--k){var q=g.cc[k];if(q==K)j=j.prev;else if(q!=$b)break}"stat"==j.type&&"}"==i&&(j=j.prev);Nb&&")"==j.type&&"stat"==j.prev.type&&(j=j.prev);k=j.type;q=i==k;return"vardef"==k?j.indented+("operator"==g.lastType||","==g.lastType?j.info+1:0):"form"==k&&"{"==i?j.indented:"form"==k?j.indented+va:"stat"==k?j.indented+("operator"==g.lastType||","==g.lastType?Nb||va:0):"switch"!=j.info||q||0==m.doubleIndentSwitch?j.align?j.column+(q?0:1):j.indented+
(q?0:va):j.indented+(/^(?:case|default)\b/.test(l)?va:2*va)},electricChars:":{}",blockCommentStart:Ea?null:"/*",blockCommentEnd:Ea?null:"*/",lineComment:Ea?null:"//",fold:"brace",helperType:Ea?"json":"javascript",jsonldMode:rb,jsonMode:Ea}});f.registerHelper("wordChars","javascript",/[\w$]/);f.defineMIME("text/javascript","javascript");f.defineMIME("text/ecmascript","javascript");f.defineMIME("application/javascript","javascript");f.defineMIME("application/x-javascript","javascript");f.defineMIME("application/ecmascript",
"javascript");f.defineMIME("application/json",{name:"javascript",json:!0});f.defineMIME("application/x-json",{name:"javascript",json:!0});f.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});f.defineMIME("text/typescript",{name:"javascript",typescript:!0});f.defineMIME("application/typescript",{name:"javascript",typescript:!0})});
(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror",require("../xml/xml"))):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml"],f):f(CodeMirror)})(function(f){f.defineMode("markdown",function(y,m){function D(f){return f.linkTitle=!1,f.em=!1,f.strong=!1,f.quote=0,ea||f.f!=w||(f.f=O,f.block=r),f.trailingSpace=0,f.trailingSpaceNewLine=!1,f.thisLineHasContent=!1,null}function r(f,g){var i=f.sol(),k=!1!==g.list;!1!==g.list&&0<=
g.indentationDiff?(4>g.indentationDiff&&(g.indentation-=g.indentationDiff),g.list=null):!1!==g.list&&0<g.indentation?(g.list=null,g.listDepth=Math.floor(g.indentation/4)):!1!==g.list&&(g.list=!1,g.listDepth=0);var r=null;return 4<=g.indentationDiff?(g.indentation-=4,f.skipToEnd(),S):f.eatSpace()?null:(r=f.match(V))?(g.header=6>=r[0].length?r[0].length:6,m.highlightFormatting&&(g.formatting="header"),g.f=g.inline,v(g)):g.prevLineHasContent&&(r=f.match(t))?(g.header="="==r[0].charAt(0)?1:2,m.highlightFormatting&&
(g.formatting="header"),g.f=g.inline,v(g)):f.eat(">")?(g.indentation++,g.quote=i?1:g.quote+1,m.highlightFormatting&&(g.formatting="quote"),f.eatSpace(),v(g)):"["===f.peek()?(g.f=g.inline=M,M(f,g)):f.match(Sa,!0)?j:(!g.prevLineHasContent||k)&&(f.match(ra,!1)||f.match(J,!1))?(i=null,f.match(ra,!0)?i="ul":(f.match(J,!0),i="ol"),g.indentation+=4,g.list=!0,g.listDepth++,m.taskLists&&f.match(q,!1)&&(g.taskList=!0),g.f=g.inline,m.highlightFormatting&&(g.formatting=["list","list-"+i]),v(g)):m.fencedCodeBlocks&&
f.match(/^```([\w+#]*)/,!0)?(g.localMode=Q(RegExp.$1),g.localMode&&(g.localState=g.localMode.startState()),g.f=g.block=G,G(f,g),m.highlightFormatting&&(g.formatting="code-block"),g.code=!0,v(g)):(g.f=g.inline=g.inline,(0,g.inline)(f,g))}function w(f,g){var i=ga.token(f,g.htmlState);return(ea&&null===g.htmlState.tagStart&&!g.htmlState.context||g.md_inside&&-1<f.current().indexOf(">"))&&(g.f=O,g.block=r,g.htmlState=null),i}function G(f,g){if(f.sol()&&f.match(/^```/,!0)){g.localMode=g.localState=null;
g.f=O;g.block=r;m.highlightFormatting&&(g.formatting="code-block");g.code=!0;var i=v(g);return g.code=!1,i}return g.localMode?g.localMode.token(f,g.localState):(f.skipToEnd(),S)}function v(f){var g=[];if(f.formatting){g.push(ma);"string"==typeof f.formatting&&(f.formatting=[f.formatting]);for(var j=0;j<f.formatting.length;j++)g.push(ma+"-"+f.formatting[j]),"header"===f.formatting[j]&&g.push(ma+"-"+f.formatting[j]+"-"+f.header),"quote"===f.formatting[j]&&(!m.maxBlockquoteDepth||m.maxBlockquoteDepth>=
f.quote?g.push(ma+"-"+f.formatting[j]+"-"+f.quote):g.push("error"))}if(f.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(f.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(f.linkHref)return g.push(Za),g.length?g.join(" "):null;if(f.strong&&g.push(Fb),f.em&&g.push(Eb),f.linkText&&g.push($a),f.code&&g.push(S),f.header&&(g.push(R),g.push(R+"-"+f.header)),f.quote&&(g.push(E),!m.maxBlockquoteDepth||m.maxBlockquoteDepth>=f.quote?g.push(E+"-"+f.quote):g.push(E+"-"+m.maxBlockquoteDepth)),
!1!==f.list)(j=(f.listDepth-1)%3)?1===j?g.push(Ra):g.push(i):g.push(T);return f.trailingSpaceNewLine?g.push("trailing-space-new-line"):f.trailingSpace&&g.push("trailing-space-"+(f.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function N(f,g){return f.match(F,!0)?v(g):void 0}function O(i,g){var j=g.text(i,g);if("undefined"!=typeof j)return j;if(g.list)return g.list=null,v(g);if(g.taskList)return"x"!==i.match(q,!0)[1]?g.taskOpen=!0:g.taskClosed=!0,m.highlightFormatting&&(g.formatting="task"),
g.taskList=!1,v(g);if(g.taskOpen=!1,g.taskClosed=!1,g.header&&i.match(/^#+$/,!0))return m.highlightFormatting&&(g.formatting="header"),v(g);var j=i.sol(),k=i.next();if("\\"===k&&(i.next(),m.highlightFormatting))return(j=v(g))?j+" formatting-escape":"formatting-escape";if(g.linkTitle){g.linkTitle=!1;var r=k;"("===k&&(r=")");r=(r+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");if(i.match(RegExp("^\\s*(?:[^"+r+"\\\\]+|\\\\\\\\|\\\\.)"+r),!0))return Za}if("`"===k)return j=g.formatting,m.highlightFormatting&&
(g.formatting="code"),k=v(g),r=i.pos,i.eatWhile("`"),r=1+i.pos-r,g.code?r===K?(g.code=!1,k):(g.formatting=j,v(g)):(K=r,g.code=!0,v(g));if(g.code)return v(g);if("!"===k&&i.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.match(/\[[^\]]*\]/),g.inline=g.f=U,ba;if("["===k&&i.match(/.*\](\(| ?\[)/,!1))return g.linkText=!0,m.highlightFormatting&&(g.formatting="link"),v(g);if("]"===k&&g.linkText)return m.highlightFormatting&&(g.formatting="link"),j=v(g),g.linkText=!1,g.inline=g.f=U,j;if("<"===k&&i.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,
!1))return g.f=g.inline=ca,m.highlightFormatting&&(g.formatting="link"),j=v(g),j?j+=" ":j="",j+Aa;if("<"===k&&i.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return g.f=g.inline=ca,m.highlightFormatting&&(g.formatting="link"),j=v(g),j?j+=" ":j="",j+nb;if("<"===k&&i.match(/^\w/,!1))return-1!=i.string.indexOf(">")&&/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(i.string.substring(1,i.string.indexOf(">")))&&(g.md_inside=!0),i.backUp(1),g.htmlState=f.startState(ga),g.f=g.block=w,w(i,g);if("<"===k&&i.match(/^\/\w*?>/))return g.md_inside=
!1,"tag";r=!1;if(!m.underscoresBreakWords&&"_"===k&&"_"!==i.peek()&&i.match(/(\w)/,!1)){var t=i.pos-2;0<=t&&(t=i.string.charAt(t),"_"!==t&&t.match(/(\w)/,!1)&&(r=!0))}if("*"===k||"_"===k&&!r){if(!(j&&" "===i.peek())){if(g.strong===k&&i.eat(k))return m.highlightFormatting&&(g.formatting="strong"),k=v(g),g.strong=!1,k;if(!g.strong&&i.eat(k))return g.strong=k,m.highlightFormatting&&(g.formatting="strong"),v(g);if(g.em===k)return m.highlightFormatting&&(g.formatting="em"),k=v(g),g.em=!1,k;if(!g.em)return g.em=
k,m.highlightFormatting&&(g.formatting="em"),v(g)}}else if(" "===k&&(i.eat("*")||i.eat("_"))){if(" "===i.peek())return v(g);i.backUp(1)}return" "===k&&(i.match(/ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),v(g)}function ca(f,g){if(">"===f.next()){g.f=g.inline=O;m.highlightFormatting&&(g.formatting="link");var i=v(g);return i?i+=" ":i="",i+Aa}return f.match(/^[^>]+/,!0),Aa}function U(f,g){if(f.eatSpace())return null;var i=f.next();return"("===i||"["===i?(g.f=g.inline=aa("("===
i?")":"]"),m.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,v(g)):"error"}function aa(f){return function(g,i){if(g.next()===f){i.f=i.inline=O;m.highlightFormatting&&(i.formatting="link-string");var j=v(i);return i.linkHref=!1,j}return g.match(k(f),!0)&&g.backUp(1),i.linkHref=!0,v(i)}}function M(f,g){return f.match(/^[^\]]*\]:/,!1)?(g.f=Y,f.next(),m.highlightFormatting&&(g.formatting="link"),g.linkText=!0,v(g)):(g.f=g.inline=O,O(f,g))}function Y(f,g){if(f.match(/^\]:/,!0)){g.f=g.inline=
x;m.highlightFormatting&&(g.formatting="link");var i=v(g);return g.linkText=!1,i}return f.match(/^[^\]]+/,!0),$a}function x(f,g){return f.eatSpace()?null:(f.match(/^[^\s]+/,!0),void 0===f.peek()?g.linkTitle=!0:f.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=O,Za)}function k(f){return Ba[f]||(f=(f+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),Ba[f]=RegExp("^(?:[^\\\\]|\\\\.)*?("+f+")")),Ba[f]}var ea=f.modes.hasOwnProperty("xml"),ga=f.getMode(y,
ea?{name:"xml",htmlMode:!0}:"text/plain"),da={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},Q=function(){var i,g,j={},k={},m=[];for(g in f.modes)f.modes.propertyIsEnumerable(g)&&m.push(g);for(i=0;i<m.length;i++)j[m[i]]=m[i];m=[];for(g in f.mimeModes)f.mimeModes.propertyIsEnumerable(g)&&m.push({mime:g,mode:f.mimeModes[g]});for(i=0;i<m.length;i++)g=m[i].mime,k[g]=m[i].mime;
for(var r in da)(da[r]in j||da[r]in k)&&(j[r]=da[r]);return function(g){return j[g]?f.getMode(y,j[g]):null}}();void 0===m.highlightFormatting&&(m.highlightFormatting=!1);void 0===m.maxBlockquoteDepth&&(m.maxBlockquoteDepth=0);void 0===m.underscoresBreakWords&&(m.underscoresBreakWords=!0);void 0===m.fencedCodeBlocks&&(m.fencedCodeBlocks=!1);void 0===m.taskLists&&(m.taskLists=!1);var K=0,R="header",S="comment",E="quote",T="variable-2",Ra="variable-3",i="keyword",j="hr",ba="tag",ma="formatting",Aa="link",
nb="link",$a="link",Za="string",Eb="em",Fb="strong",Sa=/^([*\-=_])(?:\s*\1){2,}\s*$/,ra=/^[*\-+]\s+/,J=/^[0-9]+\.\s+/,q=/^\[(x| )\](?=\s)/,V=/^#+/,t=/^(?:\={1,}|-{1,})$/,F=/^[^#!\[\]*_\\<>` "'(]+/,Ba=[],wa={startState:function(){return{f:r,prevLineHasContent:!1,thisLineHasContent:!1,block:r,htmlState:null,indentation:0,inline:O,text:N,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(i){return{f:i.f,
prevLineHasContent:i.prevLineHasContent,thisLineHasContent:i.thisLineHasContent,block:i.block,htmlState:i.htmlState&&f.copyState(ga,i.htmlState),indentation:i.indentation,localMode:i.localMode,localState:i.localMode?f.copyState(i.localMode,i.localState):null,inline:i.inline,text:i.text,formatting:!1,linkTitle:i.linkTitle,em:i.em,strong:i.strong,header:i.header,taskList:i.taskList,list:i.list,listDepth:i.listDepth,quote:i.quote,trailingSpace:i.trailingSpace,trailingSpaceNewLine:i.trailingSpaceNewLine,
md_inside:i.md_inside}},token:function(f,g){if(g.formatting=!1,f.sol()){var i=f.match(/^\s*$/,!0)||g.header;if(g.header=0,i)return g.prevLineHasContent=!1,D(g);g.prevLineHasContent=g.thisLineHasContent;g.thisLineHasContent=!0;g.taskList=!1;g.code=!1;g.trailingSpace=0;g.trailingSpaceNewLine=!1;g.f=g.block;var i=f.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length,j=4*Math.floor((i-g.indentation)/4);4<j&&(j=4);j=g.indentation+j;if(g.indentationDiff=j-g.indentation,g.indentation=j,0<i)return null}i=g.f(f,
g);return f.start==f.pos?this.token(f,g):i},innerMode:function(f){return f.block==w?{state:f.htmlState,mode:ga}:f.localState?{state:f.localState,mode:f.localMode}:{state:f,mode:wa}},blankLine:D,getType:v,fold:"markdown"};return wa},"xml");f.defineMIME("text/x-markdown","markdown")});
(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(y,m){function D(f,j){function k(m){return j.tokenize=m,m(f,j)}var m=f.next();if("<"==m)return f.eat("!")?f.eat("[")?f.match("CDATA[")?k(G("atom","]]\>")):null:f.match("--")?k(G("comment","--\>")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),k(v(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),
j.tokenize=G("meta","?>"),"meta"):(S=f.eat("/")?"closeTag":"openTag",j.tokenize=r,"tag bracket");if("&"==m){var w;return w=f.eat("#")?f.eat("x")?f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):f.eatWhile(/[\d]/)&&f.eat(";"):f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),w?"atom":"error"}return f.eatWhile(/[^&<]/),null}function r(f,j){var k=f.next();return">"==k||"/"==k&&f.eat(">")?(j.tokenize=D,S=">"==k?"endTag":"selfcloseTag","tag bracket"):"="==k?(S="equals",null):"<"==k?(j.tokenize=D,j.state=U,j.tagName=j.tagStart=
null,(k=j.tokenize(f,j))?k+" tag error":"tag error"):/[\'\"]/.test(k)?(j.tokenize=w(k),j.stringStartCol=f.column(),j.tokenize(f,j)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(f){var j=function(j,k){for(;!j.eol();)if(j.next()==f){k.tokenize=r;break}return"string"};return j.isInAttribute=!0,j}function G(f,j){return function(k,m){for(;!k.eol();){if(k.match(j)){m.tokenize=D;break}k.next()}return f}}function v(f){return function(j,k){for(var m;null!=(m=j.next());){if("<"==
m)return k.tokenize=v(f+1),k.tokenize(j,k);if(">"==m){if(1==f){k.tokenize=D;break}return k.tokenize=v(f-1),k.tokenize(j,k)}}return"meta"}}function N(f,j,k){this.prev=f.context;this.tagName=j;this.indent=f.indented;this.startOfLine=k;(T.doNotIndent.hasOwnProperty(j)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function O(f){f.context&&(f.context=f.context.prev)}function ca(f,j){for(var k;f.context&&!(k=f.context.tagName,!T.contextGrabbers.hasOwnProperty(k)||!T.contextGrabbers[k].hasOwnProperty(j));)O(f)}
function U(f,j,k){return"openTag"==f?(k.tagStart=j.column(),aa):"closeTag"==f?M:U}function aa(f,j,m){return"word"==f?(m.tagName=j.current(),E="tag",k):(E="error",aa)}function M(f,j,k){return"word"==f?(f=j.current(),k.context&&k.context.tagName!=f&&T.implicitlyClosed.hasOwnProperty(k.context.tagName)&&O(k),k.context&&k.context.tagName==f?(E="tag",Y):(E="tag error",x)):(E="error",x)}function Y(f,j,k){return"endTag"!=f?(E="error",Y):(O(k),U)}function x(f,j,k){return E="error",Y(f,j,k)}function k(f,j,
m){if("word"==f)return E="attribute",ea;if("endTag"==f||"selfcloseTag"==f){var j=m.tagName,r=m.tagStart;return m.tagName=m.tagStart=null,"selfcloseTag"==f||T.autoSelfClosers.hasOwnProperty(j)?ca(m,j):(ca(m,j),m.context=new N(m,j,r==m.indented)),U}return E="error",k}function ea(f,j,m){return"equals"==f?ga:(T.allowMissing||(E="error"),k(f,j,m))}function ga(f,j,m){return"string"==f?da:"word"==f&&T.allowUnquoted?(E="string",k):(E="error",k(f,j,m))}function da(f,j,m){return"string"==f?da:k(f,j,m)}var Q=
y.indentUnit,K=m.multilineTagIndentFactor||1,R=m.multilineTagIndentPastTag;null==R&&(R=!0);var S,E,T=m.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},
p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},
allowUnquoted:!1,allowMissing:!1,caseFold:!1},Ra=m.alignCDATA;return{startState:function(){return{tokenize:D,state:U,indented:0,tagName:null,tagStart:null,context:null}},token:function(f,j){if(!j.tagName&&f.sol()&&(j.indented=f.indentation()),f.eatSpace())return null;S=null;var k=j.tokenize(f,j);return(k||S)&&"comment"!=k&&(E=null,j.state=j.state(S||k,f,j),E&&(k="error"==E?k+" error":E)),k},indent:function(i,j,k){var m=i.context;if(i.tokenize.isInAttribute)return i.tagStart==i.indented?i.stringStartCol+
1:i.indented+Q;if(m&&m.noIndent)return f.Pass;if(i.tokenize!=r&&i.tokenize!=D)return k?k.match(/^(\s*)/)[0].length:0;if(i.tagName)return R?i.tagStart+i.tagName.length+2:i.tagStart+Q*K;if(Ra&&/<!\[CDATA\[/.test(j))return 0;if((i=j&&/^<(\/)?([\w_:\.-]*)/.exec(j))&&i[1])for(;m;){if(m.tagName==i[2]){m=m.prev;break}if(!T.implicitlyClosed.hasOwnProperty(m.tagName))break;m=m.prev}else if(i)for(;m;){j=T.contextGrabbers[m.tagName];if(!j||!j.hasOwnProperty(i[2]))break;m=m.prev}for(;m&&!m.startOfLine;)m=m.prev;
return m?m.indent+Q:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<\!--",blockCommentEnd:"--\>",configuration:m.htmlMode?"html":"xml",helperType:m.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})});
(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.overlayMode=function(y,m,D){return{startState:function(){return{base:f.startState(y),overlay:f.startState(m),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,lineSeen:null}},copyState:function(r){return{base:f.copyState(y,r.base),overlay:f.copyState(m,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,
overlayCur:null}},token:function(f,w){return(f.sol()||f.string!=w.lineSeen||Math.min(w.basePos,w.overlayPos)<f.start)&&(w.lineSeen=f.string,w.basePos=w.overlayPos=f.start),f.start==w.basePos&&(w.baseCur=y.token(f,w.base),w.basePos=f.pos),f.start==w.overlayPos&&(f.pos=f.start,w.overlayCur=m.token(f,w.overlay),w.overlayPos=f.pos),f.pos=Math.min(w.basePos,w.overlayPos),null==w.overlayCur?w.baseCur:null!=w.baseCur&&w.overlay.combineTokens||D&&null==w.overlay.combineTokens?w.baseCur+" "+w.overlayCur:w.overlayCur},
indent:y.indent&&function(f,m){return y.indent(f.base,m)},electricChars:y.electricChars,innerMode:function(f){return{state:f.base,mode:y}},blankLine:function(f){y.blankLine&&y.blankLine(f.base);m.blankLine&&m.blankLine(f.overlay)}}}});