(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[53239],{53239:function(fe,ve,pe){fe=pe.nmd(fe),function(){var E="ace",x=function(){return this}();if(!x&&typeof window!="undefined"&&(x=window),!E&&typeof requirejs!="undefined")return;var P=function(e,n,i){if(typeof e!="string"){P.original?P.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=n),P.modules[e]||(P.payloads[e]=i,P.modules[e]=null)};P.modules={},P.payloads={};var R=function(e,n,i){if(typeof n=="string"){var t=s(e,n);if(t!=null)return i&&i(),t}else if(Object.prototype.toString.call(n)==="[object Array]"){for(var r=[],o=0,c=n.length;os.length)&&(C=s.length),C-=k.length;var l=s.indexOf(k,C);return l!==-1&&l===C}),String.prototype.repeat||R(String.prototype,"repeat",function(k){for(var C="",s=this;k>0;)k&1&&(C+=s),(k>>=1)&&(s+=s);return C}),String.prototype.includes||R(String.prototype,"includes",function(k,C){return this.indexOf(k,C)!=-1}),Object.assign||(Object.assign=function(k){if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var C=Object(k),s=1;s>>0,l=arguments[1],e=l>>0,n=e<0?Math.max(s+e,0):Math.min(e,s),i=arguments[2],t=i===void 0?s:i>>0,r=t<0?Math.max(s+t,0):Math.min(t,s);n0;)s&1&&(l+=C),(s>>=1)&&(C+=C);return l};var R=/^\s\s*/,k=/\s\s*$/;x.stringTrimLeft=function(C){return C.replace(R,"")},x.stringTrimRight=function(C){return C.replace(k,"")},x.copyObject=function(C){var s={};for(var l in C)s[l]=C[l];return s},x.copyArray=function(C){for(var s=[],l=0,e=C.length;l=0?parseFloat((C.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((C.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),x.isOldIE=x.isIE&&x.isIE<9,x.isGecko=x.isMozilla=C.match(/ Gecko\/\d+/),x.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",x.isWebKit=parseFloat(C.split("WebKit/")[1])||void 0,x.isChrome=parseFloat(C.split(" Chrome/")[1])||void 0,x.isEdge=parseFloat(C.split(" Edge/")[1])||void 0,x.isAIR=C.indexOf("AdobeAIR")>=0,x.isAndroid=C.indexOf("Android")>=0,x.isChromeOS=C.indexOf(" CrOS ")>=0,x.isIOS=/iPad|iPhone|iPod/.test(C)&&!window.MSStream,x.isIOS&&(x.isMac=!0),x.isMobile=x.isIOS||x.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("./useragent"),k="http://www.w3.org/1999/xhtml";x.buildDom=function i(t,r,o){if(typeof t=="string"&&t){var c=document.createTextNode(t);return r&&r.appendChild(c),c}if(!Array.isArray(t))return t&&t.appendChild&&r&&r.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var d=[],$=0;$=1.5:!0,R.isChromeOS&&(x.HI_DPI=!1),typeof document!="undefined"){var n=document.createElement("div");x.HI_DPI&&n.style.transform!==void 0&&(x.HAS_CSS_TRANSFORMS=!0),!R.isEdge&&typeof n.style.animationName!="undefined"&&(x.HAS_CSS_ANIMATION=!0),n=null}x.HAS_CSS_TRANSFORMS?x.translate=function(i,t,r){i.style.transform="translate("+Math.round(t)+"px, "+Math.round(r)+"px)"}:x.translate=function(i,t,r){i.style.top=Math.round(r)+"px",i.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(E,x,P){/* * based on code from: * * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */"use strict";var R=E("./dom");x.get=function(k,C){var s=new XMLHttpRequest;s.open("GET",k,!0),s.onreadystatechange=function(){s.readyState===4&&C(s.responseText)},s.send(null)},x.loadScript=function(k,C){var s=R.getDocumentHead(),l=document.createElement("script");l.src=k,s.appendChild(l),l.onload=l.onreadystatechange=function(e,n){(n||!l.readyState||l.readyState=="loaded"||l.readyState=="complete")&&(l=l.onload=l.onreadystatechange=null,n||C())}},x.qualifyURL=function(k){var C=document.createElement("a");return C.href=k,C.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(E,x,P){"use strict";x.inherits=function(R,k){R.super_=k,R.prototype=Object.create(k.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}})},x.mixin=function(R,k){for(var C in k)R[C]=k[C];return R},x.implement=function(R,k){x.mixin(R,k)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(E,x,P){"use strict";var R={},k=function(){this.propagationStopped=!0},C=function(){this.defaultPrevented=!0};R._emit=R._dispatchEvent=function(s,l){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var e=this._eventRegistry[s]||[],n=this._defaultHandlers[s];if(!(!e.length&&!n)){(typeof l!="object"||!l)&&(l={}),l.type||(l.type=s),l.stopPropagation||(l.stopPropagation=k),l.preventDefault||(l.preventDefault=C),e=e.slice();for(var i=0;i1&&(c=r[r.length-2]);var $=l[t+"Path"];return $==null?$=l.basePath:o=="/"&&(t=o=""),$&&$.slice(-1)!="/"&&($+="/"),$+t+o+c+this.get("suffix")},x.setModuleUrl=function(i,t){return l.$moduleUrls[i]=t};var e=function(i,t){return i==="ace/theme/textmate"||i==="./theme/textmate"?t(null,E("./theme/textmate")):console.error("loader is not configured")};x.setLoader=function(i){e=i},x.dynamicModules=Object.create(null),x.$loading={},x.loadModule=function(i,t){var r,o;Array.isArray(i)&&(o=i[0],i=i[1]);var c=function(d){if(d&&!x.$loading[i])return t&&t(d);if(x.$loading[i]||(x.$loading[i]=[]),x.$loading[i].push(t),!(x.$loading[i].length>1)){var $=function(){e(i,function(S,y){x._emit("load.module",{name:i,module:y});var m=x.$loading[i];x.$loading[i]=null,m.forEach(function(b){b&&b(y)})})};if(!x.get("packaged"))return $();k.loadScript(x.moduleUrl(i,o),$),n()}};if(x.dynamicModules[i])x.dynamicModules[i]().then(function(d){d.default?c(d.default):c(d)});else{try{r=E(i)}catch(d){}c(r)}},x.setModuleLoader=function(i,t){x.dynamicModules[i]=t};var n=function(){!l.basePath&&!l.workerPath&&!l.modePath&&!l.themePath&&!Object.keys(l.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),n=function(){})};x.version="1.17.0"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(E,x,P){"use strict";E("./lib/fixoldbrowsers");var R=E("./config");R.setLoader(function(l,e){E([l],function(n){e(null,n)})});var k=function(){return this||typeof window!="undefined"&&window}();P.exports=function(l){R.init=C,l.require=E,l.define=pe.amdD},C(!0);function C(l){if(!(!k||!k.document)){R.set("packaged",l||E.packaged||P.packaged||k.define&&pe.amdD.packaged);var e={},n="",i=document.currentScript||document._currentScript,t=i&&i.ownerDocument||document;i&&i.src&&(n=i.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var r=t.getElementsByTagName("script"),o=0;o ["+this.end.row+"/"+this.end.column+"]"},C.prototype.contains=function(s,l){return this.compare(s,l)==0},C.prototype.compareRange=function(s){var l,e=s.end,n=s.start;return l=this.compare(e.row,e.column),l==1?(l=this.compare(n.row,n.column),l==1?2:l==0?1:0):l==-1?-2:(l=this.compare(n.row,n.column),l==-1?-1:l==1?42:0)},C.prototype.comparePoint=function(s){return this.compare(s.row,s.column)},C.prototype.containsRange=function(s){return this.comparePoint(s.start)==0&&this.comparePoint(s.end)==0},C.prototype.intersects=function(s){var l=this.compareRange(s);return l==-1||l==0||l==1},C.prototype.isEnd=function(s,l){return this.end.row==s&&this.end.column==l},C.prototype.isStart=function(s,l){return this.start.row==s&&this.start.column==l},C.prototype.setStart=function(s,l){typeof s=="object"?(this.start.column=s.column,this.start.row=s.row):(this.start.row=s,this.start.column=l)},C.prototype.setEnd=function(s,l){typeof s=="object"?(this.end.column=s.column,this.end.row=s.row):(this.end.row=s,this.end.column=l)},C.prototype.inside=function(s,l){return this.compare(s,l)==0?!(this.isEnd(s,l)||this.isStart(s,l)):!1},C.prototype.insideStart=function(s,l){return this.compare(s,l)==0?!this.isEnd(s,l):!1},C.prototype.insideEnd=function(s,l){return this.compare(s,l)==0?!this.isStart(s,l):!1},C.prototype.compare=function(s,l){return!this.isMultiLine()&&s===this.start.row?lthis.end.column?1:0:sthis.end.row?1:this.start.row===s?l>=this.start.column?0:-1:this.end.row===s?l<=this.end.column?0:1:0},C.prototype.compareStart=function(s,l){return this.start.row==s&&this.start.column==l?-1:this.compare(s,l)},C.prototype.compareEnd=function(s,l){return this.end.row==s&&this.end.column==l?1:this.compare(s,l)},C.prototype.compareInside=function(s,l){return this.end.row==s&&this.end.column==l?1:this.start.row==s&&this.start.column==l?-1:this.compare(s,l)},C.prototype.clipRows=function(s,l){if(this.end.row>l)var e={row:l+1,column:0};else if(this.end.rowl)var n={row:l+1,column:0};else if(this.start.row1?(w++,w>4&&(w=1)):w=1,k.isIE){var A=Math.abs(g.clientX-v)>5||Math.abs(g.clientY-f)>5;(!a||A)&&(w=1),a&&clearTimeout(a),a=setTimeout(function(){a=null},y[w-1]||600),w==1&&(v=g.clientX,f=g.clientY)}if(g._clicks=w,m[b]("mousedown",g),w>4)w=0;else if(w>1)return m[b](h[w],g)}Array.isArray(S)||(S=[S]),S.forEach(function(g){t(g,"mousedown",u,p)})};var o=function(S){return 0|(S.ctrlKey?1:0)|(S.altKey?2:0)|(S.shiftKey?4:0)|(S.metaKey?8:0)};x.getModifierString=function(S){return R.KEY_MODS[o(S)]};function c(S,y,m){var b=o(y);if(!k.isMac&&C){if(y.getModifierState&&(y.getModifierState("OS")||y.getModifierState("Win"))&&(b|=8),C.altGr)if((3&b)!=3)C.altGr=0;else return;if(m===18||m===17){var p="location"in y?y.location:y.keyLocation;if(m===17&&p===1)C[m]==1&&(s=y.timeStamp);else if(m===18&&b===3&&p===2){var w=y.timeStamp-s;w<50&&(C.altGr=!0)}}}if(m in R.MODIFIER_KEYS&&(m=-1),!b&&m===13){var p="location"in y?y.location:y.keyLocation;if(p===3&&(S(y,b,-m),y.defaultPrevented))return}if(k.isChromeOS&&b&8){if(S(y,b,m),y.defaultPrevented)return;b&=~8}return!b&&!(m in R.FUNCTION_KEYS)&&!(m in R.PRINTABLE_KEYS)?!1:S(y,b,m)}x.addCommandKeyListener=function(S,y,m){if(k.isOldGecko||k.isOpera&&!("KeyboardEvent"in window)){var b=null;t(S,"keydown",function(w){b=w.keyCode},m),t(S,"keypress",function(w){return c(y,w,b)},m)}else{var p=null;t(S,"keydown",function(w){C[w.keyCode]=(C[w.keyCode]||0)+1;var v=c(y,w,w.keyCode);return p=w.defaultPrevented,v},m),t(S,"keypress",function(w){p&&(w.ctrlKey||w.altKey||w.shiftKey||w.metaKey)&&(x.stopEvent(w),p=null)},m),t(S,"keyup",function(w){C[w.keyCode]=null},m),C||(d(),t(window,"focus",d))}};function d(){C=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!k.isOldIE){var $=1;x.nextTick=function(S,y){y=y||window;var m="zero-timeout-message-"+$++,b=function(p){p.data==m&&(x.stopPropagation(p),r(y,"message",b),S())};t(y,"message",b),y.postMessage(m,"*")}}x.$idleBlocked=!1,x.onIdle=function(S,y){return setTimeout(function m(){x.$idleBlocked?setTimeout(m,100):S()},y)},x.$idleBlockId=null,x.blockIdle=function(S){x.$idleBlockId&&clearTimeout(x.$idleBlockId),x.$idleBlocked=!0,x.$idleBlockId=setTimeout(function(){x.$idleBlocked=!1},S||100)},x.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),x.nextFrame?x.nextFrame=x.nextFrame.bind(window):x.nextFrame=function(S){setTimeout(S,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(E,x,P){"use strict";var R;P.exports={lineMode:!1,pasteCancelled:function(){return R&&R>Date.now()-50?!0:R=!1},cancel:function(){R=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(E,x,P){"use strict";var R=E("../lib/event"),k=E("../lib/useragent"),C=E("../lib/dom"),s=E("../lib/lang"),l=E("../clipboard"),e=k.isChrome<18,n=k.isIE,i=k.isChrome>63,t=400,r=E("../lib/keys"),o=r.KEY_MODS,c=k.isIOS,d=c?/\s/:/\n/,$=k.isMobile,S=function(y,m){var b=C.createElement("textarea");b.className="ace_text-input",b.setAttribute("wrap","off"),b.setAttribute("autocorrect","off"),b.setAttribute("autocapitalize","off"),b.setAttribute("spellcheck",!1),b.style.opacity="0",y.insertBefore(b,y.firstChild);var p=!1,w=!1,v=!1,f=!1,a="";$||(b.style.fontSize="1px");var h=!1,u=!1,g="",A=0,L=0,M=0;try{var T=document.activeElement===b}catch(D){}this.setAriaOptions=function(D){D.activeDescendant?(b.setAttribute("aria-haspopup","true"),b.setAttribute("aria-autocomplete",D.inline?"both":"list"),b.setAttribute("aria-activedescendant",D.activeDescendant)):(b.setAttribute("aria-haspopup","false"),b.setAttribute("aria-autocomplete","both"),b.removeAttribute("aria-activedescendant")),D.role&&b.setAttribute("role",D.role)},this.setAriaOptions({role:"textbox"}),R.addListener(b,"blur",function(D){u||(m.onBlur(D),T=!1,$&&!c&&document.removeEventListener("selectionchange",W))},m),R.addListener(b,"focus",function(D){if(!u){if(T=!0,k.isEdge)try{if(!document.hasFocus())return}catch(V){}m.onFocus(D),k.isEdge?setTimeout(I):I(),$&&!c&&document.addEventListener("selectionchange",W)}},m),this.$focusScroll=!1,this.focus=function(){if(a||i||this.$focusScroll=="browser")return b.focus({preventScroll:!0});var D=b.style.top;b.style.position="fixed",b.style.top="0px";try{var V=b.getBoundingClientRect().top!=0}catch(te){return}var K=[];if(V)for(var ee=b.parentElement;ee&&ee.nodeType==1;)K.push(ee),ee.setAttribute("ace_nocontext",!0),!ee.parentElement&&ee.getRootNode?ee=ee.getRootNode().host:ee=ee.parentElement;b.focus({preventScroll:!0}),V&&K.forEach(function(te){te.removeAttribute("ace_nocontext")}),setTimeout(function(){b.style.position="",b.style.top=="0px"&&(b.style.top=D)},0)},this.blur=function(){b.blur()},this.isFocused=function(){return T},m.on("beforeEndOperation",function(){var D=m.curOp,V=D&&D.command&&D.command.name;if(V!="insertstring"){var K=V&&(D.docChanged||D.selectionChanged);v&&K&&(g=b.value="",J()),I()}});var I=c?function(D){if(!(!T||p&&!D||f)){D||(D="");var V=` ab`+D+`cde fg `;V!=b.value&&(b.value=g=V);var K=4,ee=4+(D.length||(m.selection.isEmpty()?0:1));(A!=K||L!=ee)&&b.setSelectionRange(K,ee),A=K,L=ee}}:function(){if(!(v||f)&&!(!T&&!B)){v=!0;var D=0,V=0,K="";if(m.session){var ee=m.selection,te=ee.getRange(),oe=ee.cursor.row;if(D=te.start.column,V=te.end.column,K=m.session.getLine(oe),te.start.row!=oe){var le=m.session.getLine(oe-1);D=te.start.rowoe+1?ae.length:V,V+=K.length+1,K=K+` `+ae}else $&&oe>0&&(K=` `+K,V+=1,D+=1);K.length>t&&(D=g.length&&D.value===g&&g&&D.selectionEnd!==L},_=function(D){v||(p?p=!1:F(b)?(m.selectAll(),I()):$&&b.selectionStart!=A&&I())};function W(D){if((!b||!b.parentNode)&&document.removeEventListener("selectionchange",W),!v&&b.selectionStart===b.selectionEnd){var V=b.selectionStart-A,K=L-A;V>0?V=Math.max(V-K,1):V===0&&K&&(V=-1);for(var ee=Math.abs(V),te=V>0?r.right:r.left,oe=0;oe0&&g[ie]==D[ie];)ie++,te--;for(le=le.slice(ie),ie=1;oe>0&&g.length-ie>A-1&&g[g.length-ie]==D[D.length-ie];)ie++,oe--;ae-=ie-1,ne-=ie-1;var ue=le.length-ie+1;if(ue<0&&(te=-ue,ue=0),le=le.slice(0,ue),!V&&!le&&!ae&&!te&&!oe&&!ne)return"";f=!0;var ge=!1;return k.isAndroid&&le==". "&&(le=" ",ge=!0),le&&!te&&!oe&&!ae&&!ne||h?m.onTextInput(le):m.onTextInput(le,{extendLeft:te,extendRight:oe,restoreStart:ae,restoreEnd:ne}),f=!1,g=D,A=K,L=ee,M=ne,ge?` `:le},z=function(D){if(v)return Q();if(D&&D.inputType){if(D.inputType=="historyUndo")return m.execCommand("undo");if(D.inputType=="historyRedo")return m.execCommand("redo")}var V=b.value,K=H(V,!0);(V.length>t+100||d.test(K)||$&&A<1&&A==L)&&I()},Y=function(D,V,K){var ee=D.clipboardData||window.clipboardData;if(!(!ee||e)){var te=n||K?"Text":"text/plain";try{return V?ee.setData(te,V)!==!1:ee.getData(te)}catch(oe){if(!K)return Y(oe,V,!0)}}},Z=function(D,V){var K=m.getCopyText();if(!K)return R.preventDefault(D);Y(D,K)?(c&&(I(K),p=K,setTimeout(function(){p=!1},10)),V?m.onCut():m.onCopy(),R.preventDefault(D)):(p=!0,b.value=K,b.select(),setTimeout(function(){p=!1,I(),V?m.onCut():m.onCopy()}))},N=function(D){Z(D,!0)},U=function(D){Z(D,!1)},X=function(D){var V=Y(D);l.pasteCancelled()||(typeof V=="string"?(V&&m.onPaste(V,D),k.isIE&&setTimeout(I),R.preventDefault(D)):(b.value="",w=!0))};R.addCommandKeyListener(b,m.onCommandKey.bind(m),m),R.addListener(b,"select",_,m),R.addListener(b,"input",z,m),R.addListener(b,"cut",N,m),R.addListener(b,"copy",U,m),R.addListener(b,"paste",X,m),(!("oncut"in b)||!("oncopy"in b)||!("onpaste"in b))&&R.addListener(y,"keydown",function(D){if(!(k.isMac&&!D.metaKey||!D.ctrlKey))switch(D.keyCode){case 67:U(D);break;case 86:X(D);break;case 88:N(D);break}},m);var G=function(D){if(!(v||!m.onCompositionStart||m.$readOnly)&&(v={},!h)){D.data&&(v.useTextareaForIME=!1),setTimeout(Q,0),m._signal("compositionStart"),m.on("mousedown",q);var V=m.getSelectionRange();V.end.row=V.start.row,V.end.column=V.start.column,v.markerRange=V,v.selectionStart=A,m.onCompositionStart(v),v.useTextareaForIME?(g=b.value="",A=0,L=0):(b.msGetInputContext&&(v.context=b.msGetInputContext()),b.getInputContext&&(v.context=b.getInputContext()))}},Q=function(){if(!(!v||!m.onCompositionUpdate||m.$readOnly)){if(h)return q();if(v.useTextareaForIME)m.onCompositionUpdate(b.value);else{var D=b.value;H(D),v.markerRange&&(v.context&&(v.markerRange.start.column=v.selectionStart=v.context.compositionStartOffset),v.markerRange.end.column=v.markerRange.start.column+L-v.selectionStart+M)}}},J=function(D){!m.onCompositionEnd||m.$readOnly||(v=!1,m.onCompositionEnd(),m.off("mousedown",q),D&&z())};function q(){u=!0,b.blur(),b.focus(),u=!1}var j=s.delayedCall(Q,50).schedule.bind(null,null);function re(D){D.keyCode==27&&b.value.lengthL&&g[ne]==` `?ie=r.end:aeL&&g.slice(0,ne).split(` `).length>2?ie=r.down:ne>L&&g[ne-1]==" "?(ie=r.right,ue=o.option):(ne>L||ne==L&&L!=A&&ae==ne)&&(ie=r.right),ae!==ne&&(ue|=o.shift),ie){var ge=V.onCommandKey({},ue,ie);if(!ge&&V.commands){ie=r.keyCodeToString(ie);var me=V.commands.findKeyCommand(ue,ie);me&&V.execCommand(me)}A=ae,L=ne,I("")}}};document.addEventListener("selectionchange",oe),V.on("destroy",function(){document.removeEventListener("selectionchange",oe)})}this.destroy=function(){b.parentElement&&b.parentElement.removeChild(b)}};x.TextInput=S,x.$setUserAgentForTests=function(y,m){$=y,c=m}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("../lib/useragent"),k=0,C=550,s=function(){function n(i){i.$clickSelection=null;var t=i.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(i)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(i)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(i)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(i)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(i));var r=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];r.forEach(function(o){i[o]=this[o]},this),i.selectByLines=this.extendSelectionBy.bind(i,"getLineRange"),i.selectByWords=this.extendSelectionBy.bind(i,"getWordRange")}return n.prototype.onMouseDown=function(i){var t=i.inSelection(),r=i.getDocumentPosition();this.mousedownEvent=i;var o=this.editor,c=i.getButton();if(c!==0){var d=o.getSelectionRange(),$=d.isEmpty();($||c==1)&&o.selection.moveToPosition(r),c==2&&(o.textInput.onContextMenu(i.domEvent),R.isMozilla||i.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(i);return}return this.captureMouse(i),this.startSelect(r,i.domEvent._clicks>1),i.preventDefault()},n.prototype.startSelect=function(i,t){i=i||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var r=this.editor;!this.mousedownEvent||(this.mousedownEvent.getShiftKey()?r.selection.selectToPosition(i):t||r.selection.moveToPosition(i),t||this.select(),r.setStyle("ace_selecting"),this.setState("select"))},n.prototype.select=function(){var i,t=this.editor,r=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r);if(o==-1)i=this.$clickSelection.end;else if(o==1)i=this.$clickSelection.start;else{var c=e(this.$clickSelection,r);r=c.cursor,i=c.anchor}t.selection.setSelectionAnchor(i.row,i.column)}t.selection.selectToPosition(r),t.renderer.scrollCursorIntoView()},n.prototype.extendSelectionBy=function(i){var t,r=this.editor,o=r.renderer.screenToTextCoordinates(this.x,this.y),c=r.selection[i](o.row,o.column);if(this.$clickSelection){var d=this.$clickSelection.comparePoint(c.start),$=this.$clickSelection.comparePoint(c.end);if(d==-1&&$<=0)t=this.$clickSelection.end,(c.end.row!=o.row||c.end.column!=o.column)&&(o=c.start);else if($==1&&d>=0)t=this.$clickSelection.start,(c.start.row!=o.row||c.start.column!=o.column)&&(o=c.end);else if(d==-1&&$==1)o=c.end,t=c.start;else{var S=e(this.$clickSelection,o);o=S.cursor,t=S.anchor}r.selection.setSelectionAnchor(t.row,t.column)}r.selection.selectToPosition(o),r.renderer.scrollCursorIntoView()},n.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},n.prototype.focusWait=function(){var i=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(i>k||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},n.prototype.onDoubleClick=function(i){var t=i.getDocumentPosition(),r=this.editor,o=r.session,c=o.getBracketRange(t);c?(c.isEmpty()&&(c.start.column--,c.end.column++),this.setState("select")):(c=r.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=c,this.select()},n.prototype.onTripleClick=function(i){var t=i.getDocumentPosition(),r=this.editor;this.setState("selectByLines");var o=r.getSelectionRange();o.isMultiLine()&&o.contains(t.row,t.column)?(this.$clickSelection=r.selection.getLineRange(o.start.row),this.$clickSelection.end=r.selection.getLineRange(o.end.row).end):this.$clickSelection=r.selection.getLineRange(t.row),this.select()},n.prototype.onQuadClick=function(i){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},n.prototype.onMouseWheel=function(i){if(!i.getAccelKey()){i.getShiftKey()&&i.wheelY&&!i.wheelX&&(i.wheelX=i.wheelY,i.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var r=this.$lastScroll,o=i.domEvent.timeStamp,c=o-r.t,d=c?i.wheelX/c:r.vx,$=c?i.wheelY/c:r.vy;c=1&&t.renderer.isScrollableBy(i.wheelX*i.speed,0)&&(y=!0),S<=1&&t.renderer.isScrollableBy(0,i.wheelY*i.speed)&&(y=!0),y)r.allowed=o;else if(o-r.allowedi.session.documentToScreenRow(v.row,v.column))return S()}for(var f={error:[],warning:[],info:[]},a={error:{singular:"error",plural:"errors"},warning:{singular:"warning",plural:"warnings"},info:{singular:"information message",plural:"information messages"}},h=t.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",u=0;u ").concat(b.text[u]);f[b.type[u]].push(g)}var A="
";A+=[].concat(f.error,f.warning,f.info).join("
"),A+="
";for(var L=!1,M="
",u=0;u<3;u++){var T=["error","warning","info"][u];if(f[T].length>0){var I=f[T].length===1?a[T].singular:a[T].plural;M+="".concat(L?", ":"").concat(f[T].length," ").concat(I),L=!0}}if(M+="
",d=M+A,r.setHtml(d),r.setClassName("ace_gutter-tooltip"),r.$element.setAttribute("aria-live","polite"),r.show(),i._signal("showGutterTooltip",r),i.on("mousewheel",S),n.$tooltipFollowsMouse)y(c);else{var F=c.domEvent.target,_=F.getBoundingClientRect(),W=r.getElement().style;W.left=_.right+"px",W.top=_.bottom+"px"}}function S(){o&&(o=clearTimeout(o)),d&&(r.hide(),d=null,i._signal("hideGutterTooltip",r),i.off("mousewheel",S))}function y(m){r.setPosition(m.x,m.y)}n.editor.setDefaultHandler("guttermousemove",function(m){var b=m.domEvent.target||m.domEvent.srcElement;if(k.hasCssClass(b,"ace_fold-widget"))return S();d&&n.$tooltipFollowsMouse&&y(m),c=m,!o&&(o=setTimeout(function(){o=null,c&&!n.isMousePressed?$():S()},50))}),C.addListener(i.renderer.$gutter,"mouseout",function(m){c=null,!(!d||o)&&(o=setTimeout(function(){o=null,S()},50))},i),i.on("changeSession",S)}var e=function(n){R(i,n);function i(){return n!==null&&n.apply(this,arguments)||this}return i.prototype.setPosition=function(t,r){var o=window.innerWidth||document.documentElement.clientWidth,c=window.innerHeight||document.documentElement.clientHeight,d=this.getWidth(),$=this.getHeight();t+=15,r+=15,t+d>o&&(t-=t+d-o),r+$>c&&(r-=20+$),s.prototype.setPosition.call(this,t,r)},i}(s);x.GutterHandler=l}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("../lib/event"),k=E("../lib/useragent"),C=function(){function s(l,e){this.domEvent=l,this.editor=e,this.x=this.clientX=l.clientX,this.y=this.clientY=l.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1,this.getAccelKey=k.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}return s.prototype.stopPropagation=function(){R.stopPropagation(this.domEvent),this.propagationStopped=!0},s.prototype.preventDefault=function(){R.preventDefault(this.domEvent),this.defaultPrevented=!0},s.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},s.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},s.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var l=this.editor,e=l.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=e.contains(n.row,n.column)}return this.$inSelection},s.prototype.getButton=function(){return R.getButton(this.domEvent)},s.prototype.getShiftKey=function(){return this.domEvent.shiftKey},s}();x.MouseEvent=C}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("../lib/dom"),k=E("../lib/event"),C=E("../lib/useragent"),s=200,l=200,e=5;function n(t){var r=t.editor,o=R.createElement("div");o.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",o.textContent="\xA0";var c=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];c.forEach(function(O){t[O]=this[O]},this),r.on("mousedown",this.onMouseDown.bind(t));var d=r.container,$,S,y,m,b,p,w=0,v,f,a,h,u;this.onDragStart=function(O){if(this.cancelDrag||!d.draggable){var B=this;return setTimeout(function(){B.startSelect(),B.captureMouse(O)},0),O.preventDefault()}b=r.getSelectionRange();var H=O.dataTransfer;H.effectAllowed=r.getReadOnly()?"copy":"copyMove",r.container.appendChild(o),H.setDragImage&&H.setDragImage(o,0,0),setTimeout(function(){r.container.removeChild(o)}),H.clearData(),H.setData("Text",r.session.getTextRange()),f=!0,this.setState("drag")},this.onDragEnd=function(O){if(d.draggable=!1,f=!1,this.setState(null),!r.getReadOnly()){var B=O.dataTransfer.dropEffect;!v&&B=="move"&&r.session.remove(r.getSelectionRange()),r.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(O){if(!(r.getReadOnly()||!_(O.dataTransfer)))return S=O.clientX,y=O.clientY,$||M(),w++,O.dataTransfer.dropEffect=v=W(O),k.preventDefault(O)},this.onDragOver=function(O){if(!(r.getReadOnly()||!_(O.dataTransfer)))return S=O.clientX,y=O.clientY,$||(M(),w++),I!==null&&(I=null),O.dataTransfer.dropEffect=v=W(O),k.preventDefault(O)},this.onDragLeave=function(O){if(w--,w<=0&&$)return T(),v=null,k.preventDefault(O)},this.onDrop=function(O){if(!!p){var B=O.dataTransfer;if(f)switch(v){case"move":b.contains(p.row,p.column)?b={start:p,end:p}:b=r.moveText(b,p);break;case"copy":b=r.moveText(b,p,!0);break}else{var H=B.getData("Text");b={start:p,end:r.session.insert(p,H)},r.focus(),v=null}return T(),k.preventDefault(O)}},k.addListener(d,"dragstart",this.onDragStart.bind(t),r),k.addListener(d,"dragend",this.onDragEnd.bind(t),r),k.addListener(d,"dragenter",this.onDragEnter.bind(t),r),k.addListener(d,"dragover",this.onDragOver.bind(t),r),k.addListener(d,"dragleave",this.onDragLeave.bind(t),r),k.addListener(d,"drop",this.onDrop.bind(t),r);function g(O,B){var H=Date.now(),z=!B||O.row!=B.row,Y=!B||O.column!=B.column;if(!h||z||Y)r.moveCursorToPosition(O),h=H,u={x:S,y};else{var Z=i(u.x,u.y,S,y);Z>e?h=null:H-h>=l&&(r.renderer.scrollCursorIntoView(),h=null)}}function A(O,B){var H=Date.now(),z=r.renderer.layerConfig.lineHeight,Y=r.renderer.layerConfig.characterWidth,Z=r.renderer.scroller.getBoundingClientRect(),N={x:{left:S-Z.left,right:Z.right-S},y:{top:y-Z.top,bottom:Z.bottom-y}},U=Math.min(N.x.left,N.x.right),X=Math.min(N.y.top,N.y.bottom),G={row:O.row,column:O.column};U/Y<=2&&(G.column+=N.x.left=s&&r.renderer.scrollCursorIntoView(G):a=H:a=null}function L(){var O=p;p=r.renderer.screenToTextCoordinates(S,y),g(p,O),A(p,O)}function M(){b=r.selection.toOrientedRange(),$=r.session.addMarker(b,"ace_selection",r.getSelectionStyle()),r.clearSelection(),r.isFocused()&&r.renderer.$cursorLayer.setBlinking(!1),clearInterval(m),L(),m=setInterval(L,20),w=0,k.addListener(document,"mousemove",F)}function T(){clearInterval(m),r.session.removeMarker($),$=null,r.selection.fromOrientedRange(b),r.isFocused()&&!f&&r.$resetCursorStyle(),b=null,p=null,w=0,a=null,h=null,k.removeListener(document,"mousemove",F)}var I=null;function F(){I==null&&(I=setTimeout(function(){I!=null&&$&&T()},20))}function _(O){var B=O.types;return!B||Array.prototype.some.call(B,function(H){return H=="text/plain"||H=="Text"})}function W(O){var B=["copy","copymove","all","uninitialized"],H=["move","copymove","linkmove","all","uninitialized"],z=C.isMac?O.altKey:O.ctrlKey,Y="uninitialized";try{Y=O.dataTransfer.effectAllowed.toLowerCase()}catch(N){}var Z="none";return z&&B.indexOf(Y)>=0?Z="copy":H.indexOf(Y)>=0?Z="move":B.indexOf(Y)>=0&&(Z="copy"),Z}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,r=t.container;r.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var o=C.isWin?"default":"move";t.renderer.setCursorStyle(o),this.setState("dragReady")},this.onMouseDrag=function(t){var r=this.editor.container;if(C.isIE&&this.state=="dragReady"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>3&&r.dragDrop()}if(this.state==="dragWait"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>0&&(r.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(!!this.$dragEnabled){this.mousedownEvent=t;var r=this.editor,o=t.inSelection(),c=t.getButton(),d=t.domEvent.detail||1;if(d===1&&c===0&&o){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var $=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in $&&($.unselectable="on"),r.getDragDelay()){if(C.isWebKit){this.cancelDrag=!0;var S=r.container;S.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(n.prototype);function i(t,r,o,c){return Math.sqrt(Math.pow(o-t,2)+Math.pow(c-r,2))}x.DragdropHandler=n}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(E,x,P){"use strict";var R=E("./mouse_event").MouseEvent,k=E("../lib/event"),C=E("../lib/dom");x.addTouchListeners=function(s,l){var e="scroll",n,i,t,r,o,c,d=0,$,S=0,y=0,m=0,b,p;function w(){var g=window.navigator&&window.navigator.clipboard,A=!1,L=function(){var T=l.getCopyText(),I=l.session.getUndoManager().hasUndo();p.replaceChild(C.buildDom(A?["span",!T&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],T&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],T&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],g&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],I&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Palette"]]:["span"]),p.firstChild)},M=function(T){var I=T.target.getAttribute("action");if(I=="more"||!A)return A=!A,L();I=="paste"?g.readText().then(function(F){l.execCommand(I,F)}):I&&((I=="cut"||I=="copy")&&(g?g.writeText(l.getCopyText()):document.execCommand("copy")),l.execCommand(I)),p.firstChild.style.display="none",A=!1,I!="openCommandPallete"&&l.focus()};p=C.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(T){e="menu",T.stopPropagation(),T.preventDefault(),l.textInput.focus()},ontouchend:function(T){T.stopPropagation(),T.preventDefault(),M(T)},onclick:M},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],l.container)}function v(){p||w();var g=l.selection.cursor,A=l.renderer.textToScreenCoordinates(g.row,g.column),L=l.renderer.textToScreenCoordinates(0,0).pageX,M=l.renderer.scrollLeft,T=l.container.getBoundingClientRect();p.style.top=A.pageY-T.top-3+"px",A.pageX-T.left=2?l.selection.getLineRange($.row):l.session.getBracketRange($);g&&!g.isEmpty()?l.selection.setRange(g):l.selection.selectWord(),e="wait"}k.addListener(s,"contextmenu",function(g){if(!!b){var A=l.textInput.getElement();A.focus()}},l),k.addListener(s,"touchstart",function(g){var A=g.touches;if(o||A.length>1){clearTimeout(o),o=null,t=-1,e="zoom";return}b=l.$mouseHandler.isMousePressed=!0;var L=l.renderer.layerConfig.lineHeight,M=l.renderer.layerConfig.lineHeight,T=g.timeStamp;r=T;var I=A[0],F=I.clientX,_=I.clientY;Math.abs(n-F)+Math.abs(i-_)>L&&(t=-1),n=g.clientX=F,i=g.clientY=_,y=m=0;var W=new R(g,l);if($=W.getDocumentPosition(),T-t<500&&A.length==1&&!d)S++,g.preventDefault(),g.button=0,h();else{S=0;var O=l.selection.cursor,B=l.selection.isEmpty()?O:l.selection.anchor,H=l.renderer.$cursorLayer.getPixelPosition(O,!0),z=l.renderer.$cursorLayer.getPixelPosition(B,!0),Y=l.renderer.scroller.getBoundingClientRect(),Z=l.renderer.layerConfig.offset,N=l.renderer.scrollLeft,U=function(Q,J){return Q=Q/M,J=J/L-.75,Q*Q+J*J};if(g.clientXG?"cursor":"anchor"),G<3.5?e="anchor":X<3.5?e="cursor":e="scroll",o=setTimeout(a,450)}t=T},l),k.addListener(s,"touchend",function(g){b=l.$mouseHandler.isMousePressed=!1,c&&clearInterval(c),e=="zoom"?(e="",d=0):o?(l.selection.moveToPosition($),d=0,v()):e=="scroll"?(u(),f()):v(),clearTimeout(o),o=null},l),k.addListener(s,"touchmove",function(g){o&&(clearTimeout(o),o=null);var A=g.touches;if(!(A.length>1||e=="zoom")){var L=A[0],M=n-L.clientX,T=i-L.clientY;if(e=="wait")if(M*M+T*T>4)e="cursor";else return g.preventDefault();n=L.clientX,i=L.clientY,g.clientX=L.clientX,g.clientY=L.clientY;var I=g.timeStamp,F=I-r;if(r=I,e=="scroll"){var _=new R(g,l);_.speed=1,_.wheelX=M,_.wheelY=T,10*Math.abs(M)0)if(he==16){for(se=ce;se-1){for(se=ce;se=0&&G[K]==a;K--)U[K]=C}}}function H(N,U,X){if(!(s=N){for(J=Q+1;J=N;)J++;for(q=Q,j=J-1;q=U.length||(J=X[G-1])!=m&&J!=b||(q=U[G+1])!=m&&q!=b?p:(l&&(q=b),q==J?q:p);case u:return J=G>0?X[G-1]:w,J==m&&G+10&&X[G-1]==m)return m;if(l)return p;for(re=G+1,j=U.length;re=1425&&he<=2303||he==64286;if(J=U[re],de&&(J==y||J==f))return y}return G<1||(J=U[G-1])==w?p:X[G-1];case w:return l=!1,n=!0,C;case v:return i=!0,p;case L:case M:case I:case F:case T:l=!1;case _:return p}}function Y(N){var U=N.charCodeAt(0),X=U>>8;return X==0?U>191?S:W[U]:X==5?/[\u0591-\u05f4]/.test(N)?y:S:X==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(N)?A:/[\u0660-\u0669\u066b-\u066c]/.test(N)?b:U==1642?g:/[\u06f0-\u06f9]/.test(N)?m:f:X==32&&U<=8287?O[U&255]:X==254&&U>=65136?f:p}function Z(N){return N>="\u064B"&&N<="\u0655"}x.L=S,x.R=y,x.EN=m,x.ON_R=3,x.AN=4,x.R_H=5,x.B=6,x.RLE=7,x.DOT="\xB7",x.doBidiReorder=function(N,U,X){if(N.length<2)return{};var G=N.split(""),Q=new Array(G.length),J=new Array(G.length),q=[];C=X?$:d,B(G,q,G.length,U);for(var j=0;jf&&U[j]0&&G[j-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(G[j])&&(q[j-1]=q[j]=x.R_H,j++);G[G.length-1]===x.DOT&&(q[G.length-1]=x.B),G[0]==="\u202B"&&(q[0]=x.RLE);for(var j=0;j=0&&(e=this.session.$docRowCache[i])}return e},l.prototype.getSplitIndex=function(){var e=0,n=this.session.$screenRowCache;if(n.length)for(var i,t=this.session.$getRowCacheIndex(n,this.currentRow);this.currentRow-e>0&&(i=this.session.$getRowCacheIndex(n,this.currentRow-e-1),i===t);)t=i,e++;else e=this.currentRow;return e},l.prototype.updateRowLine=function(e,n){e===void 0&&(e=this.getDocumentRow());var i=e===this.session.getLength()-1,t=i?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(n===void 0&&(n=this.getSplitIndex()),n>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[R.L],this.line=nn?this.session.getOverwrite()?e:e-1:n,t=R.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=n&&r[t]%2!=0&&t++;for(var c=0;cn&&r[t]%2==0&&(o+=this.charWidths[r[t]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},l.prototype.getSelections=function(e,n){var i=this.bidiMap,t=i.bidiLevels,r,o=[],c=0,d=Math.min(e,n)-this.wrapIndent,$=Math.max(e,n)-this.wrapIndent,S=!1,y=!1,m=0;this.wrapIndent&&(c+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var b,p=0;p=d&&b<$,S&&!y?m=c:!S&&y&&o.push({left:m,width:c-m}),c+=this.charWidths[r],y=S;if(S&&p===t.length&&o.push({left:m,width:c-m}),this.isRtlDir)for(var w=0;wi+o/2;){if(i+=o,t===r.length-1){o=0;break}o=this.charWidths[r[++t]]}return t>0&&r[t-1]%2!=0&&r[t]%2==0?(e0&&r[t-1]%2==0&&r[t]%2!=0?n=1+(e>i?this.bidiMap.logicalFromVisual[t]:this.bidiMap.logicalFromVisual[t-1]):this.isRtlDir&&t===r.length-1&&o===0&&r[t-1]%2==0||!this.isRtlDir&&t===0&&r[t]%2!=0?n=1+this.bidiMap.logicalFromVisual[t]:(t>0&&r[t-1]%2!=0&&o!==0&&t--,n=this.bidiMap.logicalFromVisual[t]),n===0&&this.isRtlDir&&n++,n+this.wrapIndent},l}();x.BidiHandler=s}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(E,x,P){"use strict";var R=E("./lib/oop"),k=E("./lib/lang"),C=E("./lib/event_emitter").EventEmitter,s=E("./range").Range,l=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var n=this;this.cursor.on("change",function(i){n.$cursorChanged=!0,n.$silent||n._emit("changeCursor"),!n.$isEmpty&&!n.$silent&&n._emit("changeSelection"),!n.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(n.$desiredColumn=null)}),this.anchor.on("change",function(){n.$anchorChanged=!0,!n.$isEmpty&&!n.$silent&&n._emit("changeSelection")})};(function(){R.implement(this,C),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setAnchor=function(e,n){this.$isEmpty=!1,this.anchor.setPosition(e,n)},this.setSelectionAnchor=this.setAnchor,this.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionAnchor=this.getAnchor,this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,n=this.lead;return e.row>n.row||e.row==n.row&&e.column>n.column},this.getRange=function(){var e=this.anchor,n=this.lead;return this.$isEmpty?s.fromPoints(n,n):this.isBackwards()?s.fromPoints(n,e):s.fromPoints(e,n)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,n){var i=n?e.end:e.start,t=n?e.start:e.end;this.$setSelection(i.row,i.column,t.row,t.column)},this.$setSelection=function(e,n,i,t){if(!this.$silent){var r=this.$isEmpty,o=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,n),this.cursor.setPosition(i,t),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||o)&&this._emit("changeSelection")}},this.$moveSelection=function(e){var n=this.lead;this.$isEmpty&&this.setSelectionAnchor(n.row,n.column),e.call(this)},this.selectTo=function(e,n){this.$moveSelection(function(){this.moveCursorTo(e,n)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,n){this.clearSelection(),this.moveCursorTo(e,n)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,n){if(typeof n=="undefined"){var i=e||this.lead;e=i.row,n=i.column}return this.session.getWordRange(e,n)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),n=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(n)},this.getLineRange=function(e,n){var i=typeof e=="number"?e:this.lead.row,t,r=this.session.getFoldLine(i);return r?(i=r.start.row,t=r.end.row):t=i,n===!0?new s(i,0,t,this.session.getLine(t).length):new s(i,0,t+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,n,i){var t=e.column,r=e.column+n;return i<0&&(t=e.column-n,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(t,r).split(" ").length-1==n},this.moveCursorLeft=function(){var e=this.lead.getPosition(),n;if(n=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(n.start.row,n.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),n;if(n=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(n.end.row,n.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(n.column=t)}}this.moveCursorTo(n.row,n.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,n=this.doc.getLine(e).length;this.moveCursorTo(e,n)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,n=this.lead.column,i=this.doc.getLine(e),t=i.substring(n);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(e,n,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(t)&&(n+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,t=i.substring(n)),n>=i.length){this.moveCursorTo(e,i.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,n)},this.$shortWordEndIndex=function(e){var n=0,i,t=/\s/,r=this.session.tokenRe;if(r.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(i=e[n])&&t.test(i);)n++;if(n<1){for(r.lastIndex=0;(i=e[n])&&!r.test(i);)if(r.lastIndex=0,n++,t.test(i))if(n>2){n--;break}else{for(;(i=e[n])&&t.test(i);)n++;if(n>2)break}}}return r.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,n=this.lead.column,i=this.doc.getLine(e),t=i.substring(n),r=this.session.getFoldAt(e,n,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(n==i.length){var o=this.doc.getLength();do e++,t=this.doc.getLine(e);while(e0&&/^\s*$/.test(t));n=t.length,/\s+$/.test(t)||(t="")}var r=k.stringReverse(t),o=this.$shortWordEndIndex(r);return this.moveCursorTo(e,n-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,n){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),t;if(n===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(t=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(t/this.session.$bidiHandler.charWidths[0])):t=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];e<0?e-=r.rowsAbove||0:e>0&&(e+=r.rowCount-(r.rowsAbove||0))}var o=this.session.screenToDocumentPosition(i.row+e,i.column,t);e!==0&&n===0&&o.row===this.lead.row&&o.column===this.lead.column,this.moveCursorTo(o.row,o.column+n,n===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,n,i){var t=this.session.getFoldAt(e,n,1);t&&(e=t.start.row,n=t.start.column),this.$keepDesiredColumnOnChange=!0;var r=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(r.charAt(n))&&r.charAt(n-1)&&(this.lead.row==e&&this.lead.column==n+1?n=n-1:n=n+1),this.lead.setPosition(e,n),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,n,i){var t=this.session.screenToDocumentPosition(e,n);this.moveCursorTo(t.row,t.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach()},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var n=this.getRange();return e?(e.start.column=n.start.column,e.start.row=n.start.row,e.end.column=n.end.column,e.end.row=n.end.row):e=n,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var n=this.getCursor();try{e(this);var i=this.getCursor();return s.fromPoints(n,i)}catch(t){return s.fromPoints(n,n)}finally{this.moveCursorToPosition(n)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(n){var i=n.clone();return i.isBackwards=n.cursor==n.start,i});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==null)if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var n=e.length;n--;){var i=s.fromPoints(e[n].start,e[n].end);e[n].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}else e=e[0];this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var n=this.ranges.length;n--;)if(!this.ranges[n].isEqual(e[n]))return!1;return!0}}).call(l.prototype),x.Selection=l}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(E,x,P){"use strict";var R=E("./config"),k=2e3,C=function(){function s(l){this.states=l,this.regExps={},this.matchMappings={};for(var e in this.states){for(var n=this.states[e],i=[],t=0,r=this.matchMappings[e]={defaultToken:"text"},o="g",c=[],d=0;d1?$.onMatch=this.$applyToken:$.onMatch=$.token),y>1&&(/\\\d/.test($.regex)?S=$.regex.replace(/\\([0-9]+)/g,function(m,b){return"\\"+(parseInt(b,10)+t+1)}):(y=1,S=this.removeCapturingGroups($.regex)),!$.splitRegex&&typeof $.token!="string"&&c.push($)),r[t]=d,t+=y,i.push(S),$.onMatch||($.onMatch=null)}}i.length||(r[0]=0,i.push("$")),c.forEach(function(m){m.splitRegex=this.createSplitterRegexp(m.regex,o)},this),this.regExps[e]=new RegExp("("+i.join(")|(")+")|($)",o)}}return s.prototype.$setMaxTokenCount=function(l){k=l|0},s.prototype.$applyToken=function(l){var e=this.splitRegex.exec(l).slice(1),n=this.token.apply(this,e);if(typeof n=="string")return[{type:n,value:l}];for(var i=[],t=0,r=n.length;t$){var v=l.substring($,w-p.length);y.type==m?y.value+=v:(y.type&&d.push(y),y={type:m,value:v})}for(var f=0;fk){for(S>2*l.length&&this.reportError("infinite loop with in ace tokenizer",{startState:e,line:l});$1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:d,state:n.length?n:i}},s}();C.prototype.reportError=R.reportError,x.Tokenizer=C}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(E,x,P){"use strict";var R=E("../lib/lang"),k=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(l,e){if(!e){for(var n in l)this.$rules[n]=l[n];return}for(var n in l){for(var i=l[n],t=0;t=this.$rowTokens.length;){if(this.$row+=1,s||(s=this.$session.getLength()),this.$row>=s)return this.$row=s-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},C.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},C.prototype.getCurrentTokenRow=function(){return this.$row},C.prototype.getCurrentTokenColumn=function(){var s=this.$rowTokens,l=this.$tokenIndex,e=s[l].start;if(e!==void 0)return e;for(e=0;l>0;)l-=1,e+=s[l].value.length;return e},C.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},C.prototype.getCurrentTokenRange=function(){var s=this.$rowTokens[this.$tokenIndex],l=this.getCurrentTokenColumn();return new R(this.$row,l,this.$row,l+s.value.length)},C}();x.TokenIterator=k}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(E,x,P){"use strict";var R=E("../../lib/oop"),k=E("../behaviour").Behaviour,C=E("../../token_iterator").TokenIterator,s=E("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],e=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],n,i={},t={'"':'"',"'":"'"},r=function(d){var $=-1;if(d.multiSelect&&($=d.selection.index,i.rangeCount!=d.multiSelect.rangeCount&&(i={rangeCount:d.multiSelect.rangeCount})),i[$])return n=i[$];n=i[$]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},o=function(d,$,S,y){var m=d.end.row-d.start.row;return{text:S+$+y,selection:[0,d.start.column+1,m,d.end.column+(m?0:1)]}},c=function(d){this.add("braces","insertion",function($,S,y,m,b){var p=y.getCursorPosition(),w=m.doc.getLine(p.row);if(b=="{"){r(y);var v=y.getSelectionRange(),f=m.doc.getTextRange(v);if(f!==""&&f!=="{"&&y.getWrapBehavioursEnabled())return o(v,f,"{","}");if(c.isSaneInsertion(y,m))return/[\]\}\)]/.test(w[p.column])||y.inMultiSelectMode||d&&d.braces?(c.recordAutoInsert(y,m,"}"),{text:"{}",selection:[1,1]}):(c.recordMaybeInsert(y,m,"{"),{text:"{",selection:[1,1]})}else if(b=="}"){r(y);var a=w.substring(p.column,p.column+1);if(a=="}"){var h=m.$findOpeningBracket("}",{column:p.column+1,row:p.row});if(h!==null&&c.isAutoInsertedClosing(p,w,b))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(b==` `||b==`\r `){r(y);var u="";c.isMaybeInsertedClosing(p,w)&&(u=s.stringRepeat("}",n.maybeInsertedBrackets),c.clearMaybeInsertedClosing());var a=w.substring(p.column,p.column+1);if(a==="}"){var g=m.findMatchingBracket({row:p.row,column:p.column+1},"}");if(!g)return null;var A=this.$getIndent(m.getLine(g.row))}else if(u)var A=this.$getIndent(w);else{c.clearMaybeInsertedClosing();return}var L=A+m.getTabString();return{text:` `+L+` `+A+u,selection:[1,L.length,1,L.length]}}else c.clearMaybeInsertedClosing()}),this.add("braces","deletion",function($,S,y,m,b){var p=m.doc.getTextRange(b);if(!b.isMultiLine()&&p=="{"){r(y);var w=m.doc.getLine(b.start.row),v=w.substring(b.end.column,b.end.column+1);if(v=="}")return b.end.column++,b;n.maybeInsertedBrackets--}}),this.add("parens","insertion",function($,S,y,m,b){if(b=="("){r(y);var p=y.getSelectionRange(),w=m.doc.getTextRange(p);if(w!==""&&y.getWrapBehavioursEnabled())return o(p,w,"(",")");if(c.isSaneInsertion(y,m))return c.recordAutoInsert(y,m,")"),{text:"()",selection:[1,1]}}else if(b==")"){r(y);var v=y.getCursorPosition(),f=m.doc.getLine(v.row),a=f.substring(v.column,v.column+1);if(a==")"){var h=m.$findOpeningBracket(")",{column:v.column+1,row:v.row});if(h!==null&&c.isAutoInsertedClosing(v,f,b))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function($,S,y,m,b){var p=m.doc.getTextRange(b);if(!b.isMultiLine()&&p=="("){r(y);var w=m.doc.getLine(b.start.row),v=w.substring(b.start.column+1,b.start.column+2);if(v==")")return b.end.column++,b}}),this.add("brackets","insertion",function($,S,y,m,b){if(b=="["){r(y);var p=y.getSelectionRange(),w=m.doc.getTextRange(p);if(w!==""&&y.getWrapBehavioursEnabled())return o(p,w,"[","]");if(c.isSaneInsertion(y,m))return c.recordAutoInsert(y,m,"]"),{text:"[]",selection:[1,1]}}else if(b=="]"){r(y);var v=y.getCursorPosition(),f=m.doc.getLine(v.row),a=f.substring(v.column,v.column+1);if(a=="]"){var h=m.$findOpeningBracket("]",{column:v.column+1,row:v.row});if(h!==null&&c.isAutoInsertedClosing(v,f,b))return c.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function($,S,y,m,b){var p=m.doc.getTextRange(b);if(!b.isMultiLine()&&p=="["){r(y);var w=m.doc.getLine(b.start.row),v=w.substring(b.start.column+1,b.start.column+2);if(v=="]")return b.end.column++,b}}),this.add("string_dquotes","insertion",function($,S,y,m,b){var p=m.$mode.$quotes||t;if(b.length==1&&p[b]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(b)!=-1)return;r(y);var w=b,v=y.getSelectionRange(),f=m.doc.getTextRange(v);if(f!==""&&(f.length!=1||!p[f])&&y.getWrapBehavioursEnabled())return o(v,f,w,w);if(!f){var a=y.getCursorPosition(),h=m.doc.getLine(a.row),u=h.substring(a.column-1,a.column),g=h.substring(a.column,a.column+1),A=m.getTokenAt(a.row,a.column),L=m.getTokenAt(a.row,a.column+1);if(u=="\\"&&A&&/escape/.test(A.type))return null;var M=A&&/string|escape/.test(A.type),T=!L||/string|escape/.test(L.type),I;if(g==w)I=M!==T,I&&/string\.end/.test(L.type)&&(I=!1);else{if(M&&!T||M&&T)return null;var F=m.$mode.tokenRe;F.lastIndex=0;var _=F.test(u);F.lastIndex=0;var W=F.test(g),O=m.$mode.$pairQuotesAfter,B=O&&O[w]&&O[w].test(u);if(!B&&_||W||g&&!/[\s;,.})\]\\]/.test(g))return null;var H=h[a.column-2];if(u==w&&(H==w||F.test(H)))return null;I=!0}return{text:I?w+w:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function($,S,y,m,b){var p=m.$mode.$quotes||t,w=m.doc.getTextRange(b);if(!b.isMultiLine()&&p.hasOwnProperty(w)){r(y);var v=m.doc.getLine(b.start.row),f=v.substring(b.start.column+1,b.start.column+2);if(f==w)return b.end.column++,b}})};c.isSaneInsertion=function(d,$){var S=d.getCursorPosition(),y=new C($,S.row,S.column);if(!this.$matchTokenType(y.getCurrentToken()||"text",l)){if(/[)}\]]/.test(d.session.getLine(S.row)[S.column]))return!0;var m=new C($,S.row,S.column+1);if(!this.$matchTokenType(m.getCurrentToken()||"text",l))return!1}return y.stepForward(),y.getCurrentTokenRow()!==S.row||this.$matchTokenType(y.getCurrentToken()||"text",e)},c.$matchTokenType=function(d,$){return $.indexOf(d.type||d)>-1},c.recordAutoInsert=function(d,$,S){var y=d.getCursorPosition(),m=$.doc.getLine(y.row);this.isAutoInsertedClosing(y,m,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=y.row,n.autoInsertedLineEnd=S+m.substr(y.column),n.autoInsertedBrackets++},c.recordMaybeInsert=function(d,$,S){var y=d.getCursorPosition(),m=$.doc.getLine(y.row);this.isMaybeInsertedClosing(y,m)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=y.row,n.maybeInsertedLineStart=m.substr(0,y.column)+S,n.maybeInsertedLineEnd=m.substr(y.column),n.maybeInsertedBrackets++},c.isAutoInsertedClosing=function(d,$,S){return n.autoInsertedBrackets>0&&d.row===n.autoInsertedRow&&S===n.autoInsertedLineEnd[0]&&$.substr(d.column)===n.autoInsertedLineEnd},c.isMaybeInsertedClosing=function(d,$){return n.maybeInsertedBrackets>0&&d.row===n.maybeInsertedRow&&$.substr(d.column)===n.maybeInsertedLineEnd&&$.substr(0,d.column)==n.maybeInsertedLineStart},c.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},c.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},R.inherits(c,k),x.CstyleBehaviour=c}),ace.define("ace/unicode",["require","exports","module"],function(E,x,P){"use strict";for(var R=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],k=0,C=[],s=0;s2?H%b!=b-1:H%b==0}}else{if(!this.blockComment)return!1;var w=this.blockComment.start,v=this.blockComment.end,f=new RegExp("^(\\s*)(?:"+e.escapeRegExp(w)+")"),a=new RegExp("(?:"+e.escapeRegExp(v)+")\\s*$"),h=function(I,F){g(I,F)||(!S||/\S/.test(I))&&($.insertInLine({row:F,column:I.length},v),$.insertInLine({row:F,column:m},w))},u=function(I,F){var _;(_=I.match(a))&&$.removeInLine(F,I.length-_[0].length,I.length),(_=I.match(f))&&$.removeInLine(F,_[1].length,_[0].length)},g=function(I,F){if(f.test(I))return!0;for(var _=o.getTokens(F),W=0;W<_.length;W++)if(_[W].type==="comment")return!0}}function M(I){for(var F=c;F<=d;F++)I($.getLine(F),F)}var T=Infinity;M(function(I,F){var _=I.search(/\S/);_!==-1?(_I.length&&(T=I.length)}),m==Infinity&&(m=T,S=!1,y=!1),p&&m%b!=0&&(m=Math.floor(m/b)*b),M(y?u:h)},this.toggleBlockComment=function(r,o,c,d){var $=this.blockComment;if(!!$){!$.start&&$[0]&&($=$[0]);var S=new n(o,d.row,d.column),y=S.getCurrentToken(),m=o.selection,b=o.selection.toOrientedRange(),p,w;if(y&&/comment/.test(y.type)){for(var v,f;y&&/comment/.test(y.type);){var a=y.value.indexOf($.start);if(a!=-1){var h=S.getCurrentTokenRow(),u=S.getCurrentTokenColumn()+a;v=new i(h,u,h,u+$.start.length);break}y=S.stepBackward()}for(var S=new n(o,d.row,d.column),y=S.getCurrentToken();y&&/comment/.test(y.type);){var a=y.value.indexOf($.end);if(a!=-1){var h=S.getCurrentTokenRow(),u=S.getCurrentTokenColumn()+a;f=new i(h,u,h,u+$.end.length);break}y=S.stepForward()}f&&o.remove(f),v&&(o.remove(v),p=v.start.row,w=-$.start.length)}else w=$.start.length,p=c.start.row,o.insert(c.end,$.end),o.insert(c.start,$.start);b.start.row==p&&(b.start.column+=w),b.end.row==p&&(b.end.column+=w),o.selection.fromOrientedRange(b)}},this.getNextLineIndent=function(r,o,c){return this.$getIndent(o)},this.checkOutdent=function(r,o,c){return!1},this.autoOutdent=function(r,o,c){},this.$getIndent=function(r){return r.match(/^\s*/)[0]},this.createWorker=function(r){return null},this.createModeDelegates=function(r){this.$embeds=[],this.$modes={};for(var o in r)if(r[o]){var c=r[o],d=c.prototype.$id,$=R.$modes[d];$||(R.$modes[d]=$=new c),R.$modes[o]||(R.$modes[o]=$),this.$embeds.push(o),this.$modes[o]=$}for(var S=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],o=0;o=0&&l.row=0&&l.column<=s[l.row].length}function C(s,l){l.action!="insert"&&l.action!="remove"&&R(l,"delta.action must be 'insert' or 'remove'"),l.lines instanceof Array||R(l,"delta.lines must be an Array"),(!l.start||!l.end)&&R(l,"delta.start/end must be an present");var e=l.start;k(s,l.start)||R(l,"delta.start must be contained in document");var n=l.end;l.action=="remove"&&!k(s,n)&&R(l,"delta.end must contained in document for 'remove' actions");var i=n.row-e.row,t=n.column-(i==0?e.column:0);(i!=l.lines.length-1||l.lines[i].length!=t)&&R(l,"delta.range must match delta lines")}x.applyDelta=function(s,l,e){var n=l.start.row,i=l.start.column,t=s[n]||"";switch(l.action){case"insert":var r=l.lines;if(r.length===1)s[n]=t.substring(0,i)+l.lines[0]+t.substring(i);else{var o=[n,1].concat(l.lines);s.splice.apply(s,o),s[n]=t.substring(0,i)+s[n],s[n+l.lines.length-1]+=t.substring(i)}break;case"remove":var c=l.end.column,d=l.end.row;n===d?s[n]=t.substring(0,i)+t.substring(c):s.splice(n,d-n+1,t.substring(0,i)+s[d].substring(c));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=E("./lib/oop"),k=E("./lib/event_emitter").EventEmitter,C=function(){function e(n,i,t){this.$onChange=this.onChange.bind(this),this.attach(n),typeof t=="undefined"?this.setPosition(i.row,i.column):this.setPosition(i,t)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(n){if(!(n.start.row==n.end.row&&n.start.row!=this.row)&&!(n.start.row>this.row)){var i=l(n,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0)}},e.prototype.setPosition=function(n,i,t){var r;if(t?r={row:n,column:i}:r=this.$clipPositionToDocument(n,i),!(this.row==r.row&&this.column==r.column)){var o={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:o,value:r})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(n){this.document=n||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(n,i){var t={};return n>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):n<0?(t.row=0,t.column=0):(t.row=n,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,i))),i<0&&(t.column=0),t},e}();C.prototype.$insertRight=!1,R.implement(C.prototype,k);function s(e,n,i){var t=i?e.column<=n.column:e.column=r&&(i=r-1,t=void 0);var o=this.getLine(i);return t==null&&(t=o.length),t=Math.min(Math.max(t,0),o.length),{row:i,column:t}},n.prototype.clonePos=function(i){return{row:i.row,column:i.column}},n.prototype.pos=function(i,t){return{row:i,column:t}},n.prototype.$clipPosition=function(i){var t=this.getLength();return i.row>=t?(i.row=Math.max(0,t-1),i.column=this.getLine(t-1).length):(i.row=Math.max(0,i.row),i.column=Math.min(Math.max(i.column,0),this.getLine(i.row).length)),i},n.prototype.insertFullLines=function(i,t){i=Math.min(Math.max(i,0),this.getLength());var r=0;i0,o=t=0&&this.applyDelta({start:this.pos(i,this.getLine(i).length),end:this.pos(i+1,0),action:"remove",lines:["",""]})},n.prototype.replace=function(i,t){if(i instanceof s||(i=s.fromPoints(i.start,i.end)),t.length===0&&i.isEmpty())return i.start;if(t==this.getTextRange(i))return i.end;this.remove(i);var r;return t?r=this.insert(i.start,t):r=i.start,r},n.prototype.applyDeltas=function(i){for(var t=0;t=0;t--)this.revertDelta(i[t])},n.prototype.applyDelta=function(i,t){var r=i.action=="insert";(r?i.lines.length<=1&&!i.lines[0]:!s.comparePoints(i.start,i.end))||(r&&i.lines.length>2e4?this.$splitAndapplyLargeDelta(i,2e4):(k(this.$lines,i,t),this._signal("change",i)))},n.prototype.$safeApplyDelta=function(i){var t=this.$lines.length;(i.action=="remove"&&i.start.row20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),c<=r&&n.fireUpdateEvent(c,r)}}}return s.prototype.setTokenizer=function(l){this.tokenizer=l,this.lines=[],this.states=[],this.start(0)},s.prototype.setDocument=function(l){this.doc=l,this.lines=[],this.states=[],this.stop()},s.prototype.fireUpdateEvent=function(l,e){var n={first:l,last:e};this._signal("update",{data:n})},s.prototype.start=function(l){this.currentLine=Math.min(l||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},s.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},s.prototype.$updateOnChange=function(l){var e=l.start.row,n=l.end.row-e;if(n===0)this.lines[e]=null;else if(l.action=="remove")this.lines.splice(e,n+1,null),this.states.splice(e,n+1,null);else{var i=Array(n+1);i.unshift(e,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(e,this.currentLine,this.doc.getLength()),this.stop()},s.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},s.prototype.getTokens=function(l){return this.lines[l]||this.$tokenizeRow(l)},s.prototype.getState=function(l){return this.currentLine==l&&this.$tokenizeRow(l),this.states[l]||"start"},s.prototype.$tokenizeRow=function(l){var e=this.doc.getLine(l),n=this.states[l-1],i=this.tokenizer.getLineTokens(e,n,l);return this.states[l]+""!=i.state+""?(this.states[l]=i.state,this.lines[l+1]=null,this.currentLine>l+1&&(this.currentLine=l+1)):this.currentLine==l&&(this.currentLine=l+1),this.lines[l]=i.tokens},s.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},s}();R.implement(C.prototype,k),x.BackgroundTokenizer=C}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(E,x,P){"use strict";var R=E("./lib/lang"),k=E("./range").Range,C=function(){function s(l,e,n){n===void 0&&(n="text"),this.setRegexp(l),this.clazz=e,this.type=n}return s.prototype.setRegexp=function(l){this.regExp+""!=l+""&&(this.regExp=l,this.cache=[])},s.prototype.update=function(l,e,n,i){if(!!this.regExp)for(var t=i.firstRow,r=i.lastRow,o={},c=t;c<=r;c++){var d=this.cache[c];d==null&&(d=R.getMatchOffsets(n.getLine(c),this.regExp),d.length>this.MAX_RANGES&&(d=d.slice(0,this.MAX_RANGES)),d=d.map(function(m){return new k(c,m.offset,c,m.offset+m.length)}),this.cache[c]=d.length?d:"");for(var $=d.length;$--;){var S=d[$].toScreenRange(n),y=S.toString();o[y]||(o[y]=!0,e.drawSingleLineMarker(l,S,this.clazz,i))}}},s}();C.prototype.MAX_RANGES=500,x.SearchHighlight=C}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(E,x,P){"use strict";var R=E("../range").Range,k=function(){function C(s,l){this.foldData=s,Array.isArray(l)?this.folds=l:l=this.folds=[l];var e=l[l.length-1];this.range=new R(l[0].start.row,l[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(n){n.setFoldLine(this)},this)}return C.prototype.shiftRow=function(s){this.start.row+=s,this.end.row+=s,this.folds.forEach(function(l){l.start.row+=s,l.end.row+=s})},C.prototype.addFold=function(s){if(s.sameRow){if(s.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(s),this.folds.sort(function(l,e){return-l.range.compareEnd(e.start.row,e.start.column)}),this.range.compareEnd(s.start.row,s.start.column)>0?(this.end.row=s.end.row,this.end.column=s.end.column):this.range.compareStart(s.end.row,s.end.column)<0&&(this.start.row=s.start.row,this.start.column=s.start.column)}else if(s.start.row==this.end.row)this.folds.push(s),this.end.row=s.end.row,this.end.column=s.end.column;else if(s.end.row==this.start.row)this.folds.unshift(s),this.start.row=s.start.row,this.start.column=s.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");s.foldLine=this},C.prototype.containsRow=function(s){return s>=this.start.row&&s<=this.end.row},C.prototype.walk=function(s,l,e){var n=0,i=this.folds,t,r,o,c=!0;l==null&&(l=this.end.row,e=this.end.column);for(var d=0;d0)){var c=k(l,r.start);return o===0?e&&c!==0?-t-2:t:c>0||c===0&&!e?t:-t-1}}return-t-1},s.prototype.add=function(l){var e=!l.isEmpty(),n=this.pointIndex(l.start,e);n<0&&(n=-n-1);var i=this.pointIndex(l.end,e,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,l)},s.prototype.addList=function(l){for(var e=[],n=l.length;n--;)e.push.apply(e,this.add(l[n]));return e},s.prototype.substractPoint=function(l){var e=this.pointIndex(l);if(e>=0)return this.ranges.splice(e,1)},s.prototype.merge=function(){var l=[],e=this.ranges;e=e.sort(function(o,c){return k(o.start,c.start)});for(var n=e[0],i,t=1;t=0},s.prototype.containsPoint=function(l){return this.pointIndex(l)>=0},s.prototype.rangeAtPoint=function(l){var e=this.pointIndex(l);if(e>=0)return this.ranges[e]},s.prototype.clipRows=function(l,e){var n=this.ranges;if(n[0].start.row>e||n[n.length-1].start.row=i)break}if(l.action=="insert")for(var $=t-i,S=-e.column+n.column;oi)break;if(d.start.row==i&&d.start.column>=e.column&&(d.start.column==e.column&&this.$bias<=0||(d.start.column+=S,d.start.row+=$)),d.end.row==i&&d.end.column>=e.column){if(d.end.column==e.column&&this.$bias<0)continue;d.end.column==e.column&&S>0&&od.start.column&&d.end.column==r[o+1].start.column&&(d.end.column-=S),d.end.column+=S,d.end.row+=$}}else for(var $=i-t,S=e.column-n.column;ot)break;d.end.rowe.column)&&(d.end.column=e.column,d.end.row=e.row):(d.end.column+=S,d.end.row+=$):d.end.row>t&&(d.end.row+=$),d.start.rowe.column)&&(d.start.column=e.column,d.start.row=e.row):(d.start.column+=S,d.start.row+=$):d.start.row>t&&(d.start.row+=$)}if($!=0&&o=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,n){var i=this.$foldData,t=0;for(n&&(t=i.indexOf(n)),t==-1&&(t=0),t;t=e)return r}return null},this.getFoldedRowCount=function(e,n){for(var i=this.$foldData,t=n-e+1,r=0;r=n){d=e?t-=n-d:t=0);break}else c>=e&&(d>=e?t-=c-d:t-=c-e+1)}return t},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(n,i){return n.start.row-i.start.row}),e},this.addFold=function(e,n){var i=this.$foldData,t=!1,r;e instanceof C?r=e:(r=new C(n,e),r.collapseChildren=n.collapseChildren),this.$clipRangeToDocument(r.range);var o=r.start.row,c=r.start.column,d=r.end.row,$=r.end.column,S=this.getFoldAt(o,c,1),y=this.getFoldAt(d,$,-1);if(S&&y==S)return S.addSubFold(r);S&&!S.range.isStart(o,c)&&this.removeFold(S),y&&!y.range.isEnd(d,$)&&this.removeFold(y);var m=this.getFoldsInRange(r.range);m.length>0&&(this.removeFolds(m),r.collapseChildren||m.forEach(function(v){r.addSubFold(v)}));for(var b=0;b0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(n){this.expandFold(n)},this)},this.unfold=function(e,n){var i,t;if(e==null)i=new R(0,0,this.getLength(),0),n==null&&(n=!0);else if(typeof e=="number")i=new R(e,0,e,this.getLine(e).length);else if("row"in e)i=R.fromPoints(e,e);else{if(Array.isArray(e))return t=[],e.forEach(function(o){t=t.concat(this.unfold(o))},this),t;i=e}t=this.getFoldsInRangeList(i);for(var r=t;t.length==1&&R.comparePoints(t[0].start,i.start)<0&&R.comparePoints(t[0].end,i.end)>0;)this.expandFolds(t),t=this.getFoldsInRangeList(i);if(n!=!1?this.removeFolds(t):this.expandFolds(t),r.length)return r},this.isRowFolded=function(e,n){return!!this.getFoldLine(e,n)},this.getRowFoldEnd=function(e,n){var i=this.getFoldLine(e,n);return i?i.end.row:e},this.getRowFoldStart=function(e,n){var i=this.getFoldLine(e,n);return i?i.start.row:e},this.getFoldDisplayLine=function(e,n,i,t,r){t==null&&(t=e.start.row),r==null&&(r=0),n==null&&(n=e.end.row),i==null&&(i=this.getLine(n).length);var o=this.doc,c="";return e.walk(function(d,$,S,y){if(!($$)break;while(r&&c.test(r.type)&&!/^comment.start/.test(r.type));r=t.stepBackward()}else r=t.getCurrentToken();return d.end.row=t.getCurrentTokenRow(),d.end.column=t.getCurrentTokenColumn(),/^comment.end/.test(r.type)||(d.end.column+=r.value.length-2),d}},this.foldAll=function(e,n,i,t){i==null&&(i=1e5);var r=this.foldWidgets;if(!!r){n=n||this.getLength(),e=e||0;for(var o=e;o=e&&(o=c.end.row,c.collapseChildren=i,this.addFold("...",c))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(n){for(var i=e.getTokens(n),t=0;t=0;){var o=i[t];if(o==null&&(o=i[t]=this.getFoldWidget(t)),o=="start"){var c=this.getFoldWidgetRange(t);if(r||(r=c),c&&c.end.row>=e)break}t--}return{range:t!==-1&&c,firstRange:r}},this.onFoldWidgetClick=function(e,n){n=n.domEvent;var i={children:n.shiftKey,all:n.ctrlKey||n.metaKey,siblings:n.altKey},t=this.$toggleFoldWidget(e,i);if(!t){var r=n.target||n.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,n){if(!!this.getFoldWidget){var i=this.getFoldWidget(e),t=this.getLine(e),r=i==="end"?-1:1,o=this.getFoldAt(e,r===-1?0:t.length,r);if(o)return n.children||n.all?this.removeFold(o):this.expandFold(o),o;var c=this.getFoldWidgetRange(e,!0);if(c&&!c.isMultiLine()&&(o=this.getFoldAt(c.start.row,c.start.column,1),o&&c.isEqual(o.range)))return this.removeFold(o),o;if(n.siblings){var d=this.getParentFoldRangeData(e);if(d.range)var $=d.range.start.row+1,S=d.range.end.row;this.foldAll($,S,n.all?1e4:0)}else n.children?(S=c?c.end.row:this.getLength(),this.foldAll(e+1,S,n.all?1e4:0)):c&&(n.all&&(c.collapseChildren=1e4),this.addFold("...",c));return c}},this.toggleFoldWidget=function(e){var n=this.selection.getCursor().row;n=this.getRowFoldStart(n);var i=this.$toggleFoldWidget(n,{});if(!i){var t=this.getParentFoldRangeData(n,!0);if(i=t.range||t.firstRange,i){n=i.start.row;var r=this.getFoldAt(n,this.getLine(n).length,1);r?this.removeFold(r):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var n=e.start.row,i=e.end.row-n;if(i===0)this.foldWidgets[n]=null;else if(e.action=="remove")this.foldWidgets.splice(n,i+1,null);else{var t=Array(i+1);t.unshift(n,1),this.foldWidgets.splice.apply(this.foldWidgets,t)}},this.tokenizerUpdateFoldWidgets=function(e){var n=e.data;n.first!=n.last&&this.foldWidgets.length>n.first&&this.foldWidgets.splice(n.first,this.foldWidgets.length)}}x.Folding=l}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(E,x,P){"use strict";var R=E("../token_iterator").TokenIterator,k=E("../range").Range;function C(){this.findMatchingBracket=function(s,l){if(s.column==0)return null;var e=l||this.getLine(s.row).charAt(s.column-1);if(e=="")return null;var n=e.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],s):this.$findOpeningBracket(n[2],s):null},this.getBracketRange=function(s){var l=this.getLine(s.row),e=!0,n,i=l.charAt(s.column-1),t=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(t||(i=l.charAt(s.column),s={row:s.row,column:s.column+1},t=i&&i.match(/([\(\[\{])|([\)\]\}])/),e=!1),!t)return null;if(t[1]){var r=this.$findClosingBracket(t[1],s);if(!r)return null;n=k.fromPoints(s,r),e||(n.end.column++,n.start.column--),n.cursor=n.end}else{var r=this.$findOpeningBracket(t[2],s);if(!r)return null;n=k.fromPoints(r,s),e||(n.start.column++,n.end.column--),n.cursor=n.start}return n},this.getMatchingBracketRanges=function(s,l){var e=this.getLine(s.row),n=/([\(\[\{])|([\)\]\}])/,i=!l&&e.charAt(s.column-1),t=i&&i.match(n);if(t||(i=(l===void 0||l)&&e.charAt(s.column),s={row:s.row,column:s.column+1},t=i&&i.match(n)),!t)return null;var r=new k(s.row,s.column-1,s.row,s.column),o=t[1]?this.$findClosingBracket(t[1],s):this.$findOpeningBracket(t[2],s);if(!o)return[r];var c=new k(o.row,o.column,o.row,o.column+1);return[r,c]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(s,l,e){var n=this.$brackets[s],i=1,t=new R(this,l.row,l.column),r=t.getCurrentToken();if(r||(r=t.stepForward()),!!r){e||(e=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var o=l.column-t.getCurrentTokenColumn()-2,c=r.value;;){for(;o>=0;){var d=c.charAt(o);if(d==n){if(i-=1,i==0)return{row:t.getCurrentTokenRow(),column:o+t.getCurrentTokenColumn()}}else d==s&&(i+=1);o-=1}do r=t.stepBackward();while(r&&!e.test(r.type));if(r==null)break;c=r.value,o=c.length-1}return null}},this.$findClosingBracket=function(s,l,e){var n=this.$brackets[s],i=1,t=new R(this,l.row,l.column),r=t.getCurrentToken();if(r||(r=t.stepForward()),!!r){e||(e=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var o=l.column-t.getCurrentTokenColumn();;){for(var c=r.value,d=c.length;o"?n=!0:l.type.indexOf("tag-name")!==-1&&(e=!0));while(l&&!e);return l},this.$findClosingTag=function(s,l){var e,n=l.value,i=l.value,t=0,r=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);l=s.stepForward();var o=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+l.value.length),c=!1;do if(e=l,l=s.stepForward(),l){if(l.value===">"&&!c){var d=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);c=!0}if(l.type.indexOf("tag-name")!==-1){if(n=l.value,i===n){if(e.value==="<")t++;else if(e.value==="")var y=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);else return}}}else if(i===n&&l.value==="/>"&&(t--,t<0))var $=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2),S=$,y=S,d=new k(o.end.row,o.end.column,o.end.row,o.end.column+1)}while(l&&t>=0);if(r&&d&&$&&y&&o&&S)return{openTag:new k(r.start.row,r.start.column,d.end.row,d.end.column),closeTag:new k($.start.row,$.start.column,y.end.row,y.end.column),openTagName:o,closeTagName:S}},this.$findOpeningTag=function(s,l){var e=s.getCurrentToken(),n=l.value,i=0,t=s.getCurrentTokenRow(),r=s.getCurrentTokenColumn(),o=r+2,c=new k(t,r,t,o);s.stepForward();var d=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+l.value.length);if(l=s.stepForward(),!(!l||l.value!==">")){var $=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);s.stepBackward(),s.stepBackward();do if(l=e,t=s.getCurrentTokenRow(),r=s.getCurrentTokenColumn(),o=r+l.value.length,e=s.stepBackward(),l){if(l.type.indexOf("tag-name")!==-1){if(n===l.value)if(e.value==="<"){if(i++,i>0){var S=new k(t,r,t,o),y=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);do l=s.stepForward();while(l&&l.value!==">");var m=new k(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1)}}else e.value===""){for(var b=0,p=e;p;){if(p.type.indexOf("tag-name")!==-1&&p.value===n){i--;break}else if(p.value==="<")break;p=s.stepBackward(),b++}for(var w=0;wu&&(this.$docRowCache.splice(u,h),this.$screenRowCache.splice(u,h))},f.prototype.$getRowCacheIndex=function(a,h){for(var u=0,g=a.length-1;u<=g;){var A=u+g>>1,L=a[A];if(h>L)u=A+1;else if(h=h));L++);return g=u[L],g?(g.index=L,g.start=A-g.value.length,g):null},f.prototype.setUndoManager=function(a){if(this.$undoManager=a,this.$informUndoManager&&this.$informUndoManager.cancel(),a){var h=this;a.addSession(this),this.$syncInformUndoManager=function(){h.$informUndoManager.cancel(),h.mergeUndoDeltas=!1},this.$informUndoManager=k.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},f.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},f.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},f.prototype.getTabString=function(){return this.getUseSoftTabs()?k.stringRepeat(" ",this.getTabSize()):" "},f.prototype.setUseSoftTabs=function(a){this.setOption("useSoftTabs",a)},f.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},f.prototype.setTabSize=function(a){this.setOption("tabSize",a)},f.prototype.getTabSize=function(){return this.$tabSize},f.prototype.isTabStop=function(a){return this.$useSoftTabs&&a.column%this.$tabSize==0},f.prototype.setNavigateWithinSoftTabs=function(a){this.setOption("navigateWithinSoftTabs",a)},f.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},f.prototype.setOverwrite=function(a){this.setOption("overwrite",a)},f.prototype.getOverwrite=function(){return this.$overwrite},f.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},f.prototype.addGutterDecoration=function(a,h){this.$decorations[a]||(this.$decorations[a]=""),this.$decorations[a]+=" "+h,this._signal("changeBreakpoint",{})},f.prototype.removeGutterDecoration=function(a,h){this.$decorations[a]=(this.$decorations[a]||"").replace(" "+h,""),this._signal("changeBreakpoint",{})},f.prototype.getBreakpoints=function(){return this.$breakpoints},f.prototype.setBreakpoints=function(a){this.$breakpoints=[];for(var h=0;h0&&(g=!!u.charAt(h-1).match(this.tokenRe)),g||(g=!!u.charAt(h).match(this.tokenRe)),g)var A=this.tokenRe;else if(/^\s+$/.test(u.slice(h-1,h+1)))var A=/\s/;else var A=this.nonTokenRe;var L=h;if(L>0){do L--;while(L>=0&&u.charAt(L).match(A));L++}for(var M=h;Ma&&(a=h.screenWidth)}),this.lineWidgetWidth=a},f.prototype.$computeWidth=function(a){if(this.$modified||a){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var h=this.doc.getAllLines(),u=this.$rowLengthCache,g=0,A=0,L=this.$foldData[A],M=L?L.start.row:Infinity,T=h.length,I=0;IM){if(I=L.end.row+1,I>=T)break;L=this.$foldData[A++],M=L?L.start.row:Infinity}u[I]==null&&(u[I]=this.$getStringScreenWidth(h[I])[0]),u[I]>g&&(g=u[I])}this.screenWidth=g}},f.prototype.getLine=function(a){return this.doc.getLine(a)},f.prototype.getLines=function(a,h){return this.doc.getLines(a,h)},f.prototype.getLength=function(){return this.doc.getLength()},f.prototype.getTextRange=function(a){return this.doc.getTextRange(a||this.selection.getRange())},f.prototype.insert=function(a,h){return this.doc.insert(a,h)},f.prototype.remove=function(a){return this.doc.remove(a)},f.prototype.removeFullLines=function(a,h){return this.doc.removeFullLines(a,h)},f.prototype.undoChanges=function(a,h){if(!!a.length){this.$fromUndo=!0;for(var u=a.length-1;u!=-1;u--){var g=a[u];g.action=="insert"||g.action=="remove"?this.doc.revertDelta(g):g.folds&&this.addFolds(g.folds)}!h&&this.$undoSelect&&(a.selectionBefore?this.selection.fromJSON(a.selectionBefore):this.selection.setRange(this.$getUndoSelection(a,!0))),this.$fromUndo=!1}},f.prototype.redoChanges=function(a,h){if(!!a.length){this.$fromUndo=!0;for(var u=0;ua.end.column&&(L.start.column+=T),L.end.row==a.end.row&&L.end.column>a.end.column&&(L.end.column+=T)),M&&L.start.row>=a.end.row&&(L.start.row+=M,L.end.row+=M)}if(L.end=this.insert(L.start,g),A.length){var I=a.start,F=L.start,M=F.row-I.row,T=F.column-I.column;this.addFolds(A.map(function(O){return O=O.clone(),O.start.row==I.row&&(O.start.column+=T),O.end.row==I.row&&(O.end.column+=T),O.start.row+=M,O.end.row+=M,O}))}return L},f.prototype.indentRows=function(a,h,u){u=u.replace(/\t/g,this.getTabString());for(var g=a;g<=h;g++)this.doc.insertInLine({row:g,column:0},u)},f.prototype.outdentRows=function(a){for(var h=a.collapseRows(),u=new i(0,0,0,0),g=this.getTabSize(),A=h.start.row;A<=h.end.row;++A){var L=this.getLine(A);u.start.row=A,u.end.row=A;for(var M=0;M0){var g=this.getRowFoldEnd(h+u);if(g>this.doc.getLength()-1)return 0;var A=g-h}else{a=this.$clipRowToDocument(a),h=this.$clipRowToDocument(h);var A=h-a+1}var L=new i(a,0,h,Number.MAX_VALUE),M=this.getFoldsInRange(L).map(function(I){return I=I.clone(),I.start.row+=A,I.end.row+=A,I}),T=u==0?this.doc.getLines(a,h):this.doc.removeFullLines(a,h);return this.doc.insertFullLines(a+A,T),M.length&&this.addFolds(M),A},f.prototype.moveLinesUp=function(a,h){return this.$moveLines(a,h,-1)},f.prototype.moveLinesDown=function(a,h){return this.$moveLines(a,h,1)},f.prototype.duplicateLines=function(a,h){return this.$moveLines(a,h,0)},f.prototype.$clipRowToDocument=function(a){return Math.max(0,Math.min(a,this.doc.getLength()-1))},f.prototype.$clipColumnToRow=function(a,h){return h<0?0:Math.min(this.doc.getLine(a).length,h)},f.prototype.$clipPositionToDocument=function(a,h){if(h=Math.max(0,h),a<0)a=0,h=0;else{var u=this.doc.getLength();a>=u?(a=u-1,h=this.doc.getLine(u-1).length):h=Math.min(this.doc.getLine(a).length,h)}return{row:a,column:h}},f.prototype.$clipRangeToDocument=function(a){a.start.row<0?(a.start.row=0,a.start.column=0):a.start.column=this.$clipColumnToRow(a.start.row,a.start.column);var h=this.doc.getLength()-1;return a.end.row>h?(a.end.row=h,a.end.column=this.doc.getLine(h).length):a.end.column=this.$clipColumnToRow(a.end.row,a.end.column),a},f.prototype.setUseWrapMode=function(a){if(a!=this.$useWrapMode){if(this.$useWrapMode=a,this.$modified=!0,this.$resetRowCache(0),a){var h=this.getLength();this.$wrapData=Array(h),this.$updateWrapData(0,h-1)}this._signal("changeWrapMode")}},f.prototype.getUseWrapMode=function(){return this.$useWrapMode},f.prototype.setWrapLimitRange=function(a,h){(this.$wrapLimitRange.min!==a||this.$wrapLimitRange.max!==h)&&(this.$wrapLimitRange={min:a,max:h},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},f.prototype.adjustWrapLimit=function(a,h){var u=this.$wrapLimitRange;u.max<0&&(u={min:h,max:h});var g=this.$constrainWrapLimit(a,u.min,u.max);return g!=this.$wrapLimit&&g>1?(this.$wrapLimit=g,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},f.prototype.$constrainWrapLimit=function(a,h,u){return h&&(a=Math.max(h,a)),u&&(a=Math.min(u,a)),a},f.prototype.getWrapLimit=function(){return this.$wrapLimit},f.prototype.setWrapLimit=function(a){this.setWrapLimitRange(a,a)},f.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},f.prototype.$updateInternalDataOnChange=function(a){var h=this.$useWrapMode,u=a.action,g=a.start,A=a.end,L=g.row,M=A.row,T=M-L,I=null;if(this.$updating=!0,T!=0)if(u==="remove"){this[h?"$wrapData":"$rowLengthCache"].splice(L,T);var F=this.$foldData;I=this.getFoldsInRange(a),this.removeFolds(I);var _=this.getFoldLine(A.row),W=0;if(_){_.addRemoveChars(A.row,A.column,g.column-A.column),_.shiftRow(-T);var O=this.getFoldLine(L);O&&O!==_&&(O.merge(_),_=O),W=F.indexOf(_)+1}for(W;W=A.row&&_.shiftRow(-T)}M=L}else{var B=Array(T);B.unshift(L,0);var H=h?this.$wrapData:this.$rowLengthCache;H.splice.apply(H,B);var F=this.$foldData,_=this.getFoldLine(L),W=0;if(_){var z=_.range.compareInside(g.row,g.column);z==0?(_=_.split(g.row,g.column),_&&(_.shiftRow(T),_.addRemoveChars(M,0,A.column-g.column))):z==-1&&(_.addRemoveChars(L,0,A.column-g.column),_.shiftRow(T)),W=F.indexOf(_)+1}for(W;W=L&&_.shiftRow(T)}}else{T=Math.abs(a.start.column-a.end.column),u==="remove"&&(I=this.getFoldsInRange(a),this.removeFolds(I),T=-T);var _=this.getFoldLine(L);_&&_.addRemoveChars(L,g.column,T)}return h&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,h?this.$updateWrapData(L,M):this.$updateRowLengthCache(L,M),I},f.prototype.$updateRowLengthCache=function(a,h,u){this.$rowLengthCache[a]=null,this.$rowLengthCache[h]=null},f.prototype.$updateWrapData=function(a,h){var u=this.doc.getAllLines(),g=this.getTabSize(),A=this.$wrapData,L=this.$wrapLimit,M,T,I=a;for(h=Math.min(h,u.length-1);I<=h;)T=this.getFoldLine(I,T),T?(M=[],T.walk(function(F,_,W,O){var B;if(F!=null){B=this.$getDisplayTokens(F,M.length),B[0]=S;for(var H=1;Hh-O;){var B=L+h-O;if(a[B-1]>=b&&a[B]>=b){W(B);continue}if(a[B]==S||a[B]==y){for(B;B!=L-1&&a[B]!=S;B--);if(B>L){W(B);continue}for(B=L+h,B;B>2)),L-1);B>H&&a[B]H&&a[B]H&&a[B]==m;)B--}else for(;B>H&&a[B]H){W(++B);continue}B=L+h,a[B]==$&&B--,W(B-O)}return g},f.prototype.$getDisplayTokens=function(a,h){var u=[],g;h=h||0;for(var A=0;A39&&L<48||L>57&&L<64?u.push(m):L>=4352&&v(L)?u.push(d,$):u.push(d)}return u},f.prototype.$getStringScreenWidth=function(a,h,u){if(h==0)return[0,0];h==null&&(h=Infinity),u=u||0;var g,A;for(A=0;A=4352&&v(g)?u+=2:u+=1,!(u>h));A++);return[u,A]},f.prototype.getRowLength=function(a){var h=1;return this.lineWidgets&&(h+=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0),!this.$useWrapMode||!this.$wrapData[a]?h:this.$wrapData[a].length+h},f.prototype.getRowLineCount=function(a){return!this.$useWrapMode||!this.$wrapData[a]?1:this.$wrapData[a].length+1},f.prototype.getRowWrapIndent=function(a){if(this.$useWrapMode){var h=this.screenToDocumentPosition(a,Number.MAX_VALUE),u=this.$wrapData[h.row];return u.length&&u[0]=0)var T=F[_],A=this.$docRowCache[_],O=a>F[W-1];else var O=!W;for(var B=this.getLength()-1,H=this.getNextFoldLine(A),z=H?H.start.row:Infinity;T<=a&&(I=this.getRowLength(A),!(T+I>a||A>=B));)T+=I,A++,A>z&&(A=H.end.row+1,H=this.getNextFoldLine(A,H),z=H?H.start.row:Infinity),O&&(this.$docRowCache.push(A),this.$screenRowCache.push(T));if(H&&H.start.row<=A)g=this.getFoldDisplayLine(H),A=H.start.row;else{if(T+I<=a||A>B)return{row:B,column:this.getLine(B).length};g=this.getLine(A),H=null}var Y=0,Z=Math.floor(a-T);if(this.$useWrapMode){var N=this.$wrapData[A];N&&(M=N[Z],Z>0&&N.length&&(Y=N.indent,L=N[Z-1]||N[N.length-1],g=g.substring(L)))}return u!==void 0&&this.$bidiHandler.isBidiRow(T+Z,A,Z)&&(h=this.$bidiHandler.offsetToCol(u)),L+=this.$getStringScreenWidth(g,h-Y)[1],this.$useWrapMode&&L>=M&&(L=M-1),H?H.idxToPosition(L):{row:A,column:L}},f.prototype.documentToScreenPosition=function(a,h){if(typeof h=="undefined")var u=this.$clipPositionToDocument(a.row,a.column);else u=this.$clipPositionToDocument(a,h);a=u.row,h=u.column;var g=0,A=null,L=null;L=this.getFoldAt(a,h,1),L&&(a=L.start.row,h=L.start.column);var M,T=0,I=this.$docRowCache,F=this.$getRowCacheIndex(I,a),_=I.length;if(_&&F>=0)var T=I[F],g=this.$screenRowCache[F],W=a>I[_-1];else var W=!_;for(var O=this.getNextFoldLine(T),B=O?O.start.row:Infinity;T=B){if(M=O.end.row+1,M>a)break;O=this.getNextFoldLine(M,O),B=O?O.start.row:Infinity}else M=T+1;g+=this.getRowLength(T),T=M,W&&(this.$docRowCache.push(T),this.$screenRowCache.push(g))}var H="";O&&T>=B?(H=this.getFoldDisplayLine(O,a,h),A=O.start.row):(H=this.getLine(a).substring(0,h),A=a);var z=0;if(this.$useWrapMode){var Y=this.$wrapData[A];if(Y){for(var Z=0;H.length>=Y[Z];)g++,Z++;H=H.substring(Y[Z-1]||0,H.length),z=Z>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[T]&&this.lineWidgets[T].rowsAbove&&(g+=this.lineWidgets[T].rowsAbove),{row:g,column:z+this.$getStringScreenWidth(H)[0]}},f.prototype.documentToScreenColumn=function(a,h){return this.documentToScreenPosition(a,h).column},f.prototype.documentToScreenRow=function(a,h){return this.documentToScreenPosition(a,h).row},f.prototype.getScreenLength=function(){var a=0,h=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,L=0,g=0,h=this.$foldData[g++],M=h?h.start.row:Infinity;LM&&(L=h.end.row+1,h=this.$foldData[g++],M=h?h.start.row:Infinity)}else{a=this.getLength();for(var u=this.$foldData,g=0;gu));L++);return[g,L]})},f.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},f}();c.$uid=0,c.prototype.$modes=s.$modes,c.prototype.getValue=c.prototype.toString,c.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},c.prototype.$overwrite=!1,c.prototype.$mode=null,c.prototype.$modeId=null,c.prototype.$scrollTop=0,c.prototype.$scrollLeft=0,c.prototype.$wrapLimit=80,c.prototype.$useWrapMode=!1,c.prototype.$wrapLimitRange={min:null,max:null},c.prototype.lineWidgets=null,c.prototype.isFullWidth=v,R.implement(c.prototype,l);var d=1,$=2,S=3,y=4,m=9,b=10,p=11,w=12;function v(f){return f<4352?!1:f>=4352&&f<=4447||f>=4515&&f<=4519||f>=4602&&f<=4607||f>=9001&&f<=9002||f>=11904&&f<=11929||f>=11931&&f<=12019||f>=12032&&f<=12245||f>=12272&&f<=12283||f>=12288&&f<=12350||f>=12353&&f<=12438||f>=12441&&f<=12543||f>=12549&&f<=12589||f>=12593&&f<=12686||f>=12688&&f<=12730||f>=12736&&f<=12771||f>=12784&&f<=12830||f>=12832&&f<=12871||f>=12880&&f<=13054||f>=13056&&f<=19903||f>=19968&&f<=42124||f>=42128&&f<=42182||f>=43360&&f<=43388||f>=44032&&f<=55203||f>=55216&&f<=55238||f>=55243&&f<=55291||f>=63744&&f<=64255||f>=65040&&f<=65049||f>=65072&&f<=65106||f>=65108&&f<=65126||f>=65128&&f<=65131||f>=65281&&f<=65376||f>=65504&&f<=65510}E("./edit_session/folding").Folding.call(c.prototype),E("./edit_session/bracket_match").BracketMatch.call(c.prototype),s.defineOptions(c.prototype,"session",{wrap:{set:function(f){if(!f||f=="off"?f=!1:f=="free"?f=!0:f=="printMargin"?f=-1:typeof f=="string"&&(f=parseInt(f,10)||!1),this.$wrap!=f)if(this.$wrap=f,!f)this.setUseWrapMode(!1);else{var a=typeof f=="number"?f:null;this.setWrapLimitRange(a,a),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(f){f=f=="auto"?this.$mode.type!="text":f!="text",f!=this.$wrapAsCode&&(this.$wrapAsCode=f,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(f){this.$useWorker=f,this.$stopWorker(),f&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(f){f=parseInt(f),f>0&&this.$tabSize!==f&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=f,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(f){this.setFoldStyle(f)},handlesSet:!0},overwrite:{set:function(f){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(f){this.doc.setNewLineMode(f)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(f){this.setMode(f)},get:function(){return this.$modeId},handlesSet:!0}}),x.EditSession=c}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(E,x,P){"use strict";var R=E("./lib/lang"),k=E("./lib/oop"),C=E("./range").Range,s=function(){function e(){this.$options={}}return e.prototype.set=function(n){return k.mixin(this.$options,n),this},e.prototype.getOptions=function(){return R.copyObject(this.$options)},e.prototype.setOptions=function(n){this.$options=n},e.prototype.find=function(n){var i=this.$options,t=this.$matchIterator(n,i);if(!t)return!1;var r=null;return t.forEach(function(o,c,d,$){return r=new C(o,c,d,$),c==$&&i.start&&i.start.start&&i.skipCurrent!=!1&&r.isEqual(i.start)?(r=null,!1):!0}),r},e.prototype.findAll=function(n){var i=this.$options;if(!i.needle)return[];this.$assembleRegExp(i);var t=i.range,r=t?n.getLines(t.start.row,t.end.row):n.doc.getAllLines(),o=[],c=i.re;if(i.$isMultiLine){var d=c.length,$=r.length-d,S;e:for(var y=c.offset||0;y<=$;y++){for(var m=0;mw||(o.push(S=new C(y,w,y+d-1,v)),d>2&&(y=y+d-2))}}else for(var f=0;fg&&o[m].end.row==A;)m--;for(o=o.slice(f,m+1),f=0,m=o.length;f=$;w--)if(b(w,Number.MAX_VALUE,p))return;if(i.wrap!=!1){for(w=S,$=d.row;w>=$;w--)if(b(w,Number.MAX_VALUE,p))return}}};else var y=function(w){var v=d.row;if(!b(v,d.column,w)){for(v=v+1;v<=S;v++)if(b(v,0,w))return;if(i.wrap!=!1){for(v=$,S=d.row;v<=S;v++)if(b(v,0,w))return}}};if(i.$isMultiLine)var m=t.length,b=function(p,w,v){var f=r?p-m+1:p;if(!(f<0||f+m>n.getLength())){var a=n.getLine(f),h=a.search(t[0]);if(!(!r&&hw)&&v(f,h,f+m-1,g))return!0}}};else if(r)var b=function(w,v,f){var a=n.getLine(w),h=[],u,g=0;for(t.lastIndex=0;u=t.exec(a);){var A=u[0].length;if(g=u.index,!A){if(g>=a.length)break;t.lastIndex=g+=1}if(u.index+A>v)break;h.push(u.index,A)}for(var L=h.length-1;L>=0;L-=2){var M=h[L-1],A=h[L];if(f(w,M,w,M+A))return!0}};else var b=function(w,v,f){var a=n.getLine(w),h,u;for(t.lastIndex=v;u=t.exec(a);){var g=u[0].length;if(h=u.index,f(w,h,w,h+g))return!0;if(!g&&(t.lastIndex=h+=1,h>=a.length))return!1}};return{forEach:y}},e}();function l(e,n){function i(t){return/\w/.test(t)||n.regExp?"\\b":""}return i(e[0])+e+i(e[e.length-1])}x.Search=s}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("../lib/keys"),k=E("../lib/useragent"),C=R.KEY_MODS;function s(e,n){this.platform=n||(k.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function l(e,n){s.call(this,e,n),this.$singleCommand=!1}l.prototype=s.prototype,function(){this.addCommand=function(n){this.commands[n.name]&&this.removeCommand(n),this.commands[n.name]=n,n.bindKey&&this._buildKeyHash(n)},this.removeCommand=function(n,i){var t=n&&(typeof n=="string"?n:n.name);n=this.commands[t],i||delete this.commands[t];var r=this.commandKeyBinding;for(var o in r){var c=r[o];if(c==n)delete r[o];else if(Array.isArray(c)){var d=c.indexOf(n);d!=-1&&(c.splice(d,1),c.length==1&&(r[o]=c[0]))}}},this.bindKey=function(n,i,t){if(typeof n=="object"&&n&&(t==null&&(t=n.position),n=n[this.platform]),!!n){if(typeof i=="function")return this.addCommand({exec:i,bindKey:n,name:i.name||n});n.split("|").forEach(function(r){var o="";if(r.indexOf(" ")!=-1){var c=r.split(/\s+/);r=c.pop(),c.forEach(function(S){var y=this.parseKeys(S),m=C[y.hashId]+y.key;o+=(o?" ":"")+m,this._addCommandToBinding(o,"chainKeys")},this),o+=" "}var d=this.parseKeys(r),$=C[d.hashId]+d.key;this._addCommandToBinding(o+$,i,t)},this)}};function e(n){return typeof n=="object"&&n.bindKey&&n.bindKey.position||(n.isDefault?-100:0)}this._addCommandToBinding=function(n,i,t){var r=this.commandKeyBinding,o;if(!i)delete r[n];else if(!r[n]||this.$singleCommand)r[n]=i;else{Array.isArray(r[n])?(o=r[n].indexOf(i))!=-1&&r[n].splice(o,1):r[n]=[r[n]],typeof t!="number"&&(t=e(i));var c=r[n];for(o=0;ot)break}c.splice(o,0,i)}},this.addCommands=function(n){n&&Object.keys(n).forEach(function(i){var t=n[i];if(!!t){if(typeof t=="string")return this.bindKey(t,i);typeof t=="function"&&(t={exec:t}),typeof t=="object"&&(t.name||(t.name=i),this.addCommand(t))}},this)},this.removeCommands=function(n){Object.keys(n).forEach(function(i){this.removeCommand(n[i])},this)},this.bindKeys=function(n){Object.keys(n).forEach(function(i){this.bindKey(i,n[i])},this)},this._buildKeyHash=function(n){this.bindKey(n.bindKey,n)},this.parseKeys=function(n){var i=n.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),t=i.pop(),r=R[t];if(R.FUNCTION_KEYS[r])t=R.FUNCTION_KEYS[r].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:t.toUpperCase(),hashId:-1}}else return{key:t,hashId:-1};for(var o=0,c=i.length;c--;){var d=R.KEY_MODS[i[c]];if(d==null)return typeof console!="undefined"&&console.error("invalid modifier "+i[c]+" in "+n),!1;o|=d}return{key:t,hashId:o}},this.findKeyCommand=function(i,t){var r=C[i]+t;return this.commandKeyBinding[r]},this.handleKeyboard=function(n,i,t,r){if(!(r<0)){var o=C[i]+t,c=this.commandKeyBinding[o];return n.$keyChain&&(n.$keyChain+=" "+o,c=this.commandKeyBinding[n.$keyChain]||c),c&&(c=="chainKeys"||c[c.length-1]=="chainKeys")?(n.$keyChain=n.$keyChain||o,{command:"null"}):(n.$keyChain&&((!i||i==4)&&t.length==1?n.$keyChain=n.$keyChain.slice(0,-o.length-1):(i==-1||r>0)&&(n.$keyChain="")),{command:c})}},this.getStatusText=function(n,i){return i.$keyChain||""}}.call(s.prototype),x.HashHandler=s,x.MultiHashHandler=l}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=this&&this.__extends||function(){var e=function(n,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])},e(n,i)};return function(n,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");e(n,i);function t(){this.constructor=n}n.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),k=E("../lib/oop"),C=E("../keyboard/hash_handler").MultiHashHandler,s=E("../lib/event_emitter").EventEmitter,l=function(e){R(n,e);function n(i,t){var r=e.call(this,t,i)||this;return r.byName=r.commands,r.setDefaultHandler("exec",function(o){return o.args?o.command.exec(o.editor,o.args,o.event,!1):o.command.exec(o.editor,{},o.event,!0)}),r}return n.prototype.exec=function(i,t,r){if(Array.isArray(i)){for(var o=i.length;o--;)if(this.exec(i[o],t,r))return!0;return!1}if(typeof i=="string"&&(i=this.commands[i]),!i||t&&t.$readOnly&&!i.readOnly||this.$checkCommandState!=!1&&i.isAvailable&&!i.isAvailable(t))return!1;var c={editor:t,command:i,args:r};return c.returnValue=this._emit("exec",c),this._signal("afterExec",c),c.returnValue!==!1},n.prototype.toggleRecording=function(i){if(!this.$inReplay)return i&&i._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(t){this.macro.push([t.command,t.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},n.prototype.replay=function(i){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(i);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,i):this.exec(t[0],i,t[1])},this)}finally{this.$inReplay=!1}}},n.prototype.trimMacro=function(i){return i.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},n}(C);k.implement(l.prototype,s),x.CommandManager=l}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(E,x,P){"use strict";var R=E("../lib/lang"),k=E("../config"),C=E("../range").Range;function s(e,n){return{win:e,mac:n}}x.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){k.loadModule("ace/ext/settings_menu",function(n){n.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){k.loadModule("ace/ext/error_marker",function(n){n.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){k.loadModule("ace/ext/error_marker",function(n){n.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,n){typeof n=="number"&&!isNaN(n)&&e.gotoLine(n),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){k.loadModule("ace/ext/searchbox",function(n){n.Search(e)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,n){e.navigateUp(n.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,n){e.navigateDown(n.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,n){e.navigateLeft(n.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,n){e.navigateRight(n.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var n=e.$copyWithEmptySelection&&e.selection.isEmpty(),i=n?e.selection.getLineRange():e.selection.getRange();e._emit("cut",i),i.isEmpty()||e.session.remove(i),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,n){e.$handlePaste(n)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){k.loadModule("ace/ext/searchbox",function(n){n.Search(e,!0)})}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty())e.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var n=e.selection.getRange();n.start.column=0,e.session.remove(n)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var n=e.selection.getRange();n.end.column=Number.MAX_VALUE,e.session.remove(n)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,n){e.insert(n)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,n){e.insert(R.stringRepeat(n.text||"",n.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var n=e.selection.getRange();n.start.column=n.end.column=0,n.end.row++,e.selection.setRange(n,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var n=e.selection.isBackwards(),i=n?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),t=n?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(i.row).length,o=e.session.doc.getTextRange(e.selection.getRange()),c=o.replace(/\n\s*/," ").length,d=e.session.doc.getLine(i.row),$=i.row+1;$<=t.row+1;$++){var S=R.stringTrimLeft(R.stringTrimRight(e.session.doc.getLine($)));S.length!==0&&(S=" "+S),d+=S}t.row+10?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+c)):(r=e.session.doc.getLine(i.row).length>r?r+1:r,e.selection.moveCursorTo(i.row,r))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var n=e.session.doc.getLength()-1,i=e.session.doc.getLine(n).length,t=e.selection.rangeList.ranges,r=[];t.length<1&&(t=[e.selection.getRange()]);for(var o=0;ol[e].column&&e++,t.unshift(e,0),l.splice.apply(l,t),this.$updateRows()}}},C.prototype.$updateRows=function(){var s=this.session.lineWidgets;if(!!s){var l=!0;s.forEach(function(e,n){if(e)for(l=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget}),l&&(this.session.lineWidgets=null)}},C.prototype.$registerLineWidget=function(s){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var l=this.session.lineWidgets[s.row];return l&&(s.$oldWidget=l,l.el&&l.el.parentNode&&(l.el.parentNode.removeChild(l.el),l._inDocument=!1)),this.session.lineWidgets[s.row]=s,s},C.prototype.addLineWidget=function(s){if(this.$registerLineWidget(s),s.session=this.session,!this.editor)return s;var l=this.editor.renderer;s.html&&!s.el&&(s.el=R.createElement("div"),s.el.innerHTML=s.html),s.text&&!s.el&&(s.el=R.createElement("div"),s.el.textContent=s.text),s.el&&(R.addCssClass(s.el,"ace_lineWidgetContainer"),s.className&&R.addCssClass(s.el,s.className),s.el.style.position="absolute",s.el.style.zIndex=5,l.container.appendChild(s.el),s._inDocument=!0,s.coverGutter||(s.el.style.zIndex=3),s.pixelHeight==null&&(s.pixelHeight=s.el.offsetHeight)),s.rowCount==null&&(s.rowCount=s.pixelHeight/l.layerConfig.lineHeight);var e=this.session.getFoldAt(s.row,0);if(s.$fold=e,e){var n=this.session.lineWidgets;s.row==e.end.row&&!n[e.start.row]?n[e.start.row]=s:s.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows(),this.renderWidgets(null,l),this.onWidgetChanged(s),s},C.prototype.removeLineWidget=function(s){if(s._inDocument=!1,s.session=null,s.el&&s.el.parentNode&&s.el.parentNode.removeChild(s.el),s.editor&&s.editor.destroy)try{s.editor.destroy()}catch(e){}if(this.session.lineWidgets){var l=this.session.lineWidgets[s.row];if(l==s)this.session.lineWidgets[s.row]=s.$oldWidget,s.$oldWidget&&this.onWidgetChanged(s.$oldWidget);else for(;l;){if(l.$oldWidget==s){l.$oldWidget=s.$oldWidget;break}l=l.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows()},C.prototype.getWidgetsAtRow=function(s){for(var l=this.session.lineWidgets,e=l&&l[s],n=[];e;)n.push(e),e=e.$oldWidget;return n},C.prototype.onWidgetChanged=function(s){this.session._changedWidgets.push(s),this.editor&&this.editor.renderer.updateFull()},C.prototype.measureWidgets=function(s,l){var e=this.session._changedWidgets,n=l.layerConfig;if(!(!e||!e.length)){for(var i=Infinity,t=0;t0&&!n[i];)i--;this.firstRow=e.firstRow,this.lastRow=e.lastRow,l.$cursorLayer.config=e;for(var r=i;r<=t;r++){var o=n[r];if(!(!o||!o.el)){if(o.hidden){o.el.style.top=-100-(o.pixelHeight||0)+"px";continue}o._inDocument||(o._inDocument=!0,l.container.appendChild(o.el));var c=l.$cursorLayer.getPixelPosition({row:r,column:0},!0).top;o.coverLine||(c+=e.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=c-e.offset+"px";var d=o.coverGutter?0:l.gutterWidth;o.fixedWidth||(d-=l.scrollLeft),o.el.style.left=d+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=e.width+2*e.padding+"px"),o.fixedWidth?o.el.style.right=l.scrollBar.getWidth()+"px":o.el.style.right=""}}}},C}();x.LineWidgets=k}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/clipboard","ace/lib/keys"],function(E,x,P){"use strict";var R=this&&this.__values||function(a){var h=typeof Symbol=="function"&&Symbol.iterator,u=h&&a[h],g=0;if(u)return u.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&g>=a.length&&(a=void 0),{value:a&&a[g++],done:!a}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")},k=E("./lib/oop"),C=E("./lib/dom"),s=E("./lib/lang"),l=E("./lib/useragent"),e=E("./keyboard/textinput").TextInput,n=E("./mouse/mouse_handler").MouseHandler,i=E("./mouse/fold_handler").FoldHandler,t=E("./keyboard/keybinding").KeyBinding,r=E("./edit_session").EditSession,o=E("./search").Search,c=E("./range").Range,d=E("./lib/event_emitter").EventEmitter,$=E("./commands/command_manager").CommandManager,S=E("./commands/default_commands").commands,y=E("./config"),m=E("./token_iterator").TokenIterator,b=E("./line_widgets").LineWidgets,p=E("./clipboard"),w=E("./lib/keys"),v=function(){function a(h,u,g){this.$toDestroy=[];var A=h.getContainerElement();this.container=A,this.renderer=h,this.id="editor"+ ++a.$uid,this.commands=new $(l.isMac?"mac":"win",S),typeof document=="object"&&(this.textInput=new e(h.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new n(this),new i(this)),this.keyBinding=new t(this),this.$search=new o().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",function(L,M){M._$emitInputEvent.schedule(31)}),this.setSession(u||g&&g.session||new r("")),y.resetOptions(this),g&&this.setOptions(g),y._signal("editor",this)}return a.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},a.prototype.startOperation=function(h){if(this.curOp){if(!h||this.curOp.command)return;this.prevOp=this.curOp}h||(this.previousCommand=null,h={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:h.command||{},args:h.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},a.prototype.endOperation=function(h){if(this.curOp&&this.session){if(h&&h.returnValue===!1||!this.session)return this.curOp=null;if(h==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var u=this.curOp.command,g=u&&u.scrollIntoView;if(g){switch(g){case"center-animate":g="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var A=this.selection.getRange(),L=this.renderer.layerConfig;(A.start.row>=L.lastRow||A.end.row<=L.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}g=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var M=this.selection.toJSON();this.curOp.selectionAfter=M,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(M),this.prevOp=this.curOp,this.curOp=null}},a.prototype.$historyTracker=function(h){if(!!this.$mergeUndoDeltas){var u=this.prevOp,g=this.$mergeableCommands,A=u.command&&h.command.name==u.command.name;if(h.command.name=="insertstring"){var L=h.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),A=A&&this.mergeNextCommand&&(!/\s/.test(L)||/\s/.test(u.args)),this.mergeNextCommand=!0}else A=A&&g.indexOf(h.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(A=!1),A?this.session.mergeUndoDeltas=!0:g.indexOf(h.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},a.prototype.setKeyboardHandler=function(h,u){if(h&&typeof h=="string"&&h!="ace"){this.$keybindingId=h;var g=this;y.loadModule(["keybinding",h],function(A){g.$keybindingId==h&&g.keyBinding.setKeyboardHandler(A&&A.handler),u&&u()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(h),u&&u()},a.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},a.prototype.setSession=function(h){if(this.session!=h){this.curOp&&this.endOperation(),this.curOp={};var u=this.session;if(u){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var g=this.session.getSelection();g.off("changeCursor",this.$onCursorChange),g.off("changeSelection",this.$onSelectionChange)}this.session=h,h?(this.$onDocumentChange=this.onDocumentChange.bind(this),h.on("change",this.$onDocumentChange),this.renderer.setSession(h),this.$onChangeMode=this.onChangeMode.bind(this),h.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),h.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),h.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),h.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),h.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),h.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=h.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(h)),this._signal("changeSession",{session:h,oldSession:u}),this.curOp=null,u&&u._signal("changeEditor",{oldEditor:this}),h&&h._signal("changeEditor",{editor:this}),h&&!h.destroyed&&h.bgTokenizer.scheduleStart()}},a.prototype.getSession=function(){return this.session},a.prototype.setValue=function(h,u){return this.session.doc.setValue(h),u?u==1?this.navigateFileEnd():u==-1&&this.navigateFileStart():this.selectAll(),h},a.prototype.getValue=function(){return this.session.getValue()},a.prototype.getSelection=function(){return this.selection},a.prototype.resize=function(h){this.renderer.onResize(h)},a.prototype.setTheme=function(h,u){this.renderer.setTheme(h,u)},a.prototype.getTheme=function(){return this.renderer.getTheme()},a.prototype.setStyle=function(h){this.renderer.setStyle(h)},a.prototype.unsetStyle=function(h){this.renderer.unsetStyle(h)},a.prototype.getFontSize=function(){return this.getOption("fontSize")||C.computedStyle(this.container).fontSize},a.prototype.setFontSize=function(h){this.setOption("fontSize",h)},a.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var h=this;this.$highlightPending=!0,setTimeout(function(){h.$highlightPending=!1;var u=h.session;if(!(!u||u.destroyed)){u.$bracketHighlight&&(u.$bracketHighlight.markerIds.forEach(function(W){u.removeMarker(W)}),u.$bracketHighlight=null);var g=h.getCursorPosition(),A=h.getKeyboardHandler(),L=A&&A.$getDirectionForHighlight&&A.$getDirectionForHighlight(h),M=u.getMatchingBracketRanges(g,L);if(!M){var T=new m(u,g.row,g.column),I=T.getCurrentToken();if(I&&/\b(?:tag-open|tag-name)/.test(I.type)){var F=u.getMatchingTags(g);F&&(M=[F.openTagName,F.closeTagName])}}if(!M&&u.$mode.getMatching&&(M=u.$mode.getMatching(h.session)),!M){h.getHighlightIndentGuides()&&h.renderer.$textLayer.$highlightIndentGuide();return}var _="ace_bracket";Array.isArray(M)?M.length==1&&(_="ace_error_bracket"):M=[M],M.length==2&&(c.comparePoints(M[0].end,M[1].start)==0?M=[c.fromPoints(M[0].start,M[1].end)]:c.comparePoints(M[0].start,M[1].end)==0&&(M=[c.fromPoints(M[1].start,M[0].end)])),u.$bracketHighlight={ranges:M,markerIds:M.map(function(W){return u.addMarker(W,_,"text")})},h.getHighlightIndentGuides()&&h.renderer.$textLayer.$highlightIndentGuide()}},50)}},a.prototype.focus=function(){this.textInput.focus()},a.prototype.isFocused=function(){return this.textInput.isFocused()},a.prototype.blur=function(){this.textInput.blur()},a.prototype.onFocus=function(h){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",h))},a.prototype.onBlur=function(h){!this.$isFocused||(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",h))},a.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},a.prototype.onDocumentChange=function(h){var u=this.session.$useWrapMode,g=h.start.row==h.end.row?h.end.row:Infinity;this.renderer.updateLines(h.start.row,g,u),this._signal("change",h),this.$cursorChange()},a.prototype.onTokenizerUpdate=function(h){var u=h.data;this.renderer.updateLines(u.first,u.last)},a.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},a.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},a.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},a.prototype.$updateHighlightActiveLine=function(){var h=this.getSession(),u;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(u=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(u=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(u=!1)),h.$highlightLineMarker&&!u)h.removeMarker(h.$highlightLineMarker.id),h.$highlightLineMarker=null;else if(!h.$highlightLineMarker&&u){var g=new c(u.row,u.column,u.row,Infinity);g.id=h.addMarker(g,"ace_active-line","screenLine"),h.$highlightLineMarker=g}else u&&(h.$highlightLineMarker.start.row=u.row,h.$highlightLineMarker.end.row=u.row,h.$highlightLineMarker.start.column=u.column,h._signal("changeBackMarker"))},a.prototype.onSelectionChange=function(h){var u=this.session;if(u.$selectionMarker&&u.removeMarker(u.$selectionMarker),u.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var g=this.selection.getRange(),A=this.getSelectionStyle();u.$selectionMarker=u.addMarker(g,"ace_selection",A)}var L=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(L),this._signal("changeSelection")},a.prototype.$getSelectionHighLightRegexp=function(){var h=this.session,u=this.getSelectionRange();if(!(u.isEmpty()||u.isMultiLine())){var g=u.start.column,A=u.end.column,L=h.getLine(u.start.row),M=L.substring(g,A);if(!(M.length>5e3||!/[\w\d]/.test(M))){var T=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:M}),I=L.substring(g-1,A+1);if(!!T.test(I))return T}}},a.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},a.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},a.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},a.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},a.prototype.onChangeMode=function(h){this.renderer.updateText(),this._emit("changeMode",h)},a.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},a.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},a.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},a.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},a.prototype.getCopyText=function(){var h=this.getSelectedText(),u=this.session.doc.getNewLineCharacter(),g=!1;if(!h&&this.$copyWithEmptySelection){g=!0;for(var A=this.selection.getAllRanges(),L=0;LW.search(/\S|$/)){var I=W.substr(L.column).search(/\S|$/);g.doc.removeInLine(L.row,L.column,L.column+I)}}this.clearSelection();var F=L.column,_=g.getState(L.row),W=g.getLine(L.row),O=A.checkOutdent(_,W,h);if(g.insert(L,h),M&&M.selection&&(M.selection.length==2?this.selection.setSelectionRange(new c(L.row,F+M.selection[0],L.row,F+M.selection[1])):this.selection.setSelectionRange(new c(L.row+M.selection[0],M.selection[1],L.row+M.selection[2],M.selection[3]))),this.$enableAutoIndent){if(g.getDocument().isNewLine(h)){var B=A.getNextLineIndent(_,W.slice(0,L.column),g.getTabString());g.insert({row:L.row+1,column:0},B)}O&&A.autoOutdent(_,g,L.row)}},a.prototype.autoIndent=function(){var h=this.session,u=h.getMode(),g,A;if(this.selection.isEmpty())g=0,A=h.doc.getLength()-1;else{var L=this.getSelectionRange();g=L.start.row,A=L.end.row}for(var M="",T="",I="",F,_,W,O=h.getTabString(),B=g;B<=A;B++)B>0&&(M=h.getState(B-1),T=h.getLine(B-1),I=u.getNextLineIndent(M,T,O)),F=h.getLine(B),_=u.$getIndent(F),I!==_&&(_.length>0&&(W=new c(B,0,B,_.length),h.remove(W)),I.length>0&&h.insert({row:B,column:0},I)),u.autoOutdent(M,h,B)},a.prototype.onTextInput=function(h,u){if(!u)return this.keyBinding.onTextInput(h);this.startOperation({command:{name:"insertstring"}});var g=this.applyComposition.bind(this,h,u);this.selection.rangeCount?this.forEachSelection(g):g(),this.endOperation()},a.prototype.applyComposition=function(h,u){if(u.extendLeft||u.extendRight){var g=this.selection.getRange();g.start.column-=u.extendLeft,g.end.column+=u.extendRight,g.start.column<0&&(g.start.row--,g.start.column+=this.session.getLine(g.start.row).length+1),this.selection.setRange(g),!h&&!g.isEmpty()&&this.remove()}if((h||!this.selection.isEmpty())&&this.insert(h,!0),u.restoreStart||u.restoreEnd){var g=this.selection.getRange();g.start.column-=u.restoreStart,g.end.column-=u.restoreEnd,this.selection.setRange(g)}},a.prototype.onCommandKey=function(h,u,g){return this.keyBinding.onCommandKey(h,u,g)},a.prototype.setOverwrite=function(h){this.session.setOverwrite(h)},a.prototype.getOverwrite=function(){return this.session.getOverwrite()},a.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},a.prototype.setScrollSpeed=function(h){this.setOption("scrollSpeed",h)},a.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},a.prototype.setDragDelay=function(h){this.setOption("dragDelay",h)},a.prototype.getDragDelay=function(){return this.getOption("dragDelay")},a.prototype.setSelectionStyle=function(h){this.setOption("selectionStyle",h)},a.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},a.prototype.setHighlightActiveLine=function(h){this.setOption("highlightActiveLine",h)},a.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},a.prototype.setHighlightGutterLine=function(h){this.setOption("highlightGutterLine",h)},a.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},a.prototype.setHighlightSelectedWord=function(h){this.setOption("highlightSelectedWord",h)},a.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},a.prototype.setAnimatedScroll=function(h){this.renderer.setAnimatedScroll(h)},a.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},a.prototype.setShowInvisibles=function(h){this.renderer.setShowInvisibles(h)},a.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},a.prototype.setDisplayIndentGuides=function(h){this.renderer.setDisplayIndentGuides(h)},a.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},a.prototype.setHighlightIndentGuides=function(h){this.renderer.setHighlightIndentGuides(h)},a.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},a.prototype.setShowPrintMargin=function(h){this.renderer.setShowPrintMargin(h)},a.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},a.prototype.setPrintMarginColumn=function(h){this.renderer.setPrintMarginColumn(h)},a.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},a.prototype.setReadOnly=function(h){this.setOption("readOnly",h)},a.prototype.getReadOnly=function(){return this.getOption("readOnly")},a.prototype.setBehavioursEnabled=function(h){this.setOption("behavioursEnabled",h)},a.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},a.prototype.setWrapBehavioursEnabled=function(h){this.setOption("wrapBehavioursEnabled",h)},a.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},a.prototype.setShowFoldWidgets=function(h){this.setOption("showFoldWidgets",h)},a.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},a.prototype.setFadeFoldWidgets=function(h){this.setOption("fadeFoldWidgets",h)},a.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},a.prototype.remove=function(h){this.selection.isEmpty()&&(h=="left"?this.selection.selectLeft():this.selection.selectRight());var u=this.getSelectionRange();if(this.getBehavioursEnabled()){var g=this.session,A=g.getState(u.start.row),L=g.getMode().transformAction(A,"deletion",this,g,u);if(u.end.column===0){var M=g.getTextRange(u);if(M[M.length-1]==` `){var T=g.getLine(u.end.row);/^\s+$/.test(T)&&(u.end.column=T.length)}}L&&(u=L)}this.session.remove(u),this.clearSelection()},a.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},a.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},a.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},a.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var h=this.getSelectionRange();h.start.column==h.end.column&&h.start.row==h.end.row&&(h.end.column=0,h.end.row++),this.session.remove(h),this.clearSelection()},a.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var h=this.getCursorPosition();this.insert(` `),this.moveCursorToPosition(h)},a.prototype.setGhostText=function(h,u){this.session.widgetManager||(this.session.widgetManager=new b(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(h,u)},a.prototype.removeGhostText=function(){!this.session.widgetManager||this.renderer.removeGhostText()},a.prototype.transposeLetters=function(){if(!!this.selection.isEmpty()){var h=this.getCursorPosition(),u=h.column;if(u!==0){var g=this.session.getLine(h.row),A,L;uI.toLowerCase()?1:0});for(var L=new c(0,0,0,0),A=h.first;A<=h.last;A++){var M=u.getLine(A);L.start.row=A,L.end.row=A,L.end.column=M.length,u.replace(L,g[A-h.first])}},a.prototype.toggleCommentLines=function(){var h=this.session.getState(this.getCursorPosition().row),u=this.$getSelectedRows();this.session.getMode().toggleCommentLines(h,this.session,u.first,u.last)},a.prototype.toggleBlockComment=function(){var h=this.getCursorPosition(),u=this.session.getState(h.row),g=this.getSelectionRange();this.session.getMode().toggleBlockComment(u,this.session,g,h)},a.prototype.getNumberAt=function(h,u){var g=/[\-]?[0-9]+(?:\.[0-9]+)?/g;g.lastIndex=0;for(var A=this.session.getLine(h);g.lastIndex=u){var M={value:L[0],start:L.index,end:L.index+L[0].length};return M}}return null},a.prototype.modifyNumber=function(h){var u=this.selection.getCursor().row,g=this.selection.getCursor().column,A=new c(u,g-1,u,g),L=this.session.getTextRange(A);if(!isNaN(parseFloat(L))&&isFinite(L)){var M=this.getNumberAt(u,g);if(M){var T=M.value.indexOf(".")>=0?M.start+M.value.indexOf(".")+1:M.end,I=M.start+M.value.length-T,F=parseFloat(M.value);F*=Math.pow(10,I),T!==M.end&&g=T&&M<=I&&(g=N,F.selection.clearSelection(),F.moveCursorTo(h,T+A),F.selection.selectTo(h,I+A)),T=I});for(var _=this.$toggleWordPairs,W,O=0;O<_.length;O++)for(var B=_[O],H=0;H<=1;H++){var z=+!H,Y=g.match(new RegExp("^\\s?_?("+s.escapeRegExp(B[H])+")\\s?$","i"));if(Y){var Z=g.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(Y[1])+")($|\\s)","g"));Z&&(W=g.replace(new RegExp(s.escapeRegExp(B[H]),"i"),function(N){var U=B[z];return N.toUpperCase()==N?U=U.toUpperCase():N.charAt(0).toUpperCase()==N.charAt(0)&&(U=U.substr(0,0)+B[z].charAt(0).toUpperCase()+U.substr(1)),U}),this.insert(W),W="")}}},a.prototype.findLinkAt=function(h,u){var g,A,L=this.session.getLine(h),M=L.split(/((?:https?|ftp):\/\/[\S]+)/),T=u;T<0&&(T=0);var I=0,F=0,_;try{for(var W=R(M),O=W.next();!O.done;O=W.next()){var B=O.value;if(F=I+B.length,T>=I&&T<=F&&B.match(/((?:https?|ftp):\/\/[\S]+)/)){_=B.replace(/[\s:.,'";}\]]+$/,"");break}I=F}}catch(H){g={error:H}}finally{try{O&&!O.done&&(A=W.return)&&A.call(W)}finally{if(g)throw g.error}}return _},a.prototype.openLink=function(){var h=this.selection.getCursor(),u=this.findLinkAt(h.row,h.column);return u&&window.open(u,"_blank"),u!=null},a.prototype.removeLines=function(){var h=this.$getSelectedRows();this.session.removeFullLines(h.first,h.last),this.clearSelection()},a.prototype.duplicateSelection=function(){var h=this.selection,u=this.session,g=h.getRange(),A=h.isBackwards();if(g.isEmpty()){var L=g.start.row;u.duplicateLines(L,L)}else{var M=A?g.start:g.end,T=u.insert(M,u.getTextRange(g),!1);g.start=M,g.end=T,h.setSelectionRange(g,A)}},a.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},a.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},a.prototype.moveText=function(h,u,g){return this.session.moveText(h,u,g)},a.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},a.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},a.prototype.$moveLines=function(h,u){var g,A,L=this.selection;if(!L.inMultiSelectMode||this.inVirtualSelectionMode){var M=L.toOrientedRange();g=this.$getSelectedRows(M),A=this.session.$moveLines(g.first,g.last,u?0:h),u&&h==-1&&(A=0),M.moveBy(A,0),L.fromOrientedRange(M)}else{var T=L.rangeList.ranges;L.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var I=0,F=0,_=T.length,W=0;W<_;W++){var O=W;T[W].moveBy(I,0),g=this.$getSelectedRows(T[W]);for(var B=g.first,H=g.last;++W<_;){F&&T[W].moveBy(F,0);var z=this.$getSelectedRows(T[W]);if(u&&z.first!=H)break;if(!u&&z.first>H+1)break;H=z.last}for(W--,I=this.session.$moveLines(B,H,u?0:h),u&&h==-1&&(O=W+1);O<=W;)T[O].moveBy(I,0),O++;u||(I=0),F+=I}L.fromOrientedRange(L.ranges[0]),L.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},a.prototype.$getSelectedRows=function(h){return h=(h||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(h.start.row),last:this.session.getRowFoldEnd(h.end.row)}},a.prototype.onCompositionStart=function(h){this.renderer.showComposition(h)},a.prototype.onCompositionUpdate=function(h){this.renderer.setCompositionText(h)},a.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},a.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},a.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},a.prototype.isRowVisible=function(h){return h>=this.getFirstVisibleRow()&&h<=this.getLastVisibleRow()},a.prototype.isRowFullyVisible=function(h){return h>=this.renderer.getFirstFullyVisibleRow()&&h<=this.renderer.getLastFullyVisibleRow()},a.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},a.prototype.$moveByPage=function(h,u){var g=this.renderer,A=this.renderer.layerConfig,L=h*Math.floor(A.height/A.lineHeight);u===!0?this.selection.$moveSelection(function(){this.moveCursorBy(L,0)}):u===!1&&(this.selection.moveCursorBy(L,0),this.selection.clearSelection());var M=g.scrollTop;g.scrollBy(0,L*A.lineHeight),u!=null&&g.scrollCursorIntoView(null,.5),g.animateScrolling(M)},a.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},a.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},a.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},a.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},a.prototype.scrollPageDown=function(){this.$moveByPage(1)},a.prototype.scrollPageUp=function(){this.$moveByPage(-1)},a.prototype.scrollToRow=function(h){this.renderer.scrollToRow(h)},a.prototype.scrollToLine=function(h,u,g,A){this.renderer.scrollToLine(h,u,g,A)},a.prototype.centerSelection=function(){var h=this.getSelectionRange(),u={row:Math.floor(h.start.row+(h.end.row-h.start.row)/2),column:Math.floor(h.start.column+(h.end.column-h.start.column)/2)};this.renderer.alignCursor(u,.5)},a.prototype.getCursorPosition=function(){return this.selection.getCursor()},a.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},a.prototype.getSelectionRange=function(){return this.selection.getRange()},a.prototype.selectAll=function(){this.selection.selectAll()},a.prototype.clearSelection=function(){this.selection.clearSelection()},a.prototype.moveCursorTo=function(h,u){this.selection.moveCursorTo(h,u)},a.prototype.moveCursorToPosition=function(h){this.selection.moveCursorToPosition(h)},a.prototype.jumpToMatching=function(h,u){var g=this.getCursorPosition(),A=new m(this.session,g.row,g.column),L=A.getCurrentToken(),M=0;L&&L.type.indexOf("tag-name")!==-1&&(L=A.stepBackward());var T=L||A.stepForward();if(!!T){var I,F=!1,_={},W=g.column-T.start,O,B={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(T.value.match(/[{}()\[\]]/g)){for(;W1?_[T.value]++:L.value==="=0;--M)this.$tryReplace(g[M],h)&&A++;return this.selection.setSelectionRange(L),A},a.prototype.$tryReplace=function(h,u){var g=this.session.getTextRange(h);return u=this.$search.replace(g,u),u!==null?(h.end=this.session.replace(h,u),h):null},a.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},a.prototype.find=function(h,u,g){u||(u={}),typeof h=="string"||h instanceof RegExp?u.needle=h:typeof h=="object"&&k.mixin(u,h);var A=this.selection.getRange();u.needle==null&&(h=this.session.getTextRange(A)||this.$search.$options.needle,h||(A=this.session.getWordRange(A.start.row,A.start.column),h=this.session.getTextRange(A)),this.$search.set({needle:h})),this.$search.set(u),u.start||this.$search.set({start:A});var L=this.$search.find(this.session);if(u.preventScroll)return L;if(L)return this.revealRange(L,g),L;u.backwards?A.start=A.end:A.end=A.start,this.selection.setRange(A)},a.prototype.findNext=function(h,u){this.find({skipCurrent:!0,backwards:!1},h,u)},a.prototype.findPrevious=function(h,u){this.find(h,{skipCurrent:!0,backwards:!0},u)},a.prototype.revealRange=function(h,u){this.session.unfold(h),this.selection.setSelectionRange(h);var g=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(h.start,h.end,.5),u!==!1&&this.renderer.animateScrolling(g)},a.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},a.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},a.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(h){h.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},a.prototype.setAutoScrollEditorIntoView=function(h){if(!!h){var u,g=this,A=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var L=this.$scrollAnchor;L.style.cssText="position:absolute",this.container.insertBefore(L,this.container.firstChild);var M=this.on("changeSelection",function(){A=!0}),T=this.renderer.on("beforeRender",function(){A&&(u=g.renderer.container.getBoundingClientRect())}),I=this.renderer.on("afterRender",function(){if(A&&u&&(g.isFocused()||g.searchBox&&g.searchBox.isFocused())){var F=g.renderer,_=F.$cursorLayer.$pixelPos,W=F.layerConfig,O=_.top-W.offset;_.top>=0&&O+u.top<0?A=!0:_.topwindow.innerHeight?A=!1:A=null,A!=null&&(L.style.top=O+"px",L.style.left=_.left+"px",L.style.height=W.lineHeight+"px",L.scrollIntoView(A)),A=u=null}});this.setAutoScrollEditorIntoView=function(F){F||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",M),this.renderer.off("afterRender",I),this.renderer.off("beforeRender",T))}}},a.prototype.$resetCursorStyle=function(){var h=this.$cursorStyle||"ace",u=this.renderer.$cursorLayer;!u||(u.setSmoothBlinking(/smooth/.test(h)),u.isBlinking=!this.$readOnly&&h!="wide",C.setCssClass(u.element,"ace_slim-cursors",/slim/.test(h)))},a.prototype.prompt=function(h,u,g){var A=this;y.loadModule("ace/ext/prompt",function(L){L.prompt(A,h,u,g)})},a}();v.$uid=0,v.prototype.curOp=null,v.prototype.prevOp={},v.prototype.$mergeableCommands=["backspace","del","insertstring"],v.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],k.implement(v.prototype,d),y.defineOptions(v.prototype,"editor",{selectionStyle:{set:function(a){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:a})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(a){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(a){this.textInput.setReadOnly(a),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(a){this.textInput.setCopyWithEmptySelection(a)},initialValue:!1},cursorStyle:{set:function(a){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(a){this.setAutoScrollEditorIntoView(a)}},keyboardHandler:{set:function(a){this.setKeyboardHandler(a)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(a){this.session.setValue(a)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(a){this.setSession(a)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(a){this.renderer.$gutterLayer.setShowLineNumbers(a),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),a&&this.$relativeLineNumbers?f.attach(this):f.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(a){this.$showLineNumbers&&a?f.attach(this):f.detach(this)}},placeholder:{set:function(a){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var h=this.session&&(this.renderer.$composition||this.getValue());if(h&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),C.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!h&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),C.addCssClass(this.container,"ace_hasPlaceholder");var u=C.createElement("div");u.className="ace_placeholder",u.textContent=this.$placeholder||"",this.renderer.placeholderNode=u,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!h&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(a){var h={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(A){A.blur(),A.renderer.content.focus()},readOnly:!0},u=function(A){A.target==this.renderer.content&&A.keyCode===w.enter&&(A.stopPropagation(),A.preventDefault(),this.focus())},g="ace_keyboard-focus";a?(this.textInput.getElement().setAttribute("tabindex",-1),this.renderer.content.setAttribute("tabindex",0),this.renderer.content.classList.add(g),this.renderer.content.setAttribute("aria-label","Editor, press Enter key to start editing, press Escape key to exit"),this.renderer.content.addEventListener("keyup",u.bind(this)),this.commands.addCommand(h)):(this.textInput.getElement().setAttribute("tabindex",0),this.renderer.content.setAttribute("tabindex",-1),this.renderer.content.classList.remove(g),this.renderer.content.setAttribute("aria-label",""),this.renderer.content.removeEventListener("keyup",u.bind(this)),this.commands.removeCommand(h))},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var f={getText:function(a,h){return(Math.abs(a.selection.lead.row-h)||h+1+(h<9?"\xB7":""))+""},getWidth:function(a,h,u){return Math.max(h.toString().length,(u.lastRow+1).toString().length,2)*u.characterWidth},update:function(a,h){h.renderer.$loop.schedule(h.renderer.CHANGE_GUTTER)},attach:function(a){a.renderer.$gutterLayer.$renderer=this,a.on("changeSelection",this.update),this.update(null,a)},detach:function(a){a.renderer.$gutterLayer.$renderer==this&&(a.renderer.$gutterLayer.$renderer=null),a.off("changeSelection",this.update),this.update(null,a)}};x.Editor=v}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(E,x,P){"use strict";var R=function(){function p(){this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=Infinity,this.reset()}return p.prototype.addSession=function(w){this.$session=w},p.prototype.add=function(w,v,f){if(!this.$fromUndo&&w!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),v===!1||!this.lastDeltas){this.lastDeltas=[];var a=this.$undoStack.length;a>this.$undoDepth-1&&this.$undoStack.splice(0,a-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),w.id=this.$rev=++this.$maxRev}(w.action=="remove"||w.action=="insert")&&(this.$lastDelta=w),this.lastDeltas.push(w)}},p.prototype.addSelection=function(w,v){this.selections.push({value:w,rev:v||this.$rev})},p.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},p.prototype.markIgnored=function(w,v){v==null&&(v=this.$rev+1);for(var f=this.$undoStack,a=f.length;a--;){var h=f[a][0];if(h.id<=w)break;h.id0},p.prototype.canRedo=function(){return this.$redoStack.length>0},p.prototype.bookmark=function(w){w==null&&(w=this.$rev),this.mark=w},p.prototype.isAtBookmark=function(){return this.$rev===this.mark},p.prototype.toJSON=function(){},p.prototype.fromJSON=function(){},p.prototype.$prettyPrint=function(w){return w?t(w):t(this.$undoStack)+` --- `+t(this.$redoStack)},p}();R.prototype.hasUndo=R.prototype.canUndo,R.prototype.hasRedo=R.prototype.canRedo,R.prototype.isClean=R.prototype.isAtBookmark,R.prototype.markClean=R.prototype.bookmark;function k(p,w){for(var v=w;v--;){var f=p[v];if(f&&!f[0].ignore){for(;v0){g.row+=a,g.column+=g.row==f.row?h:0;continue}!w&&L<=0&&(g.row=v.row,g.column=v.column,L===0&&(g.bias=1))}}}function n(p){return{row:p.row,column:p.column}}function i(p){return{start:n(p.start),end:n(p.end),action:p.action,lines:p.lines.slice()}}function t(p){if(p=p||this,Array.isArray(p))return p.map(t).join(` `);var w="";return p.action?(w=p.action=="insert"?"+":"-",w+="["+p.lines+"]"):p.value&&(Array.isArray(p.value)?w=p.value.map(r).join(` `):w=r(p.value)),p.start&&(w+=r(p)),(p.id||p.rev)&&(w+=" ("+(p.id||p.rev)+")"),w}function r(p){return p.start.row+":"+p.start.column+"=>"+p.end.row+":"+p.end.column}function o(p,w){var v=p.action=="insert",f=w.action=="insert";if(v&&f)if(s(w.start,p.end)>=0)$(w,p,-1);else if(s(w.start,p.start)<=0)$(p,w,1);else return null;else if(v&&!f)if(s(w.start,p.end)>=0)$(w,p,-1);else if(s(w.end,p.start)<=0)$(p,w,-1);else return null;else if(!v&&f)if(s(w.start,p.start)>=0)$(w,p,1);else if(s(w.start,p.start)<=0)$(p,w,1);else return null;else if(!v&&!f)if(s(w.start,p.start)>=0)$(w,p,1);else if(s(w.end,p.start)<=0)$(p,w,-1);else return null;return[w,p]}function c(p,w){for(var v=p.length;v--;)for(var f=0;f=0?$(p,w,-1):(s(p.start,w.start)<=0||$(p,C.fromPoints(w.start,p.start),-1),$(w,p,1));else if(!v&&f)s(w.start,p.end)>=0?$(w,p,-1):(s(w.start,p.start)<=0||$(w,C.fromPoints(p.start,w.start),-1),$(p,w,1));else if(!v&&!f)if(s(w.start,p.end)>=0)$(w,p,-1);else if(s(w.end,p.start)<=0)$(p,w,-1);else{var a,h;return s(p.start,w.start)<0&&(a=p,p=y(p,w.start)),s(p.end,w.end)>0&&(h=y(p,w.end)),S(w.end,p.start,p.end,-1),h&&!a&&(p.lines=h.lines,p.start=h.start,p.end=h.end,h=p),[w,a,h].filter(Boolean)}return[w,p]}function $(p,w,v){S(p.start,w.start,w.end,v),S(p.end,w.start,w.end,v)}function S(p,w,v,f){p.row==(f==1?w:v).row&&(p.column+=f*(v.column-w.column)),p.row+=f*(v.row-w.row)}function y(p,w){var v=p.lines,f=p.end;p.end=n(w);var a=p.end.row-p.start.row,h=v.splice(a,v.length),u=a?w.column:w.column-p.start.column;v.push(h[0].substring(0,u)),h[0]=h[0].substr(u);var g={start:n(w),end:f,lines:h,action:p.action};return g}function m(p,w){w=i(w);for(var v=p.length;v--;){for(var f=p[v],a=0;a$&&(m=d.end.row+1,d=r.getNextFoldLine(m,d),$=d?d.start.row:Infinity),m>c){for(;this.$lines.getLength()>y+1;)this.$lines.pop();break}S=this.$lines.get(++y),S?S.row=m:(S=this.$lines.createCell(m,t,this.session,n),this.$lines.push(S)),this.$renderCell(S,t,d,m),m++}this._signal("afterRender"),this.$updateGutterWidth(t)},i.prototype.$updateGutterWidth=function(t){var r=this.session,o=r.gutterRenderer||this.$renderer,c=r.$firstLineNumber,d=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||r.$useWrapMode)&&(d=r.getLength()+c-1);var $=o?o.getWidth(r,d,t):d.toString().length*t.characterWidth,S=this.$padding||this.$computePadding();$+=S.left+S.right,$!==this.gutterWidth&&!isNaN($)&&(this.gutterWidth=$,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",$))},i.prototype.$updateCursorRow=function(){if(!!this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row)}},i.prototype.updateLineHighlight=function(){if(!!this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!(this.$cursorCell&&this.$cursorCell.row==t)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var r=this.$lines.cells;this.$cursorCell=null;for(var o=0;o=this.$cursorRow){if(c.row>this.$cursorRow){var d=this.session.getFoldLine(this.$cursorRow);if(o>0&&d&&d.start.row==r[o-1].row)c=r[o-1];else break}c.element.className="ace_gutter-active-line "+c.element.className,this.$cursorCell=c;break}}}}},i.prototype.scrollLines=function(t){var r=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(r,t))return this.update(t);this.$lines.moveContainer(t);var o=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),c=this.oldLastRow;if(this.oldLastRow=o,!r||c0;d--)this.$lines.shift();if(c>o)for(var d=this.session.getFoldedRowCount(o+1,c);d>0;d--)this.$lines.pop();t.firstRowc&&this.$lines.push(this.$renderLines(t,c+1,o)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t)},i.prototype.$renderLines=function(t,r,o){for(var c=[],d=r,$=this.session.getNextFoldLine(d),S=$?$.start.row:Infinity;d>S&&(d=$.end.row+1,$=this.session.getNextFoldLine(d,$),S=$?$.start.row:Infinity),!(d>o);){var y=this.$lines.createCell(d,t,this.session,n);this.$renderCell(y,t,$,d),c.push(y),d++}return c},i.prototype.$renderCell=function(t,r,o,c){var d=t.element,$=this.session,S=d.childNodes[0],y=d.childNodes[1],m=d.childNodes[2],b=$.$firstLineNumber,p=$.$breakpoints,w=$.$decorations,v=$.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&$.foldWidgets,a=o?o.start.row:Number.MAX_VALUE,h=r.lineHeight+"px",u;if(this.$useSvgGutterIcons?(u="ace_gutter-cell_svg-icons ",this.$annotations[c]?(m.className="ace_icon_svg"+this.$annotations[c].className,R.setStyle(m.style,"height",h),R.setStyle(m.style,"display","block")):R.setStyle(m.style,"display","none")):(u="ace_gutter-cell ",R.setStyle(m.style,"display","none")),this.$highlightGutterLine&&(c==this.$cursorRow||o&&c=a&&this.$cursorRow<=o.end.row)&&(u+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),p[c]&&(u+=p[c]),w[c]&&(u+=w[c]),this.$annotations[c]&&(u+=this.$annotations[c].className),d.className!=u&&(d.className=u),f){var g=f[c];g==null&&(g=f[c]=$.getFoldWidget(c))}if(g){var u="ace_fold-widget ace_"+g;g=="start"&&c==a&&co.right-r.right)return"foldWidgets"},i}();e.prototype.$fixedWidth=!1,e.prototype.$highlightGutterLine=!0,e.prototype.$renderer="",e.prototype.$showLineNumbers=!0,e.prototype.$showFoldWidgets=!0,k.implement(e.prototype,s);function n(i){var t=document.createTextNode("");i.appendChild(t);var r=R.createElement("span");i.appendChild(r);var o=R.createElement("span");return i.appendChild(o),i}x.Gutter=e}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(E,x,P){"use strict";var R=E("../range").Range,k=E("../lib/dom"),C=function(){function l(e){this.element=k.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return l.prototype.setPadding=function(e){this.$padding=e},l.prototype.setSession=function(e){this.session=e},l.prototype.setMarkers=function(e){this.markers=e},l.prototype.elt=function(e,n){var i=this.i!=-1&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=n,i.className=e},l.prototype.update=function(e){if(!!e){this.config=e,this.i=0;var n;for(var i in this.markers){var t=this.markers[i];if(!t.range){t.update(n,this,this.session,e);continue}var r=t.range.clipRows(e.firstRow,e.lastRow);if(!r.isEmpty())if(r=r.toScreenRange(this.session),t.renderer){var o=this.$getTop(r.start.row,e),c=this.$padding+r.start.column*e.characterWidth;t.renderer(n,r,c,o,e)}else t.type=="fullLine"?this.drawFullLineMarker(n,r,t.clazz,e):t.type=="screenLine"?this.drawScreenLineMarker(n,r,t.clazz,e):r.isMultiLine()?t.type=="text"?this.drawTextMarker(n,r,t.clazz,e):this.drawMultiLineMarker(n,r,t.clazz,e):this.drawSingleLineMarker(n,r,t.clazz+" ace_start ace_br15",e)}if(this.i!=-1)for(;this.im,$==d),t,$==d?0:1,r)},l.prototype.drawMultiLineMarker=function(e,n,i,t,r){var o=this.$padding,c=t.lineHeight,d=this.$getTop(n.start.row,t),$=o+n.start.column*t.characterWidth;if(r=r||"",this.session.$bidiHandler.isBidiRow(n.start.row)){var S=n.clone();S.end.row=S.start.row,S.end.column=this.session.getLine(S.start.row).length,this.drawBidiSingleLineMarker(e,S,i+" ace_br1 ace_start",t,null,r)}else this.elt(i+" ace_br1 ace_start","height:"+c+"px;right:0;top:"+d+"px;left:"+$+"px;"+(r||""));if(this.session.$bidiHandler.isBidiRow(n.end.row)){var S=n.clone();S.start.row=S.end.row,S.start.column=0,this.drawBidiSingleLineMarker(e,S,i+" ace_br12",t,null,r)}else{d=this.$getTop(n.end.row,t);var y=n.end.column*t.characterWidth;this.elt(i+" ace_br12","height:"+c+"px;width:"+y+"px;top:"+d+"px;left:"+o+"px;"+(r||""))}if(c=(n.end.row-n.start.row-1)*t.lineHeight,!(c<=0)){d=this.$getTop(n.start.row+1,t);var m=(n.start.column?1:0)|(n.end.column?0:8);this.elt(i+(m?" ace_br"+m:""),"height:"+c+"px;right:0;top:"+d+"px;left:"+o+"px;"+(r||""))}},l.prototype.drawSingleLineMarker=function(e,n,i,t,r,o){if(this.session.$bidiHandler.isBidiRow(n.start.row))return this.drawBidiSingleLineMarker(e,n,i,t,r,o);var c=t.lineHeight,d=(n.end.column+(r||0)-n.start.column)*t.characterWidth,$=this.$getTop(n.start.row,t),S=this.$padding+n.start.column*t.characterWidth;this.elt(i,"height:"+c+"px;width:"+d+"px;top:"+$+"px;left:"+S+"px;"+(o||""))},l.prototype.drawBidiSingleLineMarker=function(e,n,i,t,r,o){var c=t.lineHeight,d=this.$getTop(n.start.row,t),$=this.$padding,S=this.session.$bidiHandler.getSelections(n.start.column,n.end.column);S.forEach(function(y){this.elt(i,"height:"+c+"px;width:"+(y.width+(r||0))+"px;top:"+d+"px;left:"+($+y.left)+"px;"+(o||""))},this)},l.prototype.drawFullLineMarker=function(e,n,i,t,r){var o=this.$getTop(n.start.row,t),c=t.lineHeight;n.start.row!=n.end.row&&(c+=this.$getTop(n.end.row,t)-o),this.elt(i,"height:"+c+"px;top:"+o+"px;left:0;right:0;"+(r||""))},l.prototype.drawScreenLineMarker=function(e,n,i,t,r){var o=this.$getTop(n.start.row,t),c=t.lineHeight;this.elt(i,"height:"+c+"px;top:"+o+"px;left:0;right:0;"+(r||""))},l}();C.prototype.$padding=0;function s(l,e,n,i){return(l?1:0)|(e?2:0)|(n?4:0)|(i?8:0)}x.Marker=C}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=E("../lib/oop"),k=E("../lib/dom"),C=E("../lib/lang"),s=E("./lines").Lines,l=E("../lib/event_emitter").EventEmitter,e=function(){function n(i){this.dom=k,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",i.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}return n.prototype.$updateEolChar=function(){var i=this.session.doc,t=i.getNewLineCharacter()==` `&&i.getNewLineMode()!="windows",r=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=r)return this.EOL_CHAR=r,!0},n.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},n.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},n.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},n.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",function(t){this._signal("changeCharacterSize",t)}.bind(this)),this.$pollSizeChanges()},n.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},n.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},n.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},n.prototype.setShowInvisibles=function(i){return this.showInvisibles==i?!1:(this.showInvisibles=i,typeof i=="string"?(this.showSpaces=/tab/i.test(i),this.showTabs=/space/i.test(i),this.showEOL=/eol/i.test(i)):this.showSpaces=this.showTabs=this.showEOL=i,this.$computeTabString(),!0)},n.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},n.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},n.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var t=this.$tabStrings=[0],r=1;rb&&(y=m.end.row+1,m=this.session.getNextFoldLine(y,m),b=m?m.start.row:Infinity),!(y>c);){var p=d[$++];if(p){this.dom.removeChildren(p),this.$renderLine(p,y,y==b?m:!1),S&&(p.style.top=this.$lines.computeLineTop(y,i,this.session)+"px");var w=i.lineHeight*this.session.getRowLength(y)+"px";p.style.height!=w&&(S=!0,p.style.height=w)}y++}if(S)for(;$0;c--)this.$lines.shift();if(t.lastRow>i.lastRow)for(var c=this.session.getFoldedRowCount(i.lastRow+1,t.lastRow);c>0;c--)this.$lines.pop();i.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(i,t.lastRow+1,i.lastRow)),this.$highlightIndentGuide()},n.prototype.$renderLinesFragment=function(i,t,r){for(var o=[],c=t,d=this.session.getNextFoldLine(c),$=d?d.start.row:Infinity;c>$&&(c=d.end.row+1,d=this.session.getNextFoldLine(c,d),$=d?d.start.row:Infinity),!(c>r);){var S=this.$lines.createCell(c,i,this.session),y=S.element;this.dom.removeChildren(y),k.setStyle(y.style,"height",this.$lines.computeLineHeight(c,i,this.session)+"px"),k.setStyle(y.style,"top",this.$lines.computeLineTop(c,i,this.session)+"px"),this.$renderLine(y,c,c==$?d:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",o.push(S),c++}return o},n.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var t=i.firstRow,r=i.lastRow,o=this.$lines;o.getLength();)o.pop();o.push(this.$renderLinesFragment(i,t,r))},n.prototype.$renderToken=function(i,t,r,o){for(var c=this,d=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,$=this.dom.createFragment(this.element),S,y=0;S=d.exec(o);){var m=S[1],b=S[2],p=S[3],w=S[4],v=S[5];if(!(!c.showSpaces&&b)){var f=y!=S.index?o.slice(y,S.index):"";if(y=S.index+S[0].length,f&&$.appendChild(this.dom.createTextNode(f,this.element)),m){var a=c.session.getScreenTabSize(t+S.index);$.appendChild(c.$tabStrings[a].cloneNode(!0)),t+=a-1}else if(b)if(c.showSpaces){var h=this.dom.createElement("span");h.className="ace_invisible ace_invisible_space",h.textContent=C.stringRepeat(c.SPACE_CHAR,b.length),$.appendChild(h)}else $.appendChild(this.com.createTextNode(b,this.element));else if(p){var h=this.dom.createElement("span");h.className="ace_invisible ace_invisible_space ace_invalid",h.textContent=C.stringRepeat(c.SPACE_CHAR,p.length),$.appendChild(h)}else if(w){t+=1;var h=this.dom.createElement("span");h.style.width=c.config.characterWidth*2+"px",h.className=c.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",h.textContent=c.showSpaces?c.SPACE_CHAR:w,$.appendChild(h)}else if(v){t+=1;var h=this.dom.createElement("span");h.style.width=c.config.characterWidth*2+"px",h.className="ace_cjk",h.textContent=v,$.appendChild(h)}}}if($.appendChild(this.dom.createTextNode(y?o.slice(y):o,this.element)),this.$textToken[r.type])i.appendChild($);else{var u="ace_"+r.type.replace(/\./g," ace_"),h=this.dom.createElement("span");r.type=="fold"&&(h.style.width=r.value.length*this.config.characterWidth+"px"),h.className=u,h.appendChild($),i.appendChild(h)}return t+o.length},n.prototype.renderIndentGuide=function(i,t,r){var o=t.search(this.$indentGuideRe);if(o<=0||o>=r)return t;if(t[0]==" "){o-=o%this.tabSize;for(var c=o/this.tabSize,d=0;dd[$].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&i[t.row]!==""&&t.column===i[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(var $=t.row+1;$0){for(var c=0;c=this.$highlightIndentGuideMarker.start+1){if(o.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(o,t)}}else for(var r=i.length-1;r>=0;r--){var o=i[r];if(this.$highlightIndentGuideMarker.end&&o.row=d;)$=this.$renderToken(S,$,m,b.substring(0,d-o)),b=b.substring(d-o),o=d,S=this.$createLineElement(),i.appendChild(S),S.appendChild(this.dom.createTextNode(C.stringRepeat("\xA0",r.indent),this.element)),c++,$=0,d=r[c]||Number.MAX_VALUE;b.length!=0&&(o+=b.length,$=this.$renderToken(S,$,m,b))}}r[r.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(S,$,null,"",!0)},n.prototype.$renderSimpleLine=function(i,t){for(var r=0,o=0;othis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,r,c,d);r=this.$renderToken(i,r,c,d)}}},n.prototype.$renderOverflowMessage=function(i,t,r,o,c){r&&this.$renderToken(i,t,r,o.slice(0,this.MAX_LINE_LENGTH-t));var d=this.dom.createElement("span");d.className="ace_inline_button ace_keyword ace_toggle_wrap",d.textContent=c?"":"",i.appendChild(d)},n.prototype.$renderLine=function(i,t,r){if(!r&&r!=!1&&(r=this.session.getFoldLine(t)),r)var o=this.$getFoldLineTokens(t,r);else var o=this.session.getTokens(t);var c=i;if(o.length){var d=this.session.getRowSplitData(t);if(d&&d.length){this.$renderWrappedLine(i,o,d);var c=i.lastChild}else{var c=i;this.$useLineGroups()&&(c=this.$createLineElement(),i.appendChild(c)),this.$renderSimpleLine(c,o)}}else this.$useLineGroups()&&(c=this.$createLineElement(),i.appendChild(c));if(this.showEOL&&c){r&&(t=r.end.row);var $=this.dom.createElement("span");$.className="ace_invisible ace_invisible_eol",$.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,c.appendChild($)}},n.prototype.$getFoldLineTokens=function(i,t){var r=this.session,o=[];function c($,S,y){for(var m=0,b=0;b+$[m].value.lengthy-S&&(p=p.substring(0,y-S)),o.push({type:$[m].type,value:p}),b=S+p.length,m+=1}for(;by?o.push({type:$[m].type,value:p.substring(0,y-b)}):o.push($[m]),b+=p.length,m+=1}}var d=r.getTokens(i);return t.walk(function($,S,y,m,b){$!=null?o.push({type:"fold",value:$}):(b&&(d=r.getTokens(S)),d.length&&c(d,m,y))},t.end.row,this.session.getLine(t.end.row).length),o},n.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},n}();e.prototype.$textToken={text:!0,rparen:!0,lparen:!0},e.prototype.EOF_CHAR="\xB6",e.prototype.EOL_CHAR_LF="\xAC",e.prototype.EOL_CHAR_CRLF="\xA4",e.prototype.EOL_CHAR=e.prototype.EOL_CHAR_LF,e.prototype.TAB_CHAR="\u2014",e.prototype.SPACE_CHAR="\xB7",e.prototype.$padding=0,e.prototype.MAX_LINE_LENGTH=1e4,e.prototype.showInvisibles=!1,e.prototype.showSpaces=!1,e.prototype.showTabs=!1,e.prototype.showEOL=!1,e.prototype.displayIndentGuides=!0,e.prototype.$highlightIndentGuides=!0,e.prototype.$tabStrings=[],e.prototype.destroy={},e.prototype.onChangeTabSize=e.prototype.$computeTabString,R.implement(e.prototype,l),x.Text=e}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(E,x,P){"use strict";var R=E("../lib/dom"),k=function(){function C(s){this.element=R.createElement("div"),this.element.className="ace_layer ace_cursor-layer",s.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),R.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return C.prototype.$updateOpacity=function(s){for(var l=this.cursors,e=l.length;e--;)R.setStyle(l[e].style,"opacity",s?"":"0")},C.prototype.$startCssAnimation=function(){for(var s=this.cursors,l=s.length;l--;)s[l].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&R.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},C.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,R.removeCssClass(this.element,"ace_animate-blinking")},C.prototype.setPadding=function(s){this.$padding=s},C.prototype.setSession=function(s){this.session=s},C.prototype.setBlinking=function(s){s!=this.isBlinking&&(this.isBlinking=s,this.restartTimer())},C.prototype.setBlinkInterval=function(s){s!=this.blinkInterval&&(this.blinkInterval=s,this.restartTimer())},C.prototype.setSmoothBlinking=function(s){s!=this.smoothBlinking&&(this.smoothBlinking=s,R.setCssClass(this.element,"ace_smooth-blinking",s),this.$updateCursors(!0),this.restartTimer())},C.prototype.addCursor=function(){var s=R.createElement("div");return s.className="ace_cursor",this.element.appendChild(s),this.cursors.push(s),s},C.prototype.removeCursor=function(){if(this.cursors.length>1){var s=this.cursors.pop();return s.parentNode.removeChild(s),s}},C.prototype.hideCursor=function(){this.isVisible=!1,R.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},C.prototype.showCursor=function(){this.isVisible=!0,R.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},C.prototype.restartTimer=function(){var s=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,R.removeCssClass(this.element,"ace_smooth-blinking")),s(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&R.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),R.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var l=function(){this.timeoutId=setTimeout(function(){s(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){s(!0),l()},this.blinkInterval),l()}},C.prototype.getPixelPosition=function(s,l){if(!this.config||!this.session)return{left:0,top:0};s||(s=this.session.selection.getCursor());var e=this.session.documentToScreenPosition(s),n=this.$padding+(this.session.$bidiHandler.isBidiRow(e.row,s.row)?this.session.$bidiHandler.getPosLeft(e.column):e.column*this.config.characterWidth),i=(e.row-(l?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:n,top:i}},C.prototype.isCursorInView=function(s,l){return s.top>=0&&s.tops.height+s.offset||t.top<0)&&e>1)){var r=this.cursors[n++]||this.addCursor(),o=r.style;this.drawCursor?this.drawCursor(r,t,s,l[e],this.session):this.isCursorInView(t,s)?(R.setStyle(o,"display","block"),R.translate(r,t.left,t.top),R.setStyle(o,"width",Math.round(s.characterWidth)+"px"),R.setStyle(o,"height",s.lineHeight+"px")):R.setStyle(o,"display","none")}}for(;this.cursors.length>n;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=t,this.restartTimer()},C.prototype.$setOverwrite=function(s){s!=this.overwrite&&(this.overwrite=s,s?R.addCssClass(this.element,"ace_overwrite-cursors"):R.removeCssClass(this.element,"ace_overwrite-cursors"))},C.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},C}();k.prototype.$padding=0,k.prototype.drawCursor=null,x.Cursor=k}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=this&&this.__extends||function(){var r=function(o,c){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,$){d.__proto__=$}||function(d,$){for(var S in $)Object.prototype.hasOwnProperty.call($,S)&&(d[S]=$[S])},r(o,c)};return function(o,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");r(o,c);function d(){this.constructor=o}o.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}}(),k=E("./lib/oop"),C=E("./lib/dom"),s=E("./lib/event"),l=E("./lib/event_emitter").EventEmitter,e=32768,n=function(){function r(o,c){this.element=C.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+c,this.inner=C.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),o.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)}return r.prototype.setVisible=function(o){this.element.style.display=o?"":"none",this.isVisible=o,this.coeff=1},r}();k.implement(n.prototype,l);var i=function(r){R(o,r);function o(c,d){var $=r.call(this,c,"-v")||this;return $.scrollTop=0,$.scrollHeight=0,d.$scrollbarWidth=$.width=C.scrollbarWidth(c.ownerDocument),$.inner.style.width=$.element.style.width=($.width||15)+5+"px",$.$minWidth=0,$}return o.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var c=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-c)/(this.coeff-c)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},o.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},o.prototype.setHeight=function(c){this.element.style.height=c+"px"},o.prototype.setScrollHeight=function(c){this.scrollHeight=c,c>e?(this.coeff=e/c,c=e):this.coeff!=1&&(this.coeff=1),this.inner.style.height=c+"px"},o.prototype.setScrollTop=function(c){this.scrollTop!=c&&(this.skipEvent=!0,this.scrollTop=c,this.element.scrollTop=c*this.coeff)},o}(n);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var t=function(r){R(o,r);function o(c,d){var $=r.call(this,c,"-h")||this;return $.scrollLeft=0,$.height=d.$scrollbarWidth,$.inner.style.height=$.element.style.height=($.height||15)+5+"px",$}return o.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},o.prototype.getHeight=function(){return this.isVisible?this.height:0},o.prototype.setWidth=function(c){this.element.style.width=c+"px"},o.prototype.setInnerWidth=function(c){this.inner.style.width=c+"px"},o.prototype.setScrollWidth=function(c){this.inner.style.width=c+"px"},o.prototype.setScrollLeft=function(c){this.scrollLeft!=c&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=c)},o}(n);x.ScrollBar=i,x.ScrollBarV=i,x.ScrollBarH=t,x.VScrollBar=i,x.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=this&&this.__extends||function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,d){c.__proto__=d}||function(c,d){for(var $ in d)Object.prototype.hasOwnProperty.call(d,$)&&(c[$]=d[$])},t(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(r,o);function c(){this.constructor=r}r.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),k=E("./lib/oop"),C=E("./lib/dom"),s=E("./lib/event"),l=E("./lib/event_emitter").EventEmitter;C.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{ position: absolute; background: rgba(128, 128, 128, 0.6); -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #bbb; border-radius: 2px; z-index: 8; } .ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h { position: absolute; z-index: 6; background: none; overflow: hidden!important; } .ace_editor>.ace_sb-v { z-index: 6; right: 0; top: 0; width: 12px; } .ace_editor>.ace_sb-v div { z-index: 8; right: 0; width: 100%; } .ace_editor>.ace_sb-h { bottom: 0; left: 0; height: 12px; } .ace_editor>.ace_sb-h div { bottom: 0; height: 100%; } .ace_editor>.ace_sb_grabbed { z-index: 8; background: #000; }`,"ace_scrollbar.css",!1);var e=function(){function t(r,o){this.element=C.createElement("div"),this.element.className="ace_sb"+o,this.inner=C.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,r.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(r){this.element.style.display=r?"":"none",this.isVisible=r,this.coeff=1},t}();k.implement(e.prototype,l);var n=function(t){R(r,t);function r(o,c){var d=t.call(this,o,"-v")||this;return d.scrollTop=0,d.scrollHeight=0,d.parent=o,d.width=d.VScrollWidth,d.renderer=c,d.inner.style.width=d.element.style.width=(d.width||15)+"px",d.$minWidth=0,d}return r.prototype.onMouseDown=function(o,c){if(o==="mousedown"&&!(s.getButton(c)!==0||c.detail===2)){if(c.target===this.inner){var d=this,$=c.clientY,S=function(f){$=f.clientY},y=function(){clearInterval(w)},m=c.clientY,b=this.thumbTop,p=function(){if($!==void 0){var f=d.scrollTopFromThumbTop(b+$-m);f!==d.scrollTop&&d._emit("scroll",{data:f})}};s.capture(this.inner,S,y);var w=setInterval(p,20);return s.preventDefault(c)}var v=c.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(v)}),s.preventDefault(c)}},r.prototype.getHeight=function(){return this.height},r.prototype.scrollTopFromThumbTop=function(o){var c=o*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return c=c>>0,c<0?c=0:c>this.pageHeight-this.viewHeight&&(c=this.pageHeight-this.viewHeight),c},r.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},r.prototype.setHeight=function(o){this.height=Math.max(0,o),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},r.prototype.setScrollHeight=function(o,c){this.pageHeight===o&&!c||(this.pageHeight=o,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},r.prototype.setScrollTop=function(o){this.scrollTop=o,o<0&&(o=0),this.thumbTop=o*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},r}(e);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var i=function(t){R(r,t);function r(o,c){var d=t.call(this,o,"-h")||this;return d.scrollLeft=0,d.scrollWidth=0,d.height=d.HScrollHeight,d.inner.style.height=d.element.style.height=(d.height||12)+"px",d.renderer=c,d}return r.prototype.onMouseDown=function(o,c){if(o==="mousedown"&&!(s.getButton(c)!==0||c.detail===2)){if(c.target===this.inner){var d=this,$=c.clientX,S=function(f){$=f.clientX},y=function(){clearInterval(w)},m=c.clientX,b=this.thumbLeft,p=function(){if($!==void 0){var f=d.scrollLeftFromThumbLeft(b+$-m);f!==d.scrollLeft&&d._emit("scroll",{data:f})}};s.capture(this.inner,S,y);var w=setInterval(p,20);return s.preventDefault(c)}var v=c.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(v)}),s.preventDefault(c)}},r.prototype.getHeight=function(){return this.isVisible?this.height:0},r.prototype.scrollLeftFromThumbLeft=function(o){var c=o*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return c=c>>0,c<0?c=0:c>this.pageWidth-this.viewWidth&&(c=this.pageWidth-this.viewWidth),c},r.prototype.setWidth=function(o){this.width=Math.max(0,o),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},r.prototype.setScrollWidth=function(o,c){this.pageWidth===o&&!c||(this.pageWidth=o,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},r.prototype.setScrollLeft=function(o){this.scrollLeft=o,o<0&&(o=0),this.thumbLeft=o*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},r}(e);i.prototype.setInnerWidth=i.prototype.setScrollWidth,x.ScrollBar=n,x.ScrollBarV=n,x.ScrollBarH=i,x.VScrollBar=n,x.HScrollBar=i}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(E,x,P){"use strict";var R=E("./lib/event"),k=function(){function C(s,l){this.onRender=s,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=l||window;var e=this;this._flush=function(n){e.pending=!1;var i=e.changes;if(i&&(R.blockIdle(100),e.changes=0,e.onRender(i)),e.changes){if(e.$recursionLimit--<0)return;e.schedule()}else e.$recursionLimit=2}}return C.prototype.schedule=function(s){this.changes=this.changes|s,this.changes&&!this.pending&&(R.nextFrame(this._flush),this.pending=!0)},C.prototype.clear=function(s){var l=this.changes;return this.changes=0,l},C}();x.RenderLoop=k}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(E,x,P){var R=E("../lib/oop"),k=E("../lib/dom"),C=E("../lib/lang"),s=E("../lib/event"),l=E("../lib/useragent"),e=E("../lib/event_emitter").EventEmitter,n=512,i=typeof ResizeObserver=="function",t=200,r=function(){function o(c){this.el=k.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=k.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=k.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),c.appendChild(this.el),this.$measureNode.textContent=C.stringRepeat("X",n),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges()}return o.prototype.$setMeasureNodeStyles=function(c,d){c.width=c.height="auto",c.left=c.top="0px",c.visibility="hidden",c.position="absolute",c.whiteSpace="pre",l.isIE<8?c["font-family"]="inherit":c.font="inherit",c.overflow=d?"hidden":"visible"},o.prototype.checkForSizeChanges=function(c){if(c===void 0&&(c=this.$measureSizes()),c&&(this.$characterSize.width!==c.width||this.$characterSize.height!==c.height)){this.$measureNode.style.fontWeight="bold";var d=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=c,this.charSizes=Object.create(null),this.allowBoldFonts=d&&d.width===c.width&&d.height===c.height,this._emit("changeCharacterSize",{data:c})}},o.prototype.$addObserver=function(){var c=this;this.$observer=new window.ResizeObserver(function(d){c.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},o.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var c=this;return this.$pollSizeChangesTimer=s.onIdle(function d(){c.checkForSizeChanges(),s.onIdle(d,500)},500)},o.prototype.setPolling=function(c){c?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},o.prototype.$measureSizes=function(c){var d={height:(c||this.$measureNode).clientHeight,width:(c||this.$measureNode).clientWidth/n};return d.width===0||d.height===0?null:d},o.prototype.$measureCharWidth=function(c){this.$main.textContent=C.stringRepeat(c,n);var d=this.$main.getBoundingClientRect();return d.width/n},o.prototype.getCharacterWidth=function(c){var d=this.charSizes[c];return d===void 0&&(d=this.charSizes[c]=this.$measureCharWidth(c)/this.$characterSize.width),d},o.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},o.prototype.$getZoom=function(c){return!c||!c.parentElement?1:(window.getComputedStyle(c).zoom||1)*this.$getZoom(c.parentElement)},o.prototype.$initTransformMeasureNodes=function(){var c=function(d,$){return["div",{style:"position: absolute;top:"+d+"px;left:"+$+"px;"}]};this.els=k.buildDom([c(0,0),c(t,0),c(0,t),c(t,t)],this.el)},o.prototype.transformCoordinates=function(c,d){if(c){var $=this.$getZoom(this.el);c=b(1/$,c)}function S(F,_,W){var O=F[1]*_[0]-F[0]*_[1];return[(-_[1]*W[0]+_[0]*W[1])/O,(+F[1]*W[0]-F[0]*W[1])/O]}function y(F,_){return[F[0]-_[0],F[1]-_[1]]}function m(F,_){return[F[0]+_[0],F[1]+_[1]]}function b(F,_){return[F*_[0],F*_[1]]}this.els||this.$initTransformMeasureNodes();function p(F){var _=F.getBoundingClientRect();return[_.left,_.top]}var w=p(this.els[0]),v=p(this.els[1]),f=p(this.els[2]),a=p(this.els[3]),h=S(y(a,v),y(a,f),y(m(v,f),m(a,w))),u=b(1+h[0],y(v,w)),g=b(1+h[1],y(f,w));if(d){var A=d,L=h[0]*A[0]/t+h[1]*A[1]/t+1,M=m(b(A[0],u),b(A[1],g));return m(b(1/L/t,M),w)}var T=y(c,w),I=S(y(u,b(h[0],T)),y(g,b(h[1],T)),T);return b(t,I)},o}();r.prototype.$characterSize={width:0,height:0},R.implement(r.prototype,e),x.FontMetrics=r}),ace.define("ace/css/editor.css",["require","exports","module"],function(E,x,P){P.exports=` .ace_br1 {border-top-left-radius : 3px;} .ace_br2 {border-top-right-radius : 3px;} .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;} .ace_br4 {border-bottom-right-radius: 3px;} .ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;} .ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;} .ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;} .ace_br8 {border-bottom-left-radius : 3px;} .ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;} .ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;} .ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;} .ace_editor { position: relative; overflow: hidden; padding: 0; font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace; direction: ltr; text-align: left; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .ace_scroller { position: absolute; overflow: hidden; top: 0; bottom: 0; background-color: inherit; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; cursor: text; } .ace_content { position: absolute; box-sizing: border-box; min-width: 100%; contain: style size layout; font-variant-ligatures: no-common-ligatures; } .ace_keyboard-focus:focus { box-shadow: inset 0 0 0 2px #5E9ED6; outline: none; } .ace_dragging .ace_scroller:before{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; content: ''; background: rgba(250, 250, 250, 0.01); z-index: 1000; } .ace_dragging.ace_dark .ace_scroller:before{ background: rgba(0, 0, 0, 0.01); } .ace_gutter { position: absolute; overflow : hidden; width: auto; top: 0; bottom: 0; left: 0; cursor: default; z-index: 4; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; contain: style size layout; } .ace_gutter-active-line { position: absolute; left: 0; right: 0; } .ace_scroller.ace_scroll-left:after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset; pointer-events: none; } .ace_gutter-cell, .ace_gutter-cell_svg-icons { position: absolute; top: 0; left: 0; right: 0; padding-left: 19px; padding-right: 6px; background-repeat: no-repeat; } .ace_gutter-cell_svg-icons .ace_icon_svg{ margin-left: -14px; float: left; } .ace_gutter-cell.ace_error, .ace_icon.ace_error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_warning, .ace_icon.ace_warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: 2px center; } .ace_gutter-cell.ace_info, .ace_icon.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII="); background-repeat: no-repeat; background-position: 2px center; } .ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC"); } .ace_icon_svg.ace_error { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+"); background-color: crimson; } .ace_icon_svg.ace_warning { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg=="); background-color: darkorange; } .ace_icon_svg.ace_info { -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg=="); background-color: royalblue; } .ace_scrollbar { contain: strict; position: absolute; right: 0; bottom: 0; z-index: 6; } .ace_scrollbar-inner { position: absolute; cursor: text; left: 0; top: 0; } .ace_scrollbar-v{ overflow-x: hidden; overflow-y: scroll; top: 0; } .ace_scrollbar-h { overflow-x: scroll; overflow-y: hidden; left: 0; } .ace_print-margin { position: absolute; height: 100%; } .ace_text-input { position: absolute; z-index: 0; width: 0.5em; height: 1em; opacity: 0; background: transparent; -moz-appearance: none; appearance: none; border: none; resize: none; outline: none; overflow: hidden; font: inherit; padding: 0 1px; margin: 0 -1px; contain: strict; -ms-user-select: text; -moz-user-select: text; -webkit-user-select: text; user-select: text; /*with \`pre-line\` chrome inserts   instead of space*/ white-space: pre!important; } .ace_text-input.ace_composition { background: transparent; color: inherit; z-index: 1000; opacity: 1; } .ace_composition_placeholder { color: transparent } .ace_composition_marker { border-bottom: 1px solid; position: absolute; border-radius: 0; margin-top: 1px; } [ace_nocontext=true] { transform: none!important; filter: none!important; clip-path: none!important; mask : none!important; contain: none!important; perspective: none!important; mix-blend-mode: initial!important; z-index: auto; } .ace_layer { z-index: 1; position: absolute; overflow: hidden; /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/ word-wrap: normal; white-space: pre; height: 100%; width: 100%; box-sizing: border-box; /* setting pointer-events: auto; on node under the mouse, which changes during scroll, will break mouse wheel scrolling in Safari */ pointer-events: none; } .ace_gutter-layer { position: relative; width: auto; text-align: right; pointer-events: auto; height: 1000000px; contain: style size layout; } .ace_text-layer { font: inherit !important; position: absolute; height: 1000000px; width: 1000000px; contain: style size layout; } .ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group { contain: style size layout; position: absolute; top: 0; left: 0; right: 0; } .ace_hidpi .ace_text-layer, .ace_hidpi .ace_gutter-layer, .ace_hidpi .ace_content, .ace_hidpi .ace_gutter { contain: strict; } .ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group { contain: strict; } .ace_cjk { display: inline-block; text-align: center; } .ace_cursor-layer { z-index: 4; } .ace_cursor { z-index: 4; position: absolute; box-sizing: border-box; border-left: 2px solid; /* workaround for smooth cursor repaintng whole screen in chrome */ transform: translatez(0); } .ace_multiselect .ace_cursor { border-left-width: 1px; } .ace_slim-cursors .ace_cursor { border-left-width: 1px; } .ace_overwrite-cursors .ace_cursor { border-left-width: 0; border-bottom: 1px solid; } .ace_hidden-cursors .ace_cursor { opacity: 0.2; } .ace_hasPlaceholder .ace_hidden-cursors .ace_cursor { opacity: 0; } .ace_smooth-blinking .ace_cursor { transition: opacity 0.18s; } .ace_animate-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: step-end; animation-name: blink-ace-animate; animation-iteration-count: infinite; } .ace_animate-blinking.ace_smooth-blinking .ace_cursor { animation-duration: 1000ms; animation-timing-function: ease-in-out; animation-name: blink-ace-animate-smooth; } @keyframes blink-ace-animate { from, to { opacity: 1; } 60% { opacity: 0; } } @keyframes blink-ace-animate-smooth { from, to { opacity: 1; } 45% { opacity: 1; } 60% { opacity: 0; } 85% { opacity: 0; } } .ace_marker-layer .ace_step, .ace_marker-layer .ace_stack { position: absolute; z-index: 3; } .ace_marker-layer .ace_selection { position: absolute; z-index: 5; } .ace_marker-layer .ace_bracket { position: absolute; z-index: 6; } .ace_marker-layer .ace_error_bracket { position: absolute; border-bottom: 1px solid #DE5555; border-radius: 0; } .ace_marker-layer .ace_active-line { position: absolute; z-index: 2; } .ace_marker-layer .ace_selected-word { position: absolute; z-index: 4; box-sizing: border-box; } .ace_line .ace_fold { box-sizing: border-box; display: inline-block; height: 11px; margin-top: -2px; vertical-align: middle; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII="); background-repeat: no-repeat, repeat-x; background-position: center center, top left; color: transparent; border: 1px solid black; border-radius: 2px; cursor: pointer; pointer-events: auto; } .ace_dark .ace_fold { } .ace_fold:hover{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="), url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC"); } .ace_tooltip { background-color: #f5f5f5; border: 1px solid gray; border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color: black; max-width: 100%; padding: 3px 4px; position: fixed; z-index: 999999; box-sizing: border-box; cursor: default; white-space: pre; word-wrap: break-word; line-height: normal; font-style: normal; font-weight: normal; letter-spacing: normal; pointer-events: none; } .ace_tooltip:focus { outline: 1px solid black; } .ace_gutter-tooltip_header { font-weight: bold; } .ace_gutter-tooltip_body { padding-top: 5px; } .ace_gutter-tooltip .ace_icon { display: inline-block; width: 18px; } .ace_icon_svg { display: inline-block; width: 12px; vertical-align: top; -webkit-mask-repeat: no-repeat; -webkit-mask-size: 12px; -webkit-mask-position: center; } .ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons { padding-right: 13px; } .ace_fold-widget { box-sizing: border-box; margin: 0 -12px 0 1px; display: none; width: 11px; vertical-align: top; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); background-repeat: no-repeat; background-position: center; border-radius: 3px; border: 1px solid transparent; cursor: pointer; } .ace_folding-enabled .ace_fold-widget { display: inline-block; } .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); } .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } /** * Dark version for fold widgets */ .ace_dark .ace_fold-widget { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); } .ace_dark .ace_fold-widget.ace_end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget.ace_closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget:hover { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.1); } .ace_dark .ace_fold-widget:active { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); } .ace_inline_button { border: 1px solid lightgray; display: inline-block; margin: -1px 8px; padding: 0 5px; pointer-events: auto; cursor: pointer; } .ace_inline_button:hover { border-color: gray; background: rgba(200,200,200,0.2); display: inline-block; pointer-events: auto; } .ace_fold-widget.ace_invalid { background-color: #FFB4B4; border-color: #DE5555; } .ace_fade-fold-widgets .ace_fold-widget { transition: opacity 0.4s ease 0.05s; opacity: 0; } .ace_fade-fold-widgets:hover .ace_fold-widget { transition: opacity 0.05s ease 0.05s; opacity:1; } .ace_underline { text-decoration: underline; } .ace_bold { font-weight: bold; } .ace_nobold .ace_bold { font-weight: normal; } .ace_italic { font-style: italic; } .ace_error-marker { background-color: rgba(255, 0, 0,0.2); position: absolute; z-index: 9; } .ace_highlight-marker { background-color: rgba(255, 255, 0,0.2); position: absolute; z-index: 8; } .ace_mobile-menu { position: absolute; line-height: 1.5; border-radius: 4px; -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; background: white; box-shadow: 1px 3px 2px grey; border: 1px solid #dcdcdc; color: black; } .ace_dark > .ace_mobile-menu { background: #333; color: #ccc; box-shadow: 1px 3px 2px grey; border: 1px solid #444; } .ace_mobile-button { padding: 2px; cursor: pointer; overflow: hidden; } .ace_mobile-button:hover { background-color: #eee; opacity:1; } .ace_mobile-button:active { background-color: #ddd; } .ace_placeholder { font-family: arial; transform: scale(0.9); transform-origin: left; white-space: pre; opacity: 0.7; margin: 0 10px; } .ace_ghost_text { opacity: 0.5; font-style: italic; white-space: pre; }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(E,x,P){"use strict";var R=E("../lib/dom"),k=E("../lib/oop"),C=E("../lib/event_emitter").EventEmitter,s=function(){function l(e,n){this.canvas=R.createElement("canvas"),this.renderer=n,this.pixelRatio=1,this.maxHeight=n.layerConfig.maxHeight,this.lineHeight=n.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top=0+"px",this.canvas.style.right=0+"px",this.canvas.style.zIndex=7+"px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return l.prototype.$updateDecorators=function(e){var n=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(e){this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height;var i=(e.lastRow+1)*this.lineHeight;ih.priority?1:0}var o=this.renderer.session.$annotations;if(t.clearRect(0,0,this.canvas.width,this.canvas.height),o){var c={info:1,warning:2,error:3};o.forEach(function(a){a.priority=c[a.type]||null}),o=o.sort(r);for(var d=this.renderer.session.$foldData,$=0;$this.canvasHeight&&(v=this.canvasHeight-this.halfMinDecorationHeight),b=Math.round(v-this.halfMinDecorationHeight),p=Math.round(v+this.halfMinDecorationHeight)}t.fillStyle=n[o[$].type]||null,t.fillRect(0,m,this.canvasWidth,p-b)}}var f=this.renderer.session.selection.getCursor();if(f){var y=this.compensateFoldRows(f.row,d),m=Math.round((f.row-y)*this.lineHeight*this.heightRatio);t.fillStyle="rgba(0, 0, 0, 0.5)",t.fillRect(0,m,this.canvasWidth,2)}},l.prototype.compensateFoldRows=function(e,n){var i=0;if(n&&n.length>0)for(var t=0;tn[t].start.row&&e=n[t].end.row&&(i+=n[t].end.row-n[t].start.row);return i},l}();k.implement(s.prototype,C),x.Decorator=s}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor.css","ace/layer/decorators","ace/lib/useragent"],function(E,x,P){"use strict";var R=E("./lib/oop"),k=E("./lib/dom"),C=E("./lib/lang"),s=E("./config"),l=E("./layer/gutter").Gutter,e=E("./layer/marker").Marker,n=E("./layer/text").Text,i=E("./layer/cursor").Cursor,t=E("./scrollbar").HScrollBar,r=E("./scrollbar").VScrollBar,o=E("./scrollbar_custom").HScrollBar,c=E("./scrollbar_custom").VScrollBar,d=E("./renderloop").RenderLoop,$=E("./layer/font_metrics").FontMetrics,S=E("./lib/event_emitter").EventEmitter,y=E("./css/editor.css"),m=E("./layer/decorators").Decorator,b=E("./lib/useragent");k.importCssString(y,"ace_editor.css",!1);var p=function(){function w(v,f){var a=this;this.container=v||k.createElement("div"),k.addCssClass(this.container,"ace_editor"),k.HI_DPI&&k.addCssClass(this.container,"ace_hidpi"),this.setTheme(f),s.get("useStrictCSP")==null&&s.set("useStrictCSP",!1),this.$gutter=k.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=k.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=k.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new l(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new e(this.content);var h=this.$textLayer=new n(this.content);this.canvas=h.element,this.$markerFront=new e(this.content),this.$cursorLayer=new i(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new r(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(u){a.$scrollAnimation||a.session.setScrollTop(u.data-a.scrollMargin.top)}),this.scrollBarH.on("scroll",function(u){a.$scrollAnimation||a.session.setScrollLeft(u.data-a.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new $(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(u){a.updateCharacterSize(),a.onResize(!0,a.gutterWidth,a.$size.width,a.$size.height),a._signal("changeCharacterSize",u)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!b.isIOS,this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this)}return w.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),k.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},w.prototype.setSession=function(v){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=v,v&&this.scrollMargin.top&&v.getScrollTop()<=0&&v.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(v),this.$markerBack.setSession(v),this.$markerFront.setSession(v),this.$gutterLayer.setSession(v),this.$textLayer.setSession(v),!!v&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},w.prototype.updateLines=function(v,f,a){if(f===void 0&&(f=Infinity),this.$changedLines?(this.$changedLines.firstRow>v&&(this.$changedLines.firstRow=v),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},w.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},w.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},w.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},w.prototype.updateFull=function(v){v?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},w.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},w.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},w.prototype.onResize=function(v,f,a,h){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=v?1:0;var u=this.container;h||(h=u.clientHeight||u.scrollHeight),a||(a=u.clientWidth||u.scrollWidth);var g=this.$updateCachedSize(v,f,a,h);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!a&&!h)return this.resizing=0;v&&(this.$gutterLayer.$padding=null),v?this.$renderChanges(g|this.$changes,!0):this.$loop.schedule(g|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},w.prototype.$updateCachedSize=function(v,f,a,h){h-=this.$extraHeight||0;var u=0,g=this.$size,A={width:g.width,height:g.height,scrollerHeight:g.scrollerHeight,scrollerWidth:g.scrollerWidth};if(h&&(v||g.height!=h)&&(g.height=h,u|=this.CHANGE_SIZE,g.scrollerHeight=g.height,this.$horizScroll&&(g.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(g.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",u=u|this.CHANGE_SCROLL),a&&(v||g.width!=a)){u|=this.CHANGE_SIZE,g.width=a,f==null&&(f=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=f,k.setStyle(this.scrollBarH.element.style,"left",f+"px"),k.setStyle(this.scroller.style,"left",f+this.margin.left+"px"),g.scrollerWidth=Math.max(0,a-f-this.scrollBarV.getWidth()-this.margin.h),k.setStyle(this.$gutter.style,"left",this.margin.left+"px");var L=this.scrollBarV.getWidth()+"px";k.setStyle(this.scrollBarH.element.style,"right",L),k.setStyle(this.scroller.style,"right",L),k.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(g.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||v)&&(u|=this.CHANGE_FULL)}return g.$dirty=!a||!h,u&&this._signal("resize",A),u},w.prototype.onGutterResize=function(v){var f=this.$showGutter?v:0;f!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,f,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},w.prototype.adjustWrapLimit=function(){var v=this.$size.scrollerWidth-this.$padding*2,f=Math.floor(v/this.characterWidth);return this.session.adjustWrapLimit(f,this.$showPrintMargin&&this.$printMarginColumn)},w.prototype.setAnimatedScroll=function(v){this.setOption("animatedScroll",v)},w.prototype.getAnimatedScroll=function(){return this.$animatedScroll},w.prototype.setShowInvisibles=function(v){this.setOption("showInvisibles",v),this.session.$bidiHandler.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},w.prototype.getDisplayIndentGuide=function(){return this.getOption("displayIndentGuides")},w.prototype.setDisplayIndentGuides=function(v){this.setOption("displayIndentGuides",v)},w.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},w.prototype.setHighlightIndentGuides=function(v){this.setOption("highlightIndentGuides",v)},w.prototype.setShowPrintMargin=function(v){this.setOption("showPrintMargin",v)},w.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},w.prototype.setPrintMarginColumn=function(v){this.setOption("printMarginColumn",v)},w.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},w.prototype.getShowGutter=function(){return this.getOption("showGutter")},w.prototype.setShowGutter=function(v){return this.setOption("showGutter",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var v=k.createElement("div");v.className="ace_layer ace_print-margin-layer",this.$printMarginEl=k.createElement("div"),this.$printMarginEl.className="ace_print-margin",v.appendChild(this.$printMarginEl),this.content.insertBefore(v,this.content.firstChild)}var f=this.$printMarginEl.style;f.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",f.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},w.prototype.getContainerElement=function(){return this.container},w.prototype.getMouseEventTarget=function(){return this.scroller},w.prototype.getTextAreaContainer=function(){return this.container},w.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var v=this.textarea.style,f=this.$composition;if(!this.$keepTextAreaAtCursor&&!f){k.translate(this.textarea,-100,0);return}var a=this.$cursorLayer.$pixelPos;if(!!a){f&&f.markerRange&&(a=this.$cursorLayer.getPixelPosition(f.markerRange.start,!0));var h=this.layerConfig,u=a.top,g=a.left;u-=h.offset;var A=f&&f.useTextareaForIME||b.isMobile?this.lineHeight:1;if(u<0||u>h.height-A){k.translate(this.textarea,0,0);return}var L=1,M=this.$size.height-A;if(!f)u+=this.lineHeight;else if(f.useTextareaForIME){var T=this.textarea.value;L=this.characterWidth*this.session.$getStringScreenWidth(T)[0]}else u+=this.lineHeight+2;g-=this.scrollLeft,g>this.$size.scrollerWidth-L&&(g=this.$size.scrollerWidth-L),g+=this.gutterWidth+this.margin.left,k.setStyle(v,"height",A+"px"),k.setStyle(v,"width",L+"px"),k.translate(this.textarea,Math.min(g,this.$size.scrollerWidth-L),Math.min(u,M))}}},w.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},w.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},w.prototype.getLastFullyVisibleRow=function(){var v=this.layerConfig,f=v.lastRow,a=this.session.documentToScreenRow(f,0)*v.lineHeight;return a-this.session.getScrollTop()>v.height-v.lineHeight?f-1:f},w.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},w.prototype.setPadding=function(v){this.$padding=v,this.$textLayer.setPadding(v),this.$cursorLayer.setPadding(v),this.$markerFront.setPadding(v),this.$markerBack.setPadding(v),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},w.prototype.setScrollMargin=function(v,f,a,h){var u=this.scrollMargin;u.top=v|0,u.bottom=f|0,u.right=h|0,u.left=a|0,u.v=u.top+u.bottom,u.h=u.left+u.right,u.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-u.top),this.updateFull()},w.prototype.setMargin=function(v,f,a,h){var u=this.margin;u.top=v|0,u.bottom=f|0,u.right=h|0,u.left=a|0,u.v=u.top+u.bottom,u.h=u.left+u.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},w.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},w.prototype.setHScrollBarAlwaysVisible=function(v){this.setOption("hScrollBarAlwaysVisible",v)},w.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},w.prototype.setVScrollBarAlwaysVisible=function(v){this.setOption("vScrollBarAlwaysVisible",v)},w.prototype.$updateScrollBarV=function(){var v=this.layerConfig.maxHeight,f=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(v-=(f-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>v-f&&(v=this.scrollTop+f,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(v+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},w.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},w.prototype.freeze=function(){this.$frozen=!0},w.prototype.unfreeze=function(){this.$frozen=!1},w.prototype.$renderChanges=function(v,f){if(this.$changes&&(v|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!v&&!f){this.$changes|=v;return}if(this.$size.$dirty)return this.$changes|=v,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",v),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var a=this.layerConfig;if(v&this.CHANGE_FULL||v&this.CHANGE_SIZE||v&this.CHANGE_TEXT||v&this.CHANGE_LINES||v&this.CHANGE_SCROLL||v&this.CHANGE_H_SCROLL){if(v|=this.$computeLayerConfig()|this.$loop.clear(),a.firstRow!=this.layerConfig.firstRow&&a.firstRowScreen==this.layerConfig.firstRowScreen){var h=this.scrollTop+(a.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;h>0&&(this.scrollTop=h,v=v|this.CHANGE_SCROLL,v|=this.$computeLayerConfig()|this.$loop.clear())}a=this.layerConfig,this.$updateScrollBarV(),v&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),k.translate(this.content,-this.scrollLeft,-a.offset);var u=a.width+2*this.$padding+"px",g=a.minHeight+"px";k.setStyle(this.content.style,"width",u),k.setStyle(this.content.style,"height",g)}if(v&this.CHANGE_H_SCROLL&&(k.translate(this.content,-this.scrollLeft,-a.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),v&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),this._signal("afterRender",v);return}if(v&this.CHANGE_SCROLL){this.$changedLines=null,v&this.CHANGE_TEXT||v&this.CHANGE_LINES?this.$textLayer.update(a):this.$textLayer.scrollLines(a),this.$showGutter&&(v&this.CHANGE_GUTTER||v&this.CHANGE_LINES?this.$gutterLayer.update(a):this.$gutterLayer.scrollLines(a)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),this._signal("afterRender",v);return}v&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):v&this.CHANGE_LINES?((this.$updateLines()||v&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):v&this.CHANGE_TEXT||v&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):v&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)),v&this.CHANGE_CURSOR&&(this.$cursorLayer.update(a),this.$moveTextAreaToCursor()),v&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(a),v&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(a),this._signal("afterRender",v)},w.prototype.$autosize=function(){var v=this.session.getScreenLength()*this.lineHeight,f=this.$maxLines*this.lineHeight,a=Math.min(f,Math.max((this.$minLines||1)*this.lineHeight,v))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(a+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&a>this.$maxPixelHeight&&(a=this.$maxPixelHeight);var h=a<=2*this.lineHeight,u=!h&&v>f;if(a!=this.desiredHeight||this.$size.height!=this.desiredHeight||u!=this.$vScroll){u!=this.$vScroll&&(this.$vScroll=u,this.scrollBarV.setVisible(u));var g=this.container.clientWidth;this.container.style.height=a+"px",this.$updateCachedSize(!0,this.$gutterWidth,g,a),this.desiredHeight=a,this._signal("autosize")}},w.prototype.$computeLayerConfig=function(){var v=this.session,f=this.$size,a=f.height<=2*this.lineHeight,h=this.session.getScreenLength(),u=h*this.lineHeight,g=this.$getLongestLine(),A=!a&&(this.$hScrollBarAlwaysVisible||f.scrollerWidth-g-2*this.$padding<0),L=this.$horizScroll!==A;L&&(this.$horizScroll=A,this.scrollBarH.setVisible(A));var M=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var T=f.scrollerHeight+this.lineHeight,I=!this.$maxLines&&this.$scrollPastEnd?(f.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;u+=I;var F=this.scrollMargin;this.session.setScrollTop(Math.max(-F.top,Math.min(this.scrollTop,u-f.scrollerHeight+F.bottom))),this.session.setScrollLeft(Math.max(-F.left,Math.min(this.scrollLeft,g+2*this.$padding-f.scrollerWidth+F.right)));var _=!a&&(this.$vScrollBarAlwaysVisible||f.scrollerHeight-u+I<0||this.scrollTop>F.top),W=M!==_;W&&(this.$vScroll=_,this.scrollBarV.setVisible(_));var O=this.scrollTop%this.lineHeight,B=Math.ceil(T/this.lineHeight)-1,H=Math.max(0,Math.round((this.scrollTop-O)/this.lineHeight)),z=H+B,Y,Z,N=this.lineHeight;H=v.screenToDocumentRow(H,0);var U=v.getFoldLine(H);U&&(H=U.start.row),Y=v.documentToScreenRow(H,0),Z=v.getRowLength(H)*N,z=Math.min(v.screenToDocumentRow(z,0),v.getLength()-1),T=f.scrollerHeight+v.getRowLength(z)*N+Z,O=this.scrollTop-Y*N;var X=0;return(this.layerConfig.width!=g||L)&&(X=this.CHANGE_H_SCROLL),(L||W)&&(X|=this.$updateCachedSize(!0,this.gutterWidth,f.width,f.height),this._signal("scrollbarVisibilityChanged"),W&&(g=this.$getLongestLine())),this.layerConfig={width:g,padding:this.$padding,firstRow:H,firstRowScreen:Y,lastRow:z,lineHeight:N,characterWidth:this.characterWidth,minHeight:T,maxHeight:u,offset:O,gutterOffset:N?Math.max(0,Math.ceil((O+f.height-f.scrollerHeight)/N)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(g-this.$padding),X},w.prototype.$updateLines=function(){if(!!this.$changedLines){var v=this.$changedLines.firstRow,f=this.$changedLines.lastRow;this.$changedLines=null;var a=this.layerConfig;if(!(v>a.lastRow+1)&&!(fthis.$textLayer.MAX_LINE_LENGTH&&(v=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(v*this.characterWidth))},w.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},w.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},w.prototype.addGutterDecoration=function(v,f){this.$gutterLayer.addGutterDecoration(v,f)},w.prototype.removeGutterDecoration=function(v,f){this.$gutterLayer.removeGutterDecoration(v,f)},w.prototype.updateBreakpoints=function(v){this.$loop.schedule(this.CHANGE_GUTTER)},w.prototype.setAnnotations=function(v){this.$gutterLayer.setAnnotations(v),this.$loop.schedule(this.CHANGE_GUTTER)},w.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},w.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},w.prototype.showCursor=function(){this.$cursorLayer.showCursor()},w.prototype.scrollSelectionIntoView=function(v,f,a){this.scrollCursorIntoView(v,a),this.scrollCursorIntoView(f,a)},w.prototype.scrollCursorIntoView=function(v,f,a){if(this.$size.scrollerHeight!==0){var h=this.$cursorLayer.getPixelPosition(v),u=h.left,g=h.top,A=a&&a.top||0,L=a&&a.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var M=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;M+A>g?(f&&M+A>g+this.lineHeight&&(g-=f*this.$size.scrollerHeight),g===0&&(g=-this.scrollMargin.top),this.session.setScrollTop(g)):M+this.$size.scrollerHeight-L=1-this.scrollMargin.top||f>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||v<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||v>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},w.prototype.pixelToScreenCoordinates=function(v,f){var a;if(this.$hasCssTransforms){a={top:0,left:0};var h=this.$fontMetrics.transformCoordinates([v,f]);v=h[1]-this.gutterWidth-this.margin.left,f=h[0]}else a=this.scroller.getBoundingClientRect();var u=v+this.scrollLeft-a.left-this.$padding,g=u/this.characterWidth,A=Math.floor((f+this.scrollTop-a.top)/this.lineHeight),L=this.$blockCursor?Math.floor(g):Math.round(g);return{row:A,column:L,side:g-L>0?1:-1,offsetX:u}},w.prototype.screenToTextCoordinates=function(v,f){var a;if(this.$hasCssTransforms){a={top:0,left:0};var h=this.$fontMetrics.transformCoordinates([v,f]);v=h[1]-this.gutterWidth-this.margin.left,f=h[0]}else a=this.scroller.getBoundingClientRect();var u=v+this.scrollLeft-a.left-this.$padding,g=u/this.characterWidth,A=this.$blockCursor?Math.floor(g):Math.round(g),L=Math.floor((f+this.scrollTop-a.top)/this.lineHeight);return this.session.screenToDocumentPosition(L,Math.max(A,0),u)},w.prototype.textToScreenCoordinates=function(v,f){var a=this.scroller.getBoundingClientRect(),h=this.session.documentToScreenPosition(v,f),u=this.$padding+(this.session.$bidiHandler.isBidiRow(h.row,v)?this.session.$bidiHandler.getPosLeft(h.column):Math.round(h.column*this.characterWidth)),g=h.row*this.lineHeight;return{pageX:a.left+u-this.scrollLeft,pageY:a.top+g-this.scrollTop}},w.prototype.visualizeFocus=function(){k.addCssClass(this.container,"ace_focus")},w.prototype.visualizeBlur=function(){k.removeCssClass(this.container,"ace_focus")},w.prototype.showComposition=function(v){this.$composition=v,v.cssText||(v.cssText=this.textarea.style.cssText),v.useTextareaForIME==null&&(v.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(k.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):v.markerId=this.session.addMarker(v.markerRange,"ace_composition_marker","text")},w.prototype.setCompositionText=function(v){var f=this.session.selection.cursor;this.addToken(v,"composition_placeholder",f.row,f.column),this.$moveTextAreaToCursor()},w.prototype.hideComposition=function(){if(!!this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),k.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var v=this.session.selection.cursor;this.removeExtraToken(v.row,v.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},w.prototype.setGhostText=function(v,f){var a=this.session.selection.cursor,h=f||{row:a.row,column:a.column};this.removeGhostText();var u=v.split(` `);this.addToken(u[0],"ghost_text",h.row,h.column),this.$ghostText={text:v,position:{row:h.row,column:h.column}},u.length>1&&(this.$ghostTextWidget={text:u.slice(1).join(` `),row:h.row,column:h.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget))},w.prototype.removeGhostText=function(){if(!!this.$ghostText){var v=this.$ghostText.position;this.removeExtraToken(v.row,v.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},w.prototype.addToken=function(v,f,a,h){var u=this.session;u.bgTokenizer.lines[a]=null;var g={type:f,value:v},A=u.getTokens(a);if(h==null||!A.length)A.push(g);else for(var L=0,M=0;M1||Math.abs(v.$size.height-h)>1?v.$resizeTimer.delay():v.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},w}();p.prototype.CHANGE_CURSOR=1,p.prototype.CHANGE_MARKER=2,p.prototype.CHANGE_GUTTER=4,p.prototype.CHANGE_SCROLL=8,p.prototype.CHANGE_LINES=16,p.prototype.CHANGE_TEXT=32,p.prototype.CHANGE_SIZE=64,p.prototype.CHANGE_MARKER_BACK=128,p.prototype.CHANGE_MARKER_FRONT=256,p.prototype.CHANGE_FULL=512,p.prototype.CHANGE_H_SCROLL=1024,p.prototype.$changes=0,p.prototype.$padding=null,p.prototype.$frozen=!1,p.prototype.STEPS=8,R.implement(p.prototype,S),s.defineOptions(p.prototype,"renderer",{useResizeObserver:{set:function(w){!w&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):w&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(w){this.$textLayer.setShowInvisibles(w)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(w){typeof w=="number"&&(this.$printMarginColumn=w),this.$showPrintMargin=!!w,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(w){this.$gutter.style.display=w?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(w){this.$gutterLayer.$useSvgGutterIcons=w},initialValue:!1},fadeFoldWidgets:{set:function(w){k.setCssClass(this.$gutter,"ace_fade-fold-widgets",w)},initialValue:!1},showFoldWidgets:{set:function(w){this.$gutterLayer.setShowFoldWidgets(w),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(w){this.$textLayer.setDisplayIndentGuides(w)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(w){this.$textLayer.setHighlightIndentGuides(w)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(w){this.$gutterLayer.setHighlightGutterLine(w),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(w){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(w){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(w){typeof w=="number"&&(w=w+"px"),this.container.style.fontSize=w,this.updateFontSize()},initialValue:12},fontFamily:{set:function(w){this.container.style.fontFamily=w,this.updateFontSize()}},maxLines:{set:function(w){this.updateFull()}},minLines:{set:function(w){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(w){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(w){w=+w||0,this.$scrollPastEnd!=w&&(this.$scrollPastEnd=w,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(w){this.$gutterLayer.$fixedWidth=!!w,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(w){this.$updateCustomScrollbar(w)},initialValue:!1},theme:{set:function(w){this.setTheme(w)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!b.isMobile&&!b.isIE}}),x.VirtualRenderer=p}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(E,x,P){"use strict";var R=E("../lib/oop"),k=E("../lib/net"),C=E("../lib/event_emitter").EventEmitter,s=E("../config");function l(t){var r="importScripts('"+k.qualifyURL(t)+"');";try{return new Blob([r],{type:"application/javascript"})}catch(d){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,c=new o;return c.append(r),c.getBlob("application/javascript")}}function e(t){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var r=l(t),o=window.URL||window.webkitURL,c=o.createObjectURL(r);return new Worker(c)}return new Worker(t)}var n=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){R.implement(this,C),this.$createWorkerFromOldConfig=function(t,r,o,c,d){if(E.nameToUrl&&!E.toUrl&&(E.toUrl=E.nameToUrl),s.get("packaged")||!E.toUrl)c=c||s.moduleUrl(r,"worker");else{var $=this.$normalizePath;c=c||$(E.toUrl("ace/worker/worker.js",null,"_"));var S={};t.forEach(function(y){S[y]=$(E.toUrl(y,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=e(c),d&&this.send("importScripts",d),this.$worker.postMessage({init:!0,tlns:S,module:r,classname:o}),this.$worker},this.onMessage=function(t){var r=t.data;switch(r.type){case"event":this._signal(r.name,{data:r.data});break;case"call":var o=this.callbacks[r.id];o&&(o(r.data),delete this.callbacks[r.id]);break;case"error":this.reportError(r.data);break;case"log":window.console&&console.log&&console.log.apply(console,r.data);break}},this.reportError=function(t){window.console&&console.error&&console.error(t)},this.$normalizePath=function(t){return k.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,r){this.$worker.postMessage({command:t,args:r})},this.call=function(t,r,o){if(o){var c=this.callbackId++;this.callbacks[c]=o,r.push(c)}this.send(t,r)},this.emit=function(t,r){try{r.data&&r.data.err&&(r.data.err={message:r.data.err.message,stack:r.data.err.stack,code:r.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:r.data}})}catch(o){console.error(o.stack)}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;!t||(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(n.prototype);var i=function(t,r,o){var c=null,d=!1,$=Object.create(C),S=[],y=new n({messageBuffer:S,terminate:function(){},postMessage:function(b){S.push(b),!!c&&(d?setTimeout(m):m())}});y.setEmitSync=function(b){d=b};var m=function(){var b=S.shift();b.command?c[b.command].apply(c,b.args):b.event&&$._signal(b.event,b.data)};return $.postMessage=function(b){y.onMessage({data:b})},$.callback=function(b,p){this.postMessage({type:"call",id:p,data:b})},$.emit=function(b,p){this.postMessage({type:"event",name:b,data:p})},s.loadModule(["worker",r],function(b){for(c=new b[o]($);S.length;)m()}),y};x.UIWorkerClient=i,x.WorkerClient=n,x.createWorker=e}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(E,x,P){"use strict";var R=E("./range").Range,k=E("./lib/event_emitter").EventEmitter,C=E("./lib/oop"),s=function(){function l(e,n,i,t,r,o){var c=this;this.length=n,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){c.onCursorChange()})},this.$pos=i;var d=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=d.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return l.prototype.setup=function(){var e=this,n=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=n.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=i.addMarker(new R(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(r){var o=n.createAnchor(r.row,r.column);o.$insertRight=!0,o.detach(),e.others.push(o)}),i.setUndoSelect(!1)},l.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,n=this;this.othersActive=!0,this.others.forEach(function(i){i.markerId=e.addMarker(new R(i.row,i.column,i.row,i.column+n.length),n.othersClass,null,!1)})}},l.prototype.hideOtherMarkers=function(){if(!!this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&n.start.column<=this.pos.column+this.length+1,r=n.start.column-this.pos.column;if(this.updateAnchors(e),t&&(this.length+=i),t&&!this.session.$fromUndo){if(e.action==="insert")for(var o=this.others.length-1;o>=0;o--){var c=this.others[o],d={row:c.row,column:c.column+r};this.doc.insertMergedLines(d,e.lines)}else if(e.action==="remove")for(var o=this.others.length-1;o>=0;o--){var c=this.others[o],d={row:c.row,column:c.column+r};this.doc.remove(new R(d.row,d.column,d.row,d.column-i))}}this.$updating=!1,this.updateMarkers()}},l.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var n=this.others.length;n--;)this.others[n].onChange(e);this.updateMarkers()},l.prototype.updateMarkers=function(){if(!this.$updating){var e=this,n=this.session,i=function(r,o){n.removeMarker(r.markerId),r.markerId=n.addMarker(new R(r.row,r.column,r.row,r.column+e.length),o,null,!1)};i(this.pos,this.mainClass);for(var t=this.others.length;t--;)i(this.others[t],this.othersClass)}},l.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var n=this.session.selection.getCursor();n.row===this.pos.row&&n.column>=this.pos.column&&n.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},l.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},l.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var e=this.session.getUndoManager(),n=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i1?k.multiSelect.joinSelections():k.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(k){k.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(k){k.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(k){k.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],x.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(k){k.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(k){return k&&k.inMultiSelectMode}}];var R=E("../keyboard/hash_handler").HashHandler;x.keyboardHandler=new R(x.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(E,x,P){var R=E("./range_list").RangeList,k=E("./range").Range,C=E("./selection").Selection,s=E("./mouse/multi_select_handler").onMouseDown,l=E("./lib/event"),e=E("./lib/lang"),n=E("./commands/multi_select_commands");x.commands=n.defaultCommands.concat(n.multiSelectCommands);var i=E("./search").Search,t=new i;function r(y,m,b){return t.$options.wrap=!0,t.$options.needle=m,t.$options.backwards=b==-1,t.find(y)}var o=E("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(o.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(y,m){if(!!y){if(!this.inMultiSelectMode&&this.rangeCount===0){var b=this.toOrientedRange();if(this.rangeList.add(b),this.rangeList.add(y),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),m||this.fromOrientedRange(y);this.rangeList.removeAll(),this.rangeList.add(b),this.$onAddRange(b)}y.cursor||(y.cursor=y.end);var p=this.rangeList.add(y);return this.$onAddRange(y),p.length&&this.$onRemoveRange(p),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),m||this.fromOrientedRange(y)}},this.toSingleRange=function(y){y=y||this.ranges[0];var m=this.rangeList.removeAll();m.length&&this.$onRemoveRange(m),y&&this.fromOrientedRange(y)},this.substractPoint=function(y){var m=this.rangeList.substractPoint(y);if(m)return this.$onRemoveRange(m),m[0]},this.mergeOverlappingRanges=function(){var y=this.rangeList.merge();y.length&&this.$onRemoveRange(y)},this.$onAddRange=function(y){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(y),this._signal("addRange",{range:y})},this.$onRemoveRange=function(y){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var m=this.rangeList.ranges.pop();y.push(m),this.rangeCount=0}for(var b=y.length;b--;){var p=this.ranges.indexOf(y[b]);this.ranges.splice(p,1)}this._signal("removeRange",{ranges:y}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),m=m||this.ranges[0],m&&!m.isEqual(this.getRange())&&this.fromOrientedRange(m)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new R,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var y=this.ranges.length?this.ranges:[this.getRange()],m=[],b=0;b1){var y=this.rangeList.ranges,m=y[y.length-1],b=k.fromPoints(y[0].start,m.end);this.toSingleRange(),this.setSelectionRange(b,m.cursor==m.start)}else{var p=this.session.documentToScreenPosition(this.cursor),w=this.session.documentToScreenPosition(this.anchor),v=this.rectangularRangeBlock(p,w);v.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(y,m,b){var p=[],w=y.column0;)I--;if(I>0)for(var F=0;p[F].isEmpty();)F++;for(var _=I;_>=F;_--)p[_].isEmpty()&&p.splice(_,1)}return p}}.call(C.prototype);var c=E("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(y){y.cursor||(y.cursor=y.end);var m=this.getSelectionStyle();return y.marker=this.session.addMarker(y,"ace_selection",m),this.session.$selectionMarkers.push(y),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,y},this.removeSelectionMarker=function(y){if(!!y.marker){this.session.removeMarker(y.marker);var m=this.session.$selectionMarkers.indexOf(y);m!=-1&&this.session.$selectionMarkers.splice(m,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(y){for(var m=this.session.$selectionMarkers,b=y.length;b--;){var p=y[b];if(!!p.marker){this.session.removeMarker(p.marker);var w=m.indexOf(p);w!=-1&&m.splice(w,1)}}this.session.selectionMarkerCount=m.length},this.$onAddRange=function(y){this.addSelectionMarker(y.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(y){this.removeSelectionMarkers(y.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(y){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(n.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(y){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(n.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(y){var m=y.command,b=y.editor;if(!!b.multiSelect){if(m.multiSelectAction)m.multiSelectAction=="forEach"?p=b.forEachSelection(m,y.args):m.multiSelectAction=="forEachLine"?p=b.forEachSelection(m,y.args,!0):m.multiSelectAction=="single"?(b.exitMultiSelectMode(),p=m.exec(b,y.args||{})):p=m.multiSelectAction(b,y.args||{});else{var p=m.exec(b,y.args||{});b.multiSelect.addRange(b.multiSelect.toOrientedRange()),b.multiSelect.mergeOverlappingRanges()}return p}},this.forEachSelection=function(y,m,b){if(!this.inVirtualSelectionMode){var p=b&&b.keepOrder,w=b==!0||b&&b.$byLines,v=this.session,f=this.selection,a=f.rangeList,h=(p?f:a).ranges,u;if(!h.length)return y.exec?y.exec(this,m||{}):y(this,m||{});var g=f._eventRegistry;f._eventRegistry={};var A=new C(v);this.inVirtualSelectionMode=!0;for(var L=h.length;L--;){if(w)for(;L>0&&h[L].start.row==h[L-1].end.row;)L--;A.fromOrientedRange(h[L]),A.index=L,this.selection=v.selection=A;var M=y.exec?y.exec(this,m||{}):y(this,m||{});!u&&M!==void 0&&(u=M),A.toOrientedRange(h[L])}A.detach(),this.selection=v.selection=f,this.inVirtualSelectionMode=!1,f._eventRegistry=g,f.mergeOverlappingRanges(),f.ranges[0]&&f.fromOrientedRange(f.ranges[0]);var T=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),T&&T.from==T.to&&this.renderer.animateScrolling(T.from),u}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var y="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var m=this.multiSelect.rangeList.ranges,b=[],p=0;p0);f<0&&(f=0),a>=u&&(a=u-1)}var A=this.session.removeFullLines(f,a);A=this.$reAlignText(A,h),this.session.insert({row:f,column:0},A.join(` `)+` `),h||(v.start.column=0,v.end.column=A[A.length-1].length),this.selection.setRange(v)}else{w.forEach(function(I){m.substractPoint(I.cursor)});var L=0,M=Infinity,T=b.map(function(I){var F=I.cursor,_=y.getLine(F.row),W=_.substr(F.column).search(/\S/g);return W==-1&&(W=0),F.column>L&&(L=F.column),WO?y.insert(_,e.stringRepeat(" ",W-O)):y.remove(new k(_.row,_.column,_.row,_.column-W+O)),I.start.column=I.end.column=L,I.start.row=I.end.row=_.row,I.cursor=I.end}),m.fromOrientedRange(b[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(y,m){var b=!0,p=!0,w,v,f;return y.map(function(A){var L=A.match(/(\s*)(.*?)(\s*)([=:].*)/);return L?w==null?(w=L[1].length,v=L[2].length,f=L[3].length,L):(w+v+f!=L[1].length+L[2].length+L[3].length&&(p=!1),w!=L[1].length&&(b=!1),w>L[1].length&&(w=L[1].length),vL[3].length&&(f=L[3].length),L):[A]}).map(m?h:b?p?u:h:g);function a(A){return e.stringRepeat(" ",A)}function h(A){return A[2]?a(w)+A[2]+a(v-A[2].length+f)+A[4].replace(/^([=:])\s+/,"$1 "):A[0]}function u(A){return A[2]?a(w+v-A[2].length)+A[2]+a(f)+A[4].replace(/^([=:])\s+/,"$1 "):A[0]}function g(A){return A[2]?a(w)+A[2]+a(f)+A[4].replace(/^([=:])\s+/,"$1 "):A[0]}}}).call(c.prototype);function d(y,m){return y.row==m.row&&y.column==m.column}x.onSessionChange=function(y){var m=y.session;m&&!m.multiSelect&&(m.$selectionMarkers=[],m.selection.$initRangeList(),m.multiSelect=m.selection),this.multiSelect=m&&m.multiSelect;var b=y.oldSession;b&&(b.multiSelect.off("addRange",this.$onAddRange),b.multiSelect.off("removeRange",this.$onRemoveRange),b.multiSelect.off("multiSelect",this.$onMultiSelect),b.multiSelect.off("singleSelect",this.$onSingleSelect),b.multiSelect.lead.off("change",this.$checkMultiselectChange),b.multiSelect.anchor.off("change",this.$checkMultiselectChange)),m&&(m.multiSelect.on("addRange",this.$onAddRange),m.multiSelect.on("removeRange",this.$onRemoveRange),m.multiSelect.on("multiSelect",this.$onMultiSelect),m.multiSelect.on("singleSelect",this.$onSingleSelect),m.multiSelect.lead.on("change",this.$checkMultiselectChange),m.multiSelect.anchor.on("change",this.$checkMultiselectChange)),m&&this.inMultiSelectMode!=m.selection.inMultiSelectMode&&(m.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function $(y){y.$multiselectOnSessionChange||(y.$onAddRange=y.$onAddRange.bind(y),y.$onRemoveRange=y.$onRemoveRange.bind(y),y.$onMultiSelect=y.$onMultiSelect.bind(y),y.$onSingleSelect=y.$onSingleSelect.bind(y),y.$multiselectOnSessionChange=x.onSessionChange.bind(y),y.$checkMultiselectChange=y.$checkMultiselectChange.bind(y),y.$multiselectOnSessionChange(y),y.on("changeSession",y.$multiselectOnSessionChange),y.on("mousedown",s),y.commands.addCommands(n.defaultCommands),S(y))}function S(y){if(!y.textInput)return;var m=y.textInput.getElement(),b=!1;l.addListener(m,"keydown",function(w){var v=w.keyCode==18&&!(w.ctrlKey||w.shiftKey||w.metaKey);y.$blockSelectEnabled&&v?b||(y.renderer.setMouseCursor("crosshair"),b=!0):b&&p()},y),l.addListener(m,"keyup",p,y),l.addListener(m,"blur",p,y);function p(w){b&&(y.renderer.setMouseCursor(""),b=!1)}}x.MultiSelect=$,E("./config").defineOptions(c.prototype,"editor",{enableMultiselect:{set:function(y){$(this),y?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",s))},value:!0},enableBlockSelect:{set:function(y){this.$blockSelectEnabled=y},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(E,x,P){"use strict";var R=E("../../range").Range,k=x.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(C,s,l){var e=C.getLine(l);return this.foldingStartMarker.test(e)?"start":s=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(C,s,l){return null},this.indentationBlock=function(C,s,l){var e=/\S/,n=C.getLine(s),i=n.search(e);if(i!=-1){for(var t=l||n.length,r=C.getLength(),o=s,c=s;++so){var S=C.getLine(c).length;return new R(o,t,c,S)}}},this.openingBracketBlock=function(C,s,l,e,n){var i={row:l,column:e+1},t=C.$findClosingBracket(s,i,n);if(!!t){var r=C.foldWidgets[t.row];return r==null&&(r=C.getFoldWidget(t.row)),r=="start"&&t.row>i.row&&(t.row--,t.column=C.getLine(t.row).length),R.fromPoints(i,t)}},this.closingBracketBlock=function(C,s,l,e,n){var i={row:l,column:e},t=C.$findOpeningBracket(s,i);if(!!t)return t.column++,i.column--,R.fromPoints(t,i)}}).call(k.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(E,x,P){"use strict";var R=E("../line_widgets").LineWidgets,k=E("../lib/dom"),C=E("../range").Range;function s(e,n,i){for(var t=0,r=e.length-1;t<=r;){var o=t+r>>1,c=i(n,e[o]);if(c>0)t=o+1;else if(c<0)r=o-1;else return o}return-(t+1)}function l(e,n,i){var t=e.getAnnotations().sort(C.comparePoints);if(!!t.length){var r=s(t,{row:n,column:-1},C.comparePoints);r<0&&(r=-r-1),r>=t.length?r=i>0?0:t.length-1:r===0&&i<0&&(r=t.length-1);var o=t[r];if(!(!o||!i)){if(o.row===n){do o=t[r+=i];while(o&&o.row===n);if(!o)return t.slice()}var c=[];n=o.row;do c[i<0?"unshift":"push"](o),o=t[r+=i];while(o&&o.row==n);return c.length&&c}}}x.showErrorMarker=function(e,n){var i=e.session;i.widgetManager||(i.widgetManager=new R(i),i.widgetManager.attach(e));var t=e.getCursorPosition(),r=t.row,o=i.widgetManager.getWidgetsAtRow(r).filter(function(w){return w.type=="errorMarker"})[0];o?o.destroy():r-=n;var c=l(i,r,n),d;if(c){var $=c[0];t.column=($.pos&&typeof $.column!="number"?$.pos.sc:$.column)||0,t.row=$.row,d=e.renderer.$gutterLayer.$annotations[t.row]}else{if(o)return;d={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(t.row),e.selection.moveToPosition(t);var S={row:t.row,fixedWidth:!0,coverGutter:!0,el:k.createElement("div"),type:"errorMarker"},y=S.el.appendChild(k.createElement("div")),m=S.el.appendChild(k.createElement("div"));m.className="error_widget_arrow "+d.className;var b=e.renderer.$cursorLayer.getPixelPosition(t).left;m.style.left=b+e.renderer.gutterWidth-5+"px",S.el.className="error_widget_wrapper",y.className="error_widget "+d.className,y.innerHTML=d.text.join("
"),y.appendChild(k.createElement("div"));var p=function(w,v,f){if(v===0&&(f==="esc"||f==="return"))return S.destroy(),{command:"null"}};S.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(p),i.widgetManager.removeLineWidget(S),e.off("changeSelection",S.destroy),e.off("changeSession",S.destroy),e.off("mouseup",S.destroy),e.off("change",S.destroy))},e.keyBinding.addKeyboardHandler(p),e.on("changeSelection",S.destroy),e.on("changeSession",S.destroy),e.on("mouseup",S.destroy),e.on("change",S.destroy),e.session.widgetManager.addLineWidget(S),S.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:S.el.offsetHeight})},k.importCssString(` .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; } `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(E,x,P){"use strict";E("./loader_build")(x);var R=E("./lib/dom"),k=E("./range").Range,C=E("./editor").Editor,s=E("./edit_session").EditSession,l=E("./undomanager").UndoManager,e=E("./virtual_renderer").VirtualRenderer;E("./worker/worker_client"),E("./keyboard/hash_handler"),E("./placeholder"),E("./multi_select"),E("./mode/folding/fold_mode"),E("./theme/textmate"),E("./ext/error_marker"),x.config=E("./config"),x.edit=function(n,i){if(typeof n=="string"){var t=n;if(n=document.getElementById(t),!n)throw new Error("ace.edit can't find div #"+t)}if(n&&n.env&&n.env.editor instanceof C)return n.env.editor;var r="";if(n&&/input|textarea/i.test(n.tagName)){var o=n;r=o.value,n=R.createElement("pre"),o.parentNode.replaceChild(n,o)}else n&&(r=n.textContent,n.innerHTML="");var c=x.createEditSession(r),d=new C(new e(n),c,i),$={document:c,editor:d,onResize:d.resize.bind(d,null)};return o&&($.textarea=o),d.on("destroy",function(){$.editor.container.env=null}),d.container.env=d.env=$,d},x.createEditSession=function(n,i){var t=new s(n,i);return t.setUndoManager(new l),t},x.Range=k,x.Editor=C,x.EditSession=s,x.UndoManager=l,x.VirtualRenderer=e,x.version=x.config.version}),function(){ace.require(["ace/ace"],function(E){E&&(E.config.init(!0),E.define=ace.define),window.ace||(window.ace=E);for(var x in E)E.hasOwnProperty(x)&&(window.ace[x]=E[x]);window.ace.default=window.ace,fe&&(fe.exports=window.ace)})}()}}]);