uawdijnntqw1x1x1
IP : 216.73.216.229
Hostname : webm007.cluster114.gra.hosting.ovh.net
Kernel : Linux webm007.cluster114.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
OS : Linux
PATH:
/
home
/
locationbo
/
www
/
administrator
/
.
/
components
/
.
/
com_widgetkit
/
assets
/
lib
/
codemirror
/
codemirror.js
/
/
!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function s(e,t){if(!(this instanceof s))return new s(e,t);this.options=t=t?En(t):{},En(Ui,t,!1),m(t);var r=t.value;"string"==typeof r&&(r=new mo(r,t.mode,null,t.lineSeparator)),this.doc=r;var n=new s.inputStyles[t.inputStyle](this),i=this.display=new c(e,r,n);d(i.wrapper.CodeMirror=this),u(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!xi&&i.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new An,keySeq:null,specialChars:null};var o=this;for(var a in ui&&di<11&&setTimeout(function(){o.display.input.reset(!0)},20),function(i){function o(){l.activeTouch&&(r=setTimeout(function(){l.activeTouch=null},1e3),(n=l.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return 1;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}var l=i.display;wo(l.scroller,"mousedown",ct(i,_t)),wo(l.scroller,"dblclick",ui&&di<11?ct(i,function(e){if(!Sn(i,e)){var t=kt(i,e);if(t&&!St(i,e)&&!wt(i.display,e)){yo(e);var r=i.findWordAt(t);he(i.doc,r.anchor,r.head)}}}):function(e){Sn(i,e)||yo(e)}),Si||wo(l.scroller,"contextmenu",function(e){Ht(i,e)});var r,n={end:0};wo(l.scroller,"touchstart",function(e){if(!function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(e)){clearTimeout(r);var t=+new Date;l.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(l.activeTouch.left=e.touches[0].pageX,l.activeTouch.top=e.touches[0].pageY)}}),wo(l.scroller,"touchmove",function(){l.activeTouch&&(l.activeTouch.moved=!0)}),wo(l.scroller,"touchend",function(e){var t=l.activeTouch;if(t&&!wt(l,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(l.activeTouch,"page");r=!t.prev||a(t,t.prev)?new ae(n,n):!t.prev.prev||a(t,t.prev.prev)?i.findWordAt(n):new ae(Ti(n.line,0),ue(i.doc,Ti(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),yo(e)}o()}),wo(l.scroller,"touchcancel",o),wo(l.scroller,"scroll",function(){l.scroller.clientHeight&&(Tt(i,l.scroller.scrollTop),At(i,l.scroller.scrollLeft,!0),_o(i,"scroll",i))}),wo(l.scroller,"mousewheel",function(e){Ot(i,e)}),wo(l.scroller,"DOMMouseScroll",function(e){Ot(i,e)}),wo(l.wrapper,"scroll",function(){l.wrapper.scrollTop=l.wrapper.scrollLeft=0}),l.dragFunctions={enter:function(e){Sn(i,e)||xo(e)},over:function(e){Sn(i,e)||(function(e,t){var r=kt(e,t);if(r){var n=document.createDocumentFragment();Me(e,r,n),e.display.dragCursor||(e.display.dragCursor=Bn("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Un(e.display.dragCursor,n)}}(i,e),xo(e))},start:function(e){!function(e,t){if(ui&&(!e.state.draggingText||new Date-Ei<100))return xo(t);if(!Sn(e,t)&&!wt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!gi)){var r=Bn("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",mi&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),mi&&r.parentNode.removeChild(r)}}(i,e)},drop:ct(i,Mt),leave:function(){Lt(i)}};var e=l.input.getField();wo(e,"keyup",function(e){Dt.call(i,e)}),wo(e,"keydown",ct(i,Pt)),wo(e,"keypress",ct(i,It)),wo(e,"focus",Wn(Et,i)),wo(e,"blur",Wn(Wt,i))}(this),Ro||(function(){var e;wo(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Gn(xt)},100))}),wo(window,"blur",function(){Gn(Wt)})}(),Ro=!0),ot(this),this.curOp.forceUpdate=!0,Jr(this,r),t.autofocus&&!xi||o.hasFocus()?setTimeout(Wn(Et,this),20):Wt(this),Ki)Ki.hasOwnProperty(a)&&Ki[a](this,t[a],Vi);x(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Yi.length;++l)Yi[l](this);at(this),fi&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function c(e,t,r){var n=this;this.input=r,n.scrollbarFiller=Bn("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=Bn("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Bn("div",null,"CodeMirror-code"),n.selectionDiv=Bn("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Bn("div",null,"CodeMirror-cursors"),n.measure=Bn("div",null,"CodeMirror-measure"),n.lineMeasure=Bn("div",null,"CodeMirror-measure"),n.lineSpace=Bn("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Bn("div",[Bn("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Bn("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=Bn("div",null,null,"position: absolute; height: "+So+"px; width: 1px;"),n.gutters=Bn("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Bn("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Bn("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),ui&&di<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),fi||li&&xi||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(e){e.doc.mode=s.getMode(e.options,e.doc.modeOption),t(e)}function t(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Ae(e,100),e.state.modeGen++,e.curOp&&pt(e)}function h(n){var i=nt(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/it(n.display)-3);return function(e){if(Ar(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function n(e){var t=e.doc,r=h(e);t.iter(function(e){var t=r(e);t!=e.height&&nn(e,t)})}function u(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ve(e)}function i(e){d(e),pt(e),setTimeout(function(){b(e)},20)}function d(e){var t=e.display.gutters,r=e.options.gutters;Rn(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(Bn("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",l(e)}function l(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function p(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=_r(n);){n=(i=t.find(0,!0)).from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Cr(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,r+=(n=i.to.line).text.length-i.to.ch}return r}function f(e){var r=e.display,t=e.doc;r.maxLine=en(t,t.first),r.maxLineLength=p(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=p(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}function m(e){var t=zn(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function g(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ze(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+De(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function e(e,t,r){this.cm=r;var n=this.vert=Bn("div",[Bn("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Bn("div",[Bn("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),wo(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),wo(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,ui&&di<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function o(){}function v(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&jo(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new s.scrollbarModel[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),wo(e,"mousedown",function(){r.state.focused&&setTimeout(function(){r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?At:Tt)(r,e)},r),r.display.scrollbars.addClass&&Bo(r.display.wrapper,r.display.scrollbars.addClass)}function y(e,t){t=t||g(e);var r=e.display.barWidth,n=e.display.barHeight;a(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&A(e),a(e,g(e)),r=e.display.barWidth,n=e.display.barHeight}function a(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function _(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-qe(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=an(t,n),a=an(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?a=an(t,ln(en(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=an(t,ln(en(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function b(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=k(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&r[a].gutter&&(r[a].gutter.style.left=o);var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function x(e){if(e.options.lineNumbers){var t=e.doc,r=w(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(Bn("div",[Bn("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",l(e),1}}}function w(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function k(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function C(e,t,r){var n=e.display;this.viewport=t,this.visible=_(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ie(e),this.force=r,this.dims=N(e),this.events=[]}function S(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return gt(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==bt(e))return!1;x(e)&&(gt(e),t.dims=N(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Li&&(o=Lr(e.doc,o),a=Tr(e.doc,a));var l,s,c,u,d=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;s=o,c=a,0==(u=(l=e).display).view.length||s>=u.viewTo||c<=u.viewFrom?(u.view=ht(l,s,c),u.viewFrom=s):(u.viewFrom>s?u.view=ht(l,s,u.viewFrom).concat(u.view):u.viewFrom<s&&(u.view=u.view.slice(vt(l,s))),u.viewFrom=s,u.viewTo<c?u.view=u.view.concat(ht(l,u.viewTo,c)):u.viewTo>c&&(u.view=u.view.slice(0,vt(l,c)))),u.viewTo=c,r.viewOffset=ln(en(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var f=bt(e);if(!d&&0==f&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var h=Kn();return 4<f&&(r.lineDiv.style.display="none"),function(r,e,t){function n(e){var t=e.nextSibling;return fi&&wi&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var i=r.display,o=r.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var d=s[u];if(!d.hidden)if(d.node&&d.node.parentNode==a){for(;l!=d.node;)l=n(l);var f=o&&null!=e&&e<=c&&d.lineNumber;d.changes&&(-1<zn(d.changes,"gutter")&&(f=!1),q(r,d,c,t)),f&&(Rn(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(w(r.options,c)))),l=d.node.nextSibling}else{var h=(g=c,v=t,y=P(p=r,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),D(m),I(p,m,g,v),W(p,m,v),m.node);a.insertBefore(h,l)}c+=d.size}var p,m,g,v,y;for(;l;)l=n(l)}(e,r.updateLineNumbers,t.dims),4<f&&(r.lineDiv.style.display=""),r.renderedView=r.view,h&&Kn()!=h&&h.offsetHeight&&h.focus(),Rn(r.cursorDiv),Rn(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,d&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Ae(e,400)),!(r.updateLineNumbers=null)}function M(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ie(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+ze(e.display)-Ee(e),r.top)}),t.visible=_(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&S(e,t);n=!1){A(e);var i=g(e);Ce(e),T(e,i),y(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function L(e,t){var r=new C(e,t);if(S(e,r)){A(e),M(e,r);var n=g(e);Ce(e),T(e,n),y(e,n),r.finish()}}function T(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+De(e),t.clientHeight)+"px"}function A(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,o=t.view[n];if(!o.hidden){if(ui&&di<8){var a=o.node.offsetTop+o.node.offsetHeight;i=a-r,r=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(i<2&&(i=nt(t)),(.001<s||s<-.001)&&(nn(o.line,i),O(o.line),o.rest))for(var c=0;c<o.rest.length;c++)O(o.rest[c])}}}function O(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function N(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:k(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function q(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?(a=e,0,s=(l=t).text.className,c=P(a,l),l.text==l.node&&(l.node=c.pre),l.text.parentNode.replaceChild(c.pre,l.text),l.text=c.pre,c.bgClass!=l.bgClass||c.textClass!=l.textClass?(l.bgClass=c.bgClass,l.textClass=c.textClass,D(l)):s&&(l.text.className=s)):"gutter"==o?I(e,t,r,n):"class"==o?D(t):"widget"==o&&E(e,t,n)}var a,l,s,c;t.changes=null}function z(e){return e.node==e.text&&(e.node=Bn("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ui&&di<8&&(e.node.style.zIndex=2)),e.node}function P(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Br(e,t)}function D(e){(function(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=z(e);e.background=r.insertBefore(Bn("div",null,t),r.firstChild)}})(e),e.line.wrapClass?z(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function I(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=z(t);t.gutterBackground=Bn("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){i=z(t);var a=t.gutter=Bn("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Bn("div",w(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=o.hasOwnProperty(s)&&o[s];c&&a.appendChild(Bn("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[s]+"px; width: "+n.gutterWidth[s]+"px"))}}}function E(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild;n;n=i){var i=n.nextSibling;"CodeMirror-linewidget"==n.className&&t.node.removeChild(n)}W(e,t,r)}function W(e,t,r){if(H(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)H(e,t.rest[n],t,r,!1)}function H(e,t,r,n,i){if(t.widgets)for(var o=z(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=Bn("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),F(s,c,r,n),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),_n(s,"redraw")}}function F(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function j(e){return Ti(e.line,e.ch)}function B(e,t){return Ai(e,t)<0?t:e}function R(e,t){return Ai(e,t)<0?e:t}function U(e){e.state.focused||(e.display.input.focus(),Et(e))}function K(e){return e.options.readOnly||e.doc.cantEdit}function V(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n=n||o.sel;var a=e.state.pasteIncoming||"paste"==i,l=o.splitLines(t),s=null;if(a&&1<n.ranges.length)if(Oi&&Oi.join("\n")==t){if(n.ranges.length%Oi.length==0){s=[];for(var c=0;c<Oi.length;c++)s.push(o.splitLines(Oi[c]))}}else l.length==n.ranges.length&&(s=Pn(l,function(e){return[e]}));for(c=n.ranges.length-1;0<=c;c--){var u=n.ranges[c],d=u.from(),f=u.to();u.empty()&&(r&&0<r?d=Ti(d.line,d.ch-r):e.state.overwrite&&!a&&(f=Ti(f.line,Math.min(en(o,f.line).text.length,f.ch+qn(l).length))));var h=e.curOp.updateInput,p={from:d,to:f,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Ut(e.doc,p),_n(e,"inputRead",e,p)}t&&!a&&G(e,t),Qt(e),e.curOp.updateInput=h,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function $(e,t){var r=e.clipboardData&&e.clipboardData.getData("text/plain");return r&&(e.preventDefault(),K(t)||t.options.disableInput||st(t,function(){V(t,r,0,null,"paste")}),1)}function G(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(-1<t.indexOf(o.electricChars.charAt(l))){a=er(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(en(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=er(e,i.head.line,"smart"));a&&_n(e,"electricInput",e,i.head.line)}}}function X(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:Ti(i,0),head:Ti(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Y(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function Z(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new An,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Q(){var e=Bn("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Bn("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return fi?e.style.width="1000px":e.setAttribute("wrap","off"),bi&&(e.style.border="1px solid black"),Y(e),t}function J(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new An,this.gracePeriod=!1}function ee(e,t){var r=Fe(e,t.line);if(!r||r.hidden)return null;var n=en(e.doc,t.line),i=We(r,n,t.line),o=sn(n),a="left";o&&(a=ni(o,t.ch)%2?"right":"left");var l=Re(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function te(e,t){return t&&(e.bad=!0),e}function re(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return te(e.clipPos(Ti(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return ne(o,t,r)}}function ne(c,e,t){function r(e,t,r){for(var n=-1;n<(d?d.length:0);n++)for(var i=n<0?u.map:d[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=on(n<0?c.line:c.rest[n]),s=i[o]+r;return(r<0||a!=e)&&(s=i[o+(r?1:0)]),Ti(l,s)}}}var n=c.text.firstChild,i=!1;if(!e||!Eo(n,e))return te(Ti(on(c.line),0),!0);if(e==n&&(i=!0,e=n.childNodes[t],t=0,!e)){var o=c.rest?qn(c.rest):c.line;return te(Ti(on(o),o.text.length),i)}var a=3==e.nodeType?e:null,l=e;for(a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,t=t&&a.nodeValue.length);l.parentNode!=n;)l=l.parentNode;var u=c.measure,d=u.maps,s=r(a,l,t);if(s)return te(s,i);for(var f=l.nextSibling,h=a?a.nodeValue.length-t:0;f;f=f.nextSibling){if(s=r(f,f.firstChild,0))return te(Ti(s.line,s.ch-h),i);h+=f.textContent.length}var p=l.previousSibling;for(h=t;p;p=p.previousSibling){if(s=r(p,p.firstChild,-1))return te(Ti(s.line,s.ch+h),i);h+=f.textContent.length}}function ie(s,e,t,c,u){function d(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(null!=t)return""==t&&(t=e.textContent.replace(/\u200b/g,"")),void(f+=t);var r,n=e.getAttribute("cm-marker");if(n){var i=s.findMarks(Ti(c,0),Ti(u+1,0),(l=+n,function(e){return e.id==l}));return void(i.length&&(r=i[0].find())&&(f+=tn(s.doc,r.from,r.to).join(p)))}if("false"==e.getAttribute("contenteditable"))return;for(var o=0;o<e.childNodes.length;o++)d(e.childNodes[o]);/^(pre|div|p)$/i.test(e.nodeName)&&(h=!0)}else if(3==e.nodeType){var a=e.nodeValue;if(!a)return;h&&(f+=p,h=!1),f+=a}var l}for(var f="",h=!1,p=s.doc.lineSeparator();d(e),e!=t;)e=e.nextSibling;return f}function oe(e,t){this.ranges=e,this.primIndex=t}function ae(e,t){this.anchor=e,this.head=t}function le(e,t){var r=e[t];e.sort(function(e,t){return Ai(e.from(),t.from())}),t=zn(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(0<=Ai(o.to(),i.from())){var a=R(o.from(),i.from()),l=B(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new ae(s?l:a,s?a:l))}}return new oe(e,t)}function se(e,t){return new oe([new ae(e,t||e)],0)}function ce(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ue(e,t){if(t.line<e.first)return Ti(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?Ti(o,en(e,o).text.length):(n=en(e,(r=t).line).text.length,null==(i=r.ch)||n<i?Ti(r.line,n):i<0?Ti(r.line,0):r)}function de(e,t){return t>=e.first&&t<e.first+e.size}function fe(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=Ai(r,i)<0;o!=Ai(n,i)<0?(i=r,r=n):o!=Ai(r,n)<0&&(r=n)}return new ae(i,r)}return new ae(n||r,r)}function he(e,t,r,n){ye(e,new oe([fe(e,e.sel.primary(),t,r)],0),n)}function pe(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=fe(e,e.sel.ranges[i],t[i],null);ye(e,le(n,e.sel.primIndex),r)}function me(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ye(e,le(i,e.sel.primIndex),n)}function ge(e,t,r,n){ye(e,se(t,r),n)}function ve(e,t,r){var n=e.history.done,i=qn(n);i&&i.ranges?be(e,n[n.length-1]=t,r):ye(e,t,r)}function ye(e,t,r){var n,i,o,a,l,s;be(e,t,r),i=(n=e).sel,o=e.cm?e.cm.curOp.id:NaN,a=r,l=n.history,s=a&&a.origin,o==l.lastSelOp||s&&l.lastSelOrigin==s&&(l.lastModTime==l.lastSelTime&&l.lastOrigin==s||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(n,s,qn(l.done),i))?l.done[l.done.length-1]=i:hn(i,l.done),l.lastSelTime=+new Date,l.lastSelOrigin=s,l.lastSelOp=o,a&&!1!==a.clearRedo&&dn(l.undone)}function be(e,t,r){var n,i,o;(Ln(e,"beforeSelectionChange")||e.cm&&Ln(e.cm,"beforeSelectionChange"))&&(n=e,o={ranges:(i=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new ae(ue(n,e[t].anchor),ue(n,e[t].head))}},_o(n,"beforeSelectionChange",n,o),n.cm&&_o(n.cm,"beforeSelectionChange",n.cm,o),t=o.ranges!=i.ranges?le(o.ranges,o.ranges.length-1):i);var a=r&&r.bias||(Ai(t.primary().head,e.sel.primary().head)<0?-1:1);xe(e,ke(e,t,a,!0)),r&&!1===r.scroll||!e.cm||Qt(e.cm)}function xe(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mn(e.cm)),_n(e,"cursorActivity",e))}function we(e){xe(e,ke(e,e.sel,null,!1))}function ke(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=_e(e,a.anchor,r,n),s=_e(e,a.head,r,n);!i&&l==a.anchor&&s==a.head||((i=i||t.ranges.slice(0,o))[o]=new ae(l,s))}return i?le(i,t.primIndex):t}function _e(e,t,r,n){var i=!1,o=t,a=r||1;e.cantEdit=!1;e:for(;;){var l=en(e,o.line);if(l.markedSpans)for(var s=0;s<l.markedSpans.length;++s){var c=l.markedSpans[s],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from<o.ch))&&(null==c.to||(u.inclusiveRight?c.to>=o.ch:c.to>o.ch))){if(n&&(_o(u,"beforeCursorEnter"),u.explicitlyCleared)){if(l.markedSpans){--s;continue}break}if(!u.atomic)continue;var d=u.find(a<0?-1:1);if(0==Ai(d,o)&&(d.ch+=a,d.ch<0?d=d.line>e.first?ue(e,Ti(d.line-1)):null:d.ch>l.text.length&&(d=d.line<e.first+e.size-1?Ti(d.line+1,0):null),!d)){if(i)return n?(e.cantEdit=!0,Ti(e.first,0)):_e(e,t,r,!0);i=!0,d=t,a=-a}o=d;continue e}}return o}}function Ce(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Se(e,t){for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(!1!==t||a!=r.sel.primIndex){var l=r.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&Me(e,l.head,i),s||Le(e,l,o)}return n}function Me(e,t,r){var n=Qe(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(Bn("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(Bn("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Le(i,e,t){function p(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),a.appendChild(Bn("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?g-e:r)+"px; height: "+(n-t)+"px"))}function r(r,s,c){function u(e,t){return Ze(i,Ti(r,e),"div",n,t)}var d,f,n=en(o,r),h=n.text.length;return function(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}(sn(n),s||0,null==c?h:c,function(e,t,r){var n,i,o,a=u(e,"left");if(e==t)i=o=(n=a).left;else{if(n=u(t-1,"right"),"rtl"==r){var l=a;a=n,n=l}i=a.left,o=n.right}null==s&&0==e&&(i=m),3<n.top-a.top&&(p(i,a.top,null,a.bottom),i=m,a.bottom<n.top&&p(i,a.bottom,null,n.top)),null==c&&t==h&&(o=g),(!d||a.top<d.top||a.top==d.top&&a.left<d.left)&&(d=a),(!f||n.bottom>f.bottom||n.bottom==f.bottom&&n.right>f.right)&&(f=n),i<m+1&&(i=m),p(i,n.top,o-i,n.bottom)}),{start:d,end:f}}var n=i.display,o=i.doc,a=document.createDocumentFragment(),l=Pe(i.display),m=l.left,g=Math.max(n.sizerWidth,Ie(i)-n.sizer.offsetLeft)-l.right,s=e.from(),c=e.to();if(s.line==c.line)r(s.line,s.ch,c.ch);else{var u=en(o,s.line),d=en(o,c.line),f=Mr(u)==Mr(d),h=r(s.line,s.ch,f?u.text.length+1:null).end,v=r(c.line,f?0:null,c.ch).start;f&&(h.top<v.top-2?(p(h.right,h.top,null,h.bottom),p(m,v.top,v.left,v.bottom)):p(h.right,h.top,v.left-h.right,h.bottom)),h.bottom<v.top&&p(m,h.bottom,null,v.top)}t.appendChild(a)}function Te(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ae(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Wn(Oe,e))}function Oe(s){var c=s.doc;if(c.frontier<c.first&&(c.frontier=c.first),!(c.frontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=Qi(c.mode,Ne(s,c.frontier)),f=[];c.iter(c.frontier,Math.min(c.first+c.size,s.display.viewTo+500),function(e){if(c.frontier>=s.display.viewFrom){var t=e.styles,r=e.text.length>s.options.maxHighlightLength,n=Wr(s,e,r?Qi(c.mode,d):d,!0);e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),l=0;!a&&l<t.length;++l)a=t[l]!=e.styles[l];a&&f.push(c.frontier),e.stateAfter=r?d:Qi(c.mode,d)}else e.text.length<=s.options.maxHighlightLength&&Fr(s,e.text,d),e.stateAfter=c.frontier%5==0?Qi(c.mode,d):null;return++c.frontier,+new Date>u?(Ae(s,s.options.workDelay),!0):void 0}),f.length&&st(s,function(){for(var e=0;e<f.length;e++)mt(s,f[e],"text")})}}function Ne(r,n,e){var i=r.doc,o=r.display;if(!i.mode.startState)return!0;var a=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=en(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=Oo(s.text,null,e.options.tabSize);(null==i||c<n)&&(i=l-1,n=c)}return i}(r,n,e),l=a>i.first&&en(i,a-1).stateAfter;return l=l?Qi(i.mode,l):Ji(i.mode),i.iter(a,n,function(e){Fr(r,e.text,l);var t=a==n-1||a%5==0||a>=o.viewFrom&&a<o.viewTo;e.stateAfter=t?Qi(i.mode,l):null,++a}),e&&(i.frontier=a),l}function qe(e){return e.lineSpace.offsetTop}function ze(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Pe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Un(e.measure,Bn("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function De(e){return So-e.display.nativeBarWidth}function Ie(e){return e.display.scroller.clientWidth-De(e)-e.display.barWidth}function Ee(e){return e.display.scroller.clientHeight-De(e)-e.display.barHeight}function We(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(n=0;n<e.rest.length;n++)if(on(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function He(e,t,r,n){return Be(e,je(e,t),r,n)}function Fe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[vt(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function je(e,t){var r=on(t),n=Fe(e,r);n&&!n.text?n=null:n&&n.changes&&(q(e,n,r,N(e)),e.curOp.forceUpdate=!0);var i=We(n=n||function(e,t){var r=on(t=Mr(t)),n=e.display.externalMeasured=new ft(e.doc,t,r);n.lineN=r;var i=n.built=Br(e,n);return n.text=i.pre,Un(e.display.lineMeasure,i.pre),n}(e,t),t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Be(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Ie(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];2<Math.abs(s.bottom-c.bottom)&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Re(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&jn(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&jn(t.line.text.charAt(o.coverStart+s));)++s;if(ui&&di<9&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(ui&&e.options.lineWrapping){var d=zo(a,l,s).getClientRects();i=d.length?d["right"==n?d.length-1:0]:Pi}else i=zo(a,l,s).getBoundingClientRect()||Pi;if(i.left||i.right||0==l)break;s=l,--l,c="right"}ui&&di<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Go)return Go;var t=Un(e,Bn("span","x")),r=t.getBoundingClientRect(),n=zo(t,0,1).getBoundingClientRect();return Go=1<Math.abs(r.left-n.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{0<l&&(c=n="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(ui&&di<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+it(e.display),top:f.top,bottom:f.bottom}:Pi}var h=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(h+p)/2,g=t.view.measure.heights;for(u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=h,b.rbottom=p),b}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Re(e,t,r){for(var n,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(t<s?(i=0,o=1,a="left"):t<c?o=(i=t-s)+1:(l==e.length-3||t==c&&e[l+3]>t)&&(i=(o=c-s)-1,c<=t&&(a="right")),null!=i){if(n=e[l+2],s==c&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)n=e[2+(l-=3)],a="left";if("right"==r&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)n=e[(l+=3)+2],a="right";break}}return{node:n,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function Ue(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Ke(e){e.display.externalMeasure=null,Rn(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ue(e.display.view[t])}function Ve(e){Ke(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function $e(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ge(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Xe(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=qr(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n=n||"local";var a=ln(t);if("local"==n?a+=qe(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:Ge());var s=l.left+("window"==n?0:$e());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function Ye(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=$e(),i-=Ge();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Ze(e,t,r,n,i){return Xe(e,n=n||en(e.doc,t.line),He(e,n,t.ch,i),r)}function Qe(n,e,i,o,a,l){function s(e,t){var r=Be(n,a,e,t?"right":"left",l);return t?r.left=r.right:r.right=r.left,Xe(n,o,r,i)}function t(e,t){var r=c[t],n=r.level%2;return e==Zn(r)&&t&&r.level<c[t-1].level?(e=Qn(r=c[--t])-(r.level%2?0:1),n=!0):e==Qn(r)&&t<c.length-1&&r.level<c[t+1].level&&(e=Zn(r=c[++t])-r.level%2,n=!1),n&&e==r.to&&e>r.from?s(e-1):s(e,n)}o=o||en(n.doc,e.line),a=a||je(n,o);var c=sn(o),r=e.ch;if(!c)return s(r);var u=t(r,ni(c,r));return null!=Yo&&(u.other=t(r,Yo)),u}function Je(e,t){var r=0;t=ue(e.doc,t);e.options.lineWrapping||(r=it(e.display)*t.ch);var n=en(e.doc,t.line),i=ln(n)+qe(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function et(e,t,r,n){var i=Ti(e,t);return i.xRel=n,r&&(i.outside=!0),i}function tt(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return et(n.first,0,!0,-1);var i=an(n,r),o=n.first+n.size-1;if(o<i)return et(n.first+n.size-1,en(n,o).text.length,!0,1);t<0&&(t=0);for(var a=en(n,i);;){var l=rt(e,a,i,t,r),s=Cr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&0<l.xRel))return l;i=on(a=c.to.line)}}function rt(r,n,i,e,t){function o(e){var t=Qe(r,Ti(i,e),"line",n,c);return l=!0,a>t.bottom?t.left-s:a<t.top?t.left+s:(l=!1,t.left)}var a=t-ln(n),l=!1,s=2*r.display.wrapper.clientWidth,c=je(r,n),u=sn(n),d=n.text.length,f=Jn(n),h=ei(n),p=o(f),m=l,g=o(h),v=l;if(g<e)return et(i,h,v,1);for(;;){if(u?h==f||h==oi(n,f,1):h-f<=1){for(var y=e<p||e-p<=g-e?f:h,b=e-(y==f?p:g);jn(n.text.charAt(y));)++y;return et(i,y,y==f?m:v,b<-1?-1:1<b?1:0)}var x=Math.ceil(d/2),w=f+x;if(u){w=f;for(var k=0;k<x;++k)w=oi(n,w,1)}var _=o(w);e<_?(h=w,g=_,(v=l)&&(g+=1e3),d=x):(f=w,p=_,m=l,d-=x)}}function nt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ni){Ni=Bn("pre");for(var t=0;t<49;++t)Ni.appendChild(document.createTextNode("x")),Ni.appendChild(Bn("br"));Ni.appendChild(document.createTextNode("x"))}Un(e.measure,Ni);var r=Ni.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),Rn(e.measure),r||1}function it(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Bn("span","xxxxxxxxxx"),r=Bn("pre",[t]);Un(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function ot(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ii},Di?Di.ops.push(e.curOp):e.curOp.ownsGroup=Di={ops:[e.curOp],delayedCallbacks:[]}}function at(e){var t=e.curOp.ownsGroup;if(t)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(t)}finally{Di=null;for(var r=0;r<t.ops.length;r++)t.ops[r].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)n=t[r],i=n.cm,o=i.display,function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=De(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=De(e)+"px",t.scrollbarsClipped=!0)}(i),n.updateMaxLine&&f(i),n.mustUpdate=n.viewChanged||n.forceUpdate||null!=n.scrollTop||n.scrollToPos&&(n.scrollToPos.from.line<o.viewFrom||n.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&i.options.lineWrapping,n.update=n.mustUpdate&&new C(i,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate);var n,i,o;for(r=0;r<t.length;r++)a=t[r],a.updatedDisplay=a.mustUpdate&&S(a.cm,a.update);var a;for(r=0;r<t.length;r++)l=t[r],s=void 0,c=void 0,s=l.cm,c=s.display,l.updatedDisplay&&A(s),l.barMeasure=g(s),c.maxLineChanged&&!s.options.lineWrapping&&(l.adjustWidthTo=He(s,c.maxLine,c.maxLine.text.length).left+3,s.display.sizerWidth=l.adjustWidthTo,l.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+l.adjustWidthTo+De(s)+s.display.barWidth),l.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+l.adjustWidthTo-Ie(s))),(l.updatedDisplay||l.selectionChanged)&&(l.preparedSelection=c.input.prepareSelection());var l,s,c;for(r=0;r<t.length;r++)u=t[r],d=void 0,d=u.cm,null!=u.adjustWidthTo&&(d.display.sizer.style.minWidth=u.adjustWidthTo+"px",u.maxScrollLeft<d.doc.scrollLeft&&At(d,Math.min(d.display.scroller.scrollLeft,u.maxScrollLeft),!0),d.display.maxLineChanged=!1),u.preparedSelection&&d.display.input.showSelection(u.preparedSelection),u.updatedDisplay&&T(d,u.barMeasure),!u.updatedDisplay&&u.startHeight==d.doc.height||y(d,u.barMeasure),u.selectionChanged&&Te(d),d.state.focused&&u.updateInput&&d.display.input.reset(u.typing),u.focus&&u.focus==Kn()&&U(u.cm);var u,d;for(r=0;r<t.length;r++)lt(t[r])}(t)}}function lt(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&M(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-Ie(t),e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,b(t)),e.scrollToPos){var i=function(e,t,r,n){null==n&&(n=0);for(var i=0;i<5;i++){var o=!1,a=Qe(e,t),l=r&&r!=t?Qe(e,r):a,s=Yt(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-n,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(Tt(e,s.scrollTop),1<Math.abs(e.doc.scrollTop-c)&&(o=!0)),null!=s.scrollLeft&&(At(e,s.scrollLeft),1<Math.abs(e.doc.scrollLeft-u)&&(o=!0)),!o)break}return a}(t,ue(n,e.scrollToPos.from),ue(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&function(e,t){if(!Sn(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!yi){var o=Bn("div","",null,"position: absolute; top: "+(t.top-r.viewOffset-qe(e.display))+"px; height: "+(t.bottom-t.top+De(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||_o(o[l],"hide");if(a)for(l=0;l<a.length;++l)a[l].lines.length&&_o(a[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&_o(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function st(e,t){if(e.curOp)return t();ot(e);try{return t()}finally{at(e)}}function ct(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ot(e);try{return t.apply(e,arguments)}finally{at(e)}}}function ut(e){return function(){if(this.curOp)return e.apply(this,arguments);ot(this);try{return e.apply(this,arguments)}finally{at(this)}}}function dt(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);ot(e);try{return t.apply(this,arguments)}finally{at(e)}}}function ft(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Cr(e);)e=t.find(1,!0).line,(r=r||[]).push(e);return r}(t),this.size=this.rest?on(qn(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ar(e,t)}function ht(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new ft(e.doc,en(e.doc,o),o);n=o+a.size,i.push(a)}return i}function pt(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n=n||0;var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Li&&Lr(e.doc,t)<i.viewTo&>(e);else if(r<=i.viewFrom)Li&&Tr(e.doc,r+n)>i.viewFrom?gt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gt(e);else if(t<=i.viewFrom){(o=yt(e,r,r+n,1))?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gt(e)}else if(r>=i.viewTo){var o;(o=yt(e,t,t,-1))?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):gt(e)}else{var a=yt(e,t,t,-1),l=yt(e,r,r+n,1);a&&l?(i.view=i.view.slice(0,a.index).concat(ht(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):gt(e)}var s=i.externalMeasured;s&&(r<s.lineN?s.lineN+=n:t<s.lineN+s.size&&(i.externalMeasured=null))}function mt(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[vt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==zn(a,r)&&a.push(r)}}}function gt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vt(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function yt(e,t,r,n){var i,o=vt(e,t),a=e.display.view;if(!Li||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=0,s=e.display.viewFrom;l<o;l++)s+=a[l].size;if(s!=t){if(0<n){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;Lr(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function bt(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function xt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function wt(e,t){for(var r=wn(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return 1}function kt(e,t,r,n){var i=e.display;if(!r&&"true"==wn(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=tt(e,o,a);if(n&&1==c.xRel&&(s=en(e.doc,c.line).text).length==c.ch){var u=Oo(s,s.length,e.options.tabSize)-s.length;c=Ti(c.line,Math.max(0,Math.round((o-Pe(e.display).left)/it(e.display))-u))}return c}function _t(e){var t,r=this,n=r.display;if(!(n.activeTouch&&n.input.supportsTouch()||Sn(r,e))){if(n.shift=e.shiftKey,wt(n,e))return void(fi||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!St(r,e)){var i=kt(r,e);switch(window.focus(),kn(e)){case 1:r.state.selectingText?r.state.selectingText(e):i?function(e,t,r){ui?setTimeout(Wn(U,e),0):e.curOp.focus=Kn();var n,i=+new Date;zi&&zi.time>i-400&&0==Ai(zi.pos,r)?n="triple":qi&&qi.time>i-400&&0==Ai(qi.pos,r)?(n="double",zi={time:i,pos:r}):(n="single",qi={time:i,pos:r});var o,a=e.doc.sel,l=wi?t.metaKey:t.ctrlKey;e.options.dragDrop&&Uo&&!K(e)&&"single"==n&&-1<(o=a.contains(r))&&(Ai((o=a.ranges[o]).from(),r)<0||0<r.xRel)&&(0<Ai(o.to(),r)||r.xRel<0)?function(t,r,n,i){var o=t.display,a=+new Date,l=ct(t,function(e){fi&&(o.scroller.draggable=!1),t.state.draggingText=!1,ko(document,"mouseup",l),ko(o.scroller,"drop",l),Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)<10&&(yo(e),!i&&new Date-200<a&&he(t.doc,n),fi||ui&&9==di?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())});fi&&(o.scroller.draggable=!0),t.state.draggingText=l,o.scroller.dragDrop&&o.scroller.dragDrop(),wo(document,"mouseup",l),wo(o.scroller,"drop",l)}(e,t,r,l):function(m,e,g,v,t){function o(e){var t=++c,r=kt(m,e,!0,"rect"==v);if(r)if(0!=Ai(r,k)){m.curOp.focus=Kn(),function(e){if(0!=Ai(k,e))if(k=e,"rect"==v){for(var t=[],r=m.options.tabSize,n=Oo(en(y,g.line).text,g.ch,r),i=Oo(en(y,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),l=Math.min(g.line,e.line),s=Math.min(m.lastLine(),Math.max(g.line,e.line));l<=s;l++){var c=en(y,l).text,u=On(c,o,r);o==a?t.push(new ae(Ti(l,u),Ti(l,u))):c.length>u&&t.push(new ae(Ti(l,u),Ti(l,On(c,a,r))))}t.length||t.push(new ae(g,g)),ye(y,le(w.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),m.scrollIntoView(e)}else{var d=b,f=d.anchor,h=e;if("single"!=v){if("double"==v)var p=m.findWordAt(e);else p=new ae(Ti(e.line,0),ue(y,Ti(e.line+1,0)));f=0<Ai(p.anchor,f)?(h=p.head,R(d.from(),p.anchor)):(h=p.anchor,B(d.to(),p.head))}(t=w.ranges.slice(0))[x]=new ae(ue(y,f),h),ye(y,le(t,x),To)}}(r);var n=_(a,y);(r.line>=n.to||r.line<n.from)&&setTimeout(ct(m,function(){c==t&&o(e)}),150)}else{var i=e.clientY<s.top?-20:e.clientY>s.bottom?20:0;i&&setTimeout(ct(m,function(){c==t&&(a.scroller.scrollTop+=i,o(e))}),50)}}function r(e){m.state.selectingText=!1,c=1/0,yo(e),a.input.focus(),ko(document,"mousemove",u),ko(document,"mouseup",d),y.history.lastSelOrigin=null}var a=m.display,y=m.doc;yo(e);var b,x,w=y.sel,n=w.ranges;if(t&&!e.shiftKey?(x=y.sel.contains(g),b=-1<x?n[x]:new ae(g,g)):(b=y.sel.primary(),x=y.sel.primIndex),e.altKey)v="rect",t||(b=new ae(g,g)),g=kt(m,e,!0,!0),x=-1;else if("double"==v){var i=m.findWordAt(g);b=m.display.shift||y.extend?fe(y,b,i.anchor,i.head):i}else if("triple"==v){var l=new ae(Ti(g.line,0),ue(y,Ti(g.line+1,0)));b=m.display.shift||y.extend?fe(y,b,l.anchor,l.head):l}else b=fe(y,b,g);t?-1==x?(x=n.length,ye(y,le(n.concat([b]),x),{scroll:!1,origin:"*mouse"})):1<n.length&&n[x].empty()&&"single"==v&&!e.shiftKey?(ye(y,le(n.slice(0,x).concat(n.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),w=y.sel):me(y,x,b,To):(ye(y,new oe([b],x=0),To),w=y.sel);var k=g,s=a.wrapper.getBoundingClientRect(),c=0,u=ct(m,function(e){(kn(e)?o:r)(e)}),d=ct(m,r);m.state.selectingText=d,wo(document,"mousemove",u),wo(document,"mouseup",d)}(e,t,r,n,l)}(r,e,i):wn(e)==n.scroller&&yo(e);break;case 2:fi&&(r.state.lastMiddleDown=+new Date),i&&he(r.doc,i),setTimeout(function(){n.input.focus()},20),yo(e);break;case 3:Si?Ht(r,e):((t=r).state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Wt(t))},100))}}}}function Ct(e,t,r,n,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&yo(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!Ln(e,r))return xn(t);a-=s.top-l.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=l.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=o)return i(e,r,e,an(e.doc,a),e.options.gutters[c],t),xn(t)}}function St(e,t){return Ct(e,t,"gutterClick",!0,_n)}function Mt(e){var n=this;if(Lt(n),!Sn(n,e)&&!wt(n.display,e)){yo(e),ui&&(Ei=+new Date);var i=kt(n,e,!0),t=e.dataTransfer.files;if(i&&!K(n))if(t&&t.length&&window.FileReader&&window.File)for(var o=t.length,a=Array(o),l=0,r=function(e,t){var r=new FileReader;r.onload=ct(n,function(){if(a[t]=r.result,++l==o){var e={from:i=ue(n.doc,i),to:i,text:n.doc.splitLines(a.join(n.doc.lineSeparator())),origin:"paste"};Ut(n.doc,e),ve(n.doc,se(i,Ri(e)))}}),r.readAsText(e)},s=0;s<o;++s)r(t[s],s);else{if(n.state.draggingText&&-1<n.doc.sel.contains(i))return n.state.draggingText(e),void setTimeout(function(){n.display.input.focus()},20);try{if(a=e.dataTransfer.getData("Text")){if(n.state.draggingText&&!(wi?e.altKey:e.ctrlKey))var c=n.listSelections();if(be(n.doc,se(i,i)),c)for(s=0;s<c.length;++s)Xt(n.doc,"",c[s].anchor,c[s].head,"drag");n.replaceSelection(a,"around","paste"),n.display.input.focus()}}catch(e){}}}}function Lt(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Tt(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,li||L(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),li&&L(e),Ae(e,100))}function At(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,b(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Ot(e,t){var r=Fi(t),n=r.x,i=r.y,o=e.display,a=o.scroller;if(n&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&wi&&fi)e:for(var l=t.target,s=o.view;l!=a;l=l.parentNode)for(var c=0;c<s.length;c++)if(s[c].node==l){e.display.currentWheelTarget=l;break e}if(n&&!li&&!mi&&null!=Hi)return i&&Tt(e,Math.max(0,Math.min(a.scrollTop+i*Hi,a.scrollHeight-a.clientHeight))),At(e,Math.max(0,Math.min(a.scrollLeft+n*Hi,a.scrollWidth-a.clientWidth))),yo(t),o.wheelStartX=null;if(i&&null!=Hi){var u=i*Hi,d=e.doc.scrollTop,f=d+o.wrapper.clientHeight;u<0?d=Math.max(0,d+u-50):f=Math.min(e.doc.height,f+u+50),L(e,{top:d,bottom:f})}Wi<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Hi=(Hi*Wi+r)/(Wi+1),++Wi)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Nt(e,t,r){if("string"==typeof t&&!(t=eo[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{K(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Mo}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function qt(e,t,r,n){var i=e.state.keySeq;if(i){if(no(t))return"handled";ji.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=ro(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&ro(t,e.options.extraKeys,r,e)||ro(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&_n(e,"keyHandled",e,t,r),"handled"!=o&&"multi"!=o||(yo(r),Te(e)),i&&!o&&/\'$/.test(t)?(yo(r),!0):!!o}function zt(t,e){var r=io(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?qt(t,"Shift-"+r,e,function(e){return Nt(t,e,!0)})||qt(t,r,e,function(e){return("string"==typeof e?/^go[A-Z]/.test(e):e.motion)?Nt(t,e):void 0}):qt(t,r,e,function(e){return Nt(t,e)}))}function Pt(e){var t,r=this;if(r.curOp.focus=Kn(),!Sn(r,e)){ui&&di<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;r.display.shift=16==n||e.shiftKey;var i=zt(r,e);mi&&(Bi=i?n:null,!i&&88==n&&!$o&&(wi?e.metaKey:e.ctrlKey)&&r.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)||(t=r.display.lineDiv,Bo(t,"CodeMirror-crosshair"),wo(document,"keyup",o),wo(document,"mouseover",o))}function o(e){18!=e.keyCode&&e.altKey||(jo(t,"CodeMirror-crosshair"),ko(document,"keyup",o),ko(document,"mouseover",o))}}function Dt(e){16==e.keyCode&&(this.doc.sel.shift=!1),Sn(this,e)}function It(e){var t,r=this;if(!(wt(r.display,e)||Sn(r,e)||e.ctrlKey&&!e.altKey||wi&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(mi&&n==Bi)return Bi=null,void yo(e);if(!mi||e.which&&!(e.which<10)||!zt(r,e)){var o=String.fromCharCode(null==i?n:i);qt(t=r,"'"+o+"'",e,function(e){return Nt(t,e,!0)})||r.display.input.onKeyPress(e)}}}function Et(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(_o(e,"focus",e),e.state.focused=!0,Bo(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),fi&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Te(e))}function Wt(e){e.state.delayingBlurEvent||(e.state.focused&&(_o(e,"blur",e),e.state.focused=!1,jo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ht(e,t){var r,n;wt(e.display,t)||(n=t,Ln(r=e,"gutterContextMenu")&&Ct(r,n,"gutterContextMenu",!1,_o))||e.display.input.onContextMenu(t)}function Ft(e,t){if(Ai(e,t.from)<0)return e;if(Ai(e,t.to)<=0)return Ri(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ri(t).ch-t.to.ch),Ti(r,n)}function jt(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ae(Ft(i.anchor,t),Ft(i.head,t)))}return le(r,e.sel.primIndex)}function Bt(e,t,r){return e.line==t.line?Ti(r.line,e.ch-t.ch+r.ch):Ti(r.line+(e.line-t.line),e.ch)}function Rt(i,e,t){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){this.canceled=!0}};return t&&(r.update=function(e,t,r,n){e&&(this.from=ue(i,e)),t&&(this.to=ue(i,t)),r&&(this.text=r),void 0!==n&&(this.origin=n)}),_o(i,"beforeChange",i,r),i.cm&&_o(i.cm,"beforeChange",i.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ut(e,t,r){if(e.cm){if(!e.cm.curOp)return ct(e.cm,Ut)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ln(e,"beforeChange")||e.cm&&Ln(e.cm,"beforeChange"))||(t=Rt(e,t,!0))){var n=Mi&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=zn(n,r)||(n=n||[]).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(Ai(c.to,l.from)<0||0<Ai(c.from,l.to))){var u=[s,1],d=Ai(c.from,l.from),f=Ai(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(0<f||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)Kt(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Kt(e,t)}}function Kt(e,r){if(1!=r.text.length||""!=r.text[0]||0!=Ai(r.from,r.to)){var t=jt(e,r);fn(e,r,t,e.cm?e.cm.curOp.id:NaN),Gt(e,r,t,pr(e,r));var n=[];Qr(e,function(e,t){t||-1!=zn(n,e.history)||(bn(e.history,r),n.push(e.history)),Gt(e,r,null,pr(e,r))})}}function Vt(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;(n=a.pop()).ranges;){if(hn(n,l),r&&!n.equals(e.sel))return void ye(e,n,{clearRedo:!1});o=n}var c=[];hn(o,l),l.push({changes:c,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;var u=Ln(e,"beforeChange")||e.cm&&Ln(e.cm,"beforeChange");for(s=n.changes.length-1;0<=s;--s){var d=n.changes[s];if(d.origin=t,u&&!Rt(e,d,!1))return a.length=0;c.push(un(e,d));var f=s?jt(e,d):qn(a);Gt(e,d,f,gr(e,d)),!s&&e.cm&&e.cm.scrollIntoView({from:d.from,to:Ri(d)});var h=[];Qr(e,function(e,t){t||-1!=zn(h,e.history)||(bn(e.history,d),h.push(e.history)),Gt(e,d,null,gr(e,d))})}}}}function $t(e,t){if(0!=t&&(e.first+=t,e.sel=new oe(Pn(e.sel.ranges,function(e){return new ae(Ti(e.anchor.line+t,e.anchor.ch),Ti(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){pt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)mt(e.cm,n,"gutter")}}function Gt(e,t,r,n){if(e.cm&&!e.cm.curOp)return ct(e.cm,Gt)(e,t,r,n);if(t.to.line<e.first)$t(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);$t(e,i),t={from:Ti(e.first,0),to:Ti(t.to.line+i,t.to.ch),text:[qn(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Ti(o,en(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tn(e,t.from,t.to),r=r||jt(e,t),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=on(Mr(en(n,o.line))),n.iter(s,a.line+1,function(e){return e==i.maxLine?l=!0:void 0})),-1<n.sel.contains(t.from,t.to)&&Mn(e),Xr(n,t,r,h(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=p(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),Ae(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?pt(e):o.line!=a.line||1!=t.text.length||Gr(e.doc,t)?pt(e,o.line,a.line+1,c):mt(e,o.line,"text");var u=Ln(e,"changes"),d=Ln(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&_n(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Xr(e,t,n),be(e,r,Lo)}}function Xt(e,t,r,n,i){if(Ai(n=n||r,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),Ut(e,{from:r,to:n,text:t,origin:i})}function Yt(e,t,r,n,i){var o=e.display,a=nt(e.display);r<0&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ee(e),c={};s<i-r&&(i=r+s);var u=e.doc.height+ze(o),d=r<a,f=u-a<i;if(r<l)c.scrollTop=d?0:r;else if(l+s<i){var h=Math.min(r,(f?u:i)-s);h!=l&&(c.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ie(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=m<n-t;return g&&(n=t+m),t<10?c.scrollLeft=0:t<p?c.scrollLeft=Math.max(0,t-(g?0:10)):m+p-3<n&&(c.scrollLeft=n+(g?0:10)-m),c}function Zt(e,t,r){null==t&&null==r||Jt(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Qt(e){Jt(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Ti(t.line,t.ch-1):t,n=Ti(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Jt(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Je(e,t.from),n=Je(e,t.to),i=Yt(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function er(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Ne(e,t):r="prev");var a=e.options.tabSize,l=en(o,t),s=Oo(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==Mo||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?Oo(en(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=Nn(c-f)),d!=u)return Xt(o,d,Ti(t,0),Ti(t,u.length),"+input"),!(l.stateAfter=null);for(h=0;h<o.sel.ranges.length;h++){var p=o.sel.ranges[h];if(p.head.line==t&&p.head.ch<u.length){me(o,h,new ae(f=Ti(t,u.length),f));break}}}function tr(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=en(e,ce(e,t)):i=on(t),null==i?null:(n(o,i)&&e.cm&&mt(e.cm,i,r),o)}function rr(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&Ai(o.from,qn(n).to)<=0;){var a=n.pop();if(Ai(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}st(t,function(){for(var e=n.length-1;0<=e;e--)Xt(t.doc,"",n[e].from,n[e].to,"+delete");Qt(t)})}function nr(n,e,i,t,o){function r(e){var t,r=(o?oi:ai)(c,l,i,!0);if(null==r){if(e||!((t=a+i)<n.first||t>=n.first+n.size?u=!1:c=en(n,a=t)))return u=!1;l=o?(i<0?ei:Jn)(c):i<0?c.text.length:0}else l=r;return 1}var a=e.line,l=e.ch,s=i,c=en(n,a),u=!0;if("char"==t)r();else if("column"==t)r(!0);else if("word"==t||"group"==t)for(var d=null,f="group"==t,h=n.cm&&n.cm.getHelper(e,"wordChars"),p=!0;!(i<0)||r(!p);p=!1){var m=c.text.charAt(l)||"\n",g=Hn(m,h)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||p||g||(g="s"),d&&d!=g){i<0&&(i=1,r());break}if(g&&(d=g),0<i&&!r(!p))break}var v=_e(n,Ti(a,l),s,!0);return u||(v.hitSide=!0),v}function ir(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(l-(r<0?1.5:.5)*nt(e.display))}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;;){var s=tt(e,a,i);if(!s.outside)break;if(r<0?i<=0:i>=o.height){s.hitSide=!0;break}i+=5*r}return s}function or(e,t,n,r){s.defaults[e]=t,n&&(Ki[e]=r?function(e,t,r){r!=Vi&&n(e,t,r)}:n)}function ar(e){for(var t,r,n,i,o=e.split(/-(?!$)/),a=(e=o[o.length-1],0);a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function lr(e){return"string"==typeof e?to[e]:e}function sr(t,n,i,e,r){if(e&&e.shared)return function(e,r,n,i,o){(i=En(i)).shared=!1;var a=[sr(e,r,n,i,o)],l=a[0],s=i.widgetNode;return Qr(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(sr(e,ue(e,r),ue(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=qn(a)}),new so(a,l)}(t,n,i,e,r);if(t.cm&&!t.cm.curOp)return ct(t.cm,sr)(t,n,i,e,r);var o=new lo(t,r),a=Ai(n,i);if(e&&En(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Bn("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Sr(t,n.line,n,i,o)||n.line!=i.line&&Sr(t,i.line,n,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Li=!0}o.addToHistory&&fn(t,{from:n,to:i,origin:"markText"},t.sel,NaN);var l,s=n.line,c=t.cm;if(t.iter(s,i.line+1,function(e){var t,r;c&&o.collapsed&&!c.options.lineWrapping&&Mr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&nn(e,0),t=e,r=new dr(o,s==n.line?n.ch:null,s==i.line?i.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],r.marker.attachLine(t),++s}),o.collapsed&&t.iter(n.line,i.line+1,function(e){Ar(t,e)&&nn(e,0)}),o.clearOnEnter&&wo(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Mi=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ao,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)pt(c,n.line,i.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=n.line;u<=i.line;u++)mt(c,u,"text");o.atomic&&we(c.doc),_n(c,"markerAdded",c,o)}return o}function cr(e){return e.findMarks(Ti(e.first,0),e.clipPos(Ti(e.lastLine())),function(e){return e.parent})}function ur(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];Qr(r.primary.doc,function(e){n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==zn(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function dr(e,t,r){this.marker=e,this.from=t,this.to=r}function fr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function hr(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r=r||[]).push(e[n]);return r}function pr(e,t){if(t.full)return null;var r=de(e,t.from.line)&&en(e,t.from.line).markedSpans,n=de(e,t.to.line)&&en(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==Ai(t.from,t.to),l=function(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n=n||[]).push(new dr(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n=n||[]).push(new dr(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=qn(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){if(null==(f=l[d]).to)(h=fr(s,f.marker))?c&&(f.to=null==h.to?null:h.to+u):f.to=i}if(s)for(d=0;d<s.length;++d){var f,h;if(null!=(f=s[d]).to&&(f.to+=u),null==f.from)(h=fr(l,f.marker))||(f.from=u,c&&(l=l||[]).push(f));else f.from+=u,c&&(l=l||[]).push(f)}l=l&&mr(l),s&&s!=l&&(s=mr(s));var p=[l];if(!c){var m,g=t.text.length-2;if(0<g&&l)for(d=0;d<l.length;++d)null==l[d].to&&(m=m||[]).push(new dr(l[d].marker,null,null));for(d=0;d<g;++d)p.push(m);p.push(s)}return p}function mr(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function gr(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(mn(r[n]));return i}(e,t),n=pr(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function vr(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function yr(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function br(e){return e.inclusiveLeft?-1:0}function xr(e){return e.inclusiveRight?1:0}function wr(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=Ai(n.from,i.from)||br(e)-br(t);if(o)return-o;var a=Ai(n.to,i.to)||xr(e)-xr(t);return a||t.id-e.id}function kr(e,t){var r,n=Li&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||wr(r,i.marker)<0)&&(r=i.marker);return r}function _r(e){return kr(e,!0)}function Cr(e){return kr(e,!1)}function Sr(e,t,r,n,i){var o=en(e,t),a=Li&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=Ai(c.from,r)||br(s.marker)-br(i),d=Ai(c.to,n)||xr(s.marker)-xr(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(0<Ai(c.to,r)||s.marker.inclusiveRight&&i.inclusiveLeft)||0<=u&&(Ai(c.from,n)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return 1}}}function Mr(e){for(var t;t=_r(e);)e=t.find(-1,!0).line;return e}function Lr(e,t){var r=en(e,t),n=Mr(r);return r==n?t:on(n)}function Tr(e,t){if(t>e.lastLine())return t;var r,n=en(e,t);if(!Ar(e,n))return t;for(;r=Cr(n);)n=r.find(1,!0).line;return on(n)+1}function Ar(e,t){var r=Li&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&Or(e,t,n))return!0}}function Or(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return Or(e,n.line,fr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Or(e,t,i))return!0}function Nr(e,t,r){ln(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Zt(e,null,r)}function qr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Eo(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Un(t.display.measure,Bn("div",[e.node],null,r))}return e.height=e.node.offsetHeight}function zr(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Pr(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=s.innerMode(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Dr(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=s.innerMode(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function Ir(e,t,r,n){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?Qi(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=ue(a,t);var s,c=en(a,t.line),u=Ne(e,t.line,r),d=new oo(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=Dr(l,d,u),n&&s.push(i(!0));return n?s:i()}function Er(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new oo(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&zr(Pr(r,n),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&Fr(e,t,n,d.pos),d.pos=t.length,null):zr(Dr(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e4),u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e4);i(p,u),c=p}}function Wr(e,t,r,n){var o=[e.state.modeGen],i={};Er(e,t.text,e.doc.mode,r,function(e,t){o.push(e,t)},i,n);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Er(e,t.text,l.mode,!0,function(e,t){for(var r=s;c<e;){var n=o[s];e<n&&o.splice(s,1,e,o[s+1],n),s+=2,c=Math.min(e,n)}if(t)if(l.opaque)o.splice(r,s-r,e,"cm-overlay "+t),s=r+2;else for(;r<s;r+=2){var i=o[r+1];o[r+1]=(i?i+" ":"")+"cm-overlay "+t}},i)}return{styles:o,classes:i.bgClass||i.textClass?i:null}}function Hr(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ne(e,on(t)),i=Wr(e,t,t.text.length>e.options.maxHighlightLength?Qi(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Fr(e,t,r,n){var i=e.doc.mode,o=new oo(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Pr(i,r);!o.eol();)Dr(i,o,r),o.start=o.pos}function jr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ho:fo;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Br(e,t){var r=Bn("span",null,null,fi?"padding-right: .1px":null),n={pre:Bn("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,splitSpaces:(ui||fi)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Rr,Yn(e.display.measure)&&(o=sn(a))&&(n.addToken=Kr(n.addToken,o)),n.map=[],$r(a,n,Hr(e,a,t!=e.display.externalMeasured&&on(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=$n(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=$n(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Xn(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return fi&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),_o(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=$n(n.pre.className,n.textClass||"")),n}function Rr(e,t,r,n,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,Ur):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),d=0;;){s.lastIndex=d;var f=s.exec(t),h=f?f.index-d:t.length-d;if(h){var p=document.createTextNode(l.slice(d,d+h));ui&&di<9?u.appendChild(Bn("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!f)break;if(d+=1+h,"\t"==f[0]){var m=e.cm.options.tabSize,g=m-e.col%m;(p=u.appendChild(Bn("span",Nn(g),"cm-tab"))).setAttribute("role","presentation"),p.setAttribute("cm-text","\t"),e.col+=g}else if("\r"==f[0]||"\n"==f[0]){(p=u.appendChild(Bn("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1}else{(p=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),ui&&di<9?u.appendChild(Bn("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),ui&&di<9&&(c=!0),e.pos+=t.length}if(r||n||i||c||a){var v=r||"";n&&(v+=n),i&&(v+=i);var y=Bn("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Ur(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+" "}function Kr(d,f){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var l=e.pos,s=l+t.length;;){for(var c=0;c<f.length;c++){var u=f[c];if(u.to>l&&u.from<=l)break}if(u.to>=s)return d(e,t,r,n,i,o,a);d(e,t.slice(0,u.to-l),r,n,null,o,a),n=null,t=t.slice(u.to-l),l=u.to}}}function Vr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",r.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function $r(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=d=l="",f=null,v=1/0;for(var y=[],b=0;b<n.length;++b){var x=n[b],w=x.marker;"bookmark"==w.type&&x.from==p&&w.widgetNode?y.push(w):x.from<=p&&(null==x.to||x.to>p||w.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),w.className&&(s+=" "+w.className),w.css&&(l=w.css),w.startStyle&&x.from==p&&(u+=" "+w.startStyle),w.endStyle&&x.to==v&&(c+=" "+w.endStyle),w.title&&!d&&(d=w.title),w.collapsed&&(!f||wr(f.marker,w)<0)&&(f=x)):x.from>p&&v>x.from&&(v=x.from)}if(f&&(f.from||0)==p){if(Vr(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}if(!f&&y.length)for(b=0;b<y.length;++b)Vr(t,0,y[b])}if(h<=p)break;for(var k=Math.min(h,v);;){if(g){var _=p+g.length;if(!f){var C=k<_?g.slice(0,k-p):g;t.addToken(t,C,a?a+s:s,u,p+C.length==v?c:"",d,l)}if(k<=_){g=g.slice(k-p),p=k;break}p=_,u=""}g=i.slice(o,o=r[m++]),a=jr(r[m++],t.cm.options)}}else for(m=1;m<r.length;m+=2)t.addToken(t,i.slice(o,o=r[m]),jr(r[m+1],t.cm.options))}function Gr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==qn(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Xr(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){(function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),vr(e),yr(e,r);var i=n?n(e):1;i!=e.height&&nn(e,i)})(e,t,r,i),_n(e,"change",e,n)}function a(e,t){for(var r=e,n=[];r<t;++r)n.push(new uo(c[r],o(r),i));return n}var l=n.from,s=n.to,c=n.text,u=en(e,l.line),d=en(e,s.line),f=qn(c),h=o(c.length-1),p=s.line-l.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,n)){var m=a(0,c.length-1);r(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)r(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{(m=a(1,c.length-1)).push(new uo(f+u.text.slice(s.ch),h,i)),r(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,m)}else if(1==c.length)r(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{r(u,u.text.slice(0,l.ch)+c[0],o(0)),r(d,f+d.text.slice(s.ch),h);m=a(1,c.length-1);1<p&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}_n(e,"change",e,n)}function Yr(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function Zr(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}function Qr(e,l,s){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Jr(e,t){if(t.cm)throw new Error("This document is already in use.");n((e.doc=t).cm=e),r(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,pt(e)}function en(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function tn(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function rn(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function nn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function on(e){if(null==e.parent)return null;for(var t=e.parent,r=zn(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function an(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(n=0;n<e.lines.length;++n){var a=e.lines[n].height;if(t<a)break;t-=a}return r+n}function ln(e){for(var t=0,r=(e=Mr(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(n=0;n<o.children.length;++n){var a=o.children[n];if(a==r)break;t+=a.height}return t}function sn(e){var t=e.order;return null==t&&(t=e.order=ia(e.text)),t}function cn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function un(e,t){var r={from:j(t.from),to:Ri(t),text:tn(e,t.from,t.to)};return pn(e,r,t.from.line,t.to.line+1),Qr(e,function(e){pn(e,r,t.from.line,t.to.line+1)},!0),r}function dn(e){for(;e.length;){if(!qn(e).ranges)break;e.pop()}}function fn(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=(a=i).lastOp==n?(dn(a.done),qn(a.done)):a.done.length&&!qn(a.done).ranges?qn(a.done):1<a.done.length&&!a.done[a.done.length-2].ranges?(a.done.pop(),qn(a.done)):void 0)){var s=qn(o.changes);0==Ai(t.from,t.to)&&0==Ai(t.from,s.to)?s.to=Ri(t):o.changes.push(un(e,t))}else{var c=qn(i.done);for(c&&c.ranges||hn(e.sel,i.done),o={changes:[un(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||_o(e,"historyAdded")}function hn(e,t){var r=qn(t);r&&r.ranges&&r.equals(e)||t.push(e)}function pn(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i=i||(r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function mn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t=t||e.slice(0,r):t&&t.push(e[r]);return t?t.length?t:null:e}function gn(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?oe.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&-1<zn(t,Number(c[1]))&&(qn(l)[d]=u[d],delete u[d])}}}return i}function vn(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function yn(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)vn(o.ranges[l].anchor,t,r,n),vn(o.ranges[l].head,t,r,n)}else{for(l=0;l<o.changes.length;++l){var s=o.changes[l];if(r<s.from.line)s.from=Ti(s.from.line+n,s.from.ch),s.to=Ti(s.to.line+n,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function bn(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;yn(e.done,r,n,i),yn(e.undone,r,n,i)}function xn(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wn(e){return e.target||e.srcElement}function kn(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),wi&&e.ctrlKey&&1==t&&(t=3),t}function _n(e,t){function r(e){return function(){e.apply(null,o)}}var n=e._handlers&&e._handlers[t];if(n){var i,o=Array.prototype.slice.call(arguments,2);Di?i=Di.delayedCallbacks:Co?i=Co:(i=Co=[],setTimeout(Cn,0));for(var a=0;a<n.length;++a)i.push(r(n[a]))}}function Cn(){var e=Co;Co=null;for(var t=0;t<e.length;++t)e[t]()}function Sn(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),_o(e,r||t.type,e,t),xn(t)||t.codemirrorIgnore}function Mn(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==zn(r,t[n])&&r.push(t[n])}function Ln(e,t){var r=e._handlers&&e._handlers[t];return r&&0<r.length}function Tn(e){e.prototype.on=function(e,t){wo(this,e,t)},e.prototype.off=function(e,t){ko(this,e,t)}}function An(){this.id=null}function On(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}function Nn(e){for(;No.length<=e;)No.push(qn(No)+" ");return No[e]}function qn(e){return e[e.length-1]}function zn(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function Pn(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Dn(){}function In(e,t){var r;return r=Object.create?Object.create(e):(Dn.prototype=e,new Dn),t&&En(t,r),r}function En(e,t,r){for(var n in t=t||{},e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Wn(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Hn(e,t){return t?!!(-1<t.source.indexOf("\\w")&&Do(e))||t.test(e):Do(e)}function Fn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}function jn(e){return 768<=e.charCodeAt(0)&&Io.test(e)}function Bn(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Rn(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function Un(e,t){return Rn(e).appendChild(t)}function Kn(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Vn(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $n(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Vn(r[n]).test(t)&&(t+=" "+r[n]);return t}function Gn(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Xn(e){if(null==Wo){var t=Bn("span","");Un(e,Bn("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Wo=t.offsetWidth<=1&&2<t.offsetHeight&&!(ui&&di<8))}var r=Wo?Bn("span",""):Bn("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Yn(e){if(null!=Ho)return Ho;var t=Un(e,document.createTextNode("AخA")),r=zo(t,0,1).getBoundingClientRect();if(r&&r.left!=r.right){var n=zo(t,1,2).getBoundingClientRect();return Ho=n.right-r.right<3}}function Zn(e){return e.level%2?e.to:e.from}function Qn(e){return e.level%2?e.from:e.to}function Jn(e){var t=sn(e);return t?Zn(t[0]):0}function ei(e){var t=sn(e);return t?Qn(qn(t)):e.text.length}function ti(e,t){var r=en(e.doc,t),n=Mr(r);n!=r&&(t=on(n));var i=sn(n),o=i?(i[0].level%2?ei:Jn)(n):0;return Ti(t,o)}function ri(e,t){var r=ti(e,t.line),n=en(e.doc,r.line),i=sn(n);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return Ti(r.line,a?0:o)}function ni(e,t){Yo=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return o=e,a=i.level,l=e[r].level,s=o[0].level,a==s||l!=s&&a<l?(i.from!=i.to&&(Yo=r),n):(i.from!=i.to&&(Yo=n),r);r=n}}var o,a,l,s;return r}function ii(e,t,r,n){if(!n)return t+r;for(;0<(t+=r)&&jn(e.text.charAt(t)););return t}function oi(e,t,r,n){var i=sn(e);if(!i)return ai(e,t,r,n);for(var o=ni(i,t),a=i[o],l=ii(e,t,a.level%2?-r:r,n);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return ni(i,l)==o?l:0<r==(a=i[o+=r]).level%2?a.to:a.from;if(!(a=i[o+=r]))return null;l=0<r==a.level%2?ii(e,a.to,-1,n):ii(e,a.from,1,n)}}function ai(e,t,r,n){var i=t+r;if(n)for(;0<i&&jn(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}var li=/gecko\/\d/i.test(navigator.userAgent),si=/MSIE \d/.test(navigator.userAgent),ci=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ui=si||ci,di=ui&&(si?document.documentMode||6:ci[1]),fi=/WebKit\//.test(navigator.userAgent),hi=fi&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pi=/Chrome\//.test(navigator.userAgent),mi=/Opera\//.test(navigator.userAgent),gi=/Apple Computer/.test(navigator.vendor),vi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),yi=/PhantomJS/.test(navigator.userAgent),bi=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),xi=bi||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),wi=bi||/Mac/.test(navigator.platform),ki=/win/i.test(navigator.platform),_i=mi&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);(_i=_i&&Number(_i[1]))&&15<=_i&&(fi=!(mi=!1));var Ci=wi&&(hi||mi&&(null==_i||_i<12.11)),Si=li||ui&&9<=di,Mi=!1,Li=!1;e.prototype=En({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&0<e.clientHeight&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=wi&&!vi?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;function t(e){wn(e)!=r.vert&&wn(e)!=r.horiz&&ct(r.cm,_t)(e)}var r=this;wo(this.vert,"mousedown",t),wo(this.horiz,"mousedown",t)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},e.prototype),o.prototype=En({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},o.prototype),s.scrollbarModel={native:e,null:o},C.prototype.signal=function(e,t){Ln(e,t)&&this.events.push(arguments)},C.prototype.finish=function(){for(var e=0;e<this.events.length;e++)_o.apply(null,this.events[e])};var Ti=s.Pos=function(e,t){return this instanceof Ti?(this.line=e,void(this.ch=t)):new Ti(e,t)},Ai=s.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Oi=null;Z.prototype=En({init:function(t){function e(e){if(n.somethingSelected())Oi=n.getSelections(),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,o.value=Oi.join("\n"),qo(o));else{if(!n.options.lineWiseCopyCut)return;var t=X(n);Oi=t.text,"cut"==e.type?n.setSelections(t.ranges,null,Lo):(r.prevInput="",o.value=t.text.join("\n"),qo(o))}"cut"==e.type&&(n.state.cutIncoming=!0)}var r=this,n=this.cm,i=this.wrapper=Q(),o=this.textarea=i.firstChild;t.wrapper.insertBefore(i,t.wrapper.firstChild),bi&&(o.style.width="0px"),wo(o,"input",function(){ui&&9<=di&&r.hasSelection&&(r.hasSelection=null),r.poll()}),wo(o,"paste",function(e){return!!$(e,n)||(n.state.pasteIncoming=!0,void r.fastPoll())}),wo(o,"cut",e),wo(o,"copy",e),wo(t.scroller,"paste",function(e){wt(t,e)||(n.state.pasteIncoming=!0,r.focus())}),wo(t.lineSpace,"selectstart",function(e){wt(t,e)||yo(e)}),wo(o,"compositionstart",function(){var e=n.getCursor("from");r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),wo(o,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Se(e);if(e.options.moveInputWithCursor){var i=Qe(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},showSelection:function(e){var t=this.cm.display;Un(t.cursorDiv,e.cursors),Un(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary(),a=(t=$o&&(100<o.to().line-o.from().line||1e3<(r=n.getSelection()).length))?"-":r||n.getSelection();this.textarea.value=a,n.state.focused&&qo(this.textarea),ui&&9<=di&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",ui&&9<=di&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!xi||Kn()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Vo(t)&&!r&&!this.composing||K(e)||e.options.disableInput||e.state.keySeq)return!1;var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(ui&&9<=di&&this.hasSelection===n||wi&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=n.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(r.length,n.length);o<a&&r.charCodeAt(o)==n.charCodeAt(o);)++o;var l=this;return st(e,function(){V(e,n.slice(o),r.length-o,null,l.composing?"*compose":null),1e3<n.length||-1<n.indexOf("\n")?t.value=l.prevInput="":l.prevInput=n,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){ui&&9<=di&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function r(){if(null!=a.selectionStart){var e=i.somethingSelected(),t=""+(e?a.value:"");a.value="⇚",a.value=t,n.prevInput=e?"":"",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function t(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",a.style.cssText=c,ui&&di<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!ui||ui&&di<9)&&r();var e=0,t=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&0<a.selectionEnd&&""==n.prevInput?ct(i,eo.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(t,500):o.input.reset()};o.detectingSelectAll=setTimeout(t,200)}}var n=this,i=n.cm,o=i.display,a=n.textarea,l=kt(i,e),s=o.scroller.scrollTop;if(l&&!mi){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(l)&&ct(i,ye)(i.doc,se(l),Lo);var c=a.style.cssText;if(n.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ui?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",fi)var u=window.scrollY;if(o.input.focus(),fi&&window.scrollTo(null,u),o.input.reset(),i.somethingSelected()||(a.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),ui&&9<=di&&r(),Si){xo(e);var d=function(){ko(window,"mouseup",d),setTimeout(t,20)};wo(window,"mouseup",d)}else setTimeout(t,50)}},setUneditable:Dn,needsContentAttribute:!1},Z.prototype),J.prototype=En({init:function(e){function t(e){if(o.somethingSelected())Oi=o.getSelections(),"cut"==e.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var t=X(o);Oi=t.text,"cut"==e.type&&o.operation(function(){o.setSelections(t.ranges,0,Lo),o.replaceSelection("",null,"cut")})}if(e.clipboardData&&!bi)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Oi.join("\n"));else{var r=Q(),n=r.firstChild;o.display.lineSpace.insertBefore(r,o.display.lineSpace.firstChild),n.value=Oi.join("\n");var i=document.activeElement;qo(n),setTimeout(function(){o.display.lineSpace.removeChild(r),i.focus()},50)}}var i=this,o=i.cm,r=i.div=e.lineDiv;r.contentEditable="true",Y(r),wo(r,"paste",function(e){$(e,o)}),wo(r,"compositionstart",function(e){var t=e.data;if(i.composing={sel:o.doc.sel,data:t,startData:t},t){var r=o.doc.sel.primary(),n=o.getLine(r.head.line).indexOf(t,Math.max(0,r.head.ch-t.length));-1<n&&n<=r.head.ch&&(i.composing.sel=se(Ti(r.head.line,n),Ti(r.head.line,n+t.length)))}}),wo(r,"compositionupdate",function(e){i.composing.data=e.data}),wo(r,"compositionend",function(e){var t=i.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||i.applyComposition(t),i.composing==t&&(i.composing=null)},50))}),wo(r,"touchstart",function(){i.forceCompositionEnd()}),wo(r,"input",function(){i.composing||i.pollContent()||st(i.cm,function(){pt(o)})}),wo(r,"copy",t),wo(r,"cut",t)},prepareSelection:function(){var e=Se(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=re(this.cm,e.anchorNode,e.anchorOffset),n=re(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Ai(R(r,n),t.from())||0!=Ai(B(r,n),t.to())){var i=ee(this.cm,t.from()),o=ee(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=zo(i.node,i.offset,o.offset,o.node)}catch(e){}u&&(e.removeAllRanges(),e.addRange(u),l&&null==e.anchorNode?e.addRange(l):li&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Un(this.cm.display.cursorDiv,e.cursors),Un(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Eo(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){var t=this;this.selectionInEditor()?this.pollSelection():st(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var r=re(t,e.anchorNode,e.anchorOffset),n=re(t,e.focusNode,e.focusOffset);r&&n&&st(t,function(){ye(t.doc,se(r,n),Lo),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e,t=this.cm,r=t.display,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(i.line<r.viewFrom||o.line>r.viewTo-1)return!1;if(i.line==r.viewFrom||0==(e=vt(t,i.line)))var a=on(r.view[0].line),l=r.view[0].node;else a=on(r.view[e].line),l=r.view[e-1].node.nextSibling;var s=vt(t,o.line);if(s==r.view.length-1)var c=r.viewTo-1,u=r.lineDiv.lastChild;else c=on(r.view[s+1].line)-1,u=r.view[s+1].node.previousSibling;for(var d=t.doc.splitLines(ie(t,l,u,a,c)),f=tn(t.doc,Ti(a,0),Ti(c,en(t.doc,c).text.length));1<d.length&&1<f.length;)if(qn(d)==qn(f))d.pop(),f.pop(),c--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),a++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=qn(d),b=qn(f),x=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;d[d.length-1]=y.slice(0,y.length-p),d[0]=d[0].slice(h);var w=Ti(a,h),k=Ti(c,f.length?qn(f).length-p:0);return 1<d.length||d[0]||Ai(w,k)?(Xt(t.doc,d,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&ct(this.cm,V)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),ct(this.cm,V)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:Dn,resetPosition:Dn,needsContentAttribute:!0},J.prototype),s.inputStyles={textarea:Z,contenteditable:J},oe.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=Ai(r.anchor,n.anchor)||0!=Ai(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ae(j(this.ranges[t].anchor),j(this.ranges[t].head));return new oe(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=Ai(t,n.from())&&Ai(e,n.to())<=0)return r}return-1}},ae.prototype={from:function(){return R(this.anchor,this.head)},to:function(){return B(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ni,qi,zi,Pi={left:0,right:0,top:0,bottom:0},Di=null,Ii=0,Ei=0,Wi=0,Hi=null;ui?Hi=-.53:li?Hi=15:pi?Hi=-.7:gi&&(Hi=-1/3);var Fi=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};s.wheelEventPixels=function(e){var t=Fi(e);return t.x*=Hi,t.y*=Hi,t};var ji=new An,Bi=null,Ri=s.changeEnd=function(e){return e.text?Ti(e.from.line+e.text.length-1,qn(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};s.prototype={constructor:s,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,Ki.hasOwnProperty(e)&&ct(this,Ki[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](lr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:ut(function(e,t){var r=e.token?e:s.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:e,opaque:t&&t.opaque}),this.state.modeGen++,pt(this)}),removeOverlay:ut(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void pt(this)}}),indentLine:ut(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),de(this.doc,e)&&er(this,e,t,r)}),indentSelection:ut(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(er(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Qt(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<r;++s)er(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&0<c[n].from().ch&&me(this.doc,n,new ae(o,c[n].to()),Lo)}}}),getTokenAt:function(e,t){return Ir(this,e,t)},getLineTokens:function(e,t){return Ir(this,Ti(e),t,!0)},getTokenTypeAt:function(e){e=ue(this.doc,e);var t,r=Hr(this,en(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=1+a}}var l=t?t.indexOf("cm-overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?s.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Zi.hasOwnProperty(t))return r;var n=Zi[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(o=0;o<n._global.length;o++){var l=n._global[o];l.pred(i,this)&&-1==zn(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var r=this.doc;return Ne(this,(e=ce(r,null==e?r.first+r.size-1:e))+1,t)},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Qe(this,null==e?r.head:"object"==typeof e?ue(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Ze(this,ue(this.doc,e),t||"page")},coordsChar:function(e,t){return tt(this,(e=Ye(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ye(this,{top:e,left:0},t||"page").top,an(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r,n=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:i<e&&(e=i,n=!0),r=en(this.doc,e)}else r=e;return Xe(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-ln(r):0)},defaultTextHeight:function(){return nt(this.display)},defaultCharWidth:function(){return it(this.display)},setGutterMarker:ut(function(e,r,n){return tr(this.doc,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&Fn(t)&&(e.gutterMarkers=null),1})}),clearGutter:ut(function(t){var r=this,e=r.doc,n=e.first;e.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&(e.gutterMarkers[t]=null,mt(r,n,"gutter"),Fn(e.gutterMarkers)&&(e.gutterMarkers=null)),++n})}),lineInfo:function(e){if("number"==typeof e){if(!de(this.doc,e))return null;var t=e;if(!(e=en(this.doc,e)))return null}else{if(null==(t=on(e)))return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,l,s,c,u,d=this.display,f=(e=Qe(this,ue(this.doc,e))).bottom,h=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),d.sizer.appendChild(t),"over"==n)f=e.top;else if("above"==n||"near"==n){var p=Math.max(d.wrapper.clientHeight,this.doc.height),m=Math.max(d.sizer.clientWidth,d.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>p)&&e.top>t.offsetHeight?f=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=p&&(f=e.bottom),h+t.offsetWidth>m&&(h=m-t.offsetWidth)}t.style.top=f+"px",t.style.left=t.style.right="","right"==i?(h=d.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?h=0:"middle"==i&&(h=(d.sizer.clientWidth-t.offsetWidth)/2),t.style.left=h+"px"),r&&(o=this,l=f,s=(a=h)+t.offsetWidth,c=f+t.offsetHeight,null!=(u=Yt(o,a,l,s,c)).scrollTop&&Tt(o,u.scrollTop),null!=u.scrollLeft&&At(o,u.scrollLeft))},triggerOnKeyDown:ut(Pt),triggerOnKeyPress:ut(It),triggerOnKeyUp:Dt,execCommand:function(e){return eo.hasOwnProperty(e)?eo[e].call(null,this):void 0},triggerElectric:ut(function(e){G(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=0,a=ue(this.doc,e);o<t&&!(a=nr(this.doc,a,i,r,n)).hitSide;++o);return a},moveH:ut(function(t,r){var n=this;n.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?nr(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},Ao)}),deleteH:ut(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):rr(this,function(e){var t=nr(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=0,l=ue(this.doc,e);a<t;++a){var s=Qe(this,l,"div");if(null==o?o=s.left:s.left=o,(l=ir(this,s,i,r)).hitSide)break}return l},moveV:ut(function(n,i){var o=this,a=this.doc,l=[],s=!o.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(s)return n<0?e.from():e.to();var t=Qe(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var r=ir(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Zt(o,null,Ze(o,r,"div").top-t.top),r},Ao),l.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=l[e]}),findWordAt:function(e){var t=en(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");(e.xRel<0||n==t.length)&&r?--r:++n;for(var o=t.charAt(r),a=Hn(o,i)?function(e){return Hn(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Hn(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new ae(Ti(e.line,r),Ti(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?Bo:jo)(this.display.cursorDiv,"CodeMirror-overwrite"),_o(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Kn()},scrollTo:ut(function(e,t){null==e&&null==t||Jt(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-De(this)-this.display.barHeight,width:e.scrollWidth-De(this)-this.display.barWidth,clientHeight:Ee(this),clientWidth:Ie(this)}},scrollIntoView:ut(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Ti(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Jt(this),this.curOp.scrollToPos=e;else{var r=Yt(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:ut(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&Ke(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){mt(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,_o(n,"refresh",this)}),operation:function(e){return st(this,e)},refresh:ut(function(){var e=this.display.cachedTextHeight;pt(this),this.curOp.forceUpdate=!0,Ve(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),l(this),(null==e||.5<Math.abs(e-nt(this.display)))&&n(this),_o(this,"refresh",this)}),swapDoc:ut(function(e){var t=this.doc;return t.cm=null,Jr(this,e),Ve(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_n(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Tn(s);var Ui=s.defaults={},Ki=s.optionHandlers={},Vi=s.Init={toString:function(){return"CodeMirror.Init"}};or("value","",function(e,t){e.setValue(t)},!0),or("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),or("indentUnit",2,r,!0),or("indentWithTabs",!1),or("smartIndent",!0),or("tabSize",4,function(e){t(e),Ve(e),pt(e)},!0),or("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(Ti(o,r))}o++});for(var t=i.length-1;0<=t;t--)Xt(e.doc,n,i[t],Ti(i[t].line,i[t].ch+n.length))}}),or("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=s.Init&&e.refresh()}),or("specialCharPlaceholder",function(e){var t=Bn("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t},function(e){e.refresh()},!0),or("electricChars",!0),or("inputStyle",xi?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),or("rtlMoveVisually",!ki),or("wholeLineUpdateBefore",!0),or("theme","default",function(e){u(e),i(e)},!0),or("keyMap","default",function(e,t,r){var n=lr(t),i=r!=s.Init&&lr(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),or("extraKeys",null),or("lineWrapping",!1,function(e){e.options.lineWrapping?(Bo(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(jo(e.display.wrapper,"CodeMirror-wrap"),f(e)),n(e),pt(e),Ve(e),setTimeout(function(){y(e)},100)},!0),or("gutters",[],function(e){m(e.options),i(e)},!0),or("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?k(e.display)+"px":"0",e.refresh()},!0),or("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),or("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),or("lineNumbers",!1,function(e){m(e.options),i(e)},!0),or("firstLineNumber",1,i,!0),or("lineNumberFormatter",function(e){return e},i,!0),or("showCursorWhenSelecting",!1,Ce,!0),or("resetSelectionOnContextMenu",!0),or("lineWiseCopyCut",!0),or("readOnly",!1,function(e,t){"nocursor"==t?(Wt(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),or("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),or("dragDrop",!0,function(e,t,r){if(!t!=!(r&&r!=s.Init)){var n=e.display.dragFunctions,i=t?wo:ko;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}),or("cursorBlinkRate",530),or("cursorScrollMargin",0),or("cursorHeight",1,Ce,!0),or("singleCursorHeightPerLine",!0,Ce,!0),or("workTime",100),or("workDelay",100),or("flattenSpans",!0,t,!0),or("addModeClass",!1,t,!0),or("pollInterval",100),or("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),or("historyEventDelay",1250),or("viewportMargin",10,function(e){e.refresh()},!0),or("maxHighlightLength",1e4,t,!0),or("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),or("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),or("autofocus",null);var $i=s.modes={},Gi=s.mimeModes={};s.defineMode=function(e,t){s.defaults.mode||"null"==e||(s.defaults.mode=e),2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$i[e]=t},s.defineMIME=function(e,t){Gi[e]=t},s.resolveMode=function(e){if("string"==typeof e&&Gi.hasOwnProperty(e))e=Gi[e];else if(e&&"string"==typeof e.name&&Gi.hasOwnProperty(e.name)){var t=Gi[e.name];"string"==typeof t&&(t={name:t}),(e=In(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return s.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},s.getMode=function(e,t){t=s.resolveMode(t);var r=$i[t.name];if(!r)return s.getMode(e,"text/plain");var n=r(e,t);if(Xi.hasOwnProperty(t.name)){var i=Xi[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n},s.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),s.defineMIME("text/plain","null");var Xi=s.modeExtensions={};s.extendMode=function(e,t){En(t,Xi.hasOwnProperty(e)?Xi[e]:Xi[e]={})},s.defineExtension=function(e,t){s.prototype[e]=t},s.defineDocExtension=function(e,t){mo.prototype[e]=t},s.defineOption=or;var Yi=[];s.defineInitHook=function(e){Yi.push(e)};var Zi=s.helpers={};s.registerHelper=function(e,t,r){Zi.hasOwnProperty(e)||(Zi[e]=s[e]={_global:[]}),Zi[e][t]=r},s.registerGlobalHelper=function(e,t,r,n){s.registerHelper(e,t,n),Zi[e]._global.push({pred:r,val:n})};var Qi=s.copyState=function(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},Ji=s.startState=function(e,t,r){return!e.startState||e.startState(t,r)};s.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var eo=s.commands={selectAll:function(e){e.setSelection(Ti(e.firstLine(),0),Ti(e.lastLine()),Lo)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Lo)},killLine:function(r){rr(r,function(e){if(e.empty()){var t=en(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:Ti(e.head.line+1,0)}:{from:e.head,to:Ti(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){rr(t,function(e){return{from:Ti(e.from().line,0),to:ue(t.doc,Ti(e.to().line+1,0))}})},delLineLeft:function(e){rr(e,function(e){return{from:Ti(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){rr(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){rr(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Ti(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Ti(e.lastLine()))},goLineStart:function(t){t.extendSelectionsBy(function(e){return ti(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){t.extendSelectionsBy(function(e){return ri(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){t.extendSelectionsBy(function(e){return function(e,t){for(var r,n=en(e.doc,t);r=Cr(n);)n=r.find(1,!0).line,t=null;var i=sn(n),o=i?(i[0].level%2?Jn:ei)(n):n.text.length;return Ti(null==t?on(n):t,o)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){r.extendSelectionsBy(function(e){var t=r.charCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},Ao)},goLineLeft:function(r){r.extendSelectionsBy(function(e){var t=r.charCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},Ao)},goLineLeftSmart:function(n){n.extendSelectionsBy(function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?ri(n,e.head):r},Ao)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=Oo(e.getLine(o.line),o.ch,n);t.push(new Array(n-a%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){st(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++){var n=e[r].head,i=en(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new Ti(n.line,n.ch-1)),0<n.ch)n=new Ti(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),Ti(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=en(a.doc,n.line-1).text;o&&a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),Ti(n.line-1,o.length-1),Ti(n.line,1),"+transpose")}t.push(new ae(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){st(n,function(){for(var e=n.listSelections().length,t=0;t<e;t++){var r=n.listSelections()[t];n.replaceRange(n.doc.lineSeparator(),r.anchor,r.head,"+input"),n.indentLine(r.from().line+1,null,!0),Qt(n)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},to=s.keyMap={};to.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},to.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},to.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"},to.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},to.default=wi?to.macDefault:to.pcDefault,s.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Pn(r.split(" "),ar),o=0;o<i.length;o++){var a,l;a=o==i.length-1?(l=i.join(" "),n):(l=i.slice(0,o+1).join(" "),"...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e};var ro=s.lookupKey=function(e,t,r,n){var i=(t=lr(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ro(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=ro(e,t.fallthrough[o],r,n);if(a)return a}}},no=s.isModifierKey=function(e){var t="string"==typeof e?e:Xo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},io=s.keyName=function(e,t){if(mi&&34==e.keyCode&&e.char)return!1;var r=Xo[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(Ci?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(Ci?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};s.fromTextArea=function(t,e){function r(){t.value=l.getValue()}if((e=e?En(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=Kn();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}if(t.form&&(wo(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form,o=i.submit;try{var a=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=a}}catch(e){}}e.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(ko(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=o))}},t.style.display="none";var l=s(function(e){t.parentNode.insertBefore(e,t.nextSibling)},e);return l};var oo=s.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};oo.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return-1<t?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oo(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oo(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Oo(this.string,null,this.tabSize)-(this.lineStart?Oo(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}function i(e){return r?e.toLowerCase():e}return i(this.string.substr(this.pos,e.length))==i(e)?(!1!==t&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ao=0,lo=s.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ao};Tn(lo),lo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ot(e),Ln(this,"clear")){var r=this.find();r&&_n(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=fr(a.markedSpans,this);e&&!this.collapsed?mt(e,on(a),"text"):e&&(null!=l.to&&(i=on(a)),null!=l.from&&(n=on(a))),a.markedSpans=hr(a.markedSpans,l),null==l.from&&this.collapsed&&!Ar(this.doc,a)&&e&&nn(a,nt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(o=0;o<this.lines.length;++o){var s=Mr(this.lines[o]),c=p(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&pt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&we(e.doc)),e&&_n(e,"markerCleared",e,this),t&&at(e),this.parent&&this.parent.clear()}},lo.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],a=fr(o.markedSpans,this);if(null!=a.from&&(r=Ti(t?o:on(o),a.from),-1==e))return r;if(null!=a.to&&(n=Ti(t?o:on(o),a.to),1==e))return n}return r&&{from:r,to:n}},lo.prototype.changed=function(){var o=this.find(-1,!0),a=this,l=this.doc.cm;o&&l&&st(l,function(){var e=o.line,t=on(o.line),r=Fe(l,t);if(r&&(Ue(r),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ar(a.doc,e)&&null!=a.height){var n=a.height;a.height=null;var i=qr(a)-n;i&&nn(e,e.height+i)}})},lo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=zn(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},lo.prototype.detachLine=function(e){if(this.lines.splice(zn(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};ao=0;var so=s.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Tn(so),so.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_n(this,"clear")}},so.prototype.find=function(e,t){return this.primary.find(e,t)};var co=s.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Tn(co),co.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=on(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=qr(this);nn(r,Math.max(0,r.height-o)),e&&st(e,function(){Nr(e,r,-o),mt(e,n,"widget")})}},co.prototype.changed=function(){var e=this.height,t=this.doc.cm,r=this.line;this.height=null;var n=qr(this)-e;n&&(nn(r,r.height+n),t&&st(t,function(){t.curOp.forceUpdate=!0,Nr(t,r,n)}))};var uo=s.Line=function(e,t,r){this.text=e,yr(this,t),this.height=r?r(this):1};Tn(uo),uo.prototype.lineNo=function(){return on(this)};var fo={},ho={};Yr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,(o=i).parent=null,vr(o),_n(i,"delete")}var o;this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},Zr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof Yr))){var l=[];this.collapse(l),this.children=[new Yr(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&50<i.lines.length){for(;50<i.lines.length;){var a=new Yr(i.lines.splice(i.lines.length-25,25));i.height-=a.height,this.children.splice(n+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Zr(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=zn(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new Zr(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var po=0,mo=s.Doc=function(e,t,r,n){if(!(this instanceof mo))return new mo(e,t,r,n);null==r&&(r=0),Zr.call(this,[new Yr([new uo("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var i=Ti(r,0);this.sel=se(i),this.history=new cn(null),this.id=++po,this.modeOption=t,this.lineSep=n,"string"==typeof e&&(e=this.splitLines(e)),Xr(this,{from:i,to:i,text:e}),ye(this,se(i),Lo)};mo.prototype=In(Zr.prototype,{constructor:mo,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=rn(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:dt(function(e){var t=Ti(this.first,0),r=this.first+this.size-1;Ut(this,{from:t,to:Ti(r,en(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),ye(this,se(t))}),replaceRange:function(e,t,r,n){Xt(this,e,t=ue(this,t),r=r?ue(this,r):t,n)},getRange:function(e,t,r){var n=tn(this,ue(this,e),ue(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return de(this,e)?en(this,e):void 0},getLineNumber:function(e){return on(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=en(this,e)),Mr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ue(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dt(function(e,t,r){ge(this,ue(this,"number"==typeof e?Ti(e,t||0):e),null,r)}),setSelection:dt(function(e,t,r){ge(this,ue(this,e),ue(this,t||e),r)}),extendSelection:dt(function(e,t,r){he(this,ue(this,e),t&&ue(this,t),r)}),extendSelections:dt(function(e,t){pe(this,function(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ue(e,t[n]);return r}(this,e))}),extendSelectionsBy:dt(function(e,t){pe(this,Pn(this.sel.ranges,e),t)}),setSelections:dt(function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new ae(ue(this,e[n].anchor),ue(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ye(this,le(i,t),r)}}),addSelection:dt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ae(ue(this,e),ue(this,t||e))),ye(this,le(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=tn(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=tn(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:dt(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=Ti(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Bt(l.from,i,o),c=Bt(Ri(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=Ai(u.head,u.anchor)<0;n[a]=new ae(d?c:s,d?s:c)}else n[a]=new ae(s,s)}return new oe(n,e.sel.primIndex)}(this,n,t);for(o=n.length-1;0<=o;o--)Ut(this,n[o]);l?ve(this,l):this.cm&&Qt(this.cm)}),undo:dt(function(){Vt(this,"undo")}),redo:dt(function(){Vt(this,"redo")}),undoSelection:dt(function(){Vt(this,"undo",!0)}),redoSelection:dt(function(){Vt(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new cn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gn(this.history.done),undone:gn(this.history.undone)}},setHistory:function(e){var t=this.history=new cn(this.history.maxGeneration);t.done=gn(e.done.slice(0),null,!0),t.undone=gn(e.undone.slice(0),null,!0)},addLineClass:dt(function(e,r,n){return tr(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(Vn(n).test(e[t]))return;e[t]+=" "+n}else e[t]=n;return 1})}),removeLineClass:dt(function(e,o,a){return tr(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(r){if(null==a)e[t]=null;else{var n=r.match(Vn(a));if(!n)return;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return 1}})}),addLineWidget:dt(function(e,t,r){return i=e,o=new co(n=this,t,r),(a=n.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),tr(n,i,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==o.insertAt?t.push(o):t.splice(Math.min(t.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ar(n,e)){var r=ln(e)<n.scrollTop;nn(e,e.height+qr(o)),r&&Zt(a,null,o.height),a.curOp.forceUpdate=!0}return 1}),o;var n,i,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return sr(this,ue(this,e),ue(this,t),r,"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return sr(this,e=ue(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=en(this,(e=ue(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,a){i=ue(this,i),o=ue(this,o);var l=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];s==i.line&&i.ch>n.to||null==n.from&&s!=i.line||s==o.line&&n.from>o.ch||a&&!a(n.marker)||l.push(n.marker.parent||n.marker)}++s}),l},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first;return this.iter(function(e){var t=e.text.length+1;return r<t?(n=r,!0):(r-=t,void++i)}),ue(this,Ti(i,n))},indexFromPos:function(e){var t=(e=ue(this,e)).ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new mo(rn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new mo(rn(this,t,r),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(Ai(o,a)){var l=sr(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,cr(this)),n},unlinkDoc:function(e){if(e instanceof s&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),ur(cr(this));break}}if(e.history==this.history){var r=[e.id];Qr(e,function(e){r.push(e.id)},!0),e.history=new cn(null),e.history.done=gn(this.history.done,r),e.history.undone=gn(this.history.undone,r)}},iterLinkedDocs:function(e){Qr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ko(e)},lineSeparator:function(){return this.lineSep||"\n"}}),mo.prototype.eachLine=mo.prototype.iter;var go="iter insert remove copy getEditor constructor".split(" ");for(var vo in mo.prototype)mo.prototype.hasOwnProperty(vo)&&zn(go,vo)<0&&(s.prototype[vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(mo.prototype[vo]));Tn(mo);var yo=s.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},bo=s.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},xo=s.e_stop=function(e){yo(e),bo(e)},wo=s.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});(n[t]||(n[t]=[])).push(r)}},ko=s.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers&&e._handlers[t];if(!n)return;for(var i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}}},_o=s.signal=function(e,t){var r=e._handlers&&e._handlers[t];if(r)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},Co=null,So=30,Mo=s.Pass={toString:function(){return"CodeMirror.Pass"}},Lo={scroll:!1},To={origin:"*mouse"},Ao={origin:"+move"};An.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Oo=s.countColumn=function(e,t,r,n,i){null!=t||-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}},No=[""],qo=function(e){e.select()};bi?qo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ui&&(qo=function(e){try{e.select()}catch(e){}});var zo,Po=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Do=s.isWordChar=function(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Po.test(e))},Io=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;zo=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Eo=s.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)};ui&&di<11&&(Kn=function(){try{return document.activeElement}catch(e){return document.body}});var Wo,Ho,Fo,jo=s.rmClass=function(e,t){var r=e.className,n=Vn(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Bo=s.addClass=function(e,t){var r=e.className;Vn(t).test(r)||(e.className+=(r?" ":"")+t)},Ro=!1,Uo=function(){if(ui&&di<9)return!1;var e=Bn("div");return"draggable"in e||"dragDrop"in e}(),Ko=s.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Vo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},$o="oncopy"in(Fo=Bn("div"))||(Fo.setAttribute("oncopy","return;"),"function"==typeof Fo.oncopy),Go=null,Xo={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};s.keyNames=Xo,function(){for(var e=0;e<10;e++)Xo[e+48]=Xo[e+96]=String(e);for(e=65;e<=90;e++)Xo[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Xo[e+111]=Xo[e+63235]="F"+e}();var Yo,Zo,Qo,Jo,ea,ta,ra,na,ia=(Zo="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",Qo="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",Jo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ea=/[stwN]/,ta=/[LRr]/,ra=/[Lb1n]/,na=/[1n]/,function(e){if(!Jo.test(e))return!1;for(var t=e.length,r=[],n=0;n<t;++n)r.push(u=(i=e.charCodeAt(n))<=247?Zo.charAt(i):1424<=i&&i<=1524?"R":1536<=i&&i<=1773?Qo.charAt(i-1536):1774<=i&&i<=2220?"r":8192<=i&&i<=8203?"w":8204==i?"b":"L");n=0;for(var i,o="L";n<t;++n)"m"==(u=r[n])?r[n]=o:o=u;n=0;for(var a="L";n<t;++n)"1"==(u=r[n])&&"r"==a?r[n]="n":ta.test(u)&&"r"==(a=u)&&(r[n]="R");for(n=1,o=r[0];n<t-1;++n)"+"==(u=r[n])&&"1"==o&&"1"==r[n+1]?r[n]="1":","!=u||o!=r[n+1]||"1"!=o&&"n"!=o||(r[n]=o),o=u;for(n=0;n<t;++n)if(","==(u=r[n]))r[n]="N";else if("%"==u){for(var l=n+1;l<t&&"%"==r[l];++l);for(var s=n&&"!"==r[n-1]||l<t&&"1"==r[l]?"1":"N",c=n;c<l;++c)r[c]=s;n=l-1}for(n=0,a="L";n<t;++n){var u=r[n];"L"==a&&"1"==u?r[n]="L":ta.test(u)&&(a=u)}for(n=0;n<t;++n)if(ea.test(r[n])){for(l=n+1;l<t&&ea.test(r[l]);++l);var d="L"==(n?r[n-1]:"L"),f="L"==(l<t?r[l]:"L");for(s=d||f?"L":"R",c=n;c<l;++c)r[c]=s;n=l-1}var h,p=[];for(n=0;n<t;)if(ra.test(r[n])){var m=n;for(++n;n<t&&ra.test(r[n]);++n);p.push(new oa(0,m,n))}else{var g=n,v=p.length;for(++n;n<t&&"L"!=r[n];++n);for(c=g;c<n;)if(na.test(r[c])){g<c&&p.splice(v,0,new oa(1,g,c));var y=c;for(++c;c<n&&na.test(r[c]);++c);p.splice(v,0,new oa(2,y,c)),g=c}else++c;g<n&&p.splice(v,0,new oa(1,g,n))}return 1==p[0].level&&(h=e.match(/^\s+/))&&(p[0].from=h[0].length,p.unshift(new oa(0,0,h[0].length))),1==qn(p).level&&(h=e.match(/\s+$/))&&(qn(p).to-=h[0].length,p.push(new oa(0,t-h[0].length,t))),2==p[0].level&&p.unshift(new oa(1,p[0].to,p[0].to)),p[0].level!=qn(p).level&&p.push(new oa(p[0].level,t,t)),p});function oa(e,t,r){this.level=e,this.from=t,this.to=r}return s.version="5.6.0",s}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(A){"use strict";function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function r(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=r;break}}return"meta"}function t(e,t){return"variable-3"==t.prevToken&&"variable-3"}function n(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var r=e.match(/"([^\s\\()]{0,16})\(/);return!!r&&(t.cpp11RawStringDelim=r[1],(t.tokenize=o)(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function i(e,t){for(var r;null!=(r=e.next());)if('"'==r&&!e.eat('"')){t.tokenize=null;break}return"string"}function o(e,t){var r=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+r+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function a(e,t){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&n.push(t)}"string"==typeof e&&(e=[e]);var n=[];r(t.keywords),r(t.types),r(t.builtin),r(t.atoms),n.length&&(t.helperType=e[0],A.registerHelper("hintWords",e[0],n));for(var i=0;i<e.length;++i)A.defineMIME(e[i],t)}function l(e,t){for(var r=!1;!e.eol();){if(!r&&e.match('"""')){t.tokenize=null;break}r="\\"==e.next()&&!r}return"string"}A.defineMode("clike",function(e,s){function c(e,t){var o,r=e.next();if(_[r]){var n=_[r](e,t);if(!1!==n)return n}if('"'==r||"'"==r)return t.tokenize=(o=r,function(e,t){for(var r,n=!1,i=!1;null!=(r=e.next());){if(r==o&&!n){i=!0;break}n=!n&&"\\"==r}return!i&&(n||C)||(t.tokenize=null),"string"}),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(r))return h=r,null;if(/\d/.test(r))return e.eatWhile(/[\w\.]/),"number";if("/"==r){if(e.eat("*"))return(t.tokenize=a)(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(T.test(r))return e.eatWhile(T),"operator";if(e.eatWhile(/[\w\$_\xa1-\uffff]/),L)for(;e.match(L);)e.eatWhile(/[\w\$_\xa1-\uffff]/);var i=e.current();return v.propertyIsEnumerable(i)?(x.propertyIsEnumerable(i)&&(h="newstatement"),w.propertyIsEnumerable(i)&&(p=!0),"keyword"):y.propertyIsEnumerable(i)?"variable-3":b.propertyIsEnumerable(i)?(x.propertyIsEnumerable(i)&&(h="newstatement"),"builtin"):k.propertyIsEnumerable(i)?"atom":"variable"}function a(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=null;break}n="*"==r}return"comment"}function i(e,t,r,n,i){this.indented=e,this.column=t,this.type=r,this.align=n,this.prev=i}function u(e){return"statement"==e||"switchstatement"==e||"namespace"==e}function d(e,t,r){var n=e.indented;return e.context&&u(e.context.type)&&!u(r)&&(n=e.context.indented),e.context=new i(n,t,r,null,e.context)}function f(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}var h,p,l=e.indentUnit,m=s.statementIndentUnit||l,g=s.dontAlignCalls,v=s.keywords||{},y=s.types||{},b=s.builtin||{},x=s.blockKeywords||{},w=s.defKeywords||{},k=s.atoms||{},_=s.hooks||{},C=s.multiLineStrings,S=!1!==s.indentStatements,M=!1!==s.indentSwitch,L=s.namespaceSeparator,T=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-l,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;h=p=null;var n,i,o=(t.tokenize||c)(e,t);if("comment"==o||"meta"==o)return o;if(null==r.align&&(r.align=!0),";"==h||":"==h||","==h)for(;u(t.context.type);)f(t);else if("{"==h)d(t,e.column(),"}");else if("["==h)d(t,e.column(),"]");else if("("==h)d(t,e.column(),")");else if("}"==h){for(;u(r.type);)r=f(t);for("}"==r.type&&(r=f(t));u(r.type);)r=f(t)}else if(h==r.type)f(t);else if(S&&(("}"==r.type||"top"==r.type)&&";"!=h||u(r.type)&&"newstatement"==h)){var a="statement";"newstatement"==h&&M&&"switch"==e.current()?a="switchstatement":"keyword"==o&&"namespace"==e.current()&&(a="namespace"),d(t,e.column(),a)}if("variable"==o&&("def"==t.prevToken||s.typeFirstDefinitions&&(n=e,"variable"==(i=t).prevToken||"variable-3"==i.prevToken||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(n.string.slice(0,n.start)))&&function(e){for(;;){if(!e||"top"==e.type)return 1;if("}"==e.type&&"namespace"!=e.prev.type)return;e=e.prev}}(t.context)&&e.match(/^\s*\(/,!1))&&(o="def"),_.token){var l=_.token(e,t,o);void 0!==l&&(o=l)}return"def"==o&&!1===s.styleDefs&&(o="variable"),t.startOfLine=!1,t.prevToken=p?"def":o||h,o},indent:function(e,t){if(e.tokenize!=c&&null!=e.tokenize)return A.Pass;var r=e.context,n=t&&t.charAt(0);u(r.type)&&"}"==n&&(r=r.prev);var i=n==r.type,o=r.prev&&"switchstatement"==r.prev.type;return u(r.type)?r.indented+("{"==n?0:m):!r.align||g&&")"==r.type?")"!=r.type||i?r.indented+(i?0:l)+(i||!o||/^(?:case|default)\b/.test(t)?0:l):r.indented+m:r.column+(i?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile",c="int long char short double float unsigned signed void size_t ptrdiff_t";a(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:e(s),types:e(c+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:e("case do else for if switch while struct"),defKeywords:e("struct"),typeFirstDefinitions:!0,atoms:e("null true false"),hooks:{"#":r,"*":t},modeProps:{fold:["brace","include"]}}),a(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:e(s+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:e(c+" bool wchar_t"),blockKeywords:e("catch class do else finally for if struct switch try while"),defKeywords:e("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"#":r,"*":t,u:n,U:n,L:n,R:n,token:function(e,t,r){return"variable"!=r||"("!=e.peek()||";"!=t.prevToken&&null!=t.prevToken&&"}"!=t.prevToken||(n=e.current(),!(i=/(\w+)::(\w+)$/.exec(n))||i[1]!=i[2])?void 0:"def";var n,i}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),a("text/x-java",{name:"clike",keywords:e("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:e("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:e("catch class do else finally for if switch try while"),defKeywords:e("class interface package enum"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),a("text/x-csharp",{name:"clike",keywords:e("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:e("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:e("catch class do else finally for foreach if struct switch try while"),defKeywords:e("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=i)(e,t):(e.eatWhile(/[\w\$_]/),"meta")}}}),a("text/x-scala",{name:"clike",keywords:e("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:e("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:e("catch class do else finally for forSome if match switch try while"),defKeywords:e("class def object package trait type val var"),atoms:e("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=l,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),a(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:e("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:e("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:e("for while do if else struct"),builtin:e("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:e("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":r},modeProps:{fold:["brace","include"]}}),a("text/x-nesc",{name:"clike",keywords:e(s+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:e(c),blockKeywords:e("case do else for if switch while struct"),atoms:e("null true false"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),a("text/x-objectivec",{name:"clike",keywords:e(s+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:e(c),atoms:e("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r},modeProps:{fold:"brace"}}),a("text/x-squirrel",{name:"clike",keywords:e("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:e(c),blockKeywords:e("case catch class else for foreach if switch try while"),defKeywords:e("function local class"),typeFirstDefinitions:!0,atoms:e("true false null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(T){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}T.defineMode("css",function(e,t){function o(e,t){return f=t,e}function i(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return r!=i&&(n||")"==i)||(t.tokenize=null),o("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=i(")"),o(null,"(")}function n(e,t,r){this.type=e,this.indent=t,this.prev=r}function l(e,t,r){return e.context=new n(r,t.indentation()+p,e.context),r}function s(e){return e.context=e.context.prev,e.context.type}function c(e,t,r){return L[r.context.type](e,t,r)}function u(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return c(e,t,r)}function d(e){var t=e.current().toLowerCase();h=S.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}var r=t;t.propertyKeywords||(t=T.resolveMode("text/css")),t.inline=r.inline;var f,h,p=e.indentUnit,m=t.tokenHooks,g=t.documentTypes||{},v=t.mediaTypes||{},y=t.mediaFeatures||{},b=t.mediaValueKeywords||{},x=t.propertyKeywords||{},w=t.nonStandardPropertyKeywords||{},k=t.fontProperties||{},_=t.counterDescriptors||{},C=t.colorKeywords||{},S=t.valueKeywords||{},M=t.allowNested,L={top:function(e,t,r){if("{"==e)return l(r,t,"block");if("}"==e&&r.context.prev)return s(r);if(/@(media|supports|(-moz-)?document)/.test(e))return l(r,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(r,t,"interpolation");if(":"==e)return"pseudo";if(M&&"("==e)return l(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":M||"hash"!=e&&"qualifier"!=e?L.top(e,t,r):(h="error","block");var n=t.current().toLowerCase();return x.hasOwnProperty(n)?(h="property","maybeprop"):w.hasOwnProperty(n)?(h="string-2","maybeprop"):M?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?l(r,t,"prop"):c(e,t,r)},prop:function(e,t,r){if(";"==e)return s(r);if("{"==e&&M)return l(r,t,"propBlock");if("}"==e||"{"==e)return u(e,t,r);if("("==e)return l(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return l(r,t,"interpolation")}else h+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?s(r):"word"==e?(h="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?u(e,t,r):")"==e?s(r):"("==e?l(r,t,"parens"):"interpolation"==e?l(r,t,"interpolation"):("word"==e&&d(t),"parens")},pseudo:function(e,t,r){return"word"==e?(h="variable-3",r.context.type):c(e,t,r)},atBlock:function(e,t,r){if("("==e)return l(r,t,"atBlock_parens");if("}"==e)return u(e,t,r);if("{"==e)return s(r)&&l(r,t,M?"block":"top");if("word"==e){var n=t.current().toLowerCase();h="only"==n||"not"==n||"and"==n||"or"==n?"keyword":g.hasOwnProperty(n)?"tag":v.hasOwnProperty(n)?"attribute":y.hasOwnProperty(n)?"property":b.hasOwnProperty(n)?"keyword":x.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"string-2":S.hasOwnProperty(n)?"atom":C.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atBlock_parens:function(e,t,r){return")"==e?s(r):"{"==e||"}"==e?u(e,t,r,2):L.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?l(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):c(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,s(r)):"word"==e?(h="@font-face"==r.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!_.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?l(r,t,"top"):c(e,t,r)},at:function(e,t,r){return";"==e?s(r):"{"==e||"}"==e?u(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?s(r):"{"==e||";"==e?u(e,t,r):("word"==e?h="variable":"variable"!=e&&"("!=e&&")"!=e&&(h="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:t.inline?"block":"top",stateArg:null,context:new n(t.inline?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(m[r]){var n=m[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(f=r[1],r=r[0]),h=r,t.state=L[t.state](f,e,t),h},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),!r.prev||("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type)&&(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=r.indent-p,r=r.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var t=["domain","regexp","url","url-prefix"],n=e(t),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),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","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=e(a),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],c=e(s),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=e(u),f=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=e(f),p=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=e(g),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(y),x=t.concat(i).concat(a).concat(s).concat(u).concat(f).concat(g).concat(y);T.registerHelper("hintWords","css",x),T.defineMIME("text/css",{documentTypes:n,mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:p,counterDescriptors:m,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r)(e,t)}},name:"css"}),T.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),T.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:p,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(a){"use strict";a.defineMode("gfm",function(e,t){var i=0,r={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?t.codeBlock=!1:e.skipToEnd(),null;if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var r=e.pos;e.eatWhile("`");var n=1+e.pos-r;return t.code?n===i&&(t.code=!1):(i=n,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},n={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var o in t)n[o]=t[o];return n.name="markdown",a.overlayMode(a.getMode(e,n),r)},"markdown"),a.defineMIME("text/x-gfm","gfm")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(r){"use strict";r.defineMode("htmlembedded",function(e,t){return r.multiplexingMode(r.getMode(e,"htmlmixed"),{open:t.open||t.scriptStartRegex||"<%",close:t.close||t.scriptEndRegex||"%>",mode:r.getMode(e,t.scriptingModeSpec)})},"htmlmixed"),r.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),r.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),r.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),r.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(f){"use strict";f.defineMode("htmlmixed",function(e,t){function r(e,t){var r=t.htmlState.tagName;r=r&&r.toLowerCase();var n=c.token(e,t.htmlState);if("script"==r&&/\btag\b/.test(n)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);(i=i?i[1]:"")&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var o=0;o<d.length;++o){var a=d[o];if("string"==typeof a.matches?i==a.matches:a.matches.test(i)){a.mode&&(t.token=l,t.localMode=a.mode,t.localState=a.mode.startState&&a.mode.startState(c.indent(t.htmlState,"")));break}}}else"style"==r&&/\btag\b/.test(n)&&">"==e.current()&&(t.token=s,t.localMode=u,t.localState=u.startState(c.indent(t.htmlState,"")));return n}function n(e,t,r){var n=e.current(),i=n.search(t);return-1<i?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function l(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):n(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function s(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=r,t.localState=t.localMode=null,null):n(e,/<\/\s*style\s*>/,u.token(e,t.localState))}var c=f.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag}),u=f.getMode(e,"css"),d=[],i=t&&t.scriptTypes;if(d.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:f.getMode(e,"javascript")}),i)for(var o=0;o<i.length;++o){var a=i[o];d.push({matches:a.matches,mode:a.mode&&f.getMode(e,a.mode)})}return d.push({matches:/./,mode:f.getMode(e,"text/plain")}),{startState:function(){return{token:r,localMode:null,localState:null,htmlState:c.startState()}},copyState:function(e){if(e.localState)var t=f.copyState(e.localMode,e.localState);return{token:e.token,localMode:e.localMode,localState:t,htmlState:f.copyState(c,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return!e.localMode||/^\s*<\//.test(t)?c.indent(e.htmlState,t):e.localMode.indent?e.localMode.indent(e.localState,t):f.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),f.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(Me){"use strict";Me.defineMode("javascript",function(e,u){function a(e,t,r){return de=e,fe=r,t}function d(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(me&&"@"==e.peek()&&e.match(we))return t.tokenize=d,a("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=d),a("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=f)(e,t):e.eat("/")?(e.skipToEnd(),a("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(xe),a("operator","operator",e.current()));if("`"==r)return(t.tokenize=l)(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(xe.test(r))return e.eatWhile(xe),a("operator","operator",e.current());if(ye.test(r)){e.eatWhile(ye);var n=e.current(),o=be.propertyIsEnumerable(n)&&be[n];return o&&"."!=t.lastType?a(o.type,o.style,n):a("variable","variable",n)}}function f(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=d;break}n="*"==r}return a("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=d;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function n(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){for(var n=0,i=!1,o=r-1;0<=o;--o){var a=e.string.charAt(o),l=ke.indexOf(a);if(0<=l&&l<3){if(!n){++o;break}if(0==--n)break}else if(3<=l&&l<6)++n;else if(ye.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!n){++o;break}}}i&&!n&&(t.fatArrowAt=o)}}function o(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function s(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return 1;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return 1}function c(){for(var e=arguments.length-1;0<=e;e--)Ce.cc.push(arguments[e])}function h(){return c.apply(null,arguments),!0}function r(r){function e(e){for(var t=e;t;t=t.next)if(t.name==r)return 1}var t=Ce.state;if(t.context){if(Ce.marked="def",e(t.localVars))return;t.localVars={name:r,next:t.localVars}}else{if(e(t.globalVars))return;u.globalVars&&(t.globalVars={name:r,next:t.globalVars})}}function p(){Ce.state.context={prev:Ce.state.context,vars:Ce.state.localVars},Ce.state.localVars=Se}function m(){Ce.state.localVars=Ce.state.context.vars,Ce.state.context=Ce.state.context.prev}function g(n,i){function e(){var e=Ce.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new o(t,Ce.stream.column(),n,null,e.lexical,i)}return e.lex=!0,e}function v(){var e=Ce.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function y(r){return function e(t){return t==r?h():";"==r?c():h(e)}}function b(e,t){return"var"==e?h(g("vardef",t.length),F,y(";"),v):"keyword a"==e?h(g("form"),x,b,v):"keyword b"==e?h(g("form"),b,v):"{"==e?h(g("}"),I,v):";"==e?h():"if"==e?("else"==Ce.state.lexical.info&&Ce.state.cc[Ce.state.cc.length-1]==v&&Ce.state.cc.pop()(),h(g("form"),x,b,v,K)):"function"==e?h(Z):"for"==e?h(g("form"),V,b,v):"variable"==e?h(g("stat"),A):"switch"==e?h(g("form"),x,g("}","switch"),y("{"),I,v,v):"case"==e?h(x,y(":")):"default"==e?h(y(":")):"catch"==e?h(g("form"),p,y("("),Q,y(")"),b,v,m):"class"==e?h(g("form"),J,v):"export"==e?h(g("form"),ne,v):"import"==e?h(g("form"),ie,v):c(g("stat"),x,y(";"),v)}function x(e){return t(e,!1)}function w(e){return t(e,!0)}function t(e,t){if(Ce.state.fatArrowAt==Ce.stream.start){var r=t?T:L;if("("==e)return h(p,g(")"),P(j,")"),v,y("=>"),r,m);if("variable"==e)return c(p,j,y("=>"),r,m)}var n=t?C:_;return _e.hasOwnProperty(e)?h(n):"function"==e?h(Z,n):"keyword c"==e?h(t?i:k):"("==e?h(g(")"),k,ue,y(")"),v,n):"operator"==e||"spread"==e?h(t?w:x):"["==e?h(g("]"),se,v,n):"{"==e?D(N,"}",null,n):"quasi"==e?c(S,n):h()}function k(e){return e.match(/[;\}\)\],]/)?c():c(x)}function i(e){return e.match(/[;\}\)\],]/)?c():c(w)}function _(e,t){return","==e?h(x):C(e,t,!1)}function C(e,t,r){var n=0==r?_:C,i=0==r?x:w;return"=>"==e?h(p,r?T:L,m):"operator"==e?/\+\+|--/.test(t)?h(n):"?"==t?h(x,y(":"),i):h(i):"quasi"==e?c(S,n):";"!=e?"("==e?D(w,")","call",n):"."==e?h(O,n):"["==e?h(g("]"),k,y("]"),v,n):void 0:void 0}function S(e,t){return"quasi"!=e?c():"${"!=t.slice(t.length-2)?h(S):h(x,M)}function M(e){return"}"==e?(Ce.marked="string-2",Ce.state.tokenize=l,h(S)):void 0}function L(e){return n(Ce.stream,Ce.state),c("{"==e?b:x)}function T(e){return n(Ce.stream,Ce.state),c("{"==e?b:w)}function A(e){return":"==e?h(v,b):c(_,y(";"),v)}function O(e){return"variable"==e?(Ce.marked="property",h()):void 0}function N(e,t){return"variable"==e||"keyword"==Ce.style?(Ce.marked="property",h("get"==t||"set"==t?q:z)):"number"==e||"string"==e?(Ce.marked=me?"property":Ce.style+" property",h(z)):"jsonld-keyword"==e?h(z):"["==e?h(x,y("]"),z):void 0}function q(e){return"variable"!=e?c(z):(Ce.marked="property",h(Z))}function z(e){return":"==e?h(w):"("==e?c(Z):void 0}function P(r,n){function i(e){if(","!=e)return e==n?h():h(y(n));var t=Ce.state.lexical;return"call"==t.info&&(t.pos=(t.pos||0)+1),h(r,i)}return function(e){return e==n?h():c(r,i)}}function D(e,t,r){for(var n=3;n<arguments.length;n++)Ce.cc.push(arguments[n]);return h(g(t,r),P(e,t),v)}function I(e){return"}"==e?h():c(b,I)}function E(e){return ve&&":"==e?h(H):void 0}function W(e,t){return"="==t?h(w):void 0}function H(e){return"variable"==e?(Ce.marked="variable-3",h()):void 0}function F(){return c(j,E,R,U)}function j(e,t){return"variable"==e?(r(t),h()):"["==e?D(j,"]"):"{"==e?D(B,"}"):void 0}function B(e,t){return"variable"!=e||Ce.stream.match(/^\s*:/,!1)?("variable"==e&&(Ce.marked="property"),h(y(":"),j,R)):(r(t),h(R))}function R(e,t){return"="==t?h(w):void 0}function U(e){return","==e?h(F):void 0}function K(e,t){return"keyword b"==e&&"else"==t?h(g("form","else"),b,v):void 0}function V(e){return"("==e?h(g(")"),$,y(")"),v):void 0}function $(e){return"var"==e?h(F,y(";"),X):";"==e?h(X):"variable"==e?h(G):c(x,y(";"),X)}function G(e,t){return"in"==t||"of"==t?(Ce.marked="keyword",h(x)):h(_,X)}function X(e,t){return";"==e?h(Y):"in"==t||"of"==t?(Ce.marked="keyword",h(x)):c(x,y(";"),Y)}function Y(e){")"!=e&&h(x)}function Z(e,t){return"*"==t?(Ce.marked="keyword",h(Z)):"variable"==e?(r(t),h(Z)):"("==e?h(p,g(")"),P(Q,")"),v,b,m):void 0}function Q(e){return"spread"==e?h(Q):c(j,E,W)}function J(e,t){return"variable"==e?(r(t),h(ee)):void 0}function ee(e,t){return"extends"==t?h(x,ee):"{"==e?h(g("}"),te,v):void 0}function te(e,t){return"variable"==e||"keyword"==Ce.style?"static"==t?(Ce.marked="keyword",h(te)):(Ce.marked="property","get"==t||"set"==t?h(re,Z,te):h(Z,te)):"*"==t?(Ce.marked="keyword",h(te)):";"==e?h(te):"}"==e?h():void 0}function re(e){return"variable"!=e?c():(Ce.marked="property",h())}function ne(e,t){return"*"==t?(Ce.marked="keyword",h(le,y(";"))):"default"==t?(Ce.marked="keyword",h(x,y(";"))):c(b)}function ie(e){return"string"==e?h():c(oe,le)}function oe(e,t){return"{"==e?D(oe,"}"):("variable"==e&&r(t),"*"==t&&(Ce.marked="keyword"),h(ae))}function ae(e,t){return"as"==t?(Ce.marked="keyword",h(oe)):void 0}function le(e,t){return"from"==t?(Ce.marked="keyword",h(x)):void 0}function se(e){return"]"==e?h():c(w,ce)}function ce(e){return"for"==e?c(ue,y("]")):","==e?h(P(i,"]")):c(P(w,"]"))}function ue(e){return"for"==e?h(V,ue):"if"==e?h(x,ue):void 0}var de,fe,he=e.indentUnit,pe=u.statementIndent,me=u.jsonld,ge=u.json||me,ve=u.typescript,ye=u.wordCharacters||/[\w$\xa1-\uffff]/,be=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:n,delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n};if(ve){var l={type:"variable",style:"variable-3"},s={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:l,number:l,bool:l,any:l};for(var c in s)a[c]=s[c]}return a}(),xe=/[+\-*&%=<>!?|~^]/,we=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,ke="([{}])",_e={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ce={state:null,column:null,marked:null,cc:null},Se={name:"this",next:{name:"arguments"}};return v.lex=!0,{startState:function(e){var t={tokenize:d,lastType:"sof",cc:[],lexical:new o((e||0)-he,0,"block",!1),localVars:u.localVars,context:u.localVars&&{vars:u.localVars},indented:0};return u.globalVars&&"object"==typeof u.globalVars&&(t.globalVars=u.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),n(e,t)),t.tokenize!=f&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==de?r:(t.lastType="operator"!=de||"++"!=fe&&"--"!=fe?de:"incdec",function(e,t,r,n,i){var o=e.cc;for(Ce.state=e,Ce.stream=i,Ce.marked=null,Ce.cc=o,Ce.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():ge?x:b)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Ce.marked?Ce.marked:"variable"==r&&s(e,n)?"variable-2":t}}}(t,r,de,fe,e))},indent:function(e,t){if(e.tokenize==f)return Me.Pass;if(e.tokenize!=d)return 0;var r=t&&t.charAt(0),n=e.lexical;if(!/^\s*else\b/.test(t))for(var i=e.cc.length-1;0<=i;--i){var o=e.cc[i];if(o==v)n=n.prev;else if(o!=K)break}"stat"==n.type&&"}"==r&&(n=n.prev),pe&&")"==n.type&&"stat"==n.prev.type&&(n=n.prev);var a,l,s=n.type,c=r==s;return"vardef"==s?n.indented+("operator"==e.lastType||","==e.lastType?n.info+1:0):"form"==s&&"{"==r?n.indented:"form"==s?n.indented+he:"stat"==s?n.indented+(l=t,"operator"==(a=e).lastType||","==a.lastType||xe.test(l.charAt(0))||/[,.]/.test(l.charAt(0))?pe||he:0):"switch"!=n.info||c||0==u.doubleIndentSwitch?n.align?n.column+(c?0:1):n.indented+(c?0:he):n.indented+(/^(?:case|default)\b/.test(t)?he:2*he)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ge?null:"/*",blockCommentEnd:ge?null:"*/",lineComment:ge?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ge?"json":"javascript",jsonldMode:me,jsonMode:ge}}),Me.registerHelper("wordChars","javascript",/[\w$]/),Me.defineMIME("text/javascript","javascript"),Me.defineMIME("text/ecmascript","javascript"),Me.defineMIME("application/javascript","javascript"),Me.defineMIME("application/x-javascript","javascript"),Me.defineMIME("application/ecmascript","javascript"),Me.defineMIME("application/json",{name:"javascript",json:!0}),Me.defineMIME("application/x-json",{name:"javascript",json:!0}),Me.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),Me.defineMIME("text/typescript",{name:"javascript",typescript:!0}),Me.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(U){"use strict";U.defineMode("markdown",function(l,x){function s(e,t,r){return t.f=t.inline=r,r(e,t)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,f||e.f!=w||(e.f=o,e.block=n),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function n(e,t){var r=e.sol(),n=!1!==t.list,i=t.indentedCode;t.indentedCode=!1,n&&(0<=t.indentationDiff?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):0<t.indentation?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var o=null;if(4<=t.indentationDiff)return e.skipToEnd(),i||!t.prevLineHasContent?(t.indentation-=4,t.indentedCode=!0,p):null;if(e.eatSpace())return null;if((o=e.match(F))&&o[1].length<=6)return t.header=o[1].length,x.highlightFormatting&&(t.formatting="header"),t.f=t.inline,k(t);if(t.prevLineHasContent&&!t.quote&&!n&&!i&&(o=e.match(j)))return t.header="="==o[0].charAt(0)?1:2,x.highlightFormatting&&(t.formatting="header"),t.f=t.inline,k(t);if(e.eat(">"))return t.quote=r?1:t.quote+1,x.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),k(t);if("["===e.peek())return s(e,t,u);if(e.match(I,!0))return t.hr=!0,b;if(t.prevLineHasContent&&!n||!e.match(E,!1)&&!e.match(W,!1))return x.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=function(e){if(U.findModeByName){var t=U.findModeByName(e);t&&(e=t.mime||t.mimes[0])}var r=U.getMode(l,e);return"null"==r.name?null:r}(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,x.highlightFormatting&&(t.formatting="code-block"),t.code=!0,k(t)):s(e,t,t.inline);var a=null;return a=e.match(E,!0)?"ul":(e.match(W,!0),"ol"),t.indentation+=4,t.list=!0,t.listDepth++,x.taskLists&&e.match(H,!1)&&(t.taskList=!0),t.f=t.inline,x.highlightFormatting&&(t.formatting=["list","list-"+a]),k(t)}function w(e,t){var r=S.token(e,t.htmlState);return(f&&null===t.htmlState.tagStart&&!t.htmlState.context&&t.htmlState.tokenize.isInText||t.md_inside&&-1<e.current().indexOf(">"))&&(t.f=o,t.block=n,t.htmlState=null),r}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=r,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),p)}function r(e,t){e.match("```"),t.block=n,t.f=o,x.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=k(t);return t.code=!1,r}function k(e){var t=[];if(e.formatting){t.push(T),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(T+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(T+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!x.maxBlockquoteDepth||x.maxBlockquoteDepth>=e.quote?t.push(T+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(q,"url"):(e.strong&&t.push(P),e.em&&t.push(z),e.strikethrough&&t.push(D),e.linkText&&t.push(N),e.code&&t.push(p)),e.header&&(t.push(h),t.push(h+"-"+e.header)),e.quote&&(t.push(m),!x.maxBlockquoteDepth||x.maxBlockquoteDepth>=e.quote?t.push(m+"-"+e.quote):t.push(m+"-"+x.maxBlockquoteDepth)),!1!==e.list){var n=(e.listDepth-1)%3;n?1==n?t.push(v):t.push(y):t.push(g)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function e(e,t){return e.match(B,!0)?k(t):void 0}function o(e,t){var r=t.text(e,t);if(void 0!==r)return r;if(t.list)return t.list=null,k(t);if(t.taskList)return"x"!==e.match(H,!0)[1]?t.taskOpen=!0:t.taskClosed=!0,x.highlightFormatting&&(t.formatting="task"),t.taskList=!1,k(t);if(t.taskOpen=!1,t.taskClosed=!1,t.header&&e.match(/^#+$/,!0))return x.highlightFormatting&&(t.formatting="header"),k(t);var n,i,o,a=e.sol(),l=e.next();if("\\"===l&&(e.next(),x.highlightFormatting))return(p=k(t))?p+" formatting-escape":"formatting-escape";if(t.linkTitle){t.linkTitle=!1;var s=l;"("===l&&(s=")");var c="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(e.match(new RegExp(c),!0))return q}if("`"===l){var u=t.formatting;x.highlightFormatting&&(t.formatting="code");var d=k(t),f=e.pos;e.eatWhile("`");var h=1+e.pos-f;return t.code?h===M?(t.code=!1,d):(t.formatting=u,k(t)):(M=h,t.code=!0,k(t))}if(t.code)return k(t);if("!"===l&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),t.inline=t.f=C,L;if("["===l&&e.match(/.*\](\(.*\)| ?\[.*\])/,!1))return t.linkText=!0,x.highlightFormatting&&(t.formatting="link"),k(t);if("]"===l&&t.linkText&&e.match(/\(.*\)| ?\[.*\]/,!1)){x.highlightFormatting&&(t.formatting="link");var p=k(t);return t.linkText=!1,t.inline=t.f=C,p}if("<"===l&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=_,x.highlightFormatting&&(t.formatting="link"),(p=k(t))?p+=" ":p="",p+A;if("<"===l&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=_,x.highlightFormatting&&(t.formatting="link"),(p=k(t))?p+=" ":p="",p+O;if("<"===l&&e.match(/^(!--|\w)/,!1)){var m=e.string.indexOf(">",e.pos);if(-1!=m){var g=e.string.substring(e.start,m);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(g)&&(t.md_inside=!0)}return e.backUp(1),t.htmlState=U.startState(S),n=e,o=w,(i=t).f=i.block=o,o(n,i)}if("<"===l&&e.match(/^\/\w*?>/))return t.md_inside=!1,"tag";var v=!1;if(!x.underscoresBreakWords&&"_"===l&&"_"!==e.peek()&&e.match(/(\w)/,!1)){var y=e.pos-2;if(0<=y){var b=e.string.charAt(y);"_"!==b&&b.match(/(\w)/,!1)&&(v=!0)}}if("*"===l||"_"===l&&!v){if(!a||" "!==e.peek()){if(t.strong===l&&e.eat(l)){x.highlightFormatting&&(t.formatting="strong");d=k(t);return t.strong=!1,d}if(!t.strong&&e.eat(l))return t.strong=l,x.highlightFormatting&&(t.formatting="strong"),k(t);if(t.em===l){x.highlightFormatting&&(t.formatting="em");d=k(t);return t.em=!1,d}if(!t.em)return t.em=l,x.highlightFormatting&&(t.formatting="em"),k(t)}}else if(" "===l&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return k(t);e.backUp(1)}if(x.strikethrough)if("~"===l&&e.eatWhile(l)){if(t.strikethrough){x.highlightFormatting&&(t.formatting="strikethrough");d=k(t);return t.strikethrough=!1,d}if(e.match(/^[^\s]/,!1))return t.strikethrough=!0,x.highlightFormatting&&(t.formatting="strikethrough"),k(t)}else if(" "===l&&e.match(/^~~/,!0)){if(" "===e.peek())return k(t);e.backUp(2)}return" "===l&&(e.match(/ +$/,!1)?t.trailingSpace++:t.trailingSpace&&(t.trailingSpaceNewLine=!0)),k(t)}function _(e,t){if(">"!==e.next())return e.match(/^[^>]+/,!0),A;t.f=t.inline=o,x.highlightFormatting&&(t.formatting="link");var r=k(t);return r?r+=" ":r="",r+A}function C(e,t){if(e.eatSpace())return null;var i,r=e.next();return"("===r||"["===r?(t.f=t.inline=(i="("===r?")":"]",function(e,t){var r;if(e.next()!==i)return e.match((R[r=i]||(r=(r+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),R[r]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+r+")")),R[r]),!0)&&e.backUp(1),t.linkHref=!0,k(t);t.f=t.inline=o,x.highlightFormatting&&(t.formatting="link-string");var n=k(t);return t.linkHref=!1,n}),x.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,k(t)):"error"}function u(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=i,e.next(),x.highlightFormatting&&(t.formatting="link"),t.linkText=!0,k(t)):s(e,t,o)}function i(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=d,x.highlightFormatting&&(t.formatting="link");var r=k(t);return t.linkText=!1,r}return e.match(/^[^\]]+/,!0),N}function d(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=o,q+" url")}var f=U.modes.hasOwnProperty("xml"),S=U.getMode(l,f?{name:"xml",htmlMode:!0}:"text/plain");void 0===x.highlightFormatting&&(x.highlightFormatting=!1),void 0===x.maxBlockquoteDepth&&(x.maxBlockquoteDepth=0),void 0===x.underscoresBreakWords&&(x.underscoresBreakWords=!0),void 0===x.fencedCodeBlocks&&(x.fencedCodeBlocks=!1),void 0===x.taskLists&&(x.taskLists=!1),void 0===x.strikethrough&&(x.strikethrough=!1);var M=0,h="header",p="comment",m="quote",g="variable-2",v="variable-3",y="keyword",b="hr",L="tag",T="formatting",A="link",O="link",N="link",q="string",z="em",P="strong",D="strikethrough",I=/^([*\-_])(?:\s*\1){2,}\s*$/,E=/^[*\-+]\s+/,W=/^[0-9]+([.)])\s+/,H=/^\[(x| )\](?=\s)/,F=/^(#+)(?: |$)/,j=/^ *(?:\={1,}|-{1,})\s*$/,B=/^[^#!\[\]*_\\<>` "'(~]+/,R=[],t={startState:function(){return{f:n,prevLineHasContent:!1,thisLineHasContent:!1,block:n,htmlState:null,indentation:0,inline:o,text:e,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(e){return{f:e.f,prevLineHasContent:e.prevLineHasContent,thisLineHasContent:e.thisLineHasContent,block:e.block,htmlState:e.htmlState&&U.copyState(S,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?U.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,hr:e.hr,taskList:e.taskList,list:e.list,listDepth:e.listDepth,quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var r=!!t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||r)return t.prevLineHasContent=!1,a(t),r?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((n-t.indentation)/4);4<i&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,0<n)return null}return t.f(e,t)},innerMode:function(e){return e.block==w?{state:e.htmlState,mode:S}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:t}},blankLine:a,getType:k,fold:"markdown"};return t},"xml"),U.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(a){"use strict";function e(e){for(var t={},r=e.split(" "),n=0;n<r.length;++n)t[r[n]]=!0;return t}function l(i,o,a){return 0==i.length?s(o):function(e,t){for(var r=i[0],n=0;n<r.length;n++)if(e.match(r[n][0]))return t.tokenize=l(i.slice(1),o),r[n][1];return t.tokenize=s(o,a),"string"}}function s(r,n){return function(e,t){return function(e,t,r,n){if(!1!==n&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(!1!==n&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=l([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,n)),e.match(/\-\>\w/,!1)&&(t.tokenize=l([[["->",null]],[[/[\w]+/,"variable"]]],r,n)),"variable-2";for(var i=!1;!e.eol()&&(i||!1===n||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!i&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}i="\\"==e.next()&&!i}return"string"}(e,t,r,n)}}var t="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",r="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[t,r,n].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:e(t),blockKeywords:e("catch do else elseif for foreach if switch try while finally"),defKeywords:e("class function interface namespace trait"),atoms:e(r),builtin:e(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var r;if(r=e.match(/<<\s*/)){var n=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(r[0].length+(n?2:1));if(n&&e.eat(n),i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=s(i,"'"!=n),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=s('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&0<t.tokStack.length&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=s(t.tokStack[t.tokStack.length-2])),!1}}};a.defineMode("php",function(e,r){var l=a.getMode(e,"text/html"),s=a.getMode(e,i);return{startState:function(){var e=a.startState(l),t=a.startState(s);return{html:e,php:t,curMode:r.startOpen?s:l,curState:r.startOpen?t:e,pending:null}},copyState:function(e){var t,r=e.html,n=a.copyState(l,r),i=e.php,o=a.copyState(s,i);return t=e.curMode==l?n:o,{html:n,php:o,curMode:e.curMode,curState:t,pending:e.pending}},token:function(e,t){var r=t.curMode==s;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),r)return r&&null==t.php.tokenize&&e.match("?>")?(t.curMode=l,t.curState=t.html,"meta"):s.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=s,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var n="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;n=t.pending.style}else n=l.token(e,t.curState);t.pending&&(t.pending=null);var i,o=e.current(),a=o.search(/<\?/);return-1!=a&&("string"==n&&(i=o.match(/[\'\"]$/))&&!/\?>/.test(o)?t.pending=i[0]:t.pending={end:e.pos,style:n},e.backUp(o.length-a)),n},indent:function(e,t){return e.curMode!=s&&/^\s*<\//.test(t)||e.curMode==s&&/^\?>/.test(t)?l.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(S){"use strict";S.defineMode("xml",function(e,t){function a(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=a;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(w=t.eat("/")?"closeTag":"openTag",r.tokenize=l,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function l(e,t){var r,n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=a,w=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return w="equals",null;if("<"!=n)return/[\'\"]/.test(n)?(t.tokenize=(r=n,o.isInAttribute=!0,o),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=a,t.state=u,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error";function o(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=l;break}return"string"}}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=a;break}e.next()}return r}}function o(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(_.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function s(e){e.context&&(e.context=e.context.prev)}function c(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!_.contextGrabbers.hasOwnProperty(r)||!_.contextGrabbers[r].hasOwnProperty(t))return;s(e)}}function u(e,t,r){return"openTag"==e?(r.tagStart=t.column(),n):"closeTag"==e?d:u}function n(e,t,r){return"word"==e?(r.tagName=t.current(),k="tag",p):(k="error",n)}function d(e,t,r){if("word"!=e)return k="error",h;var n=t.current();return r.context&&r.context.tagName!=n&&_.implicitlyClosed.hasOwnProperty(r.context.tagName)&&s(r),r.context&&r.context.tagName==n?(k="tag",f):(k="tag error",h)}function f(e,t,r){return"endTag"!=e?(k="error",f):(s(r),u)}function h(e,t,r){return k="error",f(e,0,r)}function p(e,t,r){if("word"==e)return k="attribute",m;if("endTag"!=e&&"selfcloseTag"!=e)return k="error",p;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||_.autoSelfClosers.hasOwnProperty(n)?c(r,n):(c(r,n),r.context=new o(r,n,i==r.indented)),u}function m(e,t,r){return"equals"==e?g:(_.allowMissing||(k="error"),p(e,0,r))}function g(e,t,r){return"string"==e?v:"word"==e&&_.allowUnquoted?(k="string",p):(k="error",p(e,0,r))}function v(e,t,r){return"string"==e?v:p(e,0,r)}var y=e.indentUnit,b=t.multilineTagIndentFactor||1,x=t.multilineTagIndentPastTag;null==x&&(x=!0);var w,k,_=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},C=t.alignCDATA;return a.isInText=!0,{startState:function(){return{tokenize:a,state:u,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;w=null;var r=t.tokenize(e,t);return(r||w)&&"comment"!=r&&(k=null,t.state=t.state(w||r,e,t),k&&(r="error"==k?r+" error":k)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+y;if(n&&n.noIndent)return S.Pass;if(e.tokenize!=l&&e.tokenize!=a)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return x?e.tagStart+e.tagName.length+2:e.tagStart+y*b;if(C&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!_.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=_.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&!n.startOfLine;)n=n.prev;return n?n.indent+y:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:t.htmlMode?"html":"xml",helperType:t.htmlMode?"html":"xml"}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xquery",function(){function p(e,t,r){return(t.tokenize=r)(e,t)}function m(e,t){var r,n,i,o=e.next(),a=!1,l='"'===(r=e).current()?r.match(/^[^\"]+\"\:/,!1):"'"===r.current()&&r.match(/^[^\"]+\'\:/,!1);if("<"==o){if(e.match("!--",!0))return p(e,t,x);if(e.match("![CDATA",!1))return t.tokenize=w,"tag";if(e.match("?",!1))return p(e,t,k);var s=e.eat("/");e.eatSpace();for(var c,u="";c=e.eat(/[^\s\u00a0=<>\"\'\/?]/);)u+=c;return p(e,t,(n=u,i=s,function(e,t){return e.eatSpace(),i&&e.eat(">")?(M(t),t.tokenize=m):(e.eat("/")||S(t,{type:"tag",name:n,tokenize:m}),e.eat(">")?t.tokenize=m:t.tokenize=b),"tag"}))}if("{"==o)return S(t,{type:"codeblock"}),null;if("}"==o)return M(t),null;if(_(t))return">"==o?"tag":"/"==o&&e.eat(">")?(M(t),"tag"):"variable";if(/\d/.test(o))return e.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),"atom";if("("===o&&e.eat(":"))return S(t,{type:"comment"}),p(e,t,g);if(l||'"'!==o&&"'"!==o){if("$"===o)return p(e,t,y);if(":"===o&&e.eat("="))return"keyword";if("("===o)return S(t,{type:"paren"}),null;if(")"===o)return M(t),null;if("["===o)return S(t,{type:"bracket"}),null;if("]"===o)return M(t),null;var d=L.propertyIsEnumerable(o)&&L[o];if(l&&'"'===o)for(;'"'!==e.next(););if(l&&"'"===o)for(;"'"!==e.next(););d||e.eatWhile(/[\w\$_-]/);var f=e.eat(":");!e.eat(":")&&f&&e.eatWhile(/[\w\$_-]/),e.match(/^[ \t]*\(/,!1)&&(a=!0);var h=e.current();return d=L.propertyIsEnumerable(h)&&L[h],a&&!d&&(d={type:"function_call",style:"variable def"}),C(t,"xmlconstructor")?(M(t),"variable"):("element"!=h&&"attribute"!=h&&"axis_specifier"!=d.type||S(t,{type:"xmlconstructor"}),d?d.style:"variable")}return p(e,t,v(o))}function g(e,t){for(var r,n=!1,i=!1,o=0;r=e.next();){if(")"==r&&n){if(!(0<o)){M(t);break}o--}else":"==r&&i&&o++;n=":"==r,i="("==r}return"comment"}function v(n,i){return function(e,t){var r;if(C(t,"string")&&e.current()==n)return M(t),i&&(t.tokenize=i),"string";if(S(t,{type:"string",name:n,tokenize:v(n,i)}),e.match("{",!1)&&o(t))return t.tokenize=m,"string";for(;r=e.next();){if(r==n){M(t),i&&(t.tokenize=i);break}if(e.match("{",!1)&&o(t))return t.tokenize=m,"string"}return"string"}}function y(e,t){var r=/[\w\$_-]/;if(e.eat('"')){for(;'"'!==e.next(););e.eat(":")}else e.eatWhile(r),e.match(":=",!1)||e.eat(":");return e.eatWhile(r),t.tokenize=m,"variable"}function b(e,t){var r=e.next();return"/"==r&&e.eat(">")?(o(t)&&M(t),_(t)&&M(t),"tag"):">"==r?(o(t)&&M(t),"tag"):"="==r?null:'"'==r||"'"==r?p(e,t,v(r,b)):(o(t)||S(t,{type:"attribute",tokenize:b}),e.eat(/[a-zA-Z_:]/),e.eatWhile(/[-a-zA-Z0-9_:.]/),e.eatSpace(),(e.match(">",!1)||e.match("/",!1))&&(M(t),t.tokenize=m),"attribute")}function x(e,t){for(var r;r=e.next();)if("-"==r&&e.match("->",!0))return t.tokenize=m,"comment"}function w(e,t){for(var r;r=e.next();)if("]"==r&&e.match("]",!0))return t.tokenize=m,"comment"}function k(e,t){for(var r;r=e.next();)if("?"==r&&e.match(">",!0))return t.tokenize=m,"comment meta"}function _(e){return C(e,"tag")}function o(e){return C(e,"attribute")}function C(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function S(e,t){e.stack.push(t)}function M(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||m}var L=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={type:"axis_specifier",style:"qualifier"},l={if:t,switch:t,while:t,for:t,else:r,then:r,try:r,finally:r,catch:r,element:n,attribute:n,let:n,implements:n,import:n,module:n,namespace:n,return:n,super:n,this:n,throws:n,where:n,private:n,",":{type:"punctuation",style:null},null:o,"fn:false()":o,"fn:true()":o},s=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],c=0,u=s.length;c<u;c++)l[s[c]]=e(s[c]);var d=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"];for(c=0,u=d.length;c<u;c++)l[d[c]]=o;var f=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"];for(c=0,u=f.length;c<u;c++)l[f[c]]=i;var h=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"];for(c=0,u=h.length;c<u;c++)l[h[c]]=a;return l}();return{startState:function(){return{tokenize:m,cc:[],stack:[]}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var i=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(e,t){var r=e.peek(),n=t.escaped;if(t.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(t.literal&&e.indentation()>t.keyCol)return e.skipToEnd(),"string";if(t.literal&&(t.literal=!1),e.sol()){if(t.keyCol=0,t.pair=!1,t.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?t.inlinePairs++:"}"==r?t.inlinePairs--:"["==r?t.inlineList++:t.inlineList--,"meta";if(0<t.inlineList&&!n&&","==r)return e.next(),"meta";if(0<t.inlinePairs&&!n&&","==r)return t.keyCol=0,t.pair=!1,t.pairStart=!1,e.next(),"meta";if(t.pairStart){if(e.match(/^\s*(\||\>)\s*/))return t.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(0<t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(i))return"keyword"}return!t.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(t.pair=!0,t.keyCol=e.indentation(),"atom"):t.pair&&e.match(/^:\s*/)?(t.pairStart=!0,"meta"):(t.pairStart=!1,t.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(v){"use strict";var y=/[\w$]+/;v.registerHelper("hint","anyword",function(e,t){for(var r=t&&t.word||y,n=t&&t.range||500,i=e.getCursor(),o=e.getLine(i.line),a=i.ch,l=a;l&&r.test(o.charAt(l-1));)--l;for(var s=l!=a&&o.slice(l,a),c=t&&t.list||[],u={},d=new RegExp(r.source,"g"),f=-1;f<=1;f+=2)for(var h=i.line,p=Math.min(Math.max(h+f*n,e.firstLine()),e.lastLine())+f;h!=p;h+=f)for(var m,g=e.getLine(h);m=d.exec(g);)h==i.line&&m[0]===s||s&&0!=m[0].lastIndexOf(s,0)||Object.prototype.hasOwnProperty.call(u,m[0])||(u[m[0]]=!0,c.push(m[0]));return{list:c,from:v.Pos(i.line,l),to:v.Pos(i.line,a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(b){function x(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:r[t]}function e(t){return function(e){return function(r,e){var t=w(r);if(!t||r.getOption("disableInput"))return b.Pass;var n=x(t,"pairs"),i=n.indexOf(e);if(-1==i)return b.Pass;for(var o,a=x(t,"triples"),l=n.charAt(i+1)==e,s=r.listSelections(),c=i%2==0,u=0;u<s.length;u++){var d,f=s[u],h=f.head,p=r.getRange(h,_(h.line,h.ch+1));if(c&&!f.empty())d="surround";else if(!l&&c||p!=e)if(l&&1<h.ch&&0<=a.indexOf(e)&&r.getRange(_(h.line,h.ch-2),h)==e+e&&(h.ch<=2||r.getRange(_(h.line,h.ch-3),_(h.line,h.ch-2))!=e))d="addFour";else if(l){if(b.isWordChar(p)||!k(r,h,e))return b.Pass;d="both"}else{if(!c||r.getLine(h.line).length!=h.ch&&(m=p,!(-1<(g=n.lastIndexOf(m))&&g%2==1))&&!/\s/.test(p))return b.Pass;d="both"}else d=0<=a.indexOf(e)&&r.getRange(h,_(h.line,h.ch+3))==e+e+e?"skipThree":"skip";if(o){if(o!=d)return b.Pass}else o=d}var m,g;var v=i%2?n.charAt(i-1):e,y=i%2?e:n.charAt(i+1);r.operation(function(){if("skip"==o)r.execCommand("goCharRight");else if("skipThree"==o)for(var e=0;e<3;e++)r.execCommand("goCharRight");else if("surround"==o){var t=r.getSelections();for(e=0;e<t.length;e++)t[e]=v+t[e]+y;r.replaceSelections(t,"around")}else"both"==o?(r.replaceSelection(v+y,null),r.triggerElectric(v+y),r.execCommand("goCharLeft")):"addFour"==o&&(r.replaceSelection(v+v+v+v,"before"),r.execCommand("goCharRight"))})}(e,t)}}function w(e){var t=e.state.closeBrackets;return t?e.getModeAt(e.getCursor()).closeBrackets||t:null}function l(e,t){var r=e.getRange(_(t.line,t.ch-1),_(t.line,t.ch+1));return 2==r.length?r:null}function k(e,t,r){var n=e.getLine(t.line),i=e.getTokenAt(t);if(!/\bstring2?\b/.test(i.type)){var o=new b.StringStream(n.slice(0,t.ch)+r+n.slice(t.ch),4);for(o.pos=o.start=i.start;;){var a=e.getMode().token(o,i.state);if(o.pos>=t.ch+1)return/\bstring2?\b/.test(a);o.start=o.pos}}}var r={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},_=b.Pos;b.defineOption("autoCloseBrackets",!1,function(e,t,r){r&&r!=b.Init&&(e.removeKeyMap(n),e.state.closeBrackets=null),t&&(e.state.closeBrackets=t,e.addKeyMap(n))});for(var t=r.pairs+"`",n={Backspace:function(e){var t=w(e);if(!t||e.getOption("disableInput"))return b.Pass;for(var r=x(t,"pairs"),n=e.listSelections(),i=0;i<n.length;i++){if(!n[i].empty())return b.Pass;var o=l(e,n[i].head);if(!o||r.indexOf(o)%2!=0)return b.Pass}for(i=n.length-1;0<=i;i--){var a=n[i].head;e.replaceRange("",_(a.line,a.ch-1),_(a.line,a.ch+1))}},Enter:function(r){var e=w(r),t=e&&x(e,"explode");if(!t||r.getOption("disableInput"))return b.Pass;for(var n=r.listSelections(),i=0;i<n.length;i++){if(!n[i].empty())return b.Pass;var o=l(r,n[i].head);if(!o||t.indexOf(o)%2!=0)return b.Pass}r.operation(function(){r.replaceSelection("\n\n",null),r.execCommand("goCharLeft"),n=r.listSelections();for(var e=0;e<n.length;e++){var t=n[e].head.line;r.indentLine(t,null,!0),r.indentLine(t+1,null,!0)}})}},i=0;i<t.length;i++)n["'"+t.charAt(i)+"'"]=e(t.charAt(i))}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(v){function i(e,t){for(var r=e.listSelections(),n=[],i=t?"/":"</",o=0;o<r.length;o++){if(!r[o].empty())return v.Pass;var a,l=r[o].head,s=e.getTokenAt(l),c=v.innerMode(e.getMode(),s.state),u=c.state;if(t&&("string"==s.type||"<"!=s.string.charAt(0)||s.start!=l.ch-1))return v.Pass;if("xml"!=c.mode.name)if("htmlmixed"==e.getMode().name&&"javascript"==c.mode.name)a=i+"script";else{if("htmlmixed"!=e.getMode().name||"css"!=c.mode.name)return v.Pass;a=i+"style"}else{if(!u.context||!u.context.tagName||b(e,u.context.tagName,l,u))return v.Pass;a=i+u.context.tagName}">"!=e.getLine(l.line).charAt(s.end)&&(a+=">"),n[o]=a}e.replaceSelections(n),r=e.listSelections();for(o=0;o<r.length;o++)(o==r.length-1||r[o].head.line<r[o+1].head.line)&&e.indentLine(r[o].head.line)}function y(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;++r)if(e[r]==t)return r;return-1}function b(e,t,r,n,i){if(v.scanForClosingTag){var o=Math.min(e.lastLine()+1,r.line+500),a=v.scanForClosingTag(e,r,null,o);if(a&&a.tag==t){for(var l=n.context,s=i?1:0;l&&l.tagName==t;l=l.prev)++s;r=a.to;for(var c=1;c<s;c++){var u=v.scanForClosingTag(e,r,null,o);if(!u||u.tag!=t)return;r=u.to}return 1}}}v.defineOption("autoCloseTags",!1,function(e,t,r){if(r!=v.Init&&r&&e.removeKeyMap("autoCloseTags"),t){var n={name:"autoCloseTags"};"object"==typeof t&&!t.whenClosing||(n["'/'"]=function(e){return(t=e).getOption("disableInput")?v.Pass:i(t,!0);var t}),"object"==typeof t&&!t.whenOpening||(n["'>'"]=function(e){return function(e){if(e.getOption("disableInput"))return v.Pass;for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())return v.Pass;var i=t[n].head,o=e.getTokenAt(i),a=v.innerMode(e.getMode(),o.state),l=a.state;if("xml"!=a.mode.name||!l.tagName)return v.Pass;var s=e.getOption("autoCloseTags"),c="html"==a.mode.configuration,u="object"==typeof s&&s.dontCloseTags||c&&x,d="object"==typeof s&&s.indentTags||c&&w,f=l.tagName;o.end>i.ch&&(f=f.slice(0,f.length-o.end+i.ch));var h=f.toLowerCase();if(!f||"string"==o.type&&(o.end!=i.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||1==o.string.length)||"tag"==o.type&&"closeTag"==l.type||o.string.indexOf("/")==o.string.length-1||u&&-1<y(u,h)||b(e,f,i,l,!0))return v.Pass;var p=d&&-1<y(d,h);r[n]={indent:p,text:">"+(p?"\n\n":"")+"</"+f+">",newPos:p?v.Pos(i.line+1,0):v.Pos(i.line,i.ch+1)}}for(n=t.length-1;0<=n;n--){var m=r[n];e.replaceRange(m.text,t[n].head,t[n].anchor,"+insert");var g=e.listSelections().slice(0);g[n]={head:m.newPos,anchor:m.newPos},e.setSelections(g),m.indent&&(e.indentLine(m.newPos.line,null,!0),e.indentLine(m.newPos.line+1,null,!0))}}(e)}),e.addKeyMap(n)}});var x=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],w=["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"];v.commands.closeTag=function(e){return i(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(d){"use strict";var f={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};d.registerHelper("hint","css",function(e){function t(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}var r=e.getCursor(),n=e.getTokenAt(r),i=d.innerMode(e.getMode(),n.state);if("css"==i.mode.name){if("keyword"==n.type&&0=="!important".indexOf(n.string))return{list:["!important"],from:d.Pos(r.line,n.start),to:d.Pos(r.line,n.end)};var o=n.start,a=r.ch,l=n.string.slice(0,a-o);/[^\w$_-]/.test(l)&&(l="",o=a=r.ch);var s=d.resolveMode("text/css"),c=[],u=i.state.state;return"pseudo"==u||"variable-3"==n.type?t(f):"block"==u||"maybeprop"==u?t(s.propertyKeywords):"prop"==u||"parens"==u||"at"==u||"params"==u?(t(s.valueKeywords),t(s.colorKeywords)):"media"!=u&&"media_parens"!=u||(t(s.mediaTypes),t(s.mediaFeatures)),c.length?{list:c,from:d.Pos(r.line,o),to:d.Pos(r.line,a)}:void 0}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(d){function f(e,t,r){var n;return(n=e.getWrapperElement().appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?n.innerHTML=t:n.appendChild(t),n}function h(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}d.defineExtension("openDialog",function(e,t,r){function n(e){if("string"==typeof e)s.value=e;else{if(a)return;a=!0,o.parentNode.removeChild(o),l.focus(),r.onClose&&r.onClose(o)}}r=r||{},h(this,null);var i,o=f(this,e,r.bottom),a=!1,l=this,s=o.getElementsByTagName("input")[0];return s?(r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&d.on(s,"input",function(e){r.onInput(e,s.value,n)}),r.onKeyUp&&d.on(s,"keyup",function(e){r.onKeyUp(e,s.value,n)}),d.on(s,"keydown",function(e){r&&r.onKeyDown&&r.onKeyDown(e,s.value,n)||((27==e.keyCode||!1!==r.closeOnEnter&&13==e.keyCode)&&(s.blur(),d.e_stop(e),n()),13==e.keyCode&&t(s.value,e))}),!1!==r.closeOnBlur&&d.on(s,"blur",n),s.focus()):(i=o.getElementsByTagName("button")[0])&&(d.on(i,"click",function(){n(),l.focus()}),!1!==r.closeOnBlur&&d.on(i,"blur",n),i.focus()),n}),d.defineExtension("openConfirm",function(e,t,r){function n(){a||(a=!0,i.parentNode.removeChild(i),l.focus())}h(this,null);var i=f(this,e,r&&r.bottom),o=i.getElementsByTagName("button"),a=!1,l=this,s=1;o[0].focus();for(var c=0;c<o.length;++c){var u=o[c];!function(t){d.on(u,"click",function(e){d.e_preventDefault(e),n(),t&&t(l)})}(t[c]),d.on(u,"blur",function(){--s,setTimeout(function(){s<=0&&n()},200)}),d.on(u,"focus",function(){++s})}}),d.defineExtension("openNotification",function(e,t){function r(){o||(o=!0,clearTimeout(n),i.parentNode.removeChild(i))}h(this,r);var n,i=f(this,e,t&&t.bottom),o=!1,a=t&&void 0!==t.duration?t.duration:5e3;return d.on(i,"click",function(e){d.e_preventDefault(e),r()}),a&&(n=setTimeout(r,a)),r})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],e):e(CodeMirror)}(function(i){"use strict";function e(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}var t="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),r=["_blank","_self","_top","_parent"],n=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],a=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],l=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],s={attrs:{}},c={a:{attrs:{href:null,ping:null,type:null,media:l,target:r,hreflang:t}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:l,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:s,base:{attrs:{href:null,target:r}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:a,formmethod:o,formnovalidate:["","novalidate"],formtarget:r,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:s,dir:s,div:s,dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":n,autocomplete:["on","off"],enctype:a,method:o,novalidate:["","novalidate"],target:r}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:["head","body"]},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:a,formmethod:o,formnovalidate:["","novalidate"],formtarget:r,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:l,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:n,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noframes:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,s:s,samp:s,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:n}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strike:s,strong:s,style:{attrs:{type:["text/css"],media:l,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:t}},tt:s,u:s,ul:s,var:s,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:s},u={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};for(var d in e(s),c)c.hasOwnProperty(d)&&c[d]!=s&&e(c[d]);i.htmlSchema=c,i.registerHelper("hint","html",function(e,t){var r={schemaInfo:c};if(t)for(var n in t)r[n]=t[n];return i.hint.xml(e,r)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){function f(e,t){for(var r=0,n=e.length;r<n;++r)t(e[r])}function r(e,t,r,n){var i=e.getCursor(),o=r(e,i);if(!/\b(?:string|comment)\b/.test(o.type)){o.state=s.innerMode(e.getMode(),o.state).state,/^[\w$_]*$/.test(o.string)?o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)):o={start:i.ch,end:i.ch,string:"",state:o.state,type:"."==o.string?"property":null};for(var a=o;"property"==a.type;){if("."!=(a=r(e,c(i.line,a.start))).string)return;if(a=r(e,c(i.line,a.start)),!l)var l=[];l.push(a)}return{list:function(e,t,r,n){function i(e){0!=e.lastIndexOf(l,0)||function(e,t){if(Array.prototype.indexOf)return-1!=e.indexOf(t);for(var r=e.length;r--;)if(e[r]===t)return 1}(a,e)||a.push(e)}function o(e){for(var t in"string"==typeof e?f(h,i):e instanceof Array?f(p,i):e instanceof Function&&f(m,i),e)i(t)}var a=[],l=e.string,s=n&&n.globalScope||window;if(t&&t.length){var c,u=t.pop();for(u.type&&0===u.type.indexOf("variable")?(n&&n.additionalContext&&(c=n.additionalContext[u.string]),n&&!1===n.useGlobalScope||(c=c||s[u.string])):"string"==u.type?c="":"atom"==u.type?c=1:"function"==u.type&&(null==s.jQuery||"$"!=u.string&&"jQuery"!=u.string||"function"!=typeof s.jQuery?null!=s._&&"_"==u.string&&"function"==typeof s._&&(c=s._()):c=s.jQuery());null!=c&&t.length;)c=c[t.pop().string];null!=c&&o(c)}else{for(var d=e.state.localVars;d;d=d.next)i(d.name);for(d=e.state.globalVars;d;d=d.next)i(d.name);n&&!1===n.useGlobalScope||o(s),f(r,i)}return a}(o,l,t,n),from:c(i.line,o.start),to:c(i.line,o.end)}}}function n(e,t){var r=e.getTokenAt(t);return t.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}var c=s.Pos;s.registerHelper("hint","javascript",function(e,t){return r(e,i,function(e,t){return e.getTokenAt(t)},t)}),s.registerHelper("hint","coffeescript",function(e,t){return r(e,o,n,t)});var h="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),p="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),m="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(" "),o="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(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";function o(e){e.operation(function(){!function(e){if(!e.somethingSelected())return s(e);if(1<e.listSelections().length)return c(e);var t=e.getCursor("start"),r=e.getCursor("end"),n=e.state.markedSelection;if(!n.length)return l(e,t,r);var i=n[0].find(),o=n[n.length-1].find();if(!i||!o||r.line-t.line<f||0<=p(t,o.to)||p(r,i.from)<=0)return c(e);for(;0<p(t,i.from);)n.shift().clear(),i=n[0].find();for(p(t,i.from)<0&&(i.to.line-t.line<f?(n.shift().clear(),l(e,t,i.to,0)):l(e,t,i.from,0));p(r,o.to)<0;)n.pop().clear(),o=n[n.length-1].find();0<p(r,o.to)&&(r.line-o.from.line<f?(n.pop().clear(),l(e,o.from,r)):l(e,o.to,r))}(e)})}function a(e){e.state.markedSelection.length&&e.operation(function(){s(e)})}function l(e,t,r,n){if(0!=p(t,r))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var l=a==t.line?t:h(a,0),s=a+f,c=s>=r.line,u=c?r:h(s,0),d=e.markText(l,u,{className:o});if(null==n?i.push(d):i.splice(n++,0,d),c)break;a=s}}function s(e){for(var t=e.state.markedSelection,r=0;r<t.length;++r)t[r].clear();t.length=0}function c(e){s(e);for(var t=e.listSelections(),r=0;r<t.length;r++)l(e,t[r].from(),t[r].to())}i.defineOption("styleSelectedText",!1,function(e,t,r){var n=r&&r!=i.Init;t&&!n?(e.state.markedSelection=[],e.state.markedSelectionStyle="string"==typeof t?t:"CodeMirror-selectedtext",c(e),e.on("cursorActivity",o),e.on("change",a)):!t&&n&&(e.off("cursorActivity",o),e.off("change",a),s(e),e.state.markedSelection=e.state.markedSelectionStyle=null)});var f=8,h=i.Pos,p=i.cmpPos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";function o(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly),null==this.style&&(this.style="matchhighlight"),null==this.minChars&&(this.minChars=2),null==this.delay&&(this.delay=100),null==this.wordsOnly&&(this.wordsOnly=!1),this.overlay=this.timeout=null}function a(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){l(e)},t.delay)}function l(c){c.operation(function(){var e=c.state.matchHighlighter;if(e.overlay&&(c.removeOverlay(e.overlay),e.overlay=null),c.somethingSelected()||!e.showToken){var t=c.getCursor("from"),r=c.getCursor("to");if(t.line==r.line&&(!e.wordsOnly||function(e,t,r){if(null===e.getRange(t,r).match(/^\w+$/))return;if(0<t.ch){var n={line:t.line,ch:t.ch-1};if(null===e.getRange(n,t).match(/\W/))return}if(r.ch<e.getLine(t.line).length){n={line:r.line,ch:r.ch+1};if(null===e.getRange(r,n).match(/\W/))return}return 1}(c,t,r))){var n=c.getRange(t,r).replace(/^\s+|\s+$/g,"");n.length>=e.minChars&&c.addOverlay(e.overlay=u(n,!1,e.style))}}else{for(var i=!0===e.showToken?/[\w$]/:e.showToken,o=c.getCursor(),a=c.getLine(o.line),l=o.ch,s=l;l&&i.test(a.charAt(l-1));)--l;for(;s<a.length&&i.test(a.charAt(s));)++s;l<s&&c.addOverlay(e.overlay=u(a.slice(l,s),i,e.style))}})}function u(n,i,o){return{token:function(e){return!e.match(n)||i&&(r=i,(t=e).start&&r.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&r.test(t.string.charAt(t.pos)))?(e.next(),void(e.skipTo(n.charAt(0))||e.skipToEnd())):o;var t,r}}}i.defineOption("highlightSelectionMatches",!1,function(e,t,r){if(r&&r!=i.Init){var n=e.state.matchHighlighter.overlay;n&&e.removeOverlay(n),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",a)}t&&(e.state.matchHighlighter=new o(t),l(e),e.on("cursorActivity",a))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){function u(e,t,r,n){var i=e.getLineHandle(t.line),o=t.ch-1,a=0<=o&&g[i.text.charAt(o)]||g[i.text.charAt(++o)];if(!a)return null;var l=">"==a.charAt(1)?1:-1;if(r&&0<l!=(o==t.ch))return null;var s=e.getTokenTypeAt(m(t.line,o+1)),c=d(e,m(t.line,o+(0<l?1:0)),l,s||null,n);return null==c?null:{from:m(t.line,o),to:c&&c.pos,match:c&&c.ch==a.charAt(0),forward:0<l}}function d(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,l=[],s=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,c=0<r?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a),u=t.line;u!=c;u+=r){var d=e.getLine(u);if(d){var f=0<r?0:d.length-1,h=0<r?d.length:-1;if(!(d.length>o))for(u==t.line&&(f=t.ch-(r<0?1:0));f!=h;f+=r){var p=d.charAt(f);if(s.test(p)&&(void 0===n||e.getTokenTypeAt(m(u,f+1))==n))if(">"==g[p].charAt(1)==0<r)l.push(p);else{if(!l.length)return{pos:m(u,f),ch:p};l.pop()}}}}return u-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),a=0;a<o.length;a++){var l=o[a].empty()&&u(e,o[a].head,!1,r);if(l&&e.getLine(l.from.line).length<=n){var s=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";i.push(e.markText(l.from,m(l.from.line,l.from.ch+1),{className:s})),l.to&&e.getLine(l.to.line).length<=n&&i.push(e.markText(l.to,m(l.to.line,l.to.ch+1),{className:s}))}}if(i.length){f&&e.state.focused&&e.focus();function c(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})}if(!t)return c;setTimeout(c,800)}}function i(e){e.operation(function(){r&&(r(),r=null),r=t(e,!1,e.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),m=n.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},r=null;n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&e.off("cursorActivity",i),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return u(this,e,t,r)}),n.defineExtension("scanForBracket",function(e,t,r,n){return d(this,e,t,r,n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(a){"use strict";function l(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(o){o.state.failedTagMatch=!1,o.operation(function(){if(l(o),!o.somethingSelected()){var e=o.getCursor(),t=o.getViewport();t.from=Math.min(t.from,e.line),t.to=Math.max(e.line+1,t.to);var r=a.findMatchingTag(o,e,t);if(r){if(o.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(o.state.tagHit=o.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var i="close"==r.at?r.open:r.close;i?o.state.tagOther=o.markText(i.from,i.to,{className:"CodeMirror-matchingtag"}):o.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}a.defineOption("matchTags",!1,function(e,t,r){r&&r!=a.Init&&(e.off("cursorActivity",n),e.off("viewportChange",i),l(e)),t&&(e.state.matchBothTags="object"==typeof t&&t.bothTags,e.on("cursorActivity",n),e.on("viewportChange",i),n(e))}),a.commands.toMatchingTag=function(e){var t=a.findMatchingTag(e,e.getCursor());if(t){var r="close"==t.at?t.open:t.close;r&&e.extendSelection(r.to,r.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(t){"use strict";t.overlayMode=function(r,n,i){return{startState:function(){return{base:t.startState(r),overlay:t.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(e){return{base:t.copyState(r,e.base),overlay:t.copyState(n,e.overlay),basePos:e.basePos,baseCur:null,overlayPos:e.overlayPos,overlayCur:null}},token:function(e,t){return(e!=t.streamSeen||Math.min(t.basePos,t.overlayPos)<e.start)&&(t.streamSeen=e,t.basePos=t.overlayPos=e.start),e.start==t.basePos&&(t.baseCur=r.token(e,t.base),t.basePos=e.pos),e.start==t.overlayPos&&(e.pos=e.start,t.overlayCur=n.token(e,t.overlay),t.overlayPos=e.pos),e.pos=Math.min(t.basePos,t.overlayPos),null==t.overlayCur?t.baseCur:null!=t.baseCur&&t.overlay.combineTokens||i&&null==t.overlay.combineTokens?t.baseCur+" "+t.overlayCur:t.overlayCur},indent:r.indent&&function(e,t){return r.indent(e.base,t)},electricChars:r.electricChars,innerMode:function(e){return{state:e.base,mode:r}},blankLine:function(e){r.blankLine&&r.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(o){function a(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){a(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.className="CodeMirror-placeholder",t.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function l(e){i(e)&&n(e)}function s(e){var t=e.getWrapperElement(),r=i(e);t.className=t.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),(r?n:a)(e)}function i(e){return 1===e.lineCount()&&""===e.getLine(0)}o.defineOption("placeholder","",function(e,t,r){var n=r&&r!=o.Init;if(t&&!n)e.on("blur",l),e.on("change",s),s(e);else if(!t&&n){e.off("blur",l),e.off("change",s),a(e);var i=e.getWrapperElement();i.className=i.className.replace(" CodeMirror-empty","")}t&&!e.hasFocus()&&l(e)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(k){"use strict";function r(e,t){this.cm=e,this.options=this.buildOptions(t),this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(),this.startLen=this.cm.getLine(this.startPos.line).length;var r=this;e.on("cursorActivity",this.activityFunc=function(){r.cursorActivity()})}function _(e){return"string"==typeof e?e:e.text}function C(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function n(i,e){this.completion=i,this.data=e,this.picked=!1;var r=this,o=i.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=e.selectedHint||0;for(var t=e.list,n=0;n<t.length;++n){var l=a.appendChild(document.createElement("li")),s=t[n],c="CodeMirror-hint"+(n!=this.selectedHint?"":" "+S);null!=s.className&&(c=s.className+" "+c),l.className=c,s.render?s.render(l,e,s):l.appendChild(document.createTextNode(s.displayText||_(s))),l.hintId=n}var u=o.cursorCoords(i.options.alignWithWord?e.from:null),d=u.left,f=u.bottom,h=!0;a.style.left=d+"px",a.style.top=f+"px";var p=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),m=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(i.options.container||document.body).appendChild(a);var g=a.getBoundingClientRect();if(0<g.bottom-m){var v=g.bottom-g.top;if(0<u.top-(u.bottom-g.top)-v)a.style.top=(f=u.top-v)+"px",h=!1;else if(m<v){a.style.height=m-5+"px",a.style.top=(f=u.bottom-g.top)+"px";var y=o.getCursor();e.from.ch!=y.ch&&(u=o.cursorCoords(y),a.style.left=(d=u.left)+"px",g=a.getBoundingClientRect())}}var b,x=g.right-p;0<x&&(g.right-g.left>p&&(a.style.width=p-5+"px",x-=g.right-g.left-p),a.style.left=(d=u.left-x)+"px"),o.addKeyMap(this.keyMap=function(e,n){function t(e,t){var r;r="string"!=typeof t?function(e){return t(e,n)}:i.hasOwnProperty(t)?i[t]:t,o[e]=r}var i={Up:function(){n.moveFocus(-1)},Down:function(){n.moveFocus(1)},PageUp:function(){n.moveFocus(1-n.menuSize(),!0)},PageDown:function(){n.moveFocus(n.menuSize()-1,!0)},Home:function(){n.setFocus(0)},End:function(){n.setFocus(n.length-1)},Enter:n.pick,Tab:n.pick,Esc:n.close},r=e.options.customKeys,o=r?{}:i;if(r)for(var a in r)r.hasOwnProperty(a)&&t(a,r[a]);var l=e.options.extraKeys;if(l)for(var a in l)l.hasOwnProperty(a)&&t(a,l[a]);return o}(i,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:t.length,close:function(){i.close()},pick:function(){r.pick()},data:e})),i.options.closeOnUnfocus&&(o.on("blur",this.onBlur=function(){b=setTimeout(function(){i.close()},100)}),o.on("focus",this.onFocus=function(){clearTimeout(b)}));var w=o.getScrollInfo();return o.on("scroll",this.onScroll=function(){var e=o.getScrollInfo(),t=o.getWrapperElement().getBoundingClientRect(),r=f+w.top-e.top,n=r-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return h||(n+=a.offsetHeight),n<=t.top||n>=t.bottom?i.close():(a.style.top=r+"px",void(a.style.left=d+w.left-e.left+"px"))}),k.on(a,"dblclick",function(e){var t=C(a,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())}),k.on(a,"click",function(e){var t=C(a,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),i.options.completeOnSingleClick&&r.pick())}),k.on(a,"mousedown",function(){setTimeout(function(){o.focus()},20)}),k.signal(e,"select",t[0],a.firstChild),!0}var S="CodeMirror-hint-active";k.showHint=function(e,t,r){if(!t)return e.showHint(r);r&&r.async&&(t.async=!0);var n={hint:t};if(r)for(var i in r)n[i]=r[i];return e.showHint(n)},k.defineExtension("showHint",function(e){if(!(1<this.listSelections().length||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var t=this.state.completionActive=new r(this,e);t.options.hint&&(k.signal(this,"startCompletion",this),t.update(!0))}});var i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},o=window.cancelAnimationFrame||clearTimeout;r.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&k.signal(this.data,"close"),this.widget&&this.widget.close(),k.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,t){var r=e.list[t];r.hint?r.hint(this.cm,e,r):this.cm.replaceRange(_(r),r.from||e.from,r.to||e.to,"complete"),k.signal(e,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(o(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var r=this;this.debounce=i(function(){r.update()}),this.widget&&this.widget.disable()}},update:function(t){if(null!=this.tick)if(this.options.hint.async){var r=++this.tick,n=this;this.options.hint(this.cm,function(e){n.tick==r&&n.finishUpdate(e,t)},this.options)}else this.finishUpdate(this.options.hint(this.cm,this.options),t)},finishUpdate:function(e,t){this.data&&k.signal(this.data,"update"),e&&this.data&&k.cmpPos(e.from,this.data.from)&&(e=null),this.data=e;var r=this.widget&&this.widget.picked||t&&this.options.completeSingle;this.widget&&this.widget.close(),e&&e.list.length&&(r&&1==e.list.length?this.pick(e,0):(this.widget=new n(this,e),k.signal(e,"shown")))},buildOptions:function(e){var t=this.cm.options.hintOptions,r={};for(var n in a)r[n]=a[n];if(t)for(var n in t)void 0!==t[n]&&(r[n]=t[n]);if(e)for(var n in e)void 0!==e[n]&&(r[n]=e[n]);return r}},n.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(e,t){if(e>=this.data.list.length?e=t?this.data.list.length-1:0:e<0&&(e=t?0:this.data.list.length-1),this.selectedHint!=e){var r=this.hints.childNodes[this.selectedHint];r.className=r.className.replace(" "+S,""),(r=this.hints.childNodes[this.selectedHint=e]).className+=" "+S,r.offsetTop<this.hints.scrollTop?this.hints.scrollTop=r.offsetTop-3:r.offsetTop+r.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+3),k.signal(this.data,"select",this.data.list[this.selectedHint],r)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},k.registerHelper("hint","auto",function(e,t){var r,n=e.getHelpers(e.getCursor(),"hint");if(n.length)for(var i=0;i<n.length;i++){var o=n[i](e,t);if(o&&o.list.length)return o}else if(r=e.getHelper(e.getCursor(),"hintWords")){if(r)return k.hint.fromList(e,{words:r})}else if(k.hint.anyword)return k.hint.anyword(e,t)}),k.registerHelper("hint","fromList",function(e,t){var r=e.getCursor(),n=e.getTokenAt(r),i=k.Pos(r.line,n.end);if(n.string&&/\w/.test(n.string[n.string.length-1]))var o=n.string,a=k.Pos(r.line,n.start);else o="",a=i;for(var l=[],s=0;s<t.words.length;s++){var c=t.words[s];c.slice(0,o.length)==o&&l.push(c)}return l.length?{list:l,from:a,to:i}:void 0}),k.commands.autocomplete=k.showHint;var a={hint:k.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};k.defineOption("hintOptions",null)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],e):e(CodeMirror)}(function(d){"use strict";function c(e){return"string"==typeof e?e:e.text}function m(e,t){if(!e.slice)return e[t];for(var r=e.length-1;0<=r;r--)if(c(e[r])==t)return e[r]}function g(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function v(e,t,r,n){for(var i in r)r.hasOwnProperty(i)&&(r.slice&&(i=r[i]),a=i,s=void 0,l=(o=t).length,s=c(a).substr(0,l),o.toUpperCase()===s.toUpperCase()&&e.push(n(i)));var o,a,l,s}function y(e){for(var t=c(e).split("."),r=0;r<t.length;r++)t[r]="`"+t[r]+"`";var n=t.join(".");return"string"==typeof e?n:((e=g(e)).text=n,e)}function b(e,t){if(e)for(var r=/[,;]/g,n=e.split(" "),i=0;i<n.length;i++)t(n[i]?n[i].replace(r,""):"")}function x(e){return e.line+e.ch/Math.pow(10,6)}function w(e){return M(Math.floor(e),+e.toString().split(".").pop())}function k(e,t){for(var r=t.doc,n=r.getValue(),i=e.toUpperCase(),o="",a="",l=[],s={start:M(0,0),end:M(t.lastLine(),t.getLineHandle(t.lastLine()).length)},c=n.indexOf(S.QUERY_DIV);-1!=c;)l.push(r.posFromIndex(c)),c=n.indexOf(S.QUERY_DIV,c+1);l.unshift(M(0,0)),l.push(M(t.lastLine(),t.getLineHandle(t.lastLine()).text.length));for(var u=0,d=x(t.getCursor()),f=0;f<l.length;f++){var h=x(l[f]);if(u<d&&d<=h){s={start:w(u),end:w(h)};break}u=h}var p=r.getRange(s.start,s.end,!1);for(f=0;f<p.length;f++){if(b(p[f],function(e){var t=e.toUpperCase();t===i&&m(_,o)&&(a=o),t!==S.ALIAS_KEYWORD&&(o=e)}),a)break}return a}var _,C,f,S={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},M=d.Pos;d.registerHelper("hint","sql",function(e,t){_=t&&t.tables||{};var r,n=t&&t.defaultTable,i=t&&t.disableKeywords;C=n&&m(_,n),f=f||("sql"===(r=e.doc.modeOption)&&(r="text/x-sql"),d.resolveMode(r).keywords),n&&!C&&(C=k(n,e)),(C=C||[]).columns&&(C=C.columns);var o,a,l,s=e.getCursor(),c=[],u=e.getTokenAt(s);return u.end>s.ch&&(u.end=s.ch,u.string=u.string.slice(0,s.ch-u.start)),u.string.match(/^[.`\w@]\w*$/)?(l=u.string,o=u.start,a=u.end):(o=a=s.ch,l=""),"."==l.charAt(0)||"`"==l.charAt(0)?o=function(e,t,r,n){for(var i=!1,o=[],a=t.start,l=!0;l;)l="."==t.string.charAt(0),i=i||"`"==t.string.charAt(0),a=t.start,o.unshift(("."==(s=t.string).charAt(0)&&(s=s.substr(1)),s.replace(/`/g,""))),"."==(t=n.getTokenAt(M(e.line,t.start))).string&&(l=!0,t=n.getTokenAt(M(e.line,t.start)));var s,c=o.join(".");v(r,c,_,function(e){return i?y(e):e}),v(r,c,C,function(e){return i?y(e):e}),c=o.pop();var u=o.join("."),d=!1,f=u;if(!m(_,u)){var h=u;(u=k(u,n))!==h&&(d=!0)}var p=m(_,u);return p&&p.columns&&(p=p.columns),p&&v(r,c,p,function(e){var t=u;return 1==d&&(t=f),"string"==typeof e?e=t+"."+e:(e=g(e)).text=t+"."+e.text,i?y(e):e}),a}(s,u,c,e):(v(c,l,_,function(e){return e}),v(c,l,C,function(e){return e}),i||v(c,l,f,function(e){return e.toUpperCase()})),{list:c,from:M(s.line,o),to:M(s.line,a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function u(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?n.from:e.firstLine(),this.max=n?n.to-1:e.lastLine()}function i(e,t){var r=e.cm.getTokenTypeAt(m(e.line,t));return r&&/\btag\b/.test(r)}function o(e){return!(e.line>=e.max)&&(e.ch=0,e.text=e.cm.getLine(++e.line),1)}function a(e){return!(e.line<=e.min)&&(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,1)}function d(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){n.lastIndex=t,e.ch=t;var r=n.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function s(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(o(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var r=e.text.lastIndexOf("/",t),n=-1<r&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function h(e,t){for(var r=[];;){var n,i=s(e),o=e.line,a=e.ch-(i?i[0].length:0);if(!i||!(n=d(e)))return;if("selfClose"!=n)if(i[1]){for(var l=r.length-1;0<=l;--l)if(r[l]==i[2]){r.length=l;break}if(l<0&&(!t||t==i[2]))return{tag:i[2],from:m(o,a),to:m(e.line,e.ch)}}else r.push(i[2])}}function p(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var i=e.line,o=e.ch,a=f(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;0<=l;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!t||t==a[2]))return{tag:a[2],from:m(e.line,e.ch),to:m(i,o)}}}else f(e)}}var m=e.Pos,t="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",n=new RegExp("<(/?)(["+t+"][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new u(e,t.line,0);;){var n,i=s(r);if(!i||r.line!=t.line||!(n=d(r)))return;if(!i[1]&&"selfClose"!=n){t=m(r.line,r.ch);var o=h(r,i[2]);return o&&{from:t,to:o.from}}}}),e.findMatchingTag=function(e,t,r){var n,i,o=new u(e,t.line,t.ch,r);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var a=d(o),l=a&&m(o.line,o.ch),s=a&&f(o);if(a&&s&&(i=t,!(0<((n=o).line-i.line||n.ch-i.ch)))){var c={from:m(o.line,o.ch),to:l,tag:s[2]};return"selfClose"==a?{open:c,close:null,at:"open"}:s[1]?{open:p(o,s[2]),close:c,at:"close"}:{open:c,close:h(o=new u(e,l.line,l.ch,r),s[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r){for(var n=new u(e,t.line,t.ch,r);;){var i=p(n);if(!i)break;var o=h(new u(e,t.line,t.ch,r),i.tag);if(o)return{open:i,close:o}}},e.scanForClosingTag=function(e,t,r,n){return h(new u(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(A){"use strict";var O=A.Pos;A.registerHelper("hint","xml",function(e,t){var r=t&&t.schemaInfo,n=t&&t.quoteChar||'"';if(r){var i=e.getCursor(),o=e.getTokenAt(i);o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start));var a=A.innerMode(e.getMode(),o.state);if("xml"==a.mode.name){var l,s,c=[],u=!1,d=/\btag\b/.test(o.type)&&!/>$/.test(o.string),f=d&&/^\w/.test(o.string);if(f){var h=e.getLine(i.line).slice(Math.max(0,o.start-2),o.start),p=/<\/$/.test(h)?"close":/<$/.test(h)?"open":null;p&&(s=o.start-("close"==p?2:1))}else d&&"<"==o.string?p="open":d&&"</"==o.string&&(p="close");if(!d&&!a.state.tagName||p){f&&(l=o.string),u=p;var m=a.state.context,g=m&&r[m.tagName],v=m?g&&g.children:r["!top"];if(v&&"close"!=p)for(var y=0;y<v.length;++y)l&&0!=v[y].lastIndexOf(l,0)||c.push("<"+v[y]);else if("close"!=p)for(var b in r)!r.hasOwnProperty(b)||"!top"==b||"!attrs"==b||l&&0!=b.lastIndexOf(l,0)||c.push("<"+b);m&&(!l||"close"==p&&0==m.tagName.lastIndexOf(l,0))&&c.push("</"+m.tagName+">")}else{var x=(g=r[a.state.tagName])&&g.attrs,w=r["!attrs"];if(!x&&!w)return;if(x){if(w){var k={};for(var _ in w)w.hasOwnProperty(_)&&(k[_]=w[_]);for(var _ in x)x.hasOwnProperty(_)&&(k[_]=x[_]);x=k}}else x=w;if("string"==o.type||"="==o.string){var C,S=(h=e.getRange(O(i.line,Math.max(0,i.ch-60)),O(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!S||!x.hasOwnProperty(S[1])||!(C=x[S[1]]))return;if("function"==typeof C&&(C=C.call(this,e)),"string"==o.type){l=o.string;var M=0;/['"]/.test(o.string.charAt(0))&&(n=o.string.charAt(0),l=o.string.slice(1),M++);var L=o.string.length;/['"]/.test(o.string.charAt(L-1))&&(n=o.string.charAt(L-1),l=o.string.substr(M,L-2)),u=!0}for(y=0;y<C.length;++y)l&&0!=C[y].lastIndexOf(l,0)||c.push(n+C[y]+n)}else for(var T in"attribute"==o.type&&(l=o.string,u=!0),x)!x.hasOwnProperty(T)||l&&0!=T.lastIndexOf(l,0)||c.push(T)}return{list:c,from:u?O(i.line,null==s?o.start:s):i,to:u?O(i.line,o.end):i}}}})});
/home/locationbo/www/administrator/./components/./com_widgetkit/assets/lib/codemirror/codemirror.js