GGSheng's picture
feat: deploy Gemma 4 to hf space
020c337 verified
var pe=(L,k)=>()=>(k||L((k={exports:{}}).exports,k),k.exports);var ve=pe((me,ue)=>{(function(){function L(t){var e=N;N[t]||(N[t]={}),e=N[t],(!e.define||!e.define.packaged)&&(S.original=e.define,e.define=S,e.define.packaged=!0),(!e.require||!e.require.packaged)&&(d.original=e.require,e.require=d,e.require.packaged=!0)}var k="ace",N=function(){return this}();!N&&typeof window<"u"&&(N=window);var S=function(t,e,i){if(typeof t!="string"){S.original&&S.original.apply(this,arguments);return}arguments.length==2&&(i=e),S.modules[t]||(S.payloads[t]=i,S.modules[t]=null)};S.modules={},S.payloads={};var x=function(t,e,i){if(typeof e=="string"){var n=a(t,e);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(e)==="[object Array]"){for(var o=[],l=0,g=e.length;l<g;++l){var v=a(t,e[l]);if(v==null&&d.original)return;o.push(v)}return i&&i.apply(null,o)||!0}},d=function(t,e){var i=x("",t,e);return i==null&&d.original?d.original.apply(this,arguments):i},c=function(t,e){if(e.indexOf("!")!==-1){var i=e.split("!");return c(t,i[0])+"!"+c(t,i[1])}if(e.charAt(0)=="."){var n=t.split("/").slice(0,-1).join("/");for(e=n+"/"+e;e.indexOf(".")!==-1&&o!=e;){var o=e;e=e.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return e},a=function(t,e){e=c(t,e);var i=S.modules[e];if(!i){if(i=S.payloads[e],typeof i=="function"){var n={},o={id:e,uri:"",exports:n,packaged:!0},l=function(v,$){return x(e,v,$)},g=i(l,n,o);n=g||o.exports,S.modules[e]=n,delete S.payloads[e]}i=S.modules[e]=n||i}return i};L(k)})(),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],function(L,k,N){typeof Element<"u"&&!Element.prototype.remove&&Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(L,k,N){k.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},k.getOS=function(){return k.isMac?k.OS.MAC:k.isLinux?k.OS.LINUX:k.OS.WINDOWS};var S=typeof navigator=="object"?navigator:{},x=(/mac|win|linux/i.exec(S.platform)||["other"])[0].toLowerCase(),d=S.userAgent||"",c=S.appName||"";k.isWin=x=="win",k.isMac=x=="mac",k.isLinux=x=="linux",k.isIE=c=="Microsoft Internet Explorer"||c.indexOf("MSAppHost")>=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),k.isOldIE=k.isIE&&k.isIE<9,k.isGecko=k.isMozilla=d.match(/ Gecko\/\d+/),k.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",k.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,k.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,k.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,k.isAIR=d.indexOf("AdobeAIR")>=0,k.isAndroid=d.indexOf("Android")>=0,k.isChromeOS=d.indexOf(" CrOS ")>=0,k.isIOS=/iPad|iPhone|iPod/.test(d)&&!window.MSStream,k.isIOS&&(k.isMac=!0),k.isMobile=k.isIOS||k.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(L,k,N){var S=L("./useragent"),x="http://www.w3.org/1999/xhtml";if(k.buildDom=function c(a,t,e){if(typeof a=="string"&&a){var i=document.createTextNode(a);return t&&t.appendChild(i),i}if(!Array.isArray(a))return a&&a.appendChild&&t&&t.appendChild(a),a;if(typeof a[0]!="string"||!a[0]){for(var n=[],o=0;o<a.length;o++){var l=c(a[o],t,e);l&&n.push(l)}return n}var g=document.createElement(a[0]),v=a[1],$=1;v&&typeof v=="object"&&!Array.isArray(v)&&($=2);for(var o=$;o<a.length;o++)c(a[o],g,e);return $==2&&Object.keys(v).forEach(function(y){var p=v[y];y==="class"?g.className=Array.isArray(p)?p.join(" "):p:typeof p=="function"||y=="value"||y[0]=="$"?g[y]=p:y==="ref"?e&&(e[p]=g):p!=null&&g.setAttribute(y,p)}),t&&t.appendChild(g),g},k.getDocumentHead=function(c){return c||(c=document),c.head||c.getElementsByTagName("head")[0]||c.documentElement},k.createElement=function(c,a){return document.createElementNS?document.createElementNS(a||x,c):document.createElement(c)},k.removeChildren=function(c){c.innerHTML=""},k.createTextNode=function(c,a){var t=a?a.ownerDocument:document;return t.createTextNode(c)},k.createFragment=function(c){var a=c?c.ownerDocument:document;return a.createDocumentFragment()},k.hasCssClass=function(c,a){var t=(c.className+"").split(/\s+/g);return t.indexOf(a)!==-1},k.addCssClass=function(c,a){k.hasCssClass(c,a)||(c.className+=" "+a)},k.removeCssClass=function(c,a){for(var t=c.className.split(/\s+/g);;){var e=t.indexOf(a);if(e==-1)break;t.splice(e,1)}c.className=t.join(" ")},k.toggleCssClass=function(c,a){for(var t=c.className.split(/\s+/g),e=!0;;){var i=t.indexOf(a);if(i==-1)break;e=!1,t.splice(i,1)}return e&&t.push(a),c.className=t.join(" "),e},k.setCssClass=function(c,a,t){t?k.addCssClass(c,a):k.removeCssClass(c,a)},k.hasCssString=function(c,a){var t=0,e;if(a=a||document,e=a.querySelectorAll("style")){for(;t<e.length;)if(e[t++].id===c)return!0}},k.importCssString=function(c,a,t){var e=t;!t||!t.getRootNode?e=document:(e=t.getRootNode(),(!e||e==t)&&(e=document));var i=e.ownerDocument||e;if(a&&k.hasCssString(a,e))return null;a&&(c+="\n/*# sourceURL=ace/css/"+a+" */");var n=k.createElement("style");n.appendChild(i.createTextNode(c)),a&&(n.id=a),e==i&&(e=k.getDocumentHead(i)),e.insertBefore(n,e.firstChild)},k.importCssStylsheet=function(c,a){k.buildDom(["link",{rel:"stylesheet",href:c}],k.getDocumentHead(a))},k.scrollbarWidth=function(c){var a=k.createElement("ace_inner");a.style.width="100%",a.style.minWidth="0px",a.style.height="200px",a.style.display="block";var t=k.createElement("ace_outer"),e=t.style;e.position="absolute",e.left="-10000px",e.overflow="hidden",e.width="200px",e.minWidth="0px",e.height="150px",e.display="block",t.appendChild(a);var i=c.documentElement;i.appendChild(t);var n=a.offsetWidth;e.overflow="scroll";var o=a.offsetWidth;return n==o&&(o=t.clientWidth),i.removeChild(t),n-o},typeof document>"u"&&(k.importCssString=function(){}),k.computedStyle=function(c,a){return window.getComputedStyle(c,"")||{}},k.setStyle=function(c,a,t){c[a]!==t&&(c[a]=t)},k.HAS_CSS_ANIMATION=!1,k.HAS_CSS_TRANSFORMS=!1,k.HI_DPI=S.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,typeof document<"u"){var d=document.createElement("div");k.HI_DPI&&d.style.transform!==void 0&&(k.HAS_CSS_TRANSFORMS=!0),!S.isEdge&&typeof d.style.animationName<"u"&&(k.HAS_CSS_ANIMATION=!0),d=null}k.HAS_CSS_TRANSFORMS?k.translate=function(c,a,t){c.style.transform="translate("+Math.round(a)+"px, "+Math.round(t)+"px)"}:k.translate=function(c,a,t){c.style.top=Math.round(t)+"px",c.style.left=Math.round(a)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(L,k,N){k.inherits=function(S,x){S.super_=x,S.prototype=Object.create(x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}})},k.mixin=function(S,x){for(var d in x)S[d]=x[d];return S},k.implement=function(S,x){k.mixin(S,x)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(L,k,N){var S=L("./oop"),x=function(){var d={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},c,a;for(a in d.FUNCTION_KEYS)c=d.FUNCTION_KEYS[a].toLowerCase(),d[c]=parseInt(a,10);for(a in d.PRINTABLE_KEYS)c=d.PRINTABLE_KEYS[a].toLowerCase(),d[c]=parseInt(a,10);return S.mixin(d,d.MODIFIER_KEYS),S.mixin(d,d.PRINTABLE_KEYS),S.mixin(d,d.FUNCTION_KEYS),d.enter=d.return,d.escape=d.esc,d.del=d.delete,d[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)d.KEY_MODS[e]=t.filter(function(i){return e&d.KEY_MODS[i]}).join("-")+"-"}(),d.KEY_MODS[0]="",d.KEY_MODS[-1]="input-",d}();S.mixin(k,x),k.keyCodeToString=function(d){var c=x[d];return typeof c!="string"&&(c=String.fromCharCode(d)),c.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(L,k,N){function S(){o=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){o={passive:!1}}})}catch(y){}}function x(){return o==null&&S(),o}function d(y,p,r){this.elem=y,this.type=p,this.callback=r}function c(y,p,r){var h=v(p);if(!e.isMac&&i){if(p.getModifierState&&(p.getModifierState("OS")||p.getModifierState("Win"))&&(h|=8),i.altGr){if((3&h)==3)return;i.altGr=0}if(r===18||r===17){var w="location"in p?p.location:p.keyLocation;if(r===17&&w===1)i[r]==1&&(n=p.timeStamp);else if(r===18&&h===3&&w===2){var u=p.timeStamp-n;u<50&&(i.altGr=!0)}}}if(r in t.MODIFIER_KEYS&&(r=-1),!h&&r===13){var w="location"in p?p.location:p.keyLocation;if(w===3&&(y(p,h,-r),p.defaultPrevented))return}if(e.isChromeOS&&h&8){if(y(p,h,r),p.defaultPrevented)return;h&=-9}return h||r in t.FUNCTION_KEYS||r in t.PRINTABLE_KEYS?y(p,h,r):!1}function a(){i=Object.create(null)}var t=L("./keys"),e=L("./useragent"),i=null,n=0,o;d.prototype.destroy=function(){g(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var l=k.addListener=function(y,p,r,h){y.addEventListener(p,r,x()),h&&h.$toDestroy.push(new d(y,p,r))},g=k.removeListener=function(y,p,r){y.removeEventListener(p,r,x())};k.stopEvent=function(y){return k.stopPropagation(y),k.preventDefault(y),!1},k.stopPropagation=function(y){y.stopPropagation&&y.stopPropagation()},k.preventDefault=function(y){y.preventDefault&&y.preventDefault()},k.getButton=function(y){return y.type=="dblclick"?0:y.type=="contextmenu"||e.isMac&&y.ctrlKey&&!y.altKey&&!y.shiftKey?2:y.button},k.capture=function(y,p,r){function h(u){p&&p(u),r&&r(u),g(w,"mousemove",p),g(w,"mouseup",h),g(w,"dragstart",h)}var w=y&&y.ownerDocument||document;return l(w,"mousemove",p),l(w,"mouseup",h),l(w,"dragstart",h),h},k.addMouseWheelListener=function(y,p,r){"onmousewheel"in y?l(y,"mousewheel",function(h){var w=8;h.wheelDeltaX!==void 0?(h.wheelX=-h.wheelDeltaX/w,h.wheelY=-h.wheelDeltaY/w):(h.wheelX=0,h.wheelY=-h.wheelDelta/w),p(h)},r):"onwheel"in y?l(y,"wheel",function(h){var w=.35;switch(h.deltaMode){case h.DOM_DELTA_PIXEL:h.wheelX=h.deltaX*w||0,h.wheelY=h.deltaY*w||0;break;case h.DOM_DELTA_LINE:case h.DOM_DELTA_PAGE:h.wheelX=(h.deltaX||0)*5,h.wheelY=(h.deltaY||0)*5}p(h)},r):l(y,"DOMMouseScroll",function(h){h.axis&&h.axis==h.HORIZONTAL_AXIS?(h.wheelX=(h.detail||0)*5,h.wheelY=0):(h.wheelX=0,h.wheelY=(h.detail||0)*5),p(h)},r)},k.addMultiMouseDownListener=function(y,p,r,h,w){function u(A){if(k.getButton(A)!==0?f=0:A.detail>1?(f++,f>4&&(f=1)):f=1,e.isIE){var R=Math.abs(A.clientX-s)>5||Math.abs(A.clientY-m)>5;(!b||R)&&(f=1),b&&clearTimeout(b),b=setTimeout(function(){b=null},p[f-1]||600),f==1&&(s=A.clientX,m=A.clientY)}if(A._clicks=f,r[h]("mousedown",A),f>4)f=0;else if(f>1)return r[h](C[f],A)}var f=0,s,m,b,C={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(y)||(y=[y]),y.forEach(function(A){l(A,"mousedown",u,w)})};var v=function(y){return 0|(y.ctrlKey?1:0)|(y.altKey?2:0)|(y.shiftKey?4:0)|(y.metaKey?8:0)};if(k.getModifierString=function(y){return t.KEY_MODS[v(y)]},k.addCommandKeyListener=function(y,p,r){if(e.isOldGecko||e.isOpera&&!("KeyboardEvent"in window)){var h=null;l(y,"keydown",function(u){h=u.keyCode},r),l(y,"keypress",function(u){return c(p,u,h)},r)}else{var w=null;l(y,"keydown",function(u){i[u.keyCode]=(i[u.keyCode]||0)+1;var f=c(p,u,u.keyCode);return w=u.defaultPrevented,f},r),l(y,"keypress",function(u){w&&(u.ctrlKey||u.altKey||u.shiftKey||u.metaKey)&&(k.stopEvent(u),w=null)},r),l(y,"keyup",function(u){i[u.keyCode]=null},r),i||(a(),l(window,"focus",a))}},typeof window=="object"&&window.postMessage&&!e.isOldIE){var $=1;k.nextTick=function(y,p){p=p||window;var r="zero-timeout-message-"+$++,h=function(w){w.data==r&&(k.stopPropagation(w),g(p,"message",h),y())};l(p,"message",h),p.postMessage(r,"*")}}k.$idleBlocked=!1,k.onIdle=function(y,p){return setTimeout(function r(){k.$idleBlocked?setTimeout(r,100):y()},p)},k.$idleBlockId=null,k.blockIdle=function(y){k.$idleBlockId&&clearTimeout(k.$idleBlockId),k.$idleBlocked=!0,k.$idleBlockId=setTimeout(function(){k.$idleBlocked=!1},y||100)},k.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),k.nextFrame?k.nextFrame=k.nextFrame.bind(window):k.nextFrame=function(y){setTimeout(y,17)}}),ace.define("ace/range",["require","exports","module"],function(L,k,N){var S=function(d,c){return d.row-c.row||d.column-c.column},x=function(d,c,a,t){this.start={row:d,column:c},this.end={row:a,column:t}};(function(){this.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(d,c){return this.compare(d,c)==0},this.compareRange=function(d){var c,a=d.end,t=d.start;return c=this.compare(a.row,a.column),c==1?(c=this.compare(t.row,t.column),c==1?2:c==0?1:0):c==-1?-2:(c=this.compare(t.row,t.column),c==-1?-1:c==1?42:0)},this.comparePoint=function(d){return this.compare(d.row,d.column)},this.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},this.intersects=function(d){var c=this.compareRange(d);return c==-1||c==0||c==1},this.isEnd=function(d,c){return this.end.row==d&&this.end.column==c},this.isStart=function(d,c){return this.start.row==d&&this.start.column==c},this.setStart=function(d,c){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=c)},this.setEnd=function(d,c){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=c)},this.inside=function(d,c){return this.compare(d,c)==0?!(this.isEnd(d,c)||this.isStart(d,c)):!1},this.insideStart=function(d,c){return this.compare(d,c)==0?!this.isEnd(d,c):!1},this.insideEnd=function(d,c){return this.compare(d,c)==0?!this.isStart(d,c):!1},this.compare=function(d,c){return!this.isMultiLine()&&d===this.start.row?c<this.start.column?-1:c>this.end.column?1:0:d<this.start.row?-1:d>this.end.row?1:this.start.row===d?c>=this.start.column?0:-1:this.end.row===d?c<=this.end.column?0:1:0},this.compareStart=function(d,c){return this.start.row==d&&this.start.column==c?-1:this.compare(d,c)},this.compareEnd=function(d,c){return this.end.row==d&&this.end.column==c?1:this.compare(d,c)},this.compareInside=function(d,c){return this.end.row==d&&this.end.column==c?1:this.start.row==d&&this.start.column==c?-1:this.compare(d,c)},this.clipRows=function(d,c){if(this.end.row>c)var a={row:c+1,column:0};else if(this.end.row<d)var a={row:d,column:0};if(this.start.row>c)var t={row:c+1,column:0};else if(this.start.row<d)var t={row:d,column:0};return x.fromPoints(t||this.start,a||this.end)},this.extend=function(d,c){var a=this.compare(d,c);if(a==0)return this;if(a==-1)var t={row:d,column:c};else var e={row:d,column:c};return x.fromPoints(t||this.start,e||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return x.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new x(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new x(this.start.row,0,this.end.row,0)},this.toScreenRange=function(d){var c=d.documentToScreenPosition(this.start),a=d.documentToScreenPosition(this.end);return new x(c.row,c.column,a.row,a.column)},this.moveBy=function(d,c){this.start.row+=d,this.start.column+=c,this.end.row+=d,this.end.column+=c}}).call(x.prototype),x.fromPoints=function(d,c){return new x(d.row,d.column,c.row,c.column)},x.comparePoints=S,x.comparePoints=function(d,c){return d.row-c.row||d.column-c.column},k.Range=x}),ace.define("ace/lib/lang",["require","exports","module"],function(L,k,N){k.last=function(d){return d[d.length-1]},k.stringReverse=function(d){return d.split("").reverse().join("")},k.stringRepeat=function(d,c){for(var a="";c>0;)c&1&&(a+=d),(c>>=1)&&(d+=d);return a};var S=/^\s\s*/,x=/\s\s*$/;k.stringTrimLeft=function(d){return d.replace(S,"")},k.stringTrimRight=function(d){return d.replace(x,"")},k.copyObject=function(d){var c={};for(var a in d)c[a]=d[a];return c},k.copyArray=function(d){for(var c=[],a=0,t=d.length;a<t;a++)d[a]&&typeof d[a]=="object"?c[a]=this.copyObject(d[a]):c[a]=d[a];return c},k.deepCopy=function d(c){if(typeof c!="object"||!c)return c;var a;if(Array.isArray(c)){a=[];for(var t=0;t<c.length;t++)a[t]=d(c[t]);return a}if(Object.prototype.toString.call(c)!=="[object Object]")return c;a={};for(var t in c)a[t]=d(c[t]);return a},k.arrayToMap=function(d){for(var c={},a=0;a<d.length;a++)c[d[a]]=1;return c},k.createMap=function(d){var c=Object.create(null);for(var a in d)c[a]=d[a];return c},k.arrayRemove=function(d,c){for(var a=0;a<=d.length;a++)c===d[a]&&d.splice(a,1)},k.escapeRegExp=function(d){return d.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},k.escapeHTML=function(d){return(""+d).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},k.getMatchOffsets=function(d,c){var a=[];return d.replace(c,function(t){a.push({offset:arguments[arguments.length-2],length:t.length})}),a},k.deferredCall=function(d){var c=null,a=function(){c=null,d()},t=function(e){return t.cancel(),c=setTimeout(a,e||0),t};return t.schedule=t,t.call=function(){return this.cancel(),d(),t},t.cancel=function(){return clearTimeout(c),c=null,t},t.isPending=function(){return c},t},k.delayedCall=function(d,c){var a=null,t=function(){a=null,d()},e=function(i){a==null&&(a=setTimeout(t,i||c))};return e.delay=function(i){a&&clearTimeout(a),a=setTimeout(t,i||c)},e.schedule=e,e.call=function(){this.cancel(),d()},e.cancel=function(){a&&clearTimeout(a),a=null},e.isPending=function(){return a},e}}),ace.define("ace/clipboard",["require","exports","module"],function(L,k,N){var S;N.exports={lineMode:!1,pasteCancelled:function(){return S&&S>Date.now()-50?!0:S=!1},cancel:function(){S=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(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=L("../lib/dom"),c=L("../lib/lang"),a=L("../clipboard"),t=x.isChrome<18,e=x.isIE,i=x.isChrome>63,n=400,o=L("../lib/keys"),l=o.KEY_MODS,g=x.isIOS,v=g?/\s/:/\n/,$=x.isMobile,y=function(p,r){function h(){I=!0,s.blur(),s.focus(),I=!1}function w(H){H.keyCode==27&&s.value.length<s.selectionStart&&(C||(T=s.value),_=M=-1,F()),le()}function u(){clearTimeout(de),de=setTimeout(function(){R&&(s.style.cssText=R,R=""),r.renderer.$isMousePressed=!1,r.renderer.$keepTextAreaAtCursor&&r.renderer.$moveTextAreaToCursor()},0)}function f(H,U,G){var X=null,Q=!1;G.addEventListener("keydown",function(ne){X&&clearTimeout(X),Q=!0},!0),G.addEventListener("keyup",function(ne){X=setTimeout(function(){Q=!1},100)},!0);var ee=function(ne){if(document.activeElement===G&&!(Q||C||U.$mouseHandler.isMousePressed)&&!m){var te=G.selectionStart,J=G.selectionEnd,Y=null,ae=0;if(te==0?Y=o.up:te==1?Y=o.home:J>M&&T[J]=="\n"?Y=o.end:te<_&&T[te-1]==" "?(Y=o.left,ae=l.option):te<_||te==_&&M!=_&&te==J?Y=o.left:J>M&&T.slice(0,J).split("\n").length>2?Y=o.down:J>M&&T[J-1]==" "?(Y=o.right,ae=l.option):(J>M||J==M&&M!=_&&te==J)&&(Y=o.right),te!==J&&(ae|=l.shift),Y){var ce=U.onCommandKey({},ae,Y);if(!ce&&U.commands){Y=o.keyCodeToString(Y);var fe=U.commands.findKeyCommand(ae,Y);fe&&U.execCommand(fe)}_=te,M=J,F("")}}};document.addEventListener("selectionchange",ee),U.on("destroy",function(){document.removeEventListener("selectionchange",ee)})}var s=d.createElement("textarea");s.className="ace_text-input",s.setAttribute("wrap","off"),s.setAttribute("autocorrect","off"),s.setAttribute("autocapitalize","off"),s.setAttribute("spellcheck",!1),s.style.opacity="0",p.insertBefore(s,p.firstChild);var m=!1,b=!1,C=!1,A=!1,R="";$||(s.style.fontSize="1px");var E=!1,I=!1,T="",_=0,M=0,O=0;try{var D=document.activeElement===s}catch(H){}S.addListener(s,"blur",function(H){I||(r.onBlur(H),D=!1)},r),S.addListener(s,"focus",function(H){if(!I){if(D=!0,x.isEdge)try{if(!document.hasFocus())return}catch(U){}r.onFocus(H),x.isEdge?setTimeout(F):F()}},r),this.$focusScroll=!1,this.focus=function(){if(R||i||this.$focusScroll=="browser")return s.focus({preventScroll:!0});var H=s.style.top;s.style.position="fixed",s.style.top="0px";try{var U=s.getBoundingClientRect().top!=0}catch(Q){return}var G=[];if(U)for(var X=s.parentElement;X&&X.nodeType==1;)G.push(X),X.setAttribute("ace_nocontext",!0),!X.parentElement&&X.getRootNode?X=X.getRootNode().host:X=X.parentElement;s.focus({preventScroll:!0}),U&&G.forEach(function(Q){Q.removeAttribute("ace_nocontext")}),setTimeout(function(){s.style.position="",s.style.top=="0px"&&(s.style.top=H)},0)},this.blur=function(){s.blur()},this.isFocused=function(){return D},r.on("beforeEndOperation",function(){var H=r.curOp,U=H&&H.command&&H.command.name;if(U!="insertstring"){var G=U&&(H.docChanged||H.selectionChanged);C&&G&&(T=s.value="",he()),F()}});var F=g?function(H){if(!(!D||m&&!H||A)){H||(H="");var U="\n ab"+H+"cde fg\n";U!=s.value&&(s.value=T=U);var G=4,X=4+(H.length||(r.selection.isEmpty()?0:1));(_!=G||M!=X)&&s.setSelectionRange(G,X),_=G,M=X}}:function(){if(!(C||A)&&!(!D&&!z)){C=!0;var H=0,U=0,G="";if(r.session){var X=r.selection,Q=X.getRange(),ee=X.cursor.row;if(H=Q.start.column,U=Q.end.column,G=r.session.getLine(ee),Q.start.row!=ee){var ne=r.session.getLine(ee-1);H=Q.start.row<ee-1?0:H,U+=ne.length+1,G=ne+"\n"+G}else if(Q.end.row!=ee){var te=r.session.getLine(ee+1);U=Q.end.row>ee+1?te.length:U,U+=G.length+1,G=G+"\n"+te}else $&&ee>0&&(G="\n"+G,U+=1,H+=1);G.length>n&&(H<n&&U<n?G=G.slice(0,n):(G="\n",H==U?H=U=0:(H=0,U=1)))}var J=G+"\n\n";if(J!=T&&(s.value=T=J,_=M=J.length),z&&(_=s.selectionStart,M=s.selectionEnd),M!=U||_!=H||s.selectionEnd!=M)try{s.setSelectionRange(H,U),_=H,M=U}catch(Y){}C=!1}};this.resetSelection=F,D&&r.onFocus();var W=function(H){return H.selectionStart===0&&H.selectionEnd>=T.length&&H.value===T&&T&&H.selectionEnd!==M},B=function(H){C||(m?m=!1:W(s)?(r.selectAll(),F()):$&&s.selectionStart!=_&&F())},P=null;this.setInputHandler=function(H){P=H},this.getInputHandler=function(){return P};var z=!1,V=function(H,U){if(z&&(z=!1),b)return F(),H&&r.onPaste(H),b=!1,"";for(var G=s.selectionStart,X=s.selectionEnd,Q=_,ee=T.length-M,ne=H,te=H.length-G,J=H.length-X,Y=0;Q>0&&T[Y]==H[Y];)Y++,Q--;for(ne=ne.slice(Y),Y=1;ee>0&&T.length-Y>_-1&&T[T.length-Y]==H[H.length-Y];)Y++,ee--;te-=Y-1,J-=Y-1;var ae=ne.length-Y+1;if(ae<0&&(Q=-ae,ae=0),ne=ne.slice(0,ae),!U&&!ne&&!te&&!Q&&!ee&&!J)return"";A=!0;var ce=!1;return x.isAndroid&&ne==". "&&(ne=" ",ce=!0),ne&&!Q&&!ee&&!te&&!J||E?r.onTextInput(ne):r.onTextInput(ne,{extendLeft:Q,extendRight:ee,restoreStart:te,restoreEnd:J}),A=!1,T=H,_=G,M=X,O=J,ce?"\n":ne},j=function(H){if(C)return re();if(H&&H.inputType){if(H.inputType=="historyUndo")return r.execCommand("undo");if(H.inputType=="historyRedo")return r.execCommand("redo")}var U=s.value,G=V(U,!0);(U.length>n+100||v.test(G)||$&&_<1&&_==M)&&F()},K=function(H,U,G){var X=H.clipboardData||window.clipboardData;if(!(!X||t)){var Q=e||G?"Text":"text/plain";try{return U?X.setData(Q,U)!==!1:X.getData(Q)}catch(ee){if(!G)return K(ee,U,!0)}}},q=function(H,U){var G=r.getCopyText();if(!G)return S.preventDefault(H);K(H,G)?(g&&(F(G),m=G,setTimeout(function(){m=!1},10)),U?r.onCut():r.onCopy(),S.preventDefault(H)):(m=!0,s.value=G,s.select(),setTimeout(function(){m=!1,F(),U?r.onCut():r.onCopy()}))},ie=function(H){q(H,!0)},oe=function(H){q(H,!1)},se=function(H){var U=K(H);a.pasteCancelled()||(typeof U=="string"?(U&&r.onPaste(U,H),x.isIE&&setTimeout(F),S.preventDefault(H)):(s.value="",b=!0))};S.addCommandKeyListener(s,r.onCommandKey.bind(r),r),S.addListener(s,"select",B,r),S.addListener(s,"input",j,r),S.addListener(s,"cut",ie,r),S.addListener(s,"copy",oe,r),S.addListener(s,"paste",se,r),(!("oncut"in s)||!("oncopy"in s)||!("onpaste"in s))&&S.addListener(p,"keydown",function(H){if(!(x.isMac&&!H.metaKey||!H.ctrlKey))switch(H.keyCode){case 67:oe(H);break;case 86:se(H);break;case 88:ie(H)}},r);var Z=function(H){if(!(C||!r.onCompositionStart||r.$readOnly)&&(C={},!E)){H.data&&(C.useTextareaForIME=!1),setTimeout(re,0),r._signal("compositionStart"),r.on("mousedown",h);var U=r.getSelectionRange();U.end.row=U.start.row,U.end.column=U.start.column,C.markerRange=U,C.selectionStart=_,r.onCompositionStart(C),C.useTextareaForIME?(T=s.value="",_=0,M=0):(s.msGetInputContext&&(C.context=s.msGetInputContext()),s.getInputContext&&(C.context=s.getInputContext()))}},re=function(){if(!(!C||!r.onCompositionUpdate||r.$readOnly)){if(E)return h();if(C.useTextareaForIME)r.onCompositionUpdate(s.value);else{var H=s.value;V(H),C.markerRange&&(C.context&&(C.markerRange.start.column=C.selectionStart=C.context.compositionStartOffset),C.markerRange.end.column=C.markerRange.start.column+M-C.selectionStart+O)}}},he=function(H){!r.onCompositionEnd||r.$readOnly||(C=!1,r.onCompositionEnd(),r.off("mousedown",h),H&&j())},le=c.delayedCall(re,50).schedule.bind(null,null);S.addListener(s,"compositionstart",Z,r),S.addListener(s,"compositionupdate",re,r),S.addListener(s,"keyup",w,r),S.addListener(s,"keydown",le,r),S.addListener(s,"compositionend",he,r),this.getElement=function(){return s},this.setCommandMode=function(H){E=H,s.readOnly=!1},this.setReadOnly=function(H){E||(s.readOnly=H)},this.setCopyWithEmptySelection=function(H){},this.onContextMenu=function(H){z=!0,F(),r._emit("nativecontextmenu",{target:r,domEvent:H}),this.moveToMouse(H,!0)},this.moveToMouse=function(H,U){R||(R=s.style.cssText),s.style.cssText=(U?"z-index:100000;":"")+(x.isIE?"opacity:0.1;":"")+"text-indent: -"+(_+M)*r.renderer.characterWidth*.5+"px;";var G=r.container.getBoundingClientRect(),X=d.computedStyle(r.container),Q=G.top+(parseInt(X.borderTopWidth)||0),ee=G.left+(parseInt(G.borderLeftWidth)||0),ne=G.bottom-Q-s.clientHeight-2,te=function(J){d.translate(s,J.clientX-ee-2,Math.min(J.clientY-Q-2,ne))};te(H),H.type=="mousedown"&&(r.renderer.$isMousePressed=!0,clearTimeout(de),x.isWin&&S.capture(r.container,te,u))},this.onContextMenuClose=u;var de,ge=function(H){r.textInput.onContextMenu(H),u()};S.addListener(s,"mouseup",ge,r),S.addListener(s,"mousedown",function(H){H.preventDefault(),u()},r),S.addListener(r.renderer.scroller,"contextmenu",ge,r),S.addListener(s,"contextmenu",ge,r),g&&f(p,r,s)};k.TextInput=y,k.$setUserAgentForTests=function(p,r){$=p,g=r}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(L,k,N){function S(e){e.$clickSelection=null;var i=e.editor;i.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),i.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),i.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),i.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),i.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(o){e[o]=this[o]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function x(e,i,n,o){return Math.sqrt(Math.pow(n-e,2)+Math.pow(o-i,2))}function d(e,i){if(e.start.row==e.end.row)var n=2*i.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=i.column-4;else var n=2*i.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var c=L("../lib/useragent"),a=0,t=550;(function(){this.onMouseDown=function(e){var i=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,l=e.getButton();if(l!==0){var g=o.getSelectionRange(),v=g.isEmpty();(v||l==1)&&o.selection.moveToPosition(n),l==2&&(o.textInput.onContextMenu(e.domEvent),c.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),i&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,i){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):i||n.selection.moveToPosition(e),i||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(n);if(o==-1)e=this.$clickSelection.end;else if(o==1)e=this.$clickSelection.start;else{var l=d(this.$clickSelection,n);n=l.cursor,e=l.anchor}i.selection.setSelectionAnchor(e.row,e.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var i,n=this.editor,o=n.renderer.screenToTextCoordinates(this.x,this.y),l=n.selection[e](o.row,o.column);if(this.$clickSelection){var g=this.$clickSelection.comparePoint(l.start),v=this.$clickSelection.comparePoint(l.end);if(g==-1&&v<=0)i=this.$clickSelection.end,(l.end.row!=o.row||l.end.column!=o.column)&&(o=l.start);else if(v==1&&g>=0)i=this.$clickSelection.start,(l.start.row!=o.row||l.start.column!=o.column)&&(o=l.end);else if(g==-1&&v==1)o=l.end,i=l.start;else{var $=d(this.$clickSelection,o);o=$.cursor,i=$.anchor}n.selection.setSelectionAnchor(i.row,i.column)}n.selection.selectToPosition(o),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),i=Date.now();(e>a||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var i=e.getDocumentPosition(),n=this.editor,o=n.session,l=o.getBracketRange(i);l?(l.isEmpty()&&(l.start.column--,l.end.column++),this.setState("select")):(l=n.selection.getWordRange(i.row,i.column),this.setState("selectByWords")),this.$clickSelection=l,this.select()},this.onTripleClick=function(e){var i=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var o=n.getSelectionRange();o.isMultiLine()&&o.contains(i.row,i.column)?(this.$clickSelection=n.selection.getLineRange(o.start.row),this.$clickSelection.end=n.selection.getLineRange(o.end.row).end):this.$clickSelection=n.selection.getLineRange(i.row),this.select()},this.onQuadClick=function(e){var i=this.editor;i.selectAll(),this.$clickSelection=i.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var i=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,o=e.domEvent.timeStamp,l=o-n.t,g=l?e.wheelX/l:n.vx,v=l?e.wheelY/l:n.vy;l<t&&(g=(g+n.vx)/2,v=(v+n.vy)/2);var $=Math.abs(g/v),y=!1;if($>=1&&i.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(y=!0),$<=1&&i.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(y=!0),y)n.allowed=o;else if(o-n.allowed<t){var p=Math.abs(g)<=1.5*Math.abs(n.vx)&&Math.abs(v)<=1.5*Math.abs(n.vy);p?(y=!0,n.allowed=o):n.allowed=0}if(n.t=o,n.vx=g,n.vy=v,y)return i.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}}}).call(S.prototype),k.DefaultHandlers=S}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(L,k,N){function S(d){this.isOpen=!1,this.$element=null,this.$parentNode=d}L("./lib/oop");var x=L("./lib/dom");(function(){this.$init=function(){return this.$element=x.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(d){this.getElement().textContent=d},this.setHtml=function(d){this.getElement().innerHTML=d},this.setPosition=function(d,c){this.getElement().style.left=d+"px",this.getElement().style.top=c+"px"},this.setClassName=function(d){x.addCssClass(this.getElement(),d)},this.show=function(d,c,a){d!=null&&this.setText(d),c!=null&&a!=null&&this.setPosition(c,a),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(S.prototype),k.Tooltip=S}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(L,k,N){function S(e){function i(){var r=y.getDocumentPosition().row,h=g.$annotations[r];if(!h)return n();var w=l.session.getLength();if(r==w){var u=l.renderer.pixelToScreenCoordinates(0,y.y).row,f=y.$pos;if(u>l.session.documentToScreenRow(f.row,f.column))return n()}if(p!=h)if(p=h.text.join("<br/>"),v.setHtml(p),v.show(),l._signal("showGutterTooltip",v),l.on("mousewheel",n),e.$tooltipFollowsMouse)o(y);else{var s=y.domEvent.target,m=s.getBoundingClientRect(),b=v.getElement().style;b.left=m.right+"px",b.top=m.bottom+"px"}}function n(){$&&($=clearTimeout($)),p&&(v.hide(),p=null,l._signal("hideGutterTooltip",v),l.off("mousewheel",n))}function o(r){v.setPosition(r.x,r.y)}var l=e.editor,g=l.renderer.$gutterLayer,v=new x(l.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!(!l.isFocused()||r.getButton()!=0)){var h=g.getRegion(r);if(h!="foldWidgets"){var w=r.getDocumentPosition().row,u=l.session.selection;if(r.getShiftKey())u.selectTo(w,0);else{if(r.domEvent.detail==2)return l.selectAll(),r.preventDefault();e.$clickSelection=l.selection.getLineRange(w)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()}}});var $,y,p;e.editor.setDefaultHandler("guttermousemove",function(r){var h=r.domEvent.target||r.domEvent.srcElement;if(d.hasCssClass(h,"ace_fold-widget"))return n();p&&e.$tooltipFollowsMouse&&o(r),y=r,!$&&($=setTimeout(function(){$=null,y&&!e.isMousePressed?i():n()},50))}),a.addListener(l.renderer.$gutter,"mouseout",function(r){y=null,!(!p||$)&&($=setTimeout(function(){$=null,n()},50))},l),l.on("changeSession",n)}function x(e){t.call(this,e)}var d=L("../lib/dom"),c=L("../lib/oop"),a=L("../lib/event"),t=L("../tooltip").Tooltip;c.inherits(x,t),(function(){this.setPosition=function(e,i){var n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,l=this.getWidth(),g=this.getHeight();e+=15,i+=15,e+l>n&&(e-=e+l-n),i+g>o&&(i-=20+g),t.prototype.setPosition.call(this,e,i)}}).call(x.prototype),k.GutterHandler=S}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=k.MouseEvent=function(c,a){this.domEvent=c,this.editor=a,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){S.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){S.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,a=c.getSelectionRange();if(a.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=a.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return S.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=x.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(d.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(L,k,N){function S(n){function o(F,W){var B=Date.now(),P=!W||F.row!=W.row,z=!W||F.column!=W.column;if(!M||P||z)h.moveCursorToPosition(F),M=B,O={x:m,y:b};else{var V=x(O.x,O.y,m,b);V>i?M=null:B-M>=e&&(h.renderer.scrollCursorIntoView(),M=null)}}function l(F,W){var B=Date.now(),P=h.renderer.layerConfig.lineHeight,z=h.renderer.layerConfig.characterWidth,V=h.renderer.scroller.getBoundingClientRect(),j={x:{left:m-V.left,right:V.right-m},y:{top:b-V.top,bottom:V.bottom-b}},K=Math.min(j.x.left,j.x.right),q=Math.min(j.y.top,j.y.bottom),ie={row:F.row,column:F.column};K/z<=2&&(ie.column+=j.x.left<j.x.right?-3:2),q/P<=1&&(ie.row+=j.y.top<j.y.bottom?-1:1);var oe=F.row!=ie.row,se=F.column!=ie.column,Z=!W||F.row!=W.row;oe||se&&!Z?_?B-_>=t&&h.renderer.scrollCursorIntoView(ie):_=B:_=null}function g(){var F=R;R=h.renderer.screenToTextCoordinates(m,b),o(R,F),l(R,F)}function v(){A=h.selection.toOrientedRange(),s=h.session.addMarker(A,"ace_selection",h.getSelectionStyle()),h.clearSelection(),h.isFocused()&&h.renderer.$cursorLayer.setBlinking(!1),clearInterval(C),g(),C=setInterval(g,20),E=0,c.addListener(document,"mousemove",y)}function $(){clearInterval(C),h.session.removeMarker(s),s=null,h.selection.fromOrientedRange(A),h.isFocused()&&!T&&h.$resetCursorStyle(),A=null,R=null,E=0,_=null,M=null,c.removeListener(document,"mousemove",y)}function y(){D==null&&(D=setTimeout(function(){D!=null&&s&&$()},20))}function p(F){var W=F.types;return!W||Array.prototype.some.call(W,function(B){return B=="text/plain"||B=="Text"})}function r(F){var W=["copy","copymove","all","uninitialized"],B=["move","copymove","linkmove","all","uninitialized"],P=a.isMac?F.altKey:F.ctrlKey,z="uninitialized";try{z=F.dataTransfer.effectAllowed.toLowerCase()}catch(j){}var V="none";return P&&W.indexOf(z)>=0?V="copy":B.indexOf(z)>=0?V="move":W.indexOf(z)>=0&&(V="copy"),V}var h=n.editor,w=d.createElement("img");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(w.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var u=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];u.forEach(function(F){n[F]=this[F]},this),h.on("mousedown",this.onMouseDown.bind(n));var f=h.container,s,m,b,C,A,R,E=0,I,T,_,M,O;this.onDragStart=function(F){if(this.cancelDrag||!f.draggable){var W=this;return setTimeout(function(){W.startSelect(),W.captureMouse(F)},0),F.preventDefault()}A=h.getSelectionRange();var B=F.dataTransfer;B.effectAllowed=h.getReadOnly()?"copy":"copyMove",a.isOpera&&(h.container.appendChild(w),w.scrollTop=0),B.setDragImage&&B.setDragImage(w,0,0),a.isOpera&&h.container.removeChild(w),B.clearData(),B.setData("Text",h.session.getTextRange()),T=!0,this.setState("drag")},this.onDragEnd=function(F){if(f.draggable=!1,T=!1,this.setState(null),!h.getReadOnly()){var W=F.dataTransfer.dropEffect;!I&&W=="move"&&h.session.remove(h.getSelectionRange()),h.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(h.getReadOnly()||!p(F.dataTransfer)))return m=F.clientX,b=F.clientY,s||v(),E++,F.dataTransfer.dropEffect=I=r(F),c.preventDefault(F)},this.onDragOver=function(F){if(!(h.getReadOnly()||!p(F.dataTransfer)))return m=F.clientX,b=F.clientY,s||(v(),E++),D!==null&&(D=null),F.dataTransfer.dropEffect=I=r(F),c.preventDefault(F)},this.onDragLeave=function(F){if(E--,E<=0&&s)return $(),I=null,c.preventDefault(F)},this.onDrop=function(F){if(R){var W=F.dataTransfer;if(T)switch(I){case"move":A.contains(R.row,R.column)?A={start:R,end:R}:A=h.moveText(A,R);break;case"copy":A=h.moveText(A,R,!0)}else{var B=W.getData("Text");A={start:R,end:h.session.insert(R,B)},h.focus(),I=null}return $(),c.preventDefault(F)}},c.addListener(f,"dragstart",this.onDragStart.bind(n),h),c.addListener(f,"dragend",this.onDragEnd.bind(n),h),c.addListener(f,"dragenter",this.onDragEnter.bind(n),h),c.addListener(f,"dragover",this.onDragOver.bind(n),h),c.addListener(f,"dragleave",this.onDragLeave.bind(n),h),c.addListener(f,"drop",this.onDrop.bind(n),h);var D=null}function x(n,o,l,g){return Math.sqrt(Math.pow(l-n,2)+Math.pow(g-o,2))}var d=L("../lib/dom"),c=L("../lib/event"),a=L("../lib/useragent"),t=200,e=200,i=5;(function(){this.dragWait=function(){var n=Date.now()-this.mousedownEvent.time;n>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var n=this.editor.container;n.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(n){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var n=this.editor,o=n.container;o.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle("ace_dragging");var l=a.isWin?"default":"move";n.renderer.setCursorStyle(l),this.setState("dragReady")},this.onMouseDrag=function(n){var o=this.editor.container;if(a.isIE&&this.state=="dragReady"){var l=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>3&&o.dragDrop()}if(this.state==="dragWait"){var l=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>0&&(o.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(n){if(this.$dragEnabled){this.mousedownEvent=n;var o=this.editor,l=n.inSelection(),g=n.getButton(),v=n.domEvent.detail||1;if(v===1&&g===0&&l){if(n.editor.inMultiSelectMode&&(n.getAccelKey()||n.getShiftKey()))return;this.mousedownEvent.time=Date.now();var $=n.domEvent.target||n.domEvent.srcElement;if("unselectable"in $&&($.unselectable="on"),o.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var y=o.container;y.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(n,this.onMouseDrag.bind(this)),n.defaultPrevented=!0}}}}).call(S.prototype),k.DragdropHandler=S}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(L,k,N){var S=L("./mouse_event").MouseEvent,x=L("../lib/event"),d=L("../lib/dom");k.addTouchListeners=function(c,a){function t(){var A=window.navigator&&window.navigator.clipboard,R=!1,E=function(){var T=a.getCopyText(),_=a.session.getUndoManager().hasUndo();C.replaceChild(d.buildDom(R?["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"],A&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],_&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),C.firstChild)},I=function(T){var _=T.target.getAttribute("action");if(_=="more"||!R)return R=!R,E();_=="paste"?A.readText().then(function(M){a.execCommand(_,M)}):_&&((_=="cut"||_=="copy")&&(A?A.writeText(a.getCopyText()):document.execCommand("copy")),a.execCommand(_)),C.firstChild.style.display="none",R=!1,_!="openCommandPallete"&&a.focus()};C=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(T){g="menu",T.stopPropagation(),T.preventDefault(),a.textInput.focus()},ontouchend:function(T){T.stopPropagation(),T.preventDefault(),I(T)},onclick:I},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],a.container)}function e(){C||t();var A=a.selection.cursor,R=a.renderer.textToScreenCoordinates(A.row,A.column),E=a.renderer.textToScreenCoordinates(0,0).pageX,I=a.renderer.scrollLeft,T=a.container.getBoundingClientRect();C.style.top=R.pageY-T.top-3+"px",R.pageX-T.left<T.width-70?(C.style.left="",C.style.right="10px"):(C.style.right="",C.style.left=E+I-T.left+"px"),C.style.display="",C.firstChild.style.display="none",a.on("input",i)}function i(A){C&&(C.style.display="none"),a.off("input",i)}function n(){r=null,clearTimeout(r);var A=a.selection.getRange(),R=A.contains(u.row,u.column);(A.isEmpty()||!R)&&(a.selection.moveToPosition(u),a.selection.selectWord()),g="wait",e()}function o(){r=null,clearTimeout(r),a.selection.moveToPosition(u);var A=f>=2?a.selection.getLineRange(u.row):a.session.getBracketRange(u);A&&!A.isEmpty()?a.selection.setRange(A):a.selection.selectWord(),g="wait"}function l(){w+=60,h=setInterval(function(){w--<=0&&(clearInterval(h),h=null),Math.abs(s)<.01&&(s=0),Math.abs(m)<.01&&(m=0),w<20&&(s=.9*s),w<20&&(m=.9*m);var A=a.session.getScrollTop();a.renderer.scrollBy(10*s,10*m),A==a.session.getScrollTop()&&(w=0)},10)}var g="scroll",v,$,y,p,r,h,w=0,u,f=0,s=0,m=0,b,C;x.addListener(c,"contextmenu",function(A){if(b){var R=a.textInput.getElement();R.focus()}},a),x.addListener(c,"touchstart",function(A){var R=A.touches;if(r||R.length>1){clearTimeout(r),r=null,y=-1,g="zoom";return}b=a.$mouseHandler.isMousePressed=!0;var E=a.renderer.layerConfig.lineHeight,I=a.renderer.layerConfig.lineHeight,T=A.timeStamp;p=T;var _=R[0],M=_.clientX,O=_.clientY;Math.abs(v-M)+Math.abs($-O)>E&&(y=-1),v=A.clientX=M,$=A.clientY=O,s=m=0;var D=new S(A,a);if(u=D.getDocumentPosition(),T-y<500&&R.length==1&&!w)f++,A.preventDefault(),A.button=0,o();else{f=0;var F=a.selection.cursor,W=a.selection.isEmpty()?F:a.selection.anchor,B=a.renderer.$cursorLayer.getPixelPosition(F,!0),P=a.renderer.$cursorLayer.getPixelPosition(W,!0),z=a.renderer.scroller.getBoundingClientRect(),V=a.renderer.layerConfig.offset,j=a.renderer.scrollLeft,K=function(oe,se){return oe/=I,se=se/E-.75,oe*oe+se*se};if(A.clientX<z.left){g="zoom";return}var q=K(A.clientX-z.left-B.left+j,A.clientY-z.top-B.top+V),ie=K(A.clientX-z.left-P.left+j,A.clientY-z.top-P.top+V);q<3.5&&ie<3.5&&(g=q>ie?"cursor":"anchor"),ie<3.5?g="anchor":q<3.5?g="cursor":g="scroll",r=setTimeout(n,450)}y=T},a),x.addListener(c,"touchend",function(A){b=a.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),g=="zoom"?(g="",w=0):r?(a.selection.moveToPosition(u),w=0,e()):g=="scroll"?(l(),i()):e(),clearTimeout(r),r=null},a),x.addListener(c,"touchmove",function(A){r&&(clearTimeout(r),r=null);var R=A.touches;if(!(R.length>1||g=="zoom")){var E=R[0],I=v-E.clientX,T=$-E.clientY;if(g=="wait"){if(!(I*I+T*T>4))return A.preventDefault();g="cursor"}v=E.clientX,$=E.clientY,A.clientX=E.clientX,A.clientY=E.clientY;var _=A.timeStamp,M=_-p;if(p=_,g=="scroll"){var O=new S(A,a);O.speed=1,O.wheelX=I,O.wheelY=T,10*Math.abs(I)<Math.abs(T)&&(I=0),10*Math.abs(T)<Math.abs(I)&&(T=0),M!=0&&(s=I/M,m=T/M),a._emit("mousewheel",O),O.propagationStopped||(s=m=0)}else{var D=new S(A,a),F=D.getDocumentPosition();g=="cursor"?a.selection.moveCursorToPosition(F):g=="anchor"&&a.selection.setSelectionAnchor(F.row,F.column),a.renderer.scrollCursorIntoView(F),A.preventDefault()}}},a)}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(L,k,N){var S=L("./dom");k.get=function(x,d){var c=new XMLHttpRequest;c.open("GET",x,!0),c.onreadystatechange=function(){c.readyState===4&&d(c.responseText)},c.send(null)},k.loadScript=function(x,d){var c=S.getDocumentHead(),a=document.createElement("script");a.src=x,c.appendChild(a),a.onload=a.onreadystatechange=function(t,e){(e||!a.readyState||a.readyState=="loaded"||a.readyState=="complete")&&(a=a.onload=a.onreadystatechange=null,e||d())}},k.qualifyURL=function(x){var d=document.createElement("a");return d.href=x,d.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(L,k,N){var S={},x=function(){this.propagationStopped=!0},d=function(){this.defaultPrevented=!0};S._emit=S._dispatchEvent=function(c,a){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var t=this._eventRegistry[c]||[],e=this._defaultHandlers[c];if(!(!t.length&&!e)){(typeof a!="object"||!a)&&(a={}),a.type||(a.type=c),a.stopPropagation||(a.stopPropagation=x),a.preventDefault||(a.preventDefault=d),t=t.slice();for(var i=0;i<t.length&&(t[i](a,this),!a.propagationStopped);i++);if(e&&!a.defaultPrevented)return e(a,this)}},S._signal=function(c,a){var t=(this._eventRegistry||{})[c];if(t){t=t.slice();for(var e=0;e<t.length;e++)t[e](a,this)}},S.once=function(c,a){var t=this;if(this.on(c,function e(){t.off(c,e),a.apply(null,arguments)}),!a)return new Promise(function(e){a=e})},S.setDefaultHandler=function(c,a){var t=this._defaultHandlers;if(t||(t=this._defaultHandlers={_disabled_:{}}),t[c]){var e=t[c],i=t._disabled_[c];i||(t._disabled_[c]=i=[]),i.push(e);var n=i.indexOf(a);n!=-1&&i.splice(n,1)}t[c]=a},S.removeDefaultHandler=function(c,a){var t=this._defaultHandlers;if(t){var e=t._disabled_[c];if(t[c]==a)e&&this.setDefaultHandler(c,e.pop());else if(e){var i=e.indexOf(a);i!=-1&&e.splice(i,1)}}},S.on=S.addEventListener=function(c,a,t){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[c];return e||(e=this._eventRegistry[c]=[]),e.indexOf(a)==-1&&e[t?"unshift":"push"](a),a},S.off=S.removeListener=S.removeEventListener=function(c,a){this._eventRegistry=this._eventRegistry||{};var t=this._eventRegistry[c];if(t){var e=t.indexOf(a);e!==-1&&t.splice(e,1)}},S.removeAllListeners=function(c){c||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[c]=void 0),this._defaultHandlers&&(this._defaultHandlers[c]=void 0)},k.EventEmitter=S}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(L,k,N){"no use strict";function S(e){typeof console<"u"}function x(e,i){var n=new Error(e);n.data=i,setTimeout(function(){throw n})}var d=L("./oop"),c=L("./event_emitter").EventEmitter,a={setOptions:function(e){Object.keys(e).forEach(function(i){this.setOption(i,e[i])},this)},getOptions:function(e){var i={};if(e)Array.isArray(e)||(i=e,e=Object.keys(i));else{var n=this.$options;e=Object.keys(n).filter(function(o){return!n[o].hidden})}return e.forEach(function(o){i[o]=this.getOption(o)},this),i},setOption:function(e,i){if(this["$"+e]!==i){var n=this.$options[e];if(!n)return S('misspelled option "'+e+'"');if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,i);n.handlesSet||(this["$"+e]=i),n&&n.set&&n.set.call(this,i)}},getOption:function(e){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].getOption(e):i&&i.get?i.get.call(this):this["$"+e]:S('misspelled option "'+e+'"')}},t=function(){this.$defaultOptions={}};(function(){d.implement(this,c),this.defineOptions=function(e,i,n){return e.$options||(this.$defaultOptions[i]=e.$options={}),Object.keys(n).forEach(function(o){var l=n[o];typeof l=="string"&&(l={forwardTo:l}),l.name||(l.name=o),e.$options[l.name]=l,"initialValue"in l&&(e["$"+l.name]=l.initialValue)}),d.implement(e,a),this},this.resetOptions=function(e){Object.keys(e.$options).forEach(function(i){var n=e.$options[i];"value"in n&&e.setOption(i,n.value)})},this.setDefaultValue=function(e,i,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][i])break;if(!this.$defaultOptions[e][i])return!1}var o=this.$defaultOptions[e]||(this.$defaultOptions[e]={});o[i]&&(o.forwardTo?this.setDefaultValue(o.forwardTo,i,n):o[i].value=n)},this.setDefaultValues=function(e,i){Object.keys(i).forEach(function(n){this.setDefaultValue(e,n,i[n])},this)},this.warn=S,this.reportError=x}).call(t.prototype),k.AppConfig=t}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(L,k,N){"no use strict";function S(n){if(!(!t||!t.document)){e.packaged=n||L.packaged||N.packaged||t.define&&define.packaged;for(var o={},l="",g=document.currentScript||document._currentScript,v=g&&g.ownerDocument||document,$=v.getElementsByTagName("script"),y=0;y<$.length;y++){var p=$[y],r=p.src||p.getAttribute("src");if(r){for(var h=p.attributes,w=0,u=h.length;w<u;w++){var f=h[w];f.name.indexOf("data-ace-")===0&&(o[x(f.name.replace(/^data-ace-/,""))]=f.value)}var s=r.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);s&&(l=s[1])}}l&&(o.base=o.base||l,o.packaged=!0),o.basePath=o.base,o.workerPath=o.workerPath||o.base,o.modePath=o.modePath||o.base,o.themePath=o.themePath||o.base,delete o.base;for(var m in o)typeof o[m]<"u"&&k.set(m,o[m])}}function x(n){return n.replace(/-(.)/g,function(o,l){return l.toUpperCase()})}var d=L("./lib/lang");L("./lib/oop");var c=L("./lib/net"),a=L("./lib/app_config").AppConfig;N.exports=k=new a;var t=function(){return this||typeof window<"u"&&window}(),e={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js?v=1775629002",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1};k.get=function(n){if(!e.hasOwnProperty(n))throw new Error("Unknown config key: "+n);return e[n]},k.set=function(n,o){if(e.hasOwnProperty(n))e[n]=o;else if(this.setDefaultValue("",n,o)==0)throw new Error("Unknown config key: "+n)},k.all=function(){return d.copyObject(e)},k.$modes={},k.moduleUrl=function(n,o){if(e.$moduleUrls[n])return e.$moduleUrls[n];var l=n.split("/");o=o||l[l.length-2]||"";var g=o=="snippets"?"/":"-",v=l[l.length-1];if(o=="worker"&&g=="-"){var $=new RegExp("^"+o+"[\\-_]|[\\-_]"+o+"$","g");v=v.replace($,"")}(!v||v==o)&&l.length>1&&(v=l[l.length-2]);var y=e[o+"Path"];return y==null?y=e.basePath:g=="/"&&(o=g=""),y&&y.slice(-1)!="/"&&(y+="/"),y+o+g+v+this.get("suffix")},k.setModuleUrl=function(n,o){return e.$moduleUrls[n]=o},k.$loading={},k.loadModule=function(n,o){var l,g;Array.isArray(n)&&(g=n[0],n=n[1]);try{l=L(n)}catch($){}if(l&&!k.$loading[n])return o&&o(l);if(k.$loading[n]||(k.$loading[n]=[]),k.$loading[n].push(o),!(k.$loading[n].length>1)){var v=function(){L([n],function($){k._emit("load.module",{name:n,module:$});var y=k.$loading[n];k.$loading[n]=null,y.forEach(function(p){p&&p($)})})};if(!k.get("packaged"))return v();c.loadScript(k.moduleUrl(n,g),v),i()}};var i=function(){!e.basePath&&!e.workerPath&&!e.modePath&&!e.themePath&&!Object.keys(e.$moduleUrls).length&&(i=function(){})};k.init=S,k.version="1.4.12"}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=L("./default_handlers").DefaultHandlers,c=L("./default_gutter_handler").GutterHandler,a=L("./mouse_event").MouseEvent,t=L("./dragdrop_handler").DragdropHandler,e=L("./touch_handler").addTouchListeners,i=L("../config"),n=function(o){var l=this;this.editor=o,new d(this),new c(this),new t(this);var g=function(y){var p=!document.hasFocus||!document.hasFocus()||!o.isFocused()&&document.activeElement==(o.textInput&&o.textInput.getElement());p&&window.focus(),o.focus()},v=o.renderer.getMouseEventTarget();S.addListener(v,"click",this.onMouseEvent.bind(this,"click"),o),S.addListener(v,"mousemove",this.onMouseMove.bind(this,"mousemove"),o),S.addMultiMouseDownListener([v,o.renderer.scrollBarV&&o.renderer.scrollBarV.inner,o.renderer.scrollBarH&&o.renderer.scrollBarH.inner,o.textInput&&o.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",o),S.addMouseWheelListener(o.container,this.onMouseWheel.bind(this,"mousewheel"),o),e(o.container,o);var $=o.renderer.$gutter;S.addListener($,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),o),S.addListener($,"click",this.onMouseEvent.bind(this,"gutterclick"),o),S.addListener($,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),o),S.addListener($,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),o),S.addListener(v,"mousedown",g,o),S.addListener($,"mousedown",g,o),x.isIE&&o.renderer.scrollBarV&&(S.addListener(o.renderer.scrollBarV.element,"mousedown",g,o),S.addListener(o.renderer.scrollBarH.element,"mousedown",g,o)),o.on("mousemove",function(y){if(!(l.state||l.$dragDelay||!l.$dragEnabled)){var p=o.renderer.screenToTextCoordinates(y.x,y.y),r=o.session.selection.getRange(),h=o.renderer;!r.isEmpty()&&r.insideStart(p.row,p.column)?h.setCursorStyle("default"):h.setCursorStyle("")}},o)};(function(){this.onMouseEvent=function(o,l){this.editor._emit(o,new a(l,this.editor))},this.onMouseMove=function(o,l){var g=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!g||!g.length||this.editor._emit(o,new a(l,this.editor))},this.onMouseWheel=function(o,l){var g=new a(l,this.editor);g.speed=this.$scrollSpeed*2,g.wheelX=l.wheelX,g.wheelY=l.wheelY,this.editor._emit(o,g)},this.setState=function(o){this.state=o},this.captureMouse=function(o,l){this.x=o.x,this.y=o.y,this.isMousePressed=!0;var g=this.editor,v=this.editor.renderer;v.$isMousePressed=!0;var $=this,y=function(u){if(u){if(x.isWebKit&&!u.which&&$.releaseMouse)return $.releaseMouse();$.x=u.clientX,$.y=u.clientY,l&&l(u),$.mouseEvent=new a(u,$.editor),$.$mouseMoved=!0}},p=function(u){g.off("beforeEndOperation",h),clearInterval(w),r(),$[$.state+"End"]&&$[$.state+"End"](u),$.state="",$.isMousePressed=v.$isMousePressed=!1,v.$keepTextAreaAtCursor&&v.$moveTextAreaToCursor(),$.$onCaptureMouseMove=$.releaseMouse=null,u&&$.onMouseEvent("mouseup",u),g.endOperation()},r=function(){$[$.state]&&$[$.state](),$.$mouseMoved=!1};if(x.isOldIE&&o.domEvent.type=="dblclick")return setTimeout(function(){p(o)});var h=function(u){$.releaseMouse&&g.curOp.command.name&&g.curOp.selectionChanged&&($[$.state+"End"]&&$[$.state+"End"](),$.state="",$.releaseMouse())};g.on("beforeEndOperation",h),g.startOperation({command:{name:"mouse"}}),$.$onCaptureMouseMove=y,$.releaseMouse=S.capture(this.editor.container,y,p);var w=setInterval(r,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var o=(function(l){l&&l.domEvent&&l.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",o),l&&l.domEvent&&S.stopEvent(l.domEvent))}).bind(this);setTimeout(o,10),this.editor.on("nativecontextmenu",o)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(n.prototype),i.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:x.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),k.MouseHandler=n}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(L,k,N){function S(d){d.on("click",function(c){var a=c.getDocumentPosition(),t=d.session,e=t.getFoldAt(a.row,a.column,1);e&&(c.getAccelKey()?t.removeFold(e):t.expandFold(e),c.stop());var i=c.domEvent&&c.domEvent.target;i&&x.hasCssClass(i,"ace_inline_button")&&x.hasCssClass(i,"ace_toggle_wrap")&&(t.setOption("wrap",!t.getUseWrapMode()),d.renderer.scrollCursorIntoView())}),d.on("gutterclick",function(c){var a=d.renderer.$gutterLayer.getRegion(c);if(a=="foldWidgets"){var t=c.getDocumentPosition().row,e=d.session;e.foldWidgets&&e.foldWidgets[t]&&d.session.onFoldWidgetClick(t,c),d.isFocused()||d.focus(),c.stop()}}),d.on("gutterdblclick",function(c){var a=d.renderer.$gutterLayer.getRegion(c);if(a=="foldWidgets"){var t=c.getDocumentPosition().row,e=d.session,i=e.getParentFoldRangeData(t,!0),n=i.range||i.firstRange;if(n){t=n.start.row;var o=e.getFoldAt(t,e.getLine(t).length,1);o?e.removeFold(o):(e.addFold("...",n),d.renderer.scrollCursorIntoView({row:n.start.row,column:0}))}c.stop()}})}var x=L("../lib/dom");k.FoldHandler=S}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(L,k,N){var S=L("../lib/keys"),x=L("../lib/event"),d=function(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)};(function(){this.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},this.setKeyboardHandler=function(c){var a=this.$handlers;if(a[a.length-1]!=c){for(;a[a.length-1]&&a[a.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(a[a.length-1]);this.addKeyboardHandler(c,1)}},this.addKeyboardHandler=function(c,a){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var t=this.$handlers.indexOf(c);t!=-1&&this.$handlers.splice(t,1),a==null?this.$handlers.push(c):this.$handlers.splice(a,0,c),t==-1&&c.attach&&c.attach(this.$editor)}},this.removeKeyboardHandler=function(c){var a=this.$handlers.indexOf(c);return a==-1?!1:(this.$handlers.splice(a,1),c.detach&&c.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var c=this.$data,a=c.editor;return this.$handlers.map(function(t){return t.getStatusText&&t.getStatusText(a,c)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(c,a,t,e){for(var i,n=!1,o=this.$editor.commands,l=this.$handlers.length;l--&&(i=this.$handlers[l].handleKeyboard(this.$data,c,a,t,e),!(!(!i||!i.command)&&(i.command=="null"?n=!0:n=o.exec(i.command,this.$editor,i.args,e),n&&e&&c!=-1&&i.passEvent!=1&&i.command.passEvent!=1&&x.stopEvent(e),n))););return!n&&c==-1&&(i={command:"insertstring"},n=o.exec("insertstring",this.$editor,a)),n&&this.$editor._signal&&this.$editor._signal("keyboardActivity",i),n},this.onCommandKey=function(c,a,t){var e=S.keyCodeToString(t);return this.$callKeyboardHandlers(a,e,t,c)},this.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)}}).call(d.prototype),k.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(L,k,N){function S(F,W,B,P){var z=a?l:o,V=null,j=null,K=null,q=0,ie=null,oe=null,se=-1,Z=null,re=null,he=[];if(!P)for(Z=0,P=[];Z<B;Z++)P[Z]=c(F[Z]);for(t=a,e=!1,i=!1,n=!1,re=0;re<B;re++){if(V=q,he[re]=j=d(F,P,he,re),q=z[V][j],ie=q&240,q&=15,W[re]=K=z[q][5],ie>0)if(ie==16){for(Z=se;Z<re;Z++)W[Z]=1;se=-1}else se=-1;if(oe=z[q][6],oe)se==-1&&(se=re);else if(se>-1){for(Z=se;Z<re;Z++)W[Z]=K;se=-1}P[re]==w&&(W[re]=0),t|=K}if(n){for(Z=0;Z<B;Z++)if(P[Z]==u){W[Z]=a;for(var le=Z-1;le>=0&&P[le]==s;le--)W[le]=a}}}function x(F,W,B){if(!(t<F)){if(F==1&&a==v&&!i){B.reverse();return}for(var P=B.length,z=0,V,j,K,q;z<P;){if(W[z]>=F){for(V=z+1;V<P&&W[V]>=F;)V++;for(j=z,K=V-1;j<K;j++,K--)q=B[j],B[j]=B[K],B[K]=q;z=V}z++}}}function d(F,W,B,P){var z=W[P],V,j,K,q;switch(z){case $:case y:e=!1;case h:case r:return z;case p:return e?r:p;case f:return e=!0,y;case s:return h;case m:return P<1||P+1>=W.length||(V=B[P-1])!=p&&V!=r||(j=W[P+1])!=p&&j!=r?h:(e&&(j=r),j==V?j:h);case b:return V=P>0?B[P-1]:w,V==p&&P+1<W.length&&W[P+1]==p?p:h;case C:if(P>0&&B[P-1]==p)return p;if(e)return h;for(q=P+1,K=W.length;q<K&&W[q]==C;)q++;return q<K&&W[q]==p?p:h;case A:for(K=W.length,q=P+1;q<K&&W[q]==A;)q++;if(q<K){var ie=F[P],oe=ie>=1425&&ie<=2303||ie==64286;if(V=W[q],oe&&(V==y||V==f))return y}return P<1||(V=W[P-1])==w?h:B[P-1];case w:return e=!1,i=!0,a;case u:return n=!0,h;case R:case E:case T:case _:case I:e=!1;case M:return h}}function c(F){var W=F.charCodeAt(0),B=W>>8;return B==0?W>191?$:O[W]:B==5?/[\u0591-\u05f4]/.test(F)?y:$:B==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?A:/[\u0660-\u0669\u066b-\u066c]/.test(F)?r:W==1642?C:/[\u06f0-\u06f9]/.test(F)?p:f:B==32&&W<=8287?D[W&255]:B==254&&W>=65136?f:h}var a=0,t=0,e=!1,i=!1,n=!1,o=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],l=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],g=0,v=1,$=0,y=1,p=2,r=3,h=4,w=5,u=6,f=7,s=8,m=9,b=10,C=11,A=12,R=13,E=14,I=15,T=16,_=17,M=18,O=[M,M,M,M,M,M,M,M,M,u,w,u,s,w,M,M,M,M,M,M,M,M,M,M,M,M,M,M,w,w,w,u,s,h,h,C,C,C,h,h,h,h,h,b,m,b,m,m,p,p,p,p,p,p,p,p,p,p,m,h,h,h,h,h,h,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,h,h,h,h,h,h,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,h,h,h,h,M,M,M,M,M,M,w,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,m,h,C,C,C,C,h,h,h,h,$,h,h,M,h,h,C,C,p,p,h,$,h,h,h,p,$,h,h,h,h,h],D=[s,s,s,s,s,s,s,s,s,s,s,M,M,M,$,y,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,s,w,R,E,I,T,_,m,C,C,C,C,C,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,m,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,s];k.L=$,k.R=y,k.EN=p,k.ON_R=3,k.AN=4,k.R_H=5,k.B=6,k.RLE=7,k.DOT="·",k.doBidiReorder=function(F,W,B){if(F.length<2)return{};var P=F.split(""),z=new Array(P.length),V=new Array(P.length),j=[];a=B?v:g,S(P,j,P.length,W);for(var K=0;K<z.length;z[K]=K,K++);x(2,j,z),x(1,j,z);for(var K=0;K<z.length-1;K++)W[K]===r?j[K]=k.AN:j[K]===y&&(W[K]>f&&W[K]<R||W[K]===h||W[K]===M)?j[K]=k.ON_R:K>0&&P[K-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(P[K])&&(j[K-1]=j[K]=k.R_H,K++);P[P.length-1]===k.DOT&&(j[P.length-1]=k.B),P[0]==="‫"&&(j[0]=k.RLE);for(var K=0;K<z.length;K++)V[K]=j[z[K]];return{logicalFromVisual:z,bidiLevels:V}},k.hasBidiCharacters=function(F,W){for(var B=!1,P=0;P<F.length;P++)W[P]=c(F.charAt(P)),!B&&(W[P]==y||W[P]==f||W[P]==r)&&(B=!0);return B},k.getVisualFromLogicalIdx=function(F,W){for(var B=0;B<W.logicalFromVisual.length;B++)if(W.logicalFromVisual[B]==F)return B;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(L,k,N){var S=L("./lib/bidiutil"),x=L("./lib/lang"),d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=function(a){this.session=a,this.bidiMap={},this.currentRow=null,this.bidiUtil=S,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=d.test(a.getValue())};(function(){this.isBidiRow=function(a,t,e){return this.seenBidi?(a!==this.currentRow&&(this.currentRow=a,this.updateRowLine(t,e),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},this.onChange=function(a){this.seenBidi?this.currentRow=null:a.action=="insert"&&d.test(a.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var a=0,t=this.session.$screenRowCache;if(t.length){var e=this.session.$getRowCacheIndex(t,this.currentRow);e>=0&&(a=this.session.$docRowCache[e])}return a},this.getSplitIndex=function(){var a=0,t=this.session.$screenRowCache;if(t.length)for(var e,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-a>0&&(e=this.session.$getRowCacheIndex(t,this.currentRow-a-1),e===i);)i=e,a++;else a=this.currentRow;return a},this.updateRowLine=function(a,t){a===void 0&&(a=this.getDocumentRow());var e=a===this.session.getLength()-1,i=e?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(a),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var n=this.session.$wrapData[a];n&&(t===void 0&&(t=this.getSplitIndex()),t>0&&n.length?(this.wrapIndent=n.indent,this.wrapOffset=this.wrapIndent*this.charWidths[S.L],this.line=t<n.length?this.line.substring(n[t-1],n[t]):this.line.substring(n[n.length-1])):this.line=this.line.substring(0,n[t])),t==n.length&&(this.line+=this.showInvisibles?i:S.DOT)}else this.line+=this.showInvisibles?i:S.DOT;var o=this.session,l=0,g;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(v,$){return v===" "||o.isFullWidth(v.charCodeAt(0))?(g=v===" "?o.getScreenTabSize($+l):2,l+=g-1,x.stringRepeat(S.DOT,g)):v}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==S.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var a=[];S.hasBidiCharacters(this.line,a)||this.isRtlDir?this.bidiMap=S.doBidiReorder(this.line,a,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(a){if(this.characterWidth!==a.$characterSize.width){this.fontMetrics=a;var t=this.characterWidth=a.$characterSize.width,e=a.$measureCharWidth("ה");this.charWidths[S.L]=this.charWidths[S.EN]=this.charWidths[S.ON_R]=t,this.charWidths[S.R]=this.charWidths[S.AN]=e,this.charWidths[S.R_H]=e*.45,this.charWidths[S.B]=this.charWidths[S.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(a){this.showInvisibles=a,this.currentRow=null},this.setEolChar=function(a){this.EOL=a},this.setContentWidth=function(a){this.contentWidth=a},this.isRtlLine=function(a){return this.$isRtl?!0:a!=null?this.session.getLine(a).charAt(0)==this.RLE:this.isRtlDir},this.setRtlDirection=function(a,t){for(var e=a.getCursorPosition(),i=a.selection.getSelectionAnchor().row;i<=e.row;i++)!t&&a.session.getLine(i).charAt(0)===a.session.$bidiHandler.RLE?a.session.doc.removeInLine(i,0,1):t&&a.session.getLine(i).charAt(0)!==a.session.$bidiHandler.RLE&&a.session.doc.insert({column:0,row:i},a.session.$bidiHandler.RLE)},this.getPosLeft=function(a){a-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,e=a>t?this.session.getOverwrite()?a:a-1:t,i=S.getVisualFromLogicalIdx(e,this.bidiMap),n=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&a<=t&&n[i]%2!==0&&i++;for(var l=0;l<i;l++)o+=this.charWidths[n[l]];return!this.session.getOverwrite()&&a>t&&n[i]%2===0&&(o+=this.charWidths[n[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(a,t){var e=this.bidiMap,i=e.bidiLevels,n,o=[],l=0,g=Math.min(a,t)-this.wrapIndent,v=Math.max(a,t)-this.wrapIndent,$=!1,y=!1,p=0;this.wrapIndent&&(l+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var r,h=0;h<i.length;h++)r=e.logicalFromVisual[h],n=i[h],$=r>=g&&r<v,$&&!y?p=l:!$&&y&&o.push({left:p,width:l-p}),l+=this.charWidths[n],y=$;if($&&h===i.length&&o.push({left:p,width:l-p}),this.isRtlDir)for(var w=0;w<o.length;w++)o[w].left+=this.rtlLineOffset;return o},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),i=0,n=0,o=this.bidiMap.bidiLevels,l=this.charWidths[o[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>i+l/2;){if(i+=l,n===o.length-1){l=0;break}l=this.charWidths[o[++n]]}return n>0&&o[n-1]%2!==0&&o[n]%2===0?(e<i&&n--,t=this.bidiMap.logicalFromVisual[n]):n>0&&o[n-1]%2===0&&o[n]%2!==0?t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===o.length-1&&l===0&&o[n-1]%2===0||!this.isRtlDir&&n===0&&o[n]%2!==0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&o[n-1]%2!==0&&l!==0&&n--,t=this.bidiMap.logicalFromVisual[n]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(c.prototype),k.BidiHandler=c}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/lang"),d=L("./lib/event_emitter").EventEmitter,c=L("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(i){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),!e.$isEmpty&&!e.$silent&&e._emit("changeSelection"),!e.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,!e.$isEmpty&&!e.$silent&&e._emit("changeSelection")})};(function(){S.implement(this,d),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.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?c.fromPoints(e,e):this.isBackwards()?c.fromPoints(e,t):c.fromPoints(t,e)},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(t,e){var i=e?t.end:t.start,n=e?t.start:t.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(t,e,i,n){if(!this.$silent){var o=this.$isEmpty,l=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(i,n),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||l)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},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(t,e){if(typeof e>"u"){var i=t||this.lead;t=i.row,e=i.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var i=typeof t=="number"?t:this.lead.row,n,o=this.session.getFoldLine(i);return o?(i=o.start.row,n=o.end.row):n=i,e===!0?new c(i,0,n,this.session.getLine(n).length):new c(i,0,n+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(t,e,i){var n=t.column,o=t.column+e;return i<0&&(n=t.column-e,o=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(n,o).split(" ").length-1==e},this.moveCursorLeft=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(t.column===0)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var i=this.session.getTabSize(),t=this.lead;this.wouldMoveIntoSoftTab(t,i,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,i):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var t=this.lead.row,e=this.lead.column,i=this.session.documentToScreenRow(t,e),n=this.session.screenToDocumentPosition(i,0),o=this.session.getDisplayLine(t,null,n.row,n.column),l=o.match(/^\s*/);l[0].length!=e&&!this.session.$useEmacsStyleLineStart&&(n.column+=l[0].length),this.moveCursorToPosition(n)},this.moveCursorLineEnd=function(){var t=this.lead,e=this.session.getDocumentLastRowColumnPosition(t.row,t.column);if(this.lead.column==e.column){var i=this.session.getLine(e.row);if(e.column==i.length){var n=i.search(/\s+$/);n>0&&(e.column=n)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(t,e,1);if(o){this.moveCursorTo(o.end.row,o.end.column);return}if(this.session.nonTokenRe.exec(n)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(e)),e>=i.length){this.moveCursorTo(t,i.length),this.moveCursorRight(),t<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(n)&&(e+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,e)},this.moveCursorLongWordLeft=function(){var t=this.lead.row,e=this.lead.column,i;if(i=this.session.getFoldAt(t,e,-1)){this.moveCursorTo(i.start.row,i.start.column);return}var n=this.session.getFoldStringAt(t,e,-1);n==null&&(n=this.doc.getLine(t).substring(0,e));var o=x.stringReverse(n);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(o)&&(e-=this.session.nonTokenRe.lastIndex,o=o.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),e<=0){this.moveCursorTo(t,0),this.moveCursorLeft(),t>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(o)&&(e-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,e)},this.$shortWordEndIndex=function(t){var e=0,i,n=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(t))e=this.session.tokenRe.lastIndex;else{for(;(i=t[e])&&n.test(i);)e++;if(e<1){for(o.lastIndex=0;(i=t[e])&&!o.test(i);)if(o.lastIndex=0,e++,n.test(i)){if(e>2){e--;break}for(;(i=t[e])&&n.test(i);)e++;if(e>2)break}}}return o.lastIndex=0,e},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e),o=this.session.getFoldAt(t,e,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(e==i.length){var l=this.doc.getLength();do t++,n=this.doc.getLine(t);while(t<l&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),e=0}var g=this.$shortWordEndIndex(n);this.moveCursorTo(t,e+g)},this.moveCursorShortWordLeft=function(){var t=this.lead.row,e=this.lead.column,i;if(i=this.session.getFoldAt(t,e,-1))return this.moveCursorTo(i.start.row,i.start.column);var n=this.session.getLine(t).substring(0,e);if(e===0){do t--,n=this.doc.getLine(t);while(t>0&&/^\s*$/.test(n));e=n.length,/\s+$/.test(n)||(n="")}var o=x.stringReverse(n),l=this.$shortWordEndIndex(o);return this.moveCursorTo(t,e-l)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),n;if(e===0&&(t!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),t!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];t<0?t-=o.rowsAbove||0:t>0&&(t+=o.rowCount-(o.rowsAbove||0))}var l=this.session.screenToDocumentPosition(i.row+t,i.column,n);t!==0&&e===0&&l.row===this.lead.row&&(l.column,this.lead.column),this.moveCursorTo(l.row,l.column+e,e===0)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,i){var n=this.session.getFoldAt(t,e,1);n&&(t=n.start.row,e=n.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(o.charAt(e))&&o.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,i){var n=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(n.row,n.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var i=this.getCursor();return c.fromPoints(e,i)}catch(n){return c.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(e){var i=e.clone();return i.isBackwards=e.cursor==e.start,i});else{var t=this.getRange();t.isBackwards=this.isBackwards()}return t},this.fromJSON=function(t){if(t.start==null){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var i=c.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),k.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(L,k,N){var S=L("./config"),x=2e3,d=function(c){this.states=c,this.regExps={},this.matchMappings={};for(var a in this.states){for(var t=this.states[a],e=[],i=0,n=this.matchMappings[a]={defaultToken:"text"},o="g",l=[],g=0;g<t.length;g++){var v=t[g];if(v.defaultToken&&(n.defaultToken=v.defaultToken),v.caseInsensitive&&(o="gi"),v.regex!=null){v.regex instanceof RegExp&&(v.regex=v.regex.toString().slice(1,-1));var $=v.regex,y=new RegExp("(?:("+$+")|(.))").exec("a").length-2;Array.isArray(v.token)?v.token.length==1||y==1?v.token=v.token[0]:y-1!=v.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:v,groupCount:y-1}),v.token=v.token[0]):(v.tokenArray=v.token,v.token=null,v.onMatch=this.$arrayTokens):typeof v.token=="function"&&!v.onMatch&&(y>1?v.onMatch=this.$applyToken:v.onMatch=v.token),y>1&&(/\\\d/.test(v.regex)?$=v.regex.replace(/\\([0-9]+)/g,function(p,r){return"\\"+(parseInt(r,10)+i+1)}):(y=1,$=this.removeCapturingGroups(v.regex)),!v.splitRegex&&typeof v.token!="string"&&l.push(v)),n[i]=g,i+=y,e.push($),v.onMatch||(v.onMatch=null)}}e.length||(n[0]=0,e.push("$")),l.forEach(function(p){p.splitRegex=this.createSplitterRegexp(p.regex,o)},this),this.regExps[a]=new RegExp("("+e.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(c){x=c|0},this.$applyToken=function(c){var a=this.splitRegex.exec(c).slice(1),t=this.token.apply(this,a);if(typeof t=="string")return[{type:t,value:c}];for(var e=[],i=0,n=t.length;i<n;i++)a[i]&&(e[e.length]={type:t[i],value:a[i]});return e},this.$arrayTokens=function(c){if(!c)return[];var a=this.splitRegex.exec(c);if(!a)return"text";for(var t=[],e=this.tokenArray,i=0,n=e.length;i<n;i++)a[i+1]&&(t[t.length]={type:e[i],value:a[i+1]});return t},this.removeCapturingGroups=function(c){var a=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(t,e){return e?"(?:":t});return a},this.createSplitterRegexp=function(c,a){if(c.indexOf("(?=")!=-1){var t=0,e=!1,i={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(n,o,l,g,v,$){return e?e=v!="]":v?e=!0:g?(t==i.stack&&(i.end=$+1,i.stack=-1),t--):l&&(t++,l.length!=1&&(i.stack=t,i.start=$)),n}),i.end!=null&&/^\)*$/.test(c.substr(i.end))&&(c=c.substring(0,i.start)+c.substr(i.end))}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(a||"").replace("g",""))},this.getLineTokens=function(c,a){if(a&&typeof a!="string"){var t=a.slice(0);a=t[0],a==="#tmp"&&(t.shift(),a=t.shift())}else var t=[];var e=a||"start",i=this.states[e];i||(e="start",i=this.states[e]);var n=this.matchMappings[e],o=this.regExps[e];o.lastIndex=0;for(var l,g=[],v=0,$=0,y={type:null,value:""};l=o.exec(c);){var p=n.defaultToken,r=null,h=l[0],w=o.lastIndex;if(w-h.length>v){var u=c.substring(v,w-h.length);y.type==p?y.value+=u:(y.type&&g.push(y),y={type:p,value:u})}for(var f=0;f<l.length-2;f++)if(l[f+1]!==void 0){r=i[n[f]],r.onMatch?p=r.onMatch(h,e,t,c):p=r.token,r.next&&(typeof r.next=="string"?e=r.next:e=r.next(e,t),i=this.states[e],i||(this.reportError("state doesn't exist",e),e="start",i=this.states[e]),n=this.matchMappings[e],v=w,o=this.regExps[e],o.lastIndex=w),r.consumeLineEnd&&(v=w);break}if(h){if(typeof p=="string")r&&r.merge===!1||y.type!==p?(y.type&&g.push(y),y={type:p,value:h}):y.value+=h;else if(p){y.type&&g.push(y),y={type:null,value:""};for(var f=0;f<p.length;f++)g.push(p[f])}}if(v==c.length)break;if(v=w,$++>x){for($>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:a,line:c});v<c.length;)y.type&&g.push(y),y={value:c.substring(v,v+=500),type:"overflow"};e="start",t=[];break}}return y.type&&g.push(y),t.length>1&&t[0]!==e&&t.unshift("#tmp",e),{tokens:g,state:t.length?t:e}},this.reportError=S.reportError}).call(d.prototype),k.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(L,k,N){var S=L("../lib/lang"),x=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(a,t){if(!t){for(var e in a)this.$rules[e]=a[e];return}for(var e in a){for(var i=a[e],n=0;n<i.length;n++){var o=i[n];(o.next||o.onMatch)&&(typeof o.next=="string"&&o.next.indexOf(t)!==0&&(o.next=t+o.next),o.nextState&&o.nextState.indexOf(t)!==0&&(o.nextState=t+o.nextState))}this.$rules[t+e]=i}},this.getRules=function(){return this.$rules},this.embedRules=function(a,t,e,i,n){var o=typeof a=="function"?new a().getRules():a;if(i)for(var l=0;l<i.length;l++)i[l]=t+i[l];else{i=[];for(var g in o)i.push(t+g)}if(this.addRules(o,t),e)for(var v=Array.prototype[n?"push":"unshift"],l=0;l<i.length;l++)v.apply(this.$rules[i[l]],S.deepCopy(e));this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var d=function(a,t){return(a!="start"||t.length)&&t.unshift(this.nextState,a),this.nextState},c=function(a,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){function a(i){var n=e[i];n.processed=!0;for(var o=0;o<n.length;o++){var l=n[o],g=null;Array.isArray(l)&&(g=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var v=l.next||l.push;if(v&&Array.isArray(v)){var $=l.stateName;$||($=l.token,typeof $!="string"&&($=$[0]||""),e[$]&&($+=t++)),e[$]=v,l.next=$,a($)}else v=="pop"&&(l.next=c);if(l.push&&(l.nextState=l.next||l.push,l.next=d,delete l.push),l.rules)for(var y in l.rules)e[y]?e[y].push&&e[y].push.apply(e[y],l.rules[y]):e[y]=l.rules[y];var p=typeof l=="string"?l:l.include;if(p&&(Array.isArray(p)?g=p.map(function(h){return e[h]}):g=e[p]),g){var r=[o,1].concat(g);l.noEscape&&(r=r.filter(function(h){return!h.next})),n.splice.apply(n,r),o--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}var t=0,e=this.$rules;Object.keys(e).forEach(a,this)},this.createKeywordMapper=function(a,t,e,i){var n=Object.create(null);return this.$keywordList=[],Object.keys(a).forEach(function(o){for(var l=a[o],g=l.split(i||"|"),v=g.length;v--;){var $=g[v];this.$keywordList.push($),e&&($=$.toLowerCase()),n[$]=o}},this),a=null,e?function(o){return n[o.toLowerCase()]||t}:function(o){return n[o]||t}},this.getKeywords=function(){return this.$keywords}}).call(x.prototype),k.TextHighlightRules=x}),ace.define("ace/mode/behaviour",["require","exports","module"],function(L,k,N){var S=function(){this.$behaviours={}};(function(){this.add=function(x,d,c){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[x]:this.$behaviours[x]={}}this.$behaviours[x][d]=c},this.addBehaviours=function(x){for(var d in x)for(var c in x[d])this.add(d,c,x[d][c])},this.remove=function(x){this.$behaviours&&this.$behaviours[x]&&delete this.$behaviours[x]},this.inherit=function(x,d){if(typeof x=="function")var c=new x().getBehaviours(d);else var c=x.getBehaviours(d);this.addBehaviours(c)},this.getBehaviours=function(x){if(!x)return this.$behaviours;for(var d={},c=0;c<x.length;c++)this.$behaviours[x[c]]&&(d[x[c]]=this.$behaviours[x[c]]);return d}}).call(S.prototype),k.Behaviour=S}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(L,k,N){var S=L("./range").Range,x=function(d,c,a){this.$session=d,this.$row=c,this.$rowTokens=d.getTokens(c);var t=d.getTokenAt(c,a);this.$tokenIndex=t?t.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;for(var d;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,d||(d=this.$session.getLength()),this.$row>=d)return this.$row=d-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var d=this.$rowTokens,c=this.$tokenIndex,a=d[c].start;if(a!==void 0)return a;for(a=0;c>0;)c-=1,a+=d[c].value.length;return a},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var d=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new S(this.$row,c,this.$row,c+d.value.length)}}).call(x.prototype),k.TokenIterator=x}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(L,k,N){var S=L("../../lib/oop"),x=L("../behaviour").Behaviour,d=L("../../token_iterator").TokenIterator,c=L("../../lib/lang"),a=["text","paren.rparen","rparen","paren","punctuation.operator"],t=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],e,i={},n={'"':'"',"'":"'"},o=function(v){var $=-1;if(v.multiSelect&&($=v.selection.index,i.rangeCount!=v.multiSelect.rangeCount&&(i={rangeCount:v.multiSelect.rangeCount})),i[$])return e=i[$];e=i[$]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},l=function(v,$,y,p){var r=v.end.row-v.start.row;return{text:y+$+p,selection:[0,v.start.column+1,r,v.end.column+(r?0:1)]}},g=function(v){this.add("braces","insertion",function($,y,p,r,h){var w=p.getCursorPosition(),u=r.doc.getLine(w.row);if(h=="{"){o(p);var f=p.getSelectionRange(),s=r.doc.getTextRange(f);if(s!==""&&s!=="{"&&p.getWrapBehavioursEnabled())return l(f,s,"{","}");if(g.isSaneInsertion(p,r))return/[\]\}\)]/.test(u[w.column])||p.inMultiSelectMode||v&&v.braces?(g.recordAutoInsert(p,r,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(p,r,"{"),{text:"{",selection:[1,1]})}else if(h=="}"){o(p);var m=u.substring(w.column,w.column+1);if(m=="}"){var b=r.$findOpeningBracket("}",{column:w.column+1,row:w.row});if(b!==null&&g.isAutoInsertedClosing(w,u,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(h=="\n"||h=="\r\n"){o(p);var C="";g.isMaybeInsertedClosing(w,u)&&(C=c.stringRepeat("}",e.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var m=u.substring(w.column,w.column+1);if(m==="}"){var A=r.findMatchingBracket({row:w.row,column:w.column+1},"}");if(!A)return null;var R=this.$getIndent(r.getLine(A.row))}else{if(!C){g.clearMaybeInsertedClosing();return}var R=this.$getIndent(u)}var E=R+r.getTabString();return{text:"\n"+E+"\n"+R+C,selection:[1,E.length,1,E.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="{"){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.end.column,h.end.column+1);if(f=="}")return h.end.column++,h;e.maybeInsertedBrackets--}}),this.add("parens","insertion",function($,y,p,r,h){if(h=="("){o(p);var w=p.getSelectionRange(),u=r.doc.getTextRange(w);if(u!==""&&p.getWrapBehavioursEnabled())return l(w,u,"(",")");if(g.isSaneInsertion(p,r))return g.recordAutoInsert(p,r,")"),{text:"()",selection:[1,1]}}else if(h==")"){o(p);var f=p.getCursorPosition(),s=r.doc.getLine(f.row),m=s.substring(f.column,f.column+1);if(m==")"){var b=r.$findOpeningBracket(")",{column:f.column+1,row:f.row});if(b!==null&&g.isAutoInsertedClosing(f,s,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="("){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.start.column+1,h.start.column+2);if(f==")")return h.end.column++,h}}),this.add("brackets","insertion",function($,y,p,r,h){if(h=="["){o(p);var w=p.getSelectionRange(),u=r.doc.getTextRange(w);if(u!==""&&p.getWrapBehavioursEnabled())return l(w,u,"[","]");if(g.isSaneInsertion(p,r))return g.recordAutoInsert(p,r,"]"),{text:"[]",selection:[1,1]}}else if(h=="]"){o(p);var f=p.getCursorPosition(),s=r.doc.getLine(f.row),m=s.substring(f.column,f.column+1);if(m=="]"){var b=r.$findOpeningBracket("]",{column:f.column+1,row:f.row});if(b!==null&&g.isAutoInsertedClosing(f,s,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="["){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.start.column+1,h.start.column+2);if(f=="]")return h.end.column++,h}}),this.add("string_dquotes","insertion",function($,y,p,r,h){var w=r.$mode.$quotes||n;if(h.length==1&&w[h]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(h)!=-1)return;o(p);var u=h,f=p.getSelectionRange(),s=r.doc.getTextRange(f);if(s!==""&&(s.length!=1||!w[s])&&p.getWrapBehavioursEnabled())return l(f,s,u,u);if(!s){var m=p.getCursorPosition(),b=r.doc.getLine(m.row),C=b.substring(m.column-1,m.column),A=b.substring(m.column,m.column+1),R=r.getTokenAt(m.row,m.column),E=r.getTokenAt(m.row,m.column+1);if(C=="\\"&&R&&/escape/.test(R.type))return null;var I=R&&/string|escape/.test(R.type),T=!E||/string|escape/.test(E.type),_;if(A==u)_=I!==T,_&&/string\.end/.test(E.type)&&(_=!1);else{if(I&&!T||I&&T)return null;var M=r.$mode.tokenRe;M.lastIndex=0;var O=M.test(C);M.lastIndex=0;var D=M.test(C);if(O||D||A&&!/[\s;,.})\]\\]/.test(A))return null;var F=b[m.column-2];if(!(C!=u||F!=u&&!M.test(F)))return null;_=!0}return{text:_?u+u:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function($,y,p,r,h){var w=r.$mode.$quotes||n,u=r.doc.getTextRange(h);if(!h.isMultiLine()&&w.hasOwnProperty(u)){o(p);var f=r.doc.getLine(h.start.row),s=f.substring(h.start.column+1,h.start.column+2);if(s==u)return h.end.column++,h}})};g.isSaneInsertion=function(v,$){var y=v.getCursorPosition(),p=new d($,y.row,y.column);if(!this.$matchTokenType(p.getCurrentToken()||"text",a)){if(/[)}\]]/.test(v.session.getLine(y.row)[y.column]))return!0;var r=new d($,y.row,y.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",a))return!1}return p.stepForward(),p.getCurrentTokenRow()!==y.row||this.$matchTokenType(p.getCurrentToken()||"text",t)},g.$matchTokenType=function(v,$){return $.indexOf(v.type||v)>-1},g.recordAutoInsert=function(v,$,y){var p=v.getCursorPosition(),r=$.doc.getLine(p.row);this.isAutoInsertedClosing(p,r,e.autoInsertedLineEnd[0])||(e.autoInsertedBrackets=0),e.autoInsertedRow=p.row,e.autoInsertedLineEnd=y+r.substr(p.column),e.autoInsertedBrackets++},g.recordMaybeInsert=function(v,$,y){var p=v.getCursorPosition(),r=$.doc.getLine(p.row);this.isMaybeInsertedClosing(p,r)||(e.maybeInsertedBrackets=0),e.maybeInsertedRow=p.row,e.maybeInsertedLineStart=r.substr(0,p.column)+y,e.maybeInsertedLineEnd=r.substr(p.column),e.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(v,$,y){return e.autoInsertedBrackets>0&&v.row===e.autoInsertedRow&&y===e.autoInsertedLineEnd[0]&&$.substr(v.column)===e.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(v,$){return e.maybeInsertedBrackets>0&&v.row===e.maybeInsertedRow&&$.substr(v.column)===e.maybeInsertedLineEnd&&$.substr(0,v.column)==e.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){e.autoInsertedLineEnd=e.autoInsertedLineEnd.substr(1),e.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){e&&(e.maybeInsertedBrackets=0,e.maybeInsertedRow=-1)},S.inherits(g,x),k.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(L,k,N){for(var S=[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],x=0,d=[],c=0;c<S.length;c+=2)d.push(x+=S[c]),S[c+1]&&d.push(45,x+=S[c+1]);k.wordChars=String.fromCharCode.apply(null,d)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(L,k,N){var S=L("../config"),x=L("../tokenizer").Tokenizer,d=L("./text_highlight_rules").TextHighlightRules,c=L("./behaviour/cstyle").CstyleBehaviour,a=L("../unicode"),t=L("../lib/lang"),e=L("../token_iterator").TokenIterator,i=L("../range").Range,n=function(){this.HighlightRules=d};(function(){this.$defaultBehaviour=new c,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new x(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(o,l,g,v){function $(_){for(var M=g;M<=v;M++)_(y.getLine(M),M)}var y=l.doc,p=!0,r=!0,h=1/0,w=l.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var m=this.lineCommentStart.map(t.escapeRegExp).join("|"),f=this.lineCommentStart[0];else var m=t.escapeRegExp(this.lineCommentStart),f=this.lineCommentStart;m=new RegExp("^(\\s*)(?:"+m+") ?"),u=l.getUseSoftTabs();var A=function(W,B){var P=W.match(m);if(P){var z=P[1].length,V=P[0].length;!I(W,z,V)&&P[0][V-1]==" "&&V--,y.removeInLine(B,z,V)}},E=f+" ",C=function(W,B){(!p||/\S/.test(W))&&(I(W,h,h)?y.insertInLine({row:B,column:h},E):y.insertInLine({row:B,column:h},f))},R=function(W,B){return m.test(W)},I=function(W,B,P){for(var z=0;B--&&W.charAt(B)==" ";)z++;if(z%w!=0)return!1;for(var z=0;W.charAt(P++)==" ";)z++;return w>2?z%w!=w-1:z%w==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,s=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+t.escapeRegExp(f)+")"),b=new RegExp("(?:"+t.escapeRegExp(s)+")\\s*$"),C=function(_,M){R(_,M)||(!p||/\S/.test(_))&&(y.insertInLine({row:M,column:_.length},s),y.insertInLine({row:M,column:h},f))},A=function(_,M){var O;(O=_.match(b))&&y.removeInLine(M,_.length-O[0].length,_.length),(O=_.match(m))&&y.removeInLine(M,O[1].length,O[0].length)},R=function(_,M){if(m.test(_))return!0;for(var O=l.getTokens(M),D=0;D<O.length;D++)if(O[D].type==="comment")return!0}}var T=1/0;$(function(_,M){var O=_.search(/\S/);O!==-1?(O<h&&(h=O),r&&!R(_,M)&&(r=!1)):T>_.length&&(T=_.length)}),h==1/0&&(h=T,p=!1,r=!1),u&&h%w!=0&&(h=Math.floor(h/w)*w),$(r?A:C)},this.toggleBlockComment=function(o,l,g,v){var $=this.blockComment;if($){!$.start&&$[0]&&($=$[0]);var y=new e(l,v.row,v.column),p=y.getCurrentToken();l.selection;var r=l.selection.toOrientedRange(),h,w;if(p&&/comment/.test(p.type)){for(var u,f;p&&/comment/.test(p.type);){var s=p.value.indexOf($.start);if(s!=-1){var m=y.getCurrentTokenRow(),b=y.getCurrentTokenColumn()+s;u=new i(m,b,m,b+$.start.length);break}p=y.stepBackward()}for(var y=new e(l,v.row,v.column),p=y.getCurrentToken();p&&/comment/.test(p.type);){var s=p.value.indexOf($.end);if(s!=-1){var m=y.getCurrentTokenRow(),b=y.getCurrentTokenColumn()+s;f=new i(m,b,m,b+$.end.length);break}p=y.stepForward()}f&&l.remove(f),u&&(l.remove(u),h=u.start.row,w=-$.start.length)}else w=$.start.length,h=g.start.row,l.insert(g.end,$.end),l.insert(g.start,$.start);r.start.row==h&&(r.start.column+=w),r.end.row==h&&(r.end.column+=w),l.selection.fromOrientedRange(r)}},this.getNextLineIndent=function(o,l,g){return this.$getIndent(l)},this.checkOutdent=function(o,l,g){return!1},this.autoOutdent=function(o,l,g){},this.$getIndent=function(o){return o.match(/^\s*/)[0]},this.createWorker=function(o){return null},this.createModeDelegates=function(o){this.$embeds=[],this.$modes={};for(var l in o)if(o[l]){var g=o[l],v=g.prototype.$id,$=S.$modes[v];$||(S.$modes[v]=$=new g),S.$modes[l]||(S.$modes[l]=$),this.$embeds.push(l),this.$modes[l]=$}for(var y=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],l=0;l<y.length;l++)(function(r){var h=y[l],w=r[h];r[y[l]]=function(){return this.$delegator(h,arguments,w)}})(this)},this.$delegator=function(o,l,g){var v=l[0]||"start";if(typeof v!="string"){if(Array.isArray(v[2])){var $=v[2][v[2].length-1],y=this.$modes[$];if(y)return y[o].apply(y,[v[1]].concat([].slice.call(l,1)))}v=v[0]||"start"}for(var p=0;p<this.$embeds.length;p++)if(this.$modes[this.$embeds[p]]){var r=v.split(this.$embeds[p]);if(!r[0]&&r[1]){l[0]=r[1];var y=this.$modes[this.$embeds[p]];return y[o].apply(y,l)}}var h=g.apply(this,l);return g?h:void 0},this.transformAction=function(o,l,g,v,$){if(this.$behaviour){var y=this.$behaviour.getBehaviours();for(var p in y)if(y[p][l]){var r=y[p][l].apply(this,arguments);if(r)return r}}},this.getKeywords=function(o){if(!this.completionKeywords){var l=this.$tokenizer.rules,g=[];for(var v in l)for(var $=l[v],y=0,p=$.length;y<p;y++)if(typeof $[y].token=="string")/keyword|support|storage/.test($[y].token)&&g.push($[y].regex);else if(typeof $[y].token=="object"){for(var r=0,h=$[y].token.length;r<h;r++)if(/keyword|support|storage/.test($[y].token[r])){var v=$[y].regex.match(/\(.+?\)/g)[r];g.push(v.substr(1,v.length-2))}}this.completionKeywords=g}return o?g.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(o,l,g,v){var $=this.$keywordList||this.$createKeywordList();return $.map(function(y){return{name:y,value:y,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(n.prototype),k.Mode=n}),ace.define("ace/apply_delta",["require","exports","module"],function(L,k,N){k.applyDelta=function(S,x,d){var c=x.start.row,a=x.start.column,t=S[c]||"";switch(x.action){case"insert":var e=x.lines;if(e.length===1)S[c]=t.substring(0,a)+x.lines[0]+t.substring(a);else{var i=[c,1].concat(x.lines);S.splice.apply(S,i),S[c]=t.substring(0,a)+S[c],S[c+x.lines.length-1]+=t.substring(a)}break;case"remove":var n=x.end.column,o=x.end.row;c===o?S[c]=t.substring(0,a)+t.substring(n):S.splice(c,o-c+1,t.substring(0,a)+S[o].substring(n))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/event_emitter").EventEmitter,d=k.Anchor=function(c,a,t){this.$onChange=this.onChange.bind(this),this.attach(c),typeof t>"u"?this.setPosition(a.row,a.column):this.setPosition(a,t)};(function(){function c(t,e,i){var n=i?t.column<=e.column:t.column<e.column;return t.row<e.row||t.row==e.row&&n}function a(t,e,i){var n=t.action=="insert",o=(n?1:-1)*(t.end.row-t.start.row),l=(n?1:-1)*(t.end.column-t.start.column),g=t.start,v=n?g:t.end;return c(e,g,i)?{row:e.row,column:e.column}:c(v,e,!i)?{row:e.row+o,column:e.column+(e.row==v.row?l:0)}:{row:g.row,column:g.column}}S.implement(this,x),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row)&&!(t.start.row>this.row)){var e=a(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},this.setPosition=function(t,e,i){var n;if(i?n={row:t,column:e}:n=this.$clipPositionToDocument(t,e),!(this.row==n.row&&this.column==n.column)){var o={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:o,value:n})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var i={};return t>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):t<0?(i.row=0,i.column=0):(i.row=t,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,e))),e<0&&(i.column=0),i}}).call(d.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(L,k,N){var S=L("./lib/oop"),x=L("./apply_delta").applyDelta,d=L("./lib/event_emitter").EventEmitter,c=L("./range").Range,a=L("./anchor").Anchor,t=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){S.implement(this,d),this.setValue=function(e){var i=this.getLength()-1;this.remove(new c(0,0,i,this.getLine(i).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,i){return new a(this,e,i)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var i=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=i?i[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,i){return this.$lines.slice(e,i+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var i;if(e.start.row===e.end.row)i=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{i=this.getLines(e.start.row,e.end.row),i[0]=(i[0]||"").substring(e.start.column);var n=i.length-1;e.end.row-e.start.row==n&&(i[n]=i[n].substring(0,e.end.column))}return i},this.insertLines=function(e,i){return this.insertFullLines(e,i)},this.removeLines=function(e,i){return this.removeFullLines(e,i)},this.insertNewLine=function(e){return this.insertMergedLines(e,["",""])},this.insert=function(e,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(e,this.$split(i))},this.insertInLine=function(e,i){var n=this.clippedPos(e.row,e.column),o=this.pos(e.row,e.column+i.length);return this.applyDelta({start:n,end:o,action:"insert",lines:[i]},!0),this.clonePos(o)},this.clippedPos=function(e,i){var n=this.getLength();e===void 0?e=n:e<0?e=0:e>=n&&(e=n-1,i=void 0);var o=this.getLine(e);return i==null&&(i=o.length),i=Math.min(Math.max(i,0),o.length),{row:e,column:i}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,i){return{row:e,column:i}},this.$clipPosition=function(e){var i=this.getLength();return e.row>=i?(e.row=Math.max(0,i-1),e.column=this.getLine(i-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,i){e=Math.min(Math.max(e,0),this.getLength());var n=0;e<this.getLength()?(i=i.concat([""]),n=0):(i=[""].concat(i),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},i)},this.insertMergedLines=function(e,i){var n=this.clippedPos(e.row,e.column),o={row:n.row+i.length-1,column:(i.length==1?n.column:0)+i[i.length-1].length};return this.applyDelta({start:n,end:o,action:"insert",lines:i}),this.clonePos(o)},this.remove=function(e){var i=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:i,end:n,action:"remove",lines:this.getLinesForRange({start:i,end:n})}),this.clonePos(i)},this.removeInLine=function(e,i,n){var o=this.clippedPos(e,i),l=this.clippedPos(e,n);return this.applyDelta({start:o,end:l,action:"remove",lines:this.getLinesForRange({start:o,end:l})},!0),this.clonePos(o)},this.removeFullLines=function(e,i){e=Math.min(Math.max(0,e),this.getLength()-1),i=Math.min(Math.max(0,i),this.getLength()-1);var n=i==this.getLength()-1&&e>0,o=i<this.getLength()-1,l=n?e-1:e,g=n?this.getLine(l).length:0,v=o?i+1:i,$=o?0:this.getLine(v).length,y=new c(l,g,v,$),p=this.$lines.slice(e,i+1);return this.applyDelta({start:y.start,end:y.end,action:"remove",lines:this.getLinesForRange(y)}),p},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,i){if(e instanceof c||(e=c.fromPoints(e.start,e.end)),i.length===0&&e.isEmpty())return e.start;if(i==this.getTextRange(e))return e.end;this.remove(e);var n;return i?n=this.insert(e.start,i):n=e.start,n},this.applyDeltas=function(e){for(var i=0;i<e.length;i++)this.applyDelta(e[i])},this.revertDeltas=function(e){for(var i=e.length-1;i>=0;i--)this.revertDelta(e[i])},this.applyDelta=function(e,i){var n=e.action=="insert";(n?e.lines.length<=1&&!e.lines[0]:!c.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(x(this.$lines,e,i),this._signal("change",e)))},this.$safeApplyDelta=function(e){var i=this.$lines.length;(e.action=="remove"&&e.start.row<i&&e.end.row<i||e.action=="insert"&&e.start.row<=i)&&this.applyDelta(e)},this.$splitAndapplyLargeDelta=function(e,i){for(var n=e.lines,o=n.length-i+1,l=e.start.row,g=e.start.column,v=0,$=0;v<o;v=$){$+=i-1;var y=n.slice(v,$);y.push(""),this.applyDelta({start:this.pos(l+v,g),end:this.pos(l+$,g=0),action:e.action,lines:y},!0)}e.lines=n.slice(v),e.start.row=l+v,e.start.column=g,this.applyDelta(e,!0)},this.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,i){for(var n=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,l=i||0,g=n.length;l<g;l++)if(e-=n[l].length+o,e<0)return{row:l,column:e+n[l].length+o};return{row:g-1,column:e+n[g-1].length+o}},this.positionToIndex=function(e,i){for(var n=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,l=0,g=Math.min(e.row,n.length),v=i||0;v<g;++v)l+=n[v].length+o;return l+e.column}}).call(t.prototype),k.Document=t}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/event_emitter").EventEmitter,d=function(c,a){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var t=this;this.$worker=function(){if(t.running){for(var e=new Date,i=t.currentLine,n=-1,o=t.doc,l=i;t.lines[i];)i++;var g=o.getLength(),v=0;for(t.running=!1;i<g;){t.$tokenizeRow(i),n=i;do i++;while(t.lines[i]);if(v++,v%5===0&&new Date-e>20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=i,n==-1&&(n=i),l<=n&&t.fireUpdateEvent(l,n)}}};(function(){S.implement(this,x),this.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(c,a){var t={first:c,last:a};this._signal("update",{data:t})},this.start=function(c){this.currentLine=Math.min(c||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)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(c){var a=c.start.row,t=c.end.row-a;if(t===0)this.lines[a]=null;else if(c.action=="remove")this.lines.splice(a,t+1,null),this.states.splice(a,t+1,null);else{var e=Array(t+1);e.unshift(a,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)}this.currentLine=Math.min(a,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},this.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},this.$tokenizeRow=function(c){var a=this.doc.getLine(c),t=this.states[c-1],e=this.tokenizer.getLineTokens(a,t,c);return this.states[c]+""!=e.state+""?(this.states[c]=e.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=e.tokens}}).call(d.prototype),k.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(L,k,N){var S=L("./lib/lang");L("./lib/oop");var x=L("./range").Range,d=function(c,a,t){this.setRegexp(c),this.clazz=a,this.type=t||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},this.update=function(c,a,t,e){if(this.regExp)for(var i=e.firstRow,n=e.lastRow,o=i;o<=n;o++){var l=this.cache[o];l==null&&(l=S.getMatchOffsets(t.getLine(o),this.regExp),l.length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(v){return new x(o,v.offset,o,v.offset+v.length)}),this.cache[o]=l.length?l:"");for(var g=l.length;g--;)a.drawSingleLineMarker(c,l[g].toScreenRange(t),this.clazz,e)}}}).call(d.prototype),k.SearchHighlight=d}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(L,k,N){function S(d,c){this.foldData=d,Array.isArray(c)?this.folds=c:c=this.folds=[c];var a=c[c.length-1];this.range=new x(c[0].start.row,c[0].start.column,a.end.row,a.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}var x=L("../range").Range;(function(){this.shiftRow=function(d){this.start.row+=d,this.end.row+=d,this.folds.forEach(function(c){c.start.row+=d,c.end.row+=d})},this.addFold=function(d){if(d.sameRow){if(d.start.row<this.startRow||d.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(d),this.folds.sort(function(c,a){return-c.range.compareEnd(a.start.row,a.start.column)}),this.range.compareEnd(d.start.row,d.start.column)>0?(this.end.row=d.end.row,this.end.column=d.end.column):this.range.compareStart(d.end.row,d.end.column)<0&&(this.start.row=d.start.row,this.start.column=d.start.column)}else if(d.start.row==this.end.row)this.folds.push(d),this.end.row=d.end.row,this.end.column=d.end.column;else{if(d.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(d),this.start.row=d.start.row,this.start.column=d.start.column}d.foldLine=this},this.containsRow=function(d){return d>=this.start.row&&d<=this.end.row},this.walk=function(d,c,a){var t=0,e=this.folds,i,n,o,l=!0;c==null&&(c=this.end.row,a=this.end.column);for(var g=0;g<e.length;g++){if(i=e[g],n=i.range.compareStart(c,a),n==-1){d(null,c,a,t,l);return}if(o=d(null,i.start.row,i.start.column,t,l),o=!o&&d(i.placeholder,i.start.row,i.start.column,t),o||n===0)return;l=!i.sameRow,t=i.end.column}d(null,c,a,t,l)},this.getNextFoldTo=function(d,c){for(var a,t,e=0;e<this.folds.length;e++){if(a=this.folds[e],t=a.range.compareEnd(d,c),t==-1)return{fold:a,kind:"after"};if(t===0)return{fold:a,kind:"inside"}}return null},this.addRemoveChars=function(d,c,a){var t=this.getNextFoldTo(d,c),e,i;if(t){if(e=t.fold,t.kind=="inside"&&e.start.column!=c&&e.start.row!=d)window.console&&window.console.log(d,c,e);else if(e.start.row==d){i=this.folds;var n=i.indexOf(e);for(n===0&&(this.start.column+=a),n;n<i.length;n++){if(e=i[n],e.start.column+=a,!e.sameRow)return;e.end.column+=a}this.end.column+=a}}},this.split=function(d,c){var a=this.getNextFoldTo(d,c);if(!a||a.kind=="inside")return null;var t=a.fold,e=this.folds,i=this.foldData,n=e.indexOf(t),o=e[n-1];this.end.row=o.end.row,this.end.column=o.end.column,e=e.splice(n,e.length-n);var l=new S(i,e);return i.splice(i.indexOf(this)+1,0,l),l},this.merge=function(d){for(var c=d.folds,a=0;a<c.length;a++)this.addFold(c[a]);var t=this.foldData;t.splice(t.indexOf(d),1)},this.toString=function(){var d=[this.range.toString()+": ["];return this.folds.forEach(function(c){d.push(" "+c.toString())}),d.push("]"),d.join("\n")},this.idxToPosition=function(d){for(var c=0,a=0;a<this.folds.length;a++){var t=this.folds[a];if(d-=t.start.column-c,d<0)return{row:t.start.row,column:t.start.column+d};if(d-=t.placeholder.length,d<0)return t.start;c=t.end.column}return{row:this.end.row,column:this.end.column+d}}}).call(S.prototype),k.FoldLine=S}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(L,k,N){var S=L("./range").Range,x=S.comparePoints,d=function(){this.ranges=[],this.$bias=1};(function(){this.comparePoints=x,this.pointIndex=function(c,a,t){for(var e=this.ranges,i=t||0;i<e.length;i++){var n=e[i],o=x(c,n.end);if(!(o>0)){var l=x(c,n.start);return o===0?a&&l!==0?-i-2:i:l>0||l===0&&!a?i:-i-1}}return-i-1},this.add=function(c){var a=!c.isEmpty(),t=this.pointIndex(c.start,a);t<0&&(t=-t-1);var e=this.pointIndex(c.end,a,t);return e<0?e=-e-1:e++,this.ranges.splice(t,e-t,c)},this.addList=function(c){for(var a=[],t=c.length;t--;)a.push.apply(a,this.add(c[t]));return a},this.substractPoint=function(c){var a=this.pointIndex(c);if(a>=0)return this.ranges.splice(a,1)},this.merge=function(){var c=[],a=this.ranges;a=a.sort(function(o,l){return x(o.start,l.start)});for(var t=a[0],e,i=1;i<a.length;i++){e=t,t=a[i];var n=x(e.end,t.start);n<0||n==0&&!e.isEmpty()&&!t.isEmpty()||(x(e.end,t.end)<0&&(e.end.row=t.end.row,e.end.column=t.end.column),a.splice(i,1),c.push(t),t=e,i--)}return this.ranges=a,c},this.contains=function(c,a){return this.pointIndex({row:c,column:a})>=0},this.containsPoint=function(c){return this.pointIndex(c)>=0},this.rangeAtPoint=function(c){var a=this.pointIndex(c);if(a>=0)return this.ranges[a]},this.clipRows=function(c,a){var t=this.ranges;if(t[0].start.row>a||t[t.length-1].start.row<c)return[];var e=this.pointIndex({row:c,column:0});e<0&&(e=-e-1);var i=this.pointIndex({row:a,column:0},e);i<0&&(i=-i-1);for(var n=[],o=e;o<i;o++)n.push(t[o]);return n},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(c){for(var a=c.start,t=c.end,e=a.row,i=t.row,n=this.ranges,o=0,l=n.length;o<l;o++){var g=n[o];if(g.end.row>=e)break}if(c.action=="insert")for(var v=i-e,$=-a.column+t.column;o<l;o++){var g=n[o];if(g.start.row>e)break;if(g.start.row==e&&g.start.column>=a.column&&(g.start.column==a.column&&this.$bias<=0||(g.start.column+=$,g.start.row+=v)),g.end.row==e&&g.end.column>=a.column){if(g.end.column==a.column&&this.$bias<0)continue;g.end.column==a.column&&$>0&&o<l-1&&g.end.column>g.start.column&&g.end.column==n[o+1].start.column&&(g.end.column-=$),g.end.column+=$,g.end.row+=v}}else for(var v=e-i,$=a.column-t.column;o<l;o++){var g=n[o];if(g.start.row>i)break;g.end.row<i&&(e<g.end.row||e==g.end.row&&a.column<g.end.column)?(g.end.row=e,g.end.column=a.column):g.end.row==i?g.end.column<=t.column?(v||g.end.column>a.column)&&(g.end.column=a.column,g.end.row=a.row):(g.end.column+=$,g.end.row+=v):g.end.row>i&&(g.end.row+=v),g.start.row<i&&(e<g.start.row||e==g.start.row&&a.column<g.start.column)?(g.start.row=e,g.start.column=a.column):g.start.row==i?g.start.column<=t.column?(v||g.start.column>a.column)&&(g.start.column=a.column,g.start.row=a.row):(g.start.column+=$,g.start.row+=v):g.start.row>i&&(g.start.row+=v)}if(v!=0&&o<l)for(;o<l;o++){var g=n[o];g.start.row+=v,g.end.row+=v}}}).call(d.prototype),k.RangeList=d}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],function(L,k,N){function S(i,n){i.row-=n.row,i.row==0&&(i.column-=n.column)}function x(i,n){S(i.start,n),S(i.end,n)}function d(i,n){i.row==0&&(i.column+=n.column),i.row+=n.row}function c(i,n){d(i.start,n),d(i.end,n)}var a=L("../range_list").RangeList,t=L("../lib/oop"),e=k.Fold=function(i,n){this.foldLine=null,this.placeholder=n,this.range=i,this.start=i.start,this.end=i.end,this.sameRow=i.start.row==i.end.row,this.subFolds=this.ranges=[]};t.inherits(e,a),(function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(n){n.setFoldLine(i)})},this.clone=function(){var i=this.range.clone(),n=new e(i,this.placeholder);return this.subFolds.forEach(function(o){n.subFolds.push(o.clone())}),n.collapseChildren=this.collapseChildren,n},this.addSubFold=function(i){if(!this.range.isEqual(i)){x(i,this.start);for(var v=i.start.row,$=i.start.column,n=0,o=-1;n<this.subFolds.length&&(o=this.subFolds[n].range.compare(v,$),o==1);n++);var l=this.subFolds[n],g=0;if(o==0){if(l.range.containsRange(i))return l.addSubFold(i);g=1}for(var v=i.range.end.row,$=i.range.end.column,y=n,o=-1;y<this.subFolds.length&&(o=this.subFolds[y].range.compare(v,$),o==1);y++);o==0&&y++;for(var p=this.subFolds.splice(n,y-n,i),r=o==0?p.length-1:p.length,h=g;h<r;h++)i.addSubFold(p[h]);return i.setFoldLine(this.foldLine),i}},this.restoreRange=function(i){return c(i,this.start)}}).call(e.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(L,k,N){function S(){this.getFoldAt=function(t,e,i){var n=this.getFoldLine(t);if(!n)return null;for(var o=n.folds,l=0;l<o.length;l++){var g=o[l].range;if(g.contains(t,e)){if(i==1&&g.isEnd(t,e)&&!g.isEmpty()||i==-1&&g.isStart(t,e)&&!g.isEmpty())continue;return o[l]}}},this.getFoldsInRange=function(t){var e=t.start,i=t.end,n=this.$foldData,o=[];e.column+=1,i.column-=1;for(var l=0;l<n.length;l++){var g=n[l].range.compareRange(t);if(g!=2){if(g==-2)break;for(var v=n[l].folds,$=0;$<v.length;$++){var y=v[$];if(g=y.range.compareRange(t),g==-2)break;if(g!=2){if(g==42)break;o.push(y)}}}}return e.column-=1,i.column+=1,o},this.getFoldsInRangeList=function(t){if(Array.isArray(t)){var e=[];t.forEach(function(n){e=e.concat(this.getFoldsInRange(n))},this)}else var e=this.getFoldsInRange(t);return e},this.getAllFolds=function(){for(var t=[],e=this.$foldData,i=0;i<e.length;i++)for(var n=0;n<e[i].folds.length;n++)t.push(e[i].folds[n]);return t},this.getFoldStringAt=function(t,e,i,n){if(n=n||this.getFoldLine(t),!n)return null;for(var o={end:{column:0}},l,g,v=0;v<n.folds.length;v++){g=n.folds[v];var $=g.range.compareEnd(t,e);if($==-1){l=this.getLine(g.start.row).substring(o.end.column,g.start.column);break}if($===0)return null;o=g}return l||(l=this.getLine(g.start.row).substring(o.end.column)),i==-1?l.substring(0,e-o.end.column):i==1?l.substring(e-o.end.column):l},this.getFoldLine=function(t,e){var i=this.$foldData,n=0;for(e&&(n=i.indexOf(e)),n==-1&&(n=0),n;n<i.length;n++){var o=i[n];if(o.start.row<=t&&o.end.row>=t)return o;if(o.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var i=this.$foldData,n=0;for(e&&(n=i.indexOf(e)),n==-1&&(n=0),n;n<i.length;n++){var o=i[n];if(o.end.row>=t)return o}return null},this.getFoldedRowCount=function(t,e){for(var i=this.$foldData,n=e-t+1,o=0;o<i.length;o++){var l=i[o],g=l.end.row,v=l.start.row;if(g>=e){v<e&&(v>=t?n-=e-v:n=0);break}g>=t&&(v>=t?n-=g-v:n-=g-t+1)}return n},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(e,i){return e.start.row-i.start.row}),t},this.addFold=function(t,e){var i=this.$foldData,n=!1,o;t instanceof c?o=t:(o=new c(e,t),o.collapseChildren=e.collapseChildren),this.$clipRangeToDocument(o.range);var l=o.start.row,g=o.start.column,v=o.end.row,$=o.end.column,y=this.getFoldAt(l,g,1),p=this.getFoldAt(v,$,-1);if(y&&p==y)return y.addSubFold(o);y&&!y.range.isStart(l,g)&&this.removeFold(y),p&&!p.range.isEnd(v,$)&&this.removeFold(p);var r=this.getFoldsInRange(o.range);r.length>0&&(this.removeFolds(r),o.collapseChildren||r.forEach(function(f){o.addSubFold(f)}));for(var h=0;h<i.length;h++){var w=i[h];if(v==w.start.row){w.addFold(o),n=!0;break}if(l==w.end.row){if(w.addFold(o),n=!0,!o.sameRow){var u=i[h+1];if(u&&u.start.row==v){w.merge(u);break}}break}if(v<=w.start.row)break}return n||(w=this.$addFoldLine(new d(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(w.start.row,w.start.row):this.$updateRowLengthCache(w.start.row,w.start.row),this.$modified=!0,this._signal("changeFold",{data:o,action:"add"}),o},this.addFolds=function(t){t.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(t){var e=t.foldLine,i=e.start.row,n=e.end.row,o=this.$foldData,l=e.folds;if(l.length==1)o.splice(o.indexOf(e),1);else if(e.range.isEnd(t.end.row,t.end.column))l.pop(),e.end.row=l[l.length-1].end.row,e.end.column=l[l.length-1].end.column;else if(e.range.isStart(t.start.row,t.start.column))l.shift(),e.start.row=l[0].start.row,e.start.column=l[0].start.column;else if(t.sameRow)l.splice(l.indexOf(t),1);else{var g=e.split(t.start.row,t.start.column);l=g.folds,l.shift(),g.start.row=l[0].start.row,g.start.column=l[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:t,action:"remove"})},this.removeFolds=function(t){for(var e=[],i=0;i<t.length;i++)e.push(t[i]);e.forEach(function(n){this.removeFold(n)},this),this.$modified=!0},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(e){t.restoreRange(e),this.addFold(e)},this),t.collapseChildren>0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(t,e){var i,n;if(t==null?(i=new x(0,0,this.getLength(),0),e==null&&(e=!0)):typeof t=="number"?i=new x(t,0,t,this.getLine(t).length):"row"in t?i=x.fromPoints(t,t):i=t,n=this.getFoldsInRangeList(i),e!=0?this.removeFolds(n):this.expandFolds(n),n.length)return n},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var i=this.getFoldLine(t,e);return i?i.end.row:t},this.getRowFoldStart=function(t,e){var i=this.getFoldLine(t,e);return i?i.start.row:t},this.getFoldDisplayLine=function(t,e,i,n,o){n==null&&(n=t.start.row),o==null&&(o=0),e==null&&(e=t.end.row),i==null&&(i=this.getLine(e).length);var l=this.doc,g="";return t.walk(function(v,$,y,p){if(!($<n)){if($==n){if(y<o)return;p=Math.max(o,p)}v!=null?g+=v:g+=l.getLine($).substring(p,y)}},e,i),g},this.getDisplayLine=function(t,e,i,n){var o=this.getFoldLine(t);if(!o){var l;return l=this.doc.getLine(t),l.substring(n||0,e||l.length)}return this.getFoldDisplayLine(o,t,e,i,n)},this.$cloneFoldData=function(){var t=[];return t=this.$foldData.map(function(e){var i=e.folds.map(function(n){return n.clone()});return new d(t,i)}),t},this.toggleFold=function(t){var e=this.selection,i=e.getRange(),n,o;if(i.isEmpty()){var l=i.start;if(n=this.getFoldAt(l.row,l.column),n){this.expandFold(n);return}(o=this.findMatchingBracket(l))?i.comparePoint(o)==1?i.end=o:(i.start=o,i.start.column++,i.end.column--):(o=this.findMatchingBracket({row:l.row,column:l.column+1}))?(i.comparePoint(o)==1?i.end=o:i.start=o,i.start.column++):i=this.getCommentFoldRange(l.row,l.column)||i}else{var g=this.getFoldsInRange(i);if(t&&g.length){this.expandFolds(g);return}g.length==1&&(n=g[0])}if(n||(n=this.getFoldAt(i.start.row,i.start.column)),n&&n.range.toString()==i.toString()){this.expandFold(n);return}var v="...";if(!i.isMultiLine()){if(v=this.getTextRange(i),v.length<4)return;v=v.trim().substring(0,2)+".."}this.addFold(v,i)},this.getCommentFoldRange=function(t,e,i){var n=new a(this,t,e),o=n.getCurrentToken(),l=o&&o.type;if(o&&/^comment|string/.test(l)){l=l.match(/comment|string/)[0],l=="comment"&&(l+="|doc-start");var g=new RegExp(l),v=new x;if(i!=1){do o=n.stepBackward();while(o&&g.test(o.type));n.stepForward()}if(v.start.row=n.getCurrentTokenRow(),v.start.column=n.getCurrentTokenColumn()+2,n=new a(this,t,e),i!=-1){var $=-1;do if(o=n.stepForward(),$==-1){var y=this.getState(n.$row);g.test(y)||($=n.$row)}else if(n.$row>$)break;while(o&&g.test(o.type));o=n.stepBackward()}else o=n.getCurrentToken();return v.end.row=n.getCurrentTokenRow(),v.end.column=n.getCurrentTokenColumn()+o.value.length-2,v}},this.foldAll=function(t,e,i,n){i==null&&(i=1e5);var o=this.foldWidgets;if(o){e=e||this.getLength(),t=t||0;for(var l=t;l<e;l++)if(o[l]==null&&(o[l]=this.getFoldWidget(l)),o[l]=="start"&&!(n&&!n(l))){var g=this.getFoldWidgetRange(l);g&&g.isMultiLine()&&g.end.row<=e&&g.start.row>=t&&(l=g.end.row,g.collapseChildren=i,this.addFold("...",g))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var i=t.getTokens(e),n=0;n<i.length;n++){var o=i[n];if(!(o.type=="text"&&/^\s+$/.test(o.value)))return!!/comment/.test(o.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(t){if(!this.$foldStyles[t])throw new Error("invalid fold style: "+t+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=t){this.$foldStyle=t,t=="manual"&&this.unfold();var e=this.$foldMode;this.$setFolding(null),this.$setFolding(e)}},this.$setFolding=function(t){if(this.$foldMode!=t){if(this.$foldMode=t,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!t||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=t.getFoldWidget.bind(t,this,this.$foldStyle),this.getFoldWidgetRange=t.getFoldWidgetRange.bind(t,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(t,e){var i=this.foldWidgets;if(!i||e&&i[t])return{};for(var n=t-1,o;n>=0;){var l=i[n];if(l==null&&(l=i[n]=this.getFoldWidget(n)),l=="start"){var g=this.getFoldWidgetRange(n);if(o||(o=g),g&&g.end.row>=t)break}n--}return{range:n!==-1&&g,firstRange:o}},this.onFoldWidgetClick=function(t,e){e=e.domEvent;var i={children:e.shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey},n=this.$toggleFoldWidget(t,i);if(!n){var o=e.target||e.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var i=this.getFoldWidget(t),n=this.getLine(t),o=i==="end"?-1:1,l=this.getFoldAt(t,o===-1?0:n.length,o);if(l)return e.children||e.all?this.removeFold(l):this.expandFold(l),l;var g=this.getFoldWidgetRange(t,!0);if(g&&!g.isMultiLine()&&(l=this.getFoldAt(g.start.row,g.start.column,1),l&&g.isEqual(l.range)))return this.removeFold(l),l;if(e.siblings){var v=this.getParentFoldRangeData(t);if(v.range)var $=v.range.start.row+1,y=v.range.end.row;this.foldAll($,y,e.all?1e4:0)}else e.children?(y=g?g.end.row:this.getLength(),this.foldAll(t+1,y,e.all?1e4:0)):g&&(e.all&&(g.collapseChildren=1e4),this.addFold("...",g));return g}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var i=this.$toggleFoldWidget(e,{});if(!i){var n=this.getParentFoldRangeData(e,!0);if(i=n.range||n.firstRange,i){e=i.start.row;var o=this.getFoldAt(e,this.getLine(e).length,1);o?this.removeFold(o):this.addFold("...",i)}}},this.updateFoldWidgets=function(t){var e=t.start.row,i=t.end.row-e;if(i===0)this.foldWidgets[e]=null;else if(t.action=="remove")this.foldWidgets.splice(e,i+1,null);else{var n=Array(i+1);n.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}var x=L("../range").Range,d=L("./fold_line").FoldLine,c=L("./fold").Fold,a=L("../token_iterator").TokenIterator;k.Folding=S}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(L,k,N){function S(){this.findMatchingBracket=function(c,a){if(c.column==0)return null;var t=a||this.getLine(c.row).charAt(c.column-1);if(t=="")return null;var e=t.match(/([\(\[\{])|([\)\]\}])/);return e?e[1]?this.$findClosingBracket(e[1],c):this.$findOpeningBracket(e[2],c):null},this.getBracketRange=function(c){var a=this.getLine(c.row),t=!0,e,i=a.charAt(c.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=a.charAt(c.column),c={row:c.row,column:c.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/),t=!1),!n)return null;if(n[1]){var o=this.$findClosingBracket(n[1],c);if(!o)return null;e=d.fromPoints(c,o),t||(e.end.column++,e.start.column--),e.cursor=e.end}else{var o=this.$findOpeningBracket(n[2],c);if(!o)return null;e=d.fromPoints(o,c),t||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(c){var a=this.getLine(c.row),t=a.charAt(c.column-1),e=t&&t.match(/([\(\[\{])|([\)\]\}])/);if(e||(t=a.charAt(c.column),c={row:c.row,column:c.column+1},e=t&&t.match(/([\(\[\{])|([\)\]\}])/)),!e)return null;var i=new d(c.row,c.column-1,c.row,c.column),n=e[1]?this.$findClosingBracket(e[1],c):this.$findOpeningBracket(e[2],c);if(!n)return[i];var o=new d(n.row,n.column,n.row,n.column+1);return[i,o]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,a,t){var e=this.$brackets[c],i=1,n=new x(this,a.row,a.column),o=n.getCurrentToken();if(o||(o=n.stepForward()),!!o){t||(t=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn()-2,g=o.value;;){for(;l>=0;){var v=g.charAt(l);if(v==e){if(i-=1,i==0)return{row:n.getCurrentTokenRow(),column:l+n.getCurrentTokenColumn()}}else v==c&&(i+=1);l-=1}do o=n.stepBackward();while(o&&!t.test(o.type));if(o==null)break;g=o.value,l=g.length-1}return null}},this.$findClosingBracket=function(c,a,t){var e=this.$brackets[c],i=1,n=new x(this,a.row,a.column),o=n.getCurrentToken();if(o||(o=n.stepForward()),!!o){t||(t=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn();;){for(var g=o.value,v=g.length;l<v;){var $=g.charAt(l);if($==e){if(i-=1,i==0)return{row:n.getCurrentTokenRow(),column:l+n.getCurrentTokenColumn()}}else $==c&&(i+=1);l+=1}do o=n.stepForward();while(o&&!t.test(o.type));if(o==null)break;l=0}return null}}}var x=L("../token_iterator").TokenIterator,d=L("../range").Range;k.BracketMatch=S}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/lang"),d=L("./bidihandler").BidiHandler,c=L("./config"),a=L("./lib/event_emitter").EventEmitter,t=L("./selection").Selection,e=L("./mode/text").Mode,i=L("./range").Range,n=L("./document").Document,o=L("./background_tokenizer").BackgroundTokenizer,l=L("./search_highlight").SearchHighlight,g=function(v,$){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++g.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new n(v)),this.setDocument(v),this.selection=new t(this),this.$bidiHandler=new d(this),c.resetOptions(this),this.setMode($),c._signal("session",this)};g.$uid=0,(function(){function v(s){return s<4352?!1:s>=4352&&s<=4447||s>=4515&&s<=4519||s>=4602&&s<=4607||s>=9001&&s<=9002||s>=11904&&s<=11929||s>=11931&&s<=12019||s>=12032&&s<=12245||s>=12272&&s<=12283||s>=12288&&s<=12350||s>=12353&&s<=12438||s>=12441&&s<=12543||s>=12549&&s<=12589||s>=12593&&s<=12686||s>=12688&&s<=12730||s>=12736&&s<=12771||s>=12784&&s<=12830||s>=12832&&s<=12871||s>=12880&&s<=13054||s>=13056&&s<=19903||s>=19968&&s<=42124||s>=42128&&s<=42182||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=55216&&s<=55238||s>=55243&&s<=55291||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65106||s>=65108&&s<=65126||s>=65128&&s<=65131||s>=65281&&s<=65376||s>=65504&&s<=65510}S.implement(this,a),this.setDocument=function(s){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=s,s.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(s){if(!s){this.$docRowCache=[],this.$screenRowCache=[];return}var m=this.$docRowCache.length,b=this.$getRowCacheIndex(this.$docRowCache,s)+1;m>b&&(this.$docRowCache.splice(b,m),this.$screenRowCache.splice(b,m))},this.$getRowCacheIndex=function(s,m){for(var b=0,C=s.length-1;b<=C;){var A=b+C>>1,R=s[A];if(m>R)b=A+1;else{if(!(m<R))return A;C=A-1}}return b-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(s){var m=s.data;this.$resetRowCache(m.start.row)},this.onChange=function(s){this.$modified=!0,this.$bidiHandler.onChange(s),this.$resetRowCache(s.start.row);var m=this.$updateInternalDataOnChange(s);!this.$fromUndo&&this.$undoManager&&(m&&m.length&&(this.$undoManager.add({action:"removeFolds",folds:m},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(s,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(s),this._signal("change",s)},this.setValue=function(s){this.doc.setValue(s),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(s){return this.bgTokenizer.getState(s)},this.getTokens=function(s){return this.bgTokenizer.getTokens(s)},this.getTokenAt=function(s,m){var b=this.bgTokenizer.getTokens(s),C,A=0;if(m==null){var R=b.length-1;A=this.getLine(s).length}else for(var R=0;R<b.length&&(A+=b[R].value.length,!(A>=m));R++);return C=b[R],C?(C.index=R,C.start=A-C.value.length,C):null},this.setUndoManager=function(s){if(this.$undoManager=s,this.$informUndoManager&&this.$informUndoManager.cancel(),s){var m=this;s.addSession(this),this.$syncInformUndoManager=function(){m.$informUndoManager.cancel(),m.mergeUndoDeltas=!1},this.$informUndoManager=x.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?x.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(s){this.setOption("useSoftTabs",s)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(s){this.setOption("tabSize",s)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(s){return this.$useSoftTabs&&s.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(s){this.setOption("navigateWithinSoftTabs",s)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(s){this.setOption("overwrite",s)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(s,m){this.$decorations[s]||(this.$decorations[s]=""),this.$decorations[s]+=" "+m,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(s,m){this.$decorations[s]=(this.$decorations[s]||"").replace(" "+m,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(s){this.$breakpoints=[];for(var m=0;m<s.length;m++)this.$breakpoints[s[m]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(s,m){m===void 0&&(m="ace_breakpoint"),m?this.$breakpoints[s]=m:delete this.$breakpoints[s],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(s){delete this.$breakpoints[s],this._signal("changeBreakpoint",{})},this.addMarker=function(s,m,b,C){var A=this.$markerId++,R={range:s,type:b||"line",renderer:typeof b=="function"?b:null,clazz:m,inFront:!!C,id:A};return C?(this.$frontMarkers[A]=R,this._signal("changeFrontMarker")):(this.$backMarkers[A]=R,this._signal("changeBackMarker")),A},this.addDynamicMarker=function(s,m){if(s.update){var b=this.$markerId++;return s.id=b,s.inFront=!!m,m?(this.$frontMarkers[b]=s,this._signal("changeFrontMarker")):(this.$backMarkers[b]=s,this._signal("changeBackMarker")),s}},this.removeMarker=function(s){var m=this.$frontMarkers[s]||this.$backMarkers[s];if(m){var b=m.inFront?this.$frontMarkers:this.$backMarkers;delete b[s],this._signal(m.inFront?"changeFrontMarker":"changeBackMarker")}},this.getMarkers=function(s){return s?this.$frontMarkers:this.$backMarkers},this.highlight=function(s){if(!this.$searchHighlight){var m=new l(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(m)}this.$searchHighlight.setRegexp(s)},this.highlightLines=function(s,m,b,C){typeof m!="number"&&(b=m,m=s),b||(b="ace_step");var A=new i(s,0,m,1/0);return A.id=this.addMarker(A,b,"fullLine",C),A},this.setAnnotations=function(s){this.$annotations=s,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(s){var m=s.match(/^.*?(\r?\n)/m);m?this.$autoNewLine=m[1]:this.$autoNewLine="\n"},this.getWordRange=function(s,m){var b=this.getLine(s),C=!1;if(m>0&&(C=!!b.charAt(m-1).match(this.tokenRe)),C||(C=!!b.charAt(m).match(this.tokenRe)),C)var A=this.tokenRe;else if(/^\s+$/.test(b.slice(m-1,m+1)))var A=/\s/;else var A=this.nonTokenRe;var R=m;if(R>0){do R--;while(R>=0&&b.charAt(R).match(A));R++}for(var E=m;E<b.length&&b.charAt(E).match(A);)E++;return new i(s,R,s,E)},this.getAWordRange=function(s,m){for(var b=this.getWordRange(s,m),C=this.getLine(b.end.row);C.charAt(b.end.column).match(/[ \t]/);)b.end.column+=1;return b},this.setNewLineMode=function(s){this.doc.setNewLineMode(s)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(s){this.setOption("useWorker",s)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(s){var m=s.data;this.bgTokenizer.start(m.first),this._signal("tokenizerUpdate",s)},this.$modes=c.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(s,m){if(s&&typeof s=="object"){if(s.getTokenizer)return this.$onChangeMode(s);var b=s,C=b.path}else C=s||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new e),this.$modes[C]&&!b){this.$onChangeMode(this.$modes[C]),m&&m();return}this.$modeId=C,c.loadModule(["mode",C],(function(A){if(this.$modeId!==C)return m&&m();this.$modes[C]&&!b?this.$onChangeMode(this.$modes[C]):A&&A.Mode&&(A=new A.Mode(b),b||(this.$modes[C]=A,A.$id=C),this.$onChangeMode(A)),m&&m()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(s,m){if(m||(this.$modeId=s.$id),this.$mode!==s){var b=this.$mode;this.$mode=s,this.$stopWorker(),this.$useWorker&&this.$startWorker();var C=s.getTokenizer();if(C.on!==void 0){var A=this.onReloadTokenizer.bind(this);C.on("update",A)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(C);else{this.bgTokenizer=new o(C);var R=this;this.bgTokenizer.on("update",function(E){R._signal("tokenizerUpdate",E)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=s.tokenRe,this.nonTokenRe=s.nonTokenRe,m||(s.attachToSession&&s.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(s.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:b,mode:s}))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(s){c.warn("Could not load worker",s),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(s){this.$scrollTop===s||isNaN(s)||(this.$scrollTop=s,this._signal("changeScrollTop",s))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(s){this.$scrollLeft===s||isNaN(s)||(this.$scrollLeft=s,this._signal("changeScrollLeft",s))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var s=0;return this.lineWidgets.forEach(function(m){m&&m.screenWidth>s&&(s=m.screenWidth)}),this.lineWidgetWidth=s},this.$computeWidth=function(s){if(this.$modified||s){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var m=this.doc.getAllLines(),b=this.$rowLengthCache,C=0,A=0,R=this.$foldData[A],E=R?R.start.row:1/0,I=m.length,T=0;T<I;T++){if(T>E){if(T=R.end.row+1,T>=I)break;R=this.$foldData[A++],E=R?R.start.row:1/0}b[T]==null&&(b[T]=this.$getStringScreenWidth(m[T])[0]),b[T]>C&&(C=b[T])}this.screenWidth=C}},this.getLine=function(s){return this.doc.getLine(s)},this.getLines=function(s,m){return this.doc.getLines(s,m)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(s){return this.doc.getTextRange(s||this.selection.getRange())},this.insert=function(s,m){return this.doc.insert(s,m)},this.remove=function(s){return this.doc.remove(s)},this.removeFullLines=function(s,m){return this.doc.removeFullLines(s,m)},this.undoChanges=function(s,m){if(s.length){this.$fromUndo=!0;for(var b=s.length-1;b!=-1;b--){var C=s[b];C.action=="insert"||C.action=="remove"?this.doc.revertDelta(C):C.folds&&this.addFolds(C.folds)}!m&&this.$undoSelect&&(s.selectionBefore?this.selection.fromJSON(s.selectionBefore):this.selection.setRange(this.$getUndoSelection(s,!0))),this.$fromUndo=!1}},this.redoChanges=function(s,m){if(s.length){this.$fromUndo=!0;for(var b=0;b<s.length;b++){var C=s[b];(C.action=="insert"||C.action=="remove")&&this.doc.$safeApplyDelta(C)}!m&&this.$undoSelect&&(s.selectionAfter?this.selection.fromJSON(s.selectionAfter):this.selection.setRange(this.$getUndoSelection(s,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(s){this.$undoSelect=s},this.$getUndoSelection=function(s,m){function b(I){return m?I.action!=="insert":I.action==="insert"}for(var C,A,R=0;R<s.length;R++){var E=s[R];if(E.start){if(!C){b(E)?C=i.fromPoints(E.start,E.end):C=i.fromPoints(E.start,E.start);continue}b(E)?(A=E.start,C.compare(A.row,A.column)==-1&&C.setStart(A),A=E.end,C.compare(A.row,A.column)==1&&C.setEnd(A)):(A=E.start,C.compare(A.row,A.column)==-1&&(C=i.fromPoints(E.start,E.start)))}}return C},this.replace=function(s,m){return this.doc.replace(s,m)},this.moveText=function(s,m,b){var C=this.getTextRange(s),A=this.getFoldsInRange(s),R=i.fromPoints(m,m);if(!b){this.remove(s);var E=s.start.row-s.end.row,I=E?-s.end.column:s.start.column-s.end.column;I&&(R.start.row==s.end.row&&R.start.column>s.end.column&&(R.start.column+=I),R.end.row==s.end.row&&R.end.column>s.end.column&&(R.end.column+=I)),E&&R.start.row>=s.end.row&&(R.start.row+=E,R.end.row+=E)}if(R.end=this.insert(R.start,C),A.length){var T=s.start,_=R.start,E=_.row-T.row,I=_.column-T.column;this.addFolds(A.map(function(D){return D=D.clone(),D.start.row==T.row&&(D.start.column+=I),D.end.row==T.row&&(D.end.column+=I),D.start.row+=E,D.end.row+=E,D}))}return R},this.indentRows=function(s,m,b){b=b.replace(/\t/g,this.getTabString());for(var C=s;C<=m;C++)this.doc.insertInLine({row:C,column:0},b)},this.outdentRows=function(s){for(var m=s.collapseRows(),b=new i(0,0,0,0),C=this.getTabSize(),A=m.start.row;A<=m.end.row;++A){var R=this.getLine(A);b.start.row=A,b.end.row=A;for(var E=0;E<C&&R.charAt(E)==" ";++E);E<C&&R.charAt(E)==" "?(b.start.column=E,b.end.column=E+1):(b.start.column=0,b.end.column=E),this.remove(b)}},this.$moveLines=function(s,m,b){if(s=this.getRowFoldStart(s),m=this.getRowFoldEnd(m),b<0){var C=this.getRowFoldStart(s+b);if(C<0)return 0;var A=C-s}else if(b>0){var C=this.getRowFoldEnd(m+b);if(C>this.doc.getLength()-1)return 0;var A=C-m}else{s=this.$clipRowToDocument(s),m=this.$clipRowToDocument(m);var A=m-s+1}var R=new i(s,0,m,Number.MAX_VALUE),E=this.getFoldsInRange(R).map(function(T){return T=T.clone(),T.start.row+=A,T.end.row+=A,T}),I=b==0?this.doc.getLines(s,m):this.doc.removeFullLines(s,m);return this.doc.insertFullLines(s+A,I),E.length&&this.addFolds(E),A},this.moveLinesUp=function(s,m){return this.$moveLines(s,m,-1)},this.moveLinesDown=function(s,m){return this.$moveLines(s,m,1)},this.duplicateLines=function(s,m){return this.$moveLines(s,m,0)},this.$clipRowToDocument=function(s){return Math.max(0,Math.min(s,this.doc.getLength()-1))},this.$clipColumnToRow=function(s,m){return m<0?0:Math.min(this.doc.getLine(s).length,m)},this.$clipPositionToDocument=function(s,m){if(m=Math.max(0,m),s<0)s=0,m=0;else{var b=this.doc.getLength();s>=b?(s=b-1,m=this.doc.getLine(b-1).length):m=Math.min(this.doc.getLine(s).length,m)}return{row:s,column:m}},this.$clipRangeToDocument=function(s){s.start.row<0?(s.start.row=0,s.start.column=0):s.start.column=this.$clipColumnToRow(s.start.row,s.start.column);var m=this.doc.getLength()-1;return s.end.row>m?(s.end.row=m,s.end.column=this.doc.getLine(m).length):s.end.column=this.$clipColumnToRow(s.end.row,s.end.column),s},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(s){if(s!=this.$useWrapMode){if(this.$useWrapMode=s,this.$modified=!0,this.$resetRowCache(0),s){var m=this.getLength();this.$wrapData=Array(m),this.$updateWrapData(0,m-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(s,m){(this.$wrapLimitRange.min!==s||this.$wrapLimitRange.max!==m)&&(this.$wrapLimitRange={min:s,max:m},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(s,m){var b=this.$wrapLimitRange;b.max<0&&(b={min:m,max:m});var C=this.$constrainWrapLimit(s,b.min,b.max);return C!=this.$wrapLimit&&C>1?(this.$wrapLimit=C,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(s,m,b){return m&&(s=Math.max(m,s)),b&&(s=Math.min(b,s)),s},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(s){this.setWrapLimitRange(s,s)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(s){var m=this.$useWrapMode,b=s.action,C=s.start,A=s.end,R=C.row,E=A.row,I=E-R,T=null;if(this.$updating=!0,I!=0)if(b==="remove"){this[m?"$wrapData":"$rowLengthCache"].splice(R,I);var _=this.$foldData;T=this.getFoldsInRange(s),this.removeFolds(T);var M=this.getFoldLine(A.row),O=0;if(M){M.addRemoveChars(A.row,A.column,C.column-A.column),M.shiftRow(-I);var D=this.getFoldLine(R);D&&D!==M&&(D.merge(M),M=D),O=_.indexOf(M)+1}for(O;O<_.length;O++){var M=_[O];M.start.row>=A.row&&M.shiftRow(-I)}E=R}else{var F=Array(I);F.unshift(R,0);var W=m?this.$wrapData:this.$rowLengthCache;W.splice.apply(W,F);var _=this.$foldData,M=this.getFoldLine(R),O=0;if(M){var B=M.range.compareInside(C.row,C.column);B==0?(M=M.split(C.row,C.column),M&&(M.shiftRow(I),M.addRemoveChars(E,0,A.column-C.column))):B==-1&&(M.addRemoveChars(R,0,A.column-C.column),M.shiftRow(I)),O=_.indexOf(M)+1}for(O;O<_.length;O++){var M=_[O];M.start.row>=R&&M.shiftRow(I)}}else{I=Math.abs(s.start.column-s.end.column),b==="remove"&&(T=this.getFoldsInRange(s),this.removeFolds(T),I=-I);var M=this.getFoldLine(R);M&&M.addRemoveChars(R,C.column,I)}return m&&this.$wrapData.length!=this.doc.getLength(),this.$updating=!1,m?this.$updateWrapData(R,E):this.$updateRowLengthCache(R,E),T},this.$updateRowLengthCache=function(s,m,b){this.$rowLengthCache[s]=null,this.$rowLengthCache[m]=null},this.$updateWrapData=function(s,m){var b=this.doc.getAllLines(),C=this.getTabSize(),A=this.$wrapData,R=this.$wrapLimit,E,I,T=s;for(m=Math.min(m,b.length-1);T<=m;)I=this.getFoldLine(T,I),I?(E=[],I.walk((function(_,M,O,D){var F;if(_!=null){F=this.$getDisplayTokens(_,E.length),F[0]=p;for(var W=1;W<F.length;W++)F[W]=r}else F=this.$getDisplayTokens(b[M].substring(D,O),E.length);E=E.concat(F)}).bind(this),I.end.row,b[I.end.row].length+1),A[I.start.row]=this.$computeWrapSplits(E,R,C),T=I.end.row+1):(E=this.$getDisplayTokens(b[T]),A[T]=this.$computeWrapSplits(E,R,C),T++)};var $=1,y=2,p=3,r=4,h=9,w=10,u=11,f=12;this.$computeWrapSplits=function(s,m,b){function C(){var B=0;if(O===0)return B;if(M)for(var P=0;P<s.length;P++){var z=s[P];if(z==w)B+=1;else{if(z!=u){if(z==f)continue;break}B+=b}}return _&&M!==!1&&(B+=b),Math.min(B,O)}function A(B){for(var P=B-I,z=I;z<B;z++){var V=s[z];(V===12||V===2)&&(P-=1)}R.length||(D=C(),R.indent=D),T+=P,R.push(T),I=B}if(s.length==0)return[];for(var R=[],E=s.length,I=0,T=0,_=this.$wrapAsCode,M=this.$indentedSoftWrap,O=m<=Math.max(2*b,8)||M===!1?0:Math.floor(m/2),D=0;E-I>m-D;){var F=I+m-D;if(s[F-1]>=w&&s[F]>=w){A(F);continue}if(s[F]==p||s[F]==r){for(F;F!=I-1&&s[F]!=p;F--);if(F>I){A(F);continue}for(F=I+m,F;F<s.length&&s[F]==r;F++);if(F==s.length)break;A(F);continue}for(var W=Math.max(F-(m-(m>>2)),I-1);F>W&&s[F]<p;)F--;if(_){for(;F>W&&s[F]<p;)F--;for(;F>W&&s[F]==h;)F--}else for(;F>W&&s[F]<w;)F--;if(F>W){A(++F);continue}F=I+m,s[F]==y&&F--,A(F-D)}return R},this.$getDisplayTokens=function(s,m){var b=[],C;m=m||0;for(var A=0;A<s.length;A++){var R=s.charCodeAt(A);if(R==9){C=this.getScreenTabSize(b.length+m),b.push(u);for(var E=1;E<C;E++)b.push(f)}else R==32?b.push(w):R>39&&R<48||R>57&&R<64?b.push(h):R>=4352&&v(R)?b.push($,y):b.push($)}return b},this.$getStringScreenWidth=function(s,m,b){if(m==0)return[0,0];m==null&&(m=1/0),b=b||0;var C,A;for(A=0;A<s.length&&(C=s.charCodeAt(A),C==9?b+=this.getScreenTabSize(b):C>=4352&&v(C)?b+=2:b+=1,!(b>m));A++);return[b,A]},this.lineWidgets=null,this.getRowLength=function(s){var m=1;return this.lineWidgets&&(m+=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0),!this.$useWrapMode||!this.$wrapData[s]?m:this.$wrapData[s].length+m},this.getRowLineCount=function(s){return!this.$useWrapMode||!this.$wrapData[s]?1:this.$wrapData[s].length+1},this.getRowWrapIndent=function(s){if(this.$useWrapMode){var m=this.screenToDocumentPosition(s,Number.MAX_VALUE),b=this.$wrapData[m.row];return b.length&&b[0]<m.column?b.indent:0}return 0},this.getScreenLastRowColumn=function(s){var m=this.screenToDocumentPosition(s,Number.MAX_VALUE);return this.documentToScreenColumn(m.row,m.column)},this.getDocumentLastRowColumn=function(s,m){var b=this.documentToScreenRow(s,m);return this.getScreenLastRowColumn(b)},this.getDocumentLastRowColumnPosition=function(s,m){var b=this.documentToScreenRow(s,m);return this.screenToDocumentPosition(b,Number.MAX_VALUE/10)},this.getRowSplitData=function(s){return this.$useWrapMode?this.$wrapData[s]:void 0},this.getScreenTabSize=function(s){return this.$tabSize-(s%this.$tabSize|0)},this.screenToDocumentRow=function(s,m){return this.screenToDocumentPosition(s,m).row},this.screenToDocumentColumn=function(s,m){return this.screenToDocumentPosition(s,m).column},this.screenToDocumentPosition=function(s,m,b){if(s<0)return{row:0,column:0};var C,O=0,A=0,R,M=0,E=0,I=this.$screenRowCache,T=this.$getRowCacheIndex(I,s),_=I.length;if(_&&T>=0)var M=I[T],O=this.$docRowCache[T],D=s>I[_-1];else var D=!_;for(var F=this.getLength()-1,W=this.getNextFoldLine(O),B=W?W.start.row:1/0;M<=s&&(E=this.getRowLength(O),!(M+E>s||O>=F));)M+=E,O++,O>B&&(O=W.end.row+1,W=this.getNextFoldLine(O,W),B=W?W.start.row:1/0),D&&(this.$docRowCache.push(O),this.$screenRowCache.push(M));if(W&&W.start.row<=O)C=this.getFoldDisplayLine(W),O=W.start.row;else{if(M+E<=s||O>F)return{row:F,column:this.getLine(F).length};C=this.getLine(O),W=null}var P=0,z=Math.floor(s-M);if(this.$useWrapMode){var V=this.$wrapData[O];V&&(R=V[z],z>0&&V.length&&(P=V.indent,A=V[z-1]||V[V.length-1],C=C.substring(A)))}return b!==void 0&&this.$bidiHandler.isBidiRow(M+z,O,z)&&(m=this.$bidiHandler.offsetToCol(b)),A+=this.$getStringScreenWidth(C,m-P)[1],this.$useWrapMode&&A>=R&&(A=R-1),W?W.idxToPosition(A):{row:O,column:A}},this.documentToScreenPosition=function(s,m){if(typeof m>"u")var b=this.$clipPositionToDocument(s.row,s.column);else b=this.$clipPositionToDocument(s,m);s=b.row,m=b.column;var M=0,C=null,A=null;A=this.getFoldAt(s,m,1),A&&(s=A.start.row,m=A.start.column);var R,_=0,E=this.$docRowCache,I=this.$getRowCacheIndex(E,s),T=E.length;if(T&&I>=0)var _=E[I],M=this.$screenRowCache[I],O=s>E[T-1];else var O=!T;for(var D=this.getNextFoldLine(_),F=D?D.start.row:1/0;_<s;){if(_>=F){if(R=D.end.row+1,R>s)break;D=this.getNextFoldLine(R,D),F=D?D.start.row:1/0}else R=_+1;M+=this.getRowLength(_),_=R,O&&(this.$docRowCache.push(_),this.$screenRowCache.push(M))}var W="";D&&_>=F?(W=this.getFoldDisplayLine(D,s,m),C=D.start.row):(W=this.getLine(s).substring(0,m),C=s);var B=0;if(this.$useWrapMode){var P=this.$wrapData[C];if(P){for(var z=0;W.length>=P[z];)M++,z++;W=W.substring(P[z-1]||0,W.length),B=z>0?P.indent:0}}return this.lineWidgets&&this.lineWidgets[_]&&this.lineWidgets[_].rowsAbove&&(M+=this.lineWidgets[_].rowsAbove),{row:M,column:B+this.$getStringScreenWidth(W)[0]}},this.documentToScreenColumn=function(s,m){return this.documentToScreenPosition(s,m).column},this.documentToScreenRow=function(s,m){return this.documentToScreenPosition(s,m).row},this.getScreenLength=function(){var s=0,m=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,R=0,C=0,m=this.$foldData[C++],E=m?m.start.row:1/0;R<A;){var I=this.$wrapData[R];s+=I?I.length+1:1,R++,R>E&&(R=m.end.row+1,m=this.$foldData[C++],E=m?m.start.row:1/0)}else{s=this.getLength();for(var b=this.$foldData,C=0;C<b.length;C++)m=b[C],s-=m.end.row-m.start.row}return this.lineWidgets&&(s+=this.$getWidgetScreenLength()),s},this.$setFontMetrics=function(s){this.$enableVarChar&&(this.$getStringScreenWidth=function(m,b,C){if(b===0)return[0,0];b||(b=1/0),C=C||0;var A,R;for(R=0;R<m.length&&(A=m.charAt(R),A===" "?C+=this.getScreenTabSize(C):C+=s.getCharacterWidth(A),!(C>b));R++);return[C,R]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=v}).call(g.prototype),L("./edit_session/folding").Folding.call(g.prototype),L("./edit_session/bracket_match").BracketMatch.call(g.prototype),c.defineOptions(g.prototype,"session",{wrap:{set:function(v){if(!v||v=="off"?v=!1:v=="free"?v=!0:v=="printMargin"?v=-1:typeof v=="string"&&(v=parseInt(v,10)||!1),this.$wrap!=v)if(this.$wrap=v,!v)this.setUseWrapMode(!1);else{var $=typeof v=="number"?v:null;this.setWrapLimitRange($,$),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(v){v=v=="auto"?this.$mode.type!="text":v!="text",v!=this.$wrapAsCode&&(this.$wrapAsCode=v,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(v){this.$useWorker=v,this.$stopWorker(),v&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(v){v=parseInt(v),v>0&&this.$tabSize!==v&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=v,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(v){this.setFoldStyle(v)},handlesSet:!0},overwrite:{set:function(v){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(v){this.doc.setNewLineMode(v)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(v){this.setMode(v)},get:function(){return this.$modeId},handlesSet:!0}}),k.EditSession=g}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(L,k,N){function S(t,e){function i(n){return/\w/.test(n)||e.regExp?"\\b":""}return i(t[0])+t+i(t[t.length-1])}var x=L("./lib/lang"),d=L("./lib/oop"),c=L("./range").Range,a=function(){this.$options={}};(function(){this.set=function(t){return d.mixin(this.$options,t),this},this.getOptions=function(){return x.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,i=this.$matchIterator(t,e);if(!i)return!1;var n=null;return i.forEach(function(o,l,g,v){return n=new c(o,l,g,v),l==v&&e.start&&e.start.start&&e.skipCurrent!=0&&n.isEqual(e.start)?(n=null,!1):!0}),n},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var i=e.range,n=i?t.getLines(i.start.row,i.end.row):t.doc.getAllLines(),o=[],l=e.re;if(e.$isMultiLine){var g=l.length,v=n.length-g,$;e:for(var y=l.offset||0;y<=v;y++){for(var p=0;p<g;p++)if(n[y+p].search(l[p])==-1)continue e;var r=n[y],h=n[y+g-1],w=r.length-r.match(l[0])[0].length,u=h.match(l[g-1])[0].length;$&&$.end.row===y&&$.end.column>w||(o.push($=new c(y,w,y+g-1,u)),g>2&&(y=y+g-2))}}else for(var f=0;f<n.length;f++)for(var s=x.getMatchOffsets(n[f],l),p=0;p<s.length;p++){var m=s[p];o.push(new c(f,m.offset,f,m.offset+m.length))}if(i){for(var b=i.start.column,C=i.start.column,f=0,p=o.length-1;f<p&&o[f].start.column<b&&o[f].start.row==i.start.row;)f++;for(;f<p&&o[p].end.column>C&&o[p].end.row==i.end.row;)p--;for(o=o.slice(f,p+1),f=0,p=o.length;f<p;f++)o[f].start.row+=i.start.row,o[f].end.row+=i.start.row}return o},this.replace=function(t,e){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return e;if(n){var o=n.exec(t);if(!o||o[0].length!=t.length)return null;if(e=t.replace(n,e),i.preserveCase){e=e.split("");for(var l=Math.min(t.length,t.length);l--;){var g=t[l];g&&g.toLowerCase()!=g?e[l]=e[l].toUpperCase():e[l]=e[l].toLowerCase()}e=e.join("")}return e}},this.$assembleRegExp=function(t,e){if(t.needle instanceof RegExp)return t.re=t.needle;var i=t.needle;if(!t.needle)return t.re=!1;t.regExp||(i=x.escapeRegExp(i)),t.wholeWord&&(i=S(i,t));var n=t.caseSensitive?"gm":"gmi";if(t.$isMultiLine=!e&&/[\n\r]/.test(i),t.$isMultiLine)return t.re=this.$assembleMultilineRegExp(i,n);try{var o=new RegExp(i,n)}catch(l){o=!1}return t.re=o},this.$assembleMultilineRegExp=function(t,e){for(var i=t.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],o=0;o<i.length;o++)try{n.push(new RegExp(i[o],e))}catch(l){return!1}return n},this.$matchIterator=function(t,e){var i=this.$assembleRegExp(e);if(!i)return!1;var n=e.backwards==1,o=e.skipCurrent!=0,l=e.range,g=e.start;g||(g=l?l[n?"end":"start"]:t.selection.getRange()),g.start&&(g=g[o!=n?"end":"start"]);var v=l?l.start.row:0,$=l?l.end.row:t.getLength()-1;if(n)var y=function(h){var w=g.row;if(!r(w,g.column,h)){for(w--;w>=v;w--)if(r(w,Number.MAX_VALUE,h))return;if(e.wrap!=0){for(w=$,v=g.row;w>=v;w--)if(r(w,Number.MAX_VALUE,h))return}}};else var y=function(h){var w=g.row;if(!r(w,g.column,h)){for(w+=1;w<=$;w++)if(r(w,0,h))return;if(e.wrap!=0){for(w=v,$=g.row;w<=$;w++)if(r(w,0,h))return}}};if(e.$isMultiLine)var p=i.length,r=function(h,w,u){var f=n?h-p+1:h;if(!(f<0)){var s=t.getLine(f),m=s.search(i[0]);if(!(!n&&m<w||m===-1)){for(var b=1;b<p;b++)if(s=t.getLine(f+b),s.search(i[b])==-1)return;var C=s.match(i[p-1])[0].length;if(!(n&&C>w)&&u(f,m,f+p-1,C))return!0}}};else if(n)var r=function(h,w,u){var f=t.getLine(h),s=[],m,b=0;for(i.lastIndex=0;m=i.exec(f);){var C=m[0].length;if(b=m.index,!C){if(b>=f.length)break;i.lastIndex=b+=1}if(m.index+C>w)break;s.push(m.index,C)}for(var A=s.length-1;A>=0;A-=2){var R=s[A-1],C=s[A];if(u(h,R,h,R+C))return!0}};else var r=function(h,w,u){var f=t.getLine(h),s,m;for(i.lastIndex=w;m=i.exec(f);){var b=m[0].length;if(s=m.index,u(h,s,h,s+b))return!0;if(!b&&(i.lastIndex=s+=1,s>=f.length))return!1}};return{forEach:y}}}).call(a.prototype),k.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(L,k,N){function S(t,e){this.platform=e||(c.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function x(t,e){S.call(this,t,e),this.$singleCommand=!1}var d=L("../lib/keys"),c=L("../lib/useragent"),a=d.KEY_MODS;x.prototype=S.prototype,(function(){function t(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,i){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],i||delete this.commands[n];var o=this.commandKeyBinding;for(var l in o){var g=o[l];if(g==e)delete o[l];else if(Array.isArray(g)){var v=g.indexOf(e);v!=-1&&(g.splice(v,1),g.length==1&&(o[l]=g[0]))}}},this.bindKey=function(e,i,n){if(typeof e=="object"&&e&&(n==null&&(n=e.position),e=e[this.platform]),!!e){if(typeof i=="function")return this.addCommand({exec:i,bindKey:e,name:i.name||e});e.split("|").forEach(function(o){var l="";if(o.indexOf(" ")!=-1){var g=o.split(/\s+/);o=g.pop(),g.forEach(function(y){var p=this.parseKeys(y),r=a[p.hashId]+p.key;l+=(l?" ":"")+r,this._addCommandToBinding(l,"chainKeys")},this),l+=" "}var v=this.parseKeys(o),$=a[v.hashId]+v.key;this._addCommandToBinding(l+$,i,n)},this)}},this._addCommandToBinding=function(e,i,n){var o=this.commandKeyBinding,l;if(!i)delete o[e];else if(!o[e]||this.$singleCommand)o[e]=i;else{Array.isArray(o[e])?(l=o[e].indexOf(i))!=-1&&o[e].splice(l,1):o[e]=[o[e]],typeof n!="number"&&(n=t(i));var g=o[e];for(l=0;l<g.length;l++){var v=g[l],$=t(v);if($>n)break}g.splice(l,0,i)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(i){var n=e[i];if(n){if(typeof n=="string")return this.bindKey(n,i);typeof n=="function"&&(n={exec:n}),typeof n=="object"&&(n.name||(n.name=i),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(i){this.removeCommand(e[i])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(i){this.bindKey(i,e[i])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var i=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),n=i.pop(),o=d[n];if(d.FUNCTION_KEYS[o])n=d.FUNCTION_KEYS[o].toLowerCase();else{if(!i.length)return{key:n,hashId:-1};if(i.length==1&&i[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}for(var l=0,g=i.length;g--;){var v=d.KEY_MODS[i[g]];if(v==null)return typeof console<"u",!1;l|=v}return{key:n,hashId:l}},this.findKeyCommand=function(e,i){var n=a[e]+i;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,i,n,o){if(!(o<0)){var l=a[i]+n,g=this.commandKeyBinding[l];return e.$keyChain&&(e.$keyChain+=" "+l,g=this.commandKeyBinding[e.$keyChain]||g),g&&(g=="chainKeys"||g[g.length-1]=="chainKeys")?(e.$keyChain=e.$keyChain||l,{command:"null"}):(e.$keyChain&&(i&&i!=4||n.length!=1?(i==-1||o>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-l.length-1)),{command:g})}},this.getStatusText=function(e,i){return i.$keyChain||""}}).call(S.prototype),k.HashHandler=S,k.MultiHashHandler=x}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(L,k,N){var S=L("../lib/oop"),x=L("../keyboard/hash_handler").MultiHashHandler,d=L("../lib/event_emitter").EventEmitter,c=function(a,t){x.call(this,t,a),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};S.inherits(c,x),(function(){S.implement(this,d),this.exec=function(a,t,e){if(Array.isArray(a)){for(var i=a.length;i--;)if(this.exec(a[i],t,e))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!a||t&&t.$readOnly&&!a.readOnly||this.$checkCommandState!=0&&a.isAvailable&&!a.isAvailable(t))return!1;var n={editor:t,command:a,args:e};return n.returnValue=this._emit("exec",n),this._signal("afterExec",n),n.returnValue!==!1},this.toggleRecording=function(a){if(!this.$inReplay)return a&&a._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)},this.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,a):this.exec(t[0],a,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(a){return a.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(c.prototype),k.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(L,k,N){function S(t,e){return{win:t,mac:e}}var x=L("../lib/lang"),d=L("../config"),c=L("../range").Range;k.commands=[{name:"showSettingsMenu",bindKey:S("Ctrl-,","Command-,"),exec:function(t){d.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:S("Alt-E","F4"),exec:function(t){d.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:S("Alt-Shift-E","Shift-F4"),exec:function(t){d.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:S("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:S(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:S("Ctrl-L","Command-L"),exec:function(t,e){typeof e=="number"&&!isNaN(e)&&t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:S("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.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(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:S("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:S("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:S(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:S(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:S("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:S("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:S("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:S("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:S("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:S("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:S("Ctrl-F","Command-F"),exec:function(t){d.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:S("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.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(t){t.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(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:S("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.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(t){t.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(t){t.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(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:S("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:S("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:S("Ctrl-Left","Option-Left"),exec:function(t){t.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(t){t.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(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:S("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:S("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:S("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:S("Ctrl-Right","Option-Right"),exec:function(t){t.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(t){t.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(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:S("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:S("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:S(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:S("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:S(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:S("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:S("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:S("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:S("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:S("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:S("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:S("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.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(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty(),i=e?t.selection.getLineRange():t.selection.getRange();t._emit("cut",i),i.isEmpty()||t.session.remove(i),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:S("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:S("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:S("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:S("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:S("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:S("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:S("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:S("Ctrl-H","Command-Option-F"),exec:function(t){d.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:S("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:S("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:S("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:S("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:S("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:S("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:S("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:S("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:S("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:S("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:S("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:S("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:S("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:S("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:S("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:S("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:S("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:S("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:S("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(x.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:S(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:S("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:S("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:S("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:S(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:S("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:S(null,null),exec:function(t){for(var e=t.selection.isBackwards(),i=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),n=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(i.row).length,l=t.session.doc.getTextRange(t.selection.getRange()),g=l.replace(/\n\s*/," ").length,v=t.session.doc.getLine(i.row),$=i.row+1;$<=n.row+1;$++){var y=x.stringTrimLeft(x.stringTrimRight(t.session.doc.getLine($)));y.length!==0&&(y=" "+y),v+=y}n.row+1<t.session.doc.getLength()-1&&(v+=t.session.doc.getNewLineCharacter()),t.clearSelection(),t.session.doc.replace(new c(i.row,0,n.row+2,0),v),g>0?(t.selection.moveCursorTo(i.row,i.column),t.selection.selectTo(i.row,i.column+g)):(o=t.session.doc.getLine(i.row).length>o?o+1:o,t.selection.moveCursorTo(i.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:S(null,null),exec:function(t){var e=t.session.doc.getLength()-1,i=t.session.doc.getLine(e).length,n=t.selection.rangeList.ranges,o=[];n.length<1&&(n=[t.selection.getRange()]);for(var l=0;l<n.length;l++)l==n.length-1&&(n[l].end.row!==e||n[l].end.column!==i)&&o.push(new c(n[l].end.row,n[l].end.column,e,i)),l===0?(n[l].start.row!==0||n[l].start.column!==0)&&o.push(new c(0,0,n[l].start.row,n[l].start.column)):o.push(new c(n[l-1].end.row,n[l-1].end.column,n[l].start.row,n[l].start.column));t.exitMultiSelectMode(),t.clearSelection();for(var l=0;l<o.length;l++)t.selection.addRange(o[l],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",exec:function(t){t.selection.clearSelection(),t.navigateLineEnd(),t.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",exec:function(t){t.selection.clearSelection();var e=t.getCursorPosition();t.selection.moveTo(e.row-1,Number.MAX_VALUE),t.insert("\n"),e.row===0&&t.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command pallete",bindKey:S("F1","F1"),exec:function(t){t.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:S(null,null),exec:function(t){t.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)k.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(t){t.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","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/clipboard"],function(L,k,N){L("./lib/fixoldbrowsers");var S=L("./lib/oop"),x=L("./lib/dom"),d=L("./lib/lang"),c=L("./lib/useragent"),a=L("./keyboard/textinput").TextInput,t=L("./mouse/mouse_handler").MouseHandler,e=L("./mouse/fold_handler").FoldHandler,i=L("./keyboard/keybinding").KeyBinding,n=L("./edit_session").EditSession,o=L("./search").Search,l=L("./range").Range,g=L("./lib/event_emitter").EventEmitter,v=L("./commands/command_manager").CommandManager,$=L("./commands/default_commands").commands,y=L("./config"),p=L("./token_iterator").TokenIterator,r=L("./clipboard"),h=function(u,f,s){this.$toDestroy=[];var m=u.getContainerElement();this.container=m,this.renderer=u,this.id="editor"+ ++h.$uid,this.commands=new v(c.isMac?"mac":"win",$),typeof document=="object"&&(this.textInput=new a(u.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new t(this),new e(this)),this.keyBinding=new i(this),this.$search=new o().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=d.delayedCall((function(){this._signal("input",{}),this.session&&this.session.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(b,C){C._$emitInputEvent.schedule(31)}),this.setSession(f||s&&s.session||new n("")),y.resetOptions(this),s&&this.setOptions(s),y._signal("editor",this)};h.$uid=0,(function(){S.implement(this,g),this.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=d.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)},this.curOp=null,this.prevOp={},this.startOperation=function(u){if(this.curOp){if(!u||this.curOp.command)return;this.prevOp=this.curOp}u||(this.previousCommand=null,u={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:u.command||{},args:u.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},this.endOperation=function(u){if(this.curOp&&this.session){if(u&&u.returnValue===!1||!this.session)return this.curOp=null;if(u==1&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var f=this.curOp.command,s=f&&f.scrollIntoView;if(s){switch(s){case"center-animate":s="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var m=this.selection.getRange(),b=this.renderer.layerConfig;(m.start.row>=b.lastRow||m.end.row<=b.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}s=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(C),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(u){if(this.$mergeUndoDeltas){var f=this.prevOp,s=this.$mergeableCommands,m=f.command&&u.command.name==f.command.name;if(u.command.name=="insertstring"){var b=u.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),m=m&&this.mergeNextCommand&&(!/\s/.test(b)||/\s/.test(f.args)),this.mergeNextCommand=!0}else m=m&&s.indexOf(u.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(m=!1),m?this.session.mergeUndoDeltas=!0:s.indexOf(u.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(u,f){if(u&&typeof u=="string"&&u!="ace"){this.$keybindingId=u;var s=this;y.loadModule(["keybinding",u],function(m){s.$keybindingId==u&&s.keyBinding.setKeyboardHandler(m&&m.handler),f&&f()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(u),f&&f()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(u){if(this.session!=u){this.curOp&&this.endOperation(),this.curOp={};var f=this.session;if(f){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 s=this.session.getSelection();s.off("changeCursor",this.$onCursorChange),s.off("changeSelection",this.$onSelectionChange)}this.session=u,u?(this.$onDocumentChange=this.onDocumentChange.bind(this),u.on("change",this.$onDocumentChange),this.renderer.setSession(u),this.$onChangeMode=this.onChangeMode.bind(this),u.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),u.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),u.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),u.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),u.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),u.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=u.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(u)),this._signal("changeSession",{session:u,oldSession:f}),this.curOp=null,f&&f._signal("changeEditor",{oldEditor:this}),u&&u._signal("changeEditor",{editor:this}),u&&u.bgTokenizer&&u.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(u,f){return this.session.doc.setValue(u),f?f==1?this.navigateFileEnd():f==-1&&this.navigateFileStart():this.selectAll(),u},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(u){this.renderer.onResize(u)},this.setTheme=function(u,f){this.renderer.setTheme(u,f)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(u){this.renderer.setStyle(u)},this.unsetStyle=function(u){this.renderer.unsetStyle(u)},this.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},this.setFontSize=function(u){this.setOption("fontSize",u)},this.$highlightBrackets=function(){if(!this.$highlightPending){var u=this;this.$highlightPending=!0,setTimeout(function(){u.$highlightPending=!1;var f=u.session;if(!(!f||!f.bgTokenizer)){f.$bracketHighlight&&(f.$bracketHighlight.markerIds.forEach(function(b){f.removeMarker(b)}),f.$bracketHighlight=null);var s=f.getMatchingBracketRanges(u.getCursorPosition());if(!s&&f.$mode.getMatching&&(s=f.$mode.getMatching(u.session)),!!s){var m="ace_bracket";Array.isArray(s)?s.length==1&&(m="ace_error_bracket"):s=[s],s.length==2&&(l.comparePoints(s[0].end,s[1].start)==0?s=[l.fromPoints(s[0].start,s[1].end)]:l.comparePoints(s[0].start,s[1].end)==0&&(s=[l.fromPoints(s[1].start,s[0].end)])),f.$bracketHighlight={ranges:s,markerIds:s.map(function(b){return f.addMarker(b,m,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var u=this;this.$highlightTagPending=!0,setTimeout(function(){u.$highlightTagPending=!1;var f=u.session;if(!(!f||!f.bgTokenizer)){var s=u.getCursorPosition(),m=new p(u.session,s.row,s.column),b=m.getCurrentToken();if(!b||!/\b(?:tag-open|tag-name)/.test(b.type)){f.removeMarker(f.$tagHighlight),f.$tagHighlight=null;return}if(!(b.type.indexOf("tag-open")!==-1&&(b=m.stepForward(),!b))){var C=b.value,A=b.value,R=0,E=m.stepBackward();if(E.value==="<")do E=b,b=m.stepForward(),b&&(b.type.indexOf("tag-name")!==-1?(A=b.value,C===A&&(E.value==="<"?R++:E.value==="</"&&R--)):C===A&&b.value==="/>"&&R--);while(b&&R>=0);else{do if(b=E,E=m.stepBackward(),b){if(b.type.indexOf("tag-name")!==-1)C===b.value&&(E.value==="<"?R++:E.value==="</"&&R--);else if(b.value==="/>"){for(var I=0,T=E;T;){if(T.type.indexOf("tag-name")!==-1&&T.value===C){R--;break}if(T.value==="<")break;T=m.stepBackward(),I++}for(var _=0;_<I;_++)m.stepForward()}}while(E&&R<=0);m.stepForward()}if(!b){f.removeMarker(f.$tagHighlight),f.$tagHighlight=null;return}var M=m.getCurrentTokenRow(),O=m.getCurrentTokenColumn(),D=new l(M,O,M,O+b.value.length),F=f.$backMarkers[f.$tagHighlight];f.$tagHighlight&&F!=null&&D.compareRange(F.range)!==0&&(f.removeMarker(f.$tagHighlight),f.$tagHighlight=null),f.$tagHighlight||(f.$tagHighlight=f.addMarker(D,"ace_bracket","text"))}}},50)}},this.focus=function(){var u=this;setTimeout(function(){u.isFocused()||u.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(u){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",u))},this.onBlur=function(u){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",u))},this.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine()},this.onDocumentChange=function(u){var f=this.session.$useWrapMode,s=u.start.row==u.end.row?u.end.row:1/0;this.renderer.updateLines(u.start.row,s,f),this._signal("change",u),this.$cursorChange()},this.onTokenizerUpdate=function(u){var f=u.data;this.renderer.updateLines(f.first,f.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var u=this.getSession(),f;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(f=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(f=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(f=!1)),u.$highlightLineMarker&&!f)u.removeMarker(u.$highlightLineMarker.id),u.$highlightLineMarker=null;else if(!u.$highlightLineMarker&&f){var s=new l(f.row,f.column,f.row,1/0);s.id=u.addMarker(s,"ace_active-line","screenLine"),u.$highlightLineMarker=s}else f&&(u.$highlightLineMarker.start.row=f.row,u.$highlightLineMarker.end.row=f.row,u.$highlightLineMarker.start.column=f.column,u._signal("changeBackMarker"))},this.onSelectionChange=function(u){var f=this.session;if(f.$selectionMarker&&f.removeMarker(f.$selectionMarker),f.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var s=this.selection.getRange(),m=this.getSelectionStyle();f.$selectionMarker=f.addMarker(s,"ace_selection",m)}var b=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(b),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var u=this.session,f=this.getSelectionRange();if(!(f.isEmpty()||f.isMultiLine())){var s=f.start.column,m=f.end.column,b=u.getLine(f.start.row),C=b.substring(s,m);if(!(C.length>5e3||!/[\w\d]/.test(C))){var A=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:C}),R=b.substring(s-1,m+1);if(A.test(R))return A}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(u){this.renderer.updateText(),this._emit("changeMode",u)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var u=this.getSelectedText(),f=this.session.doc.getNewLineCharacter(),s=!1;if(!u&&this.$copyWithEmptySelection){s=!0;for(var m=this.selection.getAllRanges(),b=0;b<m.length;b++){var C=m[b];b&&m[b-1].start.row==C.start.row||(u+=this.session.getLine(C.start.row)+f)}}var A={text:u};return this._signal("copy",A),r.lineMode=s?A.text:"",A.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(u,f){var s={text:u,event:f};this.commands.exec("paste",this,s)},this.$handlePaste=function(u){typeof u=="string"&&(u={text:u}),this._signal("paste",u);var f=u.text,s=f==r.lineMode,m=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)s?m.insert({row:this.selection.lead.row,column:0},f):this.insert(f);else if(s)this.selection.rangeList.ranges.forEach(function(I){m.insert({row:I.start.row,column:0},f)});else{var b=f.split(/\r\n|\r|\n/),C=this.selection.rangeList.ranges,A=b.length==2&&(!b[0]||!b[1]);if(b.length!=C.length||A)return this.commands.exec("insertstring",this,f);for(var R=C.length;R--;){var E=C[R];E.isEmpty()||m.remove(E),m.insert(E.start,b[R])}}},this.execCommand=function(u,f){return this.commands.exec(u,this,f)},this.insert=function(u,f){var s=this.session,m=s.getMode(),b=this.getCursorPosition();if(this.getBehavioursEnabled()&&!f){var C=m.transformAction(s.getState(b.row),"insertion",this,s,u);C&&(u!==C.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),u=C.text)}if(u==" "&&(u=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&u.indexOf("\n")==-1){var A=new l.fromPoints(b,b);A.end.column+=u.length,this.session.remove(A)}}else{var A=this.getSelectionRange();b=this.session.remove(A),this.clearSelection()}if(u=="\n"||u=="\r\n"){var T=s.getLine(b.row);if(b.column>T.search(/\S|$/)){var R=T.substr(b.column).search(/\S|$/);s.doc.removeInLine(b.row,b.column,b.column+R)}}this.clearSelection();var E=b.column,I=s.getState(b.row),T=s.getLine(b.row),_=m.checkOutdent(I,T,u);if(s.insert(b,u),C&&C.selection&&(C.selection.length==2?this.selection.setSelectionRange(new l(b.row,E+C.selection[0],b.row,E+C.selection[1])):this.selection.setSelectionRange(new l(b.row+C.selection[0],C.selection[1],b.row+C.selection[2],C.selection[3]))),this.$enableAutoIndent){if(s.getDocument().isNewLine(u)){var M=m.getNextLineIndent(I,T.slice(0,b.column),s.getTabString());s.insert({row:b.row+1,column:0},M)}_&&m.autoOutdent(I,s,b.row)}},this.autoIndent=function(){var u=this.session,f=u.getMode(),s,m;if(this.selection.isEmpty())s=0,m=u.doc.getLength()-1;else{var b=this.getSelectionRange();s=b.start.row,m=b.end.row}for(var C="",A="",R="",E,I,T,_=u.getTabString(),M=s;M<=m;M++)M>0&&(C=u.getState(M-1),A=u.getLine(M-1),R=f.getNextLineIndent(C,A,_)),E=u.getLine(M),I=f.$getIndent(E),R!==I&&(I.length>0&&(T=new l(M,0,M,I.length),u.remove(T)),R.length>0&&u.insert({row:M,column:0},R)),f.autoOutdent(C,u,M)},this.onTextInput=function(u,f){if(!f)return this.keyBinding.onTextInput(u);this.startOperation({command:{name:"insertstring"}});var s=this.applyComposition.bind(this,u,f);this.selection.rangeCount?this.forEachSelection(s):s(),this.endOperation()},this.applyComposition=function(u,f){if(f.extendLeft||f.extendRight){var s=this.selection.getRange();s.start.column-=f.extendLeft,s.end.column+=f.extendRight,s.start.column<0&&(s.start.row--,s.start.column+=this.session.getLine(s.start.row).length+1),this.selection.setRange(s),!u&&!s.isEmpty()&&this.remove()}if((u||!this.selection.isEmpty())&&this.insert(u,!0),f.restoreStart||f.restoreEnd){var s=this.selection.getRange();s.start.column-=f.restoreStart,s.end.column-=f.restoreEnd,this.selection.setRange(s)}},this.onCommandKey=function(u,f,s){return this.keyBinding.onCommandKey(u,f,s)},this.setOverwrite=function(u){this.session.setOverwrite(u)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(u){this.setOption("scrollSpeed",u)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(u){this.setOption("dragDelay",u)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(u){this.setOption("selectionStyle",u)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(u){this.setOption("highlightActiveLine",u)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(u){this.setOption("highlightGutterLine",u)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(u){this.setOption("highlightSelectedWord",u)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(u){this.renderer.setAnimatedScroll(u)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(u){this.renderer.setShowInvisibles(u)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(u){this.renderer.setDisplayIndentGuides(u)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(u){this.renderer.setShowPrintMargin(u)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(u){this.renderer.setPrintMarginColumn(u)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(u){this.setOption("readOnly",u)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(u){this.setOption("behavioursEnabled",u)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(u){this.setOption("wrapBehavioursEnabled",u)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(u){this.setOption("showFoldWidgets",u)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(u){this.setOption("fadeFoldWidgets",u)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(u){this.selection.isEmpty()&&(u=="left"?this.selection.selectLeft():this.selection.selectRight());var f=this.getSelectionRange();if(this.getBehavioursEnabled()){var s=this.session,m=s.getState(f.start.row),b=s.getMode().transformAction(m,"deletion",this,s,f);if(f.end.column===0){var C=s.getTextRange(f);if(C[C.length-1]=="\n"){var A=s.getLine(f.end.row);/^\s+$/.test(A)&&(f.end.column=A.length)}}b&&(f=b)}this.session.remove(f),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var u=this.getSelectionRange();u.start.column==u.end.column&&u.start.row==u.end.row&&(u.end.column=0,u.end.row++),this.session.remove(u),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var u=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(u)},this.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),f=u.column;if(f!==0){var s=this.session.getLine(u.row),m,b;f<s.length?(m=s.charAt(f)+s.charAt(f-1),b=new l(u.row,f-1,u.row,f+1)):(m=s.charAt(f-1)+s.charAt(f-2),b=new l(u.row,f-2,u.row,f)),this.session.replace(b,m),this.session.selection.moveToPosition(b.end)}}},this.toLowerCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var f=this.getSelectionRange(),s=this.session.getTextRange(f);this.session.replace(f,s.toLowerCase()),this.selection.setSelectionRange(u)},this.toUpperCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var f=this.getSelectionRange(),s=this.session.getTextRange(f);this.session.replace(f,s.toUpperCase()),this.selection.setSelectionRange(u)},this.indent=function(){var u=this.session,f=this.getSelectionRange();if(f.start.row<f.end.row){var s=this.$getSelectedRows();u.indentRows(s.first,s.last," ");return}if(f.start.column<f.end.column){var m=u.getTextRange(f);if(!/^\s+$/.test(m)){var s=this.$getSelectedRows();u.indentRows(s.first,s.last," ");return}}var b=u.getLine(f.start.row),C=f.start,A=u.getTabSize(),R=u.documentToScreenColumn(C.row,C.column);if(this.session.getUseSoftTabs())var E=A-R%A,I=d.stringRepeat(" ",E);else{for(var E=R%A;b[f.start.column-1]==" "&&E;)f.start.column--,E--;this.selection.setSelectionRange(f),I=" "}return this.insert(I)},this.blockIndent=function(){var u=this.$getSelectedRows();this.session.indentRows(u.first,u.last," ")},this.blockOutdent=function(){var u=this.session.getSelection();this.session.outdentRows(u.getRange())},this.sortLines=function(){for(var u=this.$getSelectedRows(),f=this.session,s=[],m=u.first;m<=u.last;m++)s.push(f.getLine(m));s.sort(function(A,R){return A.toLowerCase()<R.toLowerCase()?-1:A.toLowerCase()>R.toLowerCase()?1:0});for(var b=new l(0,0,0,0),m=u.first;m<=u.last;m++){var C=f.getLine(m);b.start.row=m,b.end.row=m,b.end.column=C.length,f.replace(b,s[m-u.first])}},this.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),f=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,f.first,f.last)},this.toggleBlockComment=function(){var u=this.getCursorPosition(),f=this.session.getState(u.row),s=this.getSelectionRange();this.session.getMode().toggleBlockComment(f,this.session,s,u)},this.getNumberAt=function(u,f){var s=/[\-]?[0-9]+(?:\.[0-9]+)?/g;s.lastIndex=0;for(var m=this.session.getLine(u);s.lastIndex<f;){var b=s.exec(m);if(b.index<=f&&b.index+b[0].length>=f){var C={value:b[0],start:b.index,end:b.index+b[0].length};return C}}return null},this.modifyNumber=function(u){var f=this.selection.getCursor().row,s=this.selection.getCursor().column,m=new l(f,s-1,f,s),b=this.session.getTextRange(m);if(!isNaN(parseFloat(b))&&isFinite(b)){var C=this.getNumberAt(f,s);if(C){var A=C.value.indexOf(".")>=0?C.start+C.value.indexOf(".")+1:C.end,R=C.start+C.value.length-A,E=parseFloat(C.value);E*=Math.pow(10,R),A!==C.end&&s<A?u*=Math.pow(10,C.end-s-1):u*=Math.pow(10,C.end-s),E+=u,E/=Math.pow(10,R);var I=E.toFixed(R),T=new l(f,C.start,f,C.end);this.session.replace(T,I),this.moveCursorTo(f,Math.max(C.start+1,s+I.length-C.value.length))}}else this.toggleWord()},this.$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"],["&&","||"],["==","!="]],this.toggleWord=function(){var u=this.selection.getCursor().row,f=this.selection.getCursor().column;this.selection.selectWord();var s=this.getSelectedText(),m=this.selection.getWordRange().start.column,b=s.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),C=f-m-1;C<0&&(C=0);var A=0,R=0,E=this;s.match(/[A-Za-z0-9_]+/)&&b.forEach(function(B,P){R=A+B.length,C>=A&&C<=R&&(s=B,E.selection.clearSelection(),E.moveCursorTo(u,A+m),E.selection.selectTo(u,R+m)),A=R});for(var I=this.$toggleWordPairs,T,_=0;_<I.length;_++)for(var M=I[_],O=0;O<=1;O++){var D=+!O,F=s.match(new RegExp("^\\s?_?("+d.escapeRegExp(M[O])+")\\s?$","i"));if(F){var W=s.match(new RegExp("([_]|^|\\s)("+d.escapeRegExp(F[1])+")($|\\s)","g"));W&&(T=s.replace(new RegExp(d.escapeRegExp(M[O]),"i"),function(B){var P=M[D];return B.toUpperCase()==B?P=P.toUpperCase():B.charAt(0).toUpperCase()==B.charAt(0)&&(P=P.substr(0,0)+M[D].charAt(0).toUpperCase()+P.substr(1)),P}),this.insert(T),T="")}}},this.removeLines=function(){var u=this.$getSelectedRows();this.session.removeFullLines(u.first,u.last),this.clearSelection()},this.duplicateSelection=function(){var u=this.selection,f=this.session,s=u.getRange(),m=u.isBackwards();if(s.isEmpty()){var b=s.start.row;f.duplicateLines(b,b)}else{var C=m?s.start:s.end,A=f.insert(C,f.getTextRange(s),!1);s.start=C,s.end=A,u.setSelectionRange(s,m)}},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(u,f,s){return this.session.moveText(u,f,s)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(u,f){var s,m,b=this.selection;if(!b.inMultiSelectMode||this.inVirtualSelectionMode){var C=b.toOrientedRange();s=this.$getSelectedRows(C),m=this.session.$moveLines(s.first,s.last,f?0:u),f&&u==-1&&(m=0),C.moveBy(m,0),b.fromOrientedRange(C)}else{var A=b.rangeList.ranges;b.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var R=0,E=0,I=A.length,T=0;T<I;T++){var _=T;A[T].moveBy(R,0),s=this.$getSelectedRows(A[T]);for(var M=s.first,O=s.last;++T<I;){E&&A[T].moveBy(E,0);var D=this.$getSelectedRows(A[T]);if(f&&D.first!=O||!f&&D.first>O+1)break;O=D.last}for(T--,R=this.session.$moveLines(M,O,f?0:u),f&&u==-1&&(_=T+1);_<=T;)A[_].moveBy(R,0),_++;f||(R=0),E+=R}b.fromOrientedRange(b.ranges[0]),b.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},this.onCompositionStart=function(u){this.renderer.showComposition(u)},this.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},this.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(u,f){var s=this.renderer,m=this.renderer.layerConfig,b=u*Math.floor(m.height/m.lineHeight);f===!0?this.selection.$moveSelection(function(){this.moveCursorBy(b,0)}):f===!1&&(this.selection.moveCursorBy(b,0),this.selection.clearSelection());var C=s.scrollTop;s.scrollBy(0,b*m.lineHeight),f!=null&&s.scrollCursorIntoView(null,.5),s.animateScrolling(C)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(u){this.renderer.scrollToRow(u)},this.scrollToLine=function(u,f,s,m){this.renderer.scrollToLine(u,f,s,m)},this.centerSelection=function(){var u=this.getSelectionRange(),f={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(f,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(u,f){this.selection.moveCursorTo(u,f)},this.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},this.jumpToMatching=function(u,f){var s=this.getCursorPosition(),m=new p(this.session,s.row,s.column),b=m.getCurrentToken(),C=b||m.stepForward();if(C){var A,R=!1,E={},I=s.column-C.start,T,_={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(C.value.match(/[{}()\[\]]/g)){for(;I<C.value.length&&!R;I++)if(_[C.value[I]])switch(T=_[C.value[I]]+"."+C.type.replace("rparen","lparen"),isNaN(E[T])&&(E[T]=0),C.value[I]){case"(":case"[":case"{":E[T]++;break;case")":case"]":case"}":E[T]--,E[T]===-1&&(A="bracket",R=!0)}}else C.type.indexOf("tag-name")!==-1&&(isNaN(E[C.value])&&(E[C.value]=0),b.value==="<"?E[C.value]++:b.value==="</"&&E[C.value]--,E[C.value]===-1&&(A="tag",R=!0));R||(b=C,C=m.stepForward(),I=0)}while(C&&!R);if(A){var M,O;if(A==="bracket")M=this.session.getBracketRange(s),M||(M=new l(m.getCurrentTokenRow(),m.getCurrentTokenColumn()+I-1,m.getCurrentTokenRow(),m.getCurrentTokenColumn()+I-1),O=M.start,(f||O.row===s.row&&Math.abs(O.column-s.column)<2)&&(M=this.session.getBracketRange(O)));else if(A==="tag"){if(!C||C.type.indexOf("tag-name")===-1)return;var D=C.value;if(M=new l(m.getCurrentTokenRow(),m.getCurrentTokenColumn()-2,m.getCurrentTokenRow(),m.getCurrentTokenColumn()-2),M.compare(s.row,s.column)===0){R=!1;do C=b,b=m.stepBackward(),b&&(b.type.indexOf("tag-close")!==-1&&M.setEnd(m.getCurrentTokenRow(),m.getCurrentTokenColumn()+1),C.value===D&&C.type.indexOf("tag-name")!==-1&&(b.value==="<"?E[D]++:b.value==="</"&&E[D]--,E[D]===0&&(R=!0)));while(b&&!R)}C&&C.type.indexOf("tag-name")&&(O=M.start,O.row==s.row&&Math.abs(O.column-s.column)<2&&(O=M.end))}O=M&&M.cursor||O,O&&(u?M&&f?this.selection.setRange(M):M&&M.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(O.row,O.column):this.selection.moveTo(O.row,O.column))}}},this.gotoLine=function(u,f,s){this.selection.clearSelection(),this.session.unfold({row:u-1,column:f||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(u-1,f||0),this.isRowFullyVisible(u-1)||this.scrollToLine(u-1,!0,s)},this.navigateTo=function(u,f){this.selection.moveTo(u,f)},this.navigateUp=function(u){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var f=this.selection.anchor.getPosition();return this.moveCursorToPosition(f)}this.selection.clearSelection(),this.selection.moveCursorBy(-u||-1,0)},this.navigateDown=function(u){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var f=this.selection.anchor.getPosition();return this.moveCursorToPosition(f)}this.selection.clearSelection(),this.selection.moveCursorBy(u||1,0)},this.navigateLeft=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorLeft();else{var f=this.getSelectionRange().start;this.moveCursorToPosition(f)}this.clearSelection()},this.navigateRight=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorRight();else{var f=this.getSelectionRange().end;this.moveCursorToPosition(f)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(u,f){f&&this.$search.set(f);var s=this.$search.find(this.session),m=0;return s&&(this.$tryReplace(s,u)&&(m=1),this.selection.setSelectionRange(s),this.renderer.scrollSelectionIntoView(s.start,s.end)),m},this.replaceAll=function(u,f){f&&this.$search.set(f);var s=this.$search.findAll(this.session),m=0;if(!s.length)return m;var b=this.getSelectionRange();this.selection.moveTo(0,0);for(var C=s.length-1;C>=0;--C)this.$tryReplace(s[C],u)&&m++;return this.selection.setSelectionRange(b),m},this.$tryReplace=function(u,f){var s=this.session.getTextRange(u);return f=this.$search.replace(s,f),f!==null?(u.end=this.session.replace(u,f),u):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(u,f,s){f||(f={}),typeof u=="string"||u instanceof RegExp?f.needle=u:typeof u=="object"&&S.mixin(f,u);var m=this.selection.getRange();f.needle==null&&(u=this.session.getTextRange(m)||this.$search.$options.needle,u||(m=this.session.getWordRange(m.start.row,m.start.column),u=this.session.getTextRange(m)),this.$search.set({needle:u})),this.$search.set(f),f.start||this.$search.set({start:m});var b=this.$search.find(this.session);if(f.preventScroll)return b;if(b)return this.revealRange(b,s),b;f.backwards?m.start=m.end:m.end=m.start,this.selection.setRange(m)},this.findNext=function(u,f){this.find({skipCurrent:!0,backwards:!1},u,f)},this.findPrevious=function(u,f){this.find(u,{skipCurrent:!0,backwards:!0},f)},this.revealRange=function(u,f){this.session.unfold(u),this.selection.setSelectionRange(u);var s=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),f!==!1&&this.renderer.animateScrolling(s)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.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()},this.setAutoScrollEditorIntoView=function(u){if(u){var f,s=this,m=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var b=this.$scrollAnchor;b.style.cssText="position:absolute",this.container.insertBefore(b,this.container.firstChild);var C=this.on("changeSelection",function(){m=!0}),A=this.renderer.on("beforeRender",function(){m&&(f=s.renderer.container.getBoundingClientRect())}),R=this.renderer.on("afterRender",function(){if(m&&f&&(s.isFocused()||s.searchBox&&s.searchBox.isFocused())){var E=s.renderer,I=E.$cursorLayer.$pixelPos,T=E.layerConfig,_=I.top-T.offset;I.top>=0&&_+f.top<0?m=!0:I.top<T.height&&I.top+f.top+T.lineHeight>window.innerHeight?m=!1:m=null,m!=null&&(b.style.top=_+"px",b.style.left=I.left+"px",b.style.height=T.lineHeight+"px",b.scrollIntoView(m)),m=f=null}});this.setAutoScrollEditorIntoView=function(E){E||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",C),this.renderer.off("afterRender",R),this.renderer.off("beforeRender",A))}}},this.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",f=this.renderer.$cursorLayer;f&&(f.setSmoothBlinking(/smooth/.test(u)),f.isBlinking=!this.$readOnly&&u!="wide",x.setCssClass(f.element,"ace_slim-cursors",/slim/.test(u)))},this.prompt=function(u,f,s){var m=this;y.loadModule("./ext/prompt",function(b){b.prompt(m,u,f,s)})}}).call(h.prototype),y.defineOptions(h.prototype,"editor",{selectionStyle:{set:function(u){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:u})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(u){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(u){this.textInput.setReadOnly(u),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(u){this.textInput.setCopyWithEmptySelection(u)},initialValue:!1},cursorStyle:{set:function(u){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(u){this.setAutoScrollEditorIntoView(u)}},keyboardHandler:{set:function(u){this.setKeyboardHandler(u)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(u){this.session.setValue(u)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(u){this.setSession(u)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(u){this.renderer.$gutterLayer.setShowLineNumbers(u),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),u&&this.$relativeLineNumbers?w.attach(this):w.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(u){this.$showLineNumbers&&u?w.attach(this):w.detach(this)}},placeholder:{set:function(u){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var f=this.session&&(this.renderer.$composition||this.getValue());if(f&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),x.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!f&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var s=x.createElement("div");s.className="ace_placeholder",s.textContent=this.$placeholder||"",this.renderer.placeholderNode=s,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!f&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"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 w={getText:function(u,f){return(Math.abs(u.selection.lead.row-f)||f+1+(f<9?"·":""))+""},getWidth:function(u,f,s){return Math.max(f.toString().length,(s.lastRow+1).toString().length,2)*s.characterWidth},update:function(u,f){f.renderer.$loop.schedule(f.renderer.CHANGE_GUTTER)},attach:function(u){u.renderer.$gutterLayer.$renderer=this,u.on("changeSelection",this.update),this.update(null,u)},detach:function(u){u.renderer.$gutterLayer.$renderer==this&&(u.renderer.$gutterLayer.$renderer=null),u.off("changeSelection",this.update),this.update(null,u)}};k.Editor=h}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(L,k,N){function S(r,h){for(var w=h;w--;){var u=r[w];if(u&&!u[0].ignore){for(;w<h-1;){var f=e(r[w],r[w+1]);r[w]=f[0],r[w+1]=f[1],w++}return!0}}}function x(r){return{row:r.row,column:r.column}}function d(r){return{start:x(r.start),end:x(r.end),action:r.action,lines:r.lines.slice()}}function c(r){if(r=r||this,Array.isArray(r))return r.map(c).join("\n");var h="";return r.action?(h=r.action=="insert"?"+":"-",h+="["+r.lines+"]"):r.value&&(Array.isArray(r.value)?h=r.value.map(a).join("\n"):h=a(r.value)),r.start&&(h+=a(r)),(r.id||r.rev)&&(h+=" ("+(r.id||r.rev)+")"),h}function a(r){return r.start.row+":"+r.start.column+"=>"+r.end.row+":"+r.end.column}function t(r,h){var w=r.action=="insert",u=h.action=="insert";if(w&&u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.start,r.start)<=0))return null;n(r,h,1)}else if(w&&!u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.end,r.start)<=0))return null;n(r,h,-1)}else if(!w&&u)if(p(h.start,r.start)>=0)n(h,r,1);else{if(!(p(h.start,r.start)<=0))return null;n(r,h,1)}else if(!w&&!u)if(p(h.start,r.start)>=0)n(h,r,1);else{if(!(p(h.end,r.start)<=0))return null;n(r,h,-1)}return[h,r]}function e(r,h){for(var w=r.length;w--;)for(var u=0;u<h.length;u++)if(!t(r[w],h[u])){for(;w<r.length;){for(;u--;)t(h[u],r[w]);u=h.length,w++}return[r,h]}return r.selectionBefore=h.selectionBefore=r.selectionAfter=h.selectionAfter=null,[h,r]}function i(r,h){var w=r.action=="insert",u=h.action=="insert";if(w&&u)p(r.start,h.start)<0?n(h,r,1):n(r,h,1);else if(w&&!u)p(r.start,h.end)>=0?n(r,h,-1):(p(r.start,h.start)<=0||n(r,y.fromPoints(h.start,r.start),-1),n(h,r,1));else if(!w&&u)p(h.start,r.end)>=0?n(h,r,-1):(p(h.start,r.start)<=0||n(h,y.fromPoints(r.start,h.start),-1),n(r,h,1));else if(!w&&!u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.end,r.start)<=0)){var f,s;return p(r.start,h.start)<0&&(f=r,r=l(r,h.start)),p(r.end,h.end)>0&&(s=l(r,h.end)),o(h.end,r.start,r.end,-1),s&&!f&&(r.lines=s.lines,r.start=s.start,r.end=s.end,s=r),[h,f,s].filter(Boolean)}n(r,h,-1)}return[h,r]}function n(r,h,w){o(r.start,h.start,h.end,w),o(r.end,h.start,h.end,w)}function o(r,h,w,u){r.row==(u==1?h:w).row&&(r.column+=u*(w.column-h.column)),r.row+=u*(w.row-h.row)}function l(r,h){var w=r.lines,u=r.end;r.end=x(h);var f=r.end.row-r.start.row,s=w.splice(f,w.length),m=f?h.column:h.column-r.start.column;w.push(s[0].substring(0,m)),s[0]=s[0].substr(m);var b={start:x(h),end:u,lines:s,action:r.action};return b}function g(r,h){h=d(h);for(var w=r.length;w--;){for(var u=r[w],f=0;f<u.length;f++){var s=u[f],m=i(s,h);h=m[0],m.length!=2&&(m[2]?(u.splice(f+1,1,m[1],m[2]),f++):m[1]||(u.splice(f,1),f--))}u.length||r.splice(w,1)}return r}function v(r,h){for(var w=0;w<h.length;w++)for(var u=h[w],f=0;f<u.length;f++)g(r,u[f])}var $=function(){this.$maxRev=0,this.$fromUndo=!1,this.reset()};(function(){this.addSession=function(r){this.$session=r},this.add=function(r,h,w){this.$fromUndo||r!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),(h===!1||!this.lastDeltas)&&(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),r.id=this.$rev=++this.$maxRev),(r.action=="remove"||r.action=="insert")&&(this.$lastDelta=r),this.lastDeltas.push(r))},this.addSelection=function(r,h){this.selections.push({value:r,rev:h||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(r,h){h==null&&(h=this.$rev+1);for(var w=this.$undoStack,u=w.length;u--;){var f=w[u][0];if(f.id<=r)break;f.id<h&&(f.ignore=!0)}this.lastDeltas=null},this.getSelection=function(r,h){for(var w=this.selections,u=w.length;u--;){var f=w[u];if(f.rev<r)return h&&(f=w[u+1]),f}},this.getRevision=function(){return this.$rev},this.getDeltas=function(r,h){h==null&&(h=this.$rev+1);for(var w=this.$undoStack,u=null,f=0,s=w.length;s--;){var m=w[s][0];if(m.id<h&&!u&&(u=s+1),m.id<=r){f=s+1;break}}return w.slice(f,u)},this.getChangedRanges=function(r,h){h==null&&(h=this.$rev+1)},this.getChangedLines=function(r,h){h==null&&(h=this.$rev+1)},this.undo=function(r,h){this.lastDeltas=null;var w=this.$undoStack;if(S(w,w.length)){r||(r=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var u=w.pop(),f=null;return u&&(f=r.undoChanges(u,h),this.$redoStack.push(u),this.$syncRev()),this.$fromUndo=!1,f}},this.redo=function(r,h){if(this.lastDeltas=null,r||(r=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var w=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);v(this.$redoStack,w),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(s){s[0].id=++this.$maxRev},this)}var u=this.$redoStack.pop(),f=null;return u&&(f=r.redoChanges(u,h),this.$undoStack.push(u),this.$syncRev()),this.$fromUndo=!1,f},this.$syncRev=function(){var r=this.$undoStack,h=r[r.length-1],w=h&&h[0].id||0;this.$redoStackBaseRev=w,this.$rev=w},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return this.$undoStack.length>0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(r){r==null&&(r=this.$rev),this.mark=r},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(r){return r?c(r):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)}}).call($.prototype);var y=L("./range").Range,p=y.comparePoints;y.comparePoints,k.UndoManager=$}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(L,k,N){var S=L("../lib/dom"),x=function(d,c){this.element=d,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(d){S.translate(this.element,0,-(d.firstRowScreen*d.lineHeight%this.canvasHeight)-d.offset*this.$offsetCoefficient)},this.pageChanged=function(d,c){return Math.floor(d.firstRowScreen*d.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},this.computeLineTop=function(d,c,a){var t=c.firstRowScreen*c.lineHeight,e=Math.floor(t/this.canvasHeight),i=a.documentToScreenRow(d,0)*c.lineHeight;return i-e*this.canvasHeight},this.computeLineHeight=function(d,c,a){return c.lineHeight*a.getRowLineCount(d)},this.getLength=function(){return this.cells.length},this.get=function(d){return this.cells[d]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(d){if(Array.isArray(d)){this.cells.push.apply(this.cells,d);for(var c=S.createFragment(this.element),a=0;a<d.length;a++)c.appendChild(d[a].element);this.element.appendChild(c)}else this.cells.push(d),this.element.appendChild(d.element)},this.unshift=function(d){if(Array.isArray(d)){this.cells.unshift.apply(this.cells,d);for(var c=S.createFragment(this.element),a=0;a<d.length;a++)c.appendChild(d[a].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c)}else this.cells.unshift(d),this.element.insertAdjacentElement("afterbegin",d.element)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(d){d&&(d.element.remove(),this.cellCache.push(d))},this.createCell=function(d,c,a,t){var e=this.cellCache.pop();if(!e){var i=S.createElement("div");t&&t(i),this.element.appendChild(i),e={element:i,text:"",row:d}}return e.row=d,e}}).call(x.prototype),k.Lines=x}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],function(L,k,N){function S(i){var n=document.createTextNode("");i.appendChild(n);var o=x.createElement("span");return i.appendChild(o),i}var x=L("../lib/dom"),d=L("../lib/oop"),c=L("../lib/lang"),a=L("../lib/event_emitter").EventEmitter,t=L("./lines").Lines,e=function(i){this.element=x.createElement("div"),this.element.className="ace_layer ace_gutter-layer",i.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new t(this.element),this.$lines.$offsetCoefficient=1};(function(){d.implement(this,a),this.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(i,n){window.console,this.session.addGutterDecoration(i,n)},this.removeGutterDecoration=function(i,n){window.console,this.session.removeGutterDecoration(i,n)},this.setAnnotations=function(i){this.$annotations=[];for(var n=0;n<i.length;n++){var o=i[n],l=o.row,g=this.$annotations[l];g||(g=this.$annotations[l]={text:[]});var v=o.text;v=v?c.escapeHTML(v):o.html||"",g.text.indexOf(v)===-1&&g.text.push(v);var $=o.type;$=="error"?g.className=" ace_error":$=="warning"&&g.className!=" ace_error"?g.className=" ace_warning":$=="info"&&!g.className&&(g.className=" ace_info")}},this.$updateAnnotations=function(i){if(this.$annotations.length){var n=i.start.row,o=i.end.row-n;if(o!==0)if(i.action=="remove")this.$annotations.splice(n,o+1,null);else{var l=new Array(o+1);l.unshift(n,1),this.$annotations.splice.apply(this.$annotations,l)}}},this.update=function(i){this.config=i;var n=this.session,o=i.firstRow,l=Math.min(i.lastRow+i.gutterOffset,n.getLength()-1);this.oldLastRow=l,this.config=i,this.$lines.moveContainer(i),this.$updateCursorRow();for(var g=n.getNextFoldLine(o),v=g?g.start.row:1/0,$=null,y=-1,p=o;;){if(p>v&&(p=g.end.row+1,g=n.getNextFoldLine(p,g),v=g?g.start.row:1/0),p>l){for(;this.$lines.getLength()>y+1;)this.$lines.pop();break}$=this.$lines.get(++y),$?$.row=p:($=this.$lines.createCell(p,i,this.session,S),this.$lines.push($)),this.$renderCell($,i,g,p),p++}this._signal("afterRender"),this.$updateGutterWidth(i)},this.$updateGutterWidth=function(i){var n=this.session,o=n.gutterRenderer||this.$renderer,l=n.$firstLineNumber,g=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||n.$useWrapMode)&&(g=n.getLength()+l-1);var v=o?o.getWidth(n,g,i):g.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();v+=$.left+$.right,v!==this.gutterWidth&&!isNaN(v)&&(this.gutterWidth=v,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",v))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var n=this.$lines.cells;this.$cursorCell=null;for(var o=0;o<n.length;o++){var l=n[o];if(l.row>=this.$cursorRow){if(l.row>this.$cursorRow){var g=this.session.getFoldLine(this.$cursorRow);if(!(o>0&&g&&g.start.row==n[o-1].row))break;l=n[o-1]}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},this.scrollLines=function(i){var n=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(n,i))return this.update(i);this.$lines.moveContainer(i);var o=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=o,!n||l<i.firstRow)return this.update(i);if(o<n.firstRow)return this.update(i);if(n.firstRow<i.firstRow)for(var g=this.session.getFoldedRowCount(n.firstRow,i.firstRow-1);g>0;g--)this.$lines.shift();if(l>o)for(var g=this.session.getFoldedRowCount(o+1,l);g>0;g--)this.$lines.pop();i.firstRow<n.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,n.firstRow-1)),o>l&&this.$lines.push(this.$renderLines(i,l+1,o)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},this.$renderLines=function(i,n,o){for(var l=[],g=n,v=this.session.getNextFoldLine(g),$=v?v.start.row:1/0;g>$&&(g=v.end.row+1,v=this.session.getNextFoldLine(g,v),$=v?v.start.row:1/0),!(g>o);){var y=this.$lines.createCell(g,i,this.session,S);this.$renderCell(y,i,v,g),l.push(y),g++}return l},this.$renderCell=function(i,n,o,l){var g=i.element,v=this.session,$=g.childNodes[0],y=g.childNodes[1],p=v.$firstLineNumber,r=v.$breakpoints,h=v.$decorations,w=v.gutterRenderer||this.$renderer,u=this.$showFoldWidgets&&v.foldWidgets,f=o?o.start.row:Number.MAX_VALUE,s="ace_gutter-cell ";if(this.$highlightGutterLine&&(l==this.$cursorRow||o&&l<this.$cursorRow&&l>=f&&this.$cursorRow<=o.end.row)&&(s+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),r[l]&&(s+=r[l]),h[l]&&(s+=h[l]),this.$annotations[l]&&(s+=this.$annotations[l].className),g.className!=s&&(g.className=s),u){var m=u[l];m==null&&(m=u[l]=v.getFoldWidget(l))}if(m){var s="ace_fold-widget ace_"+m;m=="start"&&l==f&&l<o.end.row?s+=" ace_closed":s+=" ace_open",y.className!=s&&(y.className=s);var b=n.lineHeight+"px";x.setStyle(y.style,"height",b),x.setStyle(y.style,"display","inline-block")}else y&&x.setStyle(y.style,"display","none");var C=(w?w.getText(v,l):l+p).toString();return C!==$.data&&($.data=C),x.setStyle(i.element.style,"height",this.$lines.computeLineHeight(l,n,v)+"px"),x.setStyle(i.element.style,"top",this.$lines.computeLineTop(l,n,v)+"px"),i.text=C,i},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(i){i?x.addCssClass(this.element,"ace_folding-enabled"):x.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=x.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(i.borderLeftWidth)||0)+(parseInt(i.paddingLeft)||0)+1,this.$padding.right=(parseInt(i.borderRightWidth)||0)+(parseInt(i.paddingRight)||0),this.$padding},this.getRegion=function(i){var n=this.$padding||this.$computePadding(),o=this.element.getBoundingClientRect();if(i.x<n.left+o.left)return"markers";if(this.$showFoldWidgets&&i.x>o.right-n.right)return"foldWidgets"}}).call(e.prototype),k.Gutter=e}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(L,k,N){var S=L("../range").Range,x=L("../lib/dom"),d=function(c){this.element=x.createElement("div"),this.element.className="ace_layer ace_marker-layer",c.appendChild(this.element)};(function(){function c(a,t,e,i){return(a?1:0)|(t?2:0)|(e?4:0)|(i?8:0)}this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.elt=function(a,t){var e=this.i!=-1&&this.element.childNodes[this.i];e?this.i++:(e=document.createElement("div"),this.element.appendChild(e),this.i=-1),e.style.cssText=t,e.className=a},this.update=function(a){if(a){this.config=a,this.i=0;var t;for(var e in this.markers){var i=this.markers[e];if(!i.range){i.update(t,this,this.session,a);continue}var n=i.range.clipRows(a.firstRow,a.lastRow);if(!n.isEmpty())if(n=n.toScreenRange(this.session),i.renderer){var o=this.$getTop(n.start.row,a),l=this.$padding+n.start.column*a.characterWidth;i.renderer(t,n,l,o,a)}else i.type=="fullLine"?this.drawFullLineMarker(t,n,i.clazz,a):i.type=="screenLine"?this.drawScreenLineMarker(t,n,i.clazz,a):n.isMultiLine()?i.type=="text"?this.drawTextMarker(t,n,i.clazz,a):this.drawMultiLineMarker(t,n,i.clazz,a):this.drawSingleLineMarker(t,n,i.clazz+" ace_start ace_br15",a)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(a,t){return(a-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(a,t,e,i,n){for(var o=this.session,l=t.start.row,g=t.end.row,v=l,$=0,y=0,p=o.getScreenLastRowColumn(v),r=new S(v,t.start.column,v,y);v<=g;v++)r.start.row=r.end.row=v,r.start.column=v==l?t.start.column:o.getRowWrapIndent(v),r.end.column=p,$=y,y=p,p=v+1<g?o.getScreenLastRowColumn(v+1):v==g?0:t.end.column,this.drawSingleLineMarker(a,r,e+(v==l?" ace_start":"")+" ace_br"+c(v==l||v==l+1&&t.start.column,$<y,y>p,v==g),i,v==g?0:1,n)},this.drawMultiLineMarker=function(a,t,e,i,n){var o=this.$padding,l=i.lineHeight,g=this.$getTop(t.start.row,i),v=o+t.start.column*i.characterWidth;if(n=n||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var $=t.clone();$.end.row=$.start.row,$.end.column=this.session.getLine($.start.row).length,this.drawBidiSingleLineMarker(a,$,e+" ace_br1 ace_start",i,null,n)}else this.elt(e+" ace_br1 ace_start","height:"+l+"px;right:0;top:"+g+"px;left:"+v+"px;"+(n||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var $=t.clone();$.start.row=$.end.row,$.start.column=0,this.drawBidiSingleLineMarker(a,$,e+" ace_br12",i,null,n)}else{g=this.$getTop(t.end.row,i);var y=t.end.column*i.characterWidth;this.elt(e+" ace_br12","height:"+l+"px;width:"+y+"px;top:"+g+"px;left:"+o+"px;"+(n||""))}if(l=(t.end.row-t.start.row-1)*i.lineHeight,!(l<=0)){g=this.$getTop(t.start.row+1,i);var p=(t.start.column?1:0)|(t.end.column?0:8);this.elt(e+(p?" ace_br"+p:""),"height:"+l+"px;right:0;top:"+g+"px;left:"+o+"px;"+(n||""))}},this.drawSingleLineMarker=function(a,t,e,i,n,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(a,t,e,i,n,o);var l=i.lineHeight,g=(t.end.column+(n||0)-t.start.column)*i.characterWidth,v=this.$getTop(t.start.row,i),$=this.$padding+t.start.column*i.characterWidth;this.elt(e,"height:"+l+"px;width:"+g+"px;top:"+v+"px;left:"+$+"px;"+(o||""))},this.drawBidiSingleLineMarker=function(a,t,e,i,n,o){var l=i.lineHeight,g=this.$getTop(t.start.row,i),v=this.$padding,$=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);$.forEach(function(y){this.elt(e,"height:"+l+"px;width:"+y.width+(n||0)+"px;top:"+g+"px;left:"+(v+y.left)+"px;"+(o||""))},this)},this.drawFullLineMarker=function(a,t,e,i,n){var o=this.$getTop(t.start.row,i),l=i.lineHeight;t.start.row!=t.end.row&&(l+=this.$getTop(t.end.row,i)-o),this.elt(e,"height:"+l+"px;top:"+o+"px;left:0;right:0;"+(n||""))},this.drawScreenLineMarker=function(a,t,e,i,n){var o=this.$getTop(t.start.row,i),l=i.lineHeight;this.elt(e,"height:"+l+"px;top:"+o+"px;left:0;right:0;"+(n||""))}}).call(d.prototype),k.Marker=d}),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(L,k,N){var S=L("../lib/oop"),x=L("../lib/dom"),d=L("../lib/lang"),c=L("./lines").Lines,a=L("../lib/event_emitter").EventEmitter,t=function(e){this.dom=x,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new c(this.element)};(function(){S.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,i=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=i?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(i){this._signal("changeCharacterSize",i)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var i=this.$tabStrings=[0],n=1;n<e+1;n++)if(this.showTabs){var o=this.dom.createElement("span");o.className="ace_invisible ace_invisible_tab",o.textContent=d.stringRepeat(this.TAB_CHAR,n),i.push(o)}else i.push(this.dom.createTextNode(d.stringRepeat(" ",n),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var l="ace_indent-guide",g=this.showSpaces?" ace_invisible ace_invisible_space":"",v=this.showSpaces?d.stringRepeat(this.SPACE_CHAR,this.tabSize):d.stringRepeat(" ",this.tabSize),$=this.showTabs?" ace_invisible ace_invisible_tab":"",y=this.showTabs?d.stringRepeat(this.TAB_CHAR,this.tabSize):v,o=this.dom.createElement("span");o.className=l+g,o.textContent=v,this.$tabStrings[" "]=o;var o=this.dom.createElement("span");o.className=l+$,o.textContent=y,this.$tabStrings[" "]=o}},this.updateLines=function(e,i,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var o=Math.max(i,e.firstRow),l=Math.min(n,e.lastRow),g=this.element.childNodes,v=0,y=e.firstRow;y<o;y++){var p=this.session.getFoldLine(y);if(p){if(p.containsRow(o)){o=p.start.row;break}y=p.end.row}v++}for(var $=!1,y=o,p=this.session.getNextFoldLine(y),r=p?p.start.row:1/0;y>r&&(y=p.end.row+1,p=this.session.getNextFoldLine(y,p),r=p?p.start.row:1/0),!(y>l);){var h=g[v++];if(h){this.dom.removeChildren(h),this.$renderLine(h,y,y==r?p:!1),$&&(h.style.top=this.$lines.computeLineTop(y,e,this.session)+"px");var w=e.lineHeight*this.session.getRowLength(y)+"px";h.style.height!=w&&($=!0,h.style.height=w)}y++}if($)for(;v<this.$lines.cells.length;){var u=this.$lines.cells[v++];u.element.style.top=this.$lines.computeLineTop(u.row,e,this.session)+"px"}},this.scrollLines=function(e){var i=this.config;if(this.config=e,this.$lines.pageChanged(i,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,o=i?i.lastRow:-1;if(!i||o<e.firstRow)return this.update(e);if(n<i.firstRow)return this.update(e);if(!i||i.lastRow<e.firstRow)return this.update(e);if(e.lastRow<i.firstRow)return this.update(e);if(i.firstRow<e.firstRow)for(var l=this.session.getFoldedRowCount(i.firstRow,e.firstRow-1);l>0;l--)this.$lines.shift();if(i.lastRow>e.lastRow)for(var l=this.session.getFoldedRowCount(e.lastRow+1,i.lastRow);l>0;l--)this.$lines.pop();e.firstRow<i.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,i.firstRow-1)),e.lastRow>i.lastRow&&this.$lines.push(this.$renderLinesFragment(e,i.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,i,n){for(var o=[],l=i,g=this.session.getNextFoldLine(l),v=g?g.start.row:1/0;l>v&&(l=g.end.row+1,g=this.session.getNextFoldLine(l,g),v=g?g.start.row:1/0),!(l>n);){var $=this.$lines.createCell(l,e,this.session),y=$.element;this.dom.removeChildren(y),x.setStyle(y.style,"height",this.$lines.computeLineHeight(l,e,this.session)+"px"),x.setStyle(y.style,"top",this.$lines.computeLineTop(l,e,this.session)+"px"),this.$renderLine(y,l,l==v?g:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",o.push($),l++}return o},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var i=e.firstRow,n=e.lastRow,o=this.$lines;o.getLength();)o.pop();o.push(this.$renderLinesFragment(e,i,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,i,n,o){for(var l=this,g=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\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,v=this.dom.createFragment(this.element),$,y=0;$=g.exec(o);){var p=$[1],r=$[2],h=$[3],w=$[4],u=$[5];if(!(!l.showSpaces&&r)){var f=y!=$.index?o.slice(y,$.index):"";if(y=$.index+$[0].length,f&&v.appendChild(this.dom.createTextNode(f,this.element)),p){var s=l.session.getScreenTabSize(i+$.index);v.appendChild(l.$tabStrings[s].cloneNode(!0)),i+=s-1}else if(r)if(l.showSpaces){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space",m.textContent=d.stringRepeat(l.SPACE_CHAR,r.length),v.appendChild(m)}else v.appendChild(this.com.createTextNode(r,this.element));else if(h){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space ace_invalid",m.textContent=d.stringRepeat(l.SPACE_CHAR,h.length),v.appendChild(m)}else if(w){i+=1;var m=this.dom.createElement("span");m.style.width=l.config.characterWidth*2+"px",m.className=l.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",m.textContent=l.showSpaces?l.SPACE_CHAR:w,v.appendChild(m)}else if(u){i+=1;var m=this.dom.createElement("span");m.style.width=l.config.characterWidth*2+"px",m.className="ace_cjk",m.textContent=u,v.appendChild(m)}}}if(v.appendChild(this.dom.createTextNode(y?o.slice(y):o,this.element)),this.$textToken[n.type])e.appendChild(v);else{var b="ace_"+n.type.replace(/\./g," ace_"),m=this.dom.createElement("span");n.type=="fold"&&(m.style.width=n.value.length*this.config.characterWidth+"px"),m.className=b,m.appendChild(v),e.appendChild(m)}return i+o.length},this.renderIndentGuide=function(e,i,n){var o=i.search(this.$indentGuideRe);if(o<=0||o>=n)return i;if(i[0]==" "){o-=o%this.tabSize;for(var l=o/this.tabSize,g=0;g<l;g++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return i.substr(o)}if(i[0]==" "){for(var g=0;g<o;g++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return i.substr(o)}return i},this.$createLineElement=function(e){var i=this.dom.createElement("div");return i.className="ace_line",i.style.height=this.config.lineHeight+"px",i},this.$renderWrappedLine=function(e,i,n){var o=0,l=0,g=n[0],v=0,$=this.$createLineElement();e.appendChild($);for(var y=0;y<i.length;y++){var p=i[y],r=p.value;if(y==0&&this.displayIndentGuides){if(o=r.length,r=this.renderIndentGuide($,r,g),!r)continue;o-=r.length}if(o+r.length<g)v=this.$renderToken($,v,p,r),o+=r.length;else{for(;o+r.length>=g;)v=this.$renderToken($,v,p,r.substring(0,g-o)),r=r.substring(g-o),o=g,$=this.$createLineElement(),e.appendChild($),$.appendChild(this.dom.createTextNode(d.stringRepeat(" ",n.indent),this.element)),l++,v=0,g=n[l]||Number.MAX_VALUE;r.length!=0&&(o+=r.length,v=this.$renderToken($,v,p,r))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage($,v,null,"",!0)},this.$renderSimpleLine=function(e,i){var n=0,o=i[0],l=o.value;this.displayIndentGuides&&(l=this.renderIndentGuide(e,l)),l&&(n=this.$renderToken(e,n,o,l));for(var g=1;g<i.length;g++){if(o=i[g],l=o.value,n+l.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,o,l);n=this.$renderToken(e,n,o,l)}},this.$renderOverflowMessage=function(e,i,n,o,l){n&&this.$renderToken(e,i,n,o.slice(0,this.MAX_LINE_LENGTH-i));var g=this.dom.createElement("span");g.className="ace_inline_button ace_keyword ace_toggle_wrap",g.textContent=l?"<hide>":"<click to see more...>",e.appendChild(g)},this.$renderLine=function(e,i,n){if(!n&&n!=0&&(n=this.session.getFoldLine(i)),n)var o=this.$getFoldLineTokens(i,n);else var o=this.session.getTokens(i);var l=e;if(o.length){var g=this.session.getRowSplitData(i);if(g&&g.length){this.$renderWrappedLine(e,o,g);var l=e.lastChild}else{var l=e;this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l)),this.$renderSimpleLine(l,o)}}else this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l));if(this.showEOL&&l){n&&(i=n.end.row);var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_eol",v.textContent=i==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,l.appendChild(v)}},this.$getFoldLineTokens=function(e,i){function n(v,$,y){for(var p=0,r=0;r+v[p].value.length<$;)if(r+=v[p].value.length,p++,p==v.length)return;if(r!=$){var h=v[p].value.substring($-r);h.length>y-$&&(h=h.substring(0,y-$)),l.push({type:v[p].type,value:h}),r=$+h.length,p+=1}for(;r<y&&p<v.length;){var h=v[p].value;h.length+r>y?l.push({type:v[p].type,value:h.substring(0,y-r)}):l.push(v[p]),r+=h.length,p+=1}}var o=this.session,l=[],g=o.getTokens(e);return i.walk(function(v,$,y,p,r){v!=null?l.push({type:"fold",value:v}):(r&&(g=o.getTokens($)),g.length&&n(g,p,y))},i.end.row,this.session.getLine(i.end.row).length),l},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(t.prototype),k.Text=t}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(L,k,N){var S=L("../lib/dom"),x=function(d){this.element=S.createElement("div"),this.element.className="ace_layer ace_cursor-layer",d.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),S.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(d){for(var c=this.cursors,a=c.length;a--;)S.setStyle(c[a].style,"opacity",d?"":"0")},this.$startCssAnimation=function(){for(var d=this.cursors,c=d.length;c--;)d[c].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){S.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){S.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(d){this.$padding=d},this.setSession=function(d){this.session=d},this.setBlinking=function(d){d!=this.isBlinking&&(this.isBlinking=d,this.restartTimer())},this.setBlinkInterval=function(d){d!=this.blinkInterval&&(this.blinkInterval=d,this.restartTimer())},this.setSmoothBlinking=function(d){d!=this.smoothBlinking&&(this.smoothBlinking=d,S.setCssClass(this.element,"ace_smooth-blinking",d),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var d=S.createElement("div");return d.className="ace_cursor",this.element.appendChild(d),this.cursors.push(d),d},this.removeCursor=function(){if(this.cursors.length>1){var d=this.cursors.pop();return d.parentNode.removeChild(d),d}},this.hideCursor=function(){this.isVisible=!1,S.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,S.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var d=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&S.removeCssClass(this.element,"ace_smooth-blinking"),d(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&setTimeout((function(){S.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),S.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=(function(){this.timeoutId=setTimeout(function(){d(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){d(!0),c()},this.blinkInterval),c()}},this.getPixelPosition=function(d,c){if(!this.config||!this.session)return{left:0,top:0};d||(d=this.session.selection.getCursor());var a=this.session.documentToScreenPosition(d),t=this.$padding+(this.session.$bidiHandler.isBidiRow(a.row,d.row)?this.session.$bidiHandler.getPosLeft(a.column):a.column*this.config.characterWidth),e=(a.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:t,top:e}},this.isCursorInView=function(d,c){return d.top>=0&&d.top<c.maxHeight},this.update=function(d){this.config=d;var c=this.session.$selectionMarkers,a=0,t=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var a=0,e=c.length;a<e;a++){var i=this.getPixelPosition(c[a].cursor,!0);if(!((i.top>d.height+d.offset||i.top<0)&&a>1)){var n=this.cursors[t++]||this.addCursor(),o=n.style;this.drawCursor?this.drawCursor(n,i,d,c[a],this.session):this.isCursorInView(i,d)?(S.setStyle(o,"display","block"),S.translate(n,i.left,i.top),S.setStyle(o,"width",Math.round(d.characterWidth)+"px"),S.setStyle(o,"height",d.lineHeight+"px")):S.setStyle(o,"display","none")}}for(;this.cursors.length>t;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=i,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(d){d!=this.overwrite&&(this.overwrite=d,d?S.addCssClass(this.element,"ace_overwrite-cursors"):S.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(x.prototype),k.Cursor=x}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/dom"),d=L("./lib/event"),c=L("./lib/event_emitter").EventEmitter,a=32768,t=function(n){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),n.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,d.addListener(this.element,"scroll",this.onScroll.bind(this)),d.addListener(this.element,"mousedown",d.preventDefault)};(function(){S.implement(this,c),this.setVisible=function(n){this.element.style.display=n?"":"none",this.isVisible=n,this.coeff=1}}).call(t.prototype);var e=function(n,o){t.call(this,n),this.scrollTop=0,this.scrollHeight=0,o.$scrollbarWidth=this.width=x.scrollbarWidth(n.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};S.inherits(e,t),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var n=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-n)/(this.coeff-n)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(n){this.element.style.height=n+"px"},this.setInnerHeight=this.setScrollHeight=function(n){this.scrollHeight=n,n>a?(this.coeff=a/n,n=a):this.coeff!=1&&(this.coeff=1),this.inner.style.height=n+"px"},this.setScrollTop=function(n){this.scrollTop!=n&&(this.skipEvent=!0,this.scrollTop=n,this.element.scrollTop=n*this.coeff)}}).call(e.prototype);var i=function(n,o){t.call(this,n),this.scrollLeft=0,this.height=o.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};S.inherits(i,t),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(n){this.element.style.width=n+"px"},this.setInnerWidth=function(n){this.inner.style.width=n+"px"},this.setScrollWidth=function(n){this.inner.style.width=n+"px"},this.setScrollLeft=function(n){this.scrollLeft!=n&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=n)}}).call(i.prototype),k.ScrollBar=e,k.ScrollBarV=e,k.ScrollBarH=i,k.VScrollBar=e,k.HScrollBar=i}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(L,k,N){var S=L("./lib/event"),x=function(d,c){this.onRender=d,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var a=this;this._flush=function(t){a.pending=!1;var e=a.changes;if(e&&(S.blockIdle(100),a.changes=0,a.onRender(e)),a.changes){if(a.$recursionLimit--<0)return;a.schedule()}else a.$recursionLimit=2}};(function(){this.schedule=function(d){this.changes=this.changes|d,this.changes&&!this.pending&&(S.nextFrame(this._flush),this.pending=!0)},this.clear=function(d){var c=this.changes;return this.changes=0,c}}).call(x.prototype),k.RenderLoop=x}),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(L,k,N){var S=L("../lib/oop"),x=L("../lib/dom"),d=L("../lib/lang"),c=L("../lib/event"),a=L("../lib/useragent"),t=L("../lib/event_emitter").EventEmitter,e=256,i=typeof ResizeObserver=="function",n=200,o=k.FontMetrics=function(l){this.el=x.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=x.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=x.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),l.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",e),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges()};(function(){S.implement(this,t),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(l,g){l.width=l.height="auto",l.left=l.top="0px",l.visibility="hidden",l.position="absolute",l.whiteSpace="pre",a.isIE<8?l["font-family"]="inherit":l.font="inherit",l.overflow=g?"hidden":"visible"},this.checkForSizeChanges=function(l){if(l===void 0&&(l=this.$measureSizes()),l&&(this.$characterSize.width!==l.width||this.$characterSize.height!==l.height)){this.$measureNode.style.fontWeight="bold";var g=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=l,this.charSizes=Object.create(null),this.allowBoldFonts=g&&g.width===l.width&&g.height===l.height,this._emit("changeCharacterSize",{data:l})}},this.$addObserver=function(){var l=this;this.$observer=new window.ResizeObserver(function(g){l.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var l=this;return this.$pollSizeChangesTimer=c.onIdle(function g(){l.checkForSizeChanges(),c.onIdle(g,500)},500)},this.setPolling=function(l){l?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(l){var g={height:(l||this.$measureNode).clientHeight,width:(l||this.$measureNode).clientWidth/e};return g.width===0||g.height===0?null:g},this.$measureCharWidth=function(l){this.$main.textContent=d.stringRepeat(l,e);var g=this.$main.getBoundingClientRect();return g.width/e},this.getCharacterWidth=function(l){var g=this.charSizes[l];return g===void 0&&(g=this.charSizes[l]=this.$measureCharWidth(l)/this.$characterSize.width),g},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function l(g){return!g||!g.parentElement?1:(window.getComputedStyle(g).zoom||1)*l(g.parentElement)},this.$initTransformMeasureNodes=function(){var l=function(g,v){return["div",{style:"position: absolute;top:"+g+"px;left:"+v+"px;"}]};this.els=x.buildDom([l(0,0),l(n,0),l(0,n),l(n,n)],this.el)},this.transformCoordinates=function(l,g){function v(_,M,O){var D=_[1]*M[0]-_[0]*M[1];return[(-M[1]*O[0]+M[0]*O[1])/D,(+_[1]*O[0]-_[0]*O[1])/D]}function $(_,M){return[_[0]-M[0],_[1]-M[1]]}function y(_,M){return[_[0]+M[0],_[1]+M[1]]}function p(_,M){return[_*M[0],_*M[1]]}function r(_){var M=_.getBoundingClientRect();return[M.left,M.top]}if(l){var h=this.$getZoom(this.el);l=p(1/h,l)}this.els||this.$initTransformMeasureNodes();var w=r(this.els[0]),u=r(this.els[1]),f=r(this.els[2]),s=r(this.els[3]),m=v($(s,u),$(s,f),$(y(u,f),y(s,w))),b=p(1+m[0],$(u,w)),C=p(1+m[1],$(f,w));if(g){var A=g,R=m[0]*A[0]/n+m[1]*A[1]/n+1,E=y(p(A[0],b),p(A[1],C));return y(p(1/R/n,E),w)}var I=$(l,w),T=v($(b,p(m[0],I)),$(C,p(m[1],I)),I);return p(n,T)}}).call(o.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/dom"),d=L("./config"),c=L("./layer/gutter").Gutter,a=L("./layer/marker").Marker,t=L("./layer/text").Text,e=L("./layer/cursor").Cursor,i=L("./scrollbar").HScrollBar,n=L("./scrollbar").VScrollBar,o=L("./renderloop").RenderLoop,l=L("./layer/font_metrics").FontMetrics,g=L("./lib/event_emitter").EventEmitter,v='.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\', 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_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_selecting, .ace_selecting * {cursor: text !important;}.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 {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.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 {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-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.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;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;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;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;will-change: transform;}.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;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: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));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_folding-enabled > .ace_gutter-cell {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);}.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;}',$=L("./lib/useragent"),y=$.isIE;x.importCssString(v,"ace_editor.css?v=1775629002");var p=function(r,h){var w=this;this.container=r||x.createElement("div"),x.addCssClass(this.container,"ace_editor"),x.HI_DPI&&x.addCssClass(this.container,"ace_hidpi"),this.setTheme(h),this.$gutter=x.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=x.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=x.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new c(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var u=this.$textLayer=new t(this.content);this.canvas=u.element,this.$markerFront=new a(this.content),this.$cursorLayer=new e(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new n(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollTop(f.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollLeft(f.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new l(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(f){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",f)}),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=!$.isIOS,this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),d.resetOptions(this),d._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,S.implement(this,g),this.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(),x.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(r){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=r,r&&this.scrollMargin.top&&r.getScrollTop()<=0&&r.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(r),this.$markerBack.setSession(r),this.$markerFront.setSession(r),this.$gutterLayer.setSession(r),this.$textLayer.setSession(r),r&&(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))},this.updateLines=function(r,h,w){if(h===void 0&&(h=1/0),this.$changedLines?(this.$changedLines.firstRow>r&&(this.$changedLines.firstRow=r),this.$changedLines.lastRow<h&&(this.$changedLines.lastRow=h)):this.$changedLines={firstRow:r,lastRow:h},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!w)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(r){r?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(r,h,w,u){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=r?1:0;var f=this.container;u||(u=f.clientHeight||f.scrollHeight),w||(w=f.clientWidth||f.scrollWidth);var s=this.$updateCachedSize(r,h,w,u);if(!this.$size.scrollerHeight||!w&&!u)return this.resizing=0;r&&(this.$gutterLayer.$padding=null),r?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(r,h,w,u){u-=this.$extraHeight||0;var f=0,s=this.$size,m={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(u&&(r||s.height!=u)&&(s.height=u,f|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",f|=this.CHANGE_SCROLL),w&&(r||s.width!=w)){f|=this.CHANGE_SIZE,s.width=w,h==null&&(h=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=h,x.setStyle(this.scrollBarH.element.style,"left",h+"px"),x.setStyle(this.scroller.style,"left",h+this.margin.left+"px"),s.scrollerWidth=Math.max(0,w-h-this.scrollBarV.getWidth()-this.margin.h),x.setStyle(this.$gutter.style,"left",this.margin.left+"px");var b=this.scrollBarV.getWidth()+"px";x.setStyle(this.scrollBarH.element.style,"right",b),x.setStyle(this.scroller.style,"right",b),x.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||r)&&(f|=this.CHANGE_FULL)}return s.$dirty=!w||!u,f&&this._signal("resize",m),f},this.onGutterResize=function(r){var h=this.$showGutter?r:0;h!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,h,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()},this.adjustWrapLimit=function(){var r=this.$size.scrollerWidth-this.$padding*2,h=Math.floor(r/this.characterWidth);return this.session.adjustWrapLimit(h,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(r){this.setOption("animatedScroll",r)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(r){this.setOption("showInvisibles",r),this.session.$bidiHandler.setShowInvisibles(r)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(r){this.setOption("displayIndentGuides",r)},this.setShowPrintMargin=function(r){this.setOption("showPrintMargin",r)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(r){this.setOption("printMarginColumn",r)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(r){return this.setOption("showGutter",r)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(r){this.setOption("fadeFoldWidgets",r)},this.setHighlightGutterLine=function(r){this.setOption("highlightGutterLine",r)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var r=x.createElement("div");r.className="ace_layer ace_print-margin-layer",this.$printMarginEl=x.createElement("div"),this.$printMarginEl.className="ace_print-margin",r.appendChild(this.$printMarginEl),this.content.insertBefore(r,this.content.firstChild)}var h=this.$printMarginEl.style;h.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",h.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var r=this.textarea.style,h=this.$composition;if(!this.$keepTextAreaAtCursor&&!h){x.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){h&&h.markerRange&&(w=this.$cursorLayer.getPixelPosition(h.markerRange.start,!0));var u=this.layerConfig,f=w.top,s=w.left;f-=u.offset;var m=h&&h.useTextareaForIME?this.lineHeight:y?0:1;if(f<0||f>u.height-m){x.translate(this.textarea,0,0);return}var b=1,C=this.$size.height-m;if(!h)f+=this.lineHeight;else if(h.useTextareaForIME){var A=this.textarea.value;b=this.characterWidth*this.session.$getStringScreenWidth(A)[0]}else f+=this.lineHeight+2;s-=this.scrollLeft,s>this.$size.scrollerWidth-b&&(s=this.$size.scrollerWidth-b),s+=this.gutterWidth+this.margin.left,x.setStyle(r,"height",m+"px"),x.setStyle(r,"width",b+"px"),x.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-b),Math.min(f,C))}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var r=this.layerConfig,h=r.lastRow,w=this.session.documentToScreenRow(h,0)*r.lineHeight;return w-this.session.getScrollTop()>r.height-r.lineHeight?h-1:h},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(r){this.$padding=r,this.$textLayer.setPadding(r),this.$cursorLayer.setPadding(r),this.$markerFront.setPadding(r),this.$markerBack.setPadding(r),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(r,h,w,u){var f=this.scrollMargin;f.top=r|0,f.bottom=h|0,f.right=u|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,f.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-f.top),this.updateFull()},this.setMargin=function(r,h,w,u){var f=this.margin;f.top=r|0,f.bottom=h|0,f.right=u|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(r){this.setOption("hScrollBarAlwaysVisible",r)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(r){this.setOption("vScrollBarAlwaysVisible",r)},this.$updateScrollBarV=function(){var r=this.layerConfig.maxHeight,h=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(r-=(h-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>r-h&&(r=this.scrollTop+h,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(r+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(r,h){if(this.$changes&&(r|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!r&&!h){this.$changes|=r;return}if(this.$size.$dirty)return this.$changes|=r,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",r),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(r&this.CHANGE_FULL||r&this.CHANGE_SIZE||r&this.CHANGE_TEXT||r&this.CHANGE_LINES||r&this.CHANGE_SCROLL||r&this.CHANGE_H_SCROLL){if(r|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var u=this.scrollTop+(w.firstRow-this.layerConfig.firstRow)*this.lineHeight;u>0&&(this.scrollTop=u,r|=this.CHANGE_SCROLL,r|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),r&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),x.translate(this.content,-this.scrollLeft,-w.offset);var f=w.width+2*this.$padding+"px",s=w.minHeight+"px";x.setStyle(this.content.style,"width",f),x.setStyle(this.content.style,"height",s)}if(r&this.CHANGE_H_SCROLL&&(x.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),r&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",r);return}if(r&this.CHANGE_SCROLL){this.$changedLines=null,r&this.CHANGE_TEXT||r&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(r&this.CHANGE_GUTTER||r&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",r);return}r&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w)):r&this.CHANGE_LINES?(this.$updateLines()||r&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w):r&this.CHANGE_TEXT||r&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(w):r&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),r&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),r&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),r&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",r)},this.$autosize=function(){var r=this.session.getScreenLength()*this.lineHeight,h=this.$maxLines*this.lineHeight,w=Math.min(h,Math.max((this.$minLines||1)*this.lineHeight,r))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var u=w<=2*this.lineHeight,f=!u&&r>h;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||f!=this.$vScroll){f!=this.$vScroll&&(this.$vScroll=f,this.scrollBarV.setVisible(f));var s=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,w),this.desiredHeight=w,this._signal("autosize")}},this.$computeLayerConfig=function(){var r=this.session,h=this.$size,w=h.height<=2*this.lineHeight,u=this.session.getScreenLength(),f=u*this.lineHeight,s=this.$getLongestLine(),m=!w&&(this.$hScrollBarAlwaysVisible||h.scrollerWidth-s-2*this.$padding<0),b=this.$horizScroll!==m;b&&(this.$horizScroll=m,this.scrollBarH.setVisible(m));var C=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var A=h.scrollerHeight+this.lineHeight,R=!this.$maxLines&&this.$scrollPastEnd?(h.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;f+=R;var E=this.scrollMargin;this.session.setScrollTop(Math.max(-E.top,Math.min(this.scrollTop,f-h.scrollerHeight+E.bottom))),this.session.setScrollLeft(Math.max(-E.left,Math.min(this.scrollLeft,s+2*this.$padding-h.scrollerWidth+E.right)));var I=!w&&(this.$vScrollBarAlwaysVisible||h.scrollerHeight-f+R<0||this.scrollTop>E.top),T=C!==I;T&&(this.$vScroll=I,this.scrollBarV.setVisible(I));var _=this.scrollTop%this.lineHeight,M=Math.ceil(A/this.lineHeight)-1,O=Math.max(0,Math.round((this.scrollTop-_)/this.lineHeight)),D=O+M,F,W,B=this.lineHeight;O=r.screenToDocumentRow(O,0);var P=r.getFoldLine(O);P&&(O=P.start.row),F=r.documentToScreenRow(O,0),W=r.getRowLength(O)*B,D=Math.min(r.screenToDocumentRow(D,0),r.getLength()-1),A=h.scrollerHeight+r.getRowLength(D)*B+W,_=this.scrollTop-F*B;var z=0;return(this.layerConfig.width!=s||b)&&(z=this.CHANGE_H_SCROLL),(b||T)&&(z|=this.$updateCachedSize(!0,this.gutterWidth,h.width,h.height),this._signal("scrollbarVisibilityChanged"),T&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:O,firstRowScreen:F,lastRow:D,lineHeight:B,characterWidth:this.characterWidth,minHeight:A,maxHeight:f,offset:_,gutterOffset:B?Math.max(0,Math.ceil((_+h.height-h.scrollerHeight)/B)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),z},this.$updateLines=function(){if(this.$changedLines){var r=this.$changedLines.firstRow,h=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(r>w.lastRow+1)&&!(h<w.firstRow)){if(h===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,r,h),!0}}},this.$getLongestLine=function(){var r=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(r+=1),this.$textLayer&&r>this.$textLayer.MAX_LINE_LENGTH&&(r=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(r*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(r,h){this.$gutterLayer.addGutterDecoration(r,h)},this.removeGutterDecoration=function(r,h){this.$gutterLayer.removeGutterDecoration(r,h)},this.updateBreakpoints=function(r){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(r){this.$gutterLayer.setAnnotations(r),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(r,h,w){this.scrollCursorIntoView(r,w),this.scrollCursorIntoView(h,w)},this.scrollCursorIntoView=function(r,h,w){if(this.$size.scrollerHeight!==0){var u=this.$cursorLayer.getPixelPosition(r),f=u.left,s=u.top,m=w&&w.top||0,b=w&&w.bottom||0,C=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;C+m>s?(h&&C+m>s+this.lineHeight&&(s-=h*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):C+this.$size.scrollerHeight-b<s+this.lineHeight&&(h&&C+this.$size.scrollerHeight-b<s-this.lineHeight&&(s+=h*this.$size.scrollerHeight),this.session.setScrollTop(s+this.lineHeight+b-this.$size.scrollerHeight));var A=this.scrollLeft;A>f?(f<this.$padding+2*this.layerConfig.characterWidth&&(f=-this.scrollMargin.left),this.session.setScrollLeft(f)):A+this.$size.scrollerWidth<f+this.characterWidth?this.session.setScrollLeft(Math.round(f+this.characterWidth-this.$size.scrollerWidth)):A<=this.$padding&&f-A<this.characterWidth&&this.session.setScrollLeft(0)}},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(r){this.session.setScrollTop(r*this.lineHeight)},this.alignCursor=function(r,h){typeof r=="number"&&(r={row:r,column:0});var w=this.$cursorLayer.getPixelPosition(r),u=this.$size.scrollerHeight-this.lineHeight,f=w.top-u*(h||0);return this.session.setScrollTop(f),f},this.STEPS=8,this.$calcSteps=function(r,h){var w=0,u=this.STEPS,f=[],s=function(m,b,C){return C*(Math.pow(m-1,3)+1)+b};for(w=0;w<u;++w)f.push(s(w/this.STEPS,r,h-r));return f},this.scrollToLine=function(r,h,w,u){var f=this.$cursorLayer.getPixelPosition({row:r,column:0}),s=f.top;h&&(s-=this.$size.scrollerHeight/2);var m=this.scrollTop;this.session.setScrollTop(s),w!==!1&&this.animateScrolling(m,u)},this.animateScrolling=function(r,h){var w=this.scrollTop;if(this.$animatedScroll){var u=this;if(r!=w){if(this.$scrollAnimation){var f=this.$scrollAnimation.steps;if(f.length&&(r=f[0],r==w))return}var s=u.$calcSteps(r,w);this.$scrollAnimation={from:r,to:w,steps:s},clearInterval(this.$timer),u.session.setScrollTop(s.shift()),u.session.$scrollTop=w,this.$timer=setInterval(function(){if(!u.session)return clearInterval(u.$timer);s.length?(u.session.setScrollTop(s.shift()),u.session.$scrollTop=w):w!=null?(u.session.$scrollTop=-1,u.session.setScrollTop(w),w=null):(u.$timer=clearInterval(u.$timer),u.$scrollAnimation=null,h&&h())},10)}}},this.scrollToY=function(r){this.scrollTop!==r&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=r)},this.scrollToX=function(r){this.scrollLeft!==r&&(this.scrollLeft=r),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(r,h){this.session.setScrollTop(h),this.session.setScrollLeft(h)},this.scrollBy=function(r,h){h&&this.session.setScrollTop(this.session.getScrollTop()+h),r&&this.session.setScrollLeft(this.session.getScrollLeft()+r)},this.isScrollableBy=function(r,h){if(h<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||h>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||r<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||r>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(r,h){var w;if(this.$hasCssTransforms){w={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([r,h]);r=u[1]-this.gutterWidth-this.margin.left,h=u[0]}else w=this.scroller.getBoundingClientRect();var f=r+this.scrollLeft-w.left-this.$padding,s=f/this.characterWidth,m=Math.floor((h+this.scrollTop-w.top)/this.lineHeight),b=this.$blockCursor?Math.floor(s):Math.round(s);return{row:m,column:b,side:s-b>0?1:-1,offsetX:f}},this.screenToTextCoordinates=function(r,h){var w;if(this.$hasCssTransforms){w={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([r,h]);r=u[1]-this.gutterWidth-this.margin.left,h=u[0]}else w=this.scroller.getBoundingClientRect();var f=r+this.scrollLeft-w.left-this.$padding,s=f/this.characterWidth,m=this.$blockCursor?Math.floor(s):Math.round(s),b=Math.floor((h+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(b,Math.max(m,0),f)},this.textToScreenCoordinates=function(r,h){var w=this.scroller.getBoundingClientRect(),u=this.session.documentToScreenPosition(r,h),f=this.$padding+(this.session.$bidiHandler.isBidiRow(u.row,r)?this.session.$bidiHandler.getPosLeft(u.column):Math.round(u.column*this.characterWidth)),s=u.row*this.lineHeight;return{pageX:w.left+f-this.scrollLeft,pageY:w.top+s-this.scrollTop}},this.visualizeFocus=function(){x.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){x.removeCssClass(this.container,"ace_focus")},this.showComposition=function(r){this.$composition=r,r.cssText||(r.cssText=this.textarea.style.cssText),r.useTextareaForIME==null&&(r.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(x.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):r.markerId=this.session.addMarker(r.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(r){var h=this.session.selection.cursor;this.addToken(r,"composition_placeholder",h.row,h.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),x.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var r=this.session.selection.cursor;this.removeExtraToken(r.row,r.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(r,h,w,u){var f=this.session;f.bgTokenizer.lines[w]=null;var s={type:h,value:r},m=f.getTokens(w);if(u==null)m.push(s);else for(var b=0,C=0;C<m.length;C++){var A=m[C];if(b+=A.value.length,u<=b){var R=A.value.length-(b-u),E=A.value.slice(0,R),I=A.value.slice(R);m.splice(C,1,{type:A.type,value:E},s,{type:A.type,value:I});break}}this.updateLines(w,w)},this.removeExtraToken=function(r,h){this.updateLines(r,r)},this.setTheme=function(r,h){function w(s){if(u.$themeId!=r)return h&&h();if(!s||!s.cssClass)throw new Error("couldn't load module "+r+" or it didn't call define");s.$id&&(u.$themeId=s.$id),x.importCssString(s.cssText,s.cssClass,u.container),u.theme&&x.removeCssClass(u.container,u.theme.cssClass);var m="padding"in s?s.padding:"padding"in(u.theme||{})?4:u.$padding;u.$padding&&m!=u.$padding&&u.setPadding(m),u.$theme=s.cssClass,u.theme=s,x.addCssClass(u.container,s.cssClass),x.setCssClass(u.container,"ace_dark",s.isDark),u.$size&&(u.$size.width=0,u.$updateSizeAsync()),u._dispatchEvent("themeLoaded",{theme:s}),h&&h()}var u=this;if(this.$themeId=r,u._dispatchEvent("themeChange",{theme:r}),!r||typeof r=="string"){var f=r||this.$options.theme.initialValue;d.loadModule(["theme",f],w)}else w(r)},this.getTheme=function(){return this.$themeId},this.setStyle=function(r,h){x.setCssClass(this.container,r,h!==!1)},this.unsetStyle=function(r){x.removeCssClass(this.container,r)},this.setCursorStyle=function(r){x.setStyle(this.scroller.style,"cursor",r)},this.setMouseCursor=function(r){x.setStyle(this.scroller.style,"cursor",r)},this.attachToShadowRoot=function(){x.importCssString(v,"ace_editor.css?v=1775629002",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""}}).call(p.prototype),d.defineOptions(p.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(r){this.$textLayer.setShowInvisibles(r)&&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(r){typeof r=="number"&&(this.$printMarginColumn=r),this.$showPrintMargin=!!r,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(r){this.$gutter.style.display=r?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(r){x.setCssClass(this.$gutter,"ace_fade-fold-widgets",r)},initialValue:!1},showFoldWidgets:{set:function(r){this.$gutterLayer.setShowFoldWidgets(r),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(r){this.$textLayer.setDisplayIndentGuides(r)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(r){this.$gutterLayer.setHighlightGutterLine(r),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(r){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(r){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(r){typeof r=="number"&&(r+="px"),this.container.style.fontSize=r,this.updateFontSize()},initialValue:12},fontFamily:{set:function(r){this.container.style.fontFamily=r,this.updateFontSize()}},maxLines:{set:function(r){this.updateFull()}},minLines:{set:function(r){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(r){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(r){r=+r||0,this.$scrollPastEnd!=r&&(this.$scrollPastEnd=r,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(r){this.$gutterLayer.$fixedWidth=!!r,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(r){this.setTheme(r)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!$.isMobile&&!$.isIE}}),k.VirtualRenderer=p}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(L,k,N){function S(n){var o="importScripts('"+c.qualifyURL(n)+"');";try{return new Blob([o],{type:"application/javascript"})}catch(v){var l=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,g=new l;return g.append(o),g.getBlob("application/javascript")}}function x(n){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(t.get("loadWorkerFromBlob")){var o=S(n),l=window.URL||window.webkitURL,g=l.createObjectURL(o);return new Worker(g)}return new Worker(n)}var d=L("../lib/oop"),c=L("../lib/net"),a=L("../lib/event_emitter").EventEmitter,t=L("../config"),e=function(n){n.postMessage||(n=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=n,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(){d.implement(this,a),this.$createWorkerFromOldConfig=function(n,o,l,g,v){if(L.nameToUrl&&!L.toUrl&&(L.toUrl=L.nameToUrl),t.get("packaged")||!L.toUrl)g=g||t.moduleUrl(o,"worker");else{var $=this.$normalizePath;g=g||$(L.toUrl("ace/worker/worker.js?v=1775629002",null,"_"));var y={};n.forEach(function(p){y[p]=$(L.toUrl(p,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=x(g),v&&this.send("importScripts",v),this.$worker.postMessage({init:!0,tlns:y,module:o,classname:l}),this.$worker},this.onMessage=function(n){var o=n.data;switch(o.type){case"event":this._signal(o.name,{data:o.data});break;case"call":var l=this.callbacks[o.id];l&&(l(o.data),delete this.callbacks[o.id]);break;case"error":this.reportError(o.data);break;case"log":window.console}},this.reportError=function(n){window.console},this.$normalizePath=function(n){return c.qualifyURL(n)},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(n,o){this.$worker.postMessage({command:n,args:o})},this.call=function(n,o,l){if(l){var g=this.callbackId++;this.callbacks[g]=l,o.push(g)}this.send(n,o)},this.emit=function(n,o){try{o.data&&o.data.err&&(o.data.err={message:o.data.err.message,stack:o.data.err.stack,code:o.data.err.code}),this.$worker.postMessage({event:n,data:{data:o.data}})}catch(l){}},this.attachToDocument=function(n){this.$doc&&this.terminate(),this.$doc=n,this.call("setValue",[n.getValue()]),n.on("change",this.changeListener)},this.changeListener=function(n){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),n.action=="insert"?this.deltaQueue.push(n.start,n.lines):this.deltaQueue.push(n.start,n.end)},this.$sendDeltaQueue=function(){var n=this.deltaQueue;n&&(this.deltaQueue=null,n.length>50&&n.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:n}))}}).call(e.prototype);var i=function(n,o,l){var g=null,v=!1,$=Object.create(a),y=[],p=new e({messageBuffer:y,terminate:function(){},postMessage:function(h){y.push(h),g&&(v?setTimeout(r):r())}});p.setEmitSync=function(h){v=h};var r=function(){var h=y.shift();h.command?g[h.command].apply(g,h.args):h.event&&$._signal(h.event,h.data)};return $.postMessage=function(h){p.onMessage({data:h})},$.callback=function(h,w){this.postMessage({type:"call",id:w,data:h})},$.emit=function(h,w){this.postMessage({type:"event",name:h,data:w})},t.loadModule(["worker",o],function(h){for(g=new h[l]($);y.length;)r()}),p};k.UIWorkerClient=i,k.WorkerClient=e,k.createWorker=x}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(L,k,N){var S=L("./range").Range,x=L("./lib/event_emitter").EventEmitter,d=L("./lib/oop"),c=function(a,t,e,i,n,o){var l=this;this.length=t,this.session=a,this.doc=a.getDocument(),this.mainClass=n,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){l.onCursorChange()})},this.$pos=e;var g=a.getUndoManager().$undoStack||a.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=g.length,this.setup(),a.selection.on("changeCursor",this.$onCursorChange)};(function(){d.implement(this,x),this.setup=function(){var a=this,t=this.doc,e=this.session;this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=e.addMarker(new S(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var o=t.createAnchor(n.row,n.column);o.$insertRight=!0,o.detach(),a.others.push(o)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var a=this.session,t=this;this.othersActive=!0,this.others.forEach(function(e){e.markerId=a.addMarker(new S(e.row,e.column,e.row,e.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var a=0;a<this.others.length;a++)this.session.removeMarker(this.others[a].markerId)}},this.onUpdate=function(a){if(this.$updating)return this.updateAnchors(a);var t=a;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var e=a.action==="insert"?t.end.column-t.start.column:t.start.column-t.end.column,i=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,n=t.start.column-this.pos.column;if(this.updateAnchors(a),i&&(this.length+=e),i&&!this.session.$fromUndo){if(a.action==="insert")for(var o=this.others.length-1;o>=0;o--){var l=this.others[o],g={row:l.row,column:l.column+n};this.doc.insertMergedLines(g,a.lines)}else if(a.action==="remove")for(var o=this.others.length-1;o>=0;o--){var l=this.others[o],g={row:l.row,column:l.column+n};this.doc.remove(new S(g.row,g.column,g.row,g.column-e))}}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(a){this.pos.onChange(a);for(var t=this.others.length;t--;)this.others[t].onChange(a);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var a=this,t=this.session,e=function(n,o){t.removeMarker(n.markerId),n.markerId=t.addMarker(new S(n.row,n.column,n.row,n.column+a.length),o,null,!1)};e(this.pos,this.mainClass);for(var i=this.others.length;i--;)e(this.others[i],this.othersClass)}},this.onCursorChange=function(a){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))}},this.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},this.cancel=function(){if(this.$undoStackDepth!==-1){for(var a=this.session.getUndoManager(),t=(a.$undoStack||a.$undostack).length-this.$undoStackDepth,e=0;e<t;e++)a.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}}}).call(c.prototype),k.PlaceHolder=c}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(L,k,N){function S(a,t){return a.row==t.row&&a.column==t.column}function x(a){var t=a.domEvent,e=t.altKey,i=t.shiftKey,n=t.ctrlKey,o=a.getAccelKey(),l=a.getButton();if(n&&c.isMac&&(l=t.button),a.editor.inMultiSelectMode&&l==2){a.editor.textInput.onContextMenu(a.domEvent);return}if(!n&&!e&&!o){l===0&&a.editor.inMultiSelectMode&&a.editor.exitMultiSelectMode();return}if(l===0){var g=a.editor,v=g.selection,$=g.inMultiSelectMode,y=a.getDocumentPosition(),p=v.getCursor(),r=a.inSelection()||v.isEmpty()&&S(y,p),h=a.x,w=a.y,u=function(O){h=O.clientX,w=O.clientY},f=g.session,s=g.renderer.pixelToScreenCoordinates(h,w),m=s,b;if(g.$mouseHandler.$enableJumpToDef)n&&e||o&&e?b=i?"block":"add":e&&g.$blockSelectEnabled&&(b="block");else if(o&&!e){if(b="add",!$&&i)return}else e&&g.$blockSelectEnabled&&(b="block");if(b&&c.isMac&&t.ctrlKey&&g.$mouseHandler.cancelContextMenu(),b=="add"){if(!$&&r)return;if(!$){var C=v.toOrientedRange();g.addSelectionMarker(C)}var A=v.rangeList.rangeAtPoint(y);g.inVirtualSelectionMode=!0,i&&(A=null,C=v.ranges[0]||C,g.removeSelectionMarker(C)),g.once("mouseup",function(){var O=v.toOrientedRange();A&&O.isEmpty()&&S(A.cursor,O.cursor)?v.substractPoint(O.cursor):(i?v.substractPoint(C.cursor):C&&(g.removeSelectionMarker(C),v.addRange(C)),v.addRange(O)),g.inVirtualSelectionMode=!1})}else if(b=="block"){a.stop(),g.inVirtualSelectionMode=!0;var R,E=[],I=function(){var O=g.renderer.pixelToScreenCoordinates(h,w),D=f.screenToDocumentPosition(O.row,O.column,O.offsetX);S(m,O)&&S(D,v.lead)||(m=O,g.selection.moveToPosition(D),g.renderer.scrollCursorIntoView(),g.removeSelectionMarkers(E),E=v.rectangularRangeBlock(m,s),g.$mouseHandler.$clickSelection&&E.length==1&&E[0].isEmpty()&&(E[0]=g.$mouseHandler.$clickSelection.clone()),E.forEach(g.addSelectionMarker,g),g.updateSelectionMarkers())};$&&!o?v.toSingleRange():!$&&o&&(R=v.toOrientedRange(),g.addSelectionMarker(R)),i?s=f.documentToScreenPosition(v.lead):v.moveToPosition(y),m={row:-1,column:-1};var T=function(O){I(),clearInterval(M),g.removeSelectionMarkers(E),E.length||(E=[v.toOrientedRange()]),R&&(g.removeSelectionMarker(R),v.toSingleRange(R));for(var D=0;D<E.length;D++)v.addRange(E[D]);g.inVirtualSelectionMode=!1,g.$mouseHandler.$clickSelection=null},_=I;d.capture(g.container,u,T);var M=setInterval(function(){_()},20);return a.preventDefault()}}}var d=L("../lib/event"),c=L("../lib/useragent");k.onMouseDown=x}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(L,k,N){k.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(x){x.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(x){x.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(x){x.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(x){x.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(x){x.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(x){x.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(x){x.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(x){x.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split into lines",exec:function(x){x.multiSelect.rangeCount>1?x.multiSelect.joinSelections():x.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(x){x.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(x){x.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(x){x.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],k.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(x){x.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(x){return x&&x.inMultiSelectMode}}];var S=L("../keyboard/hash_handler").HashHandler;k.keyboardHandler=new S(k.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(L,k,N){function S(p,r,h){return v.$options.wrap=!0,v.$options.needle=r,v.$options.backwards=h==-1,v.find(p)}function x(p,r){return p.row==r.row&&p.column==r.column}function d(p){p.$multiselectOnSessionChange||(p.$onAddRange=p.$onAddRange.bind(p),p.$onRemoveRange=p.$onRemoveRange.bind(p),p.$onMultiSelect=p.$onMultiSelect.bind(p),p.$onSingleSelect=p.$onSingleSelect.bind(p),p.$multiselectOnSessionChange=k.onSessionChange.bind(p),p.$checkMultiselectChange=p.$checkMultiselectChange.bind(p),p.$multiselectOnSessionChange(p),p.on("changeSession",p.$multiselectOnSessionChange),p.on("mousedown",i),p.commands.addCommands(l.defaultCommands),c(p))}function c(p){function r(u){w&&(p.renderer.setMouseCursor(""),w=!1)}if(p.textInput){var h=p.textInput.getElement(),w=!1;n.addListener(h,"keydown",function(u){var f=u.keyCode==18&&!(u.ctrlKey||u.shiftKey||u.metaKey);p.$blockSelectEnabled&&f?w||(p.renderer.setMouseCursor("crosshair"),w=!0):w&&r()},p),n.addListener(h,"keyup",r,p),n.addListener(h,"blur",r,p)}}var a=L("./range_list").RangeList,t=L("./range").Range,e=L("./selection").Selection,i=L("./mouse/multi_select_handler").onMouseDown,n=L("./lib/event"),o=L("./lib/lang"),l=L("./commands/multi_select_commands");k.commands=l.defaultCommands.concat(l.multiSelectCommands);var g=L("./search").Search,v=new g,$=L("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call($.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(p,r){if(p){if(!this.inMultiSelectMode&&this.rangeCount===0){var h=this.toOrientedRange();if(this.rangeList.add(h),this.rangeList.add(p),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),r||this.fromOrientedRange(p);this.rangeList.removeAll(),this.rangeList.add(h),this.$onAddRange(h)}p.cursor||(p.cursor=p.end);var w=this.rangeList.add(p);return this.$onAddRange(p),w.length&&this.$onRemoveRange(w),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),r||this.fromOrientedRange(p)}},this.toSingleRange=function(p){p=p||this.ranges[0];var r=this.rangeList.removeAll();r.length&&this.$onRemoveRange(r),p&&this.fromOrientedRange(p)},this.substractPoint=function(p){var r=this.rangeList.substractPoint(p);if(r)return this.$onRemoveRange(r),r[0]},this.mergeOverlappingRanges=function(){var p=this.rangeList.merge();p.length&&this.$onRemoveRange(p)},this.$onAddRange=function(p){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(p),this._signal("addRange",{range:p})},this.$onRemoveRange=function(p){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var r=this.rangeList.ranges.pop();p.push(r),this.rangeCount=0}for(var h=p.length;h--;){var w=this.ranges.indexOf(p[h]);this.ranges.splice(w,1)}this._signal("removeRange",{ranges:p}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),r=r||this.ranges[0],r&&!r.isEqual(this.getRange())&&this.fromOrientedRange(r)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var p=this.ranges.length?this.ranges:[this.getRange()],r=[],h=0;h<p.length;h++){var w=p[h],u=w.start.row,f=w.end.row;if(u===f)r.push(w.clone());else{for(r.push(new t(u,w.start.column,u,this.session.getLine(u).length));++u<f;)r.push(this.getLineRange(u,!0));r.push(new t(f,0,f,w.end.column))}h==0&&!this.isBackwards()&&(r=r.reverse())}this.toSingleRange();for(var h=r.length;h--;)this.addRange(r[h])},this.joinSelections=function(){var p=this.rangeList.ranges,r=p[p.length-1],h=t.fromPoints(p[0].start,r.end);this.toSingleRange(),this.setSelectionRange(h,r.cursor==r.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var p=this.rangeList.ranges,r=p[p.length-1],h=t.fromPoints(p[0].start,r.end);this.toSingleRange(),this.setSelectionRange(h,r.cursor==r.start)}else{var w=this.session.documentToScreenPosition(this.cursor),u=this.session.documentToScreenPosition(this.anchor),f=this.rectangularRangeBlock(w,u);f.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(p,r,h){var w=[],u=p.column<r.column;if(u)var f=p.column,s=r.column,m=p.offsetX,b=r.offsetX;else var f=r.column,s=p.column,m=r.offsetX,b=p.offsetX;var C=p.row<r.row;if(C)var A=p.row,R=r.row;else var A=r.row,R=p.row;f<0&&(f=0),A<0&&(A=0),A==R&&(h=!0);for(var E,I=A;I<=R;I++){var T=t.fromPoints(this.session.screenToDocumentPosition(I,f,m),this.session.screenToDocumentPosition(I,s,b));if(T.isEmpty()){if(E&&x(T.end,E))break;E=T.end}T.cursor=u?T.start:T.end,w.push(T)}if(C&&w.reverse(),!h){for(var _=w.length-1;w[_].isEmpty()&&_>0;)_--;if(_>0)for(var M=0;w[M].isEmpty();)M++;for(var O=_;O>=M;O--)w[O].isEmpty()&&w.splice(O,1)}return w}}).call(e.prototype);var y=L("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(p){p.cursor||(p.cursor=p.end);var r=this.getSelectionStyle();return p.marker=this.session.addMarker(p,"ace_selection",r),this.session.$selectionMarkers.push(p),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,p},this.removeSelectionMarker=function(p){if(p.marker){this.session.removeMarker(p.marker);var r=this.session.$selectionMarkers.indexOf(p);r!=-1&&this.session.$selectionMarkers.splice(r,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(p){for(var r=this.session.$selectionMarkers,h=p.length;h--;){var w=p[h];if(w.marker){this.session.removeMarker(w.marker);var u=r.indexOf(w);u!=-1&&r.splice(u,1)}}this.session.selectionMarkerCount=r.length},this.$onAddRange=function(p){this.addSelectionMarker(p.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(p){this.removeSelectionMarkers(p.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(p){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(l.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(p){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(l.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(p){var r=p.command,h=p.editor;if(h.multiSelect){if(r.multiSelectAction)r.multiSelectAction=="forEach"?w=h.forEachSelection(r,p.args):r.multiSelectAction=="forEachLine"?w=h.forEachSelection(r,p.args,!0):r.multiSelectAction=="single"?(h.exitMultiSelectMode(),w=r.exec(h,p.args||{})):w=r.multiSelectAction(h,p.args||{});else{var w=r.exec(h,p.args||{});h.multiSelect.addRange(h.multiSelect.toOrientedRange()),h.multiSelect.mergeOverlappingRanges()}return w}},this.forEachSelection=function(p,r,h){if(!this.inVirtualSelectionMode){var w=h&&h.keepOrder,u=h==1||h&&h.$byLines,f=this.session,s=this.selection,m=s.rangeList,b=(w?s:m).ranges,C;if(!b.length)return p.exec?p.exec(this,r||{}):p(this,r||{});var A=s._eventRegistry;s._eventRegistry={};var R=new e(f);this.inVirtualSelectionMode=!0;for(var E=b.length;E--;){if(u)for(;E>0&&b[E].start.row==b[E-1].end.row;)E--;R.fromOrientedRange(b[E]),R.index=E,this.selection=f.selection=R;var I=p.exec?p.exec(this,r||{}):p(this,r||{});!C&&I!==void 0&&(C=I),R.toOrientedRange(b[E])}R.detach(),this.selection=f.selection=s,this.inVirtualSelectionMode=!1,s._eventRegistry=A,s.mergeOverlappingRanges(),s.ranges[0]&&s.fromOrientedRange(s.ranges[0]);var T=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),T&&T.from==T.to&&this.renderer.animateScrolling(T.from),C}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var p="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var r=this.multiSelect.rangeList.ranges,h=[],w=0;w<r.length;w++)h.push(this.session.getTextRange(r[w]));var u=this.session.getDocument().getNewLineCharacter();p=h.join(u),p.length==(h.length-1)*u.length&&(p="")}else this.selection.isEmpty()||(p=this.session.getTextRange(this.getSelectionRange()));return p},this.$checkMultiselectChange=function(p,r){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var h=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&r==this.multiSelect.anchor)return;var w=r==this.multiSelect.anchor?h.cursor==h.start?h.end:h.start:h.cursor;w.row!=r.row||this.session.$clipPositionToDocument(w.row,w.column).column!=r.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(p,r,h){if(r=r||{},r.needle=p||r.needle,r.needle==null){var w=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();r.needle=this.session.getTextRange(w)}this.$search.set(r);var u=this.$search.findAll(this.session);if(!u.length)return 0;var f=this.multiSelect;h||f.toSingleRange(u[0]);for(var s=u.length;s--;)f.addRange(u[s],!0);return w&&f.rangeList.rangeAtPoint(w.start)&&f.addRange(w,!0),u.length},this.selectMoreLines=function(p,r){var h=this.selection.toOrientedRange(),w=h.cursor==h.end,u=this.session.documentToScreenPosition(h.cursor);this.selection.$desiredColumn&&(u.column=this.selection.$desiredColumn);var f=this.session.screenToDocumentPosition(u.row+p,u.column);if(h.isEmpty())var m=f;else var s=this.session.documentToScreenPosition(w?h.end:h.start),m=this.session.screenToDocumentPosition(s.row+p,s.column);if(w){var b=t.fromPoints(f,m);b.cursor=b.start}else{var b=t.fromPoints(m,f);b.cursor=b.end}if(b.desiredColumn=u.column,!this.selection.inMultiSelectMode)this.selection.addRange(h);else if(r)var C=h.cursor;this.selection.addRange(b),C&&this.selection.substractPoint(C)},this.transposeSelections=function(p){for(var r=this.session,h=r.multiSelect,w=h.ranges,u=w.length;u--;){var f=w[u];if(f.isEmpty()){var s=r.getWordRange(f.start.row,f.start.column);f.start.row=s.start.row,f.start.column=s.start.column,f.end.row=s.end.row,f.end.column=s.end.column}}h.mergeOverlappingRanges();for(var m=[],u=w.length;u--;){var f=w[u];m.unshift(r.getTextRange(f))}p<0?m.unshift(m.pop()):m.push(m.shift());for(var u=w.length;u--;){var f=w[u],s=f.clone();r.replace(f,m[u]),f.start.row=s.start.row,f.start.column=s.start.column}h.fromOrientedRange(h.ranges[0])},this.selectMore=function(p,r,h){var w=this.session,u=w.multiSelect,f=u.toOrientedRange();if(!(f.isEmpty()&&(f=w.getWordRange(f.start.row,f.start.column),f.cursor=p==-1?f.start:f.end,this.multiSelect.addRange(f),h))){var s=w.getTextRange(f),m=S(w,s,p);m&&(m.cursor=p==-1?m.start:m.end,this.session.unfold(m),this.multiSelect.addRange(m),this.renderer.scrollCursorIntoView(null,.5)),r&&this.multiSelect.substractPoint(f.cursor)}},this.alignCursors=function(){var p=this.session,r=p.multiSelect,h=r.ranges,w=-1,u=h.filter(function(_){if(_.cursor.row==w)return!0;w=_.cursor.row});if(!h.length||u.length==h.length-1){var f=this.selection.getRange(),s=f.start.row,m=f.end.row,b=s==m;if(b){var C=this.session.getLength(),A;do A=this.session.getLine(m);while(/[=:]/.test(A)&&++m<C);do A=this.session.getLine(s);while(/[=:]/.test(A)&&--s>0);s<0&&(s=0),m>=C&&(m=C-1)}var R=this.session.removeFullLines(s,m);R=this.$reAlignText(R,b),this.session.insert({row:s,column:0},R.join("\n")+"\n"),b||(f.start.column=0,f.end.column=R[R.length-1].length),this.selection.setRange(f)}else{u.forEach(function(_){r.substractPoint(_.cursor)});var E=0,I=1/0,T=h.map(function(_){var M=_.cursor,O=p.getLine(M.row),D=O.substr(M.column).search(/\S/g);return D==-1&&(D=0),M.column>E&&(E=M.column),D<I&&(I=D),D});h.forEach(function(_,M){var O=_.cursor,D=E-O.column,F=T[M]-I;D>F?p.insert(O,o.stringRepeat(" ",D-F)):p.remove(new t(O.row,O.column,O.row,O.column-D+F)),_.start.column=_.end.column=E,_.start.row=_.end.row=O.row,_.cursor=_.end}),r.fromOrientedRange(h[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(p,r){function h(R){return o.stringRepeat(" ",R)}function w(R){return R[2]?h(b)+R[2]+h(C-R[2].length+A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}function u(R){return R[2]?h(b+C-R[2].length)+R[2]+h(A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}function f(R){return R[2]?h(b)+R[2]+h(A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}var s=!0,m=!0,b,C,A;return p.map(function(R){var E=R.match(/(\s*)(.*?)(\s*)([=:].*)/);return E?b==null?(b=E[1].length,C=E[2].length,A=E[3].length,E):(b+C+A!=E[1].length+E[2].length+E[3].length&&(m=!1),b!=E[1].length&&(s=!1),b>E[1].length&&(b=E[1].length),C<E[2].length&&(C=E[2].length),A>E[3].length&&(A=E[3].length),E):[R]}).map(r?w:s?m?u:w:f)}}).call(y.prototype),k.onSessionChange=function(p){var r=p.session;r&&!r.multiSelect&&(r.$selectionMarkers=[],r.selection.$initRangeList(),r.multiSelect=r.selection),this.multiSelect=r&&r.multiSelect;var h=p.oldSession;h&&(h.multiSelect.off("addRange",this.$onAddRange),h.multiSelect.off("removeRange",this.$onRemoveRange),h.multiSelect.off("multiSelect",this.$onMultiSelect),h.multiSelect.off("singleSelect",this.$onSingleSelect),h.multiSelect.lead.off("change",this.$checkMultiselectChange),h.multiSelect.anchor.off("change",this.$checkMultiselectChange)),r&&(r.multiSelect.on("addRange",this.$onAddRange),r.multiSelect.on("removeRange",this.$onRemoveRange),r.multiSelect.on("multiSelect",this.$onMultiSelect),r.multiSelect.on("singleSelect",this.$onSingleSelect),r.multiSelect.lead.on("change",this.$checkMultiselectChange),r.multiSelect.anchor.on("change",this.$checkMultiselectChange)),r&&this.inMultiSelectMode!=r.selection.inMultiSelectMode&&(r.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},k.MultiSelect=d,L("./config").defineOptions(y.prototype,"editor",{enableMultiselect:{set:function(p){d(this),p?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",i)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",i))},value:!0},enableBlockSelect:{set:function(p){this.$blockSelectEnabled=p},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(L,k,N){var S=L("../../range").Range,x=k.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,c,a){var t=d.getLine(a);return this.foldingStartMarker.test(t)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(t)?"end":""},this.getFoldWidgetRange=function(d,c,a){return null},this.indentationBlock=function(d,c,a){var t=/\S/,e=d.getLine(c),i=e.search(t);if(i!=-1){for(var n=a||e.length,o=d.getLength(),l=c,g=c;++c<o;){var v=d.getLine(c).search(t);if(v!=-1){if(v<=i){var $=d.getTokenAt(c,0);if(!$||$.type!=="string")break}g=c}}if(g>l){var y=d.getLine(g).length;return new S(l,n,g,y)}}},this.openingBracketBlock=function(d,c,a,t,e){var i={row:a,column:t+1},n=d.$findClosingBracket(c,i,e);if(n){var o=d.foldWidgets[n.row];return o==null&&(o=d.getFoldWidget(n.row)),o=="start"&&n.row>i.row&&(n.row--,n.column=d.getLine(n.row).length),S.fromPoints(i,n)}},this.closingBracketBlock=function(d,c,a,t,e){var i={row:a,column:t},n=d.$findOpeningBracket(c,i);if(n)return n.column++,i.column--,S.fromPoints(n,i)}}).call(x.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(L,k,N){k.isDark=!1,k.cssClass="ace-tm",k.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',k.$id="ace/theme/textmate";var S=L("../lib/dom");S.importCssString(k.cssText,k.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(L,k,N){function S(d){this.session=d,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var x=L("./lib/dom");(function(){this.getRowLength=function(d){var c;return this.lineWidgets?c=this.lineWidgets[d]&&this.lineWidgets[d].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[d]?1+c:this.$wrapData[d].length+1+c},this.$getWidgetScreenLength=function(){var d=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(d+=c.rowCount)}),d},this.$onChangeEditor=function(d){this.attach(d.editor)},this.attach=function(d){d&&d.widgetManager&&d.widgetManager!=this&&d.widgetManager.detach(),this.editor!=d&&(this.detach(),this.editor=d,d&&(d.widgetManager=this,d.renderer.on("beforeRender",this.measureWidgets),d.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(d){var c=this.editor;if(c){this.editor=null,c.widgetManager=null,c.renderer.off("beforeRender",this.measureWidgets),c.renderer.off("afterRender",this.renderWidgets);var a=this.session.lineWidgets;a&&a.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(d,c){var a=c.lineWidgets;if(!(!a||!d.action)){for(var t=d.data,e=t.start.row,i=t.end.row,n=d.action=="add",o=e+1;o<i;o++)a[o]&&(a[o].hidden=n);a[i]&&(n?a[e]?a[i].hidden=n:a[e]=a[i]:(a[e]==a[i]&&(a[e]=void 0),a[i].hidden=n))}},this.updateOnChange=function(d){var c=this.session.lineWidgets;if(c){var a=d.start.row,t=d.end.row-a;if(t!==0)if(d.action=="remove"){var e=c.splice(a+1,t);!c[a]&&e[e.length-1]&&(c[a]=e.pop()),e.forEach(function(n){n&&this.removeLineWidget(n)},this),this.$updateRows()}else{var i=new Array(t);c[a]&&c[a].column!=null&&d.start.column>c[a].column&&a++,i.unshift(a,0),c.splice.apply(c,i),this.$updateRows()}}},this.$updateRows=function(){var d=this.session.lineWidgets;if(d){var c=!0;d.forEach(function(a,t){if(a)for(c=!1,a.row=t;a.$oldWidget;)a.$oldWidget.row=t,a=a.$oldWidget}),c&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(d){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[d.row];return c&&(d.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[d.row]=d,d},this.addLineWidget=function(d){if(this.$registerLineWidget(d),d.session=this.session,!this.editor)return d;var c=this.editor.renderer;d.html&&!d.el&&(d.el=x.createElement("div"),d.el.innerHTML=d.html),d.el&&(x.addCssClass(d.el,"ace_lineWidgetContainer"),d.el.style.position="absolute",d.el.style.zIndex=5,c.container.appendChild(d.el),d._inDocument=!0,d.coverGutter||(d.el.style.zIndex=3),d.pixelHeight==null&&(d.pixelHeight=d.el.offsetHeight)),d.rowCount==null&&(d.rowCount=d.pixelHeight/c.layerConfig.lineHeight);var a=this.session.getFoldAt(d.row,0);if(d.$fold=a,a){var t=this.session.lineWidgets;d.row==a.end.row&&!t[a.start.row]?t[a.start.row]=d:d.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:d.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(d),d},this.removeLineWidget=function(d){if(d._inDocument=!1,d.session=null,d.el&&d.el.parentNode&&d.el.parentNode.removeChild(d.el),d.editor&&d.editor.destroy)try{d.editor.destroy()}catch(a){}if(this.session.lineWidgets){var c=this.session.lineWidgets[d.row];if(c==d)this.session.lineWidgets[d.row]=d.$oldWidget,d.$oldWidget&&this.onWidgetChanged(d.$oldWidget);else for(;c;){if(c.$oldWidget==d){c.$oldWidget=d.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:d.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(d){for(var c=this.session.lineWidgets,a=c&&c[d],t=[];a;)t.push(a),a=a.$oldWidget;return t},this.onWidgetChanged=function(d){this.session._changedWidgets.push(d),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(d,c){var a=this.session._changedWidgets,t=c.layerConfig;if(!(!a||!a.length)){for(var e=1/0,i=0;i<a.length;i++){var n=a[i];if(!(!n||!n.el)&&n.session==this.session){if(!n._inDocument){if(this.session.lineWidgets[n.row]!=n)continue;n._inDocument=!0,c.container.appendChild(n.el)}n.h=n.el.offsetHeight,n.fixedWidth||(n.w=n.el.offsetWidth,n.screenWidth=Math.ceil(n.w/t.characterWidth));var o=n.h/t.lineHeight;n.coverLine&&(o-=this.session.getRowLineCount(n.row),o<0&&(o=0)),n.rowCount!=o&&(n.rowCount=o,n.row<e&&(e=n.row))}}e!=1/0&&(this.session._emit("changeFold",{data:{start:{row:e}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(d,c){var a=c.layerConfig,t=this.session.lineWidgets;if(t){for(var e=Math.min(this.firstRow,a.firstRow),i=Math.max(this.lastRow,a.lastRow,t.length);e>0&&!t[e];)e--;this.firstRow=a.firstRow,this.lastRow=a.lastRow,c.$cursorLayer.config=a;for(var n=e;n<=i;n++){var o=t[n];if(!(!o||!o.el)){if(o.hidden){o.el.style.top=-100-(o.pixelHeight||0)+"px";continue}o._inDocument||(o._inDocument=!0,c.container.appendChild(o.el));var l=c.$cursorLayer.getPixelPosition({row:n,column:0},!0).top;o.coverLine||(l+=a.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=l-a.offset+"px";var g=o.coverGutter?0:c.gutterWidth;o.fixedWidth||(g-=c.scrollLeft),o.el.style.left=g+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=a.width+2*a.padding+"px"),o.fixedWidth?o.el.style.right=c.scrollBar.getWidth()+"px":o.el.style.right=""}}}}}).call(S.prototype),k.LineWidgets=S}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(L,k,N){function S(t,e,i){for(var n=0,o=t.length-1;n<=o;){var l=n+o>>1,g=i(e,t[l]);if(g>0)n=l+1;else{if(!(g<0))return l;o=l-1}}return-(n+1)}function x(t,e,i){var n=t.getAnnotations().sort(a.comparePoints);if(n.length){var o=S(n,{row:e,column:-1},a.comparePoints);o<0&&(o=-o-1),o>=n.length?o=i>0?0:n.length-1:o===0&&i<0&&(o=n.length-1);var l=n[o];if(!(!l||!i)){if(l.row===e){do l=n[o+=i];while(l&&l.row===e);if(!l)return n.slice()}var g=[];e=l.row;do g[i<0?"unshift":"push"](l),l=n[o+=i];while(l&&l.row==e);return g.length&&g}}}var d=L("../line_widgets").LineWidgets,c=L("../lib/dom"),a=L("../range").Range;k.showErrorMarker=function(t,e){var i=t.session;i.widgetManager||(i.widgetManager=new d(i),i.widgetManager.attach(t));var n=t.getCursorPosition(),o=n.row,l=i.widgetManager.getWidgetsAtRow(o).filter(function(u){return u.type=="errorMarker"})[0];l?l.destroy():o-=e;var g=x(i,o,e),v;if(g){var $=g[0];n.column=($.pos&&typeof $.column!="number"?$.pos.sc:$.column)||0,n.row=$.row,v=t.renderer.$gutterLayer.$annotations[n.row]}else{if(l)return;v={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(n.row),t.selection.moveToPosition(n);var y={row:n.row,fixedWidth:!0,coverGutter:!0,el:c.createElement("div"),type:"errorMarker"},p=y.el.appendChild(c.createElement("div")),r=y.el.appendChild(c.createElement("div"));r.className="error_widget_arrow "+v.className;var h=t.renderer.$cursorLayer.getPixelPosition(n).left;r.style.left=h+t.renderer.gutterWidth-5+"px",y.el.className="error_widget_wrapper",p.className="error_widget "+v.className,p.innerHTML=v.text.join("<br>"),p.appendChild(c.createElement("div"));var w=function(u,f,s){if(f===0&&(s==="esc"||s==="return"))return y.destroy(),{command:"null"}};y.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(w),i.widgetManager.removeLineWidget(y),t.off("changeSelection",y.destroy),t.off("changeSession",y.destroy),t.off("mouseup",y.destroy),t.off("change",y.destroy))},t.keyBinding.addKeyboardHandler(w),t.on("changeSelection",y.destroy),t.on("changeSession",y.destroy),t.on("mouseup",y.destroy),t.on("change",y.destroy),t.session.widgetManager.addLineWidget(y),y.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:y.el.offsetHeight})},c.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; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","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"],function(L,k,N){L("./lib/fixoldbrowsers");var S=L("./lib/dom"),x=L("./lib/event"),d=L("./range").Range,c=L("./editor").Editor,a=L("./edit_session").EditSession,t=L("./undomanager").UndoManager,e=L("./virtual_renderer").VirtualRenderer;L("./worker/worker_client"),L("./keyboard/hash_handler"),L("./placeholder"),L("./multi_select"),L("./mode/folding/fold_mode"),L("./theme/textmate"),L("./ext/error_marker"),k.config=L("./config"),k.require=L,typeof define=="function"&&(k.define=define),k.edit=function(i,n){if(typeof i=="string"){var o=i;if(i=document.getElementById(o),!i)throw new Error("ace.edit can't find div #"+o)}if(i&&i.env&&i.env.editor instanceof c)return i.env.editor;var l="";if(i&&/input|textarea/i.test(i.tagName)){var g=i;l=g.value,i=S.createElement("pre"),g.parentNode.replaceChild(i,g)}else i&&(l=i.textContent,i.innerHTML="");var v=k.createEditSession(l),$=new c(new e(i),v,n),y={document:v,editor:$,onResize:$.resize.bind($,null)};return g&&(y.textarea=g),x.addListener(window,"resize",y.onResize),$.on("destroy",function(){x.removeListener(window,"resize",y.onResize),y.editor.container.env=null}),$.container.env=$.env=y,$},k.createEditSession=function(i,n){var o=new a(i,n);return o.setUndoManager(new t),o},k.Range=d,k.Editor=c,k.EditSession=a,k.UndoManager=t,k.VirtualRenderer=e,k.version=k.config.version});(function(){ace.require(["ace/ace"],function(L){L&&(L.config.init(!0),L.define=ace.define),window.ace||(window.ace=L);for(var k in L)L.hasOwnProperty(k)&&(window.ace[k]=L[k]);window.ace.default=window.ace,typeof ue=="object"&&typeof me=="object"&&ue&&(ue.exports=window.ace)})})()});export default ve();