芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/tvc.mgaplay.com.br/web/dist/vendor/ckeditor/plugins/codemirror/js/codemirror.min.js
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("codemirror.js",t):(e=e||self).CodeMirror=t()}(this,(function(){function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;0
o||o>=t)return r+(t-i);r+=o-i,r+=n-r%n,i=o+1}}function d(e,t){for(var n=0;n
=t)return i+Math.min(l,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}function p(e){for(;ao.length<=e;)ao.push(g(ao)+" ");return ao[e]}function g(e){return e[e.length-1]}function m(e,t){for(var n=[],i=0;i
n?0
n?-1:1;;){if(t==n)return t;var r=(t+n)/2;if((r=0>i?Math.ceil(r):Math.floor(r))==t)return e(r)?t:n;e(r)?n=r:t=r+i}}function k(e,t,n){var i;ho=null;for(var r=0;r
t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ho=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ho=r)}return null!=i?i:ho}function T(e,t){var n=e.order;return null==n&&(n=e.order=fo(e.text,t)),n}function M(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=(e=e._handlers)&&e[t];i&&-1<(n=d(i,n))&&(e[t]=i.slice(0,n).concat(i.slice(n+1)))}}function N(e,t){var n=e._handlers&&e._handlers[t]||po;if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r
=t.offsetWidth&&2
Fr))}return(e=to?i("span",""):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")).setAttribute("cm-text",""),e}function z(e,t){2
(t-=e.first)||t>=e.size)throw Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t
=e.first&&t
te(e,t)?t:e}function oe(e,t){return 0>te(e,t)?e:t}function le(e,t){if(t.line
n)return ee(n,X(e,n).text.length);n=X(e,t.line).text.length;var i=t.ch;return null==i||i>n?ee(t.line,n):0>i?ee(t.line,0):t}function se(e,t){for(var n=[],i=0;i
e&&r.splice(a,1,e,r[a+1],i),a+=2,u=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n
e.options.maxHighlightLength&&V(e.doc.mode,i.state),o=ae(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ce(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new To(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100);t>l;--t){if(t<=o.first)return o.first;var s=X(o,t-1),a=s.stateAfter;if(a&&(!n||t+(a instanceof ko?a.lookAhead:0)<=o.modeFrontier))return t;s=h(s.text,null,e.options.tabSize),(null==r||i>s)&&(r=t-1,i=s)}return r}(e,t,n),l=o>i.first&&X(i,o-1).stateAfter,s=l?To.fromSaved(i,l,o):new To(i,j(i.mode),o);return i.iter(o,t,(function(n){he(e,n.text,s);var i=s.line;n.stateAfter=i==t-1||0==i%5||i>=r.viewFrom&&i
r;r++){i&&(i[0]=K(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw Error("Mode "+e.name+" failed to advance stream.")}function pe(e,t,n,i){var r,o,l=e.doc,s=l.mode,a=X(l,(t=le(l,t)).line);for(n=ce(e,t.line,n),e=new Lo(a.text,e.options.tabSize,n),i&&(o=[]);(i||e.pos
e.options.maxHighlightLength?(s=!1,l&&he(e,t,i,h.pos),h.pos=t.length,a=null):a=ge(fe(n,h,i.state,d),o),d){var f=d[0].name;f&&(a="m-"+(a?f+" "+a:f))}if(!s||c!=a){for(;u
=l:c.to>l);(r||(r=[])).push(new ve(h,c.from,d?null:c.to))}}if(n=r,i)for(r=0;r
=s:u.to>s)||u.from==s&&"bookmark"==c.type&&(!a||u.marker.insertLeft))&&(h=null==u.from||(c.inclusiveLeft?u.from<=s:u.from
Se(n,r.marker))&&(n=r.marker);return n}function ke(e,t,n,i,r){if(e=X(e,t),e=Oo&&e.markedSpans)for(t=0;t
=a||0>=s&&0<=a)&&(0>=s&&(o.marker.inclusiveRight&&r.inclusiveLeft?0<=te(l.to,n):0
=te(l.from,i):0>te(l.from,i))))return!0}}}function Te(e){for(var t;t=Le(e,!0);)e=t.find(-1,!0).line;return e}function Me(e,t){var n=X(e,t),i=Te(n);return n==i?t:q(i)}function Ne(e,t){if(t>e.lastLine())return t;var n,i=X(e,t);if(!Oe(e,i))return t;for(;n=Le(i,!1);)i=n.find(1,!0).line;return q(i)+1}function Oe(e,t){var n=Oo&&t.markedSpans;if(n)for(var i=void 0,r=0;r
t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}function Fe(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ho:Wo;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ee(e,i){var o=r("span",null,null,Er?"padding-right: .1px":null);o={pre:r("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")},i.measure={};for(var l=0;l<=(i.rest?i.rest.length:0);l++){var s,u=l?i.rest[l-1]:i.line,c=void 0;if(o.pos=0,o.addToken=Re,s=e.display.measure,null!=no)s=no;else{var h=n(s,document.createTextNode("AخA")),d=$r(h,0,1).getBoundingClientRect();h=$r(h,1,2).getBoundingClientRect(),t(s),s=!(!d||d.left==d.right)&&(no=3>h.right-d.right)}s&&(c=T(u,e.doc.direction))&&(o.addToken=Ie(o.addToken,c)),o.map=[];e:{c=o,s=ue(e,u,s=i!=e.display.externalMeasured&&q(u));var f=u.markedSpans;if(d=u.text,h=0,f)for(var p=d.length,g=0,m=1,v="",y=void 0,b=void 0,w=0,x=void 0,C=void 0,S=void 0,L=void 0,k=void 0;;){if(w==g){x=C=S=b="",L=k=null,w=1/0;for(var M=[],O=void 0,A=0;A
g||W.collapsed&&D.to==g&&D.from==g)){if(null!=D.to&&D.to!=g&&w>D.to&&(w=D.to,C=""),W.className&&(x+=" "+W.className),W.css&&(b=(b?b+";":"")+W.css),W.startStyle&&D.from==g&&(S+=" "+W.startStyle),W.endStyle&&D.to==w&&(O||(O=[])).push(W.endStyle,D.to),W.title&&((k||(k={})).title=W.title),W.attributes)for(var H in W.attributes)(k||(k={}))[H]=W.attributes[H];W.collapsed&&(!L||0>Se(L.marker,W))&&(L=D)}else D.from>g&&w>D.from&&(w=D.from)}if(O)for(A=0;A
=p)break;for(M=Math.min(p,w);;){if(v){if(O=g+v.length,L||(A=O>M?v.slice(0,M-g):v,c.addToken(c,A,y?y+x:x,S,g+A.length==w?C:"",b,k)),O>=M){v=v.slice(M-g),g=M;break}g=O,S=""}v=d.slice(h,h=s[m++]),y=Fe(s[m++],c.cm.options)}}else for(f=1;f
Fr?a.appendChild(i("span",[m])):a.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!f)break;d+=g+1,g=void 0,"\t"==f[0]?(f=e.cm.options.tabSize,f-=e.col%f,(g=a.appendChild(i("span",p(f),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=f):("\r"==f[0]||"\n"==f[0]?(g=a.appendChild(i("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),Hr&&9>Fr?a.appendChild(i("span",[g])):a.appendChild(g)),e.col+=1),e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,a=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,a),Hr&&9>Fr&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||o||h||l||s){if(t=n||"",r&&(t+=r),o&&(t+=o),r=i("span",[a],t,l),s)for(var v in s)s.hasOwnProperty(v)&&"style"!=v&&"class"!=v&&r.setAttribute(v,s[v]);return e.content.appendChild(r)}e.content.appendChild(a)}}function Ie(e,t){return function(n,i,r,o,l,s,a){r=r?r+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+i.length;;){for(var h=void 0,d=0;d
u&&h.from<=u);d++);if(h.to>=c)return e(n,i,r,o,l,s,a);e(n,i.slice(0,h.to-u),r,o,null,s,a),o=null,i=i.slice(h.to-u),u=h.to}}}function ze(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Be(e,t,n){for(var i,r=this.line=t;r=Le(r,!1);)r=r.find(1,!0).line,(i||(i=[])).push(r);this.size=(this.rest=i)?q(g(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Oe(e,t)}function Ge(e,t,n){var i,r=[];for(i=t;i
Fr&&(e.node.style.zIndex=2)),e.node}function Xe(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Ee(e,t)}function Ye(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=je(t);t.background=r.insertBefore(i("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}t.line.wrapClass?je(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=""),t.text.className=(t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass)||""}function _e(e,t,n,r){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 o=je(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}if(o=t.line.gutterMarkers,e.options.lineNumbers||o){var l=je(t),s=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(i("div",J(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(t=0;t
n)return{map:e.measure.maps[t],cache:e.measure.caches[t],before:!0}}function lt(e,t){if(t>=e.display.viewFrom&&t
=n.lineN&&t
g;g++){for(;u&&C(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+c
Fr&&0==u&&c==a.coverEnd-a.coverStart)p=o.parentNode.getBoundingClientRect();else{if(p=$r(o,u,c).getClientRects(),c=Po,"left"==d)for(h=0;h
Fr&&((g=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)||(null!=wo?g=wo:(g=(d=n(e.display.measure,i("span","x"))).getBoundingClientRect(),d=$r(d,0,1).getBoundingClientRect(),g=wo=1
Fr)||u||p&&(p.left||p.right)||(p=(p=o.parentNode.getClientRects()[0])?{left:p.left,right:p.left+At(e.display),top:p.top,bottom:p.bottom}:Po),g=((o=p.top-t.rect.top)+(u=p.bottom-t.rect.top))/2,d=t.view.measure.heights,a=0;a
t)&&(r=(o=a-s)-1,t>=a&&(l="right")),null!=r){if(i=e[u+2],s==a&&n==(i.insertLeft?"left":"right")&&(l=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],l="left";if("right"==n&&r==a-s)for(;u
=i.text.length?(u=i.text.length,t="before"):0>=u&&(u=0,t="after"),!a)return l("before"==t?u-1:u,"before"==t);var c=k(a,u,t),h=ho;return c=s(u,c,"before"==t),null!=h&&(c.other=s(u,h,"before"!=t)),c}function wt(e,t){var n=0;t=le(e.doc,t),e.options.lineWrapping||(n=At(e.display)*t.ch);var i=X(e.doc,t.line),r=De(i)+e.display.lineSpace.offsetTop;return{left:n,right:n,top:r,bottom:r+i.height}}function xt(e,t,n,i,r){return(e=ee(e,t,n)).xRel=r,i&&(e.outside=i),e}function Ct(e,t,n){var i=e.doc;if(0>(n+=e.display.viewOffset))return xt(i.first,0,null,-1,-1);var r=Z(i,n);if(r>(l=i.first+i.size-1))return xt(i.first+i.size-1,X(i,l).text.length,null,1,1);0>t&&(t=0);for(var o=X(i,r);;){var l,s;s=(l=Tt(e,o,r,t,n)).ch+(0
s)&&(!a||0>Se(a,c.marker))&&(a=c.marker)}if(!(s=a))return l;if((l=s.find(1)).line==r)return l;o=X(i,r=l.line)}}function St(e,t,n,i){i-=gt(t);var r=L((function(t){return at(e,n,t-1).bottom<=i}),t=t.text.length,0);return{begin:r,end:t=L((function(t){return at(e,n,t).top>i}),r,t)}}function Lt(e,t,n,i){return n||(n=st(e,t)),St(e,t,n,i=mt(e,t,at(e,n,i),"line").top)}function kt(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function Tt(e,t,n,i,r){r-=De(t);var o=st(e,t),l=gt(t),s=0,a=t.text.length,u=!0;(d=T(t,e.doc.direction))&&(s=(u=1!=(d=(e.options.lineWrapping?Nt:Mt)(e,t,n,o,d,i,r)).level)?d.from:d.to-1,a=u?d.to:d.from-1);var c=null,h=null,d=L((function(t){var n=at(e,o,t);return n.top+=l,n.bottom+=l,!!kt(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(c=t,h=n),!0)}),s,a),f=!1;return h?(s=i-h.left
=f.bottom?1:0),xt(n,d=S(t.text,d,1),u,f,i-s)}function Mt(e,t,n,i,r,o,l){var s=L((function(s){var a=1!=(s=r[s]).level;return kt(bt(e,ee(n,a?s.to:s.from,a?"before":"after"),"line",t,i),o,l,!0)}),0,r.length-1),a=r[s];if(0
l&&(a=r[s-1])}return a}function Nt(e,t,n,i,r,o,l){n=(l=St(e,t,i,l)).begin,l=l.end,/\s/.test(t.text.charAt(l-1))&&l--;for(var s=t=null,a=0;a
=l||u.to<=n)){var c=(c=at(e,i,1!=u.level?Math.min(l,u.to)-1:Math.max(n,u.from)).right)
c)&&(t=u,s=c)}}return t||(t=r[r.length-1]),t.from
l&&(t={from:t.from,to:l,level:t.level}),t}function Ot(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Do){Do=i("pre",null,"CodeMirror-line-like");for(var r=0;49>r;++r)Do.appendChild(document.createTextNode("x")),Do.appendChild(i("br"));Do.appendChild(document.createTextNode("x"))}return n(e.measure,Do),3<(r=Do.offsetHeight/50)&&(e.cachedTextHeight=r),t(e.measure),r||1}function At(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=i("span","xxxxxxxxxx"),r=i("pre",[t],"CodeMirror-line-like");return n(e.measure,r),2<(t=((t=t.getBoundingClientRect()).right-t.left)/10)&&(e.cachedCharWidth=t),t||10}function Dt(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:Wt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Wt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ht(e){var t=Ot(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/At(e.display)-3);return function(r){if(Oe(e.doc,r))return 0;var o=0;if(r.widgets)for(var l=0;l
=e.display.viewTo)return null;if(0>(t-=e.display.viewFrom))return null;for(var n=e.display.view,i=0;i
(t-=n[i].size))return i}function Rt(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n
t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Oo&&Me(e.doc,t)
r.viewFrom?zt(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)zt(e);else if(t<=r.viewFrom)(o=Bt(e,n,n+i,1))?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):zt(e);else if(n>=r.viewTo)(o=Bt(e,t,t,-1))?(r.view=r.view.slice(0,o.index),r.viewTo=o.lineN):zt(e);else{var o=Bt(e,t,t,-1),l=Bt(e,n,n+i,1);o&&l?(r.view=r.view.slice(0,o.index).concat(Ge(e,o.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):zt(e)}(e=r.externalMeasured)&&(n
=r.lineN&&t
=i.viewTo||null!=(e=i.view[Pt(e,t)]).node&&-1==d(e=e.changes||(e.changes=[]),n)&&e.push(n)}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t,n,i){var r=Pt(e,t),o=e.display.view;if(!Oo||n==e.doc.first+e.doc.size)return{index:r,lineN:n};for(var l=e.display.viewFrom,s=0;s
i?0:o.length-1))return null;n+=i*o[r-(0>i?1:0)].size,r+=i}return{index:r,lineN:n}}function Gt(e){e=e.display.view;for(var t=0,n=0;n
=e.display.viewTo||s.to().line
t&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?c-e:n)+"px;\n height: "+(r-t)+"px"))}function o(t,n,i){function o(n,i){return yt(e,ee(t,n),"div",f,i)}function l(t,n,i){return t=Lt(e,f,null,t),n="ltr"==n==("after"==i)?"left":"right",o(i="after"==i?t.begin:t.end-(/\s/.test(f.text.charAt(t.end-1))?2:1),n)[n]}var a,d,f=X(s,t),p=f.text.length,g=T(f,s.direction);return function(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o
t||t==n&&l.to==t)&&(i(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(g,n||0,null==i?p:i,(function(e,t,s,f){var m="ltr"==s,v=o(e,m?"left":"right"),y=o(t-1,m?"right":"left"),b=null==n&&0==e,w=null==i&&t==p,x=0==f;f=!g||f==g.length-1,3>=y.top-v.top?r(t=(h?b:w)&&x?u:(m?v:y).left,v.top,((h?w:b)&&f?c:(m?y:v).right)-t,v.bottom):(m?(m=h&&b&&x?u:v.left,b=h?c:l(e,s,"before"),e=h?u:l(t,s,"after"),w=h&&w&&f?c:y.right):(m=h?l(e,s,"before"):u,b=!h&&b&&x?c:v.right,e=!h&&w&&f?u:y.left,w=h?l(t,s,"after"):c),r(m,v.top,b-m,v.bottom),v.bottom
jt(v,a))&&(a=v),0>jt(y,a)&&(a=y),(!d||0>jt(v,d))&&(d=v),0>jt(y,d)&&(d=y)})),{start:a,end:d}}var l=e.display,s=e.doc,a=document.createDocumentFragment(),u=(f=tt(e.display)).left,c=Math.max(l.sizerWidth,it(e)-l.sizer.offsetLeft)-f.right,h="ltr"==s.direction;if(l=t.from(),t=t.to(),l.line==t.line)o(l.line,l.ch,t.ch);else{var d=X(s,l.line),f=X(s,t.line);f=Te(d)==Te(f),l=o(l.line,l.ch,f?d.text.length+1:null).end,t=o(t.line,f?0:null,t.ch).start,f&&(l.top
e.options.cursorBlinkRate&&(t.cursorDiv.style.visibility="hidden")}}function _t(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||qt(e))}function $t(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zt(e))}),100)}function qt(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(N(e,"focus",e,t),e.state.focused=!0,s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Er&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yt(e))}function Zt(e,t){e.state.delayingBlurEvent||(e.state.focused&&(N(e,"blur",e,t),e.state.focused=!1,Qr(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qt(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i
Fr)l=(o=r.node.offsetTop+r.node.offsetHeight)-n,n=o;else{var a=r.node.getBoundingClientRect();l=a.bottom-a.top,!o&&r.text.firstChild&&(s=r.text.firstChild.getBoundingClientRect().right-a.left-1)}if((.005<(o=r.line.height-l)||-.005>o)&&($(r.line,l),Jt(r.line),r.rest))for(l=0;l
e.display.sizerWidth&&(s=Math.ceil(s/At(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=s,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Jt(e){if(e.widgets)for(var t=0;t
=r&&(i=Z(t,De(X(t,n))-e.wrapper.clientHeight),r=n)}return{from:i,to:Math.max(r,i+1)}}function tn(e,t){var n=e.display,i=Ot(e.display);0>t.top&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=rt(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+et(n),a=t.top
s-i,t.top
r+o&&(o=Math.min(t.top,(i?s:t.bottom)-o))!=r&&(l.scrollTop=o),r=e.options.fixedGutter?0:n.gutters.offsetWidth,o=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-r,n=it(e)-n.gutters.offsetWidth,(s=t.right-t.left>n)&&(t.right=t.left+n),10>t.left?l.scrollLeft=0:t.left
n+o-3&&(l.scrollLeft=t.right+(s?0:10)-n),l}function nn(e,t){null!=t&&(ln(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function rn(e){ln(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function on(e,t,n){null==t&&null==n||ln(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ln(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,sn(e,wt(e,t.from),wt(e,t.to),t.margin))}function sn(e,t,n,i){on(e,(t=tn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i})).scrollLeft,t.scrollTop)}function an(e,t){2>Math.abs(e.doc.scrollTop-t)||(Or||kn(e,{top:t}),un(e,t,!0),Or&&kn(e),xn(e,100))}function un(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function cn(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:2>Math.abs(e.doc.scrollLeft-t))&&!i||(e.doc.scrollLeft=t,Nn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function hn(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+et(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?n:0,docHeight:i,scrollHeight:i+nt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function dn(e,t){t||(t=hn(e));var n=e.display.barWidth,i=e.display.barHeight;fn(e,t);for(var r=0;4>r&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Qt(e),fn(e,hn(e)),n=e.display.barWidth,i=e.display.barHeight}function fn(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function pn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Qr(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zo[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),go(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?cn(e,t):an(e,t)}),e),e.display.scrollbars.addClass&&s(e.display.wrapper,e.display.scrollbars.addClass)}function gn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Bo},e=e.curOp,Fo?Fo.ops.push(e):e.ownsGroup=Fo={ops:[e],delayedCallbacks:[]}}function mn(e){(e=e.curOp)&&function(e,t){var n=e.ownsGroup;if(n)try{var r=n.delayedCallbacks,o=0;do{for(;o
=o.viewTo)||o.maxLineChanged&&r.options.lineWrapping,n.update=n.mustUpdate&&new Go(r,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}for(t=0;t
d;d++){var f=!1,p=(h=bt(r,a),u&&u!=a?bt(r,u):h),g=(p=tn(r,h={left:Math.min(h.left,p.left),top:Math.min(h.top,p.top)-c,right:Math.max(h.left,p.left),bottom:Math.max(h.bottom,p.bottom)+c}),r.doc.scrollTop),m=r.doc.scrollLeft;if(null!=p.scrollTop&&(an(r,p.scrollTop),1
u.top+d.top?a=!0:u.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null==a||Gr||(u=i("div","",null,"position: absolute;\n top: "+(u.top-c.viewOffset-r.display.lineSpace.offsetTop)+"px;\n height: "+(u.bottom-u.top+nt(r)+c.barHeight)+"px;\n left: "+u.left+"px; width: "+Math.max(2,u.right-u.left)+"px;"),r.display.lineSpace.appendChild(u),u.scrollIntoView(a),r.display.lineSpace.removeChild(u)))}if(u=n.maybeHiddenMarkers,a=n.maybeUnhiddenMarkers,u)for(c=0;c
=e.display.viewTo)){var n=+new Date+e.options.workTime,i=ce(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?V(t.mode,i.state):null,a=ae(e,o,i,!0);for(s&&(i.state=s),o.styles=a.styles,s=o.styleClasses,(a=a.classes)?o.styleClasses=a:s&&(o.styleClasses=null),a=!l||l.length!=o.styles.length||s!=a&&(!s||!a||s.bgClass!=a.bgClass||s.textClass!=a.textClass),s=0;!a&&s
n)return xn(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&vn(e,(function(){for(var t=0;t
=i.viewFrom&&n.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==Gt(e))return!1;On(e)&&(zt(e),n.dims=Dt(e));var s=r.first+r.size,a=Math.max(n.visible.from-e.options.viewportMargin,r.first),u=Math.min(s,n.visible.to+e.options.viewportMargin);return i.viewFrom
a-i.viewFrom&&(a=Math.max(r.first,i.viewFrom)),i.viewTo>u&&20>i.viewTo-u&&(u=Math.min(s,i.viewTo)),Oo&&(a=Me(e.doc,a),u=Ne(e.doc,u)),r=a!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=n.wrapperHeight||i.lastWrapWidth!=n.wrapperWidth,0==(s=e.display).view.length||a>=s.viewTo||u<=s.viewFrom?(s.view=Ge(e,a,u),s.viewFrom=a):(s.viewFrom>a?s.view=Ge(e,a,s.viewFrom).concat(s.view):s.viewFrom
u&&(s.view=s.view.slice(0,Pt(e,u)))),s.viewTo=u,i.viewOffset=De(X(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px",u=Gt(e),!(!r&&0==u&&!n.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)||(e.hasFocus()?a=null:(a=l())&&o(e.display.lineDiv,a)?(a={activeElt:a},window.getSelection&&(s=window.getSelection()).anchorNode&&s.extend&&o(e.display.lineDiv,s.anchorNode)&&(a.anchorNode=s.anchorNode,a.anchorOffset=s.anchorOffset,a.focusNode=s.focusNode,a.focusOffset=s.focusOffset)):a=null,4
=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Sn(e,t))break;Qt(e),i=hn(e),Ut(e),dn(e,i),Mn(e,i),t.force=!1}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 kn(e,t){var n=new Go(e,t);if(Sn(e,n)){Qt(e),Ln(e,n);var i=hn(e);Ut(e),dn(e,i),Mn(e,i),n.finish()}}function Tn(e){e.sizer.style.marginLeft=e.gutters.offsetWidth+"px"}function Mn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+nt(e)+"px"}function Nn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=Wt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",l=0;l
Fr&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),Er||Or&&Kr||(this.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(this.wrapper):e(this.wrapper)),this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=t.first,this.view=[],this.externalMeasured=this.renderedView=null,this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0,this.updateLineNumbers=null,this.nativeBarWidth=this.barHeight=this.barWidth=0,this.scrollbarsClipped=!1,this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null,this.alignWidgets=!1,this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.activeTouch=this.selForContextMenu=null,this.gutterSpecs=An(o.gutters,o.lineNumbers),Dn(this),n.init(this)}function Fn(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function En(e){return(e=Fn(e)).x*=Vo,e.y*=Vo,e}function Pn(e,t){var n=(i=Fn(t)).x,i=i.y,r=e.display,o=r.scroller,l=o.scrollWidth>o.clientWidth,s=o.scrollHeight>o.clientHeight;if(n&&l||i&&s){if(i&&jr&&Er){l=t.target;var a=r.view;e:for(;l!=o;l=l.parentNode)for(var u=0;u
s?l=Math.max(0,l+s-50):a=Math.min(e.doc.height,a+s+50),kn(e,{top:l,bottom:a})),20>Uo&&(null==r.wheelStartX?(r.wheelStartX=o.scrollLeft,r.wheelStartY=o.scrollTop,r.wheelDX=n,r.wheelDY=i,setTimeout((function(){if(null!=r.wheelStartX){var e=o.scrollLeft-r.wheelStartX,t=o.scrollTop-r.wheelStartY;e=t&&r.wheelDY&&t/r.wheelDY||e&&r.wheelDX&&e/r.wheelDX,r.wheelStartX=r.wheelStartY=null,e&&(Vo=(Vo*Uo+e)/(Uo+1),++Uo)}}),200)):(r.wheelDX+=n,r.wheelDY+=i))):(i&&s&&an(e,Math.max(0,o.scrollTop+i*Vo)),cn(e,Math.max(0,o.scrollLeft+n*Vo)),(!i||i&&s)&&H(t),r.wheelStartX=null)}}function Rn(e,t,n){e=e&&e.options.selectionsMayTouch,n=t[n],t.sort((function(e,t){return te(e.from(),t.from())})),n=d(t,n);for(var i=1;i
te(e,t.from))return e;if(0>=te(e,t.to))return zn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=zn(t).ch-t.to.ch),ee(n,i)}function Gn(e,t){for(var n=[],i=0;i
a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(r.lastOp==i?(Qn(r.done),o=g(r.done)):r.done.length&&!g(r.done).ranges?o=g(r.done):1
r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift();r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=a,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,l||N(e,"historyAdded")}function ei(e,t){var n=g(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ti(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function ni(e){if(!e)return null;for(var t,n=0;n
te(t,e))!=0>te(n,e)?(e=t,t=n):i!=0>te(t,n)&&(t=n)),new jo(e,t)):new jo(n||t,t)}function li(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),ci(e,new Ko([oi(e.sel.primary(),t,n,r)],0),i)}function si(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o
te(t.primary().head,e.sel.primary().head)?-1:1);di(e,pi(e,t,i,!0)),n&&!1===n.scroll||!e.cm||rn(e.cm)}function di(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,A(e.cm)),Ue(e,"cursorActivity",e))}function fi(e){di(e,pi(e,e.sel,null,!1))}function pi(e,t,n,i){for(var r,o=0;o
=t.ch:s.to>t.ch))){if(r&&(N(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(a.atomic)return n&&(l=a.find(0>i?1:-1),s=void 0,(0>i?c:u)&&(l=vi(e,l,-i,l&&l.line==t.line?o:null)),l&&l.line==t.line&&(s=te(l,n))&&(0>i?0>s:0
i?-1:1),(0>i?u:c)&&(n=vi(e,n,i,n.line==t.line?o:null)),n?gi(e,n,t,i,r):null)}}return t}function mi(e,t,n,i,r){return(t=gi(e,t,n,i=i||1,r)||!r&&gi(e,t,n,i,!0)||gi(e,t,n,-i,r)||!r&&gi(e,t,n,-i,!0))||(e.cantEdit=!0,ee(e.first,0))}function vi(e,t,n,i){return 0>n&&0==t.ch?t.line>e.first?le(e,ee(t.line-1)):null:0
te(l.to,r.from)||0
a||!n.inclusiveLeft&&!a)&&s.push({from:l.from,to:r.from}),(0
e.lastLine())){if(t.from.line
r&&(t={from:t.from,to:ee(r,X(e,r).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Y(e,t.from,t.to),n||(n=Gn(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=q(Te(X(i,o.line))),i.iter(a,l.line+1,(function(e){if(e==r.maxLine)return s=!0}))),-1
r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier
n;i--){var r=X(e,i).stateAfter;if(r&&(!(r instanceof ko)||i+r.lookAhead
te(i,n)&&(n=(i=[i,n])[0],i=i[1]),"string"==typeof t&&(t=e.splitLines(t)),wi(e,{from:n,to:i,text:t,origin:r})}function Ti(e,t,n,i){n
=te(o.from,g(i).to);){var l=i.pop();if(0>te(l.from,o.from)){o.from=l.from;break}}i.push(o)}vn(e,(function(){for(var t=i.length-1;0<=t;t--)ki(e.doc,"",i[t].from,i[t].to,"+delete");rn(e)}))}function Yi(e,t,n){return 0>(t=S(e.text,t+n,n))||t>e.text.length?null:t}function _i(e,t,n){return null==(e=Yi(e,t.ch,n))?null:new ee(t.line,e,0>n?"after":"before")}function $i(e,t,n,i,r){if(e&&("rtl"==t.doc.direction&&(r=-r),e=T(n,t.doc.direction))){var o,l=0>r==(1==(e=0>r?g(e):e[0]).level)?"after":"before";if(0
r?n.text.length-1:0;var a=at(t,s,o).top;o=L((function(e){return at(t,s,e).top==a}),0>r==(1==e.level)?e.from:e.to-1,o),"before"==l&&(o=Yi(n,o,1))}else o=0>r?e.to:e.from;return new ee(i,o,l)}return new ee(i,0>r?n.text.length:0,0>r?"before":"after")}function qi(e,t){var n=X(e.doc,t),i=Te(n);return i!=n&&(t=q(i)),$i(!0,e,i,t,1)}function Zi(e,t){var n=qi(e,t.line),i=X(e.doc,n.line),r=T(i,e.doc.direction);return r&&0!=r[0].level?n:(i=Math.max(n.ch,i.text.search(/\S/)),ee(n.line,t.line==n.line&&t.ch<=i&&t.ch?0:i,n.sticky))}function Qi(e,t,n){if("string"==typeof t&&!(t=ol[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=ro}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function Ji(e,t,n,i){var r=e.state.keySeq;if(r){if(Ui(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ll.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),er(e,r+" "+t,n,i))return!0}return er(e,t,n,i)}function er(e,t,n,i){e:{for(var r=0;r
Fr&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var n=tr(this,e);Ir&&(sl=n?t:null,!n&&88==t&&!bo&&(jr?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),Or&&!jr&&!n&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){function t(e){18!=e.keyCode&&e.altKey||(Qr(n,"CodeMirror-crosshair"),M(document,"keyup",t),M(document,"mouseover",t))}var n=e.display.lineDiv;s(n,"CodeMirror-crosshair"),go(document,"keyup",t),go(document,"mouseover",t)}(this)}}function ir(e){16==e.keyCode&&(this.doc.sel.shift=!1),O(this,e)}function rr(e){if(!(e.target&&e.target!=this.display.input.getField()||Je(this.display,e)||O(this,e)||e.ctrlKey&&!e.altKey||jr&&e.metaKey)){var t=e.keyCode,n=e.charCode;Ir&&t==sl?(sl=null,H(e)):Ir&&(!e.which||10>e.which)&&tr(this,e)||"\b"==(t=String.fromCharCode(null==n?t:n))||function(e,t,n){return Ji(e,"'"+n+"'",t,(function(t){return Qi(e,t,!0)}))}(this,e,t)||this.display.input.onKeyPress(e)}}function or(e){var t=this.display;if(!(O(this,e)||t.activeTouch&&t.input.supportsTouch()))if(t.input.ensurePolled(),t.shift=e.shiftKey,Je(t,e))Er||(t.scroller.draggable=!1,setTimeout((function(){return t.scroller.draggable=!0}),100));else if(!sr(this,e,"gutterClick",!0)){var n=Et(this,e),i=R(e),r=n?function(e,t){var n=+new Date;return cl&&cl.compare(n,e,t)?(ul=cl=null,"triple"):ul&&ul.compare(n,e,t)?(cl=new al(n,e,t),ul=null,"double"):(ul=new al(n,e,t),cl=null,"single")}(n,i):"single";window.focus(),1==i&&this.state.selectingText&&this.state.selectingText(e),n&&function(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),Ji(e,Vi((1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=ol[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=ro}finally{e.state.suppressEdits=!1}return i}))}(this,i,n,r,e)||(1==i?n?function(e,t,n,i){Hr?setTimeout(u(_t,e),0):e.curOp.focus=l();var r=e.getOption("configureMouse");null==(r=r?r(e,n,i):{}).unit&&(r.unit=(Xr?i.shiftKey&&i.metaKey:i.altKey)?"rectangle":"single"==n?"char":"double"==n?"word":"line"),(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),null==r.addNew&&(r.addNew=jr?i.metaKey:i.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(jr?i.altKey:i.ctrlKey));var o,s=e.doc.sel;e.options.dragDrop&&mo&&!e.isReadOnly()&&"single"==n&&-1<(o=s.contains(t))&&(0>te((o=s.ranges[o]).from(),t)||0
t.xRel)?function(e,t,n,i){var r=e.display,o=!1,l=yn(e,(function(t){Er&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:$t(e)),M(r.wrapper.ownerDocument,"mouseup",l),M(r.wrapper.ownerDocument,"mousemove",s),M(r.scroller,"dragstart",a),M(r.scroller,"drop",l),o||(H(t),i.addNew||li(e.doc,n,null,null,i.extend),Er&&!zr||Hr&&9==Fr?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),s=function(e){o=o||10<=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)},a=function(){return o=!0};Er&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!i.moveOnDrag,go(r.wrapper.ownerDocument,"mouseup",l),go(r.wrapper.ownerDocument,"mousemove",s),go(r.scroller,"dragstart",a),go(r.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}(e,i,t,r):function(e,t,n,i){function r(t){if(0!=te(m,t))if(m=t,"rectangle"==i.unit){for(var r=[],o=e.options.tabSize,l=h(X(u,n.line).text,n.ch,o),s=h(X(u,t.line).text,t.ch,o),a=Math.min(l,s),g=(l=Math.max(l,s),s=Math.min(n.line,t.line),Math.min(e.lastLine(),Math.max(n.line,t.line)));s<=g;s++){var v=X(u,s).text,y=f(v,a,o);a==l?r.push(new jo(ee(s,y),ee(s,y))):v.length>y&&r.push(new jo(ee(s,y),ee(s,f(v,l,o))))}r.length||r.push(new jo(n,n)),ci(u,Rn(e,p.ranges.slice(0,d).concat(r),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else r=c,a=lr(e,t,i.unit),t=r.anchor,0
o:0
=c.to||s.line
v.bottom?20:0;h&&setTimeout(yn(e,(function(){y==n&&(a.scroller.scrollTop+=h,o(t))})),50)}}function s(t){e.state.selectingText=!1,y=1/0,t&&(H(t),a.input.focus()),M(a.wrapper.ownerDocument,"mousemove",b),M(a.wrapper.ownerDocument,"mouseup",w),u.history.lastSelOrigin=null}Hr&&$t(e);var a=e.display,u=e.doc;H(t);var c,d,p=u.sel,g=p.ranges;i.addNew&&!i.extend?(d=u.sel.contains(n),c=-1
=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&H(t);var l=(i=e.display).lineDiv.getBoundingClientRect();if(o>l.bottom||!D(e,n))return E(t);for(o-=l.top-i.viewOffset,l=0;l
=r)return N(e,n,e,r=Z(e.doc,o),e.display.gutterSpecs[l].className,t),E(t)}}function ar(e,t){var n;(n=Je(e.display,t))||(n=!!D(e,"gutterContextMenu")&&sr(e,t,"gutterContextMenu",!1)),n||O(e,t,"contextmenu")||Zr||e.display.input.onContextMenu(t)}function ur(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dt(e)}function cr(e,t,n){!t!=!(n&&n!=hl)&&(n=e.display.dragFunctions,(t=t?go:M)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}function hr(e){e.options.lineWrapping?(s(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Qr(e.display.wrapper,"CodeMirror-wrap"),He(e)),Ft(e),Rt(e),dt(e),setTimeout((function(){return dn(e)}),100)}function dr(e,t){var r=this;if(!(this instanceof dr))return new dr(e,t);this.options=t=t?c(t):{},c(dl,t,!1);var o=t.value;"string"==typeof o?o=new Zo(o,t.mode,null,t.lineSeparator,t.direction):t.mode&&(o.modeOption=t.mode),this.doc=o;var l=new dr.inputStyles[t.inputStyle](this);for(var s in(l=this.display=new Hn(e,o,l,t)).wrapper.CodeMirror=this,ur(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),pn(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 eo,keySeq:null,specialChars:null},t.autofocus&&!Kr&&l.input.focus(),Hr&&11>Fr&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){function t(){o.activeTouch&&(l=setTimeout((function(){return o.activeTouch=null}),1e3),(s=o.activeTouch).end=+new Date)}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return 400
Fr?yn(e,(function(t){if(!O(e,t)){var n=Et(e,t);!n||sr(e,t,"gutterClick",!0)||Je(e.display,t)||(H(t),t=e.findWordAt(n),li(e.doc,t.anchor,t.head))}})):function(t){return O(e,t)||H(t)}),go(o.scroller,"contextmenu",(function(t){return ar(e,t)})),go(o.input.getField(),"contextmenu",(function(t){o.scroller.contains(t.target)||ar(e,t)}));var l,s={end:0};go(o.scroller,"touchstart",(function(t){var n;(n=!O(e,t))&&(n=!(n=1==t.touches.length&&(1>=(n=t.touches[0]).radiusX&&1>=n.radiusY))),n&&!sr(e,t,"gutterClick",!0)&&(o.input.ensurePolled(),clearTimeout(l),n=+new Date,o.activeTouch={start:n,moved:!1,prev:300>=n-s.end?s:null},1==t.touches.length&&(o.activeTouch.left=t.touches[0].pageX,o.activeTouch.top=t.touches[0].pageY))})),go(o.scroller,"touchmove",(function(){o.activeTouch&&(o.activeTouch.moved=!0)})),go(o.scroller,"touchend",(function(n){if((l=o.activeTouch)&&!Je(o,n)&&null!=l.left&&!l.moved&&300>new Date-l.start){var i=e.coordsChar(o.activeTouch,"page"),l=!l.prev||r(l,l.prev)?new jo(i,i):!l.prev.prev||r(l,l.prev.prev)?e.findWordAt(i):new jo(ee(i.line,0),le(e.doc,ee(i.line+1,0)));e.setSelection(l.anchor,l.head),e.focus(),H(n)}t()})),go(o.scroller,"touchcancel",t),go(o.scroller,"scroll",(function(){o.scroller.clientHeight&&(an(e,o.scroller.scrollTop),cn(e,o.scroller.scrollLeft,!0),N(e,"scroll",e))})),go(o.scroller,"mousewheel",(function(t){return Pn(e,t)})),go(o.scroller,"DOMMouseScroll",(function(t){return Pn(e,t)})),go(o.wrapper,"scroll",(function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0})),o.dragFunctions={enter:function(t){O(e,t)||P(t)},over:function(t){if(!O(e,t)){var r=Et(e,t);if(r){var o=document.createDocumentFragment();Kt(e,r,o),e.display.dragCursor||(e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,o)}P(t)}},start:function(t){if(Hr&&(!e.state.draggingText||100>+new Date-Qo))P(t);else if(!O(e,t)&&!Je(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!zr)){var n=i("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ir&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Ir&&n.parentNode.removeChild(n)}},drop:yn(e,Ei),leave:function(t){O(e,t)||Pi(e)}};var a=o.input.getField();go(a,"keyup",(function(t){return ir.call(e,t)})),go(a,"keydown",yn(e,nr)),go(a,"keypress",yn(e,rr)),go(a,"focus",(function(t){return qt(e,t)})),go(a,"blur",(function(t){return Zt(e,t)}))}(this),Jo||(function(){var e;go(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ri(Ii)}),100))})),go(window,"blur",(function(){return Ri(Zt)}))}(),Jo=!0),gn(this),this.curOp.forceUpdate=!0,_n(this,o),t.autofocus&&!Kr||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&qt(r)}),20):Zt(this),fl)fl.hasOwnProperty(s)&&fl[s](this,t[s],hl);for(On(this),t.finishInit&&t.finishInit(this),o=0;o
o.first?h(X(o,t-1).text,null,l):0:"add"==n?u=a+e.options.indentUnit:"subtract"==n?u=a-e.options.indentUnit:"number"==typeof n&&(u=a+n),u=Math.max(0,u),n="",i=0,e.options.indentWithTabs)for(e=Math.floor(u/l);e;--e)i+=l,n+="\t";if(i
l,a=vo(t),u=null;if(s&&1
l?"cut":"+input")},wi(e.doc,d),Ue(e,"inputRead",e,d)}t&&!s&&vr(e,t),rn(e),2>e.curOp.updateInput&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function mr(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||vn(t,(function(){return gr(t,n,0,null,"paste")})),!0}function vr(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;0<=i;i--){var r=n.ranges[i];if(!(100
l:56320<=l&&57343>l)?2:1))),-n)):l=r?function(e,t,n,i){var r=T(t,e.doc.direction);if(!r)return _i(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):0>=n.ch&&(n.ch=0,n.sticky="after");var o=k(r,n.ch,n.sticky),l=r[o];if("ltr"==e.doc.direction&&0==l.level%2&&(0
n.ch:l.from
i,d=a(n,h?1:-1);if(null!=d&&(h?d<=l.to&&d<=c.end:d>=l.from&&d>=c.begin))return new ee(n.line,d,h?"before":"after")}return l=function(e,t,i){for(var o=function(e,t){return t?new ee(n.line,a(e,1),"before"):new ee(n.line,e,"after")};0<=e&&e
=e.first+e.size?o=!1:(t=new ee(o,t.ch,t.sticky),o=a=X(e,o))),!o)return!1;t=$i(r,e.cm,a,t.line,u)}else t=l;return!0}var l=t,s=n,a=X(e,t.line),u=r&&"rtl"==e.direction?-n:n;if("char"==i||"codepoint"==i)o();else if("column"==i)o(!0);else if("word"==i||"group"==i)for(var c=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(0>n)||o(!f);f=!1){var p=w(p=a.text.charAt(t.ch)||"\n",d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||p||(p="s"),c&&c!=p){0>n&&(n=1,o(),t.sticky="after");break}if(p&&(c=p),0
n?0>=r:r>=o.height){t.hitSide=!0;break}r+=5*n}return t}function Sr(e,t){if(!(i=lt(e,t.line))||i.hidden)return null;var n,i=ot(i,n=X(e.doc,t.line),t.line),r="left";return(n=T(n,e.doc.direction))&&(r=k(n,t.ch)%2?"right":"left"),(i=ut(i.map,t.ch,r)).offset="right"==i.collapse?i.end:i.start,i}function Lr(e,t){return t&&(e.bad=!0),e}function kr(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return Lr(e.clipPos(ee(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r
r?u.map:c[r],l=0;l
r?e.line:e.rest[r]),r=o[l]+i,(0>i||s!=t)&&(r=o[l+(i?1:0)]),ee(n,r)}}var r=e.text.firstChild,l=!1;if(!t||!o(r,t))return Lr(ee(q(e.line),0),!0);if(t==r&&(l=!0,t=r.childNodes[n],n=0,!t))return Lr(ee(q(n=e.rest?g(e.rest):e.line),n.text.length),l);var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=e.measure,c=u.maps;if(t=i(s,a,n))return Lr(t,l);for(r=a.nextSibling,s=s?s.nodeValue.length-n:0;r;r=r.nextSibling){if(t=i(r,r.firstChild,0))return Lr(ee(t.line,t.ch-s),l);s+=r.textContent.length}for(a=a.previousSibling;a;a=a.previousSibling){if(t=i(a,a.firstChild,-1))return Lr(ee(t.line,t.ch+n),l);n+=a.textContent.length}}var Mr=navigator.userAgent,Nr=navigator.platform,Or=/gecko\/\d/i.test(Mr),Ar=/MSIE \d/.test(Mr),Dr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Mr),Wr=/Edge\/(\d+)/.exec(Mr),Hr=Ar||Dr||Wr,Fr=Hr&&(Ar?document.documentMode||6:+(Wr||Dr)[1]),Er=!Wr&&/WebKit\//.test(Mr),Pr=Er&&/Qt\/\d+\.\d+/.test(Mr),Rr=!Wr&&/Chrome\//.test(Mr),Ir=/Opera\//.test(Mr),zr=/Apple Computer/.test(navigator.vendor),Br=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Mr),Gr=/PhantomJS/.test(Mr),Ur=zr&&(/Mobile\/\w+/.test(Mr)||2
_r)),Zr=Or||Hr&&9<=Fr,Qr=function(t,n){var i=t.className,r=e(n).exec(i);if(r){var o=i.slice(r.index+r[0].length);t.className=i.slice(0,r.index)+(o?r[1]+o:"")}};$r=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var Jr=function(e){e.select()};Ur?Jr=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Hr&&(Jr=function(e){try{e.select()}catch(e){}});var eo=function(){this.f=this.id=null,this.time=0,this.handler=u(this.onTimeout,this)};eo.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},eo.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n
=e?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(e):1424<=e&&1524>=e?"R":1536<=e&&1785>=e?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(e-1536):1774<=e&&2220>=e?"r":8192<=e&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;return function(s,a){var u,c="ltr"==a?"L":"R";if(0==s.length||"ltr"==a&&!n.test(s))return!1;for(var h=s.length,d=[],f=0;f
Fr)return!1;var e=i("div");return"draggable"in e||"dragDrop"in e}(),vo=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},yo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},bo="oncopy"in(io=i("div"))||(io.setAttribute("oncopy","return;"),"function"==typeof io.oncopy),wo=null,xo={},Co={},So={},Lo=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lineStart=this.lastColumnPos=this.lastColumnValue=0,this.lineOracle=n};Lo.prototype.eol=function(){return this.pos>=this.string.length},Lo.prototype.sol=function(){return this.pos==this.lineStart},Lo.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Lo.prototype.next=function(){if(this.pos
t},Lo.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Lo.prototype.skipToEnd=function(){this.pos=this.string.length},Lo.prototype.skipTo=function(e){if(-1<(e=this.string.indexOf(e,this.pos)))return this.pos=e,!0},Lo.prototype.backUp=function(e){this.pos-=e},Lo.prototype.column=function(){return this.lastColumnPos
this.maxLookAhead&&(this.maxLookAhead=e),t},To.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},To.prototype.nextLine=function(){this.line++,0
Fr&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ro.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return n?(this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0",this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+(e.viewHeight-(t?i:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),t?(this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+(e.viewWidth-e.barLeft-(n?i:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0
=te(e,i.to()))return n}return-1};var jo=function(e,t){this.anchor=e,this.head=t};jo.prototype.from=function(){return oe(this.anchor,this.head)},jo.prototype.to=function(){return re(this.anchor,this.head)},jo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Ai.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n
this.size-t&&(1
=this.children.length)){var e=this;do{var t=new Di(t=e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=d(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else(n=new Di(e.children)).parent=e,e.children=[n,t],e=n;t.parent=e.parent}while(10
e.display.maxLineLength&&(e.display.maxLine=o,e.display.maxLineLength=l,e.display.maxLineChanged=!0);null!=n&&e&&this.collapsed&&Rt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&fi(e.doc)),e&&Ue(e,"markerCleared",e,this,n,i),t&&mn(e),this.parent&&this.parent.clear()}},_o.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,i,r=0;r
te((s=this.sel.ranges[o]).head,s.anchor),e[o]=new jo(s?a:l,s?l:a)):e[o]=new jo(l,l)}e=new Ko(e,this.sel.primIndex)}for(t=e,e=i.length-1;0<=e;e--)wi(this,i[e]);t?ui(this,t):this.cm&&rn(this.cm)})),undo:wn((function(){Ci(this,"undo")})),redo:wn((function(){Ci(this,"redo")})),undoSelection:wn((function(){Ci(this,"undo",!0)})),redoSelection:wn((function(){Ci(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i
=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=le(this,e),t=le(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){if(o=o.markedSpans)for(var l=0;l
=s.to||null==s.from&&r!=e.line||null!=s.from&&r==t.line&&s.from>=t.ch||n&&!n(s.marker)||i.push(s.marker.parent||s.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){if(t=t.markedSpans)for(var n=0;n
e)return t=e,!0;e-=r,++n})),le(this,ee(n,t))},indexFromPos:function(e){var t=(e=le(this,e)).ch;if(e.line
e.ch)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Zo(_(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);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,n=this.first+this.size;for(null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to
tl;tl++)el[tl+48]=el[tl+96]=String(tl);for(var nl=65;90>=nl;nl++)el[nl]=String.fromCharCode(nl);for(var il=1;12>=il;il++)el[il+111]=el[il+63235]="F"+il;var rl={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"},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"},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","Ctrl-O":"openLine"},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"]}};rl.default=jr?rl.macDefault:rl.pcDefault;var ol={selectAll:yi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),oo)},killLine:function(e){return Xi(e,(function(t){if(t.empty()){var n=X(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line
e.doc.first){var l=X(e.doc,r.line-1).text;l&&(r=new ee(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ee(r.line-1,l.length-1),r,"+transpose"))}n.push(new jo(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return vn(e,(function(){for(var t=e.listSelections(),n=t.length-1;0<=n;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");for(t=e.listSelections(),n=0;n
e&&0==te(t,this.pos)&&n==this.button};var ul,cl,hl={toString:function(){return"CodeMirror.Init"}},dl={},fl={};dr.defaults=dl,dr.optionHandlers=fl;var pl=[];dr.defineInitHook=function(e){return pl.push(e)};var gl=null,ml=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new eo,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ml.prototype.init=function(e){function t(e){for(e=e.target;e;e=e.parentNode){if(e==l)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function n(e){if(t(e)&&!O(o,e)){if(o.somethingSelected())pr({lineWise:!1,text:o.getSelections()}),"cut"==e.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var n=yr(o);pr({lineWise:!0,text:n.text}),"cut"==e.type&&o.operation((function(){o.setSelections(n.ranges,0,oo),o.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var i=gl.text.join("\n");if(e.clipboardData.setData("Text",i),e.clipboardData.getData("Text")==i)return void e.preventDefault()}var s=wr();e=s.firstChild,o.display.lineSpace.insertBefore(s,o.display.lineSpace.firstChild),e.value=gl.text.join("\n");var a=document.activeElement;Jr(e),setTimeout((function(){o.display.lineSpace.removeChild(s),a.focus(),a==l&&r.showPrimarySelection()}),50)}}var i=this,r=this,o=r.cm,l=r.div=e.lineDiv;br(l,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize),go(l,"paste",(function(e){!t(e)||O(o,e)||mr(e,o)||11>=Fr&&setTimeout(yn(o,(function(){return i.updateFromDOM()})),20)})),go(l,"compositionstart",(function(e){i.composing={data:e.data,done:!1}})),go(l,"compositionupdate",(function(e){i.composing||(i.composing={data:e.data,done:!1})})),go(l,"compositionend",(function(e){i.composing&&(e.data!=i.composing.data&&i.readFromDOMSoon(),i.composing.done=!0)})),go(l,"touchstart",(function(){return r.forceCompositionEnd()})),go(l,"input",(function(){i.composing||i.readFromDOMSoon()})),go(l,"copy",n),go(l,"cut",n)},ml.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ml.prototype.prepareSelection=function(){var e=Vt(this.cm,!1);return e.focus=document.activeElement==this.div,e},ml.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ml.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ml.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=(i=t.doc.sel.primary()).from(),i=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line
=t.display.viewFrom&&Sr(t,n)||{node:r[0].measure.map[2],offset:0},(i=i.line
t.firstLine()&&(r=ee(r.line-1,X(t.doc,r.line-1).length)),o.ch==X(t.doc,o.line).text.length&&o.line
n.viewTo-1)return!1;if(r.line==n.viewFrom||0==(e=Pt(t,r.line))?(i=q(n.view[0].line),e=n.view[0].node):(i=q(n.view[e].line),e=n.view[e-1].node.nextSibling),(s=Pt(t,o.line))==n.view.length-1?(o=n.viewTo-1,n=n.lineDiv.lastChild):(o=q(n.view[s+1].line)-1,n=n.view[s+1].node.previousSibling),!e)return!1;for(n=t.doc.splitLines(function(e,t,n,i,r){function o(){u&&(a+=c,h&&(a+=c),u=h=!1)}function l(e){e&&(o(),a+=e)}function s(t){var n,a;if(1==t.nodeType){if(n=t.getAttribute("cm-text"))l(n);else if(n=t.getAttribute("cm-marker"))(t=e.findMarks(ee(i,0),ee(r+1,0),function(e){return function(t){return t.id==e}}(+n))).length&&(a=t[0].find(0))&&l(Y(e.doc,a.from,a.to).join(c));else if("false"!=t.getAttribute("contenteditable")&&(a=/^(pre|div|p|li|table|br)$/i.test(t.nodeName),/^br$/i.test(t.nodeName)||0!=t.textContent.length)){for(a&&o(),n=0;n
r.ch&&a.charCodeAt(a.length-s-1)==u.charCodeAt(u.length-s-1);)l--,s++;return n[n.length-1]=a.slice(0,a.length-s).replace(/^\u200b+/,""),n[0]=n[0].slice(l).replace(/\u200b+$/,""),r=ee(i,l),i=ee(o,e.length?g(e).length-s:0),1
Fr&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart)){(!Hr||Hr&&9>Fr)&&t();var e=0,s=function(){o.selForContextMenu==r.doc.sel&&0==l.selectionStart&&0
e++?o.detectingSelectAll=setTimeout(s,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(s,200)}}var i=this,r=i.cm,o=r.display,l=i.textarea;i.contextMenuPending&&i.contextMenuPending();var s=Et(r,e),a=o.scroller.scrollTop;if(s&&!Ir){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(s)&&yn(r,ci)(r.doc,In(s),oo);var u,c=l.style.cssText,h=i.wrapper.style.cssText;if(s=i.wrapper.offsetParent.getBoundingClientRect(),i.wrapper.style.cssText="position: static",l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-s.top-5)+"px; left: "+(e.clientX-s.left-5)+"px;\n z-index: 1000; background: "+(Hr?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Er&&(u=window.scrollY),o.input.focus(),Er&&window.scrollTo(null,u),o.input.reset(),r.somethingSelected()||(l.value=i.prevInput=" "),i.contextMenuPending=n,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),Hr&&9<=Fr&&t(),Zr){P(e);var d=function(){M(window,"mouseup",d),setTimeout(n,20)};go(window,"mouseup",d)}else setTimeout(n,50)}},vl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},vl.prototype.setUneditable=function(){},vl.prototype.needsContentAttribute=!1,function(e){function t(t,i,r,o){e.defaults[t]=i,r&&(n[t]=o?function(e,t,n){n!=hl&&r(e,t,n)}:r)}var n=e.optionHandlers;e.defineOption=t,e.Init=hl,t("value","",(function(e,t){return e.setValue(t)}),!0),t("mode",null,(function(e,t){e.doc.modeOption=t,Vn(e)}),!0),t("indentUnit",2,Vn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,(function(e){Kn(e),dt(e),Rt(e)}),!0),t("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(ee(i,o))}i++}));for(var r=n.length-1;0<=r;r--)ki(e.doc,t,n[r],ee(n[r].line,n[r].ch+t.length))}})),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=hl&&e.refresh()})),t("specialCharPlaceholder",Pe,(function(e){return e.refresh()}),!0),t("electricChars",!0),t("inputStyle",Kr?"contenteditable":"textarea",(function(){throw Error("inputStyle can not (yet) be changed in a running editor")}),!0),t("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),t("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),t("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),t("rtlMoveVisually",!Yr),t("wholeLineUpdateBefore",!0),t("theme","default",(function(e){ur(e),Wn(e)}),!0),t("keyMap","default",(function(e,t,n){t=ji(t),(n=n!=hl&&ji(n))&&n.detach&&n.detach(e,t),t.attach&&t.attach(e,n||null)})),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,hr,!0),t("gutters",[],(function(e,t){e.display.gutterSpecs=An(t,e.options.lineNumbers),Wn(e)}),!0),t("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Wt(e.display)+"px":"0",e.refresh()}),!0),t("coverGutterNextToScrollbar",!1,(function(e){return dn(e)}),!0),t("scrollbarStyle","native",(function(e){pn(e),dn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),t("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=An(e.options.gutters,t),Wn(e)}),!0),t("firstLineNumber",1,Wn,!0),t("lineNumberFormatter",(function(e){return e}),Wn,!0),t("showCursorWhenSelecting",!1,Ut,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,(function(e,t){"nocursor"==t&&(Zt(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),t("screenReaderLabel",null,(function(e,t){e.display.input.screenReaderLabelChanged(""===t?null:t)})),t("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),t("dragDrop",!0,cr),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Ut,!0),t("singleCursorHeightPerLine",!0,Ut,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Kn,!0),t("addModeClass",!1,Kn,!0),t("pollInterval",100),t("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),t("historyEventDelay",1250),t("viewportMargin",10,(function(e){return e.refresh()}),!0),t("maxHighlightLength",1e4,Kn,!0),t("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),t("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),t("autofocus",null),t("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),t("phrases",null)}(dr),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&yn(this,t[e])(this,n,r),N(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](ji(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n
n&&(fr(this,o.head.line,e,!0),n=o.head.line,i==this.doc.sel.primIndex&&rn(this));else{var r=o.from(),o=o.to(),l=Math.max(n,r.line);for(n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1,o=l;o
>1;if((r?t[2*r-1]:0)>=e)i=r;else{if(!(t[2*r+1]
(n=t?t.indexOf("overlay "):-1)?t:0==n?null:t.slice(0,n-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var l=0;l
r&&(e=r,i=!0),e=X(this.doc,e)}return mt(this,e,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-De(e):0)},defaultTextHeight:function(){return Ot(this.display)},defaultCharWidth:function(){return At(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display,l=(e=bt(this,le(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==i)l=e.top;else if("above"==i||"near"==i){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==r?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&(null!=(e=tn(this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&an(this,e.scrollTop),null!=e.scrollLeft&&cn(this,e.scrollLeft))},triggerOnKeyDown:bn(nr),triggerOnKeyPress:bn(rr),triggerOnKeyUp:ir,triggerOnMouseDown:bn(or),execCommand:function(e){if(ol.hasOwnProperty(e))return ol[e].call(null,this)},triggerElectric:bn((function(e){vr(this,e)})),findPosH:function(e,t,n,i){var r=1;0>t&&(r=-1,t=-t),e=le(this.doc,e);for(var o=0;o
e?i.from():i.to()}),so)})),deleteH:bn((function(e,t){var n=this.doc;this.doc.sel.somethingSelected()?n.replaceSelection("",null,"+delete"):Xi(this,(function(i){var r=xr(n,i.head,e,t,!1);return 0>e?{from:r,to:i.head}:{from:i.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1;0>t&&(r=-1,t=-t);var o=le(this.doc,e);for(e=0;e
e?l.from():l.to();var s=bt(n,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),r.push(s.left);var a=Cr(n,s,e,t);return"page"==t&&l==i.sel.primary()&&nn(n,yt(n,a,"div").top-s.top),a}),so),r.length)for(var l=0;l
d(bl,yl)&&(dr.prototype[yl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Zo.prototype[yl]));return W(Zo),dr.inputStyles={textarea:vl,contenteditable:ml},dr.defineMode=function(e){dr.defaults.mode||"null"==e||(dr.defaults.mode=e),z.apply(this,arguments)},dr.defineMIME=function(e,t){Co[e]=t},dr.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),dr.defineMIME("text/plain","null"),dr.defineExtension=function(e,t){dr.prototype[e]=t},dr.defineDocExtension=function(e,t){Zo.prototype[e]=t},dr.fromTextArea=function(e,t){function n(){e.value=a.getValue()}if((t=t?c(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var i=l();t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}var r;if(e.form&&(go(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var s=o.submit=function(){n(),o.submit=r,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(i){i.save=n,i.getTextArea=function(){return e},i.toTextArea=function(){i.toTextArea=isNaN,n(),e.parentNode.removeChild(i.getWrapperElement()),e.style.display="",e.form&&(M(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var a=dr((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=M,e.on=go,e.wheelEventPixels=En,e.Doc=Zo,e.splitLines=vo,e.countColumn=h,e.findColumn=f,e.isWordChar=b,e.Pass=ro,e.signal=N,e.Line=Ao,e.changeEnd=zn,e.scrollbarModel=zo,e.Pos=ee,e.cmpPos=te,e.modes=xo,e.mimeModes=Co,e.resolveMode=B,e.getMode=G,e.modeExtensions=So,e.extendMode=U,e.copyState=V,e.startState=j,e.innerMode=K,e.commands=ol,e.keyMap=rl,e.keyName=Ki,e.isModifierKey=Ui,e.lookupKey=Gi,e.normalizeKeyMap=Bi,e.StringStream=Lo,e.SharedTextMarker=$o,e.TextMarker=_o,e.LineWidget=Xo,e.e_preventDefault=H,e.e_stopPropagation=F,e.e_stop=P,e.addClass=s,e.contains=o,e.rmClass=Qr,e.keyNames=el}(dr),dr.version="5.59.1",dr})),function(e){"function"==typeof e.define&&e.define("core",["codemirror.js"],(function(t){e.CodeMirror=t}))}(this);