This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 347
/
codemirror-compressed.js
6 lines (6 loc) · 164 KB
/
codemirror-compressed.js
1
2
3
4
5
6
window.CodeMirror=function(){"use strict";function w(a,c){if(!(this instanceof w))return new w(a,c);this.options=c=c||{};for(var d in Sc)!c.hasOwnProperty(d)&&Sc.hasOwnProperty(d)&&(c[d]=Sc[d]);I(c);var e="string"==typeof c.value?0:c.value.first,f=this.display=x(a,e);f.wrapper.CodeMirror=this,F(this),c.autofocus&&!o&&Hb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ke},D(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;"string"==typeof g&&(g=new Yd(c.value,c.mode)),zb(this,ae)(this,g),b&&setTimeout(Ue(Gb,this,!0),20),Jb(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!o?setTimeout(Ue(dc,this),20):ec(this),zb(this,function(){for(var a in Rc)Rc.propertyIsEnumerable(a)&&Rc[a](this,c[a],Uc);for(var b=0;Yc.length>b;++b)Yc[b](this)})()}function x(a,b){var d={},f=d.input=Ze("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");e?f.style.width="1000px":f.setAttribute("wrap","off"),n&&(f.style.border="1px solid black"),f.setAttribute("autocorrect","off"),f.setAttribute("autocapitalize","off"),d.inputDiv=Ze("div",[f],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=Ze("div",[Ze("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=Ze("div",[Ze("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=Ze("div",null,"CodeMirror-scrollbar-filler"),d.lineDiv=Ze("div"),d.selectionDiv=Ze("div",null,null,"position: relative; z-index: 1"),d.cursor=Ze("div","\u00a0","CodeMirror-cursor"),d.otherCursor=Ze("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"),d.measure=Ze("div",null,"CodeMirror-measure"),d.lineSpace=Ze("div",[d.measure,d.selectionDiv,d.lineDiv,d.cursor,d.otherCursor],null,"position: relative; outline: none"),d.mover=Ze("div",[Ze("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Ze("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=Ze("div",null,null,"position: absolute; height: "+Ie+"px; width: 1px;"),d.gutters=Ze("div",null,"CodeMirror-gutters"),d.lineGutter=null;var g=Ze("div",[d.sizer,d.heightForcer,d.gutters],null,"position: relative; min-height: 100%");return d.scroller=Ze("div",[g],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Ze("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.scroller],"CodeMirror"),c&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),a.appendChild?a.appendChild(d.wrapper):a(d.wrapper),n&&(f.style.width="0px"),e||(d.scroller.draggable=!0),j?(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"):c&&(d.scrollbarH.style.minWidth=d.scrollbarV.style.minWidth="18px"),d.viewOffset=d.lastSizeC=0,d.showingFrom=d.showingTo=b,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new Ke,d.draggingText=!1,d.cachedCharWidth=d.cachedTextHeight=null,d.measureLineCache=[],d.measureLineCachePos=0,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d}function y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,_(a,100),a.state.modeGen++,a.curOp&&Cb(a)}function z(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),H(a)),B(a),Cb(a),lb(a),setTimeout(function(){J(a.display,a.doc.height)},100)}function A(a){var b=ub(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/vb(a.display)-3);return function(e){return wd(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function B(a){var b=a.doc,c=A(a);b.iter(function(a){var b=c(a);b!=a.height&&ee(a,b)})}function C(a){var b=ad[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")}function D(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lb(a)}function E(a){F(a),Cb(a)}function F(a){var b=a.display.gutters,c=a.options.gutters;$e(b);for(var d=0;c.length>d;++d){var e=c[d],f=b.appendChild(Ze("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function G(a,b){if(0==b.height)return 0;for(var d,c=b.text.length,e=b;d=td(e);){var f=d.find();e=be(a,f.from.line),c+=f.from.ch-f.to.ch}for(e=b;d=ud(e);){var f=d.find();c-=e.text.length-f.from.ch,e=be(a,f.to.line),c+=e.text.length-f.to.ch}return c}function H(a){var b=a.display,c=a.doc;b.maxLine=be(c,c.first),b.maxLineLength=G(c,b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var d=G(c,a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function I(a){for(var b=!1,c=0;a.gutters.length>c;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function J(a,b){var c=b+eb(a);a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var d=Math.max(c,a.scroller.scrollHeight),e=a.scroller.scrollWidth>a.scroller.clientWidth,f=d>a.scroller.clientHeight;f?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=e?ff(a.measure)+"px":"0",a.scrollbarV.firstChild.style.height=d-a.scroller.clientHeight+a.scrollbarV.clientHeight+"px"):a.scrollbarV.style.display="",e?(a.scrollbarH.style.display="block",a.scrollbarH.style.right=f?ff(a.measure)+"px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="",e&&f?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=ff(a.measure)+"px"):a.scrollbarFiller.style.display="",k&&0===ff(a.measure)&&(a.scrollbarV.style.minWidth=a.scrollbarH.style.minHeight=l?"18px":"12px")}function K(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-db(a));var f=Math.ceil(d+e);return{from:ge(b,d),to:ge(b,f)}}function L(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=O(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;h.length>g;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function M(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=N(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(Ze("div",[Ze("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g),d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",!0}return!1}function N(a,b){return a.lineNumberFormatter(b+a.firstLineNumber)+""}function O(a){return bf(a.scroller).left-bf(a.sizer).left}function P(a,b,c){var d=a.display.showingFrom,e=a.display.showingTo,f=Q(a,b,c);return f&&(Fe(a,"update",a),(a.display.showingFrom!=d||a.display.showingTo!=e)&&Fe(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),X(a),J(a.display,a.doc.height),f}function Q(a,b,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)return e.showingFrom=e.showingTo=f.first,e.viewOffset=0,void 0;var g=K(e,f,d);if(!(0==b.length&&g.from>e.showingFrom&&g.to<e.showingTo)){M(a)&&(b=[{from:f.first,to:f.first+f.size}]);var h=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?h:"0";var i=1/0;if(a.options.lineNumbers)for(var j=0;b.length>j;++j)if(b[j].diff){i=b[j].from;break}var k=f.first+f.size,l=Math.max(g.from-a.options.viewportMargin,f.first),m=Math.min(k,g.to+a.options.viewportMargin);if(l>e.showingFrom&&20>l-e.showingFrom&&(l=Math.max(f.first,e.showingFrom)),e.showingTo>m&&20>e.showingTo-m&&(m=Math.min(k,e.showingTo)),v)for(l=fe(vd(f,be(f,l)));k>m&&wd(f,be(f,m));)++m;var n=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,k)}];if(n=n[0].from>=n[0].to?[]:S(n,b),v)for(var j=0;n.length>j;++j)for(var p,o=n[j];p=ud(be(f,o.to-1));){var q=p.find().from.line;if(!(q>o.from)){n.splice(j--,1);break}o.to=q}for(var r=0,j=0;n.length>j;++j){var o=n[j];l>o.from&&(o.from=l),o.to>m&&(o.to=m),o.from>=o.to?n.splice(j--,1):r+=o.to-o.from}if(r==m-l&&l==e.showingFrom&&m==e.showingTo)return R(a),void 0;n.sort(function(a,b){return a.from-b.from});var s=document.activeElement;.7*(m-l)>r&&(e.lineDiv.style.display="none"),U(a,l,m,n,i),e.lineDiv.style.display="",document.activeElement!=s&&s.offsetHeight&&s.focus();var t=l!=e.showingFrom||m!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;t&&(e.lastSizeC=e.wrapper.clientHeight),e.showingFrom=l,e.showingTo=m,_(a,100);for(var x,u=e.lineDiv.offsetTop,w=e.lineDiv.firstChild;w;w=w.nextSibling)if(w.lineObj){if(c){var y=w.offsetTop+w.offsetHeight;x=y-u,u=y}else{var z=bf(w);x=z.bottom-z.top}var A=w.lineObj.height-x;if(2>x&&(x=ub(e)),A>.001||-.001>A){ee(w.lineObj,x);var B=w.lineObj.widgets;if(B)for(var j=0;B.length>j;++j)B[j].height=B[j].node.offsetHeight}}return R(a),K(e,f,d).to>m&&Q(a,[],d),!0}}function R(a){var b=a.display.viewOffset=he(a,be(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function S(a,b){for(var c=0,d=b.length||0;d>c;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,i=a.length;i>h;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function T(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:O(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function U(a,b,c,d,f){function l(b){var c=b.nextSibling;return e&&p&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b),c}var g=T(a),h=a.display,i=a.options.lineNumbers;d.length||e&&a.display.currentWheelTarget||$e(h.lineDiv);var j=h.lineDiv,k=j.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){if(m&&m.to==n&&(m=d.shift()),wd(a.doc,b)){if(0!=b.height&&ee(b,0),b.widgets&&k.previousSibling)for(var c=0;b.widgets.length>c;++c)if(b.widgets[c].showIfHidden){var e=k.previousSibling;if(/pre/i.test(e.nodeName)){var h=Ze("div",null,null,"position: relative");e.parentNode.replaceChild(h,e),h.appendChild(e),e=h}var o=e.appendChild(Ze("div",[b.widgets[c].node],"CodeMirror-linewidget"));W(b.widgets[c],o,e,g)}}else if(m&&n>=m.from&&m.to>n){for(;k.lineObj!=b;)k=l(k);i&&n>=f&&k.lineNumber&&af(k.lineNumber,N(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var r,p=0,q=k;q&&20>p;++p,q=q.nextSibling)if(q.lineObj==b&&/div/i.test(q.nodeName)){r=q;break}var s=V(a,b,n,g,r);if(s!=r)j.insertBefore(s,k);else{for(;k!=r;)k=l(k);k=k.nextSibling}s.lineObj=b}++n});k;)k=l(k)}function V(a,b,d,e,f){var j,g=Nd(a,b),h=b.gutterMarkers,i=a.display;if(!(a.options.lineNumbers||h||b.bgClass||b.wrapClass||b.widgets))return g;if(f){f.alignable=null;for(var n,k=!0,l=0,m=f.firstChild;m;m=n)if(n=m.nextSibling,/\bCodeMirror-linewidget\b/.test(m.className)){for(var o=0,p=!0;b.widgets.length>o;++o){var q=b.widgets[o],r=!1;if(q.above||(r=p,p=!1),q.node==m.firstChild){W(q,m,f,e),++l,r&&f.insertBefore(g,m);break}}if(o==b.widgets.length){k=!1;break}}else f.removeChild(m);k&&l==b.widgets.length&&(j=f,f.className=b.wrapClass||"")}if(j||(j=Ze("div",null,b.wrapClass,"position: relative"),j.appendChild(g)),b.bgClass&&j.insertBefore(Ze("div",null,b.bgClass+" CodeMirror-linebackground"),j.firstChild),a.options.lineNumbers||h){var s=j.insertBefore(Ze("div",null,null,"position: absolute; left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px"),j.firstChild);if(a.options.fixedGutter&&(j.alignable||(j.alignable=[])).push(s),!a.options.lineNumbers||h&&h["CodeMirror-linenumbers"]||(j.lineNumber=s.appendChild(Ze("div",N(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+i.lineNumInnerWidth+"px"))),h)for(var t=0;a.options.gutters.length>t;++t){var u=a.options.gutters[t],v=h.hasOwnProperty(u)&&h[u];v&&s.appendChild(Ze("div",[v],"CodeMirror-gutter-elt","left: "+e.gutterLeft[u]+"px; width: "+e.gutterWidth[u]+"px"))}}if(c&&(j.style.zIndex=2),b.widgets&&j!=f)for(var o=0,w=b.widgets;w.length>o;++o){var q=w[o],x=Ze("div",[q.node],"CodeMirror-linewidget");W(q,x,j,e),q.above?j.insertBefore(x,a.options.lineNumbers&&0!=b.height?s:g):j.appendChild(x),Fe(q,"redraw")}return j}function W(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function X(a){var b=a.display,c=tc(a.doc.sel.from,a.doc.sel.to);c||a.options.showCursorWhenSelecting?Y(a):b.cursor.style.display=b.otherCursor.style.display="none",c?b.selectionDiv.style.display="none":Z(a);var d=pb(a,a.doc.sel.head,"div"),e=bf(b.wrapper),f=bf(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-20,d.top+f.top-e.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,d.left+f.left-e.left))+"px"}function Y(a){var b=a.display,c=pb(a,a.doc.sel.head,"div");b.cursor.style.left=c.left+"px",b.cursor.style.top=c.top+"px",b.cursor.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px",b.cursor.style.display="",c.other?(b.otherCursor.style.display="",b.otherCursor.style.left=c.other.left+"px",b.otherCursor.style.top=c.other.top+"px",b.otherCursor.style.height=.85*(c.other.bottom-c.other.top)+"px"):b.otherCursor.style.display="none"}function Z(a){function h(a,b,c,d){0>b&&(b=0),e.appendChild(Ze("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?f-a:c)+"px; height: "+(d-b)+"px"))}function i(b,d,e,i){function m(c){return ob(a,sc(b,c),"div",j)}var j=be(c,b),k=j.text.length,l=i?1/0:-1/0;return nf(ie(j),d||0,null==e?k:e,function(a,b,c){var j=m("rtl"==c?b-1:a),n=m("rtl"==c?a:b-1),o=j.left,p=n.right;n.top-j.top>3&&(h(o,j.top,null,j.bottom),o=g,j.bottom<n.top&&h(o,j.bottom,null,n.top)),null==e&&b==k&&(p=f),null==d&&0==a&&(o=g),l=i?Math.min(n.top,l):Math.max(n.bottom,l),g+1>o&&(o=g),h(o,n.top,p-o,n.bottom)}),l}var b=a.display,c=a.doc,d=a.doc.sel,e=document.createDocumentFragment(),f=b.lineSpace.offsetWidth,g=fb(a.display);if(d.from.line==d.to.line)i(d.from.line,d.from.ch,d.to.ch);else{for(var l,n,j=be(c,d.from.line),k=j,m=[d.from.line,d.from.ch];l=ud(k);){var o=l.find();if(m.push(o.from.ch,o.to.line,o.to.ch),o.to.line==d.to.line){m.push(d.to.ch),n=!0;break}k=be(c,o.to.line)}if(n)for(var p=0;m.length>p;p+=3)i(m[p],m[p+1],m[p+2]);else{var q,r,s=be(c,d.to.line);q=d.from.ch?i(d.from.line,d.from.ch,null,!1):he(a,j)-b.viewOffset,r=d.to.ch?i(d.to.line,td(s)?null:0,d.to.ch,!0):he(a,s)-b.viewOffset,r>q&&h(g,q,null,r)}}_e(b.selectionDiv,e),b.selectionDiv.style.display=""}function $(a){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="",b.blinker=setInterval(function(){b.cursor.offsetHeight&&(b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden")},a.options.cursorBlinkRate)}function _(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,Ue(ab,a))}function ab(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.showingTo)){var f,c=+new Date+a.options.workTime,d=Zc(b.mode,cb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=Id(a,g,d);for(var i=!h||h.length!=g.styles.length,j=0;!i&&h.length>j;++j)i=h[j]!=g.styles[j];i&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1})),g.stateAfter=Zc(b.mode,d)}else Kd(a,g,d),g.stateAfter=0==b.frontier%5?Zc(b.mode,d):null;return++b.frontier,+new Date>c?(_(a,a.options.workDelay),!0):void 0}),e.length&&zb(a,function(){for(var a=0;e.length>a;++a)Cb(this,e[a].start,e[a].end)})()}}function bb(a,b){for(var c,d,e=a.doc,f=b,g=b-100;f>g;--f){if(e.first>=f)return e.first;var h=be(e,f-1);if(h.stateAfter)return f;var i=Le(h.text,null,a.options.tabSize);(null==d||c>i)&&(d=f-1,c=i)}return d}function cb(a,b){var c=a.doc,d=a.display;if(!c.mode.startState)return!0;var e=bb(a,b),f=e>c.first&&be(c,e-1).stateAfter;return f=f?Zc(c.mode,f):$c(c.mode),c.iter(e,b,function(g){Kd(a,g,f);var h=e==b-1||0==e%5||e>=d.showingFrom&&d.showingTo>e;g.stateAfter=h?Zc(c.mode,f):null,++e}),f}function db(a){return a.lineSpace.offsetTop}function eb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function fb(a){var b=_e(a.measure,Ze("pre",null,null,"text-align: left")).appendChild(Ze("span","x"));return b.offsetLeft}function gb(a,b,c,d){var e=-1;d=d||ib(a,b);for(var f=c;;f+=e){var g=d[f];if(g)break;0>e&&0==f&&(e=1)}return{left:c>f?g.right:g.left,right:f>c?g.left:g.right,top:g.top,bottom:g.bottom}}function hb(a,b){for(var c=a.display.measureLineCache,d=0;c.length>d;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return e.measure}}function ib(a,b){var c=hb(a,b);if(!c){c=jb(a,b);var d=a.display.measureLineCache,e={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:c,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++a.display.measureLineCachePos%16]=e:d.push(e)}return c}function jb(a,e){var f=a.display,g=Te(e.text.length),h=Nd(a,e,g);if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){for(var i=document.createDocumentFragment(),j=10,k=h.childNodes.length,l=0,m=Math.ceil(k/j);m>l;++l){for(var n=Ze("div",null,null,"display: inline-block"),o=0;j>o&&k;++o)n.appendChild(h.firstChild),--k;i.appendChild(n)}h.appendChild(i)}_e(f.measure,h);var p=bf(f.lineDiv),q=[],r=Te(e.text.length),s=h.offsetHeight;d&&f.measure.first!=h&&_e(f.measure,h);for(var t,l=0;g.length>l;++l)if(t=g[l]){for(var u=bf(t),v=Math.max(0,u.top-p.top),w=Math.min(u.bottom-p.top,s),o=0;q.length>o;o+=2){var x=q[o],y=q[o+1];if(!(x>w||v>y)&&(v>=x&&y>=w||x>=v&&w>=y||Math.min(w,y)-Math.max(v,x)>=w-v>>1)){q[o]=Math.min(v,x),q[o+1]=Math.max(w,y);break}}o==q.length&&q.push(v,w);var z=u.right;t.measureRight&&(z=bf(t.measureRight).left),r[l]={left:u.left-p.left,right:z-p.left,top:o}}for(var t,l=0;r.length>l;++l)if(t=r[l]){var A=t.top;t.top=q[A],t.bottom=q[A+1]}return r}function kb(a,b){var c=!1;if(b.markedSpans)for(var d=0;b.markedSpans>d;++d){var e=b.markedSpans[d];!e.collapsed||null!=e.to&&e.to!=b.text.length||(c=!0)}var f=!c&&hb(a,b);if(f)return gb(a,b,b.text.length,f).right;var g=Nd(a,b),h=g.appendChild(hf(a.display.measure));return _e(a.display.measure,g),bf(h).right-bf(a.display.lineDiv).left}function lb(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0,a.display.cachedCharWidth=a.display.cachedTextHeight=null,a.display.maxLineChanged=!0,a.display.lineNumChars=null}function mb(a,b,c,d){if(b.widgets)for(var e=0;b.widgets.length>e;++e)if(b.widgets[e].above){var f=Cd(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=he(a,b);if("local"!=d&&(g-=a.display.viewOffset),"page"==d){var h=bf(a.display.lineSpace);g+=h.top+(window.pageYOffset||(document.documentElement||document.body).scrollTop);var i=h.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft);c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function nb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;"page"==c&&(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,e-=window.pageYOffset||(document.documentElement||document.body).scrollTop);var f=bf(a.display.lineSpace);if(d-=f.left,e-=f.top,"local"==c||!c){var g=bf(a.display.wrapper);d-=g.left,e-=g.top}return{left:d,top:e}}function ob(a,b,c,d){return d||(d=be(a.doc,b.line)),mb(a,d,gb(a,d,b.ch),c)}function pb(a,b,c,d,e){function f(b,f){var g=gb(a,d,b,e);return f?g.left=g.right:g.right=g.left,mb(a,d,g,c)}d=d||be(a.doc,b.line),e||(e=ib(a,d));var g=ie(d),h=b.ch;if(!g)return f(h);for(var i,j,k=g[0].level,l=0;g.length>l;++l){var o,p,m=g[l],n=m.level%2;if(h>m.from&&m.to>h)return f(h,n);var q=n?m.to:m.from,r=n?m.from:m.to;if(q==h)p=l&&m.level<(o=g[l-1]).level?f(o.level%2?o.from:o.to-1,!0):f(n&&m.from!=m.to?h-1:h),n==k?i=p:j=p;else if(r==h){var o=g.length-1>l&&g[l+1];if(!n&&o&&o.from==o.to)continue;p=o&&m.level<o.level?f(o.level%2?o.to-1:o.from):f(n?h:h-1,!0),n==k?i=p:j=p}}return k&&!h&&(j=f(g[0].to-1)),i?(j&&(i.other=j),i):j}function qb(a,b,c){var d=new sc(a,b);return c&&(d.outside=!0),d}function rb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return qb(d.first,0,!0);var e=ge(d,c),f=d.first+d.size-1;if(e>f)return qb(d.first+d.size-1,be(d,f).text.length,!0);for(0>b&&(b=0);;){var g=be(d,e),h=sb(a,g,e,b,c),i=ud(g),j=i&&i.find();if(!(i&&h.ch>=j.from.ch))return h;e=j.to.line}}function sb(a,b,c,d,e){function j(d){var e=pb(a,sc(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:e.top>f?e.left+h:(g=!1,e.left)}var f=e-he(a,b),g=!1,h=2*a.display.wrapper.clientWidth,i=ib(a,b),k=ie(b),l=b.text.length,m=qf(b),n=rf(b),o=j(m),p=g,q=j(n),r=g;if(d>q)return qb(c,n,r);for(;;){if(k?n==m||n==uf(b,m,1):1>=n-m){for(var s=q-d>d-o,t=s?m:n;Ye.test(b.text.charAt(t));)++t;var u=qb(c,t,s?p:r);return u.after=s,u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=uf(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l-=v):(m=w,o=y,p=g,l=v)}}function ub(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==tb){tb=Ze("pre");for(var b=0;49>b;++b)tb.appendChild(document.createTextNode("x")),tb.appendChild(Ze("br"));tb.appendChild(document.createTextNode("x"))}_e(a.measure,tb);var c=tb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),$e(a.measure),c||1}function vb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Ze("span","x"),c=Ze("pre",[b]);_e(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function xb(a){a.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,updateScrollPos:!1,id:++wb},Ee++||(De=[])}function yb(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&H(a),d.maxLineChanged&&!a.options.lineWrapping){var e=kb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3+Ie)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);c.scrollLeft>f&&!b.updateScrollPos&&Tb(a,Math.min(d.scroller.scrollLeft,f),!0)}var g,h;if(b.updateScrollPos)g=b.updateScrollPos;else if(b.selectionChanged&&d.scroller.clientHeight){var i=pb(a,c.sel.head);g=Ic(a,i.left,i.top,i.left,i.bottom)}(b.changes.length||g&&null!=g.scrollTop)&&(h=P(a,b.changes,g&&g.scrollTop),a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)),!h&&b.selectionChanged&&X(a),b.updateScrollPos?(d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=g.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g.scrollLeft,L(a)):g&&Fc(a),b.selectionChanged&&$(a),a.state.focused&&b.updateInput&&Gb(a,b.userSelChange);var j=b.maybeHiddenMarkers,k=b.maybeUnhiddenMarkers;if(j)for(var l=0;j.length>l;++l)j[l].lines.length||Ce(j[l],"hide");if(k)for(var l=0;k.length>l;++l)k[l].lines.length&&Ce(k[l],"unhide");var m;if(--Ee||(m=De,De=null),b.textChanged&&Ce(a,"change",a,b.textChanged),b.selectionChanged&&Ce(a,"cursorActivity",a),m)for(var l=0;m.length>l;++l)m[l]()}function zb(a,b){return function(){var c=a||this,d=!c.curOp;d&&xb(c);try{var e=b.apply(c,arguments)}finally{d&&yb(c)}return e}}function Ab(a){return function(){var c,b=this.cm&&!this.cm.curOp;b&&xb(this.cm);try{c=a.apply(this,arguments)}finally{b&&yb(this.cm)}return c}}function Bb(a,b){var d,c=!a.curOp;c&&xb(a);try{d=b()}finally{c&&yb(a)}return d}function Cb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),a.curOp.changes.push({from:b,to:c,diff:d})}function Db(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Fb(a),a.state.focused&&Db(a)})}function Eb(a){function c(){var d=Fb(a);d||b?(a.display.pollingFast=!1,Db(a)):(b=!0,a.display.poll.set(60,c))}var b=!1;a.display.pollingFast=!0,a.display.poll.set(20,c)}function Fb(a){var c=a.display.input,d=a.display.prevInput,e=a.doc,f=e.sel;if(!a.state.focused||kf(c)||Ib(a))return!1;var g=c.value;if(g==d&&tc(f.from,f.to))return!1;if(b&&g&&0===c.selectionStart)return Gb(a,!0),!1;var h=!a.curOp;h&&xb(a),f.shift=!1;for(var i=0,j=Math.min(d.length,g.length);j>i&&d[i]==g[i];)++i;var k=f.from,l=f.to;d.length>i?k=sc(k.line,k.ch-(d.length-i)):a.state.overwrite&&tc(k,l)&&!a.state.pasteIncoming&&(l=sc(l.line,Math.min(be(e,l.line).text.length,l.ch+(g.length-i))));var m=a.curOp.updateInput;return lc(a.doc,{from:k,to:l,text:jf(g.slice(i)),origin:a.state.pasteIncoming?"paste":"+input"},"end"),a.curOp.updateInput=m,g.length>1e3||g.indexOf("\n")>-1?c.value=a.display.prevInput="":a.display.prevInput=g,h&&yb(a),a.state.pasteIncoming=!1,!0}function Gb(a,b){var c,d,e=a.doc;tc(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value=""):(a.display.prevInput="",c=lf&&(e.sel.to.line-e.sel.from.line>100||(d=a.getSelection()).length>1e3),a.display.input.value=c?"-":d||a.getSelection(),a.state.focused&&Pe(a.display.input)),a.display.inaccurateSelection=c}function Hb(a){"nocursor"==a.options.readOnly||o&&document.activeElement==a.display.input||a.display.input.focus()}function Ib(a){return a.options.readOnly||a.doc.cantEdit}function Jb(a){function c(){a.state.focused&&setTimeout(Ue(Hb,a),0)}function d(){b.cachedCharWidth=b.cachedTextHeight=null,lb(a),Bb(a,Ue(Cb,a))}function e(){for(var a=b.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(e,5e3):Be(window,"resize",d)}function f(b){a.options.onDragEvent&&a.options.onDragEvent(a,ue(b))||xe(b)}function g(){b.inaccurateSelection&&(b.prevInput="",b.inaccurateSelection=!1,b.input.value=a.getSelection(),Pe(b.input))}var b=a.display;Ae(b.scroller,"mousedown",zb(a,Ob)),Ae(b.scroller,"dblclick",zb(a,ve)),Ae(b.lineSpace,"selectstart",function(a){Kb(b,a)||ve(a)}),t||Ae(b.scroller,"contextmenu",function(b){gc(a,b)}),Ae(b.scroller,"scroll",function(){b.scroller.clientHeight&&(Sb(a,b.scroller.scrollTop),Tb(a,b.scroller.scrollLeft,!0),Ce(a,"scroll",a))}),Ae(b.scrollbarV,"scroll",function(){b.scroller.clientHeight&&Sb(a,b.scrollbarV.scrollTop)}),Ae(b.scrollbarH,"scroll",function(){b.scroller.clientHeight&&Tb(a,b.scrollbarH.scrollLeft)}),Ae(b.scroller,"mousewheel",function(b){Wb(a,b)}),Ae(b.scroller,"DOMMouseScroll",function(b){Wb(a,b)}),Ae(b.scrollbarH,"mousedown",c),Ae(b.scrollbarV,"mousedown",c),Ae(b.wrapper,"scroll",function(){b.wrapper.scrollTop=b.wrapper.scrollLeft=0}),Ae(window,"resize",d),setTimeout(e,5e3),Ae(b.input,"keyup",zb(a,function(b){a.options.onKeyEvent&&a.options.onKeyEvent(a,ue(b))||16==b.keyCode&&(a.doc.sel.shift=!1)})),Ae(b.input,"input",Ue(Eb,a)),Ae(b.input,"keydown",zb(a,bc)),Ae(b.input,"keypress",zb(a,cc)),Ae(b.input,"focus",Ue(dc,a)),Ae(b.input,"blur",Ue(ec,a)),a.options.dragDrop&&(Ae(b.scroller,"dragstart",function(b){Rb(a,b)}),Ae(b.scroller,"dragenter",f),Ae(b.scroller,"dragover",f),Ae(b.scroller,"drop",zb(a,Pb))),Ae(b.scroller,"paste",function(c){Kb(b,c)||(Hb(a),Eb(a))}),Ae(b.input,"paste",function(){a.state.pasteIncoming=!0,Eb(a)}),Ae(b.input,"cut",g),Ae(b.input,"copy",g),j&&Ae(b.sizer,"mouseup",function(){document.activeElement==b.input&&b.input.blur(),Hb(a)})}function Kb(a,b){for(var c=ye(b);c!=a.wrapper;c=c.parentNode){if(!c)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(c.className)||c.parentNode==a.sizer&&c!=a.mover)return!0}}function Lb(a,b,c){var d=a.display;if(!c){var e=ye(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller)return null}var f,g,h=bf(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return rb(a,f-h.left,g-h.top)}function Ob(a){function p(a){if("single"==j)return Ac(c.doc,xc(f,h),a),void 0;if(n=xc(f,n),o=xc(f,o),"double"==j){var b=Pc(be(f,a.line).text,a);uc(a,n)?Ac(c.doc,b.from,o):Ac(c.doc,n,b.to)}else"triple"==j&&(uc(a,n)?Ac(c.doc,o,xc(f,sc(a.line,0))):Ac(c.doc,n,xc(f,sc(a.line+1,0))))}function s(a){var b=++r,e=Lb(c,a,!0);if(e)if(tc(e,l)){var h=a.clientY<q.top?-20:a.clientY>q.bottom?20:0;h&&setTimeout(zb(c,function(){r==b&&(d.scroller.scrollTop+=h,s(a))}),50)}else{c.state.focused||dc(c),l=e,p(e);var g=K(d,f);(e.line>=g.to||e.line<g.from)&&setTimeout(zb(c,function(){r==b&&s(a)}),150)}}function u(a){r=1/0;var b=Lb(c,a);b&&p(b),ve(a),Hb(c),Be(document,"mousemove",v),Be(document,"mouseup",w)}var c=this,d=c.display,f=c.doc,g=f.sel;if(g.shift=a.shiftKey,Kb(d,a))return e||(d.scroller.draggable=!1,setTimeout(function(){d.scroller.draggable=!0},100)),void 0;if(!Qb(c,a)){var h=Lb(c,a);switch(ze(a)){case 3:return t&&gc.call(c,c,a),void 0;case 2:return h&&Ac(c.doc,h),setTimeout(Ue(Hb,c),20),ve(a),void 0}if(!h)return ye(a)==d.scroller&&ve(a),void 0;c.state.focused||dc(c);var i=+new Date,j="single";if(Nb&&Nb.time>i-400&&tc(Nb.pos,h))j="triple",ve(a),setTimeout(Ue(Hb,c),20),Qc(c,h.line);else if(Mb&&Mb.time>i-400&&tc(Mb.pos,h)){j="double",Nb={time:i,pos:h},ve(a);var k=Pc(be(f,h.line).text,h);Ac(c.doc,k.from,k.to)}else Mb={time:i,pos:h};var l=h;if(c.options.dragDrop&&cf&&!Ib(c)&&!tc(g.from,g.to)&&!uc(h,g.from)&&!uc(g.to,h)&&"single"==j){var m=zb(c,function(b){e&&(d.scroller.draggable=!1),c.state.draggingText=!1,Be(document,"mouseup",m),Be(d.scroller,"drop",m),10>Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)&&(ve(b),Ac(c.doc,h),Hb(c))});return e&&(d.scroller.draggable=!0),c.state.draggingText=m,d.scroller.dragDrop&&d.scroller.dragDrop(),Ae(document,"mouseup",m),Ae(d.scroller,"drop",m),void 0}ve(a),"single"==j&&Ac(c.doc,xc(f,h));var n=g.from,o=g.to,q=bf(d.wrapper),r=0,v=zb(c,function(a){b||ze(a)?s(a):u(a)}),w=zb(c,u);Ae(document,"mousemove",v),Ae(document,"mouseup",w)}}function Pb(a){var b=this;if(!(Kb(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,ue(a)))){ve(a);var c=Lb(b,a,!0),d=a.dataTransfer.files;if(c&&!Ib(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result,++g==e&&(c=xc(b.doc,c),lc(b.doc,{from:c,to:c,text:jf(f.join("\n")),origin:"paste"},"around"))},h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&!uc(c,b.doc.sel.from)&&!uc(b.doc.sel.to,c))return b.state.draggingText(a),setTimeout(Ue(Hb,b),20),void 0;try{var f=a.dataTransfer.getData("Text");if(f){var j=b.doc.sel.from,k=b.doc.sel.to;Cc(b.doc,c,c),b.state.draggingText&&rc(b.doc,"",j,k,"paste"),b.replaceSelection(f,null,"paste"),Hb(b),dc(b)}}catch(a){}}}}function Qb(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(b){return!1}if(d>=Math.floor(bf(c.gutters).right))return!1;if(ve(b),!He(a,"gutterClick"))return!0;var f=bf(c.lineDiv);if(e>f.bottom)return!0;e-=f.top-c.viewOffset;for(var g=0;a.options.gutters.length>g;++g){var h=c.gutters.childNodes[g];if(h&&bf(h).right>=d){var i=ge(a.doc,e),j=a.options.gutters[g];Fe(a,"gutterClick",a,i,j,b);break}}return!0}function Rb(a,b){if(!Kb(a.display,b)){var c=a.getSelection();if(b.dataTransfer.setData("Text",c),b.dataTransfer.setDragImage){var d=Ze("img",null,null,"position: fixed; left: 0; top: 0;");h&&(d.width=d.height=1,a.display.wrapper.appendChild(d),d._top=d.offsetTop),i&&(a.display.dragImg?d=a.display.dragImg:(a.display.dragImg=d,d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.display.wrapper.appendChild(d))),b.dataTransfer.setDragImage(d,0,0),h&&d.parentNode.removeChild(d)
}}}function Sb(b,c){2>Math.abs(b.doc.scrollTop-c)||(b.doc.scrollTop=c,a||P(b,[],c),b.display.scroller.scrollTop!=c&&(b.display.scroller.scrollTop=c),b.display.scrollbarV.scrollTop!=c&&(b.display.scrollbarV.scrollTop=c),a&&P(b,[]))}function Tb(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,L(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function Wb(b,c){var d=c.wheelDeltaX,f=c.wheelDeltaY;null==d&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),null==f&&c.detail&&c.axis==c.VERTICAL_AXIS?f=c.detail:null==f&&(f=c.wheelDelta);var g=b.display,i=g.scroller;if(d&&i.scrollWidth>i.clientWidth||f&&i.scrollHeight>i.clientHeight){if(f&&p&&e)for(var j=c.target;j!=i;j=j.parentNode)if(j.lineObj){b.display.currentWheelTarget=j;break}if(d&&!a&&!h&&null!=Vb)return f&&Sb(b,Math.max(0,Math.min(i.scrollTop+f*Vb,i.scrollHeight-i.clientHeight))),Tb(b,Math.max(0,Math.min(i.scrollLeft+d*Vb,i.scrollWidth-i.clientWidth))),ve(c),g.wheelStartX=null,void 0;if(f&&null!=Vb){var k=f*Vb,l=b.doc.scrollTop,m=l+g.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(b.doc.height,m+k+50),P(b,[],{top:l,bottom:m})}20>Ub&&(null==g.wheelStartX?(g.wheelStartX=i.scrollLeft,g.wheelStartY=i.scrollTop,g.wheelDX=d,g.wheelDY=f,setTimeout(function(){if(null!=g.wheelStartX){var a=i.scrollLeft-g.wheelStartX,b=i.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null,c&&(Vb=(Vb*Ub+c)/(Ub+1),++Ub)}},200)):(g.wheelDX+=d,g.wheelDY+=f))}}function Xb(a,b,c){if("string"==typeof b&&(b=_c[b],!b))return!1;a.display.pollingFast&&Fb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Ib(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Je}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function Yb(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function $b(a,b){var c=bd(a.options.keyMap),e=c.auto;clearTimeout(Zb),e&&!dd(b)&&(Zb=setTimeout(function(){bd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e)},50));var f=ed(b,!0),g=!1;if(!f)return!1;var h=Yb(a);return g=b.shiftKey?cd("Shift-"+f,h,function(b){return Xb(a,b,!0)})||cd(f,h,function(b){return"string"==typeof b&&/^go[A-Z]/.test(b)?Xb(a,b):void 0}):cd(f,h,function(b){return Xb(a,b)}),"stop"==g&&(g=!1),g&&(ve(b),$(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0)),g}function _b(a,b,c){var d=cd("'"+c+"'",Yb(a),function(b){return Xb(a,b,!0)});return d&&(ve(b),$(a)),d}function bc(a){var c=this;if(c.state.focused||dc(c),b&&27==a.keyCode&&(a.returnValue=!1),!c.options.onKeyEvent||!c.options.onKeyEvent(c,ue(a))){var d=a.keyCode;c.doc.sel.shift=16==d||a.shiftKey;var e=$b(c,a);h&&(ac=e?d:null,!e&&88==d&&!lf&&(p?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}}function cc(a){var b=this;if(!b.options.onKeyEvent||!b.options.onKeyEvent(b,ue(a))){var c=a.keyCode,d=a.charCode;if(h&&c==ac)return ac=null,ve(a),void 0;if(!(h&&(!a.which||10>a.which)||j)||!$b(b,a)){var e=String.fromCharCode(null==d?c:d);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Ib(this)&&this.doc.mode.electricChars.indexOf(e)>-1&&setTimeout(zb(b,function(){Lc(b,b.doc.sel.to.line,"smart")}),75),_b(b,a,e)||Eb(b)}}}function dc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Ce(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),Gb(a,!0)),Db(a),$(a))}function ec(a){a.state.focused&&(Ce(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function gc(a,c){function k(){if(e.inputDiv.style.position="relative",e.input.style.cssText=j,d&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=i),Db(a),null!=e.input.selectionStart&&(!b||d)){clearTimeout(fc);var c=e.input.value=" "+(tc(f.from,f.to)?"":e.input.value),g=0;e.prevInput=" ",e.input.selectionStart=1,e.input.selectionEnd=c.length;var h=function(){" "==e.prevInput&&0==e.input.selectionStart?zb(a,_c.selectAll)(a):10>g++?fc=setTimeout(h,500):Gb(a)};fc=setTimeout(h,200)}}var e=a.display,f=a.doc.sel;if(!Kb(e,c)){var g=Lb(a,c),i=e.scroller.scrollTop;if(g&&!h){(tc(f.from,f.to)||uc(g,f.from)||!uc(g,f.to))&&zb(a,Cc)(a.doc,g,g);var j=e.input.style.cssText;if(e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c.clientY-5)+"px; left: "+(c.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Hb(a),Gb(a,!0),tc(f.from,f.to)&&(e.input.value=e.prevInput=" "),t){xe(c);var l=function(){Be(window,"mouseup",l),setTimeout(k,20)};Ae(window,"mouseup",l)}else setTimeout(k,50)}}}function hc(a){return a.text?sc(a.from.line+a.text.length-1,Oe(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function ic(a,b,c){if(!uc(b.from,c))return xc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?sc(f,be(a,f).text.length):yc(c,be(a,e).text.length)}if(c.line==b.to.line+d)return yc(c,Oe(b.text).length+(1==b.text.length?b.from.ch:0)+be(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return yc(c,b.text[g].length+(g?0:b.from.ch))}function jc(a,b,c){if(c&&"object"==typeof c)return{anchor:ic(a,b,c.anchor),head:ic(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=hc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};var e=function(a){if(uc(a,b.from))return a;if(!uc(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),sc(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function kc(a,b){var c={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,update:function(b,c,d,e){b&&(this.from=xc(a,b)),c&&(this.to=xc(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)},cancel:function(){this.canceled=!0}};return Ce(a,"beforeChange",a,c),a.cm&&Ce(a.cm,"beforeChange",a.cm,c),c.canceled?null:{from:c.from,to:c.to,text:c.text,origin:c.origin}}function lc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return zb(a.cm,lc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(!(He(a,"beforeChange")||a.cm&&He(a.cm,"beforeChange"))||(b=kc(a,b))){var e=u&&!d&&rd(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)mc(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&mc(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else mc(a,b,c)}}function mc(a,b,c){var d=jc(a,b,c);me(a,b,d,a.cm?a.cm.curOp.id:0/0),pc(a,b,d,pd(a,b));var e=[];_d(a,function(a,c){c||-1!=Qe(e,a.history)||(se(a.history,b),e.push(a.history)),pc(a,b,null,pd(a,b))})}function nc(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){c.dirtyCounter+="undo"==b?-1:1;var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore};("undo"==b?c.undone:c.done).push(e);for(var f=d.changes.length-1;f>=0;--f){var g=d.changes[f];g.origin=b,e.changes.push(le(a,g));var h=f?jc(a,g,null):{anchor:d.anchorBefore,head:d.headBefore};pc(a,g,h,qd(a,g));var i=[];_d(a,function(a,b){b||-1!=Qe(i,a.history)||(se(a.history,g),i.push(a.history)),pc(a,g,null,qd(a,g))})}}}}function oc(a,b){function c(a){return sc(a.line+b,a.ch)}a.first+=b,a.cm&&Cb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function pc(a,b,c,d){if(a.cm&&!a.cm.curOp)return zb(a.cm,pc)(a,b,c,d);if(b.to.line<a.first)return oc(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);oc(a,e),b={from:sc(a.first,0),to:sc(b.to.line+e,b.to.ch),text:[Oe(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:sc(f,be(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=ce(a,b.from,b.to),c||(c=jc(a,b,null)),a.cm?qc(a.cm,b,d,c):Ud(a,b,d,c)}}function qc(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=fe(vd(e,be(e,g.line))),e.iter(j,h.line+1,function(a){return a==f.maxLine?(i=!0,!0):void 0})),Ud(e,b,c,d,A(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=G(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),_(a,400);var k=b.text.length-(h.line-g.line)-1;if(Cb(a,g.line,h.line+1,k),He(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function rc(a,b,c,d,e){if(d||(d=c),uc(d,c)){var f=d;d=c,c=f}"string"==typeof b&&(b=jf(b)),lc(a,{from:c,to:d,text:b,origin:e},null)}function sc(a,b){return this instanceof sc?(this.line=a,this.ch=b,void 0):new sc(a,b)}function tc(a,b){return a.line==b.line&&a.ch==b.ch}function uc(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function vc(a){return sc(a.line,a.ch)}function wc(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function xc(a,b){if(b.line<a.first)return sc(a.first,0);var c=a.first+a.size-1;return b.line>c?sc(c,be(a,c).text.length):yc(b,be(a,b.line).text.length)}function yc(a,b){var c=a.ch;return null==c||c>b?sc(a.line,b):0>c?sc(a.line,0):a}function zc(a,b){return b>=a.first&&a.first+a.size>b}function Ac(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=uc(b,e);f!=uc(c,e)?(e=b,b=c):f!=uc(b,c)&&(b=c)}Cc(a,e,b,d)}else Cc(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Bc(a,b,c){var d={anchor:b,head:c};return Ce(a,"beforeSelectionChange",a,d),a.cm&&Ce(a.cm,"beforeSelectionChange",a.cm,d),d.anchor=xc(a,d.anchor),d.head=xc(a,d.head),d}function Cc(a,b,c,d,e){if(!e&&He(a,"beforeSelectionChange")||a.cm&&He(a.cm,"beforeSelectionChange")){var f=Bc(a,b,c);c=f.head,b=f.anchor}var g=a.sel;if(g.goalColumn=null,(e||!tc(b,g.anchor))&&(b=Ec(a,b,d,"push"!=e)),(e||!tc(c,g.head))&&(c=Ec(a,c,d,"push"!=e)),!tc(g.anchor,b)||!tc(g.head,c)){g.anchor=b,g.head=c;var h=uc(c,b);g.from=h?c:b,g.to=h?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0),Fe(a,"cursorActivity",a)}}function Dc(a){Cc(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Ec(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=be(a,f.line);if(h.markedSpans)for(var i=0;h.markedSpans.length>i;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(Ce(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find()[0>g?"from":"to"];if(tc(l,f)&&(l.ch+=g,0>l.ch?l=l.line>a.first?xc(a,sc(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?sc(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,sc(a.first,0)):Ec(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Fc(a){var b=Gc(a,a.doc.sel.head);if(a.state.focused){var c=a.display,d=bf(c.sizer),e=null,f=db(a.display);if(0>b.top+f+d.top?e=!0:b.bottom+f+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!m){var g="none"==c.cursor.style.display;g&&(c.cursor.style.display="",c.cursor.style.left=b.left+"px",c.cursor.style.top=b.top-c.viewOffset+"px"),c.cursor.scrollIntoView(e),g&&(c.cursor.style.display="none")}}}function Gc(a,b,c){for(null==c&&(c=0);;){var d=!1,e=pb(a,b),f=Ic(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;if(null!=f.scrollTop&&(Sb(a,f.scrollTop),Math.abs(a.doc.scrollTop-g)>1&&(d=!0)),null!=f.scrollLeft&&(Tb(a,f.scrollLeft),Math.abs(a.doc.scrollLeft-h)>1&&(d=!0)),!d)return e}}function Hc(a,b,c,d,e){var f=Ic(a,b,c,d,e);null!=f.scrollTop&&Sb(a,f.scrollTop),null!=f.scrollLeft&&Tb(a,f.scrollLeft)}function Ic(a,b,c,d,e){var f=a.display,g=db(f);c+=g,e+=g;var h=f.scroller.clientHeight-Ie,i=f.scroller.scrollTop,j={},k=a.doc.height+eb(f),l=g+10>c,m=e+g>k-10;i>c?j.scrollTop=l?0:Math.max(0,c):e>i+h&&(j.scrollTop=(m?k:e)-h);var n=f.scroller.clientWidth-Ie,o=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var p=f.gutters.offsetWidth,q=p+10>b;return o+p>b||q?(q&&(b=0),j.scrollLeft=Math.max(0,b-10-p)):d>n+o-3&&(j.scrollLeft=d+10-n),j}function Jc(a,b,c){a.curOp.updateScrollPos={scrollLeft:b,scrollTop:c}}function Kc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function Lc(a,b,c,d){var e=a.doc;if(c||(c="add"),"smart"==c)if(a.doc.mode.indent)var f=cb(a,b);else c="prev";var k,g=a.options.tabSize,h=be(e,b),i=Le(h.text,null,g),j=h.text.match(/^\s*/)[0];if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==Je)){if(!d)return;c="prev"}"prev"==c?k=b>e.first?Le(be(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c&&(k=i-a.options.indentUnit),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";k>m&&(l+=Ne(k-m)),l!=j&&rc(a.doc,l,sc(b,0),sc(b,j.length),"+input"),h.stateAfter=null}function Mc(a,b,c){var d=b,e=b,f=a.doc;return"number"==typeof b?e=be(f,wc(f,b)):d=fe(b),null==d?null:c(e,d)?(Cb(a,d,d+1),e):null}function Nc(a,b,c,d,e){function j(){var b=f+c;return a.first>b||b>=a.first+a.size?i=!1:(f=b,h=be(a,b))}function k(a){var b=(e?uf:vf)(h,g,c,!0);if(null==b){if(a||!j())return i=!1;g=e?(0>c?rf:qf)(h):0>c?h.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=be(a,f),i=!0;if("char"==d)k();else if("column"==d)k(!0);else if("word"==d||"group"==d)for(var l=null,m="group"==d,n=!0;!(0>c)||k(!n);n=!1){var o=h.text.charAt(g)||"\n",p=We(o)?"w":m?/\s/.test(o)?null:"p":null;if(l&&l!=p){0>c&&(c=1,k());break}if(p&&(l=p),c>0&&!k(!n))break}var q=Ec(a,sc(f,g),c,!0);return i||(q.hitSide=!0),q}function Oc(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*ub(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=rb(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Pc(a,b){var c=b.ch,d=b.ch;if(a){b.after===!1||d==a.length?--c:++d;for(var e=a.charAt(c),f=We(e)?We:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!We(a)};c>0&&f(a.charAt(c-1));)--c;for(;a.length>d&&f(a.charAt(d));)++d}return{from:sc(b.line,c),to:sc(b.line,d)}}function Qc(a,b){Ac(a.doc,sc(b,0),xc(a.doc,sc(b+1,0)))}function Tc(a,b,c,d){w.defaults[a]=b,c&&(Rc[a]=d?function(a,b,d){d!=Uc&&c(a,b,d)}:c)}function Zc(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function $c(a,b,c){return a.startState?a.startState(b,c):!0}function bd(a){return"string"==typeof a?ad[a]:a}function cd(a,b,c){function d(b){b=bd(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0,h=f.length;h>g;++g){var i=d(f[g]);if(i)return i}return!1}for(var e=0;b.length>e;++e){var f=d(b[e]);if(f)return f}}function dd(a){var b=mf[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function ed(a,b){if(h&&34==a.keyCode&&a["char"])return!1;var c=mf[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),(s?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(s?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)}function fd(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0}function gd(a,b){this.lines=[],this.type=b,this.doc=a}function hd(a,b,c,d,e){if(d&&d.shared)return jd(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return zb(a.cm,hd)(a,b,c,d,e);var f=new gd(a,e);if("range"==e&&!uc(b,c))return f;d&&Se(d,f),f.replacedWith&&(f.collapsed=!0,f.replacedWith=Ze("span",[f.replacedWith],"CodeMirror-widget")),f.collapsed&&(v=!0),f.addToHistory&&me(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},0/0);var i,j,l,g=b.line,h=0,k=a.cm;if(a.iter(g,c.line+1,function(d){k&&f.collapsed&&!k.options.lineWrapping&&vd(a,d)==k.display.maxLine&&(l=!0);var e={from:null,to:null,marker:f};h+=d.text.length,g==b.line&&(e.from=b.ch,h-=b.ch),g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch),f.collapsed&&(g==c.line&&(j=sd(d,c.ch)),g==b.line?i=sd(d,b.ch):ee(d,0)),md(d,e),++g}),f.collapsed&&a.iter(b.line,c.line+1,function(b){wd(a,b)&&ee(b,0)}),f.clearOnEnter&&Ae(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(u=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed){if(i!=j)throw Error("Inserting collapsed marker overlapping an existing one");f.size=h,f.atomic=!0}return k&&(l&&(k.curOp.updateMaxLine=!0),(f.className||f.startStyle||f.endStyle||f.collapsed)&&Cb(k,b.line,c.line+1),f.atomic&&Dc(k)),f}function id(a,b){this.markers=a,this.primary=b;for(var c=0,d=this;a.length>c;++c)a[c].parent=this,Ae(a[c],"clear",function(){d.clear()})}function jd(a,b,c,d,e){d=Se(d),d.shared=!1;var f=[hd(a,b,c,d,e)],g=f[0],h=d.replacedWith;return _d(a,function(a){h&&(d.replacedWith=h.cloneNode(!0)),f.push(hd(a,xc(a,b),xc(a,c),d,e));for(var i=0;a.linked.length>i;++i)if(a.linked[i].isParent)return;g=Oe(f)}),new id(f,g)}function kd(a,b){if(a)for(var c=0;a.length>c;++c){var d=a[c];if(d.marker==b)return d}}function ld(a,b){for(var c,d=0;a.length>d;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function md(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function nd(a,b,c){if(a)for(var e,d=0;a.length>d;++d){var f=a[d],g=f.marker,h=null==f.from||(g.inclusiveLeft?b>=f.from:b>f.from);if(h||"bookmark"==g.type&&f.from==b&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function od(a,b,c){if(a)for(var e,d=0;a.length>d;++d){var f=a[d],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||"bookmark"==g.type&&f.from==b&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?b>=f.from:b>f.from);(e||(e=[])).push({from:i?null:f.from-b,to:null==f.to?null:f.to-b,marker:g})}}return e}function pd(a,b){var c=zc(a,b.from.line)&&be(a,b.from.line).markedSpans,d=zc(a,b.to.line)&&be(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=tc(b.from,b.to),h=nd(c,e,g),i=od(d,f,g),j=1==b.text.length,k=Oe(b.text).length+(j?e:0);if(h)for(var l=0;h.length>l;++l){var m=h[l];if(null==m.to){var n=kd(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;i.length>l;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=kd(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}var o=[h];if(!j){var q,p=b.text.length-2;if(p>0&&h)for(var l=0;h.length>l;++l)null==h[l].to&&(q||(q=[])).push({from:null,to:null,marker:h[l].marker});for(var l=0;p>l;++l)o.push(q);o.push(i)}return o}function qd(a,b){var c=oe(a,b),d=pd(a,b);if(!c)return d;if(!d)return c;for(var e=0;c.length>e;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;g.length>h;++h){for(var i=g[h],j=0;f.length>j;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function rd(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;a.markedSpans.length>b;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=Qe(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;d.length>f;++f)for(var g=d[f],h=g.find(),i=0;e.length>i;++i){var j=e[i];if(!uc(j.to,h.from)&&!uc(h.to,j.from)){var k=[i,1];(uc(j.from,h.from)||!g.inclusiveLeft&&tc(j.from,h.from))&&k.push({from:j.from,to:h.from}),(uc(h.to,j.to)||!g.inclusiveRight&&tc(j.to,h.to))&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function sd(a,b){var d,c=v&&a.markedSpans;if(c)for(var e,f=0;c.length>f;++f)e=c[f],e.marker.collapsed&&(null==e.from||b>e.from)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function td(a){return sd(a,-1)}function ud(a){return sd(a,a.text.length+1)}function vd(a,b){for(var c;c=td(b);)b=be(a,c.find().from.line);return b}function wd(a,b){var c=v&&b.markedSpans;if(c)for(var d,e=0;c.length>e;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(0==d.from&&d.marker.inclusiveLeft&&xd(a,b,d))return!0}}function xd(a,b,c){if(null==c.to){var d=c.marker.find().to,e=be(a,d.line);return xd(a,e,kd(e.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var f,g=0;b.markedSpans.length>g;++g)if(f=b.markedSpans[g],f.marker.collapsed&&f.from==c.to&&(f.marker.inclusiveLeft||c.marker.inclusiveRight)&&xd(a,b,f))return!0}function yd(a){var b=a.markedSpans;if(b){for(var c=0;b.length>c;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function zd(a,b){if(b){for(var c=0;b.length>c;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Bd(a){return function(){var b=!this.cm.curOp;b&&xb(this.cm);try{var c=a.apply(this,arguments)}finally{b&&yb(this.cm)}return c}}function Cd(a){return null!=a.height?a.height:(a.node.parentNode&&1==a.node.parentNode.nodeType||_e(a.cm.display.measure,Ze("div",[a.node],null,"position: relative")),a.height=a.node.offsetHeight)}function Dd(a,b,c,d){var e=new Ad(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),Mc(a,b,function(b){if((b.widgets||(b.widgets=[])).push(e),e.line=b,!wd(a.doc,b)||e.showIfHidden){var c=he(a,b)<a.display.scroller.scrollTop;ee(b,b.height+Cd(e)),c&&Kc(a,0,e.height)}return!0}),e}function Ed(a,b,c){var d={text:a};return zd(d,b),d.height=c?c(d):1,d}function Fd(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),yd(a),zd(a,c);var e=d?d(a):1;e!=a.height&&ee(a,e)}function Gd(a){a.parent=null,yd(a)}function Hd(a,b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var g="",h=null,i=new fd(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!i.eol();){var j=c.token(i,d);i.pos>5e3&&(f=!1,i.pos=Math.min(b.length,i.start+5e4),j=null);var k=i.current();i.start=i.pos,f&&h==j?g+=k:(g&&e(g,h),g=k,h=j)}g&&e(g,h)}function Id(a,b,c){var d=[a.state.modeGen];Hd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(var e=0;a.state.overlays.length>e;++e){var f=a.state.overlays[e],g=1;Hd(a,b.text,f.mode,!0,function(a,b){for(var c=g,e=a.length;e;){var h=d[g],i=h.length;e>=i?e-=i:(d.splice(g,1,h.slice(0,e),d[g+1],h.slice(e)),e=0),g+=2}if(b)if(f.opaque)d.splice(c,g-c,a,b),g=c+2;else for(;g>c;c+=2){var h=d[c+1];d[c+1]=h?h+" "+b:b}})}return d}function Jd(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Id(a,b,b.stateAfter=cb(a,fe(b)))),b.styles}function Kd(a,b,c){var d=a.doc.mode,e=new fd(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&5e3>=e.pos;)d.token(e,c),e.start=e.pos}function Md(a){return a?Ld[a]||(Ld[a]="cm-"+a.replace(/ +/g," cm-")):null}function Nd(a,c,d){for(var f,h,i,g=c,j=!0;f=td(g);)j=!1,g=be(a.doc,f.find().from.line),h||(h=g);var k={pre:Ze("pre"),col:0,pos:0,display:!d,measure:null,addedOne:!1,cm:a};g.textClass&&(k.pre.className=g.textClass);do{k.measure=g==c&&d,k.pos=0,k.addToken=k.measure?Qd:Pd,(b||e)&&a.getOption("lineWrapping")&&(k.addToken=Rd(k.addToken)),d&&i&&g!=c&&!k.addedOne&&(d[0]=k.pre.appendChild(hf(a.display.measure)),k.addedOne=!0);var l=Td(g,k,Jd(a,g));i=g==h,l&&(g=be(a.doc,l.to.line),j=!1)}while(l);d&&!k.addedOne&&(d[0]=k.pre.appendChild(j?Ze("span","\u00a0"):hf(a.display.measure))),k.pre.firstChild||wd(a.doc,c)||k.pre.appendChild(document.createTextNode("\u00a0"));var m;if(d&&b&&(m=ie(g))){var n=m.length-1;m[n].from==m[n].to&&--n;var o=m[n],p=m[n-1];if(o.from+1==o.to&&p&&o.level<p.level){var q=d[k.pos-1];q&&q.parentNode.insertBefore(q.measureRight=hf(a.display.measure),q.nextSibling)}}return Ce(a,"renderLine",a,c,k.pre),k.pre}function Pd(a,b,c,d,e){if(b){if(Od.test(b))for(var f=document.createDocumentFragment(),g=0;;){Od.lastIndex=g;var h=Od.exec(b),i=h?h.index-g:b.length-g;if(i&&(f.appendChild(document.createTextNode(b.slice(g,g+i))),a.col+=i),!h)break;if(g+=i+1," "==h[0]){var j=a.cm.options.tabSize,k=j-a.col%j;f.appendChild(Ze("span",Ne(k),"cm-tab")),a.col+=k}else{var l=Ze("span","\u2022","cm-invalidchar");l.title="\\u"+h[0].charCodeAt(0).toString(16),f.appendChild(l),a.col+=1}}else{a.col+=b.length;var f=document.createTextNode(b)}if(c||d||e||a.measure){var m=c||"";return d&&(m+=d),e&&(m+=e),a.pre.appendChild(Ze("span",[f],m))}a.pre.appendChild(f)}}function Qd(a,c,d,e,f){for(var g=a.cm.options.lineWrapping,h=0;c.length>h;++h){var i=c.charAt(h),j=0==h;i>="\ud800"&&"\udbff">i&&c.length-1>h?(i=c.slice(h,h+2),++h):h&&g&&df.test(c.slice(h-1,h+1))&&a.pre.appendChild(Ze("wbr"));var k=a.measure[a.pos]=Pd(a,i,d,j&&e,h==c.length-1&&f);b&&g&&" "==i&&h&&!/\s/.test(c.charAt(h-1))&&c.length-1>h&&!/\s/.test(c.charAt(h+1))&&(k.style.whiteSpace="normal"),a.pos+=i.length}c.length&&(a.addedOne=!0)}function Rd(a){function b(a){for(var b=" ",c=0;a.length-2>c;++c)b+=c%2?" ":"\u00a0";return b+=" "}return function(c,d,e,f,g){return a(c,d.replace(/ {3,}/,b),e,f,g)}}function Sd(a,b,c){c&&(a.display||(c=c.cloneNode(!0)),a.pre.appendChild(c),a.measure&&b&&(a.measure[a.pos]=c,a.addedOne=!0)),a.pos+=b}function Td(a,b,c){var d=a.markedSpans;if(d)for(var j,l,m,n,o,f=a.text,g=f.length,h=0,e=1,i="",k=0;;){if(k==h){l=m=n="",o=null,k=1/0;for(var p=null,q=0;d.length>q;++q){var r=d[q],s=r.marker;h>=r.from&&(null==r.to||r.to>h)?(null!=r.to&&k>r.to&&(k=r.to,m=""),s.className&&(l+=" "+s.className),s.startStyle&&r.from==h&&(n+=" "+s.startStyle),s.endStyle&&r.to==k&&(m+=" "+s.endStyle),s.collapsed&&(!o||o.marker.width<s.width)&&(o=r)):r.from>h&&k>r.from&&(k=r.from),"bookmark"==s.type&&r.from==h&&s.replacedWith&&(p=s.replacedWith)}if(o&&(o.from||0)==h&&(Sd(b,(null==o.to?g:o.to)-h,null!=o.from&&o.marker.replacedWith),null==o.to))return o.marker.find();p&&!o&&Sd(b,0,p)}if(h>=g)break;for(var t=Math.min(g,k);;){if(i){var u=h+i.length;if(!o){var v=u>t?i.slice(0,t-h):i;b.addToken(b,v,j?j+l:l,n,h+v.length==k?m:"")}if(u>=t){i=i.slice(t-h),h=t;break}h=u,n=""}i=c[e++],j=Md(c[e++])}}else for(var e=1;c.length>e;e+=2)b.addToken(b,c[e],Md(c[e+1]))}function Ud(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){Fd(a,c,d,e),Fe(a,"change",a,b)}var h=b.from,i=b.to,j=b.text,k=be(a,h.line),l=be(a,i.line),m=Oe(j),n=f(j.length-1),o=i.line-h.line;if(0==h.ch&&0==i.ch&&""==m){for(var p=0,q=j.length-1,r=[];q>p;++p)r.push(Ed(j[p],f(p),e));g(l,l.text,n),o&&a.remove(h.line,o),r.length&&a.insert(h.line,r)}else if(k==l)if(1==j.length)g(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{for(var r=[],p=1,q=j.length-1;q>p;++p)r.push(Ed(j[p],f(p),e));r.push(Ed(m+k.text.slice(i.ch),n,e)),g(k,k.text.slice(0,h.ch)+j[0],f(0)),a.insert(h.line+1,r)}else if(1==j.length)g(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),f(0)),a.remove(h.line+1,o);else{g(k,k.text.slice(0,h.ch)+j[0],f(0)),g(l,m+l.text.slice(i.ch),n);for(var p=1,q=j.length-1,r=[];q>p;++p)r.push(Ed(j[p],f(p),e));o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}Fe(a,"change",a,b),Cc(a,d.anchor,d.head,null,!0)}function Vd(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;c>b;++b)a[b].parent=this,d+=a[b].height;this.height=d}function Wd(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;e>d;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function _d(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;a.linked.length>g;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function ae(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b,b.cm=a,B(a),y(a),a.options.lineWrapping||H(a),a.options.mode=b.modeOption,Cb(a)}function be(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(e>b){a=d;break}b-=e}return a.lines[b]}function ce(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function de(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ee(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function fe(a){if(null==a.parent)return null;for(var b=a.parent,c=Qe(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function ge(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;e>d;++d){var f=a.children[d],g=f.height;if(g>b){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;e>d;++d){var h=a.lines[d],i=h.height;if(i>b)break;b-=i}return c+d}function he(a,b){b=vd(a.doc,b);for(var c=0,d=b.parent,e=0;d.lines.length>e;++e){var f=d.lines[e];if(f==b)break;c+=f.height}for(var g=d.parent;g;d=g,g=d.parent)for(var e=0;g.children.length>e;++e){var h=g.children[e];if(h==d)break;c+=h.height}return c}function ie(a){var b=a.order;return null==b&&(b=a.order=wf(a.text)),b}function je(){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function ke(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function le(a,b){var c={from:b.from,to:hc(b),text:ce(a,b.from,b.to)};return ke(a,c,b.from.line,b.to.line+1),_d(a,function(a){ke(a,c,b.from.line,b.to.line+1)},!0),c}function me(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=Oe(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastTime>f-600||"*"==b.origin.charAt(0)))){var h=Oe(g.changes);tc(b.from,b.to)&&tc(b.from,h.to)?h.to=hc(b):g.changes.push(le(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else{for(g={changes:[le(a,b)],anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift();0>e.dirtyCounter?e.dirtyCounter=0/0:e.dirtyCounter++}e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin}function ne(a){if(!a)return null;for(var c,b=0;a.length>b;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function oe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];b.text.length>d;++d)e.push(ne(c[d]));return e}function pe(a,b){for(var c=0,d=[];a.length>c;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(var h=0;f.length>h;++h){var j,i=f[h];if(g.push({from:i.from,to:i.to,text:i.text}),b)for(var k in i)(j=k.match(/^spans_(\d+)$/))&&Qe(b,Number(j[1]))>-1&&(Oe(g)[k]=i[k],delete i[k])}}return d}function qe(a,b,c,d){a.line>c?a.line+=d:a.line>b&&(a.line=b,a.ch=0)}function re(a,b,c,d){for(var e=0;a.length>e;++e){for(var f=a[e],g=!0,h=0;f.changes.length>h;++h){var i=f.changes[h];if(f.copied||(i.from=vc(i.from),i.to=vc(i.to)),i.from.line>c)i.from.line+=d,i.to.line+=d;else if(i.to.line>=b){g=!1;break}}f.copied||(f.anchorBefore=vc(f.anchorBefore),f.headBefore=vc(f.headBefore),f.anchorAfter=vc(f.anchorAfter),f.readAfter=vc(f.headAfter),f.copied=!0),g?(qe(f.anchorBefore),qe(f.headBefore),qe(f.anchorAfter),qe(f.headAfter)):(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;re(a.done,c,d,e),re(a.undone,c,d,e)}function te(){xe(this)}function ue(a){return a.stop||(a.stop=te),a}function ve(a){a.preventDefault?a.preventDefault():a.returnValue=!1
}function we(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function xe(a){ve(a),we(a)}function ye(a){return a.target||a.srcElement}function ze(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),p&&a.ctrlKey&&1==b&&(b=3),b}function Ae(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}}function Be(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;d.length>e;++e)if(d[e]==c){d.splice(e,1);break}}}function Ce(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;c.length>e;++e)c[e].apply(null,d)}function Fe(a,b){function e(a){return function(){a.apply(null,d)}}var c=a._handlers&&a._handlers[b];if(c){var d=Array.prototype.slice.call(arguments,2);De||(++Ee,De=[],setTimeout(Ge,0));for(var f=0;c.length>f;++f)De.push(e(c[f]))}}function Ge(){--Ee;var a=De;De=null;for(var b=0;a.length>b;++b)a[b]()}function He(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function Ke(){this.id=null}function Le(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;b>f;++f)" "==a.charAt(f)?g+=c-g%c:++g;return g}function Ne(a){for(;a>=Me.length;)Me.push(Oe(Me)+" ");return Me[a]}function Oe(a){return a[a.length-1]}function Pe(a){n?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function Qe(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}function Re(a,b){function c(){}c.prototype=a;var d=new c;return b&&Se(b,d),d}function Se(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function Te(a){for(var b=[],c=0;a>c;++c)b.push(void 0);return b}function Ue(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function We(a){return/\w/.test(a)||a>"\u0080"&&(a.toUpperCase()!=a.toLowerCase()||Ve.test(a))}function Xe(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Ze(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)af(e,b);else if(b)for(var f=0;b.length>f;++f)e.appendChild(b[f]);return e}function $e(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function _e(a,b){return $e(a).appendChild(b)}function af(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function bf(a){return a.getBoundingClientRect()}function ff(a){if(null!=ef)return ef;var b=Ze("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return _e(a,b),b.offsetWidth&&(ef=b.offsetHeight-b.clientHeight),ef||0}function hf(a){if(null==gf){var b=Ze("span","\u200b");_e(a,Ze("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(gf=1>=b.offsetWidth&&b.offsetHeight>2&&!c)}return gf?Ze("span","\u200b"):Ze("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}function nf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=0;a.length>e;++e){var f=a[e];(c>f.from&&f.to>b||b==c&&f.to==b)&&d(Math.max(f.from,b),Math.min(f.to,c),1==f.level?"rtl":"ltr")}}function of(a){return a.level%2?a.to:a.from}function pf(a){return a.level%2?a.from:a.to}function qf(a){var b=ie(a);return b?of(b[0]):0}function rf(a){var b=ie(a);return b?pf(Oe(b)):a.text.length}function sf(a,b){var c=be(a.doc,b),d=vd(a.doc,c);d!=c&&(b=fe(d));var e=ie(d),f=e?e[0].level%2?rf(d):qf(d):0;return sc(b,f)}function tf(a,b){for(var c,d;c=ud(d=be(a.doc,b));)b=c.find().to.line;var e=ie(d),f=e?e[0].level%2?qf(d):rf(d):d.text.length;return sc(b,f)}function uf(a,b,c,d){var e=ie(a);if(!e)return vf(a,b,c,d);for(var f=d?function(b,c){do b+=c;while(b>0&&Ye.test(a.text.charAt(b)));return b}:function(a,b){return a+b},g=e[0].level,h=0;e.length>h;++h){var i=e[h],j=i.level%2==g;if(b>i.from&&i.to>b||j&&(i.from==b||i.to==b))break}for(var k=f(b,i.level%2?-c:c);null!=k;)if(i.level%2==g){if(!(i.from>k||k>i.to))break;i=e[h+=c],k=i&&(c>0==i.level%2?f(i.to,-1):f(i.from,1))}else if(k==of(i))i=e[--h],k=i&&pf(i);else{if(k!=pf(i))break;i=e[++h],k=i&&of(i)}return 0>k||k>a.text.length?null:k}function vf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Ye.test(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||8>document.documentMode),d=b&&(null==document.documentMode||9>document.documentMode),e=/WebKit\//.test(navigator.userAgent),f=e&&/Qt\/\d+\.\d+/.test(navigator.userAgent),g=/Chrome\//.test(navigator.userAgent),h=/Opera\//.test(navigator.userAgent),i=/Apple Computer/.test(navigator.vendor),j=/KHTML\//.test(navigator.userAgent),k=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/windows/i.test(navigator.platform),r=h&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1]));var tb,Mb,Nb,s=p&&(f||h&&(null==r||12.11>r)),t=a||b&&!d,u=!1,v=!1,wb=0,Ub=0,Vb=null;b?Vb=-.53:a?Vb=15:g?Vb=-.7:i&&(Vb=-1/3);var Zb,fc,ac=null;w.Pos=sc,w.prototype={focus:function(){window.focus(),Hb(this),dc(this),Eb(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Rc.hasOwnProperty(a)&&zb(this,Rc[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;b.length>c;++c)if(("string"==typeof a?b[c].name:b[c])==a)return b.splice(c,1),!0},addOverlay:zb(null,function(a,b){var c=a.token?a:w.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++,Cb(this)}),removeOverlay:zb(null,function(a){for(var b=this.state.overlays,c=0;b.length>c;++c)if(b[c].modeSpec==a)return b.splice(c,1),this.state.modeGen++,Cb(this),void 0}),indentLine:zb(null,function(a,b,c){"string"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),zc(this.doc,a)&&Lc(this,a,b,c)}),indentSelection:zb(null,function(a){var b=this.doc.sel;if(tc(b.from,b.to))return Lc(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),d=b.from.line;c>=d;++d)Lc(this,d,a)}),getTokenAt:function(a){var b=this.doc;a=xc(b,a);for(var c=cb(this,a.line),d=this.doc.mode,e=be(b,a.line),f=new fd(e.text,this.options.tabSize);f.pos<a.ch&&!f.eol();){f.start=f.pos;var g=d.token(f,c)}return{start:f.start,end:f.pos,string:f.current(),className:g||null,type:g||null,state:c}},getStateAfter:function(a){var b=this.doc;return a=wc(b,null==a?b.first+b.size-1:a),cb(this,a+1)},cursorCoords:function(a,b){var c,d=this.doc.sel;return c=null==a?d.head:"object"==typeof a?xc(this.doc,a):a?d.from:d.to,pb(this,c,b||"page")},charCoords:function(a,b){return ob(this,xc(this.doc,a),b||"page")},coordsChar:function(a,b){return a=nb(this,a,b||"page"),rb(this,a.left,a.top)},defaultTextHeight:function(){return ub(this.display)},defaultCharWidth:function(){return vb(this.display)},setGutterMarker:zb(null,function(a,b,c){return Mc(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Xe(d)&&(a.gutterMarkers=null),!0})}),clearGutter:zb(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Cb(b,d,d+1),Xe(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:zb(null,function(a,b,c){return Mc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(RegExp("\\b"+c+"\\b").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:zb(null,function(a,b,c){return Mc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.replace(RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b"),"");if(f==e)return!1;a[d]=f||null}return!0})}),addLineWidget:zb(null,function(a,b,c){return Dd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!zc(this.doc,a))return null;var b=a;if(a=be(this.doc,a),!a)return null}else{var b=fe(a);if(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.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=pb(this,xc(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:i>=a.bottom+b.offsetHeight&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+db(f)+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Hc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:zb(null,bc),execCommand:function(a){return _c[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=xc(this.doc,a);b>f&&(g=Nc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:zb(null,function(a,b){var d,c=this.doc.sel;d=c.shift||c.extend||tc(c.from,c.to)?Nc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to,Ac(this.doc,d,d,a)}),deleteH:zb(null,function(a,b){var c=this.doc.sel;tc(c.from,c.to)?rc(this.doc,"",c.from,Nc(this.doc,c.head,a,b,!1),"+delete"):rc(this.doc,"",c.from,c.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=xc(this.doc,a);b>g;++g){var i=pb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Oc(this,i,e,c),h.hitSide)break}return h},moveV:zb(null,function(a,b){var c=this.doc.sel,d=pb(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=Oc(this,d,a,b);"page"==b&&Kc(this,0,ob(this,e,"div").top-d.top),Ac(this.doc,e,e,a),c.goalColumn=d.left}),toggleOverwrite:function(){(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},hasFocus:function(){return this.state.focused},scrollTo:zb(null,function(a,b){Jc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller,b=Ie;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:function(a,b){"number"==typeof a&&(a=sc(a,0)),a&&null==a.line?Hc(this,a.left,a.top-b,a.right,a.bottom+b):(a=a?xc(this.doc,a):this.doc.sel.head,Gc(this,a,b))},setSize:function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(a+"")?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a)),null!=b&&(this.display.wrapper.style.height=c(b)),this.refresh()},on:function(a,b){Ae(this,a,b)},off:function(a,b){Be(this,a,b)},operation:function(a){return Bb(this,a)},refresh:zb(null,function(){lb(this),Jc(this,this.doc.scrollLeft,this.doc.scrollTop),Cb(this)}),swapDoc:zb(null,function(a){var b=this.doc;return b.cm=null,ae(this,a),lb(this),Jc(this,a.scrollLeft,a.scrollTop),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}};var Rc=w.optionHandlers={},Sc=w.defaults={},Uc=w.Init={toString:function(){return"CodeMirror.Init"}};Tc("value","",function(a,b){a.setValue(b)},!0),Tc("mode",null,function(a,b){a.doc.modeOption=b,y(a)},!0),Tc("indentUnit",2,y,!0),Tc("indentWithTabs",!1),Tc("smartIndent",!0),Tc("tabSize",4,function(a){y(a),lb(a),Cb(a)},!0),Tc("electricChars",!0),Tc("rtlMoveVisually",!q),Tc("theme","default",function(a){D(a),E(a)},!0),Tc("keyMap","default",C),Tc("extraKeys",null),Tc("onKeyEvent",null),Tc("onDragEvent",null),Tc("lineWrapping",!1,z,!0),Tc("gutters",[],function(a){I(a.options),E(a)},!0),Tc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?O(a.display)+"px":"0",a.refresh()},!0),Tc("lineNumbers",!1,function(a){I(a.options),E(a)},!0),Tc("firstLineNumber",1,E,!0),Tc("lineNumberFormatter",function(a){return a},E,!0),Tc("showCursorWhenSelecting",!1,X,!0),Tc("readOnly",!1,function(a,b){"nocursor"==b?(ec(a),a.display.input.blur()):b||Gb(a,!0)}),Tc("dragDrop",!0),Tc("cursorBlinkRate",530),Tc("cursorHeight",1),Tc("workTime",100),Tc("workDelay",100),Tc("flattenSpans",!0),Tc("pollInterval",100),Tc("undoDepth",40,function(a,b){a.doc.history.undoDepth=b}),Tc("viewportMargin",10,function(a){a.refresh()},!0),Tc("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),Tc("autofocus",null);var Vc=w.modes={},Wc=w.mimeModes={};w.defineMode=function(a,b){if(w.defaults.mode||"null"==a||(w.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;arguments.length>c;++c)b.dependencies.push(arguments[c])}Vc[a]=b},w.defineMIME=function(a,b){Wc[a]=b},w.resolveMode=function(a){if("string"==typeof a&&Wc.hasOwnProperty(a))a=Wc[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return w.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}},w.getMode=function(a,b){b=w.resolveMode(b);var c=Vc[b.name];if(!c)return w.getMode(a,"text/plain");var d=c(a,b);if(Xc.hasOwnProperty(b.name)){var e=Xc[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}return d.name=b.name,d},w.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),w.defineMIME("text/plain","null");var Xc=w.modeExtensions={};w.extendMode=function(a,b){var c=Xc.hasOwnProperty(a)?Xc[a]:Xc[a]={};Se(b,c)},w.defineExtension=function(a,b){w.prototype[a]=b},w.defineOption=Tc;var Yc=[];w.defineInitHook=function(a){Yc.push(a)},w.copyState=Zc,w.startState=$c,w.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);b=c.state,a=c.mode}return c||{mode:a,state:b}};var _c=w.commands={selectAll:function(a){a.setSelection(sc(a.firstLine(),0),sc(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!tc(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:sc(b.line),"+delete"):a.replaceRange("",b,sc(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",sc(b,0),sc(b),"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(sc(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(sc(a.lastLine()))},goLineStart:function(a){a.extendSelection(sf(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=sf(a,b.line),d=a.getLineHandle(c.line),e=ie(d);if(e&&0!=e[0].level)a.extendSelection(c);else{var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&f>=b.ch&&b.ch;a.extendSelection(sc(c.line,g?0:f))}},goLineEnd:function(a){a.extendSelection(tf(a,a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},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(" ","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection(" ","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),sc(b.line,b.ch-1),sc(b.line,b.ch+1))},newlineAndIndent:function(a){zb(a,function(){a.replaceSelection("\n","end","+input"),a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},ad=w.keyMap={};ad.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},ad.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"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",fallthrough:"basic"},ad.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},ad["default"]=p?ad.macDefault:ad.pcDefault,ad.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"},w.lookupKey=cd,w.isModifierKey=dd,w.keyName=ed,w.fromTextArea=function(a,b){function e(){a.value=i.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 c=document.body;try{c=document.activeElement}catch(d){}b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(Ae(a.form,"submit",e),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){e(),f.submit=g,f.submit(),f.submit=h}}catch(d){}}a.style.display="none";var i=w(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return i.save=e,i.getTextArea=function(){return a},i.toTextArea=function(){e(),a.parentNode.removeChild(i.getWrapperElement()),a.style.display="",a.form&&(Be(a.form,"submit",e),"function"==typeof a.form.submit&&(a.form.submit=g))},i},fd.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++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){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return Le(this.string,null,this.tabSize)},match:function(a,b,c){if("string"!=typeof a){var f=this.string.slice(this.pos).match(a);return f&&f.index>0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},w.StringStream=fd,w.TextMarker=gd,gd.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&xb(a);for(var c=null,d=null,e=0;this.lines.length>e;++e){var f=this.lines[e],g=kd(f.markedSpans,this);null!=g.to&&(d=fe(f)),f.markedSpans=ld(f.markedSpans,g),null!=g.from?c=fe(f):this.collapsed&&!wd(this.doc,f)&&a&&ee(f,ub(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var e=0;this.lines.length>e;++e){var h=vd(a.doc,this.lines[e]),i=G(a.doc,h);i>a.display.maxLineLength&&(a.display.maxLine=h,a.display.maxLineLength=i,a.display.maxLineChanged=!0)}null!=c&&a&&Cb(a,c,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.collapsed&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Dc(a)),b&&yb(a),Fe(this,"clear")}},gd.prototype.find=function(){for(var a,b,c=0;this.lines.length>c;++c){var d=this.lines[c],e=kd(d.markedSpans,this);if(null!=e.from||null!=e.to){var f=fe(d);null!=e.from&&(a=sc(f,e.from)),null!=e.to&&(b=sc(f,e.to))}}return"bookmark"==this.type?a:a&&{from:a,to:b}},gd.prototype.getOptions=function(a){var b=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,atomic:this.atomic,collapsed:this.collapsed,replacedWith:a?b&&b.cloneNode(!0):b,readOnly:this.readOnly,startStyle:this.startStyle,endStyle:this.endStyle}},gd.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=Qe(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},gd.prototype.detachLine=function(a){if(this.lines.splice(Qe(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},w.SharedTextMarker=id,id.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;this.markers.length>a;++a)this.markers[a].clear();Fe(this,"clear")}},id.prototype.find=function(){return this.primary.find()},id.prototype.getOptions=function(a){var b=this.primary.getOptions(a);return b.shared=!0,b};var Ad=w.LineWidget=function(a,b,c){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a,this.node=b};Ad.prototype.clear=Bd(function(){var a=this.line.widgets,b=fe(this.line);if(null!=b&&a){for(var c=0;a.length>c;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null),ee(this.line,Math.max(0,this.line.height-Cd(this))),Cb(this.cm,b,b+1)}}),Ad.prototype.changed=Bd(function(){var a=this.height;this.height=null;var b=Cd(this)-a;if(b){ee(this.line,this.line.height+b);var c=fe(this.line);Cb(this.cm,c,c+1)}});var Ld={},Od=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;Vd.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,Gd(e),Fe(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(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(var d=0,e=b.length;e>d;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},Wd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;this.children.length>c;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(25>this.size-b){var h=[];this.collapse(h),this.children=[new Vd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;c>b;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>=a){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(;f.lines.length>50;){var h=f.lines.splice(f.lines.length-25,25),i=new Vd(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Wd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=Qe(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new Wd(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>a){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var Xd=0,Yd=w.Doc=function(a,b,c){if(!(this instanceof Yd))return new Yd(a,b,c);null==c&&(c=0),Wd.call(this,[new Vd([Ed("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=je(),this.frontier=c;var d=sc(c,0);this.sel={from:d,to:d,head:d,anchor:d,shift:!1,extend:!1,goalColumn:null},this.id=++Xd,this.modeOption=b,"string"==typeof a&&(a=jf(a)),Ud(this,{from:d,to:d,text:a},null,{head:d,anchor:d})};Yd.prototype=Re(Wd.prototype,{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,e=b.length;e>d;++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=de(this,this.first,this.first+this.size);return a===!1?b:b.join(a||"\n")},setValue:function(a){var b=sc(this.first,0),c=this.first+this.size-1;lc(this,{from:b,to:sc(c,be(this,c).text.length),text:jf(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=xc(this,b),c=c?xc(this,c):b,rc(this,a,b,c,d)},getRange:function(a,b,c){var d=ce(this,xc(this,a),xc(this,b));return c===!1?d:d.join(c||"\n")},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},setLine:function(a,b){zc(this,a)&&rc(this,b,sc(a,0),xc(this,sc(a)))},removeLine:function(a){a?rc(this,"",xc(this,sc(a-1)),xc(this,sc(a))):rc(this,"",sc(0,0),xc(this,sc(1,0)))},getLineHandle:function(a){return zc(this,a)?be(this,a):void 0},getLineNumber:function(a){return fe(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return xc(this,a)},getCursor:function(a){var c,b=this.sel;return c=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||a===!1?b.to:b.from,vc(c)},somethingSelected:function(){return!tc(this.sel.head,this.sel.anchor)},setCursor:Ab(function(a,b,c){var d=xc(this,"number"==typeof a?sc(a,b||0):a);c?Ac(this,d):Cc(this,d,d)}),setSelection:Ab(function(a,b){Cc(this,xc(this,a),xc(this,b||a))}),extendSelection:Ab(function(a,b){Ac(this,xc(this,a),b&&xc(this,b))}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to,a)},replaceSelection:function(a,b,c){lc(this,{from:this.sel.from,to:this.sel.to,text:jf(a),origin:c},b||"around")},undo:Ab(function(){nc(this,"undo")}),redo:Ab(function(){nc(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=je()},markClean:function(){this.history.dirtyCounter=0,this.history.lastOp=this.history.lastOrigin=null},isClean:function(){return 0==this.history.dirtyCounter},getHistory:function(){return{done:pe(this.history.done),undone:pe(this.history.undone)}},setHistory:function(a){var b=this.history=je();b.done=a.done.slice(0),b.undone=a.undone.slice(0)},markText:function(a,b,c){return hd(this,xc(this,a),xc(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft};return a=xc(this,a),hd(this,a,a,c,"bookmark")},findMarksAt:function(a){a=xc(this,a);var b=[],c=be(this,a.line).markedSpans;if(c)for(var d=0;c.length>d;++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},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;c.length>d;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,++c,void 0)}),xc(this,sc(c,b))},indexFromPos:function(a){a=xc(this,a);var 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 Yd(de(this,this.first,this.first+this.size),this.modeOption,this.first);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},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&&c>a.to&&(c=a.to);var d=new Yd(de(this,b,c),a.mode||this.modeOption,b);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],d},unlinkDoc:function(a){if(a instanceof w&&(a=a.doc),this.linked)for(var b=0;this.linked.length>b;++b){var c=this.linked[b];if(c.doc==a){this.linked.splice(b,1),a.unlinkDoc(this);break}}if(a.history==this.history){var d=[a.id];_d(a,function(a){d.push(a.id)},!0),a.history=je(),a.history.done=pe(this.history.done,d),a.history.undone=pe(this.history.undone,d)}},iterLinkedDocs:function(a){_d(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),Yd.prototype.eachLine=Yd.prototype.iter;var Zd="iter insert remove copy getEditor".split(" ");for(var $d in Yd.prototype)Yd.prototype.hasOwnProperty($d)&&0>Qe(Zd,$d)&&(w.prototype[$d]=function(a){return function(){return a.apply(this.doc,arguments)}}(Yd.prototype[$d]));w.e_stop=xe,w.e_preventDefault=ve,w.e_stopPropagation=we;var De,Ee=0;w.on=Ae,w.off=Be,w.signal=Ce;var Ie=30,Je=w.Pass={toString:function(){return"CodeMirror.Pass"}};Ke.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}},w.countColumn=Le;var Me=[""],Ve=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,Ye=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;
w.replaceGetRect=function(a){bf=a};var cf=function(){if(d)return!1;var a=Ze("div");return"draggable"in a||"dragDrop"in a}(),df=/^$/;a?df=/$'/:i&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?df=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:e&&(df=/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.]|\?[\w~`@#$%\^&*(_=+{[|><]/);var ef,gf,jf=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 f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};w.splitLines=jf;var kf=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},lf=function(){var a=Ze("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),mf={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:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};w.keyNames=mf,function(){for(var a=0;10>a;a++)mf[a+48]=a+"";for(var a=65;90>=a;a++)mf[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)mf[a+111]=mf[a+63235]="F"+a}();var wf=function(){function c(c){return 255>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1791>=c?b.charAt(c-1536):c>=1792&&2220>=c?"r":"L"}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var l,b=a.length,j=[],k=0;b>k;++k)j.push(l=c(a.charCodeAt(k)));for(var k=0,m=i;b>k;++k){var l=j[k];"m"==l?j[k]=m:m=l}for(var k=0,n=i;b>k;++k){var l=j[k];"1"==l&&"r"==n?j[k]="n":f.test(l)&&(n=l,"r"==l&&(j[k]="R"))}for(var k=1,m=j[0];b-1>k;++k){var l=j[k];"+"==l&&"1"==m&&"1"==j[k+1]?j[k]="1":","!=l||m!=j[k+1]||"1"!=m&&"n"!=m||(j[k]=m),m=l}for(var k=0;b>k;++k){var l=j[k];if(","==l)j[k]="N";else if("%"==l){for(var o=k+1;b>o&&"%"==j[o];++o);for(var p=k&&"!"==j[k-1]||b-1>o&&"1"==j[o]?"1":"N",q=k;o>q;++q)j[q]=p;k=o-1}}for(var k=0,n=i;b>k;++k){var l=j[k];"L"==n&&"1"==l?j[k]="L":f.test(l)&&(n=l)}for(var k=0;b>k;++k)if(e.test(j[k])){for(var o=k+1;b>o&&e.test(j[o]);++o);for(var r="L"==(k?j[k-1]:i),s="L"==(b-1>o?j[o]:i),p=r||s?"L":"R",q=k;o>q;++q)j[q]=p;k=o-1}for(var u,t=[],k=0;b>k;)if(g.test(j[k])){var v=k;for(++k;b>k&&g.test(j[k]);++k);t.push({from:v,to:k,level:0})}else{var w=k,x=t.length;for(++k;b>k&&"L"!=j[k];++k);for(var q=w;k>q;)if(h.test(j[q])){q>w&&t.splice(x,0,{from:w,to:q,level:1});var y=q;for(++q;k>q&&h.test(j[q]);++q);t.splice(x,0,{from:y,to:q,level:2}),w=q}else++q;k>w&&t.splice(x,0,{from:w,to:k,level:1})}return 1==t[0].level&&(u=a.match(/^\s+/))&&(t[0].from=u[0].length,t.unshift({from:0,to:u[0].length,level:0})),1==Oe(t).level&&(u=a.match(/\s+$/))&&(Oe(t).to-=u[0].length,t.push({from:b-u[0].length,to:b,level:0})),t[0].level!=Oe(t).level&&t.push({from:b,to:b,level:t[0].level}),t}}();return w.version="3.11 +",w}(),CodeMirror.defineMode("clike",function(a,b){function n(a,b){var c=a.next();if(j[c]){var d=j[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=o(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return m=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=p,p(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(l.test(c))return a.eatWhile(l),"operator";a.eatWhile(/[\w\$_]/);var e=a.current();return f.propertyIsEnumerable(e)?(h.propertyIsEnumerable(e)&&(m="newstatement"),"keyword"):g.propertyIsEnumerable(e)?(h.propertyIsEnumerable(e)&&(m="newstatement"),"builtin"):i.propertyIsEnumerable(e)?"atom":"variable"}function o(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&!k)&&(c.tokenize=null),"string"}}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=null;break}c="*"==d}return"comment"}function q(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function r(a,b,c){var d=a.indented;return a.context&&"statement"==a.context.type&&(d=a.context.indented),a.context=new q(d,b,c,null,a.context)}function s(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var m,c=a.indentUnit,d=b.statementIndentUnit||c,e=b.dontAlignCalls,f=b.keywords||{},g=b.builtin||{},h=b.blockKeywords||{},i=b.atoms||{},j=b.hooks||{},k=b.multiLineStrings,l=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new q((a||0)-c,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;m=null;var d=(b.tokenize||n)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=m&&":"!=m&&","!=m||"statement"!=c.type)if("{"==m)r(b,a.column(),"}");else if("["==m)r(b,a.column(),"]");else if("("==m)r(b,a.column(),")");else if("}"==m){for(;"statement"==c.type;)c=s(b);for("}"==c.type&&(c=s(b));"statement"==c.type;)c=s(b)}else m==c.type?s(b):(("}"==c.type||"top"==c.type)&&";"!=m||"statement"==c.type&&"newstatement"==m)&&r(b,a.column(),"statement");else s(b);return b.startOfLine=!1,d},indent:function(a,b){if(a.tokenize!=n&&null!=a.tokenize)return CodeMirror.Pass;var f=a.context,g=b&&b.charAt(0);"statement"==f.type&&"}"==g&&(f=f.prev);var h=g==f.type;return"statement"==f.type?f.indented+("{"==g?0:d):e&&")"==f.type&&!h?f.indented+d:f.align?f.column+(h?0:1):f.indented+(h?0:c)},electricChars:"{}"}}),function(){function a(a){for(var b={},c=a.split(" "),d=0;c.length>d;++d)b[c[d]]=!0;return b}function c(a,b){if(!b.startOfLine)return!1;for(;;){if(!a.skipTo("\\")){a.skipToEnd(),b.tokenize=null;break}if(a.next(),a.eol()){b.tokenize=c;break}}return"meta"}function d(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function e(a,b){for(var c=0;a.length>c;++c)CodeMirror.defineMIME(a[c],b)}var b="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";e(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),blockKeywords:a("case do else for if switch while struct"),atoms:a("null"),hooks:{"#":c}}),e(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" 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"),blockKeywords:a("catch class do else finally for if struct switch try while"),atoms:a("true false null"),hooks:{"#":c}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:a("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:a("catch class do else finally for if switch try while"),atoms:a("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:a("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:a("catch class do else finally for foreach if struct switch try while"),builtin:a("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:a("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=d,d(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:a("catch class do else finally for forSome if match switch try while"),atoms:a("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("coffeescript",function(a){function c(a){return RegExp("^(("+a.join(")|(")+"))\\b")}function s(a,c){if(a.sol()){var l=c.scopes[0].offset;if(a.eatSpace()){var m=a.indentation();return m>l?"indent":l>m?"dedent":null}l>0&&w(a,c)}if(a.eatSpace())return null;var q=a.peek();if(a.match("####"))return a.skipToEnd(),"comment";if(a.match("###"))return c.tokenize=u,c.tokenize(a,c);if("#"===q)return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var s=!1;if(a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),a.match(/^-?\d+\.\d*/)&&(s=!0),a.match(/^-?\.\d+/)&&(s=!0),s)return"."==a.peek()&&a.backUp(1),"number";var v=!1;if(a.match(/^-?0x[0-9a-f]+/i)&&(v=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(v=!0),a.match(/^-?0(?![\dx])/i)&&(v=!0),v)return"number"}if(a.match(o))return c.tokenize=t(a.current(),"string"),c.tokenize(a,c);if(a.match(p)){if("/"!=a.current()||a.match(/^.*\//,!1))return c.tokenize=t(a.current(),"string-2"),c.tokenize(a,c);a.backUp(1)}return a.match(h)||a.match(g)?"punctuation":a.match(f)||a.match(d)||a.match(k)?"operator":a.match(e)?"punctuation":a.match(r)?"atom":a.match(n)?"keyword":a.match(i)?"variable":a.match(j)?"property":(a.next(),b)}function t(c,d){var e=1==c.length;return function(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\/\\]/),f.eat("\\")){if(f.next(),e&&f.eol())return d}else{if(f.match(c))return g.tokenize=s,d;f.eat(/['"\/]/)}return e&&(a.mode.singleLineStringErrors?d=b:g.tokenize=s),d}}function u(a,b){for(;!a.eol();){if(a.eatWhile(/[^#]/),a.match("###")){b.tokenize=s;break}a.eatWhile("#")}return"comment"}function v(b,c,d){d=d||"coffee";var e=0;if("coffee"===d){for(var f=0;c.scopes.length>f;f++)if("coffee"===c.scopes[f].type){e=c.scopes[f].offset+a.indentUnit;break}}else e=b.column()+b.current().length;c.scopes.unshift({offset:e,type:d})}function w(a,b){if(1!=b.scopes.length){if("coffee"===b.scopes[0].type){for(var c=a.indentation(),d=-1,e=0;b.scopes.length>e;++e)if(c===b.scopes[e].offset){d=e;break}if(-1===d)return!0;for(;b.scopes[0].offset!==c;)b.scopes.shift();return!1}return b.scopes.shift(),!1}}function x(a,c){var d=c.tokenize(a,c),e=a.current();if("."===e)return d=c.tokenize(a,c),e=a.current(),"variable"===d?"variable":b;"return"===e&&(c.dedent+=1),("->"!==e&&"=>"!==e||c.lambda||"coffee"!=c.scopes[0].type||""!==a.peek())&&"indent"!==d||v(a,c);var f="[({".indexOf(e);return-1!==f&&v(a,c,"])}".slice(f,f+1)),l.exec(e)&&v(a,c),"then"==e&&w(a,c),"dedent"===d&&w(a,c)?b:(f="])}".indexOf(e),-1!==f&&w(a,c)?b:(c.dedent>0&&a.eol()&&"coffee"==c.scopes[0].type&&(c.scopes.length>1&&c.scopes.shift(),c.dedent-=1),d))}var b="error",d=RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),e=RegExp("^[\\(\\)\\[\\]\\{\\},:`=;\\.]"),f=RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),g=RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),i=RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),j=RegExp("^(@|this.)[_A-Za-z$][_A-Za-z$0-9]*"),k=c(["and","or","not","is","isnt","in","instanceof","typeof"]),l=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],m=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],n=c(l.concat(m));l=c(l);var o=RegExp("^('{3}|\"{3}|['\"])"),p=RegExp("^(/{3}|/)"),q=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],r=c(q),y={startState:function(a){return{tokenize:s,scopes:[{offset:a||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=x(a,b);return b.lastToken={style:c,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),c},indent:function(a){return a.tokenize!=s?0:a.scopes[0].offset}};return y}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),CodeMirror.defineMode("css",function(a){return CodeMirror.getMode(a,"text/css")}),CodeMirror.defineMode("css-base",function(a,b){"use strict";function l(a,b){return k=b,a}function m(a,b){var c=a.next();if(d[c]){var e=d[c](a,b);if(e!==!1)return e}if("@"==c)return a.eatWhile(/[\w\\\-]/),l("def",a.current());if("="==c)l(null,"compare");else{if(("~"==c||"|"==c)&&a.eat("="))return l(null,"compare");if('"'==c||"'"==c)return b.tokenize=n(c),b.tokenize(a,b);if("#"==c)return a.eatWhile(/[\w\\\-]/),l("atom","hash");if("!"==c)return a.match(/^\s*\w*/),l("keyword","important");if(/\d/.test(c))return a.eatWhile(/[\w.%]/),l("number","unit");if("-"!==c)return/[,+>*\/]/.test(c)?l(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?l("qualifier","qualifier"):":"==c?l("operator",c):/[;{}\[\]\(\)]/.test(c)?l(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=o,l("property","variable")):(a.eatWhile(/[\w\\\-]/),l("property","variable"));if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),l("number","unit");if(a.match(/^[^-]+-/))return l("meta","meta")}}function n(a,b){return function(c,d){for(var f,e=!1;null!=(f=c.next())&&(f!=a||e);)e=!e&&"\\"==f;return e||(b&&c.backUp(1),d.tokenize=m),l("string","string")}}function o(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?m:n(")",!0),l(null,"(")}var c=a.indentUnit,d=b.hooks||{},e=b.atMediaTypes||{},f=b.atMediaFeatures||{},g=b.propertyKeywords||{},h=b.colorKeywords||{},i=b.valueKeywords||{},j=!!b.allowNested,k=null;return{startState:function(a){return{tokenize:m,baseIndent:a||0,stack:[]}},token:function(a,b){if(b.tokenize=b.tokenize||m,b.tokenize==m&&a.eatSpace())return null;var c=b.tokenize(a,b);c&&"string"!=typeof c&&(c=l(c[0],c[1]));var d=b.stack[b.stack.length-1];if("variable"==c)return"variable-definition"==k&&b.stack.push("propertyValue"),"variable-2";if("property"==c?"propertyValue"==d?c=i[a.current()]?"string-2":h[a.current()]?"keyword":"variable-2":"rule"==d?g[a.current()]||(c+=" error"):"block"==d?c=g[a.current()]?"property":h[a.current()]?"keyword":i[a.current()]?"string-2":"tag":d&&"@media{"!=d?"@media"==d?c=e[a.current()]?"attribute":/^(only|not)$/i.test(a.current())?"keyword":"and"==a.current().toLowerCase()?"error":f[a.current()]?"error":"attribute error":"@mediaType"==d?c=e[a.current()]?"attribute":"and"==a.current().toLowerCase()?"operator":/^(only|not)$/i.test(a.current())?"error":f[a.current()]?"error":"error":"@mediaType("==d?g[a.current()]||(e[a.current()]?c="error":"and"==a.current().toLowerCase()?c="operator":/^(only|not)$/i.test(a.current())?c="error":c+=" error"):c="error":c="tag":"atom"==c?d&&"@media{"!=d&&"block"!=d?"propertyValue"==d?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(a.current())||(c+=" error"):c="error":c="builtin":"@media"==d&&"{"==k&&(c="error"),"{"==k)if("@media"==d||"@mediaType"==d)b.stack.pop(),b.stack[b.stack.length-1]="@media{";else{var n=j?"block":"rule";b.stack.push(n)}else if("}"==k){var o=b.stack[b.stack.length-1];"interpolation"==o&&(c="operator"),b.stack.pop(),"propertyValue"==d&&b.stack.pop()}else"interpolation"==k?b.stack.push("interpolation"):"@media"==k?b.stack.push("@media"):"@media"==d&&/\b(keyword|attribute)\b/.test(c)?b.stack.push("@mediaType"):"@mediaType"==d&&","==a.current()?b.stack.pop():"@mediaType"==d&&"("==k?b.stack.push("@mediaType("):"@mediaType("==d&&")"==k?b.stack.pop():"rule"!=d&&"block"!=d||":"!=k?"propertyValue"==d&&";"==k&&b.stack.pop():b.stack.push("propertyValue");return c},indent:function(a,b){var d=a.stack.length;return/^\}/.test(b)&&(d-="propertyValue"==a.stack[a.stack.length-1]?2:1),a.baseIndent+d*c},electricChars:"}"}}),function(){function a(a){for(var b={},c=0;a.length>c;++c)b[a[c]]=!0;return b}function g(a,b){for(var d,c=!1;null!=(d=a.next());){if(c&&"/"==d){b.tokenize=null;break}c="*"==d}return["comment","comment"]}var b=a(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),c=a(["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"]),d=a(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-shadow","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"]),e=a(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua"]),f=a(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","overlay","overline","padding","padding-box","painted","paused","persian","plus-darker","plus-lighter","pointer","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","white","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"]);CodeMirror.defineMIME("text/css",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,hooks:{"<":function(a,b){function c(a,b){for(var d,c=0;null!=(d=a.next());){if(c>=2&&">"==d){b.tokenize=null;break}c="-"==d?c+1:0}return["comment","comment"]}return a.eat("!")?(b.tokenize=c,c(a,b)):void 0},"/":function(a,b){return a.eat("*")?(b.tokenize=g,g(a,b)):!1}},name:"css-base"}),CodeMirror.defineMIME("text/x-scss",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,allowNested:!0,hooks:{$:function(a){return a.match(/^[\w-]+/),":"==a.peek()?["variable","variable-definition"]:["variable","variable"]},"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=g,g(a,b)):["operator","operator"]},"#":function(a){return a.eat("{")?["operator","interpolation"]:(a.eatWhile(/[\w\\\-]/),["atom","hash"])}},name:"css-base"})}(),CodeMirror.defineMode("javascript",function(a,b){function h(a,b,c){return b.tokenize=c,c(a,b)}function i(a,b){for(var d,c=!1;null!=(d=a.next());){if(d==b&&!c)return!1;c=!c&&"\\"==d}return c}function l(a,b,c){return j=a,k=c,b}function m(a,b){var c=a.next();if('"'==c||"'"==c)return h(a,b,n(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return l(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),l("number","number");if(/\d/.test(c)||"-"==c&&a.eat(/\d/))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),l("number","number");if("/"==c)return a.eat("*")?h(a,b,o):a.eat("/")?(a.skipToEnd(),l("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(i(a,"/"),a.eatWhile(/[gimy]/),l("regexp","string-2")):(a.eatWhile(g),l("operator",null,a.current()));if("#"==c)return a.skipToEnd(),l("error","error");if(g.test(c))return a.eatWhile(g),l("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=f.propertyIsEnumerable(d)&&f[d];return e&&"."!=b.lastType?l(e.type,e.style,d):l("variable","variable",d)}function n(a){return function(b,c){return i(b,a)||(c.tokenize=m),l("string","string")}}function o(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=m;break}c="*"==d}return l("comment","comment")}function q(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function r(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function s(a,b,c,e,f){var g=a.cc;for(t.state=a,t.stream=f,t.marked=null,t.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=g.length?g.pop():d?E:D;if(h(c,e)){for(;g.length&&g[g.length-1].lex;)g.pop()();return t.marked?t.marked:"variable"==c&&r(a,e)?"variable-2":b}}}function u(){for(var a=arguments.length-1;a>=0;a--)t.cc.push(arguments[a])}function v(){return u.apply(null,arguments),!0}function w(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;
return!1}var c=t.state;if(c.context){if(t.marked="def",b(c.localVars))return;c.localVars={name:a,next:c.localVars}}else{if(b(c.globalVars))return;c.globalVars={name:a,next:c.globalVars}}}function y(){t.state.context={prev:t.state.context,vars:t.state.localVars},t.state.localVars=x}function z(){t.state.localVars=t.state.context.vars,t.state.context=t.state.context.prev}function A(a,b){var c=function(){var c=t.state;c.lexical=new q(c.indented,t.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function B(){var a=t.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function C(a){return function(b){return b==a?v():";"==a?u():v(arguments.callee)}}function D(a){return"var"==a?v(A("vardef"),P,C(";"),B):"keyword a"==a?v(A("form"),E,D,B):"keyword b"==a?v(A("form"),D,B):"{"==a?v(A("}"),M,B):";"==a?v():"function"==a?v(V):"for"==a?v(A("form"),C("("),A(")"),R,C(")"),B,D,B):"variable"==a?v(A("stat"),H):"switch"==a?v(A("form"),E,A("}","switch"),C("{"),M,B,B):"case"==a?v(E,C(":")):"default"==a?v(C(":")):"catch"==a?v(A("form"),y,C("("),W,C(")"),D,B,z):u(A("stat"),E,C(";"),B)}function E(a){return p.hasOwnProperty(a)?v(G):"function"==a?v(V):"keyword c"==a?v(F):"("==a?v(A(")"),F,C(")"),B,G):"operator"==a?v(E):"["==a?v(A("]"),L(E,"]"),B,G):"{"==a?v(A("}"),L(J,"}"),B,G):v()}function F(a){return a.match(/[;\}\)\],]/)?u():u(E)}function G(a,b){if("operator"==a)return/\+\+|--/.test(b)?v(G):"?"==b?v(E,C(":"),E):v(E);if(";"!=a)return"("==a?v(A(")"),L(E,")"),B,G):"."==a?v(I,G):"["==a?v(A("]"),E,C("]"),B,G):void 0}function H(a){return":"==a?v(B,D):u(G,C(";"),B)}function I(a){return"variable"==a?(t.marked="property",v()):void 0}function J(a,b){if("variable"==a){if(t.marked="property","get"==b||"set"==b)return v(K)}else("number"==a||"string"==a)&&(t.marked=a+" property");return p.hasOwnProperty(a)?v(C(":"),E):void 0}function K(a){return":"==a?v(E):"variable"!=a?v(C(":"),E):(t.marked="property",v(V))}function L(a,b){function c(d){return","==d?v(a,c):d==b?v():v(C(b))}return function(d){return d==b?v():u(a,c)}}function M(a){return"}"==a?v():u(D,M)}function N(a){return":"==a?v(O):u()}function O(a){return"variable"==a?(t.marked="variable-3",v()):u()}function P(a,b){return"variable"==a?(w(b),e?v(N,Q):v(Q)):u()}function Q(a,b){return"="==b?v(E,Q):","==a?v(P):void 0}function R(a){return"var"==a?v(P,C(";"),T):";"==a?v(T):"variable"==a?v(S):v(T)}function S(a,b){return"in"==b?v(E):v(G,T)}function T(a,b){return";"==a?v(U):"in"==b?v(E):v(E,C(";"),U)}function U(a){")"!=a&&v(E)}function V(a,b){return"variable"==a?(w(b),v(V)):"("==a?v(A(")"),y,L(W,")"),B,D,z):void 0}function W(a,b){return"variable"==a?(w(b),e?v(N):v()):void 0}var j,k,c=a.indentUnit,d=b.json,e=b.typescript,f=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),f=a("operator"),g={type:"atom",style:"atom"},h={"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":f,"typeof":f,"instanceof":f,"true":g,"false":g,"null":g,undefined:g,NaN:g,Infinity:g,"this":a("this")};if(e){var i={type:"variable",style:"variable-3"},j={"interface":a("interface"),"class":a("class"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:i,number:i,bool:i,any:i};for(var k in j)h[k]=j[k]}return h}(),g=/[+\-*&%=<>!?|~^]/,p={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0},t={state:null,column:null,marked:null,cc:null},x={name:"this",next:{name:"arguments"}};return B.lex=!0,{startState:function(a){return{tokenize:m,lastType:null,cc:[],lexical:new q((a||0)-c,0,"block",!1),localVars:b.localVars,globalVars:b.globalVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==j?c:(b.lastType=j,s(b,c,j,k,a))},indent:function(a,b){if(a.tokenize==o)return CodeMirror.Pass;if(a.tokenize!=m)return 0;var d=b&&b.charAt(0),e=a.lexical;"stat"==e.type&&"}"==d&&(e=e.prev);var f=e.type,g=d==f;return"vardef"==f?e.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==f&&"{"==d?e.indented:"form"==f?e.indented+c:"stat"==f?e.indented+("operator"==a.lastType||","==a.lastType?c:0):"switch"!=e.info||g?e.align?e.column+(g?0:1):e.indented+(g?0:c):e.indented+(/^(?:case|default)\b/.test(b)?c:2*c)},electricChars:":{}",jsonMode:d}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("text/ecmascript","javascript"),CodeMirror.defineMIME("application/javascript","javascript"),CodeMirror.defineMIME("application/ecmascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMode("less",function(a){function d(a,b){return c=b,a}function f(a){for(var b=0;e.length>b;b++)if(a===e[b])return!0}function h(a,b){var e=a.next();if("@"==e)return a.eatWhile(/[\w\-]/),d("meta",a.current());if("/"==e&&a.eat("*"))return b.tokenize=j,j(a,b);if("<"==e&&a.eat("!"))return b.tokenize=k,k(a,b);if("="==e)d(null,"compare");else{if("|"==e&&a.eat("="))return d(null,"compare");if('"'==e||"'"==e)return b.tokenize=l(e),b.tokenize(a,b);if("/"==e){if(a.eat("/"))return b.tokenize=i,i(a,b);if("string"==c||"("==c)return d("string","string");if(void 0!=b.stack[b.stack.length-1])return d(null,e);if(a.eatWhile(/[\a-zA-Z0-9\-_.\s]/),/\/|\)|#/.test(a.peek()||a.eatSpace()&&")"==a.peek())||a.eol())return d("string","string")}else{if("!"==e)return a.match(/^\s*\w*/),d("keyword","important");if(/\d/.test(e))return a.eatWhile(/[\w.%]/),d("number","unit");if(/[,+<>*\/]/.test(e))return"="==a.peek()||"a"==c?d("string","string"):d(null,"select-op");if(!/[;{}:\[\]()~\|]/.test(e)){if("."==e)return"("==c||"string"==c?d("string","string"):(a.eatWhile(/[\a-zA-Z0-9\-_]/)," "==a.peek()&&a.eatSpace(),")"==a.peek()?d("number","unit"):d("tag","tag"));if("#"==e)return a.eatWhile(/[A-Za-z0-9]/),4==a.current().length||7==a.current().length?null!=a.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,!1)?a.current().substring(1)!=a.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,!1)?d("atom","tag"):(a.eatSpace(),/[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(a.peek())?d("atom","tag"):"}"==a.peek()?d("number","unit"):/[a-zA-Z\\]/.test(a.peek())?d("atom","tag"):a.eol()?d("atom","tag"):d("number","unit")):(a.eatWhile(/[\w\\\-]/),d("atom","tag")):(a.eatWhile(/[\w\\\-]/),d("atom","tag"));if("&"==e)return a.eatWhile(/[\w\-]/),d(null,e);if(a.eatWhile(/[\w\\\-_%.{]/),"string"==c)return d("string","string");if(null!=a.current().match(/(^http$|^https$)/))return a.eatWhile(/[\w\\\-_%.{:\/]/),d("string","string");if("<"==a.peek()||">"==a.peek())return d("tag","tag");if(/\(/.test(a.peek()))return d(null,e);if("/"==a.peek()&&void 0!=b.stack[b.stack.length-1])return d("string","string");if(a.current().match(/\-\d|\-.\d/))return d("number","unit");if(f(a.current().toLowerCase()))return d("tag","tag");if(/\/|[\s\)]/.test(a.peek()||a.eol()||a.eatSpace()&&"/"==a.peek())&&-1!==a.current().indexOf("."))return"{"==a.current().substring(a.current().length-1,a.current().length)?(a.backUp(1),d("tag","tag")):(a.eatSpace(),/[{<>.a-zA-Z\/]/.test(a.peek())||a.eol()?d("tag","tag"):d("string","string"));if(a.eol()||"["==a.peek()||"#"==a.peek()||"tag"==c)return"{"==a.current().substring(a.current().length-1,a.current().length)&&a.backUp(1),d("tag","tag");if("compare"==c||"a"==c||"("==c)return d("string","string");if("|"==c||"-"==a.current()||"["==c)return d(null,e);if(":"==a.peek()){a.next();var h=":"==a.peek()?!0:!1;if(h)a.backUp(1);else{var m=a.pos,n=a.current().length;a.eatWhile(/[a-z\\\-]/);var o=a.pos;if(null!=a.current().substring(n-1).match(g))return a.backUp(o-(m-1)),d("tag","tag");a.backUp(o-(m-1))}return h?d("tag","tag"):d("variable","variable")}return d("variable","variable")}if(":"==e)return a.eatWhile(/[a-z\\\-]/),g.test(a.current())?d("tag","tag"):":"==a.peek()?(a.next(),a.eatWhile(/[a-z\\\-]/),a.current().match(/\:\:\-(o|ms|moz|webkit)\-/)?d("string","string"):g.test(a.current().substring(1))?d("tag","tag"):d(null,e)):d(null,e);if("~"!=e)return d(null,e);if("r"==c)return d("string","string")}}}function i(a,b){return a.skipToEnd(),b.tokenize=h,d("comment","comment")}function j(a,b){for(var e,c=!1;null!=(e=a.next());){if(c&&"/"==e){b.tokenize=h;break}c="*"==e}return d("comment","comment")}function k(a,b){for(var e,c=0;null!=(e=a.next());){if(c>=2&&">"==e){b.tokenize=h;break}c="-"==e?c+1:0}return d("comment","comment")}function l(a){return function(b,c){for(var f,e=!1;null!=(f=b.next())&&(f!=a||e);)e=!e&&"\\"==f;return e||(c.tokenize=h),d("string","string")}}var c,b=a.indentUnit,e="a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins keygen kbd label legend li link map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(" "),g=/(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;return{startState:function(a){return{tokenize:h,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];return"hash"==c&&"rule"==e?d="atom":"variable"==d&&("rule"==e?d=null:e&&"@media{"!=e||(d="when"==a.current()?"variable":/[\s,|\s\)|\s]/.test(a.peek())?"tag":c)),"rule"==e&&/^[\{\};]$/.test(c)&&b.stack.pop(),"{"==c?"@media"==e?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):"}"==c?b.stack.pop():"@media"==c?b.stack.push("@media"):"{"==e&&"comment"!=c&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-="rule"==a.stack[a.stack.length-1]?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/x-less","less"),CodeMirror.mimeModes.hasOwnProperty("text/css")||CodeMirror.defineMIME("text/css","less"),function(){function a(a){for(var b={},c=a.split(" "),d=0;c.length>d;++d)b[c[d]]=!0;return b}function b(a){return function(b,c){return b.match(a)?c.tokenize=null:b.skipToEnd(),"string"}}var c={name:"clike",keywords:a("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:a("catch do else elseif for foreach if switch try while"),atoms:a("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__"),builtin:a("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport echo print global static exit array empty eval isset unset die include require include_once require_once"),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,c){return a.match(/<</)?(a.eatWhile(/[\w\.]/),c.tokenize=b(a.current().slice(3)),c.tokenize(a,c)):!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(a,b){function f(a,b){var c=b.curMode==e;if(a.sol()&&'"'!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=d,b.curState=b.html,"meta"):e.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=e,b.curState=b.php,"meta";if('"'==b.pending){for(;!a.eol()&&'"'!=a.next(););var f="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var f=b.pending.style}else var f=d.token(a,b.curState);b.pending=null;var g=a.current(),h=g.search(/<\?/);return-1!=h&&(b.pending="string"==f&&/\"$/.test(g)&&!/\?>/.test(g)?'"':{end:a.pos,style:f},a.backUp(g.length-h)),f}var d=CodeMirror.getMode(a,"text/html"),e=CodeMirror.getMode(a,c);return{startState:function(){var a=CodeMirror.startState(d),c=CodeMirror.startState(e);return{html:a,php:c,curMode:b.startOpen?e:d,curState:b.startOpen?c:a,pending:null}},copyState:function(a){var h,b=a.html,c=CodeMirror.copyState(d,b),f=a.php,g=CodeMirror.copyState(e,f);return h=a.curMode==d?c:g,{html:c,php:g,curMode:a.curMode,curState:h,pending:a.pending}},token:f,indent:function(a,b){return a.curMode!=e&&/^\s*<\//.test(b)||a.curMode==e&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},electricChars:"/{}:",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",c)}(),CodeMirror.defineMode("ruby",function(a){function b(a){for(var b={},c=0,d=a.length;d>c;++c)b[a[c]]=!0;return b}function h(a,b,c){return c.tokenize.push(a),a(b,c)}function i(a,b){if(g=null,a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(m),"comment";if(a.eatSpace())return null;var d,c=a.next();if("`"==c||"'"==c||'"'==c||"/"==c&&!a.eol()&&" "!=a.peek())return h(k(c,"string",'"'==c||"`"==c),a,b);if("%"==c){var e,i=!1;a.eat("s")?e="atom":a.eat(/[WQ]/)?(e="string",i=!0):a.eat(/[wxqr]/)&&(e="string");var j=a.eat(/[^\w\s]/);return j?(f.propertyIsEnumerable(j)&&(j=f[j]),h(k(j,e,i,!0),a,b)):"operator"}if("#"==c)return a.skipToEnd(),"comment";if("<"==c&&(d=a.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return h(l(d[1]),a,b);if("0"==c)return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(c))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==c){for(;a.match(/^\\[CM]-/););return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}return":"==c?a.eat("'")?h(k("'","atom",!1),a,b):a.eat('"')?h(k('"',"atom",!0),a,b):(a.eatWhile(/[\w\?]/),"atom"):"@"==c?(a.eat("@"),a.eatWhile(/[\w\?]/),"variable-2"):"$"==c?(a.next(),a.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(c)?(a.eatWhile(/[\w\?]/),a.eat(":")?"atom":"ident"):"|"!=c||!b.varList&&"{"!=b.lastTok&&"do"!=b.lastTok?/[\(\)\[\]{}\\;]/.test(c)?(g=c,null):"-"==c&&a.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(c)?(a.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(g="|",null)}function j(){var a=1;return function(b,c){if("}"==b.peek()){if(a--,0==a)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)}else"{"==b.peek()&&a++;return i(b,c)}}function k(a,b,c,d){return function(e,f){for(var h,g=!1;null!=(h=e.next());){if(h==a&&(d||!g)){f.tokenize.pop();break}if(c&&"#"==h&&!g&&e.eat("{")){f.tokenize.push(j(arguments.callee));break}g=!g&&"\\"==h}return b}}function l(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function m(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var g,c=b(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),d=b(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),e=b(["end","until"]),f={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[i],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var h,f=b.tokenize[b.tokenize.length-1](a,b);if("ident"==f){var i=a.current();f=c.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(i)?"tag":"def"==b.lastTok||"class"==b.lastTok||b.varList?"def":"variable",d.propertyIsEnumerable(i)?h="indent":e.propertyIsEnumerable(i)?h="dedent":"if"!=i&&"unless"!=i||a.column()!=a.indentation()||(h="indent")}return(g||f&&"comment"!=f)&&(b.lastTok=i||g||f),"|"==g&&(b.varList=!b.varList),"indent"==h||/[\(\[\{]/.test(g)?b.context={prev:b.context,type:g||f,indented:b.indented}:("dedent"==h||/[\)\]\}]/.test(g))&&b.context.prev&&(b.context=b.context.prev),a.eol()&&(b.continuedLine="\\"==g||"operator"==f),f},indent:function(b,c){if(b.tokenize[b.tokenize.length-1]!=i)return 0;var d=c&&c.charAt(0),e=b.context,g=e.type==f[d]||"keyword"==e.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(c);return e.indented+(g?0:a.indentUnit)+(b.continuedLine?a.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("xml",function(a,b){function i(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(l("atom","]]>")):null:a.match("--")?c(l("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(m(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=l("meta","?>"),"meta";var e=a.eat("/");g="";for(var f;f=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)g+=f;return g?(h=e?"closeTag":"openTag",b.tokenize=j,"tag"):"error"}if("&"==d){var i;return i=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),i?"atom":"error"}return a.eatWhile(/[^&<]/),null}function j(a,b){var c=a.next();return">"==c||"/"==c&&a.eat(">")?(b.tokenize=i,h=">"==c?"endTag":"selfcloseTag","tag"):"="==c?(h="equals",null):/[\'\"]/.test(c)?(b.tokenize=k(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function k(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=j;break}return"string"}}function l(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=i;break}c.next()}return a}}function m(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=m(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=i;break}return c.tokenize=m(a-1),c.tokenize(b,c)}}return"meta"}}function q(){for(var a=arguments.length-1;a>=0;a--)n.cc.push(arguments[a])}function r(){return q.apply(null,arguments),!0}function s(a,b){var c=e.doNotIndent.hasOwnProperty(a)||n.context&&n.context.noIndent;n.context={prev:n.context,tagName:a,indent:n.indented,startOfLine:b,noIndent:c}}function t(){n.context&&(n.context=n.context.prev)}function u(a){if("openTag"==a)return n.tagName=g,n.tagStart=o.column(),r(y,v(n.startOfLine));if("closeTag"==a){var b=!1;return n.context?n.context.tagName!=g&&(e.implicitlyClosed.hasOwnProperty(n.context.tagName.toLowerCase())&&t(),b=!n.context||n.context.tagName!=g):b=!0,b&&(p="error"),r(w(b))}return r()}function v(a){return function(b){var c=n.tagName;return n.tagName=n.tagStart=null,"selfcloseTag"==b||"endTag"==b&&e.autoSelfClosers.hasOwnProperty(c.toLowerCase())?(x(c.toLowerCase()),r()):"endTag"==b?(x(c.toLowerCase()),s(c,a),r()):r()}}function w(a){return function(b){return a&&(p="error"),"endTag"==b?(t(),r()):(p="error",r(arguments.callee))}}function x(a){for(var b;;){if(!n.context)return;if(b=n.context.tagName.toLowerCase(),!e.contextGrabbers.hasOwnProperty(b)||!e.contextGrabbers[b].hasOwnProperty(a))return;t()}}function y(a){return"word"==a?(p="attribute",r(z,y)):"endTag"==a||"selfcloseTag"==a?q():(p="error",r(y))}function z(a){return"equals"==a?r(A,y):(e.allowMissing?"word"==a&&(p="attribute"):p="error","endTag"==a||"selfcloseTag"==a?q():r())}function A(a){return"string"==a?r(B):"word"==a&&e.allowUnquoted?(p="string",r()):(p="error","endTag"==a||"selfCloseTag"==a?q():r())}function B(a){return"string"==a?r(B):q()}var g,h,n,o,p,c=a.indentUnit,d=b.multilineTagIndentFactor||1,e=b.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},f=b.alignCDATA;return{startState:function(){return{tokenize:i,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;p=h=g=null;var c=b.tokenize(a,b);if(b.type=h,(c||h)&&"comment"!=c)for(n=b,o=a;;){var d=b.cc.pop()||u;if(d(h||c))break}return b.startOfLine=!1,p||c},indent:function(a,b,e){var g=a.context;if(a.tokenize!=j&&a.tokenize!=i||g&&g.noIndent)return e?e.match(/^(\s*)/)[0].length:0;if(a.tagName)return a.tagStart+c*d;if(f&&/<!\[CDATA\[/.test(b))return 0;for(g&&/^<\//.test(b)&&(g=g.prev);g&&!g.startOfLine;)g=g.prev;return g?g.indent+c:0},electricChars:"/",configuration:b.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),function(){function c(c,e){var f=c.getCursor(),g=c.getTokenAt(f),h=CodeMirror.innerMode(c.getMode(),g.state),i=h.state;if("xml"!=h.mode.name)return CodeMirror.Pass;var j=c.getOption("autoCloseTags"),k="html"==h.mode.configuration,l="object"==typeof j&&j.dontCloseTags||k&&a,m="object"==typeof j&&j.indentTags||k&&b;if(">"==e&&i.tagName){var n=i.tagName;g.end>f.ch&&(n=n.slice(0,n.length-g.end+f.ch));var o=n.toLowerCase();if("tag"==g.type&&"closeTag"==i.type||g.string.indexOf("/")>-1||l&&d(l,o)>-1)return CodeMirror.Pass;var p=m&&d(m,o)>-1,q=p?CodeMirror.Pos(f.line+1,0):CodeMirror.Pos(f.line,f.ch+1);return c.replaceSelection(">"+(p?"\n\n":"")+"</"+n+">",{head:q,anchor:q}),p&&(c.indentLine(f.line+1),c.indentLine(f.line+2)),void 0}if("/"==e&&"<"==g.string){var n=i.context&&i.context.tagName;return n&&c.replaceSelection("/"+n+">","end"),void 0}return CodeMirror.Pass}function d(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(a,b,d){if(!b||d!=CodeMirror.Init&&d)!b&&d!=CodeMirror.Init&&d&&a.removeKeyMap("autoCloseTags");else{var e={name:"autoCloseTags"};("object"!=typeof b||b.whenClosing)&&(e["'/'"]=function(a){return c(a,"/")}),("object"!=typeof b||b.whenOpening)&&(e["'>'"]=function(a){return c(a,">")}),a.addKeyMap(e)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],b=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"]}(),CodeMirror.newFoldFunction=function(a,b){if(null==b&&(b="\u2194"),"string"==typeof b){var c=document.createTextNode(b);b=document.createElement("span"),b.appendChild(c),b.className="CodeMirror-foldmarker"}return function(c,d){"number"==typeof d&&(d=CodeMirror.Pos(d,0));var e=a(c,d);if(e){for(var f=c.findMarksAt(e.from),g=0,h=0;f.length>h;++h)f[h].__isFold&&(++g,f[h].clear());if(!g){var i=b.cloneNode(!0);CodeMirror.on(i,"mousedown",function(){j.clear()});var j=c.markText(e.from,e.to,{replacedWith:i,clearOnEnter:!0,__isFold:!0})}}}},CodeMirror.tagRangeFinder=function(){var a="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",b=a+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",c=RegExp("<(/?)(["+a+"]["+b+"]*)","g");
return function(a,b){function g(){return d>=a.lastLine()?void 0:(e=0,f=a.getLine(++d),!0)}function h(){for(;;){var a=f.indexOf(">",e);if(-1==a){if(g())continue;return}var b=f.lastIndexOf("/",a),c=b>-1&&/^\s*$/.test(f.slice(b+1,a));return e=a+1,c?"selfClose":"regular"}}function i(){for(;;){c.lastIndex=e;var a=c.exec(f);if(!a){if(g())continue;return}return e=a.index+a[0].length,a}}for(var k,d=b.line,e=b.ch,f=a.getLine(d),j=[];;){var m,l=i();if(!l||d!=b.line||!(m=h()))return;if(!l[1]&&"selfClose"!=m){j.push(l[2]),k=e;break}}for(;;){var m,n=i(),o=d,p=e-(n?n[0].length:0);if(!n||!(m=h()))return;if("selfClose"!=m)if(n[1]){for(var q=j.length-1;q>=0;--q)if(j[q]==n[2]){j.length=q;break}if(!j.length)return{from:CodeMirror.Pos(b.line,k),to:CodeMirror.Pos(o,p)}}else j.push(n[2])}}}(),CodeMirror.braceRangeFinder=function(a,b){for(var f,g,c=b.line,d=a.getLine(c),e=d.length;;){var h=d.lastIndexOf("{",e);if(b.ch>h)break;if(g=a.getTokenAt(CodeMirror.Pos(c,h+1)).type,!/^(comment|string)/.test(g)){f=h;break}e=h-1}if(!(null==f||d.lastIndexOf("}")>f)){var k,l,i=1,j=a.lineCount();a:for(var m=c+1;j>m;++m)for(var n=a.getLine(m),o=0;;){var p=n.indexOf("{",o),q=n.indexOf("}",o);if(0>p&&(p=n.length),0>q&&(q=n.length),o=Math.min(p,q),o==n.length)break;if(a.getTokenAt(CodeMirror.Pos(m,o+1)).type==g)if(o==p)++i;else if(!--i){k=m,l=o;break a}++o}if(null!=k&&k!=c+1)return{from:CodeMirror.Pos(c,f+1),to:CodeMirror.Pos(k,l)}}},function(){function b(a,b){for(var c=0,d=a.length;d>c;++c)b(a[c])}function c(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}return-1!=a.indexOf(b)}function d(b,c,d,e){var f=b.getCursor(),g=d(b,f),h=g;for(g.state=CodeMirror.innerMode(b.getMode(),g.state).state,/^[\w$_]*$/.test(g.string)||(g=h={start:f.ch,end:f.ch,string:"",state:state,type:"."==g.string?"property":null});"property"==h.type;){if(h=d(b,a(f.line,h.start)),"."!=h.string)return;if(h=d(b,a(f.line,h.start)),")"==h.string){var i=1;do switch(h=d(b,a(f.line,h.start)),h.string){case")":i++;break;case"(":i--;break;default:}while(i>0);if(h=d(b,a(f.line,h.start)),0!==h.type.indexOf("variable"))return;h.type="function"}if(!j)var j=[];j.push(h)}return{list:k(g,j,c,e),from:a(f.line,g.start),to:a(f.line,g.end)}}function e(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&"."==c.string.charAt(0)?(c.end=c.start,c.string=".",c.type="property"):/^\.[\w$_]*$/.test(c.string)&&(c.type="property",c.start++,c.string=c.string.replace(/\./,"")),c}function k(a,d,e,i){function l(a){0!=a.indexOf(k)||c(j,a)||j.push(a)}function m(a){"string"==typeof a?b(f,l):a instanceof Array?b(g,l):a instanceof Function&&b(h,l);for(var c in a)l(c)}var j=[],k=a.string;if(d){var o,n=d.pop();for(0===n.type.indexOf("variable")?(i&&i.additionalContext&&(o=i.additionalContext[n.string]),o=o||window[n.string]):"string"==n.type?o="":"atom"==n.type?o=1:"function"==n.type&&(null==window.jQuery||"$"!=n.string&&"jQuery"!=n.string||"function"!=typeof window.jQuery?null!=window._&&"_"==n.string&&"function"==typeof window._&&(o=window._()):o=window.jQuery());null!=o&&d.length;)o=o[d.pop().string];null!=o&&m(o)}else{for(var p=a.state.localVars;p;p=p.next)l(p.name);for(var p=a.state.globalVars;p;p=p.next)l(p.name);m(window),b(e,l)}return j}var a=CodeMirror.Pos;CodeMirror.javascriptHint=function(a,b){return d(a,i,function(a,b){return a.getTokenAt(b)},b)},CodeMirror.coffeescriptHint=function(a,b){return d(a,j,e,b)};var f="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),g="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),h="prototype apply call bind".split(" "),i="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),j="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}(),function(){function b(b,c,d,e){if(this.atOccurrence=!1,this.cm=b,null==e&&"string"==typeof c&&(e=!1),d=d?b.clipPos(d):a(0,0),this.pos={from:d,to:d},"string"!=typeof c)c.global||(c=RegExp(c.source,c.ignoreCase?"ig":"g")),this.matches=function(d,e){if(d){c.lastIndex=0;for(var h,i,f=b.getLine(e.line).slice(0,e.ch),g=0;;){c.lastIndex=g;var j=c.exec(f);if(!j)break;h=j,i=h.index,g=h.index+1}}else{c.lastIndex=e.ch;var f=b.getLine(e.line),h=c.exec(f),i=h&&h.index}return h&&h[0]?{from:a(e.line,i),to:a(e.line,i+h[0].length),match:h}:void 0};else{e&&(c=c.toLowerCase());var f=e?function(a){return a.toLowerCase()}:function(a){return a},g=c.split("\n");this.matches=1==g.length?c.length?function(d,e){var i,g=f(b.getLine(e.line)),h=c.length;return(d?e.ch>=h&&-1!=(i=g.lastIndexOf(c,e.ch-h)):-1!=(i=g.indexOf(c,e.ch)))?{from:a(e.line,i),to:a(e.line,i+h)}:void 0}:function(){}:function(c,d){var e=d.line,h=c?g.length-1:0,i=g[h],j=f(b.getLine(e)),k=c?j.indexOf(i)+i.length:j.lastIndexOf(i);if(!(c?k>=d.ch||k!=i.length:d.ch>=k||k!=j.length-i.length))for(;;){if(c?!e:e==b.lineCount()-1)return;if(j=f(b.getLine(e+=c?-1:1)),i=g[c?--h:++h],!(h>0&&g.length-1>h)){var l=c?j.lastIndexOf(i):j.indexOf(i)+i.length;if(c?l!=j.length-i.length:l!=i.length)return;var m=a(d.line,k),n=a(e,l);return{from:c?n:m,to:c?m:n}}if(j!=i)return}}}}var a=CodeMirror.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){function e(b){var d=a(b,0);return c.pos={from:d,to:d},c.atOccurrence=!1,!1}for(var c=this,d=this.cm.clipPos(b?this.pos.from:this.pos.to);;){if(this.pos=this.matches(b,d))return this.pos.from&&this.pos.to||console.log(this.matches,this.pos),this.atOccurrence=!0,this.pos.match||!0;if(b){if(!d.line)return e(0);d=a(d.line-1,this.cm.getLine(d.line-1).length)}else{var f=this.cm.lineCount();if(d.line==f-1)return e(f);d=a(d.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b){if(this.atOccurrence){var c=CodeMirror.splitLines(b);this.cm.replaceRange(c,this.pos.from,this.pos.to),this.pos.to=a(this.pos.from.line+c.length-1,c[c.length-1].length+(1==c.length?this.pos.from.ch:0))}}},CodeMirror.defineExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)})}(),function(){function c(c){this.minChars="object"==typeof c&&c.minChars||a,this.style="object"==typeof c&&c.style||b,this.overlay=null}function d(a){a.operation(function(){var b=a._matchHighlightState;if(b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null),a.somethingSelected()){var c=a.getSelection().replace(/^\s+|\s+$/g,"");c.length<b.minChars||a.addOverlay(b.overlay=e(c,b.style))}})}function e(a,b){return{token:function(c){return c.match(a)?b:(c.next(),c.skipTo(a.charAt(0))||c.skipToEnd(),void 0)}}}var a=2,b="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(a,b,e){var f=e&&e!=CodeMirror.Init;if(b&&!f)a._matchHighlightState=new c(b),a.on("cursorActivity",d);else if(!b&&f){var g=a._matchHighlightState.overlay;g&&a.removeOverlay(g),a._matchHighlightState=null,a.off("cursorActivity",d)}})}();