@zydon/common-csr 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
+ import { a as a$1 } from '../../../chunk-75QNIQAU.mjs';
1
2
  import { a, b } from '../../../chunk-6KMKD42J.mjs';
2
3
  import { useState, useEffect } from 'react';
3
4
  import { useFormContext, useFieldArray } from 'react-hook-form';
4
5
  import it from '@mui/material/Button';
5
6
  import Di from '@mui/material/ToggleButtonGroup';
6
- import Ue from '@zydon/common/components/Icon';
7
+ import ze from '@zydon/common/components/Icon';
7
8
  import Jt from '@zydon/common/hooks/usePopover';
8
9
  import Hi from '@zydon/common/hooks/useToggle';
9
10
  import Dt from '@mui/material/Popover';
@@ -23,8 +24,8 @@ import Ne from '@zydon/common/form/Autocomplete';
23
24
  import mi from '@zydon/common/form/Field';
24
25
  import _i from '@mui/material/ToggleButton';
25
26
 
26
- var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&typeof window<"u"&&(M=window),!k);var H=function(r,e,i){if(typeof r!="string"){H.original?H.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=e),H.modules[r]||(H.payloads[r]=i,H.modules[r]=null);};H.modules={},H.payloads={};var R=function(r,e,i){if(typeof e=="string"){var n=s(r,e);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(e)==="[object Array]"){for(var t=[],o=0,a=e.length;o<a;++o){var u=s(r,e[o]);if(u==null&&L.original)return;t.push(u);}return i&&i.apply(null,t)||!0}},L=function(r,e){var i=R("",r,e);return i==null&&L.original?L.original.apply(this,arguments):i},x=function(r,e){if(e.indexOf("!")!==-1){var i=e.split("!");return x(r,i[0])+"!"+x(r,i[1])}if(e.charAt(0)=="."){var n=r.split("/").slice(0,-1).join("/");for(e=n+"/"+e;e.indexOf(".")!==-1&&t!=e;){var t=e;e=e.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"");}}return e},s=function(r,e){e=x(r,e);var i=H.modules[e];if(!i){if(i=H.payloads[e],typeof i=="function"){var n={},t={id:e,uri:"",exports:n,packaged:!0},o=function(u,w){return R(e,u,w)},a=i(o,n,t);n=a||t.exports,H.modules[e]=n,delete H.payloads[e];}i=H.modules[e]=n||i;}return i};function l(r){var e=M;r&&(M[r]||(M[r]={}),e=M[r]),(!e.define||!e.define.packaged)&&(H.original=e.define,e.define=H,e.define.packaged=!0),(!e.require||!e.require.packaged)&&(L.original=e.require,e.require=L,e.require.packaged=!0);}l(k);})();ace.define("ace/lib/es6-shim",["require","exports","module"],function(k,M,H){function R(L,x,s){Object.defineProperty(L,x,{value:s,enumerable:!1,writable:!0,configurable:!0});}String.prototype.startsWith||R(String.prototype,"startsWith",function(L,x){return x=x||0,this.lastIndexOf(L,x)===x}),String.prototype.endsWith||R(String.prototype,"endsWith",function(L,x){var s=this;(x===void 0||x>s.length)&&(x=s.length),x-=L.length;var l=s.indexOf(L,x);return l!==-1&&l===x}),String.prototype.repeat||R(String.prototype,"repeat",function(L){for(var x="",s=this;L>0;)L&1&&(x+=s),(L>>=1)&&(s+=s);return x}),String.prototype.includes||R(String.prototype,"includes",function(L,x){return this.indexOf(L,x)!=-1}),Object.assign||(Object.assign=function(L){if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var x=Object(L),s=1;s<arguments.length;s++){var l=arguments[s];l!=null&&Object.keys(l).forEach(function(r){x[r]=l[r];});}return x}),Object.values||(Object.values=function(L){return Object.keys(L).map(function(x){return L[x]})}),Array.prototype.find||R(Array.prototype,"find",function(L){for(var x=this.length,s=arguments[1],l=0;l<x;l++){var r=this[l];if(L.call(s,r,l,this))return r}}),Array.prototype.findIndex||R(Array.prototype,"findIndex",function(L){for(var x=this.length,s=arguments[1],l=0;l<x;l++){var r=this[l];if(L.call(s,r,l,this))return l}}),Array.prototype.includes||R(Array.prototype,"includes",function(L,x){return this.indexOf(L,x)!=-1}),Array.prototype.fill||R(Array.prototype,"fill",function(L){for(var x=this,s=x.length>>>0,l=arguments[1],r=l>>0,e=r<0?Math.max(s+r,0):Math.min(r,s),i=arguments[2],n=i===void 0?s:i>>0,t=n<0?Math.max(s+n,0):Math.min(n,s);e<t;)x[e]=L,e++;return x}),Array.of||R(Array,"of",function(){return Array.prototype.slice.call(arguments)});});ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(k,M,H){k("./es6-shim");});ace.define("ace/lib/deep_copy",["require","exports","module"],function(k,M,H){M.deepCopy=function R(L){if(typeof L!="object"||!L)return L;var x;if(Array.isArray(L)){x=[];for(var s=0;s<L.length;s++)x[s]=R(L[s]);return x}if(Object.prototype.toString.call(L)!=="[object Object]")return L;x={};for(var s in L)x[s]=R(L[s]);return x};});ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(k,M,H){M.last=function(x){return x[x.length-1]},M.stringReverse=function(x){return x.split("").reverse().join("")},M.stringRepeat=function(x,s){for(var l="";s>0;)s&1&&(l+=x),(s>>=1)&&(x+=x);return l};var R=/^\s\s*/,L=/\s\s*$/;M.stringTrimLeft=function(x){return x.replace(R,"")},M.stringTrimRight=function(x){return x.replace(L,"")},M.copyObject=function(x){var s={};for(var l in x)s[l]=x[l];return s},M.copyArray=function(x){for(var s=[],l=0,r=x.length;l<r;l++)x[l]&&typeof x[l]=="object"?s[l]=this.copyObject(x[l]):s[l]=x[l];return s},M.deepCopy=k("./deep_copy").deepCopy,M.arrayToMap=function(x){for(var s={},l=0;l<x.length;l++)s[x[l]]=1;return s},M.createMap=function(x){var s=Object.create(null);for(var l in x)s[l]=x[l];return s},M.arrayRemove=function(x,s){for(var l=0;l<=x.length;l++)s===x[l]&&x.splice(l,1);},M.escapeRegExp=function(x){return x.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},M.escapeHTML=function(x){return (""+x).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},M.getMatchOffsets=function(x,s){var l=[];return x.replace(s,function(r){l.push({offset:arguments[arguments.length-2],length:r.length});}),l},M.deferredCall=function(x){var s=null,l=function(){s=null,x();},r=function(e){return r.cancel(),s=setTimeout(l,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),x(),r},r.cancel=function(){return clearTimeout(s),s=null,r},r.isPending=function(){return s},r},M.delayedCall=function(x,s){var l=null,r=function(){l=null,x();},e=function(i){l==null&&(l=setTimeout(r,i||s));};return e.delay=function(i){l&&clearTimeout(l),l=setTimeout(r,i||s);},e.schedule=e,e.call=function(){this.cancel(),x();},e.cancel=function(){l&&clearTimeout(l),l=null;},e.isPending=function(){return l},e},M.supportsLookbehind=function(){try{new RegExp("(?<=.)");}catch{return !1}return !0},M.skipEmptyMatch=function(x,s,l){return l&&x.codePointAt(s)>65535?2:1};});ace.define("ace/lib/useragent",["require","exports","module"],function(k,M,H){M.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},M.getOS=function(){return M.isMac?M.OS.MAC:M.isLinux?M.OS.LINUX:M.OS.WINDOWS};var R=typeof navigator=="object"?navigator:{},L=(/mac|win|linux/i.exec(R.platform)||["other"])[0].toLowerCase(),x=R.userAgent||"",s=R.appName||"";M.isWin=L=="win",M.isMac=L=="mac",M.isLinux=L=="linux",M.isIE=s=="Microsoft Internet Explorer"||s.indexOf("MSAppHost")>=0?parseFloat((x.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((x.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),M.isOldIE=M.isIE&&M.isIE<9,M.isGecko=M.isMozilla=x.match(/ Gecko\/\d+/),M.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",M.isWebKit=parseFloat(x.split("WebKit/")[1])||void 0,M.isChrome=parseFloat(x.split(" Chrome/")[1])||void 0,M.isSafari=parseFloat(x.split(" Safari/")[1])&&!M.isChrome||void 0,M.isEdge=parseFloat(x.split(" Edge/")[1])||void 0,M.isAIR=x.indexOf("AdobeAIR")>=0,M.isAndroid=x.indexOf("Android")>=0,M.isChromeOS=x.indexOf(" CrOS ")>=0,M.isIOS=/iPad|iPhone|iPod/.test(x)&&!window.MSStream,M.isIOS&&(M.isMac=!0),M.isMobile=M.isIOS||M.isAndroid;});ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(k,M,H){var R=k("./useragent"),L="http://www.w3.org/1999/xhtml";M.buildDom=function i(n,t,o){if(typeof n=="string"&&n){var a=document.createTextNode(n);return t&&t.appendChild(a),a}if(!Array.isArray(n))return n&&n.appendChild&&t&&t.appendChild(n),n;if(typeof n[0]!="string"||!n[0]){for(var u=[],w=0;w<n.length;w++){var S=i(n[w],t,o);S&&u.push(S);}return u}var m=document.createElement(n[0]),$=n[1],d=1;$&&typeof $=="object"&&!Array.isArray($)&&(d=2);for(var w=d;w<n.length;w++)i(n[w],m,o);return d==2&&Object.keys($).forEach(function(h){var v=$[h];h==="class"?m.className=Array.isArray(v)?v.join(" "):v:typeof v=="function"||h=="value"||h[0]=="$"?m[h]=v:h==="ref"?o&&(o[v]=m):h==="style"?typeof v=="string"&&(m.style.cssText=v):v!=null&&m.setAttribute(h,v);}),t&&t.appendChild(m),m},M.getDocumentHead=function(i){return i||(i=document),i.head||i.getElementsByTagName("head")[0]||i.documentElement},M.createElement=function(i,n){return document.createElementNS?document.createElementNS(n||L,i):document.createElement(i)},M.removeChildren=function(i){i.innerHTML="";},M.createTextNode=function(i,n){var t=n?n.ownerDocument:document;return t.createTextNode(i)},M.createFragment=function(i){var n=i?i.ownerDocument:document;return n.createDocumentFragment()},M.hasCssClass=function(i,n){var t=(i.className+"").split(/\s+/g);return t.indexOf(n)!==-1},M.addCssClass=function(i,n){M.hasCssClass(i,n)||(i.className+=" "+n);},M.removeCssClass=function(i,n){for(var t=i.className.split(/\s+/g);;){var o=t.indexOf(n);if(o==-1)break;t.splice(o,1);}i.className=t.join(" ");},M.toggleCssClass=function(i,n){for(var t=i.className.split(/\s+/g),o=!0;;){var a=t.indexOf(n);if(a==-1)break;o=!1,t.splice(a,1);}return o&&t.push(n),i.className=t.join(" "),o},M.setCssClass=function(i,n,t){t?M.addCssClass(i,n):M.removeCssClass(i,n);},M.hasCssString=function(i,n){var t=0,o;if(n=n||document,o=n.querySelectorAll("style")){for(;t<o.length;)if(o[t++].id===i)return !0}},M.removeElementById=function(i,n){n=n||document,n.getElementById(i)&&n.getElementById(i).remove();};var x,s=[];M.useStrictCSP=function(i){x=i,i==!1?l():s||(s=[]);};function l(){var i=s;s=null,i&&i.forEach(function(n){r(n[0],n[1]);});}function r(i,n,t){if(!(typeof document>"u")){if(s){if(t)l();else if(t===!1)return s.push([i,n])}if(!x){var o=t;!t||!t.getRootNode?o=document:(o=t.getRootNode(),(!o||o==t)&&(o=document));var a=o.ownerDocument||o;if(n&&M.hasCssString(n,o))return null;n&&(i+=`
27
- /*# sourceURL=ace/css/`+n+" */");var u=M.createElement("style");u.appendChild(a.createTextNode(i)),n&&(u.id=n),o==a&&(o=M.getDocumentHead(a)),o.insertBefore(u,o.firstChild);}}}if(M.importCssString=r,M.importCssStylsheet=function(i,n){M.buildDom(["link",{rel:"stylesheet",href:i}],M.getDocumentHead(n));},M.scrollbarWidth=function(i){var n=M.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var t=M.createElement("ace_outer"),o=t.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",t.appendChild(n);var a=i&&i.documentElement||document&&document.documentElement;if(!a)return 0;a.appendChild(t);var u=n.offsetWidth;o.overflow="scroll";var w=n.offsetWidth;return u===w&&(w=t.clientWidth),a.removeChild(t),u-w},M.computedStyle=function(i,n){return window.getComputedStyle(i,"")||{}},M.setStyle=function(i,n,t){i[n]!==t&&(i[n]=t);},M.HAS_CSS_ANIMATION=!1,M.HAS_CSS_TRANSFORMS=!1,M.HI_DPI=R.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,R.isChromeOS&&(M.HI_DPI=!1),typeof document<"u"){var e=document.createElement("div");M.HI_DPI&&e.style.transform!==void 0&&(M.HAS_CSS_TRANSFORMS=!0),!R.isEdge&&typeof e.style.animationName<"u"&&(M.HAS_CSS_ANIMATION=!0),e=null;}M.HAS_CSS_TRANSFORMS?M.translate=function(i,n,t){i.style.transform="translate("+Math.round(n)+"px, "+Math.round(t)+"px)";}:M.translate=function(i,n,t){i.style.top=Math.round(t)+"px",i.style.left=Math.round(n)+"px";};});ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("./dom");M.get=function(L,x){var s=new XMLHttpRequest;s.open("GET",L,!0),s.onreadystatechange=function(){s.readyState===4&&x(s.responseText);},s.send(null);},M.loadScript=function(L,x){var s=R.getDocumentHead(),l=document.createElement("script");l.src=L,s.appendChild(l),l.onload=l.onreadystatechange=function(r,e){(e||!l.readyState||l.readyState=="loaded"||l.readyState=="complete")&&(l=l.onload=l.onreadystatechange=null,e||x());};},M.qualifyURL=function(L){var x=document.createElement("a");return x.href=L,x.href};});ace.define("ace/lib/oop",["require","exports","module"],function(k,M,H){M.inherits=function(R,L){R.super_=L,R.prototype=Object.create(L.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}});},M.mixin=function(R,L){for(var x in L)R[x]=L[x];return R},M.implement=function(R,L){M.mixin(R,L);};});ace.define("ace/lib/event_emitter",["require","exports","module"],function(k,M,H){var R={},L=function(){this.propagationStopped=!0;},x=function(){this.defaultPrevented=!0;};R._emit=R._dispatchEvent=function(s,l){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[s]||[],e=this._defaultHandlers[s];if(!(!r.length&&!e)){(typeof l!="object"||!l)&&(l={}),l.type||(l.type=s),l.stopPropagation||(l.stopPropagation=L),l.preventDefault||(l.preventDefault=x),r=r.slice();for(var i=0;i<r.length&&(r[i](l,this),!l.propagationStopped);i++);if(e&&!l.defaultPrevented)return e(l,this)}},R._signal=function(s,l){var r=(this._eventRegistry||{})[s];if(r){r=r.slice();for(var e=0;e<r.length;e++)r[e](l,this);}},R.once=function(s,l){var r=this;if(this.on(s,function e(){r.off(s,e),l.apply(null,arguments);}),!l)return new Promise(function(e){l=e;})},R.setDefaultHandler=function(s,l){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[s]){var e=r[s],i=r._disabled_[s];i||(r._disabled_[s]=i=[]),i.push(e);var n=i.indexOf(l);n!=-1&&i.splice(n,1);}r[s]=l;},R.removeDefaultHandler=function(s,l){var r=this._defaultHandlers;if(r){var e=r._disabled_[s];if(r[s]==l)e&&this.setDefaultHandler(s,e.pop());else if(e){var i=e.indexOf(l);i!=-1&&e.splice(i,1);}}},R.on=R.addEventListener=function(s,l,r){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[s];return e||(e=this._eventRegistry[s]=[]),e.indexOf(l)==-1&&e[r?"unshift":"push"](l),l},R.off=R.removeListener=R.removeEventListener=function(s,l){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[s];if(r){var e=r.indexOf(l);e!==-1&&r.splice(e,1);}},R.removeAllListeners=function(s){s||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[s]=void 0),this._defaultHandlers&&(this._defaultHandlers[s]=void 0);},M.EventEmitter=R;});ace.define("ace/lib/report_error",["require","exports","module"],function(k,M,H){M.reportError=function(L,x){var s=new Error(L);s.data=x,typeof console=="object"&&console.error&&console.error(s),setTimeout(function(){throw s});};});ace.define("ace/lib/default_english_messages",["require","exports","module"],function(k,M,H){var R={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages"};M.defaultEnglishMessages=R;});ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(k,M,H){"no use strict";var R=k("./oop"),L=k("./event_emitter").EventEmitter,x=k("./report_error").reportError,s=k("./default_english_messages").defaultEnglishMessages,l={setOptions:function(t){Object.keys(t).forEach(function(o){this.setOption(o,t[o]);},this);},getOptions:function(t){var o={};if(t)Array.isArray(t)||(o=t,t=Object.keys(o));else {var a=this.$options;t=Object.keys(a).filter(function(u){return !a[u].hidden});}return t.forEach(function(u){o[u]=this.getOption(u);},this),o},setOption:function(t,o){if(this["$"+t]!==o){var a=this.$options[t];if(!a)return r('misspelled option "'+t+'"');if(a.forwardTo)return this[a.forwardTo]&&this[a.forwardTo].setOption(t,o);a.handlesSet||(this["$"+t]=o),a&&a.set&&a.set.call(this,o);}},getOption:function(t){var o=this.$options[t];return o?o.forwardTo?this[o.forwardTo]&&this[o.forwardTo].getOption(t):o&&o.get?o.get.call(this):this["$"+t]:r('misspelled option "'+t+'"')}};function r(t){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments);}var e,i,n=function(){function t(){this.$defaultOptions={},e=s,i="dollarSigns";}return t.prototype.defineOptions=function(o,a,u){return o.$options||(this.$defaultOptions[a]=o.$options={}),Object.keys(u).forEach(function(w){var S=u[w];typeof S=="string"&&(S={forwardTo:S}),S.name||(S.name=w),o.$options[S.name]=S,"initialValue"in S&&(o["$"+S.name]=S.initialValue);}),R.implement(o,l),this},t.prototype.resetOptions=function(o){Object.keys(o.$options).forEach(function(a){var u=o.$options[a];"value"in u&&o.setOption(a,u.value);});},t.prototype.setDefaultValue=function(o,a,u){if(!o){for(o in this.$defaultOptions)if(this.$defaultOptions[o][a])break;if(!this.$defaultOptions[o][a])return !1}var w=this.$defaultOptions[o]||(this.$defaultOptions[o]={});w[a]&&(w.forwardTo?this.setDefaultValue(w.forwardTo,a,u):w[a].value=u);},t.prototype.setDefaultValues=function(o,a){Object.keys(a).forEach(function(u){this.setDefaultValue(o,u,a[u]);},this);},t.prototype.setMessages=function(o,a){e=o,a&&a.placeholders&&(i=a.placeholders);},t.prototype.nls=function(o,a,u){e[o]||(r("No message found for the key '"+o+"' in the provided messages, trying to find a translation for the default string '"+a+"'."),e[a]||r("No message found for the default string '"+a+"' in the provided messages. Falling back to the default English message."));var w=e[o]||e[a]||a;return u&&(i==="dollarSigns"&&(w=w.replace(/\$(\$|[\d]+)/g,function(S,m){return m=="$"?"$":u[m]})),i==="curlyBrackets"&&(w=w.replace(/\{([^\}]+)\}/g,function(S,m){return u[m]}))),w},t}();n.prototype.warn=r,n.prototype.reportError=x,R.implement(n.prototype,L),M.AppConfig=n;});ace.define("ace/theme/textmate-css",["require","exports","module"],function(k,M,H){H.exports=`.ace-tm .ace_gutter {
27
+ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&typeof window<"u"&&(M=window),!k);var H=function(r,t,i){if(typeof r!="string"){H.original?H.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=t),H.modules[r]||(H.payloads[r]=i,H.modules[r]=null);};H.modules={},H.payloads={};var R=function(r,t,i){if(typeof t=="string"){var n=s(r,t);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(t)==="[object Array]"){for(var e=[],o=0,a=t.length;o<a;++o){var u=s(r,t[o]);if(u==null&&L.original)return;e.push(u);}return i&&i.apply(null,e)||!0}},L=function(r,t){var i=R("",r,t);return i==null&&L.original?L.original.apply(this,arguments):i},x=function(r,t){if(t.indexOf("!")!==-1){var i=t.split("!");return x(r,i[0])+"!"+x(r,i[1])}if(t.charAt(0)=="."){var n=r.split("/").slice(0,-1).join("/");for(t=n+"/"+t;t.indexOf(".")!==-1&&e!=t;){var e=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"");}}return t},s=function(r,t){t=x(r,t);var i=H.modules[t];if(!i){if(i=H.payloads[t],typeof i=="function"){var n={},e={id:t,uri:"",exports:n,packaged:!0},o=function(u,w){return R(t,u,w)},a=i(o,n,e);n=a||e.exports,H.modules[t]=n,delete H.payloads[t];}i=H.modules[t]=n||i;}return i};function c(r){var t=M;r&&(M[r]||(M[r]={}),t=M[r]),(!t.define||!t.define.packaged)&&(H.original=t.define,t.define=H,t.define.packaged=!0),(!t.require||!t.require.packaged)&&(L.original=t.require,t.require=L,t.require.packaged=!0);}c(k);})();ace.define("ace/lib/es6-shim",["require","exports","module"],function(k,M,H){function R(L,x,s){Object.defineProperty(L,x,{value:s,enumerable:!1,writable:!0,configurable:!0});}String.prototype.startsWith||R(String.prototype,"startsWith",function(L,x){return x=x||0,this.lastIndexOf(L,x)===x}),String.prototype.endsWith||R(String.prototype,"endsWith",function(L,x){var s=this;(x===void 0||x>s.length)&&(x=s.length),x-=L.length;var c=s.indexOf(L,x);return c!==-1&&c===x}),String.prototype.repeat||R(String.prototype,"repeat",function(L){for(var x="",s=this;L>0;)L&1&&(x+=s),(L>>=1)&&(s+=s);return x}),String.prototype.includes||R(String.prototype,"includes",function(L,x){return this.indexOf(L,x)!=-1}),Object.assign||(Object.assign=function(L){if(L==null)throw new TypeError("Cannot convert undefined or null to object");for(var x=Object(L),s=1;s<arguments.length;s++){var c=arguments[s];c!=null&&Object.keys(c).forEach(function(r){x[r]=c[r];});}return x}),Object.values||(Object.values=function(L){return Object.keys(L).map(function(x){return L[x]})}),Array.prototype.find||R(Array.prototype,"find",function(L){for(var x=this.length,s=arguments[1],c=0;c<x;c++){var r=this[c];if(L.call(s,r,c,this))return r}}),Array.prototype.findIndex||R(Array.prototype,"findIndex",function(L){for(var x=this.length,s=arguments[1],c=0;c<x;c++){var r=this[c];if(L.call(s,r,c,this))return c}}),Array.prototype.includes||R(Array.prototype,"includes",function(L,x){return this.indexOf(L,x)!=-1}),Array.prototype.fill||R(Array.prototype,"fill",function(L){for(var x=this,s=x.length>>>0,c=arguments[1],r=c>>0,t=r<0?Math.max(s+r,0):Math.min(r,s),i=arguments[2],n=i===void 0?s:i>>0,e=n<0?Math.max(s+n,0):Math.min(n,s);t<e;)x[t]=L,t++;return x}),Array.of||R(Array,"of",function(){return Array.prototype.slice.call(arguments)});});ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(k,M,H){k("./es6-shim");});ace.define("ace/lib/deep_copy",["require","exports","module"],function(k,M,H){M.deepCopy=function R(L){if(typeof L!="object"||!L)return L;var x;if(Array.isArray(L)){x=[];for(var s=0;s<L.length;s++)x[s]=R(L[s]);return x}if(Object.prototype.toString.call(L)!=="[object Object]")return L;x={};for(var s in L)x[s]=R(L[s]);return x};});ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(k,M,H){M.last=function(x){return x[x.length-1]},M.stringReverse=function(x){return x.split("").reverse().join("")},M.stringRepeat=function(x,s){for(var c="";s>0;)s&1&&(c+=x),(s>>=1)&&(x+=x);return c};var R=/^\s\s*/,L=/\s\s*$/;M.stringTrimLeft=function(x){return x.replace(R,"")},M.stringTrimRight=function(x){return x.replace(L,"")},M.copyObject=function(x){var s={};for(var c in x)s[c]=x[c];return s},M.copyArray=function(x){for(var s=[],c=0,r=x.length;c<r;c++)x[c]&&typeof x[c]=="object"?s[c]=this.copyObject(x[c]):s[c]=x[c];return s},M.deepCopy=k("./deep_copy").deepCopy,M.arrayToMap=function(x){for(var s={},c=0;c<x.length;c++)s[x[c]]=1;return s},M.createMap=function(x){var s=Object.create(null);for(var c in x)s[c]=x[c];return s},M.arrayRemove=function(x,s){for(var c=0;c<=x.length;c++)s===x[c]&&x.splice(c,1);},M.escapeRegExp=function(x){return x.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},M.escapeHTML=function(x){return (""+x).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},M.getMatchOffsets=function(x,s){var c=[];return x.replace(s,function(r){c.push({offset:arguments[arguments.length-2],length:r.length});}),c},M.deferredCall=function(x){var s=null,c=function(){s=null,x();},r=function(t){return r.cancel(),s=setTimeout(c,t||0),r};return r.schedule=r,r.call=function(){return this.cancel(),x(),r},r.cancel=function(){return clearTimeout(s),s=null,r},r.isPending=function(){return s},r},M.delayedCall=function(x,s){var c=null,r=function(){c=null,x();},t=function(i){c==null&&(c=setTimeout(r,i||s));};return t.delay=function(i){c&&clearTimeout(c),c=setTimeout(r,i||s);},t.schedule=t,t.call=function(){this.cancel(),x();},t.cancel=function(){c&&clearTimeout(c),c=null;},t.isPending=function(){return c},t},M.supportsLookbehind=function(){try{new RegExp("(?<=.)");}catch{return !1}return !0},M.skipEmptyMatch=function(x,s,c){return c&&x.codePointAt(s)>65535?2:1};});ace.define("ace/lib/useragent",["require","exports","module"],function(k,M,H){M.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},M.getOS=function(){return M.isMac?M.OS.MAC:M.isLinux?M.OS.LINUX:M.OS.WINDOWS};var R=typeof navigator=="object"?navigator:{},L=(/mac|win|linux/i.exec(R.platform)||["other"])[0].toLowerCase(),x=R.userAgent||"",s=R.appName||"";M.isWin=L=="win",M.isMac=L=="mac",M.isLinux=L=="linux",M.isIE=s=="Microsoft Internet Explorer"||s.indexOf("MSAppHost")>=0?parseFloat((x.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((x.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),M.isOldIE=M.isIE&&M.isIE<9,M.isGecko=M.isMozilla=x.match(/ Gecko\/\d+/),M.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",M.isWebKit=parseFloat(x.split("WebKit/")[1])||void 0,M.isChrome=parseFloat(x.split(" Chrome/")[1])||void 0,M.isSafari=parseFloat(x.split(" Safari/")[1])&&!M.isChrome||void 0,M.isEdge=parseFloat(x.split(" Edge/")[1])||void 0,M.isAIR=x.indexOf("AdobeAIR")>=0,M.isAndroid=x.indexOf("Android")>=0,M.isChromeOS=x.indexOf(" CrOS ")>=0,M.isIOS=/iPad|iPhone|iPod/.test(x)&&!window.MSStream,M.isIOS&&(M.isMac=!0),M.isMobile=M.isIOS||M.isAndroid;});ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(k,M,H){var R=k("./useragent"),L="http://www.w3.org/1999/xhtml";M.buildDom=function i(n,e,o){if(typeof n=="string"&&n){var a=document.createTextNode(n);return e&&e.appendChild(a),a}if(!Array.isArray(n))return n&&n.appendChild&&e&&e.appendChild(n),n;if(typeof n[0]!="string"||!n[0]){for(var u=[],w=0;w<n.length;w++){var S=i(n[w],e,o);S&&u.push(S);}return u}var m=document.createElement(n[0]),$=n[1],d=1;$&&typeof $=="object"&&!Array.isArray($)&&(d=2);for(var w=d;w<n.length;w++)i(n[w],m,o);return d==2&&Object.keys($).forEach(function(h){var v=$[h];h==="class"?m.className=Array.isArray(v)?v.join(" "):v:typeof v=="function"||h=="value"||h[0]=="$"?m[h]=v:h==="ref"?o&&(o[v]=m):h==="style"?typeof v=="string"&&(m.style.cssText=v):v!=null&&m.setAttribute(h,v);}),e&&e.appendChild(m),m},M.getDocumentHead=function(i){return i||(i=document),i.head||i.getElementsByTagName("head")[0]||i.documentElement},M.createElement=function(i,n){return document.createElementNS?document.createElementNS(n||L,i):document.createElement(i)},M.removeChildren=function(i){i.innerHTML="";},M.createTextNode=function(i,n){var e=n?n.ownerDocument:document;return e.createTextNode(i)},M.createFragment=function(i){var n=i?i.ownerDocument:document;return n.createDocumentFragment()},M.hasCssClass=function(i,n){var e=(i.className+"").split(/\s+/g);return e.indexOf(n)!==-1},M.addCssClass=function(i,n){M.hasCssClass(i,n)||(i.className+=" "+n);},M.removeCssClass=function(i,n){for(var e=i.className.split(/\s+/g);;){var o=e.indexOf(n);if(o==-1)break;e.splice(o,1);}i.className=e.join(" ");},M.toggleCssClass=function(i,n){for(var e=i.className.split(/\s+/g),o=!0;;){var a=e.indexOf(n);if(a==-1)break;o=!1,e.splice(a,1);}return o&&e.push(n),i.className=e.join(" "),o},M.setCssClass=function(i,n,e){e?M.addCssClass(i,n):M.removeCssClass(i,n);},M.hasCssString=function(i,n){var e=0,o;if(n=n||document,o=n.querySelectorAll("style")){for(;e<o.length;)if(o[e++].id===i)return !0}},M.removeElementById=function(i,n){n=n||document,n.getElementById(i)&&n.getElementById(i).remove();};var x,s=[];M.useStrictCSP=function(i){x=i,i==!1?c():s||(s=[]);};function c(){var i=s;s=null,i&&i.forEach(function(n){r(n[0],n[1]);});}function r(i,n,e){if(!(typeof document>"u")){if(s){if(e)c();else if(e===!1)return s.push([i,n])}if(!x){var o=e;!e||!e.getRootNode?o=document:(o=e.getRootNode(),(!o||o==e)&&(o=document));var a=o.ownerDocument||o;if(n&&M.hasCssString(n,o))return null;n&&(i+=`
28
+ /*# sourceURL=ace/css/`+n+" */");var u=M.createElement("style");u.appendChild(a.createTextNode(i)),n&&(u.id=n),o==a&&(o=M.getDocumentHead(a)),o.insertBefore(u,o.firstChild);}}}if(M.importCssString=r,M.importCssStylsheet=function(i,n){M.buildDom(["link",{rel:"stylesheet",href:i}],M.getDocumentHead(n));},M.scrollbarWidth=function(i){var n=M.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var e=M.createElement("ace_outer"),o=e.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",e.appendChild(n);var a=i&&i.documentElement||document&&document.documentElement;if(!a)return 0;a.appendChild(e);var u=n.offsetWidth;o.overflow="scroll";var w=n.offsetWidth;return u===w&&(w=e.clientWidth),a.removeChild(e),u-w},M.computedStyle=function(i,n){return window.getComputedStyle(i,"")||{}},M.setStyle=function(i,n,e){i[n]!==e&&(i[n]=e);},M.HAS_CSS_ANIMATION=!1,M.HAS_CSS_TRANSFORMS=!1,M.HI_DPI=R.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,R.isChromeOS&&(M.HI_DPI=!1),typeof document<"u"){var t=document.createElement("div");M.HI_DPI&&t.style.transform!==void 0&&(M.HAS_CSS_TRANSFORMS=!0),!R.isEdge&&typeof t.style.animationName<"u"&&(M.HAS_CSS_ANIMATION=!0),t=null;}M.HAS_CSS_TRANSFORMS?M.translate=function(i,n,e){i.style.transform="translate("+Math.round(n)+"px, "+Math.round(e)+"px)";}:M.translate=function(i,n,e){i.style.top=Math.round(e)+"px",i.style.left=Math.round(n)+"px";};});ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("./dom");M.get=function(L,x){var s=new XMLHttpRequest;s.open("GET",L,!0),s.onreadystatechange=function(){s.readyState===4&&x(s.responseText);},s.send(null);},M.loadScript=function(L,x){var s=R.getDocumentHead(),c=document.createElement("script");c.src=L,s.appendChild(c),c.onload=c.onreadystatechange=function(r,t){(t||!c.readyState||c.readyState=="loaded"||c.readyState=="complete")&&(c=c.onload=c.onreadystatechange=null,t||x());};},M.qualifyURL=function(L){var x=document.createElement("a");return x.href=L,x.href};});ace.define("ace/lib/oop",["require","exports","module"],function(k,M,H){M.inherits=function(R,L){R.super_=L,R.prototype=Object.create(L.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}});},M.mixin=function(R,L){for(var x in L)R[x]=L[x];return R},M.implement=function(R,L){M.mixin(R,L);};});ace.define("ace/lib/event_emitter",["require","exports","module"],function(k,M,H){var R={},L=function(){this.propagationStopped=!0;},x=function(){this.defaultPrevented=!0;};R._emit=R._dispatchEvent=function(s,c){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[s]||[],t=this._defaultHandlers[s];if(!(!r.length&&!t)){(typeof c!="object"||!c)&&(c={}),c.type||(c.type=s),c.stopPropagation||(c.stopPropagation=L),c.preventDefault||(c.preventDefault=x),r=r.slice();for(var i=0;i<r.length&&(r[i](c,this),!c.propagationStopped);i++);if(t&&!c.defaultPrevented)return t(c,this)}},R._signal=function(s,c){var r=(this._eventRegistry||{})[s];if(r){r=r.slice();for(var t=0;t<r.length;t++)r[t](c,this);}},R.once=function(s,c){var r=this;if(this.on(s,function t(){r.off(s,t),c.apply(null,arguments);}),!c)return new Promise(function(t){c=t;})},R.setDefaultHandler=function(s,c){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[s]){var t=r[s],i=r._disabled_[s];i||(r._disabled_[s]=i=[]),i.push(t);var n=i.indexOf(c);n!=-1&&i.splice(n,1);}r[s]=c;},R.removeDefaultHandler=function(s,c){var r=this._defaultHandlers;if(r){var t=r._disabled_[s];if(r[s]==c)t&&this.setDefaultHandler(s,t.pop());else if(t){var i=t.indexOf(c);i!=-1&&t.splice(i,1);}}},R.on=R.addEventListener=function(s,c,r){this._eventRegistry=this._eventRegistry||{};var t=this._eventRegistry[s];return t||(t=this._eventRegistry[s]=[]),t.indexOf(c)==-1&&t[r?"unshift":"push"](c),c},R.off=R.removeListener=R.removeEventListener=function(s,c){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[s];if(r){var t=r.indexOf(c);t!==-1&&r.splice(t,1);}},R.removeAllListeners=function(s){s||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[s]=void 0),this._defaultHandlers&&(this._defaultHandlers[s]=void 0);},M.EventEmitter=R;});ace.define("ace/lib/report_error",["require","exports","module"],function(k,M,H){M.reportError=function(L,x){var s=new Error(L);s.data=x,typeof console=="object"&&console.error&&console.error(s),setTimeout(function(){throw s});};});ace.define("ace/lib/default_english_messages",["require","exports","module"],function(k,M,H){var R={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages"};M.defaultEnglishMessages=R;});ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(k,M,H){"no use strict";var R=k("./oop"),L=k("./event_emitter").EventEmitter,x=k("./report_error").reportError,s=k("./default_english_messages").defaultEnglishMessages,c={setOptions:function(e){Object.keys(e).forEach(function(o){this.setOption(o,e[o]);},this);},getOptions:function(e){var o={};if(e)Array.isArray(e)||(o=e,e=Object.keys(o));else {var a=this.$options;e=Object.keys(a).filter(function(u){return !a[u].hidden});}return e.forEach(function(u){o[u]=this.getOption(u);},this),o},setOption:function(e,o){if(this["$"+e]!==o){var a=this.$options[e];if(!a)return r('misspelled option "'+e+'"');if(a.forwardTo)return this[a.forwardTo]&&this[a.forwardTo].setOption(e,o);a.handlesSet||(this["$"+e]=o),a&&a.set&&a.set.call(this,o);}},getOption:function(e){var o=this.$options[e];return o?o.forwardTo?this[o.forwardTo]&&this[o.forwardTo].getOption(e):o&&o.get?o.get.call(this):this["$"+e]:r('misspelled option "'+e+'"')}};function r(e){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments);}var t,i,n=function(){function e(){this.$defaultOptions={},t=s,i="dollarSigns";}return e.prototype.defineOptions=function(o,a,u){return o.$options||(this.$defaultOptions[a]=o.$options={}),Object.keys(u).forEach(function(w){var S=u[w];typeof S=="string"&&(S={forwardTo:S}),S.name||(S.name=w),o.$options[S.name]=S,"initialValue"in S&&(o["$"+S.name]=S.initialValue);}),R.implement(o,c),this},e.prototype.resetOptions=function(o){Object.keys(o.$options).forEach(function(a){var u=o.$options[a];"value"in u&&o.setOption(a,u.value);});},e.prototype.setDefaultValue=function(o,a,u){if(!o){for(o in this.$defaultOptions)if(this.$defaultOptions[o][a])break;if(!this.$defaultOptions[o][a])return !1}var w=this.$defaultOptions[o]||(this.$defaultOptions[o]={});w[a]&&(w.forwardTo?this.setDefaultValue(w.forwardTo,a,u):w[a].value=u);},e.prototype.setDefaultValues=function(o,a){Object.keys(a).forEach(function(u){this.setDefaultValue(o,u,a[u]);},this);},e.prototype.setMessages=function(o,a){t=o,a&&a.placeholders&&(i=a.placeholders);},e.prototype.nls=function(o,a,u){t[o]||(r("No message found for the key '"+o+"' in the provided messages, trying to find a translation for the default string '"+a+"'."),t[a]||r("No message found for the default string '"+a+"' in the provided messages. Falling back to the default English message."));var w=t[o]||t[a]||a;return u&&(i==="dollarSigns"&&(w=w.replace(/\$(\$|[\d]+)/g,function(S,m){return m=="$"?"$":u[m]})),i==="curlyBrackets"&&(w=w.replace(/\{([^\}]+)\}/g,function(S,m){return u[m]}))),w},e}();n.prototype.warn=r,n.prototype.reportError=x,R.implement(n.prototype,L),M.AppConfig=n;});ace.define("ace/theme/textmate-css",["require","exports","module"],function(k,M,H){H.exports=`.ace-tm .ace_gutter {
28
29
  background: #f0f0f0;
29
30
  color: #333;
30
31
  }
@@ -182,49 +183,49 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
182
183
  .ace-tm .ace_indent-guide-active {
183
184
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
184
185
  }
185
- `;});ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(k,M,H){M.isDark=!1,M.cssClass="ace-tm",M.cssText=k("./textmate-css"),M.$id="ace/theme/textmate";var R=k("../lib/dom");R.importCssString(M.cssText,M.cssClass,!1);});ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(k,M,H){"no use strict";var R=k("./lib/lang"),L=k("./lib/net"),x=k("./lib/dom"),s=k("./lib/app_config").AppConfig;H.exports=M=new s;var l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};M.get=function(n){if(!l.hasOwnProperty(n))throw new Error("Unknown config key: "+n);return l[n]},M.set=function(n,t){if(l.hasOwnProperty(n))l[n]=t;else if(this.setDefaultValue("",n,t)==!1)throw new Error("Unknown config key: "+n);n=="useStrictCSP"&&x.useStrictCSP(t);},M.all=function(){return R.copyObject(l)},M.$modes={},M.moduleUrl=function(n,t){if(l.$moduleUrls[n])return l.$moduleUrls[n];var o=n.split("/");t=t||o[o.length-2]||"";var a=t=="snippets"?"/":"-",u=o[o.length-1];if(t=="worker"&&a=="-"){var w=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");u=u.replace(w,"");}(!u||u==t)&&o.length>1&&(u=o[o.length-2]);var S=l[t+"Path"];return S==null?S=l.basePath:a=="/"&&(t=a=""),S&&S.slice(-1)!="/"&&(S+="/"),S+t+a+u+this.get("suffix")},M.setModuleUrl=function(n,t){return l.$moduleUrls[n]=t};var r=function(n,t){if(n==="ace/theme/textmate"||n==="./theme/textmate")return t(null,k("./theme/textmate"));if(e)return e(n,t);console.error("loader is not configured");},e;M.setLoader=function(n){e=n;},M.dynamicModules=Object.create(null),M.$loading={},M.$loaded={},M.loadModule=function(n,t){var o;if(Array.isArray(n))var a=n[0],u=n[1];else if(typeof n=="string")var u=n;var w=function(S){if(S&&!M.$loading[u])return t&&t(S);if(M.$loading[u]||(M.$loading[u]=[]),M.$loading[u].push(t),!(M.$loading[u].length>1)){var m=function(){r(u,function($,d){d&&(M.$loaded[u]=d),M._emit("load.module",{name:u,module:d});var h=M.$loading[u];M.$loading[u]=null,h.forEach(function(v){v&&v(d);});});};if(!M.get("packaged"))return m();L.loadScript(M.moduleUrl(u,a),m),i();}};if(M.dynamicModules[u])M.dynamicModules[u]().then(function(S){S.default?w(S.default):w(S);});else {try{o=this.$require(u);}catch{}w(o||M.$loaded[u]);}},M.$require=function(n){if(typeof H.require=="function"){var t="require";return H[t](n)}},M.setModuleLoader=function(n,t){M.dynamicModules[n]=t;};var i=function(){!l.basePath&&!l.workerPath&&!l.modePath&&!l.themePath&&!Object.keys(l.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),i=function(){});};M.version="1.35.4";});ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(k,M,H){k("./lib/fixoldbrowsers");var R=k("./config");R.setLoader(function(l,r){k([l],function(e){r(null,e);});});var L=function(){return this||typeof window<"u"&&window}();H.exports=function(l){R.init=x,R.$require=k,l.require=k,typeof define=="function"&&(l.define=define);},x(!0);function x(l){if(!(!L||!L.document)){R.set("packaged",l||k.packaged||H.packaged||L.define&&define.packaged);var r={},e="",i=document.currentScript||document._currentScript,n=i&&i.ownerDocument||document;i&&i.src&&(e=i.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var t=n.getElementsByTagName("script"),o=0;o<t.length;o++){var a=t[o],u=a.src||a.getAttribute("src");if(u){for(var w=a.attributes,S=0,m=w.length;S<m;S++){var $=w[S];$.name.indexOf("data-ace-")===0&&(r[s($.name.replace(/^data-ace-/,""))]=$.value);}var d=u.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);d&&(e=d[1]);}}e&&(r.base=r.base||e,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var h in r)typeof r[h]<"u"&&R.set(h,r[h]);}}function s(l){return l.replace(/-(.)/g,function(r,e){return e.toUpperCase()})}});ace.define("ace/range",["require","exports","module"],function(k,M,H){var R=function(){function L(x,s,l,r){this.start={row:x,column:s},this.end={row:l,column:r};}return L.prototype.isEqual=function(x){return this.start.row===x.start.row&&this.end.row===x.end.row&&this.start.column===x.start.column&&this.end.column===x.end.column},L.prototype.toString=function(){return "Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},L.prototype.contains=function(x,s){return this.compare(x,s)==0},L.prototype.compareRange=function(x){var s,l=x.end,r=x.start;return s=this.compare(l.row,l.column),s==1?(s=this.compare(r.row,r.column),s==1?2:s==0?1:0):s==-1?-2:(s=this.compare(r.row,r.column),s==-1?-1:s==1?42:0)},L.prototype.comparePoint=function(x){return this.compare(x.row,x.column)},L.prototype.containsRange=function(x){return this.comparePoint(x.start)==0&&this.comparePoint(x.end)==0},L.prototype.intersects=function(x){var s=this.compareRange(x);return s==-1||s==0||s==1},L.prototype.isEnd=function(x,s){return this.end.row==x&&this.end.column==s},L.prototype.isStart=function(x,s){return this.start.row==x&&this.start.column==s},L.prototype.setStart=function(x,s){typeof x=="object"?(this.start.column=x.column,this.start.row=x.row):(this.start.row=x,this.start.column=s);},L.prototype.setEnd=function(x,s){typeof x=="object"?(this.end.column=x.column,this.end.row=x.row):(this.end.row=x,this.end.column=s);},L.prototype.inside=function(x,s){return this.compare(x,s)==0?!(this.isEnd(x,s)||this.isStart(x,s)):!1},L.prototype.insideStart=function(x,s){return this.compare(x,s)==0?!this.isEnd(x,s):!1},L.prototype.insideEnd=function(x,s){return this.compare(x,s)==0?!this.isStart(x,s):!1},L.prototype.compare=function(x,s){return !this.isMultiLine()&&x===this.start.row?s<this.start.column?-1:s>this.end.column?1:0:x<this.start.row?-1:x>this.end.row?1:this.start.row===x?s>=this.start.column?0:-1:this.end.row===x?s<=this.end.column?0:1:0},L.prototype.compareStart=function(x,s){return this.start.row==x&&this.start.column==s?-1:this.compare(x,s)},L.prototype.compareEnd=function(x,s){return this.end.row==x&&this.end.column==s?1:this.compare(x,s)},L.prototype.compareInside=function(x,s){return this.end.row==x&&this.end.column==s?1:this.start.row==x&&this.start.column==s?-1:this.compare(x,s)},L.prototype.clipRows=function(x,s){if(this.end.row>s)var l={row:s+1,column:0};else if(this.end.row<x)var l={row:x,column:0};if(this.start.row>s)var r={row:s+1,column:0};else if(this.start.row<x)var r={row:x,column:0};return L.fromPoints(r||this.start,l||this.end)},L.prototype.extend=function(x,s){var l=this.compare(x,s);if(l==0)return this;if(l==-1)var r={row:x,column:s};else var e={row:x,column:s};return L.fromPoints(r||this.start,e||this.end)},L.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},L.prototype.isMultiLine=function(){return this.start.row!==this.end.row},L.prototype.clone=function(){return L.fromPoints(this.start,this.end)},L.prototype.collapseRows=function(){return this.end.column==0?new L(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new L(this.start.row,0,this.end.row,0)},L.prototype.toScreenRange=function(x){var s=x.documentToScreenPosition(this.start),l=x.documentToScreenPosition(this.end);return new L(s.row,s.column,l.row,l.column)},L.prototype.moveBy=function(x,s){this.start.row+=x,this.start.column+=s,this.end.row+=x,this.end.column+=s;},L}();R.fromPoints=function(L,x){return new R(L.row,L.column,x.row,x.column)},R.comparePoints=function(L,x){return L.row-x.row||L.column-x.column},M.Range=R;});ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(k,M,H){for(var R=k("./oop"),L={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","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},x={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},s=0;s<10;s++)x["Digit"+s]=48+s,x["Numpad"+s]=96+s,L.PRINTABLE_KEYS[48+s]=""+s,L.FUNCTION_KEYS[96+s]="Numpad"+s;for(var s=65;s<91;s++){var l=String.fromCharCode(s+32);x["Key"+l.toUpperCase()]=s,L.PRINTABLE_KEYS[s]=l;}for(var s=1;s<13;s++)x["F"+s]=111+s,L.FUNCTION_KEYS[111+s]="F"+s;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var e in r)x[e]=x[e+"Left"]=x[e+"Right"]=r[e];M.$codeToKeyCode=x,L.PRINTABLE_KEYS[173]="-";for(var i in L.FUNCTION_KEYS){var n=L.FUNCTION_KEYS[i].toLowerCase();L[n]=parseInt(i,10);}for(var i in L.PRINTABLE_KEYS){var n=L.PRINTABLE_KEYS[i].toLowerCase();L[n]=parseInt(i,10);}R.mixin(L,L.MODIFIER_KEYS),R.mixin(L,L.PRINTABLE_KEYS),R.mixin(L,L.FUNCTION_KEYS),L.enter=L.return,L.escape=L.esc,L.del=L.delete,function(){for(var t=["cmd","ctrl","alt","shift"],o=Math.pow(2,t.length);o--;)L.KEY_MODS[o]=t.filter(function(a){return o&L.KEY_MODS[a]}).join("-")+"-";}(),L.KEY_MODS[0]="",L.KEY_MODS[-1]="input-",R.mixin(M,L),M.default=M,M.keyCodeToString=function(t){var o=L[t];return typeof o!="string"&&(o=String.fromCharCode(t)),o.toLowerCase()};});ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,M,H){var R=k("./keys"),L=k("./useragent"),x=null,s=0,l;function r(){l=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return l={passive:!1},!0}});}catch{}}function e(){return l==null&&r(),l}function i(S,m,$){this.elem=S,this.type=m,this.callback=$;}i.prototype.destroy=function(){t(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0;};var n=M.addListener=function(S,m,$,d){S.addEventListener(m,$,e()),d&&d.$toDestroy.push(new i(S,m,$));},t=M.removeListener=function(S,m,$){S.removeEventListener(m,$,e());};M.stopEvent=function(S){return M.stopPropagation(S),M.preventDefault(S),!1},M.stopPropagation=function(S){S.stopPropagation&&S.stopPropagation();},M.preventDefault=function(S){S.preventDefault&&S.preventDefault();},M.getButton=function(S){return S.type=="dblclick"?0:S.type=="contextmenu"||L.isMac&&S.ctrlKey&&!S.altKey&&!S.shiftKey?2:S.button},M.capture=function(S,m,$){var d=S&&S.ownerDocument||document;function h(v){m&&m(v),$&&$(v),t(d,"mousemove",m),t(d,"mouseup",h),t(d,"dragstart",h);}return n(d,"mousemove",m),n(d,"mouseup",h),n(d,"dragstart",h),h},M.addMouseWheelListener=function(S,m,$){n(S,"wheel",function(d){var h=.15,v=d.deltaX||0,C=d.deltaY||0;switch(d.deltaMode){case d.DOM_DELTA_PIXEL:d.wheelX=v*h,d.wheelY=C*h;break;case d.DOM_DELTA_LINE:var y=15;d.wheelX=v*y,d.wheelY=C*y;break;case d.DOM_DELTA_PAGE:var b=150;d.wheelX=v*b,d.wheelY=C*b;break}m(d);},$);},M.addMultiMouseDownListener=function(S,m,$,d,h){var v=0,C,y,b,f={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(c){if(M.getButton(c)!==0?v=0:c.detail>1?(v++,v>4&&(v=1)):v=1,L.isIE){var g=Math.abs(c.clientX-C)>5||Math.abs(c.clientY-y)>5;(!b||g)&&(v=1),b&&clearTimeout(b),b=setTimeout(function(){b=null;},m[v-1]||600),v==1&&(C=c.clientX,y=c.clientY);}if(c._clicks=v,$[d]("mousedown",c),v>4)v=0;else if(v>1)return $[d](f[v],c)}Array.isArray(S)||(S=[S]),S.forEach(function(c){n(c,"mousedown",p,h);});};function o(S){return 0|(S.ctrlKey?1:0)|(S.altKey?2:0)|(S.shiftKey?4:0)|(S.metaKey?8:0)}M.getModifierString=function(S){return R.KEY_MODS[o(S)]};function a(S,m,$){var d=o(m);if(!$&&m.code&&($=R.$codeToKeyCode[m.code]||$),!L.isMac&&x){if(m.getModifierState&&(m.getModifierState("OS")||m.getModifierState("Win"))&&(d|=8),x.altGr)if((3&d)!=3)x.altGr=0;else return;if($===18||$===17){var h=m.location;if($===17&&h===1)x[$]==1&&(s=m.timeStamp);else if($===18&&d===3&&h===2){var v=m.timeStamp-s;v<50&&(x.altGr=!0);}}}if($ in R.MODIFIER_KEYS&&($=-1),!(!d&&$===13&&m.location===3&&(S(m,d,-$),m.defaultPrevented))){if(L.isChromeOS&&d&8){if(S(m,d,$),m.defaultPrevented)return;d&=-9;}return !d&&!($ in R.FUNCTION_KEYS)&&!($ in R.PRINTABLE_KEYS)?!1:S(m,d,$)}}M.addCommandKeyListener=function(S,m,$){var d=null;n(S,"keydown",function(h){x[h.keyCode]=(x[h.keyCode]||0)+1;var v=a(m,h,h.keyCode);return d=h.defaultPrevented,v},$),n(S,"keypress",function(h){d&&(h.ctrlKey||h.altKey||h.shiftKey||h.metaKey)&&(M.stopEvent(h),d=null);},$),n(S,"keyup",function(h){x[h.keyCode]=null;},$),x||(u(),n(window,"focus",u));};function u(){x=Object.create(null);}if(typeof window=="object"&&window.postMessage&&!L.isOldIE){var w=1;M.nextTick=function(S,m){m=m||window;var $="zero-timeout-message-"+w++,d=function(h){h.data==$&&(M.stopPropagation(h),t(m,"message",d),S());};n(m,"message",d),m.postMessage($,"*");};}M.$idleBlocked=!1,M.onIdle=function(S,m){return setTimeout(function $(){M.$idleBlocked?setTimeout($,100):S();},m)},M.$idleBlockId=null,M.blockIdle=function(S){M.$idleBlockId&&clearTimeout(M.$idleBlockId),M.$idleBlocked=!0,M.$idleBlockId=setTimeout(function(){M.$idleBlocked=!1;},S||100);},M.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),M.nextFrame?M.nextFrame=M.nextFrame.bind(window):M.nextFrame=function(S){setTimeout(S,17);};});ace.define("ace/clipboard",["require","exports","module"],function(k,M,H){var R;H.exports={lineMode:!1,pasteCancelled:function(){return R&&R>Date.now()-50?!0:R=!1},cancel:function(){R=Date.now();}};});ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(k,M,H){var R=k("../lib/event"),L=k("../config").nls,x=k("../lib/useragent"),s=k("../lib/dom"),l=k("../lib/lang"),r=k("../clipboard"),e=x.isChrome<18,i=x.isIE,n=x.isChrome>63,t=400,o=k("../lib/keys"),a=o.KEY_MODS,u=x.isIOS,w=u?/\s/:/\n/,S=x.isMobile,m;m=function($,d){var h=s.createElement("textarea");h.className="ace_text-input",h.setAttribute("wrap","off"),h.setAttribute("autocorrect","off"),h.setAttribute("autocapitalize","off"),h.setAttribute("spellcheck","false"),h.style.opacity="0",$.insertBefore(h,$.firstChild);var v=!1,C=!1,y=!1,b=!1,f="";S||(h.style.fontSize="1px");var p=!1,c=!1,g="",A=0,T=0,E=0,_=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER,I=0;try{var N=document.activeElement===h;}catch{}this.setNumberOfExtraLines=function(P){if(_=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER,P<0){I=0;return}I=P;},this.setAriaOptions=function(P){if(P.activeDescendant?(h.setAttribute("aria-haspopup","true"),h.setAttribute("aria-autocomplete",P.inline?"both":"list"),h.setAttribute("aria-activedescendant",P.activeDescendant)):(h.setAttribute("aria-haspopup","false"),h.setAttribute("aria-autocomplete","both"),h.removeAttribute("aria-activedescendant")),P.role&&h.setAttribute("role",P.role),P.setLabel){h.setAttribute("aria-roledescription",L("text-input.aria-roledescription","editor"));var j="";if(d.$textInputAriaLabel&&(j+="".concat(d.$textInputAriaLabel,", ")),d.session){var X=d.session.selection.cursor.row;j+=L("text-input.aria-label","Cursor at row $0",[X+1]);}h.setAttribute("aria-label",j);}},this.setAriaOptions({role:"textbox"}),R.addListener(h,"blur",function(P){c||(d.onBlur(P),N=!1);},d),R.addListener(h,"focus",function(P){if(!c){if(N=!0,x.isEdge)try{if(!document.hasFocus())return}catch{}d.onFocus(P),x.isEdge?setTimeout(D):D();}},d),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:d.renderer.enableKeyboardAccessibility}),f||n||this.$focusScroll=="browser")return h.focus({preventScroll:!0});var P=h.style.top;h.style.position="fixed",h.style.top="0px";try{var j=h.getBoundingClientRect().top!=0;}catch{return}var X=[];if(j)for(var Z=h.parentElement;Z&&Z.nodeType==1;)X.push(Z),Z.setAttribute("ace_nocontext","true"),!Z.parentElement&&Z.getRootNode?Z=Z.getRootNode().host:Z=Z.parentElement;h.focus({preventScroll:!0}),j&&X.forEach(function(te){te.removeAttribute("ace_nocontext");}),setTimeout(function(){h.style.position="",h.style.top=="0px"&&(h.style.top=P);},0);},this.blur=function(){h.blur();},this.isFocused=function(){return N},d.on("beforeEndOperation",function(){var P=d.curOp,j=P&&P.command&&P.command.name;if(j!="insertstring"){var X=j&&(P.docChanged||P.selectionChanged);y&&X&&(g=h.value="",pe()),D();}});var F=function(P,j){for(var X=j,Z=1;Z<=P-_&&Z<2*I+1;Z++)X+=d.session.getLine(P-Z).length+1;return X},D=u?function(P){if(!(!N||v&&!P||b)){P||(P="");var j=`
186
+ `;});ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(k,M,H){M.isDark=!1,M.cssClass="ace-tm",M.cssText=k("./textmate-css"),M.$id="ace/theme/textmate";var R=k("../lib/dom");R.importCssString(M.cssText,M.cssClass,!1);});ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(k,M,H){"no use strict";var R=k("./lib/lang"),L=k("./lib/net"),x=k("./lib/dom"),s=k("./lib/app_config").AppConfig;H.exports=M=new s;var c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};M.get=function(n){if(!c.hasOwnProperty(n))throw new Error("Unknown config key: "+n);return c[n]},M.set=function(n,e){if(c.hasOwnProperty(n))c[n]=e;else if(this.setDefaultValue("",n,e)==!1)throw new Error("Unknown config key: "+n);n=="useStrictCSP"&&x.useStrictCSP(e);},M.all=function(){return R.copyObject(c)},M.$modes={},M.moduleUrl=function(n,e){if(c.$moduleUrls[n])return c.$moduleUrls[n];var o=n.split("/");e=e||o[o.length-2]||"";var a=e=="snippets"?"/":"-",u=o[o.length-1];if(e=="worker"&&a=="-"){var w=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");u=u.replace(w,"");}(!u||u==e)&&o.length>1&&(u=o[o.length-2]);var S=c[e+"Path"];return S==null?S=c.basePath:a=="/"&&(e=a=""),S&&S.slice(-1)!="/"&&(S+="/"),S+e+a+u+this.get("suffix")},M.setModuleUrl=function(n,e){return c.$moduleUrls[n]=e};var r=function(n,e){if(n==="ace/theme/textmate"||n==="./theme/textmate")return e(null,k("./theme/textmate"));if(t)return t(n,e);console.error("loader is not configured");},t;M.setLoader=function(n){t=n;},M.dynamicModules=Object.create(null),M.$loading={},M.$loaded={},M.loadModule=function(n,e){var o;if(Array.isArray(n))var a=n[0],u=n[1];else if(typeof n=="string")var u=n;var w=function(S){if(S&&!M.$loading[u])return e&&e(S);if(M.$loading[u]||(M.$loading[u]=[]),M.$loading[u].push(e),!(M.$loading[u].length>1)){var m=function(){r(u,function($,d){d&&(M.$loaded[u]=d),M._emit("load.module",{name:u,module:d});var h=M.$loading[u];M.$loading[u]=null,h.forEach(function(v){v&&v(d);});});};if(!M.get("packaged"))return m();L.loadScript(M.moduleUrl(u,a),m),i();}};if(M.dynamicModules[u])M.dynamicModules[u]().then(function(S){S.default?w(S.default):w(S);});else {try{o=this.$require(u);}catch{}w(o||M.$loaded[u]);}},M.$require=function(n){if(typeof H.require=="function"){var e="require";return H[e](n)}},M.setModuleLoader=function(n,e){M.dynamicModules[n]=e;};var i=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),i=function(){});};M.version="1.35.4";});ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(k,M,H){k("./lib/fixoldbrowsers");var R=k("./config");R.setLoader(function(c,r){k([c],function(t){r(null,t);});});var L=function(){return this||typeof window<"u"&&window}();H.exports=function(c){R.init=x,R.$require=k,c.require=k,typeof define=="function"&&(c.define=define);},x(!0);function x(c){if(!(!L||!L.document)){R.set("packaged",c||k.packaged||H.packaged||L.define&&define.packaged);var r={},t="",i=document.currentScript||document._currentScript,n=i&&i.ownerDocument||document;i&&i.src&&(t=i.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=n.getElementsByTagName("script"),o=0;o<e.length;o++){var a=e[o],u=a.src||a.getAttribute("src");if(u){for(var w=a.attributes,S=0,m=w.length;S<m;S++){var $=w[S];$.name.indexOf("data-ace-")===0&&(r[s($.name.replace(/^data-ace-/,""))]=$.value);}var d=u.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);d&&(t=d[1]);}}t&&(r.base=r.base||t,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var h in r)typeof r[h]<"u"&&R.set(h,r[h]);}}function s(c){return c.replace(/-(.)/g,function(r,t){return t.toUpperCase()})}});ace.define("ace/range",["require","exports","module"],function(k,M,H){var R=function(){function L(x,s,c,r){this.start={row:x,column:s},this.end={row:c,column:r};}return L.prototype.isEqual=function(x){return this.start.row===x.start.row&&this.end.row===x.end.row&&this.start.column===x.start.column&&this.end.column===x.end.column},L.prototype.toString=function(){return "Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},L.prototype.contains=function(x,s){return this.compare(x,s)==0},L.prototype.compareRange=function(x){var s,c=x.end,r=x.start;return s=this.compare(c.row,c.column),s==1?(s=this.compare(r.row,r.column),s==1?2:s==0?1:0):s==-1?-2:(s=this.compare(r.row,r.column),s==-1?-1:s==1?42:0)},L.prototype.comparePoint=function(x){return this.compare(x.row,x.column)},L.prototype.containsRange=function(x){return this.comparePoint(x.start)==0&&this.comparePoint(x.end)==0},L.prototype.intersects=function(x){var s=this.compareRange(x);return s==-1||s==0||s==1},L.prototype.isEnd=function(x,s){return this.end.row==x&&this.end.column==s},L.prototype.isStart=function(x,s){return this.start.row==x&&this.start.column==s},L.prototype.setStart=function(x,s){typeof x=="object"?(this.start.column=x.column,this.start.row=x.row):(this.start.row=x,this.start.column=s);},L.prototype.setEnd=function(x,s){typeof x=="object"?(this.end.column=x.column,this.end.row=x.row):(this.end.row=x,this.end.column=s);},L.prototype.inside=function(x,s){return this.compare(x,s)==0?!(this.isEnd(x,s)||this.isStart(x,s)):!1},L.prototype.insideStart=function(x,s){return this.compare(x,s)==0?!this.isEnd(x,s):!1},L.prototype.insideEnd=function(x,s){return this.compare(x,s)==0?!this.isStart(x,s):!1},L.prototype.compare=function(x,s){return !this.isMultiLine()&&x===this.start.row?s<this.start.column?-1:s>this.end.column?1:0:x<this.start.row?-1:x>this.end.row?1:this.start.row===x?s>=this.start.column?0:-1:this.end.row===x?s<=this.end.column?0:1:0},L.prototype.compareStart=function(x,s){return this.start.row==x&&this.start.column==s?-1:this.compare(x,s)},L.prototype.compareEnd=function(x,s){return this.end.row==x&&this.end.column==s?1:this.compare(x,s)},L.prototype.compareInside=function(x,s){return this.end.row==x&&this.end.column==s?1:this.start.row==x&&this.start.column==s?-1:this.compare(x,s)},L.prototype.clipRows=function(x,s){if(this.end.row>s)var c={row:s+1,column:0};else if(this.end.row<x)var c={row:x,column:0};if(this.start.row>s)var r={row:s+1,column:0};else if(this.start.row<x)var r={row:x,column:0};return L.fromPoints(r||this.start,c||this.end)},L.prototype.extend=function(x,s){var c=this.compare(x,s);if(c==0)return this;if(c==-1)var r={row:x,column:s};else var t={row:x,column:s};return L.fromPoints(r||this.start,t||this.end)},L.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},L.prototype.isMultiLine=function(){return this.start.row!==this.end.row},L.prototype.clone=function(){return L.fromPoints(this.start,this.end)},L.prototype.collapseRows=function(){return this.end.column==0?new L(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new L(this.start.row,0,this.end.row,0)},L.prototype.toScreenRange=function(x){var s=x.documentToScreenPosition(this.start),c=x.documentToScreenPosition(this.end);return new L(s.row,s.column,c.row,c.column)},L.prototype.moveBy=function(x,s){this.start.row+=x,this.start.column+=s,this.end.row+=x,this.end.column+=s;},L}();R.fromPoints=function(L,x){return new R(L.row,L.column,x.row,x.column)},R.comparePoints=function(L,x){return L.row-x.row||L.column-x.column},M.Range=R;});ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(k,M,H){for(var R=k("./oop"),L={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","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},x={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},s=0;s<10;s++)x["Digit"+s]=48+s,x["Numpad"+s]=96+s,L.PRINTABLE_KEYS[48+s]=""+s,L.FUNCTION_KEYS[96+s]="Numpad"+s;for(var s=65;s<91;s++){var c=String.fromCharCode(s+32);x["Key"+c.toUpperCase()]=s,L.PRINTABLE_KEYS[s]=c;}for(var s=1;s<13;s++)x["F"+s]=111+s,L.FUNCTION_KEYS[111+s]="F"+s;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var t in r)x[t]=x[t+"Left"]=x[t+"Right"]=r[t];M.$codeToKeyCode=x,L.PRINTABLE_KEYS[173]="-";for(var i in L.FUNCTION_KEYS){var n=L.FUNCTION_KEYS[i].toLowerCase();L[n]=parseInt(i,10);}for(var i in L.PRINTABLE_KEYS){var n=L.PRINTABLE_KEYS[i].toLowerCase();L[n]=parseInt(i,10);}R.mixin(L,L.MODIFIER_KEYS),R.mixin(L,L.PRINTABLE_KEYS),R.mixin(L,L.FUNCTION_KEYS),L.enter=L.return,L.escape=L.esc,L.del=L.delete,function(){for(var e=["cmd","ctrl","alt","shift"],o=Math.pow(2,e.length);o--;)L.KEY_MODS[o]=e.filter(function(a){return o&L.KEY_MODS[a]}).join("-")+"-";}(),L.KEY_MODS[0]="",L.KEY_MODS[-1]="input-",R.mixin(M,L),M.default=M,M.keyCodeToString=function(e){var o=L[e];return typeof o!="string"&&(o=String.fromCharCode(e)),o.toLowerCase()};});ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,M,H){var R=k("./keys"),L=k("./useragent"),x=null,s=0,c;function r(){c=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return c={passive:!1},!0}});}catch{}}function t(){return c==null&&r(),c}function i(S,m,$){this.elem=S,this.type=m,this.callback=$;}i.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0;};var n=M.addListener=function(S,m,$,d){S.addEventListener(m,$,t()),d&&d.$toDestroy.push(new i(S,m,$));},e=M.removeListener=function(S,m,$){S.removeEventListener(m,$,t());};M.stopEvent=function(S){return M.stopPropagation(S),M.preventDefault(S),!1},M.stopPropagation=function(S){S.stopPropagation&&S.stopPropagation();},M.preventDefault=function(S){S.preventDefault&&S.preventDefault();},M.getButton=function(S){return S.type=="dblclick"?0:S.type=="contextmenu"||L.isMac&&S.ctrlKey&&!S.altKey&&!S.shiftKey?2:S.button},M.capture=function(S,m,$){var d=S&&S.ownerDocument||document;function h(v){m&&m(v),$&&$(v),e(d,"mousemove",m),e(d,"mouseup",h),e(d,"dragstart",h);}return n(d,"mousemove",m),n(d,"mouseup",h),n(d,"dragstart",h),h},M.addMouseWheelListener=function(S,m,$){n(S,"wheel",function(d){var h=.15,v=d.deltaX||0,C=d.deltaY||0;switch(d.deltaMode){case d.DOM_DELTA_PIXEL:d.wheelX=v*h,d.wheelY=C*h;break;case d.DOM_DELTA_LINE:var y=15;d.wheelX=v*y,d.wheelY=C*y;break;case d.DOM_DELTA_PAGE:var b=150;d.wheelX=v*b,d.wheelY=C*b;break}m(d);},$);},M.addMultiMouseDownListener=function(S,m,$,d,h){var v=0,C,y,b,f={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(l){if(M.getButton(l)!==0?v=0:l.detail>1?(v++,v>4&&(v=1)):v=1,L.isIE){var g=Math.abs(l.clientX-C)>5||Math.abs(l.clientY-y)>5;(!b||g)&&(v=1),b&&clearTimeout(b),b=setTimeout(function(){b=null;},m[v-1]||600),v==1&&(C=l.clientX,y=l.clientY);}if(l._clicks=v,$[d]("mousedown",l),v>4)v=0;else if(v>1)return $[d](f[v],l)}Array.isArray(S)||(S=[S]),S.forEach(function(l){n(l,"mousedown",p,h);});};function o(S){return 0|(S.ctrlKey?1:0)|(S.altKey?2:0)|(S.shiftKey?4:0)|(S.metaKey?8:0)}M.getModifierString=function(S){return R.KEY_MODS[o(S)]};function a(S,m,$){var d=o(m);if(!$&&m.code&&($=R.$codeToKeyCode[m.code]||$),!L.isMac&&x){if(m.getModifierState&&(m.getModifierState("OS")||m.getModifierState("Win"))&&(d|=8),x.altGr)if((3&d)!=3)x.altGr=0;else return;if($===18||$===17){var h=m.location;if($===17&&h===1)x[$]==1&&(s=m.timeStamp);else if($===18&&d===3&&h===2){var v=m.timeStamp-s;v<50&&(x.altGr=!0);}}}if($ in R.MODIFIER_KEYS&&($=-1),!(!d&&$===13&&m.location===3&&(S(m,d,-$),m.defaultPrevented))){if(L.isChromeOS&&d&8){if(S(m,d,$),m.defaultPrevented)return;d&=-9;}return !d&&!($ in R.FUNCTION_KEYS)&&!($ in R.PRINTABLE_KEYS)?!1:S(m,d,$)}}M.addCommandKeyListener=function(S,m,$){var d=null;n(S,"keydown",function(h){x[h.keyCode]=(x[h.keyCode]||0)+1;var v=a(m,h,h.keyCode);return d=h.defaultPrevented,v},$),n(S,"keypress",function(h){d&&(h.ctrlKey||h.altKey||h.shiftKey||h.metaKey)&&(M.stopEvent(h),d=null);},$),n(S,"keyup",function(h){x[h.keyCode]=null;},$),x||(u(),n(window,"focus",u));};function u(){x=Object.create(null);}if(typeof window=="object"&&window.postMessage&&!L.isOldIE){var w=1;M.nextTick=function(S,m){m=m||window;var $="zero-timeout-message-"+w++,d=function(h){h.data==$&&(M.stopPropagation(h),e(m,"message",d),S());};n(m,"message",d),m.postMessage($,"*");};}M.$idleBlocked=!1,M.onIdle=function(S,m){return setTimeout(function $(){M.$idleBlocked?setTimeout($,100):S();},m)},M.$idleBlockId=null,M.blockIdle=function(S){M.$idleBlockId&&clearTimeout(M.$idleBlockId),M.$idleBlocked=!0,M.$idleBlockId=setTimeout(function(){M.$idleBlocked=!1;},S||100);},M.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),M.nextFrame?M.nextFrame=M.nextFrame.bind(window):M.nextFrame=function(S){setTimeout(S,17);};});ace.define("ace/clipboard",["require","exports","module"],function(k,M,H){var R;H.exports={lineMode:!1,pasteCancelled:function(){return R&&R>Date.now()-50?!0:R=!1},cancel:function(){R=Date.now();}};});ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(k,M,H){var R=k("../lib/event"),L=k("../config").nls,x=k("../lib/useragent"),s=k("../lib/dom"),c=k("../lib/lang"),r=k("../clipboard"),t=x.isChrome<18,i=x.isIE,n=x.isChrome>63,e=400,o=k("../lib/keys"),a=o.KEY_MODS,u=x.isIOS,w=u?/\s/:/\n/,S=x.isMobile,m;m=function($,d){var h=s.createElement("textarea");h.className="ace_text-input",h.setAttribute("wrap","off"),h.setAttribute("autocorrect","off"),h.setAttribute("autocapitalize","off"),h.setAttribute("spellcheck","false"),h.style.opacity="0",$.insertBefore(h,$.firstChild);var v=!1,C=!1,y=!1,b=!1,f="";S||(h.style.fontSize="1px");var p=!1,l=!1,g="",A=0,T=0,E=0,_=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER,I=0;try{var N=document.activeElement===h;}catch{}this.setNumberOfExtraLines=function(P){if(_=Number.MAX_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER,P<0){I=0;return}I=P;},this.setAriaOptions=function(P){if(P.activeDescendant?(h.setAttribute("aria-haspopup","true"),h.setAttribute("aria-autocomplete",P.inline?"both":"list"),h.setAttribute("aria-activedescendant",P.activeDescendant)):(h.setAttribute("aria-haspopup","false"),h.setAttribute("aria-autocomplete","both"),h.removeAttribute("aria-activedescendant")),P.role&&h.setAttribute("role",P.role),P.setLabel){h.setAttribute("aria-roledescription",L("text-input.aria-roledescription","editor"));var j="";if(d.$textInputAriaLabel&&(j+="".concat(d.$textInputAriaLabel,", ")),d.session){var X=d.session.selection.cursor.row;j+=L("text-input.aria-label","Cursor at row $0",[X+1]);}h.setAttribute("aria-label",j);}},this.setAriaOptions({role:"textbox"}),R.addListener(h,"blur",function(P){l||(d.onBlur(P),N=!1);},d),R.addListener(h,"focus",function(P){if(!l){if(N=!0,x.isEdge)try{if(!document.hasFocus())return}catch{}d.onFocus(P),x.isEdge?setTimeout(D):D();}},d),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:d.renderer.enableKeyboardAccessibility}),f||n||this.$focusScroll=="browser")return h.focus({preventScroll:!0});var P=h.style.top;h.style.position="fixed",h.style.top="0px";try{var j=h.getBoundingClientRect().top!=0;}catch{return}var X=[];if(j)for(var Z=h.parentElement;Z&&Z.nodeType==1;)X.push(Z),Z.setAttribute("ace_nocontext","true"),!Z.parentElement&&Z.getRootNode?Z=Z.getRootNode().host:Z=Z.parentElement;h.focus({preventScroll:!0}),j&&X.forEach(function(te){te.removeAttribute("ace_nocontext");}),setTimeout(function(){h.style.position="",h.style.top=="0px"&&(h.style.top=P);},0);},this.blur=function(){h.blur();},this.isFocused=function(){return N},d.on("beforeEndOperation",function(){var P=d.curOp,j=P&&P.command&&P.command.name;if(j!="insertstring"){var X=j&&(P.docChanged||P.selectionChanged);y&&X&&(g=h.value="",pe()),D();}});var F=function(P,j){for(var X=j,Z=1;Z<=P-_&&Z<2*I+1;Z++)X+=d.session.getLine(P-Z).length+1;return X},D=u?function(P){if(!(!N||v&&!P||b)){P||(P="");var j=`
186
187
  ab`+P+`cde fg
187
188
  `;j!=h.value&&(h.value=g=j);var X=4,Z=4+(P.length||(d.selection.isEmpty()?0:1));(A!=X||T!=Z)&&h.setSelectionRange(X,Z),A=X,T=Z;}}:function(){if(!(y||b)&&!(!N&&!G)){y=!0;var P=0,j=0,X="";if(d.session){var Z=d.selection,te=Z.getRange(),oe=Z.cursor.row;oe===O+1?(_=O+1,O=_+2*I):oe===_-1?(O=_-1,_=O-2*I):(oe<_-1||oe>O+1)&&(_=oe>I?oe-I:0,O=oe>I?oe+I:2*I);for(var le=[],se=_;se<=O;se++)le.push(d.session.getLine(se));if(X=le.join(`
188
189
  `),P=F(te.start.row,te.start.column),j=F(te.end.row,te.end.column),te.start.row<_){var re=d.session.getLine(_-1);P=te.start.row<_-1?0:P,j+=re.length+1,X=re+`
189
190
  `+X;}else if(te.end.row>O){var ie=d.session.getLine(O+1);j=te.end.row>O+1?ie.length:te.end.column,j+=X.length+1,X=X+`
190
191
  `+ie;}else S&&oe>0&&(X=`
191
- `+X,j+=1,P+=1);X.length>t&&(P<t&&j<t?X=X.slice(0,t):(X=`
192
+ `+X,j+=1,P+=1);X.length>e&&(P<e&&j<e?X=X.slice(0,e):(X=`
192
193
  `,P==j?P=j=0:(P=0,j=1)));var he=X+`
193
194
 
194
195
  `;he!=g&&(h.value=g=he,A=T=he.length);}if(G&&(A=h.selectionStart,T=h.selectionEnd),T!=j||A!=P||h.selectionEnd!=T)try{h.setSelectionRange(P,j),A=P,T=j;}catch{}y=!1;}};this.resetSelection=D,N&&d.onFocus();var W=function(P){return P.selectionStart===0&&P.selectionEnd>=g.length&&P.value===g&&g&&P.selectionEnd!==T},B=function(P){y||(v?v=!1:W(h)?(d.selectAll(),D()):S&&h.selectionStart!=A&&D());},z=null;this.setInputHandler=function(P){z=P;},this.getInputHandler=function(){return z};var G=!1,U=function(P,j){if(G&&(G=!1),C)return D(),P&&d.onPaste(P),C=!1,"";for(var X=h.selectionStart,Z=h.selectionEnd,te=A,oe=g.length-T,le=P,se=P.length-X,re=P.length-Z,ie=0;te>0&&g[ie]==P[ie];)ie++,te--;for(le=le.slice(ie),ie=1;oe>0&&g.length-ie>A-1&&g[g.length-ie]==P[P.length-ie];)ie++,oe--;se-=ie-1,re-=ie-1;var he=le.length-ie+1;if(he<0&&(te=-he,he=0),le=le.slice(0,he),!j&&!le&&!se&&!te&&!oe&&!re)return "";b=!0;var Ae=!1;return x.isAndroid&&le==". "&&(le=" ",Ae=!0),le&&!te&&!oe&&!se&&!re||p?d.onTextInput(le):d.onTextInput(le,{extendLeft:te,extendRight:oe,restoreStart:se,restoreEnd:re}),b=!1,g=P,A=X,T=Z,E=re,Ae?`
195
- `:le},V=function(P){if(y)return ne();if(P&&P.inputType){if(P.inputType=="historyUndo")return d.execCommand("undo");if(P.inputType=="historyRedo")return d.execCommand("redo")}var j=h.value,X=U(j,!0);(j.length>t+100||w.test(X)||S&&A<1&&A==T)&&D();},Y=function(P,j,X){var Z=P.clipboardData||window.clipboardData;if(!(!Z||e)){var te=i||X?"Text":"text/plain";try{return j?Z.setData(te,j)!==!1:Z.getData(te)}catch(oe){if(!X)return Y(oe,j,!0)}}},K=function(P,j){var X=d.getCopyText();if(!X)return R.preventDefault(P);Y(P,X)?(u&&(D(X),v=X,setTimeout(function(){v=!1;},10)),j?d.onCut():d.onCopy(),R.preventDefault(P)):(v=!0,h.value=X,h.select(),setTimeout(function(){v=!1,D(),j?d.onCut():d.onCopy();}));},J=function(P){K(P,!0);},q=function(P){K(P,!1);},ee=function(P){var j=Y(P);r.pasteCancelled()||(typeof j=="string"?(j&&d.onPaste(j,P),x.isIE&&setTimeout(D),R.preventDefault(P)):(h.value="",C=!0));};R.addCommandKeyListener(h,function(P,j,X){if(!y)return d.onCommandKey(P,j,X)},d),R.addListener(h,"select",B,d),R.addListener(h,"input",V,d),R.addListener(h,"cut",J,d),R.addListener(h,"copy",q,d),R.addListener(h,"paste",ee,d),(!("oncut"in h)||!("oncopy"in h)||!("onpaste"in h))&&R.addListener($,"keydown",function(P){if(!(x.isMac&&!P.metaKey||!P.ctrlKey))switch(P.keyCode){case 67:q(P);break;case 86:ee(P);break;case 88:J(P);break}},d);var Q=function(P){if(!(y||!d.onCompositionStart||d.$readOnly)&&(y={},!p)){P.data&&(y.useTextareaForIME=!1),setTimeout(ne,0),d._signal("compositionStart"),d.on("mousedown",ge);var j=d.getSelectionRange();j.end.row=j.start.row,j.end.column=j.start.column,y.markerRange=j,y.selectionStart=A,d.onCompositionStart(y),y.useTextareaForIME?(g=h.value="",A=0,T=0):(h.msGetInputContext&&(y.context=h.msGetInputContext()),h.getInputContext&&(y.context=h.getInputContext()));}},ne=function(){if(!(!y||!d.onCompositionUpdate||d.$readOnly)){if(p)return ge();if(y.useTextareaForIME)d.onCompositionUpdate(h.value);else {var P=h.value;U(P),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+T-y.selectionStart+E);}}},pe=function(P){!d.onCompositionEnd||d.$readOnly||(y=!1,d.onCompositionEnd(),d.off("mousedown",ge),P&&V());};function ge(){c=!0,h.blur(),h.focus(),c=!1;}var ue=l.delayedCall(ne,50).schedule.bind(null,null);function ae(P){P.keyCode==27&&h.value.length<h.selectionStart&&(y||(g=h.value),A=T=-1,D()),ue();}R.addListener(h,"compositionstart",Q,d),R.addListener(h,"compositionupdate",ne,d),R.addListener(h,"keyup",ae,d),R.addListener(h,"keydown",ue,d),R.addListener(h,"compositionend",pe,d),this.getElement=function(){return h},this.setCommandMode=function(P){p=P,h.readOnly=!1;},this.setReadOnly=function(P){p||(h.readOnly=P);},this.setCopyWithEmptySelection=function(P){},this.onContextMenu=function(P){G=!0,D(),d._emit("nativecontextmenu",{target:d,domEvent:P}),this.moveToMouse(P,!0);},this.moveToMouse=function(P,j){f||(f=h.style.cssText),h.style.cssText=(j?"z-index:100000;":"")+(x.isIE?"opacity:0.1;":"")+"text-indent: -"+(A+T)*d.renderer.characterWidth*.5+"px;";var X=d.container.getBoundingClientRect(),Z=s.computedStyle(d.container),te=X.top+(parseInt(Z.borderTopWidth)||0),oe=X.left+(parseInt(X.borderLeftWidth)||0),le=X.bottom-te-h.clientHeight-2,se=function(re){s.translate(h,re.clientX-oe-2,Math.min(re.clientY-te-2,le));};se(P),P.type=="mousedown"&&(d.renderer.$isMousePressed=!0,clearTimeout(ce),x.isWin&&R.capture(d.container,se,we));},this.onContextMenuClose=we;var ce;function we(){clearTimeout(ce),ce=setTimeout(function(){f&&(h.style.cssText=f,f=""),d.renderer.$isMousePressed=!1,d.renderer.$keepTextAreaAtCursor&&d.renderer.$moveTextAreaToCursor();},0);}var me=function(P){d.textInput.onContextMenu(P),we();};R.addListener(h,"mouseup",me,d),R.addListener(h,"mousedown",function(P){P.preventDefault(),we();},d),R.addListener(d.renderer.scroller,"contextmenu",me,d),R.addListener(h,"contextmenu",me,d),u&&It($,d,h);function It(P,j,X){var Z=null,te=!1;X.addEventListener("keydown",function(le){Z&&clearTimeout(Z),te=!0;},!0),X.addEventListener("keyup",function(le){Z=setTimeout(function(){te=!1;},100);},!0);var oe=function(le){if(document.activeElement===X&&!(te||y||j.$mouseHandler.isMousePressed)&&!v){var se=X.selectionStart,re=X.selectionEnd,ie=null,he=0;if(se==0?ie=o.up:se==1?ie=o.home:re>T&&g[re]==`
196
+ `:le},V=function(P){if(y)return ne();if(P&&P.inputType){if(P.inputType=="historyUndo")return d.execCommand("undo");if(P.inputType=="historyRedo")return d.execCommand("redo")}var j=h.value,X=U(j,!0);(j.length>e+100||w.test(X)||S&&A<1&&A==T)&&D();},Y=function(P,j,X){var Z=P.clipboardData||window.clipboardData;if(!(!Z||t)){var te=i||X?"Text":"text/plain";try{return j?Z.setData(te,j)!==!1:Z.getData(te)}catch(oe){if(!X)return Y(oe,j,!0)}}},K=function(P,j){var X=d.getCopyText();if(!X)return R.preventDefault(P);Y(P,X)?(u&&(D(X),v=X,setTimeout(function(){v=!1;},10)),j?d.onCut():d.onCopy(),R.preventDefault(P)):(v=!0,h.value=X,h.select(),setTimeout(function(){v=!1,D(),j?d.onCut():d.onCopy();}));},J=function(P){K(P,!0);},q=function(P){K(P,!1);},ee=function(P){var j=Y(P);r.pasteCancelled()||(typeof j=="string"?(j&&d.onPaste(j,P),x.isIE&&setTimeout(D),R.preventDefault(P)):(h.value="",C=!0));};R.addCommandKeyListener(h,function(P,j,X){if(!y)return d.onCommandKey(P,j,X)},d),R.addListener(h,"select",B,d),R.addListener(h,"input",V,d),R.addListener(h,"cut",J,d),R.addListener(h,"copy",q,d),R.addListener(h,"paste",ee,d),(!("oncut"in h)||!("oncopy"in h)||!("onpaste"in h))&&R.addListener($,"keydown",function(P){if(!(x.isMac&&!P.metaKey||!P.ctrlKey))switch(P.keyCode){case 67:q(P);break;case 86:ee(P);break;case 88:J(P);break}},d);var Q=function(P){if(!(y||!d.onCompositionStart||d.$readOnly)&&(y={},!p)){P.data&&(y.useTextareaForIME=!1),setTimeout(ne,0),d._signal("compositionStart"),d.on("mousedown",ge);var j=d.getSelectionRange();j.end.row=j.start.row,j.end.column=j.start.column,y.markerRange=j,y.selectionStart=A,d.onCompositionStart(y),y.useTextareaForIME?(g=h.value="",A=0,T=0):(h.msGetInputContext&&(y.context=h.msGetInputContext()),h.getInputContext&&(y.context=h.getInputContext()));}},ne=function(){if(!(!y||!d.onCompositionUpdate||d.$readOnly)){if(p)return ge();if(y.useTextareaForIME)d.onCompositionUpdate(h.value);else {var P=h.value;U(P),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+T-y.selectionStart+E);}}},pe=function(P){!d.onCompositionEnd||d.$readOnly||(y=!1,d.onCompositionEnd(),d.off("mousedown",ge),P&&V());};function ge(){l=!0,h.blur(),h.focus(),l=!1;}var ue=c.delayedCall(ne,50).schedule.bind(null,null);function ae(P){P.keyCode==27&&h.value.length<h.selectionStart&&(y||(g=h.value),A=T=-1,D()),ue();}R.addListener(h,"compositionstart",Q,d),R.addListener(h,"compositionupdate",ne,d),R.addListener(h,"keyup",ae,d),R.addListener(h,"keydown",ue,d),R.addListener(h,"compositionend",pe,d),this.getElement=function(){return h},this.setCommandMode=function(P){p=P,h.readOnly=!1;},this.setReadOnly=function(P){p||(h.readOnly=P);},this.setCopyWithEmptySelection=function(P){},this.onContextMenu=function(P){G=!0,D(),d._emit("nativecontextmenu",{target:d,domEvent:P}),this.moveToMouse(P,!0);},this.moveToMouse=function(P,j){f||(f=h.style.cssText),h.style.cssText=(j?"z-index:100000;":"")+(x.isIE?"opacity:0.1;":"")+"text-indent: -"+(A+T)*d.renderer.characterWidth*.5+"px;";var X=d.container.getBoundingClientRect(),Z=s.computedStyle(d.container),te=X.top+(parseInt(Z.borderTopWidth)||0),oe=X.left+(parseInt(X.borderLeftWidth)||0),le=X.bottom-te-h.clientHeight-2,se=function(re){s.translate(h,re.clientX-oe-2,Math.min(re.clientY-te-2,le));};se(P),P.type=="mousedown"&&(d.renderer.$isMousePressed=!0,clearTimeout(ce),x.isWin&&R.capture(d.container,se,we));},this.onContextMenuClose=we;var ce;function we(){clearTimeout(ce),ce=setTimeout(function(){f&&(h.style.cssText=f,f=""),d.renderer.$isMousePressed=!1,d.renderer.$keepTextAreaAtCursor&&d.renderer.$moveTextAreaToCursor();},0);}var me=function(P){d.textInput.onContextMenu(P),we();};R.addListener(h,"mouseup",me,d),R.addListener(h,"mousedown",function(P){P.preventDefault(),we();},d),R.addListener(d.renderer.scroller,"contextmenu",me,d),R.addListener(h,"contextmenu",me,d),u&&It($,d,h);function It(P,j,X){var Z=null,te=!1;X.addEventListener("keydown",function(le){Z&&clearTimeout(Z),te=!0;},!0),X.addEventListener("keyup",function(le){Z=setTimeout(function(){te=!1;},100);},!0);var oe=function(le){if(document.activeElement===X&&!(te||y||j.$mouseHandler.isMousePressed)&&!v){var se=X.selectionStart,re=X.selectionEnd,ie=null,he=0;if(se==0?ie=o.up:se==1?ie=o.home:re>T&&g[re]==`
196
197
  `?ie=o.end:se<A&&g[se-1]==" "?(ie=o.left,he=a.option):se<A||se==A&&T!=A&&se==re?ie=o.left:re>T&&g.slice(0,re).split(`
197
- `).length>2?ie=o.down:re>T&&g[re-1]==" "?(ie=o.right,he=a.option):(re>T||re==T&&T!=A&&se==re)&&(ie=o.right),se!==re&&(he|=a.shift),ie){var Ae=j.onCommandKey({},he,ie);if(!Ae&&j.commands){ie=o.keyCodeToString(ie);var Je=j.commands.findKeyCommand(he,ie);Je&&j.execCommand(Je);}A=se,T=re,D("");}}};document.addEventListener("selectionchange",oe),j.on("destroy",function(){document.removeEventListener("selectionchange",oe);});}this.destroy=function(){h.parentElement&&h.parentElement.removeChild(h);};},M.TextInput=m,M.$setUserAgentForTests=function($,d){S=$,u=d;};});ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(k,M,H){var R=k("../lib/useragent"),L=0,x=550,s=function(){function e(i){i.$clickSelection=null;var n=i.editor;n.setDefaultHandler("mousedown",this.onMouseDown.bind(i)),n.setDefaultHandler("dblclick",this.onDoubleClick.bind(i)),n.setDefaultHandler("tripleclick",this.onTripleClick.bind(i)),n.setDefaultHandler("quadclick",this.onQuadClick.bind(i)),n.setDefaultHandler("mousewheel",this.onMouseWheel.bind(i));var t=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];t.forEach(function(o){i[o]=this[o];},this),i.selectByLines=this.extendSelectionBy.bind(i,"getLineRange"),i.selectByWords=this.extendSelectionBy.bind(i,"getWordRange");}return e.prototype.onMouseDown=function(i){var n=i.inSelection(),t=i.getDocumentPosition();this.mousedownEvent=i;var o=this.editor,a=i.getButton();if(a!==0){var u=o.getSelectionRange(),w=u.isEmpty();(w||a==1)&&o.selection.moveToPosition(t),a==2&&(o.textInput.onContextMenu(i.domEvent),R.isMozilla||i.preventDefault());return}if(this.mousedownEvent.time=Date.now(),n&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(i);return}return this.captureMouse(i),this.startSelect(t,i.domEvent._clicks>1),i.preventDefault()},e.prototype.startSelect=function(i,n){i=i||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var t=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?t.selection.selectToPosition(i):n||t.selection.moveToPosition(i),n||this.select(),t.setStyle("ace_selecting"),this.setState("select"));},e.prototype.select=function(){var i,n=this.editor,t=n.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(t);if(o==-1)i=this.$clickSelection.end;else if(o==1)i=this.$clickSelection.start;else {var a=r(this.$clickSelection,t);t=a.cursor,i=a.anchor;}n.selection.setSelectionAnchor(i.row,i.column);}n.selection.selectToPosition(t),n.renderer.scrollCursorIntoView();},e.prototype.extendSelectionBy=function(i){var n,t=this.editor,o=t.renderer.screenToTextCoordinates(this.x,this.y),a=t.selection[i](o.row,o.column);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(a.start),w=this.$clickSelection.comparePoint(a.end);if(u==-1&&w<=0)n=this.$clickSelection.end,(a.end.row!=o.row||a.end.column!=o.column)&&(o=a.start);else if(w==1&&u>=0)n=this.$clickSelection.start,(a.start.row!=o.row||a.start.column!=o.column)&&(o=a.end);else if(u==-1&&w==1)o=a.end,n=a.start;else {var S=r(this.$clickSelection,o);o=S.cursor,n=S.anchor;}t.selection.setSelectionAnchor(n.row,n.column);}t.selection.selectToPosition(o),t.renderer.scrollCursorIntoView();},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting");},e.prototype.focusWait=function(){var i=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),n=Date.now();(i>L||n-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition());},e.prototype.onDoubleClick=function(i){var n=i.getDocumentPosition(),t=this.editor,o=t.session,a=o.getBracketRange(n);a?(a.isEmpty()&&(a.start.column--,a.end.column++),this.setState("select")):(a=t.selection.getWordRange(n.row,n.column),this.setState("selectByWords")),this.$clickSelection=a,this.select();},e.prototype.onTripleClick=function(i){var n=i.getDocumentPosition(),t=this.editor;this.setState("selectByLines");var o=t.getSelectionRange();o.isMultiLine()&&o.contains(n.row,n.column)?(this.$clickSelection=t.selection.getLineRange(o.start.row),this.$clickSelection.end=t.selection.getLineRange(o.end.row).end):this.$clickSelection=t.selection.getLineRange(n.row),this.select();},e.prototype.onQuadClick=function(i){var n=this.editor;n.selectAll(),this.$clickSelection=n.getSelectionRange(),this.setState("selectAll");},e.prototype.onMouseWheel=function(i){if(!i.getAccelKey()){i.getShiftKey()&&i.wheelY&&!i.wheelX&&(i.wheelX=i.wheelY,i.wheelY=0);var n=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var t=this.$lastScroll,o=i.domEvent.timeStamp,a=o-t.t,u=a?i.wheelX/a:t.vx,w=a?i.wheelY/a:t.vy;a<x&&(u=(u+t.vx)/2,w=(w+t.vy)/2);var S=Math.abs(u/w),m=!1;if(S>=1&&n.renderer.isScrollableBy(i.wheelX*i.speed,0)&&(m=!0),S<=1&&n.renderer.isScrollableBy(0,i.wheelY*i.speed)&&(m=!0),m)t.allowed=o;else if(o-t.allowed<x){var $=Math.abs(u)<=1.5*Math.abs(t.vx)&&Math.abs(w)<=1.5*Math.abs(t.vy);$?(m=!0,t.allowed=o):t.allowed=0;}if(t.t=o,t.vx=u,t.vy=w,m)return n.renderer.scrollBy(i.wheelX*i.speed,i.wheelY*i.speed),i.stop()}},e}();s.prototype.selectEnd=s.prototype.selectByLinesEnd,s.prototype.selectAllEnd=s.prototype.selectByLinesEnd,s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd,M.DefaultHandlers=s;function l(e,i,n,t){return Math.sqrt(Math.pow(n-e,2)+Math.pow(t-i,2))}function r(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}}});ace.define("ace/lib/scroll",["require","exports","module"],function(k,M,H){M.preventParentScroll=function(L){L.stopPropagation();var x=L.currentTarget,s=x.scrollHeight>x.clientHeight;s||L.preventDefault();};});ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(k,M,H){var R=this&&this.__extends||function(){var a=function(u,w){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,m){S.__proto__=m;}||function(S,m){for(var $ in m)Object.prototype.hasOwnProperty.call(m,$)&&(S[$]=m[$]);},a(u,w)};return function(u,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");a(u,w);function S(){this.constructor=u;}u.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S);}}(),L=this&&this.__values||function(a){var u=typeof Symbol=="function"&&Symbol.iterator,w=u&&a[u],S=0;if(w)return w.call(a);if(a&&typeof a.length=="number")return {next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},x=k("./lib/dom");k("./lib/event");var l=k("./range").Range,r=k("./lib/scroll").preventParentScroll,e="ace_tooltip",i=function(){function a(u){this.isOpen=!1,this.$element=null,this.$parentNode=u;}return a.prototype.$init=function(){return this.$element=x.createElement("div"),this.$element.className=e,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},a.prototype.getElement=function(){return this.$element||this.$init()},a.prototype.setText=function(u){this.getElement().textContent=u;},a.prototype.setHtml=function(u){this.getElement().innerHTML=u;},a.prototype.setPosition=function(u,w){this.getElement().style.left=u+"px",this.getElement().style.top=w+"px";},a.prototype.setClassName=function(u){x.addCssClass(this.getElement(),u);},a.prototype.setTheme=function(u){this.$element.className=e+" "+(u.isDark?"ace_dark ":"")+(u.cssClass||"");},a.prototype.show=function(u,w,S){u!=null&&this.setText(u),w!=null&&S!=null&&this.setPosition(w,S),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0);},a.prototype.hide=function(u){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=e,this.isOpen=!1);},a.prototype.getHeight=function(){return this.getElement().offsetHeight},a.prototype.getWidth=function(){return this.getElement().offsetWidth},a.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element);},a}(),n=function(){function a(){this.popups=[];}return a.prototype.addPopup=function(u){this.popups.push(u),this.updatePopups();},a.prototype.removePopup=function(u){var w=this.popups.indexOf(u);w!==-1&&(this.popups.splice(w,1),this.updatePopups());},a.prototype.updatePopups=function(){var u,w,S,m;this.popups.sort(function(p,c){return c.priority-p.priority});var $=[];try{for(var d=L(this.popups),h=d.next();!h.done;h=d.next()){var v=h.value,C=!0;try{for(var y=(S=void 0,L($)),b=y.next();!b.done;b=y.next()){var f=b.value;if(this.doPopupsOverlap(f,v)){C=!1;break}}}catch(p){S={error:p};}finally{try{b&&!b.done&&(m=y.return)&&m.call(y);}finally{if(S)throw S.error}}C?$.push(v):v.hide();}}catch(p){u={error:p};}finally{try{h&&!h.done&&(w=d.return)&&w.call(d);}finally{if(u)throw u.error}}},a.prototype.doPopupsOverlap=function(u,w){var S=u.getElement().getBoundingClientRect(),m=w.getElement().getBoundingClientRect();return S.left<m.right&&S.right>m.left&&S.top<m.bottom&&S.bottom>m.top},a}(),t=new n;M.popupManager=t,M.Tooltip=i;var o=function(a){R(u,a);function u(w){w===void 0&&(w=document.body);var S=a.call(this,w)||this;S.timeout=void 0,S.lastT=0,S.idleTime=350,S.lastEvent=void 0,S.onMouseOut=S.onMouseOut.bind(S),S.onMouseMove=S.onMouseMove.bind(S),S.waitForHover=S.waitForHover.bind(S),S.hide=S.hide.bind(S);var m=S.getElement();return m.style.whiteSpace="pre-wrap",m.style.pointerEvents="auto",m.addEventListener("mouseout",S.onMouseOut),m.tabIndex=-1,m.addEventListener("blur",function(){m.contains(document.activeElement)||this.hide();}.bind(S)),m.addEventListener("wheel",r),S}return u.prototype.addToEditor=function(w){w.on("mousemove",this.onMouseMove),w.on("mousedown",this.hide),w.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0);},u.prototype.removeFromEditor=function(w){w.off("mousemove",this.onMouseMove),w.off("mousedown",this.hide),w.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null);},u.prototype.onMouseMove=function(w,S){this.lastEvent=w,this.lastT=Date.now();var m=S.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||m||this.isOutsideOfText(this.lastEvent))&&this.hide();}this.timeout||m||(this.lastEvent=w,this.timeout=setTimeout(this.waitForHover,this.idleTime));},u.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var w=Date.now()-this.lastT;if(this.idleTime-w>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-w);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor);},u.prototype.isOutsideOfText=function(w){var S=w.editor,m=w.getDocumentPosition(),$=S.session.getLine(m.row);if(m.column==$.length){var d=S.renderer.pixelToScreenCoordinates(w.clientX,w.clientY),h=S.session.documentToScreenPosition(m.row,m.column);if(h.column!=d.column||h.row!=d.row)return !0}return !1},u.prototype.setDataProvider=function(w){this.$gatherData=w;},u.prototype.showForRange=function(w,S,m,$){var d=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var h=w.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(h.theme)),this.isOpen=!0,this.addMarker(S,w.session),this.range=l.fromPoints(S.start,S.end);var v=h.textToScreenCoordinates(S.start.row,S.start.column),C=h.scroller.getBoundingClientRect();v.pageX<C.left&&(v.pageX=C.left);var y=this.getElement();y.innerHTML="",y.appendChild(m),y.style.maxHeight="",y.style.display="block";var b=y.clientHeight,f=y.clientWidth,p=window.innerHeight-v.pageY-h.lineHeight,c=!0;v.pageY-b<0&&v.pageY<p&&(c=!1),y.style.maxHeight=(c?v.pageY:p)-d+"px",y.style.top=c?"":v.pageY+h.lineHeight+"px",y.style.bottom=c?window.innerHeight-v.pageY+"px":"",y.style.left=Math.min(v.pageX,window.innerWidth-f-d)+"px";}},u.prototype.addMarker=function(w,S){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=S,this.marker=S&&S.addMarker(w,"ace_highlight-marker","text");},u.prototype.hide=function(w){!w&&document.activeElement==this.getElement()||w&&w.target&&(w.type!="keydown"||w.ctrlKey||w.metaKey)&&this.$element.contains(w.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,t.removePopup(this)));},u.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0);},u.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0);},u.prototype.onMouseOut=function(w){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!w.relatedTarget||this.getElement().contains(w.relatedTarget)||w&&w.currentTarget.contains(w.relatedTarget)||w.relatedTarget.classList.contains("ace_content")||this.hide());},u}(i);M.HoverTooltip=o;});ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(k,M,H){var R=this&&this.__extends||function(){var t=function(o,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w;}||function(u,w){for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(u[S]=w[S]);},t(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");t(o,a);function u(){this.constructor=o;}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u);}}(),L=this&&this.__values||function(t){var o=typeof Symbol=="function"&&Symbol.iterator,a=o&&t[o],u=0;if(a)return a.call(t);if(t&&typeof t.length=="number")return {next:function(){return t&&u>=t.length&&(t=void 0),{value:t&&t[u++],done:!t}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},x=k("../lib/dom"),s=k("../lib/event"),l=k("../tooltip").Tooltip,r=k("../config").nls;k("../lib/lang");function i(t){var o=t.editor,a=o.renderer.$gutterLayer,u=new n(o);t.editor.setDefaultHandler("guttermousedown",function(h){if(!(!o.isFocused()||h.getButton()!=0)){var v=a.getRegion(h);if(v!="foldWidgets"){var C=h.getDocumentPosition().row,y=o.session.selection;if(h.getShiftKey())y.selectTo(C,0);else {if(h.domEvent.detail==2)return o.selectAll(),h.preventDefault();t.$clickSelection=o.selection.getLineRange(C);}return t.setState("selectByLines"),t.captureMouse(h),h.preventDefault()}}});var w,S;function m(){var h=S.getDocumentPosition().row,v=o.session.getLength();if(h==v){var C=o.renderer.pixelToScreenCoordinates(0,S.y).row,y=S.$pos;if(C>o.session.documentToScreenRow(y.row,y.column))return $()}if(u.showTooltip(h),!!u.isOpen)if(o.on("mousewheel",$),t.$tooltipFollowsMouse)d(S);else {var b=S.getGutterRow(),f=a.$lines.get(b);if(f){var p=f.element.querySelector(".ace_gutter_annotation"),c=p.getBoundingClientRect(),g=u.getElement().style;g.left=c.right+"px",g.top=c.bottom+"px";}else d(S);}}function $(){w&&(w=clearTimeout(w)),u.isOpen&&(u.hideTooltip(),o.off("mousewheel",$));}function d(h){u.setPosition(h.x,h.y);}t.editor.setDefaultHandler("guttermousemove",function(h){var v=h.domEvent.target||h.domEvent.srcElement;if(x.hasCssClass(v,"ace_fold-widget"))return $();u.isOpen&&t.$tooltipFollowsMouse&&d(h),S=h,!w&&(w=setTimeout(function(){w=null,S&&!t.isMousePressed?m():$();},50));}),s.addListener(o.renderer.$gutter,"mouseout",function(h){S=null,!(!u.isOpen||w)&&(w=setTimeout(function(){w=null,$();},50));},o),o.on("changeSession",$),o.on("input",$);}M.GutterHandler=i;var n=function(t){R(o,t);function o(a){var u=t.call(this,a.container)||this;return u.editor=a,u}return o.prototype.setPosition=function(a,u){var w=window.innerWidth||document.documentElement.clientWidth,S=window.innerHeight||document.documentElement.clientHeight,m=this.getWidth(),$=this.getHeight();a+=15,u+=15,a+m>w&&(a-=a+m-w),u+$>S&&(u-=20+$),l.prototype.setPosition.call(this,a,u);},Object.defineProperty(o,"annotationLabels",{get:function(){return {error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),o.prototype.showTooltip=function(a){var u,w=this.editor.renderer.$gutterLayer,S=w.$annotations[a],m;S?m={displayText:Array.from(S.displayText),type:Array.from(S.type)}:m={displayText:[],type:[]};var $=w.session.getFoldLine(a);if($&&w.$showFoldedAnnotations){for(var d={error:[],warning:[],info:[]},h,v=a+1;v<=$.end.row;v++)if(w.$annotations[v])for(var C=0;C<w.$annotations[v].text.length;C++){var y=w.$annotations[v].type[C];if(d[y].push(w.$annotations[v].text[C]),y==="error"){h="error_fold";continue}if(y==="warning"){h="warning_fold";continue}}if(h==="error_fold"||h==="warning_fold"){var b="".concat(o.annotationsToSummaryString(d)," in folded code.");m.displayText.push(b),m.type.push(h);}}if(m.displayText.length===0)return this.hide();for(var f={error:[],warning:[],info:[]},p=w.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",v=0;v<m.displayText.length;v++){var c=x.createElement("span"),g=x.createElement("span");(u=g.classList).add.apply(u,["ace_".concat(m.type[v]),p]),g.setAttribute("aria-label","".concat(o.annotationLabels[m.type[v].replace("_fold","")].singular)),g.setAttribute("role","img"),g.appendChild(x.createTextNode(" ")),c.appendChild(g),c.appendChild(x.createTextNode(m.displayText[v])),c.appendChild(x.createElement("br")),f[m.type[v].replace("_fold","")].push(c);}var A=this.getElement();x.removeChildren(A),f.error.forEach(function(T){return A.appendChild(T)}),f.warning.forEach(function(T){return A.appendChild(T)}),f.info.forEach(function(T){return A.appendChild(T)}),A.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this);},o.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this);},o.annotationsToSummaryString=function(a){var u,w,S=[],m=["error","warning","info"];try{for(var $=L(m),d=$.next();!d.done;d=$.next()){var h=d.value;if(a[h].length){var v=a[h].length===1?o.annotationLabels[h].singular:o.annotationLabels[h].plural;S.push("".concat(a[h].length," ").concat(v));}}}catch(C){u={error:C};}finally{try{d&&!d.done&&(w=$.return)&&w.call($);}finally{if(u)throw u.error}}return S.join(", ")},o}(l);M.GutterTooltip=n;});ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent"),x=function(){function s(l,r){this.speed,this.wheelX,this.wheelY,this.domEvent=l,this.editor=r,this.x=this.clientX=l.clientX,this.y=this.clientY=l.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1;}return s.prototype.stopPropagation=function(){R.stopPropagation(this.domEvent),this.propagationStopped=!0;},s.prototype.preventDefault=function(){R.preventDefault(this.domEvent),this.defaultPrevented=!0;},s.prototype.stop=function(){this.stopPropagation(),this.preventDefault();},s.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},s.prototype.getGutterRow=function(){var l=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(l,0),e=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-e},s.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var l=this.editor,r=l.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else {var e=this.getDocumentPosition();this.$inSelection=r.contains(e.row,e.column);}return this.$inSelection},s.prototype.getButton=function(){return R.getButton(this.domEvent)},s.prototype.getShiftKey=function(){return this.domEvent.shiftKey},s.prototype.getAccelKey=function(){return L.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},s}();M.MouseEvent=x;});ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/event"),x=k("../lib/useragent"),s=200,l=200,r=5;function e(n){var t=n.editor,o=R.createElement("div");o.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",o.textContent="\xA0";var a=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];a.forEach(function(F){n[F]=this[F];},this),t.on("mousedown",this.onMouseDown.bind(n));var u=t.container,w,S,m,$,d,h,v=0,C,y,b,f,p;this.onDragStart=function(F){if(this.cancelDrag||!u.draggable){var D=this;return setTimeout(function(){D.startSelect(),D.captureMouse(F);},0),F.preventDefault()}d=t.getSelectionRange();var W=F.dataTransfer;W.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(o),W.setDragImage&&W.setDragImage(o,0,0),setTimeout(function(){t.container.removeChild(o);}),W.clearData(),W.setData("Text",t.session.getTextRange()),y=!0,this.setState("drag");},this.onDragEnd=function(F){if(u.draggable=!1,y=!1,this.setState(null),!t.getReadOnly()){var D=F.dataTransfer.dropEffect;!C&&D=="move"&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle();}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("");},this.onDragEnter=function(F){if(!(t.getReadOnly()||!I(F.dataTransfer)))return S=F.clientX,m=F.clientY,w||T(),v++,F.dataTransfer.dropEffect=C=N(F),L.preventDefault(F)},this.onDragOver=function(F){if(!(t.getReadOnly()||!I(F.dataTransfer)))return S=F.clientX,m=F.clientY,w||(T(),v++),_!==null&&(_=null),F.dataTransfer.dropEffect=C=N(F),L.preventDefault(F)},this.onDragLeave=function(F){if(v--,v<=0&&w)return E(),C=null,L.preventDefault(F)},this.onDrop=function(F){if(h){var D=F.dataTransfer;if(y)switch(C){case"move":d.contains(h.row,h.column)?d={start:h,end:h}:d=t.moveText(d,h);break;case"copy":d=t.moveText(d,h,!0);break}else {var W=D.getData("Text");d={start:h,end:t.session.insert(h,W)},t.focus(),C=null;}return E(),L.preventDefault(F)}},L.addListener(u,"dragstart",this.onDragStart.bind(n),t),L.addListener(u,"dragend",this.onDragEnd.bind(n),t),L.addListener(u,"dragenter",this.onDragEnter.bind(n),t),L.addListener(u,"dragover",this.onDragOver.bind(n),t),L.addListener(u,"dragleave",this.onDragLeave.bind(n),t),L.addListener(u,"drop",this.onDrop.bind(n),t);function c(F,D){var W=Date.now(),B=!D||F.row!=D.row,z=!D||F.column!=D.column;if(!f||B||z)t.moveCursorToPosition(F),f=W,p={x:S,y:m};else {var G=i(p.x,p.y,S,m);G>r?f=null:W-f>=l&&(t.renderer.scrollCursorIntoView(),f=null);}}function g(F,D){var W=Date.now(),B=t.renderer.layerConfig.lineHeight,z=t.renderer.layerConfig.characterWidth,G=t.renderer.scroller.getBoundingClientRect(),U={x:{left:S-G.left,right:G.right-S},y:{top:m-G.top,bottom:G.bottom-m}},V=Math.min(U.x.left,U.x.right),Y=Math.min(U.y.top,U.y.bottom),K={row:F.row,column:F.column};V/z<=2&&(K.column+=U.x.left<U.x.right?-3:2),Y/B<=1&&(K.row+=U.y.top<U.y.bottom?-1:1);var J=F.row!=K.row,q=F.column!=K.column,ee=!D||F.row!=D.row;J||q&&!ee?b?W-b>=s&&t.renderer.scrollCursorIntoView(K):b=W:b=null;}function A(){var F=h;h=t.renderer.screenToTextCoordinates(S,m),c(h,F),g(h,F);}function T(){d=t.selection.toOrientedRange(),w=t.session.addMarker(d,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval($),A(),$=setInterval(A,20),v=0,L.addListener(document,"mousemove",O);}function E(){clearInterval($),t.session.removeMarker(w),w=null,t.selection.fromOrientedRange(d),t.isFocused()&&!y&&t.$resetCursorStyle(),d=null,h=null,v=0,b=null,f=null,L.removeListener(document,"mousemove",O);}var _=null;function O(){_==null&&(_=setTimeout(function(){_!=null&&w&&E();},20));}function I(F){var D=F.types;return !D||Array.prototype.some.call(D,function(W){return W=="text/plain"||W=="Text"})}function N(F){var D=["copy","copymove","all","uninitialized"],W=["move","copymove","linkmove","all","uninitialized"],B=x.isMac?F.altKey:F.ctrlKey,z="uninitialized";try{z=F.dataTransfer.effectAllowed.toLowerCase();}catch{}var G="none";return B&&D.indexOf(z)>=0?G="copy":W.indexOf(z)>=0?G="move":D.indexOf(z)>=0&&(G="copy"),G}}(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,t=n.container;t.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle("ace_dragging");var o=x.isWin?"default":"move";n.renderer.setCursorStyle(o),this.setState("dragReady");},this.onMouseDrag=function(n){var t=this.editor.container;if(x.isIE&&this.state=="dragReady"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>3&&t.dragDrop();}if(this.state==="dragWait"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()));}},this.onMouseDown=function(n){if(this.$dragEnabled){this.mousedownEvent=n;var t=this.editor,o=n.inSelection(),a=n.getButton(),u=n.domEvent.detail||1;if(u===1&&a===0&&o){if(n.editor.inMultiSelectMode&&(n.getAccelKey()||n.getShiftKey()))return;this.mousedownEvent.time=Date.now();var w=n.domEvent.target||n.domEvent.srcElement;if("unselectable"in w&&(w.unselectable="on"),t.getDragDelay()){if(x.isWebKit){this.cancelDrag=!0;var S=t.container;S.draggable=!0;}this.setState("dragWait");}else this.startDrag();this.captureMouse(n,this.onMouseDrag.bind(this)),n.defaultPrevented=!0;}}};}).call(e.prototype);function i(n,t,o,a){return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-t,2))}M.DragdropHandler=e;});ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(k,M,H){var R=k("./mouse_event").MouseEvent,L=k("../lib/event"),x=k("../lib/dom");M.addTouchListeners=function(s,l){var r="scroll",e,i,n,t,o,a,u=0,w,S=0,m=0,$=0,d,h;function v(){var c=window.navigator&&window.navigator.clipboard,g=!1,A=function(){var _=l.getCopyText(),O=l.session.getUndoManager().hasUndo();h.replaceChild(x.buildDom(g?["span",!_&&T("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],_&&T("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],_&&T("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],c&&T("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],O&&T("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],T("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],T("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),h.firstChild);},T=function(_){return l.commands.canExecute(_,l)},E=function(_){var O=_.target.getAttribute("action");if(O=="more"||!g)return g=!g,A();O=="paste"?c.readText().then(function(I){l.execCommand(O,I);}):O&&((O=="cut"||O=="copy")&&(c?c.writeText(l.getCopyText()):document.execCommand("copy")),l.execCommand(O)),h.firstChild.style.display="none",g=!1,O!="openCommandPalette"&&l.focus();};h=x.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(_){r="menu",_.stopPropagation(),_.preventDefault(),l.textInput.focus();},ontouchend:function(_){_.stopPropagation(),_.preventDefault(),E(_);},onclick:E},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],l.container);}function C(){if(!l.getOption("enableMobileMenu")){h&&y();return}h||v();var c=l.selection.cursor,g=l.renderer.textToScreenCoordinates(c.row,c.column),A=l.renderer.textToScreenCoordinates(0,0).pageX,T=l.renderer.scrollLeft,E=l.container.getBoundingClientRect();h.style.top=g.pageY-E.top-3+"px",g.pageX-E.left<E.width-70?(h.style.left="",h.style.right="10px"):(h.style.right="",h.style.left=A+T-E.left+"px"),h.style.display="",h.firstChild.style.display="none",l.on("input",y);}function y(c){h&&(h.style.display="none"),l.off("input",y);}function b(){o=null,clearTimeout(o);var c=l.selection.getRange(),g=c.contains(w.row,w.column);(c.isEmpty()||!g)&&(l.selection.moveToPosition(w),l.selection.selectWord()),r="wait",C();}function f(){o=null,clearTimeout(o),l.selection.moveToPosition(w);var c=S>=2?l.selection.getLineRange(w.row):l.session.getBracketRange(w);c&&!c.isEmpty()?l.selection.setRange(c):l.selection.selectWord(),r="wait";}L.addListener(s,"contextmenu",function(c){if(d){var g=l.textInput.getElement();g.focus();}},l),L.addListener(s,"touchstart",function(c){var g=c.touches;if(o||g.length>1){clearTimeout(o),o=null,n=-1,r="zoom";return}d=l.$mouseHandler.isMousePressed=!0;var A=l.renderer.layerConfig.lineHeight,T=l.renderer.layerConfig.lineHeight,E=c.timeStamp;t=E;var _=g[0],O=_.clientX,I=_.clientY;Math.abs(e-O)+Math.abs(i-I)>A&&(n=-1),e=c.clientX=O,i=c.clientY=I,m=$=0;var N=new R(c,l);if(w=N.getDocumentPosition(),E-n<500&&g.length==1&&!u)S++,c.preventDefault(),c.button=0,f();else {S=0;var F=l.selection.cursor,D=l.selection.isEmpty()?F:l.selection.anchor,W=l.renderer.$cursorLayer.getPixelPosition(F,!0),B=l.renderer.$cursorLayer.getPixelPosition(D,!0),z=l.renderer.scroller.getBoundingClientRect(),G=l.renderer.layerConfig.offset,U=l.renderer.scrollLeft,V=function(J,q){return J=J/T,q=q/A-.75,J*J+q*q};if(c.clientX<z.left){r="zoom";return}var Y=V(c.clientX-z.left-W.left+U,c.clientY-z.top-W.top+G),K=V(c.clientX-z.left-B.left+U,c.clientY-z.top-B.top+G);Y<3.5&&K<3.5&&(r=Y>K?"cursor":"anchor"),K<3.5?r="anchor":Y<3.5?r="cursor":r="scroll",o=setTimeout(b,450);}n=E;},l),L.addListener(s,"touchend",function(c){d=l.$mouseHandler.isMousePressed=!1,a&&clearInterval(a),r=="zoom"?(r="",u=0):o?(l.selection.moveToPosition(w),u=0,C()):r=="scroll"?(p(),y()):C(),clearTimeout(o),o=null;},l),L.addListener(s,"touchmove",function(c){o&&(clearTimeout(o),o=null);var g=c.touches;if(!(g.length>1||r=="zoom")){var A=g[0],T=e-A.clientX,E=i-A.clientY;if(r=="wait")if(T*T+E*E>4)r="cursor";else return c.preventDefault();e=A.clientX,i=A.clientY,c.clientX=A.clientX,c.clientY=A.clientY;var _=c.timeStamp,O=_-t;if(t=_,r=="scroll"){var I=new R(c,l);I.speed=1,I.wheelX=T,I.wheelY=E,10*Math.abs(T)<Math.abs(E)&&(T=0),10*Math.abs(E)<Math.abs(T)&&(E=0),O!=0&&(m=T/O,$=E/O),l._emit("mousewheel",I),I.propagationStopped||(m=$=0);}else {var N=new R(c,l),F=N.getDocumentPosition();r=="cursor"?l.selection.moveCursorToPosition(F):r=="anchor"&&l.selection.setSelectionAnchor(F.row,F.column),l.renderer.scrollCursorIntoView(F),c.preventDefault();}}},l);function p(){u+=60,a=setInterval(function(){u--<=0&&(clearInterval(a),a=null),Math.abs(m)<.01&&(m=0),Math.abs($)<.01&&($=0),u<20&&(m=.9*m),u<20&&($=.9*$);var c=l.session.getScrollTop();l.renderer.scrollBy(10*m,10*$),c==l.session.getScrollTop()&&(u=0);},10);}};});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(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent"),x=k("./default_handlers").DefaultHandlers,s=k("./default_gutter_handler").GutterHandler,l=k("./mouse_event").MouseEvent,r=k("./dragdrop_handler").DragdropHandler,e=k("./touch_handler").addTouchListeners,i=k("../config"),n=function(){function t(o){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var a=this;this.editor=o,new x(this),new s(this),new r(this);var u=function(m){var $=!document.hasFocus||!document.hasFocus()||!o.isFocused()&&document.activeElement==(o.textInput&&o.textInput.getElement());$&&window.focus(),o.focus(),setTimeout(function(){o.isFocused()||o.focus();});},w=o.renderer.getMouseEventTarget();R.addListener(w,"click",this.onMouseEvent.bind(this,"click"),o),R.addListener(w,"mousemove",this.onMouseMove.bind(this,"mousemove"),o),R.addMultiMouseDownListener([w,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),R.addMouseWheelListener(o.container,this.onMouseWheel.bind(this,"mousewheel"),o),e(o.container,o);var S=o.renderer.$gutter;R.addListener(S,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),o),R.addListener(S,"click",this.onMouseEvent.bind(this,"gutterclick"),o),R.addListener(S,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),o),R.addListener(S,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),o),R.addListener(w,"mousedown",u,o),R.addListener(S,"mousedown",u,o),L.isIE&&o.renderer.scrollBarV&&(R.addListener(o.renderer.scrollBarV.element,"mousedown",u,o),R.addListener(o.renderer.scrollBarH.element,"mousedown",u,o)),o.on("mousemove",function(m){if(!(a.state||a.$dragDelay||!a.$dragEnabled)){var $=o.renderer.screenToTextCoordinates(m.x,m.y),d=o.session.selection.getRange(),h=o.renderer;!d.isEmpty()&&d.insideStart($.row,$.column)?h.setCursorStyle("default"):h.setCursorStyle("");}},o);}return t.prototype.onMouseEvent=function(o,a){this.editor.session&&this.editor._emit(o,new l(a,this.editor));},t.prototype.onMouseMove=function(o,a){var u=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!u||!u.length||this.editor._emit(o,new l(a,this.editor));},t.prototype.onMouseWheel=function(o,a){var u=new l(a,this.editor);u.speed=this.$scrollSpeed*2,u.wheelX=a.wheelX,u.wheelY=a.wheelY,this.editor._emit(o,u);},t.prototype.setState=function(o){this.state=o;},t.prototype.captureMouse=function(o,a){this.x=o.x,this.y=o.y,this.isMousePressed=!0;var u=this.editor,w=this.editor.renderer;w.$isMousePressed=!0;var S=this,m=function(C){if(C){if(L.isWebKit&&!C.which&&S.releaseMouse)return S.releaseMouse();S.x=C.clientX,S.y=C.clientY,a&&a(C),S.mouseEvent=new l(C,S.editor),S.$mouseMoved=!0;}},$=function(C){u.off("beforeEndOperation",h),clearInterval(v),u.session&&d(),S[S.state+"End"]&&S[S.state+"End"](C),S.state="",S.isMousePressed=w.$isMousePressed=!1,w.$keepTextAreaAtCursor&&w.$moveTextAreaToCursor(),S.$onCaptureMouseMove=S.releaseMouse=null,C&&S.onMouseEvent("mouseup",C),u.endOperation();},d=function(){S[S.state]&&S[S.state](),S.$mouseMoved=!1;};if(L.isOldIE&&o.domEvent.type=="dblclick")return setTimeout(function(){$(o);});var h=function(C){S.releaseMouse&&u.curOp.command.name&&u.curOp.selectionChanged&&(S[S.state+"End"]&&S[S.state+"End"](),S.state="",S.releaseMouse());};u.on("beforeEndOperation",h),u.startOperation({command:{name:"mouse"}}),S.$onCaptureMouseMove=m,S.releaseMouse=R.capture(this.editor.container,m,$);var v=setInterval(d,20);},t.prototype.cancelContextMenu=function(){var o=function(a){a&&a.domEvent&&a.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",o),a&&a.domEvent&&R.stopEvent(a.domEvent));}.bind(this);setTimeout(o,10),this.editor.on("nativecontextmenu",o);},t.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse();},t}();n.prototype.releaseMouse=null,i.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:L.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),M.MouseHandler=n;});ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s){s.on("click",function(l){var r=l.getDocumentPosition(),e=s.session,i=e.getFoldAt(r.row,r.column,1);i&&(l.getAccelKey()?e.removeFold(i):e.expandFold(i),l.stop());var n=l.domEvent&&l.domEvent.target;n&&R.hasCssClass(n,"ace_inline_button")&&R.hasCssClass(n,"ace_toggle_wrap")&&(e.setOption("wrap",!e.getUseWrapMode()),s.renderer.scrollCursorIntoView());}),s.on("gutterclick",function(l){var r=s.renderer.$gutterLayer.getRegion(l);if(r=="foldWidgets"){var e=l.getDocumentPosition().row,i=s.session;i.foldWidgets&&i.foldWidgets[e]&&s.session.onFoldWidgetClick(e,l),s.isFocused()||s.focus(),l.stop();}}),s.on("gutterdblclick",function(l){var r=s.renderer.$gutterLayer.getRegion(l);if(r=="foldWidgets"){var e=l.getDocumentPosition().row,i=s.session,n=i.getParentFoldRangeData(e,!0),t=n.range||n.firstRange;if(t){e=t.start.row;var o=i.getFoldAt(e,i.getLine(e).length,1);o?i.removeFold(o):(i.addFold("...",t),s.renderer.scrollCursorIntoView({row:t.start.row,column:0}));}l.stop();}});}return x}();M.FoldHandler=L;});ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(k,M,H){var R=k("../lib/keys"),L=k("../lib/event"),x=function(){function s(l){this.$editor=l,this.$data={editor:l},this.$handlers=[],this.setDefaultHandler(l.commands);}return s.prototype.setDefaultHandler=function(l){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=l,this.addKeyboardHandler(l,0);},s.prototype.setKeyboardHandler=function(l){var r=this.$handlers;if(r[r.length-1]!=l){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(l,1);}},s.prototype.addKeyboardHandler=function(l,r){if(l){typeof l=="function"&&!l.handleKeyboard&&(l.handleKeyboard=l);var e=this.$handlers.indexOf(l);e!=-1&&this.$handlers.splice(e,1),r==null?this.$handlers.push(l):this.$handlers.splice(r,0,l),e==-1&&l.attach&&l.attach(this.$editor);}},s.prototype.removeKeyboardHandler=function(l){var r=this.$handlers.indexOf(l);return r==-1?!1:(this.$handlers.splice(r,1),l.detach&&l.detach(this.$editor),!0)},s.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},s.prototype.getStatusText=function(){var l=this.$data,r=l.editor;return this.$handlers.map(function(e){return e.getStatusText&&e.getStatusText(r,l)||""}).filter(Boolean).join(" ")},s.prototype.$callKeyboardHandlers=function(l,r,e,i){for(var n,t=!1,o=this.$editor.commands,a=this.$handlers.length;a--&&(n=this.$handlers[a].handleKeyboard(this.$data,l,r,e,i),!(!(!n||!n.command)&&(n.command=="null"?t=!0:t=o.exec(n.command,this.$editor,n.args,i),t&&i&&l!=-1&&n.passEvent!=!0&&n.command.passEvent!=!0&&L.stopEvent(i),t))););return !t&&l==-1&&(n={command:"insertstring"},t=o.exec("insertstring",this.$editor,r)),t&&this.$editor._signal&&this.$editor._signal("keyboardActivity",n),t},s.prototype.onCommandKey=function(l,r,e){var i=R.keyCodeToString(e);return this.$callKeyboardHandlers(r,i,e,l)},s.prototype.onTextInput=function(l){return this.$callKeyboardHandlers(-1,l)},s}();M.KeyBinding=x;});ace.define("ace/lib/bidiutil",["require","exports","module"],function(k,M,H){var x=0,s=0,l=!1,e=!1,i=!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]],a=[[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]],u=0,w=1,S=0,m=1,$=2,d=3,h=4,v=5,C=6,y=7,b=8,f=9,p=10,c=11,g=12,A=13,T=14,E=15,_=16,O=17,I=18,N=[I,I,I,I,I,I,I,I,I,C,v,C,b,v,I,I,I,I,I,I,I,I,I,I,I,I,I,I,v,v,v,C,b,h,h,c,c,c,h,h,h,h,h,p,f,p,f,f,$,$,$,$,$,$,$,$,$,$,f,h,h,h,h,h,h,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,h,h,h,h,h,h,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,h,h,h,h,I,I,I,I,I,I,v,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,f,h,c,c,c,c,h,h,h,h,S,h,h,I,h,h,c,c,$,$,h,S,h,h,h,$,S,h,h,h,h,h],F=[b,b,b,b,b,b,b,b,b,b,b,I,I,I,S,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,b,v,A,T,E,_,O,f,c,c,c,c,c,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,f,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,b];function D(U,V,Y,K){var J=x?a:o,q=null,ee=null,Q=null,ne=0,pe=null,ge=null,ue=-1,ae=null,ce=null,we=[];if(!K)for(ae=0,K=[];ae<Y;ae++)K[ae]=z(U[ae]);for(s=x,l=!1,e=!1,i=!1,ce=0;ce<Y;ce++){if(q=ne,we[ce]=ee=B(U,K,we,ce),ne=J[q][ee],pe=ne&240,ne&=15,V[ce]=Q=J[ne][5],pe>0)if(pe==16){for(ae=ue;ae<ce;ae++)V[ae]=1;ue=-1;}else ue=-1;if(ge=J[ne][6],ge)ue==-1&&(ue=ce);else if(ue>-1){for(ae=ue;ae<ce;ae++)V[ae]=Q;ue=-1;}K[ce]==v&&(V[ce]=0),s|=Q;}if(i){for(ae=0;ae<Y;ae++)if(K[ae]==C){V[ae]=x;for(var me=ae-1;me>=0&&K[me]==b;me--)V[me]=x;}}}function W(U,V,Y){if(!(s<U)){if(U==1&&x==w&&!e){Y.reverse();return}for(var K=Y.length,J=0,q,ee,Q,ne;J<K;){if(V[J]>=U){for(q=J+1;q<K&&V[q]>=U;)q++;for(ee=J,Q=q-1;ee<Q;ee++,Q--)ne=Y[ee],Y[ee]=Y[Q],Y[Q]=ne;J=q;}J++;}}}function B(U,V,Y,K){var J=V[K],q,ee,Q,ne;switch(J){case S:case m:l=!1;case h:case d:return J;case $:return l?d:$;case y:return l=!0,m;case b:return h;case f:return K<1||K+1>=V.length||(q=Y[K-1])!=$&&q!=d||(ee=V[K+1])!=$&&ee!=d?h:(l&&(ee=d),ee==q?ee:h);case p:return q=K>0?Y[K-1]:v,q==$&&K+1<V.length&&V[K+1]==$?$:h;case c:if(K>0&&Y[K-1]==$)return $;if(l)return h;for(ne=K+1,Q=V.length;ne<Q&&V[ne]==c;)ne++;return ne<Q&&V[ne]==$?$:h;case g:for(Q=V.length,ne=K+1;ne<Q&&V[ne]==g;)ne++;if(ne<Q){var pe=U[K],ge=pe>=1425&&pe<=2303||pe==64286;if(q=V[ne],ge&&(q==m||q==y))return m}return K<1||(q=V[K-1])==v?h:Y[K-1];case v:return l=!1,e=!0,x;case C:return i=!0,h;case A:case T:case _:case O:case E:l=!1;case I:return h}}function z(U){var V=U.charCodeAt(0),Y=V>>8;return Y==0?V>191?S:N[V]:Y==5?/[\u0591-\u05f4]/.test(U)?m:S:Y==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(U)?g:/[\u0660-\u0669\u066b-\u066c]/.test(U)?d:V==1642?c:/[\u06f0-\u06f9]/.test(U)?$:y:Y==32&&V<=8287?F[V&255]:Y==254&&V>=65136?y:h}M.L=S,M.R=m,M.EN=$,M.ON_R=3,M.AN=4,M.R_H=5,M.B=6,M.RLE=7,M.DOT="\xB7",M.doBidiReorder=function(U,V,Y){if(U.length<2)return {};var K=U.split(""),J=new Array(K.length),q=new Array(K.length),ee=[];x=Y?w:u,D(K,ee,K.length,V);for(var Q=0;Q<J.length;J[Q]=Q,Q++);W(2,ee,J),W(1,ee,J);for(var Q=0;Q<J.length-1;Q++)V[Q]===d?ee[Q]=M.AN:ee[Q]===m&&(V[Q]>y&&V[Q]<A||V[Q]===h||V[Q]===I)?ee[Q]=M.ON_R:Q>0&&K[Q-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(K[Q])&&(ee[Q-1]=ee[Q]=M.R_H,Q++);K[K.length-1]===M.DOT&&(ee[K.length-1]=M.B),K[0]==="\u202B"&&(ee[0]=M.RLE);for(var Q=0;Q<J.length;Q++)q[Q]=ee[J[Q]];return {logicalFromVisual:J,bidiLevels:q}},M.hasBidiCharacters=function(U,V){for(var Y=!1,K=0;K<U.length;K++)V[K]=z(U.charAt(K)),!Y&&(V[K]==m||V[K]==y||V[K]==d)&&(Y=!0);return Y},M.getVisualFromLogicalIdx=function(U,V){for(var Y=0;Y<V.logicalFromVisual.length;Y++)if(V.logicalFromVisual[Y]==U)return Y;return 0};});ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(k,M,H){var R=k("./lib/bidiutil"),L=k("./lib/lang"),x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(){function l(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=R,this.charWidths=[],this.EOL="\xAC",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="\xB6",this.RLE="\u202B",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=x.test(r.getValue());}return l.prototype.isBidiRow=function(r,e,i){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(e,i),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},l.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&x.test(r.lines.join(`
198
- `))&&(this.seenBidi=!0,this.currentRow=null);},l.prototype.getDocumentRow=function(){var r=0,e=this.session.$screenRowCache;if(e.length){var i=this.session.$getRowCacheIndex(e,this.currentRow);i>=0&&(r=this.session.$docRowCache[i]);}return r},l.prototype.getSplitIndex=function(){var r=0,e=this.session.$screenRowCache;if(e.length)for(var i,n=this.session.$getRowCacheIndex(e,this.currentRow);this.currentRow-r>0&&(i=this.session.$getRowCacheIndex(e,this.currentRow-r-1),i===n);)n=i,r++;else r=this.currentRow;return r},l.prototype.updateRowLine=function(r,e){r===void 0&&(r=this.getDocumentRow());var i=r===this.session.getLength()-1,n=i?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var t=this.session.$wrapData[r];t&&(e===void 0&&(e=this.getSplitIndex()),e>0&&t.length?(this.wrapIndent=t.indent,this.wrapOffset=this.wrapIndent*this.charWidths[R.L],this.line=e<t.length?this.line.substring(t[e-1],t[e]):this.line.substring(t[t.length-1])):this.line=this.line.substring(0,t[e]),e==t.length&&(this.line+=this.showInvisibles?n:R.DOT));}else this.line+=this.showInvisibles?n:R.DOT;var o=this.session,a=0,u;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(w,S){return w===" "||o.isFullWidth(w.charCodeAt(0))?(u=w===" "?o.getScreenTabSize(S+a):2,a+=u-1,L.stringRepeat(R.DOT,u)):w}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==R.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width);},l.prototype.updateBidiMap=function(){var r=[];R.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=R.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={};},l.prototype.markAsDirty=function(){this.currentRow=null;},l.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var e=this.characterWidth=r.$characterSize.width,i=r.$measureCharWidth("\u05D4");this.charWidths[R.L]=this.charWidths[R.EN]=this.charWidths[R.ON_R]=e,this.charWidths[R.R]=this.charWidths[R.AN]=i,this.charWidths[R.R_H]=i*.45,this.charWidths[R.B]=this.charWidths[R.RLE]=0,this.currentRow=null;}},l.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null;},l.prototype.setEolChar=function(r){this.EOL=r;},l.prototype.setContentWidth=function(r){this.contentWidth=r;},l.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},l.prototype.setRtlDirection=function(r,e){for(var i=r.getCursorPosition(),n=r.selection.getSelectionAnchor().row;n<=i.row;n++)!e&&r.session.getLine(n).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(n,0,1):e&&r.session.getLine(n).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:n},r.session.$bidiHandler.RLE);},l.prototype.getPosLeft=function(r){r-=this.wrapIndent;var e=this.line.charAt(0)===this.RLE?1:0,i=r>e?this.session.getOverwrite()?r:r-1:e,n=R.getVisualFromLogicalIdx(i,this.bidiMap),t=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&r<=e&&t[n]%2!==0&&n++;for(var a=0;a<n;a++)o+=this.charWidths[t[a]];return !this.session.getOverwrite()&&r>e&&t[n]%2===0&&(o+=this.charWidths[t[n]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},l.prototype.getSelections=function(r,e){var i=this.bidiMap,n=i.bidiLevels,t,o=[],a=0,u=Math.min(r,e)-this.wrapIndent,w=Math.max(r,e)-this.wrapIndent,S=!1,m=!1,$=0;this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,h=0;h<n.length;h++)d=i.logicalFromVisual[h],t=n[h],S=d>=u&&d<w,S&&!m?$=a:!S&&m&&o.push({left:$,width:a-$}),a+=this.charWidths[t],m=S;if(S&&h===n.length&&o.push({left:$,width:a-$}),this.isRtlDir)for(var v=0;v<o.length;v++)o[v].left+=this.rtlLineOffset;return o},l.prototype.offsetToCol=function(i){this.isRtlDir&&(i-=this.rtlLineOffset);var e=0,i=Math.max(i,0),n=0,t=0,o=this.bidiMap.bidiLevels,a=this.charWidths[o[t]];for(this.wrapIndent&&(i-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i>n+a/2;){if(n+=a,t===o.length-1){a=0;break}a=this.charWidths[o[++t]];}return t>0&&o[t-1]%2!==0&&o[t]%2===0?(i<n&&t--,e=this.bidiMap.logicalFromVisual[t]):t>0&&o[t-1]%2===0&&o[t]%2!==0?e=1+(i>n?this.bidiMap.logicalFromVisual[t]:this.bidiMap.logicalFromVisual[t-1]):this.isRtlDir&&t===o.length-1&&a===0&&o[t-1]%2===0||!this.isRtlDir&&t===0&&o[t]%2!==0?e=1+this.bidiMap.logicalFromVisual[t]:(t>0&&o[t-1]%2!==0&&a!==0&&t--,e=this.bidiMap.logicalFromVisual[t]),e===0&&this.isRtlDir&&e++,e+this.wrapIndent},l}();M.BidiHandler=s;});ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/lang"),x=k("./lib/event_emitter").EventEmitter,s=k("./range").Range,l=function(){function r(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var i=this;this.cursor.on("change",function(n){i.$cursorChanged=!0,i.$silent||i._emit("changeCursor"),!i.$isEmpty&&!i.$silent&&i._emit("changeSelection"),!i.$keepDesiredColumnOnChange&&n.old.column!=n.value.column&&(i.$desiredColumn=null);}),this.anchor.on("change",function(){i.$anchorChanged=!0,!i.$isEmpty&&!i.$silent&&i._emit("changeSelection");});}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return !this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(e,i){this.$isEmpty=!1,this.anchor.setPosition(e,i);},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var e=this.anchor,i=this.lead;return e.row>i.row||e.row==i.row&&e.column>i.column},r.prototype.getRange=function(){var e=this.anchor,i=this.lead;return this.$isEmpty?s.fromPoints(i,i):this.isBackwards()?s.fromPoints(i,e):s.fromPoints(e,i)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"));},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE);},r.prototype.setRange=function(e,i){var n=i?e.end:e.start,t=i?e.start:e.end;this.$setSelection(n.row,n.column,t.row,t.column);},r.prototype.$setSelection=function(e,i,n,t){if(!this.$silent){var o=this.$isEmpty,a=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,i),this.cursor.setPosition(n,t),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||a)&&this._emit("changeSelection");}},r.prototype.$moveSelection=function(e){var i=this.lead;this.$isEmpty&&this.setSelectionAnchor(i.row,i.column),e.call(this);},r.prototype.selectTo=function(e,i){this.$moveSelection(function(){this.moveCursorTo(e,i);});},r.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e);});},r.prototype.moveTo=function(e,i){this.clearSelection(),this.moveCursorTo(e,i);},r.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e);},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp);},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown);},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight);},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft);},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart);},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd);},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd);},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart);},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight);},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft);},r.prototype.getWordRange=function(e,i){if(typeof i>"u"){var n=e||this.lead;e=n.row,i=n.column;}return this.session.getWordRange(e,i)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange());},r.prototype.selectAWord=function(){var e=this.getCursor(),i=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(i);},r.prototype.getLineRange=function(e,i){var n=typeof e=="number"?e:this.lead.row,t,o=this.session.getFoldLine(n);return o?(n=o.start.row,t=o.end.row):t=n,i===!0?new s(n,0,t,this.session.getLine(t).length):new s(n,0,t+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange());},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0);},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0);},r.prototype.wouldMoveIntoSoftTab=function(e,i,n){var t=e.column,o=e.column+i;return n<0&&(t=e.column-i,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(t,o).split(" ").length-1==i},r.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),i;if(i=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(i.start.row,i.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else {var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1);}},r.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),i;if(i=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(i.end.row,i.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 n=this.session.getTabSize(),e=this.lead;this.wouldMoveIntoSoftTab(e,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1);}},r.prototype.moveCursorLineStart=function(){var e=this.lead.row,i=this.lead.column,n=this.session.documentToScreenRow(e,i),t=this.session.screenToDocumentPosition(n,0),o=this.session.getDisplayLine(e,null,t.row,t.column),a=o.match(/^\s*/);a[0].length!=i&&!this.session.$useEmacsStyleLineStart&&(t.column+=a[0].length),this.moveCursorToPosition(t);},r.prototype.moveCursorLineEnd=function(){var e=this.lead,i=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==i.column){var n=this.session.getLine(i.row);if(i.column==n.length){var t=n.search(/\s+$/);t>0&&(i.column=t);}}this.moveCursorTo(i.row,i.column);},r.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,i=this.doc.getLine(e).length;this.moveCursorTo(e,i);},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0);},r.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,i=this.lead.column,n=this.doc.getLine(e),t=n.substring(i);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,i,1);if(o){this.moveCursorTo(o.end.row,o.end.column);return}if(this.session.nonTokenRe.exec(t)&&(i+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,t=n.substring(i)),i>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(t)&&(i+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,i);},r.prototype.moveCursorLongWordLeft=function(){var e=this.lead.row,i=this.lead.column,n;if(n=this.session.getFoldAt(e,i,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var t=this.session.getFoldStringAt(e,i,-1);t==null&&(t=this.doc.getLine(e).substring(0,i));var o=L.stringReverse(t);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(o)&&(i-=this.session.nonTokenRe.lastIndex,o=o.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0){this.moveCursorTo(e,0),this.moveCursorLeft(),e>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(o)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,i);},r.prototype.$shortWordEndIndex=function(e){var i=0,n,t=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else {for(;(n=e[i])&&t.test(n);)i++;if(i<1){for(o.lastIndex=0;(n=e[i])&&!o.test(n);)if(o.lastIndex=0,i++,t.test(n))if(i>2){i--;break}else {for(;(n=e[i])&&t.test(n);)i++;if(i>2)break}}}return o.lastIndex=0,i},r.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,i=this.lead.column,n=this.doc.getLine(e),t=n.substring(i),o=this.session.getFoldAt(e,i,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(i==n.length){var a=this.doc.getLength();do e++,t=this.doc.getLine(e);while(e<a&&/^\s*$/.test(t));/^\s+/.test(t)||(t=""),i=0;}var u=this.$shortWordEndIndex(t);this.moveCursorTo(e,i+u);},r.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row,i=this.lead.column,n;if(n=this.session.getFoldAt(e,i,-1))return this.moveCursorTo(n.start.row,n.start.column);var t=this.session.getLine(e).substring(0,i);if(i===0){do e--,t=this.doc.getLine(e);while(e>0&&/^\s*$/.test(t));i=t.length,/\s+$/.test(t)||(t="");}var o=L.stringReverse(t),a=this.$shortWordEndIndex(o);return this.moveCursorTo(e,i-a)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight();},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft();},r.prototype.moveCursorBy=function(e,i){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),t;if(i===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(t=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(t/this.session.$bidiHandler.charWidths[0])):t=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];e<0?e-=o.rowsAbove||0:e>0&&(e+=o.rowCount-(o.rowsAbove||0));}var a=this.session.screenToDocumentPosition(n.row+e,n.column,t);e!==0&&i===0&&a.row===this.lead.row&&(a.column,this.lead.column),this.moveCursorTo(a.row,a.column+i,i===0);},r.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column);},r.prototype.moveCursorTo=function(e,i,n){var t=this.session.getFoldAt(e,i,1);t&&(e=t.start.row,i=t.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(i))&&o.charAt(i-1)&&(this.lead.row==e&&this.lead.column==i+1?i=i-1:i=i+1),this.lead.setPosition(e,i),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null);},r.prototype.moveCursorToScreen=function(e,i,n){var t=this.session.screenToDocumentPosition(e,i);this.moveCursorTo(t.row,t.column,n);},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach();},r.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn;},r.prototype.toOrientedRange=function(e){var i=this.getRange();return e?(e.start.column=i.start.column,e.start.row=i.start.row,e.end.column=i.end.column,e.end.row=i.end.row):e=i,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},r.prototype.getRangeOfMovements=function(e){var i=this.getCursor();try{e(this);var n=this.getCursor();return s.fromPoints(i,n)}catch{return s.fromPoints(i,i)}finally{this.moveCursorToPosition(i);}},r.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(i){var n=i.clone();return n.isBackwards=i.cursor==i.start,n});else {var e=this.getRange();e.isBackwards=this.isBackwards();}return e},r.prototype.fromJSON=function(e){if(e.start==null)if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var i=e.length;i--;){var n=s.fromPoints(e[i].start,e[i].end);e[i].isBackwards&&(n.cursor=n.start),this.addRange(n,!0);}return}else e=e[0];this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards);},r.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return !1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var i=this.ranges.length;i--;)if(!this.ranges[i].isEqual(e[i]))return !1;return !0},r}();l.prototype.setSelectionAnchor=l.prototype.setAnchor,l.prototype.getSelectionAnchor=l.prototype.getAnchor,l.prototype.setSelectionRange=l.prototype.setRange,R.implement(l.prototype,x),M.Selection=l;});ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(k,M,H){var R=k("./lib/report_error").reportError,L=2e3,x=function(){function s(l){this.splitRegex,this.states=l,this.regExps={},this.matchMappings={};for(var r in this.states){for(var e=this.states[r],i=[],n=0,t=this.matchMappings[r]={defaultToken:"text"},o="g",a=[],u=0;u<e.length;u++){var w=e[u];if(w.defaultToken&&(t.defaultToken=w.defaultToken),w.caseInsensitive&&o.indexOf("i")===-1&&(o+="i"),w.unicode&&o.indexOf("u")===-1&&(o+="u"),w.regex!=null){w.regex instanceof RegExp&&(w.regex=w.regex.toString().slice(1,-1));var S=w.regex,m=new RegExp("(?:("+S+")|(.))").exec("a").length-2;Array.isArray(w.token)?w.token.length==1||m==1?w.token=w.token[0]:m-1!=w.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:w,groupCount:m-1}),w.token=w.token[0]):(w.tokenArray=w.token,w.token=null,w.onMatch=this.$arrayTokens):typeof w.token=="function"&&!w.onMatch&&(m>1?w.onMatch=this.$applyToken:w.onMatch=w.token),m>1&&(/\\\d/.test(w.regex)?S=w.regex.replace(/\\([0-9]+)/g,function($,d){return "\\"+(parseInt(d,10)+n+1)}):(m=1,S=this.removeCapturingGroups(w.regex)),!w.splitRegex&&typeof w.token!="string"&&a.push(w)),t[n]=u,n+=m,i.push(S),w.onMatch||(w.onMatch=null);}}i.length||(t[0]=0,i.push("$")),a.forEach(function($){$.splitRegex=this.createSplitterRegexp($.regex,o);},this),this.regExps[r]=new RegExp("("+i.join(")|(")+")|($)",o);}}return s.prototype.$setMaxTokenCount=function(l){L=l|0;},s.prototype.$applyToken=function(l){var r=this.splitRegex.exec(l).slice(1),e=this.token.apply(this,r);if(typeof e=="string")return [{type:e,value:l}];for(var i=[],n=0,t=e.length;n<t;n++)r[n]&&(i[i.length]={type:e[n],value:r[n]});return i},s.prototype.$arrayTokens=function(l){if(!l)return [];var r=this.splitRegex.exec(l);if(!r)return "text";for(var e=[],i=this.tokenArray,n=0,t=i.length;n<t;n++)r[n+1]&&(e[e.length]={type:i[n],value:r[n+1]});return e},s.prototype.removeCapturingGroups=function(l){var r=l.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(e,i){return i?"(?:":e});return r},s.prototype.createSplitterRegexp=function(l,r){if(l.indexOf("(?=")!=-1){var e=0,i=!1,n={};l.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(t,o,a,u,w,S){return i?i=w!="]":w?i=!0:u?(e==n.stack&&(n.end=S+1,n.stack=-1),e--):a&&(e++,a.length!=1&&(n.stack=e,n.start=S)),t}),n.end!=null&&/^\)*$/.test(l.substr(n.end))&&(l=l.substring(0,n.start)+l.substr(n.end));}return l.charAt(0)!="^"&&(l="^"+l),l.charAt(l.length-1)!="$"&&(l+="$"),new RegExp(l,(r||"").replace("g",""))},s.prototype.getLineTokens=function(l,r){if(r&&typeof r!="string"){var e=r.slice(0);r=e[0],r==="#tmp"&&(e.shift(),r=e.shift());}else var e=[];var i=r||"start",n=this.states[i];n||(i="start",n=this.states[i]);var t=this.matchMappings[i],o=this.regExps[i];o.lastIndex=0;for(var a,u=[],w=0,S=0,m={type:null,value:""};a=o.exec(l);){var $=t.defaultToken,d=null,h=a[0],v=o.lastIndex;if(v-h.length>w){var C=l.substring(w,v-h.length);m.type==$?m.value+=C:(m.type&&u.push(m),m={type:$,value:C});}for(var y=0;y<a.length-2;y++)if(a[y+1]!==void 0){d=n[t[y]],d.onMatch?$=d.onMatch(h,i,e,l):$=d.token,d.next&&(typeof d.next=="string"?i=d.next:i=d.next(i,e),n=this.states[i],n||(this.reportError("state doesn't exist",i),i="start",n=this.states[i]),t=this.matchMappings[i],w=v,o=this.regExps[i],o.lastIndex=v),d.consumeLineEnd&&(w=v);break}if(h){if(typeof $=="string")(!d||d.merge!==!1)&&m.type===$?m.value+=h:(m.type&&u.push(m),m={type:$,value:h});else if($){m.type&&u.push(m),m={type:null,value:""};for(var y=0;y<$.length;y++)u.push($[y]);}}if(w==l.length)break;if(w=v,S++>L){for(S>2*l.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:l});w<l.length;)m.type&&u.push(m),m={value:l.substring(w,w+=500),type:"overflow"};i="start",e=[];break}}return m.type&&u.push(m),e.length>1&&e[0]!==i&&e.unshift("#tmp",i),{tokens:u,state:e.length?e:i}},s}();x.prototype.reportError=R,M.Tokenizer=x;});ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(k,M,H){var R=k("../lib/deep_copy").deepCopy,L;L=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]};},function(){this.addRules=function(l,r){if(!r){for(var e in l)this.$rules[e]=l[e];return}for(var e in l){for(var i=l[e],n=0;n<i.length;n++){var t=i[n];(t.next||t.onMatch)&&(typeof t.next=="string"&&t.next.indexOf(r)!==0&&(t.next=r+t.next),t.nextState&&t.nextState.indexOf(r)!==0&&(t.nextState=r+t.nextState));}this.$rules[r+e]=i;}},this.getRules=function(){return this.$rules},this.embedRules=function(l,r,e,i,n){var t=typeof l=="function"?new l().getRules():l;if(i)for(var o=0;o<i.length;o++)i[o]=r+i[o];else {i=[];for(var a in t)i.push(r+a);}if(this.addRules(t,r),e)for(var u=Array.prototype[n?"push":"unshift"],o=0;o<i.length;o++)u.apply(this.$rules[i[o]],R(e));this.$embeds||(this.$embeds=[]),this.$embeds.push(r);},this.getEmbeds=function(){return this.$embeds};var x=function(l,r){return (l!="start"||r.length)&&r.unshift(this.nextState,l),this.nextState},s=function(l,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var l=0,r=this.$rules;function e(i){var n=r[i];n.processed=!0;for(var t=0;t<n.length;t++){var o=n[t],a=null;Array.isArray(o)&&(a=o,o={}),!o.regex&&o.start&&(o.regex=o.start,o.next||(o.next=[]),o.next.push({defaultToken:o.token},{token:o.token+".end",regex:o.end||o.start,next:"pop"}),o.token=o.token+".start",o.push=!0);var u=o.next||o.push;if(u&&Array.isArray(u)){var w=o.stateName;w||(w=o.token,typeof w!="string"&&(w=w[0]||""),r[w]&&(w+=l++)),r[w]=u,o.next=w,e(w);}else u=="pop"&&(o.next=s);if(o.push&&(o.nextState=o.next||o.push,o.next=x,delete o.push),o.rules)for(var S in o.rules)r[S]?r[S].push&&r[S].push.apply(r[S],o.rules[S]):r[S]=o.rules[S];var m=typeof o=="string"?o:o.include;if(m&&(m==="$self"&&(m="start"),Array.isArray(m)?a=m.map(function(d){return r[d]}):a=r[m]),a){var $=[t,1].concat(a);o.noEscape&&($=$.filter(function(d){return !d.next})),n.splice.apply(n,$),t--;}o.keywordMap&&(o.token=this.createKeywordMapper(o.keywordMap,o.defaultToken||"text",o.caseInsensitive),delete o.defaultToken);}}Object.keys(r).forEach(e,this);},this.createKeywordMapper=function(l,r,e,i){var n=Object.create(null);return this.$keywordList=[],Object.keys(l).forEach(function(t){for(var o=l[t],a=o.split(i||"|"),u=a.length;u--;){var w=a[u];this.$keywordList.push(w),e&&(w=w.toLowerCase()),n[w]=t;}},this),l=null,e?function(t){return n[t.toLowerCase()]||r}:function(t){return n[t]||r}},this.getKeywords=function(){return this.$keywords};}.call(L.prototype),M.TextHighlightRules=L;});ace.define("ace/mode/behaviour",["require","exports","module"],function(k,M,H){var R;R=function(){this.$behaviours={};},function(){this.add=function(L,x,s){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[L]:this.$behaviours[L]={};}this.$behaviours[L][x]=s;},this.addBehaviours=function(L){for(var x in L)for(var s in L[x])this.add(x,s,L[x][s]);},this.remove=function(L){this.$behaviours&&this.$behaviours[L]&&delete this.$behaviours[L];},this.inherit=function(L,x){if(typeof L=="function")var s=new L().getBehaviours(x);else var s=L.getBehaviours(x);this.addBehaviours(s);},this.getBehaviours=function(L){if(L){for(var x={},s=0;s<L.length;s++)this.$behaviours[L[s]]&&(x[L[s]]=this.$behaviours[L[s]]);return x}else return this.$behaviours};}.call(R.prototype),M.Behaviour=R;});ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(k,M,H){var R=k("./range").Range,L=function(){function x(s,l,r){this.$session=s,this.$row=l,this.$rowTokens=s.getTokens(l);var e=s.getTokenAt(l,r);this.$tokenIndex=e?e.index:-1;}return x.prototype.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]},x.prototype.stepForward=function(){this.$tokenIndex+=1;for(var s;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,s||(s=this.$session.getLength()),this.$row>=s)return this.$row=s-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0;}return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentTokenRow=function(){return this.$row},x.prototype.getCurrentTokenColumn=function(){var s=this.$rowTokens,l=this.$tokenIndex,r=s[l].start;if(r!==void 0)return r;for(r=0;l>0;)l-=1,r+=s[l].value.length;return r},x.prototype.getCurrentTokenPosition=function(){return {row:this.$row,column:this.getCurrentTokenColumn()}},x.prototype.getCurrentTokenRange=function(){var s=this.$rowTokens[this.$tokenIndex],l=this.getCurrentTokenColumn();return new R(this.$row,l,this.$row,l+s.value.length)},x}();M.TokenIterator=L;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(k,M,H){var R=k("../../lib/oop"),L=k("../behaviour").Behaviour,x=k("../../token_iterator").TokenIterator,s=k("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],e,i={},n={'"':'"',"'":"'"},t=function(u){var w=-1;if(u.multiSelect&&(w=u.selection.index,i.rangeCount!=u.multiSelect.rangeCount&&(i={rangeCount:u.multiSelect.rangeCount})),i[w])return e=i[w];e=i[w]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};},o=function(u,w,S,m){var $=u.end.row-u.start.row;return {text:S+w+m,selection:[0,u.start.column+1,$,u.end.column+($?0:1)]}},a;a=function(u){u=u||{},this.add("braces","insertion",function(w,S,m,$,d){var h=m.getCursorPosition(),v=$.doc.getLine(h.row);if(d=="{"){t(m);var C=m.getSelectionRange(),y=$.doc.getTextRange(C),b=$.getTokenAt(h.row,h.column);if(y!==""&&y!=="{"&&m.getWrapBehavioursEnabled())return o(C,y,"{","}");if(b&&/(?:string)\.quasi|\.xml/.test(b.type)){var f=[/tag\-(?:open|name)/,/attribute\-name/];return f.some(function(_){return _.test(b.type)})||/(string)\.quasi/.test(b.type)&&b.value[h.column-b.start-1]!=="$"?void 0:(a.recordAutoInsert(m,$,"}"),{text:"{}",selection:[1,1]})}else if(a.isSaneInsertion(m,$))return /[\]\}\)]/.test(v[h.column])||m.inMultiSelectMode||u.braces?(a.recordAutoInsert(m,$,"}"),{text:"{}",selection:[1,1]}):(a.recordMaybeInsert(m,$,"{"),{text:"{",selection:[1,1]})}else if(d=="}"){t(m);var p=v.substring(h.column,h.column+1);if(p=="}"){var c=$.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(c!==null&&a.isAutoInsertedClosing(h,v,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(d==`
198
+ `).length>2?ie=o.down:re>T&&g[re-1]==" "?(ie=o.right,he=a.option):(re>T||re==T&&T!=A&&se==re)&&(ie=o.right),se!==re&&(he|=a.shift),ie){var Ae=j.onCommandKey({},he,ie);if(!Ae&&j.commands){ie=o.keyCodeToString(ie);var Ze=j.commands.findKeyCommand(he,ie);Ze&&j.execCommand(Ze);}A=se,T=re,D("");}}};document.addEventListener("selectionchange",oe),j.on("destroy",function(){document.removeEventListener("selectionchange",oe);});}this.destroy=function(){h.parentElement&&h.parentElement.removeChild(h);};},M.TextInput=m,M.$setUserAgentForTests=function($,d){S=$,u=d;};});ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(k,M,H){var R=k("../lib/useragent"),L=0,x=550,s=function(){function t(i){i.$clickSelection=null;var n=i.editor;n.setDefaultHandler("mousedown",this.onMouseDown.bind(i)),n.setDefaultHandler("dblclick",this.onDoubleClick.bind(i)),n.setDefaultHandler("tripleclick",this.onTripleClick.bind(i)),n.setDefaultHandler("quadclick",this.onQuadClick.bind(i)),n.setDefaultHandler("mousewheel",this.onMouseWheel.bind(i));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(o){i[o]=this[o];},this),i.selectByLines=this.extendSelectionBy.bind(i,"getLineRange"),i.selectByWords=this.extendSelectionBy.bind(i,"getWordRange");}return t.prototype.onMouseDown=function(i){var n=i.inSelection(),e=i.getDocumentPosition();this.mousedownEvent=i;var o=this.editor,a=i.getButton();if(a!==0){var u=o.getSelectionRange(),w=u.isEmpty();(w||a==1)&&o.selection.moveToPosition(e),a==2&&(o.textInput.onContextMenu(i.domEvent),R.isMozilla||i.preventDefault());return}if(this.mousedownEvent.time=Date.now(),n&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(i);return}return this.captureMouse(i),this.startSelect(e,i.domEvent._clicks>1),i.preventDefault()},t.prototype.startSelect=function(i,n){i=i||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(i):n||e.selection.moveToPosition(i),n||this.select(),e.setStyle("ace_selecting"),this.setState("select"));},t.prototype.select=function(){var i,n=this.editor,e=n.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(e);if(o==-1)i=this.$clickSelection.end;else if(o==1)i=this.$clickSelection.start;else {var a=r(this.$clickSelection,e);e=a.cursor,i=a.anchor;}n.selection.setSelectionAnchor(i.row,i.column);}n.selection.selectToPosition(e),n.renderer.scrollCursorIntoView();},t.prototype.extendSelectionBy=function(i){var n,e=this.editor,o=e.renderer.screenToTextCoordinates(this.x,this.y),a=e.selection[i](o.row,o.column);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(a.start),w=this.$clickSelection.comparePoint(a.end);if(u==-1&&w<=0)n=this.$clickSelection.end,(a.end.row!=o.row||a.end.column!=o.column)&&(o=a.start);else if(w==1&&u>=0)n=this.$clickSelection.start,(a.start.row!=o.row||a.start.column!=o.column)&&(o=a.end);else if(u==-1&&w==1)o=a.end,n=a.start;else {var S=r(this.$clickSelection,o);o=S.cursor,n=S.anchor;}e.selection.setSelectionAnchor(n.row,n.column);}e.selection.selectToPosition(o),e.renderer.scrollCursorIntoView();},t.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting");},t.prototype.focusWait=function(){var i=c(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),n=Date.now();(i>L||n-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition());},t.prototype.onDoubleClick=function(i){var n=i.getDocumentPosition(),e=this.editor,o=e.session,a=o.getBracketRange(n);a?(a.isEmpty()&&(a.start.column--,a.end.column++),this.setState("select")):(a=e.selection.getWordRange(n.row,n.column),this.setState("selectByWords")),this.$clickSelection=a,this.select();},t.prototype.onTripleClick=function(i){var n=i.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var o=e.getSelectionRange();o.isMultiLine()&&o.contains(n.row,n.column)?(this.$clickSelection=e.selection.getLineRange(o.start.row),this.$clickSelection.end=e.selection.getLineRange(o.end.row).end):this.$clickSelection=e.selection.getLineRange(n.row),this.select();},t.prototype.onQuadClick=function(i){var n=this.editor;n.selectAll(),this.$clickSelection=n.getSelectionRange(),this.setState("selectAll");},t.prototype.onMouseWheel=function(i){if(!i.getAccelKey()){i.getShiftKey()&&i.wheelY&&!i.wheelX&&(i.wheelX=i.wheelY,i.wheelY=0);var n=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,o=i.domEvent.timeStamp,a=o-e.t,u=a?i.wheelX/a:e.vx,w=a?i.wheelY/a:e.vy;a<x&&(u=(u+e.vx)/2,w=(w+e.vy)/2);var S=Math.abs(u/w),m=!1;if(S>=1&&n.renderer.isScrollableBy(i.wheelX*i.speed,0)&&(m=!0),S<=1&&n.renderer.isScrollableBy(0,i.wheelY*i.speed)&&(m=!0),m)e.allowed=o;else if(o-e.allowed<x){var $=Math.abs(u)<=1.5*Math.abs(e.vx)&&Math.abs(w)<=1.5*Math.abs(e.vy);$?(m=!0,e.allowed=o):e.allowed=0;}if(e.t=o,e.vx=u,e.vy=w,m)return n.renderer.scrollBy(i.wheelX*i.speed,i.wheelY*i.speed),i.stop()}},t}();s.prototype.selectEnd=s.prototype.selectByLinesEnd,s.prototype.selectAllEnd=s.prototype.selectByLinesEnd,s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd,M.DefaultHandlers=s;function c(t,i,n,e){return Math.sqrt(Math.pow(n-t,2)+Math.pow(e-i,2))}function r(t,i){if(t.start.row==t.end.row)var n=2*i.column-t.start.column-t.end.column;else if(t.start.row==t.end.row-1&&!t.start.column&&!t.end.column)var n=i.column-4;else var n=2*i.row-t.start.row-t.end.row;return n<0?{cursor:t.start,anchor:t.end}:{cursor:t.end,anchor:t.start}}});ace.define("ace/lib/scroll",["require","exports","module"],function(k,M,H){M.preventParentScroll=function(L){L.stopPropagation();var x=L.currentTarget,s=x.scrollHeight>x.clientHeight;s||L.preventDefault();};});ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(k,M,H){var R=this&&this.__extends||function(){var a=function(u,w){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,m){S.__proto__=m;}||function(S,m){for(var $ in m)Object.prototype.hasOwnProperty.call(m,$)&&(S[$]=m[$]);},a(u,w)};return function(u,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");a(u,w);function S(){this.constructor=u;}u.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S);}}(),L=this&&this.__values||function(a){var u=typeof Symbol=="function"&&Symbol.iterator,w=u&&a[u],S=0;if(w)return w.call(a);if(a&&typeof a.length=="number")return {next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")},x=k("./lib/dom");k("./lib/event");var c=k("./range").Range,r=k("./lib/scroll").preventParentScroll,t="ace_tooltip",i=function(){function a(u){this.isOpen=!1,this.$element=null,this.$parentNode=u;}return a.prototype.$init=function(){return this.$element=x.createElement("div"),this.$element.className=t,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},a.prototype.getElement=function(){return this.$element||this.$init()},a.prototype.setText=function(u){this.getElement().textContent=u;},a.prototype.setHtml=function(u){this.getElement().innerHTML=u;},a.prototype.setPosition=function(u,w){this.getElement().style.left=u+"px",this.getElement().style.top=w+"px";},a.prototype.setClassName=function(u){x.addCssClass(this.getElement(),u);},a.prototype.setTheme=function(u){this.$element.className=t+" "+(u.isDark?"ace_dark ":"")+(u.cssClass||"");},a.prototype.show=function(u,w,S){u!=null&&this.setText(u),w!=null&&S!=null&&this.setPosition(w,S),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0);},a.prototype.hide=function(u){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=t,this.isOpen=!1);},a.prototype.getHeight=function(){return this.getElement().offsetHeight},a.prototype.getWidth=function(){return this.getElement().offsetWidth},a.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element);},a}(),n=function(){function a(){this.popups=[];}return a.prototype.addPopup=function(u){this.popups.push(u),this.updatePopups();},a.prototype.removePopup=function(u){var w=this.popups.indexOf(u);w!==-1&&(this.popups.splice(w,1),this.updatePopups());},a.prototype.updatePopups=function(){var u,w,S,m;this.popups.sort(function(p,l){return l.priority-p.priority});var $=[];try{for(var d=L(this.popups),h=d.next();!h.done;h=d.next()){var v=h.value,C=!0;try{for(var y=(S=void 0,L($)),b=y.next();!b.done;b=y.next()){var f=b.value;if(this.doPopupsOverlap(f,v)){C=!1;break}}}catch(p){S={error:p};}finally{try{b&&!b.done&&(m=y.return)&&m.call(y);}finally{if(S)throw S.error}}C?$.push(v):v.hide();}}catch(p){u={error:p};}finally{try{h&&!h.done&&(w=d.return)&&w.call(d);}finally{if(u)throw u.error}}},a.prototype.doPopupsOverlap=function(u,w){var S=u.getElement().getBoundingClientRect(),m=w.getElement().getBoundingClientRect();return S.left<m.right&&S.right>m.left&&S.top<m.bottom&&S.bottom>m.top},a}(),e=new n;M.popupManager=e,M.Tooltip=i;var o=function(a){R(u,a);function u(w){w===void 0&&(w=document.body);var S=a.call(this,w)||this;S.timeout=void 0,S.lastT=0,S.idleTime=350,S.lastEvent=void 0,S.onMouseOut=S.onMouseOut.bind(S),S.onMouseMove=S.onMouseMove.bind(S),S.waitForHover=S.waitForHover.bind(S),S.hide=S.hide.bind(S);var m=S.getElement();return m.style.whiteSpace="pre-wrap",m.style.pointerEvents="auto",m.addEventListener("mouseout",S.onMouseOut),m.tabIndex=-1,m.addEventListener("blur",function(){m.contains(document.activeElement)||this.hide();}.bind(S)),m.addEventListener("wheel",r),S}return u.prototype.addToEditor=function(w){w.on("mousemove",this.onMouseMove),w.on("mousedown",this.hide),w.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0);},u.prototype.removeFromEditor=function(w){w.off("mousemove",this.onMouseMove),w.off("mousedown",this.hide),w.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null);},u.prototype.onMouseMove=function(w,S){this.lastEvent=w,this.lastT=Date.now();var m=S.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||m||this.isOutsideOfText(this.lastEvent))&&this.hide();}this.timeout||m||(this.lastEvent=w,this.timeout=setTimeout(this.waitForHover,this.idleTime));},u.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var w=Date.now()-this.lastT;if(this.idleTime-w>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-w);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor);},u.prototype.isOutsideOfText=function(w){var S=w.editor,m=w.getDocumentPosition(),$=S.session.getLine(m.row);if(m.column==$.length){var d=S.renderer.pixelToScreenCoordinates(w.clientX,w.clientY),h=S.session.documentToScreenPosition(m.row,m.column);if(h.column!=d.column||h.row!=d.row)return !0}return !1},u.prototype.setDataProvider=function(w){this.$gatherData=w;},u.prototype.showForRange=function(w,S,m,$){var d=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var h=w.renderer;this.isOpen||(e.addPopup(this),this.$registerCloseEvents(),this.setTheme(h.theme)),this.isOpen=!0,this.addMarker(S,w.session),this.range=c.fromPoints(S.start,S.end);var v=h.textToScreenCoordinates(S.start.row,S.start.column),C=h.scroller.getBoundingClientRect();v.pageX<C.left&&(v.pageX=C.left);var y=this.getElement();y.innerHTML="",y.appendChild(m),y.style.maxHeight="",y.style.display="block";var b=y.clientHeight,f=y.clientWidth,p=window.innerHeight-v.pageY-h.lineHeight,l=!0;v.pageY-b<0&&v.pageY<p&&(l=!1),y.style.maxHeight=(l?v.pageY:p)-d+"px",y.style.top=l?"":v.pageY+h.lineHeight+"px",y.style.bottom=l?window.innerHeight-v.pageY+"px":"",y.style.left=Math.min(v.pageX,window.innerWidth-f-d)+"px";}},u.prototype.addMarker=function(w,S){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=S,this.marker=S&&S.addMarker(w,"ace_highlight-marker","text");},u.prototype.hide=function(w){!w&&document.activeElement==this.getElement()||w&&w.target&&(w.type!="keydown"||w.ctrlKey||w.metaKey)&&this.$element.contains(w.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,e.removePopup(this)));},u.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0);},u.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0);},u.prototype.onMouseOut=function(w){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!w.relatedTarget||this.getElement().contains(w.relatedTarget)||w&&w.currentTarget.contains(w.relatedTarget)||w.relatedTarget.classList.contains("ace_content")||this.hide());},u}(i);M.HoverTooltip=o;});ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(k,M,H){var R=this&&this.__extends||function(){var e=function(o,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w;}||function(u,w){for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(u[S]=w[S]);},e(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(o,a);function u(){this.constructor=o;}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u);}}(),L=this&&this.__values||function(e){var o=typeof Symbol=="function"&&Symbol.iterator,a=o&&e[o],u=0;if(a)return a.call(e);if(e&&typeof e.length=="number")return {next:function(){return e&&u>=e.length&&(e=void 0),{value:e&&e[u++],done:!e}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},x=k("../lib/dom"),s=k("../lib/event"),c=k("../tooltip").Tooltip,r=k("../config").nls;k("../lib/lang");function i(e){var o=e.editor,a=o.renderer.$gutterLayer,u=new n(o);e.editor.setDefaultHandler("guttermousedown",function(h){if(!(!o.isFocused()||h.getButton()!=0)){var v=a.getRegion(h);if(v!="foldWidgets"){var C=h.getDocumentPosition().row,y=o.session.selection;if(h.getShiftKey())y.selectTo(C,0);else {if(h.domEvent.detail==2)return o.selectAll(),h.preventDefault();e.$clickSelection=o.selection.getLineRange(C);}return e.setState("selectByLines"),e.captureMouse(h),h.preventDefault()}}});var w,S;function m(){var h=S.getDocumentPosition().row,v=o.session.getLength();if(h==v){var C=o.renderer.pixelToScreenCoordinates(0,S.y).row,y=S.$pos;if(C>o.session.documentToScreenRow(y.row,y.column))return $()}if(u.showTooltip(h),!!u.isOpen)if(o.on("mousewheel",$),e.$tooltipFollowsMouse)d(S);else {var b=S.getGutterRow(),f=a.$lines.get(b);if(f){var p=f.element.querySelector(".ace_gutter_annotation"),l=p.getBoundingClientRect(),g=u.getElement().style;g.left=l.right+"px",g.top=l.bottom+"px";}else d(S);}}function $(){w&&(w=clearTimeout(w)),u.isOpen&&(u.hideTooltip(),o.off("mousewheel",$));}function d(h){u.setPosition(h.x,h.y);}e.editor.setDefaultHandler("guttermousemove",function(h){var v=h.domEvent.target||h.domEvent.srcElement;if(x.hasCssClass(v,"ace_fold-widget"))return $();u.isOpen&&e.$tooltipFollowsMouse&&d(h),S=h,!w&&(w=setTimeout(function(){w=null,S&&!e.isMousePressed?m():$();},50));}),s.addListener(o.renderer.$gutter,"mouseout",function(h){S=null,!(!u.isOpen||w)&&(w=setTimeout(function(){w=null,$();},50));},o),o.on("changeSession",$),o.on("input",$);}M.GutterHandler=i;var n=function(e){R(o,e);function o(a){var u=e.call(this,a.container)||this;return u.editor=a,u}return o.prototype.setPosition=function(a,u){var w=window.innerWidth||document.documentElement.clientWidth,S=window.innerHeight||document.documentElement.clientHeight,m=this.getWidth(),$=this.getHeight();a+=15,u+=15,a+m>w&&(a-=a+m-w),u+$>S&&(u-=20+$),c.prototype.setPosition.call(this,a,u);},Object.defineProperty(o,"annotationLabels",{get:function(){return {error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")}}},enumerable:!1,configurable:!0}),o.prototype.showTooltip=function(a){var u,w=this.editor.renderer.$gutterLayer,S=w.$annotations[a],m;S?m={displayText:Array.from(S.displayText),type:Array.from(S.type)}:m={displayText:[],type:[]};var $=w.session.getFoldLine(a);if($&&w.$showFoldedAnnotations){for(var d={error:[],warning:[],info:[]},h,v=a+1;v<=$.end.row;v++)if(w.$annotations[v])for(var C=0;C<w.$annotations[v].text.length;C++){var y=w.$annotations[v].type[C];if(d[y].push(w.$annotations[v].text[C]),y==="error"){h="error_fold";continue}if(y==="warning"){h="warning_fold";continue}}if(h==="error_fold"||h==="warning_fold"){var b="".concat(o.annotationsToSummaryString(d)," in folded code.");m.displayText.push(b),m.type.push(h);}}if(m.displayText.length===0)return this.hide();for(var f={error:[],warning:[],info:[]},p=w.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",v=0;v<m.displayText.length;v++){var l=x.createElement("span"),g=x.createElement("span");(u=g.classList).add.apply(u,["ace_".concat(m.type[v]),p]),g.setAttribute("aria-label","".concat(o.annotationLabels[m.type[v].replace("_fold","")].singular)),g.setAttribute("role","img"),g.appendChild(x.createTextNode(" ")),l.appendChild(g),l.appendChild(x.createTextNode(m.displayText[v])),l.appendChild(x.createElement("br")),f[m.type[v].replace("_fold","")].push(l);}var A=this.getElement();x.removeChildren(A),f.error.forEach(function(T){return A.appendChild(T)}),f.warning.forEach(function(T){return A.appendChild(T)}),f.info.forEach(function(T){return A.appendChild(T)}),A.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this);},o.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this);},o.annotationsToSummaryString=function(a){var u,w,S=[],m=["error","warning","info"];try{for(var $=L(m),d=$.next();!d.done;d=$.next()){var h=d.value;if(a[h].length){var v=a[h].length===1?o.annotationLabels[h].singular:o.annotationLabels[h].plural;S.push("".concat(a[h].length," ").concat(v));}}}catch(C){u={error:C};}finally{try{d&&!d.done&&(w=$.return)&&w.call($);}finally{if(u)throw u.error}}return S.join(", ")},o}(c);M.GutterTooltip=n;});ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent"),x=function(){function s(c,r){this.speed,this.wheelX,this.wheelY,this.domEvent=c,this.editor=r,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1;}return s.prototype.stopPropagation=function(){R.stopPropagation(this.domEvent),this.propagationStopped=!0;},s.prototype.preventDefault=function(){R.preventDefault(this.domEvent),this.defaultPrevented=!0;},s.prototype.stop=function(){this.stopPropagation(),this.preventDefault();},s.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},s.prototype.getGutterRow=function(){var c=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(c,0),t=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-t},s.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,r=c.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else {var t=this.getDocumentPosition();this.$inSelection=r.contains(t.row,t.column);}return this.$inSelection},s.prototype.getButton=function(){return R.getButton(this.domEvent)},s.prototype.getShiftKey=function(){return this.domEvent.shiftKey},s.prototype.getAccelKey=function(){return L.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},s}();M.MouseEvent=x;});ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/event"),x=k("../lib/useragent"),s=200,c=200,r=5;function t(n){var e=n.editor,o=R.createElement("div");o.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",o.textContent="\xA0";var a=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];a.forEach(function(F){n[F]=this[F];},this),e.on("mousedown",this.onMouseDown.bind(n));var u=e.container,w,S,m,$,d,h,v=0,C,y,b,f,p;this.onDragStart=function(F){if(this.cancelDrag||!u.draggable){var D=this;return setTimeout(function(){D.startSelect(),D.captureMouse(F);},0),F.preventDefault()}d=e.getSelectionRange();var W=F.dataTransfer;W.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(o),W.setDragImage&&W.setDragImage(o,0,0),setTimeout(function(){e.container.removeChild(o);}),W.clearData(),W.setData("Text",e.session.getTextRange()),y=!0,this.setState("drag");},this.onDragEnd=function(F){if(u.draggable=!1,y=!1,this.setState(null),!e.getReadOnly()){var D=F.dataTransfer.dropEffect;!C&&D=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle();}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("");},this.onDragEnter=function(F){if(!(e.getReadOnly()||!I(F.dataTransfer)))return S=F.clientX,m=F.clientY,w||T(),v++,F.dataTransfer.dropEffect=C=N(F),L.preventDefault(F)},this.onDragOver=function(F){if(!(e.getReadOnly()||!I(F.dataTransfer)))return S=F.clientX,m=F.clientY,w||(T(),v++),_!==null&&(_=null),F.dataTransfer.dropEffect=C=N(F),L.preventDefault(F)},this.onDragLeave=function(F){if(v--,v<=0&&w)return E(),C=null,L.preventDefault(F)},this.onDrop=function(F){if(h){var D=F.dataTransfer;if(y)switch(C){case"move":d.contains(h.row,h.column)?d={start:h,end:h}:d=e.moveText(d,h);break;case"copy":d=e.moveText(d,h,!0);break}else {var W=D.getData("Text");d={start:h,end:e.session.insert(h,W)},e.focus(),C=null;}return E(),L.preventDefault(F)}},L.addListener(u,"dragstart",this.onDragStart.bind(n),e),L.addListener(u,"dragend",this.onDragEnd.bind(n),e),L.addListener(u,"dragenter",this.onDragEnter.bind(n),e),L.addListener(u,"dragover",this.onDragOver.bind(n),e),L.addListener(u,"dragleave",this.onDragLeave.bind(n),e),L.addListener(u,"drop",this.onDrop.bind(n),e);function l(F,D){var W=Date.now(),B=!D||F.row!=D.row,z=!D||F.column!=D.column;if(!f||B||z)e.moveCursorToPosition(F),f=W,p={x:S,y:m};else {var G=i(p.x,p.y,S,m);G>r?f=null:W-f>=c&&(e.renderer.scrollCursorIntoView(),f=null);}}function g(F,D){var W=Date.now(),B=e.renderer.layerConfig.lineHeight,z=e.renderer.layerConfig.characterWidth,G=e.renderer.scroller.getBoundingClientRect(),U={x:{left:S-G.left,right:G.right-S},y:{top:m-G.top,bottom:G.bottom-m}},V=Math.min(U.x.left,U.x.right),Y=Math.min(U.y.top,U.y.bottom),K={row:F.row,column:F.column};V/z<=2&&(K.column+=U.x.left<U.x.right?-3:2),Y/B<=1&&(K.row+=U.y.top<U.y.bottom?-1:1);var J=F.row!=K.row,q=F.column!=K.column,ee=!D||F.row!=D.row;J||q&&!ee?b?W-b>=s&&e.renderer.scrollCursorIntoView(K):b=W:b=null;}function A(){var F=h;h=e.renderer.screenToTextCoordinates(S,m),l(h,F),g(h,F);}function T(){d=e.selection.toOrientedRange(),w=e.session.addMarker(d,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval($),A(),$=setInterval(A,20),v=0,L.addListener(document,"mousemove",O);}function E(){clearInterval($),e.session.removeMarker(w),w=null,e.selection.fromOrientedRange(d),e.isFocused()&&!y&&e.$resetCursorStyle(),d=null,h=null,v=0,b=null,f=null,L.removeListener(document,"mousemove",O);}var _=null;function O(){_==null&&(_=setTimeout(function(){_!=null&&w&&E();},20));}function I(F){var D=F.types;return !D||Array.prototype.some.call(D,function(W){return W=="text/plain"||W=="Text"})}function N(F){var D=["copy","copymove","all","uninitialized"],W=["move","copymove","linkmove","all","uninitialized"],B=x.isMac?F.altKey:F.ctrlKey,z="uninitialized";try{z=F.dataTransfer.effectAllowed.toLowerCase();}catch{}var G="none";return B&&D.indexOf(z)>=0?G="copy":W.indexOf(z)>=0?G="move":D.indexOf(z)>=0&&(G="copy"),G}}(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,e=n.container;e.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle("ace_dragging");var o=x.isWin?"default":"move";n.renderer.setCursorStyle(o),this.setState("dragReady");},this.onMouseDrag=function(n){var e=this.editor.container;if(x.isIE&&this.state=="dragReady"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>3&&e.dragDrop();}if(this.state==="dragWait"){var o=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);o>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()));}},this.onMouseDown=function(n){if(this.$dragEnabled){this.mousedownEvent=n;var e=this.editor,o=n.inSelection(),a=n.getButton(),u=n.domEvent.detail||1;if(u===1&&a===0&&o){if(n.editor.inMultiSelectMode&&(n.getAccelKey()||n.getShiftKey()))return;this.mousedownEvent.time=Date.now();var w=n.domEvent.target||n.domEvent.srcElement;if("unselectable"in w&&(w.unselectable="on"),e.getDragDelay()){if(x.isWebKit){this.cancelDrag=!0;var S=e.container;S.draggable=!0;}this.setState("dragWait");}else this.startDrag();this.captureMouse(n,this.onMouseDrag.bind(this)),n.defaultPrevented=!0;}}};}).call(t.prototype);function i(n,e,o,a){return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-e,2))}M.DragdropHandler=t;});ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(k,M,H){var R=k("./mouse_event").MouseEvent,L=k("../lib/event"),x=k("../lib/dom");M.addTouchListeners=function(s,c){var r="scroll",t,i,n,e,o,a,u=0,w,S=0,m=0,$=0,d,h;function v(){var l=window.navigator&&window.navigator.clipboard,g=!1,A=function(){var _=c.getCopyText(),O=c.session.getUndoManager().hasUndo();h.replaceChild(x.buildDom(g?["span",!_&&T("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],_&&T("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],_&&T("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],l&&T("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],O&&T("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],T("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],T("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),h.firstChild);},T=function(_){return c.commands.canExecute(_,c)},E=function(_){var O=_.target.getAttribute("action");if(O=="more"||!g)return g=!g,A();O=="paste"?l.readText().then(function(I){c.execCommand(O,I);}):O&&((O=="cut"||O=="copy")&&(l?l.writeText(c.getCopyText()):document.execCommand("copy")),c.execCommand(O)),h.firstChild.style.display="none",g=!1,O!="openCommandPalette"&&c.focus();};h=x.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(_){r="menu",_.stopPropagation(),_.preventDefault(),c.textInput.focus();},ontouchend:function(_){_.stopPropagation(),_.preventDefault(),E(_);},onclick:E},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],c.container);}function C(){if(!c.getOption("enableMobileMenu")){h&&y();return}h||v();var l=c.selection.cursor,g=c.renderer.textToScreenCoordinates(l.row,l.column),A=c.renderer.textToScreenCoordinates(0,0).pageX,T=c.renderer.scrollLeft,E=c.container.getBoundingClientRect();h.style.top=g.pageY-E.top-3+"px",g.pageX-E.left<E.width-70?(h.style.left="",h.style.right="10px"):(h.style.right="",h.style.left=A+T-E.left+"px"),h.style.display="",h.firstChild.style.display="none",c.on("input",y);}function y(l){h&&(h.style.display="none"),c.off("input",y);}function b(){o=null,clearTimeout(o);var l=c.selection.getRange(),g=l.contains(w.row,w.column);(l.isEmpty()||!g)&&(c.selection.moveToPosition(w),c.selection.selectWord()),r="wait",C();}function f(){o=null,clearTimeout(o),c.selection.moveToPosition(w);var l=S>=2?c.selection.getLineRange(w.row):c.session.getBracketRange(w);l&&!l.isEmpty()?c.selection.setRange(l):c.selection.selectWord(),r="wait";}L.addListener(s,"contextmenu",function(l){if(d){var g=c.textInput.getElement();g.focus();}},c),L.addListener(s,"touchstart",function(l){var g=l.touches;if(o||g.length>1){clearTimeout(o),o=null,n=-1,r="zoom";return}d=c.$mouseHandler.isMousePressed=!0;var A=c.renderer.layerConfig.lineHeight,T=c.renderer.layerConfig.lineHeight,E=l.timeStamp;e=E;var _=g[0],O=_.clientX,I=_.clientY;Math.abs(t-O)+Math.abs(i-I)>A&&(n=-1),t=l.clientX=O,i=l.clientY=I,m=$=0;var N=new R(l,c);if(w=N.getDocumentPosition(),E-n<500&&g.length==1&&!u)S++,l.preventDefault(),l.button=0,f();else {S=0;var F=c.selection.cursor,D=c.selection.isEmpty()?F:c.selection.anchor,W=c.renderer.$cursorLayer.getPixelPosition(F,!0),B=c.renderer.$cursorLayer.getPixelPosition(D,!0),z=c.renderer.scroller.getBoundingClientRect(),G=c.renderer.layerConfig.offset,U=c.renderer.scrollLeft,V=function(J,q){return J=J/T,q=q/A-.75,J*J+q*q};if(l.clientX<z.left){r="zoom";return}var Y=V(l.clientX-z.left-W.left+U,l.clientY-z.top-W.top+G),K=V(l.clientX-z.left-B.left+U,l.clientY-z.top-B.top+G);Y<3.5&&K<3.5&&(r=Y>K?"cursor":"anchor"),K<3.5?r="anchor":Y<3.5?r="cursor":r="scroll",o=setTimeout(b,450);}n=E;},c),L.addListener(s,"touchend",function(l){d=c.$mouseHandler.isMousePressed=!1,a&&clearInterval(a),r=="zoom"?(r="",u=0):o?(c.selection.moveToPosition(w),u=0,C()):r=="scroll"?(p(),y()):C(),clearTimeout(o),o=null;},c),L.addListener(s,"touchmove",function(l){o&&(clearTimeout(o),o=null);var g=l.touches;if(!(g.length>1||r=="zoom")){var A=g[0],T=t-A.clientX,E=i-A.clientY;if(r=="wait")if(T*T+E*E>4)r="cursor";else return l.preventDefault();t=A.clientX,i=A.clientY,l.clientX=A.clientX,l.clientY=A.clientY;var _=l.timeStamp,O=_-e;if(e=_,r=="scroll"){var I=new R(l,c);I.speed=1,I.wheelX=T,I.wheelY=E,10*Math.abs(T)<Math.abs(E)&&(T=0),10*Math.abs(E)<Math.abs(T)&&(E=0),O!=0&&(m=T/O,$=E/O),c._emit("mousewheel",I),I.propagationStopped||(m=$=0);}else {var N=new R(l,c),F=N.getDocumentPosition();r=="cursor"?c.selection.moveCursorToPosition(F):r=="anchor"&&c.selection.setSelectionAnchor(F.row,F.column),c.renderer.scrollCursorIntoView(F),l.preventDefault();}}},c);function p(){u+=60,a=setInterval(function(){u--<=0&&(clearInterval(a),a=null),Math.abs(m)<.01&&(m=0),Math.abs($)<.01&&($=0),u<20&&(m=.9*m),u<20&&($=.9*$);var l=c.session.getScrollTop();c.renderer.scrollBy(10*m,10*$),l==c.session.getScrollTop()&&(u=0);},10);}};});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(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent"),x=k("./default_handlers").DefaultHandlers,s=k("./default_gutter_handler").GutterHandler,c=k("./mouse_event").MouseEvent,r=k("./dragdrop_handler").DragdropHandler,t=k("./touch_handler").addTouchListeners,i=k("../config"),n=function(){function e(o){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var a=this;this.editor=o,new x(this),new s(this),new r(this);var u=function(m){var $=!document.hasFocus||!document.hasFocus()||!o.isFocused()&&document.activeElement==(o.textInput&&o.textInput.getElement());$&&window.focus(),o.focus(),setTimeout(function(){o.isFocused()||o.focus();});},w=o.renderer.getMouseEventTarget();R.addListener(w,"click",this.onMouseEvent.bind(this,"click"),o),R.addListener(w,"mousemove",this.onMouseMove.bind(this,"mousemove"),o),R.addMultiMouseDownListener([w,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),R.addMouseWheelListener(o.container,this.onMouseWheel.bind(this,"mousewheel"),o),t(o.container,o);var S=o.renderer.$gutter;R.addListener(S,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),o),R.addListener(S,"click",this.onMouseEvent.bind(this,"gutterclick"),o),R.addListener(S,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),o),R.addListener(S,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),o),R.addListener(w,"mousedown",u,o),R.addListener(S,"mousedown",u,o),L.isIE&&o.renderer.scrollBarV&&(R.addListener(o.renderer.scrollBarV.element,"mousedown",u,o),R.addListener(o.renderer.scrollBarH.element,"mousedown",u,o)),o.on("mousemove",function(m){if(!(a.state||a.$dragDelay||!a.$dragEnabled)){var $=o.renderer.screenToTextCoordinates(m.x,m.y),d=o.session.selection.getRange(),h=o.renderer;!d.isEmpty()&&d.insideStart($.row,$.column)?h.setCursorStyle("default"):h.setCursorStyle("");}},o);}return e.prototype.onMouseEvent=function(o,a){this.editor.session&&this.editor._emit(o,new c(a,this.editor));},e.prototype.onMouseMove=function(o,a){var u=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!u||!u.length||this.editor._emit(o,new c(a,this.editor));},e.prototype.onMouseWheel=function(o,a){var u=new c(a,this.editor);u.speed=this.$scrollSpeed*2,u.wheelX=a.wheelX,u.wheelY=a.wheelY,this.editor._emit(o,u);},e.prototype.setState=function(o){this.state=o;},e.prototype.captureMouse=function(o,a){this.x=o.x,this.y=o.y,this.isMousePressed=!0;var u=this.editor,w=this.editor.renderer;w.$isMousePressed=!0;var S=this,m=function(C){if(C){if(L.isWebKit&&!C.which&&S.releaseMouse)return S.releaseMouse();S.x=C.clientX,S.y=C.clientY,a&&a(C),S.mouseEvent=new c(C,S.editor),S.$mouseMoved=!0;}},$=function(C){u.off("beforeEndOperation",h),clearInterval(v),u.session&&d(),S[S.state+"End"]&&S[S.state+"End"](C),S.state="",S.isMousePressed=w.$isMousePressed=!1,w.$keepTextAreaAtCursor&&w.$moveTextAreaToCursor(),S.$onCaptureMouseMove=S.releaseMouse=null,C&&S.onMouseEvent("mouseup",C),u.endOperation();},d=function(){S[S.state]&&S[S.state](),S.$mouseMoved=!1;};if(L.isOldIE&&o.domEvent.type=="dblclick")return setTimeout(function(){$(o);});var h=function(C){S.releaseMouse&&u.curOp.command.name&&u.curOp.selectionChanged&&(S[S.state+"End"]&&S[S.state+"End"](),S.state="",S.releaseMouse());};u.on("beforeEndOperation",h),u.startOperation({command:{name:"mouse"}}),S.$onCaptureMouseMove=m,S.releaseMouse=R.capture(this.editor.container,m,$);var v=setInterval(d,20);},e.prototype.cancelContextMenu=function(){var o=function(a){a&&a.domEvent&&a.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",o),a&&a.domEvent&&R.stopEvent(a.domEvent));}.bind(this);setTimeout(o,10),this.editor.on("nativecontextmenu",o);},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse();},e}();n.prototype.releaseMouse=null,i.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:L.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),M.MouseHandler=n;});ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s){s.on("click",function(c){var r=c.getDocumentPosition(),t=s.session,i=t.getFoldAt(r.row,r.column,1);i&&(c.getAccelKey()?t.removeFold(i):t.expandFold(i),c.stop());var n=c.domEvent&&c.domEvent.target;n&&R.hasCssClass(n,"ace_inline_button")&&R.hasCssClass(n,"ace_toggle_wrap")&&(t.setOption("wrap",!t.getUseWrapMode()),s.renderer.scrollCursorIntoView());}),s.on("gutterclick",function(c){var r=s.renderer.$gutterLayer.getRegion(c);if(r=="foldWidgets"){var t=c.getDocumentPosition().row,i=s.session;i.foldWidgets&&i.foldWidgets[t]&&s.session.onFoldWidgetClick(t,c),s.isFocused()||s.focus(),c.stop();}}),s.on("gutterdblclick",function(c){var r=s.renderer.$gutterLayer.getRegion(c);if(r=="foldWidgets"){var t=c.getDocumentPosition().row,i=s.session,n=i.getParentFoldRangeData(t,!0),e=n.range||n.firstRange;if(e){t=e.start.row;var o=i.getFoldAt(t,i.getLine(t).length,1);o?i.removeFold(o):(i.addFold("...",e),s.renderer.scrollCursorIntoView({row:e.start.row,column:0}));}c.stop();}});}return x}();M.FoldHandler=L;});ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(k,M,H){var R=k("../lib/keys"),L=k("../lib/event"),x=function(){function s(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands);}return s.prototype.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0);},s.prototype.setKeyboardHandler=function(c){var r=this.$handlers;if(r[r.length-1]!=c){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(c,1);}},s.prototype.addKeyboardHandler=function(c,r){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var t=this.$handlers.indexOf(c);t!=-1&&this.$handlers.splice(t,1),r==null?this.$handlers.push(c):this.$handlers.splice(r,0,c),t==-1&&c.attach&&c.attach(this.$editor);}},s.prototype.removeKeyboardHandler=function(c){var r=this.$handlers.indexOf(c);return r==-1?!1:(this.$handlers.splice(r,1),c.detach&&c.detach(this.$editor),!0)},s.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},s.prototype.getStatusText=function(){var c=this.$data,r=c.editor;return this.$handlers.map(function(t){return t.getStatusText&&t.getStatusText(r,c)||""}).filter(Boolean).join(" ")},s.prototype.$callKeyboardHandlers=function(c,r,t,i){for(var n,e=!1,o=this.$editor.commands,a=this.$handlers.length;a--&&(n=this.$handlers[a].handleKeyboard(this.$data,c,r,t,i),!(!(!n||!n.command)&&(n.command=="null"?e=!0:e=o.exec(n.command,this.$editor,n.args,i),e&&i&&c!=-1&&n.passEvent!=!0&&n.command.passEvent!=!0&&L.stopEvent(i),e))););return !e&&c==-1&&(n={command:"insertstring"},e=o.exec("insertstring",this.$editor,r)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",n),e},s.prototype.onCommandKey=function(c,r,t){var i=R.keyCodeToString(t);return this.$callKeyboardHandlers(r,i,t,c)},s.prototype.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)},s}();M.KeyBinding=x;});ace.define("ace/lib/bidiutil",["require","exports","module"],function(k,M,H){var x=0,s=0,c=!1,t=!1,i=!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]],a=[[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]],u=0,w=1,S=0,m=1,$=2,d=3,h=4,v=5,C=6,y=7,b=8,f=9,p=10,l=11,g=12,A=13,T=14,E=15,_=16,O=17,I=18,N=[I,I,I,I,I,I,I,I,I,C,v,C,b,v,I,I,I,I,I,I,I,I,I,I,I,I,I,I,v,v,v,C,b,h,h,l,l,l,h,h,h,h,h,p,f,p,f,f,$,$,$,$,$,$,$,$,$,$,f,h,h,h,h,h,h,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,h,h,h,h,h,h,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,h,h,h,h,I,I,I,I,I,I,v,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,f,h,l,l,l,l,h,h,h,h,S,h,h,I,h,h,l,l,$,$,h,S,h,h,h,$,S,h,h,h,h,h],F=[b,b,b,b,b,b,b,b,b,b,b,I,I,I,S,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,b,v,A,T,E,_,O,f,l,l,l,l,l,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,f,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,b];function D(U,V,Y,K){var J=x?a:o,q=null,ee=null,Q=null,ne=0,pe=null,ge=null,ue=-1,ae=null,ce=null,we=[];if(!K)for(ae=0,K=[];ae<Y;ae++)K[ae]=z(U[ae]);for(s=x,c=!1,t=!1,i=!1,ce=0;ce<Y;ce++){if(q=ne,we[ce]=ee=B(U,K,we,ce),ne=J[q][ee],pe=ne&240,ne&=15,V[ce]=Q=J[ne][5],pe>0)if(pe==16){for(ae=ue;ae<ce;ae++)V[ae]=1;ue=-1;}else ue=-1;if(ge=J[ne][6],ge)ue==-1&&(ue=ce);else if(ue>-1){for(ae=ue;ae<ce;ae++)V[ae]=Q;ue=-1;}K[ce]==v&&(V[ce]=0),s|=Q;}if(i){for(ae=0;ae<Y;ae++)if(K[ae]==C){V[ae]=x;for(var me=ae-1;me>=0&&K[me]==b;me--)V[me]=x;}}}function W(U,V,Y){if(!(s<U)){if(U==1&&x==w&&!t){Y.reverse();return}for(var K=Y.length,J=0,q,ee,Q,ne;J<K;){if(V[J]>=U){for(q=J+1;q<K&&V[q]>=U;)q++;for(ee=J,Q=q-1;ee<Q;ee++,Q--)ne=Y[ee],Y[ee]=Y[Q],Y[Q]=ne;J=q;}J++;}}}function B(U,V,Y,K){var J=V[K],q,ee,Q,ne;switch(J){case S:case m:c=!1;case h:case d:return J;case $:return c?d:$;case y:return c=!0,m;case b:return h;case f:return K<1||K+1>=V.length||(q=Y[K-1])!=$&&q!=d||(ee=V[K+1])!=$&&ee!=d?h:(c&&(ee=d),ee==q?ee:h);case p:return q=K>0?Y[K-1]:v,q==$&&K+1<V.length&&V[K+1]==$?$:h;case l:if(K>0&&Y[K-1]==$)return $;if(c)return h;for(ne=K+1,Q=V.length;ne<Q&&V[ne]==l;)ne++;return ne<Q&&V[ne]==$?$:h;case g:for(Q=V.length,ne=K+1;ne<Q&&V[ne]==g;)ne++;if(ne<Q){var pe=U[K],ge=pe>=1425&&pe<=2303||pe==64286;if(q=V[ne],ge&&(q==m||q==y))return m}return K<1||(q=V[K-1])==v?h:Y[K-1];case v:return c=!1,t=!0,x;case C:return i=!0,h;case A:case T:case _:case O:case E:c=!1;case I:return h}}function z(U){var V=U.charCodeAt(0),Y=V>>8;return Y==0?V>191?S:N[V]:Y==5?/[\u0591-\u05f4]/.test(U)?m:S:Y==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(U)?g:/[\u0660-\u0669\u066b-\u066c]/.test(U)?d:V==1642?l:/[\u06f0-\u06f9]/.test(U)?$:y:Y==32&&V<=8287?F[V&255]:Y==254&&V>=65136?y:h}M.L=S,M.R=m,M.EN=$,M.ON_R=3,M.AN=4,M.R_H=5,M.B=6,M.RLE=7,M.DOT="\xB7",M.doBidiReorder=function(U,V,Y){if(U.length<2)return {};var K=U.split(""),J=new Array(K.length),q=new Array(K.length),ee=[];x=Y?w:u,D(K,ee,K.length,V);for(var Q=0;Q<J.length;J[Q]=Q,Q++);W(2,ee,J),W(1,ee,J);for(var Q=0;Q<J.length-1;Q++)V[Q]===d?ee[Q]=M.AN:ee[Q]===m&&(V[Q]>y&&V[Q]<A||V[Q]===h||V[Q]===I)?ee[Q]=M.ON_R:Q>0&&K[Q-1]==="\u0644"&&/\u0622|\u0623|\u0625|\u0627/.test(K[Q])&&(ee[Q-1]=ee[Q]=M.R_H,Q++);K[K.length-1]===M.DOT&&(ee[K.length-1]=M.B),K[0]==="\u202B"&&(ee[0]=M.RLE);for(var Q=0;Q<J.length;Q++)q[Q]=ee[J[Q]];return {logicalFromVisual:J,bidiLevels:q}},M.hasBidiCharacters=function(U,V){for(var Y=!1,K=0;K<U.length;K++)V[K]=z(U.charAt(K)),!Y&&(V[K]==m||V[K]==y||V[K]==d)&&(Y=!0);return Y},M.getVisualFromLogicalIdx=function(U,V){for(var Y=0;Y<V.logicalFromVisual.length;Y++)if(V.logicalFromVisual[Y]==U)return Y;return 0};});ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(k,M,H){var R=k("./lib/bidiutil"),L=k("./lib/lang"),x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(){function c(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=R,this.charWidths=[],this.EOL="\xAC",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="\xB6",this.RLE="\u202B",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=x.test(r.getValue());}return c.prototype.isBidiRow=function(r,t,i){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},c.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&x.test(r.lines.join(`
199
+ `))&&(this.seenBidi=!0,this.currentRow=null);},c.prototype.getDocumentRow=function(){var r=0,t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);i>=0&&(r=this.session.$docRowCache[i]);}return r},c.prototype.getSplitIndex=function(){var r=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-r>0&&(i=this.session.$getRowCacheIndex(t,this.currentRow-r-1),i===n);)n=i,r++;else r=this.currentRow;return r},c.prototype.updateRowLine=function(r,t){r===void 0&&(r=this.getDocumentRow());var i=r===this.session.getLength()-1,n=i?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[r];e&&(t===void 0&&(t=this.getSplitIndex()),t>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[R.L],this.line=t<e.length?this.line.substring(e[t-1],e[t]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[t]),t==e.length&&(this.line+=this.showInvisibles?n:R.DOT));}else this.line+=this.showInvisibles?n:R.DOT;var o=this.session,a=0,u;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(w,S){return w===" "||o.isFullWidth(w.charCodeAt(0))?(u=w===" "?o.getScreenTabSize(S+a):2,a+=u-1,L.stringRepeat(R.DOT,u)):w}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==R.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width);},c.prototype.updateBidiMap=function(){var r=[];R.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=R.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={};},c.prototype.markAsDirty=function(){this.currentRow=null;},c.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var t=this.characterWidth=r.$characterSize.width,i=r.$measureCharWidth("\u05D4");this.charWidths[R.L]=this.charWidths[R.EN]=this.charWidths[R.ON_R]=t,this.charWidths[R.R]=this.charWidths[R.AN]=i,this.charWidths[R.R_H]=i*.45,this.charWidths[R.B]=this.charWidths[R.RLE]=0,this.currentRow=null;}},c.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null;},c.prototype.setEolChar=function(r){this.EOL=r;},c.prototype.setContentWidth=function(r){this.contentWidth=r;},c.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},c.prototype.setRtlDirection=function(r,t){for(var i=r.getCursorPosition(),n=r.selection.getSelectionAnchor().row;n<=i.row;n++)!t&&r.session.getLine(n).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(n,0,1):t&&r.session.getLine(n).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:n},r.session.$bidiHandler.RLE);},c.prototype.getPosLeft=function(r){r-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=r>t?this.session.getOverwrite()?r:r-1:t,n=R.getVisualFromLogicalIdx(i,this.bidiMap),e=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&r<=t&&e[n]%2!==0&&n++;for(var a=0;a<n;a++)o+=this.charWidths[e[a]];return !this.session.getOverwrite()&&r>t&&e[n]%2===0&&(o+=this.charWidths[e[n]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},c.prototype.getSelections=function(r,t){var i=this.bidiMap,n=i.bidiLevels,e,o=[],a=0,u=Math.min(r,t)-this.wrapIndent,w=Math.max(r,t)-this.wrapIndent,S=!1,m=!1,$=0;this.wrapIndent&&(a+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,h=0;h<n.length;h++)d=i.logicalFromVisual[h],e=n[h],S=d>=u&&d<w,S&&!m?$=a:!S&&m&&o.push({left:$,width:a-$}),a+=this.charWidths[e],m=S;if(S&&h===n.length&&o.push({left:$,width:a-$}),this.isRtlDir)for(var v=0;v<o.length;v++)o[v].left+=this.rtlLineOffset;return o},c.prototype.offsetToCol=function(i){this.isRtlDir&&(i-=this.rtlLineOffset);var t=0,i=Math.max(i,0),n=0,e=0,o=this.bidiMap.bidiLevels,a=this.charWidths[o[e]];for(this.wrapIndent&&(i-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i>n+a/2;){if(n+=a,e===o.length-1){a=0;break}a=this.charWidths[o[++e]];}return e>0&&o[e-1]%2!==0&&o[e]%2===0?(i<n&&e--,t=this.bidiMap.logicalFromVisual[e]):e>0&&o[e-1]%2===0&&o[e]%2!==0?t=1+(i>n?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===o.length-1&&a===0&&o[e-1]%2===0||!this.isRtlDir&&e===0&&o[e]%2!==0?t=1+this.bidiMap.logicalFromVisual[e]:(e>0&&o[e-1]%2!==0&&a!==0&&e--,t=this.bidiMap.logicalFromVisual[e]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},c}();M.BidiHandler=s;});ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/lang"),x=k("./lib/event_emitter").EventEmitter,s=k("./range").Range,c=function(){function r(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 i=this;this.cursor.on("change",function(n){i.$cursorChanged=!0,i.$silent||i._emit("changeCursor"),!i.$isEmpty&&!i.$silent&&i._emit("changeSelection"),!i.$keepDesiredColumnOnChange&&n.old.column!=n.value.column&&(i.$desiredColumn=null);}),this.anchor.on("change",function(){i.$anchorChanged=!0,!i.$isEmpty&&!i.$silent&&i._emit("changeSelection");});}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return !this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(t,i){this.$isEmpty=!1,this.anchor.setPosition(t,i);},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var t=this.anchor,i=this.lead;return t.row>i.row||t.row==i.row&&t.column>i.column},r.prototype.getRange=function(){var t=this.anchor,i=this.lead;return this.$isEmpty?s.fromPoints(i,i):this.isBackwards()?s.fromPoints(i,t):s.fromPoints(t,i)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"));},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE);},r.prototype.setRange=function(t,i){var n=i?t.end:t.start,e=i?t.start:t.end;this.$setSelection(n.row,n.column,e.row,e.column);},r.prototype.$setSelection=function(t,i,n,e){if(!this.$silent){var o=this.$isEmpty,a=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,i),this.cursor.setPosition(n,e),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||a)&&this._emit("changeSelection");}},r.prototype.$moveSelection=function(t){var i=this.lead;this.$isEmpty&&this.setSelectionAnchor(i.row,i.column),t.call(this);},r.prototype.selectTo=function(t,i){this.$moveSelection(function(){this.moveCursorTo(t,i);});},r.prototype.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t);});},r.prototype.moveTo=function(t,i){this.clearSelection(),this.moveCursorTo(t,i);},r.prototype.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t);},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp);},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown);},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight);},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft);},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart);},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd);},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd);},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart);},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight);},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft);},r.prototype.getWordRange=function(t,i){if(typeof i>"u"){var n=t||this.lead;t=n.row,i=n.column;}return this.session.getWordRange(t,i)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange());},r.prototype.selectAWord=function(){var t=this.getCursor(),i=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(i);},r.prototype.getLineRange=function(t,i){var n=typeof t=="number"?t:this.lead.row,e,o=this.session.getFoldLine(n);return o?(n=o.start.row,e=o.end.row):e=n,i===!0?new s(n,0,e,this.session.getLine(e).length):new s(n,0,e+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange());},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0);},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0);},r.prototype.wouldMoveIntoSoftTab=function(t,i,n){var e=t.column,o=t.column+i;return n<0&&(e=t.column-i,o=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(e,o).split(" ").length-1==i},r.prototype.moveCursorLeft=function(){var t=this.lead.getPosition(),i;if(i=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(i.start.row,i.start.column);else if(t.column===0)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else {var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1);}},r.prototype.moveCursorRight=function(){var t=this.lead.getPosition(),i;if(i=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(i.end.row,i.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 n=this.session.getTabSize(),t=this.lead;this.wouldMoveIntoSoftTab(t,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1);}},r.prototype.moveCursorLineStart=function(){var t=this.lead.row,i=this.lead.column,n=this.session.documentToScreenRow(t,i),e=this.session.screenToDocumentPosition(n,0),o=this.session.getDisplayLine(t,null,e.row,e.column),a=o.match(/^\s*/);a[0].length!=i&&!this.session.$useEmacsStyleLineStart&&(e.column+=a[0].length),this.moveCursorToPosition(e);},r.prototype.moveCursorLineEnd=function(){var t=this.lead,i=this.session.getDocumentLastRowColumnPosition(t.row,t.column);if(this.lead.column==i.column){var n=this.session.getLine(i.row);if(i.column==n.length){var e=n.search(/\s+$/);e>0&&(i.column=e);}}this.moveCursorTo(i.row,i.column);},r.prototype.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,i=this.doc.getLine(t).length;this.moveCursorTo(t,i);},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0);},r.prototype.moveCursorLongWordRight=function(){var t=this.lead.row,i=this.lead.column,n=this.doc.getLine(t),e=n.substring(i);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(t,i,1);if(o){this.moveCursorTo(o.end.row,o.end.column);return}if(this.session.nonTokenRe.exec(e)&&(i+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=n.substring(i)),i>=n.length){this.moveCursorTo(t,n.length),this.moveCursorRight(),t<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(i+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i);},r.prototype.moveCursorLongWordLeft=function(){var t=this.lead.row,i=this.lead.column,n;if(n=this.session.getFoldAt(t,i,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var e=this.session.getFoldStringAt(t,i,-1);e==null&&(e=this.doc.getLine(t).substring(0,i));var o=L.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(o)&&(i-=this.session.nonTokenRe.lastIndex,o=o.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0){this.moveCursorTo(t,0),this.moveCursorLeft(),t>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(o)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i);},r.prototype.$shortWordEndIndex=function(t){var i=0,n,e=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(t))i=this.session.tokenRe.lastIndex;else {for(;(n=t[i])&&e.test(n);)i++;if(i<1){for(o.lastIndex=0;(n=t[i])&&!o.test(n);)if(o.lastIndex=0,i++,e.test(n))if(i>2){i--;break}else {for(;(n=t[i])&&e.test(n);)i++;if(i>2)break}}}return o.lastIndex=0,i},r.prototype.moveCursorShortWordRight=function(){var t=this.lead.row,i=this.lead.column,n=this.doc.getLine(t),e=n.substring(i),o=this.session.getFoldAt(t,i,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(i==n.length){var a=this.doc.getLength();do t++,e=this.doc.getLine(t);while(t<a&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),i=0;}var u=this.$shortWordEndIndex(e);this.moveCursorTo(t,i+u);},r.prototype.moveCursorShortWordLeft=function(){var t=this.lead.row,i=this.lead.column,n;if(n=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(n.start.row,n.start.column);var e=this.session.getLine(t).substring(0,i);if(i===0){do t--,e=this.doc.getLine(t);while(t>0&&/^\s*$/.test(e));i=e.length,/\s+$/.test(e)||(e="");}var o=L.stringReverse(e),a=this.$shortWordEndIndex(o);return this.moveCursorTo(t,i-a)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight();},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft();},r.prototype.moveCursorBy=function(t,i){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(i===0&&(t!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.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 a=this.session.screenToDocumentPosition(n.row+t,n.column,e);t!==0&&i===0&&a.row===this.lead.row&&(a.column,this.lead.column),this.moveCursorTo(a.row,a.column+i,i===0);},r.prototype.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column);},r.prototype.moveCursorTo=function(t,i,n){var e=this.session.getFoldAt(t,i,1);e&&(t=e.start.row,i=e.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(o.charAt(i))&&o.charAt(i-1)&&(this.lead.row==t&&this.lead.column==i+1?i=i-1:i=i+1),this.lead.setPosition(t,i),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null);},r.prototype.moveCursorToScreen=function(t,i,n){var e=this.session.screenToDocumentPosition(t,i);this.moveCursorTo(e.row,e.column,n);},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach();},r.prototype.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn;},r.prototype.toOrientedRange=function(t){var i=this.getRange();return t?(t.start.column=i.start.column,t.start.row=i.start.row,t.end.column=i.end.column,t.end.row=i.end.row):t=i,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},r.prototype.getRangeOfMovements=function(t){var i=this.getCursor();try{t(this);var n=this.getCursor();return s.fromPoints(i,n)}catch{return s.fromPoints(i,i)}finally{this.moveCursorToPosition(i);}},r.prototype.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(i){var n=i.clone();return n.isBackwards=i.cursor==i.start,n});else {var t=this.getRange();t.isBackwards=this.isBackwards();}return t},r.prototype.fromJSON=function(t){if(t.start==null)if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var i=t.length;i--;){var n=s.fromPoints(t[i].start,t[i].end);t[i].isBackwards&&(n.cursor=n.start),this.addRange(n,!0);}return}else t=t[0];this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards);},r.prototype.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 i=this.ranges.length;i--;)if(!this.ranges[i].isEqual(t[i]))return !1;return !0},r}();c.prototype.setSelectionAnchor=c.prototype.setAnchor,c.prototype.getSelectionAnchor=c.prototype.getAnchor,c.prototype.setSelectionRange=c.prototype.setRange,R.implement(c.prototype,x),M.Selection=c;});ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(k,M,H){var R=k("./lib/report_error").reportError,L=2e3,x=function(){function s(c){this.splitRegex,this.states=c,this.regExps={},this.matchMappings={};for(var r in this.states){for(var t=this.states[r],i=[],n=0,e=this.matchMappings[r]={defaultToken:"text"},o="g",a=[],u=0;u<t.length;u++){var w=t[u];if(w.defaultToken&&(e.defaultToken=w.defaultToken),w.caseInsensitive&&o.indexOf("i")===-1&&(o+="i"),w.unicode&&o.indexOf("u")===-1&&(o+="u"),w.regex!=null){w.regex instanceof RegExp&&(w.regex=w.regex.toString().slice(1,-1));var S=w.regex,m=new RegExp("(?:("+S+")|(.))").exec("a").length-2;Array.isArray(w.token)?w.token.length==1||m==1?w.token=w.token[0]:m-1!=w.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:w,groupCount:m-1}),w.token=w.token[0]):(w.tokenArray=w.token,w.token=null,w.onMatch=this.$arrayTokens):typeof w.token=="function"&&!w.onMatch&&(m>1?w.onMatch=this.$applyToken:w.onMatch=w.token),m>1&&(/\\\d/.test(w.regex)?S=w.regex.replace(/\\([0-9]+)/g,function($,d){return "\\"+(parseInt(d,10)+n+1)}):(m=1,S=this.removeCapturingGroups(w.regex)),!w.splitRegex&&typeof w.token!="string"&&a.push(w)),e[n]=u,n+=m,i.push(S),w.onMatch||(w.onMatch=null);}}i.length||(e[0]=0,i.push("$")),a.forEach(function($){$.splitRegex=this.createSplitterRegexp($.regex,o);},this),this.regExps[r]=new RegExp("("+i.join(")|(")+")|($)",o);}}return s.prototype.$setMaxTokenCount=function(c){L=c|0;},s.prototype.$applyToken=function(c){var r=this.splitRegex.exec(c).slice(1),t=this.token.apply(this,r);if(typeof t=="string")return [{type:t,value:c}];for(var i=[],n=0,e=t.length;n<e;n++)r[n]&&(i[i.length]={type:t[n],value:r[n]});return i},s.prototype.$arrayTokens=function(c){if(!c)return [];var r=this.splitRegex.exec(c);if(!r)return "text";for(var t=[],i=this.tokenArray,n=0,e=i.length;n<e;n++)r[n+1]&&(t[t.length]={type:i[n],value:r[n+1]});return t},s.prototype.removeCapturingGroups=function(c){var r=c.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(t,i){return i?"(?:":t});return r},s.prototype.createSplitterRegexp=function(c,r){if(c.indexOf("(?=")!=-1){var t=0,i=!1,n={};c.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,o,a,u,w,S){return i?i=w!="]":w?i=!0:u?(t==n.stack&&(n.end=S+1,n.stack=-1),t--):a&&(t++,a.length!=1&&(n.stack=t,n.start=S)),e}),n.end!=null&&/^\)*$/.test(c.substr(n.end))&&(c=c.substring(0,n.start)+c.substr(n.end));}return c.charAt(0)!="^"&&(c="^"+c),c.charAt(c.length-1)!="$"&&(c+="$"),new RegExp(c,(r||"").replace("g",""))},s.prototype.getLineTokens=function(c,r){if(r&&typeof r!="string"){var t=r.slice(0);r=t[0],r==="#tmp"&&(t.shift(),r=t.shift());}else var t=[];var i=r||"start",n=this.states[i];n||(i="start",n=this.states[i]);var e=this.matchMappings[i],o=this.regExps[i];o.lastIndex=0;for(var a,u=[],w=0,S=0,m={type:null,value:""};a=o.exec(c);){var $=e.defaultToken,d=null,h=a[0],v=o.lastIndex;if(v-h.length>w){var C=c.substring(w,v-h.length);m.type==$?m.value+=C:(m.type&&u.push(m),m={type:$,value:C});}for(var y=0;y<a.length-2;y++)if(a[y+1]!==void 0){d=n[e[y]],d.onMatch?$=d.onMatch(h,i,t,c):$=d.token,d.next&&(typeof d.next=="string"?i=d.next:i=d.next(i,t),n=this.states[i],n||(this.reportError("state doesn't exist",i),i="start",n=this.states[i]),e=this.matchMappings[i],w=v,o=this.regExps[i],o.lastIndex=v),d.consumeLineEnd&&(w=v);break}if(h){if(typeof $=="string")(!d||d.merge!==!1)&&m.type===$?m.value+=h:(m.type&&u.push(m),m={type:$,value:h});else if($){m.type&&u.push(m),m={type:null,value:""};for(var y=0;y<$.length;y++)u.push($[y]);}}if(w==c.length)break;if(w=v,S++>L){for(S>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:c});w<c.length;)m.type&&u.push(m),m={value:c.substring(w,w+=500),type:"overflow"};i="start",t=[];break}}return m.type&&u.push(m),t.length>1&&t[0]!==i&&t.unshift("#tmp",i),{tokens:u,state:t.length?t:i}},s}();x.prototype.reportError=R,M.Tokenizer=x;});ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(k,M,H){var R=k("../lib/deep_copy").deepCopy,L;L=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]};},function(){this.addRules=function(c,r){if(!r){for(var t in c)this.$rules[t]=c[t];return}for(var t in c){for(var i=c[t],n=0;n<i.length;n++){var e=i[n];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(r)!==0&&(e.next=r+e.next),e.nextState&&e.nextState.indexOf(r)!==0&&(e.nextState=r+e.nextState));}this.$rules[r+t]=i;}},this.getRules=function(){return this.$rules},this.embedRules=function(c,r,t,i,n){var e=typeof c=="function"?new c().getRules():c;if(i)for(var o=0;o<i.length;o++)i[o]=r+i[o];else {i=[];for(var a in e)i.push(r+a);}if(this.addRules(e,r),t)for(var u=Array.prototype[n?"push":"unshift"],o=0;o<i.length;o++)u.apply(this.$rules[i[o]],R(t));this.$embeds||(this.$embeds=[]),this.$embeds.push(r);},this.getEmbeds=function(){return this.$embeds};var x=function(c,r){return (c!="start"||r.length)&&r.unshift(this.nextState,c),this.nextState},s=function(c,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var c=0,r=this.$rules;function t(i){var n=r[i];n.processed=!0;for(var e=0;e<n.length;e++){var o=n[e],a=null;Array.isArray(o)&&(a=o,o={}),!o.regex&&o.start&&(o.regex=o.start,o.next||(o.next=[]),o.next.push({defaultToken:o.token},{token:o.token+".end",regex:o.end||o.start,next:"pop"}),o.token=o.token+".start",o.push=!0);var u=o.next||o.push;if(u&&Array.isArray(u)){var w=o.stateName;w||(w=o.token,typeof w!="string"&&(w=w[0]||""),r[w]&&(w+=c++)),r[w]=u,o.next=w,t(w);}else u=="pop"&&(o.next=s);if(o.push&&(o.nextState=o.next||o.push,o.next=x,delete o.push),o.rules)for(var S in o.rules)r[S]?r[S].push&&r[S].push.apply(r[S],o.rules[S]):r[S]=o.rules[S];var m=typeof o=="string"?o:o.include;if(m&&(m==="$self"&&(m="start"),Array.isArray(m)?a=m.map(function(d){return r[d]}):a=r[m]),a){var $=[e,1].concat(a);o.noEscape&&($=$.filter(function(d){return !d.next})),n.splice.apply(n,$),e--;}o.keywordMap&&(o.token=this.createKeywordMapper(o.keywordMap,o.defaultToken||"text",o.caseInsensitive),delete o.defaultToken);}}Object.keys(r).forEach(t,this);},this.createKeywordMapper=function(c,r,t,i){var n=Object.create(null);return this.$keywordList=[],Object.keys(c).forEach(function(e){for(var o=c[e],a=o.split(i||"|"),u=a.length;u--;){var w=a[u];this.$keywordList.push(w),t&&(w=w.toLowerCase()),n[w]=e;}},this),c=null,t?function(e){return n[e.toLowerCase()]||r}:function(e){return n[e]||r}},this.getKeywords=function(){return this.$keywords};}.call(L.prototype),M.TextHighlightRules=L;});ace.define("ace/mode/behaviour",["require","exports","module"],function(k,M,H){var R;R=function(){this.$behaviours={};},function(){this.add=function(L,x,s){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[L]:this.$behaviours[L]={};}this.$behaviours[L][x]=s;},this.addBehaviours=function(L){for(var x in L)for(var s in L[x])this.add(x,s,L[x][s]);},this.remove=function(L){this.$behaviours&&this.$behaviours[L]&&delete this.$behaviours[L];},this.inherit=function(L,x){if(typeof L=="function")var s=new L().getBehaviours(x);else var s=L.getBehaviours(x);this.addBehaviours(s);},this.getBehaviours=function(L){if(L){for(var x={},s=0;s<L.length;s++)this.$behaviours[L[s]]&&(x[L[s]]=this.$behaviours[L[s]]);return x}else return this.$behaviours};}.call(R.prototype),M.Behaviour=R;});ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(k,M,H){var R=k("./range").Range,L=function(){function x(s,c,r){this.$session=s,this.$row=c,this.$rowTokens=s.getTokens(c);var t=s.getTokenAt(c,r);this.$tokenIndex=t?t.index:-1;}return x.prototype.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]},x.prototype.stepForward=function(){this.$tokenIndex+=1;for(var s;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,s||(s=this.$session.getLength()),this.$row>=s)return this.$row=s-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0;}return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentTokenRow=function(){return this.$row},x.prototype.getCurrentTokenColumn=function(){var s=this.$rowTokens,c=this.$tokenIndex,r=s[c].start;if(r!==void 0)return r;for(r=0;c>0;)c-=1,r+=s[c].value.length;return r},x.prototype.getCurrentTokenPosition=function(){return {row:this.$row,column:this.getCurrentTokenColumn()}},x.prototype.getCurrentTokenRange=function(){var s=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new R(this.$row,c,this.$row,c+s.value.length)},x}();M.TokenIterator=L;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(k,M,H){var R=k("../../lib/oop"),L=k("../behaviour").Behaviour,x=k("../../token_iterator").TokenIterator,s=k("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],t,i={},n={'"':'"',"'":"'"},e=function(u){var w=-1;if(u.multiSelect&&(w=u.selection.index,i.rangeCount!=u.multiSelect.rangeCount&&(i={rangeCount:u.multiSelect.rangeCount})),i[w])return t=i[w];t=i[w]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};},o=function(u,w,S,m){var $=u.end.row-u.start.row;return {text:S+w+m,selection:[0,u.start.column+1,$,u.end.column+($?0:1)]}},a;a=function(u){u=u||{},this.add("braces","insertion",function(w,S,m,$,d){var h=m.getCursorPosition(),v=$.doc.getLine(h.row);if(d=="{"){e(m);var C=m.getSelectionRange(),y=$.doc.getTextRange(C),b=$.getTokenAt(h.row,h.column);if(y!==""&&y!=="{"&&m.getWrapBehavioursEnabled())return o(C,y,"{","}");if(b&&/(?:string)\.quasi|\.xml/.test(b.type)){var f=[/tag\-(?:open|name)/,/attribute\-name/];return f.some(function(_){return _.test(b.type)})||/(string)\.quasi/.test(b.type)&&b.value[h.column-b.start-1]!=="$"?void 0:(a.recordAutoInsert(m,$,"}"),{text:"{}",selection:[1,1]})}else if(a.isSaneInsertion(m,$))return /[\]\}\)]/.test(v[h.column])||m.inMultiSelectMode||u.braces?(a.recordAutoInsert(m,$,"}"),{text:"{}",selection:[1,1]}):(a.recordMaybeInsert(m,$,"{"),{text:"{",selection:[1,1]})}else if(d=="}"){e(m);var p=v.substring(h.column,h.column+1);if(p=="}"){var l=$.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(l!==null&&a.isAutoInsertedClosing(h,v,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(d==`
199
200
  `||d==`\r
200
- `){t(m);var g="";a.isMaybeInsertedClosing(h,v)&&(g=s.stringRepeat("}",e.maybeInsertedBrackets),a.clearMaybeInsertedClosing());var p=v.substring(h.column,h.column+1);if(p==="}"){var A=$.findMatchingBracket({row:h.row,column:h.column+1},"}");if(!A)return null;var T=this.$getIndent($.getLine(A.row));}else if(g)var T=this.$getIndent(v);else {a.clearMaybeInsertedClosing();return}var E=T+$.getTabString();return {text:`
201
+ `){e(m);var g="";a.isMaybeInsertedClosing(h,v)&&(g=s.stringRepeat("}",t.maybeInsertedBrackets),a.clearMaybeInsertedClosing());var p=v.substring(h.column,h.column+1);if(p==="}"){var A=$.findMatchingBracket({row:h.row,column:h.column+1},"}");if(!A)return null;var T=this.$getIndent($.getLine(A.row));}else if(g)var T=this.$getIndent(v);else {a.clearMaybeInsertedClosing();return}var E=T+$.getTabString();return {text:`
201
202
  `+E+`
202
- `+T+g,selection:[1,E.length,1,E.length]}}else a.clearMaybeInsertedClosing();}),this.add("braces","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="{"){t(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.end.column,d.end.column+1);if(C=="}")return d.end.column++,d;e.maybeInsertedBrackets--;}}),this.add("parens","insertion",function(w,S,m,$,d){if(d=="("){t(m);var h=m.getSelectionRange(),v=$.doc.getTextRange(h);if(v!==""&&m.getWrapBehavioursEnabled())return o(h,v,"(",")");if(a.isSaneInsertion(m,$))return a.recordAutoInsert(m,$,")"),{text:"()",selection:[1,1]}}else if(d==")"){t(m);var C=m.getCursorPosition(),y=$.doc.getLine(C.row),b=y.substring(C.column,C.column+1);if(b==")"){var f=$.$findOpeningBracket(")",{column:C.column+1,row:C.row});if(f!==null&&a.isAutoInsertedClosing(C,y,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="("){t(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.start.column+1,d.start.column+2);if(C==")")return d.end.column++,d}}),this.add("brackets","insertion",function(w,S,m,$,d){if(d=="["){t(m);var h=m.getSelectionRange(),v=$.doc.getTextRange(h);if(v!==""&&m.getWrapBehavioursEnabled())return o(h,v,"[","]");if(a.isSaneInsertion(m,$))return a.recordAutoInsert(m,$,"]"),{text:"[]",selection:[1,1]}}else if(d=="]"){t(m);var C=m.getCursorPosition(),y=$.doc.getLine(C.row),b=y.substring(C.column,C.column+1);if(b=="]"){var f=$.$findOpeningBracket("]",{column:C.column+1,row:C.row});if(f!==null&&a.isAutoInsertedClosing(C,y,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="["){t(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.start.column+1,d.start.column+2);if(C=="]")return d.end.column++,d}}),this.add("string_dquotes","insertion",function(w,S,m,$,d){var h=$.$mode.$quotes||n;if(d.length==1&&h[d]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(d)!=-1)return;t(m);var v=d,C=m.getSelectionRange(),y=$.doc.getTextRange(C);if(y!==""&&(y.length!=1||!h[y])&&m.getWrapBehavioursEnabled())return o(C,y,v,v);if(!y){var b=m.getCursorPosition(),f=$.doc.getLine(b.row),p=f.substring(b.column-1,b.column),c=f.substring(b.column,b.column+1),g=$.getTokenAt(b.row,b.column),A=$.getTokenAt(b.row,b.column+1);if(p=="\\"&&g&&/escape/.test(g.type))return null;var T=g&&/string|escape/.test(g.type),E=!A||/string|escape/.test(A.type),_;if(c==v)_=T!==E,_&&/string\.end/.test(A.type)&&(_=!1);else {if(T&&!E||T&&E)return null;var O=$.$mode.tokenRe;O.lastIndex=0;var I=O.test(p);O.lastIndex=0;var N=O.test(c),F=$.$mode.$pairQuotesAfter,D=F&&F[v]&&F[v].test(p);if(!D&&I||N||c&&!/[\s;,.})\]\\]/.test(c))return null;var W=f[b.column-2];if(p==v&&(W==v||O.test(W)))return null;_=!0;}return {text:_?v+v:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(w,S,m,$,d){var h=$.$mode.$quotes||n,v=$.doc.getTextRange(d);if(!d.isMultiLine()&&h.hasOwnProperty(v)){t(m);var C=$.doc.getLine(d.start.row),y=C.substring(d.start.column+1,d.start.column+2);if(y==v)return d.end.column++,d}}),u.closeDocComment!==!1&&this.add("doc comment end","insertion",function(w,S,m,$,d){if(w==="doc-start"&&(d===`
203
+ `+T+g,selection:[1,E.length,1,E.length]}}else a.clearMaybeInsertedClosing();}),this.add("braces","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="{"){e(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.end.column,d.end.column+1);if(C=="}")return d.end.column++,d;t.maybeInsertedBrackets--;}}),this.add("parens","insertion",function(w,S,m,$,d){if(d=="("){e(m);var h=m.getSelectionRange(),v=$.doc.getTextRange(h);if(v!==""&&m.getWrapBehavioursEnabled())return o(h,v,"(",")");if(a.isSaneInsertion(m,$))return a.recordAutoInsert(m,$,")"),{text:"()",selection:[1,1]}}else if(d==")"){e(m);var C=m.getCursorPosition(),y=$.doc.getLine(C.row),b=y.substring(C.column,C.column+1);if(b==")"){var f=$.$findOpeningBracket(")",{column:C.column+1,row:C.row});if(f!==null&&a.isAutoInsertedClosing(C,y,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="("){e(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.start.column+1,d.start.column+2);if(C==")")return d.end.column++,d}}),this.add("brackets","insertion",function(w,S,m,$,d){if(d=="["){e(m);var h=m.getSelectionRange(),v=$.doc.getTextRange(h);if(v!==""&&m.getWrapBehavioursEnabled())return o(h,v,"[","]");if(a.isSaneInsertion(m,$))return a.recordAutoInsert(m,$,"]"),{text:"[]",selection:[1,1]}}else if(d=="]"){e(m);var C=m.getCursorPosition(),y=$.doc.getLine(C.row),b=y.substring(C.column,C.column+1);if(b=="]"){var f=$.$findOpeningBracket("]",{column:C.column+1,row:C.row});if(f!==null&&a.isAutoInsertedClosing(C,y,d))return a.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(w,S,m,$,d){var h=$.doc.getTextRange(d);if(!d.isMultiLine()&&h=="["){e(m);var v=$.doc.getLine(d.start.row),C=v.substring(d.start.column+1,d.start.column+2);if(C=="]")return d.end.column++,d}}),this.add("string_dquotes","insertion",function(w,S,m,$,d){var h=$.$mode.$quotes||n;if(d.length==1&&h[d]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(d)!=-1)return;e(m);var v=d,C=m.getSelectionRange(),y=$.doc.getTextRange(C);if(y!==""&&(y.length!=1||!h[y])&&m.getWrapBehavioursEnabled())return o(C,y,v,v);if(!y){var b=m.getCursorPosition(),f=$.doc.getLine(b.row),p=f.substring(b.column-1,b.column),l=f.substring(b.column,b.column+1),g=$.getTokenAt(b.row,b.column),A=$.getTokenAt(b.row,b.column+1);if(p=="\\"&&g&&/escape/.test(g.type))return null;var T=g&&/string|escape/.test(g.type),E=!A||/string|escape/.test(A.type),_;if(l==v)_=T!==E,_&&/string\.end/.test(A.type)&&(_=!1);else {if(T&&!E||T&&E)return null;var O=$.$mode.tokenRe;O.lastIndex=0;var I=O.test(p);O.lastIndex=0;var N=O.test(l),F=$.$mode.$pairQuotesAfter,D=F&&F[v]&&F[v].test(p);if(!D&&I||N||l&&!/[\s;,.})\]\\]/.test(l))return null;var W=f[b.column-2];if(p==v&&(W==v||O.test(W)))return null;_=!0;}return {text:_?v+v:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(w,S,m,$,d){var h=$.$mode.$quotes||n,v=$.doc.getTextRange(d);if(!d.isMultiLine()&&h.hasOwnProperty(v)){e(m);var C=$.doc.getLine(d.start.row),y=C.substring(d.start.column+1,d.start.column+2);if(y==v)return d.end.column++,d}}),u.closeDocComment!==!1&&this.add("doc comment end","insertion",function(w,S,m,$,d){if(w==="doc-start"&&(d===`
203
204
  `||d===`\r
204
- `)&&m.selection.isEmpty()){var h=m.getCursorPosition();if(h.column===0)return;for(var v=$.doc.getLine(h.row),C=$.doc.getLine(h.row+1),y=$.getTokens(h.row),b=0,f=0;f<y.length;f++){b+=y[f].value.length;var p=y[f];if(b>=h.column){if(b===h.column){if(!/\.doc/.test(p.type))return;if(/\*\//.test(p.value)){var c=y[f+1];if(!c||!/\.doc/.test(c.type))return}}var g=h.column-(b-p.value.length),A=p.value.indexOf("*/"),T=p.value.indexOf("/**",A>-1?A+2:0);if(T!==-1&&g>T&&g<T+3||A!==-1&&T!==-1&&g>=A&&g<=T||!/\.doc/.test(p.type))return;break}}var E=this.$getIndent(v);if(/\s*\*/.test(C))return /^\s*\*/.test(v)?{text:d+E+"* ",selection:[1,2+E.length,1,2+E.length]}:{text:d+E+" * ",selection:[1,3+E.length,1,3+E.length]};if(/\/\*\*/.test(v.substring(0,h.column)))return {text:d+E+" * "+d+" "+E+"*/",selection:[1,4+E.length,1,4+E.length]}}});},a.isSaneInsertion=function(u,w){var S=u.getCursorPosition(),m=new x(w,S.row,S.column);if(!this.$matchTokenType(m.getCurrentToken()||"text",l)){if(/[)}\]]/.test(u.session.getLine(S.row)[S.column]))return !0;var $=new x(w,S.row,S.column+1);if(!this.$matchTokenType($.getCurrentToken()||"text",l))return !1}return m.stepForward(),m.getCurrentTokenRow()!==S.row||this.$matchTokenType(m.getCurrentToken()||"text",r)},a.$matchTokenType=function(u,w){return w.indexOf(u.type||u)>-1},a.recordAutoInsert=function(u,w,S){var m=u.getCursorPosition(),$=w.doc.getLine(m.row);this.isAutoInsertedClosing(m,$,e.autoInsertedLineEnd[0])||(e.autoInsertedBrackets=0),e.autoInsertedRow=m.row,e.autoInsertedLineEnd=S+$.substr(m.column),e.autoInsertedBrackets++;},a.recordMaybeInsert=function(u,w,S){var m=u.getCursorPosition(),$=w.doc.getLine(m.row);this.isMaybeInsertedClosing(m,$)||(e.maybeInsertedBrackets=0),e.maybeInsertedRow=m.row,e.maybeInsertedLineStart=$.substr(0,m.column)+S,e.maybeInsertedLineEnd=$.substr(m.column),e.maybeInsertedBrackets++;},a.isAutoInsertedClosing=function(u,w,S){return e.autoInsertedBrackets>0&&u.row===e.autoInsertedRow&&S===e.autoInsertedLineEnd[0]&&w.substr(u.column)===e.autoInsertedLineEnd},a.isMaybeInsertedClosing=function(u,w){return e.maybeInsertedBrackets>0&&u.row===e.maybeInsertedRow&&w.substr(u.column)===e.maybeInsertedLineEnd&&w.substr(0,u.column)==e.maybeInsertedLineStart},a.popAutoInsertedClosing=function(){e.autoInsertedLineEnd=e.autoInsertedLineEnd.substr(1),e.autoInsertedBrackets--;},a.clearMaybeInsertedClosing=function(){e&&(e.maybeInsertedBrackets=0,e.maybeInsertedRow=-1);},R.inherits(a,L),M.CstyleBehaviour=a;});ace.define("ace/unicode",["require","exports","module"],function(k,M,H){for(var R=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],L=0,x=[],s=0;s<R.length;s+=2)x.push(L+=R[s]),R[s+1]&&x.push(45,L+=R[s+1]);M.wordChars=String.fromCharCode.apply(null,x);});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(k,M,H){var R=k("../config"),L=k("../tokenizer").Tokenizer,x=k("./text_highlight_rules").TextHighlightRules,s=k("./behaviour/cstyle").CstyleBehaviour,l=k("../unicode"),r=k("../lib/lang"),e=k("../token_iterator").TokenIterator,i=k("../range").Range,n;n=function(){this.HighlightRules=x;},function(){this.$defaultBehaviour=new s,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new L(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(t,o,a,u){var w=o.doc,S=!0,m=!0,$=1/0,d=o.getTabSize(),h=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var y=this.lineCommentStart.map(r.escapeRegExp).join("|"),v=this.lineCommentStart[0];else var y=r.escapeRegExp(this.lineCommentStart),v=this.lineCommentStart;y=new RegExp("^(\\s*)(?:"+y+") ?"),h=o.getUseSoftTabs();var p=function(N,F){var D=N.match(y);if(D){var W=D[1].length,B=D[0].length;!A(N,W,B)&&D[0][B-1]==" "&&B--,w.removeInLine(F,W,B);}},g=v+" ",f=function(N,F){(!S||/\S/.test(N))&&(A(N,$,$)?w.insertInLine({row:F,column:$},g):w.insertInLine({row:F,column:$},v));},c=function(N,F){return y.test(N)},A=function(N,F,D){for(var W=0;F--&&N.charAt(F)==" ";)W++;if(W%d!=0)return !1;for(var W=0;N.charAt(D++)==" ";)W++;return d>2?W%d!=d-1:W%d==0};}else {if(!this.blockComment)return !1;var v=this.blockComment.start,C=this.blockComment.end,y=new RegExp("^(\\s*)(?:"+r.escapeRegExp(v)+")"),b=new RegExp("(?:"+r.escapeRegExp(C)+")\\s*$"),f=function(_,O){c(_,O)||(!S||/\S/.test(_))&&(w.insertInLine({row:O,column:_.length},C),w.insertInLine({row:O,column:$},v));},p=function(_,O){var I;(I=_.match(b))&&w.removeInLine(O,_.length-I[0].length,_.length),(I=_.match(y))&&w.removeInLine(O,I[1].length,I[0].length);},c=function(_,O){if(y.test(_))return !0;for(var I=o.getTokens(O),N=0;N<I.length;N++)if(I[N].type==="comment")return !0};}function T(_){for(var O=a;O<=u;O++)_(w.getLine(O),O);}var E=1/0;T(function(_,O){var I=_.search(/\S/);I!==-1?(I<$&&($=I),m&&!c(_,O)&&(m=!1)):E>_.length&&(E=_.length);}),$==1/0&&($=E,S=!1,m=!1),h&&$%d!=0&&($=Math.floor($/d)*d),T(m?p:f);},this.toggleBlockComment=function(t,o,a,u){var w=this.blockComment;if(w){!w.start&&w[0]&&(w=w[0]);var S=new e(o,u.row,u.column),m=S.getCurrentToken();o.selection;var d=o.selection.toOrientedRange(),h,v;if(m&&/comment/.test(m.type)){for(var C,y;m&&/comment/.test(m.type);){var b=m.value.indexOf(w.start);if(b!=-1){var f=S.getCurrentTokenRow(),p=S.getCurrentTokenColumn()+b;C=new i(f,p,f,p+w.start.length);break}m=S.stepBackward();}for(var S=new e(o,u.row,u.column),m=S.getCurrentToken();m&&/comment/.test(m.type);){var b=m.value.indexOf(w.end);if(b!=-1){var f=S.getCurrentTokenRow(),p=S.getCurrentTokenColumn()+b;y=new i(f,p,f,p+w.end.length);break}m=S.stepForward();}y&&o.remove(y),C&&(o.remove(C),h=C.start.row,v=-w.start.length);}else v=w.start.length,h=a.start.row,o.insert(a.end,w.end),o.insert(a.start,w.start);d.start.row==h&&(d.start.column+=v),d.end.row==h&&(d.end.column+=v),o.selection.fromOrientedRange(d);}},this.getNextLineIndent=function(t,o,a){return this.$getIndent(o)},this.checkOutdent=function(t,o,a){return !1},this.autoOutdent=function(t,o,a){},this.$getIndent=function(t){return t.match(/^\s*/)[0]},this.createWorker=function(t){return null},this.createModeDelegates=function(t){this.$embeds=[],this.$modes={};for(var o in t)if(t[o]){var a=t[o],u=a.prototype.$id,w=R.$modes[u];w||(R.$modes[u]=w=new a),R.$modes[o]||(R.$modes[o]=w),this.$embeds.push(o),this.$modes[o]=w;}for(var S=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],m=function(d){(function(h){var v=S[d],C=h[v];h[S[d]]=function(){return this.$delegator(v,arguments,C)};})($);},$=this,o=0;o<S.length;o++)m(o);},this.$delegator=function(t,o,a){var u=o[0]||"start";if(typeof u!="string"){if(Array.isArray(u[2])){var w=u[2][u[2].length-1],S=this.$modes[w];if(S)return S[t].apply(S,[u[1]].concat([].slice.call(o,1)))}u=u[0]||"start";}for(var m=0;m<this.$embeds.length;m++)if(this.$modes[this.$embeds[m]]){var $=u.split(this.$embeds[m]);if(!$[0]&&$[1]){o[0]=$[1];var S=this.$modes[this.$embeds[m]];return S[t].apply(S,o)}}var d=a.apply(this,o);return a?d:void 0},this.transformAction=function(t,o,a,u,w){if(this.$behaviour){var S=this.$behaviour.getBehaviours();for(var m in S)if(S[m][o]){var $=S[m][o].apply(this,arguments);if($)return $}}},this.getKeywords=function(t){if(!this.completionKeywords){var o=this.$tokenizer.rules,a=[];for(var u in o)for(var w=o[u],S=0,m=w.length;S<m;S++)if(typeof w[S].token=="string")/keyword|support|storage/.test(w[S].token)&&a.push(w[S].regex);else if(typeof w[S].token=="object"){for(var $=0,d=w[S].token.length;$<d;$++)if(/keyword|support|storage/.test(w[S].token[$])){var u=w[S].regex.match(/\(.+?\)/g)[$];a.push(u.substr(1,u.length-2));}}this.completionKeywords=a;}return t?a.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(t,o,a,u){var w=this.$keywordList||this.$createKeywordList();return w.map(function(S){return {name:S,value:S,score:0,meta:"keyword"}})},this.$id="ace/mode/text";}.call(n.prototype),M.Mode=n;});ace.define("ace/apply_delta",["require","exports","module"],function(k,M,H){M.applyDelta=function(s,l,r){var e=l.start.row,i=l.start.column,n=s[e]||"";switch(l.action){case"insert":var t=l.lines;if(t.length===1)s[e]=n.substring(0,i)+l.lines[0]+n.substring(i);else {var o=[e,1].concat(l.lines);s.splice.apply(s,o),s[e]=n.substring(0,i)+s[e],s[e+l.lines.length-1]+=n.substring(i);}break;case"remove":var a=l.end.column,u=l.end.row;e===u?s[e]=n.substring(0,i)+n.substring(a):s.splice(e,u-e+1,n.substring(0,i)+s[u].substring(a));break}};});ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/event_emitter").EventEmitter,x=function(){function r(e,i,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof i!="number"?this.setPosition(i.row,i.column):this.setPosition(i,n);}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row)&&!(e.start.row>this.row)){var i=l(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0);}},r.prototype.setPosition=function(e,i,n){var t;if(n?t={row:e,column:i}:t=this.$clipPositionToDocument(e,i),!(this.row==t.row&&this.column==t.column)){var o={row:this.row,column:this.column};this.row=t.row,this.column=t.column,this._signal("change",{old:o,value:t});}},r.prototype.detach=function(){this.document.off("change",this.$onChange);},r.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange);},r.prototype.$clipPositionToDocument=function(e,i){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,i))),i<0&&(n.column=0),n},r}();x.prototype.$insertRight=!1,R.implement(x.prototype,L);function s(r,e,i){var n=i?r.column<=e.column:r.column<e.column;return r.row<e.row||r.row==e.row&&n}function l(r,e,i){var n=r.action=="insert",t=(n?1:-1)*(r.end.row-r.start.row),o=(n?1:-1)*(r.end.column-r.start.column),a=r.start,u=n?a:r.end;return s(e,a,i)?{row:e.row,column:e.column}:s(u,e,!i)?{row:e.row+t,column:e.column+(e.row==u.row?o:0)}:{row:a.row,column:a.column}}M.Anchor=x;});ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(k,M,H){var R=k("./lib/oop"),L=k("./apply_delta").applyDelta,x=k("./lib/event_emitter").EventEmitter,s=k("./range").Range,l=k("./anchor").Anchor,r=function(){function e(i){this.$lines=[""],i.length===0?this.$lines=[""]:Array.isArray(i)?this.insertMergedLines({row:0,column:0},i):this.insert({row:0,column:0},i);}return e.prototype.setValue=function(i){var n=this.getLength()-1;this.remove(new s(0,0,n,this.getLine(n).length)),this.insert({row:0,column:0},i||"");},e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},e.prototype.createAnchor=function(i,n){return new l(this,i,n)},e.prototype.$detectNewLine=function(i){var n=i.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=n?n[1]:`
205
- `,this._signal("changeNewLineMode");},e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return `\r
205
+ `)&&m.selection.isEmpty()){var h=m.getCursorPosition();if(h.column===0)return;for(var v=$.doc.getLine(h.row),C=$.doc.getLine(h.row+1),y=$.getTokens(h.row),b=0,f=0;f<y.length;f++){b+=y[f].value.length;var p=y[f];if(b>=h.column){if(b===h.column){if(!/\.doc/.test(p.type))return;if(/\*\//.test(p.value)){var l=y[f+1];if(!l||!/\.doc/.test(l.type))return}}var g=h.column-(b-p.value.length),A=p.value.indexOf("*/"),T=p.value.indexOf("/**",A>-1?A+2:0);if(T!==-1&&g>T&&g<T+3||A!==-1&&T!==-1&&g>=A&&g<=T||!/\.doc/.test(p.type))return;break}}var E=this.$getIndent(v);if(/\s*\*/.test(C))return /^\s*\*/.test(v)?{text:d+E+"* ",selection:[1,2+E.length,1,2+E.length]}:{text:d+E+" * ",selection:[1,3+E.length,1,3+E.length]};if(/\/\*\*/.test(v.substring(0,h.column)))return {text:d+E+" * "+d+" "+E+"*/",selection:[1,4+E.length,1,4+E.length]}}});},a.isSaneInsertion=function(u,w){var S=u.getCursorPosition(),m=new x(w,S.row,S.column);if(!this.$matchTokenType(m.getCurrentToken()||"text",c)){if(/[)}\]]/.test(u.session.getLine(S.row)[S.column]))return !0;var $=new x(w,S.row,S.column+1);if(!this.$matchTokenType($.getCurrentToken()||"text",c))return !1}return m.stepForward(),m.getCurrentTokenRow()!==S.row||this.$matchTokenType(m.getCurrentToken()||"text",r)},a.$matchTokenType=function(u,w){return w.indexOf(u.type||u)>-1},a.recordAutoInsert=function(u,w,S){var m=u.getCursorPosition(),$=w.doc.getLine(m.row);this.isAutoInsertedClosing(m,$,t.autoInsertedLineEnd[0])||(t.autoInsertedBrackets=0),t.autoInsertedRow=m.row,t.autoInsertedLineEnd=S+$.substr(m.column),t.autoInsertedBrackets++;},a.recordMaybeInsert=function(u,w,S){var m=u.getCursorPosition(),$=w.doc.getLine(m.row);this.isMaybeInsertedClosing(m,$)||(t.maybeInsertedBrackets=0),t.maybeInsertedRow=m.row,t.maybeInsertedLineStart=$.substr(0,m.column)+S,t.maybeInsertedLineEnd=$.substr(m.column),t.maybeInsertedBrackets++;},a.isAutoInsertedClosing=function(u,w,S){return t.autoInsertedBrackets>0&&u.row===t.autoInsertedRow&&S===t.autoInsertedLineEnd[0]&&w.substr(u.column)===t.autoInsertedLineEnd},a.isMaybeInsertedClosing=function(u,w){return t.maybeInsertedBrackets>0&&u.row===t.maybeInsertedRow&&w.substr(u.column)===t.maybeInsertedLineEnd&&w.substr(0,u.column)==t.maybeInsertedLineStart},a.popAutoInsertedClosing=function(){t.autoInsertedLineEnd=t.autoInsertedLineEnd.substr(1),t.autoInsertedBrackets--;},a.clearMaybeInsertedClosing=function(){t&&(t.maybeInsertedBrackets=0,t.maybeInsertedRow=-1);},R.inherits(a,L),M.CstyleBehaviour=a;});ace.define("ace/unicode",["require","exports","module"],function(k,M,H){for(var R=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],L=0,x=[],s=0;s<R.length;s+=2)x.push(L+=R[s]),R[s+1]&&x.push(45,L+=R[s+1]);M.wordChars=String.fromCharCode.apply(null,x);});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(k,M,H){var R=k("../config"),L=k("../tokenizer").Tokenizer,x=k("./text_highlight_rules").TextHighlightRules,s=k("./behaviour/cstyle").CstyleBehaviour,c=k("../unicode"),r=k("../lib/lang"),t=k("../token_iterator").TokenIterator,i=k("../range").Range,n;n=function(){this.HighlightRules=x;},function(){this.$defaultBehaviour=new s,this.tokenRe=new RegExp("^["+c.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+c.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new L(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,o,a,u){var w=o.doc,S=!0,m=!0,$=1/0,d=o.getTabSize(),h=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var y=this.lineCommentStart.map(r.escapeRegExp).join("|"),v=this.lineCommentStart[0];else var y=r.escapeRegExp(this.lineCommentStart),v=this.lineCommentStart;y=new RegExp("^(\\s*)(?:"+y+") ?"),h=o.getUseSoftTabs();var p=function(N,F){var D=N.match(y);if(D){var W=D[1].length,B=D[0].length;!A(N,W,B)&&D[0][B-1]==" "&&B--,w.removeInLine(F,W,B);}},g=v+" ",f=function(N,F){(!S||/\S/.test(N))&&(A(N,$,$)?w.insertInLine({row:F,column:$},g):w.insertInLine({row:F,column:$},v));},l=function(N,F){return y.test(N)},A=function(N,F,D){for(var W=0;F--&&N.charAt(F)==" ";)W++;if(W%d!=0)return !1;for(var W=0;N.charAt(D++)==" ";)W++;return d>2?W%d!=d-1:W%d==0};}else {if(!this.blockComment)return !1;var v=this.blockComment.start,C=this.blockComment.end,y=new RegExp("^(\\s*)(?:"+r.escapeRegExp(v)+")"),b=new RegExp("(?:"+r.escapeRegExp(C)+")\\s*$"),f=function(_,O){l(_,O)||(!S||/\S/.test(_))&&(w.insertInLine({row:O,column:_.length},C),w.insertInLine({row:O,column:$},v));},p=function(_,O){var I;(I=_.match(b))&&w.removeInLine(O,_.length-I[0].length,_.length),(I=_.match(y))&&w.removeInLine(O,I[1].length,I[0].length);},l=function(_,O){if(y.test(_))return !0;for(var I=o.getTokens(O),N=0;N<I.length;N++)if(I[N].type==="comment")return !0};}function T(_){for(var O=a;O<=u;O++)_(w.getLine(O),O);}var E=1/0;T(function(_,O){var I=_.search(/\S/);I!==-1?(I<$&&($=I),m&&!l(_,O)&&(m=!1)):E>_.length&&(E=_.length);}),$==1/0&&($=E,S=!1,m=!1),h&&$%d!=0&&($=Math.floor($/d)*d),T(m?p:f);},this.toggleBlockComment=function(e,o,a,u){var w=this.blockComment;if(w){!w.start&&w[0]&&(w=w[0]);var S=new t(o,u.row,u.column),m=S.getCurrentToken();o.selection;var d=o.selection.toOrientedRange(),h,v;if(m&&/comment/.test(m.type)){for(var C,y;m&&/comment/.test(m.type);){var b=m.value.indexOf(w.start);if(b!=-1){var f=S.getCurrentTokenRow(),p=S.getCurrentTokenColumn()+b;C=new i(f,p,f,p+w.start.length);break}m=S.stepBackward();}for(var S=new t(o,u.row,u.column),m=S.getCurrentToken();m&&/comment/.test(m.type);){var b=m.value.indexOf(w.end);if(b!=-1){var f=S.getCurrentTokenRow(),p=S.getCurrentTokenColumn()+b;y=new i(f,p,f,p+w.end.length);break}m=S.stepForward();}y&&o.remove(y),C&&(o.remove(C),h=C.start.row,v=-w.start.length);}else v=w.start.length,h=a.start.row,o.insert(a.end,w.end),o.insert(a.start,w.start);d.start.row==h&&(d.start.column+=v),d.end.row==h&&(d.end.column+=v),o.selection.fromOrientedRange(d);}},this.getNextLineIndent=function(e,o,a){return this.$getIndent(o)},this.checkOutdent=function(e,o,a){return !1},this.autoOutdent=function(e,o,a){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var o in e)if(e[o]){var a=e[o],u=a.prototype.$id,w=R.$modes[u];w||(R.$modes[u]=w=new a),R.$modes[o]||(R.$modes[o]=w),this.$embeds.push(o),this.$modes[o]=w;}for(var S=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],m=function(d){(function(h){var v=S[d],C=h[v];h[S[d]]=function(){return this.$delegator(v,arguments,C)};})($);},$=this,o=0;o<S.length;o++)m(o);},this.$delegator=function(e,o,a){var u=o[0]||"start";if(typeof u!="string"){if(Array.isArray(u[2])){var w=u[2][u[2].length-1],S=this.$modes[w];if(S)return S[e].apply(S,[u[1]].concat([].slice.call(o,1)))}u=u[0]||"start";}for(var m=0;m<this.$embeds.length;m++)if(this.$modes[this.$embeds[m]]){var $=u.split(this.$embeds[m]);if(!$[0]&&$[1]){o[0]=$[1];var S=this.$modes[this.$embeds[m]];return S[e].apply(S,o)}}var d=a.apply(this,o);return a?d:void 0},this.transformAction=function(e,o,a,u,w){if(this.$behaviour){var S=this.$behaviour.getBehaviours();for(var m in S)if(S[m][o]){var $=S[m][o].apply(this,arguments);if($)return $}}},this.getKeywords=function(e){if(!this.completionKeywords){var o=this.$tokenizer.rules,a=[];for(var u in o)for(var w=o[u],S=0,m=w.length;S<m;S++)if(typeof w[S].token=="string")/keyword|support|storage/.test(w[S].token)&&a.push(w[S].regex);else if(typeof w[S].token=="object"){for(var $=0,d=w[S].token.length;$<d;$++)if(/keyword|support|storage/.test(w[S].token[$])){var u=w[S].regex.match(/\(.+?\)/g)[$];a.push(u.substr(1,u.length-2));}}this.completionKeywords=a;}return e?a.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,o,a,u){var w=this.$keywordList||this.$createKeywordList();return w.map(function(S){return {name:S,value:S,score:0,meta:"keyword"}})},this.$id="ace/mode/text";}.call(n.prototype),M.Mode=n;});ace.define("ace/apply_delta",["require","exports","module"],function(k,M,H){M.applyDelta=function(s,c,r){var t=c.start.row,i=c.start.column,n=s[t]||"";switch(c.action){case"insert":var e=c.lines;if(e.length===1)s[t]=n.substring(0,i)+c.lines[0]+n.substring(i);else {var o=[t,1].concat(c.lines);s.splice.apply(s,o),s[t]=n.substring(0,i)+s[t],s[t+c.lines.length-1]+=n.substring(i);}break;case"remove":var a=c.end.column,u=c.end.row;t===u?s[t]=n.substring(0,i)+n.substring(a):s.splice(t,u-t+1,n.substring(0,i)+s[u].substring(a));break}};});ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/event_emitter").EventEmitter,x=function(){function r(t,i,n){this.$onChange=this.onChange.bind(this),this.attach(t),typeof i!="number"?this.setPosition(i.row,i.column):this.setPosition(i,n);}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(t){if(!(t.start.row==t.end.row&&t.start.row!=this.row)&&!(t.start.row>this.row)){var i=c(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(i.row,i.column,!0);}},r.prototype.setPosition=function(t,i,n){var e;if(n?e={row:t,column:i}:e=this.$clipPositionToDocument(t,i),!(this.row==e.row&&this.column==e.column)){var o={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:o,value:e});}},r.prototype.detach=function(){this.document.off("change",this.$onChange);},r.prototype.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange);},r.prototype.$clipPositionToDocument=function(t,i){var n={};return t>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):t<0?(n.row=0,n.column=0):(n.row=t,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,i))),i<0&&(n.column=0),n},r}();x.prototype.$insertRight=!1,R.implement(x.prototype,L);function s(r,t,i){var n=i?r.column<=t.column:r.column<t.column;return r.row<t.row||r.row==t.row&&n}function c(r,t,i){var n=r.action=="insert",e=(n?1:-1)*(r.end.row-r.start.row),o=(n?1:-1)*(r.end.column-r.start.column),a=r.start,u=n?a:r.end;return s(t,a,i)?{row:t.row,column:t.column}:s(u,t,!i)?{row:t.row+e,column:t.column+(t.row==u.row?o:0)}:{row:a.row,column:a.column}}M.Anchor=x;});ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(k,M,H){var R=k("./lib/oop"),L=k("./apply_delta").applyDelta,x=k("./lib/event_emitter").EventEmitter,s=k("./range").Range,c=k("./anchor").Anchor,r=function(){function t(i){this.$lines=[""],i.length===0?this.$lines=[""]:Array.isArray(i)?this.insertMergedLines({row:0,column:0},i):this.insert({row:0,column:0},i);}return t.prototype.setValue=function(i){var n=this.getLength()-1;this.remove(new s(0,0,n,this.getLine(n).length)),this.insert({row:0,column:0},i||"");},t.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},t.prototype.createAnchor=function(i,n){return new c(this,i,n)},t.prototype.$detectNewLine=function(i){var n=i.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=n?n[1]:`
206
+ `,this._signal("changeNewLineMode");},t.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return `\r
206
207
  `;case"unix":return `
207
208
  `;default:return this.$autoNewLine||`
208
- `}},e.prototype.setNewLineMode=function(i){this.$newLineMode!==i&&(this.$newLineMode=i,this._signal("changeNewLineMode"));},e.prototype.getNewLineMode=function(){return this.$newLineMode},e.prototype.isNewLine=function(i){return i==`\r
209
+ `}},t.prototype.setNewLineMode=function(i){this.$newLineMode!==i&&(this.$newLineMode=i,this._signal("changeNewLineMode"));},t.prototype.getNewLineMode=function(){return this.$newLineMode},t.prototype.isNewLine=function(i){return i==`\r
209
210
  `||i=="\r"||i==`
210
- `},e.prototype.getLine=function(i){return this.$lines[i]||""},e.prototype.getLines=function(i,n){return this.$lines.slice(i,n+1)},e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},e.prototype.getLength=function(){return this.$lines.length},e.prototype.getTextRange=function(i){return this.getLinesForRange(i).join(this.getNewLineCharacter())},e.prototype.getLinesForRange=function(i){var n;if(i.start.row===i.end.row)n=[this.getLine(i.start.row).substring(i.start.column,i.end.column)];else {n=this.getLines(i.start.row,i.end.row),n[0]=(n[0]||"").substring(i.start.column);var t=n.length-1;i.end.row-i.start.row==t&&(n[t]=n[t].substring(0,i.end.column));}return n},e.prototype.insertLines=function(i,n){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(i,n)},e.prototype.removeLines=function(i,n){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(i,n)},e.prototype.insertNewLine=function(i){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(i,["",""])},e.prototype.insert=function(i,n){return this.getLength()<=1&&this.$detectNewLine(n),this.insertMergedLines(i,this.$split(n))},e.prototype.insertInLine=function(i,n){var t=this.clippedPos(i.row,i.column),o=this.pos(i.row,i.column+n.length);return this.applyDelta({start:t,end:o,action:"insert",lines:[n]},!0),this.clonePos(o)},e.prototype.clippedPos=function(i,n){var t=this.getLength();i===void 0?i=t:i<0?i=0:i>=t&&(i=t-1,n=void 0);var o=this.getLine(i);return n==null&&(n=o.length),n=Math.min(Math.max(n,0),o.length),{row:i,column:n}},e.prototype.clonePos=function(i){return {row:i.row,column:i.column}},e.prototype.pos=function(i,n){return {row:i,column:n}},e.prototype.$clipPosition=function(i){var n=this.getLength();return i.row>=n?(i.row=Math.max(0,n-1),i.column=this.getLine(n-1).length):(i.row=Math.max(0,i.row),i.column=Math.min(Math.max(i.column,0),this.getLine(i.row).length)),i},e.prototype.insertFullLines=function(i,n){i=Math.min(Math.max(i,0),this.getLength());var t=0;i<this.getLength()?(n=n.concat([""]),t=0):(n=[""].concat(n),i--,t=this.$lines[i].length),this.insertMergedLines({row:i,column:t},n);},e.prototype.insertMergedLines=function(i,n){var t=this.clippedPos(i.row,i.column),o={row:t.row+n.length-1,column:(n.length==1?t.column:0)+n[n.length-1].length};return this.applyDelta({start:t,end:o,action:"insert",lines:n}),this.clonePos(o)},e.prototype.remove=function(i){var n=this.clippedPos(i.start.row,i.start.column),t=this.clippedPos(i.end.row,i.end.column);return this.applyDelta({start:n,end:t,action:"remove",lines:this.getLinesForRange({start:n,end:t})}),this.clonePos(n)},e.prototype.removeInLine=function(i,n,t){var o=this.clippedPos(i,n),a=this.clippedPos(i,t);return this.applyDelta({start:o,end:a,action:"remove",lines:this.getLinesForRange({start:o,end:a})},!0),this.clonePos(o)},e.prototype.removeFullLines=function(i,n){i=Math.min(Math.max(0,i),this.getLength()-1),n=Math.min(Math.max(0,n),this.getLength()-1);var t=n==this.getLength()-1&&i>0,o=n<this.getLength()-1,a=t?i-1:i,u=t?this.getLine(a).length:0,w=o?n+1:n,S=o?0:this.getLine(w).length,m=new s(a,u,w,S),$=this.$lines.slice(i,n+1);return this.applyDelta({start:m.start,end:m.end,action:"remove",lines:this.getLinesForRange(m)}),$},e.prototype.removeNewLine=function(i){i<this.getLength()-1&&i>=0&&this.applyDelta({start:this.pos(i,this.getLine(i).length),end:this.pos(i+1,0),action:"remove",lines:["",""]});},e.prototype.replace=function(i,n){if(i instanceof s||(i=s.fromPoints(i.start,i.end)),n.length===0&&i.isEmpty())return i.start;if(n==this.getTextRange(i))return i.end;this.remove(i);var t;return n?t=this.insert(i.start,n):t=i.start,t},e.prototype.applyDeltas=function(i){for(var n=0;n<i.length;n++)this.applyDelta(i[n]);},e.prototype.revertDeltas=function(i){for(var n=i.length-1;n>=0;n--)this.revertDelta(i[n]);},e.prototype.applyDelta=function(i,n){var t=i.action=="insert";(t?i.lines.length<=1&&!i.lines[0]:!s.comparePoints(i.start,i.end))||(t&&i.lines.length>2e4?this.$splitAndapplyLargeDelta(i,2e4):(L(this.$lines,i,n),this._signal("change",i)));},e.prototype.$safeApplyDelta=function(i){var n=this.$lines.length;(i.action=="remove"&&i.start.row<n&&i.end.row<n||i.action=="insert"&&i.start.row<=n)&&this.applyDelta(i);},e.prototype.$splitAndapplyLargeDelta=function(i,n){for(var t=i.lines,o=t.length-n+1,a=i.start.row,u=i.start.column,w=0,S=0;w<o;w=S){S+=n-1;var m=t.slice(w,S);m.push(""),this.applyDelta({start:this.pos(a+w,u),end:this.pos(a+S,u=0),action:i.action,lines:m},!0);}i.lines=t.slice(w),i.start.row=a+w,i.start.column=u,this.applyDelta(i,!0);},e.prototype.revertDelta=function(i){this.$safeApplyDelta({start:this.clonePos(i.start),end:this.clonePos(i.end),action:i.action=="insert"?"remove":"insert",lines:i.lines.slice()});},e.prototype.indexToPosition=function(i,n){for(var t=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,a=n||0,u=t.length;a<u;a++)if(i-=t[a].length+o,i<0)return {row:a,column:i+t[a].length+o};return {row:u-1,column:i+t[u-1].length+o}},e.prototype.positionToIndex=function(i,n){for(var t=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,a=0,u=Math.min(i.row,t.length),w=n||0;w<u;++w)a+=t[w].length+o;return a+i.column},e.prototype.$split=function(i){return i.split(/\r\n|\r|\n/)},e}();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",R.implement(r.prototype,x),M.Document=r;});ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/event_emitter").EventEmitter,x=function(){function s(l,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=l;var e=this;this.$worker=function(){if(e.running){for(var i=new Date,n=e.currentLine,t=-1,o=e.doc,a=n;e.lines[n];)n++;var u=o.getLength(),w=0;for(e.running=!1;n<u;){e.$tokenizeRow(n),t=n;do n++;while(e.lines[n]);if(w++,w%5===0&&new Date-i>20){e.running=setTimeout(e.$worker,20);break}}e.currentLine=n,t==-1&&(t=n),a<=t&&e.fireUpdateEvent(a,t);}};}return s.prototype.setTokenizer=function(l){this.tokenizer=l,this.lines=[],this.states=[],this.start(0);},s.prototype.setDocument=function(l){this.doc=l,this.lines=[],this.states=[],this.stop();},s.prototype.fireUpdateEvent=function(l,r){var e={first:l,last:r};this._signal("update",{data:e});},s.prototype.start=function(l){this.currentLine=Math.min(l||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700);},s.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700));},s.prototype.$updateOnChange=function(l){var r=l.start.row,e=l.end.row-r;if(e===0)this.lines[r]=null;else if(l.action=="remove")this.lines.splice(r,e+1,null),this.states.splice(r,e+1,null);else {var i=Array(e+1);i.unshift(r,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i);}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop();},s.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1;},s.prototype.getTokens=function(l){return this.lines[l]||this.$tokenizeRow(l)},s.prototype.getState=function(l){return this.currentLine==l&&this.$tokenizeRow(l),this.states[l]||"start"},s.prototype.$tokenizeRow=function(l){var r=this.doc.getLine(l),e=this.states[l-1],i=this.tokenizer.getLineTokens(r,e,l);return this.states[l]+""!=i.state+""?(this.states[l]=i.state,this.lines[l+1]=null,this.currentLine>l+1&&(this.currentLine=l+1)):this.currentLine==l&&(this.currentLine=l+1),this.lines[l]=i.tokens},s.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners();},s}();R.implement(x.prototype,L),M.BackgroundTokenizer=x;});ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(k,M,H){var R=k("./lib/lang"),L=k("./range").Range,x=function(){function s(l,r,e){e===void 0&&(e="text"),this.setRegexp(l),this.clazz=r,this.type=e;}return s.prototype.setRegexp=function(l){this.regExp+""!=l+""&&(this.regExp=l,this.cache=[]);},s.prototype.update=function(l,r,e,i){if(this.regExp)for(var n=i.firstRow,t=i.lastRow,o={},a=n;a<=t;a++){var u=this.cache[a];u==null&&(u=R.getMatchOffsets(e.getLine(a),this.regExp),u.length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function($){return new L(a,$.offset,a,$.offset+$.length)}),this.cache[a]=u.length?u:"");for(var w=u.length;w--;){var S=u[w].toScreenRange(e),m=S.toString();o[m]||(o[m]=!0,r.drawSingleLineMarker(l,S,this.clazz,i));}}},s}();x.prototype.MAX_RANGES=500,M.SearchHighlight=x;});ace.define("ace/undomanager",["require","exports","module","ace/range"],function(k,M,H){var R=function(){function h(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset();}return h.prototype.addSession=function(v){this.$session=v;},h.prototype.add=function(v,C,y){if(!this.$fromUndo&&v!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),C===!1||!this.lastDeltas){this.lastDeltas=[];var b=this.$undoStack.length;b>this.$undoDepth-1&&this.$undoStack.splice(0,b-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),v.id=this.$rev=++this.$maxRev;}(v.action=="remove"||v.action=="insert")&&(this.$lastDelta=v),this.lastDeltas.push(v);}},h.prototype.addSelection=function(v,C){this.selections.push({value:v,rev:C||this.$rev});},h.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},h.prototype.markIgnored=function(v,C){C==null&&(C=this.$rev+1);for(var y=this.$undoStack,b=y.length;b--;){var f=y[b][0];if(f.id<=v)break;f.id<C&&(f.ignore=!0);}this.lastDeltas=null;},h.prototype.getSelection=function(v,C){for(var y=this.selections,b=y.length;b--;){var f=y[b];if(f.rev<v)return C&&(f=y[b+1]),f}},h.prototype.getRevision=function(){return this.$rev},h.prototype.getDeltas=function(v,C){C==null&&(C=this.$rev+1);for(var y=this.$undoStack,b=null,f=0,p=y.length;p--;){var c=y[p][0];if(c.id<C&&!b&&(b=p+1),c.id<=v){f=p+1;break}}return y.slice(f,b)},h.prototype.getChangedRanges=function(v,C){C==null&&(C=this.$rev+1);},h.prototype.getChangedLines=function(v,C){C==null&&(C=this.$rev+1);},h.prototype.undo=function(v,C){this.lastDeltas=null;var y=this.$undoStack;if(L(y,y.length)){v||(v=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var b=y.pop(),f=null;return b&&(f=v.undoChanges(b,C),this.$redoStack.push(b),this.$syncRev()),this.$fromUndo=!1,f}},h.prototype.redo=function(v,C){if(this.lastDeltas=null,v||(v=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var y=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);d(this.$redoStack,y),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(p){p[0].id=++this.$maxRev;},this);}var b=this.$redoStack.pop(),f=null;return b&&(f=v.redoChanges(b,C),this.$undoStack.push(b),this.$syncRev()),this.$fromUndo=!1,f},h.prototype.$syncRev=function(){var v=this.$undoStack,C=v[v.length-1],y=C&&C[0].id||0;this.$redoStackBaseRev=y,this.$rev=y;},h.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[];},h.prototype.canUndo=function(){return this.$undoStack.length>0},h.prototype.canRedo=function(){return this.$redoStack.length>0},h.prototype.bookmark=function(v){v==null&&(v=this.$rev),this.mark=v;},h.prototype.isAtBookmark=function(){return this.$rev===this.mark},h.prototype.toJSON=function(){return {$redoStack:this.$redoStack,$undoStack:this.$undoStack}},h.prototype.fromJSON=function(v){this.reset(),this.$undoStack=v.$undoStack,this.$redoStack=v.$redoStack;},h.prototype.$prettyPrint=function(v){return v?n(v):n(this.$undoStack)+`
211
+ `},t.prototype.getLine=function(i){return this.$lines[i]||""},t.prototype.getLines=function(i,n){return this.$lines.slice(i,n+1)},t.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},t.prototype.getLength=function(){return this.$lines.length},t.prototype.getTextRange=function(i){return this.getLinesForRange(i).join(this.getNewLineCharacter())},t.prototype.getLinesForRange=function(i){var n;if(i.start.row===i.end.row)n=[this.getLine(i.start.row).substring(i.start.column,i.end.column)];else {n=this.getLines(i.start.row,i.end.row),n[0]=(n[0]||"").substring(i.start.column);var e=n.length-1;i.end.row-i.start.row==e&&(n[e]=n[e].substring(0,i.end.column));}return n},t.prototype.insertLines=function(i,n){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(i,n)},t.prototype.removeLines=function(i,n){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(i,n)},t.prototype.insertNewLine=function(i){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(i,["",""])},t.prototype.insert=function(i,n){return this.getLength()<=1&&this.$detectNewLine(n),this.insertMergedLines(i,this.$split(n))},t.prototype.insertInLine=function(i,n){var e=this.clippedPos(i.row,i.column),o=this.pos(i.row,i.column+n.length);return this.applyDelta({start:e,end:o,action:"insert",lines:[n]},!0),this.clonePos(o)},t.prototype.clippedPos=function(i,n){var e=this.getLength();i===void 0?i=e:i<0?i=0:i>=e&&(i=e-1,n=void 0);var o=this.getLine(i);return n==null&&(n=o.length),n=Math.min(Math.max(n,0),o.length),{row:i,column:n}},t.prototype.clonePos=function(i){return {row:i.row,column:i.column}},t.prototype.pos=function(i,n){return {row:i,column:n}},t.prototype.$clipPosition=function(i){var n=this.getLength();return i.row>=n?(i.row=Math.max(0,n-1),i.column=this.getLine(n-1).length):(i.row=Math.max(0,i.row),i.column=Math.min(Math.max(i.column,0),this.getLine(i.row).length)),i},t.prototype.insertFullLines=function(i,n){i=Math.min(Math.max(i,0),this.getLength());var e=0;i<this.getLength()?(n=n.concat([""]),e=0):(n=[""].concat(n),i--,e=this.$lines[i].length),this.insertMergedLines({row:i,column:e},n);},t.prototype.insertMergedLines=function(i,n){var e=this.clippedPos(i.row,i.column),o={row:e.row+n.length-1,column:(n.length==1?e.column:0)+n[n.length-1].length};return this.applyDelta({start:e,end:o,action:"insert",lines:n}),this.clonePos(o)},t.prototype.remove=function(i){var n=this.clippedPos(i.start.row,i.start.column),e=this.clippedPos(i.end.row,i.end.column);return this.applyDelta({start:n,end:e,action:"remove",lines:this.getLinesForRange({start:n,end:e})}),this.clonePos(n)},t.prototype.removeInLine=function(i,n,e){var o=this.clippedPos(i,n),a=this.clippedPos(i,e);return this.applyDelta({start:o,end:a,action:"remove",lines:this.getLinesForRange({start:o,end:a})},!0),this.clonePos(o)},t.prototype.removeFullLines=function(i,n){i=Math.min(Math.max(0,i),this.getLength()-1),n=Math.min(Math.max(0,n),this.getLength()-1);var e=n==this.getLength()-1&&i>0,o=n<this.getLength()-1,a=e?i-1:i,u=e?this.getLine(a).length:0,w=o?n+1:n,S=o?0:this.getLine(w).length,m=new s(a,u,w,S),$=this.$lines.slice(i,n+1);return this.applyDelta({start:m.start,end:m.end,action:"remove",lines:this.getLinesForRange(m)}),$},t.prototype.removeNewLine=function(i){i<this.getLength()-1&&i>=0&&this.applyDelta({start:this.pos(i,this.getLine(i).length),end:this.pos(i+1,0),action:"remove",lines:["",""]});},t.prototype.replace=function(i,n){if(i instanceof s||(i=s.fromPoints(i.start,i.end)),n.length===0&&i.isEmpty())return i.start;if(n==this.getTextRange(i))return i.end;this.remove(i);var e;return n?e=this.insert(i.start,n):e=i.start,e},t.prototype.applyDeltas=function(i){for(var n=0;n<i.length;n++)this.applyDelta(i[n]);},t.prototype.revertDeltas=function(i){for(var n=i.length-1;n>=0;n--)this.revertDelta(i[n]);},t.prototype.applyDelta=function(i,n){var e=i.action=="insert";(e?i.lines.length<=1&&!i.lines[0]:!s.comparePoints(i.start,i.end))||(e&&i.lines.length>2e4?this.$splitAndapplyLargeDelta(i,2e4):(L(this.$lines,i,n),this._signal("change",i)));},t.prototype.$safeApplyDelta=function(i){var n=this.$lines.length;(i.action=="remove"&&i.start.row<n&&i.end.row<n||i.action=="insert"&&i.start.row<=n)&&this.applyDelta(i);},t.prototype.$splitAndapplyLargeDelta=function(i,n){for(var e=i.lines,o=e.length-n+1,a=i.start.row,u=i.start.column,w=0,S=0;w<o;w=S){S+=n-1;var m=e.slice(w,S);m.push(""),this.applyDelta({start:this.pos(a+w,u),end:this.pos(a+S,u=0),action:i.action,lines:m},!0);}i.lines=e.slice(w),i.start.row=a+w,i.start.column=u,this.applyDelta(i,!0);},t.prototype.revertDelta=function(i){this.$safeApplyDelta({start:this.clonePos(i.start),end:this.clonePos(i.end),action:i.action=="insert"?"remove":"insert",lines:i.lines.slice()});},t.prototype.indexToPosition=function(i,n){for(var e=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,a=n||0,u=e.length;a<u;a++)if(i-=e[a].length+o,i<0)return {row:a,column:i+e[a].length+o};return {row:u-1,column:i+e[u-1].length+o}},t.prototype.positionToIndex=function(i,n){for(var e=this.$lines||this.getAllLines(),o=this.getNewLineCharacter().length,a=0,u=Math.min(i.row,e.length),w=n||0;w<u;++w)a+=e[w].length+o;return a+i.column},t.prototype.$split=function(i){return i.split(/\r\n|\r|\n/)},t}();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",R.implement(r.prototype,x),M.Document=r;});ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/event_emitter").EventEmitter,x=function(){function s(c,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=c;var t=this;this.$worker=function(){if(t.running){for(var i=new Date,n=t.currentLine,e=-1,o=t.doc,a=n;t.lines[n];)n++;var u=o.getLength(),w=0;for(t.running=!1;n<u;){t.$tokenizeRow(n),e=n;do n++;while(t.lines[n]);if(w++,w%5===0&&new Date-i>20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=n,e==-1&&(e=n),a<=e&&t.fireUpdateEvent(a,e);}};}return s.prototype.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0);},s.prototype.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop();},s.prototype.fireUpdateEvent=function(c,r){var t={first:c,last:r};this._signal("update",{data:t});},s.prototype.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);},s.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700));},s.prototype.$updateOnChange=function(c){var r=c.start.row,t=c.end.row-r;if(t===0)this.lines[r]=null;else if(c.action=="remove")this.lines.splice(r,t+1,null),this.states.splice(r,t+1,null);else {var i=Array(t+1);i.unshift(r,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i);}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop();},s.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1;},s.prototype.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},s.prototype.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},s.prototype.$tokenizeRow=function(c){var r=this.doc.getLine(c),t=this.states[c-1],i=this.tokenizer.getLineTokens(r,t,c);return this.states[c]+""!=i.state+""?(this.states[c]=i.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=i.tokens},s.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners();},s}();R.implement(x.prototype,L),M.BackgroundTokenizer=x;});ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(k,M,H){var R=k("./lib/lang"),L=k("./range").Range,x=function(){function s(c,r,t){t===void 0&&(t="text"),this.setRegexp(c),this.clazz=r,this.type=t;}return s.prototype.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[]);},s.prototype.update=function(c,r,t,i){if(this.regExp)for(var n=i.firstRow,e=i.lastRow,o={},a=n;a<=e;a++){var u=this.cache[a];u==null&&(u=R.getMatchOffsets(t.getLine(a),this.regExp),u.length>this.MAX_RANGES&&(u=u.slice(0,this.MAX_RANGES)),u=u.map(function($){return new L(a,$.offset,a,$.offset+$.length)}),this.cache[a]=u.length?u:"");for(var w=u.length;w--;){var S=u[w].toScreenRange(t),m=S.toString();o[m]||(o[m]=!0,r.drawSingleLineMarker(c,S,this.clazz,i));}}},s}();x.prototype.MAX_RANGES=500,M.SearchHighlight=x;});ace.define("ace/undomanager",["require","exports","module","ace/range"],function(k,M,H){var R=function(){function h(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset();}return h.prototype.addSession=function(v){this.$session=v;},h.prototype.add=function(v,C,y){if(!this.$fromUndo&&v!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),C===!1||!this.lastDeltas){this.lastDeltas=[];var b=this.$undoStack.length;b>this.$undoDepth-1&&this.$undoStack.splice(0,b-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),v.id=this.$rev=++this.$maxRev;}(v.action=="remove"||v.action=="insert")&&(this.$lastDelta=v),this.lastDeltas.push(v);}},h.prototype.addSelection=function(v,C){this.selections.push({value:v,rev:C||this.$rev});},h.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},h.prototype.markIgnored=function(v,C){C==null&&(C=this.$rev+1);for(var y=this.$undoStack,b=y.length;b--;){var f=y[b][0];if(f.id<=v)break;f.id<C&&(f.ignore=!0);}this.lastDeltas=null;},h.prototype.getSelection=function(v,C){for(var y=this.selections,b=y.length;b--;){var f=y[b];if(f.rev<v)return C&&(f=y[b+1]),f}},h.prototype.getRevision=function(){return this.$rev},h.prototype.getDeltas=function(v,C){C==null&&(C=this.$rev+1);for(var y=this.$undoStack,b=null,f=0,p=y.length;p--;){var l=y[p][0];if(l.id<C&&!b&&(b=p+1),l.id<=v){f=p+1;break}}return y.slice(f,b)},h.prototype.getChangedRanges=function(v,C){C==null&&(C=this.$rev+1);},h.prototype.getChangedLines=function(v,C){C==null&&(C=this.$rev+1);},h.prototype.undo=function(v,C){this.lastDeltas=null;var y=this.$undoStack;if(L(y,y.length)){v||(v=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var b=y.pop(),f=null;return b&&(f=v.undoChanges(b,C),this.$redoStack.push(b),this.$syncRev()),this.$fromUndo=!1,f}},h.prototype.redo=function(v,C){if(this.lastDeltas=null,v||(v=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var y=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);d(this.$redoStack,y),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(p){p[0].id=++this.$maxRev;},this);}var b=this.$redoStack.pop(),f=null;return b&&(f=v.redoChanges(b,C),this.$undoStack.push(b),this.$syncRev()),this.$fromUndo=!1,f},h.prototype.$syncRev=function(){var v=this.$undoStack,C=v[v.length-1],y=C&&C[0].id||0;this.$redoStackBaseRev=y,this.$rev=y;},h.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[];},h.prototype.canUndo=function(){return this.$undoStack.length>0},h.prototype.canRedo=function(){return this.$redoStack.length>0},h.prototype.bookmark=function(v){v==null&&(v=this.$rev),this.mark=v;},h.prototype.isAtBookmark=function(){return this.$rev===this.mark},h.prototype.toJSON=function(){return {$redoStack:this.$redoStack,$undoStack:this.$undoStack}},h.prototype.fromJSON=function(v){this.reset(),this.$undoStack=v.$undoStack,this.$redoStack=v.$redoStack;},h.prototype.$prettyPrint=function(v){return v?n(v):n(this.$undoStack)+`
211
212
  ---
212
- `+n(this.$redoStack)},h}();R.prototype.hasUndo=R.prototype.canUndo,R.prototype.hasRedo=R.prototype.canRedo,R.prototype.isClean=R.prototype.isAtBookmark,R.prototype.markClean=R.prototype.bookmark;function L(h,v){for(var C=v;C--;){var y=h[C];if(y&&!y[0].ignore){for(;C<v-1;){var b=a(h[C],h[C+1]);h[C]=b[0],h[C+1]=b[1],C++;}return !0}}}var x=k("./range").Range,s=x.comparePoints;x.comparePoints;function e(h){return {row:h.row,column:h.column}}function i(h){return {start:e(h.start),end:e(h.end),action:h.action,lines:h.lines.slice()}}function n(h){if(h=h||this,Array.isArray(h))return h.map(n).join(`
213
- `);var v="";return h.action?(v=h.action=="insert"?"+":"-",v+="["+h.lines+"]"):h.value&&(Array.isArray(h.value)?v=h.value.map(t).join(`
214
- `):v=t(h.value)),h.start&&(v+=t(h)),(h.id||h.rev)&&(v+=" ("+(h.id||h.rev)+")"),v}function t(h){return h.start.row+":"+h.start.column+"=>"+h.end.row+":"+h.end.column}function o(h,v){var C=h.action=="insert",y=v.action=="insert";if(C&&y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.start,h.start)<=0)w(h,v,1);else return null;else if(C&&!y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.end,h.start)<=0)w(h,v,-1);else return null;else if(!C&&y)if(s(v.start,h.start)>=0)w(v,h,1);else if(s(v.start,h.start)<=0)w(h,v,1);else return null;else if(!C&&!y)if(s(v.start,h.start)>=0)w(v,h,1);else if(s(v.end,h.start)<=0)w(h,v,-1);else return null;return [v,h]}function a(h,v){for(var C=h.length;C--;)for(var y=0;y<v.length;y++)if(!o(h[C],v[y])){for(;C<h.length;){for(;y--;)o(v[y],h[C]);y=v.length,C++;}return [h,v]}return h.selectionBefore=v.selectionBefore=h.selectionAfter=v.selectionAfter=null,[v,h]}function u(h,v){var C=h.action=="insert",y=v.action=="insert";if(C&&y)s(h.start,v.start)<0?w(v,h,1):w(h,v,1);else if(C&&!y)s(h.start,v.end)>=0?w(h,v,-1):(s(h.start,v.start)<=0||w(h,x.fromPoints(v.start,h.start),-1),w(v,h,1));else if(!C&&y)s(v.start,h.end)>=0?w(v,h,-1):(s(v.start,h.start)<=0||w(v,x.fromPoints(h.start,v.start),-1),w(h,v,1));else if(!C&&!y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.end,h.start)<=0)w(h,v,-1);else {var b,f;return s(h.start,v.start)<0&&(b=h,h=m(h,v.start)),s(h.end,v.end)>0&&(f=m(h,v.end)),S(v.end,h.start,h.end,-1),f&&!b&&(h.lines=f.lines,h.start=f.start,h.end=f.end,f=h),[v,b,f].filter(Boolean)}return [v,h]}function w(h,v,C){S(h.start,v.start,v.end,C),S(h.end,v.start,v.end,C);}function S(h,v,C,y){h.row==(y==1?v:C).row&&(h.column+=y*(C.column-v.column)),h.row+=y*(C.row-v.row);}function m(h,v){var C=h.lines,y=h.end;h.end=e(v);var b=h.end.row-h.start.row,f=C.splice(b,C.length),p=b?v.column:v.column-h.start.column;C.push(f[0].substring(0,p)),f[0]=f[0].substr(p);var c={start:e(v),end:y,lines:f,action:h.action};return c}function $(h,v){v=i(v);for(var C=h.length;C--;){for(var y=h[C],b=0;b<y.length;b++){var f=y[b],p=u(f,v);v=p[0],p.length!=2&&(p[2]?(y.splice(b+1,1,p[1],p[2]),b++):p[1]||(y.splice(b,1),b--));}y.length||h.splice(C,1);}return h}function d(h,v){for(var C=0;C<v.length;C++)for(var y=v[C],b=0;b<y.length;b++)$(h,y[b]);}M.UndoManager=R;});ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(k,M,H){var R=k("../range").Range,L=function(){function x(s,l){this.foldData=s,Array.isArray(l)?this.folds=l:l=this.folds=[l];var r=l[l.length-1];this.range=new R(l[0].start.row,l[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this);},this);}return x.prototype.shiftRow=function(s){this.start.row+=s,this.end.row+=s,this.folds.forEach(function(l){l.start.row+=s,l.end.row+=s;});},x.prototype.addFold=function(s){if(s.sameRow){if(s.start.row<this.startRow||s.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(s),this.folds.sort(function(l,r){return -l.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(s.start.row,s.start.column)>0?(this.end.row=s.end.row,this.end.column=s.end.column):this.range.compareStart(s.end.row,s.end.column)<0&&(this.start.row=s.start.row,this.start.column=s.start.column);}else if(s.start.row==this.end.row)this.folds.push(s),this.end.row=s.end.row,this.end.column=s.end.column;else if(s.end.row==this.start.row)this.folds.unshift(s),this.start.row=s.start.row,this.start.column=s.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");s.foldLine=this;},x.prototype.containsRow=function(s){return s>=this.start.row&&s<=this.end.row},x.prototype.walk=function(s,l,r){var e=0,i=this.folds,n,t,o,a=!0;l==null&&(l=this.end.row,r=this.end.column);for(var u=0;u<i.length;u++){if(n=i[u],t=n.range.compareStart(l,r),t==-1){s(null,l,r,e,a);return}if(o=s(null,n.start.row,n.start.column,e,a),o=!o&&s(n.placeholder,n.start.row,n.start.column,e),o||t===0)return;a=!n.sameRow,e=n.end.column;}s(null,l,r,e,a);},x.prototype.getNextFoldTo=function(s,l){for(var r,e,i=0;i<this.folds.length;i++){if(r=this.folds[i],e=r.range.compareEnd(s,l),e==-1)return {fold:r,kind:"after"};if(e===0)return {fold:r,kind:"inside"}}return null},x.prototype.addRemoveChars=function(s,l,r){var e=this.getNextFoldTo(s,l),i,n;if(e){if(i=e.fold,e.kind=="inside"&&i.start.column!=l&&i.start.row!=s)window.console&&window.console.log(s,l,i);else if(i.start.row==s){n=this.folds;var t=n.indexOf(i);for(t===0&&(this.start.column+=r),t;t<n.length;t++){if(i=n[t],i.start.column+=r,!i.sameRow)return;i.end.column+=r;}this.end.column+=r;}}},x.prototype.split=function(s,l){var r=this.getNextFoldTo(s,l);if(!r||r.kind=="inside")return null;var e=r.fold,i=this.folds,n=this.foldData,t=i.indexOf(e),o=i[t-1];this.end.row=o.end.row,this.end.column=o.end.column,i=i.splice(t,i.length-t);var a=new x(n,i);return n.splice(n.indexOf(this)+1,0,a),a},x.prototype.merge=function(s){for(var l=s.folds,r=0;r<l.length;r++)this.addFold(l[r]);var e=this.foldData;e.splice(e.indexOf(s),1);},x.prototype.toString=function(){var s=[this.range.toString()+": ["];return this.folds.forEach(function(l){s.push(" "+l.toString());}),s.push("]"),s.join(`
215
- `)},x.prototype.idxToPosition=function(s){for(var l=0,r=0;r<this.folds.length;r++){var e=this.folds[r];if(s-=e.start.column-l,s<0)return {row:e.start.row,column:e.start.column+s};if(s-=e.placeholder.length,s<0)return e.start;l=e.end.column;}return {row:this.end.row,column:this.end.column+s}},x}();M.FoldLine=L;});ace.define("ace/range_list",["require","exports","module","ace/range"],function(k,M,H){var R=k("./range").Range,L=R.comparePoints,x=function(){function s(){this.ranges=[],this.$bias=1;}return s.prototype.pointIndex=function(l,r,e){for(var i=this.ranges,n=e||0;n<i.length;n++){var t=i[n],o=L(l,t.end);if(!(o>0)){var a=L(l,t.start);return o===0?r&&a!==0?-n-2:n:a>0||a===0&&!r?n:-n-1}}return -n-1},s.prototype.add=function(l){var r=!l.isEmpty(),e=this.pointIndex(l.start,r);e<0&&(e=-e-1);var i=this.pointIndex(l.end,r,e);return i<0?i=-i-1:i++,this.ranges.splice(e,i-e,l)},s.prototype.addList=function(l){for(var r=[],e=l.length;e--;)r.push.apply(r,this.add(l[e]));return r},s.prototype.substractPoint=function(l){var r=this.pointIndex(l);if(r>=0)return this.ranges.splice(r,1)},s.prototype.merge=function(){var l=[],r=this.ranges;r=r.sort(function(o,a){return L(o.start,a.start)});for(var e=r[0],i,n=1;n<r.length;n++){i=e,e=r[n];var t=L(i.end,e.start);t<0||t==0&&!i.isEmpty()&&!e.isEmpty()||(L(i.end,e.end)<0&&(i.end.row=e.end.row,i.end.column=e.end.column),r.splice(n,1),l.push(e),e=i,n--);}return this.ranges=r,l},s.prototype.contains=function(l,r){return this.pointIndex({row:l,column:r})>=0},s.prototype.containsPoint=function(l){return this.pointIndex(l)>=0},s.prototype.rangeAtPoint=function(l){var r=this.pointIndex(l);if(r>=0)return this.ranges[r]},s.prototype.clipRows=function(l,r){var e=this.ranges;if(e[0].start.row>r||e[e.length-1].start.row<l)return [];var i=this.pointIndex({row:l,column:0});i<0&&(i=-i-1);var n=this.pointIndex({row:r,column:0},i);n<0&&(n=-n-1);for(var t=[],o=i;o<n;o++)t.push(e[o]);return t},s.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},s.prototype.attach=function(l){this.session&&this.detach(),this.session=l,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange);},s.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null);},s.prototype.$onChange=function(l){for(var r=l.start,e=l.end,i=r.row,n=e.row,t=this.ranges,o=0,a=t.length;o<a;o++){var u=t[o];if(u.end.row>=i)break}if(l.action=="insert")for(var w=n-i,S=-r.column+e.column;o<a;o++){var u=t[o];if(u.start.row>i)break;if(u.start.row==i&&u.start.column>=r.column&&(u.start.column==r.column&&this.$bias<=0||(u.start.column+=S,u.start.row+=w)),u.end.row==i&&u.end.column>=r.column){if(u.end.column==r.column&&this.$bias<0)continue;u.end.column==r.column&&S>0&&o<a-1&&u.end.column>u.start.column&&u.end.column==t[o+1].start.column&&(u.end.column-=S),u.end.column+=S,u.end.row+=w;}}else for(var w=i-n,S=r.column-e.column;o<a;o++){var u=t[o];if(u.start.row>n)break;u.end.row<n&&(i<u.end.row||i==u.end.row&&r.column<u.end.column)?(u.end.row=i,u.end.column=r.column):u.end.row==n?u.end.column<=e.column?(w||u.end.column>r.column)&&(u.end.column=r.column,u.end.row=r.row):(u.end.column+=S,u.end.row+=w):u.end.row>n&&(u.end.row+=w),u.start.row<n&&(i<u.start.row||i==u.start.row&&r.column<u.start.column)?(u.start.row=i,u.start.column=r.column):u.start.row==n?u.start.column<=e.column?(w||u.start.column>r.column)&&(u.start.column=r.column,u.start.row=r.row):(u.start.column+=S,u.start.row+=w):u.start.row>n&&(u.start.row+=w);}if(w!=0&&o<a)for(;o<a;o++){var u=t[o];u.start.row+=w,u.end.row+=w;}},s}();x.prototype.comparePoints=L,M.RangeList=x;});ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(k,M,H){var R=this&&this.__extends||function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a;}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u]);},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function o(){this.constructor=n;}n.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o);}}(),L=k("../range_list").RangeList,x=function(i){R(n,i);function n(t,o){var a=i.call(this)||this;return a.foldLine=null,a.placeholder=o,a.range=t,a.start=t.start,a.end=t.end,a.sameRow=t.start.row==t.end.row,a.subFolds=a.ranges=[],a}return n.prototype.toString=function(){return '"'+this.placeholder+'" '+this.range.toString()},n.prototype.setFoldLine=function(t){this.foldLine=t,this.subFolds.forEach(function(o){o.setFoldLine(t);});},n.prototype.clone=function(){var t=this.range.clone(),o=new n(t,this.placeholder);return this.subFolds.forEach(function(a){o.subFolds.push(a.clone());}),o.collapseChildren=this.collapseChildren,o},n.prototype.addSubFold=function(t){if(!this.range.isEqual(t)){l(t,this.start);for(var S=t.start.row,m=t.start.column,o=0,a=-1;o<this.subFolds.length&&(a=this.subFolds[o].range.compare(S,m),a==1);o++);var u=this.subFolds[o],w=0;if(a==0){if(u.range.containsRange(t))return u.addSubFold(t);w=1;}for(var S=t.range.end.row,m=t.range.end.column,$=o,a=-1;$<this.subFolds.length&&(a=this.subFolds[$].range.compare(S,m),a==1);$++);a==0&&$++;for(var d=this.subFolds.splice(o,$-o,t),h=a==0?d.length-1:d.length,v=w;v<h;v++)t.addSubFold(d[v]);return t.setFoldLine(this.foldLine),t}},n.prototype.restoreRange=function(t){return e(t,this.start)},n}(L);function s(i,n){i.row-=n.row,i.row==0&&(i.column-=n.column);}function l(i,n){s(i.start,n),s(i.end,n);}function r(i,n){i.row==0&&(i.column+=n.column),i.row+=n.row;}function e(i,n){r(i.start,n),r(i.end,n);}M.Fold=x;});ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(k,M,H){var R=k("../range").Range,L=k("./fold_line").FoldLine,x=k("./fold").Fold,s=k("../token_iterator").TokenIterator,l=k("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(e,i,n){var t=this.getFoldLine(e);if(!t)return null;for(var o=t.folds,a=0;a<o.length;a++){var u=o[a].range;if(u.contains(e,i)){if(n==1&&u.isEnd(e,i)&&!u.isEmpty())continue;if(n==-1&&u.isStart(e,i)&&!u.isEmpty())continue;return o[a]}}},this.getFoldsInRange=function(e){var i=e.start,n=e.end,t=this.$foldData,o=[];i.column+=1,n.column-=1;for(var a=0;a<t.length;a++){var u=t[a].range.compareRange(e);if(u!=2){if(u==-2)break;for(var w=t[a].folds,S=0;S<w.length;S++){var m=w[S];if(u=m.range.compareRange(e),u==-2)break;if(u==2)continue;if(u==42)break;o.push(m);}}}return i.column-=1,n.column+=1,o},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var i=[];e.forEach(function(n){i=i.concat(this.getFoldsInRange(n));},this);}else var i=this.getFoldsInRange(e);return i},this.getAllFolds=function(){for(var e=[],i=this.$foldData,n=0;n<i.length;n++)for(var t=0;t<i[n].folds.length;t++)e.push(i[n].folds[t]);return e},this.getFoldStringAt=function(e,i,n,t){if(t=t||this.getFoldLine(e),!t)return null;for(var o={end:{column:0}},a,u,w=0;w<t.folds.length;w++){u=t.folds[w];var S=u.range.compareEnd(e,i);if(S==-1){a=this.getLine(u.start.row).substring(o.end.column,u.start.column);break}else if(S===0)return null;o=u;}return a||(a=this.getLine(u.start.row).substring(o.end.column)),n==-1?a.substring(0,i-o.end.column):n==1?a.substring(i-o.end.column):a},this.getFoldLine=function(e,i){var n=this.$foldData,t=0;for(i&&(t=n.indexOf(i)),t==-1&&(t=0),t;t<n.length;t++){var o=n[t];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,i){var n=this.$foldData,t=0;for(i&&(t=n.indexOf(i)),t==-1&&(t=0),t;t<n.length;t++){var o=n[t];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,i){for(var n=this.$foldData,t=i-e+1,o=0;o<n.length;o++){var a=n[o],u=a.end.row,w=a.start.row;if(u>=i){w<i&&(w>=e?t-=i-w:t=0);break}else u>=e&&(w>=e?t-=u-w:t-=u-e+1);}return t},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(i,n){return i.start.row-n.start.row}),e},this.addFold=function(e,i){var n=this.$foldData,t=!1,o;e instanceof x?o=e:(o=new x(i,e),o.collapseChildren=i.collapseChildren),this.$clipRangeToDocument(o.range);var a=o.start.row,u=o.start.column,w=o.end.row,S=o.end.column,m=this.getFoldAt(a,u,1),$=this.getFoldAt(w,S,-1);if(m&&$==m)return m.addSubFold(o);m&&!m.range.isStart(a,u)&&this.removeFold(m),$&&!$.range.isEnd(w,S)&&this.removeFold($);var d=this.getFoldsInRange(o.range);d.length>0&&(this.removeFolds(d),o.collapseChildren||d.forEach(function(y){o.addSubFold(y);}));for(var h=0;h<n.length;h++){var v=n[h];if(w==v.start.row){v.addFold(o),t=!0;break}else if(a==v.end.row){if(v.addFold(o),t=!0,!o.sameRow){var C=n[h+1];if(C&&C.start.row==w){v.merge(C);break}}break}else if(w<=v.start.row)break}return t||(v=this.$addFoldLine(new L(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(v.start.row,v.start.row):this.$updateRowLengthCache(v.start.row,v.start.row),this.$modified=!0,this._signal("changeFold",{data:o,action:"add"}),o},this.addFolds=function(e){e.forEach(function(i){this.addFold(i);},this);},this.removeFold=function(e){var i=e.foldLine,n=i.start.row,t=i.end.row,o=this.$foldData,a=i.folds;if(a.length==1)o.splice(o.indexOf(i),1);else if(i.range.isEnd(e.end.row,e.end.column))a.pop(),i.end.row=a[a.length-1].end.row,i.end.column=a[a.length-1].end.column;else if(i.range.isStart(e.start.row,e.start.column))a.shift(),i.start.row=a[0].start.row,i.start.column=a[0].start.column;else if(e.sameRow)a.splice(a.indexOf(e),1);else {var u=i.split(e.start.row,e.start.column);a=u.folds,a.shift(),u.start.row=a[0].start.row,u.start.column=a[0].start.column;}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,t):this.$updateRowLengthCache(n,t)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"});},this.removeFolds=function(e){for(var i=[],n=0;n<e.length;n++)i.push(e[n]);i.forEach(function(t){this.removeFold(t);},this),this.$modified=!0;},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(i){e.restoreRange(i),this.addFold(i);},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[];},this.expandFolds=function(e){e.forEach(function(i){this.expandFold(i);},this);},this.unfold=function(e,i){var n,t;if(e==null)n=new R(0,0,this.getLength(),0),i==null&&(i=!0);else if(typeof e=="number")n=new R(e,0,e,this.getLine(e).length);else if("row"in e)n=R.fromPoints(e,e);else {if(Array.isArray(e))return t=[],e.forEach(function(a){t=t.concat(this.unfold(a));},this),t;n=e;}t=this.getFoldsInRangeList(n);for(var o=t;t.length==1&&R.comparePoints(t[0].start,n.start)<0&&R.comparePoints(t[0].end,n.end)>0;)this.expandFolds(t),t=this.getFoldsInRangeList(n);if(i!=!1?this.removeFolds(t):this.expandFolds(t),o.length)return o},this.isRowFolded=function(e,i){return !!this.getFoldLine(e,i)},this.getRowFoldEnd=function(e,i){var n=this.getFoldLine(e,i);return n?n.end.row:e},this.getRowFoldStart=function(e,i){var n=this.getFoldLine(e,i);return n?n.start.row:e},this.getFoldDisplayLine=function(e,i,n,t,o){t==null&&(t=e.start.row),o==null&&(o=0),i==null&&(i=e.end.row),n==null&&(n=this.getLine(i).length);var a=this.doc,u="";return e.walk(function(w,S,m,$){if(!(S<t)){if(S==t){if(m<o)return;$=Math.max(o,$);}w!=null?u+=w:u+=a.getLine(S).substring($,m);}},i,n),u},this.getDisplayLine=function(e,i,n,t){var o=this.getFoldLine(e);if(o)return this.getFoldDisplayLine(o,e,i,n,t);var a;return a=this.doc.getLine(e),a.substring(t||0,i||a.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(i){var n=i.folds.map(function(t){return t.clone()});return new L(e,n)}),e},this.toggleFold=function(e){var i=this.selection,n=i.getRange(),t,o;if(n.isEmpty()){var a=n.start;if(t=this.getFoldAt(a.row,a.column),t){this.expandFold(t);return}else (o=this.findMatchingBracket(a))?n.comparePoint(o)==1?n.end=o:(n.start=o,n.start.column++,n.end.column--):(o=this.findMatchingBracket({row:a.row,column:a.column+1}))?(n.comparePoint(o)==1?n.end=o:n.start=o,n.start.column++):n=this.getCommentFoldRange(a.row,a.column)||n;}else {var u=this.getFoldsInRange(n);if(e&&u.length){this.expandFolds(u);return}else u.length==1&&(t=u[0]);}if(t||(t=this.getFoldAt(n.start.row,n.start.column)),t&&t.range.toString()==n.toString()){this.expandFold(t);return}var w="...";if(!n.isMultiLine()){if(w=this.getTextRange(n),w.length<4)return;w=w.trim().substring(0,2)+"..";}this.addFold(w,n);},this.getCommentFoldRange=function(e,i,n){var t=new s(this,e,i),o=t.getCurrentToken(),a=o&&o.type;if(o&&/^comment|string/.test(a)){a=a.match(/comment|string/)[0],a=="comment"&&(a+="|doc-start|\\.doc");var u=new RegExp(a),w=new R;if(n!=1){do o=t.stepBackward();while(o&&u.test(o.type));o=t.stepForward();}w.start.row=t.getCurrentTokenRow(),w.start.column=t.getCurrentTokenColumn()+o.value.length,t=new s(this,e,i);var S=this.getState(t.$row);if(n!=-1){var m=-1;do if(o=t.stepForward(),m==-1){var $=this.getState(t.$row);S.toString()!==$.toString()&&(m=t.$row);}else if(t.$row>m)break;while(o&&u.test(o.type));o=t.stepBackward();}else o=t.getCurrentToken();return w.end.row=t.getCurrentTokenRow(),w.end.column=t.getCurrentTokenColumn(),w}},this.foldAll=function(e,i,n,t){n==null&&(n=1e5);var o=this.foldWidgets;if(o){i=i||this.getLength(),e=e||0;for(var a=e;a<i;a++)if(o[a]==null&&(o[a]=this.getFoldWidget(a)),o[a]=="start"&&!(t&&!t(a))){var u=this.getFoldWidgetRange(a);u&&u.isMultiLine()&&u.end.row<=i&&u.start.row>=e&&(a=u.end.row,u.collapseChildren=n,this.addFold("...",u));}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1);},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(i){for(var n=e.getTokens(i),t=0;t<n.length;t++){var o=n[t];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(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,e=="manual"&&this.unfold();var i=this.$foldMode;this.$setFolding(null),this.$setFolding(i);}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,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(e,i){var n=this.foldWidgets;if(!n||i&&n[e])return {};for(var t=e-1,o;t>=0;){var a=n[t];if(a==null&&(a=n[t]=this.getFoldWidget(t)),a=="start"){var u=this.getFoldWidgetRange(t);if(o||(o=u),u&&u.end.row>=e)break}t--;}return {range:t!==-1&&u,firstRange:o}},this.onFoldWidgetClick=function(e,i){i instanceof l&&(i=i.domEvent);var n={children:i.shiftKey,all:i.ctrlKey||i.metaKey,siblings:i.altKey},t=this.$toggleFoldWidget(e,n);if(!t){var o=i.target||i.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid");}},this.$toggleFoldWidget=function(e,i){if(this.getFoldWidget){var n=this.getFoldWidget(e),t=this.getLine(e),o=n==="end"?-1:1,a=this.getFoldAt(e,o===-1?0:t.length,o);if(a)return i.children||i.all?this.removeFold(a):this.expandFold(a),a;var u=this.getFoldWidgetRange(e,!0);if(u&&!u.isMultiLine()&&(a=this.getFoldAt(u.start.row,u.start.column,1),a&&u.isEqual(a.range)))return this.removeFold(a),a;if(i.siblings){var w=this.getParentFoldRangeData(e);if(w.range)var S=w.range.start.row+1,m=w.range.end.row;this.foldAll(S,m,i.all?1e4:0);}else i.children?(m=u?u.end.row:this.getLength(),this.foldAll(e+1,m,i.all?1e4:0)):u&&(i.all&&(u.collapseChildren=1e4),this.addFold("...",u));return u}},this.toggleFoldWidget=function(e){var i=this.selection.getCursor().row;i=this.getRowFoldStart(i);var n=this.$toggleFoldWidget(i,{});if(!n){var t=this.getParentFoldRangeData(i,!0);if(n=t.range||t.firstRange,n){i=n.start.row;var o=this.getFoldAt(i,this.getLine(i).length,1);o?this.removeFold(o):this.addFold("...",n);}}},this.updateFoldWidgets=function(e){var i=e.start.row,n=e.end.row-i;if(n===0)this.foldWidgets[i]=null;else if(e.action=="remove")this.foldWidgets.splice(i,n+1,null);else {var t=Array(n+1);t.unshift(i,1),this.foldWidgets.splice.apply(this.foldWidgets,t);}},this.tokenizerUpdateFoldWidgets=function(e){var i=e.data;i.first!=i.last&&this.foldWidgets.length>i.first&&this.foldWidgets.splice(i.first,this.foldWidgets.length);};}M.Folding=r;});ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(k,M,H){var R=k("../token_iterator").TokenIterator,L=k("../range").Range;function x(){this.findMatchingBracket=function(s,l){if(s.column==0)return null;var r=l||this.getLine(s.row).charAt(s.column-1);if(r=="")return null;var e=r.match(/([\(\[\{])|([\)\]\}])/);return e?e[1]?this.$findClosingBracket(e[1],s):this.$findOpeningBracket(e[2],s):null},this.getBracketRange=function(s){var l=this.getLine(s.row),r=!0,e,i=l.charAt(s.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=l.charAt(s.column),s={row:s.row,column:s.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/),r=!1),!n)return null;if(n[1]){var t=this.$findClosingBracket(n[1],s);if(!t)return null;e=L.fromPoints(s,t),r||(e.end.column++,e.start.column--),e.cursor=e.end;}else {var t=this.$findOpeningBracket(n[2],s);if(!t)return null;e=L.fromPoints(t,s),r||(e.start.column++,e.end.column--),e.cursor=e.start;}return e},this.getMatchingBracketRanges=function(s,l){var r=this.getLine(s.row),e=/([\(\[\{])|([\)\]\}])/,i=!l&&r.charAt(s.column-1),n=i&&i.match(e);if(n||(i=(l===void 0||l)&&r.charAt(s.column),s={row:s.row,column:s.column+1},n=i&&i.match(e)),!n)return null;var t=new L(s.row,s.column-1,s.row,s.column),o=n[1]?this.$findClosingBracket(n[1],s):this.$findOpeningBracket(n[2],s);if(!o)return [t];var a=new L(o.row,o.column,o.row,o.column+1);return [t,a]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(s,l,r){var e=this.$brackets[s],i=1,n=new R(this,l.row,l.column),t=n.getCurrentToken();if(t||(t=n.stepForward()),!!t){r||(r=new RegExp("(\\.?"+t.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var o=l.column-n.getCurrentTokenColumn()-2,a=t.value;;){for(;o>=0;){var u=a.charAt(o);if(u==e){if(i-=1,i==0)return {row:n.getCurrentTokenRow(),column:o+n.getCurrentTokenColumn()}}else u==s&&(i+=1);o-=1;}do t=n.stepBackward();while(t&&!r.test(t.type));if(t==null)break;a=t.value,o=a.length-1;}return null}},this.$findClosingBracket=function(s,l,r){var e=this.$brackets[s],i=1,n=new R(this,l.row,l.column),t=n.getCurrentToken();if(t||(t=n.stepForward()),!!t){r||(r=new RegExp("(\\.?"+t.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var o=l.column-n.getCurrentTokenColumn();;){for(var a=t.value,u=a.length;o<u;){var w=a.charAt(o);if(w==e){if(i-=1,i==0)return {row:n.getCurrentTokenRow(),column:o+n.getCurrentTokenColumn()}}else w==s&&(i+=1);o+=1;}do t=n.stepForward();while(t&&!r.test(t.type));if(t==null)break;o=0;}return null}},this.getMatchingTags=function(s){var l=new R(this,s.row,s.column),r=this.$findTagName(l);if(r){var e=l.stepBackward();return e.value==="<"?this.$findClosingTag(l,r):this.$findOpeningTag(l,r)}},this.$findTagName=function(s){var l=s.getCurrentToken(),r=!1,e=!1;if(l&&l.type.indexOf("tag-name")===-1)do e?l=s.stepBackward():l=s.stepForward(),l&&(l.value==="/>"?e=!0:l.type.indexOf("tag-name")!==-1&&(r=!0));while(l&&!r);return l},this.$findClosingTag=function(s,l){var r,e=l.value,i=l.value,n=0,t=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);l=s.stepForward();var o=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+l.value.length),a=!1;do{if(r=l,r.type.indexOf("tag-close")!==-1&&!a){var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);a=!0;}if(l=s.stepForward(),l){if(l.value===">"&&!a){var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);a=!0;}if(l.type.indexOf("tag-name")!==-1){if(e=l.value,i===e){if(r.value==="<")n++;else if(r.value==="</"&&(n--,n<0)){s.stepBackward();var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2);l=s.stepForward();var S=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+l.value.length);if(l.type.indexOf("tag-close")===-1&&(l=s.stepForward()),l&&l.value===">")var m=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);else return}}}else if(i===e&&l.value==="/>"&&(n--,n<0))var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2),S=w,m=S,u=new L(o.end.row,o.end.column,o.end.row,o.end.column+1);}}while(l&&n>=0);if(t&&u&&w&&m&&o&&S)return {openTag:new L(t.start.row,t.start.column,u.end.row,u.end.column),closeTag:new L(w.start.row,w.start.column,m.end.row,m.end.column),openTagName:o,closeTagName:S}},this.$findOpeningTag=function(s,l){var r=s.getCurrentToken(),e=l.value,i=0,n=s.getCurrentTokenRow(),t=s.getCurrentTokenColumn(),o=t+2,a=new L(n,t,n,o);s.stepForward();var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+l.value.length);if(l.type.indexOf("tag-close")===-1&&(l=s.stepForward()),!(!l||l.value!==">")){var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);s.stepBackward(),s.stepBackward();do if(l=r,n=s.getCurrentTokenRow(),t=s.getCurrentTokenColumn(),o=t+l.value.length,r=s.stepBackward(),l){if(l.type.indexOf("tag-name")!==-1){if(e===l.value)if(r.value==="<"){if(i++,i>0){var S=new L(n,t,n,o),m=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);do l=s.stepForward();while(l&&l.value!==">");var $=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);}}else r.value==="</"&&i--;}else if(l.value==="/>"){for(var d=0,h=r;h;){if(h.type.indexOf("tag-name")!==-1&&h.value===e){i--;break}else if(h.value==="<")break;h=s.stepBackward(),d++;}for(var v=0;v<d;v++)s.stepForward();}}while(r&&i<=0);if(m&&$&&a&&w&&S&&u)return {openTag:new L(m.start.row,m.start.column,$.end.row,$.end.column),closeTag:new L(a.start.row,a.start.column,w.end.row,w.end.column),openTagName:S,closeTagName:u}}};}M.BracketMatch=x;});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/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/lang"),x=k("./bidihandler").BidiHandler,s=k("./config"),l=k("./lib/event_emitter").EventEmitter,r=k("./selection").Selection,e=k("./mode/text").Mode,i=k("./range").Range,n=k("./document").Document,t=k("./background_tokenizer").BackgroundTokenizer,o=k("./search_highlight").SearchHighlight,a=k("./undomanager").UndoManager,u=function(){function b(f,p){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++b.$uid,this.$foldData.toString=function(){return this.join(`
216
- `)},this.bgTokenizer=new t(new e().getTokenizer(),this);var c=this;this.bgTokenizer.on("update",function(g){c._signal("tokenizerUpdate",g);}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof f!="object"||!f.getLine)&&(f=new n(f)),this.setDocument(f),this.selection=new r(this),this.$bidiHandler=new x(this),s.resetOptions(this),this.setMode(p),s._signal("session",this),this.destroyed=!1;}return b.prototype.setDocument=function(f){this.doc&&this.doc.off("change",this.$onChange),this.doc=f,f.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches();},b.prototype.getDocument=function(){return this.doc},b.prototype.$resetRowCache=function(f){if(!f){this.$docRowCache=[],this.$screenRowCache=[];return}var p=this.$docRowCache.length,c=this.$getRowCacheIndex(this.$docRowCache,f)+1;p>c&&(this.$docRowCache.splice(c,p),this.$screenRowCache.splice(c,p));},b.prototype.$getRowCacheIndex=function(f,p){for(var c=0,g=f.length-1;c<=g;){var A=c+g>>1,T=f[A];if(p>T)c=A+1;else if(p<T)g=A-1;else return A}return c-1},b.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0);},b.prototype.onChangeFold=function(f){var p=f.data;this.$resetRowCache(p.start.row);},b.prototype.onChange=function(f){this.$modified=!0,this.$bidiHandler.onChange(f),this.$resetRowCache(f.start.row);var p=this.$updateInternalDataOnChange(f);!this.$fromUndo&&this.$undoManager&&(p&&p.length&&(this.$undoManager.add({action:"removeFolds",folds:p},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(f,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(f),this._signal("change",f);},b.prototype.setValue=function(f){this.doc.setValue(f),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset();},b.fromJSON=function(f){typeof f=="string"&&(f=JSON.parse(f));var p=new a;p.$undoStack=f.history.undo,p.$redoStack=f.history.redo,p.mark=f.history.mark,p.$rev=f.history.rev;var c=new b(f.value);return f.folds.forEach(function(g){c.addFold("...",i.fromPoints(g.start,g.end));}),c.setAnnotations(f.annotations),c.setBreakpoints(f.breakpoints),c.setMode(f.mode),c.setScrollLeft(f.scrollLeft),c.setScrollTop(f.scrollTop),c.setUndoManager(p),c.selection.fromJSON(f.selection),c},b.prototype.toJSON=function(){return {annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(f){return f.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},b.prototype.toString=function(){return this.doc.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.getState=function(f){return this.bgTokenizer.getState(f)},b.prototype.getTokens=function(f){return this.bgTokenizer.getTokens(f)},b.prototype.getTokenAt=function(f,p){var c=this.bgTokenizer.getTokens(f),g,A=0;if(p==null){var T=c.length-1;A=this.getLine(f).length;}else for(var T=0;T<c.length&&(A+=c[T].value.length,!(A>=p));T++);return g=c[T],g?(g.index=T,g.start=A-g.value.length,g):null},b.prototype.setUndoManager=function(f){if(this.$undoManager=f,this.$informUndoManager&&this.$informUndoManager.cancel(),f){var p=this;f.addSession(this),this.$syncInformUndoManager=function(){p.$informUndoManager.cancel(),p.mergeUndoDeltas=!1;},this.$informUndoManager=L.delayedCall(this.$syncInformUndoManager);}else this.$syncInformUndoManager=function(){};},b.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager();},b.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},b.prototype.getTabString=function(){return this.getUseSoftTabs()?L.stringRepeat(" ",this.getTabSize()):" "},b.prototype.setUseSoftTabs=function(f){this.setOption("useSoftTabs",f);},b.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},b.prototype.setTabSize=function(f){this.setOption("tabSize",f);},b.prototype.getTabSize=function(){return this.$tabSize},b.prototype.isTabStop=function(f){return this.$useSoftTabs&&f.column%this.$tabSize===0},b.prototype.setNavigateWithinSoftTabs=function(f){this.setOption("navigateWithinSoftTabs",f);},b.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},b.prototype.setOverwrite=function(f){this.setOption("overwrite",f);},b.prototype.getOverwrite=function(){return this.$overwrite},b.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite);},b.prototype.addGutterDecoration=function(f,p){this.$decorations[f]||(this.$decorations[f]=""),this.$decorations[f]+=" "+p,this._signal("changeBreakpoint",{});},b.prototype.removeGutterDecoration=function(f,p){this.$decorations[f]=(this.$decorations[f]||"").replace(" "+p,""),this._signal("changeBreakpoint",{});},b.prototype.getBreakpoints=function(){return this.$breakpoints},b.prototype.setBreakpoints=function(f){this.$breakpoints=[];for(var p=0;p<f.length;p++)this.$breakpoints[f[p]]="ace_breakpoint";this._signal("changeBreakpoint",{});},b.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{});},b.prototype.setBreakpoint=function(f,p){p===void 0&&(p="ace_breakpoint"),p?this.$breakpoints[f]=p:delete this.$breakpoints[f],this._signal("changeBreakpoint",{});},b.prototype.clearBreakpoint=function(f){delete this.$breakpoints[f],this._signal("changeBreakpoint",{});},b.prototype.addMarker=function(f,p,c,g){var A=this.$markerId++,T={range:f,type:c||"line",renderer:typeof c=="function"?c:null,clazz:p,inFront:!!g,id:A};return g?(this.$frontMarkers[A]=T,this._signal("changeFrontMarker")):(this.$backMarkers[A]=T,this._signal("changeBackMarker")),A},b.prototype.addDynamicMarker=function(f,p){if(f.update){var c=this.$markerId++;return f.id=c,f.inFront=!!p,p?(this.$frontMarkers[c]=f,this._signal("changeFrontMarker")):(this.$backMarkers[c]=f,this._signal("changeBackMarker")),f}},b.prototype.removeMarker=function(f){var p=this.$frontMarkers[f]||this.$backMarkers[f];if(p){var c=p.inFront?this.$frontMarkers:this.$backMarkers;delete c[f],this._signal(p.inFront?"changeFrontMarker":"changeBackMarker");}},b.prototype.getMarkers=function(f){return f?this.$frontMarkers:this.$backMarkers},b.prototype.highlight=function(f){if(!this.$searchHighlight){var p=new o(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(p);}this.$searchHighlight.setRegexp(f);},b.prototype.highlightLines=function(f,p,c,g){typeof p!="number"&&(c=p,p=f),c||(c="ace_step");var A=new i(f,0,p,1/0);return A.id=this.addMarker(A,c,"fullLine",g),A},b.prototype.setAnnotations=function(f){this.$annotations=f,this._signal("changeAnnotation",{});},b.prototype.getAnnotations=function(){return this.$annotations||[]},b.prototype.clearAnnotations=function(){this.setAnnotations([]);},b.prototype.$detectNewLine=function(f){var p=f.match(/^.*?(\r?\n)/m);p?this.$autoNewLine=p[1]:this.$autoNewLine=`
217
- `;},b.prototype.getWordRange=function(f,p){var c=this.getLine(f),g=!1;if(p>0&&(g=!!c.charAt(p-1).match(this.tokenRe)),g||(g=!!c.charAt(p).match(this.tokenRe)),g)var A=this.tokenRe;else if(/^\s+$/.test(c.slice(p-1,p+1)))var A=/\s/;else var A=this.nonTokenRe;var T=p;if(T>0){do T--;while(T>=0&&c.charAt(T).match(A));T++;}for(var E=p;E<c.length&&c.charAt(E).match(A);)E++;return new i(f,T,f,E)},b.prototype.getAWordRange=function(f,p){for(var c=this.getWordRange(f,p),g=this.getLine(c.end.row);g.charAt(c.end.column).match(/[ \t]/);)c.end.column+=1;return c},b.prototype.setNewLineMode=function(f){this.doc.setNewLineMode(f);},b.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},b.prototype.setUseWorker=function(f){this.setOption("useWorker",f);},b.prototype.getUseWorker=function(){return this.$useWorker},b.prototype.onReloadTokenizer=function(f){var p=f.data;this.bgTokenizer.start(p.first),this._signal("tokenizerUpdate",f);},b.prototype.setMode=function(f,p){if(f&&typeof f=="object"){if(f.getTokenizer)return this.$onChangeMode(f);var c=f,g=c.path;}else g=f||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new e),this.$modes[g]&&!c){this.$onChangeMode(this.$modes[g]),p&&p();return}this.$modeId=g,s.loadModule(["mode",g],function(A){if(this.$modeId!==g)return p&&p();this.$modes[g]&&!c?this.$onChangeMode(this.$modes[g]):A&&A.Mode&&(A=new A.Mode(c),c||(this.$modes[g]=A,A.$id=g),this.$onChangeMode(A)),p&&p();}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0);},b.prototype.$onChangeMode=function(f,p){if(p||(this.$modeId=f.$id),this.$mode!==f){var c=this.$mode;this.$mode=f,this.$stopWorker(),this.$useWorker&&this.$startWorker();var g=f.getTokenizer();if(g.on!==void 0){var A=this.onReloadTokenizer.bind(this);g.on("update",A);}this.bgTokenizer.setTokenizer(g),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=f.tokenRe,this.nonTokenRe=f.nonTokenRe,p||(f.attachToSession&&f.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(f.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:c,mode:f}));}},b.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null);},b.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this);}catch(f){s.warn("Could not load worker",f),this.$worker=null;}},b.prototype.getMode=function(){return this.$mode},b.prototype.setScrollTop=function(f){this.$scrollTop===f||isNaN(f)||(this.$scrollTop=f,this._signal("changeScrollTop",f));},b.prototype.getScrollTop=function(){return this.$scrollTop},b.prototype.setScrollLeft=function(f){this.$scrollLeft===f||isNaN(f)||(this.$scrollLeft=f,this._signal("changeScrollLeft",f));},b.prototype.getScrollLeft=function(){return this.$scrollLeft},b.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},b.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var f=0;return this.lineWidgets.forEach(function(p){p&&p.screenWidth>f&&(f=p.screenWidth);}),this.lineWidgetWidth=f},b.prototype.$computeWidth=function(f){if(this.$modified||f){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var p=this.doc.getAllLines(),c=this.$rowLengthCache,g=0,A=0,T=this.$foldData[A],E=T?T.start.row:1/0,_=p.length,O=0;O<_;O++){if(O>E){if(O=T.end.row+1,O>=_)break;T=this.$foldData[A++],E=T?T.start.row:1/0;}c[O]==null&&(c[O]=this.$getStringScreenWidth(p[O])[0]),c[O]>g&&(g=c[O]);}this.screenWidth=g;}},b.prototype.getLine=function(f){return this.doc.getLine(f)},b.prototype.getLines=function(f,p){return this.doc.getLines(f,p)},b.prototype.getLength=function(){return this.doc.getLength()},b.prototype.getTextRange=function(f){return this.doc.getTextRange(f||this.selection.getRange())},b.prototype.insert=function(f,p){return this.doc.insert(f,p)},b.prototype.remove=function(f){return this.doc.remove(f)},b.prototype.removeFullLines=function(f,p){return this.doc.removeFullLines(f,p)},b.prototype.undoChanges=function(f,p){if(f.length){this.$fromUndo=!0;for(var c=f.length-1;c!=-1;c--){var g=f[c];g.action=="insert"||g.action=="remove"?this.doc.revertDelta(g):g.folds&&this.addFolds(g.folds);}!p&&this.$undoSelect&&(f.selectionBefore?this.selection.fromJSON(f.selectionBefore):this.selection.setRange(this.$getUndoSelection(f,!0))),this.$fromUndo=!1;}},b.prototype.redoChanges=function(f,p){if(f.length){this.$fromUndo=!0;for(var c=0;c<f.length;c++){var g=f[c];(g.action=="insert"||g.action=="remove")&&this.doc.$safeApplyDelta(g);}!p&&this.$undoSelect&&(f.selectionAfter?this.selection.fromJSON(f.selectionAfter):this.selection.setRange(this.$getUndoSelection(f,!1))),this.$fromUndo=!1;}},b.prototype.setUndoSelect=function(f){this.$undoSelect=f;},b.prototype.$getUndoSelection=function(f,p){function c(_){return p?_.action!=="insert":_.action==="insert"}for(var g,A,T=0;T<f.length;T++){var E=f[T];if(E.start){if(!g){c(E)?g=i.fromPoints(E.start,E.end):g=i.fromPoints(E.start,E.start);continue}c(E)?(A=E.start,g.compare(A.row,A.column)==-1&&g.setStart(A),A=E.end,g.compare(A.row,A.column)==1&&g.setEnd(A)):(A=E.start,g.compare(A.row,A.column)==-1&&(g=i.fromPoints(E.start,E.start)));}}return g},b.prototype.replace=function(f,p){return this.doc.replace(f,p)},b.prototype.moveText=function(f,p,c){var g=this.getTextRange(f),A=this.getFoldsInRange(f),T=i.fromPoints(p,p);if(!c){this.remove(f);var E=f.start.row-f.end.row,_=E?-f.end.column:f.start.column-f.end.column;_&&(T.start.row==f.end.row&&T.start.column>f.end.column&&(T.start.column+=_),T.end.row==f.end.row&&T.end.column>f.end.column&&(T.end.column+=_)),E&&T.start.row>=f.end.row&&(T.start.row+=E,T.end.row+=E);}if(T.end=this.insert(T.start,g),A.length){var O=f.start,I=T.start,E=I.row-O.row,_=I.column-O.column;this.addFolds(A.map(function(D){return D=D.clone(),D.start.row==O.row&&(D.start.column+=_),D.end.row==O.row&&(D.end.column+=_),D.start.row+=E,D.end.row+=E,D}));}return T},b.prototype.indentRows=function(f,p,c){c=c.replace(/\t/g,this.getTabString());for(var g=f;g<=p;g++)this.doc.insertInLine({row:g,column:0},c);},b.prototype.outdentRows=function(f){for(var p=f.collapseRows(),c=new i(0,0,0,0),g=this.getTabSize(),A=p.start.row;A<=p.end.row;++A){var T=this.getLine(A);c.start.row=A,c.end.row=A;for(var E=0;E<g&&T.charAt(E)==" ";++E);E<g&&T.charAt(E)==" "?(c.start.column=E,c.end.column=E+1):(c.start.column=0,c.end.column=E),this.remove(c);}},b.prototype.$moveLines=function(f,p,c){if(f=this.getRowFoldStart(f),p=this.getRowFoldEnd(p),c<0){var g=this.getRowFoldStart(f+c);if(g<0)return 0;var A=g-f;}else if(c>0){var g=this.getRowFoldEnd(p+c);if(g>this.doc.getLength()-1)return 0;var A=g-p;}else {f=this.$clipRowToDocument(f),p=this.$clipRowToDocument(p);var A=p-f+1;}var T=new i(f,0,p,Number.MAX_VALUE),E=this.getFoldsInRange(T).map(function(O){return O=O.clone(),O.start.row+=A,O.end.row+=A,O}),_=c==0?this.doc.getLines(f,p):this.doc.removeFullLines(f,p);return this.doc.insertFullLines(f+A,_),E.length&&this.addFolds(E),A},b.prototype.moveLinesUp=function(f,p){return this.$moveLines(f,p,-1)},b.prototype.moveLinesDown=function(f,p){return this.$moveLines(f,p,1)},b.prototype.duplicateLines=function(f,p){return this.$moveLines(f,p,0)},b.prototype.$clipRowToDocument=function(f){return Math.max(0,Math.min(f,this.doc.getLength()-1))},b.prototype.$clipColumnToRow=function(f,p){return p<0?0:Math.min(this.doc.getLine(f).length,p)},b.prototype.$clipPositionToDocument=function(f,p){if(p=Math.max(0,p),f<0)f=0,p=0;else {var c=this.doc.getLength();f>=c?(f=c-1,p=this.doc.getLine(c-1).length):p=Math.min(this.doc.getLine(f).length,p);}return {row:f,column:p}},b.prototype.$clipRangeToDocument=function(f){f.start.row<0?(f.start.row=0,f.start.column=0):f.start.column=this.$clipColumnToRow(f.start.row,f.start.column);var p=this.doc.getLength()-1;return f.end.row>p?(f.end.row=p,f.end.column=this.doc.getLine(p).length):f.end.column=this.$clipColumnToRow(f.end.row,f.end.column),f},b.prototype.setUseWrapMode=function(f){if(f!=this.$useWrapMode){if(this.$useWrapMode=f,this.$modified=!0,this.$resetRowCache(0),f){var p=this.getLength();this.$wrapData=Array(p),this.$updateWrapData(0,p-1);}this._signal("changeWrapMode");}},b.prototype.getUseWrapMode=function(){return this.$useWrapMode},b.prototype.setWrapLimitRange=function(f,p){(this.$wrapLimitRange.min!==f||this.$wrapLimitRange.max!==p)&&(this.$wrapLimitRange={min:f,max:p},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"));},b.prototype.adjustWrapLimit=function(f,p){var c=this.$wrapLimitRange;c.max<0&&(c={min:p,max:p});var g=this.$constrainWrapLimit(f,c.min,c.max);return g!=this.$wrapLimit&&g>1?(this.$wrapLimit=g,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},b.prototype.$constrainWrapLimit=function(f,p,c){return p&&(f=Math.max(p,f)),c&&(f=Math.min(c,f)),f},b.prototype.getWrapLimit=function(){return this.$wrapLimit},b.prototype.setWrapLimit=function(f){this.setWrapLimitRange(f,f);},b.prototype.getWrapLimitRange=function(){return {min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},b.prototype.$updateInternalDataOnChange=function(f){var p=this.$useWrapMode,c=f.action,g=f.start,A=f.end,T=g.row,E=A.row,_=E-T,O=null;if(this.$updating=!0,_!=0)if(c==="remove"){this[p?"$wrapData":"$rowLengthCache"].splice(T,_);var I=this.$foldData;O=this.getFoldsInRange(f),this.removeFolds(O);var N=this.getFoldLine(A.row),F=0;if(N){N.addRemoveChars(A.row,A.column,g.column-A.column),N.shiftRow(-_);var D=this.getFoldLine(T);D&&D!==N&&(D.merge(N),N=D),F=I.indexOf(N)+1;}for(F;F<I.length;F++){var N=I[F];N.start.row>=A.row&&N.shiftRow(-_);}E=T;}else {var W=Array(_);W.unshift(T,0);var B=p?this.$wrapData:this.$rowLengthCache;B.splice.apply(B,W);var I=this.$foldData,N=this.getFoldLine(T),F=0;if(N){var z=N.range.compareInside(g.row,g.column);z==0?(N=N.split(g.row,g.column),N&&(N.shiftRow(_),N.addRemoveChars(E,0,A.column-g.column))):z==-1&&(N.addRemoveChars(T,0,A.column-g.column),N.shiftRow(_)),F=I.indexOf(N)+1;}for(F;F<I.length;F++){var N=I[F];N.start.row>=T&&N.shiftRow(_);}}else {_=Math.abs(f.start.column-f.end.column),c==="remove"&&(O=this.getFoldsInRange(f),this.removeFolds(O),_=-_);var N=this.getFoldLine(T);N&&N.addRemoveChars(T,g.column,_);}return p&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,p?this.$updateWrapData(T,E):this.$updateRowLengthCache(T,E),O},b.prototype.$updateRowLengthCache=function(f,p){this.$rowLengthCache[f]=null,this.$rowLengthCache[p]=null;},b.prototype.$updateWrapData=function(f,p){var c=this.doc.getAllLines(),g=this.getTabSize(),A=this.$wrapData,T=this.$wrapLimit,E,_,O=f;for(p=Math.min(p,c.length-1);O<=p;)_=this.getFoldLine(O,_),_?(E=[],_.walk(function(I,N,F,D){var W;if(I!=null){W=this.$getDisplayTokens(I,E.length),W[0]=m;for(var B=1;B<W.length;B++)W[B]=$;}else W=this.$getDisplayTokens(c[N].substring(D,F),E.length);E=E.concat(W);}.bind(this),_.end.row,c[_.end.row].length+1),A[_.start.row]=this.$computeWrapSplits(E,T,g),O=_.end.row+1):(E=this.$getDisplayTokens(c[O]),A[O]=this.$computeWrapSplits(E,T,g),O++);},b.prototype.$computeWrapSplits=function(f,p,c){if(f.length==0)return [];var g=[],A=f.length,T=0,E=0,_=this.$wrapAsCode,O=this.$indentedSoftWrap,I=p<=Math.max(2*c,8)||O===!1?0:Math.floor(p/2);function N(){var z=0;if(I===0)return z;if(O)for(var G=0;G<f.length;G++){var U=f[G];if(U==h)z+=1;else if(U==v)z+=c;else {if(U==C)continue;break}}return _&&O!==!1&&(z+=c),Math.min(z,I)}function F(z){for(var G=z-T,U=T;U<z;U++){var V=f[U];(V===12||V===2)&&(G-=1);}g.length||(D=N(),g.indent=D),E+=G,g.push(E),T=z;}for(var D=0;A-T>p-D;){var W=T+p-D;if(f[W-1]>=h&&f[W]>=h){F(W);continue}if(f[W]==m||f[W]==$){for(W;W!=T-1&&f[W]!=m;W--);if(W>T){F(W);continue}for(W=T+p,W;W<f.length&&f[W]==$;W++);if(W==f.length)break;F(W);continue}for(var B=Math.max(W-(p-(p>>2)),T-1);W>B&&f[W]<m;)W--;if(_){for(;W>B&&f[W]<m;)W--;for(;W>B&&f[W]==d;)W--;}else for(;W>B&&f[W]<h;)W--;if(W>B){F(++W);continue}W=T+p,f[W]==S&&W--,F(W-D);}return g},b.prototype.$getDisplayTokens=function(f,p){var c=[],g;p=p||0;for(var A=0;A<f.length;A++){var T=f.charCodeAt(A);if(T==9){g=this.getScreenTabSize(c.length+p),c.push(v);for(var E=1;E<g;E++)c.push(C);}else T==32?c.push(h):T>39&&T<48||T>57&&T<64?c.push(d):T>=4352&&y(T)?c.push(w,S):c.push(w);}return c},b.prototype.$getStringScreenWidth=function(f,p,c){if(p==0)return [0,0];p==null&&(p=1/0),c=c||0;var g,A;for(A=0;A<f.length&&(g=f.charCodeAt(A),g==9?c+=this.getScreenTabSize(c):g>=4352&&y(g)?c+=2:c+=1,!(c>p));A++);return [c,A]},b.prototype.getRowLength=function(f){var p=1;return this.lineWidgets&&(p+=this.lineWidgets[f]&&this.lineWidgets[f].rowCount||0),!this.$useWrapMode||!this.$wrapData[f]?p:this.$wrapData[f].length+p},b.prototype.getRowLineCount=function(f){return !this.$useWrapMode||!this.$wrapData[f]?1:this.$wrapData[f].length+1},b.prototype.getRowWrapIndent=function(f){if(this.$useWrapMode){var p=this.screenToDocumentPosition(f,Number.MAX_VALUE),c=this.$wrapData[p.row];return c.length&&c[0]<p.column?c.indent:0}else return 0},b.prototype.getScreenLastRowColumn=function(f){var p=this.screenToDocumentPosition(f,Number.MAX_VALUE);return this.documentToScreenColumn(p.row,p.column)},b.prototype.getDocumentLastRowColumn=function(f,p){var c=this.documentToScreenRow(f,p);return this.getScreenLastRowColumn(c)},b.prototype.getDocumentLastRowColumnPosition=function(f,p){var c=this.documentToScreenRow(f,p);return this.screenToDocumentPosition(c,Number.MAX_VALUE/10)},b.prototype.getRowSplitData=function(f){if(this.$useWrapMode)return this.$wrapData[f]},b.prototype.getScreenTabSize=function(f){return this.$tabSize-(f%this.$tabSize|0)},b.prototype.screenToDocumentRow=function(f,p){return this.screenToDocumentPosition(f,p).row},b.prototype.screenToDocumentColumn=function(f,p){return this.screenToDocumentPosition(f,p).column},b.prototype.screenToDocumentPosition=function(f,p,c){if(f<0)return {row:0,column:0};var g,A=0,T=0,E,_=0,O=0,I=this.$screenRowCache,N=this.$getRowCacheIndex(I,f),F=I.length;if(F&&N>=0)var _=I[N],A=this.$docRowCache[N],D=f>I[F-1];else var D=!F;for(var W=this.getLength()-1,B=this.getNextFoldLine(A),z=B?B.start.row:1/0;_<=f&&(O=this.getRowLength(A),!(_+O>f||A>=W));)_+=O,A++,A>z&&(A=B.end.row+1,B=this.getNextFoldLine(A,B),z=B?B.start.row:1/0),D&&(this.$docRowCache.push(A),this.$screenRowCache.push(_));if(B&&B.start.row<=A)g=this.getFoldDisplayLine(B),A=B.start.row;else {if(_+O<=f||A>W)return {row:W,column:this.getLine(W).length};g=this.getLine(A),B=null;}var G=0,U=Math.floor(f-_);if(this.$useWrapMode){var V=this.$wrapData[A];V&&(E=V[U],U>0&&V.length&&(G=V.indent,T=V[U-1]||V[V.length-1],g=g.substring(T)));}return c!==void 0&&this.$bidiHandler.isBidiRow(_+U,A,U)&&(p=this.$bidiHandler.offsetToCol(c)),T+=this.$getStringScreenWidth(g,p-G)[1],this.$useWrapMode&&T>=E&&(T=E-1),B?B.idxToPosition(T):{row:A,column:T}},b.prototype.documentToScreenPosition=function(f,p){if(typeof p>"u")var c=this.$clipPositionToDocument(f.row,f.column);else c=this.$clipPositionToDocument(f,p);f=c.row,p=c.column;var g=0,A=null,T=null;T=this.getFoldAt(f,p,1),T&&(f=T.start.row,p=T.start.column);var E,_=0,O=this.$docRowCache,I=this.$getRowCacheIndex(O,f),N=O.length;if(N&&I>=0)var _=O[I],g=this.$screenRowCache[I],F=f>O[N-1];else var F=!N;for(var D=this.getNextFoldLine(_),W=D?D.start.row:1/0;_<f;){if(_>=W){if(E=D.end.row+1,E>f)break;D=this.getNextFoldLine(E,D),W=D?D.start.row:1/0;}else E=_+1;g+=this.getRowLength(_),_=E,F&&(this.$docRowCache.push(_),this.$screenRowCache.push(g));}var B="";D&&_>=W?(B=this.getFoldDisplayLine(D,f,p),A=D.start.row):(B=this.getLine(f).substring(0,p),A=f);var z=0;if(this.$useWrapMode){var G=this.$wrapData[A];if(G){for(var U=0;B.length>=G[U];)g++,U++;B=B.substring(G[U-1]||0,B.length),z=U>0?G.indent:0;}}return this.lineWidgets&&this.lineWidgets[_]&&this.lineWidgets[_].rowsAbove&&(g+=this.lineWidgets[_].rowsAbove),{row:g,column:z+this.$getStringScreenWidth(B)[0]}},b.prototype.documentToScreenColumn=function(f,p){return this.documentToScreenPosition(f,p).column},b.prototype.documentToScreenRow=function(f,p){return this.documentToScreenPosition(f,p).row},b.prototype.getScreenLength=function(){var f=0,p=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,T=0,g=0,p=this.$foldData[g++],E=p?p.start.row:1/0;T<A;){var _=this.$wrapData[T];f+=_?_.length+1:1,T++,T>E&&(T=p.end.row+1,p=this.$foldData[g++],E=p?p.start.row:1/0);}else {f=this.getLength();for(var c=this.$foldData,g=0;g<c.length;g++)p=c[g],f-=p.end.row-p.start.row;}return this.lineWidgets&&(f+=this.$getWidgetScreenLength()),f},b.prototype.$setFontMetrics=function(f){this.$enableVarChar&&(this.$getStringScreenWidth=function(p,c,g){if(c===0)return [0,0];c||(c=1/0),g=g||0;var A,T;for(T=0;T<p.length&&(A=p.charAt(T),A===" "?g+=this.getScreenTabSize(g):g+=f.getCharacterWidth(A),!(g>c));T++);return [g,T]});},b.prototype.getPrecedingCharacter=function(){var f=this.selection.getCursor();if(f.column===0)return f.row===0?"":this.doc.getNewLineCharacter();var p=this.getLine(f.row);return p[f.column-1]},b.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach();},b}();u.$uid=0,u.prototype.$modes=s.$modes,u.prototype.getValue=u.prototype.toString,u.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},u.prototype.$overwrite=!1,u.prototype.$mode=null,u.prototype.$modeId=null,u.prototype.$scrollTop=0,u.prototype.$scrollLeft=0,u.prototype.$wrapLimit=80,u.prototype.$useWrapMode=!1,u.prototype.$wrapLimitRange={min:null,max:null},u.prototype.lineWidgets=null,u.prototype.isFullWidth=y,R.implement(u.prototype,l);var w=1,S=2,m=3,$=4,d=9,h=10,v=11,C=12;function y(b){return b<4352?!1:b>=4352&&b<=4447||b>=4515&&b<=4519||b>=4602&&b<=4607||b>=9001&&b<=9002||b>=11904&&b<=11929||b>=11931&&b<=12019||b>=12032&&b<=12245||b>=12272&&b<=12283||b>=12288&&b<=12350||b>=12353&&b<=12438||b>=12441&&b<=12543||b>=12549&&b<=12589||b>=12593&&b<=12686||b>=12688&&b<=12730||b>=12736&&b<=12771||b>=12784&&b<=12830||b>=12832&&b<=12871||b>=12880&&b<=13054||b>=13056&&b<=19903||b>=19968&&b<=42124||b>=42128&&b<=42182||b>=43360&&b<=43388||b>=44032&&b<=55203||b>=55216&&b<=55238||b>=55243&&b<=55291||b>=63744&&b<=64255||b>=65040&&b<=65049||b>=65072&&b<=65106||b>=65108&&b<=65126||b>=65128&&b<=65131||b>=65281&&b<=65376||b>=65504&&b<=65510}k("./edit_session/folding").Folding.call(u.prototype),k("./edit_session/bracket_match").BracketMatch.call(u.prototype),s.defineOptions(u.prototype,"session",{wrap:{set:function(b){if(!b||b=="off"?b=!1:b=="free"?b=!0:b=="printMargin"?b=-1:typeof b=="string"&&(b=parseInt(b,10)||!1),this.$wrap!=b)if(this.$wrap=b,!b)this.setUseWrapMode(!1);else {var f=typeof b=="number"?b:null;this.setWrapLimitRange(f,f),this.setUseWrapMode(!0);}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(b){b=b=="auto"?this.$mode.type!="text":b!="text",b!=this.$wrapAsCode&&(this.$wrapAsCode=b,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(b){this.$useWorker=b,this.$stopWorker(),b&&this.$startWorker();},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(b){b=parseInt(b),b>0&&this.$tabSize!==b&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=b,this._signal("changeTabSize"));},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(b){this.setFoldStyle(b);},handlesSet:!0},overwrite:{set:function(b){this._signal("changeOverwrite");},initialValue:!1},newLineMode:{set:function(b){this.doc.setNewLineMode(b);},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(b){this.setMode(b);},get:function(){return this.$modeId},handlesSet:!0}}),M.EditSession=u;});ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(k,M,H){var R=k("./lib/lang"),L=k("./lib/oop"),x=k("./range").Range,s=function(){function r(){this.$options={};}return r.prototype.set=function(e){return L.mixin(this.$options,e),this},r.prototype.getOptions=function(){return R.copyObject(this.$options)},r.prototype.setOptions=function(e){this.$options=e;},r.prototype.find=function(e){var i=this.$options,n=this.$matchIterator(e,i);if(!n)return !1;var t=null;return n.forEach(function(o,a,u,w){return t=new x(o,a,u,w),a==w&&i.start&&i.start.start&&i.skipCurrent!=!1&&t.isEqual(i.start)?(t=null,!1):!0}),t},r.prototype.findAll=function(e){var i=this.$options;if(!i.needle)return [];this.$assembleRegExp(i);var n=i.range,t=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],a=i.re;if(i.$isMultiLine){var u=a.length,w=t.length-u,S;e:for(var m=a.offset||0;m<=w;m++){for(var $=0;$<u;$++)if(t[m+$].search(a[$])==-1)continue e;var d=t[m],h=t[m+u-1],v=d.length-d.match(a[0])[0].length,C=h.match(a[u-1])[0].length;S&&S.end.row===m&&S.end.column>v||(o.push(S=new x(m,v,m+u-1,C)),u>2&&(m=m+u-2));}}else for(var y=0;y<t.length;y++)for(var b=R.getMatchOffsets(t[y],a),$=0;$<b.length;$++){var f=b[$];o.push(new x(y,f.offset,y,f.offset+f.length));}if(n){for(var p=n.start.column,c=n.end.column,y=0,$=o.length-1;y<$&&o[y].start.column<p&&o[y].start.row==0;)y++;for(var g=n.end.row-n.start.row;y<$&&o[$].end.column>c&&o[$].end.row==g;)$--;for(o=o.slice(y,$+1),y=0,$=o.length;y<$;y++)o[y].start.row+=n.start.row,o[y].end.row+=n.start.row;}return o},r.prototype.replace=function(e,i){var n=this.$options,t=this.$assembleRegExp(n);if(n.$isMultiLine)return i;if(t){var o=t.exec(e);if(!o||o[0].length!=e.length)return null;if(n.regExp||(i=i.replace(/\$/g,"$$$$")),i=e.replace(t,i),n.preserveCase){i=i.split("");for(var a=Math.min(e.length,e.length);a--;){var u=e[a];u&&u.toLowerCase()!=u?i[a]=i[a].toUpperCase():i[a]=i[a].toLowerCase();}i=i.join("");}return i}},r.prototype.$assembleRegExp=function(e,i){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=R.escapeRegExp(n));var t=e.caseSensitive?"gm":"gmi";try{new RegExp(n,"u"),e.$supportsUnicodeFlag=!0,t+="u";}catch{e.$supportsUnicodeFlag=!1;}if(e.wholeWord&&(n=l(n,e)),e.$isMultiLine=!i&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,t);try{var o=new RegExp(n,t);}catch{o=!1;}return e.re=o},r.prototype.$assembleMultilineRegExp=function(e,i){for(var n=e.replace(/\r\n|\r|\n/g,`$
213
+ `+n(this.$redoStack)},h}();R.prototype.hasUndo=R.prototype.canUndo,R.prototype.hasRedo=R.prototype.canRedo,R.prototype.isClean=R.prototype.isAtBookmark,R.prototype.markClean=R.prototype.bookmark;function L(h,v){for(var C=v;C--;){var y=h[C];if(y&&!y[0].ignore){for(;C<v-1;){var b=a(h[C],h[C+1]);h[C]=b[0],h[C+1]=b[1],C++;}return !0}}}var x=k("./range").Range,s=x.comparePoints;x.comparePoints;function t(h){return {row:h.row,column:h.column}}function i(h){return {start:t(h.start),end:t(h.end),action:h.action,lines:h.lines.slice()}}function n(h){if(h=h||this,Array.isArray(h))return h.map(n).join(`
214
+ `);var v="";return h.action?(v=h.action=="insert"?"+":"-",v+="["+h.lines+"]"):h.value&&(Array.isArray(h.value)?v=h.value.map(e).join(`
215
+ `):v=e(h.value)),h.start&&(v+=e(h)),(h.id||h.rev)&&(v+=" ("+(h.id||h.rev)+")"),v}function e(h){return h.start.row+":"+h.start.column+"=>"+h.end.row+":"+h.end.column}function o(h,v){var C=h.action=="insert",y=v.action=="insert";if(C&&y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.start,h.start)<=0)w(h,v,1);else return null;else if(C&&!y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.end,h.start)<=0)w(h,v,-1);else return null;else if(!C&&y)if(s(v.start,h.start)>=0)w(v,h,1);else if(s(v.start,h.start)<=0)w(h,v,1);else return null;else if(!C&&!y)if(s(v.start,h.start)>=0)w(v,h,1);else if(s(v.end,h.start)<=0)w(h,v,-1);else return null;return [v,h]}function a(h,v){for(var C=h.length;C--;)for(var y=0;y<v.length;y++)if(!o(h[C],v[y])){for(;C<h.length;){for(;y--;)o(v[y],h[C]);y=v.length,C++;}return [h,v]}return h.selectionBefore=v.selectionBefore=h.selectionAfter=v.selectionAfter=null,[v,h]}function u(h,v){var C=h.action=="insert",y=v.action=="insert";if(C&&y)s(h.start,v.start)<0?w(v,h,1):w(h,v,1);else if(C&&!y)s(h.start,v.end)>=0?w(h,v,-1):(s(h.start,v.start)<=0||w(h,x.fromPoints(v.start,h.start),-1),w(v,h,1));else if(!C&&y)s(v.start,h.end)>=0?w(v,h,-1):(s(v.start,h.start)<=0||w(v,x.fromPoints(h.start,v.start),-1),w(h,v,1));else if(!C&&!y)if(s(v.start,h.end)>=0)w(v,h,-1);else if(s(v.end,h.start)<=0)w(h,v,-1);else {var b,f;return s(h.start,v.start)<0&&(b=h,h=m(h,v.start)),s(h.end,v.end)>0&&(f=m(h,v.end)),S(v.end,h.start,h.end,-1),f&&!b&&(h.lines=f.lines,h.start=f.start,h.end=f.end,f=h),[v,b,f].filter(Boolean)}return [v,h]}function w(h,v,C){S(h.start,v.start,v.end,C),S(h.end,v.start,v.end,C);}function S(h,v,C,y){h.row==(y==1?v:C).row&&(h.column+=y*(C.column-v.column)),h.row+=y*(C.row-v.row);}function m(h,v){var C=h.lines,y=h.end;h.end=t(v);var b=h.end.row-h.start.row,f=C.splice(b,C.length),p=b?v.column:v.column-h.start.column;C.push(f[0].substring(0,p)),f[0]=f[0].substr(p);var l={start:t(v),end:y,lines:f,action:h.action};return l}function $(h,v){v=i(v);for(var C=h.length;C--;){for(var y=h[C],b=0;b<y.length;b++){var f=y[b],p=u(f,v);v=p[0],p.length!=2&&(p[2]?(y.splice(b+1,1,p[1],p[2]),b++):p[1]||(y.splice(b,1),b--));}y.length||h.splice(C,1);}return h}function d(h,v){for(var C=0;C<v.length;C++)for(var y=v[C],b=0;b<y.length;b++)$(h,y[b]);}M.UndoManager=R;});ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(k,M,H){var R=k("../range").Range,L=function(){function x(s,c){this.foldData=s,Array.isArray(c)?this.folds=c:c=this.folds=[c];var r=c[c.length-1];this.range=new R(c[0].start.row,c[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this);},this);}return x.prototype.shiftRow=function(s){this.start.row+=s,this.end.row+=s,this.folds.forEach(function(c){c.start.row+=s,c.end.row+=s;});},x.prototype.addFold=function(s){if(s.sameRow){if(s.start.row<this.startRow||s.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(s),this.folds.sort(function(c,r){return -c.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(s.start.row,s.start.column)>0?(this.end.row=s.end.row,this.end.column=s.end.column):this.range.compareStart(s.end.row,s.end.column)<0&&(this.start.row=s.start.row,this.start.column=s.start.column);}else if(s.start.row==this.end.row)this.folds.push(s),this.end.row=s.end.row,this.end.column=s.end.column;else if(s.end.row==this.start.row)this.folds.unshift(s),this.start.row=s.start.row,this.start.column=s.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");s.foldLine=this;},x.prototype.containsRow=function(s){return s>=this.start.row&&s<=this.end.row},x.prototype.walk=function(s,c,r){var t=0,i=this.folds,n,e,o,a=!0;c==null&&(c=this.end.row,r=this.end.column);for(var u=0;u<i.length;u++){if(n=i[u],e=n.range.compareStart(c,r),e==-1){s(null,c,r,t,a);return}if(o=s(null,n.start.row,n.start.column,t,a),o=!o&&s(n.placeholder,n.start.row,n.start.column,t),o||e===0)return;a=!n.sameRow,t=n.end.column;}s(null,c,r,t,a);},x.prototype.getNextFoldTo=function(s,c){for(var r,t,i=0;i<this.folds.length;i++){if(r=this.folds[i],t=r.range.compareEnd(s,c),t==-1)return {fold:r,kind:"after"};if(t===0)return {fold:r,kind:"inside"}}return null},x.prototype.addRemoveChars=function(s,c,r){var t=this.getNextFoldTo(s,c),i,n;if(t){if(i=t.fold,t.kind=="inside"&&i.start.column!=c&&i.start.row!=s)window.console&&window.console.log(s,c,i);else if(i.start.row==s){n=this.folds;var e=n.indexOf(i);for(e===0&&(this.start.column+=r),e;e<n.length;e++){if(i=n[e],i.start.column+=r,!i.sameRow)return;i.end.column+=r;}this.end.column+=r;}}},x.prototype.split=function(s,c){var r=this.getNextFoldTo(s,c);if(!r||r.kind=="inside")return null;var t=r.fold,i=this.folds,n=this.foldData,e=i.indexOf(t),o=i[e-1];this.end.row=o.end.row,this.end.column=o.end.column,i=i.splice(e,i.length-e);var a=new x(n,i);return n.splice(n.indexOf(this)+1,0,a),a},x.prototype.merge=function(s){for(var c=s.folds,r=0;r<c.length;r++)this.addFold(c[r]);var t=this.foldData;t.splice(t.indexOf(s),1);},x.prototype.toString=function(){var s=[this.range.toString()+": ["];return this.folds.forEach(function(c){s.push(" "+c.toString());}),s.push("]"),s.join(`
216
+ `)},x.prototype.idxToPosition=function(s){for(var c=0,r=0;r<this.folds.length;r++){var t=this.folds[r];if(s-=t.start.column-c,s<0)return {row:t.start.row,column:t.start.column+s};if(s-=t.placeholder.length,s<0)return t.start;c=t.end.column;}return {row:this.end.row,column:this.end.column+s}},x}();M.FoldLine=L;});ace.define("ace/range_list",["require","exports","module","ace/range"],function(k,M,H){var R=k("./range").Range,L=R.comparePoints,x=function(){function s(){this.ranges=[],this.$bias=1;}return s.prototype.pointIndex=function(c,r,t){for(var i=this.ranges,n=t||0;n<i.length;n++){var e=i[n],o=L(c,e.end);if(!(o>0)){var a=L(c,e.start);return o===0?r&&a!==0?-n-2:n:a>0||a===0&&!r?n:-n-1}}return -n-1},s.prototype.add=function(c){var r=!c.isEmpty(),t=this.pointIndex(c.start,r);t<0&&(t=-t-1);var i=this.pointIndex(c.end,r,t);return i<0?i=-i-1:i++,this.ranges.splice(t,i-t,c)},s.prototype.addList=function(c){for(var r=[],t=c.length;t--;)r.push.apply(r,this.add(c[t]));return r},s.prototype.substractPoint=function(c){var r=this.pointIndex(c);if(r>=0)return this.ranges.splice(r,1)},s.prototype.merge=function(){var c=[],r=this.ranges;r=r.sort(function(o,a){return L(o.start,a.start)});for(var t=r[0],i,n=1;n<r.length;n++){i=t,t=r[n];var e=L(i.end,t.start);e<0||e==0&&!i.isEmpty()&&!t.isEmpty()||(L(i.end,t.end)<0&&(i.end.row=t.end.row,i.end.column=t.end.column),r.splice(n,1),c.push(t),t=i,n--);}return this.ranges=r,c},s.prototype.contains=function(c,r){return this.pointIndex({row:c,column:r})>=0},s.prototype.containsPoint=function(c){return this.pointIndex(c)>=0},s.prototype.rangeAtPoint=function(c){var r=this.pointIndex(c);if(r>=0)return this.ranges[r]},s.prototype.clipRows=function(c,r){var t=this.ranges;if(t[0].start.row>r||t[t.length-1].start.row<c)return [];var i=this.pointIndex({row:c,column:0});i<0&&(i=-i-1);var n=this.pointIndex({row:r,column:0},i);n<0&&(n=-n-1);for(var e=[],o=i;o<n;o++)e.push(t[o]);return e},s.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},s.prototype.attach=function(c){this.session&&this.detach(),this.session=c,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange);},s.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null);},s.prototype.$onChange=function(c){for(var r=c.start,t=c.end,i=r.row,n=t.row,e=this.ranges,o=0,a=e.length;o<a;o++){var u=e[o];if(u.end.row>=i)break}if(c.action=="insert")for(var w=n-i,S=-r.column+t.column;o<a;o++){var u=e[o];if(u.start.row>i)break;if(u.start.row==i&&u.start.column>=r.column&&(u.start.column==r.column&&this.$bias<=0||(u.start.column+=S,u.start.row+=w)),u.end.row==i&&u.end.column>=r.column){if(u.end.column==r.column&&this.$bias<0)continue;u.end.column==r.column&&S>0&&o<a-1&&u.end.column>u.start.column&&u.end.column==e[o+1].start.column&&(u.end.column-=S),u.end.column+=S,u.end.row+=w;}}else for(var w=i-n,S=r.column-t.column;o<a;o++){var u=e[o];if(u.start.row>n)break;u.end.row<n&&(i<u.end.row||i==u.end.row&&r.column<u.end.column)?(u.end.row=i,u.end.column=r.column):u.end.row==n?u.end.column<=t.column?(w||u.end.column>r.column)&&(u.end.column=r.column,u.end.row=r.row):(u.end.column+=S,u.end.row+=w):u.end.row>n&&(u.end.row+=w),u.start.row<n&&(i<u.start.row||i==u.start.row&&r.column<u.start.column)?(u.start.row=i,u.start.column=r.column):u.start.row==n?u.start.column<=t.column?(w||u.start.column>r.column)&&(u.start.column=r.column,u.start.row=r.row):(u.start.column+=S,u.start.row+=w):u.start.row>n&&(u.start.row+=w);}if(w!=0&&o<a)for(;o<a;o++){var u=e[o];u.start.row+=w,u.end.row+=w;}},s}();x.prototype.comparePoints=L,M.RangeList=x;});ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(k,M,H){var R=this&&this.__extends||function(){var i=function(n,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a;}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u]);},i(n,e)};return function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(n,e);function o(){this.constructor=n;}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o);}}(),L=k("../range_list").RangeList,x=function(i){R(n,i);function n(e,o){var a=i.call(this)||this;return a.foldLine=null,a.placeholder=o,a.range=e,a.start=e.start,a.end=e.end,a.sameRow=e.start.row==e.end.row,a.subFolds=a.ranges=[],a}return n.prototype.toString=function(){return '"'+this.placeholder+'" '+this.range.toString()},n.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(o){o.setFoldLine(e);});},n.prototype.clone=function(){var e=this.range.clone(),o=new n(e,this.placeholder);return this.subFolds.forEach(function(a){o.subFolds.push(a.clone());}),o.collapseChildren=this.collapseChildren,o},n.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){c(e,this.start);for(var S=e.start.row,m=e.start.column,o=0,a=-1;o<this.subFolds.length&&(a=this.subFolds[o].range.compare(S,m),a==1);o++);var u=this.subFolds[o],w=0;if(a==0){if(u.range.containsRange(e))return u.addSubFold(e);w=1;}for(var S=e.range.end.row,m=e.range.end.column,$=o,a=-1;$<this.subFolds.length&&(a=this.subFolds[$].range.compare(S,m),a==1);$++);a==0&&$++;for(var d=this.subFolds.splice(o,$-o,e),h=a==0?d.length-1:d.length,v=w;v<h;v++)e.addSubFold(d[v]);return e.setFoldLine(this.foldLine),e}},n.prototype.restoreRange=function(e){return t(e,this.start)},n}(L);function s(i,n){i.row-=n.row,i.row==0&&(i.column-=n.column);}function c(i,n){s(i.start,n),s(i.end,n);}function r(i,n){i.row==0&&(i.column+=n.column),i.row+=n.row;}function t(i,n){r(i.start,n),r(i.end,n);}M.Fold=x;});ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(k,M,H){var R=k("../range").Range,L=k("./fold_line").FoldLine,x=k("./fold").Fold,s=k("../token_iterator").TokenIterator,c=k("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(t,i,n){var e=this.getFoldLine(t);if(!e)return null;for(var o=e.folds,a=0;a<o.length;a++){var u=o[a].range;if(u.contains(t,i)){if(n==1&&u.isEnd(t,i)&&!u.isEmpty())continue;if(n==-1&&u.isStart(t,i)&&!u.isEmpty())continue;return o[a]}}},this.getFoldsInRange=function(t){var i=t.start,n=t.end,e=this.$foldData,o=[];i.column+=1,n.column-=1;for(var a=0;a<e.length;a++){var u=e[a].range.compareRange(t);if(u!=2){if(u==-2)break;for(var w=e[a].folds,S=0;S<w.length;S++){var m=w[S];if(u=m.range.compareRange(t),u==-2)break;if(u==2)continue;if(u==42)break;o.push(m);}}}return i.column-=1,n.column+=1,o},this.getFoldsInRangeList=function(t){if(Array.isArray(t)){var i=[];t.forEach(function(n){i=i.concat(this.getFoldsInRange(n));},this);}else var i=this.getFoldsInRange(t);return i},this.getAllFolds=function(){for(var t=[],i=this.$foldData,n=0;n<i.length;n++)for(var e=0;e<i[n].folds.length;e++)t.push(i[n].folds[e]);return t},this.getFoldStringAt=function(t,i,n,e){if(e=e||this.getFoldLine(t),!e)return null;for(var o={end:{column:0}},a,u,w=0;w<e.folds.length;w++){u=e.folds[w];var S=u.range.compareEnd(t,i);if(S==-1){a=this.getLine(u.start.row).substring(o.end.column,u.start.column);break}else if(S===0)return null;o=u;}return a||(a=this.getLine(u.start.row).substring(o.end.column)),n==-1?a.substring(0,i-o.end.column):n==1?a.substring(i-o.end.column):a},this.getFoldLine=function(t,i){var n=this.$foldData,e=0;for(i&&(e=n.indexOf(i)),e==-1&&(e=0),e;e<n.length;e++){var o=n[e];if(o.start.row<=t&&o.end.row>=t)return o;if(o.end.row>t)return null}return null},this.getNextFoldLine=function(t,i){var n=this.$foldData,e=0;for(i&&(e=n.indexOf(i)),e==-1&&(e=0),e;e<n.length;e++){var o=n[e];if(o.end.row>=t)return o}return null},this.getFoldedRowCount=function(t,i){for(var n=this.$foldData,e=i-t+1,o=0;o<n.length;o++){var a=n[o],u=a.end.row,w=a.start.row;if(u>=i){w<i&&(w>=t?e-=i-w:e=0);break}else u>=t&&(w>=t?e-=u-w:e-=u-t+1);}return e},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(i,n){return i.start.row-n.start.row}),t},this.addFold=function(t,i){var n=this.$foldData,e=!1,o;t instanceof x?o=t:(o=new x(i,t),o.collapseChildren=i.collapseChildren),this.$clipRangeToDocument(o.range);var a=o.start.row,u=o.start.column,w=o.end.row,S=o.end.column,m=this.getFoldAt(a,u,1),$=this.getFoldAt(w,S,-1);if(m&&$==m)return m.addSubFold(o);m&&!m.range.isStart(a,u)&&this.removeFold(m),$&&!$.range.isEnd(w,S)&&this.removeFold($);var d=this.getFoldsInRange(o.range);d.length>0&&(this.removeFolds(d),o.collapseChildren||d.forEach(function(y){o.addSubFold(y);}));for(var h=0;h<n.length;h++){var v=n[h];if(w==v.start.row){v.addFold(o),e=!0;break}else if(a==v.end.row){if(v.addFold(o),e=!0,!o.sameRow){var C=n[h+1];if(C&&C.start.row==w){v.merge(C);break}}break}else if(w<=v.start.row)break}return e||(v=this.$addFoldLine(new L(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(v.start.row,v.start.row):this.$updateRowLengthCache(v.start.row,v.start.row),this.$modified=!0,this._signal("changeFold",{data:o,action:"add"}),o},this.addFolds=function(t){t.forEach(function(i){this.addFold(i);},this);},this.removeFold=function(t){var i=t.foldLine,n=i.start.row,e=i.end.row,o=this.$foldData,a=i.folds;if(a.length==1)o.splice(o.indexOf(i),1);else if(i.range.isEnd(t.end.row,t.end.column))a.pop(),i.end.row=a[a.length-1].end.row,i.end.column=a[a.length-1].end.column;else if(i.range.isStart(t.start.row,t.start.column))a.shift(),i.start.row=a[0].start.row,i.start.column=a[0].start.column;else if(t.sameRow)a.splice(a.indexOf(t),1);else {var u=i.split(t.start.row,t.start.column);a=u.folds,a.shift(),u.start.row=a[0].start.row,u.start.column=a[0].start.column;}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,e):this.$updateRowLengthCache(n,e)),this.$modified=!0,this._signal("changeFold",{data:t,action:"remove"});},this.removeFolds=function(t){for(var i=[],n=0;n<t.length;n++)i.push(t[n]);i.forEach(function(e){this.removeFold(e);},this),this.$modified=!0;},this.expandFold=function(t){this.removeFold(t),t.subFolds.forEach(function(i){t.restoreRange(i),this.addFold(i);},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(i){this.expandFold(i);},this);},this.unfold=function(t,i){var n,e;if(t==null)n=new R(0,0,this.getLength(),0),i==null&&(i=!0);else if(typeof t=="number")n=new R(t,0,t,this.getLine(t).length);else if("row"in t)n=R.fromPoints(t,t);else {if(Array.isArray(t))return e=[],t.forEach(function(a){e=e.concat(this.unfold(a));},this),e;n=t;}e=this.getFoldsInRangeList(n);for(var o=e;e.length==1&&R.comparePoints(e[0].start,n.start)<0&&R.comparePoints(e[0].end,n.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(n);if(i!=!1?this.removeFolds(e):this.expandFolds(e),o.length)return o},this.isRowFolded=function(t,i){return !!this.getFoldLine(t,i)},this.getRowFoldEnd=function(t,i){var n=this.getFoldLine(t,i);return n?n.end.row:t},this.getRowFoldStart=function(t,i){var n=this.getFoldLine(t,i);return n?n.start.row:t},this.getFoldDisplayLine=function(t,i,n,e,o){e==null&&(e=t.start.row),o==null&&(o=0),i==null&&(i=t.end.row),n==null&&(n=this.getLine(i).length);var a=this.doc,u="";return t.walk(function(w,S,m,$){if(!(S<e)){if(S==e){if(m<o)return;$=Math.max(o,$);}w!=null?u+=w:u+=a.getLine(S).substring($,m);}},i,n),u},this.getDisplayLine=function(t,i,n,e){var o=this.getFoldLine(t);if(o)return this.getFoldDisplayLine(o,t,i,n,e);var a;return a=this.doc.getLine(t),a.substring(e||0,i||a.length)},this.$cloneFoldData=function(){var t=[];return t=this.$foldData.map(function(i){var n=i.folds.map(function(e){return e.clone()});return new L(t,n)}),t},this.toggleFold=function(t){var i=this.selection,n=i.getRange(),e,o;if(n.isEmpty()){var a=n.start;if(e=this.getFoldAt(a.row,a.column),e){this.expandFold(e);return}else (o=this.findMatchingBracket(a))?n.comparePoint(o)==1?n.end=o:(n.start=o,n.start.column++,n.end.column--):(o=this.findMatchingBracket({row:a.row,column:a.column+1}))?(n.comparePoint(o)==1?n.end=o:n.start=o,n.start.column++):n=this.getCommentFoldRange(a.row,a.column)||n;}else {var u=this.getFoldsInRange(n);if(t&&u.length){this.expandFolds(u);return}else u.length==1&&(e=u[0]);}if(e||(e=this.getFoldAt(n.start.row,n.start.column)),e&&e.range.toString()==n.toString()){this.expandFold(e);return}var w="...";if(!n.isMultiLine()){if(w=this.getTextRange(n),w.length<4)return;w=w.trim().substring(0,2)+"..";}this.addFold(w,n);},this.getCommentFoldRange=function(t,i,n){var e=new s(this,t,i),o=e.getCurrentToken(),a=o&&o.type;if(o&&/^comment|string/.test(a)){a=a.match(/comment|string/)[0],a=="comment"&&(a+="|doc-start|\\.doc");var u=new RegExp(a),w=new R;if(n!=1){do o=e.stepBackward();while(o&&u.test(o.type));o=e.stepForward();}w.start.row=e.getCurrentTokenRow(),w.start.column=e.getCurrentTokenColumn()+o.value.length,e=new s(this,t,i);var S=this.getState(e.$row);if(n!=-1){var m=-1;do if(o=e.stepForward(),m==-1){var $=this.getState(e.$row);S.toString()!==$.toString()&&(m=e.$row);}else if(e.$row>m)break;while(o&&u.test(o.type));o=e.stepBackward();}else o=e.getCurrentToken();return w.end.row=e.getCurrentTokenRow(),w.end.column=e.getCurrentTokenColumn(),w}},this.foldAll=function(t,i,n,e){n==null&&(n=1e5);var o=this.foldWidgets;if(o){i=i||this.getLength(),t=t||0;for(var a=t;a<i;a++)if(o[a]==null&&(o[a]=this.getFoldWidget(a)),o[a]=="start"&&!(e&&!e(a))){var u=this.getFoldWidgetRange(a);u&&u.isMultiLine()&&u.end.row<=i&&u.start.row>=t&&(a=u.end.row,u.collapseChildren=n,this.addFold("...",u));}}},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(i){for(var n=t.getTokens(i),e=0;e<n.length;e++){var o=n[e];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 i=this.$foldMode;this.$setFolding(null),this.$setFolding(i);}},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,i){var n=this.foldWidgets;if(!n||i&&n[t])return {};for(var e=t-1,o;e>=0;){var a=n[e];if(a==null&&(a=n[e]=this.getFoldWidget(e)),a=="start"){var u=this.getFoldWidgetRange(e);if(o||(o=u),u&&u.end.row>=t)break}e--;}return {range:e!==-1&&u,firstRange:o}},this.onFoldWidgetClick=function(t,i){i instanceof c&&(i=i.domEvent);var n={children:i.shiftKey,all:i.ctrlKey||i.metaKey,siblings:i.altKey},e=this.$toggleFoldWidget(t,n);if(!e){var o=i.target||i.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid");}},this.$toggleFoldWidget=function(t,i){if(this.getFoldWidget){var n=this.getFoldWidget(t),e=this.getLine(t),o=n==="end"?-1:1,a=this.getFoldAt(t,o===-1?0:e.length,o);if(a)return i.children||i.all?this.removeFold(a):this.expandFold(a),a;var u=this.getFoldWidgetRange(t,!0);if(u&&!u.isMultiLine()&&(a=this.getFoldAt(u.start.row,u.start.column,1),a&&u.isEqual(a.range)))return this.removeFold(a),a;if(i.siblings){var w=this.getParentFoldRangeData(t);if(w.range)var S=w.range.start.row+1,m=w.range.end.row;this.foldAll(S,m,i.all?1e4:0);}else i.children?(m=u?u.end.row:this.getLength(),this.foldAll(t+1,m,i.all?1e4:0)):u&&(i.all&&(u.collapseChildren=1e4),this.addFold("...",u));return u}},this.toggleFoldWidget=function(t){var i=this.selection.getCursor().row;i=this.getRowFoldStart(i);var n=this.$toggleFoldWidget(i,{});if(!n){var e=this.getParentFoldRangeData(i,!0);if(n=e.range||e.firstRange,n){i=n.start.row;var o=this.getFoldAt(i,this.getLine(i).length,1);o?this.removeFold(o):this.addFold("...",n);}}},this.updateFoldWidgets=function(t){var i=t.start.row,n=t.end.row-i;if(n===0)this.foldWidgets[i]=null;else if(t.action=="remove")this.foldWidgets.splice(i,n+1,null);else {var e=Array(n+1);e.unshift(i,1),this.foldWidgets.splice.apply(this.foldWidgets,e);}},this.tokenizerUpdateFoldWidgets=function(t){var i=t.data;i.first!=i.last&&this.foldWidgets.length>i.first&&this.foldWidgets.splice(i.first,this.foldWidgets.length);};}M.Folding=r;});ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(k,M,H){var R=k("../token_iterator").TokenIterator,L=k("../range").Range;function x(){this.findMatchingBracket=function(s,c){if(s.column==0)return null;var r=c||this.getLine(s.row).charAt(s.column-1);if(r=="")return null;var t=r.match(/([\(\[\{])|([\)\]\}])/);return t?t[1]?this.$findClosingBracket(t[1],s):this.$findOpeningBracket(t[2],s):null},this.getBracketRange=function(s){var c=this.getLine(s.row),r=!0,t,i=c.charAt(s.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=c.charAt(s.column),s={row:s.row,column:s.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/),r=!1),!n)return null;if(n[1]){var e=this.$findClosingBracket(n[1],s);if(!e)return null;t=L.fromPoints(s,e),r||(t.end.column++,t.start.column--),t.cursor=t.end;}else {var e=this.$findOpeningBracket(n[2],s);if(!e)return null;t=L.fromPoints(e,s),r||(t.start.column++,t.end.column--),t.cursor=t.start;}return t},this.getMatchingBracketRanges=function(s,c){var r=this.getLine(s.row),t=/([\(\[\{])|([\)\]\}])/,i=!c&&r.charAt(s.column-1),n=i&&i.match(t);if(n||(i=(c===void 0||c)&&r.charAt(s.column),s={row:s.row,column:s.column+1},n=i&&i.match(t)),!n)return null;var e=new L(s.row,s.column-1,s.row,s.column),o=n[1]?this.$findClosingBracket(n[1],s):this.$findOpeningBracket(n[2],s);if(!o)return [e];var a=new L(o.row,o.column,o.row,o.column+1);return [e,a]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(s,c,r){var t=this.$brackets[s],i=1,n=new R(this,c.row,c.column),e=n.getCurrentToken();if(e||(e=n.stepForward()),!!e){r||(r=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var o=c.column-n.getCurrentTokenColumn()-2,a=e.value;;){for(;o>=0;){var u=a.charAt(o);if(u==t){if(i-=1,i==0)return {row:n.getCurrentTokenRow(),column:o+n.getCurrentTokenColumn()}}else u==s&&(i+=1);o-=1;}do e=n.stepBackward();while(e&&!r.test(e.type));if(e==null)break;a=e.value,o=a.length-1;}return null}},this.$findClosingBracket=function(s,c,r){var t=this.$brackets[s],i=1,n=new R(this,c.row,c.column),e=n.getCurrentToken();if(e||(e=n.stepForward()),!!e){r||(r=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var o=c.column-n.getCurrentTokenColumn();;){for(var a=e.value,u=a.length;o<u;){var w=a.charAt(o);if(w==t){if(i-=1,i==0)return {row:n.getCurrentTokenRow(),column:o+n.getCurrentTokenColumn()}}else w==s&&(i+=1);o+=1;}do e=n.stepForward();while(e&&!r.test(e.type));if(e==null)break;o=0;}return null}},this.getMatchingTags=function(s){var c=new R(this,s.row,s.column),r=this.$findTagName(c);if(r){var t=c.stepBackward();return t.value==="<"?this.$findClosingTag(c,r):this.$findOpeningTag(c,r)}},this.$findTagName=function(s){var c=s.getCurrentToken(),r=!1,t=!1;if(c&&c.type.indexOf("tag-name")===-1)do t?c=s.stepBackward():c=s.stepForward(),c&&(c.value==="/>"?t=!0:c.type.indexOf("tag-name")!==-1&&(r=!0));while(c&&!r);return c},this.$findClosingTag=function(s,c){var r,t=c.value,i=c.value,n=0,e=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);c=s.stepForward();var o=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length),a=!1;do{if(r=c,r.type.indexOf("tag-close")!==-1&&!a){var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);a=!0;}if(c=s.stepForward(),c){if(c.value===">"&&!a){var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);a=!0;}if(c.type.indexOf("tag-name")!==-1){if(t=c.value,i===t){if(r.value==="<")n++;else if(r.value==="</"&&(n--,n<0)){s.stepBackward();var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2);c=s.stepForward();var S=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=s.stepForward()),c&&c.value===">")var m=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);else return}}}else if(i===t&&c.value==="/>"&&(n--,n<0))var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+2),S=w,m=S,u=new L(o.end.row,o.end.column,o.end.row,o.end.column+1);}}while(c&&n>=0);if(e&&u&&w&&m&&o&&S)return {openTag:new L(e.start.row,e.start.column,u.end.row,u.end.column),closeTag:new L(w.start.row,w.start.column,m.end.row,m.end.column),openTagName:o,closeTagName:S}},this.$findOpeningTag=function(s,c){var r=s.getCurrentToken(),t=c.value,i=0,n=s.getCurrentTokenRow(),e=s.getCurrentTokenColumn(),o=e+2,a=new L(n,e,n,o);s.stepForward();var u=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+c.value.length);if(c.type.indexOf("tag-close")===-1&&(c=s.stepForward()),!(!c||c.value!==">")){var w=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);s.stepBackward(),s.stepBackward();do if(c=r,n=s.getCurrentTokenRow(),e=s.getCurrentTokenColumn(),o=e+c.value.length,r=s.stepBackward(),c){if(c.type.indexOf("tag-name")!==-1){if(t===c.value)if(r.value==="<"){if(i++,i>0){var S=new L(n,e,n,o),m=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);do c=s.stepForward();while(c&&c.value!==">");var $=new L(s.getCurrentTokenRow(),s.getCurrentTokenColumn(),s.getCurrentTokenRow(),s.getCurrentTokenColumn()+1);}}else r.value==="</"&&i--;}else if(c.value==="/>"){for(var d=0,h=r;h;){if(h.type.indexOf("tag-name")!==-1&&h.value===t){i--;break}else if(h.value==="<")break;h=s.stepBackward(),d++;}for(var v=0;v<d;v++)s.stepForward();}}while(r&&i<=0);if(m&&$&&a&&w&&S&&u)return {openTag:new L(m.start.row,m.start.column,$.end.row,$.end.column),closeTag:new L(a.start.row,a.start.column,w.end.row,w.end.column),openTagName:S,closeTagName:u}}};}M.BracketMatch=x;});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/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/lang"),x=k("./bidihandler").BidiHandler,s=k("./config"),c=k("./lib/event_emitter").EventEmitter,r=k("./selection").Selection,t=k("./mode/text").Mode,i=k("./range").Range,n=k("./document").Document,e=k("./background_tokenizer").BackgroundTokenizer,o=k("./search_highlight").SearchHighlight,a=k("./undomanager").UndoManager,u=function(){function b(f,p){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++b.$uid,this.$foldData.toString=function(){return this.join(`
217
+ `)},this.bgTokenizer=new e(new t().getTokenizer(),this);var l=this;this.bgTokenizer.on("update",function(g){l._signal("tokenizerUpdate",g);}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof f!="object"||!f.getLine)&&(f=new n(f)),this.setDocument(f),this.selection=new r(this),this.$bidiHandler=new x(this),s.resetOptions(this),this.setMode(p),s._signal("session",this),this.destroyed=!1;}return b.prototype.setDocument=function(f){this.doc&&this.doc.off("change",this.$onChange),this.doc=f,f.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches();},b.prototype.getDocument=function(){return this.doc},b.prototype.$resetRowCache=function(f){if(!f){this.$docRowCache=[],this.$screenRowCache=[];return}var p=this.$docRowCache.length,l=this.$getRowCacheIndex(this.$docRowCache,f)+1;p>l&&(this.$docRowCache.splice(l,p),this.$screenRowCache.splice(l,p));},b.prototype.$getRowCacheIndex=function(f,p){for(var l=0,g=f.length-1;l<=g;){var A=l+g>>1,T=f[A];if(p>T)l=A+1;else if(p<T)g=A-1;else return A}return l-1},b.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0);},b.prototype.onChangeFold=function(f){var p=f.data;this.$resetRowCache(p.start.row);},b.prototype.onChange=function(f){this.$modified=!0,this.$bidiHandler.onChange(f),this.$resetRowCache(f.start.row);var p=this.$updateInternalDataOnChange(f);!this.$fromUndo&&this.$undoManager&&(p&&p.length&&(this.$undoManager.add({action:"removeFolds",folds:p},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(f,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(f),this._signal("change",f);},b.prototype.setValue=function(f){this.doc.setValue(f),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset();},b.fromJSON=function(f){typeof f=="string"&&(f=JSON.parse(f));var p=new a;p.$undoStack=f.history.undo,p.$redoStack=f.history.redo,p.mark=f.history.mark,p.$rev=f.history.rev;var l=new b(f.value);return f.folds.forEach(function(g){l.addFold("...",i.fromPoints(g.start,g.end));}),l.setAnnotations(f.annotations),l.setBreakpoints(f.breakpoints),l.setMode(f.mode),l.setScrollLeft(f.scrollLeft),l.setScrollTop(f.scrollTop),l.setUndoManager(p),l.selection.fromJSON(f.selection),l},b.prototype.toJSON=function(){return {annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(f){return f.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},b.prototype.toString=function(){return this.doc.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.getState=function(f){return this.bgTokenizer.getState(f)},b.prototype.getTokens=function(f){return this.bgTokenizer.getTokens(f)},b.prototype.getTokenAt=function(f,p){var l=this.bgTokenizer.getTokens(f),g,A=0;if(p==null){var T=l.length-1;A=this.getLine(f).length;}else for(var T=0;T<l.length&&(A+=l[T].value.length,!(A>=p));T++);return g=l[T],g?(g.index=T,g.start=A-g.value.length,g):null},b.prototype.setUndoManager=function(f){if(this.$undoManager=f,this.$informUndoManager&&this.$informUndoManager.cancel(),f){var p=this;f.addSession(this),this.$syncInformUndoManager=function(){p.$informUndoManager.cancel(),p.mergeUndoDeltas=!1;},this.$informUndoManager=L.delayedCall(this.$syncInformUndoManager);}else this.$syncInformUndoManager=function(){};},b.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager();},b.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},b.prototype.getTabString=function(){return this.getUseSoftTabs()?L.stringRepeat(" ",this.getTabSize()):" "},b.prototype.setUseSoftTabs=function(f){this.setOption("useSoftTabs",f);},b.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},b.prototype.setTabSize=function(f){this.setOption("tabSize",f);},b.prototype.getTabSize=function(){return this.$tabSize},b.prototype.isTabStop=function(f){return this.$useSoftTabs&&f.column%this.$tabSize===0},b.prototype.setNavigateWithinSoftTabs=function(f){this.setOption("navigateWithinSoftTabs",f);},b.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},b.prototype.setOverwrite=function(f){this.setOption("overwrite",f);},b.prototype.getOverwrite=function(){return this.$overwrite},b.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite);},b.prototype.addGutterDecoration=function(f,p){this.$decorations[f]||(this.$decorations[f]=""),this.$decorations[f]+=" "+p,this._signal("changeBreakpoint",{});},b.prototype.removeGutterDecoration=function(f,p){this.$decorations[f]=(this.$decorations[f]||"").replace(" "+p,""),this._signal("changeBreakpoint",{});},b.prototype.getBreakpoints=function(){return this.$breakpoints},b.prototype.setBreakpoints=function(f){this.$breakpoints=[];for(var p=0;p<f.length;p++)this.$breakpoints[f[p]]="ace_breakpoint";this._signal("changeBreakpoint",{});},b.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{});},b.prototype.setBreakpoint=function(f,p){p===void 0&&(p="ace_breakpoint"),p?this.$breakpoints[f]=p:delete this.$breakpoints[f],this._signal("changeBreakpoint",{});},b.prototype.clearBreakpoint=function(f){delete this.$breakpoints[f],this._signal("changeBreakpoint",{});},b.prototype.addMarker=function(f,p,l,g){var A=this.$markerId++,T={range:f,type:l||"line",renderer:typeof l=="function"?l:null,clazz:p,inFront:!!g,id:A};return g?(this.$frontMarkers[A]=T,this._signal("changeFrontMarker")):(this.$backMarkers[A]=T,this._signal("changeBackMarker")),A},b.prototype.addDynamicMarker=function(f,p){if(f.update){var l=this.$markerId++;return f.id=l,f.inFront=!!p,p?(this.$frontMarkers[l]=f,this._signal("changeFrontMarker")):(this.$backMarkers[l]=f,this._signal("changeBackMarker")),f}},b.prototype.removeMarker=function(f){var p=this.$frontMarkers[f]||this.$backMarkers[f];if(p){var l=p.inFront?this.$frontMarkers:this.$backMarkers;delete l[f],this._signal(p.inFront?"changeFrontMarker":"changeBackMarker");}},b.prototype.getMarkers=function(f){return f?this.$frontMarkers:this.$backMarkers},b.prototype.highlight=function(f){if(!this.$searchHighlight){var p=new o(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(p);}this.$searchHighlight.setRegexp(f);},b.prototype.highlightLines=function(f,p,l,g){typeof p!="number"&&(l=p,p=f),l||(l="ace_step");var A=new i(f,0,p,1/0);return A.id=this.addMarker(A,l,"fullLine",g),A},b.prototype.setAnnotations=function(f){this.$annotations=f,this._signal("changeAnnotation",{});},b.prototype.getAnnotations=function(){return this.$annotations||[]},b.prototype.clearAnnotations=function(){this.setAnnotations([]);},b.prototype.$detectNewLine=function(f){var p=f.match(/^.*?(\r?\n)/m);p?this.$autoNewLine=p[1]:this.$autoNewLine=`
218
+ `;},b.prototype.getWordRange=function(f,p){var l=this.getLine(f),g=!1;if(p>0&&(g=!!l.charAt(p-1).match(this.tokenRe)),g||(g=!!l.charAt(p).match(this.tokenRe)),g)var A=this.tokenRe;else if(/^\s+$/.test(l.slice(p-1,p+1)))var A=/\s/;else var A=this.nonTokenRe;var T=p;if(T>0){do T--;while(T>=0&&l.charAt(T).match(A));T++;}for(var E=p;E<l.length&&l.charAt(E).match(A);)E++;return new i(f,T,f,E)},b.prototype.getAWordRange=function(f,p){for(var l=this.getWordRange(f,p),g=this.getLine(l.end.row);g.charAt(l.end.column).match(/[ \t]/);)l.end.column+=1;return l},b.prototype.setNewLineMode=function(f){this.doc.setNewLineMode(f);},b.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},b.prototype.setUseWorker=function(f){this.setOption("useWorker",f);},b.prototype.getUseWorker=function(){return this.$useWorker},b.prototype.onReloadTokenizer=function(f){var p=f.data;this.bgTokenizer.start(p.first),this._signal("tokenizerUpdate",f);},b.prototype.setMode=function(f,p){if(f&&typeof f=="object"){if(f.getTokenizer)return this.$onChangeMode(f);var l=f,g=l.path;}else g=f||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new t),this.$modes[g]&&!l){this.$onChangeMode(this.$modes[g]),p&&p();return}this.$modeId=g,s.loadModule(["mode",g],function(A){if(this.$modeId!==g)return p&&p();this.$modes[g]&&!l?this.$onChangeMode(this.$modes[g]):A&&A.Mode&&(A=new A.Mode(l),l||(this.$modes[g]=A,A.$id=g),this.$onChangeMode(A)),p&&p();}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0);},b.prototype.$onChangeMode=function(f,p){if(p||(this.$modeId=f.$id),this.$mode!==f){var l=this.$mode;this.$mode=f,this.$stopWorker(),this.$useWorker&&this.$startWorker();var g=f.getTokenizer();if(g.on!==void 0){var A=this.onReloadTokenizer.bind(this);g.on("update",A);}this.bgTokenizer.setTokenizer(g),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=f.tokenRe,this.nonTokenRe=f.nonTokenRe,p||(f.attachToSession&&f.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(f.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:l,mode:f}));}},b.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null);},b.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this);}catch(f){s.warn("Could not load worker",f),this.$worker=null;}},b.prototype.getMode=function(){return this.$mode},b.prototype.setScrollTop=function(f){this.$scrollTop===f||isNaN(f)||(this.$scrollTop=f,this._signal("changeScrollTop",f));},b.prototype.getScrollTop=function(){return this.$scrollTop},b.prototype.setScrollLeft=function(f){this.$scrollLeft===f||isNaN(f)||(this.$scrollLeft=f,this._signal("changeScrollLeft",f));},b.prototype.getScrollLeft=function(){return this.$scrollLeft},b.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},b.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var f=0;return this.lineWidgets.forEach(function(p){p&&p.screenWidth>f&&(f=p.screenWidth);}),this.lineWidgetWidth=f},b.prototype.$computeWidth=function(f){if(this.$modified||f){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var p=this.doc.getAllLines(),l=this.$rowLengthCache,g=0,A=0,T=this.$foldData[A],E=T?T.start.row:1/0,_=p.length,O=0;O<_;O++){if(O>E){if(O=T.end.row+1,O>=_)break;T=this.$foldData[A++],E=T?T.start.row:1/0;}l[O]==null&&(l[O]=this.$getStringScreenWidth(p[O])[0]),l[O]>g&&(g=l[O]);}this.screenWidth=g;}},b.prototype.getLine=function(f){return this.doc.getLine(f)},b.prototype.getLines=function(f,p){return this.doc.getLines(f,p)},b.prototype.getLength=function(){return this.doc.getLength()},b.prototype.getTextRange=function(f){return this.doc.getTextRange(f||this.selection.getRange())},b.prototype.insert=function(f,p){return this.doc.insert(f,p)},b.prototype.remove=function(f){return this.doc.remove(f)},b.prototype.removeFullLines=function(f,p){return this.doc.removeFullLines(f,p)},b.prototype.undoChanges=function(f,p){if(f.length){this.$fromUndo=!0;for(var l=f.length-1;l!=-1;l--){var g=f[l];g.action=="insert"||g.action=="remove"?this.doc.revertDelta(g):g.folds&&this.addFolds(g.folds);}!p&&this.$undoSelect&&(f.selectionBefore?this.selection.fromJSON(f.selectionBefore):this.selection.setRange(this.$getUndoSelection(f,!0))),this.$fromUndo=!1;}},b.prototype.redoChanges=function(f,p){if(f.length){this.$fromUndo=!0;for(var l=0;l<f.length;l++){var g=f[l];(g.action=="insert"||g.action=="remove")&&this.doc.$safeApplyDelta(g);}!p&&this.$undoSelect&&(f.selectionAfter?this.selection.fromJSON(f.selectionAfter):this.selection.setRange(this.$getUndoSelection(f,!1))),this.$fromUndo=!1;}},b.prototype.setUndoSelect=function(f){this.$undoSelect=f;},b.prototype.$getUndoSelection=function(f,p){function l(_){return p?_.action!=="insert":_.action==="insert"}for(var g,A,T=0;T<f.length;T++){var E=f[T];if(E.start){if(!g){l(E)?g=i.fromPoints(E.start,E.end):g=i.fromPoints(E.start,E.start);continue}l(E)?(A=E.start,g.compare(A.row,A.column)==-1&&g.setStart(A),A=E.end,g.compare(A.row,A.column)==1&&g.setEnd(A)):(A=E.start,g.compare(A.row,A.column)==-1&&(g=i.fromPoints(E.start,E.start)));}}return g},b.prototype.replace=function(f,p){return this.doc.replace(f,p)},b.prototype.moveText=function(f,p,l){var g=this.getTextRange(f),A=this.getFoldsInRange(f),T=i.fromPoints(p,p);if(!l){this.remove(f);var E=f.start.row-f.end.row,_=E?-f.end.column:f.start.column-f.end.column;_&&(T.start.row==f.end.row&&T.start.column>f.end.column&&(T.start.column+=_),T.end.row==f.end.row&&T.end.column>f.end.column&&(T.end.column+=_)),E&&T.start.row>=f.end.row&&(T.start.row+=E,T.end.row+=E);}if(T.end=this.insert(T.start,g),A.length){var O=f.start,I=T.start,E=I.row-O.row,_=I.column-O.column;this.addFolds(A.map(function(D){return D=D.clone(),D.start.row==O.row&&(D.start.column+=_),D.end.row==O.row&&(D.end.column+=_),D.start.row+=E,D.end.row+=E,D}));}return T},b.prototype.indentRows=function(f,p,l){l=l.replace(/\t/g,this.getTabString());for(var g=f;g<=p;g++)this.doc.insertInLine({row:g,column:0},l);},b.prototype.outdentRows=function(f){for(var p=f.collapseRows(),l=new i(0,0,0,0),g=this.getTabSize(),A=p.start.row;A<=p.end.row;++A){var T=this.getLine(A);l.start.row=A,l.end.row=A;for(var E=0;E<g&&T.charAt(E)==" ";++E);E<g&&T.charAt(E)==" "?(l.start.column=E,l.end.column=E+1):(l.start.column=0,l.end.column=E),this.remove(l);}},b.prototype.$moveLines=function(f,p,l){if(f=this.getRowFoldStart(f),p=this.getRowFoldEnd(p),l<0){var g=this.getRowFoldStart(f+l);if(g<0)return 0;var A=g-f;}else if(l>0){var g=this.getRowFoldEnd(p+l);if(g>this.doc.getLength()-1)return 0;var A=g-p;}else {f=this.$clipRowToDocument(f),p=this.$clipRowToDocument(p);var A=p-f+1;}var T=new i(f,0,p,Number.MAX_VALUE),E=this.getFoldsInRange(T).map(function(O){return O=O.clone(),O.start.row+=A,O.end.row+=A,O}),_=l==0?this.doc.getLines(f,p):this.doc.removeFullLines(f,p);return this.doc.insertFullLines(f+A,_),E.length&&this.addFolds(E),A},b.prototype.moveLinesUp=function(f,p){return this.$moveLines(f,p,-1)},b.prototype.moveLinesDown=function(f,p){return this.$moveLines(f,p,1)},b.prototype.duplicateLines=function(f,p){return this.$moveLines(f,p,0)},b.prototype.$clipRowToDocument=function(f){return Math.max(0,Math.min(f,this.doc.getLength()-1))},b.prototype.$clipColumnToRow=function(f,p){return p<0?0:Math.min(this.doc.getLine(f).length,p)},b.prototype.$clipPositionToDocument=function(f,p){if(p=Math.max(0,p),f<0)f=0,p=0;else {var l=this.doc.getLength();f>=l?(f=l-1,p=this.doc.getLine(l-1).length):p=Math.min(this.doc.getLine(f).length,p);}return {row:f,column:p}},b.prototype.$clipRangeToDocument=function(f){f.start.row<0?(f.start.row=0,f.start.column=0):f.start.column=this.$clipColumnToRow(f.start.row,f.start.column);var p=this.doc.getLength()-1;return f.end.row>p?(f.end.row=p,f.end.column=this.doc.getLine(p).length):f.end.column=this.$clipColumnToRow(f.end.row,f.end.column),f},b.prototype.setUseWrapMode=function(f){if(f!=this.$useWrapMode){if(this.$useWrapMode=f,this.$modified=!0,this.$resetRowCache(0),f){var p=this.getLength();this.$wrapData=Array(p),this.$updateWrapData(0,p-1);}this._signal("changeWrapMode");}},b.prototype.getUseWrapMode=function(){return this.$useWrapMode},b.prototype.setWrapLimitRange=function(f,p){(this.$wrapLimitRange.min!==f||this.$wrapLimitRange.max!==p)&&(this.$wrapLimitRange={min:f,max:p},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"));},b.prototype.adjustWrapLimit=function(f,p){var l=this.$wrapLimitRange;l.max<0&&(l={min:p,max:p});var g=this.$constrainWrapLimit(f,l.min,l.max);return g!=this.$wrapLimit&&g>1?(this.$wrapLimit=g,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},b.prototype.$constrainWrapLimit=function(f,p,l){return p&&(f=Math.max(p,f)),l&&(f=Math.min(l,f)),f},b.prototype.getWrapLimit=function(){return this.$wrapLimit},b.prototype.setWrapLimit=function(f){this.setWrapLimitRange(f,f);},b.prototype.getWrapLimitRange=function(){return {min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},b.prototype.$updateInternalDataOnChange=function(f){var p=this.$useWrapMode,l=f.action,g=f.start,A=f.end,T=g.row,E=A.row,_=E-T,O=null;if(this.$updating=!0,_!=0)if(l==="remove"){this[p?"$wrapData":"$rowLengthCache"].splice(T,_);var I=this.$foldData;O=this.getFoldsInRange(f),this.removeFolds(O);var N=this.getFoldLine(A.row),F=0;if(N){N.addRemoveChars(A.row,A.column,g.column-A.column),N.shiftRow(-_);var D=this.getFoldLine(T);D&&D!==N&&(D.merge(N),N=D),F=I.indexOf(N)+1;}for(F;F<I.length;F++){var N=I[F];N.start.row>=A.row&&N.shiftRow(-_);}E=T;}else {var W=Array(_);W.unshift(T,0);var B=p?this.$wrapData:this.$rowLengthCache;B.splice.apply(B,W);var I=this.$foldData,N=this.getFoldLine(T),F=0;if(N){var z=N.range.compareInside(g.row,g.column);z==0?(N=N.split(g.row,g.column),N&&(N.shiftRow(_),N.addRemoveChars(E,0,A.column-g.column))):z==-1&&(N.addRemoveChars(T,0,A.column-g.column),N.shiftRow(_)),F=I.indexOf(N)+1;}for(F;F<I.length;F++){var N=I[F];N.start.row>=T&&N.shiftRow(_);}}else {_=Math.abs(f.start.column-f.end.column),l==="remove"&&(O=this.getFoldsInRange(f),this.removeFolds(O),_=-_);var N=this.getFoldLine(T);N&&N.addRemoveChars(T,g.column,_);}return p&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,p?this.$updateWrapData(T,E):this.$updateRowLengthCache(T,E),O},b.prototype.$updateRowLengthCache=function(f,p){this.$rowLengthCache[f]=null,this.$rowLengthCache[p]=null;},b.prototype.$updateWrapData=function(f,p){var l=this.doc.getAllLines(),g=this.getTabSize(),A=this.$wrapData,T=this.$wrapLimit,E,_,O=f;for(p=Math.min(p,l.length-1);O<=p;)_=this.getFoldLine(O,_),_?(E=[],_.walk(function(I,N,F,D){var W;if(I!=null){W=this.$getDisplayTokens(I,E.length),W[0]=m;for(var B=1;B<W.length;B++)W[B]=$;}else W=this.$getDisplayTokens(l[N].substring(D,F),E.length);E=E.concat(W);}.bind(this),_.end.row,l[_.end.row].length+1),A[_.start.row]=this.$computeWrapSplits(E,T,g),O=_.end.row+1):(E=this.$getDisplayTokens(l[O]),A[O]=this.$computeWrapSplits(E,T,g),O++);},b.prototype.$computeWrapSplits=function(f,p,l){if(f.length==0)return [];var g=[],A=f.length,T=0,E=0,_=this.$wrapAsCode,O=this.$indentedSoftWrap,I=p<=Math.max(2*l,8)||O===!1?0:Math.floor(p/2);function N(){var z=0;if(I===0)return z;if(O)for(var G=0;G<f.length;G++){var U=f[G];if(U==h)z+=1;else if(U==v)z+=l;else {if(U==C)continue;break}}return _&&O!==!1&&(z+=l),Math.min(z,I)}function F(z){for(var G=z-T,U=T;U<z;U++){var V=f[U];(V===12||V===2)&&(G-=1);}g.length||(D=N(),g.indent=D),E+=G,g.push(E),T=z;}for(var D=0;A-T>p-D;){var W=T+p-D;if(f[W-1]>=h&&f[W]>=h){F(W);continue}if(f[W]==m||f[W]==$){for(W;W!=T-1&&f[W]!=m;W--);if(W>T){F(W);continue}for(W=T+p,W;W<f.length&&f[W]==$;W++);if(W==f.length)break;F(W);continue}for(var B=Math.max(W-(p-(p>>2)),T-1);W>B&&f[W]<m;)W--;if(_){for(;W>B&&f[W]<m;)W--;for(;W>B&&f[W]==d;)W--;}else for(;W>B&&f[W]<h;)W--;if(W>B){F(++W);continue}W=T+p,f[W]==S&&W--,F(W-D);}return g},b.prototype.$getDisplayTokens=function(f,p){var l=[],g;p=p||0;for(var A=0;A<f.length;A++){var T=f.charCodeAt(A);if(T==9){g=this.getScreenTabSize(l.length+p),l.push(v);for(var E=1;E<g;E++)l.push(C);}else T==32?l.push(h):T>39&&T<48||T>57&&T<64?l.push(d):T>=4352&&y(T)?l.push(w,S):l.push(w);}return l},b.prototype.$getStringScreenWidth=function(f,p,l){if(p==0)return [0,0];p==null&&(p=1/0),l=l||0;var g,A;for(A=0;A<f.length&&(g=f.charCodeAt(A),g==9?l+=this.getScreenTabSize(l):g>=4352&&y(g)?l+=2:l+=1,!(l>p));A++);return [l,A]},b.prototype.getRowLength=function(f){var p=1;return this.lineWidgets&&(p+=this.lineWidgets[f]&&this.lineWidgets[f].rowCount||0),!this.$useWrapMode||!this.$wrapData[f]?p:this.$wrapData[f].length+p},b.prototype.getRowLineCount=function(f){return !this.$useWrapMode||!this.$wrapData[f]?1:this.$wrapData[f].length+1},b.prototype.getRowWrapIndent=function(f){if(this.$useWrapMode){var p=this.screenToDocumentPosition(f,Number.MAX_VALUE),l=this.$wrapData[p.row];return l.length&&l[0]<p.column?l.indent:0}else return 0},b.prototype.getScreenLastRowColumn=function(f){var p=this.screenToDocumentPosition(f,Number.MAX_VALUE);return this.documentToScreenColumn(p.row,p.column)},b.prototype.getDocumentLastRowColumn=function(f,p){var l=this.documentToScreenRow(f,p);return this.getScreenLastRowColumn(l)},b.prototype.getDocumentLastRowColumnPosition=function(f,p){var l=this.documentToScreenRow(f,p);return this.screenToDocumentPosition(l,Number.MAX_VALUE/10)},b.prototype.getRowSplitData=function(f){if(this.$useWrapMode)return this.$wrapData[f]},b.prototype.getScreenTabSize=function(f){return this.$tabSize-(f%this.$tabSize|0)},b.prototype.screenToDocumentRow=function(f,p){return this.screenToDocumentPosition(f,p).row},b.prototype.screenToDocumentColumn=function(f,p){return this.screenToDocumentPosition(f,p).column},b.prototype.screenToDocumentPosition=function(f,p,l){if(f<0)return {row:0,column:0};var g,A=0,T=0,E,_=0,O=0,I=this.$screenRowCache,N=this.$getRowCacheIndex(I,f),F=I.length;if(F&&N>=0)var _=I[N],A=this.$docRowCache[N],D=f>I[F-1];else var D=!F;for(var W=this.getLength()-1,B=this.getNextFoldLine(A),z=B?B.start.row:1/0;_<=f&&(O=this.getRowLength(A),!(_+O>f||A>=W));)_+=O,A++,A>z&&(A=B.end.row+1,B=this.getNextFoldLine(A,B),z=B?B.start.row:1/0),D&&(this.$docRowCache.push(A),this.$screenRowCache.push(_));if(B&&B.start.row<=A)g=this.getFoldDisplayLine(B),A=B.start.row;else {if(_+O<=f||A>W)return {row:W,column:this.getLine(W).length};g=this.getLine(A),B=null;}var G=0,U=Math.floor(f-_);if(this.$useWrapMode){var V=this.$wrapData[A];V&&(E=V[U],U>0&&V.length&&(G=V.indent,T=V[U-1]||V[V.length-1],g=g.substring(T)));}return l!==void 0&&this.$bidiHandler.isBidiRow(_+U,A,U)&&(p=this.$bidiHandler.offsetToCol(l)),T+=this.$getStringScreenWidth(g,p-G)[1],this.$useWrapMode&&T>=E&&(T=E-1),B?B.idxToPosition(T):{row:A,column:T}},b.prototype.documentToScreenPosition=function(f,p){if(typeof p>"u")var l=this.$clipPositionToDocument(f.row,f.column);else l=this.$clipPositionToDocument(f,p);f=l.row,p=l.column;var g=0,A=null,T=null;T=this.getFoldAt(f,p,1),T&&(f=T.start.row,p=T.start.column);var E,_=0,O=this.$docRowCache,I=this.$getRowCacheIndex(O,f),N=O.length;if(N&&I>=0)var _=O[I],g=this.$screenRowCache[I],F=f>O[N-1];else var F=!N;for(var D=this.getNextFoldLine(_),W=D?D.start.row:1/0;_<f;){if(_>=W){if(E=D.end.row+1,E>f)break;D=this.getNextFoldLine(E,D),W=D?D.start.row:1/0;}else E=_+1;g+=this.getRowLength(_),_=E,F&&(this.$docRowCache.push(_),this.$screenRowCache.push(g));}var B="";D&&_>=W?(B=this.getFoldDisplayLine(D,f,p),A=D.start.row):(B=this.getLine(f).substring(0,p),A=f);var z=0;if(this.$useWrapMode){var G=this.$wrapData[A];if(G){for(var U=0;B.length>=G[U];)g++,U++;B=B.substring(G[U-1]||0,B.length),z=U>0?G.indent:0;}}return this.lineWidgets&&this.lineWidgets[_]&&this.lineWidgets[_].rowsAbove&&(g+=this.lineWidgets[_].rowsAbove),{row:g,column:z+this.$getStringScreenWidth(B)[0]}},b.prototype.documentToScreenColumn=function(f,p){return this.documentToScreenPosition(f,p).column},b.prototype.documentToScreenRow=function(f,p){return this.documentToScreenPosition(f,p).row},b.prototype.getScreenLength=function(){var f=0,p=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,T=0,g=0,p=this.$foldData[g++],E=p?p.start.row:1/0;T<A;){var _=this.$wrapData[T];f+=_?_.length+1:1,T++,T>E&&(T=p.end.row+1,p=this.$foldData[g++],E=p?p.start.row:1/0);}else {f=this.getLength();for(var l=this.$foldData,g=0;g<l.length;g++)p=l[g],f-=p.end.row-p.start.row;}return this.lineWidgets&&(f+=this.$getWidgetScreenLength()),f},b.prototype.$setFontMetrics=function(f){this.$enableVarChar&&(this.$getStringScreenWidth=function(p,l,g){if(l===0)return [0,0];l||(l=1/0),g=g||0;var A,T;for(T=0;T<p.length&&(A=p.charAt(T),A===" "?g+=this.getScreenTabSize(g):g+=f.getCharacterWidth(A),!(g>l));T++);return [g,T]});},b.prototype.getPrecedingCharacter=function(){var f=this.selection.getCursor();if(f.column===0)return f.row===0?"":this.doc.getNewLineCharacter();var p=this.getLine(f.row);return p[f.column-1]},b.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach();},b}();u.$uid=0,u.prototype.$modes=s.$modes,u.prototype.getValue=u.prototype.toString,u.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},u.prototype.$overwrite=!1,u.prototype.$mode=null,u.prototype.$modeId=null,u.prototype.$scrollTop=0,u.prototype.$scrollLeft=0,u.prototype.$wrapLimit=80,u.prototype.$useWrapMode=!1,u.prototype.$wrapLimitRange={min:null,max:null},u.prototype.lineWidgets=null,u.prototype.isFullWidth=y,R.implement(u.prototype,c);var w=1,S=2,m=3,$=4,d=9,h=10,v=11,C=12;function y(b){return b<4352?!1:b>=4352&&b<=4447||b>=4515&&b<=4519||b>=4602&&b<=4607||b>=9001&&b<=9002||b>=11904&&b<=11929||b>=11931&&b<=12019||b>=12032&&b<=12245||b>=12272&&b<=12283||b>=12288&&b<=12350||b>=12353&&b<=12438||b>=12441&&b<=12543||b>=12549&&b<=12589||b>=12593&&b<=12686||b>=12688&&b<=12730||b>=12736&&b<=12771||b>=12784&&b<=12830||b>=12832&&b<=12871||b>=12880&&b<=13054||b>=13056&&b<=19903||b>=19968&&b<=42124||b>=42128&&b<=42182||b>=43360&&b<=43388||b>=44032&&b<=55203||b>=55216&&b<=55238||b>=55243&&b<=55291||b>=63744&&b<=64255||b>=65040&&b<=65049||b>=65072&&b<=65106||b>=65108&&b<=65126||b>=65128&&b<=65131||b>=65281&&b<=65376||b>=65504&&b<=65510}k("./edit_session/folding").Folding.call(u.prototype),k("./edit_session/bracket_match").BracketMatch.call(u.prototype),s.defineOptions(u.prototype,"session",{wrap:{set:function(b){if(!b||b=="off"?b=!1:b=="free"?b=!0:b=="printMargin"?b=-1:typeof b=="string"&&(b=parseInt(b,10)||!1),this.$wrap!=b)if(this.$wrap=b,!b)this.setUseWrapMode(!1);else {var f=typeof b=="number"?b:null;this.setWrapLimitRange(f,f),this.setUseWrapMode(!0);}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(b){b=b=="auto"?this.$mode.type!="text":b!="text",b!=this.$wrapAsCode&&(this.$wrapAsCode=b,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(b){this.$useWorker=b,this.$stopWorker(),b&&this.$startWorker();},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(b){b=parseInt(b),b>0&&this.$tabSize!==b&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=b,this._signal("changeTabSize"));},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(b){this.setFoldStyle(b);},handlesSet:!0},overwrite:{set:function(b){this._signal("changeOverwrite");},initialValue:!1},newLineMode:{set:function(b){this.doc.setNewLineMode(b);},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(b){this.setMode(b);},get:function(){return this.$modeId},handlesSet:!0}}),M.EditSession=u;});ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(k,M,H){var R=k("./lib/lang"),L=k("./lib/oop"),x=k("./range").Range,s=function(){function r(){this.$options={};}return r.prototype.set=function(t){return L.mixin(this.$options,t),this},r.prototype.getOptions=function(){return R.copyObject(this.$options)},r.prototype.setOptions=function(t){this.$options=t;},r.prototype.find=function(t){var i=this.$options,n=this.$matchIterator(t,i);if(!n)return !1;var e=null;return n.forEach(function(o,a,u,w){return e=new x(o,a,u,w),a==w&&i.start&&i.start.start&&i.skipCurrent!=!1&&e.isEqual(i.start)?(e=null,!1):!0}),e},r.prototype.findAll=function(t){var i=this.$options;if(!i.needle)return [];this.$assembleRegExp(i);var n=i.range,e=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),o=[],a=i.re;if(i.$isMultiLine){var u=a.length,w=e.length-u,S;e:for(var m=a.offset||0;m<=w;m++){for(var $=0;$<u;$++)if(e[m+$].search(a[$])==-1)continue e;var d=e[m],h=e[m+u-1],v=d.length-d.match(a[0])[0].length,C=h.match(a[u-1])[0].length;S&&S.end.row===m&&S.end.column>v||(o.push(S=new x(m,v,m+u-1,C)),u>2&&(m=m+u-2));}}else for(var y=0;y<e.length;y++)for(var b=R.getMatchOffsets(e[y],a),$=0;$<b.length;$++){var f=b[$];o.push(new x(y,f.offset,y,f.offset+f.length));}if(n){for(var p=n.start.column,l=n.end.column,y=0,$=o.length-1;y<$&&o[y].start.column<p&&o[y].start.row==0;)y++;for(var g=n.end.row-n.start.row;y<$&&o[$].end.column>l&&o[$].end.row==g;)$--;for(o=o.slice(y,$+1),y=0,$=o.length;y<$;y++)o[y].start.row+=n.start.row,o[y].end.row+=n.start.row;}return o},r.prototype.replace=function(t,i){var n=this.$options,e=this.$assembleRegExp(n);if(n.$isMultiLine)return i;if(e){var o=e.exec(t);if(!o||o[0].length!=t.length)return null;if(n.regExp||(i=i.replace(/\$/g,"$$$$")),i=t.replace(e,i),n.preserveCase){i=i.split("");for(var a=Math.min(t.length,t.length);a--;){var u=t[a];u&&u.toLowerCase()!=u?i[a]=i[a].toUpperCase():i[a]=i[a].toLowerCase();}i=i.join("");}return i}},r.prototype.$assembleRegExp=function(t,i){if(t.needle instanceof RegExp)return t.re=t.needle;var n=t.needle;if(!t.needle)return t.re=!1;t.regExp||(n=R.escapeRegExp(n));var e=t.caseSensitive?"gm":"gmi";try{new RegExp(n,"u"),t.$supportsUnicodeFlag=!0,e+="u";}catch{t.$supportsUnicodeFlag=!1;}if(t.wholeWord&&(n=c(n,t)),t.$isMultiLine=!i&&/[\n\r]/.test(n),t.$isMultiLine)return t.re=this.$assembleMultilineRegExp(n,e);try{var o=new RegExp(n,e);}catch{o=!1;}return t.re=o},r.prototype.$assembleMultilineRegExp=function(t,i){for(var n=t.replace(/\r\n|\r|\n/g,`$
218
219
  ^`).split(`
219
- `),t=[],o=0;o<n.length;o++)try{t.push(new RegExp(n[o],i));}catch{return !1}return t},r.prototype.$matchIterator=function(e,i){var n=this.$assembleRegExp(i);if(!n)return !1;var t=i.backwards==!0,o=i.skipCurrent!=!1,a=n.unicode,u=i.range,w=i.start;w||(w=u?u[t?"end":"start"]:e.selection.getRange()),w.start&&(w=w[o!=t?"end":"start"]);var S=u?u.start.row:0,m=u?u.end.row:e.getLength()-1;if(t)var $=function(v){var C=w.row;if(!h(C,w.column,v)){for(C--;C>=S;C--)if(h(C,Number.MAX_VALUE,v))return;if(i.wrap!=!1){for(C=m,S=w.row;C>=S;C--)if(h(C,Number.MAX_VALUE,v))return}}};else var $=function(C){var y=w.row;if(!h(y,w.column,C)){for(y=y+1;y<=m;y++)if(h(y,0,C))return;if(i.wrap!=!1){for(y=S,m=w.row;y<=m;y++)if(h(y,0,C))return}}};if(i.$isMultiLine)var d=n.length,h=function(v,C,y){var b=t?v-d+1:v;if(!(b<0||b+d>e.getLength())){var f=e.getLine(b),p=f.search(n[0]);if(!(!t&&p<C||p===-1)){for(var c=1;c<d;c++)if(f=e.getLine(b+c),f.search(n[c])==-1)return;var g=f.match(n[d-1])[0].length;if(!(t&&g>C)&&y(b,p,b+d-1,g))return !0}}};else if(t)var h=function(C,y,b){var f=e.getLine(C),p=[],c,g=0;for(n.lastIndex=0;c=n.exec(f);){var A=c[0].length;if(g=c.index,!A){if(g>=f.length)break;n.lastIndex=g+=R.skipEmptyMatch(f,g,a);}if(c.index+A>y)break;p.push(c.index,A);}for(var T=p.length-1;T>=0;T-=2){var E=p[T-1],A=p[T];if(b(C,E,C,E+A))return !0}};else var h=function(C,y,b){var f=e.getLine(C),p,c;for(n.lastIndex=y;c=n.exec(f);){var g=c[0].length;if(p=c.index,b(C,p,C,p+g))return !0;if(!g&&(n.lastIndex=p+=R.skipEmptyMatch(f,p,a),p>=f.length))return !1}};return {forEach:$}},r}();function l(r,e){var i=R.supportsLookbehind();function n(u,w){w===void 0&&(w=!0);var S=i&&e.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return S.test(u)||e.regExp?i&&e.$supportsUnicodeFlag?w?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var t=Array.from(r),o=t[0],a=t[t.length-1];return n(o)+r+n(a,!1)}M.Search=s;});ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,M,H){var R=this&&this.__extends||function(){var i=function(n,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a;}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u]);},i(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(n,t);function o(){this.constructor=n;}n.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o);}}(),L=k("../lib/keys"),x=k("../lib/useragent"),s=L.KEY_MODS,l=function(){function i(n,t){this.$init(n,t,!1);}return i.prototype.$init=function(n,t,o){this.platform=t||(x.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(n),this.$singleCommand=o;},i.prototype.addCommand=function(n){this.commands[n.name]&&this.removeCommand(n),this.commands[n.name]=n,n.bindKey&&this._buildKeyHash(n);},i.prototype.removeCommand=function(n,t){var o=n&&(typeof n=="string"?n:n.name);n=this.commands[o],t||delete this.commands[o];var a=this.commandKeyBinding;for(var u in a){var w=a[u];if(w==n)delete a[u];else if(Array.isArray(w)){var S=w.indexOf(n);S!=-1&&(w.splice(S,1),w.length==1&&(a[u]=w[0]));}}},i.prototype.bindKey=function(n,t,o){if(typeof n=="object"&&n&&(o==null&&(o=n.position),n=n[this.platform]),!!n){if(typeof t=="function")return this.addCommand({exec:t,bindKey:n,name:t.name||n});n.split("|").forEach(function(a){var u="";if(a.indexOf(" ")!=-1){var w=a.split(/\s+/);a=w.pop(),w.forEach(function($){var d=this.parseKeys($),h=s[d.hashId]+d.key;u+=(u?" ":"")+h,this._addCommandToBinding(u,"chainKeys");},this),u+=" ";}var S=this.parseKeys(a),m=s[S.hashId]+S.key;this._addCommandToBinding(u+m,t,o);},this);}},i.prototype._addCommandToBinding=function(n,t,o){var a=this.commandKeyBinding,u;if(!t)delete a[n];else if(!a[n]||this.$singleCommand)a[n]=t;else {Array.isArray(a[n])?(u=a[n].indexOf(t))!=-1&&a[n].splice(u,1):a[n]=[a[n]],typeof o!="number"&&(o=r(t));var w=a[n];for(u=0;u<w.length;u++){var S=w[u],m=r(S);if(m>o)break}w.splice(u,0,t);}},i.prototype.addCommands=function(n){n&&Object.keys(n).forEach(function(t){var o=n[t];if(o){if(typeof o=="string")return this.bindKey(o,t);typeof o=="function"&&(o={exec:o}),typeof o=="object"&&(o.name||(o.name=t),this.addCommand(o));}},this);},i.prototype.removeCommands=function(n){Object.keys(n).forEach(function(t){this.removeCommand(n[t]);},this);},i.prototype.bindKeys=function(n){Object.keys(n).forEach(function(t){this.bindKey(t,n[t]);},this);},i.prototype._buildKeyHash=function(n){this.bindKey(n.bindKey,n);},i.prototype.parseKeys=function(n){var t=n.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(m){return m}),o=t.pop(),a=L[o];if(L.FUNCTION_KEYS[a])o=L.FUNCTION_KEYS[a].toLowerCase();else if(t.length){if(t.length==1&&t[0]=="shift")return {key:o.toUpperCase(),hashId:-1}}else return {key:o,hashId:-1};for(var u=0,w=t.length;w--;){var S=L.KEY_MODS[t[w]];if(S==null)return typeof console<"u"&&console.error("invalid modifier "+t[w]+" in "+n),!1;u|=S;}return {key:o,hashId:u}},i.prototype.findKeyCommand=function(n,t){var o=s[n]+t;return this.commandKeyBinding[o]},i.prototype.handleKeyboard=function(n,t,o,a){if(!(a<0)){var u=s[t]+o,w=this.commandKeyBinding[u];return n.$keyChain&&(n.$keyChain+=" "+u,w=this.commandKeyBinding[n.$keyChain]||w),w&&(w=="chainKeys"||w[w.length-1]=="chainKeys")?(n.$keyChain=n.$keyChain||u,{command:"null"}):(n.$keyChain&&((!t||t==4)&&o.length==1?n.$keyChain=n.$keyChain.slice(0,-u.length-1):(t==-1||a>0)&&(n.$keyChain="")),{command:w})}},i.prototype.getStatusText=function(n,t){return t.$keyChain||""},i}();function r(i){return typeof i=="object"&&i.bindKey&&i.bindKey.position||(i.isDefault?-100:0)}var e=function(i){R(n,i);function n(t,o){var a=i.call(this,t,o)||this;return a.$singleCommand=!0,a}return n}(l);e.call=function(i,n,t){l.prototype.$init.call(i,n,t,!0);},l.call=function(i,n,t){l.prototype.$init.call(i,n,t,!1);},M.HashHandler=e,M.MultiHashHandler=l;});ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var r=function(e,i){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t;}||function(n,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);},r(e,i)};return function(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");r(e,i);function n(){this.constructor=e;}e.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n);}}(),L=k("../lib/oop"),x=k("../keyboard/hash_handler").MultiHashHandler,s=k("../lib/event_emitter").EventEmitter,l=function(r){R(e,r);function e(i,n){var t=r.call(this,n,i)||this;return t.byName=t.commands,t.setDefaultHandler("exec",function(o){return o.args?o.command.exec(o.editor,o.args,o.event,!1):o.command.exec(o.editor,{},o.event,!0)}),t}return e.prototype.exec=function(i,n,t){if(Array.isArray(i)){for(var o=i.length;o--;)if(this.exec(i[o],n,t))return !0;return !1}if(typeof i=="string"&&(i=this.commands[i]),!this.canExecute(i,n))return !1;var a={editor:n,command:i,args:t};return a.returnValue=this._emit("exec",a),this._signal("afterExec",a),a.returnValue!==!1},e.prototype.canExecute=function(i,n){return typeof i=="string"&&(i=this.commands[i]),!(!i||n&&n.$readOnly&&!i.readOnly||this.$checkCommandState!=!1&&i.isAvailable&&!i.isAvailable(n))},e.prototype.toggleRecording=function(i){if(!this.$inReplay)return i&&i._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(n){this.macro.push([n.command,n.args]);}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},e.prototype.replay=function(i){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(i);try{this.$inReplay=!0,this.macro.forEach(function(n){typeof n=="string"?this.exec(n,i):this.exec(n[0],i,n[1]);},this);}finally{this.$inReplay=!1;}}},e.prototype.trimMacro=function(i){return i.map(function(n){return typeof n[0]!="string"&&(n[0]=n[0].name),n[1]||(n=n[0]),n})},e}(x);L.implement(l.prototype,s),M.CommandManager=l;});ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(k,M,H){var R=k("../lib/lang"),L=k("../config"),x=k("../range").Range;function s(r,e){return {win:r,mac:e}}M.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(r){L.loadModule("ace/ext/settings_menu",function(e){e.init(r),r.showSettingsMenu();});},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(e){e.showErrorMarker(r,1);});},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(e){e.showErrorMarker(r,-1);});},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(r){r.selectAll();},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(r){r.centerSelection();},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(r,e){typeof e=="number"&&!isNaN(e)&&r.gotoLine(e),r.prompt({$type:"gotoLine"});},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.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(r){r.session.toggleFold(!0);},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(r){r.session.toggleFoldWidget();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0);},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll();},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments();},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges());},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold();},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(r){r.findNext();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext();},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious();},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(e){e.Search(r);});},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite();},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.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(r){r.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(r){r.getSelection().selectUp();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(r,e){r.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(r){r.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(r){r.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(r){r.getSelection().selectDown();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(r,e){r.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(r){r.getSelection().selectWordLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(r){r.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(r){r.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(r){r.navigateLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(r,e){r.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(r){r.getSelection().selectWordRight();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(r){r.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(r){r.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(r){r.navigateLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(r,e){r.navigateRight(e.times);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown();},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(r){r.scrollPageDown();},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown();},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp();},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(r){r.scrollPageUp();},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp();},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight);},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight);},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r);},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r);},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching();},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0);},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.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(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var e=r.$copyWithEmptySelection&&r.selection.isEmpty(),i=e?r.selection.getLineRange():r.selection.getRange();r._emit("cut",i),i.isEmpty()||r.session.remove(i),r.clearSelection();},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,e){r.$handlePaste(e);},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(r){r.removeLines();},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection();},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines();},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1);},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1);},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(e){e.Search(r,!0);});}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(r){r.undo();}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo();}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp();},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp();},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown();},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown();},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right");},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left");},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return !1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(r){var e=r.selection.getRange();e.start.column=0,r.session.remove(e);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(r){var e=r.selection.getRange();e.end.column=Number.MAX_VALUE,r.session.remove(e);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(r){r.indent();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,e){r.insert(e);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,e){r.insert(R.stringRepeat(e.text||"",e.times||1));},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(r){r.splitLine();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters();},multiSelectAction:function(r){r.transposeSelections(1);},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(r){r.autoIndent();},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var e=r.selection.getRange();e.start.column=e.end.column=0,e.end.row++,r.selection.setRange(e,!1);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(r){r.openLink();}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(r){for(var e=r.selection.isBackwards(),i=e?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),n=e?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),t=r.session.doc.getLine(i.row).length,o=r.session.doc.getTextRange(r.selection.getRange()),a=o.replace(/\n\s*/," ").length,u=r.session.doc.getLine(i.row),w=i.row+1;w<=n.row+1;w++){var S=R.stringTrimLeft(R.stringTrimRight(r.session.doc.getLine(w)));S.length!==0&&(S=" "+S),u+=S;}n.row+1<r.session.doc.getLength()-1&&(u+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new x(i.row,0,n.row+2,0),u),a>0?(r.selection.moveCursorTo(i.row,i.column),r.selection.selectTo(i.row,i.column+a)):(t=r.session.doc.getLine(i.row).length>t?t+1:t,r.selection.moveCursorTo(i.row,t));},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(r){var e=r.session.doc.getLength()-1,i=r.session.doc.getLine(e).length,n=r.selection.rangeList.ranges,t=[];n.length<1&&(n=[r.selection.getRange()]);for(var o=0;o<n.length;o++)o==n.length-1&&(n[o].end.row===e&&n[o].end.column===i||t.push(new x(n[o].end.row,n[o].end.column,e,i))),o===0?n[o].start.row===0&&n[o].start.column===0||t.push(new x(0,0,n[o].start.row,n[o].start.column)):t.push(new x(n[o-1].end.row,n[o-1].end.column,n[o].start.row,n[o].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var o=0;o<t.length;o++)r.selection.addRange(t[o],!1);},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
220
- `);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var e=r.getCursorPosition();r.selection.moveTo(e.row-1,Number.MAX_VALUE),r.insert(`
221
- `),e.row===0&&r.navigateUp();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"});},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(r){r.prompt({$type:"commands"});},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(r){r.prompt({$type:"modes"});},readOnly:!0}];for(var l=1;l<9;l++)M.commands.push({name:"foldToLevel"+l,description:"Fold To Level "+l,level:l,exec:function(r){r.session.foldToLevel(this.level);},scrollIntoView:"center",readOnly:!0});});ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("./lib/dom"),L=function(){function x(s){this.session=s,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);}return x.prototype.getRowLength=function(s){var l;return this.lineWidgets?l=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0:l=0,!this.$useWrapMode||!this.$wrapData[s]?1+l:this.$wrapData[s].length+1+l},x.prototype.$getWidgetScreenLength=function(){var s=0;return this.lineWidgets.forEach(function(l){l&&l.rowCount&&!l.hidden&&(s+=l.rowCount);}),s},x.prototype.$onChangeEditor=function(s){this.attach(s.editor);},x.prototype.attach=function(s){s&&s.widgetManager&&s.widgetManager!=this&&s.widgetManager.detach(),this.editor!=s&&(this.detach(),this.editor=s,s&&(s.widgetManager=this,s.renderer.on("beforeRender",this.measureWidgets),s.renderer.on("afterRender",this.renderWidgets)));},x.prototype.detach=function(s){var l=this.editor;if(l){this.editor=null,l.widgetManager=null,l.renderer.off("beforeRender",this.measureWidgets),l.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el));});}},x.prototype.updateOnFold=function(s,l){var r=l.lineWidgets;if(!(!r||!s.action)){for(var e=s.data,i=e.start.row,n=e.end.row,t=s.action=="add",o=i+1;o<n;o++)r[o]&&(r[o].hidden=t);r[n]&&(t?r[i]?r[n].hidden=t:r[i]=r[n]:(r[i]==r[n]&&(r[i]=void 0),r[n].hidden=t));}},x.prototype.updateOnChange=function(s){var l=this.session.lineWidgets;if(l){var r=s.start.row,e=s.end.row-r;if(e!==0)if(s.action=="remove"){var i=l.splice(r+1,e);!l[r]&&i[i.length-1]&&(l[r]=i.pop()),i.forEach(function(t){t&&this.removeLineWidget(t);},this),this.$updateRows();}else {var n=new Array(e);l[r]&&l[r].column!=null&&s.start.column>l[r].column&&r++,n.unshift(r,0),l.splice.apply(l,n),this.$updateRows();}}},x.prototype.$updateRows=function(){var s=this.session.lineWidgets;if(s){var l=!0;s.forEach(function(r,e){if(r)for(l=!1,r.row=e;r.$oldWidget;)r.$oldWidget.row=e,r=r.$oldWidget;}),l&&(this.session.lineWidgets=null);}},x.prototype.$registerLineWidget=function(s){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var l=this.session.lineWidgets[s.row];return l&&(s.$oldWidget=l,l.el&&l.el.parentNode&&(l.el.parentNode.removeChild(l.el),l._inDocument=!1)),this.session.lineWidgets[s.row]=s,s},x.prototype.addLineWidget=function(s){if(this.$registerLineWidget(s),s.session=this.session,!this.editor)return s;var l=this.editor.renderer;s.html&&!s.el&&(s.el=R.createElement("div"),s.el.innerHTML=s.html),s.text&&!s.el&&(s.el=R.createElement("div"),s.el.textContent=s.text),s.el&&(R.addCssClass(s.el,"ace_lineWidgetContainer"),s.className&&R.addCssClass(s.el,s.className),s.el.style.position="absolute",s.el.style.zIndex="5",l.container.appendChild(s.el),s._inDocument=!0,s.coverGutter||(s.el.style.zIndex="3"),s.pixelHeight==null&&(s.pixelHeight=s.el.offsetHeight)),s.rowCount==null&&(s.rowCount=s.pixelHeight/l.layerConfig.lineHeight);var r=this.session.getFoldAt(s.row,0);if(s.$fold=r,r){var e=this.session.lineWidgets;s.row==r.end.row&&!e[r.start.row]?e[r.start.row]=s:s.hidden=!0;}return this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows(),this.renderWidgets(null,l),this.onWidgetChanged(s),s},x.prototype.removeLineWidget=function(s){if(s._inDocument=!1,s.session=null,s.el&&s.el.parentNode&&s.el.parentNode.removeChild(s.el),s.editor&&s.editor.destroy)try{s.editor.destroy();}catch{}if(this.session.lineWidgets){var l=this.session.lineWidgets[s.row];if(l==s)this.session.lineWidgets[s.row]=s.$oldWidget,s.$oldWidget&&this.onWidgetChanged(s.$oldWidget);else for(;l;){if(l.$oldWidget==s){l.$oldWidget=s.$oldWidget;break}l=l.$oldWidget;}}this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows();},x.prototype.getWidgetsAtRow=function(s){for(var l=this.session.lineWidgets,r=l&&l[s],e=[];r;)e.push(r),r=r.$oldWidget;return e},x.prototype.onWidgetChanged=function(s){this.session._changedWidgets.push(s),this.editor&&this.editor.renderer.updateFull();},x.prototype.measureWidgets=function(s,l){var r=this.session._changedWidgets,e=l.layerConfig;if(!(!r||!r.length)){for(var i=1/0,n=0;n<r.length;n++){var t=r[n];if(!(!t||!t.el)&&t.session==this.session){if(!t._inDocument){if(this.session.lineWidgets[t.row]!=t)continue;t._inDocument=!0,l.container.appendChild(t.el);}t.h=t.el.offsetHeight,t.fixedWidth||(t.w=t.el.offsetWidth,t.screenWidth=Math.ceil(t.w/e.characterWidth));var o=t.h/e.lineHeight;t.coverLine&&(o-=this.session.getRowLineCount(t.row),o<0&&(o=0)),t.rowCount!=o&&(t.rowCount=o,t.row<i&&(i=t.row));}}i!=1/0&&(this.session._emit("changeFold",{data:{start:{row:i}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[];}},x.prototype.renderWidgets=function(s,l){var r=l.layerConfig,e=this.session.lineWidgets;if(e){for(var i=Math.min(this.firstRow,r.firstRow),n=Math.max(this.lastRow,r.lastRow,e.length);i>0&&!e[i];)i--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,l.$cursorLayer.config=r;for(var t=i;t<=n;t++){var o=e[t];if(!(!o||!o.el)){if(o.hidden){o.el.style.top=-100-(o.pixelHeight||0)+"px";continue}o._inDocument||(o._inDocument=!0,l.container.appendChild(o.el));var a=l.$cursorLayer.getPixelPosition({row:t,column:0},!0).top;o.coverLine||(a+=r.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=a-r.offset+"px";var u=o.coverGutter?0:l.gutterWidth;o.fixedWidth||(u-=l.scrollLeft),o.el.style.left=u+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=r.width+2*r.padding+"px"),o.fixedWidth?o.el.style.right=l.scrollBar.getWidth()+"px":o.el.style.right="";}}}},x}();M.LineWidgets=L;});ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(k,M,H){var R=k("../lib/keys"),L=k("../mouse/default_gutter_handler").GutterTooltip,x=function(){function l(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new L(this.editor);}return l.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this));},l.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this));},l.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===R.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=R.enter)return;r.preventDefault();var e=this.editor.getCursorPosition().row;this.editor.isRowVisible(e)||this.editor.scrollToLine(e,!0,!0),setTimeout(function(){var i=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),n=this.$findNearestFoldWidget(i),t=this.$findNearestAnnotation(i);if(!(n===null&&t===null)){if(n===null&&t!==null){this.activeRowIndex=t,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(n!==null&&t===null){this.activeRowIndex=n,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(t-i)<Math.abs(n-i)){this.activeRowIndex=t,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else {this.activeRowIndex=n,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout(function(){this.editor._signal("gutterkeydown",new s(r,this));}.bind(this),10);},l.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===R.tab){r.preventDefault();return}if(r.keyCode===R.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===R.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===R.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===R.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===R.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===R.enter||r.keyCode===R.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var e=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==e&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(e),this.$focusFoldWidget(this.activeRowIndex));}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var i=this.lines.cells[this.activeRowIndex].element.childNodes[2],n=i.getBoundingClientRect(),t=this.annotationTooltip.getElement().style;t.left=n.right+"px",t.top=n.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},l.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip();},l.prototype.$isFoldWidgetVisible=function(r){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),i=this.$getFoldWidget(r).style.display!=="none";return e&&i},l.prototype.$isAnnotationVisible=function(r){var e=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),i=this.$getAnnotation(r).style.display!=="none";return e&&i},l.prototype.$getFoldWidget=function(r){var e=this.lines.get(r),i=e.element;return i.childNodes[1]},l.prototype.$getAnnotation=function(r){var e=this.lines.get(r),i=e.element;return i.childNodes[2]},l.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var e=0;r-e>0||r+e<this.lines.getLength()-1;){if(e++,r-e>=0&&this.$isFoldWidgetVisible(r-e))return r-e;if(r+e<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+e))return r+e}return null},l.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var e=0;r-e>0||r+e<this.lines.getLength()-1;){if(e++,r-e>=0&&this.$isAnnotationVisible(r-e))return r-e;if(r+e<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+e))return r+e}return null},l.prototype.$focusFoldWidget=function(r){if(r!=null){var e=this.$getFoldWidget(r);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus();}},l.prototype.$focusAnnotation=function(r){if(r!=null){var e=this.$getAnnotation(r);e.classList.add(this.editor.renderer.keyboardFocusClassName),e.focus();}},l.prototype.$blurFoldWidget=function(r){var e=this.$getFoldWidget(r);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur();},l.prototype.$blurAnnotation=function(r){var e=this.$getAnnotation(r);e.classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur();},l.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},l.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},l.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},l.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},l.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var e=this.$findNearestAnnotation(this.activeRowIndex);if(e==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var i=this.$findNearestFoldWidget(this.activeRowIndex);if(i==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusFoldWidget(this.activeRowIndex);break}},l.prototype.$rowIndexToRow=function(r){var e=this.lines.get(r);return e?e.row:null},l.prototype.$rowToRowIndex=function(r){for(var e=0;e<this.lines.getLength();e++){var i=this.lines.get(e);if(i.row==r)return e}return null},l}();M.GutterKeyboardHandler=x;var s=function(){function l(r,e){this.gutterKeyboardHandler=e,this.domEvent=r;}return l.prototype.getKey=function(){return R.keyCodeToString(this.domEvent.keyCode)},l.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},l.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},l.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},l}();M.GutterKeyboardEvent=s;});ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(k,M,H){var R=this&&this.__values||function(p){var c=typeof Symbol=="function"&&Symbol.iterator,g=c&&p[c],A=0;if(g)return g.call(p);if(p&&typeof p.length=="number")return {next:function(){return p&&A>=p.length&&(p=void 0),{value:p&&p[A++],done:!p}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/lang"),l=k("./lib/useragent"),r=k("./keyboard/textinput").TextInput,e=k("./mouse/mouse_handler").MouseHandler,i=k("./mouse/fold_handler").FoldHandler,n=k("./keyboard/keybinding").KeyBinding,t=k("./edit_session").EditSession,o=k("./search").Search,a=k("./range").Range,u=k("./lib/event_emitter").EventEmitter,w=k("./commands/command_manager").CommandManager,S=k("./commands/default_commands").commands,m=k("./config"),$=k("./token_iterator").TokenIterator,d=k("./line_widgets").LineWidgets,h=k("./keyboard/gutter_handler").GutterKeyboardHandler,v=k("./config").nls,C=k("./clipboard"),y=k("./lib/keys"),b=function(){function p(c,g,A){this.session,this.$toDestroy=[];var T=c.getContainerElement();this.container=T,this.renderer=c,this.id="editor"+ ++p.$uid,this.commands=new w(l.isMac?"mac":"win",S),typeof document=="object"&&(this.textInput=new r(c.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new e(this),new i(this)),this.keyBinding=new n(this),this.$search=new o().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart();}.bind(this)),this.on("change",function(E,_){_._$emitInputEvent.schedule(31);}),this.setSession(g||A&&A.session||new t("")),m.resetOptions(this),A&&this.setOptions(A),m._signal("editor",this);}return p.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0;}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0;}.bind(this),!0);},p.prototype.startOperation=function(c){if(this.curOp){if(!c||this.curOp.command)return;this.prevOp=this.curOp;}c||(this.previousCommand=null,c={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:c.command||{},args:c.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON();},p.prototype.endOperation=function(c){if(this.curOp&&this.session){if(c&&c.returnValue===!1||!this.session)return this.curOp=null;if(c==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var g=this.curOp.command,A=g&&g.scrollIntoView;if(A){switch(A){case"center-animate":A="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),E=this.renderer.layerConfig;(T.start.row>=E.lastRow||T.end.row<=E.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;}A=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop);}var _=this.selection.toJSON();this.curOp.selectionAfter=_,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(_),this.prevOp=this.curOp,this.curOp=null;}},p.prototype.$historyTracker=function(c){if(this.$mergeUndoDeltas){var g=this.prevOp,A=this.$mergeableCommands,T=g.command&&c.command.name==g.command.name;if(c.command.name=="insertstring"){var E=c.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(E)||/\s/.test(g.args)),this.mergeNextCommand=!0;}else T=T&&A.indexOf(c.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:A.indexOf(c.command.name)!==-1&&(this.sequenceStartTime=Date.now());}},p.prototype.setKeyboardHandler=function(c,g){if(c&&typeof c=="string"&&c!="ace"){this.$keybindingId=c;var A=this;m.loadModule(["keybinding",c],function(T){A.$keybindingId==c&&A.keyBinding.setKeyboardHandler(T&&T.handler),g&&g();});}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(c),g&&g();},p.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},p.prototype.setSession=function(c){if(this.session!=c){this.curOp&&this.endOperation(),this.curOp={};var g=this.session;if(g){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 A=this.session.getSelection();A.off("changeCursor",this.$onCursorChange),A.off("changeSelection",this.$onSelectionChange);}this.session=c,c?(this.$onDocumentChange=this.onDocumentChange.bind(this),c.on("change",this.$onDocumentChange),this.renderer.setSession(c),this.$onChangeMode=this.onChangeMode.bind(this),c.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),c.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),c.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),c.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),c.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),c.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=c.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(c)),this._signal("changeSession",{session:c,oldSession:g}),this.curOp=null,g&&g._signal("changeEditor",{oldEditor:this}),c&&c._signal("changeEditor",{editor:this}),c&&!c.destroyed&&c.bgTokenizer.scheduleStart();}},p.prototype.getSession=function(){return this.session},p.prototype.setValue=function(c,g){return this.session.doc.setValue(c),g?g==1?this.navigateFileEnd():g==-1&&this.navigateFileStart():this.selectAll(),c},p.prototype.getValue=function(){return this.session.getValue()},p.prototype.getSelection=function(){return this.selection},p.prototype.resize=function(c){this.renderer.onResize(c);},p.prototype.setTheme=function(c,g){this.renderer.setTheme(c,g);},p.prototype.getTheme=function(){return this.renderer.getTheme()},p.prototype.setStyle=function(c){this.renderer.setStyle(c);},p.prototype.unsetStyle=function(c){this.renderer.unsetStyle(c);},p.prototype.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},p.prototype.setFontSize=function(c){this.setOption("fontSize",c);},p.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var c=this;this.$highlightPending=!0,setTimeout(function(){c.$highlightPending=!1;var g=c.session;if(!(!g||g.destroyed)){g.$bracketHighlight&&(g.$bracketHighlight.markerIds.forEach(function(D){g.removeMarker(D);}),g.$bracketHighlight=null);var A=c.getCursorPosition(),T=c.getKeyboardHandler(),E=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(c),_=g.getMatchingBracketRanges(A,E);if(!_){var O=new $(g,A.row,A.column),I=O.getCurrentToken();if(I&&/\b(?:tag-open|tag-name)/.test(I.type)){var N=g.getMatchingTags(A);N&&(_=[N.openTagName.isEmpty()?N.openTag:N.openTagName,N.closeTagName.isEmpty()?N.closeTag:N.closeTagName]);}}if(!_&&g.$mode.getMatching&&(_=g.$mode.getMatching(c.session)),!_){c.getHighlightIndentGuides()&&c.renderer.$textLayer.$highlightIndentGuide();return}var F="ace_bracket";Array.isArray(_)?_.length==1&&(F="ace_error_bracket"):_=[_],_.length==2&&(a.comparePoints(_[0].end,_[1].start)==0?_=[a.fromPoints(_[0].start,_[1].end)]:a.comparePoints(_[0].start,_[1].end)==0&&(_=[a.fromPoints(_[1].start,_[0].end)])),g.$bracketHighlight={ranges:_,markerIds:_.map(function(D){return g.addMarker(D,F,"text")})},c.getHighlightIndentGuides()&&c.renderer.$textLayer.$highlightIndentGuide();}},50);}},p.prototype.focus=function(){this.textInput.focus();},p.prototype.isFocused=function(){return this.textInput.isFocused()},p.prototype.blur=function(){this.textInput.blur();},p.prototype.onFocus=function(c){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",c));},p.prototype.onBlur=function(c){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",c));},p.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine();},p.prototype.onDocumentChange=function(c){var g=this.session.$useWrapMode,A=c.start.row==c.end.row?c.end.row:1/0;this.renderer.updateLines(c.start.row,A,g),this._signal("change",c),this.$cursorChange();},p.prototype.onTokenizerUpdate=function(c){var g=c.data;this.renderer.updateLines(g.first,g.last);},p.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop());},p.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft());},p.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection");},p.prototype.$updateHighlightActiveLine=function(){var c=this.getSession(),g;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(g=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(g=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(g=!1)),c.$highlightLineMarker&&!g)c.removeMarker(c.$highlightLineMarker.id),c.$highlightLineMarker=null;else if(!c.$highlightLineMarker&&g){var A=new a(g.row,g.column,g.row,1/0);A.id=c.addMarker(A,"ace_active-line","screenLine"),c.$highlightLineMarker=A;}else g&&(c.$highlightLineMarker.start.row=g.row,c.$highlightLineMarker.end.row=g.row,c.$highlightLineMarker.start.column=g.column,c._signal("changeBackMarker"));},p.prototype.onSelectionChange=function(c){var g=this.session;if(g.$selectionMarker&&g.removeMarker(g.$selectionMarker),g.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else {var A=this.selection.getRange(),T=this.getSelectionStyle();g.$selectionMarker=g.addMarker(A,"ace_selection",T);}var E=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(E),this._signal("changeSelection");},p.prototype.$getSelectionHighLightRegexp=function(){var c=this.session,g=this.getSelectionRange();if(!(g.isEmpty()||g.isMultiLine())){var A=g.start.column,T=g.end.column,E=c.getLine(g.start.row),_=E.substring(A,T);if(!(_.length>5e3||!/[\w\d]/.test(_))){var O=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:_}),I=E.substring(A-1,T+1);if(O.test(I))return O}}},p.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers();},p.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers();},p.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints();},p.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations());},p.prototype.onChangeMode=function(c){this.renderer.updateText(),this._emit("changeMode",c);},p.prototype.onChangeWrapLimit=function(){this.renderer.updateFull();},p.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0);},p.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull();},p.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},p.prototype.getCopyText=function(){var c=this.getSelectedText(),g=this.session.doc.getNewLineCharacter(),A=!1;if(!c&&this.$copyWithEmptySelection){A=!0;for(var T=this.selection.getAllRanges(),E=0;E<T.length;E++){var _=T[E];E&&T[E-1].start.row==_.start.row||(c+=this.session.getLine(_.start.row)+g);}}var O={text:c};return this._signal("copy",O),C.lineMode=A?O.text:!1,O.text},p.prototype.onCopy=function(){this.commands.exec("copy",this);},p.prototype.onCut=function(){this.commands.exec("cut",this);},p.prototype.onPaste=function(c,g){var A={text:c,event:g};this.commands.exec("paste",this,A);},p.prototype.$handlePaste=function(c){typeof c=="string"&&(c={text:c}),this._signal("paste",c);var g=c.text,A=g===C.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)A?T.insert({row:this.selection.lead.row,column:0},g):this.insert(g);else if(A)this.selection.rangeList.ranges.forEach(function(F){T.insert({row:F.start.row,column:0},g);});else {var E=g.split(/\r\n|\r|\n/),_=this.selection.rangeList.ranges,O=E.length==2&&(!E[0]||!E[1]);if(E.length!=_.length||O)return this.commands.exec("insertstring",this,g);for(var I=_.length;I--;){var N=_[I];N.isEmpty()||T.remove(N),T.insert(N.start,E[I]);}}},p.prototype.execCommand=function(c,g){return this.commands.exec(c,this,g)},p.prototype.insert=function(c,g){var A=this.session,T=A.getMode(),E=this.getCursorPosition();if(this.getBehavioursEnabled()&&!g){var _=T.transformAction(A.getState(E.row),"insertion",this,A,c);_&&(c!==_.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),c=_.text);}if(c==" "&&(c=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&c.indexOf(`
222
- `)==-1){var O=a.fromPoints(E,E);O.end.column+=c.length,this.session.remove(O);}}else {var O=this.getSelectionRange();E=this.session.remove(O),this.clearSelection();}if(c==`
223
- `||c==`\r
224
- `){var D=A.getLine(E.row);if(E.column>D.search(/\S|$/)){var I=D.substr(E.column).search(/\S|$/);A.doc.removeInLine(E.row,E.column,E.column+I);}}this.clearSelection();var N=E.column,F=A.getState(E.row),D=A.getLine(E.row),W=T.checkOutdent(F,D,c);if(A.insert(E,c),_&&_.selection&&(_.selection.length==2?this.selection.setSelectionRange(new a(E.row,N+_.selection[0],E.row,N+_.selection[1])):this.selection.setSelectionRange(new a(E.row+_.selection[0],_.selection[1],E.row+_.selection[2],_.selection[3]))),this.$enableAutoIndent){if(A.getDocument().isNewLine(c)){var B=T.getNextLineIndent(F,D.slice(0,E.column),A.getTabString());A.insert({row:E.row+1,column:0},B);}W&&T.autoOutdent(F,A,E.row);}},p.prototype.autoIndent=function(){for(var c=this.session,g=c.getMode(),A=this.selection.isEmpty()?[new a(0,0,c.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",E="",_="",O=c.getTabString(),I=0;I<A.length;I++)for(var N=A[I].start.row,F=A[I].end.row,D=N;D<=F;D++){D>0&&(T=c.getState(D-1),E=c.getLine(D-1),_=g.getNextLineIndent(T,E,O));var W=c.getLine(D),B=g.$getIndent(W);if(_!==B){if(B.length>0){var z=new a(D,0,D,B.length);c.remove(z);}_.length>0&&c.insert({row:D,column:0},_);}g.autoOutdent(T,c,D);}},p.prototype.onTextInput=function(c,g){if(!g)return this.keyBinding.onTextInput(c);this.startOperation({command:{name:"insertstring"}});var A=this.applyComposition.bind(this,c,g);this.selection.rangeCount?this.forEachSelection(A):A(),this.endOperation();},p.prototype.applyComposition=function(c,g){if(g.extendLeft||g.extendRight){var A=this.selection.getRange();A.start.column-=g.extendLeft,A.end.column+=g.extendRight,A.start.column<0&&(A.start.row--,A.start.column+=this.session.getLine(A.start.row).length+1),this.selection.setRange(A),!c&&!A.isEmpty()&&this.remove();}if((c||!this.selection.isEmpty())&&this.insert(c,!0),g.restoreStart||g.restoreEnd){var A=this.selection.getRange();A.start.column-=g.restoreStart,A.end.column-=g.restoreEnd,this.selection.setRange(A);}},p.prototype.onCommandKey=function(c,g,A){return this.keyBinding.onCommandKey(c,g,A)},p.prototype.setOverwrite=function(c){this.session.setOverwrite(c);},p.prototype.getOverwrite=function(){return this.session.getOverwrite()},p.prototype.toggleOverwrite=function(){this.session.toggleOverwrite();},p.prototype.setScrollSpeed=function(c){this.setOption("scrollSpeed",c);},p.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},p.prototype.setDragDelay=function(c){this.setOption("dragDelay",c);},p.prototype.getDragDelay=function(){return this.getOption("dragDelay")},p.prototype.setSelectionStyle=function(c){this.setOption("selectionStyle",c);},p.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},p.prototype.setHighlightActiveLine=function(c){this.setOption("highlightActiveLine",c);},p.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},p.prototype.setHighlightGutterLine=function(c){this.setOption("highlightGutterLine",c);},p.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},p.prototype.setHighlightSelectedWord=function(c){this.setOption("highlightSelectedWord",c);},p.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},p.prototype.setAnimatedScroll=function(c){this.renderer.setAnimatedScroll(c);},p.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},p.prototype.setShowInvisibles=function(c){this.renderer.setShowInvisibles(c);},p.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},p.prototype.setDisplayIndentGuides=function(c){this.renderer.setDisplayIndentGuides(c);},p.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},p.prototype.setHighlightIndentGuides=function(c){this.renderer.setHighlightIndentGuides(c);},p.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},p.prototype.setShowPrintMargin=function(c){this.renderer.setShowPrintMargin(c);},p.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},p.prototype.setPrintMarginColumn=function(c){this.renderer.setPrintMarginColumn(c);},p.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},p.prototype.setReadOnly=function(c){this.setOption("readOnly",c);},p.prototype.getReadOnly=function(){return this.getOption("readOnly")},p.prototype.setBehavioursEnabled=function(c){this.setOption("behavioursEnabled",c);},p.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},p.prototype.setWrapBehavioursEnabled=function(c){this.setOption("wrapBehavioursEnabled",c);},p.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},p.prototype.setShowFoldWidgets=function(c){this.setOption("showFoldWidgets",c);},p.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},p.prototype.setFadeFoldWidgets=function(c){this.setOption("fadeFoldWidgets",c);},p.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},p.prototype.remove=function(c){this.selection.isEmpty()&&(c=="left"?this.selection.selectLeft():this.selection.selectRight());var g=this.getSelectionRange();if(this.getBehavioursEnabled()){var A=this.session,T=A.getState(g.start.row),E=A.getMode().transformAction(T,"deletion",this,A,g);if(g.end.column===0){var _=A.getTextRange(g);if(_[_.length-1]==`
225
- `){var O=A.getLine(g.end.row);/^\s+$/.test(O)&&(g.end.column=O.length);}}E&&(g=E);}this.session.remove(g),this.clearSelection();},p.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var c=this.getSelectionRange();c.start.column==c.end.column&&c.start.row==c.end.row&&(c.end.column=0,c.end.row++),this.session.remove(c),this.clearSelection();},p.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var c=this.getCursorPosition();this.insert(`
226
- `),this.moveCursorToPosition(c);},p.prototype.setGhostText=function(c,g){this.session.widgetManager||(this.session.widgetManager=new d(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(c,g);},p.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText();},p.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var c=this.getCursorPosition(),g=c.column;if(g!==0){var A=this.session.getLine(c.row),T,E;g<A.length?(T=A.charAt(g)+A.charAt(g-1),E=new a(c.row,g-1,c.row,g+1)):(T=A.charAt(g-1)+A.charAt(g-2),E=new a(c.row,g-2,c.row,g)),this.session.replace(E,T),this.session.selection.moveToPosition(E.end);}}},p.prototype.toLowerCase=function(){var c=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var g=this.getSelectionRange(),A=this.session.getTextRange(g);this.session.replace(g,A.toLowerCase()),this.selection.setSelectionRange(c);},p.prototype.toUpperCase=function(){var c=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var g=this.getSelectionRange(),A=this.session.getTextRange(g);this.session.replace(g,A.toUpperCase()),this.selection.setSelectionRange(c);},p.prototype.indent=function(){var c=this.session,g=this.getSelectionRange();if(g.start.row<g.end.row){var A=this.$getSelectedRows();c.indentRows(A.first,A.last," ");return}else if(g.start.column<g.end.column){var T=c.getTextRange(g);if(!/^\s+$/.test(T)){var A=this.$getSelectedRows();c.indentRows(A.first,A.last," ");return}}var E=c.getLine(g.start.row),_=g.start,O=c.getTabSize(),I=c.documentToScreenColumn(_.row,_.column);if(this.session.getUseSoftTabs())var N=O-I%O,F=s.stringRepeat(" ",N);else {for(var N=I%O;E[g.start.column-1]==" "&&N;)g.start.column--,N--;this.selection.setSelectionRange(g),F=" ";}return this.insert(F)},p.prototype.blockIndent=function(){var c=this.$getSelectedRows();this.session.indentRows(c.first,c.last," ");},p.prototype.blockOutdent=function(){var c=this.session.getSelection();this.session.outdentRows(c.getRange());},p.prototype.sortLines=function(){for(var c=this.$getSelectedRows(),g=this.session,A=[],T=c.first;T<=c.last;T++)A.push(g.getLine(T));A.sort(function(O,I){return O.toLowerCase()<I.toLowerCase()?-1:O.toLowerCase()>I.toLowerCase()?1:0});for(var E=new a(0,0,0,0),T=c.first;T<=c.last;T++){var _=g.getLine(T);E.start.row=T,E.end.row=T,E.end.column=_.length,g.replace(E,A[T-c.first]);}},p.prototype.toggleCommentLines=function(){var c=this.session.getState(this.getCursorPosition().row),g=this.$getSelectedRows();this.session.getMode().toggleCommentLines(c,this.session,g.first,g.last);},p.prototype.toggleBlockComment=function(){var c=this.getCursorPosition(),g=this.session.getState(c.row),A=this.getSelectionRange();this.session.getMode().toggleBlockComment(g,this.session,A,c);},p.prototype.getNumberAt=function(c,g){var A=/[\-]?[0-9]+(?:\.[0-9]+)?/g;A.lastIndex=0;for(var T=this.session.getLine(c);A.lastIndex<g;){var E=A.exec(T);if(E.index<=g&&E.index+E[0].length>=g){var _={value:E[0],start:E.index,end:E.index+E[0].length};return _}}return null},p.prototype.modifyNumber=function(c){var g=this.selection.getCursor().row,A=this.selection.getCursor().column,T=new a(g,A-1,g,A),E=this.session.getTextRange(T);if(!isNaN(parseFloat(E))&&isFinite(E)){var _=this.getNumberAt(g,A);if(_){var O=_.value.indexOf(".")>=0?_.start+_.value.indexOf(".")+1:_.end,I=_.start+_.value.length-O,N=parseFloat(_.value);N*=Math.pow(10,I),O!==_.end&&A<O?c*=Math.pow(10,_.end-A-1):c*=Math.pow(10,_.end-A),N+=c,N/=Math.pow(10,I);var F=N.toFixed(I),D=new a(g,_.start,g,_.end);this.session.replace(D,F),this.moveCursorTo(g,Math.max(_.start+1,A+F.length-_.value.length));}}else this.toggleWord();},p.prototype.toggleWord=function(){var c=this.selection.getCursor().row,g=this.selection.getCursor().column;this.selection.selectWord();var A=this.getSelectedText(),T=this.selection.getWordRange().start.column,E=A.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),_=g-T-1;_<0&&(_=0);var O=0,I=0,N=this;A.match(/[A-Za-z0-9_]+/)&&E.forEach(function(Y,K){I=O+Y.length,_>=O&&_<=I&&(A=Y,N.selection.clearSelection(),N.moveCursorTo(c,O+T),N.selection.selectTo(c,I+T)),O=I;});for(var F=this.$toggleWordPairs,D,W=0;W<F.length;W++)for(var B=F[W],z=0;z<=1;z++){var G=+!z,U=A.match(new RegExp("^\\s?_?("+s.escapeRegExp(B[z])+")\\s?$","i"));if(U){var V=A.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(U[1])+")($|\\s)","g"));V&&(D=A.replace(new RegExp(s.escapeRegExp(B[z]),"i"),function(Y){var K=B[G];return Y.toUpperCase()==Y?K=K.toUpperCase():Y.charAt(0).toUpperCase()==Y.charAt(0)&&(K=K.substr(0,0)+B[G].charAt(0).toUpperCase()+K.substr(1)),K}),this.insert(D),D="");}}},p.prototype.findLinkAt=function(c,g){var A,T,E=this.session.getLine(c),_=E.split(/((?:https?|ftp):\/\/[\S]+)/),O=g;O<0&&(O=0);var I=0,N=0,F;try{for(var D=R(_),W=D.next();!W.done;W=D.next()){var B=W.value;if(N=I+B.length,O>=I&&O<=N&&B.match(/((?:https?|ftp):\/\/[\S]+)/)){F=B.replace(/[\s:.,'";}\]]+$/,"");break}I=N;}}catch(z){A={error:z};}finally{try{W&&!W.done&&(T=D.return)&&T.call(D);}finally{if(A)throw A.error}}return F},p.prototype.openLink=function(){var c=this.selection.getCursor(),g=this.findLinkAt(c.row,c.column);return g&&window.open(g,"_blank"),g!=null},p.prototype.removeLines=function(){var c=this.$getSelectedRows();this.session.removeFullLines(c.first,c.last),this.clearSelection();},p.prototype.duplicateSelection=function(){var c=this.selection,g=this.session,A=c.getRange(),T=c.isBackwards();if(A.isEmpty()){var E=A.start.row;g.duplicateLines(E,E);}else {var _=T?A.start:A.end,O=g.insert(_,g.getTextRange(A));A.start=_,A.end=O,c.setSelectionRange(A,T);}},p.prototype.moveLinesDown=function(){this.$moveLines(1,!1);},p.prototype.moveLinesUp=function(){this.$moveLines(-1,!1);},p.prototype.moveText=function(c,g,A){return this.session.moveText(c,g,A)},p.prototype.copyLinesUp=function(){this.$moveLines(-1,!0);},p.prototype.copyLinesDown=function(){this.$moveLines(1,!0);},p.prototype.$moveLines=function(c,g){var A,T,E=this.selection;if(!E.inMultiSelectMode||this.inVirtualSelectionMode){var _=E.toOrientedRange();A=this.$getSelectedRows(_),T=this.session.$moveLines(A.first,A.last,g?0:c),g&&c==-1&&(T=0),_.moveBy(T,0),E.fromOrientedRange(_);}else {var O=E.rangeList.ranges;E.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var I=0,N=0,F=O.length,D=0;D<F;D++){var W=D;O[D].moveBy(I,0),A=this.$getSelectedRows(O[D]);for(var B=A.first,z=A.last;++D<F;){N&&O[D].moveBy(N,0);var G=this.$getSelectedRows(O[D]);if(g&&G.first!=z)break;if(!g&&G.first>z+1)break;z=G.last;}for(D--,I=this.session.$moveLines(B,z,g?0:c),g&&c==-1&&(W=D+1);W<=D;)O[W].moveBy(I,0),W++;g||(I=0),N+=I;}E.fromOrientedRange(E.ranges[0]),E.rangeList.attach(this.session),this.inVirtualSelectionMode=!1;}},p.prototype.$getSelectedRows=function(c){return c=(c||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(c.start.row),last:this.session.getRowFoldEnd(c.end.row)}},p.prototype.onCompositionStart=function(c){this.renderer.showComposition(c);},p.prototype.onCompositionUpdate=function(c){this.renderer.setCompositionText(c);},p.prototype.onCompositionEnd=function(){this.renderer.hideComposition();},p.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},p.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},p.prototype.isRowVisible=function(c){return c>=this.getFirstVisibleRow()&&c<=this.getLastVisibleRow()},p.prototype.isRowFullyVisible=function(c){return c>=this.renderer.getFirstFullyVisibleRow()&&c<=this.renderer.getLastFullyVisibleRow()},p.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},p.prototype.$moveByPage=function(c,g){var A=this.renderer,T=this.renderer.layerConfig,E=c*Math.floor(T.height/T.lineHeight);g===!0?this.selection.$moveSelection(function(){this.moveCursorBy(E,0);}):g===!1&&(this.selection.moveCursorBy(E,0),this.selection.clearSelection());var _=A.scrollTop;A.scrollBy(0,E*T.lineHeight),g!=null&&A.scrollCursorIntoView(null,.5),A.animateScrolling(_);},p.prototype.selectPageDown=function(){this.$moveByPage(1,!0);},p.prototype.selectPageUp=function(){this.$moveByPage(-1,!0);},p.prototype.gotoPageDown=function(){this.$moveByPage(1,!1);},p.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1);},p.prototype.scrollPageDown=function(){this.$moveByPage(1);},p.prototype.scrollPageUp=function(){this.$moveByPage(-1);},p.prototype.scrollToRow=function(c){this.renderer.scrollToRow(c);},p.prototype.scrollToLine=function(c,g,A,T){this.renderer.scrollToLine(c,g,A,T);},p.prototype.centerSelection=function(){var c=this.getSelectionRange(),g={row:Math.floor(c.start.row+(c.end.row-c.start.row)/2),column:Math.floor(c.start.column+(c.end.column-c.start.column)/2)};this.renderer.alignCursor(g,.5);},p.prototype.getCursorPosition=function(){return this.selection.getCursor()},p.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},p.prototype.getSelectionRange=function(){return this.selection.getRange()},p.prototype.selectAll=function(){this.selection.selectAll();},p.prototype.clearSelection=function(){this.selection.clearSelection();},p.prototype.moveCursorTo=function(c,g){this.selection.moveCursorTo(c,g);},p.prototype.moveCursorToPosition=function(c){this.selection.moveCursorToPosition(c);},p.prototype.jumpToMatching=function(c,g){var A=this.getCursorPosition(),T=new $(this.session,A.row,A.column),E=T.getCurrentToken(),_=0;E&&E.type.indexOf("tag-name")!==-1&&(E=T.stepBackward());var O=E||T.stepForward();if(O){var I,N=!1,F={},D=A.column-O.start,W,B={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(O.value.match(/[{}()\[\]]/g)){for(;D<O.value.length&&!N;D++)if(B[O.value[D]])switch(W=B[O.value[D]]+"."+O.type.replace("rparen","lparen"),isNaN(F[W])&&(F[W]=0),O.value[D]){case"(":case"[":case"{":F[W]++;break;case")":case"]":case"}":F[W]--,F[W]===-1&&(I="bracket",N=!0);break}}else O.type.indexOf("tag-name")!==-1&&(isNaN(F[O.value])&&(F[O.value]=0),E.value==="<"&&_>1?F[O.value]++:E.value==="</"&&F[O.value]--,F[O.value]===-1&&(I="tag",N=!0));N||(E=O,_++,O=T.stepForward(),D=0);}while(O&&!N);if(I){var z,G;if(I==="bracket")z=this.session.getBracketRange(A),z||(z=new a(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+D-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+D-1),G=z.start,(g||G.row===A.row&&Math.abs(G.column-A.column)<2)&&(z=this.session.getBracketRange(G)));else if(I==="tag"){if(!O||O.type.indexOf("tag-name")===-1)return;if(z=new a(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),z.compare(A.row,A.column)===0){var U=this.session.getMatchingTags(A);U&&(U.openTag.contains(A.row,A.column)?(z=U.closeTag,G=z.start):(z=U.openTag,U.closeTag.start.row===A.row&&U.closeTag.start.column===A.column?G=z.end:G=z.start));}G=G||z.start;}G=z&&z.cursor||G,G&&(c?z&&g?this.selection.setRange(z):z&&z.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column));}}},p.prototype.gotoLine=function(c,g,A){this.selection.clearSelection(),this.session.unfold({row:c-1,column:g||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(c-1,g||0),this.isRowFullyVisible(c-1)||this.scrollToLine(c-1,!0,A);},p.prototype.navigateTo=function(c,g){this.selection.moveTo(c,g);},p.prototype.navigateUp=function(c){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var g=this.selection.anchor.getPosition();return this.moveCursorToPosition(g)}this.selection.clearSelection(),this.selection.moveCursorBy(-c||-1,0);},p.prototype.navigateDown=function(c){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var g=this.selection.anchor.getPosition();return this.moveCursorToPosition(g)}this.selection.clearSelection(),this.selection.moveCursorBy(c||1,0);},p.prototype.navigateLeft=function(c){if(this.selection.isEmpty())for(c=c||1;c--;)this.selection.moveCursorLeft();else {var g=this.getSelectionRange().start;this.moveCursorToPosition(g);}this.clearSelection();},p.prototype.navigateRight=function(c){if(this.selection.isEmpty())for(c=c||1;c--;)this.selection.moveCursorRight();else {var g=this.getSelectionRange().end;this.moveCursorToPosition(g);}this.clearSelection();},p.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection();},p.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection();},p.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection();},p.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection();},p.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection();},p.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection();},p.prototype.replace=function(c,g){g&&this.$search.set(g);var A=this.$search.find(this.session),T=0;return A&&(this.$tryReplace(A,c)&&(T=1),this.selection.setSelectionRange(A),this.renderer.scrollSelectionIntoView(A.start,A.end)),T},p.prototype.replaceAll=function(c,g){g&&this.$search.set(g);var A=this.$search.findAll(this.session),T=0;if(!A.length)return T;var E=this.getSelectionRange();this.selection.moveTo(0,0);for(var _=A.length-1;_>=0;--_)this.$tryReplace(A[_],c)&&T++;return this.selection.setSelectionRange(E),T},p.prototype.$tryReplace=function(c,g){var A=this.session.getTextRange(c);return g=this.$search.replace(A,g),g!==null?(c.end=this.session.replace(c,g),c):null},p.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},p.prototype.find=function(c,g,A){g||(g={}),typeof c=="string"||c instanceof RegExp?g.needle=c:typeof c=="object"&&L.mixin(g,c);var T=this.selection.getRange();g.needle==null&&(c=this.session.getTextRange(T)||this.$search.$options.needle,c||(T=this.session.getWordRange(T.start.row,T.start.column),c=this.session.getTextRange(T)),this.$search.set({needle:c})),this.$search.set(g),g.start||this.$search.set({start:T});var E=this.$search.find(this.session);if(g.preventScroll)return E;if(E)return this.revealRange(E,A),E;g.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T);},p.prototype.findNext=function(c,g){this.find({skipCurrent:!0,backwards:!1},c,g);},p.prototype.findPrevious=function(c,g){this.find(c,{skipCurrent:!0,backwards:!0},g);},p.prototype.revealRange=function(c,g){this.session.unfold(c),this.selection.setSelectionRange(c);var A=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(c.start,c.end,.5),g!==!1&&this.renderer.animateScrolling(A);},p.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5);},p.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5);},p.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(c){c.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();},p.prototype.setAutoScrollEditorIntoView=function(c){if(c){var g,A=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var E=this.$scrollAnchor;E.style.cssText="position:absolute",this.container.insertBefore(E,this.container.firstChild);var _=this.on("changeSelection",function(){T=!0;}),O=this.renderer.on("beforeRender",function(){T&&(g=A.renderer.container.getBoundingClientRect());}),I=this.renderer.on("afterRender",function(){if(T&&g&&(A.isFocused()||A.searchBox&&A.searchBox.isFocused())){var N=A.renderer,F=N.$cursorLayer.$pixelPos,D=N.layerConfig,W=F.top-D.offset;F.top>=0&&W+g.top<0?T=!0:F.top<D.height&&F.top+g.top+D.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(E.style.top=W+"px",E.style.left=F.left+"px",E.style.height=D.lineHeight+"px",E.scrollIntoView(T)),T=g=null;}});this.setAutoScrollEditorIntoView=function(N){N||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",_),this.renderer.off("afterRender",I),this.renderer.off("beforeRender",O));};}},p.prototype.$resetCursorStyle=function(){var c=this.$cursorStyle||"ace",g=this.renderer.$cursorLayer;g&&(g.setSmoothBlinking(/smooth/.test(c)),g.isBlinking=!this.$readOnly&&c!="wide",x.setCssClass(g.element,"ace_slim-cursors",/slim/.test(c)));},p.prototype.prompt=function(c,g,A){var T=this;m.loadModule("ace/ext/prompt",function(E){E.prompt(T,c,g,A);});},p}();b.$uid=0,b.prototype.curOp=null,b.prototype.prevOp={},b.prototype.$mergeableCommands=["backspace","del","insertstring"],b.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],L.implement(b.prototype,u),m.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(p){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:p});},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine();},initialValue:!0},highlightSelectedWord:{set:function(p){this.$onSelectionChange();},initialValue:!0},readOnly:{set:function(p){this.textInput.setReadOnly(p),this.$resetCursorStyle();},initialValue:!1},copyWithEmptySelection:{set:function(p){this.textInput.setCopyWithEmptySelection(p);},initialValue:!1},cursorStyle:{set:function(p){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(p){this.setAutoScrollEditorIntoView(p);}},keyboardHandler:{set:function(p){this.setKeyboardHandler(p);},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(p){this.session.setValue(p);},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(p){this.setSession(p);},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(p){this.renderer.$gutterLayer.setShowLineNumbers(p),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),p&&this.$relativeLineNumbers?f.attach(this):f.detach(this);},initialValue:!0},relativeLineNumbers:{set:function(p){this.$showLineNumbers&&p?f.attach(this):f.detach(this);}},placeholder:{set:function(p){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var c=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(c&&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(!c&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var g=x.createElement("div");g.className="ace_placeholder",g.textContent=this.$placeholder||"",this.renderer.placeholderNode=g,this.renderer.content.appendChild(this.renderer.placeholderNode);}else !c&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder();}},enableKeyboardAccessibility:{set:function(p){var c={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus();},readOnly:!0},g=function(T){if(T.target==this.renderer.scroller&&T.keyCode===y.enter){T.preventDefault();var E=this.getCursorPosition().row;this.isRowVisible(E)||this.scrollToLine(E,!0,!0),this.focus();}},A;p?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(l.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",v("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",v("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",g.bind(this)),this.commands.addCommand(c),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",v("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",v("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),A||(A=new h(this)),A.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",g.bind(this)),this.commands.removeCommand(c),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),A&&A.removeListener());},initialValue:!1},textInputAriaLabel:{set:function(p){this.$textInputAriaLabel=p;},initialValue:""},enableMobileMenu:{set:function(p){this.$enableMobileMenu=p;},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var f={getText:function(p,c){return (Math.abs(p.selection.lead.row-c)||c+1+(c<9?"\xB7":""))+""},getWidth:function(p,c,g){return Math.max(c.toString().length,(g.lastRow+1).toString().length,2)*g.characterWidth},update:function(p,c){c.renderer.$loop.schedule(c.renderer.CHANGE_GUTTER);},attach:function(p){p.renderer.$gutterLayer.$renderer=this,p.on("changeSelection",this.update),this.update(null,p);},detach:function(p){p.renderer.$gutterLayer.$renderer==this&&(p.renderer.$gutterLayer.$renderer=null),p.off("changeSelection",this.update),this.update(null,p);}};M.Editor=b;});ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s,l){this.element=s,this.canvasHeight=l||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0;}return x.prototype.moveContainer=function(s){R.translate(this.element,0,-(s.firstRowScreen*s.lineHeight%this.canvasHeight)-s.offset*this.$offsetCoefficient);},x.prototype.pageChanged=function(s,l){return Math.floor(s.firstRowScreen*s.lineHeight/this.canvasHeight)!==Math.floor(l.firstRowScreen*l.lineHeight/this.canvasHeight)},x.prototype.computeLineTop=function(s,l,r){var e=l.firstRowScreen*l.lineHeight,i=Math.floor(e/this.canvasHeight),n=r.documentToScreenRow(s,0)*l.lineHeight;return n-i*this.canvasHeight},x.prototype.computeLineHeight=function(s,l,r){return l.lineHeight*r.getRowLineCount(s)},x.prototype.getLength=function(){return this.cells.length},x.prototype.get=function(s){return this.cells[s]},x.prototype.shift=function(){this.$cacheCell(this.cells.shift());},x.prototype.pop=function(){this.$cacheCell(this.cells.pop());},x.prototype.push=function(s){if(Array.isArray(s)){this.cells.push.apply(this.cells,s);for(var l=R.createFragment(this.element),r=0;r<s.length;r++)l.appendChild(s[r].element);this.element.appendChild(l);}else this.cells.push(s),this.element.appendChild(s.element);},x.prototype.unshift=function(s){if(Array.isArray(s)){this.cells.unshift.apply(this.cells,s);for(var l=R.createFragment(this.element),r=0;r<s.length;r++)l.appendChild(s[r].element);this.element.firstChild?this.element.insertBefore(l,this.element.firstChild):this.element.appendChild(l);}else this.cells.unshift(s),this.element.insertAdjacentElement("afterbegin",s.element);},x.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},x.prototype.$cacheCell=function(s){s&&(s.element.remove(),this.cellCache.push(s));},x.prototype.createCell=function(s,l,r,e){var i=this.cellCache.pop();if(!i){var n=R.createElement("div");e&&e(n),this.element.appendChild(n),i={element:n,text:"",row:s};}return i.row=s,i},x}();M.Lines=L;});ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/oop"),x=k("../lib/lang"),s=k("../lib/event_emitter").EventEmitter,l=k("./lines").Lines,r=k("../config").nls,e=function(){function n(t){this.element=R.createElement("div"),this.element.className="ace_layer ace_gutter-layer",t.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new l(this.element),this.$lines.$offsetCoefficient=1;}return n.prototype.setSession=function(t){this.session&&this.session.off("change",this.$updateAnnotations),this.session=t,t&&t.on("change",this.$updateAnnotations);},n.prototype.addGutterDecoration=function(t,o){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(t,o);},n.prototype.removeGutterDecoration=function(t,o){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(t,o);},n.prototype.setAnnotations=function(t){this.$annotations=[];for(var o=0;o<t.length;o++){var a=t[o],u=a.row,w=this.$annotations[u];w||(w=this.$annotations[u]={text:[],type:[],displayText:[]});var S=a.text,m=a.text,$=a.type;S=S?x.escapeHTML(S):a.html||"",m=m||a.html||"",w.text.indexOf(S)===-1&&(w.text.push(S),w.type.push($),w.displayText.push(m));var d=a.className;d?w.className=d:$=="error"?w.className=" ace_error":$=="warning"&&w.className!=" ace_error"?w.className=" ace_warning":$=="info"&&!w.className&&(w.className=" ace_info");}},n.prototype.$updateAnnotations=function(t){if(this.$annotations.length){var o=t.start.row,a=t.end.row-o;if(a!==0)if(t.action=="remove")this.$annotations.splice(o,a+1,null);else {var u=new Array(a+1);u.unshift(o,1),this.$annotations.splice.apply(this.$annotations,u);}}},n.prototype.update=function(t){this.config=t;var o=this.session,a=t.firstRow,u=Math.min(t.lastRow+t.gutterOffset,o.getLength()-1);this.oldLastRow=u,this.config=t,this.$lines.moveContainer(t),this.$updateCursorRow();for(var w=o.getNextFoldLine(a),S=w?w.start.row:1/0,m=null,$=-1,d=a;;){if(d>S&&(d=w.end.row+1,w=o.getNextFoldLine(d,w),S=w?w.start.row:1/0),d>u){for(;this.$lines.getLength()>$+1;)this.$lines.pop();break}m=this.$lines.get(++$),m?m.row=d:(m=this.$lines.createCell(d,t,this.session,i),this.$lines.push(m)),this.$renderCell(m,t,w,d),d++;}this._signal("afterRender"),this.$updateGutterWidth(t);},n.prototype.$updateGutterWidth=function(t){var o=this.session,a=o.gutterRenderer||this.$renderer,u=o.$firstLineNumber,w=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||o.$useWrapMode)&&(w=o.getLength()+u-1);var S=a?a.getWidth(o,w,t):w.toString().length*t.characterWidth,m=this.$padding||this.$computePadding();S+=m.left+m.right,S!==this.gutterWidth&&!isNaN(S)&&(this.gutterWidth=S,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",S));},n.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var t=this.session.selection.getCursor();this.$cursorRow!==t.row&&(this.$cursorRow=t.row);}},n.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var t=this.session.selection.cursor.row;if(this.$cursorRow=t,!(this.$cursorCell&&this.$cursorCell.row==t)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var o=this.$lines.cells;this.$cursorCell=null;for(var a=0;a<o.length;a++){var u=o[a];if(u.row>=this.$cursorRow){if(u.row>this.$cursorRow){var w=this.session.getFoldLine(this.$cursorRow);if(a>0&&w&&w.start.row==o[a-1].row)u=o[a-1];else break}u.element.className="ace_gutter-active-line "+u.element.className,this.$cursorCell=u;break}}}}},n.prototype.scrollLines=function(t){var o=this.config;if(this.config=t,this.$updateCursorRow(),this.$lines.pageChanged(o,t))return this.update(t);this.$lines.moveContainer(t);var a=Math.min(t.lastRow+t.gutterOffset,this.session.getLength()-1),u=this.oldLastRow;if(this.oldLastRow=a,!o||u<t.firstRow)return this.update(t);if(a<o.firstRow)return this.update(t);if(o.firstRow<t.firstRow)for(var w=this.session.getFoldedRowCount(o.firstRow,t.firstRow-1);w>0;w--)this.$lines.shift();if(u>a)for(var w=this.session.getFoldedRowCount(a+1,u);w>0;w--)this.$lines.pop();t.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLines(t,t.firstRow,o.firstRow-1)),a>u&&this.$lines.push(this.$renderLines(t,u+1,a)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(t);},n.prototype.$renderLines=function(t,o,a){for(var u=[],w=o,S=this.session.getNextFoldLine(w),m=S?S.start.row:1/0;w>m&&(w=S.end.row+1,S=this.session.getNextFoldLine(w,S),m=S?S.start.row:1/0),!(w>a);){var $=this.$lines.createCell(w,t,this.session,i);this.$renderCell($,t,S,w),u.push($),w++;}return u},n.prototype.$renderCell=function(t,o,a,u){var w=t.element,S=this.session,m=w.childNodes[0],$=w.childNodes[1],d=w.childNodes[2],h=d.firstChild,v=S.$firstLineNumber,C=S.$breakpoints,y=S.$decorations,b=S.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&S.foldWidgets,p=a?a.start.row:Number.MAX_VALUE,c=o.lineHeight+"px",g=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",A=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(b?b.getText(S,u):u+v).toString();if(this.$highlightGutterLine&&(u==this.$cursorRow||a&&u<this.$cursorRow&&u>=p&&this.$cursorRow<=a.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=t&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=t)),C[u]&&(g+=C[u]),y[u]&&(g+=y[u]),this.$annotations[u]&&u!==p&&(g+=this.$annotations[u].className),f){var E=f[u];E==null&&(E=f[u]=S.getFoldWidget(u));}if(E){var _="ace_fold-widget ace_"+E,O=E=="start"&&u==p&&u<a.end.row;if(O){_+=" ace_closed";for(var I="",N=!1,F=u+1;F<=a.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){N=!0,I=" ace_error_fold";break}if(this.$annotations[F].className===" ace_warning"){N=!0,I=" ace_warning_fold";continue}}g+=I;}else _+=" ace_open";$.className!=_&&($.className=_),R.setStyle($.style,"height",c),R.setStyle($.style,"display","inline-block"),$.setAttribute("role","button"),$.setAttribute("tabindex","-1");var D=S.getFoldWidgetRange(u);D?$.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[D.start.row+1,D.end.row+1])):a?$.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[a.start.row+1,a.end.row+1])):$.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[u+1])),O?($.setAttribute("aria-expanded","false"),$.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):($.setAttribute("aria-expanded","true"),$.setAttribute("title",r("gutter.code-folding.open.title","Fold code")));}else $&&(R.setStyle($.style,"display","none"),$.setAttribute("tabindex","0"),$.removeAttribute("role"),$.removeAttribute("aria-label"));if(N&&this.$showFoldedAnnotations){d.className="ace_gutter_annotation",h.className=A,h.className+=I,R.setStyle(h.style,"height",c),R.setStyle(d.style,"display","block"),R.setStyle(d.style,"height",c);var W;switch(I){case" ace_error_fold":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning_fold":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break}d.setAttribute("aria-label",W),d.setAttribute("tabindex","-1"),d.setAttribute("role","button");}else if(this.$annotations[u]){d.className="ace_gutter_annotation",h.className=A,this.$useSvgGutterIcons?h.className+=this.$annotations[u].className:w.classList.add(this.$annotations[u].className.replace(" ","")),R.setStyle(h.style,"height",c),R.setStyle(d.style,"display","block"),R.setStyle(d.style,"height",c);var W;switch(this.$annotations[u].className){case" ace_error":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break;case" ace_info":W=r("gutter.annotation.aria-label.info","Read annotations row $0",[T]);break}d.setAttribute("aria-label",W),d.setAttribute("tabindex","-1"),d.setAttribute("role","button");}else R.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0");return T!==m.data&&(m.data=T),w.className!=g&&(w.className=g),R.setStyle(t.element.style,"height",this.$lines.computeLineHeight(u,o,S)+"px"),R.setStyle(t.element.style,"top",this.$lines.computeLineTop(u,o,S)+"px"),t.text=T,d.style.display==="none"&&$.style.display==="none"?t.element.setAttribute("aria-hidden",!0):t.element.setAttribute("aria-hidden",!1),t},n.prototype.setHighlightGutterLine=function(t){this.$highlightGutterLine=t;},n.prototype.setShowLineNumbers=function(t){this.$renderer=!t&&{getWidth:function(){return 0},getText:function(){return ""}};},n.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},n.prototype.setShowFoldWidgets=function(t){t?R.addCssClass(this.element,"ace_folding-enabled"):R.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=t,this.$padding=null;},n.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},n.prototype.$computePadding=function(){if(!this.element.firstChild)return {left:0,right:0};var t=R.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(t.borderLeftWidth)||0)+(parseInt(t.paddingLeft)||0)+1,this.$padding.right=(parseInt(t.borderRightWidth)||0)+(parseInt(t.paddingRight)||0),this.$padding},n.prototype.getRegion=function(t){var o=this.$padding||this.$computePadding(),a=this.element.getBoundingClientRect();if(t.x<o.left+a.left)return "markers";if(this.$showFoldWidgets&&t.x>a.right-o.right)return "foldWidgets"},n}();e.prototype.$fixedWidth=!1,e.prototype.$highlightGutterLine=!0,e.prototype.$renderer="",e.prototype.$showLineNumbers=!0,e.prototype.$showFoldWidgets=!0,L.implement(e.prototype,s);function i(n){var t=document.createTextNode("");n.appendChild(t);var o=R.createElement("span");n.appendChild(o);var a=R.createElement("span");n.appendChild(a);var u=R.createElement("span");return a.appendChild(u),n}M.Gutter=e;});ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(k,M,H){var R=k("../range").Range,L=k("../lib/dom"),x=function(){function l(r){this.element=L.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element);}return l.prototype.setPadding=function(r){this.$padding=r;},l.prototype.setSession=function(r){this.session=r;},l.prototype.setMarkers=function(r){this.markers=r;},l.prototype.elt=function(r,e){var i=this.i!=-1&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=e,i.className=r;},l.prototype.update=function(r){if(r){this.config=r,this.i=0;var e;for(var i in this.markers){var n=this.markers[i];if(!n.range){n.update(e,this,this.session,r);continue}var t=n.range.clipRows(r.firstRow,r.lastRow);if(!t.isEmpty())if(t=t.toScreenRange(this.session),n.renderer){var o=this.$getTop(t.start.row,r),a=this.$padding+t.start.column*r.characterWidth;n.renderer(e,t,a,o,r);}else n.type=="fullLine"?this.drawFullLineMarker(e,t,n.clazz,r):n.type=="screenLine"?this.drawScreenLineMarker(e,t,n.clazz,r):t.isMultiLine()?n.type=="text"?this.drawTextMarker(e,t,n.clazz,r):this.drawMultiLineMarker(e,t,n.clazz,r):this.drawSingleLineMarker(e,t,n.clazz+" ace_start ace_br15",r);}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild);}},l.prototype.$getTop=function(r,e){return (r-e.firstRowScreen)*e.lineHeight},l.prototype.drawTextMarker=function(r,e,i,n,t){for(var o=this.session,a=e.start.row,u=e.end.row,w=a,S=0,m=0,$=o.getScreenLastRowColumn(w),d=new R(w,e.start.column,w,m);w<=u;w++)d.start.row=d.end.row=w,d.start.column=w==a?e.start.column:o.getRowWrapIndent(w),d.end.column=$,S=m,m=$,$=w+1<u?o.getScreenLastRowColumn(w+1):w==u?0:e.end.column,this.drawSingleLineMarker(r,d,i+(w==a?" ace_start":"")+" ace_br"+s(w==a||w==a+1&&e.start.column,S<m,m>$,w==u),n,w==u?0:1,t);},l.prototype.drawMultiLineMarker=function(r,e,i,n,t){var o=this.$padding,a=n.lineHeight,u=this.$getTop(e.start.row,n),w=o+e.start.column*n.characterWidth;if(t=t||"",this.session.$bidiHandler.isBidiRow(e.start.row)){var S=e.clone();S.end.row=S.start.row,S.end.column=this.session.getLine(S.start.row).length,this.drawBidiSingleLineMarker(r,S,i+" ace_br1 ace_start",n,null,t);}else this.elt(i+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+u+"px;left:"+w+"px;"+(t||""));if(this.session.$bidiHandler.isBidiRow(e.end.row)){var S=e.clone();S.start.row=S.end.row,S.start.column=0,this.drawBidiSingleLineMarker(r,S,i+" ace_br12",n,null,t);}else {u=this.$getTop(e.end.row,n);var m=e.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+a+"px;width:"+m+"px;top:"+u+"px;left:"+o+"px;"+(t||""));}if(a=(e.end.row-e.start.row-1)*n.lineHeight,!(a<=0)){u=this.$getTop(e.start.row+1,n);var $=(e.start.column?1:0)|(e.end.column?0:8);this.elt(i+($?" ace_br"+$:""),"height:"+a+"px;right:0;top:"+u+"px;left:"+o+"px;"+(t||""));}},l.prototype.drawSingleLineMarker=function(r,e,i,n,t,o){if(this.session.$bidiHandler.isBidiRow(e.start.row))return this.drawBidiSingleLineMarker(r,e,i,n,t,o);var a=n.lineHeight,u=(e.end.column+(t||0)-e.start.column)*n.characterWidth,w=this.$getTop(e.start.row,n),S=this.$padding+e.start.column*n.characterWidth;this.elt(i,"height:"+a+"px;width:"+u+"px;top:"+w+"px;left:"+S+"px;"+(o||""));},l.prototype.drawBidiSingleLineMarker=function(r,e,i,n,t,o){var a=n.lineHeight,u=this.$getTop(e.start.row,n),w=this.$padding,S=this.session.$bidiHandler.getSelections(e.start.column,e.end.column);S.forEach(function(m){this.elt(i,"height:"+a+"px;width:"+(m.width+(t||0))+"px;top:"+u+"px;left:"+(w+m.left)+"px;"+(o||""));},this);},l.prototype.drawFullLineMarker=function(r,e,i,n,t){var o=this.$getTop(e.start.row,n),a=n.lineHeight;e.start.row!=e.end.row&&(a+=this.$getTop(e.end.row,n)-o),this.elt(i,"height:"+a+"px;top:"+o+"px;left:0;right:0;"+(t||""));},l.prototype.drawScreenLineMarker=function(r,e,i,n,t){var o=this.$getTop(e.start.row,n),a=n.lineHeight;this.elt(i,"height:"+a+"px;top:"+o+"px;left:0;right:0;"+(t||""));},l}();x.prototype.$padding=0;function s(l,r,e,i){return (l?1:0)|(r?2:0)|(e?4:0)|(i?8:0)}M.Marker=x;});ace.define("ace/layer/text_util",["require","exports","module"],function(k,M,H){var R=new Set(["text","rparen","lparen"]);M.isTextToken=function(L){return R.has(L)};});ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(k,M,H){var R=k("../lib/oop"),L=k("../lib/dom"),x=k("../lib/lang"),s=k("./lines").Lines,l=k("../lib/event_emitter").EventEmitter,r=k("../config").nls,e=k("./text_util").isTextToken,i=function(){function n(t){this.dom=L,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element);}return n.prototype.$updateEolChar=function(){var t=this.session.doc,o=t.getNewLineCharacter()==`
227
- `&&t.getNewLineMode()!="windows",a=o?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=a)return this.EOL_CHAR=a,!0},n.prototype.setPadding=function(t){this.$padding=t,this.element.style.margin="0 "+t+"px";},n.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},n.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},n.prototype.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on("changeCharacterSize",function(o){this._signal("changeCharacterSize",o);}.bind(this)),this.$pollSizeChanges();},n.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges();},n.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},n.prototype.setSession=function(t){this.session=t,t&&this.$computeTabString();},n.prototype.setShowInvisibles=function(t){return this.showInvisibles==t?!1:(this.showInvisibles=t,typeof t=="string"?(this.showSpaces=/tab/i.test(t),this.showTabs=/space/i.test(t),this.showEOL=/eol/i.test(t)):this.showSpaces=this.showTabs=this.showEOL=t,this.$computeTabString(),!0)},n.prototype.setDisplayIndentGuides=function(t){return this.displayIndentGuides==t?!1:(this.displayIndentGuides=t,this.$computeTabString(),!0)},n.prototype.setHighlightIndentGuides=function(t){return this.$highlightIndentGuides===t?!1:(this.$highlightIndentGuides=t,t)},n.prototype.$computeTabString=function(){var t=this.session.getTabSize();this.tabSize=t;for(var o=this.$tabStrings=[0],a=1;a<t+1;a++)if(this.showTabs){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_tab",u.textContent=x.stringRepeat(this.TAB_CHAR,a),o.push(u);}else o.push(this.dom.createTextNode(x.stringRepeat(" ",a),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var w="ace_indent-guide",S=this.showSpaces?" ace_invisible ace_invisible_space":"",m=this.showSpaces?x.stringRepeat(this.SPACE_CHAR,this.tabSize):x.stringRepeat(" ",this.tabSize),$=this.showTabs?" ace_invisible ace_invisible_tab":"",d=this.showTabs?x.stringRepeat(this.TAB_CHAR,this.tabSize):m,u=this.dom.createElement("span");u.className=w+S,u.textContent=m,this.$tabStrings[" "]=u;var u=this.dom.createElement("span");u.className=w+$,u.textContent=d,this.$tabStrings[" "]=u;}},n.prototype.updateLines=function(t,o,a){if(this.config.lastRow!=t.lastRow||this.config.firstRow!=t.firstRow)return this.update(t);this.config=t;for(var u=Math.max(o,t.firstRow),w=Math.min(a,t.lastRow),S=this.element.childNodes,m=0,d=t.firstRow;d<u;d++){var h=this.session.getFoldLine(d);if(h)if(h.containsRow(u)){u=h.start.row;break}else d=h.end.row;m++;}for(var $=!1,d=u,h=this.session.getNextFoldLine(d),v=h?h.start.row:1/0;d>v&&(d=h.end.row+1,h=this.session.getNextFoldLine(d,h),v=h?h.start.row:1/0),!(d>w);){var C=S[m++];if(C){this.dom.removeChildren(C),this.$renderLine(C,d,d==v?h:!1),$&&(C.style.top=this.$lines.computeLineTop(d,t,this.session)+"px");var y=t.lineHeight*this.session.getRowLength(d)+"px";C.style.height!=y&&($=!0,C.style.height=y);}d++;}if($)for(;m<this.$lines.cells.length;){var b=this.$lines.cells[m++];b.element.style.top=this.$lines.computeLineTop(b.row,t,this.session)+"px";}},n.prototype.scrollLines=function(t){var o=this.config;if(this.config=t,this.$lines.pageChanged(o,t))return this.update(t);this.$lines.moveContainer(t);var a=t.lastRow,u=o?o.lastRow:-1;if(!o||u<t.firstRow)return this.update(t);if(a<o.firstRow)return this.update(t);if(!o||o.lastRow<t.firstRow)return this.update(t);if(t.lastRow<o.firstRow)return this.update(t);if(o.firstRow<t.firstRow)for(var w=this.session.getFoldedRowCount(o.firstRow,t.firstRow-1);w>0;w--)this.$lines.shift();if(o.lastRow>t.lastRow)for(var w=this.session.getFoldedRowCount(t.lastRow+1,o.lastRow);w>0;w--)this.$lines.pop();t.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLinesFragment(t,t.firstRow,o.firstRow-1)),t.lastRow>o.lastRow&&this.$lines.push(this.$renderLinesFragment(t,o.lastRow+1,t.lastRow)),this.$highlightIndentGuide();},n.prototype.$renderLinesFragment=function(t,o,a){for(var u=[],w=o,S=this.session.getNextFoldLine(w),m=S?S.start.row:1/0;w>m&&(w=S.end.row+1,S=this.session.getNextFoldLine(w,S),m=S?S.start.row:1/0),!(w>a);){var $=this.$lines.createCell(w,t,this.session),d=$.element;this.dom.removeChildren(d),L.setStyle(d.style,"height",this.$lines.computeLineHeight(w,t,this.session)+"px"),L.setStyle(d.style,"top",this.$lines.computeLineTop(w,t,this.session)+"px"),this.$renderLine(d,w,w==m?S:!1),this.$useLineGroups()?d.className="ace_line_group":d.className="ace_line",u.push($),w++;}return u},n.prototype.update=function(t){this.$lines.moveContainer(t),this.config=t;for(var o=t.firstRow,a=t.lastRow,u=this.$lines;u.getLength();)u.pop();u.push(this.$renderLinesFragment(t,o,a));},n.prototype.$renderToken=function(t,o,a,u){for(var w=this,S=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,m=this.dom.createFragment(this.element),$,d=0;$=S.exec(u);){var h=$[1],v=$[2],C=$[3],y=$[4],b=$[5];if(!(!w.showSpaces&&v)){var f=d!=$.index?u.slice(d,$.index):"";if(d=$.index+$[0].length,f&&m.appendChild(this.dom.createTextNode(f,this.element)),h){var p=w.session.getScreenTabSize(o+$.index);m.appendChild(w.$tabStrings[p].cloneNode(!0)),o+=p-1;}else if(v)if(w.showSpaces){var c=this.dom.createElement("span");c.className="ace_invisible ace_invisible_space",c.textContent=x.stringRepeat(w.SPACE_CHAR,v.length),m.appendChild(c);}else m.appendChild(this.dom.createTextNode(v,this.element));else if(C){var c=this.dom.createElement("span");c.className="ace_invisible ace_invisible_space ace_invalid",c.textContent=x.stringRepeat(w.SPACE_CHAR,C.length),m.appendChild(c);}else if(y){o+=1;var c=this.dom.createElement("span");c.style.width=w.config.characterWidth*2+"px",c.className=w.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",c.textContent=w.showSpaces?w.SPACE_CHAR:y,m.appendChild(c);}else if(b){o+=1;var c=this.dom.createElement("span");c.style.width=w.config.characterWidth*2+"px",c.className="ace_cjk",c.textContent=b,m.appendChild(c);}}}if(m.appendChild(this.dom.createTextNode(d?u.slice(d):u,this.element)),e(a.type))t.appendChild(m);else {var g="ace_"+a.type.replace(/\./g," ace_"),c=this.dom.createElement("span");a.type=="fold"&&(c.style.width=a.value.length*this.config.characterWidth+"px",c.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),c.className=g,c.appendChild(m),t.appendChild(c);}return o+u.length},n.prototype.renderIndentGuide=function(t,o,a){var u=o.search(this.$indentGuideRe);if(u<=0||u>=a)return o;if(o[0]==" "){u-=u%this.tabSize;for(var w=u/this.tabSize,S=0;S<w;S++)t.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(u)}else if(o[0]==" "){for(var S=0;S<u;S++)t.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(u)}return this.$highlightIndentGuide(),o},n.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var t=this.session.doc.$lines;if(t){var o=this.session.selection.getCursor(),a=/^\s*/.exec(this.session.doc.getLine(o.row))[0].length,u=Math.floor(a/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:u,start:o.row};var w=this.session.$bracketHighlight;if(w){for(var S=this.session.$bracketHighlight.ranges,m=0;m<S.length;m++)if(o.row!==S[m].start.row){this.$highlightIndentGuideMarker.end=S[m].start.row,o.row>S[m].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&t[o.row]!==""&&o.column===t[o.row].length){this.$highlightIndentGuideMarker.dir=1;for(var m=o.row+1;m<t.length;m++){var $=t[m],d=/^\s*/.exec($)[0].length;if($!==""&&(this.$highlightIndentGuideMarker.end=m,d<=a))break}}this.$renderHighlightIndentGuide();}}},n.prototype.$clearActiveIndentGuide=function(){for(var t=this.$lines.cells,o=0;o<t.length;o++){var a=t[o],u=a.element.childNodes;if(u.length>0){for(var w=0;w<u.length;w++)if(u[w].classList&&u[w].classList.contains("ace_indent-guide-active")){u[w].classList.remove("ace_indent-guide-active");break}}}},n.prototype.$setIndentGuideActive=function(t,o){var a=this.session.doc.getLine(t.row);if(a!==""){var u=t.element.childNodes;if(u){var w=u[o-1];w&&w.classList&&w.classList.contains("ace_indent-guide")&&w.classList.add("ace_indent-guide-active");}}},n.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var t=this.$lines.cells;this.$clearActiveIndentGuide();var o=this.$highlightIndentGuideMarker.indentLevel;if(o!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var a=0;a<t.length;a++){var u=t[a];if(this.$highlightIndentGuideMarker.end&&u.row>=this.$highlightIndentGuideMarker.start+1){if(u.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(u,o);}}else for(var a=t.length-1;a>=0;a--){var u=t[a];if(this.$highlightIndentGuideMarker.end&&u.row<this.$highlightIndentGuideMarker.start){if(u.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(u,o);}}}},n.prototype.$createLineElement=function(t){var o=this.dom.createElement("div");return o.className="ace_line",o.style.height=this.config.lineHeight+"px",o},n.prototype.$renderWrappedLine=function(t,o,a){var u=0,w=0,S=a[0],m=0,$=this.$createLineElement();t.appendChild($);for(var d=0;d<o.length;d++){var h=o[d],v=h.value;if(d==0&&this.displayIndentGuides){if(u=v.length,v=this.renderIndentGuide($,v,S),!v)continue;u-=v.length;}if(u+v.length<S)m=this.$renderToken($,m,h,v),u+=v.length;else {for(;u+v.length>=S;)m=this.$renderToken($,m,h,v.substring(0,S-u)),v=v.substring(S-u),u=S,$=this.$createLineElement(),t.appendChild($),$.appendChild(this.dom.createTextNode(x.stringRepeat("\xA0",a.indent),this.element)),w++,m=0,S=a[w]||Number.MAX_VALUE;v.length!=0&&(u+=v.length,m=this.$renderToken($,m,h,v));}}a[a.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage($,m,null,"",!0);},n.prototype.$renderSimpleLine=function(t,o){for(var a=0,u=0;u<o.length;u++){var w=o[u],S=w.value;if(!(u==0&&this.displayIndentGuides&&(S=this.renderIndentGuide(t,S),!S))){if(a+S.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(t,a,w,S);a=this.$renderToken(t,a,w,S);}}},n.prototype.$renderOverflowMessage=function(t,o,a,u,w){a&&this.$renderToken(t,o,a,u.slice(0,this.MAX_LINE_LENGTH-o));var S=this.dom.createElement("span");S.className="ace_inline_button ace_keyword ace_toggle_wrap",S.textContent=w?"<hide>":"<click to see more...>",t.appendChild(S);},n.prototype.$renderLine=function(t,o,a){if(!a&&a!=!1&&(a=this.session.getFoldLine(o)),a)var u=this.$getFoldLineTokens(o,a);else var u=this.session.getTokens(o);var w=t;if(u.length){var S=this.session.getRowSplitData(o);if(S&&S.length){this.$renderWrappedLine(t,u,S);var w=t.lastChild;}else {var w=t;this.$useLineGroups()&&(w=this.$createLineElement(),t.appendChild(w)),this.$renderSimpleLine(w,u);}}else this.$useLineGroups()&&(w=this.$createLineElement(),t.appendChild(w));if(this.showEOL&&w){a&&(o=a.end.row);var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_eol",m.textContent=o==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,w.appendChild(m);}},n.prototype.$getFoldLineTokens=function(t,o){var a=this.session,u=[];function w(m,$,d){for(var h=0,v=0;v+m[h].value.length<$;)if(v+=m[h].value.length,h++,h==m.length)return;if(v!=$){var C=m[h].value.substring($-v);C.length>d-$&&(C=C.substring(0,d-$)),u.push({type:m[h].type,value:C}),v=$+C.length,h+=1;}for(;v<d&&h<m.length;){var C=m[h].value;C.length+v>d?u.push({type:m[h].type,value:C.substring(0,d-v)}):u.push(m[h]),v+=C.length,h+=1;}}var S=a.getTokens(t);return o.walk(function(m,$,d,h,v){m!=null?u.push({type:"fold",value:m}):(v&&(S=a.getTokens($)),S.length&&w(S,h,d));},o.end.row,this.session.getLine(o.end.row).length),u},n.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},n}();i.prototype.EOF_CHAR="\xB6",i.prototype.EOL_CHAR_LF="\xAC",i.prototype.EOL_CHAR_CRLF="\xA4",i.prototype.EOL_CHAR=i.prototype.EOL_CHAR_LF,i.prototype.TAB_CHAR="\u2014",i.prototype.SPACE_CHAR="\xB7",i.prototype.$padding=0,i.prototype.MAX_LINE_LENGTH=1e4,i.prototype.showInvisibles=!1,i.prototype.showSpaces=!1,i.prototype.showTabs=!1,i.prototype.showEOL=!1,i.prototype.displayIndentGuides=!0,i.prototype.$highlightIndentGuides=!0,i.prototype.$tabStrings=[],i.prototype.destroy={},i.prototype.onChangeTabSize=i.prototype.$computeTabString,R.implement(i.prototype,l),M.Text=i;});ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s){this.element=R.createElement("div"),this.element.className="ace_layer ace_cursor-layer",s.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),R.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this);}return x.prototype.$updateOpacity=function(s){for(var l=this.cursors,r=l.length;r--;)R.setStyle(l[r].style,"opacity",s?"":"0");},x.prototype.$startCssAnimation=function(){for(var s=this.cursors,l=s.length;l--;)s[l].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&R.addCssClass(this.element,"ace_animate-blinking");}.bind(this));},x.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,R.removeCssClass(this.element,"ace_animate-blinking");},x.prototype.setPadding=function(s){this.$padding=s;},x.prototype.setSession=function(s){this.session=s;},x.prototype.setBlinking=function(s){s!=this.isBlinking&&(this.isBlinking=s,this.restartTimer());},x.prototype.setBlinkInterval=function(s){s!=this.blinkInterval&&(this.blinkInterval=s,this.restartTimer());},x.prototype.setSmoothBlinking=function(s){s!=this.smoothBlinking&&(this.smoothBlinking=s,R.setCssClass(this.element,"ace_smooth-blinking",s),this.$updateCursors(!0),this.restartTimer());},x.prototype.addCursor=function(){var s=R.createElement("div");return s.className="ace_cursor",this.element.appendChild(s),this.cursors.push(s),s},x.prototype.removeCursor=function(){if(this.cursors.length>1){var s=this.cursors.pop();return s.parentNode.removeChild(s),s}},x.prototype.hideCursor=function(){this.isVisible=!1,R.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer();},x.prototype.showCursor=function(){this.isVisible=!0,R.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer();},x.prototype.restartTimer=function(){var s=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,R.removeCssClass(this.element,"ace_smooth-blinking")),s(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&R.addCssClass(this.element,"ace_smooth-blinking");}.bind(this))),R.HAS_CSS_ANIMATION)this.$startCssAnimation();else {var l=function(){this.timeoutId=setTimeout(function(){s(!1);},.6*this.blinkInterval);}.bind(this);this.intervalId=setInterval(function(){s(!0),l();},this.blinkInterval),l();}},x.prototype.getPixelPosition=function(s,l){if(!this.config||!this.session)return {left:0,top:0};s||(s=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(s),e=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,s.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),i=(r.row-(l?this.config.firstRowScreen:0))*this.config.lineHeight;return {left:e,top:i}},x.prototype.isCursorInView=function(s,l){return s.top>=0&&s.top<l.maxHeight},x.prototype.update=function(s){this.config=s;var l=this.session.$selectionMarkers,r=0,e=0;(l===void 0||l.length===0)&&(l=[{cursor:null}]);for(var r=0,i=l.length;r<i;r++){var n=this.getPixelPosition(l[r].cursor,!0);if(!((n.top>s.height+s.offset||n.top<0)&&r>1)){var t=this.cursors[e++]||this.addCursor(),o=t.style;this.drawCursor?this.drawCursor(t,n,s,l[r],this.session):this.isCursorInView(n,s)?(R.setStyle(o,"display","block"),R.translate(t,n.left,n.top),R.setStyle(o,"width",Math.round(s.characterWidth)+"px"),R.setStyle(o,"height",s.lineHeight+"px")):R.setStyle(o,"display","none");}}for(;this.cursors.length>e;)this.removeCursor();var a=this.session.getOverwrite();this.$setOverwrite(a),this.$pixelPos=n,this.restartTimer();},x.prototype.$setOverwrite=function(s){s!=this.overwrite&&(this.overwrite=s,s?R.addCssClass(this.element,"ace_overwrite-cursors"):R.removeCssClass(this.element,"ace_overwrite-cursors"));},x.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId);},x}();L.prototype.$padding=0,L.prototype.drawCursor=null,M.Cursor=L;});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var t=function(o,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w;}||function(u,w){for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(u[S]=w[S]);},t(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");t(o,a);function u(){this.constructor=o;}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u);}}(),L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/event"),l=k("./lib/event_emitter").EventEmitter,r=32768,e=function(){function t(o,a){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+a,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),o.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault);}return t.prototype.setVisible=function(o){this.element.style.display=o?"":"none",this.isVisible=o,this.coeff=1;},t}();L.implement(e.prototype,l);var i=function(t){R(o,t);function o(a,u){var w=t.call(this,a,"-v")||this;return w.scrollTop=0,w.scrollHeight=0,u.$scrollbarWidth=w.width=x.scrollbarWidth(a.ownerDocument),w.inner.style.width=w.element.style.width=(w.width||15)+5+"px",w.$minWidth=0,w}return o.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var a=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-a)/(this.coeff-a);}this._emit("scroll",{data:this.scrollTop});}this.skipEvent=!1;},o.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},o.prototype.setHeight=function(a){this.element.style.height=a+"px";},o.prototype.setScrollHeight=function(a){this.scrollHeight=a,a>r?(this.coeff=r/a,a=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=a+"px";},o.prototype.setScrollTop=function(a){this.scrollTop!=a&&(this.skipEvent=!0,this.scrollTop=a,this.element.scrollTop=a*this.coeff);},o}(e);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var n=function(t){R(o,t);function o(a,u){var w=t.call(this,a,"-h")||this;return w.scrollLeft=0,w.height=u.$scrollbarWidth,w.inner.style.height=w.element.style.height=(w.height||15)+5+"px",w}return o.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1;},o.prototype.getHeight=function(){return this.isVisible?this.height:0},o.prototype.setWidth=function(a){this.element.style.width=a+"px";},o.prototype.setInnerWidth=function(a){this.inner.style.width=a+"px";},o.prototype.setScrollWidth=function(a){this.inner.style.width=a+"px";},o.prototype.setScrollLeft=function(a){this.scrollLeft!=a&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=a);},o}(e);M.ScrollBar=i,M.ScrollBarV=i,M.ScrollBarH=n,M.VScrollBar=i,M.HScrollBar=n;});ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var n=function(t,o){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u;}||function(a,u){for(var w in u)Object.prototype.hasOwnProperty.call(u,w)&&(a[w]=u[w]);},n(t,o)};return function(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");n(t,o);function a(){this.constructor=t;}t.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a);}}(),L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/event"),l=k("./lib/event_emitter").EventEmitter;x.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
220
+ `),e=[],o=0;o<n.length;o++)try{e.push(new RegExp(n[o],i));}catch{return !1}return e},r.prototype.$matchIterator=function(t,i){var n=this.$assembleRegExp(i);if(!n)return !1;var e=i.backwards==!0,o=i.skipCurrent!=!1,a=n.unicode,u=i.range,w=i.start;w||(w=u?u[e?"end":"start"]:t.selection.getRange()),w.start&&(w=w[o!=e?"end":"start"]);var S=u?u.start.row:0,m=u?u.end.row:t.getLength()-1;if(e)var $=function(v){var C=w.row;if(!h(C,w.column,v)){for(C--;C>=S;C--)if(h(C,Number.MAX_VALUE,v))return;if(i.wrap!=!1){for(C=m,S=w.row;C>=S;C--)if(h(C,Number.MAX_VALUE,v))return}}};else var $=function(C){var y=w.row;if(!h(y,w.column,C)){for(y=y+1;y<=m;y++)if(h(y,0,C))return;if(i.wrap!=!1){for(y=S,m=w.row;y<=m;y++)if(h(y,0,C))return}}};if(i.$isMultiLine)var d=n.length,h=function(v,C,y){var b=e?v-d+1:v;if(!(b<0||b+d>t.getLength())){var f=t.getLine(b),p=f.search(n[0]);if(!(!e&&p<C||p===-1)){for(var l=1;l<d;l++)if(f=t.getLine(b+l),f.search(n[l])==-1)return;var g=f.match(n[d-1])[0].length;if(!(e&&g>C)&&y(b,p,b+d-1,g))return !0}}};else if(e)var h=function(C,y,b){var f=t.getLine(C),p=[],l,g=0;for(n.lastIndex=0;l=n.exec(f);){var A=l[0].length;if(g=l.index,!A){if(g>=f.length)break;n.lastIndex=g+=R.skipEmptyMatch(f,g,a);}if(l.index+A>y)break;p.push(l.index,A);}for(var T=p.length-1;T>=0;T-=2){var E=p[T-1],A=p[T];if(b(C,E,C,E+A))return !0}};else var h=function(C,y,b){var f=t.getLine(C),p,l;for(n.lastIndex=y;l=n.exec(f);){var g=l[0].length;if(p=l.index,b(C,p,C,p+g))return !0;if(!g&&(n.lastIndex=p+=R.skipEmptyMatch(f,p,a),p>=f.length))return !1}};return {forEach:$}},r}();function c(r,t){var i=R.supportsLookbehind();function n(u,w){w===void 0&&(w=!0);var S=i&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return S.test(u)||t.regExp?i&&t.$supportsUnicodeFlag?w?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var e=Array.from(r),o=e[0],a=e[e.length-1];return n(o)+r+n(a,!1)}M.Search=s;});ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(k,M,H){var R=this&&this.__extends||function(){var i=function(n,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a;}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u]);},i(n,e)};return function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");i(n,e);function o(){this.constructor=n;}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o);}}(),L=k("../lib/keys"),x=k("../lib/useragent"),s=L.KEY_MODS,c=function(){function i(n,e){this.$init(n,e,!1);}return i.prototype.$init=function(n,e,o){this.platform=e||(x.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(n),this.$singleCommand=o;},i.prototype.addCommand=function(n){this.commands[n.name]&&this.removeCommand(n),this.commands[n.name]=n,n.bindKey&&this._buildKeyHash(n);},i.prototype.removeCommand=function(n,e){var o=n&&(typeof n=="string"?n:n.name);n=this.commands[o],e||delete this.commands[o];var a=this.commandKeyBinding;for(var u in a){var w=a[u];if(w==n)delete a[u];else if(Array.isArray(w)){var S=w.indexOf(n);S!=-1&&(w.splice(S,1),w.length==1&&(a[u]=w[0]));}}},i.prototype.bindKey=function(n,e,o){if(typeof n=="object"&&n&&(o==null&&(o=n.position),n=n[this.platform]),!!n){if(typeof e=="function")return this.addCommand({exec:e,bindKey:n,name:e.name||n});n.split("|").forEach(function(a){var u="";if(a.indexOf(" ")!=-1){var w=a.split(/\s+/);a=w.pop(),w.forEach(function($){var d=this.parseKeys($),h=s[d.hashId]+d.key;u+=(u?" ":"")+h,this._addCommandToBinding(u,"chainKeys");},this),u+=" ";}var S=this.parseKeys(a),m=s[S.hashId]+S.key;this._addCommandToBinding(u+m,e,o);},this);}},i.prototype._addCommandToBinding=function(n,e,o){var a=this.commandKeyBinding,u;if(!e)delete a[n];else if(!a[n]||this.$singleCommand)a[n]=e;else {Array.isArray(a[n])?(u=a[n].indexOf(e))!=-1&&a[n].splice(u,1):a[n]=[a[n]],typeof o!="number"&&(o=r(e));var w=a[n];for(u=0;u<w.length;u++){var S=w[u],m=r(S);if(m>o)break}w.splice(u,0,e);}},i.prototype.addCommands=function(n){n&&Object.keys(n).forEach(function(e){var o=n[e];if(o){if(typeof o=="string")return this.bindKey(o,e);typeof o=="function"&&(o={exec:o}),typeof o=="object"&&(o.name||(o.name=e),this.addCommand(o));}},this);},i.prototype.removeCommands=function(n){Object.keys(n).forEach(function(e){this.removeCommand(n[e]);},this);},i.prototype.bindKeys=function(n){Object.keys(n).forEach(function(e){this.bindKey(e,n[e]);},this);},i.prototype._buildKeyHash=function(n){this.bindKey(n.bindKey,n);},i.prototype.parseKeys=function(n){var e=n.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(m){return m}),o=e.pop(),a=L[o];if(L.FUNCTION_KEYS[a])o=L.FUNCTION_KEYS[a].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return {key:o.toUpperCase(),hashId:-1}}else return {key:o,hashId:-1};for(var u=0,w=e.length;w--;){var S=L.KEY_MODS[e[w]];if(S==null)return typeof console<"u"&&console.error("invalid modifier "+e[w]+" in "+n),!1;u|=S;}return {key:o,hashId:u}},i.prototype.findKeyCommand=function(n,e){var o=s[n]+e;return this.commandKeyBinding[o]},i.prototype.handleKeyboard=function(n,e,o,a){if(!(a<0)){var u=s[e]+o,w=this.commandKeyBinding[u];return n.$keyChain&&(n.$keyChain+=" "+u,w=this.commandKeyBinding[n.$keyChain]||w),w&&(w=="chainKeys"||w[w.length-1]=="chainKeys")?(n.$keyChain=n.$keyChain||u,{command:"null"}):(n.$keyChain&&((!e||e==4)&&o.length==1?n.$keyChain=n.$keyChain.slice(0,-u.length-1):(e==-1||a>0)&&(n.$keyChain="")),{command:w})}},i.prototype.getStatusText=function(n,e){return e.$keyChain||""},i}();function r(i){return typeof i=="object"&&i.bindKey&&i.bindKey.position||(i.isDefault?-100:0)}var t=function(i){R(n,i);function n(e,o){var a=i.call(this,e,o)||this;return a.$singleCommand=!0,a}return n}(c);t.call=function(i,n,e){c.prototype.$init.call(i,n,e,!0);},c.call=function(i,n,e){c.prototype.$init.call(i,n,e,!1);},M.HashHandler=t,M.MultiHashHandler=c;});ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var r=function(t,i){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e;}||function(n,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);},r(t,i)};return function(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");r(t,i);function n(){this.constructor=t;}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n);}}(),L=k("../lib/oop"),x=k("../keyboard/hash_handler").MultiHashHandler,s=k("../lib/event_emitter").EventEmitter,c=function(r){R(t,r);function t(i,n){var e=r.call(this,n,i)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(o){return o.args?o.command.exec(o.editor,o.args,o.event,!1):o.command.exec(o.editor,{},o.event,!0)}),e}return t.prototype.exec=function(i,n,e){if(Array.isArray(i)){for(var o=i.length;o--;)if(this.exec(i[o],n,e))return !0;return !1}if(typeof i=="string"&&(i=this.commands[i]),!this.canExecute(i,n))return !1;var a={editor:n,command:i,args:e};return a.returnValue=this._emit("exec",a),this._signal("afterExec",a),a.returnValue!==!1},t.prototype.canExecute=function(i,n){return typeof i=="string"&&(i=this.commands[i]),!(!i||n&&n.$readOnly&&!i.readOnly||this.$checkCommandState!=!1&&i.isAvailable&&!i.isAvailable(n))},t.prototype.toggleRecording=function(i){if(!this.$inReplay)return i&&i._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(n){this.macro.push([n.command,n.args]);}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(i){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(i);try{this.$inReplay=!0,this.macro.forEach(function(n){typeof n=="string"?this.exec(n,i):this.exec(n[0],i,n[1]);},this);}finally{this.$inReplay=!1;}}},t.prototype.trimMacro=function(i){return i.map(function(n){return typeof n[0]!="string"&&(n[0]=n[0].name),n[1]||(n=n[0]),n})},t}(x);L.implement(c.prototype,s),M.CommandManager=c;});ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(k,M,H){var R=k("../lib/lang"),L=k("../config"),x=k("../range").Range;function s(r,t){return {win:r,mac:t}}M.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(r){L.loadModule("ace/ext/settings_menu",function(t){t.init(r),r.showSettingsMenu();});},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(r,1);});},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(r){L.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(r,-1);});},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(r){r.selectAll();},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(r){r.centerSelection();},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(r,t){typeof t=="number"&&!isNaN(t)&&r.gotoLine(t),r.prompt({$type:"gotoLine"});},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.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(r){r.session.toggleFold(!0);},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(r){r.session.toggleFoldWidget();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0);},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll();},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments();},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges());},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold();},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(r){r.findNext();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious();},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext();},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious();},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(t){t.Search(r);});},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite();},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.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(r){r.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(r){r.getSelection().selectUp();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(r,t){r.navigateUp(t.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(r){r.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(r){r.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(r){r.getSelection().selectDown();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(r,t){r.navigateDown(t.times);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(r){r.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(r){r.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(r){r.navigateLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(r,t){r.navigateLeft(t.times);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(r){r.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(r){r.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(r){r.navigateLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(r,t){r.navigateRight(t.times);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown();},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(r){r.scrollPageDown();},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown();},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp();},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(r){r.scrollPageUp();},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp();},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight);},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight);},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r);},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r);},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching();},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0);},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.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(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var t=r.$copyWithEmptySelection&&r.selection.isEmpty(),i=t?r.selection.getLineRange():r.selection.getRange();r._emit("cut",i),i.isEmpty()||r.session.remove(i),r.clearSelection();},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,t){r.$handlePaste(t);},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(r){r.removeLines();},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection();},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines();},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1);},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1);},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(r){L.loadModule("ace/ext/searchbox",function(t){t.Search(r,!0);});}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(r){r.undo();}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo();}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp();},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp();},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown();},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown();},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right");},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left");},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return !1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(r){var t=r.selection.getRange();t.start.column=0,r.session.remove(t);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(r){var t=r.selection.getRange();t.end.column=Number.MAX_VALUE,r.session.remove(t);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(r){r.indent();},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent();},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,t){r.insert(t);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,t){r.insert(R.stringRepeat(t.text||"",t.times||1));},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(r){r.splitLine();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters();},multiSelectAction:function(r){r.transposeSelections(1);},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(r){r.autoIndent();},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var t=r.selection.getRange();t.start.column=t.end.column=0,t.end.row++,r.selection.setRange(t,!1);},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(r){r.openLink();}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(r){for(var t=r.selection.isBackwards(),i=t?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),n=t?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),e=r.session.doc.getLine(i.row).length,o=r.session.doc.getTextRange(r.selection.getRange()),a=o.replace(/\n\s*/," ").length,u=r.session.doc.getLine(i.row),w=i.row+1;w<=n.row+1;w++){var S=R.stringTrimLeft(R.stringTrimRight(r.session.doc.getLine(w)));S.length!==0&&(S=" "+S),u+=S;}n.row+1<r.session.doc.getLength()-1&&(u+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new x(i.row,0,n.row+2,0),u),a>0?(r.selection.moveCursorTo(i.row,i.column),r.selection.selectTo(i.row,i.column+a)):(e=r.session.doc.getLine(i.row).length>e?e+1:e,r.selection.moveCursorTo(i.row,e));},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(r){var t=r.session.doc.getLength()-1,i=r.session.doc.getLine(t).length,n=r.selection.rangeList.ranges,e=[];n.length<1&&(n=[r.selection.getRange()]);for(var o=0;o<n.length;o++)o==n.length-1&&(n[o].end.row===t&&n[o].end.column===i||e.push(new x(n[o].end.row,n[o].end.column,t,i))),o===0?n[o].start.row===0&&n[o].start.column===0||e.push(new x(0,0,n[o].start.row,n[o].start.column)):e.push(new x(n[o-1].end.row,n[o-1].end.column,n[o].start.row,n[o].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var o=0;o<e.length;o++)r.selection.addRange(e[o],!1);},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
221
+ `);},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var t=r.getCursorPosition();r.selection.moveTo(t.row-1,Number.MAX_VALUE),r.insert(`
222
+ `),t.row===0&&r.navigateUp();},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"});},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(r){r.prompt({$type:"commands"});},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(r){r.prompt({$type:"modes"});},readOnly:!0}];for(var c=1;c<9;c++)M.commands.push({name:"foldToLevel"+c,description:"Fold To Level "+c,level:c,exec:function(r){r.session.foldToLevel(this.level);},scrollIntoView:"center",readOnly:!0});});ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("./lib/dom"),L=function(){function x(s){this.session=s,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);}return x.prototype.getRowLength=function(s){var c;return this.lineWidgets?c=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[s]?1+c:this.$wrapData[s].length+1+c},x.prototype.$getWidgetScreenLength=function(){var s=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(s+=c.rowCount);}),s},x.prototype.$onChangeEditor=function(s){this.attach(s.editor);},x.prototype.attach=function(s){s&&s.widgetManager&&s.widgetManager!=this&&s.widgetManager.detach(),this.editor!=s&&(this.detach(),this.editor=s,s&&(s.widgetManager=this,s.renderer.on("beforeRender",this.measureWidgets),s.renderer.on("afterRender",this.renderWidgets)));},x.prototype.detach=function(s){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 r=this.session.lineWidgets;r&&r.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el));});}},x.prototype.updateOnFold=function(s,c){var r=c.lineWidgets;if(!(!r||!s.action)){for(var t=s.data,i=t.start.row,n=t.end.row,e=s.action=="add",o=i+1;o<n;o++)r[o]&&(r[o].hidden=e);r[n]&&(e?r[i]?r[n].hidden=e:r[i]=r[n]:(r[i]==r[n]&&(r[i]=void 0),r[n].hidden=e));}},x.prototype.updateOnChange=function(s){var c=this.session.lineWidgets;if(c){var r=s.start.row,t=s.end.row-r;if(t!==0)if(s.action=="remove"){var i=c.splice(r+1,t);!c[r]&&i[i.length-1]&&(c[r]=i.pop()),i.forEach(function(e){e&&this.removeLineWidget(e);},this),this.$updateRows();}else {var n=new Array(t);c[r]&&c[r].column!=null&&s.start.column>c[r].column&&r++,n.unshift(r,0),c.splice.apply(c,n),this.$updateRows();}}},x.prototype.$updateRows=function(){var s=this.session.lineWidgets;if(s){var c=!0;s.forEach(function(r,t){if(r)for(c=!1,r.row=t;r.$oldWidget;)r.$oldWidget.row=t,r=r.$oldWidget;}),c&&(this.session.lineWidgets=null);}},x.prototype.$registerLineWidget=function(s){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[s.row];return c&&(s.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[s.row]=s,s},x.prototype.addLineWidget=function(s){if(this.$registerLineWidget(s),s.session=this.session,!this.editor)return s;var c=this.editor.renderer;s.html&&!s.el&&(s.el=R.createElement("div"),s.el.innerHTML=s.html),s.text&&!s.el&&(s.el=R.createElement("div"),s.el.textContent=s.text),s.el&&(R.addCssClass(s.el,"ace_lineWidgetContainer"),s.className&&R.addCssClass(s.el,s.className),s.el.style.position="absolute",s.el.style.zIndex="5",c.container.appendChild(s.el),s._inDocument=!0,s.coverGutter||(s.el.style.zIndex="3"),s.pixelHeight==null&&(s.pixelHeight=s.el.offsetHeight)),s.rowCount==null&&(s.rowCount=s.pixelHeight/c.layerConfig.lineHeight);var r=this.session.getFoldAt(s.row,0);if(s.$fold=r,r){var t=this.session.lineWidgets;s.row==r.end.row&&!t[r.start.row]?t[r.start.row]=s:s.hidden=!0;}return this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(s),s},x.prototype.removeLineWidget=function(s){if(s._inDocument=!1,s.session=null,s.el&&s.el.parentNode&&s.el.parentNode.removeChild(s.el),s.editor&&s.editor.destroy)try{s.editor.destroy();}catch{}if(this.session.lineWidgets){var c=this.session.lineWidgets[s.row];if(c==s)this.session.lineWidgets[s.row]=s.$oldWidget,s.$oldWidget&&this.onWidgetChanged(s.$oldWidget);else for(;c;){if(c.$oldWidget==s){c.$oldWidget=s.$oldWidget;break}c=c.$oldWidget;}}this.session._emit("changeFold",{data:{start:{row:s.row}}}),this.$updateRows();},x.prototype.getWidgetsAtRow=function(s){for(var c=this.session.lineWidgets,r=c&&c[s],t=[];r;)t.push(r),r=r.$oldWidget;return t},x.prototype.onWidgetChanged=function(s){this.session._changedWidgets.push(s),this.editor&&this.editor.renderer.updateFull();},x.prototype.measureWidgets=function(s,c){var r=this.session._changedWidgets,t=c.layerConfig;if(!(!r||!r.length)){for(var i=1/0,n=0;n<r.length;n++){var e=r[n];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,c.container.appendChild(e.el);}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/t.characterWidth));var o=e.h/t.lineHeight;e.coverLine&&(o-=this.session.getRowLineCount(e.row),o<0&&(o=0)),e.rowCount!=o&&(e.rowCount=o,e.row<i&&(i=e.row));}}i!=1/0&&(this.session._emit("changeFold",{data:{start:{row:i}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[];}},x.prototype.renderWidgets=function(s,c){var r=c.layerConfig,t=this.session.lineWidgets;if(t){for(var i=Math.min(this.firstRow,r.firstRow),n=Math.max(this.lastRow,r.lastRow,t.length);i>0&&!t[i];)i--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,c.$cursorLayer.config=r;for(var e=i;e<=n;e++){var o=t[e];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 a=c.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;o.coverLine||(a+=r.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=a-r.offset+"px";var u=o.coverGutter?0:c.gutterWidth;o.fixedWidth||(u-=c.scrollLeft),o.el.style.left=u+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=r.width+2*r.padding+"px"),o.fixedWidth?o.el.style.right=c.scrollBar.getWidth()+"px":o.el.style.right="";}}}},x}();M.LineWidgets=L;});ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(k,M,H){var R=k("../lib/keys"),L=k("../mouse/default_gutter_handler").GutterTooltip,x=function(){function c(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new L(this.editor);}return c.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this));},c.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this));},c.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===R.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=R.enter)return;r.preventDefault();var t=this.editor.getCursorPosition().row;this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var i=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),n=this.$findNearestFoldWidget(i),e=this.$findNearestAnnotation(i);if(!(n===null&&e===null)){if(n===null&&e!==null){this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(n!==null&&e===null){this.activeRowIndex=n,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(e-i)<Math.abs(n-i)){this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else {this.activeRowIndex=n,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout(function(){this.editor._signal("gutterkeydown",new s(r,this));}.bind(this),10);},c.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===R.tab){r.preventDefault();return}if(r.keyCode===R.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===R.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===R.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===R.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===R.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===R.enter||r.keyCode===R.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var t=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex));}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var i=this.lines.cells[this.activeRowIndex].element.childNodes[2],n=i.getBoundingClientRect(),e=this.annotationTooltip.getElement().style;e.left=n.right+"px",e.top=n.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},c.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip();},c.prototype.$isFoldWidgetVisible=function(r){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),i=this.$getFoldWidget(r).style.display!=="none";return t&&i},c.prototype.$isAnnotationVisible=function(r){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),i=this.$getAnnotation(r).style.display!=="none";return t&&i},c.prototype.$getFoldWidget=function(r){var t=this.lines.get(r),i=t.element;return i.childNodes[1]},c.prototype.$getAnnotation=function(r){var t=this.lines.get(r),i=t.element;return i.childNodes[2]},c.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var t=0;r-t>0||r+t<this.lines.getLength()-1;){if(t++,r-t>=0&&this.$isFoldWidgetVisible(r-t))return r-t;if(r+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+t))return r+t}return null},c.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var t=0;r-t>0||r+t<this.lines.getLength()-1;){if(t++,r-t>=0&&this.$isAnnotationVisible(r-t))return r-t;if(r+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+t))return r+t}return null},c.prototype.$focusFoldWidget=function(r){if(r!=null){var t=this.$getFoldWidget(r);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus();}},c.prototype.$focusAnnotation=function(r){if(r!=null){var t=this.$getAnnotation(r);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus();}},c.prototype.$blurFoldWidget=function(r){var t=this.$getFoldWidget(r);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur();},c.prototype.$blurAnnotation=function(r){var t=this.$getAnnotation(r);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur();},c.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},c.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},c.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},c.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var t=this.$findNearestAnnotation(this.activeRowIndex);if(t==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var i=this.$findNearestFoldWidget(this.activeRowIndex);if(i==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusFoldWidget(this.activeRowIndex);break}},c.prototype.$rowIndexToRow=function(r){var t=this.lines.get(r);return t?t.row:null},c.prototype.$rowToRowIndex=function(r){for(var t=0;t<this.lines.getLength();t++){var i=this.lines.get(t);if(i.row==r)return t}return null},c}();M.GutterKeyboardHandler=x;var s=function(){function c(r,t){this.gutterKeyboardHandler=t,this.domEvent=r;}return c.prototype.getKey=function(){return R.keyCodeToString(this.domEvent.keyCode)},c.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},c.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},c.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},c}();M.GutterKeyboardEvent=s;});ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(k,M,H){var R=this&&this.__values||function(p){var l=typeof Symbol=="function"&&Symbol.iterator,g=l&&p[l],A=0;if(g)return g.call(p);if(p&&typeof p.length=="number")return {next:function(){return p&&A>=p.length&&(p=void 0),{value:p&&p[A++],done:!p}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")},L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/lang"),c=k("./lib/useragent"),r=k("./keyboard/textinput").TextInput,t=k("./mouse/mouse_handler").MouseHandler,i=k("./mouse/fold_handler").FoldHandler,n=k("./keyboard/keybinding").KeyBinding,e=k("./edit_session").EditSession,o=k("./search").Search,a=k("./range").Range,u=k("./lib/event_emitter").EventEmitter,w=k("./commands/command_manager").CommandManager,S=k("./commands/default_commands").commands,m=k("./config"),$=k("./token_iterator").TokenIterator,d=k("./line_widgets").LineWidgets,h=k("./keyboard/gutter_handler").GutterKeyboardHandler,v=k("./config").nls,C=k("./clipboard"),y=k("./lib/keys"),b=function(){function p(l,g,A){this.session,this.$toDestroy=[];var T=l.getContainerElement();this.container=T,this.renderer=l,this.id="editor"+ ++p.$uid,this.commands=new w(c.isMac?"mac":"win",S),typeof document=="object"&&(this.textInput=new r(l.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new t(this),new i(this)),this.keyBinding=new n(this),this.$search=new o().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart();}.bind(this)),this.on("change",function(E,_){_._$emitInputEvent.schedule(31);}),this.setSession(g||A&&A.session||new e("")),m.resetOptions(this),A&&this.setOptions(A),m._signal("editor",this);}return p.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0;}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0;}.bind(this),!0);},p.prototype.startOperation=function(l){if(this.curOp){if(!l||this.curOp.command)return;this.prevOp=this.curOp;}l||(this.previousCommand=null,l={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:l.command||{},args:l.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON();},p.prototype.endOperation=function(l){if(this.curOp&&this.session){if(l&&l.returnValue===!1||!this.session)return this.curOp=null;if(l==!0&&this.curOp.command&&this.curOp.command.name=="mouse"||(this._signal("beforeEndOperation"),!this.curOp))return;var g=this.curOp.command,A=g&&g.scrollIntoView;if(A){switch(A){case"center-animate":A="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),E=this.renderer.layerConfig;(T.start.row>=E.lastRow||T.end.row<=E.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;}A=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop);}var _=this.selection.toJSON();this.curOp.selectionAfter=_,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(_),this.prevOp=this.curOp,this.curOp=null;}},p.prototype.$historyTracker=function(l){if(this.$mergeUndoDeltas){var g=this.prevOp,A=this.$mergeableCommands,T=g.command&&l.command.name==g.command.name;if(l.command.name=="insertstring"){var E=l.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(E)||/\s/.test(g.args)),this.mergeNextCommand=!0;}else T=T&&A.indexOf(l.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:A.indexOf(l.command.name)!==-1&&(this.sequenceStartTime=Date.now());}},p.prototype.setKeyboardHandler=function(l,g){if(l&&typeof l=="string"&&l!="ace"){this.$keybindingId=l;var A=this;m.loadModule(["keybinding",l],function(T){A.$keybindingId==l&&A.keyBinding.setKeyboardHandler(T&&T.handler),g&&g();});}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(l),g&&g();},p.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},p.prototype.setSession=function(l){if(this.session!=l){this.curOp&&this.endOperation(),this.curOp={};var g=this.session;if(g){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 A=this.session.getSelection();A.off("changeCursor",this.$onCursorChange),A.off("changeSelection",this.$onSelectionChange);}this.session=l,l?(this.$onDocumentChange=this.onDocumentChange.bind(this),l.on("change",this.$onDocumentChange),this.renderer.setSession(l),this.$onChangeMode=this.onChangeMode.bind(this),l.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),l.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),l.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),l.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),l.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),l.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=l.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(l)),this._signal("changeSession",{session:l,oldSession:g}),this.curOp=null,g&&g._signal("changeEditor",{oldEditor:this}),l&&l._signal("changeEditor",{editor:this}),l&&!l.destroyed&&l.bgTokenizer.scheduleStart();}},p.prototype.getSession=function(){return this.session},p.prototype.setValue=function(l,g){return this.session.doc.setValue(l),g?g==1?this.navigateFileEnd():g==-1&&this.navigateFileStart():this.selectAll(),l},p.prototype.getValue=function(){return this.session.getValue()},p.prototype.getSelection=function(){return this.selection},p.prototype.resize=function(l){this.renderer.onResize(l);},p.prototype.setTheme=function(l,g){this.renderer.setTheme(l,g);},p.prototype.getTheme=function(){return this.renderer.getTheme()},p.prototype.setStyle=function(l){this.renderer.setStyle(l);},p.prototype.unsetStyle=function(l){this.renderer.unsetStyle(l);},p.prototype.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},p.prototype.setFontSize=function(l){this.setOption("fontSize",l);},p.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var l=this;this.$highlightPending=!0,setTimeout(function(){l.$highlightPending=!1;var g=l.session;if(!(!g||g.destroyed)){g.$bracketHighlight&&(g.$bracketHighlight.markerIds.forEach(function(D){g.removeMarker(D);}),g.$bracketHighlight=null);var A=l.getCursorPosition(),T=l.getKeyboardHandler(),E=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(l),_=g.getMatchingBracketRanges(A,E);if(!_){var O=new $(g,A.row,A.column),I=O.getCurrentToken();if(I&&/\b(?:tag-open|tag-name)/.test(I.type)){var N=g.getMatchingTags(A);N&&(_=[N.openTagName.isEmpty()?N.openTag:N.openTagName,N.closeTagName.isEmpty()?N.closeTag:N.closeTagName]);}}if(!_&&g.$mode.getMatching&&(_=g.$mode.getMatching(l.session)),!_){l.getHighlightIndentGuides()&&l.renderer.$textLayer.$highlightIndentGuide();return}var F="ace_bracket";Array.isArray(_)?_.length==1&&(F="ace_error_bracket"):_=[_],_.length==2&&(a.comparePoints(_[0].end,_[1].start)==0?_=[a.fromPoints(_[0].start,_[1].end)]:a.comparePoints(_[0].start,_[1].end)==0&&(_=[a.fromPoints(_[1].start,_[0].end)])),g.$bracketHighlight={ranges:_,markerIds:_.map(function(D){return g.addMarker(D,F,"text")})},l.getHighlightIndentGuides()&&l.renderer.$textLayer.$highlightIndentGuide();}},50);}},p.prototype.focus=function(){this.textInput.focus();},p.prototype.isFocused=function(){return this.textInput.isFocused()},p.prototype.blur=function(){this.textInput.blur();},p.prototype.onFocus=function(l){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",l));},p.prototype.onBlur=function(l){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",l));},p.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine();},p.prototype.onDocumentChange=function(l){var g=this.session.$useWrapMode,A=l.start.row==l.end.row?l.end.row:1/0;this.renderer.updateLines(l.start.row,A,g),this._signal("change",l),this.$cursorChange();},p.prototype.onTokenizerUpdate=function(l){var g=l.data;this.renderer.updateLines(g.first,g.last);},p.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop());},p.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft());},p.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection");},p.prototype.$updateHighlightActiveLine=function(){var l=this.getSession(),g;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(g=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(g=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(g=!1)),l.$highlightLineMarker&&!g)l.removeMarker(l.$highlightLineMarker.id),l.$highlightLineMarker=null;else if(!l.$highlightLineMarker&&g){var A=new a(g.row,g.column,g.row,1/0);A.id=l.addMarker(A,"ace_active-line","screenLine"),l.$highlightLineMarker=A;}else g&&(l.$highlightLineMarker.start.row=g.row,l.$highlightLineMarker.end.row=g.row,l.$highlightLineMarker.start.column=g.column,l._signal("changeBackMarker"));},p.prototype.onSelectionChange=function(l){var g=this.session;if(g.$selectionMarker&&g.removeMarker(g.$selectionMarker),g.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else {var A=this.selection.getRange(),T=this.getSelectionStyle();g.$selectionMarker=g.addMarker(A,"ace_selection",T);}var E=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(E),this._signal("changeSelection");},p.prototype.$getSelectionHighLightRegexp=function(){var l=this.session,g=this.getSelectionRange();if(!(g.isEmpty()||g.isMultiLine())){var A=g.start.column,T=g.end.column,E=l.getLine(g.start.row),_=E.substring(A,T);if(!(_.length>5e3||!/[\w\d]/.test(_))){var O=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:_}),I=E.substring(A-1,T+1);if(O.test(I))return O}}},p.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers();},p.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers();},p.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints();},p.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations());},p.prototype.onChangeMode=function(l){this.renderer.updateText(),this._emit("changeMode",l);},p.prototype.onChangeWrapLimit=function(){this.renderer.updateFull();},p.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0);},p.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull();},p.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},p.prototype.getCopyText=function(){var l=this.getSelectedText(),g=this.session.doc.getNewLineCharacter(),A=!1;if(!l&&this.$copyWithEmptySelection){A=!0;for(var T=this.selection.getAllRanges(),E=0;E<T.length;E++){var _=T[E];E&&T[E-1].start.row==_.start.row||(l+=this.session.getLine(_.start.row)+g);}}var O={text:l};return this._signal("copy",O),C.lineMode=A?O.text:!1,O.text},p.prototype.onCopy=function(){this.commands.exec("copy",this);},p.prototype.onCut=function(){this.commands.exec("cut",this);},p.prototype.onPaste=function(l,g){var A={text:l,event:g};this.commands.exec("paste",this,A);},p.prototype.$handlePaste=function(l){typeof l=="string"&&(l={text:l}),this._signal("paste",l);var g=l.text,A=g===C.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)A?T.insert({row:this.selection.lead.row,column:0},g):this.insert(g);else if(A)this.selection.rangeList.ranges.forEach(function(F){T.insert({row:F.start.row,column:0},g);});else {var E=g.split(/\r\n|\r|\n/),_=this.selection.rangeList.ranges,O=E.length==2&&(!E[0]||!E[1]);if(E.length!=_.length||O)return this.commands.exec("insertstring",this,g);for(var I=_.length;I--;){var N=_[I];N.isEmpty()||T.remove(N),T.insert(N.start,E[I]);}}},p.prototype.execCommand=function(l,g){return this.commands.exec(l,this,g)},p.prototype.insert=function(l,g){var A=this.session,T=A.getMode(),E=this.getCursorPosition();if(this.getBehavioursEnabled()&&!g){var _=T.transformAction(A.getState(E.row),"insertion",this,A,l);_&&(l!==_.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),l=_.text);}if(l==" "&&(l=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&l.indexOf(`
223
+ `)==-1){var O=a.fromPoints(E,E);O.end.column+=l.length,this.session.remove(O);}}else {var O=this.getSelectionRange();E=this.session.remove(O),this.clearSelection();}if(l==`
224
+ `||l==`\r
225
+ `){var D=A.getLine(E.row);if(E.column>D.search(/\S|$/)){var I=D.substr(E.column).search(/\S|$/);A.doc.removeInLine(E.row,E.column,E.column+I);}}this.clearSelection();var N=E.column,F=A.getState(E.row),D=A.getLine(E.row),W=T.checkOutdent(F,D,l);if(A.insert(E,l),_&&_.selection&&(_.selection.length==2?this.selection.setSelectionRange(new a(E.row,N+_.selection[0],E.row,N+_.selection[1])):this.selection.setSelectionRange(new a(E.row+_.selection[0],_.selection[1],E.row+_.selection[2],_.selection[3]))),this.$enableAutoIndent){if(A.getDocument().isNewLine(l)){var B=T.getNextLineIndent(F,D.slice(0,E.column),A.getTabString());A.insert({row:E.row+1,column:0},B);}W&&T.autoOutdent(F,A,E.row);}},p.prototype.autoIndent=function(){for(var l=this.session,g=l.getMode(),A=this.selection.isEmpty()?[new a(0,0,l.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",E="",_="",O=l.getTabString(),I=0;I<A.length;I++)for(var N=A[I].start.row,F=A[I].end.row,D=N;D<=F;D++){D>0&&(T=l.getState(D-1),E=l.getLine(D-1),_=g.getNextLineIndent(T,E,O));var W=l.getLine(D),B=g.$getIndent(W);if(_!==B){if(B.length>0){var z=new a(D,0,D,B.length);l.remove(z);}_.length>0&&l.insert({row:D,column:0},_);}g.autoOutdent(T,l,D);}},p.prototype.onTextInput=function(l,g){if(!g)return this.keyBinding.onTextInput(l);this.startOperation({command:{name:"insertstring"}});var A=this.applyComposition.bind(this,l,g);this.selection.rangeCount?this.forEachSelection(A):A(),this.endOperation();},p.prototype.applyComposition=function(l,g){if(g.extendLeft||g.extendRight){var A=this.selection.getRange();A.start.column-=g.extendLeft,A.end.column+=g.extendRight,A.start.column<0&&(A.start.row--,A.start.column+=this.session.getLine(A.start.row).length+1),this.selection.setRange(A),!l&&!A.isEmpty()&&this.remove();}if((l||!this.selection.isEmpty())&&this.insert(l,!0),g.restoreStart||g.restoreEnd){var A=this.selection.getRange();A.start.column-=g.restoreStart,A.end.column-=g.restoreEnd,this.selection.setRange(A);}},p.prototype.onCommandKey=function(l,g,A){return this.keyBinding.onCommandKey(l,g,A)},p.prototype.setOverwrite=function(l){this.session.setOverwrite(l);},p.prototype.getOverwrite=function(){return this.session.getOverwrite()},p.prototype.toggleOverwrite=function(){this.session.toggleOverwrite();},p.prototype.setScrollSpeed=function(l){this.setOption("scrollSpeed",l);},p.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},p.prototype.setDragDelay=function(l){this.setOption("dragDelay",l);},p.prototype.getDragDelay=function(){return this.getOption("dragDelay")},p.prototype.setSelectionStyle=function(l){this.setOption("selectionStyle",l);},p.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},p.prototype.setHighlightActiveLine=function(l){this.setOption("highlightActiveLine",l);},p.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},p.prototype.setHighlightGutterLine=function(l){this.setOption("highlightGutterLine",l);},p.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},p.prototype.setHighlightSelectedWord=function(l){this.setOption("highlightSelectedWord",l);},p.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},p.prototype.setAnimatedScroll=function(l){this.renderer.setAnimatedScroll(l);},p.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},p.prototype.setShowInvisibles=function(l){this.renderer.setShowInvisibles(l);},p.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},p.prototype.setDisplayIndentGuides=function(l){this.renderer.setDisplayIndentGuides(l);},p.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},p.prototype.setHighlightIndentGuides=function(l){this.renderer.setHighlightIndentGuides(l);},p.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},p.prototype.setShowPrintMargin=function(l){this.renderer.setShowPrintMargin(l);},p.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},p.prototype.setPrintMarginColumn=function(l){this.renderer.setPrintMarginColumn(l);},p.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},p.prototype.setReadOnly=function(l){this.setOption("readOnly",l);},p.prototype.getReadOnly=function(){return this.getOption("readOnly")},p.prototype.setBehavioursEnabled=function(l){this.setOption("behavioursEnabled",l);},p.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},p.prototype.setWrapBehavioursEnabled=function(l){this.setOption("wrapBehavioursEnabled",l);},p.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},p.prototype.setShowFoldWidgets=function(l){this.setOption("showFoldWidgets",l);},p.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},p.prototype.setFadeFoldWidgets=function(l){this.setOption("fadeFoldWidgets",l);},p.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},p.prototype.remove=function(l){this.selection.isEmpty()&&(l=="left"?this.selection.selectLeft():this.selection.selectRight());var g=this.getSelectionRange();if(this.getBehavioursEnabled()){var A=this.session,T=A.getState(g.start.row),E=A.getMode().transformAction(T,"deletion",this,A,g);if(g.end.column===0){var _=A.getTextRange(g);if(_[_.length-1]==`
226
+ `){var O=A.getLine(g.end.row);/^\s+$/.test(O)&&(g.end.column=O.length);}}E&&(g=E);}this.session.remove(g),this.clearSelection();},p.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection();},p.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var l=this.getSelectionRange();l.start.column==l.end.column&&l.start.row==l.end.row&&(l.end.column=0,l.end.row++),this.session.remove(l),this.clearSelection();},p.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var l=this.getCursorPosition();this.insert(`
227
+ `),this.moveCursorToPosition(l);},p.prototype.setGhostText=function(l,g){this.session.widgetManager||(this.session.widgetManager=new d(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(l,g);},p.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText();},p.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var l=this.getCursorPosition(),g=l.column;if(g!==0){var A=this.session.getLine(l.row),T,E;g<A.length?(T=A.charAt(g)+A.charAt(g-1),E=new a(l.row,g-1,l.row,g+1)):(T=A.charAt(g-1)+A.charAt(g-2),E=new a(l.row,g-2,l.row,g)),this.session.replace(E,T),this.session.selection.moveToPosition(E.end);}}},p.prototype.toLowerCase=function(){var l=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var g=this.getSelectionRange(),A=this.session.getTextRange(g);this.session.replace(g,A.toLowerCase()),this.selection.setSelectionRange(l);},p.prototype.toUpperCase=function(){var l=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var g=this.getSelectionRange(),A=this.session.getTextRange(g);this.session.replace(g,A.toUpperCase()),this.selection.setSelectionRange(l);},p.prototype.indent=function(){var l=this.session,g=this.getSelectionRange();if(g.start.row<g.end.row){var A=this.$getSelectedRows();l.indentRows(A.first,A.last," ");return}else if(g.start.column<g.end.column){var T=l.getTextRange(g);if(!/^\s+$/.test(T)){var A=this.$getSelectedRows();l.indentRows(A.first,A.last," ");return}}var E=l.getLine(g.start.row),_=g.start,O=l.getTabSize(),I=l.documentToScreenColumn(_.row,_.column);if(this.session.getUseSoftTabs())var N=O-I%O,F=s.stringRepeat(" ",N);else {for(var N=I%O;E[g.start.column-1]==" "&&N;)g.start.column--,N--;this.selection.setSelectionRange(g),F=" ";}return this.insert(F)},p.prototype.blockIndent=function(){var l=this.$getSelectedRows();this.session.indentRows(l.first,l.last," ");},p.prototype.blockOutdent=function(){var l=this.session.getSelection();this.session.outdentRows(l.getRange());},p.prototype.sortLines=function(){for(var l=this.$getSelectedRows(),g=this.session,A=[],T=l.first;T<=l.last;T++)A.push(g.getLine(T));A.sort(function(O,I){return O.toLowerCase()<I.toLowerCase()?-1:O.toLowerCase()>I.toLowerCase()?1:0});for(var E=new a(0,0,0,0),T=l.first;T<=l.last;T++){var _=g.getLine(T);E.start.row=T,E.end.row=T,E.end.column=_.length,g.replace(E,A[T-l.first]);}},p.prototype.toggleCommentLines=function(){var l=this.session.getState(this.getCursorPosition().row),g=this.$getSelectedRows();this.session.getMode().toggleCommentLines(l,this.session,g.first,g.last);},p.prototype.toggleBlockComment=function(){var l=this.getCursorPosition(),g=this.session.getState(l.row),A=this.getSelectionRange();this.session.getMode().toggleBlockComment(g,this.session,A,l);},p.prototype.getNumberAt=function(l,g){var A=/[\-]?[0-9]+(?:\.[0-9]+)?/g;A.lastIndex=0;for(var T=this.session.getLine(l);A.lastIndex<g;){var E=A.exec(T);if(E.index<=g&&E.index+E[0].length>=g){var _={value:E[0],start:E.index,end:E.index+E[0].length};return _}}return null},p.prototype.modifyNumber=function(l){var g=this.selection.getCursor().row,A=this.selection.getCursor().column,T=new a(g,A-1,g,A),E=this.session.getTextRange(T);if(!isNaN(parseFloat(E))&&isFinite(E)){var _=this.getNumberAt(g,A);if(_){var O=_.value.indexOf(".")>=0?_.start+_.value.indexOf(".")+1:_.end,I=_.start+_.value.length-O,N=parseFloat(_.value);N*=Math.pow(10,I),O!==_.end&&A<O?l*=Math.pow(10,_.end-A-1):l*=Math.pow(10,_.end-A),N+=l,N/=Math.pow(10,I);var F=N.toFixed(I),D=new a(g,_.start,g,_.end);this.session.replace(D,F),this.moveCursorTo(g,Math.max(_.start+1,A+F.length-_.value.length));}}else this.toggleWord();},p.prototype.toggleWord=function(){var l=this.selection.getCursor().row,g=this.selection.getCursor().column;this.selection.selectWord();var A=this.getSelectedText(),T=this.selection.getWordRange().start.column,E=A.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),_=g-T-1;_<0&&(_=0);var O=0,I=0,N=this;A.match(/[A-Za-z0-9_]+/)&&E.forEach(function(Y,K){I=O+Y.length,_>=O&&_<=I&&(A=Y,N.selection.clearSelection(),N.moveCursorTo(l,O+T),N.selection.selectTo(l,I+T)),O=I;});for(var F=this.$toggleWordPairs,D,W=0;W<F.length;W++)for(var B=F[W],z=0;z<=1;z++){var G=+!z,U=A.match(new RegExp("^\\s?_?("+s.escapeRegExp(B[z])+")\\s?$","i"));if(U){var V=A.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(U[1])+")($|\\s)","g"));V&&(D=A.replace(new RegExp(s.escapeRegExp(B[z]),"i"),function(Y){var K=B[G];return Y.toUpperCase()==Y?K=K.toUpperCase():Y.charAt(0).toUpperCase()==Y.charAt(0)&&(K=K.substr(0,0)+B[G].charAt(0).toUpperCase()+K.substr(1)),K}),this.insert(D),D="");}}},p.prototype.findLinkAt=function(l,g){var A,T,E=this.session.getLine(l),_=E.split(/((?:https?|ftp):\/\/[\S]+)/),O=g;O<0&&(O=0);var I=0,N=0,F;try{for(var D=R(_),W=D.next();!W.done;W=D.next()){var B=W.value;if(N=I+B.length,O>=I&&O<=N&&B.match(/((?:https?|ftp):\/\/[\S]+)/)){F=B.replace(/[\s:.,'";}\]]+$/,"");break}I=N;}}catch(z){A={error:z};}finally{try{W&&!W.done&&(T=D.return)&&T.call(D);}finally{if(A)throw A.error}}return F},p.prototype.openLink=function(){var l=this.selection.getCursor(),g=this.findLinkAt(l.row,l.column);return g&&window.open(g,"_blank"),g!=null},p.prototype.removeLines=function(){var l=this.$getSelectedRows();this.session.removeFullLines(l.first,l.last),this.clearSelection();},p.prototype.duplicateSelection=function(){var l=this.selection,g=this.session,A=l.getRange(),T=l.isBackwards();if(A.isEmpty()){var E=A.start.row;g.duplicateLines(E,E);}else {var _=T?A.start:A.end,O=g.insert(_,g.getTextRange(A));A.start=_,A.end=O,l.setSelectionRange(A,T);}},p.prototype.moveLinesDown=function(){this.$moveLines(1,!1);},p.prototype.moveLinesUp=function(){this.$moveLines(-1,!1);},p.prototype.moveText=function(l,g,A){return this.session.moveText(l,g,A)},p.prototype.copyLinesUp=function(){this.$moveLines(-1,!0);},p.prototype.copyLinesDown=function(){this.$moveLines(1,!0);},p.prototype.$moveLines=function(l,g){var A,T,E=this.selection;if(!E.inMultiSelectMode||this.inVirtualSelectionMode){var _=E.toOrientedRange();A=this.$getSelectedRows(_),T=this.session.$moveLines(A.first,A.last,g?0:l),g&&l==-1&&(T=0),_.moveBy(T,0),E.fromOrientedRange(_);}else {var O=E.rangeList.ranges;E.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var I=0,N=0,F=O.length,D=0;D<F;D++){var W=D;O[D].moveBy(I,0),A=this.$getSelectedRows(O[D]);for(var B=A.first,z=A.last;++D<F;){N&&O[D].moveBy(N,0);var G=this.$getSelectedRows(O[D]);if(g&&G.first!=z)break;if(!g&&G.first>z+1)break;z=G.last;}for(D--,I=this.session.$moveLines(B,z,g?0:l),g&&l==-1&&(W=D+1);W<=D;)O[W].moveBy(I,0),W++;g||(I=0),N+=I;}E.fromOrientedRange(E.ranges[0]),E.rangeList.attach(this.session),this.inVirtualSelectionMode=!1;}},p.prototype.$getSelectedRows=function(l){return l=(l||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(l.start.row),last:this.session.getRowFoldEnd(l.end.row)}},p.prototype.onCompositionStart=function(l){this.renderer.showComposition(l);},p.prototype.onCompositionUpdate=function(l){this.renderer.setCompositionText(l);},p.prototype.onCompositionEnd=function(){this.renderer.hideComposition();},p.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},p.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},p.prototype.isRowVisible=function(l){return l>=this.getFirstVisibleRow()&&l<=this.getLastVisibleRow()},p.prototype.isRowFullyVisible=function(l){return l>=this.renderer.getFirstFullyVisibleRow()&&l<=this.renderer.getLastFullyVisibleRow()},p.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},p.prototype.$moveByPage=function(l,g){var A=this.renderer,T=this.renderer.layerConfig,E=l*Math.floor(T.height/T.lineHeight);g===!0?this.selection.$moveSelection(function(){this.moveCursorBy(E,0);}):g===!1&&(this.selection.moveCursorBy(E,0),this.selection.clearSelection());var _=A.scrollTop;A.scrollBy(0,E*T.lineHeight),g!=null&&A.scrollCursorIntoView(null,.5),A.animateScrolling(_);},p.prototype.selectPageDown=function(){this.$moveByPage(1,!0);},p.prototype.selectPageUp=function(){this.$moveByPage(-1,!0);},p.prototype.gotoPageDown=function(){this.$moveByPage(1,!1);},p.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1);},p.prototype.scrollPageDown=function(){this.$moveByPage(1);},p.prototype.scrollPageUp=function(){this.$moveByPage(-1);},p.prototype.scrollToRow=function(l){this.renderer.scrollToRow(l);},p.prototype.scrollToLine=function(l,g,A,T){this.renderer.scrollToLine(l,g,A,T);},p.prototype.centerSelection=function(){var l=this.getSelectionRange(),g={row:Math.floor(l.start.row+(l.end.row-l.start.row)/2),column:Math.floor(l.start.column+(l.end.column-l.start.column)/2)};this.renderer.alignCursor(g,.5);},p.prototype.getCursorPosition=function(){return this.selection.getCursor()},p.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},p.prototype.getSelectionRange=function(){return this.selection.getRange()},p.prototype.selectAll=function(){this.selection.selectAll();},p.prototype.clearSelection=function(){this.selection.clearSelection();},p.prototype.moveCursorTo=function(l,g){this.selection.moveCursorTo(l,g);},p.prototype.moveCursorToPosition=function(l){this.selection.moveCursorToPosition(l);},p.prototype.jumpToMatching=function(l,g){var A=this.getCursorPosition(),T=new $(this.session,A.row,A.column),E=T.getCurrentToken(),_=0;E&&E.type.indexOf("tag-name")!==-1&&(E=T.stepBackward());var O=E||T.stepForward();if(O){var I,N=!1,F={},D=A.column-O.start,W,B={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(O.value.match(/[{}()\[\]]/g)){for(;D<O.value.length&&!N;D++)if(B[O.value[D]])switch(W=B[O.value[D]]+"."+O.type.replace("rparen","lparen"),isNaN(F[W])&&(F[W]=0),O.value[D]){case"(":case"[":case"{":F[W]++;break;case")":case"]":case"}":F[W]--,F[W]===-1&&(I="bracket",N=!0);break}}else O.type.indexOf("tag-name")!==-1&&(isNaN(F[O.value])&&(F[O.value]=0),E.value==="<"&&_>1?F[O.value]++:E.value==="</"&&F[O.value]--,F[O.value]===-1&&(I="tag",N=!0));N||(E=O,_++,O=T.stepForward(),D=0);}while(O&&!N);if(I){var z,G;if(I==="bracket")z=this.session.getBracketRange(A),z||(z=new a(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+D-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+D-1),G=z.start,(g||G.row===A.row&&Math.abs(G.column-A.column)<2)&&(z=this.session.getBracketRange(G)));else if(I==="tag"){if(!O||O.type.indexOf("tag-name")===-1)return;if(z=new a(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),z.compare(A.row,A.column)===0){var U=this.session.getMatchingTags(A);U&&(U.openTag.contains(A.row,A.column)?(z=U.closeTag,G=z.start):(z=U.openTag,U.closeTag.start.row===A.row&&U.closeTag.start.column===A.column?G=z.end:G=z.start));}G=G||z.start;}G=z&&z.cursor||G,G&&(l?z&&g?this.selection.setRange(z):z&&z.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column));}}},p.prototype.gotoLine=function(l,g,A){this.selection.clearSelection(),this.session.unfold({row:l-1,column:g||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(l-1,g||0),this.isRowFullyVisible(l-1)||this.scrollToLine(l-1,!0,A);},p.prototype.navigateTo=function(l,g){this.selection.moveTo(l,g);},p.prototype.navigateUp=function(l){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var g=this.selection.anchor.getPosition();return this.moveCursorToPosition(g)}this.selection.clearSelection(),this.selection.moveCursorBy(-l||-1,0);},p.prototype.navigateDown=function(l){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var g=this.selection.anchor.getPosition();return this.moveCursorToPosition(g)}this.selection.clearSelection(),this.selection.moveCursorBy(l||1,0);},p.prototype.navigateLeft=function(l){if(this.selection.isEmpty())for(l=l||1;l--;)this.selection.moveCursorLeft();else {var g=this.getSelectionRange().start;this.moveCursorToPosition(g);}this.clearSelection();},p.prototype.navigateRight=function(l){if(this.selection.isEmpty())for(l=l||1;l--;)this.selection.moveCursorRight();else {var g=this.getSelectionRange().end;this.moveCursorToPosition(g);}this.clearSelection();},p.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection();},p.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection();},p.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection();},p.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection();},p.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection();},p.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection();},p.prototype.replace=function(l,g){g&&this.$search.set(g);var A=this.$search.find(this.session),T=0;return A&&(this.$tryReplace(A,l)&&(T=1),this.selection.setSelectionRange(A),this.renderer.scrollSelectionIntoView(A.start,A.end)),T},p.prototype.replaceAll=function(l,g){g&&this.$search.set(g);var A=this.$search.findAll(this.session),T=0;if(!A.length)return T;var E=this.getSelectionRange();this.selection.moveTo(0,0);for(var _=A.length-1;_>=0;--_)this.$tryReplace(A[_],l)&&T++;return this.selection.setSelectionRange(E),T},p.prototype.$tryReplace=function(l,g){var A=this.session.getTextRange(l);return g=this.$search.replace(A,g),g!==null?(l.end=this.session.replace(l,g),l):null},p.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},p.prototype.find=function(l,g,A){g||(g={}),typeof l=="string"||l instanceof RegExp?g.needle=l:typeof l=="object"&&L.mixin(g,l);var T=this.selection.getRange();g.needle==null&&(l=this.session.getTextRange(T)||this.$search.$options.needle,l||(T=this.session.getWordRange(T.start.row,T.start.column),l=this.session.getTextRange(T)),this.$search.set({needle:l})),this.$search.set(g),g.start||this.$search.set({start:T});var E=this.$search.find(this.session);if(g.preventScroll)return E;if(E)return this.revealRange(E,A),E;g.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T);},p.prototype.findNext=function(l,g){this.find({skipCurrent:!0,backwards:!1},l,g);},p.prototype.findPrevious=function(l,g){this.find(l,{skipCurrent:!0,backwards:!0},g);},p.prototype.revealRange=function(l,g){this.session.unfold(l),this.selection.setSelectionRange(l);var A=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(l.start,l.end,.5),g!==!1&&this.renderer.animateScrolling(A);},p.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5);},p.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5);},p.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(l){l.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();},p.prototype.setAutoScrollEditorIntoView=function(l){if(l){var g,A=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var E=this.$scrollAnchor;E.style.cssText="position:absolute",this.container.insertBefore(E,this.container.firstChild);var _=this.on("changeSelection",function(){T=!0;}),O=this.renderer.on("beforeRender",function(){T&&(g=A.renderer.container.getBoundingClientRect());}),I=this.renderer.on("afterRender",function(){if(T&&g&&(A.isFocused()||A.searchBox&&A.searchBox.isFocused())){var N=A.renderer,F=N.$cursorLayer.$pixelPos,D=N.layerConfig,W=F.top-D.offset;F.top>=0&&W+g.top<0?T=!0:F.top<D.height&&F.top+g.top+D.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(E.style.top=W+"px",E.style.left=F.left+"px",E.style.height=D.lineHeight+"px",E.scrollIntoView(T)),T=g=null;}});this.setAutoScrollEditorIntoView=function(N){N||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",_),this.renderer.off("afterRender",I),this.renderer.off("beforeRender",O));};}},p.prototype.$resetCursorStyle=function(){var l=this.$cursorStyle||"ace",g=this.renderer.$cursorLayer;g&&(g.setSmoothBlinking(/smooth/.test(l)),g.isBlinking=!this.$readOnly&&l!="wide",x.setCssClass(g.element,"ace_slim-cursors",/slim/.test(l)));},p.prototype.prompt=function(l,g,A){var T=this;m.loadModule("ace/ext/prompt",function(E){E.prompt(T,l,g,A);});},p}();b.$uid=0,b.prototype.curOp=null,b.prototype.prevOp={},b.prototype.$mergeableCommands=["backspace","del","insertstring"],b.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],L.implement(b.prototype,u),m.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(p){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:p});},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine();},initialValue:!0},highlightSelectedWord:{set:function(p){this.$onSelectionChange();},initialValue:!0},readOnly:{set:function(p){this.textInput.setReadOnly(p),this.$resetCursorStyle();},initialValue:!1},copyWithEmptySelection:{set:function(p){this.textInput.setCopyWithEmptySelection(p);},initialValue:!1},cursorStyle:{set:function(p){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(p){this.setAutoScrollEditorIntoView(p);}},keyboardHandler:{set:function(p){this.setKeyboardHandler(p);},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(p){this.session.setValue(p);},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(p){this.setSession(p);},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(p){this.renderer.$gutterLayer.setShowLineNumbers(p),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),p&&this.$relativeLineNumbers?f.attach(this):f.detach(this);},initialValue:!0},relativeLineNumbers:{set:function(p){this.$showLineNumbers&&p?f.attach(this):f.detach(this);}},placeholder:{set:function(p){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var l=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(l&&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(!l&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var g=x.createElement("div");g.className="ace_placeholder",g.textContent=this.$placeholder||"",this.renderer.placeholderNode=g,this.renderer.content.appendChild(this.renderer.placeholderNode);}else !l&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder();}},enableKeyboardAccessibility:{set:function(p){var l={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus();},readOnly:!0},g=function(T){if(T.target==this.renderer.scroller&&T.keyCode===y.enter){T.preventDefault();var E=this.getCursorPosition().row;this.isRowVisible(E)||this.scrollToLine(E,!0,!0),this.focus();}},A;p?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(c.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",v("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",v("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",g.bind(this)),this.commands.addCommand(l),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",v("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",v("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),A||(A=new h(this)),A.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",g.bind(this)),this.commands.removeCommand(l),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),A&&A.removeListener());},initialValue:!1},textInputAriaLabel:{set:function(p){this.$textInputAriaLabel=p;},initialValue:""},enableMobileMenu:{set:function(p){this.$enableMobileMenu=p;},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var f={getText:function(p,l){return (Math.abs(p.selection.lead.row-l)||l+1+(l<9?"\xB7":""))+""},getWidth:function(p,l,g){return Math.max(l.toString().length,(g.lastRow+1).toString().length,2)*g.characterWidth},update:function(p,l){l.renderer.$loop.schedule(l.renderer.CHANGE_GUTTER);},attach:function(p){p.renderer.$gutterLayer.$renderer=this,p.on("changeSelection",this.update),this.update(null,p);},detach:function(p){p.renderer.$gutterLayer.$renderer==this&&(p.renderer.$gutterLayer.$renderer=null),p.off("changeSelection",this.update),this.update(null,p);}};M.Editor=b;});ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s,c){this.element=s,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0;}return x.prototype.moveContainer=function(s){R.translate(this.element,0,-(s.firstRowScreen*s.lineHeight%this.canvasHeight)-s.offset*this.$offsetCoefficient);},x.prototype.pageChanged=function(s,c){return Math.floor(s.firstRowScreen*s.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},x.prototype.computeLineTop=function(s,c,r){var t=c.firstRowScreen*c.lineHeight,i=Math.floor(t/this.canvasHeight),n=r.documentToScreenRow(s,0)*c.lineHeight;return n-i*this.canvasHeight},x.prototype.computeLineHeight=function(s,c,r){return c.lineHeight*r.getRowLineCount(s)},x.prototype.getLength=function(){return this.cells.length},x.prototype.get=function(s){return this.cells[s]},x.prototype.shift=function(){this.$cacheCell(this.cells.shift());},x.prototype.pop=function(){this.$cacheCell(this.cells.pop());},x.prototype.push=function(s){if(Array.isArray(s)){this.cells.push.apply(this.cells,s);for(var c=R.createFragment(this.element),r=0;r<s.length;r++)c.appendChild(s[r].element);this.element.appendChild(c);}else this.cells.push(s),this.element.appendChild(s.element);},x.prototype.unshift=function(s){if(Array.isArray(s)){this.cells.unshift.apply(this.cells,s);for(var c=R.createFragment(this.element),r=0;r<s.length;r++)c.appendChild(s[r].element);this.element.firstChild?this.element.insertBefore(c,this.element.firstChild):this.element.appendChild(c);}else this.cells.unshift(s),this.element.insertAdjacentElement("afterbegin",s.element);},x.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},x.prototype.$cacheCell=function(s){s&&(s.element.remove(),this.cellCache.push(s));},x.prototype.createCell=function(s,c,r,t){var i=this.cellCache.pop();if(!i){var n=R.createElement("div");t&&t(n),this.element.appendChild(n),i={element:n,text:"",row:s};}return i.row=s,i},x}();M.Lines=L;});ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/oop"),x=k("../lib/lang"),s=k("../lib/event_emitter").EventEmitter,c=k("./lines").Lines,r=k("../config").nls,t=function(){function n(e){this.element=R.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new c(this.element),this.$lines.$offsetCoefficient=1;}return n.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations);},n.prototype.addGutterDecoration=function(e,o){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,o);},n.prototype.removeGutterDecoration=function(e,o){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,o);},n.prototype.setAnnotations=function(e){this.$annotations=[];for(var o=0;o<e.length;o++){var a=e[o],u=a.row,w=this.$annotations[u];w||(w=this.$annotations[u]={text:[],type:[],displayText:[]});var S=a.text,m=a.text,$=a.type;S=S?x.escapeHTML(S):a.html||"",m=m||a.html||"",w.text.indexOf(S)===-1&&(w.text.push(S),w.type.push($),w.displayText.push(m));var d=a.className;d?w.className=d:$=="error"?w.className=" ace_error":$=="warning"&&w.className!=" ace_error"?w.className=" ace_warning":$=="info"&&!w.className&&(w.className=" ace_info");}},n.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var o=e.start.row,a=e.end.row-o;if(a!==0)if(e.action=="remove")this.$annotations.splice(o,a+1,null);else {var u=new Array(a+1);u.unshift(o,1),this.$annotations.splice.apply(this.$annotations,u);}}},n.prototype.update=function(e){this.config=e;var o=this.session,a=e.firstRow,u=Math.min(e.lastRow+e.gutterOffset,o.getLength()-1);this.oldLastRow=u,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var w=o.getNextFoldLine(a),S=w?w.start.row:1/0,m=null,$=-1,d=a;;){if(d>S&&(d=w.end.row+1,w=o.getNextFoldLine(d,w),S=w?w.start.row:1/0),d>u){for(;this.$lines.getLength()>$+1;)this.$lines.pop();break}m=this.$lines.get(++$),m?m.row=d:(m=this.$lines.createCell(d,e,this.session,i),this.$lines.push(m)),this.$renderCell(m,e,w,d),d++;}this._signal("afterRender"),this.$updateGutterWidth(e);},n.prototype.$updateGutterWidth=function(e){var o=this.session,a=o.gutterRenderer||this.$renderer,u=o.$firstLineNumber,w=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||o.$useWrapMode)&&(w=o.getLength()+u-1);var S=a?a.getWidth(o,w,e):w.toString().length*e.characterWidth,m=this.$padding||this.$computePadding();S+=m.left+m.right,S!==this.gutterWidth&&!isNaN(S)&&(this.gutterWidth=S,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",S));},n.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row);}},n.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var o=this.$lines.cells;this.$cursorCell=null;for(var a=0;a<o.length;a++){var u=o[a];if(u.row>=this.$cursorRow){if(u.row>this.$cursorRow){var w=this.session.getFoldLine(this.$cursorRow);if(a>0&&w&&w.start.row==o[a-1].row)u=o[a-1];else break}u.element.className="ace_gutter-active-line "+u.element.className,this.$cursorCell=u;break}}}}},n.prototype.scrollLines=function(e){var o=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(o,e))return this.update(e);this.$lines.moveContainer(e);var a=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),u=this.oldLastRow;if(this.oldLastRow=a,!o||u<e.firstRow)return this.update(e);if(a<o.firstRow)return this.update(e);if(o.firstRow<e.firstRow)for(var w=this.session.getFoldedRowCount(o.firstRow,e.firstRow-1);w>0;w--)this.$lines.shift();if(u>a)for(var w=this.session.getFoldedRowCount(a+1,u);w>0;w--)this.$lines.pop();e.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,o.firstRow-1)),a>u&&this.$lines.push(this.$renderLines(e,u+1,a)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e);},n.prototype.$renderLines=function(e,o,a){for(var u=[],w=o,S=this.session.getNextFoldLine(w),m=S?S.start.row:1/0;w>m&&(w=S.end.row+1,S=this.session.getNextFoldLine(w,S),m=S?S.start.row:1/0),!(w>a);){var $=this.$lines.createCell(w,e,this.session,i);this.$renderCell($,e,S,w),u.push($),w++;}return u},n.prototype.$renderCell=function(e,o,a,u){var w=e.element,S=this.session,m=w.childNodes[0],$=w.childNodes[1],d=w.childNodes[2],h=d.firstChild,v=S.$firstLineNumber,C=S.$breakpoints,y=S.$decorations,b=S.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&S.foldWidgets,p=a?a.start.row:Number.MAX_VALUE,l=o.lineHeight+"px",g=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",A=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(b?b.getText(S,u):u+v).toString();if(this.$highlightGutterLine&&(u==this.$cursorRow||a&&u<this.$cursorRow&&u>=p&&this.$cursorRow<=a.end.row)&&(g+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),C[u]&&(g+=C[u]),y[u]&&(g+=y[u]),this.$annotations[u]&&u!==p&&(g+=this.$annotations[u].className),f){var E=f[u];E==null&&(E=f[u]=S.getFoldWidget(u));}if(E){var _="ace_fold-widget ace_"+E,O=E=="start"&&u==p&&u<a.end.row;if(O){_+=" ace_closed";for(var I="",N=!1,F=u+1;F<=a.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){N=!0,I=" ace_error_fold";break}if(this.$annotations[F].className===" ace_warning"){N=!0,I=" ace_warning_fold";continue}}g+=I;}else _+=" ace_open";$.className!=_&&($.className=_),R.setStyle($.style,"height",l),R.setStyle($.style,"display","inline-block"),$.setAttribute("role","button"),$.setAttribute("tabindex","-1");var D=S.getFoldWidgetRange(u);D?$.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[D.start.row+1,D.end.row+1])):a?$.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[a.start.row+1,a.end.row+1])):$.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[u+1])),O?($.setAttribute("aria-expanded","false"),$.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):($.setAttribute("aria-expanded","true"),$.setAttribute("title",r("gutter.code-folding.open.title","Fold code")));}else $&&(R.setStyle($.style,"display","none"),$.setAttribute("tabindex","0"),$.removeAttribute("role"),$.removeAttribute("aria-label"));if(N&&this.$showFoldedAnnotations){d.className="ace_gutter_annotation",h.className=A,h.className+=I,R.setStyle(h.style,"height",l),R.setStyle(d.style,"display","block"),R.setStyle(d.style,"height",l);var W;switch(I){case" ace_error_fold":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning_fold":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break}d.setAttribute("aria-label",W),d.setAttribute("tabindex","-1"),d.setAttribute("role","button");}else if(this.$annotations[u]){d.className="ace_gutter_annotation",h.className=A,this.$useSvgGutterIcons?h.className+=this.$annotations[u].className:w.classList.add(this.$annotations[u].className.replace(" ","")),R.setStyle(h.style,"height",l),R.setStyle(d.style,"display","block"),R.setStyle(d.style,"height",l);var W;switch(this.$annotations[u].className){case" ace_error":W=r("gutter.annotation.aria-label.error","Read annotations row $0",[T]);break;case" ace_warning":W=r("gutter.annotation.aria-label.warning","Read annotations row $0",[T]);break;case" ace_info":W=r("gutter.annotation.aria-label.info","Read annotations row $0",[T]);break}d.setAttribute("aria-label",W),d.setAttribute("tabindex","-1"),d.setAttribute("role","button");}else R.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0");return T!==m.data&&(m.data=T),w.className!=g&&(w.className=g),R.setStyle(e.element.style,"height",this.$lines.computeLineHeight(u,o,S)+"px"),R.setStyle(e.element.style,"top",this.$lines.computeLineTop(u,o,S)+"px"),e.text=T,d.style.display==="none"&&$.style.display==="none"?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},n.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e;},n.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return ""}};},n.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},n.prototype.setShowFoldWidgets=function(e){e?R.addCssClass(this.element,"ace_folding-enabled"):R.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null;},n.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},n.prototype.$computePadding=function(){if(!this.element.firstChild)return {left:0,right:0};var e=R.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},n.prototype.getRegion=function(e){var o=this.$padding||this.$computePadding(),a=this.element.getBoundingClientRect();if(e.x<o.left+a.left)return "markers";if(this.$showFoldWidgets&&e.x>a.right-o.right)return "foldWidgets"},n}();t.prototype.$fixedWidth=!1,t.prototype.$highlightGutterLine=!0,t.prototype.$renderer="",t.prototype.$showLineNumbers=!0,t.prototype.$showFoldWidgets=!0,L.implement(t.prototype,s);function i(n){var e=document.createTextNode("");n.appendChild(e);var o=R.createElement("span");n.appendChild(o);var a=R.createElement("span");n.appendChild(a);var u=R.createElement("span");return a.appendChild(u),n}M.Gutter=t;});ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(k,M,H){var R=k("../range").Range,L=k("../lib/dom"),x=function(){function c(r){this.element=L.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element);}return c.prototype.setPadding=function(r){this.$padding=r;},c.prototype.setSession=function(r){this.session=r;},c.prototype.setMarkers=function(r){this.markers=r;},c.prototype.elt=function(r,t){var i=this.i!=-1&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=r;},c.prototype.update=function(r){if(r){this.config=r,this.i=0;var t;for(var i in this.markers){var n=this.markers[i];if(!n.range){n.update(t,this,this.session,r);continue}var e=n.range.clipRows(r.firstRow,r.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),n.renderer){var o=this.$getTop(e.start.row,r),a=this.$padding+e.start.column*r.characterWidth;n.renderer(t,e,a,o,r);}else n.type=="fullLine"?this.drawFullLineMarker(t,e,n.clazz,r):n.type=="screenLine"?this.drawScreenLineMarker(t,e,n.clazz,r):e.isMultiLine()?n.type=="text"?this.drawTextMarker(t,e,n.clazz,r):this.drawMultiLineMarker(t,e,n.clazz,r):this.drawSingleLineMarker(t,e,n.clazz+" ace_start ace_br15",r);}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild);}},c.prototype.$getTop=function(r,t){return (r-t.firstRowScreen)*t.lineHeight},c.prototype.drawTextMarker=function(r,t,i,n,e){for(var o=this.session,a=t.start.row,u=t.end.row,w=a,S=0,m=0,$=o.getScreenLastRowColumn(w),d=new R(w,t.start.column,w,m);w<=u;w++)d.start.row=d.end.row=w,d.start.column=w==a?t.start.column:o.getRowWrapIndent(w),d.end.column=$,S=m,m=$,$=w+1<u?o.getScreenLastRowColumn(w+1):w==u?0:t.end.column,this.drawSingleLineMarker(r,d,i+(w==a?" ace_start":"")+" ace_br"+s(w==a||w==a+1&&t.start.column,S<m,m>$,w==u),n,w==u?0:1,e);},c.prototype.drawMultiLineMarker=function(r,t,i,n,e){var o=this.$padding,a=n.lineHeight,u=this.$getTop(t.start.row,n),w=o+t.start.column*n.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var S=t.clone();S.end.row=S.start.row,S.end.column=this.session.getLine(S.start.row).length,this.drawBidiSingleLineMarker(r,S,i+" ace_br1 ace_start",n,null,e);}else this.elt(i+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+u+"px;left:"+w+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var S=t.clone();S.start.row=S.end.row,S.start.column=0,this.drawBidiSingleLineMarker(r,S,i+" ace_br12",n,null,e);}else {u=this.$getTop(t.end.row,n);var m=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+a+"px;width:"+m+"px;top:"+u+"px;left:"+o+"px;"+(e||""));}if(a=(t.end.row-t.start.row-1)*n.lineHeight,!(a<=0)){u=this.$getTop(t.start.row+1,n);var $=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+($?" ace_br"+$:""),"height:"+a+"px;right:0;top:"+u+"px;left:"+o+"px;"+(e||""));}},c.prototype.drawSingleLineMarker=function(r,t,i,n,e,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(r,t,i,n,e,o);var a=n.lineHeight,u=(t.end.column+(e||0)-t.start.column)*n.characterWidth,w=this.$getTop(t.start.row,n),S=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+a+"px;width:"+u+"px;top:"+w+"px;left:"+S+"px;"+(o||""));},c.prototype.drawBidiSingleLineMarker=function(r,t,i,n,e,o){var a=n.lineHeight,u=this.$getTop(t.start.row,n),w=this.$padding,S=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);S.forEach(function(m){this.elt(i,"height:"+a+"px;width:"+(m.width+(e||0))+"px;top:"+u+"px;left:"+(w+m.left)+"px;"+(o||""));},this);},c.prototype.drawFullLineMarker=function(r,t,i,n,e){var o=this.$getTop(t.start.row,n),a=n.lineHeight;t.start.row!=t.end.row&&(a+=this.$getTop(t.end.row,n)-o),this.elt(i,"height:"+a+"px;top:"+o+"px;left:0;right:0;"+(e||""));},c.prototype.drawScreenLineMarker=function(r,t,i,n,e){var o=this.$getTop(t.start.row,n),a=n.lineHeight;this.elt(i,"height:"+a+"px;top:"+o+"px;left:0;right:0;"+(e||""));},c}();x.prototype.$padding=0;function s(c,r,t,i){return (c?1:0)|(r?2:0)|(t?4:0)|(i?8:0)}M.Marker=x;});ace.define("ace/layer/text_util",["require","exports","module"],function(k,M,H){var R=new Set(["text","rparen","lparen"]);M.isTextToken=function(L){return R.has(L)};});ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(k,M,H){var R=k("../lib/oop"),L=k("../lib/dom"),x=k("../lib/lang"),s=k("./lines").Lines,c=k("../lib/event_emitter").EventEmitter,r=k("../config").nls,t=k("./text_util").isTextToken,i=function(){function n(e){this.dom=L,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 s(this.element);}return n.prototype.$updateEolChar=function(){var e=this.session.doc,o=e.getNewLineCharacter()==`
228
+ `&&e.getNewLineMode()!="windows",a=o?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=a)return this.EOL_CHAR=a,!0},n.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px";},n.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},n.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},n.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(o){this._signal("changeCharacterSize",o);}.bind(this)),this.$pollSizeChanges();},n.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges();},n.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},n.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString();},n.prototype.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)},n.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},n.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},n.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var o=this.$tabStrings=[0],a=1;a<e+1;a++)if(this.showTabs){var u=this.dom.createElement("span");u.className="ace_invisible ace_invisible_tab",u.textContent=x.stringRepeat(this.TAB_CHAR,a),o.push(u);}else o.push(this.dom.createTextNode(x.stringRepeat(" ",a),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var w="ace_indent-guide",S=this.showSpaces?" ace_invisible ace_invisible_space":"",m=this.showSpaces?x.stringRepeat(this.SPACE_CHAR,this.tabSize):x.stringRepeat(" ",this.tabSize),$=this.showTabs?" ace_invisible ace_invisible_tab":"",d=this.showTabs?x.stringRepeat(this.TAB_CHAR,this.tabSize):m,u=this.dom.createElement("span");u.className=w+S,u.textContent=m,this.$tabStrings[" "]=u;var u=this.dom.createElement("span");u.className=w+$,u.textContent=d,this.$tabStrings[" "]=u;}},n.prototype.updateLines=function(e,o,a){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var u=Math.max(o,e.firstRow),w=Math.min(a,e.lastRow),S=this.element.childNodes,m=0,d=e.firstRow;d<u;d++){var h=this.session.getFoldLine(d);if(h)if(h.containsRow(u)){u=h.start.row;break}else d=h.end.row;m++;}for(var $=!1,d=u,h=this.session.getNextFoldLine(d),v=h?h.start.row:1/0;d>v&&(d=h.end.row+1,h=this.session.getNextFoldLine(d,h),v=h?h.start.row:1/0),!(d>w);){var C=S[m++];if(C){this.dom.removeChildren(C),this.$renderLine(C,d,d==v?h:!1),$&&(C.style.top=this.$lines.computeLineTop(d,e,this.session)+"px");var y=e.lineHeight*this.session.getRowLength(d)+"px";C.style.height!=y&&($=!0,C.style.height=y);}d++;}if($)for(;m<this.$lines.cells.length;){var b=this.$lines.cells[m++];b.element.style.top=this.$lines.computeLineTop(b.row,e,this.session)+"px";}},n.prototype.scrollLines=function(e){var o=this.config;if(this.config=e,this.$lines.pageChanged(o,e))return this.update(e);this.$lines.moveContainer(e);var a=e.lastRow,u=o?o.lastRow:-1;if(!o||u<e.firstRow)return this.update(e);if(a<o.firstRow)return this.update(e);if(!o||o.lastRow<e.firstRow)return this.update(e);if(e.lastRow<o.firstRow)return this.update(e);if(o.firstRow<e.firstRow)for(var w=this.session.getFoldedRowCount(o.firstRow,e.firstRow-1);w>0;w--)this.$lines.shift();if(o.lastRow>e.lastRow)for(var w=this.session.getFoldedRowCount(e.lastRow+1,o.lastRow);w>0;w--)this.$lines.pop();e.firstRow<o.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,o.firstRow-1)),e.lastRow>o.lastRow&&this.$lines.push(this.$renderLinesFragment(e,o.lastRow+1,e.lastRow)),this.$highlightIndentGuide();},n.prototype.$renderLinesFragment=function(e,o,a){for(var u=[],w=o,S=this.session.getNextFoldLine(w),m=S?S.start.row:1/0;w>m&&(w=S.end.row+1,S=this.session.getNextFoldLine(w,S),m=S?S.start.row:1/0),!(w>a);){var $=this.$lines.createCell(w,e,this.session),d=$.element;this.dom.removeChildren(d),L.setStyle(d.style,"height",this.$lines.computeLineHeight(w,e,this.session)+"px"),L.setStyle(d.style,"top",this.$lines.computeLineTop(w,e,this.session)+"px"),this.$renderLine(d,w,w==m?S:!1),this.$useLineGroups()?d.className="ace_line_group":d.className="ace_line",u.push($),w++;}return u},n.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var o=e.firstRow,a=e.lastRow,u=this.$lines;u.getLength();)u.pop();u.push(this.$renderLinesFragment(e,o,a));},n.prototype.$renderToken=function(e,o,a,u){for(var w=this,S=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,m=this.dom.createFragment(this.element),$,d=0;$=S.exec(u);){var h=$[1],v=$[2],C=$[3],y=$[4],b=$[5];if(!(!w.showSpaces&&v)){var f=d!=$.index?u.slice(d,$.index):"";if(d=$.index+$[0].length,f&&m.appendChild(this.dom.createTextNode(f,this.element)),h){var p=w.session.getScreenTabSize(o+$.index);m.appendChild(w.$tabStrings[p].cloneNode(!0)),o+=p-1;}else if(v)if(w.showSpaces){var l=this.dom.createElement("span");l.className="ace_invisible ace_invisible_space",l.textContent=x.stringRepeat(w.SPACE_CHAR,v.length),m.appendChild(l);}else m.appendChild(this.dom.createTextNode(v,this.element));else if(C){var l=this.dom.createElement("span");l.className="ace_invisible ace_invisible_space ace_invalid",l.textContent=x.stringRepeat(w.SPACE_CHAR,C.length),m.appendChild(l);}else if(y){o+=1;var l=this.dom.createElement("span");l.style.width=w.config.characterWidth*2+"px",l.className=w.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",l.textContent=w.showSpaces?w.SPACE_CHAR:y,m.appendChild(l);}else if(b){o+=1;var l=this.dom.createElement("span");l.style.width=w.config.characterWidth*2+"px",l.className="ace_cjk",l.textContent=b,m.appendChild(l);}}}if(m.appendChild(this.dom.createTextNode(d?u.slice(d):u,this.element)),t(a.type))e.appendChild(m);else {var g="ace_"+a.type.replace(/\./g," ace_"),l=this.dom.createElement("span");a.type=="fold"&&(l.style.width=a.value.length*this.config.characterWidth+"px",l.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),l.className=g,l.appendChild(m),e.appendChild(l);}return o+u.length},n.prototype.renderIndentGuide=function(e,o,a){var u=o.search(this.$indentGuideRe);if(u<=0||u>=a)return o;if(o[0]==" "){u-=u%this.tabSize;for(var w=u/this.tabSize,S=0;S<w;S++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(u)}else if(o[0]==" "){for(var S=0;S<u;S++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),o.substr(u)}return this.$highlightIndentGuide(),o},n.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var o=this.session.selection.getCursor(),a=/^\s*/.exec(this.session.doc.getLine(o.row))[0].length,u=Math.floor(a/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:u,start:o.row};var w=this.session.$bracketHighlight;if(w){for(var S=this.session.$bracketHighlight.ranges,m=0;m<S.length;m++)if(o.row!==S[m].start.row){this.$highlightIndentGuideMarker.end=S[m].start.row,o.row>S[m].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[o.row]!==""&&o.column===e[o.row].length){this.$highlightIndentGuideMarker.dir=1;for(var m=o.row+1;m<e.length;m++){var $=e[m],d=/^\s*/.exec($)[0].length;if($!==""&&(this.$highlightIndentGuideMarker.end=m,d<=a))break}}this.$renderHighlightIndentGuide();}}},n.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,o=0;o<e.length;o++){var a=e[o],u=a.element.childNodes;if(u.length>0){for(var w=0;w<u.length;w++)if(u[w].classList&&u[w].classList.contains("ace_indent-guide-active")){u[w].classList.remove("ace_indent-guide-active");break}}}},n.prototype.$setIndentGuideActive=function(e,o){var a=this.session.doc.getLine(e.row);if(a!==""){var u=e.element.childNodes;if(u){var w=u[o-1];w&&w.classList&&w.classList.contains("ace_indent-guide")&&w.classList.add("ace_indent-guide-active");}}},n.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var o=this.$highlightIndentGuideMarker.indentLevel;if(o!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var a=0;a<e.length;a++){var u=e[a];if(this.$highlightIndentGuideMarker.end&&u.row>=this.$highlightIndentGuideMarker.start+1){if(u.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(u,o);}}else for(var a=e.length-1;a>=0;a--){var u=e[a];if(this.$highlightIndentGuideMarker.end&&u.row<this.$highlightIndentGuideMarker.start){if(u.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(u,o);}}}},n.prototype.$createLineElement=function(e){var o=this.dom.createElement("div");return o.className="ace_line",o.style.height=this.config.lineHeight+"px",o},n.prototype.$renderWrappedLine=function(e,o,a){var u=0,w=0,S=a[0],m=0,$=this.$createLineElement();e.appendChild($);for(var d=0;d<o.length;d++){var h=o[d],v=h.value;if(d==0&&this.displayIndentGuides){if(u=v.length,v=this.renderIndentGuide($,v,S),!v)continue;u-=v.length;}if(u+v.length<S)m=this.$renderToken($,m,h,v),u+=v.length;else {for(;u+v.length>=S;)m=this.$renderToken($,m,h,v.substring(0,S-u)),v=v.substring(S-u),u=S,$=this.$createLineElement(),e.appendChild($),$.appendChild(this.dom.createTextNode(x.stringRepeat("\xA0",a.indent),this.element)),w++,m=0,S=a[w]||Number.MAX_VALUE;v.length!=0&&(u+=v.length,m=this.$renderToken($,m,h,v));}}a[a.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage($,m,null,"",!0);},n.prototype.$renderSimpleLine=function(e,o){for(var a=0,u=0;u<o.length;u++){var w=o[u],S=w.value;if(!(u==0&&this.displayIndentGuides&&(S=this.renderIndentGuide(e,S),!S))){if(a+S.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,a,w,S);a=this.$renderToken(e,a,w,S);}}},n.prototype.$renderOverflowMessage=function(e,o,a,u,w){a&&this.$renderToken(e,o,a,u.slice(0,this.MAX_LINE_LENGTH-o));var S=this.dom.createElement("span");S.className="ace_inline_button ace_keyword ace_toggle_wrap",S.textContent=w?"<hide>":"<click to see more...>",e.appendChild(S);},n.prototype.$renderLine=function(e,o,a){if(!a&&a!=!1&&(a=this.session.getFoldLine(o)),a)var u=this.$getFoldLineTokens(o,a);else var u=this.session.getTokens(o);var w=e;if(u.length){var S=this.session.getRowSplitData(o);if(S&&S.length){this.$renderWrappedLine(e,u,S);var w=e.lastChild;}else {var w=e;this.$useLineGroups()&&(w=this.$createLineElement(),e.appendChild(w)),this.$renderSimpleLine(w,u);}}else this.$useLineGroups()&&(w=this.$createLineElement(),e.appendChild(w));if(this.showEOL&&w){a&&(o=a.end.row);var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_eol",m.textContent=o==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,w.appendChild(m);}},n.prototype.$getFoldLineTokens=function(e,o){var a=this.session,u=[];function w(m,$,d){for(var h=0,v=0;v+m[h].value.length<$;)if(v+=m[h].value.length,h++,h==m.length)return;if(v!=$){var C=m[h].value.substring($-v);C.length>d-$&&(C=C.substring(0,d-$)),u.push({type:m[h].type,value:C}),v=$+C.length,h+=1;}for(;v<d&&h<m.length;){var C=m[h].value;C.length+v>d?u.push({type:m[h].type,value:C.substring(0,d-v)}):u.push(m[h]),v+=C.length,h+=1;}}var S=a.getTokens(e);return o.walk(function(m,$,d,h,v){m!=null?u.push({type:"fold",value:m}):(v&&(S=a.getTokens($)),S.length&&w(S,h,d));},o.end.row,this.session.getLine(o.end.row).length),u},n.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},n}();i.prototype.EOF_CHAR="\xB6",i.prototype.EOL_CHAR_LF="\xAC",i.prototype.EOL_CHAR_CRLF="\xA4",i.prototype.EOL_CHAR=i.prototype.EOL_CHAR_LF,i.prototype.TAB_CHAR="\u2014",i.prototype.SPACE_CHAR="\xB7",i.prototype.$padding=0,i.prototype.MAX_LINE_LENGTH=1e4,i.prototype.showInvisibles=!1,i.prototype.showSpaces=!1,i.prototype.showTabs=!1,i.prototype.showEOL=!1,i.prototype.displayIndentGuides=!0,i.prototype.$highlightIndentGuides=!0,i.prototype.$tabStrings=[],i.prototype.destroy={},i.prototype.onChangeTabSize=i.prototype.$computeTabString,R.implement(i.prototype,c),M.Text=i;});ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(k,M,H){var R=k("../lib/dom"),L=function(){function x(s){this.element=R.createElement("div"),this.element.className="ace_layer ace_cursor-layer",s.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),R.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this);}return x.prototype.$updateOpacity=function(s){for(var c=this.cursors,r=c.length;r--;)R.setStyle(c[r].style,"opacity",s?"":"0");},x.prototype.$startCssAnimation=function(){for(var s=this.cursors,c=s.length;c--;)s[c].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&R.addCssClass(this.element,"ace_animate-blinking");}.bind(this));},x.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,R.removeCssClass(this.element,"ace_animate-blinking");},x.prototype.setPadding=function(s){this.$padding=s;},x.prototype.setSession=function(s){this.session=s;},x.prototype.setBlinking=function(s){s!=this.isBlinking&&(this.isBlinking=s,this.restartTimer());},x.prototype.setBlinkInterval=function(s){s!=this.blinkInterval&&(this.blinkInterval=s,this.restartTimer());},x.prototype.setSmoothBlinking=function(s){s!=this.smoothBlinking&&(this.smoothBlinking=s,R.setCssClass(this.element,"ace_smooth-blinking",s),this.$updateCursors(!0),this.restartTimer());},x.prototype.addCursor=function(){var s=R.createElement("div");return s.className="ace_cursor",this.element.appendChild(s),this.cursors.push(s),s},x.prototype.removeCursor=function(){if(this.cursors.length>1){var s=this.cursors.pop();return s.parentNode.removeChild(s),s}},x.prototype.hideCursor=function(){this.isVisible=!1,R.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer();},x.prototype.showCursor=function(){this.isVisible=!0,R.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer();},x.prototype.restartTimer=function(){var s=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,R.removeCssClass(this.element,"ace_smooth-blinking")),s(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&R.addCssClass(this.element,"ace_smooth-blinking");}.bind(this))),R.HAS_CSS_ANIMATION)this.$startCssAnimation();else {var c=function(){this.timeoutId=setTimeout(function(){s(!1);},.6*this.blinkInterval);}.bind(this);this.intervalId=setInterval(function(){s(!0),c();},this.blinkInterval),c();}},x.prototype.getPixelPosition=function(s,c){if(!this.config||!this.session)return {left:0,top:0};s||(s=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(s),t=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,s.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),i=(r.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return {left:t,top:i}},x.prototype.isCursorInView=function(s,c){return s.top>=0&&s.top<c.maxHeight},x.prototype.update=function(s){this.config=s;var c=this.session.$selectionMarkers,r=0,t=0;(c===void 0||c.length===0)&&(c=[{cursor:null}]);for(var r=0,i=c.length;r<i;r++){var n=this.getPixelPosition(c[r].cursor,!0);if(!((n.top>s.height+s.offset||n.top<0)&&r>1)){var e=this.cursors[t++]||this.addCursor(),o=e.style;this.drawCursor?this.drawCursor(e,n,s,c[r],this.session):this.isCursorInView(n,s)?(R.setStyle(o,"display","block"),R.translate(e,n.left,n.top),R.setStyle(o,"width",Math.round(s.characterWidth)+"px"),R.setStyle(o,"height",s.lineHeight+"px")):R.setStyle(o,"display","none");}}for(;this.cursors.length>t;)this.removeCursor();var a=this.session.getOverwrite();this.$setOverwrite(a),this.$pixelPos=n,this.restartTimer();},x.prototype.$setOverwrite=function(s){s!=this.overwrite&&(this.overwrite=s,s?R.addCssClass(this.element,"ace_overwrite-cursors"):R.removeCssClass(this.element,"ace_overwrite-cursors"));},x.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId);},x}();L.prototype.$padding=0,L.prototype.drawCursor=null,M.Cursor=L;});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var e=function(o,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w;}||function(u,w){for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(u[S]=w[S]);},e(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(o,a);function u(){this.constructor=o;}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u);}}(),L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter,r=32768,t=function(){function e(o,a){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+a,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent="\xA0",this.element.appendChild(this.inner),o.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault);}return e.prototype.setVisible=function(o){this.element.style.display=o?"":"none",this.isVisible=o,this.coeff=1;},e}();L.implement(t.prototype,c);var i=function(e){R(o,e);function o(a,u){var w=e.call(this,a,"-v")||this;return w.scrollTop=0,w.scrollHeight=0,u.$scrollbarWidth=w.width=x.scrollbarWidth(a.ownerDocument),w.inner.style.width=w.element.style.width=(w.width||15)+5+"px",w.$minWidth=0,w}return o.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var a=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-a)/(this.coeff-a);}this._emit("scroll",{data:this.scrollTop});}this.skipEvent=!1;},o.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},o.prototype.setHeight=function(a){this.element.style.height=a+"px";},o.prototype.setScrollHeight=function(a){this.scrollHeight=a,a>r?(this.coeff=r/a,a=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=a+"px";},o.prototype.setScrollTop=function(a){this.scrollTop!=a&&(this.skipEvent=!0,this.scrollTop=a,this.element.scrollTop=a*this.coeff);},o}(t);i.prototype.setInnerHeight=i.prototype.setScrollHeight;var n=function(e){R(o,e);function o(a,u){var w=e.call(this,a,"-h")||this;return w.scrollLeft=0,w.height=u.$scrollbarWidth,w.inner.style.height=w.element.style.height=(w.height||15)+5+"px",w}return o.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1;},o.prototype.getHeight=function(){return this.isVisible?this.height:0},o.prototype.setWidth=function(a){this.element.style.width=a+"px";},o.prototype.setInnerWidth=function(a){this.inner.style.width=a+"px";},o.prototype.setScrollWidth=function(a){this.inner.style.width=a+"px";},o.prototype.setScrollLeft=function(a){this.scrollLeft!=a&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=a);},o}(t);M.ScrollBar=i,M.ScrollBarV=i,M.ScrollBarH=n,M.VScrollBar=i,M.HScrollBar=n;});ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(k,M,H){var R=this&&this.__extends||function(){var n=function(e,o){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u;}||function(a,u){for(var w in u)Object.prototype.hasOwnProperty.call(u,w)&&(a[w]=u[w]);},n(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");n(e,o);function a(){this.constructor=e;}e.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a);}}(),L=k("./lib/oop"),x=k("./lib/dom"),s=k("./lib/event"),c=k("./lib/event_emitter").EventEmitter;x.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
228
229
  position: absolute;
229
230
  background: rgba(128, 128, 128, 0.6);
230
231
  -moz-box-sizing: border-box;
@@ -262,7 +263,7 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
262
263
  .ace_editor>.ace_sb_grabbed {
263
264
  z-index: 8;
264
265
  background: #000;
265
- }`,"ace_scrollbar.css",!1);var r=function(){function n(t,o){this.element=x.createElement("div"),this.element.className="ace_sb"+o,this.inner=x.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown");}return n.prototype.setVisible=function(t){this.element.style.display=t?"":"none",this.isVisible=t,this.coeff=1;},n}();L.implement(r.prototype,l);var e=function(n){R(t,n);function t(o,a){var u=n.call(this,o,"-v")||this;return u.scrollTop=0,u.scrollHeight=0,u.parent=o,u.width=u.VScrollWidth,u.renderer=a,u.inner.style.width=u.element.style.width=(u.width||15)+"px",u.$minWidth=0,u}return t.prototype.onMouseDown=function(o,a){if(o==="mousedown"&&!(s.getButton(a)!==0||a.detail===2)){if(a.target===this.inner){var u=this,w=a.clientY,S=function(y){w=y.clientY;},m=function(){clearInterval(v);},$=a.clientY,d=this.thumbTop,h=function(){if(w!==void 0){var y=u.scrollTopFromThumbTop(d+w-$);y!==u.scrollTop&&u._emit("scroll",{data:y});}};s.capture(this.inner,S,m);var v=setInterval(h,20);return s.preventDefault(a)}var C=a.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(C)}),s.preventDefault(a)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(o){var a=o*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return a=a>>0,a<0?a=0:a>this.pageHeight-this.viewHeight&&(a=this.pageHeight-this.viewHeight),a},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(o){this.height=Math.max(0,o),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0);},t.prototype.setScrollHeight=function(o,a){this.pageHeight===o&&!a||(this.pageHeight=o,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})));},t.prototype.setScrollTop=function(o){this.scrollTop=o,o<0&&(o=0),this.thumbTop=o*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px";},t}(r);e.prototype.setInnerHeight=e.prototype.setScrollHeight;var i=function(n){R(t,n);function t(o,a){var u=n.call(this,o,"-h")||this;return u.scrollLeft=0,u.scrollWidth=0,u.height=u.HScrollHeight,u.inner.style.height=u.element.style.height=(u.height||12)+"px",u.renderer=a,u}return t.prototype.onMouseDown=function(o,a){if(o==="mousedown"&&!(s.getButton(a)!==0||a.detail===2)){if(a.target===this.inner){var u=this,w=a.clientX,S=function(y){w=y.clientX;},m=function(){clearInterval(v);},$=a.clientX,d=this.thumbLeft,h=function(){if(w!==void 0){var y=u.scrollLeftFromThumbLeft(d+w-$);y!==u.scrollLeft&&u._emit("scroll",{data:y});}};s.capture(this.inner,S,m);var v=setInterval(h,20);return s.preventDefault(a)}var C=a.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(C)}),s.preventDefault(a)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(o){var a=o*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return a=a>>0,a<0?a=0:a>this.pageWidth-this.viewWidth&&(a=this.pageWidth-this.viewWidth),a},t.prototype.setWidth=function(o){this.width=Math.max(0,o),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0);},t.prototype.setScrollWidth=function(o,a){this.pageWidth===o&&!a||(this.pageWidth=o,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})));},t.prototype.setScrollLeft=function(o){this.scrollLeft=o,o<0&&(o=0),this.thumbLeft=o*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px";},t}(r);i.prototype.setInnerWidth=i.prototype.setScrollWidth,M.ScrollBar=e,M.ScrollBarV=e,M.ScrollBarH=i,M.VScrollBar=e,M.HScrollBar=i;});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(k,M,H){var R=k("./lib/event"),L=function(){function x(s,l){this.onRender=s,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=l||window;var r=this;this._flush=function(e){r.pending=!1;var i=r.changes;if(i&&(R.blockIdle(100),r.changes=0,r.onRender(i)),r.changes){if(r.$recursionLimit--<0)return;r.schedule();}else r.$recursionLimit=2;};}return x.prototype.schedule=function(s){this.changes=this.changes|s,this.changes&&!this.pending&&(R.nextFrame(this._flush),this.pending=!0);},x.prototype.clear=function(s){var l=this.changes;return this.changes=0,l},x}();M.RenderLoop=L;});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(k,M,H){var R=k("../lib/oop"),L=k("../lib/dom"),x=k("../lib/lang"),s=k("../lib/event"),l=k("../lib/useragent"),r=k("../lib/event_emitter").EventEmitter,e=512,i=typeof ResizeObserver=="function",n=200,t=function(){function o(a){this.el=L.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=L.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=L.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),a.appendChild(this.el),this.$measureNode.textContent=x.stringRepeat("X",e),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges();}return o.prototype.$setMeasureNodeStyles=function(a,u){a.width=a.height="auto",a.left=a.top="0px",a.visibility="hidden",a.position="absolute",a.whiteSpace="pre",l.isIE<8?a["font-family"]="inherit":a.font="inherit",a.overflow=u?"hidden":"visible";},o.prototype.checkForSizeChanges=function(a){if(a===void 0&&(a=this.$measureSizes()),a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)){this.$measureNode.style.fontWeight="bold";var u=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=a,this.charSizes=Object.create(null),this.allowBoldFonts=u&&u.width===a.width&&u.height===a.height,this._emit("changeCharacterSize",{data:a});}},o.prototype.$addObserver=function(){var a=this;this.$observer=new window.ResizeObserver(function(u){a.checkForSizeChanges();}),this.$observer.observe(this.$measureNode);},o.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var a=this;return this.$pollSizeChangesTimer=s.onIdle(function u(){a.checkForSizeChanges(),s.onIdle(u,500);},500)},o.prototype.setPolling=function(a){a?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0);},o.prototype.$measureSizes=function(a){var u={height:(a||this.$measureNode).clientHeight,width:(a||this.$measureNode).clientWidth/e};return u.width===0||u.height===0?null:u},o.prototype.$measureCharWidth=function(a){this.$main.textContent=x.stringRepeat(a,e);var u=this.$main.getBoundingClientRect();return u.width/e},o.prototype.getCharacterWidth=function(a){var u=this.charSizes[a];return u===void 0&&(u=this.charSizes[a]=this.$measureCharWidth(a)/this.$characterSize.width),u},o.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);},o.prototype.$getZoom=function(a){return !a||!a.parentElement?1:(Number(window.getComputedStyle(a).zoom)||1)*this.$getZoom(a.parentElement)},o.prototype.$initTransformMeasureNodes=function(){var a=function(u,w){return ["div",{style:"position: absolute;top:"+u+"px;left:"+w+"px;"}]};this.els=L.buildDom([a(0,0),a(n,0),a(0,n),a(n,n)],this.el);},o.prototype.transformCoordinates=function(a,u){if(a){var w=this.$getZoom(this.el);a=d(1/w,a);}function S(O,I,N){var F=O[1]*I[0]-O[0]*I[1];return [(-I[1]*N[0]+I[0]*N[1])/F,(+O[1]*N[0]-O[0]*N[1])/F]}function m(O,I){return [O[0]-I[0],O[1]-I[1]]}function $(O,I){return [O[0]+I[0],O[1]+I[1]]}function d(O,I){return [O*I[0],O*I[1]]}this.els||this.$initTransformMeasureNodes();function h(O){var I=O.getBoundingClientRect();return [I.left,I.top]}var v=h(this.els[0]),C=h(this.els[1]),y=h(this.els[2]),b=h(this.els[3]),f=S(m(b,C),m(b,y),m($(C,y),$(b,v))),p=d(1+f[0],m(C,v)),c=d(1+f[1],m(y,v));if(u){var g=u,A=f[0]*g[0]/n+f[1]*g[1]/n+1,T=$(d(g[0],p),d(g[1],c));return $(d(1/A/n,T),v)}var E=m(a,v),_=S(m(p,d(f[0],E)),m(c,d(f[1],E)),E);return d(n,_)},o}();t.prototype.$characterSize={width:0,height:0},R.implement(t.prototype,r),M.FontMetrics=t;});ace.define("ace/css/editor-css",["require","exports","module"],function(k,M,H){H.exports=`
266
+ }`,"ace_scrollbar.css",!1);var r=function(){function n(e,o){this.element=x.createElement("div"),this.element.className="ace_sb"+o,this.inner=x.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown");}return n.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1;},n}();L.implement(r.prototype,c);var t=function(n){R(e,n);function e(o,a){var u=n.call(this,o,"-v")||this;return u.scrollTop=0,u.scrollHeight=0,u.parent=o,u.width=u.VScrollWidth,u.renderer=a,u.inner.style.width=u.element.style.width=(u.width||15)+"px",u.$minWidth=0,u}return e.prototype.onMouseDown=function(o,a){if(o==="mousedown"&&!(s.getButton(a)!==0||a.detail===2)){if(a.target===this.inner){var u=this,w=a.clientY,S=function(y){w=y.clientY;},m=function(){clearInterval(v);},$=a.clientY,d=this.thumbTop,h=function(){if(w!==void 0){var y=u.scrollTopFromThumbTop(d+w-$);y!==u.scrollTop&&u._emit("scroll",{data:y});}};s.capture(this.inner,S,m);var v=setInterval(h,20);return s.preventDefault(a)}var C=a.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(C)}),s.preventDefault(a)}},e.prototype.getHeight=function(){return this.height},e.prototype.scrollTopFromThumbTop=function(o){var a=o*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return a=a>>0,a<0?a=0:a>this.pageHeight-this.viewHeight&&(a=this.pageHeight-this.viewHeight),a},e.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},e.prototype.setHeight=function(o){this.height=Math.max(0,o),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0);},e.prototype.setScrollHeight=function(o,a){this.pageHeight===o&&!a||(this.pageHeight=o,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})));},e.prototype.setScrollTop=function(o){this.scrollTop=o,o<0&&(o=0),this.thumbTop=o*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px";},e}(r);t.prototype.setInnerHeight=t.prototype.setScrollHeight;var i=function(n){R(e,n);function e(o,a){var u=n.call(this,o,"-h")||this;return u.scrollLeft=0,u.scrollWidth=0,u.height=u.HScrollHeight,u.inner.style.height=u.element.style.height=(u.height||12)+"px",u.renderer=a,u}return e.prototype.onMouseDown=function(o,a){if(o==="mousedown"&&!(s.getButton(a)!==0||a.detail===2)){if(a.target===this.inner){var u=this,w=a.clientX,S=function(y){w=y.clientX;},m=function(){clearInterval(v);},$=a.clientX,d=this.thumbLeft,h=function(){if(w!==void 0){var y=u.scrollLeftFromThumbLeft(d+w-$);y!==u.scrollLeft&&u._emit("scroll",{data:y});}};s.capture(this.inner,S,m);var v=setInterval(h,20);return s.preventDefault(a)}var C=a.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(C)}),s.preventDefault(a)}},e.prototype.getHeight=function(){return this.isVisible?this.height:0},e.prototype.scrollLeftFromThumbLeft=function(o){var a=o*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return a=a>>0,a<0?a=0:a>this.pageWidth-this.viewWidth&&(a=this.pageWidth-this.viewWidth),a},e.prototype.setWidth=function(o){this.width=Math.max(0,o),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0);},e.prototype.setScrollWidth=function(o,a){this.pageWidth===o&&!a||(this.pageWidth=o,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})));},e.prototype.setScrollLeft=function(o){this.scrollLeft=o,o<0&&(o=0),this.thumbLeft=o*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px";},e}(r);i.prototype.setInnerWidth=i.prototype.setScrollWidth,M.ScrollBar=t,M.ScrollBarV=t,M.ScrollBarH=i,M.VScrollBar=t,M.HScrollBar=i;});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(k,M,H){var R=k("./lib/event"),L=function(){function x(s,c){this.onRender=s,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var r=this;this._flush=function(t){r.pending=!1;var i=r.changes;if(i&&(R.blockIdle(100),r.changes=0,r.onRender(i)),r.changes){if(r.$recursionLimit--<0)return;r.schedule();}else r.$recursionLimit=2;};}return x.prototype.schedule=function(s){this.changes=this.changes|s,this.changes&&!this.pending&&(R.nextFrame(this._flush),this.pending=!0);},x.prototype.clear=function(s){var c=this.changes;return this.changes=0,c},x}();M.RenderLoop=L;});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(k,M,H){var R=k("../lib/oop"),L=k("../lib/dom"),x=k("../lib/lang"),s=k("../lib/event"),c=k("../lib/useragent"),r=k("../lib/event_emitter").EventEmitter,t=512,i=typeof ResizeObserver=="function",n=200,e=function(){function o(a){this.el=L.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=L.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=L.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),a.appendChild(this.el),this.$measureNode.textContent=x.stringRepeat("X",t),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges();}return o.prototype.$setMeasureNodeStyles=function(a,u){a.width=a.height="auto",a.left=a.top="0px",a.visibility="hidden",a.position="absolute",a.whiteSpace="pre",c.isIE<8?a["font-family"]="inherit":a.font="inherit",a.overflow=u?"hidden":"visible";},o.prototype.checkForSizeChanges=function(a){if(a===void 0&&(a=this.$measureSizes()),a&&(this.$characterSize.width!==a.width||this.$characterSize.height!==a.height)){this.$measureNode.style.fontWeight="bold";var u=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=a,this.charSizes=Object.create(null),this.allowBoldFonts=u&&u.width===a.width&&u.height===a.height,this._emit("changeCharacterSize",{data:a});}},o.prototype.$addObserver=function(){var a=this;this.$observer=new window.ResizeObserver(function(u){a.checkForSizeChanges();}),this.$observer.observe(this.$measureNode);},o.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var a=this;return this.$pollSizeChangesTimer=s.onIdle(function u(){a.checkForSizeChanges(),s.onIdle(u,500);},500)},o.prototype.setPolling=function(a){a?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0);},o.prototype.$measureSizes=function(a){var u={height:(a||this.$measureNode).clientHeight,width:(a||this.$measureNode).clientWidth/t};return u.width===0||u.height===0?null:u},o.prototype.$measureCharWidth=function(a){this.$main.textContent=x.stringRepeat(a,t);var u=this.$main.getBoundingClientRect();return u.width/t},o.prototype.getCharacterWidth=function(a){var u=this.charSizes[a];return u===void 0&&(u=this.charSizes[a]=this.$measureCharWidth(a)/this.$characterSize.width),u},o.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el);},o.prototype.$getZoom=function(a){return !a||!a.parentElement?1:(Number(window.getComputedStyle(a).zoom)||1)*this.$getZoom(a.parentElement)},o.prototype.$initTransformMeasureNodes=function(){var a=function(u,w){return ["div",{style:"position: absolute;top:"+u+"px;left:"+w+"px;"}]};this.els=L.buildDom([a(0,0),a(n,0),a(0,n),a(n,n)],this.el);},o.prototype.transformCoordinates=function(a,u){if(a){var w=this.$getZoom(this.el);a=d(1/w,a);}function S(O,I,N){var F=O[1]*I[0]-O[0]*I[1];return [(-I[1]*N[0]+I[0]*N[1])/F,(+O[1]*N[0]-O[0]*N[1])/F]}function m(O,I){return [O[0]-I[0],O[1]-I[1]]}function $(O,I){return [O[0]+I[0],O[1]+I[1]]}function d(O,I){return [O*I[0],O*I[1]]}this.els||this.$initTransformMeasureNodes();function h(O){var I=O.getBoundingClientRect();return [I.left,I.top]}var v=h(this.els[0]),C=h(this.els[1]),y=h(this.els[2]),b=h(this.els[3]),f=S(m(b,C),m(b,y),m($(C,y),$(b,v))),p=d(1+f[0],m(C,v)),l=d(1+f[1],m(y,v));if(u){var g=u,A=f[0]*g[0]/n+f[1]*g[1]/n+1,T=$(d(g[0],p),d(g[1],l));return $(d(1/A/n,T),v)}var E=m(a,v),_=S(m(p,d(f[0],E)),m(l,d(f[1],E)),E);return d(n,_)},o}();e.prototype.$characterSize={width:0,height:0},R.implement(e.prototype,r),M.FontMetrics=e;});ace.define("ace/css/editor-css",["require","exports","module"],function(k,M,H){H.exports=`
266
267
  .ace_br1 {border-top-left-radius : 3px;}
267
268
  .ace_br2 {border-top-right-radius : 3px;}
268
269
  .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
@@ -937,9 +938,9 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
937
938
 
938
939
  .ace_hidden_token {
939
940
  display: none;
940
- }`;});ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/oop"),x=k("../lib/event_emitter").EventEmitter,s=function(){function l(r,e){this.canvas=R.createElement("canvas"),this.renderer=e,this.pixelRatio=1,this.maxHeight=e.layerConfig.maxHeight,this.lineHeight=e.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas);}return l.prototype.$updateDecorators=function(r){var e=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var i=(r.lastRow+1)*this.lineHeight;i<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight;}var n=this.canvas.getContext("2d");function t(b,f){return b.priority<f.priority?-1:b.priority>f.priority?1:0}var o=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),o){var a={info:1,warning:2,error:3};o.forEach(function(b){b.priority=a[b.type]||null;}),o=o.sort(t);for(var u=this.renderer.session.$foldData,w=0;w<o.length;w++){var S=o[w].row,m=this.compensateFoldRows(S,u),$=Math.round((S-m)*this.lineHeight*this.heightRatio),d=Math.round((S-m)*this.lineHeight*this.heightRatio),h=Math.round(((S-m)*this.lineHeight+this.lineHeight)*this.heightRatio),v=h-d;if(v<this.minDecorationHeight){var C=(d+h)/2|0;C<this.halfMinDecorationHeight?C=this.halfMinDecorationHeight:C+this.halfMinDecorationHeight>this.canvasHeight&&(C=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(C-this.halfMinDecorationHeight),h=Math.round(C+this.halfMinDecorationHeight);}n.fillStyle=e[o[w].type]||null,n.fillRect(0,$,this.canvasWidth,h-d);}}var y=this.renderer.session.selection.getCursor();if(y){var m=this.compensateFoldRows(y.row,u),$=Math.round((y.row-m)*this.lineHeight*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,$,this.canvasWidth,2);}},l.prototype.compensateFoldRows=function(r,e){var i=0;if(e&&e.length>0)for(var n=0;n<e.length;n++)r>e[n].start.row&&r<e[n].end.row?i+=r-e[n].start.row:r>=e[n].end.row&&(i+=e[n].end.row-e[n].start.row);return i},l}();L.implement(s.prototype,x),M.Decorator=s;});ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/dom"),x=k("./lib/lang"),s=k("./config"),l=k("./layer/gutter").Gutter,r=k("./layer/marker").Marker,e=k("./layer/text").Text,i=k("./layer/cursor").Cursor,n=k("./scrollbar").HScrollBar,t=k("./scrollbar").VScrollBar,o=k("./scrollbar_custom").HScrollBar,a=k("./scrollbar_custom").VScrollBar,u=k("./renderloop").RenderLoop,w=k("./layer/font_metrics").FontMetrics,S=k("./lib/event_emitter").EventEmitter,m=k("./css/editor-css"),$=k("./layer/decorators").Decorator,d=k("./lib/useragent"),h=k("./layer/text_util").isTextToken;L.importCssString(m,"ace_editor.css",!1);var v=function(){function C(y,b){var f=this;this.container=y||L.createElement("div"),L.addCssClass(this.container,"ace_editor"),L.HI_DPI&&L.addCssClass(this.container,"ace_hidpi"),this.setTheme(b),s.get("useStrictCSP")==null&&s.set("useStrictCSP",!1),this.$gutter=L.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=L.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=L.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new l(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var p=this.$textLayer=new e(this.content);this.canvas=p.element,this.$markerFront=new r(this.content),this.$cursorLayer=new i(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new t(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.on("scroll",function(c){f.$scrollAnimation||f.session.setScrollTop(c.data-f.scrollMargin.top);}),this.scrollBarH.on("scroll",function(c){f.$scrollAnimation||f.session.setScrollLeft(c.data-f.scrollMargin.left);}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new w(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(c){f.updateCharacterSize(),f.onResize(!0,f.gutterWidth,f.$size.width,f.$size.height),f._signal("changeCharacterSize",c);}),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=!d.isIOS,this.$loop=new u(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this);}return C.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),L.setStyle(this.scroller.style,"line-height",this.lineHeight+"px");},C.prototype.setSession=function(y){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=y,y&&this.scrollMargin.top&&y.getScrollTop()<=0&&y.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(y),this.$markerBack.setSession(y),this.$markerFront.setSession(y),this.$gutterLayer.setSession(y),this.$textLayer.setSession(y),y&&(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));},C.prototype.updateLines=function(y,b,f){if(b===void 0&&(b=1/0),this.$changedLines?(this.$changedLines.firstRow>y&&(this.$changedLines.firstRow=y),this.$changedLines.lastRow<b&&(this.$changedLines.lastRow=b)):this.$changedLines={firstRow:y,lastRow:b},this.$changedLines.lastRow<this.layerConfig.firstRow)if(f)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES);},C.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);},C.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize();},C.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT);},C.prototype.updateFull=function(y){y?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL);},C.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges();},C.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize();},C.prototype.onResize=function(y,b,f,p){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=y?1:0;var c=this.container;p||(p=c.clientHeight||c.scrollHeight),!p&&this.$maxLines&&this.lineHeight>1&&(!c.style.height||c.style.height=="0px")&&(c.style.height="1px",p=c.clientHeight||c.scrollHeight),f||(f=c.clientWidth||c.scrollWidth);var g=this.$updateCachedSize(y,b,f,p);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!f&&!p)return this.resizing=0;y&&(this.$gutterLayer.$padding=null),y?this.$renderChanges(g|this.$changes,!0):this.$loop.schedule(g|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0);}},C.prototype.$updateCachedSize=function(y,b,f,p){p-=this.$extraHeight||0;var c=0,g=this.$size,A={width:g.width,height:g.height,scrollerHeight:g.scrollerHeight,scrollerWidth:g.scrollerWidth};if(p&&(y||g.height!=p)&&(g.height=p,c|=this.CHANGE_SIZE,g.scrollerHeight=g.height,this.$horizScroll&&(g.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(g.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",c=c|this.CHANGE_SCROLL),f&&(y||g.width!=f)){c|=this.CHANGE_SIZE,g.width=f,b==null&&(b=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=b,L.setStyle(this.scrollBarH.element.style,"left",b+"px"),L.setStyle(this.scroller.style,"left",b+this.margin.left+"px"),g.scrollerWidth=Math.max(0,f-b-this.scrollBarV.getWidth()-this.margin.h),L.setStyle(this.$gutter.style,"left",this.margin.left+"px");var T=this.scrollBarV.getWidth()+"px";L.setStyle(this.scrollBarH.element.style,"right",T),L.setStyle(this.scroller.style,"right",T),L.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(g.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||y)&&(c|=this.CHANGE_FULL);}return g.$dirty=!f||!p,c&&this._signal("resize",A),c},C.prototype.onGutterResize=function(y){var b=this.$showGutter?y:0;b!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,b,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();},C.prototype.adjustWrapLimit=function(){var y=this.$size.scrollerWidth-this.$padding*2,b=Math.floor(y/this.characterWidth);return this.session.adjustWrapLimit(b,this.$showPrintMargin&&this.$printMarginColumn)},C.prototype.setAnimatedScroll=function(y){this.setOption("animatedScroll",y);},C.prototype.getAnimatedScroll=function(){return this.$animatedScroll},C.prototype.setShowInvisibles=function(y){this.setOption("showInvisibles",y),this.session.$bidiHandler.setShowInvisibles(y);},C.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},C.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},C.prototype.setDisplayIndentGuides=function(y){this.setOption("displayIndentGuides",y);},C.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},C.prototype.setHighlightIndentGuides=function(y){this.setOption("highlightIndentGuides",y);},C.prototype.setShowPrintMargin=function(y){this.setOption("showPrintMargin",y);},C.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},C.prototype.setPrintMarginColumn=function(y){this.setOption("printMarginColumn",y);},C.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},C.prototype.getShowGutter=function(){return this.getOption("showGutter")},C.prototype.setShowGutter=function(y){return this.setOption("showGutter",y)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.setFadeFoldWidgets=function(y){this.setOption("fadeFoldWidgets",y);},C.prototype.setHighlightGutterLine=function(y){this.setOption("highlightGutterLine",y);},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var y=L.createElement("div");y.className="ace_layer ace_print-margin-layer",this.$printMarginEl=L.createElement("div"),this.$printMarginEl.className="ace_print-margin",y.appendChild(this.$printMarginEl),this.content.insertBefore(y,this.content.firstChild);}var b=this.$printMarginEl.style;b.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",b.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit();}},C.prototype.getContainerElement=function(){return this.container},C.prototype.getMouseEventTarget=function(){return this.scroller},C.prototype.getTextAreaContainer=function(){return this.container},C.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var y=this.textarea.style,b=this.$composition;if(!this.$keepTextAreaAtCursor&&!b){L.translate(this.textarea,-100,0);return}var f=this.$cursorLayer.$pixelPos;if(f){b&&b.markerRange&&(f=this.$cursorLayer.getPixelPosition(b.markerRange.start,!0));var p=this.layerConfig,c=f.top,g=f.left;c-=p.offset;var A=b&&b.useTextareaForIME||d.isMobile?this.lineHeight:1;if(c<0||c>p.height-A){L.translate(this.textarea,0,0);return}var T=1,E=this.$size.height-A;if(!b)c+=this.lineHeight;else if(b.useTextareaForIME){var _=this.textarea.value;T=this.characterWidth*this.session.$getStringScreenWidth(_)[0];}else c+=this.lineHeight+2;g-=this.scrollLeft,g>this.$size.scrollerWidth-T&&(g=this.$size.scrollerWidth-T),g+=this.gutterWidth+this.margin.left,L.setStyle(y,"height",A+"px"),L.setStyle(y,"width",T+"px"),L.translate(this.textarea,Math.min(g,this.$size.scrollerWidth-T),Math.min(c,E));}}},C.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},C.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},C.prototype.getLastFullyVisibleRow=function(){var y=this.layerConfig,b=y.lastRow,f=this.session.documentToScreenRow(b,0)*y.lineHeight;return f-this.session.getScrollTop()>y.height-y.lineHeight?b-1:b},C.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},C.prototype.setPadding=function(y){this.$padding=y,this.$textLayer.setPadding(y),this.$cursorLayer.setPadding(y),this.$markerFront.setPadding(y),this.$markerBack.setPadding(y),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin();},C.prototype.setScrollMargin=function(y,b,f,p){var c=this.scrollMargin;c.top=y|0,c.bottom=b|0,c.right=p|0,c.left=f|0,c.v=c.top+c.bottom,c.h=c.left+c.right,c.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-c.top),this.updateFull();},C.prototype.setMargin=function(y,b,f,p){var c=this.margin;c.top=y|0,c.bottom=b|0,c.right=p|0,c.left=f|0,c.v=c.top+c.bottom,c.h=c.left+c.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull();},C.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},C.prototype.setHScrollBarAlwaysVisible=function(y){this.setOption("hScrollBarAlwaysVisible",y);},C.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},C.prototype.setVScrollBarAlwaysVisible=function(y){this.setOption("vScrollBarAlwaysVisible",y);},C.prototype.$updateScrollBarV=function(){var y=this.layerConfig.maxHeight,b=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(y-=(b-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>y-b&&(y=this.scrollTop+b,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(y+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top);},C.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left);},C.prototype.freeze=function(){this.$frozen=!0;},C.prototype.unfreeze=function(){this.$frozen=!1;},C.prototype.$renderChanges=function(y,b){if(this.$changes&&(y|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!y&&!b){this.$changes|=y;return}if(this.$size.$dirty)return this.$changes|=y,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",y),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var f=this.layerConfig;if(y&this.CHANGE_FULL||y&this.CHANGE_SIZE||y&this.CHANGE_TEXT||y&this.CHANGE_LINES||y&this.CHANGE_SCROLL||y&this.CHANGE_H_SCROLL){if(y|=this.$computeLayerConfig()|this.$loop.clear(),f.firstRow!=this.layerConfig.firstRow&&f.firstRowScreen==this.layerConfig.firstRowScreen){var p=this.scrollTop+(f.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;p>0&&(this.scrollTop=p,y=y|this.CHANGE_SCROLL,y|=this.$computeLayerConfig()|this.$loop.clear());}f=this.layerConfig,this.$updateScrollBarV(),y&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),L.translate(this.content,-this.scrollLeft,-f.offset);var c=f.width+2*this.$padding+"px",g=f.minHeight+"px";L.setStyle(this.content.style,"width",c),L.setStyle(this.content.style,"height",g);}if(y&this.CHANGE_H_SCROLL&&(L.translate(this.content,-this.scrollLeft,-f.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),y&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(f),this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f),this.$markerBack.update(f),this.$markerFront.update(f),this.$cursorLayer.update(f),this.$moveTextAreaToCursor(),this._signal("afterRender",y);return}if(y&this.CHANGE_SCROLL){this.$changedLines=null,y&this.CHANGE_TEXT||y&this.CHANGE_LINES?this.$textLayer.update(f):this.$textLayer.scrollLines(f),this.$showGutter&&(y&this.CHANGE_GUTTER||y&this.CHANGE_LINES?this.$gutterLayer.update(f):this.$gutterLayer.scrollLines(f)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f),this.$markerBack.update(f),this.$markerFront.update(f),this.$cursorLayer.update(f),this.$moveTextAreaToCursor(),this._signal("afterRender",y);return}y&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(f),this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_LINES?((this.$updateLines()||y&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_TEXT||y&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)),y&this.CHANGE_CURSOR&&(this.$cursorLayer.update(f),this.$moveTextAreaToCursor()),y&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(f),y&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(f),this._signal("afterRender",y);},C.prototype.$autosize=function(){var y=this.session.getScreenLength()*this.lineHeight,b=this.$maxLines*this.lineHeight,f=Math.min(b,Math.max((this.$minLines||1)*this.lineHeight,y))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(f+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&f>this.$maxPixelHeight&&(f=this.$maxPixelHeight);var p=f<=2*this.lineHeight,c=!p&&y>b;if(f!=this.desiredHeight||this.$size.height!=this.desiredHeight||c!=this.$vScroll){c!=this.$vScroll&&(this.$vScroll=c,this.scrollBarV.setVisible(c));var g=this.container.clientWidth;this.container.style.height=f+"px",this.$updateCachedSize(!0,this.$gutterWidth,g,f),this.desiredHeight=f,this._signal("autosize");}},C.prototype.$computeLayerConfig=function(){var y=this.session,b=this.$size,f=b.height<=2*this.lineHeight,p=this.session.getScreenLength(),c=p*this.lineHeight,g=this.$getLongestLine(),A=!f&&(this.$hScrollBarAlwaysVisible||b.scrollerWidth-g-2*this.$padding<0),T=this.$horizScroll!==A;T&&(this.$horizScroll=A,this.scrollBarH.setVisible(A));var E=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var _=b.scrollerHeight+this.lineHeight,O=!this.$maxLines&&this.$scrollPastEnd?(b.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;c+=O;var I=this.scrollMargin;this.session.setScrollTop(Math.max(-I.top,Math.min(this.scrollTop,c-b.scrollerHeight+I.bottom))),this.session.setScrollLeft(Math.max(-I.left,Math.min(this.scrollLeft,g+2*this.$padding-b.scrollerWidth+I.right)));var N=!f&&(this.$vScrollBarAlwaysVisible||b.scrollerHeight-c+O<0||this.scrollTop>I.top),F=E!==N;F&&(this.$vScroll=N,this.scrollBarV.setVisible(N));var D=this.scrollTop%this.lineHeight,W=Math.ceil(_/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-D)/this.lineHeight)),z=B+W,G,U,V=this.lineHeight;B=y.screenToDocumentRow(B,0);var Y=y.getFoldLine(B);Y&&(B=Y.start.row),G=y.documentToScreenRow(B,0),U=y.getRowLength(B)*V,z=Math.min(y.screenToDocumentRow(z,0),y.getLength()-1),_=b.scrollerHeight+y.getRowLength(z)*V+U,D=this.scrollTop-G*V;var K=0;return (this.layerConfig.width!=g||T)&&(K=this.CHANGE_H_SCROLL),(T||F)&&(K|=this.$updateCachedSize(!0,this.gutterWidth,b.width,b.height),this._signal("scrollbarVisibilityChanged"),F&&(g=this.$getLongestLine())),this.layerConfig={width:g,padding:this.$padding,firstRow:B,firstRowScreen:G,lastRow:z,lineHeight:V,characterWidth:this.characterWidth,minHeight:_,maxHeight:c,offset:D,gutterOffset:V?Math.max(0,Math.ceil((D+b.height-b.scrollerHeight)/V)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(g-this.$padding),K},C.prototype.$updateLines=function(){if(this.$changedLines){var y=this.$changedLines.firstRow,b=this.$changedLines.lastRow;this.$changedLines=null;var f=this.layerConfig;if(!(y>f.lastRow+1)&&!(b<f.firstRow)){if(b===1/0){this.$showGutter&&this.$gutterLayer.update(f),this.$textLayer.update(f);return}return this.$textLayer.updateLines(f,y,b),!0}}},C.prototype.$getLongestLine=function(){var y=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(y+=1),this.$textLayer&&y>this.$textLayer.MAX_LINE_LENGTH&&(y=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(y*this.characterWidth))},C.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT);},C.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK);},C.prototype.addGutterDecoration=function(y,b){this.$gutterLayer.addGutterDecoration(y,b);},C.prototype.removeGutterDecoration=function(y,b){this.$gutterLayer.removeGutterDecoration(y,b);},C.prototype.updateBreakpoints=function(y){this._rows=y,this.$loop.schedule(this.CHANGE_GUTTER);},C.prototype.setAnnotations=function(y){this.$gutterLayer.setAnnotations(y),this.$loop.schedule(this.CHANGE_GUTTER);},C.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR);},C.prototype.hideCursor=function(){this.$cursorLayer.hideCursor();},C.prototype.showCursor=function(){this.$cursorLayer.showCursor();},C.prototype.scrollSelectionIntoView=function(y,b,f){this.scrollCursorIntoView(y,f),this.scrollCursorIntoView(b,f);},C.prototype.scrollCursorIntoView=function(y,b,f){if(this.$size.scrollerHeight!==0){var p=this.$cursorLayer.getPixelPosition(y),c=p.left,g=p.top,A=f&&f.top||0,T=f&&f.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var E=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;E+A>g?(b&&E+A>g+this.lineHeight&&(g-=b*this.$size.scrollerHeight),g===0&&(g=-this.scrollMargin.top),this.session.setScrollTop(g)):E+this.$size.scrollerHeight-T<g+this.lineHeight&&(b&&E+this.$size.scrollerHeight-T<g-this.lineHeight&&(g+=b*this.$size.scrollerHeight),this.session.setScrollTop(g+this.lineHeight+T-this.$size.scrollerHeight));var _=this.scrollLeft,O=2*this.layerConfig.characterWidth;c-O<_?(c-=O,c<this.$padding+O&&(c=-this.scrollMargin.left),this.session.setScrollLeft(c)):(c+=O,_+this.$size.scrollerWidth<c+this.characterWidth?this.session.setScrollLeft(Math.round(c+this.characterWidth-this.$size.scrollerWidth)):_<=this.$padding&&c-_<this.characterWidth&&this.session.setScrollLeft(0));}},C.prototype.getScrollTop=function(){return this.session.getScrollTop()},C.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},C.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},C.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},C.prototype.scrollToRow=function(y){this.session.setScrollTop(y*this.lineHeight);},C.prototype.alignCursor=function(y,b){typeof y=="number"&&(y={row:y,column:0});var f=this.$cursorLayer.getPixelPosition(y),p=this.$size.scrollerHeight-this.lineHeight,c=f.top-p*(b||0);return this.session.setScrollTop(c),c},C.prototype.$calcSteps=function(y,b){var f=0,p=this.STEPS,c=[],g=function(A,T,E){return E*(Math.pow(A-1,3)+1)+T};for(f=0;f<p;++f)c.push(g(f/this.STEPS,y,b-y));return c},C.prototype.scrollToLine=function(y,b,f,p){var c=this.$cursorLayer.getPixelPosition({row:y,column:0}),g=c.top;b&&(g-=this.$size.scrollerHeight/2);var A=this.scrollTop;this.session.setScrollTop(g),f!==!1&&this.animateScrolling(A,p);},C.prototype.animateScrolling=function(y,b){var f=this.scrollTop;if(!this.$animatedScroll)return;var p=this;if(y==f)return;if(this.$scrollAnimation){var c=this.$scrollAnimation.steps;if(c.length&&(y=c[0],y==f))return}var g=p.$calcSteps(y,f);this.$scrollAnimation={from:y,to:f,steps:g},clearInterval(this.$timer),p.session.setScrollTop(g.shift()),p.session.$scrollTop=f;function A(){p.$timer=clearInterval(p.$timer),p.$scrollAnimation=null,p.$stopAnimation=!1,b&&b();}this.$timer=setInterval(function(){if(p.$stopAnimation){A();return}if(!p.session)return clearInterval(p.$timer);g.length?(p.session.setScrollTop(g.shift()),p.session.$scrollTop=f):f!=null?(p.session.$scrollTop=-1,p.session.setScrollTop(f),f=null):A();},10);},C.prototype.scrollToY=function(y){this.scrollTop!==y&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=y);},C.prototype.scrollToX=function(y){this.scrollLeft!==y&&(this.scrollLeft=y),this.$loop.schedule(this.CHANGE_H_SCROLL);},C.prototype.scrollTo=function(y,b){this.session.setScrollTop(b),this.session.setScrollLeft(y);},C.prototype.scrollBy=function(y,b){b&&this.session.setScrollTop(this.session.getScrollTop()+b),y&&this.session.setScrollLeft(this.session.getScrollLeft()+y);},C.prototype.isScrollableBy=function(y,b){if(b<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||b>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||y<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||y>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return !0},C.prototype.pixelToScreenCoordinates=function(y,b){var f;if(this.$hasCssTransforms){f={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([y,b]);y=p[1]-this.gutterWidth-this.margin.left,b=p[0];}else f=this.scroller.getBoundingClientRect();var c=y+this.scrollLeft-f.left-this.$padding,g=c/this.characterWidth,A=Math.floor((b+this.scrollTop-f.top)/this.lineHeight),T=this.$blockCursor?Math.floor(g):Math.round(g);return {row:A,column:T,side:g-T>0?1:-1,offsetX:c}},C.prototype.screenToTextCoordinates=function(y,b){var f;if(this.$hasCssTransforms){f={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([y,b]);y=p[1]-this.gutterWidth-this.margin.left,b=p[0];}else f=this.scroller.getBoundingClientRect();var c=y+this.scrollLeft-f.left-this.$padding,g=c/this.characterWidth,A=this.$blockCursor?Math.floor(g):Math.round(g),T=Math.floor((b+this.scrollTop-f.top)/this.lineHeight);return this.session.screenToDocumentPosition(T,Math.max(A,0),c)},C.prototype.textToScreenCoordinates=function(y,b){var f=this.scroller.getBoundingClientRect(),p=this.session.documentToScreenPosition(y,b),c=this.$padding+(this.session.$bidiHandler.isBidiRow(p.row,y)?this.session.$bidiHandler.getPosLeft(p.column):Math.round(p.column*this.characterWidth)),g=p.row*this.lineHeight;return {pageX:f.left+c-this.scrollLeft,pageY:f.top+g-this.scrollTop}},C.prototype.visualizeFocus=function(){L.addCssClass(this.container,"ace_focus");},C.prototype.visualizeBlur=function(){L.removeCssClass(this.container,"ace_focus");},C.prototype.showComposition=function(y){this.$composition=y,y.cssText||(y.cssText=this.textarea.style.cssText),y.useTextareaForIME==null&&(y.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(L.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):y.markerId=this.session.addMarker(y.markerRange,"ace_composition_marker","text");},C.prototype.setCompositionText=function(y){var b=this.session.selection.cursor;this.addToken(y,"composition_placeholder",b.row,b.column),this.$moveTextAreaToCursor();},C.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),L.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var y=this.session.selection.cursor;this.removeExtraToken(y.row,y.column),this.$composition=null,this.$cursorLayer.element.style.display="";}},C.prototype.setGhostText=function(y,b){var f=this.session.selection.cursor,p=b||{row:f.row,column:f.column};this.removeGhostText();var c=this.$calculateWrappedTextChunks(y,p);this.addToken(c[0].text,"ghost_text",p.row,p.column),this.$ghostText={text:y,position:{row:p.row,column:p.column}};var g=L.createElement("div");if(c.length>1){var A=this.hideTokensAfterPosition(p.row,p.column),T;c.slice(1).forEach(function(F){var D=L.createElement("div"),W=L.createElement("span");W.className="ace_ghost_text",F.wrapped&&(D.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),W.appendChild(L.createTextNode(F.text)),D.appendChild(W),g.appendChild(D),T=D;}),A.forEach(function(F){var D=L.createElement("span");h(F.type)||(D.className="ace_"+F.type.replace(/\./g," ace_")),D.appendChild(L.createTextNode(F.value)),T.appendChild(D);}),this.$ghostTextWidget={el:g,row:p.row,column:p.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var E=this.$cursorLayer.getPixelPosition(p,!0),_=this.container,O=_.getBoundingClientRect().height,I=c.length*this.lineHeight,N=I<O-E.top;if(N)return;I<O?this.scrollBy(0,(c.length-1)*this.lineHeight):this.scrollToRow(p.row);}},C.prototype.$calculateWrappedTextChunks=function(y,b){var f=this.$size.scrollerWidth-this.$padding*2,p=Math.floor(f/this.characterWidth)-2;p=p<=0?60:p;for(var c=y.split(/\r?\n/),g=[],A=0;A<c.length;A++){var T=this.session.$getDisplayTokens(c[A],b.column),E=this.session.$computeWrapSplits(T,p,this.session.$tabSize);if(E.length>0){var _=0;E.push(c[A].length);for(var O=0;O<E.length;O++){var I=c[A].slice(_,E[O]);g.push({text:I,wrapped:!0}),_=E[O];}}else g.push({text:c[A],wrapped:!1});}return g},C.prototype.removeGhostText=function(){if(this.$ghostText){var y=this.$ghostText.position;this.removeExtraToken(y.row,y.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null;}},C.prototype.addToken=function(y,b,f,p){var c=this.session;c.bgTokenizer.lines[f]=null;var g={type:b,value:y},A=c.getTokens(f);if(p==null||!A.length)A.push(g);else for(var T=0,E=0;E<A.length;E++){var _=A[E];if(T+=_.value.length,p<=T){var O=_.value.length-(T-p),I=_.value.slice(0,O),N=_.value.slice(O);A.splice(E,1,{type:_.type,value:I},g,{type:_.type,value:N});break}}this.updateLines(f,f);},C.prototype.hideTokensAfterPosition=function(y,b){for(var f=this.session.getTokens(y),p=0,c=!1,g=[],A=0;A<f.length;A++){var T=f[A];if(p+=T.value.length,T.type!=="ghost_text"){if(c){g.push({type:T.type,value:T.value}),T.type="hidden_token";continue}p===b&&(c=!0);}}return this.updateLines(y,y),g},C.prototype.removeExtraToken=function(y,b){this.session.bgTokenizer.lines[y]=null,this.updateLines(y,y);},C.prototype.setTheme=function(y,b){var f=this;if(this.$themeId=y,f._dispatchEvent("themeChange",{theme:y}),!y||typeof y=="string"){var p=y||this.$options.theme.initialValue;s.loadModule(["theme",p],c);}else c(y);function c(g){if(f.$themeId!=y)return b&&b();if(!g||!g.cssClass)throw new Error("couldn't load module "+y+" or it didn't call define");g.$id&&(f.$themeId=g.$id),L.importCssString(g.cssText,g.cssClass,f.container),f.theme&&L.removeCssClass(f.container,f.theme.cssClass);var A="padding"in g?g.padding:"padding"in(f.theme||{})?4:f.$padding;f.$padding&&A!=f.$padding&&f.setPadding(A),f.$theme=g.cssClass,f.theme=g,L.addCssClass(f.container,g.cssClass),L.setCssClass(f.container,"ace_dark",g.isDark),f.$size&&(f.$size.width=0,f.$updateSizeAsync()),f._dispatchEvent("themeLoaded",{theme:g}),b&&b(),d.isSafari&&f.scroller&&(f.scroller.style.background="red",f.scroller.style.background="");}},C.prototype.getTheme=function(){return this.$themeId},C.prototype.setStyle=function(y,b){L.setCssClass(this.container,y,b!==!1);},C.prototype.unsetStyle=function(y){L.removeCssClass(this.container,y);},C.prototype.setCursorStyle=function(y){L.setStyle(this.scroller.style,"cursor",y);},C.prototype.setMouseCursor=function(y){L.setStyle(this.scroller.style,"cursor",y);},C.prototype.attachToShadowRoot=function(){L.importCssString(m,"ace_editor.css",this.container);},C.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1);},C.prototype.$updateCustomScrollbar=function(y){var b=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,y===!0?(this.scrollBarV=new a(this.container,this),this.scrollBarH=new o(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollTop(f.data-b.scrollMargin.top);}),this.scrollBarH.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollLeft(f.data-b.scrollMargin.left);}),this.$scrollDecorator=new $(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new t(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollTop(f.data-b.scrollMargin.top);}),this.scrollBarH.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollLeft(f.data-b.scrollMargin.left);}));},C.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var y=this;this.$resizeTimer=x.delayedCall(function(){y.destroyed||y.onResize();},50),this.$resizeObserver=new window.ResizeObserver(function(b){var f=b[0].contentRect.width,p=b[0].contentRect.height;Math.abs(y.$size.width-f)>1||Math.abs(y.$size.height-p)>1?y.$resizeTimer.delay():y.$resizeTimer.cancel();}),this.$resizeObserver.observe(this.container);}},C}();v.prototype.CHANGE_CURSOR=1,v.prototype.CHANGE_MARKER=2,v.prototype.CHANGE_GUTTER=4,v.prototype.CHANGE_SCROLL=8,v.prototype.CHANGE_LINES=16,v.prototype.CHANGE_TEXT=32,v.prototype.CHANGE_SIZE=64,v.prototype.CHANGE_MARKER_BACK=128,v.prototype.CHANGE_MARKER_FRONT=256,v.prototype.CHANGE_FULL=512,v.prototype.CHANGE_H_SCROLL=1024,v.prototype.$changes=0,v.prototype.$padding=null,v.prototype.$frozen=!1,v.prototype.STEPS=8,R.implement(v.prototype,S),s.defineOptions(v.prototype,"renderer",{useResizeObserver:{set:function(C){!C&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):C&&!this.$resizeObserver&&this.$addResizeObserver();}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(C){this.$textLayer.setShowInvisibles(C)&&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(C){typeof C=="number"&&(this.$printMarginColumn=C),this.$showPrintMargin=!!C,this.$updatePrintMargin();},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(C){this.$gutter.style.display=C?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize();},initialValue:!0},useSvgGutterIcons:{set:function(C){this.$gutterLayer.$useSvgGutterIcons=C;},initialValue:!1},showFoldedAnnotations:{set:function(C){this.$gutterLayer.$showFoldedAnnotations=C;},initialValue:!1},fadeFoldWidgets:{set:function(C){L.setCssClass(this.$gutter,"ace_fade-fold-widgets",C);},initialValue:!1},showFoldWidgets:{set:function(C){this.$gutterLayer.setShowFoldWidgets(C),this.$loop.schedule(this.CHANGE_GUTTER);},initialValue:!0},displayIndentGuides:{set:function(C){this.$textLayer.setDisplayIndentGuides(C)&&this.$loop.schedule(this.CHANGE_TEXT);},initialValue:!0},highlightIndentGuides:{set:function(C){this.$textLayer.setHighlightIndentGuides(C)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);},initialValue:!0},highlightGutterLine:{set:function(C){this.$gutterLayer.setHighlightGutterLine(C),this.$loop.schedule(this.CHANGE_GUTTER);},initialValue:!0},hScrollBarAlwaysVisible:{set:function(C){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL);},initialValue:!1},vScrollBarAlwaysVisible:{set:function(C){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL);},initialValue:!1},fontSize:{set:function(C){typeof C=="number"&&(C=C+"px"),this.container.style.fontSize=C,this.updateFontSize();},initialValue:12},fontFamily:{set:function(C){this.container.style.fontFamily=C,this.updateFontSize();}},maxLines:{set:function(C){this.updateFull();}},minLines:{set:function(C){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull();}},maxPixelHeight:{set:function(C){this.updateFull();},initialValue:0},scrollPastEnd:{set:function(C){C=+C||0,this.$scrollPastEnd!=C&&(this.$scrollPastEnd=C,this.$loop.schedule(this.CHANGE_SCROLL));},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(C){this.$gutterLayer.$fixedWidth=!!C,this.$loop.schedule(this.CHANGE_GUTTER);}},customScrollbar:{set:function(C){this.$updateCustomScrollbar(C);},initialValue:!1},theme:{set:function(C){this.setTheme(C);},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!d.isMobile&&!d.isIE}}),M.VirtualRenderer=v;});ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(k,M,H){var R=k("../lib/oop"),L=k("../lib/net"),x=k("../lib/event_emitter").EventEmitter,s=k("../config");function l(n){var t="importScripts('"+L.qualifyURL(n)+"');";try{return new Blob([t],{type:"application/javascript"})}catch{var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,a=new o;return a.append(t),a.getBlob("application/javascript")}}function r(n){if(typeof Worker>"u")return {postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var t=l(n),o=window.URL||window.webkitURL,a=o.createObjectURL(t);return new Worker(a)}return new Worker(n)}var 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(){R.implement(this,x),this.$createWorkerFromOldConfig=function(n,t,o,a,u){if(k.nameToUrl&&!k.toUrl&&(k.toUrl=k.nameToUrl),s.get("packaged")||!k.toUrl)a=a||s.moduleUrl(t,"worker");else {var w=this.$normalizePath;a=a||w(k.toUrl("ace/worker/worker.js",null,"_"));var S={};n.forEach(function(m){S[m]=w(k.toUrl(m,null,"_").replace(/(\.js)?(\?.*)?$/,""));});}return this.$worker=r(a),u&&this.send("importScripts",u),this.$worker.postMessage({init:!0,tlns:S,module:t,classname:o}),this.$worker},this.onMessage=function(n){var t=n.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var o=this.callbacks[t.id];o&&(o(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data);break}},this.reportError=function(n){window.console&&console.error&&console.error(n);},this.$normalizePath=function(n){return L.qualifyURL(n)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(n){n.preventDefault();},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null;},this.send=function(n,t){this.$worker.postMessage({command:n,args:t});},this.call=function(n,t,o){if(o){var a=this.callbackId++;this.callbacks[a]=o,t.push(a);}this.send(n,t);},this.emit=function(n,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:n,data:{data:t.data}});}catch(o){console.error(o.stack);}},this.attachToDocument=function(n){this.$doc&&this.terminate(),this.$doc=n,this.call("setValue",[n.getValue()]),n.on("change",this.changeListener,!0);},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,t,o){var a=null,u=!1,w=Object.create(x),S=[],m=new e({messageBuffer:S,terminate:function(){},postMessage:function(d){S.push(d),a&&(u?setTimeout($):$());}});m.setEmitSync=function(d){u=d;};var $=function(){var d=S.shift();d.command?a[d.command].apply(a,d.args):d.event&&w._signal(d.event,d.data);};return w.postMessage=function(d){m.onMessage({data:d});},w.callback=function(d,h){this.postMessage({type:"call",id:h,data:d});},w.emit=function(d,h){this.postMessage({type:"event",name:d,data:h});},s.loadModule(["worker",t],function(d){for(a=new d[o](w);S.length;)$();}),m};M.UIWorkerClient=i,M.WorkerClient=e,M.createWorker=r;});ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(k,M,H){var R=k("./range").Range,L=k("./lib/event_emitter").EventEmitter,x=k("./lib/oop"),s=function(){function l(r,e,i,n,t,o){var a=this;this.length=e,this.session=r,this.doc=r.getDocument(),this.mainClass=t,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){a.onCursorChange();});},this.$pos=i;var u=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange);}return l.prototype.setup=function(){var r=this,e=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var n=this.pos;n.$insertRight=!0,n.detach(),n.markerId=i.addMarker(new R(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(t){var o=e.createAnchor(t.row,t.column);o.$insertRight=!0,o.detach(),r.others.push(o);}),i.setUndoSelect(!1);},l.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,e=this;this.othersActive=!0,this.others.forEach(function(i){i.markerId=r.addMarker(new R(i.row,i.column,i.row,i.column+e.length),e.othersClass,null,!1);});}},l.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId);}},l.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var e=r;if(e.start.row===e.end.row&&e.start.row===this.pos.row){this.$updating=!0;var i=r.action==="insert"?e.end.column-e.start.column:e.start.column-e.end.column,n=e.start.column>=this.pos.column&&e.start.column<=this.pos.column+this.length+1,t=e.start.column-this.pos.column;if(this.updateAnchors(r),n&&(this.length+=i),n&&!this.session.$fromUndo){if(r.action==="insert")for(var o=this.others.length-1;o>=0;o--){var a=this.others[o],u={row:a.row,column:a.column+t};this.doc.insertMergedLines(u,r.lines);}else if(r.action==="remove")for(var o=this.others.length-1;o>=0;o--){var a=this.others[o],u={row:a.row,column:a.column+t};this.doc.remove(new R(u.row,u.column,u.row,u.column-i));}}this.$updating=!1,this.updateMarkers();}},l.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var e=this.others.length;e--;)this.others[e].onChange(r);this.updateMarkers();},l.prototype.updateMarkers=function(){if(!this.$updating){var r=this,e=this.session,i=function(t,o){e.removeMarker(t.markerId),t.markerId=e.addMarker(new R(t.row,t.column,t.row,t.column+r.length),o,null,!1);};i(this.pos,this.mainClass);for(var n=this.others.length;n--;)i(this.others[n],this.othersClass);}},l.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r));}},l.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null;},l.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),e=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,i=0;i<e;i++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore);}},l}();x.implement(s.prototype,L),M.PlaceHolder=s;});ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent");function x(l,r){return l.row==r.row&&l.column==r.column}function s(l){var r=l.domEvent,e=r.altKey,i=r.shiftKey,n=r.ctrlKey,t=l.getAccelKey(),o=l.getButton();if(n&&L.isMac&&(o=r.button),l.editor.inMultiSelectMode&&o==2){l.editor.textInput.onContextMenu(l.domEvent);return}if(!n&&!e&&!t){o===0&&l.editor.inMultiSelectMode&&l.editor.exitMultiSelectMode();return}if(o===0){var a=l.editor,u=a.selection,w=a.inMultiSelectMode,S=l.getDocumentPosition(),m=u.getCursor(),$=l.inSelection()||u.isEmpty()&&x(S,m),d=l.x,h=l.y,v=function(I){d=I.clientX,h=I.clientY;},C=a.session,y=a.renderer.pixelToScreenCoordinates(d,h),b=y,f;if(a.$mouseHandler.$enableJumpToDef)n&&e||t&&e?f=i?"block":"add":e&&a.$blockSelectEnabled&&(f="block");else if(t&&!e){if(f="add",!w&&i)return}else e&&a.$blockSelectEnabled&&(f="block");if(f&&L.isMac&&r.ctrlKey&&a.$mouseHandler.cancelContextMenu(),f=="add"){if(!w&&$)return;if(!w){var p=u.toOrientedRange();a.addSelectionMarker(p);}var c=u.rangeList.rangeAtPoint(S);a.inVirtualSelectionMode=!0,i&&(c=null,p=u.ranges[0]||p,a.removeSelectionMarker(p)),a.once("mouseup",function(){var I=u.toOrientedRange();c&&I.isEmpty()&&x(c.cursor,I.cursor)?u.substractPoint(I.cursor):(i?u.substractPoint(p.cursor):p&&(a.removeSelectionMarker(p),u.addRange(p)),u.addRange(I)),a.inVirtualSelectionMode=!1;});}else if(f=="block"){l.stop(),a.inVirtualSelectionMode=!0;var g,A=[],T=function(){var I=a.renderer.pixelToScreenCoordinates(d,h),N=C.screenToDocumentPosition(I.row,I.column,I.offsetX);x(b,I)&&x(N,u.lead)||(b=I,a.selection.moveToPosition(N),a.renderer.scrollCursorIntoView(),a.removeSelectionMarkers(A),A=u.rectangularRangeBlock(b,y),a.$mouseHandler.$clickSelection&&A.length==1&&A[0].isEmpty()&&(A[0]=a.$mouseHandler.$clickSelection.clone()),A.forEach(a.addSelectionMarker,a),a.updateSelectionMarkers());};w&&!t?u.toSingleRange():!w&&t&&(g=u.toOrientedRange(),a.addSelectionMarker(g)),i?y=C.documentToScreenPosition(u.lead):u.moveToPosition(S),b={row:-1,column:-1};var E=function(I){T(),clearInterval(O),a.removeSelectionMarkers(A),A.length||(A=[u.toOrientedRange()]),g&&(a.removeSelectionMarker(g),u.toSingleRange(g));for(var N=0;N<A.length;N++)u.addRange(A[N]);a.inVirtualSelectionMode=!1,a.$mouseHandler.$clickSelection=null;},_=T;R.capture(a.container,v,E);var O=setInterval(function(){_();},20);return l.preventDefault()}}}M.onMouseDown=s;});ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(k,M,H){M.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(L){L.selectMoreLines(-1);},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(L){L.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(L){L.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(L){L.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(L){L.selectMore(-1);},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(L){L.selectMore(1);},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(L){L.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(L){L.selectMore(1,!0);},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(L){L.multiSelect.rangeCount>1?L.multiSelect.joinSelections():L.multiSelect.splitIntoLines();},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(L){L.multiSelect.splitIntoLines();},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(L){L.alignCursors();},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(L){L.findAll();},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],M.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(L){L.exitMultiSelectMode();},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(L){return L&&L.inMultiSelectMode}}];var R=k("../keyboard/hash_handler").HashHandler;M.keyboardHandler=new R(M.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(k,M,H){var R=k("./range_list").RangeList,L=k("./range").Range,x=k("./selection").Selection,s=k("./mouse/multi_select_handler").onMouseDown,l=k("./lib/event"),r=k("./lib/lang"),e=k("./commands/multi_select_commands");M.commands=e.defaultCommands.concat(e.multiSelectCommands);var i=k("./search").Search,n=new i;function t(m,$,d){return n.$options.wrap=!0,n.$options.needle=$,n.$options.backwards=d==-1,n.find(m)}var o=k("./edit_session").EditSession;((function(){this.getSelectionMarkers=function(){return this.$selectionMarkers};})).call(o.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(m,$){if(m){if(!this.inMultiSelectMode&&this.rangeCount===0){var d=this.toOrientedRange();if(this.rangeList.add(d),this.rangeList.add(m),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),$||this.fromOrientedRange(m);this.rangeList.removeAll(),this.rangeList.add(d),this.$onAddRange(d);}m.cursor||(m.cursor=m.end);var h=this.rangeList.add(m);return this.$onAddRange(m),h.length&&this.$onRemoveRange(h),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),$||this.fromOrientedRange(m)}},this.toSingleRange=function(m){m=m||this.ranges[0];var $=this.rangeList.removeAll();$.length&&this.$onRemoveRange($),m&&this.fromOrientedRange(m);},this.substractPoint=function(m){var $=this.rangeList.substractPoint(m);if($)return this.$onRemoveRange($),$[0]},this.mergeOverlappingRanges=function(){var m=this.rangeList.merge();m.length&&this.$onRemoveRange(m);},this.$onAddRange=function(m){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(m),this._signal("addRange",{range:m});},this.$onRemoveRange=function(m){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var $=this.rangeList.ranges.pop();m.push($),this.rangeCount=0;}for(var d=m.length;d--;){var h=this.ranges.indexOf(m[d]);this.ranges.splice(h,1);}this._signal("removeRange",{ranges:m}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),$=$||this.ranges[0],$&&!$.isEqual(this.getRange())&&this.fromOrientedRange($);},this.$initRangeList=function(){this.rangeList||(this.rangeList=new R,this.ranges=[],this.rangeCount=0);},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var m=this.ranges.length?this.ranges:[this.getRange()],$=[],d=0;d<m.length;d++){var h=m[d],v=h.start.row,C=h.end.row;if(v===C)$.push(h.clone());else {for($.push(new L(v,h.start.column,v,this.session.getLine(v).length));++v<C;)$.push(this.getLineRange(v,!0));$.push(new L(C,0,C,h.end.column));}d==0&&!this.isBackwards()&&($=$.reverse());}this.toSingleRange();for(var d=$.length;d--;)this.addRange($[d]);},this.joinSelections=function(){var m=this.rangeList.ranges,$=m[m.length-1],d=L.fromPoints(m[0].start,$.end);this.toSingleRange(),this.setSelectionRange(d,$.cursor==$.start);},this.toggleBlockSelection=function(){if(this.rangeCount>1){var m=this.rangeList.ranges,$=m[m.length-1],d=L.fromPoints(m[0].start,$.end);this.toSingleRange(),this.setSelectionRange(d,$.cursor==$.start);}else {var h=this.session.documentToScreenPosition(this.cursor),v=this.session.documentToScreenPosition(this.anchor),C=this.rectangularRangeBlock(h,v);C.forEach(this.addRange,this);}},this.rectangularRangeBlock=function(m,$,d){var h=[],v=m.column<$.column;if(v)var C=m.column,y=$.column,b=m.offsetX,f=$.offsetX;else var C=$.column,y=m.column,b=$.offsetX,f=m.offsetX;var p=m.row<$.row;if(p)var c=m.row,g=$.row;else var c=$.row,g=m.row;C<0&&(C=0),c<0&&(c=0),c==g&&(d=!0);for(var A,T=c;T<=g;T++){var E=L.fromPoints(this.session.screenToDocumentPosition(T,C,b),this.session.screenToDocumentPosition(T,y,f));if(E.isEmpty()){if(A&&u(E.end,A))break;A=E.end;}E.cursor=v?E.start:E.end,h.push(E);}if(p&&h.reverse(),!d){for(var _=h.length-1;h[_].isEmpty()&&_>0;)_--;if(_>0)for(var O=0;h[O].isEmpty();)O++;for(var I=_;I>=O;I--)h[I].isEmpty()&&h.splice(I,1);}return h};}.call(x.prototype);var a=k("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.addSelectionMarker=function(m){m.cursor||(m.cursor=m.end);var $=this.getSelectionStyle();return m.marker=this.session.addMarker(m,"ace_selection",$),this.session.$selectionMarkers.push(m),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,m},this.removeSelectionMarker=function(m){if(m.marker){this.session.removeMarker(m.marker);var $=this.session.$selectionMarkers.indexOf(m);$!=-1&&this.session.$selectionMarkers.splice($,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length;}},this.removeSelectionMarkers=function(m){for(var $=this.session.$selectionMarkers,d=m.length;d--;){var h=m[d];if(h.marker){this.session.removeMarker(h.marker);var v=$.indexOf(h);v!=-1&&$.splice(v,1);}}this.session.selectionMarkerCount=$.length;},this.$onAddRange=function(m){this.addSelectionMarker(m.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.$onRemoveRange=function(m){this.removeSelectionMarkers(m.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.$onMultiSelect=function(m){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(e.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers());},this.$onSingleSelect=function(m){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(e.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"));},this.$onMultiSelectExec=function(m){var $=m.command,d=m.editor;if(d.multiSelect){if($.multiSelectAction)$.multiSelectAction=="forEach"?h=d.forEachSelection($,m.args):$.multiSelectAction=="forEachLine"?h=d.forEachSelection($,m.args,!0):$.multiSelectAction=="single"?(d.exitMultiSelectMode(),h=$.exec(d,m.args||{})):h=$.multiSelectAction(d,m.args||{});else {var h=$.exec(d,m.args||{});d.multiSelect.addRange(d.multiSelect.toOrientedRange()),d.multiSelect.mergeOverlappingRanges();}return h}},this.forEachSelection=function(m,$,d){if(!this.inVirtualSelectionMode){var h=d&&d.keepOrder,v=d==!0||d&&d.$byLines,C=this.session,y=this.selection,b=y.rangeList,f=(h?y:b).ranges,p;if(!f.length)return m.exec?m.exec(this,$||{}):m(this,$||{});var c=y._eventRegistry;y._eventRegistry={};var g=new x(C);this.inVirtualSelectionMode=!0;for(var A=f.length;A--;){if(v)for(;A>0&&f[A].start.row==f[A-1].end.row;)A--;g.fromOrientedRange(f[A]),g.index=A,this.selection=C.selection=g;var T=m.exec?m.exec(this,$||{}):m(this,$||{});!p&&T!==void 0&&(p=T),g.toOrientedRange(f[A]);}g.detach(),this.selection=C.selection=y,this.inVirtualSelectionMode=!1,y._eventRegistry=c,y.mergeOverlappingRanges(),y.ranges[0]&&y.fromOrientedRange(y.ranges[0]);var E=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),E&&E.from==E.to&&this.renderer.animateScrolling(E.from),p}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange();},this.getSelectedText=function(){var m="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var $=this.multiSelect.rangeList.ranges,d=[],h=0;h<$.length;h++)d.push(this.session.getTextRange($[h]));var v=this.session.getDocument().getNewLineCharacter();m=d.join(v),m.length==(d.length-1)*v.length&&(m="");}else this.selection.isEmpty()||(m=this.session.getTextRange(this.getSelectionRange()));return m},this.$checkMultiselectChange=function(m,$){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var d=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&$==this.multiSelect.anchor)return;var h=$==this.multiSelect.anchor?d.cursor==d.start?d.end:d.start:d.cursor;h.row!=$.row||this.session.$clipPositionToDocument(h.row,h.column).column!=$.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges();}},this.findAll=function(m,$,d){if($=$||{},$.needle=m||$.needle,$.needle==null){var h=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();$.needle=this.session.getTextRange(h);}this.$search.set($);var v=this.$search.findAll(this.session);if(!v.length)return 0;var C=this.multiSelect;d||C.toSingleRange(v[0]);for(var y=v.length;y--;)C.addRange(v[y],!0);return h&&C.rangeList.rangeAtPoint(h.start)&&C.addRange(h,!0),v.length},this.selectMoreLines=function(m,$){var d=this.selection.toOrientedRange(),h=d.cursor==d.end,v=this.session.documentToScreenPosition(d.cursor);this.selection.$desiredColumn&&(v.column=this.selection.$desiredColumn);var C=this.session.screenToDocumentPosition(v.row+m,v.column);if(d.isEmpty())var b=C;else var y=this.session.documentToScreenPosition(h?d.end:d.start),b=this.session.screenToDocumentPosition(y.row+m,y.column);if(h){var f=L.fromPoints(C,b);f.cursor=f.start;}else {var f=L.fromPoints(b,C);f.cursor=f.end;}if(f.desiredColumn=v.column,!this.selection.inMultiSelectMode)this.selection.addRange(d);else if($)var p=d.cursor;this.selection.addRange(f),p&&this.selection.substractPoint(p);},this.transposeSelections=function(m){for(var $=this.session,d=$.multiSelect,h=d.ranges,v=h.length;v--;){var C=h[v];if(C.isEmpty()){var y=$.getWordRange(C.start.row,C.start.column);C.start.row=y.start.row,C.start.column=y.start.column,C.end.row=y.end.row,C.end.column=y.end.column;}}d.mergeOverlappingRanges();for(var b=[],v=h.length;v--;){var C=h[v];b.unshift($.getTextRange(C));}m<0?b.unshift(b.pop()):b.push(b.shift());for(var v=h.length;v--;){var C=h[v],f=C.clone();$.replace(C,b[v]),C.start.row=f.start.row,C.start.column=f.start.column;}d.fromOrientedRange(d.ranges[0]);},this.selectMore=function(m,$,d){var h=this.session,v=h.multiSelect,C=v.toOrientedRange();if(!(C.isEmpty()&&(C=h.getWordRange(C.start.row,C.start.column),C.cursor=m==-1?C.start:C.end,this.multiSelect.addRange(C),d))){var y=h.getTextRange(C),b=t(h,y,m);b&&(b.cursor=m==-1?b.start:b.end,this.session.unfold(b),this.multiSelect.addRange(b),this.renderer.scrollCursorIntoView(null,.5)),$&&this.multiSelect.substractPoint(C.cursor);}},this.alignCursors=function(){var m=this.session,$=m.multiSelect,d=$.ranges,h=-1,v=d.filter(function(_){if(_.cursor.row==h)return !0;h=_.cursor.row;});if(!d.length||v.length==d.length-1){var C=this.selection.getRange(),y=C.start.row,b=C.end.row,f=y==b;if(f){var p=this.session.getLength(),c;do c=this.session.getLine(b);while(/[=:]/.test(c)&&++b<p);do c=this.session.getLine(y);while(/[=:]/.test(c)&&--y>0);y<0&&(y=0),b>=p&&(b=p-1);}var g=this.session.removeFullLines(y,b);g=this.$reAlignText(g,f),this.session.insert({row:y,column:0},g.join(`
941
+ }`;});ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(k,M,H){var R=k("../lib/dom"),L=k("../lib/oop"),x=k("../lib/event_emitter").EventEmitter,s=function(){function c(r,t){this.canvas=R.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas);}return c.prototype.$updateDecorators=function(r){var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var i=(r.lastRow+1)*this.lineHeight;i<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight;}var n=this.canvas.getContext("2d");function e(b,f){return b.priority<f.priority?-1:b.priority>f.priority?1:0}var o=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),o){var a={info:1,warning:2,error:3};o.forEach(function(b){b.priority=a[b.type]||null;}),o=o.sort(e);for(var u=this.renderer.session.$foldData,w=0;w<o.length;w++){var S=o[w].row,m=this.compensateFoldRows(S,u),$=Math.round((S-m)*this.lineHeight*this.heightRatio),d=Math.round((S-m)*this.lineHeight*this.heightRatio),h=Math.round(((S-m)*this.lineHeight+this.lineHeight)*this.heightRatio),v=h-d;if(v<this.minDecorationHeight){var C=(d+h)/2|0;C<this.halfMinDecorationHeight?C=this.halfMinDecorationHeight:C+this.halfMinDecorationHeight>this.canvasHeight&&(C=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(C-this.halfMinDecorationHeight),h=Math.round(C+this.halfMinDecorationHeight);}n.fillStyle=t[o[w].type]||null,n.fillRect(0,$,this.canvasWidth,h-d);}}var y=this.renderer.session.selection.getCursor();if(y){var m=this.compensateFoldRows(y.row,u),$=Math.round((y.row-m)*this.lineHeight*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,$,this.canvasWidth,2);}},c.prototype.compensateFoldRows=function(r,t){var i=0;if(t&&t.length>0)for(var n=0;n<t.length;n++)r>t[n].start.row&&r<t[n].end.row?i+=r-t[n].start.row:r>=t[n].end.row&&(i+=t[n].end.row-t[n].start.row);return i},c}();L.implement(s.prototype,x),M.Decorator=s;});ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(k,M,H){var R=k("./lib/oop"),L=k("./lib/dom"),x=k("./lib/lang"),s=k("./config"),c=k("./layer/gutter").Gutter,r=k("./layer/marker").Marker,t=k("./layer/text").Text,i=k("./layer/cursor").Cursor,n=k("./scrollbar").HScrollBar,e=k("./scrollbar").VScrollBar,o=k("./scrollbar_custom").HScrollBar,a=k("./scrollbar_custom").VScrollBar,u=k("./renderloop").RenderLoop,w=k("./layer/font_metrics").FontMetrics,S=k("./lib/event_emitter").EventEmitter,m=k("./css/editor-css"),$=k("./layer/decorators").Decorator,d=k("./lib/useragent"),h=k("./layer/text_util").isTextToken;L.importCssString(m,"ace_editor.css",!1);var v=function(){function C(y,b){var f=this;this.container=y||L.createElement("div"),L.addCssClass(this.container,"ace_editor"),L.HI_DPI&&L.addCssClass(this.container,"ace_hidpi"),this.setTheme(b),s.get("useStrictCSP")==null&&s.set("useStrictCSP",!1),this.$gutter=L.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=L.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=L.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 r(this.content);var p=this.$textLayer=new t(this.content);this.canvas=p.element,this.$markerFront=new r(this.content),this.$cursorLayer=new i(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.on("scroll",function(l){f.$scrollAnimation||f.session.setScrollTop(l.data-f.scrollMargin.top);}),this.scrollBarH.on("scroll",function(l){f.$scrollAnimation||f.session.setScrollLeft(l.data-f.scrollMargin.left);}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new w(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(l){f.updateCharacterSize(),f.onResize(!0,f.gutterWidth,f.$size.width,f.$size.height),f._signal("changeCharacterSize",l);}),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=!d.isIOS,this.$loop=new u(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this);}return C.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),L.setStyle(this.scroller.style,"line-height",this.lineHeight+"px");},C.prototype.setSession=function(y){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=y,y&&this.scrollMargin.top&&y.getScrollTop()<=0&&y.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(y),this.$markerBack.setSession(y),this.$markerFront.setSession(y),this.$gutterLayer.setSession(y),this.$textLayer.setSession(y),y&&(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));},C.prototype.updateLines=function(y,b,f){if(b===void 0&&(b=1/0),this.$changedLines?(this.$changedLines.firstRow>y&&(this.$changedLines.firstRow=y),this.$changedLines.lastRow<b&&(this.$changedLines.lastRow=b)):this.$changedLines={firstRow:y,lastRow:b},this.$changedLines.lastRow<this.layerConfig.firstRow)if(f)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES);},C.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);},C.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize();},C.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT);},C.prototype.updateFull=function(y){y?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL);},C.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges();},C.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize();},C.prototype.onResize=function(y,b,f,p){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=y?1:0;var l=this.container;p||(p=l.clientHeight||l.scrollHeight),!p&&this.$maxLines&&this.lineHeight>1&&(!l.style.height||l.style.height=="0px")&&(l.style.height="1px",p=l.clientHeight||l.scrollHeight),f||(f=l.clientWidth||l.scrollWidth);var g=this.$updateCachedSize(y,b,f,p);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!f&&!p)return this.resizing=0;y&&(this.$gutterLayer.$padding=null),y?this.$renderChanges(g|this.$changes,!0):this.$loop.schedule(g|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0);}},C.prototype.$updateCachedSize=function(y,b,f,p){p-=this.$extraHeight||0;var l=0,g=this.$size,A={width:g.width,height:g.height,scrollerHeight:g.scrollerHeight,scrollerWidth:g.scrollerWidth};if(p&&(y||g.height!=p)&&(g.height=p,l|=this.CHANGE_SIZE,g.scrollerHeight=g.height,this.$horizScroll&&(g.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(g.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",l=l|this.CHANGE_SCROLL),f&&(y||g.width!=f)){l|=this.CHANGE_SIZE,g.width=f,b==null&&(b=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=b,L.setStyle(this.scrollBarH.element.style,"left",b+"px"),L.setStyle(this.scroller.style,"left",b+this.margin.left+"px"),g.scrollerWidth=Math.max(0,f-b-this.scrollBarV.getWidth()-this.margin.h),L.setStyle(this.$gutter.style,"left",this.margin.left+"px");var T=this.scrollBarV.getWidth()+"px";L.setStyle(this.scrollBarH.element.style,"right",T),L.setStyle(this.scroller.style,"right",T),L.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(g.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||y)&&(l|=this.CHANGE_FULL);}return g.$dirty=!f||!p,l&&this._signal("resize",A),l},C.prototype.onGutterResize=function(y){var b=this.$showGutter?y:0;b!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,b,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();},C.prototype.adjustWrapLimit=function(){var y=this.$size.scrollerWidth-this.$padding*2,b=Math.floor(y/this.characterWidth);return this.session.adjustWrapLimit(b,this.$showPrintMargin&&this.$printMarginColumn)},C.prototype.setAnimatedScroll=function(y){this.setOption("animatedScroll",y);},C.prototype.getAnimatedScroll=function(){return this.$animatedScroll},C.prototype.setShowInvisibles=function(y){this.setOption("showInvisibles",y),this.session.$bidiHandler.setShowInvisibles(y);},C.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},C.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},C.prototype.setDisplayIndentGuides=function(y){this.setOption("displayIndentGuides",y);},C.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},C.prototype.setHighlightIndentGuides=function(y){this.setOption("highlightIndentGuides",y);},C.prototype.setShowPrintMargin=function(y){this.setOption("showPrintMargin",y);},C.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},C.prototype.setPrintMarginColumn=function(y){this.setOption("printMarginColumn",y);},C.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},C.prototype.getShowGutter=function(){return this.getOption("showGutter")},C.prototype.setShowGutter=function(y){return this.setOption("showGutter",y)},C.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},C.prototype.setFadeFoldWidgets=function(y){this.setOption("fadeFoldWidgets",y);},C.prototype.setHighlightGutterLine=function(y){this.setOption("highlightGutterLine",y);},C.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},C.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var y=L.createElement("div");y.className="ace_layer ace_print-margin-layer",this.$printMarginEl=L.createElement("div"),this.$printMarginEl.className="ace_print-margin",y.appendChild(this.$printMarginEl),this.content.insertBefore(y,this.content.firstChild);}var b=this.$printMarginEl.style;b.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",b.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit();}},C.prototype.getContainerElement=function(){return this.container},C.prototype.getMouseEventTarget=function(){return this.scroller},C.prototype.getTextAreaContainer=function(){return this.container},C.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var y=this.textarea.style,b=this.$composition;if(!this.$keepTextAreaAtCursor&&!b){L.translate(this.textarea,-100,0);return}var f=this.$cursorLayer.$pixelPos;if(f){b&&b.markerRange&&(f=this.$cursorLayer.getPixelPosition(b.markerRange.start,!0));var p=this.layerConfig,l=f.top,g=f.left;l-=p.offset;var A=b&&b.useTextareaForIME||d.isMobile?this.lineHeight:1;if(l<0||l>p.height-A){L.translate(this.textarea,0,0);return}var T=1,E=this.$size.height-A;if(!b)l+=this.lineHeight;else if(b.useTextareaForIME){var _=this.textarea.value;T=this.characterWidth*this.session.$getStringScreenWidth(_)[0];}else l+=this.lineHeight+2;g-=this.scrollLeft,g>this.$size.scrollerWidth-T&&(g=this.$size.scrollerWidth-T),g+=this.gutterWidth+this.margin.left,L.setStyle(y,"height",A+"px"),L.setStyle(y,"width",T+"px"),L.translate(this.textarea,Math.min(g,this.$size.scrollerWidth-T),Math.min(l,E));}}},C.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},C.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},C.prototype.getLastFullyVisibleRow=function(){var y=this.layerConfig,b=y.lastRow,f=this.session.documentToScreenRow(b,0)*y.lineHeight;return f-this.session.getScrollTop()>y.height-y.lineHeight?b-1:b},C.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},C.prototype.setPadding=function(y){this.$padding=y,this.$textLayer.setPadding(y),this.$cursorLayer.setPadding(y),this.$markerFront.setPadding(y),this.$markerBack.setPadding(y),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin();},C.prototype.setScrollMargin=function(y,b,f,p){var l=this.scrollMargin;l.top=y|0,l.bottom=b|0,l.right=p|0,l.left=f|0,l.v=l.top+l.bottom,l.h=l.left+l.right,l.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-l.top),this.updateFull();},C.prototype.setMargin=function(y,b,f,p){var l=this.margin;l.top=y|0,l.bottom=b|0,l.right=p|0,l.left=f|0,l.v=l.top+l.bottom,l.h=l.left+l.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull();},C.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},C.prototype.setHScrollBarAlwaysVisible=function(y){this.setOption("hScrollBarAlwaysVisible",y);},C.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},C.prototype.setVScrollBarAlwaysVisible=function(y){this.setOption("vScrollBarAlwaysVisible",y);},C.prototype.$updateScrollBarV=function(){var y=this.layerConfig.maxHeight,b=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(y-=(b-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>y-b&&(y=this.scrollTop+b,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(y+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top);},C.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left);},C.prototype.freeze=function(){this.$frozen=!0;},C.prototype.unfreeze=function(){this.$frozen=!1;},C.prototype.$renderChanges=function(y,b){if(this.$changes&&(y|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!y&&!b){this.$changes|=y;return}if(this.$size.$dirty)return this.$changes|=y,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",y),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var f=this.layerConfig;if(y&this.CHANGE_FULL||y&this.CHANGE_SIZE||y&this.CHANGE_TEXT||y&this.CHANGE_LINES||y&this.CHANGE_SCROLL||y&this.CHANGE_H_SCROLL){if(y|=this.$computeLayerConfig()|this.$loop.clear(),f.firstRow!=this.layerConfig.firstRow&&f.firstRowScreen==this.layerConfig.firstRowScreen){var p=this.scrollTop+(f.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;p>0&&(this.scrollTop=p,y=y|this.CHANGE_SCROLL,y|=this.$computeLayerConfig()|this.$loop.clear());}f=this.layerConfig,this.$updateScrollBarV(),y&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),L.translate(this.content,-this.scrollLeft,-f.offset);var l=f.width+2*this.$padding+"px",g=f.minHeight+"px";L.setStyle(this.content.style,"width",l),L.setStyle(this.content.style,"height",g);}if(y&this.CHANGE_H_SCROLL&&(L.translate(this.content,-this.scrollLeft,-f.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),y&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(f),this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f),this.$markerBack.update(f),this.$markerFront.update(f),this.$cursorLayer.update(f),this.$moveTextAreaToCursor(),this._signal("afterRender",y);return}if(y&this.CHANGE_SCROLL){this.$changedLines=null,y&this.CHANGE_TEXT||y&this.CHANGE_LINES?this.$textLayer.update(f):this.$textLayer.scrollLines(f),this.$showGutter&&(y&this.CHANGE_GUTTER||y&this.CHANGE_LINES?this.$gutterLayer.update(f):this.$gutterLayer.scrollLines(f)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f),this.$markerBack.update(f),this.$markerFront.update(f),this.$cursorLayer.update(f),this.$moveTextAreaToCursor(),this._signal("afterRender",y);return}y&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(f),this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_LINES?((this.$updateLines()||y&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_TEXT||y&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)):y&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(f),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(f)),y&this.CHANGE_CURSOR&&(this.$cursorLayer.update(f),this.$moveTextAreaToCursor()),y&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(f),y&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(f),this._signal("afterRender",y);},C.prototype.$autosize=function(){var y=this.session.getScreenLength()*this.lineHeight,b=this.$maxLines*this.lineHeight,f=Math.min(b,Math.max((this.$minLines||1)*this.lineHeight,y))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(f+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&f>this.$maxPixelHeight&&(f=this.$maxPixelHeight);var p=f<=2*this.lineHeight,l=!p&&y>b;if(f!=this.desiredHeight||this.$size.height!=this.desiredHeight||l!=this.$vScroll){l!=this.$vScroll&&(this.$vScroll=l,this.scrollBarV.setVisible(l));var g=this.container.clientWidth;this.container.style.height=f+"px",this.$updateCachedSize(!0,this.$gutterWidth,g,f),this.desiredHeight=f,this._signal("autosize");}},C.prototype.$computeLayerConfig=function(){var y=this.session,b=this.$size,f=b.height<=2*this.lineHeight,p=this.session.getScreenLength(),l=p*this.lineHeight,g=this.$getLongestLine(),A=!f&&(this.$hScrollBarAlwaysVisible||b.scrollerWidth-g-2*this.$padding<0),T=this.$horizScroll!==A;T&&(this.$horizScroll=A,this.scrollBarH.setVisible(A));var E=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var _=b.scrollerHeight+this.lineHeight,O=!this.$maxLines&&this.$scrollPastEnd?(b.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;l+=O;var I=this.scrollMargin;this.session.setScrollTop(Math.max(-I.top,Math.min(this.scrollTop,l-b.scrollerHeight+I.bottom))),this.session.setScrollLeft(Math.max(-I.left,Math.min(this.scrollLeft,g+2*this.$padding-b.scrollerWidth+I.right)));var N=!f&&(this.$vScrollBarAlwaysVisible||b.scrollerHeight-l+O<0||this.scrollTop>I.top),F=E!==N;F&&(this.$vScroll=N,this.scrollBarV.setVisible(N));var D=this.scrollTop%this.lineHeight,W=Math.ceil(_/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-D)/this.lineHeight)),z=B+W,G,U,V=this.lineHeight;B=y.screenToDocumentRow(B,0);var Y=y.getFoldLine(B);Y&&(B=Y.start.row),G=y.documentToScreenRow(B,0),U=y.getRowLength(B)*V,z=Math.min(y.screenToDocumentRow(z,0),y.getLength()-1),_=b.scrollerHeight+y.getRowLength(z)*V+U,D=this.scrollTop-G*V;var K=0;return (this.layerConfig.width!=g||T)&&(K=this.CHANGE_H_SCROLL),(T||F)&&(K|=this.$updateCachedSize(!0,this.gutterWidth,b.width,b.height),this._signal("scrollbarVisibilityChanged"),F&&(g=this.$getLongestLine())),this.layerConfig={width:g,padding:this.$padding,firstRow:B,firstRowScreen:G,lastRow:z,lineHeight:V,characterWidth:this.characterWidth,minHeight:_,maxHeight:l,offset:D,gutterOffset:V?Math.max(0,Math.ceil((D+b.height-b.scrollerHeight)/V)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(g-this.$padding),K},C.prototype.$updateLines=function(){if(this.$changedLines){var y=this.$changedLines.firstRow,b=this.$changedLines.lastRow;this.$changedLines=null;var f=this.layerConfig;if(!(y>f.lastRow+1)&&!(b<f.firstRow)){if(b===1/0){this.$showGutter&&this.$gutterLayer.update(f),this.$textLayer.update(f);return}return this.$textLayer.updateLines(f,y,b),!0}}},C.prototype.$getLongestLine=function(){var y=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(y+=1),this.$textLayer&&y>this.$textLayer.MAX_LINE_LENGTH&&(y=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(y*this.characterWidth))},C.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT);},C.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK);},C.prototype.addGutterDecoration=function(y,b){this.$gutterLayer.addGutterDecoration(y,b);},C.prototype.removeGutterDecoration=function(y,b){this.$gutterLayer.removeGutterDecoration(y,b);},C.prototype.updateBreakpoints=function(y){this._rows=y,this.$loop.schedule(this.CHANGE_GUTTER);},C.prototype.setAnnotations=function(y){this.$gutterLayer.setAnnotations(y),this.$loop.schedule(this.CHANGE_GUTTER);},C.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR);},C.prototype.hideCursor=function(){this.$cursorLayer.hideCursor();},C.prototype.showCursor=function(){this.$cursorLayer.showCursor();},C.prototype.scrollSelectionIntoView=function(y,b,f){this.scrollCursorIntoView(y,f),this.scrollCursorIntoView(b,f);},C.prototype.scrollCursorIntoView=function(y,b,f){if(this.$size.scrollerHeight!==0){var p=this.$cursorLayer.getPixelPosition(y),l=p.left,g=p.top,A=f&&f.top||0,T=f&&f.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var E=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;E+A>g?(b&&E+A>g+this.lineHeight&&(g-=b*this.$size.scrollerHeight),g===0&&(g=-this.scrollMargin.top),this.session.setScrollTop(g)):E+this.$size.scrollerHeight-T<g+this.lineHeight&&(b&&E+this.$size.scrollerHeight-T<g-this.lineHeight&&(g+=b*this.$size.scrollerHeight),this.session.setScrollTop(g+this.lineHeight+T-this.$size.scrollerHeight));var _=this.scrollLeft,O=2*this.layerConfig.characterWidth;l-O<_?(l-=O,l<this.$padding+O&&(l=-this.scrollMargin.left),this.session.setScrollLeft(l)):(l+=O,_+this.$size.scrollerWidth<l+this.characterWidth?this.session.setScrollLeft(Math.round(l+this.characterWidth-this.$size.scrollerWidth)):_<=this.$padding&&l-_<this.characterWidth&&this.session.setScrollLeft(0));}},C.prototype.getScrollTop=function(){return this.session.getScrollTop()},C.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},C.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},C.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},C.prototype.scrollToRow=function(y){this.session.setScrollTop(y*this.lineHeight);},C.prototype.alignCursor=function(y,b){typeof y=="number"&&(y={row:y,column:0});var f=this.$cursorLayer.getPixelPosition(y),p=this.$size.scrollerHeight-this.lineHeight,l=f.top-p*(b||0);return this.session.setScrollTop(l),l},C.prototype.$calcSteps=function(y,b){var f=0,p=this.STEPS,l=[],g=function(A,T,E){return E*(Math.pow(A-1,3)+1)+T};for(f=0;f<p;++f)l.push(g(f/this.STEPS,y,b-y));return l},C.prototype.scrollToLine=function(y,b,f,p){var l=this.$cursorLayer.getPixelPosition({row:y,column:0}),g=l.top;b&&(g-=this.$size.scrollerHeight/2);var A=this.scrollTop;this.session.setScrollTop(g),f!==!1&&this.animateScrolling(A,p);},C.prototype.animateScrolling=function(y,b){var f=this.scrollTop;if(!this.$animatedScroll)return;var p=this;if(y==f)return;if(this.$scrollAnimation){var l=this.$scrollAnimation.steps;if(l.length&&(y=l[0],y==f))return}var g=p.$calcSteps(y,f);this.$scrollAnimation={from:y,to:f,steps:g},clearInterval(this.$timer),p.session.setScrollTop(g.shift()),p.session.$scrollTop=f;function A(){p.$timer=clearInterval(p.$timer),p.$scrollAnimation=null,p.$stopAnimation=!1,b&&b();}this.$timer=setInterval(function(){if(p.$stopAnimation){A();return}if(!p.session)return clearInterval(p.$timer);g.length?(p.session.setScrollTop(g.shift()),p.session.$scrollTop=f):f!=null?(p.session.$scrollTop=-1,p.session.setScrollTop(f),f=null):A();},10);},C.prototype.scrollToY=function(y){this.scrollTop!==y&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=y);},C.prototype.scrollToX=function(y){this.scrollLeft!==y&&(this.scrollLeft=y),this.$loop.schedule(this.CHANGE_H_SCROLL);},C.prototype.scrollTo=function(y,b){this.session.setScrollTop(b),this.session.setScrollLeft(y);},C.prototype.scrollBy=function(y,b){b&&this.session.setScrollTop(this.session.getScrollTop()+b),y&&this.session.setScrollLeft(this.session.getScrollLeft()+y);},C.prototype.isScrollableBy=function(y,b){if(b<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||b>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||y<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||y>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return !0},C.prototype.pixelToScreenCoordinates=function(y,b){var f;if(this.$hasCssTransforms){f={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([y,b]);y=p[1]-this.gutterWidth-this.margin.left,b=p[0];}else f=this.scroller.getBoundingClientRect();var l=y+this.scrollLeft-f.left-this.$padding,g=l/this.characterWidth,A=Math.floor((b+this.scrollTop-f.top)/this.lineHeight),T=this.$blockCursor?Math.floor(g):Math.round(g);return {row:A,column:T,side:g-T>0?1:-1,offsetX:l}},C.prototype.screenToTextCoordinates=function(y,b){var f;if(this.$hasCssTransforms){f={top:0,left:0};var p=this.$fontMetrics.transformCoordinates([y,b]);y=p[1]-this.gutterWidth-this.margin.left,b=p[0];}else f=this.scroller.getBoundingClientRect();var l=y+this.scrollLeft-f.left-this.$padding,g=l/this.characterWidth,A=this.$blockCursor?Math.floor(g):Math.round(g),T=Math.floor((b+this.scrollTop-f.top)/this.lineHeight);return this.session.screenToDocumentPosition(T,Math.max(A,0),l)},C.prototype.textToScreenCoordinates=function(y,b){var f=this.scroller.getBoundingClientRect(),p=this.session.documentToScreenPosition(y,b),l=this.$padding+(this.session.$bidiHandler.isBidiRow(p.row,y)?this.session.$bidiHandler.getPosLeft(p.column):Math.round(p.column*this.characterWidth)),g=p.row*this.lineHeight;return {pageX:f.left+l-this.scrollLeft,pageY:f.top+g-this.scrollTop}},C.prototype.visualizeFocus=function(){L.addCssClass(this.container,"ace_focus");},C.prototype.visualizeBlur=function(){L.removeCssClass(this.container,"ace_focus");},C.prototype.showComposition=function(y){this.$composition=y,y.cssText||(y.cssText=this.textarea.style.cssText),y.useTextareaForIME==null&&(y.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(L.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):y.markerId=this.session.addMarker(y.markerRange,"ace_composition_marker","text");},C.prototype.setCompositionText=function(y){var b=this.session.selection.cursor;this.addToken(y,"composition_placeholder",b.row,b.column),this.$moveTextAreaToCursor();},C.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),L.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var y=this.session.selection.cursor;this.removeExtraToken(y.row,y.column),this.$composition=null,this.$cursorLayer.element.style.display="";}},C.prototype.setGhostText=function(y,b){var f=this.session.selection.cursor,p=b||{row:f.row,column:f.column};this.removeGhostText();var l=this.$calculateWrappedTextChunks(y,p);this.addToken(l[0].text,"ghost_text",p.row,p.column),this.$ghostText={text:y,position:{row:p.row,column:p.column}};var g=L.createElement("div");if(l.length>1){var A=this.hideTokensAfterPosition(p.row,p.column),T;l.slice(1).forEach(function(F){var D=L.createElement("div"),W=L.createElement("span");W.className="ace_ghost_text",F.wrapped&&(D.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),W.appendChild(L.createTextNode(F.text)),D.appendChild(W),g.appendChild(D),T=D;}),A.forEach(function(F){var D=L.createElement("span");h(F.type)||(D.className="ace_"+F.type.replace(/\./g," ace_")),D.appendChild(L.createTextNode(F.value)),T.appendChild(D);}),this.$ghostTextWidget={el:g,row:p.row,column:p.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var E=this.$cursorLayer.getPixelPosition(p,!0),_=this.container,O=_.getBoundingClientRect().height,I=l.length*this.lineHeight,N=I<O-E.top;if(N)return;I<O?this.scrollBy(0,(l.length-1)*this.lineHeight):this.scrollToRow(p.row);}},C.prototype.$calculateWrappedTextChunks=function(y,b){var f=this.$size.scrollerWidth-this.$padding*2,p=Math.floor(f/this.characterWidth)-2;p=p<=0?60:p;for(var l=y.split(/\r?\n/),g=[],A=0;A<l.length;A++){var T=this.session.$getDisplayTokens(l[A],b.column),E=this.session.$computeWrapSplits(T,p,this.session.$tabSize);if(E.length>0){var _=0;E.push(l[A].length);for(var O=0;O<E.length;O++){var I=l[A].slice(_,E[O]);g.push({text:I,wrapped:!0}),_=E[O];}}else g.push({text:l[A],wrapped:!1});}return g},C.prototype.removeGhostText=function(){if(this.$ghostText){var y=this.$ghostText.position;this.removeExtraToken(y.row,y.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null;}},C.prototype.addToken=function(y,b,f,p){var l=this.session;l.bgTokenizer.lines[f]=null;var g={type:b,value:y},A=l.getTokens(f);if(p==null||!A.length)A.push(g);else for(var T=0,E=0;E<A.length;E++){var _=A[E];if(T+=_.value.length,p<=T){var O=_.value.length-(T-p),I=_.value.slice(0,O),N=_.value.slice(O);A.splice(E,1,{type:_.type,value:I},g,{type:_.type,value:N});break}}this.updateLines(f,f);},C.prototype.hideTokensAfterPosition=function(y,b){for(var f=this.session.getTokens(y),p=0,l=!1,g=[],A=0;A<f.length;A++){var T=f[A];if(p+=T.value.length,T.type!=="ghost_text"){if(l){g.push({type:T.type,value:T.value}),T.type="hidden_token";continue}p===b&&(l=!0);}}return this.updateLines(y,y),g},C.prototype.removeExtraToken=function(y,b){this.session.bgTokenizer.lines[y]=null,this.updateLines(y,y);},C.prototype.setTheme=function(y,b){var f=this;if(this.$themeId=y,f._dispatchEvent("themeChange",{theme:y}),!y||typeof y=="string"){var p=y||this.$options.theme.initialValue;s.loadModule(["theme",p],l);}else l(y);function l(g){if(f.$themeId!=y)return b&&b();if(!g||!g.cssClass)throw new Error("couldn't load module "+y+" or it didn't call define");g.$id&&(f.$themeId=g.$id),L.importCssString(g.cssText,g.cssClass,f.container),f.theme&&L.removeCssClass(f.container,f.theme.cssClass);var A="padding"in g?g.padding:"padding"in(f.theme||{})?4:f.$padding;f.$padding&&A!=f.$padding&&f.setPadding(A),f.$theme=g.cssClass,f.theme=g,L.addCssClass(f.container,g.cssClass),L.setCssClass(f.container,"ace_dark",g.isDark),f.$size&&(f.$size.width=0,f.$updateSizeAsync()),f._dispatchEvent("themeLoaded",{theme:g}),b&&b(),d.isSafari&&f.scroller&&(f.scroller.style.background="red",f.scroller.style.background="");}},C.prototype.getTheme=function(){return this.$themeId},C.prototype.setStyle=function(y,b){L.setCssClass(this.container,y,b!==!1);},C.prototype.unsetStyle=function(y){L.removeCssClass(this.container,y);},C.prototype.setCursorStyle=function(y){L.setStyle(this.scroller.style,"cursor",y);},C.prototype.setMouseCursor=function(y){L.setStyle(this.scroller.style,"cursor",y);},C.prototype.attachToShadowRoot=function(){L.importCssString(m,"ace_editor.css",this.container);},C.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1);},C.prototype.$updateCustomScrollbar=function(y){var b=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,y===!0?(this.scrollBarV=new a(this.container,this),this.scrollBarH=new o(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollTop(f.data-b.scrollMargin.top);}),this.scrollBarH.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollLeft(f.data-b.scrollMargin.left);}),this.$scrollDecorator=new $(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollTop(f.data-b.scrollMargin.top);}),this.scrollBarH.addEventListener("scroll",function(f){b.$scrollAnimation||b.session.setScrollLeft(f.data-b.scrollMargin.left);}));},C.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var y=this;this.$resizeTimer=x.delayedCall(function(){y.destroyed||y.onResize();},50),this.$resizeObserver=new window.ResizeObserver(function(b){var f=b[0].contentRect.width,p=b[0].contentRect.height;Math.abs(y.$size.width-f)>1||Math.abs(y.$size.height-p)>1?y.$resizeTimer.delay():y.$resizeTimer.cancel();}),this.$resizeObserver.observe(this.container);}},C}();v.prototype.CHANGE_CURSOR=1,v.prototype.CHANGE_MARKER=2,v.prototype.CHANGE_GUTTER=4,v.prototype.CHANGE_SCROLL=8,v.prototype.CHANGE_LINES=16,v.prototype.CHANGE_TEXT=32,v.prototype.CHANGE_SIZE=64,v.prototype.CHANGE_MARKER_BACK=128,v.prototype.CHANGE_MARKER_FRONT=256,v.prototype.CHANGE_FULL=512,v.prototype.CHANGE_H_SCROLL=1024,v.prototype.$changes=0,v.prototype.$padding=null,v.prototype.$frozen=!1,v.prototype.STEPS=8,R.implement(v.prototype,S),s.defineOptions(v.prototype,"renderer",{useResizeObserver:{set:function(C){!C&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):C&&!this.$resizeObserver&&this.$addResizeObserver();}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(C){this.$textLayer.setShowInvisibles(C)&&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(C){typeof C=="number"&&(this.$printMarginColumn=C),this.$showPrintMargin=!!C,this.$updatePrintMargin();},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(C){this.$gutter.style.display=C?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize();},initialValue:!0},useSvgGutterIcons:{set:function(C){this.$gutterLayer.$useSvgGutterIcons=C;},initialValue:!1},showFoldedAnnotations:{set:function(C){this.$gutterLayer.$showFoldedAnnotations=C;},initialValue:!1},fadeFoldWidgets:{set:function(C){L.setCssClass(this.$gutter,"ace_fade-fold-widgets",C);},initialValue:!1},showFoldWidgets:{set:function(C){this.$gutterLayer.setShowFoldWidgets(C),this.$loop.schedule(this.CHANGE_GUTTER);},initialValue:!0},displayIndentGuides:{set:function(C){this.$textLayer.setDisplayIndentGuides(C)&&this.$loop.schedule(this.CHANGE_TEXT);},initialValue:!0},highlightIndentGuides:{set:function(C){this.$textLayer.setHighlightIndentGuides(C)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);},initialValue:!0},highlightGutterLine:{set:function(C){this.$gutterLayer.setHighlightGutterLine(C),this.$loop.schedule(this.CHANGE_GUTTER);},initialValue:!0},hScrollBarAlwaysVisible:{set:function(C){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL);},initialValue:!1},vScrollBarAlwaysVisible:{set:function(C){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL);},initialValue:!1},fontSize:{set:function(C){typeof C=="number"&&(C=C+"px"),this.container.style.fontSize=C,this.updateFontSize();},initialValue:12},fontFamily:{set:function(C){this.container.style.fontFamily=C,this.updateFontSize();}},maxLines:{set:function(C){this.updateFull();}},minLines:{set:function(C){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull();}},maxPixelHeight:{set:function(C){this.updateFull();},initialValue:0},scrollPastEnd:{set:function(C){C=+C||0,this.$scrollPastEnd!=C&&(this.$scrollPastEnd=C,this.$loop.schedule(this.CHANGE_SCROLL));},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(C){this.$gutterLayer.$fixedWidth=!!C,this.$loop.schedule(this.CHANGE_GUTTER);}},customScrollbar:{set:function(C){this.$updateCustomScrollbar(C);},initialValue:!1},theme:{set:function(C){this.setTheme(C);},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!d.isMobile&&!d.isIE}}),M.VirtualRenderer=v;});ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(k,M,H){var R=k("../lib/oop"),L=k("../lib/net"),x=k("../lib/event_emitter").EventEmitter,s=k("../config");function c(n){var e="importScripts('"+L.qualifyURL(n)+"');";try{return new Blob([e],{type:"application/javascript"})}catch{var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,a=new o;return a.append(e),a.getBlob("application/javascript")}}function r(n){if(typeof Worker>"u")return {postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var e=c(n),o=window.URL||window.webkitURL,a=o.createObjectURL(e);return new Worker(a)}return new Worker(n)}var t=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(){R.implement(this,x),this.$createWorkerFromOldConfig=function(n,e,o,a,u){if(k.nameToUrl&&!k.toUrl&&(k.toUrl=k.nameToUrl),s.get("packaged")||!k.toUrl)a=a||s.moduleUrl(e,"worker");else {var w=this.$normalizePath;a=a||w(k.toUrl("ace/worker/worker.js",null,"_"));var S={};n.forEach(function(m){S[m]=w(k.toUrl(m,null,"_").replace(/(\.js)?(\?.*)?$/,""));});}return this.$worker=r(a),u&&this.send("importScripts",u),this.$worker.postMessage({init:!0,tlns:S,module:e,classname:o}),this.$worker},this.onMessage=function(n){var e=n.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var o=this.callbacks[e.id];o&&(o(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console&&console.log&&console.log.apply(console,e.data);break}},this.reportError=function(n){window.console&&console.error&&console.error(n);},this.$normalizePath=function(n){return L.qualifyURL(n)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(n){n.preventDefault();},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null;},this.send=function(n,e){this.$worker.postMessage({command:n,args:e});},this.call=function(n,e,o){if(o){var a=this.callbackId++;this.callbacks[a]=o,e.push(a);}this.send(n,e);},this.emit=function(n,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:n,data:{data:e.data}});}catch(o){console.error(o.stack);}},this.attachToDocument=function(n){this.$doc&&this.terminate(),this.$doc=n,this.call("setValue",[n.getValue()]),n.on("change",this.changeListener,!0);},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(t.prototype);var i=function(n,e,o){var a=null,u=!1,w=Object.create(x),S=[],m=new t({messageBuffer:S,terminate:function(){},postMessage:function(d){S.push(d),a&&(u?setTimeout($):$());}});m.setEmitSync=function(d){u=d;};var $=function(){var d=S.shift();d.command?a[d.command].apply(a,d.args):d.event&&w._signal(d.event,d.data);};return w.postMessage=function(d){m.onMessage({data:d});},w.callback=function(d,h){this.postMessage({type:"call",id:h,data:d});},w.emit=function(d,h){this.postMessage({type:"event",name:d,data:h});},s.loadModule(["worker",e],function(d){for(a=new d[o](w);S.length;)$();}),m};M.UIWorkerClient=i,M.WorkerClient=t,M.createWorker=r;});ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(k,M,H){var R=k("./range").Range,L=k("./lib/event_emitter").EventEmitter,x=k("./lib/oop"),s=function(){function c(r,t,i,n,e,o){var a=this;this.length=t,this.session=r,this.doc=r.getDocument(),this.mainClass=e,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){a.onCursorChange();});},this.$pos=i;var u=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange);}return c.prototype.setup=function(){var r=this,t=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var n=this.pos;n.$insertRight=!0,n.detach(),n.markerId=i.addMarker(new R(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var o=t.createAnchor(e.row,e.column);o.$insertRight=!0,o.detach(),r.others.push(o);}),i.setUndoSelect(!1);},c.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,t=this;this.othersActive=!0,this.others.forEach(function(i){i.markerId=r.addMarker(new R(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1);});}},c.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId);}},c.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var t=r;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i=r.action==="insert"?t.end.column-t.start.column:t.start.column-t.end.column,n=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,e=t.start.column-this.pos.column;if(this.updateAnchors(r),n&&(this.length+=i),n&&!this.session.$fromUndo){if(r.action==="insert")for(var o=this.others.length-1;o>=0;o--){var a=this.others[o],u={row:a.row,column:a.column+e};this.doc.insertMergedLines(u,r.lines);}else if(r.action==="remove")for(var o=this.others.length-1;o>=0;o--){var a=this.others[o],u={row:a.row,column:a.column+e};this.doc.remove(new R(u.row,u.column,u.row,u.column-i));}}this.$updating=!1,this.updateMarkers();}},c.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var t=this.others.length;t--;)this.others[t].onChange(r);this.updateMarkers();},c.prototype.updateMarkers=function(){if(!this.$updating){var r=this,t=this.session,i=function(e,o){t.removeMarker(e.markerId),e.markerId=t.addMarker(new R(e.row,e.column,e.row,e.column+r.length),o,null,!1);};i(this.pos,this.mainClass);for(var n=this.others.length;n--;)i(this.others[n],this.othersClass);}},c.prototype.onCursorChange=function(r){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",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r));}},c.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null;},c.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),t=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore);}},c}();x.implement(s.prototype,L),M.PlaceHolder=s;});ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(k,M,H){var R=k("../lib/event"),L=k("../lib/useragent");function x(c,r){return c.row==r.row&&c.column==r.column}function s(c){var r=c.domEvent,t=r.altKey,i=r.shiftKey,n=r.ctrlKey,e=c.getAccelKey(),o=c.getButton();if(n&&L.isMac&&(o=r.button),c.editor.inMultiSelectMode&&o==2){c.editor.textInput.onContextMenu(c.domEvent);return}if(!n&&!t&&!e){o===0&&c.editor.inMultiSelectMode&&c.editor.exitMultiSelectMode();return}if(o===0){var a=c.editor,u=a.selection,w=a.inMultiSelectMode,S=c.getDocumentPosition(),m=u.getCursor(),$=c.inSelection()||u.isEmpty()&&x(S,m),d=c.x,h=c.y,v=function(I){d=I.clientX,h=I.clientY;},C=a.session,y=a.renderer.pixelToScreenCoordinates(d,h),b=y,f;if(a.$mouseHandler.$enableJumpToDef)n&&t||e&&t?f=i?"block":"add":t&&a.$blockSelectEnabled&&(f="block");else if(e&&!t){if(f="add",!w&&i)return}else t&&a.$blockSelectEnabled&&(f="block");if(f&&L.isMac&&r.ctrlKey&&a.$mouseHandler.cancelContextMenu(),f=="add"){if(!w&&$)return;if(!w){var p=u.toOrientedRange();a.addSelectionMarker(p);}var l=u.rangeList.rangeAtPoint(S);a.inVirtualSelectionMode=!0,i&&(l=null,p=u.ranges[0]||p,a.removeSelectionMarker(p)),a.once("mouseup",function(){var I=u.toOrientedRange();l&&I.isEmpty()&&x(l.cursor,I.cursor)?u.substractPoint(I.cursor):(i?u.substractPoint(p.cursor):p&&(a.removeSelectionMarker(p),u.addRange(p)),u.addRange(I)),a.inVirtualSelectionMode=!1;});}else if(f=="block"){c.stop(),a.inVirtualSelectionMode=!0;var g,A=[],T=function(){var I=a.renderer.pixelToScreenCoordinates(d,h),N=C.screenToDocumentPosition(I.row,I.column,I.offsetX);x(b,I)&&x(N,u.lead)||(b=I,a.selection.moveToPosition(N),a.renderer.scrollCursorIntoView(),a.removeSelectionMarkers(A),A=u.rectangularRangeBlock(b,y),a.$mouseHandler.$clickSelection&&A.length==1&&A[0].isEmpty()&&(A[0]=a.$mouseHandler.$clickSelection.clone()),A.forEach(a.addSelectionMarker,a),a.updateSelectionMarkers());};w&&!e?u.toSingleRange():!w&&e&&(g=u.toOrientedRange(),a.addSelectionMarker(g)),i?y=C.documentToScreenPosition(u.lead):u.moveToPosition(S),b={row:-1,column:-1};var E=function(I){T(),clearInterval(O),a.removeSelectionMarkers(A),A.length||(A=[u.toOrientedRange()]),g&&(a.removeSelectionMarker(g),u.toSingleRange(g));for(var N=0;N<A.length;N++)u.addRange(A[N]);a.inVirtualSelectionMode=!1,a.$mouseHandler.$clickSelection=null;},_=T;R.capture(a.container,v,E);var O=setInterval(function(){_();},20);return c.preventDefault()}}}M.onMouseDown=s;});ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(k,M,H){M.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(L){L.selectMoreLines(-1);},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(L){L.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(L){L.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(L){L.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(L){L.selectMore(-1);},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(L){L.selectMore(1);},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(L){L.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(L){L.selectMore(1,!0);},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(L){L.multiSelect.rangeCount>1?L.multiSelect.joinSelections():L.multiSelect.splitIntoLines();},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(L){L.multiSelect.splitIntoLines();},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(L){L.alignCursors();},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(L){L.findAll();},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],M.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(L){L.exitMultiSelectMode();},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(L){return L&&L.inMultiSelectMode}}];var R=k("../keyboard/hash_handler").HashHandler;M.keyboardHandler=new R(M.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(k,M,H){var R=k("./range_list").RangeList,L=k("./range").Range,x=k("./selection").Selection,s=k("./mouse/multi_select_handler").onMouseDown,c=k("./lib/event"),r=k("./lib/lang"),t=k("./commands/multi_select_commands");M.commands=t.defaultCommands.concat(t.multiSelectCommands);var i=k("./search").Search,n=new i;function e(m,$,d){return n.$options.wrap=!0,n.$options.needle=$,n.$options.backwards=d==-1,n.find(m)}var o=k("./edit_session").EditSession;((function(){this.getSelectionMarkers=function(){return this.$selectionMarkers};})).call(o.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(m,$){if(m){if(!this.inMultiSelectMode&&this.rangeCount===0){var d=this.toOrientedRange();if(this.rangeList.add(d),this.rangeList.add(m),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),$||this.fromOrientedRange(m);this.rangeList.removeAll(),this.rangeList.add(d),this.$onAddRange(d);}m.cursor||(m.cursor=m.end);var h=this.rangeList.add(m);return this.$onAddRange(m),h.length&&this.$onRemoveRange(h),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),$||this.fromOrientedRange(m)}},this.toSingleRange=function(m){m=m||this.ranges[0];var $=this.rangeList.removeAll();$.length&&this.$onRemoveRange($),m&&this.fromOrientedRange(m);},this.substractPoint=function(m){var $=this.rangeList.substractPoint(m);if($)return this.$onRemoveRange($),$[0]},this.mergeOverlappingRanges=function(){var m=this.rangeList.merge();m.length&&this.$onRemoveRange(m);},this.$onAddRange=function(m){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(m),this._signal("addRange",{range:m});},this.$onRemoveRange=function(m){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var $=this.rangeList.ranges.pop();m.push($),this.rangeCount=0;}for(var d=m.length;d--;){var h=this.ranges.indexOf(m[d]);this.ranges.splice(h,1);}this._signal("removeRange",{ranges:m}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),$=$||this.ranges[0],$&&!$.isEqual(this.getRange())&&this.fromOrientedRange($);},this.$initRangeList=function(){this.rangeList||(this.rangeList=new R,this.ranges=[],this.rangeCount=0);},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var m=this.ranges.length?this.ranges:[this.getRange()],$=[],d=0;d<m.length;d++){var h=m[d],v=h.start.row,C=h.end.row;if(v===C)$.push(h.clone());else {for($.push(new L(v,h.start.column,v,this.session.getLine(v).length));++v<C;)$.push(this.getLineRange(v,!0));$.push(new L(C,0,C,h.end.column));}d==0&&!this.isBackwards()&&($=$.reverse());}this.toSingleRange();for(var d=$.length;d--;)this.addRange($[d]);},this.joinSelections=function(){var m=this.rangeList.ranges,$=m[m.length-1],d=L.fromPoints(m[0].start,$.end);this.toSingleRange(),this.setSelectionRange(d,$.cursor==$.start);},this.toggleBlockSelection=function(){if(this.rangeCount>1){var m=this.rangeList.ranges,$=m[m.length-1],d=L.fromPoints(m[0].start,$.end);this.toSingleRange(),this.setSelectionRange(d,$.cursor==$.start);}else {var h=this.session.documentToScreenPosition(this.cursor),v=this.session.documentToScreenPosition(this.anchor),C=this.rectangularRangeBlock(h,v);C.forEach(this.addRange,this);}},this.rectangularRangeBlock=function(m,$,d){var h=[],v=m.column<$.column;if(v)var C=m.column,y=$.column,b=m.offsetX,f=$.offsetX;else var C=$.column,y=m.column,b=$.offsetX,f=m.offsetX;var p=m.row<$.row;if(p)var l=m.row,g=$.row;else var l=$.row,g=m.row;C<0&&(C=0),l<0&&(l=0),l==g&&(d=!0);for(var A,T=l;T<=g;T++){var E=L.fromPoints(this.session.screenToDocumentPosition(T,C,b),this.session.screenToDocumentPosition(T,y,f));if(E.isEmpty()){if(A&&u(E.end,A))break;A=E.end;}E.cursor=v?E.start:E.end,h.push(E);}if(p&&h.reverse(),!d){for(var _=h.length-1;h[_].isEmpty()&&_>0;)_--;if(_>0)for(var O=0;h[O].isEmpty();)O++;for(var I=_;I>=O;I--)h[I].isEmpty()&&h.splice(I,1);}return h};}.call(x.prototype);var a=k("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.addSelectionMarker=function(m){m.cursor||(m.cursor=m.end);var $=this.getSelectionStyle();return m.marker=this.session.addMarker(m,"ace_selection",$),this.session.$selectionMarkers.push(m),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,m},this.removeSelectionMarker=function(m){if(m.marker){this.session.removeMarker(m.marker);var $=this.session.$selectionMarkers.indexOf(m);$!=-1&&this.session.$selectionMarkers.splice($,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length;}},this.removeSelectionMarkers=function(m){for(var $=this.session.$selectionMarkers,d=m.length;d--;){var h=m[d];if(h.marker){this.session.removeMarker(h.marker);var v=$.indexOf(h);v!=-1&&$.splice(v,1);}}this.session.selectionMarkerCount=$.length;},this.$onAddRange=function(m){this.addSelectionMarker(m.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.$onRemoveRange=function(m){this.removeSelectionMarkers(m.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers();},this.$onMultiSelect=function(m){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(t.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers());},this.$onSingleSelect=function(m){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(t.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"));},this.$onMultiSelectExec=function(m){var $=m.command,d=m.editor;if(d.multiSelect){if($.multiSelectAction)$.multiSelectAction=="forEach"?h=d.forEachSelection($,m.args):$.multiSelectAction=="forEachLine"?h=d.forEachSelection($,m.args,!0):$.multiSelectAction=="single"?(d.exitMultiSelectMode(),h=$.exec(d,m.args||{})):h=$.multiSelectAction(d,m.args||{});else {var h=$.exec(d,m.args||{});d.multiSelect.addRange(d.multiSelect.toOrientedRange()),d.multiSelect.mergeOverlappingRanges();}return h}},this.forEachSelection=function(m,$,d){if(!this.inVirtualSelectionMode){var h=d&&d.keepOrder,v=d==!0||d&&d.$byLines,C=this.session,y=this.selection,b=y.rangeList,f=(h?y:b).ranges,p;if(!f.length)return m.exec?m.exec(this,$||{}):m(this,$||{});var l=y._eventRegistry;y._eventRegistry={};var g=new x(C);this.inVirtualSelectionMode=!0;for(var A=f.length;A--;){if(v)for(;A>0&&f[A].start.row==f[A-1].end.row;)A--;g.fromOrientedRange(f[A]),g.index=A,this.selection=C.selection=g;var T=m.exec?m.exec(this,$||{}):m(this,$||{});!p&&T!==void 0&&(p=T),g.toOrientedRange(f[A]);}g.detach(),this.selection=C.selection=y,this.inVirtualSelectionMode=!1,y._eventRegistry=l,y.mergeOverlappingRanges(),y.ranges[0]&&y.fromOrientedRange(y.ranges[0]);var E=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),E&&E.from==E.to&&this.renderer.animateScrolling(E.from),p}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange();},this.getSelectedText=function(){var m="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var $=this.multiSelect.rangeList.ranges,d=[],h=0;h<$.length;h++)d.push(this.session.getTextRange($[h]));var v=this.session.getDocument().getNewLineCharacter();m=d.join(v),m.length==(d.length-1)*v.length&&(m="");}else this.selection.isEmpty()||(m=this.session.getTextRange(this.getSelectionRange()));return m},this.$checkMultiselectChange=function(m,$){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var d=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&$==this.multiSelect.anchor)return;var h=$==this.multiSelect.anchor?d.cursor==d.start?d.end:d.start:d.cursor;h.row!=$.row||this.session.$clipPositionToDocument(h.row,h.column).column!=$.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges();}},this.findAll=function(m,$,d){if($=$||{},$.needle=m||$.needle,$.needle==null){var h=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();$.needle=this.session.getTextRange(h);}this.$search.set($);var v=this.$search.findAll(this.session);if(!v.length)return 0;var C=this.multiSelect;d||C.toSingleRange(v[0]);for(var y=v.length;y--;)C.addRange(v[y],!0);return h&&C.rangeList.rangeAtPoint(h.start)&&C.addRange(h,!0),v.length},this.selectMoreLines=function(m,$){var d=this.selection.toOrientedRange(),h=d.cursor==d.end,v=this.session.documentToScreenPosition(d.cursor);this.selection.$desiredColumn&&(v.column=this.selection.$desiredColumn);var C=this.session.screenToDocumentPosition(v.row+m,v.column);if(d.isEmpty())var b=C;else var y=this.session.documentToScreenPosition(h?d.end:d.start),b=this.session.screenToDocumentPosition(y.row+m,y.column);if(h){var f=L.fromPoints(C,b);f.cursor=f.start;}else {var f=L.fromPoints(b,C);f.cursor=f.end;}if(f.desiredColumn=v.column,!this.selection.inMultiSelectMode)this.selection.addRange(d);else if($)var p=d.cursor;this.selection.addRange(f),p&&this.selection.substractPoint(p);},this.transposeSelections=function(m){for(var $=this.session,d=$.multiSelect,h=d.ranges,v=h.length;v--;){var C=h[v];if(C.isEmpty()){var y=$.getWordRange(C.start.row,C.start.column);C.start.row=y.start.row,C.start.column=y.start.column,C.end.row=y.end.row,C.end.column=y.end.column;}}d.mergeOverlappingRanges();for(var b=[],v=h.length;v--;){var C=h[v];b.unshift($.getTextRange(C));}m<0?b.unshift(b.pop()):b.push(b.shift());for(var v=h.length;v--;){var C=h[v],f=C.clone();$.replace(C,b[v]),C.start.row=f.start.row,C.start.column=f.start.column;}d.fromOrientedRange(d.ranges[0]);},this.selectMore=function(m,$,d){var h=this.session,v=h.multiSelect,C=v.toOrientedRange();if(!(C.isEmpty()&&(C=h.getWordRange(C.start.row,C.start.column),C.cursor=m==-1?C.start:C.end,this.multiSelect.addRange(C),d))){var y=h.getTextRange(C),b=e(h,y,m);b&&(b.cursor=m==-1?b.start:b.end,this.session.unfold(b),this.multiSelect.addRange(b),this.renderer.scrollCursorIntoView(null,.5)),$&&this.multiSelect.substractPoint(C.cursor);}},this.alignCursors=function(){var m=this.session,$=m.multiSelect,d=$.ranges,h=-1,v=d.filter(function(_){if(_.cursor.row==h)return !0;h=_.cursor.row;});if(!d.length||v.length==d.length-1){var C=this.selection.getRange(),y=C.start.row,b=C.end.row,f=y==b;if(f){var p=this.session.getLength(),l;do l=this.session.getLine(b);while(/[=:]/.test(l)&&++b<p);do l=this.session.getLine(y);while(/[=:]/.test(l)&&--y>0);y<0&&(y=0),b>=p&&(b=p-1);}var g=this.session.removeFullLines(y,b);g=this.$reAlignText(g,f),this.session.insert({row:y,column:0},g.join(`
941
942
  `)+`
942
- `),f||(C.start.column=0,C.end.column=g[g.length-1].length),this.selection.setRange(C);}else {v.forEach(function(_){$.substractPoint(_.cursor);});var A=0,T=1/0,E=d.map(function(_){var O=_.cursor,I=m.getLine(O.row),N=I.substr(O.column).search(/\S/g);return N==-1&&(N=0),O.column>A&&(A=O.column),N<T&&(T=N),N});d.forEach(function(_,O){var I=_.cursor,N=A-I.column,F=E[O]-T;N>F?m.insert(I,r.stringRepeat(" ",N-F)):m.remove(new L(I.row,I.column,I.row,I.column-N+F)),_.start.column=_.end.column=A,_.start.row=_.end.row=I.row,_.cursor=_.end;}),$.fromOrientedRange(d[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers();}},this.$reAlignText=function(m,$){var d=!0,h=!0,v,C,y;return m.map(function(g){var A=g.match(/(\s*)(.*?)(\s*)([=:].*)/);return A?v==null?(v=A[1].length,C=A[2].length,y=A[3].length,A):(v+C+y!=A[1].length+A[2].length+A[3].length&&(h=!1),v!=A[1].length&&(d=!1),v>A[1].length&&(v=A[1].length),C<A[2].length&&(C=A[2].length),y>A[3].length&&(y=A[3].length),A):[g]}).map($?f:d?h?p:f:c);function b(g){return r.stringRepeat(" ",g)}function f(g){return g[2]?b(v)+g[2]+b(C-g[2].length+y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}function p(g){return g[2]?b(v+C-g[2].length)+g[2]+b(y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}function c(g){return g[2]?b(v)+g[2]+b(y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}};}).call(a.prototype);function u(m,$){return m.row==$.row&&m.column==$.column}M.onSessionChange=function(m){var $=m.session;$&&!$.multiSelect&&($.$selectionMarkers=[],$.selection.$initRangeList(),$.multiSelect=$.selection),this.multiSelect=$&&$.multiSelect;var d=m.oldSession;d&&(d.multiSelect.off("addRange",this.$onAddRange),d.multiSelect.off("removeRange",this.$onRemoveRange),d.multiSelect.off("multiSelect",this.$onMultiSelect),d.multiSelect.off("singleSelect",this.$onSingleSelect),d.multiSelect.lead.off("change",this.$checkMultiselectChange),d.multiSelect.anchor.off("change",this.$checkMultiselectChange)),$&&($.multiSelect.on("addRange",this.$onAddRange),$.multiSelect.on("removeRange",this.$onRemoveRange),$.multiSelect.on("multiSelect",this.$onMultiSelect),$.multiSelect.on("singleSelect",this.$onSingleSelect),$.multiSelect.lead.on("change",this.$checkMultiselectChange),$.multiSelect.anchor.on("change",this.$checkMultiselectChange)),$&&this.inMultiSelectMode!=$.selection.inMultiSelectMode&&($.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect());};function w(m){m.$multiselectOnSessionChange||(m.$onAddRange=m.$onAddRange.bind(m),m.$onRemoveRange=m.$onRemoveRange.bind(m),m.$onMultiSelect=m.$onMultiSelect.bind(m),m.$onSingleSelect=m.$onSingleSelect.bind(m),m.$multiselectOnSessionChange=M.onSessionChange.bind(m),m.$checkMultiselectChange=m.$checkMultiselectChange.bind(m),m.$multiselectOnSessionChange(m),m.on("changeSession",m.$multiselectOnSessionChange),m.on("mousedown",s),m.commands.addCommands(e.defaultCommands),S(m));}function S(m){if(!m.textInput)return;var $=m.textInput.getElement(),d=!1;l.addListener($,"keydown",function(v){var C=v.keyCode==18&&!(v.ctrlKey||v.shiftKey||v.metaKey);m.$blockSelectEnabled&&C?d||(m.renderer.setMouseCursor("crosshair"),d=!0):d&&h();},m),l.addListener($,"keyup",h,m),l.addListener($,"blur",h,m);function h(v){d&&(m.renderer.setMouseCursor(""),d=!1);}}M.MultiSelect=w,k("./config").defineOptions(a.prototype,"editor",{enableMultiselect:{set:function(m){w(this),m?this.on("mousedown",s):this.off("mousedown",s);},value:!0},enableBlockSelect:{set:function(m){this.$blockSelectEnabled=m;},value:!0}});});ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(k,M,H){var R=k("../../range").Range,L=M.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(x,s,l){var r=x.getLine(l);return this.foldingStartMarker.test(r)?"start":s=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(x,s,l){return null},this.indentationBlock=function(x,s,l){var r=/\S/,e=x.getLine(s),i=e.search(r);if(i!=-1){for(var n=l||e.length,t=x.getLength(),o=s,a=s;++s<t;){var u=x.getLine(s).search(r);if(u!=-1){if(u<=i){var w=x.getTokenAt(s,0);if(!w||w.type!=="string")break}a=s;}}if(a>o){var S=x.getLine(a).length;return new R(o,n,a,S)}}},this.openingBracketBlock=function(x,s,l,r,e){var i={row:l,column:r+1},n=x.$findClosingBracket(s,i,e);if(n){var t=x.foldWidgets[n.row];return t==null&&(t=x.getFoldWidget(n.row)),t=="start"&&n.row>i.row&&(n.row--,n.column=x.getLine(n.row).length),R.fromPoints(i,n)}},this.closingBracketBlock=function(x,s,l,r,e){var i={row:l,column:r},n=x.$findOpeningBracket(s,i);if(n)return n.column++,i.column--,R.fromPoints(n,i)};}).call(L.prototype);});ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(k,M,H){var R=k("../line_widgets").LineWidgets,L=k("../lib/dom"),x=k("../range").Range,s=k("../config").nls;function l(e,i,n){for(var t=0,o=e.length-1;t<=o;){var a=t+o>>1,u=n(i,e[a]);if(u>0)t=a+1;else if(u<0)o=a-1;else return a}return -(t+1)}function r(e,i,n){var t=e.getAnnotations().sort(x.comparePoints);if(t.length){var o=l(t,{row:i,column:-1},x.comparePoints);o<0&&(o=-o-1),o>=t.length?o=n>0?0:t.length-1:o===0&&n<0&&(o=t.length-1);var a=t[o];if(!(!a||!n)){if(a.row===i){do a=t[o+=n];while(a&&a.row===i);if(!a)return t.slice()}var u=[];i=a.row;do u[n<0?"unshift":"push"](a),a=t[o+=n];while(a&&a.row==i);return u.length&&u}}}M.showErrorMarker=function(e,i){var n=e.session;n.widgetManager||(n.widgetManager=new R(n),n.widgetManager.attach(e));var t=e.getCursorPosition(),o=t.row,a=n.widgetManager.getWidgetsAtRow(o).filter(function(C){return C.type=="errorMarker"})[0];a?a.destroy():o-=i;var u=r(n,o,i),w;if(u){var S=u[0];t.column=(S.pos&&typeof S.column!="number"?S.pos.sc:S.column)||0,t.row=S.row,w=e.renderer.$gutterLayer.$annotations[t.row];}else {if(a)return;w={displayText:[s("error-marker.good-state","Looks good!")],className:"ace_ok"};}e.session.unfold(t.row),e.selection.moveToPosition(t);var m={row:t.row,fixedWidth:!0,coverGutter:!0,el:L.createElement("div"),type:"errorMarker"},$=m.el.appendChild(L.createElement("div")),d=m.el.appendChild(L.createElement("div"));d.className="error_widget_arrow "+w.className;var h=e.renderer.$cursorLayer.getPixelPosition(t).left;d.style.left=h+e.renderer.gutterWidth-5+"px",m.el.className="error_widget_wrapper",$.className="error_widget "+w.className,w.displayText.forEach(function(C,y){$.appendChild(L.createTextNode(C)),y<w.displayText.length-1&&$.appendChild(L.createElement("br"));}),$.appendChild(L.createElement("div"));var v=function(C,y,b){if(y===0&&(b==="esc"||b==="return"))return m.destroy(),{command:"null"}};m.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(v),n.widgetManager.removeLineWidget(m),e.off("changeSelection",m.destroy),e.off("changeSession",m.destroy),e.off("mouseup",m.destroy),e.off("change",m.destroy));},e.keyBinding.addKeyboardHandler(v),e.on("changeSelection",m.destroy),e.on("changeSession",m.destroy),e.on("mouseup",m.destroy),e.on("change",m.destroy),e.session.widgetManager.addLineWidget(m),m.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:m.el.offsetHeight});},L.importCssString(`
943
+ `),f||(C.start.column=0,C.end.column=g[g.length-1].length),this.selection.setRange(C);}else {v.forEach(function(_){$.substractPoint(_.cursor);});var A=0,T=1/0,E=d.map(function(_){var O=_.cursor,I=m.getLine(O.row),N=I.substr(O.column).search(/\S/g);return N==-1&&(N=0),O.column>A&&(A=O.column),N<T&&(T=N),N});d.forEach(function(_,O){var I=_.cursor,N=A-I.column,F=E[O]-T;N>F?m.insert(I,r.stringRepeat(" ",N-F)):m.remove(new L(I.row,I.column,I.row,I.column-N+F)),_.start.column=_.end.column=A,_.start.row=_.end.row=I.row,_.cursor=_.end;}),$.fromOrientedRange(d[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers();}},this.$reAlignText=function(m,$){var d=!0,h=!0,v,C,y;return m.map(function(g){var A=g.match(/(\s*)(.*?)(\s*)([=:].*)/);return A?v==null?(v=A[1].length,C=A[2].length,y=A[3].length,A):(v+C+y!=A[1].length+A[2].length+A[3].length&&(h=!1),v!=A[1].length&&(d=!1),v>A[1].length&&(v=A[1].length),C<A[2].length&&(C=A[2].length),y>A[3].length&&(y=A[3].length),A):[g]}).map($?f:d?h?p:f:l);function b(g){return r.stringRepeat(" ",g)}function f(g){return g[2]?b(v)+g[2]+b(C-g[2].length+y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}function p(g){return g[2]?b(v+C-g[2].length)+g[2]+b(y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}function l(g){return g[2]?b(v)+g[2]+b(y)+g[4].replace(/^([=:])\s+/,"$1 "):g[0]}};}).call(a.prototype);function u(m,$){return m.row==$.row&&m.column==$.column}M.onSessionChange=function(m){var $=m.session;$&&!$.multiSelect&&($.$selectionMarkers=[],$.selection.$initRangeList(),$.multiSelect=$.selection),this.multiSelect=$&&$.multiSelect;var d=m.oldSession;d&&(d.multiSelect.off("addRange",this.$onAddRange),d.multiSelect.off("removeRange",this.$onRemoveRange),d.multiSelect.off("multiSelect",this.$onMultiSelect),d.multiSelect.off("singleSelect",this.$onSingleSelect),d.multiSelect.lead.off("change",this.$checkMultiselectChange),d.multiSelect.anchor.off("change",this.$checkMultiselectChange)),$&&($.multiSelect.on("addRange",this.$onAddRange),$.multiSelect.on("removeRange",this.$onRemoveRange),$.multiSelect.on("multiSelect",this.$onMultiSelect),$.multiSelect.on("singleSelect",this.$onSingleSelect),$.multiSelect.lead.on("change",this.$checkMultiselectChange),$.multiSelect.anchor.on("change",this.$checkMultiselectChange)),$&&this.inMultiSelectMode!=$.selection.inMultiSelectMode&&($.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect());};function w(m){m.$multiselectOnSessionChange||(m.$onAddRange=m.$onAddRange.bind(m),m.$onRemoveRange=m.$onRemoveRange.bind(m),m.$onMultiSelect=m.$onMultiSelect.bind(m),m.$onSingleSelect=m.$onSingleSelect.bind(m),m.$multiselectOnSessionChange=M.onSessionChange.bind(m),m.$checkMultiselectChange=m.$checkMultiselectChange.bind(m),m.$multiselectOnSessionChange(m),m.on("changeSession",m.$multiselectOnSessionChange),m.on("mousedown",s),m.commands.addCommands(t.defaultCommands),S(m));}function S(m){if(!m.textInput)return;var $=m.textInput.getElement(),d=!1;c.addListener($,"keydown",function(v){var C=v.keyCode==18&&!(v.ctrlKey||v.shiftKey||v.metaKey);m.$blockSelectEnabled&&C?d||(m.renderer.setMouseCursor("crosshair"),d=!0):d&&h();},m),c.addListener($,"keyup",h,m),c.addListener($,"blur",h,m);function h(v){d&&(m.renderer.setMouseCursor(""),d=!1);}}M.MultiSelect=w,k("./config").defineOptions(a.prototype,"editor",{enableMultiselect:{set:function(m){w(this),m?this.on("mousedown",s):this.off("mousedown",s);},value:!0},enableBlockSelect:{set:function(m){this.$blockSelectEnabled=m;},value:!0}});});ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(k,M,H){var R=k("../../range").Range,L=M.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(x,s,c){var r=x.getLine(c);return this.foldingStartMarker.test(r)?"start":s=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(x,s,c){return null},this.indentationBlock=function(x,s,c){var r=/\S/,t=x.getLine(s),i=t.search(r);if(i!=-1){for(var n=c||t.length,e=x.getLength(),o=s,a=s;++s<e;){var u=x.getLine(s).search(r);if(u!=-1){if(u<=i){var w=x.getTokenAt(s,0);if(!w||w.type!=="string")break}a=s;}}if(a>o){var S=x.getLine(a).length;return new R(o,n,a,S)}}},this.openingBracketBlock=function(x,s,c,r,t){var i={row:c,column:r+1},n=x.$findClosingBracket(s,i,t);if(n){var e=x.foldWidgets[n.row];return e==null&&(e=x.getFoldWidget(n.row)),e=="start"&&n.row>i.row&&(n.row--,n.column=x.getLine(n.row).length),R.fromPoints(i,n)}},this.closingBracketBlock=function(x,s,c,r,t){var i={row:c,column:r},n=x.$findOpeningBracket(s,i);if(n)return n.column++,i.column--,R.fromPoints(n,i)};}).call(L.prototype);});ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],function(k,M,H){var R=k("../line_widgets").LineWidgets,L=k("../lib/dom"),x=k("../range").Range,s=k("../config").nls;function c(t,i,n){for(var e=0,o=t.length-1;e<=o;){var a=e+o>>1,u=n(i,t[a]);if(u>0)e=a+1;else if(u<0)o=a-1;else return a}return -(e+1)}function r(t,i,n){var e=t.getAnnotations().sort(x.comparePoints);if(e.length){var o=c(e,{row:i,column:-1},x.comparePoints);o<0&&(o=-o-1),o>=e.length?o=n>0?0:e.length-1:o===0&&n<0&&(o=e.length-1);var a=e[o];if(!(!a||!n)){if(a.row===i){do a=e[o+=n];while(a&&a.row===i);if(!a)return e.slice()}var u=[];i=a.row;do u[n<0?"unshift":"push"](a),a=e[o+=n];while(a&&a.row==i);return u.length&&u}}}M.showErrorMarker=function(t,i){var n=t.session;n.widgetManager||(n.widgetManager=new R(n),n.widgetManager.attach(t));var e=t.getCursorPosition(),o=e.row,a=n.widgetManager.getWidgetsAtRow(o).filter(function(C){return C.type=="errorMarker"})[0];a?a.destroy():o-=i;var u=r(n,o,i),w;if(u){var S=u[0];e.column=(S.pos&&typeof S.column!="number"?S.pos.sc:S.column)||0,e.row=S.row,w=t.renderer.$gutterLayer.$annotations[e.row];}else {if(a)return;w={displayText:[s("error-marker.good-state","Looks good!")],className:"ace_ok"};}t.session.unfold(e.row),t.selection.moveToPosition(e);var m={row:e.row,fixedWidth:!0,coverGutter:!0,el:L.createElement("div"),type:"errorMarker"},$=m.el.appendChild(L.createElement("div")),d=m.el.appendChild(L.createElement("div"));d.className="error_widget_arrow "+w.className;var h=t.renderer.$cursorLayer.getPixelPosition(e).left;d.style.left=h+t.renderer.gutterWidth-5+"px",m.el.className="error_widget_wrapper",$.className="error_widget "+w.className,w.displayText.forEach(function(C,y){$.appendChild(L.createTextNode(C)),y<w.displayText.length-1&&$.appendChild(L.createElement("br"));}),$.appendChild(L.createElement("div"));var v=function(C,y,b){if(y===0&&(b==="esc"||b==="return"))return m.destroy(),{command:"null"}};m.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(v),n.widgetManager.removeLineWidget(m),t.off("changeSelection",m.destroy),t.off("changeSession",m.destroy),t.off("mouseup",m.destroy),t.off("change",m.destroy));},t.keyBinding.addKeyboardHandler(v),t.on("changeSelection",m.destroy),t.on("changeSession",m.destroy),t.on("mouseup",m.destroy),t.on("change",m.destroy),t.session.widgetManager.addLineWidget(m),m.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:m.el.offsetHeight});},L.importCssString(`
943
944
  .error_widget_wrapper {
944
945
  background: inherit;
945
946
  color: inherit;
@@ -972,21 +973,21 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
972
973
  border-left-color: transparent!important;
973
974
  top: -5px;
974
975
  }
975
- `,"error_marker.css",!1);});ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(k,M,H){k("./loader_build")(M);var R=k("./lib/dom"),L=k("./range").Range,x=k("./editor").Editor,s=k("./edit_session").EditSession,l=k("./undomanager").UndoManager,r=k("./virtual_renderer").VirtualRenderer;k("./worker/worker_client"),k("./keyboard/hash_handler"),k("./placeholder"),k("./multi_select"),k("./mode/folding/fold_mode"),k("./theme/textmate"),k("./ext/error_marker"),M.config=k("./config"),M.edit=function(e,i){if(typeof e=="string"){var n=e;if(e=document.getElementById(n),!e)throw new Error("ace.edit can't find div #"+n)}if(e&&e.env&&e.env.editor instanceof x)return e.env.editor;var t="";if(e&&/input|textarea/i.test(e.tagName)){var o=e;t=o.value,e=R.createElement("pre"),o.parentNode.replaceChild(e,o);}else e&&(t=e.textContent,e.innerHTML="");var a=M.createEditSession(t),u=new x(new r(e),a,i),w={document:a,editor:u,onResize:u.resize.bind(u,null)};return o&&(w.textarea=o),u.on("destroy",function(){w.editor.container.env=null;}),u.container.env=u.env=w,u},M.createEditSession=function(e,i){var n=new s(e,i);return n.setUndoManager(new l),n},M.Range=L,M.Editor=x,M.EditSession=s,M.UndoManager=l,M.VirtualRenderer=r,M.version=M.config.version;});(function(){ace.require(["ace/ace"],function(k){k&&(k.config.init(!0),k.define=ace.define);var M=function(){return this}();!M&&typeof window<"u"&&(M=window),!M&&typeof self<"u"&&(M=self),M.ace||(M.ace=k);for(var H in k)k.hasOwnProperty(H)&&(M.ace[H]=k[H]);M.ace.default=M.ace,typeof Ee=="object"&&typeof ot=="object"&&Ee&&(Ee.exports=M.ace);});})();});var lt=a((at,_e)=>{ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(k,M,H){var R=k("./lib/dom"),L=k("./lib/oop"),x=k("./lib/event_emitter").EventEmitter,s=k("./lib/lang"),l=k("./range").Range,r=k("./range_list").RangeList,e=k("./keyboard/hash_handler").HashHandler,i=k("./tokenizer").Tokenizer,n=k("./clipboard"),t={CURRENT_WORD:function(d){return d.session.getTextRange(d.session.getWordRange())},SELECTION:function(d,h,v){var C=d.session.getTextRange();return v?C.replace(/\n\r?([ \t]*\S)/g,`
976
- `+v+"$1"):C},CURRENT_LINE:function(d){return d.session.getLine(d.getCursorPosition().row)},PREV_LINE:function(d){return d.session.getLine(d.getCursorPosition().row-1)},LINE_INDEX:function(d){return d.getCursorPosition().row},LINE_NUMBER:function(d){return d.getCursorPosition().row+1},SOFT_TABS:function(d){return d.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(d){return d.session.getTabSize()},CLIPBOARD:function(d){return n.getText&&n.getText()},FILENAME:function(d){return /[^/\\]*$/.exec(this.FILEPATH(d))[0]},FILENAME_BASE:function(d){return /[^/\\]*$/.exec(this.FILEPATH(d))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(d){return this.FILEPATH(d).replace(/[^/\\]*$/,"")},FILEPATH:function(d){return "/not implemented.txt"},WORKSPACE_NAME:function(){return "Unknown"},FULLNAME:function(){return "Unknown"},BLOCK_COMMENT_START:function(d){var h=d.session.$mode||{};return h.blockComment&&h.blockComment.start||""},BLOCK_COMMENT_END:function(d){var h=d.session.$mode||{};return h.blockComment&&h.blockComment.end||""},LINE_COMMENT:function(d){var h=d.session.$mode||{};return h.lineCommentStart||""},CURRENT_YEAR:o.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:o.bind(null,{year:"2-digit"}),CURRENT_MONTH:o.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:o.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:o.bind(null,{month:"short"}),CURRENT_DATE:o.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:o.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:o.bind(null,{weekday:"short"}),CURRENT_HOUR:o.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:o.bind(null,{minute:"2-digit"}),CURRENT_SECOND:o.bind(null,{second:"2-digit"})};t.SELECTED_TEXT=t.SELECTION;function o(d){var h=new Date().toLocaleString("en-us",d);return h.length==1?"0"+h:h}var a=function(){function d(){this.snippetMap={},this.snippetNameMap={},this.variables=t;}return d.prototype.getTokenizer=function(){return d.$tokenizer||this.createTokenizer()},d.prototype.createTokenizer=function(){function h(y){return y=y.substr(1),/^\d+$/.test(y)?[{tabstopId:parseInt(y,10)}]:[{text:y}]}function v(y){return "(?:[^\\\\"+y+"]|\\\\.)"}var C={regex:"/("+v("/")+"+)/",onMatch:function(y,b,f){var p=f[0];return p.fmtString=!0,p.guard=y.slice(1,-1),p.flag="",""},next:"formatString"};return d.$tokenizer=new i({start:[{regex:/\\./,onMatch:function(y,b,f){var p=y[1];return (p=="}"&&f.length||"`$\\".indexOf(p)!=-1)&&(y=p),[y]}},{regex:/}/,onMatch:function(y,b,f){return [f.length?f.shift():y]}},{regex:/\$(?:\d+|\w+)/,onMatch:h},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(y,b,f){var p=h(y.substr(1));return f.unshift(p[0]),p},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+v("\\|")+"*\\|",onMatch:function(y,b,f){var p=y.slice(1,-1).replace(/\\[,|\\]|,/g,function(c){return c.length==2?c[1]:"\0"}).split("\0").map(function(c){return {value:c}});return f[0].choices=p,[p[0]]},next:"start"},C,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(y,b,f){return f.length&&f[0].expectElse?(f[0].expectElse=!1,f[0].ifEnd={elseEnd:f[0]},[f[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(y,b,f){var p=y[1];return p=="}"&&f.length||"`$\\".indexOf(p)!=-1?y=p:p=="n"?y=`
977
- `:p=="t"?y=" ":"ulULE".indexOf(p)!=-1&&(y={changeCase:p,local:p>"a"}),[y]}},{regex:"/\\w*}",onMatch:function(y,b,f){var p=f.shift();return p&&(p.flag=y.slice(1,-1)),this.next=p&&p.tabstopId?"start":"",[p||y]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(y,b,f){return [{text:y.slice(1)}]}},{regex:/\${\w+/,onMatch:function(y,b,f){var p={text:y.slice(2)};return f.unshift(p),[p]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(y,b,f){var p=f.shift();return this.next=p&&p.tabstopId?"start":"",[p||y]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(y,b,f){var p=f[0];return p.formatFunction=y.slice(2,-1),[f.shift()]},next:"formatString"},C,{regex:/:[\?\-+]?/,onMatch:function(y,b,f){y[1]=="+"&&(f[0].ifEnd=f[0]),y[1]=="?"&&(f[0].expectElse=!0);},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),d.$tokenizer},d.prototype.tokenizeTmSnippet=function(h,v){return this.getTokenizer().getLineTokens(h,v).tokens.map(function(C){return C.value||C})},d.prototype.getVariableValue=function(h,v,C){if(/^\d+$/.test(v))return (this.variables.__||{})[v]||"";if(/^[A-Z]\d+$/.test(v))return (this.variables[v[0]+"__"]||{})[v.substr(1)]||"";if(v=v.replace(/^TM_/,""),!this.variables.hasOwnProperty(v))return "";var y=this.variables[v];return typeof y=="function"&&(y=this.variables[v](h,v,C)),y??""},d.prototype.tmStrFormat=function(h,v,C){if(!v.fmt)return h;var y=v.flag||"",b=v.guard;b=new RegExp(b,y.replace(/[^gim]/g,""));var f=typeof v.fmt=="string"?this.tokenizeTmSnippet(v.fmt,"formatString"):v.fmt,p=this,c=h.replace(b,function(){var g=p.variables.__;p.variables.__=[].slice.call(arguments);for(var A=p.resolveVariables(f,C),T="E",E=0;E<A.length;E++){var _=A[E];if(typeof _=="object")if(A[E]="",_.changeCase&&_.local){var O=A[E+1];O&&typeof O=="string"&&(_.changeCase=="u"?A[E]=O[0].toUpperCase():A[E]=O[0].toLowerCase(),A[E+1]=O.substr(1));}else _.changeCase&&(T=_.changeCase);else T=="U"?A[E]=_.toUpperCase():T=="L"&&(A[E]=_.toLowerCase());}return p.variables.__=g,A.join("")});return c},d.prototype.tmFormatFunction=function(h,v,C){return v.formatFunction=="upcase"?h.toUpperCase():v.formatFunction=="downcase"?h.toLowerCase():h},d.prototype.resolveVariables=function(h,v){for(var C=[],y="",b=!0,f=0;f<h.length;f++){var p=h[f];if(typeof p=="string"){C.push(p),p==`
978
- `?(b=!0,y=""):b&&(y=/^\t*/.exec(p)[0],b=/\S/.test(p));continue}if(p){if(b=!1,p.fmtString){var c=h.indexOf(p,f+1);c==-1&&(c=h.length),p.fmt=h.slice(f+1,c),f=c;}if(p.text){var g=this.getVariableValue(v,p.text,y)+"";p.fmtString&&(g=this.tmStrFormat(g,p,v)),p.formatFunction&&(g=this.tmFormatFunction(g,p,v)),g&&!p.ifEnd?(C.push(g),A(p)):!g&&p.ifEnd&&A(p.ifEnd);}else p.elseEnd?A(p.elseEnd):(p.tabstopId!=null||p.changeCase!=null)&&C.push(p);}}function A(T){var E=h.indexOf(T,f+1);E!=-1&&(f=E);}return C},d.prototype.getDisplayTextForSnippet=function(h,v){var C=u.call(this,h,v);return C.text},d.prototype.insertSnippetForSelection=function(h,v,C){C===void 0&&(C={});var y=u.call(this,h,v,C),b=h.getSelectionRange(),f=h.session.replace(b,y.text),p=new w(h),c=h.inVirtualSelectionMode&&h.selection.index;p.addTabstops(y.tabstops,b.start,f,c);},d.prototype.insertSnippet=function(h,v,C){C===void 0&&(C={});var y=this;if(h.inVirtualSelectionMode)return y.insertSnippetForSelection(h,v,C);h.forEachSelection(function(){y.insertSnippetForSelection(h,v,C);},null,{keepOrder:!0}),h.tabstopManager&&h.tabstopManager.tabNext();},d.prototype.$getScope=function(h){var v=h.session.$mode.$id||"";if(v=v.split("/").pop(),v==="html"||v==="php"){v==="php"&&!h.session.$mode.inlinePhp&&(v="html");var C=h.getCursorPosition(),y=h.session.getState(C.row);typeof y=="object"&&(y=y[0]),y.substring&&(y.substring(0,3)=="js-"?v="javascript":y.substring(0,4)=="css-"?v="css":y.substring(0,4)=="php-"&&(v="php"));}return v},d.prototype.getActiveScopes=function(h){var v=this.$getScope(h),C=[v],y=this.snippetMap;return y[v]&&y[v].includeScopes&&C.push.apply(C,y[v].includeScopes),C.push("_"),C},d.prototype.expandWithTab=function(h,v){var C=this,y=h.forEachSelection(function(){return C.expandSnippetForSelection(h,v)},null,{keepOrder:!0});return y&&h.tabstopManager&&h.tabstopManager.tabNext(),y},d.prototype.expandSnippetForSelection=function(h,v){var C=h.getCursorPosition(),y=h.session.getLine(C.row),b=y.substring(0,C.column),f=y.substr(C.column),p=this.snippetMap,c;return this.getActiveScopes(h).some(function(g){var A=p[g];return A&&(c=this.findMatchingSnippet(A,b,f)),!!c},this),c?(v&&v.dryRun||(h.session.doc.removeInLine(C.row,C.column-c.replaceBefore.length,C.column+c.replaceAfter.length),this.variables.M__=c.matchBefore,this.variables.T__=c.matchAfter,this.insertSnippetForSelection(h,c.content),this.variables.M__=this.variables.T__=null),!0):!1},d.prototype.findMatchingSnippet=function(h,v,C){for(var y=h.length;y--;){var b=h[y];if(!(b.startRe&&!b.startRe.test(v))&&!(b.endRe&&!b.endRe.test(C))&&!(!b.startRe&&!b.endRe))return b.matchBefore=b.startRe?b.startRe.exec(v):[""],b.matchAfter=b.endRe?b.endRe.exec(C):[""],b.replaceBefore=b.triggerRe?b.triggerRe.exec(v)[0]:"",b.replaceAfter=b.endTriggerRe?b.endTriggerRe.exec(C)[0]:"",b}},d.prototype.register=function(h,v){var C=this.snippetMap,y=this.snippetNameMap,b=this;h||(h=[]);function f(g){return g&&!/^\^?\(.*\)\$?$|^\\b$/.test(g)&&(g="(?:"+g+")"),g||""}function p(g,A,T){return g=f(g),A=f(A),T?(g=A+g,g&&g[g.length-1]!="$"&&(g=g+"$")):(g=g+A,g&&g[0]!="^"&&(g="^"+g)),new RegExp(g)}function c(g){g.scope||(g.scope=v||"_"),v=g.scope,C[v]||(C[v]=[],y[v]={});var A=y[v];if(g.name){var T=A[g.name];T&&b.unregister(T),A[g.name]=g;}C[v].push(g),g.prefix&&(g.tabTrigger=g.prefix),!g.content&&g.body&&(g.content=Array.isArray(g.body)?g.body.join(`
979
- `):g.body),g.tabTrigger&&!g.trigger&&(!g.guard&&/^\w/.test(g.tabTrigger)&&(g.guard="\\b"),g.trigger=s.escapeRegExp(g.tabTrigger)),!(!g.trigger&&!g.guard&&!g.endTrigger&&!g.endGuard)&&(g.startRe=p(g.trigger,g.guard,!0),g.triggerRe=new RegExp(g.trigger),g.endRe=p(g.endTrigger,g.endGuard,!0),g.endTriggerRe=new RegExp(g.endTrigger));}Array.isArray(h)?h.forEach(c):Object.keys(h).forEach(function(g){c(h[g]);}),this._signal("registerSnippets",{scope:v});},d.prototype.unregister=function(h,v){var C=this.snippetMap,y=this.snippetNameMap;function b(f){var p=y[f.scope||v];if(p&&p[f.name]){delete p[f.name];var c=C[f.scope||v],g=c&&c.indexOf(f);g>=0&&c.splice(g,1);}}h.content?b(h):Array.isArray(h)&&h.forEach(b);},d.prototype.parseSnippetFile=function(h){h=h.replace(/\r/g,"");for(var v=[],C={},y=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,b;b=y.exec(h);){if(b[1])try{C=JSON.parse(b[1]),v.push(C);}catch{}if(b[4])C.content=b[4].replace(/^\t/gm,""),v.push(C),C={};else {var f=b[2],p=b[3];if(f=="regex"){var c=/\/((?:[^\/\\]|\\.)*)|$/g;C.guard=c.exec(p)[1],C.trigger=c.exec(p)[1],C.endTrigger=c.exec(p)[1],C.endGuard=c.exec(p)[1];}else f=="snippet"?(C.tabTrigger=p.match(/^\S*/)[0],C.name||(C.name=p)):f&&(C[f]=p);}}return v},d.prototype.getSnippetByName=function(h,v){var C=this.snippetNameMap,y;return this.getActiveScopes(v).some(function(b){var f=C[b];return f&&(y=f[h]),!!y},this),y},d}();L.implement(a.prototype,x);var u=function(d,h,v){v===void 0&&(v={});var C=d.getCursorPosition(),y=d.session.getLine(C.row),b=d.session.getTabString(),f=y.match(/^\s*/)[0];C.column<f.length&&(f=f.slice(0,C.column)),h=h.replace(/\r/g,"");var p=this.tokenizeTmSnippet(h);p=this.resolveVariables(p,d),p=p.map(function(B){return B==`
980
- `&&!v.excludeExtraIndent?B+f:typeof B=="string"?B.replace(/\t/g,b):B});var c=[];p.forEach(function(B,z){if(typeof B=="object"){var G=B.tabstopId,U=c[G];if(U||(U=c[G]=[],U.index=G,U.value="",U.parents={}),U.indexOf(B)===-1){B.choices&&!U.choices&&(U.choices=B.choices),U.push(B);var V=p.indexOf(B,z+1);if(V!==-1){var Y=p.slice(z+1,V),K=Y.some(function(J){return typeof J=="object"});K&&!U.value?U.value=Y:Y.length&&(!U.value||typeof U.value!="string")&&(U.value=Y.join(""));}}}}),c.forEach(function(B){B.length=0;});var g={};function A(B){for(var z=[],G=0;G<B.length;G++){var U=B[G];if(typeof U=="object"){if(g[U.tabstopId])continue;var V=B.lastIndexOf(U,G-1);U=z[V]||{tabstopId:U.tabstopId};}z[G]=U;}return z}for(var T=0;T<p.length;T++){var E=p[T];if(typeof E=="object"){var _=E.tabstopId,O=c[_],I=p.indexOf(E,T+1);if(g[_]){g[_]===E&&(delete g[_],Object.keys(g).forEach(function(B){O.parents[B]=!0;}));continue}g[_]=E;var N=O.value;typeof N!="string"?N=A(N):E.fmt&&(N=this.tmStrFormat(N,E,d)),p.splice.apply(p,[T+1,Math.max(0,I-T)].concat(N,E)),O.indexOf(E)===-1&&O.push(E);}}var F=0,D=0,W="";return p.forEach(function(B){if(typeof B=="string"){var z=B.split(`
981
- `);z.length>1?(D=z[z.length-1].length,F+=z.length-1):D+=B.length,W+=B;}else B&&(B.start?B.end={row:F,column:D}:B.start={row:F,column:D});}),{text:W,tabstops:c,tokens:p}},w=function(){function d(h){if(this.index=0,this.ranges=[],this.tabstops=[],h.tabstopManager)return h.tabstopManager;h.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(h);}return d.prototype.attach=function(h){this.$openTabstops=null,this.selectedTabstop=null,this.editor=h,this.session=h.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);},d.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null;},d.prototype.onChange=function(h){for(var v=h.action[0]=="r",C=this.selectedTabstop||{},y=C.parents||{},b=this.tabstops.slice(),f=0;f<b.length;f++){var p=b[f],c=p==C||y[p.index];if(p.rangeList.$bias=c?0:1,h.action=="remove"&&p!==C){var g=p.parents&&p.parents[C.index],A=p.rangeList.pointIndex(h.start,g);A=A<0?-A-1:A+1;var T=p.rangeList.pointIndex(h.end,g);T=T<0?-T-1:T-1;for(var E=p.rangeList.ranges.slice(A,T),_=0;_<E.length;_++)this.removeRange(E[_]);}p.rangeList.$onChange(h);}var O=this.session;!this.$inChange&&v&&O.getLength()==1&&!O.getValue()&&this.detach();},d.prototype.updateLinkedFields=function(){var h=this.selectedTabstop;if(!(!h||!h.hasLinkedRanges||!h.firstNonLinked)){this.$inChange=!0;for(var v=this.session,C=v.getTextRange(h.firstNonLinked),y=0;y<h.length;y++){var b=h[y];if(b.linked){var f=b.original,p=M.snippetManager.tmStrFormat(C,f,this.editor);v.replace(b,p);}}this.$inChange=!1;}},d.prototype.onAfterExec=function(h){h.command&&!h.command.readOnly&&this.updateLinkedFields();},d.prototype.onChangeSelection=function(){if(this.editor){for(var h=this.editor.selection.lead,v=this.editor.selection.anchor,C=this.editor.selection.isEmpty(),y=0;y<this.ranges.length;y++)if(!this.ranges[y].linked){var b=this.ranges[y].contains(h.row,h.column),f=C||this.ranges[y].contains(v.row,v.column);if(b&&f)return}this.detach();}},d.prototype.onChangeSession=function(){this.detach();},d.prototype.tabNext=function(h){var v=this.tabstops.length,C=this.index+(h||1);C=Math.min(Math.max(C,1),v),C==v&&(C=0),this.selectTabstop(C),this.updateTabstopMarkers(),C===0&&this.detach();},d.prototype.selectTabstop=function(h){this.$openTabstops=null;var v=this.tabstops[this.index];if(v&&this.addTabstopMarkers(v),this.index=h,v=this.tabstops[this.index],!(!v||!v.length)){this.selectedTabstop=v;var C=v.firstNonLinked||v;if(v.choices&&(C.cursor=C.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(C);else {var y=this.editor.multiSelect;y.toSingleRange(C);for(var b=0;b<v.length;b++)v.hasLinkedRanges&&v[b].linked||y.addRange(v[b].clone(),!0);}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices});}},d.prototype.addTabstops=function(h,v,C){var y=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!h[0]){var b=l.fromPoints(C,C);m(b.start,v),m(b.end,v),h[0]=[b],h[0].index=0;}var f=this.index,p=[f+1,0],c=this.ranges,g=this.snippetId=(this.snippetId||0)+1;h.forEach(function(A,T){var E=this.$openTabstops[T]||A;E.snippetId=g;for(var _=0;_<A.length;_++){var O=A[_],I=l.fromPoints(O.start,O.end||O.start);S(I.start,v),S(I.end,v),I.original=O,I.tabstop=E,c.push(I),E!=A?E.unshift(I):E[_]=I,O.fmtString||E.firstNonLinked&&y?(I.linked=!0,E.hasLinkedRanges=!0):E.firstNonLinked||(E.firstNonLinked=I);}E.firstNonLinked||(E.hasLinkedRanges=!1),E===A&&(p.push(E),this.$openTabstops[T]=E),this.addTabstopMarkers(E),E.rangeList=E.rangeList||new r,E.rangeList.$bias=0,E.rangeList.addList(E);},this),p.length>2&&(this.tabstops.length&&p.push(p.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,p));},d.prototype.addTabstopMarkers=function(h){var v=this.session;h.forEach(function(C){C.markerId||(C.markerId=v.addMarker(C,"ace_snippet-marker","text"));});},d.prototype.removeTabstopMarkers=function(h){var v=this.session;h.forEach(function(C){v.removeMarker(C.markerId),C.markerId=null;});},d.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var h=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&h--,this.tabstops.forEach(function(v){v.snippetId===h?this.addTabstopMarkers(v):this.removeTabstopMarkers(v);},this);}},d.prototype.removeRange=function(h){var v=h.tabstop.indexOf(h);v!=-1&&h.tabstop.splice(v,1),v=this.ranges.indexOf(h),v!=-1&&this.ranges.splice(v,1),v=h.tabstop.rangeList.ranges.indexOf(h),v!=-1&&h.tabstop.splice(v,1),this.session.removeMarker(h.markerId),h.tabstop.length||(v=this.tabstops.indexOf(h.tabstop),v!=-1&&this.tabstops.splice(v,1),this.tabstops.length||this.detach());},d}();w.prototype.keyboardHandler=new e,w.prototype.keyboardHandler.bindKeys({Tab:function(d){M.snippetManager&&M.snippetManager.expandWithTab(d)||(d.tabstopManager.tabNext(1),d.renderer.scrollCursorIntoView());},"Shift-Tab":function(d){d.tabstopManager.tabNext(-1),d.renderer.scrollCursorIntoView();},Esc:function(d){d.tabstopManager.detach();}});var S=function(d,h){d.row==0&&(d.column+=h.column),d.row+=h.row;},m=function(d,h){d.row==h.row&&(d.column-=h.column),d.row-=h.row;};R.importCssString(`
976
+ `,"error_marker.css",!1);});ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(k,M,H){k("./loader_build")(M);var R=k("./lib/dom"),L=k("./range").Range,x=k("./editor").Editor,s=k("./edit_session").EditSession,c=k("./undomanager").UndoManager,r=k("./virtual_renderer").VirtualRenderer;k("./worker/worker_client"),k("./keyboard/hash_handler"),k("./placeholder"),k("./multi_select"),k("./mode/folding/fold_mode"),k("./theme/textmate"),k("./ext/error_marker"),M.config=k("./config"),M.edit=function(t,i){if(typeof t=="string"){var n=t;if(t=document.getElementById(n),!t)throw new Error("ace.edit can't find div #"+n)}if(t&&t.env&&t.env.editor instanceof x)return t.env.editor;var e="";if(t&&/input|textarea/i.test(t.tagName)){var o=t;e=o.value,t=R.createElement("pre"),o.parentNode.replaceChild(t,o);}else t&&(e=t.textContent,t.innerHTML="");var a=M.createEditSession(e),u=new x(new r(t),a,i),w={document:a,editor:u,onResize:u.resize.bind(u,null)};return o&&(w.textarea=o),u.on("destroy",function(){w.editor.container.env=null;}),u.container.env=u.env=w,u},M.createEditSession=function(t,i){var n=new s(t,i);return n.setUndoManager(new c),n},M.Range=L,M.Editor=x,M.EditSession=s,M.UndoManager=c,M.VirtualRenderer=r,M.version=M.config.version;});(function(){ace.require(["ace/ace"],function(k){k&&(k.config.init(!0),k.define=ace.define);var M=function(){return this}();!M&&typeof window<"u"&&(M=window),!M&&typeof self<"u"&&(M=self),M.ace||(M.ace=k);for(var H in k)k.hasOwnProperty(H)&&(M.ace[H]=k[H]);M.ace.default=M.ace,typeof Ee=="object"&&typeof ot=="object"&&Ee&&(Ee.exports=M.ace);});})();});var lt=a((at,_e)=>{ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],function(k,M,H){var R=k("./lib/dom"),L=k("./lib/oop"),x=k("./lib/event_emitter").EventEmitter,s=k("./lib/lang"),c=k("./range").Range,r=k("./range_list").RangeList,t=k("./keyboard/hash_handler").HashHandler,i=k("./tokenizer").Tokenizer,n=k("./clipboard"),e={CURRENT_WORD:function(d){return d.session.getTextRange(d.session.getWordRange())},SELECTION:function(d,h,v){var C=d.session.getTextRange();return v?C.replace(/\n\r?([ \t]*\S)/g,`
977
+ `+v+"$1"):C},CURRENT_LINE:function(d){return d.session.getLine(d.getCursorPosition().row)},PREV_LINE:function(d){return d.session.getLine(d.getCursorPosition().row-1)},LINE_INDEX:function(d){return d.getCursorPosition().row},LINE_NUMBER:function(d){return d.getCursorPosition().row+1},SOFT_TABS:function(d){return d.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(d){return d.session.getTabSize()},CLIPBOARD:function(d){return n.getText&&n.getText()},FILENAME:function(d){return /[^/\\]*$/.exec(this.FILEPATH(d))[0]},FILENAME_BASE:function(d){return /[^/\\]*$/.exec(this.FILEPATH(d))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(d){return this.FILEPATH(d).replace(/[^/\\]*$/,"")},FILEPATH:function(d){return "/not implemented.txt"},WORKSPACE_NAME:function(){return "Unknown"},FULLNAME:function(){return "Unknown"},BLOCK_COMMENT_START:function(d){var h=d.session.$mode||{};return h.blockComment&&h.blockComment.start||""},BLOCK_COMMENT_END:function(d){var h=d.session.$mode||{};return h.blockComment&&h.blockComment.end||""},LINE_COMMENT:function(d){var h=d.session.$mode||{};return h.lineCommentStart||""},CURRENT_YEAR:o.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:o.bind(null,{year:"2-digit"}),CURRENT_MONTH:o.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:o.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:o.bind(null,{month:"short"}),CURRENT_DATE:o.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:o.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:o.bind(null,{weekday:"short"}),CURRENT_HOUR:o.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:o.bind(null,{minute:"2-digit"}),CURRENT_SECOND:o.bind(null,{second:"2-digit"})};e.SELECTED_TEXT=e.SELECTION;function o(d){var h=new Date().toLocaleString("en-us",d);return h.length==1?"0"+h:h}var a=function(){function d(){this.snippetMap={},this.snippetNameMap={},this.variables=e;}return d.prototype.getTokenizer=function(){return d.$tokenizer||this.createTokenizer()},d.prototype.createTokenizer=function(){function h(y){return y=y.substr(1),/^\d+$/.test(y)?[{tabstopId:parseInt(y,10)}]:[{text:y}]}function v(y){return "(?:[^\\\\"+y+"]|\\\\.)"}var C={regex:"/("+v("/")+"+)/",onMatch:function(y,b,f){var p=f[0];return p.fmtString=!0,p.guard=y.slice(1,-1),p.flag="",""},next:"formatString"};return d.$tokenizer=new i({start:[{regex:/\\./,onMatch:function(y,b,f){var p=y[1];return (p=="}"&&f.length||"`$\\".indexOf(p)!=-1)&&(y=p),[y]}},{regex:/}/,onMatch:function(y,b,f){return [f.length?f.shift():y]}},{regex:/\$(?:\d+|\w+)/,onMatch:h},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(y,b,f){var p=h(y.substr(1));return f.unshift(p[0]),p},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+v("\\|")+"*\\|",onMatch:function(y,b,f){var p=y.slice(1,-1).replace(/\\[,|\\]|,/g,function(l){return l.length==2?l[1]:"\0"}).split("\0").map(function(l){return {value:l}});return f[0].choices=p,[p[0]]},next:"start"},C,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(y,b,f){return f.length&&f[0].expectElse?(f[0].expectElse=!1,f[0].ifEnd={elseEnd:f[0]},[f[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(y,b,f){var p=y[1];return p=="}"&&f.length||"`$\\".indexOf(p)!=-1?y=p:p=="n"?y=`
978
+ `:p=="t"?y=" ":"ulULE".indexOf(p)!=-1&&(y={changeCase:p,local:p>"a"}),[y]}},{regex:"/\\w*}",onMatch:function(y,b,f){var p=f.shift();return p&&(p.flag=y.slice(1,-1)),this.next=p&&p.tabstopId?"start":"",[p||y]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(y,b,f){return [{text:y.slice(1)}]}},{regex:/\${\w+/,onMatch:function(y,b,f){var p={text:y.slice(2)};return f.unshift(p),[p]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(y,b,f){var p=f.shift();return this.next=p&&p.tabstopId?"start":"",[p||y]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(y,b,f){var p=f[0];return p.formatFunction=y.slice(2,-1),[f.shift()]},next:"formatString"},C,{regex:/:[\?\-+]?/,onMatch:function(y,b,f){y[1]=="+"&&(f[0].ifEnd=f[0]),y[1]=="?"&&(f[0].expectElse=!0);},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),d.$tokenizer},d.prototype.tokenizeTmSnippet=function(h,v){return this.getTokenizer().getLineTokens(h,v).tokens.map(function(C){return C.value||C})},d.prototype.getVariableValue=function(h,v,C){if(/^\d+$/.test(v))return (this.variables.__||{})[v]||"";if(/^[A-Z]\d+$/.test(v))return (this.variables[v[0]+"__"]||{})[v.substr(1)]||"";if(v=v.replace(/^TM_/,""),!this.variables.hasOwnProperty(v))return "";var y=this.variables[v];return typeof y=="function"&&(y=this.variables[v](h,v,C)),y??""},d.prototype.tmStrFormat=function(h,v,C){if(!v.fmt)return h;var y=v.flag||"",b=v.guard;b=new RegExp(b,y.replace(/[^gim]/g,""));var f=typeof v.fmt=="string"?this.tokenizeTmSnippet(v.fmt,"formatString"):v.fmt,p=this,l=h.replace(b,function(){var g=p.variables.__;p.variables.__=[].slice.call(arguments);for(var A=p.resolveVariables(f,C),T="E",E=0;E<A.length;E++){var _=A[E];if(typeof _=="object")if(A[E]="",_.changeCase&&_.local){var O=A[E+1];O&&typeof O=="string"&&(_.changeCase=="u"?A[E]=O[0].toUpperCase():A[E]=O[0].toLowerCase(),A[E+1]=O.substr(1));}else _.changeCase&&(T=_.changeCase);else T=="U"?A[E]=_.toUpperCase():T=="L"&&(A[E]=_.toLowerCase());}return p.variables.__=g,A.join("")});return l},d.prototype.tmFormatFunction=function(h,v,C){return v.formatFunction=="upcase"?h.toUpperCase():v.formatFunction=="downcase"?h.toLowerCase():h},d.prototype.resolveVariables=function(h,v){for(var C=[],y="",b=!0,f=0;f<h.length;f++){var p=h[f];if(typeof p=="string"){C.push(p),p==`
979
+ `?(b=!0,y=""):b&&(y=/^\t*/.exec(p)[0],b=/\S/.test(p));continue}if(p){if(b=!1,p.fmtString){var l=h.indexOf(p,f+1);l==-1&&(l=h.length),p.fmt=h.slice(f+1,l),f=l;}if(p.text){var g=this.getVariableValue(v,p.text,y)+"";p.fmtString&&(g=this.tmStrFormat(g,p,v)),p.formatFunction&&(g=this.tmFormatFunction(g,p,v)),g&&!p.ifEnd?(C.push(g),A(p)):!g&&p.ifEnd&&A(p.ifEnd);}else p.elseEnd?A(p.elseEnd):(p.tabstopId!=null||p.changeCase!=null)&&C.push(p);}}function A(T){var E=h.indexOf(T,f+1);E!=-1&&(f=E);}return C},d.prototype.getDisplayTextForSnippet=function(h,v){var C=u.call(this,h,v);return C.text},d.prototype.insertSnippetForSelection=function(h,v,C){C===void 0&&(C={});var y=u.call(this,h,v,C),b=h.getSelectionRange(),f=h.session.replace(b,y.text),p=new w(h),l=h.inVirtualSelectionMode&&h.selection.index;p.addTabstops(y.tabstops,b.start,f,l);},d.prototype.insertSnippet=function(h,v,C){C===void 0&&(C={});var y=this;if(h.inVirtualSelectionMode)return y.insertSnippetForSelection(h,v,C);h.forEachSelection(function(){y.insertSnippetForSelection(h,v,C);},null,{keepOrder:!0}),h.tabstopManager&&h.tabstopManager.tabNext();},d.prototype.$getScope=function(h){var v=h.session.$mode.$id||"";if(v=v.split("/").pop(),v==="html"||v==="php"){v==="php"&&!h.session.$mode.inlinePhp&&(v="html");var C=h.getCursorPosition(),y=h.session.getState(C.row);typeof y=="object"&&(y=y[0]),y.substring&&(y.substring(0,3)=="js-"?v="javascript":y.substring(0,4)=="css-"?v="css":y.substring(0,4)=="php-"&&(v="php"));}return v},d.prototype.getActiveScopes=function(h){var v=this.$getScope(h),C=[v],y=this.snippetMap;return y[v]&&y[v].includeScopes&&C.push.apply(C,y[v].includeScopes),C.push("_"),C},d.prototype.expandWithTab=function(h,v){var C=this,y=h.forEachSelection(function(){return C.expandSnippetForSelection(h,v)},null,{keepOrder:!0});return y&&h.tabstopManager&&h.tabstopManager.tabNext(),y},d.prototype.expandSnippetForSelection=function(h,v){var C=h.getCursorPosition(),y=h.session.getLine(C.row),b=y.substring(0,C.column),f=y.substr(C.column),p=this.snippetMap,l;return this.getActiveScopes(h).some(function(g){var A=p[g];return A&&(l=this.findMatchingSnippet(A,b,f)),!!l},this),l?(v&&v.dryRun||(h.session.doc.removeInLine(C.row,C.column-l.replaceBefore.length,C.column+l.replaceAfter.length),this.variables.M__=l.matchBefore,this.variables.T__=l.matchAfter,this.insertSnippetForSelection(h,l.content),this.variables.M__=this.variables.T__=null),!0):!1},d.prototype.findMatchingSnippet=function(h,v,C){for(var y=h.length;y--;){var b=h[y];if(!(b.startRe&&!b.startRe.test(v))&&!(b.endRe&&!b.endRe.test(C))&&!(!b.startRe&&!b.endRe))return b.matchBefore=b.startRe?b.startRe.exec(v):[""],b.matchAfter=b.endRe?b.endRe.exec(C):[""],b.replaceBefore=b.triggerRe?b.triggerRe.exec(v)[0]:"",b.replaceAfter=b.endTriggerRe?b.endTriggerRe.exec(C)[0]:"",b}},d.prototype.register=function(h,v){var C=this.snippetMap,y=this.snippetNameMap,b=this;h||(h=[]);function f(g){return g&&!/^\^?\(.*\)\$?$|^\\b$/.test(g)&&(g="(?:"+g+")"),g||""}function p(g,A,T){return g=f(g),A=f(A),T?(g=A+g,g&&g[g.length-1]!="$"&&(g=g+"$")):(g=g+A,g&&g[0]!="^"&&(g="^"+g)),new RegExp(g)}function l(g){g.scope||(g.scope=v||"_"),v=g.scope,C[v]||(C[v]=[],y[v]={});var A=y[v];if(g.name){var T=A[g.name];T&&b.unregister(T),A[g.name]=g;}C[v].push(g),g.prefix&&(g.tabTrigger=g.prefix),!g.content&&g.body&&(g.content=Array.isArray(g.body)?g.body.join(`
980
+ `):g.body),g.tabTrigger&&!g.trigger&&(!g.guard&&/^\w/.test(g.tabTrigger)&&(g.guard="\\b"),g.trigger=s.escapeRegExp(g.tabTrigger)),!(!g.trigger&&!g.guard&&!g.endTrigger&&!g.endGuard)&&(g.startRe=p(g.trigger,g.guard,!0),g.triggerRe=new RegExp(g.trigger),g.endRe=p(g.endTrigger,g.endGuard,!0),g.endTriggerRe=new RegExp(g.endTrigger));}Array.isArray(h)?h.forEach(l):Object.keys(h).forEach(function(g){l(h[g]);}),this._signal("registerSnippets",{scope:v});},d.prototype.unregister=function(h,v){var C=this.snippetMap,y=this.snippetNameMap;function b(f){var p=y[f.scope||v];if(p&&p[f.name]){delete p[f.name];var l=C[f.scope||v],g=l&&l.indexOf(f);g>=0&&l.splice(g,1);}}h.content?b(h):Array.isArray(h)&&h.forEach(b);},d.prototype.parseSnippetFile=function(h){h=h.replace(/\r/g,"");for(var v=[],C={},y=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,b;b=y.exec(h);){if(b[1])try{C=JSON.parse(b[1]),v.push(C);}catch{}if(b[4])C.content=b[4].replace(/^\t/gm,""),v.push(C),C={};else {var f=b[2],p=b[3];if(f=="regex"){var l=/\/((?:[^\/\\]|\\.)*)|$/g;C.guard=l.exec(p)[1],C.trigger=l.exec(p)[1],C.endTrigger=l.exec(p)[1],C.endGuard=l.exec(p)[1];}else f=="snippet"?(C.tabTrigger=p.match(/^\S*/)[0],C.name||(C.name=p)):f&&(C[f]=p);}}return v},d.prototype.getSnippetByName=function(h,v){var C=this.snippetNameMap,y;return this.getActiveScopes(v).some(function(b){var f=C[b];return f&&(y=f[h]),!!y},this),y},d}();L.implement(a.prototype,x);var u=function(d,h,v){v===void 0&&(v={});var C=d.getCursorPosition(),y=d.session.getLine(C.row),b=d.session.getTabString(),f=y.match(/^\s*/)[0];C.column<f.length&&(f=f.slice(0,C.column)),h=h.replace(/\r/g,"");var p=this.tokenizeTmSnippet(h);p=this.resolveVariables(p,d),p=p.map(function(B){return B==`
981
+ `&&!v.excludeExtraIndent?B+f:typeof B=="string"?B.replace(/\t/g,b):B});var l=[];p.forEach(function(B,z){if(typeof B=="object"){var G=B.tabstopId,U=l[G];if(U||(U=l[G]=[],U.index=G,U.value="",U.parents={}),U.indexOf(B)===-1){B.choices&&!U.choices&&(U.choices=B.choices),U.push(B);var V=p.indexOf(B,z+1);if(V!==-1){var Y=p.slice(z+1,V),K=Y.some(function(J){return typeof J=="object"});K&&!U.value?U.value=Y:Y.length&&(!U.value||typeof U.value!="string")&&(U.value=Y.join(""));}}}}),l.forEach(function(B){B.length=0;});var g={};function A(B){for(var z=[],G=0;G<B.length;G++){var U=B[G];if(typeof U=="object"){if(g[U.tabstopId])continue;var V=B.lastIndexOf(U,G-1);U=z[V]||{tabstopId:U.tabstopId};}z[G]=U;}return z}for(var T=0;T<p.length;T++){var E=p[T];if(typeof E=="object"){var _=E.tabstopId,O=l[_],I=p.indexOf(E,T+1);if(g[_]){g[_]===E&&(delete g[_],Object.keys(g).forEach(function(B){O.parents[B]=!0;}));continue}g[_]=E;var N=O.value;typeof N!="string"?N=A(N):E.fmt&&(N=this.tmStrFormat(N,E,d)),p.splice.apply(p,[T+1,Math.max(0,I-T)].concat(N,E)),O.indexOf(E)===-1&&O.push(E);}}var F=0,D=0,W="";return p.forEach(function(B){if(typeof B=="string"){var z=B.split(`
982
+ `);z.length>1?(D=z[z.length-1].length,F+=z.length-1):D+=B.length,W+=B;}else B&&(B.start?B.end={row:F,column:D}:B.start={row:F,column:D});}),{text:W,tabstops:l,tokens:p}},w=function(){function d(h){if(this.index=0,this.ranges=[],this.tabstops=[],h.tabstopManager)return h.tabstopManager;h.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(h);}return d.prototype.attach=function(h){this.$openTabstops=null,this.selectedTabstop=null,this.editor=h,this.session=h.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);},d.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null;},d.prototype.onChange=function(h){for(var v=h.action[0]=="r",C=this.selectedTabstop||{},y=C.parents||{},b=this.tabstops.slice(),f=0;f<b.length;f++){var p=b[f],l=p==C||y[p.index];if(p.rangeList.$bias=l?0:1,h.action=="remove"&&p!==C){var g=p.parents&&p.parents[C.index],A=p.rangeList.pointIndex(h.start,g);A=A<0?-A-1:A+1;var T=p.rangeList.pointIndex(h.end,g);T=T<0?-T-1:T-1;for(var E=p.rangeList.ranges.slice(A,T),_=0;_<E.length;_++)this.removeRange(E[_]);}p.rangeList.$onChange(h);}var O=this.session;!this.$inChange&&v&&O.getLength()==1&&!O.getValue()&&this.detach();},d.prototype.updateLinkedFields=function(){var h=this.selectedTabstop;if(!(!h||!h.hasLinkedRanges||!h.firstNonLinked)){this.$inChange=!0;for(var v=this.session,C=v.getTextRange(h.firstNonLinked),y=0;y<h.length;y++){var b=h[y];if(b.linked){var f=b.original,p=M.snippetManager.tmStrFormat(C,f,this.editor);v.replace(b,p);}}this.$inChange=!1;}},d.prototype.onAfterExec=function(h){h.command&&!h.command.readOnly&&this.updateLinkedFields();},d.prototype.onChangeSelection=function(){if(this.editor){for(var h=this.editor.selection.lead,v=this.editor.selection.anchor,C=this.editor.selection.isEmpty(),y=0;y<this.ranges.length;y++)if(!this.ranges[y].linked){var b=this.ranges[y].contains(h.row,h.column),f=C||this.ranges[y].contains(v.row,v.column);if(b&&f)return}this.detach();}},d.prototype.onChangeSession=function(){this.detach();},d.prototype.tabNext=function(h){var v=this.tabstops.length,C=this.index+(h||1);C=Math.min(Math.max(C,1),v),C==v&&(C=0),this.selectTabstop(C),this.updateTabstopMarkers(),C===0&&this.detach();},d.prototype.selectTabstop=function(h){this.$openTabstops=null;var v=this.tabstops[this.index];if(v&&this.addTabstopMarkers(v),this.index=h,v=this.tabstops[this.index],!(!v||!v.length)){this.selectedTabstop=v;var C=v.firstNonLinked||v;if(v.choices&&(C.cursor=C.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(C);else {var y=this.editor.multiSelect;y.toSingleRange(C);for(var b=0;b<v.length;b++)v.hasLinkedRanges&&v[b].linked||y.addRange(v[b].clone(),!0);}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices});}},d.prototype.addTabstops=function(h,v,C){var y=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!h[0]){var b=c.fromPoints(C,C);m(b.start,v),m(b.end,v),h[0]=[b],h[0].index=0;}var f=this.index,p=[f+1,0],l=this.ranges,g=this.snippetId=(this.snippetId||0)+1;h.forEach(function(A,T){var E=this.$openTabstops[T]||A;E.snippetId=g;for(var _=0;_<A.length;_++){var O=A[_],I=c.fromPoints(O.start,O.end||O.start);S(I.start,v),S(I.end,v),I.original=O,I.tabstop=E,l.push(I),E!=A?E.unshift(I):E[_]=I,O.fmtString||E.firstNonLinked&&y?(I.linked=!0,E.hasLinkedRanges=!0):E.firstNonLinked||(E.firstNonLinked=I);}E.firstNonLinked||(E.hasLinkedRanges=!1),E===A&&(p.push(E),this.$openTabstops[T]=E),this.addTabstopMarkers(E),E.rangeList=E.rangeList||new r,E.rangeList.$bias=0,E.rangeList.addList(E);},this),p.length>2&&(this.tabstops.length&&p.push(p.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,p));},d.prototype.addTabstopMarkers=function(h){var v=this.session;h.forEach(function(C){C.markerId||(C.markerId=v.addMarker(C,"ace_snippet-marker","text"));});},d.prototype.removeTabstopMarkers=function(h){var v=this.session;h.forEach(function(C){v.removeMarker(C.markerId),C.markerId=null;});},d.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var h=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&h--,this.tabstops.forEach(function(v){v.snippetId===h?this.addTabstopMarkers(v):this.removeTabstopMarkers(v);},this);}},d.prototype.removeRange=function(h){var v=h.tabstop.indexOf(h);v!=-1&&h.tabstop.splice(v,1),v=this.ranges.indexOf(h),v!=-1&&this.ranges.splice(v,1),v=h.tabstop.rangeList.ranges.indexOf(h),v!=-1&&h.tabstop.splice(v,1),this.session.removeMarker(h.markerId),h.tabstop.length||(v=this.tabstops.indexOf(h.tabstop),v!=-1&&this.tabstops.splice(v,1),this.tabstops.length||this.detach());},d}();w.prototype.keyboardHandler=new t,w.prototype.keyboardHandler.bindKeys({Tab:function(d){M.snippetManager&&M.snippetManager.expandWithTab(d)||(d.tabstopManager.tabNext(1),d.renderer.scrollCursorIntoView());},"Shift-Tab":function(d){d.tabstopManager.tabNext(-1),d.renderer.scrollCursorIntoView();},Esc:function(d){d.tabstopManager.detach();}});var S=function(d,h){d.row==0&&(d.column+=h.column),d.row+=h.row;},m=function(d,h){d.row==h.row&&(d.column-=h.column),d.row-=h.row;};R.importCssString(`
982
983
  .ace_snippet-marker {
983
984
  -moz-box-sizing: border-box;
984
985
  box-sizing: border-box;
985
986
  background: rgba(194, 193, 208, 0.09);
986
987
  border: 1px dotted rgba(211, 208, 235, 0.62);
987
988
  position: absolute;
988
- }`,"snippets.css",!1),M.snippetManager=new a;var $=k("./editor").Editor;(function(){this.insertSnippet=function(d,h){return M.snippetManager.insertSnippet(this,d,h)},this.expandSnippet=function(d){return M.snippetManager.expandWithTab(this,d)};}).call($.prototype);});ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(k,M,H){var R=k("../virtual_renderer").VirtualRenderer,L=k("../editor").Editor,x=k("../range").Range,s=k("../lib/event"),l=k("../lib/lang"),r=k("../lib/dom"),e=k("../config").nls,i=k("./../lib/useragent"),n=function(S){return "suggest-aria-id:".concat(S)},t=i.isSafari?"menu":"listbox",o=i.isSafari?"menuitem":"option",a=i.isSafari?"aria-current":"aria-selected",u=function(S){var m=new R(S);m.$maxLines=4;var $=new L(m);return $.setHighlightActiveLine(!1),$.setShowPrintMargin(!1),$.renderer.setShowGutter(!1),$.renderer.setHighlightGutterLine(!1),$.$mouseHandler.$focusTimeout=0,$.$highlightTagPending=!0,$},w=function(){function S(m){var $=r.createElement("div"),d=u($);m&&m.appendChild($),$.style.display="none",d.renderer.content.style.cursor="default",d.renderer.setStyle("ace_autocomplete"),d.renderer.$textLayer.element.setAttribute("role",t),d.renderer.$textLayer.element.setAttribute("aria-roledescription",e("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),d.renderer.$textLayer.element.setAttribute("aria-label",e("autocomplete.popup.aria-label","Autocomplete suggestions")),d.renderer.textarea.setAttribute("aria-hidden","true"),d.setOption("displayIndentGuides",!1),d.setOption("dragDelay",150);var h=function(){};d.focus=h,d.$isFocused=!0,d.renderer.$cursorLayer.restartTimer=h,d.renderer.$cursorLayer.element.style.opacity="0",d.renderer.$maxLines=8,d.renderer.$keepTextAreaAtCursor=!1,d.setHighlightActiveLine(!1),d.session.highlight(""),d.session.$searchHighlight.clazz="ace_highlight-marker",d.on("mousedown",function(c){var g=c.getDocumentPosition();d.selection.moveToPosition(g),y.start.row=y.end.row=g.row,c.stop();});var v,C=new x(-1,0,-1,1/0),y=new x(-1,0,-1,1/0);y.id=d.session.addMarker(y,"ace_active-line","fullLine"),d.setSelectOnHover=function(c){c?C.id&&(d.session.removeMarker(C.id),C.id=null):C.id=d.session.addMarker(C,"ace_line-hover","fullLine");},d.setSelectOnHover(!1),d.on("mousemove",function(c){if(!v){v=c;return}if(!(v.x==c.x&&v.y==c.y)){v=c,v.scrollTop=d.renderer.scrollTop,d.isMouseOver=!0;var g=v.getDocumentPosition().row;C.start.row!=g&&(C.id||d.setRow(g),f(g));}}),d.renderer.on("beforeRender",function(){if(v&&C.start.row!=-1){v.$pos=null;var c=v.getDocumentPosition().row;C.id||d.setRow(c),f(c,!0);}}),d.renderer.on("afterRender",function(){var c=d.getRow(),g=d.renderer.$textLayer,A=g.element.childNodes[c-g.config.firstRow],T=document.activeElement;if(A!==d.selectedNode&&d.selectedNode&&(r.removeCssClass(d.selectedNode,"ace_selected"),T.removeAttribute("aria-activedescendant"),d.selectedNode.removeAttribute(a),d.selectedNode.removeAttribute("id")),d.selectedNode=A,A){r.addCssClass(A,"ace_selected");var E=n(c);A.id=E,g.element.setAttribute("aria-activedescendant",E),T.setAttribute("aria-activedescendant",E),A.setAttribute("role",o),A.setAttribute("aria-roledescription",e("autocomplete.popup.item.aria-roledescription","item")),A.setAttribute("aria-label",d.getData(c).caption||d.getData(c).value),A.setAttribute("aria-setsize",d.data.length),A.setAttribute("aria-posinset",c+1),A.setAttribute("aria-describedby","doc-tooltip"),A.setAttribute(a,"true");}});var b=function(){f(-1);},f=function(c,g){c!==C.start.row&&(C.start.row=C.end.row=c,g||d.session._emit("changeBackMarker"),d._emit("changeHoverMarker"));};d.getHoveredRow=function(){return C.start.row},s.addListener(d.container,"mouseout",function(){d.isMouseOver=!1,b();}),d.on("hide",b),d.on("changeSelection",b),d.session.doc.getLength=function(){return d.data.length},d.session.doc.getLine=function(c){var g=d.data[c];return typeof g=="string"?g:g&&g.value||""};var p=d.session.bgTokenizer;return p.$tokenizeRow=function(c){var g=d.data[c],A=[];if(!g)return A;typeof g=="string"&&(g={value:g});var T=g.caption||g.value||g.name;function E(B,z){B&&A.push({type:(g.className||"")+(z||""),value:B});}for(var _=T.toLowerCase(),O=(d.filterText||"").toLowerCase(),I=0,N=0,F=0;F<=O.length;F++)if(F!=N&&(g.matchMask&1<<F||F==O.length)){var D=O.slice(N,F);N=F;var W=_.indexOf(D,I);if(W==-1)continue;E(T.slice(I,W),""),I=W+D.length,E(T.slice(W,I),"completion-highlight");}return E(T.slice(I,T.length),""),A.push({type:"completion-spacer",value:" "}),g.meta&&A.push({type:"completion-meta",value:g.meta}),g.message&&A.push({type:"completion-message",value:g.message}),A},p.$updateOnChange=h,p.start=h,d.session.$computeWidth=function(){return this.screenWidth=0},d.isOpen=!1,d.isTopdown=!1,d.autoSelect=!0,d.filterText="",d.isMouseOver=!1,d.data=[],d.setData=function(c,g){d.filterText=g||"",d.setValue(l.stringRepeat(`
989
- `,c.length),-1),d.data=c||[],d.setRow(0);},d.getData=function(c){return d.data[c]},d.getRow=function(){return y.start.row},d.setRow=function(c){c=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,c)),y.start.row!=c&&(d.selection.clearSelection(),y.start.row=y.end.row=c||0,d.session._emit("changeBackMarker"),d.moveCursorTo(c||0,0),d.isOpen&&d._signal("select"));},d.on("changeSelection",function(){d.isOpen&&d.setRow(d.selection.lead.row),d.renderer.scrollCursorIntoView();}),d.hide=function(){this.container.style.display="none",d.anchorPos=null,d.anchor=null,d.isOpen&&(d.isOpen=!1,this._signal("hide"));},d.tryShow=function(c,g,A,T){if(!T&&d.isOpen&&d.anchorPos&&d.anchor&&d.anchorPos.top===c.top&&d.anchorPos.left===c.left&&d.anchor===A)return !0;var E=this.container,_=window.innerHeight,O=window.innerWidth,I=this.renderer,N=I.$maxLines*g*1.4,F={top:0,bottom:0,left:0},D=_-c.top-3*this.$borderSize-g,W=c.top-3*this.$borderSize;A||(W<=D||D>=N?A="bottom":A="top"),A==="top"?(F.bottom=c.top-this.$borderSize,F.top=F.bottom-N):A==="bottom"&&(F.top=c.top+g+this.$borderSize,F.bottom=F.top+N);var B=F.top>=0&&F.bottom<=_;if(!T&&!B)return !1;B?I.$maxPixelHeight=null:A==="top"?I.$maxPixelHeight=W:I.$maxPixelHeight=D,A==="top"?(E.style.top="",E.style.bottom=_-F.bottom+"px",d.isTopdown=!1):(E.style.top=F.top+"px",E.style.bottom="",d.isTopdown=!0),E.style.display="";var z=c.left;return z+E.offsetWidth>O&&(z=O-E.offsetWidth),E.style.left=z+"px",E.style.right="",d.isOpen||(d.isOpen=!0,this._signal("show"),v=null),d.anchorPos=c,d.anchor=A,!0},d.show=function(c,g,A){this.tryShow(c,g,A?"bottom":void 0,!0);},d.goTo=function(c){var g=this.getRow(),A=this.session.getLength()-1;switch(c){case"up":g=g<=0?A:g-1;break;case"down":g=g>=A?-1:g+1;break;case"start":g=0;break;case"end":g=A;break}this.setRow(g);},d.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},d.$imageSize=0,d.$borderSize=1,d}return S}();r.importCssString(`
989
+ }`,"snippets.css",!1),M.snippetManager=new a;var $=k("./editor").Editor;(function(){this.insertSnippet=function(d,h){return M.snippetManager.insertSnippet(this,d,h)},this.expandSnippet=function(d){return M.snippetManager.expandWithTab(this,d)};}).call($.prototype);});ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],function(k,M,H){var R=k("../virtual_renderer").VirtualRenderer,L=k("../editor").Editor,x=k("../range").Range,s=k("../lib/event"),c=k("../lib/lang"),r=k("../lib/dom"),t=k("../config").nls,i=k("./../lib/useragent"),n=function(S){return "suggest-aria-id:".concat(S)},e=i.isSafari?"menu":"listbox",o=i.isSafari?"menuitem":"option",a=i.isSafari?"aria-current":"aria-selected",u=function(S){var m=new R(S);m.$maxLines=4;var $=new L(m);return $.setHighlightActiveLine(!1),$.setShowPrintMargin(!1),$.renderer.setShowGutter(!1),$.renderer.setHighlightGutterLine(!1),$.$mouseHandler.$focusTimeout=0,$.$highlightTagPending=!0,$},w=function(){function S(m){var $=r.createElement("div"),d=u($);m&&m.appendChild($),$.style.display="none",d.renderer.content.style.cursor="default",d.renderer.setStyle("ace_autocomplete"),d.renderer.$textLayer.element.setAttribute("role",e),d.renderer.$textLayer.element.setAttribute("aria-roledescription",t("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),d.renderer.$textLayer.element.setAttribute("aria-label",t("autocomplete.popup.aria-label","Autocomplete suggestions")),d.renderer.textarea.setAttribute("aria-hidden","true"),d.setOption("displayIndentGuides",!1),d.setOption("dragDelay",150);var h=function(){};d.focus=h,d.$isFocused=!0,d.renderer.$cursorLayer.restartTimer=h,d.renderer.$cursorLayer.element.style.opacity="0",d.renderer.$maxLines=8,d.renderer.$keepTextAreaAtCursor=!1,d.setHighlightActiveLine(!1),d.session.highlight(""),d.session.$searchHighlight.clazz="ace_highlight-marker",d.on("mousedown",function(l){var g=l.getDocumentPosition();d.selection.moveToPosition(g),y.start.row=y.end.row=g.row,l.stop();});var v,C=new x(-1,0,-1,1/0),y=new x(-1,0,-1,1/0);y.id=d.session.addMarker(y,"ace_active-line","fullLine"),d.setSelectOnHover=function(l){l?C.id&&(d.session.removeMarker(C.id),C.id=null):C.id=d.session.addMarker(C,"ace_line-hover","fullLine");},d.setSelectOnHover(!1),d.on("mousemove",function(l){if(!v){v=l;return}if(!(v.x==l.x&&v.y==l.y)){v=l,v.scrollTop=d.renderer.scrollTop,d.isMouseOver=!0;var g=v.getDocumentPosition().row;C.start.row!=g&&(C.id||d.setRow(g),f(g));}}),d.renderer.on("beforeRender",function(){if(v&&C.start.row!=-1){v.$pos=null;var l=v.getDocumentPosition().row;C.id||d.setRow(l),f(l,!0);}}),d.renderer.on("afterRender",function(){var l=d.getRow(),g=d.renderer.$textLayer,A=g.element.childNodes[l-g.config.firstRow],T=document.activeElement;if(A!==d.selectedNode&&d.selectedNode&&(r.removeCssClass(d.selectedNode,"ace_selected"),T.removeAttribute("aria-activedescendant"),d.selectedNode.removeAttribute(a),d.selectedNode.removeAttribute("id")),d.selectedNode=A,A){r.addCssClass(A,"ace_selected");var E=n(l);A.id=E,g.element.setAttribute("aria-activedescendant",E),T.setAttribute("aria-activedescendant",E),A.setAttribute("role",o),A.setAttribute("aria-roledescription",t("autocomplete.popup.item.aria-roledescription","item")),A.setAttribute("aria-label",d.getData(l).caption||d.getData(l).value),A.setAttribute("aria-setsize",d.data.length),A.setAttribute("aria-posinset",l+1),A.setAttribute("aria-describedby","doc-tooltip"),A.setAttribute(a,"true");}});var b=function(){f(-1);},f=function(l,g){l!==C.start.row&&(C.start.row=C.end.row=l,g||d.session._emit("changeBackMarker"),d._emit("changeHoverMarker"));};d.getHoveredRow=function(){return C.start.row},s.addListener(d.container,"mouseout",function(){d.isMouseOver=!1,b();}),d.on("hide",b),d.on("changeSelection",b),d.session.doc.getLength=function(){return d.data.length},d.session.doc.getLine=function(l){var g=d.data[l];return typeof g=="string"?g:g&&g.value||""};var p=d.session.bgTokenizer;return p.$tokenizeRow=function(l){var g=d.data[l],A=[];if(!g)return A;typeof g=="string"&&(g={value:g});var T=g.caption||g.value||g.name;function E(B,z){B&&A.push({type:(g.className||"")+(z||""),value:B});}for(var _=T.toLowerCase(),O=(d.filterText||"").toLowerCase(),I=0,N=0,F=0;F<=O.length;F++)if(F!=N&&(g.matchMask&1<<F||F==O.length)){var D=O.slice(N,F);N=F;var W=_.indexOf(D,I);if(W==-1)continue;E(T.slice(I,W),""),I=W+D.length,E(T.slice(W,I),"completion-highlight");}return E(T.slice(I,T.length),""),A.push({type:"completion-spacer",value:" "}),g.meta&&A.push({type:"completion-meta",value:g.meta}),g.message&&A.push({type:"completion-message",value:g.message}),A},p.$updateOnChange=h,p.start=h,d.session.$computeWidth=function(){return this.screenWidth=0},d.isOpen=!1,d.isTopdown=!1,d.autoSelect=!0,d.filterText="",d.isMouseOver=!1,d.data=[],d.setData=function(l,g){d.filterText=g||"",d.setValue(c.stringRepeat(`
990
+ `,l.length),-1),d.data=l||[],d.setRow(0);},d.getData=function(l){return d.data[l]},d.getRow=function(){return y.start.row},d.setRow=function(l){l=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,l)),y.start.row!=l&&(d.selection.clearSelection(),y.start.row=y.end.row=l||0,d.session._emit("changeBackMarker"),d.moveCursorTo(l||0,0),d.isOpen&&d._signal("select"));},d.on("changeSelection",function(){d.isOpen&&d.setRow(d.selection.lead.row),d.renderer.scrollCursorIntoView();}),d.hide=function(){this.container.style.display="none",d.anchorPos=null,d.anchor=null,d.isOpen&&(d.isOpen=!1,this._signal("hide"));},d.tryShow=function(l,g,A,T){if(!T&&d.isOpen&&d.anchorPos&&d.anchor&&d.anchorPos.top===l.top&&d.anchorPos.left===l.left&&d.anchor===A)return !0;var E=this.container,_=window.innerHeight,O=window.innerWidth,I=this.renderer,N=I.$maxLines*g*1.4,F={top:0,bottom:0,left:0},D=_-l.top-3*this.$borderSize-g,W=l.top-3*this.$borderSize;A||(W<=D||D>=N?A="bottom":A="top"),A==="top"?(F.bottom=l.top-this.$borderSize,F.top=F.bottom-N):A==="bottom"&&(F.top=l.top+g+this.$borderSize,F.bottom=F.top+N);var B=F.top>=0&&F.bottom<=_;if(!T&&!B)return !1;B?I.$maxPixelHeight=null:A==="top"?I.$maxPixelHeight=W:I.$maxPixelHeight=D,A==="top"?(E.style.top="",E.style.bottom=_-F.bottom+"px",d.isTopdown=!1):(E.style.top=F.top+"px",E.style.bottom="",d.isTopdown=!0),E.style.display="";var z=l.left;return z+E.offsetWidth>O&&(z=O-E.offsetWidth),E.style.left=z+"px",E.style.right="",d.isOpen||(d.isOpen=!0,this._signal("show"),v=null),d.anchorPos=l,d.anchor=A,!0},d.show=function(l,g,A){this.tryShow(l,g,A?"bottom":void 0,!0);},d.goTo=function(l){var g=this.getRow(),A=this.session.getLength()-1;switch(l){case"up":g=g<=0?A:g-1;break;case"down":g=g>=A?-1:g+1;break;case"start":g=0;break;case"end":g=A;break}this.setRow(g);},d.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},d.$imageSize=0,d.$borderSize=1,d}return S}();r.importCssString(`
990
991
  .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {
991
992
  background-color: #CAD6FA;
992
993
  z-index: 1;
@@ -1078,7 +1079,7 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
1078
1079
  animation: none;
1079
1080
  }
1080
1081
  }
1081
- `,"autocompletion.css",!1),M.AcePopup=w,M.$singleLineEditor=u,M.getAriaId=n;});ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(k,M,H){var R=function(){function L(x){this.editor=x,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv);}return L.prototype.setScreenReaderContent=function(x){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var l=this.popup.getRow(),r=this.popup.renderer.$textLayer,e=r.element.childNodes[l-r.config.firstRow];if(e){for(var i="doc-tooltip ",n=0;n<this._lines.length;n++)i+="ace-inline-screenreader-line-".concat(n," ");e.setAttribute("aria-describedby",i);}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=x.split(/\r\n|\r|\n/);var s=this.createCodeBlock();this.screenReaderDiv.appendChild(s);},L.prototype.destroy=function(){this.screenReaderDiv.remove();},L.prototype.createCodeBlock=function(){var x=document.createElement("pre");x.setAttribute("id","ace-inline-screenreader");for(var s=0;s<this._lines.length;s++){var l=document.createElement("code");l.setAttribute("id","ace-inline-screenreader-line-".concat(s));var r=document.createTextNode(this._lines[s]);l.appendChild(r),x.appendChild(l);}return x},L}();M.AceInlineScreenReader=R;});ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(k,M,H){var R=k("../snippets").snippetManager,L=k("./inline_screenreader").AceInlineScreenReader,x=function(){function s(){this.editor=null;}return s.prototype.show=function(l,r,e){if(e=e||"",l&&this.editor&&this.editor!==l&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!l||!r)return !1;this.inlineScreenReader||(this.inlineScreenReader=new L(l));var i=r.snippet?R.getDisplayTextForSnippet(l,r.snippet):r.value;return r.hideInlinePreview||!i||!i.startsWith(e)?!1:(this.editor=l,this.inlineScreenReader.setScreenReaderContent(i),i=i.slice(e.length),i===""?l.removeGhostText():l.setGhostText(i),!0)},s.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},s.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},s.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null);},s}();M.AceInline=x;});ace.define("ace/autocomplete/util",["require","exports","module"],function(k,M,H){M.parForEach=function(L,x,s){var l=0,r=L.length;r===0&&s();for(var e=0;e<r;e++)x(L[e],function(i,n){l++,l===r&&s(i,n);});};var R=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;M.retrievePrecedingIdentifier=function(L,x,s){s=s||R;for(var l=[],r=x-1;r>=0&&s.test(L[r]);r--)l.push(L[r]);return l.reverse().join("")},M.retrieveFollowingIdentifier=function(L,x,s){s=s||R;for(var l=[],r=x;r<L.length&&s.test(L[r]);r++)l.push(L[r]);return l},M.getCompletionPrefix=function(L){var x=L.getCursorPosition(),s=L.session.getLine(x.row),l;return L.completers.forEach(function(r){r.identifierRegexps&&r.identifierRegexps.forEach(function(e){!l&&e&&(l=this.retrievePrecedingIdentifier(s,x.column,e));}.bind(this));}.bind(this)),l||this.retrievePrecedingIdentifier(s,x.column)},M.triggerAutocomplete=function(L,s){var s=s??L.session.getPrecedingCharacter();return L.completers.some(function(l){if(l.triggerCharacters&&Array.isArray(l.triggerCharacters))return l.triggerCharacters.includes(s)})};});ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(k,M,H){var R=k("./keyboard/hash_handler").HashHandler,L=k("./autocomplete/popup").AcePopup,x=k("./autocomplete/inline").AceInline,s=k("./autocomplete/popup").getAriaId,l=k("./autocomplete/util"),r=k("./lib/lang"),e=k("./lib/dom"),i=k("./snippets").snippetManager,n=k("./config"),t=k("./lib/event"),o=k("./lib/scroll").preventParentScroll,a=function(m,$){$.completer&&$.completer.destroy();},u=function(){function m(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new R,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0);}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=r.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=r.delayedCall(function(){this.stickySelection=!0;}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=r.delayedCall(function(){var $=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!$||this.editor.completers.length===0||(this.completions=new S(m.completionsForLoading),this.openPopup(this.editor,$.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0));}.bind(this),this.stickySelectionDelay);}return Object.defineProperty(m,"completionsForLoading",{get:function(){return [{caption:n.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),m.prototype.$init=function(){return this.popup=new L(this.parentNode||document.body||document.documentElement),this.popup.on("click",function($){this.insertMatch(),$.stop();}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),t.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},m.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new x,this.inlineRenderer},m.prototype.getPopup=function(){return this.popup||this.$init()},m.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1;},m.prototype.$seen=function($){!this.hasSeen.has($)&&$&&$.completer&&$.completer.onSeen&&typeof $.completer.onSeen=="function"&&($.completer.onSeen(this.editor,$),this.hasSeen.add($));},m.prototype.$onPopupChange=function($){if(this.inlineRenderer&&this.inlineEnabled){var d=$?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(d),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule();}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null);},m.prototype.$updateGhostText=function($){var d=this.base.row,h=this.base.column,v=this.editor.getCursorPosition().column,C=this.editor.session.getLine(d).slice(h,v);this.inlineRenderer.show(this.editor,$,C)?this.$seen($):this.inlineRenderer.hide();},m.prototype.$onPopupRender=function(){var $=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var d=this.popup.getFirstVisibleRow();d<=this.popup.getLastVisibleRow();d++){var h=this.popup.getData(d);h&&(!$||h.hideInlinePreview)&&this.$seen(h);}},m.prototype.$onPopupShow=function($){this.$onPopupChange($),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay);},m.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var $=this.editor.container.parentNode,d=[];$;)d.push($),$.addEventListener("scroll",this.onLayoutChange,{passive:!0}),$=$.parentNode;this.$elements=d;}},m.prototype.unObserveLayoutChanges=function(){var $=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(d){d.removeEventListener("scroll",$.onLayoutChange,{passive:!0});}),this.$elements=null;},m.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip();},m.prototype.$updatePopupPosition=function(){var $=this.editor,d=$.renderer,h=d.layerConfig.lineHeight,v=d.$cursorLayer.getPixelPosition(this.base,!0);v.left-=this.popup.getTextLeftOffset();var C=$.container.getBoundingClientRect();v.top+=C.top-d.layerConfig.offset,v.left+=C.left-$.renderer.scrollLeft,v.left+=d.gutterWidth;var y={top:v.top,left:v.left};d.$ghostText&&d.$ghostTextWidget&&this.base.row===d.$ghostText.position.row&&(y.top+=d.$ghostTextWidget.el.offsetHeight);var b=$.container.getBoundingClientRect().bottom-h,f=b<y.top?{top:b,left:y.left}:y;this.popup.tryShow(f,h,"bottom")||this.popup.tryShow(v,h,"top")||this.popup.show(v,h);},m.prototype.openPopup=function($,d,h){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var v=this.popup.getRow(),C=this.popup.data[v];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:s(this.popup.getRow()),inline:this.inlineEnabled}),$.keyBinding.addKeyboardHandler(this.keyboardHandler);var y;this.stickySelection&&(y=this.popup.data.indexOf(C)),(!y||y===-1)&&(y=0),this.popup.setRow(this.autoSelect?y:-1),y===v&&C!==this.completions.filtered[y]&&this.$onPopupChange();var b=this.inlineRenderer&&this.inlineEnabled;if(y===v&&b){var f=this.popup.getData(this.popup.getRow());this.$updateGhostText(f);}h||(this.popup.setTheme($.getTheme()),this.popup.setFontSize($.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges();},m.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges();},m.prototype.changeListener=function($){var d=this.editor.selection.lead;(d.row!=this.base.row||d.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach();},m.prototype.blurListener=function($){var d=document.activeElement,h=this.editor.textInput.getElement(),v=$.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains($.relatedTarget),C=this.popup&&this.popup.container;d!=h&&d.parentNode!=C&&!v&&d!=this.tooltipNode&&$.relatedTarget!=h&&this.detach();},m.prototype.mousedownListener=function($){this.detach();},m.prototype.mousewheelListener=function($){this.popup&&!this.popup.isMouseOver&&this.detach();},m.prototype.mouseOutListener=function($){this.popup.isOpen&&this.$updatePopupPosition();},m.prototype.goTo=function($){this.popup.goTo($);},m.prototype.insertMatch=function($,d){if($||($=this.popup.getData(this.popup.getRow())),!$)return !1;if($.value==="")return this.detach();var h=this.completions,v=this.getCompletionProvider().insertMatch(this.editor,$,h.filterText,d);return this.completions==h&&this.detach(),v},m.prototype.showPopup=function($,d){this.editor&&this.detach(),this.activated=!0,this.editor=$,$.completer!=this&&($.completer&&$.completer.detach(),$.completer=this),$.on("changeSelection",this.changeListener),$.on("blur",this.blurListener),$.on("mousedown",this.mousedownListener),$.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,d);},m.prototype.getCompletionProvider=function($){return this.completionProvider||(this.completionProvider=new w($)),this.completionProvider},m.prototype.gatherCompletions=function($,d){return this.getCompletionProvider().gatherCompletions($,d)},m.prototype.updateCompletions=function($,d){if($&&this.base&&this.completions){var v=this.editor.getCursorPosition(),C=this.editor.session.getTextRange({start:this.base,end:v});if(C==this.completions.filterText)return;if(this.completions.setFilter(C),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==C&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,C,$);return}if(d&&d.matches){var v=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(v.row,v.column),this.base.$insertRight=!0,this.completions=new S(d.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",$)}var h=this.editor.getSession(),v=this.editor.getCursorPosition(),C=l.getCompletionPrefix(this.editor);this.base=h.doc.createAnchor(v.row,v.column-C.length),this.base.$insertRight=!0;var y={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:C,pos:v}).provideCompletions(this.editor,y,function(b,f,p){var c=f.filtered,g=l.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),p){if(!c.length){var A=!this.autoShown&&this.emptyMessage;if(typeof A=="function"&&(A=this.emptyMessage(g)),A){var T=[{caption:A,value:""}];this.completions=new S(T),this.openPopup(this.editor,g,$),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(c.length==1&&c[0].value==g&&!c[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&c.length==1)return this.insertMatch(c[0])}this.completions=!p&&this.showLoadingState?new S(m.completionsForLoading.concat(c),f.filterText):f,this.openPopup(this.editor,g,$),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!p);}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2);},m.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu();},m.prototype.updateDocTooltip=function(){var $=this.popup,d=this.completions.filtered,h=d&&(d[$.getHoveredRow()]||d[$.getRow()]),v=null;if(!h||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var C=this.editor.completers.length,y=0;y<C;y++){var b=this.editor.completers[y];if(b.getDocTooltip&&h.completerId===b.id){v=b.getDocTooltip(h);break}}if(!v&&typeof h!="string"&&(v=h),typeof v=="string"&&(v={docText:v}),!v||!(v.docHTML||v.docText))return this.hideDocTooltip();this.showDocTooltip(v);},m.prototype.showDocTooltip=function($){this.tooltipNode||(this.tooltipNode=e.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",o));var d=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(d.isDark?"ace_dark ":"")+(d.cssClass||"");var h=this.tooltipNode;$.docHTML?h.innerHTML=$.docHTML:$.docText&&(h.textContent=$.docText),h.parentNode||this.popup.container.appendChild(this.tooltipNode);var v=this.popup,C=v.container.getBoundingClientRect();h.style.top=v.container.style.top,h.style.bottom=v.container.style.bottom,h.style.display="block",window.innerWidth-C.right<320?C.left<320?v.isTopdown?(h.style.top=C.bottom+"px",h.style.left=C.left+"px",h.style.right="",h.style.bottom=""):(h.style.top=v.container.offsetTop-h.offsetHeight+"px",h.style.left=C.left+"px",h.style.right="",h.style.bottom=""):(h.style.right=window.innerWidth-C.left+"px",h.style.left=""):(h.style.left=C.right+1+"px",h.style.right="");},m.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var $=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==$&&this.editor.focus(),this.tooltipNode=null,$.parentNode&&$.parentNode.removeChild($);}},m.prototype.onTooltipClick=function($){for(var d=$.target;d&&d!=this.tooltipNode;){if(d.nodeName=="A"&&d.href){d.rel="noreferrer",d.target="_blank";break}d=d.parentNode;}},m.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var $=this.popup.container;$&&$.parentNode&&$.parentNode.removeChild($);}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",a),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null;},m}();u.prototype.commands={Up:function(m){m.completer.goTo("up");},Down:function(m){m.completer.goTo("down");},"Ctrl-Up|Ctrl-Home":function(m){m.completer.goTo("start");},"Ctrl-Down|Ctrl-End":function(m){m.completer.goTo("end");},Esc:function(m){m.completer.detach();},Return:function(m){return m.completer.insertMatch()},"Shift-Return":function(m){m.completer.insertMatch(null,{deleteSuffix:!0});},Tab:function(m){var $=m.completer.insertMatch();if(!$&&!m.tabstopManager)m.completer.goTo("down");else return $},Backspace:function(m){m.execCommand("backspace");var $=l.getCompletionPrefix(m);!$&&m.completer&&m.completer.detach();},PageUp:function(m){m.completer.popup.gotoPageUp();},PageDown:function(m){m.completer.popup.gotoPageDown();}},u.for=function(m){return m.completer instanceof u||(m.completer&&(m.completer.destroy(),m.completer=null),n.get("sharedPopups")?(u.$sharedInstance||(u.$sharedInstance=new u),m.completer=u.$sharedInstance):(m.completer=new u,m.once("destroy",a))),m.completer},u.startCommand={name:"startAutocomplete",exec:function(m,$){var d=u.for(m);d.autoInsert=!1,d.autoSelect=!0,d.autoShown=!1,d.showPopup(m,$),d.cancelContextMenu();},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var w=function(){function m($){this.initialPosition=$,this.active=!0;}return m.prototype.insertByIndex=function($,d,h){return !this.completions||!this.completions.filtered?!1:this.insertMatch($,this.completions.filtered[d],h)},m.prototype.insertMatch=function($,d,h){if(!d)return !1;if($.startOperation({command:{name:"insertMatch"}}),d.completer&&d.completer.insertMatch)d.completer.insertMatch($,d);else {if(!this.completions)return !1;var v=this.completions.filterText.length,C=0;if(d.range&&d.range.start.row===d.range.end.row&&(v-=this.initialPosition.prefix.length,v+=this.initialPosition.pos.column-d.range.start.column,C+=d.range.end.column-this.initialPosition.pos.column),v||C){var y;$.selection.getAllRanges?y=$.selection.getAllRanges():y=[$.getSelectionRange()];for(var b=0,f;f=y[b];b++)f.start.column-=v,f.end.column+=C,$.session.remove(f);}d.snippet?i.insertSnippet($,d.snippet):this.$insertString($,d),d.completer&&d.completer.onInsert&&typeof d.completer.onInsert=="function"&&d.completer.onInsert($,d),d.command&&d.command==="startAutocomplete"&&$.execCommand(d.command);}return $.endOperation(),!0},m.prototype.$insertString=function($,d){var h=d.value||d;$.execCommand("insertstring",h);},m.prototype.gatherCompletions=function($,d){var h=$.getSession(),v=$.getCursorPosition(),C=l.getCompletionPrefix($),y=[];this.completers=$.completers;var b=$.completers.length;return $.completers.forEach(function(f,p){f.getCompletions($,h,v,C,function(c,g){f.hideInlinePreview&&(g=g.map(function(A){return Object.assign(A,{hideInlinePreview:f.hideInlinePreview})})),!c&&g&&(y=y.concat(g)),d(null,{prefix:l.getCompletionPrefix($),matches:y,finished:--b===0});});}),!0},m.prototype.provideCompletions=function($,d,h){var v=function(f){var p=f.prefix,c=f.matches;this.completions=new S(c),d.exactMatch&&(this.completions.exactMatch=!0),d.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(p),(f.finished||this.completions.filtered.length)&&h(null,this.completions,f.finished);}.bind(this),C=!0,y=null;if(this.gatherCompletions($,function(f,p){if(this.active){f&&(h(f,[],!0),this.detach());var c=p.prefix;if(c.indexOf(p.prefix)===0){if(C){y=p;return}v(p);}}}.bind(this)),C=!1,y){var b=y;y=null,v(b);}},m.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function($){typeof $.cancel=="function"&&$.cancel();});},m}(),S=function(){function m($,d){this.all=$,this.filtered=$,this.filterText=d||"",this.exactMatch=!1,this.ignoreCaption=!1;}return m.prototype.setFilter=function($){if($.length>this.filterText&&$.lastIndexOf(this.filterText,0)===0)var d=this.filtered;else var d=this.all;this.filterText=$,d=this.filterCompletions(d,this.filterText),d=d.sort(function(v,C){return C.exactMatch-v.exactMatch||C.$score-v.$score||(v.caption||v.value).localeCompare(C.caption||C.value)});var h=null;d=d.filter(function(v){var C=v.snippet||v.caption||v.value;return C===h?!1:(h=C,!0)}),this.filtered=d;},m.prototype.filterCompletions=function($,d){var h=[],v=d.toUpperCase(),C=d.toLowerCase();e:for(var y=0,b;b=$[y];y++){var f=!this.ignoreCaption&&b.caption||b.value||b.snippet;if(f){var p=-1,c=0,g=0,A,T;if(this.exactMatch){if(d!==f.substr(0,d.length))continue e}else {var E=f.toLowerCase().indexOf(C);if(E>-1)g=E;else for(var _=0;_<d.length;_++){var O=f.indexOf(C[_],p+1),I=f.indexOf(v[_],p+1);if(A=O>=0&&(I<0||O<I)?O:I,A<0)continue e;T=A-p-1,T>0&&(p===-1&&(g+=10),g+=T,c=c|1<<_),p=A;}}b.matchMask=c,b.exactMatch=g?0:1,b.$score=(b.score||0)-g,h.push(b);}}return h},m}();M.Autocomplete=u,M.CompletionProvider=w,M.FilteredList=S;});ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(k,M,H){var R=k("../range").Range,L=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function x(l,r){var e=l.getTextRange(R.fromPoints({row:0,column:0},r));return e.split(L).length-1}function s(l,r){var e=x(l,r),i=l.getValue().split(L),n=Object.create(null),t=i[e];return i.forEach(function(o,a){if(!(!o||o===t)){var u=Math.abs(e-a),w=i.length-u;n[o]?n[o]=Math.max(w,n[o]):n[o]=w;}}),n}M.getCompletions=function(l,r,e,i,n){var t=s(r,e),o=Object.keys(t);n(null,o.map(function(a){return {caption:a,value:a,score:t[a],meta:"local"}}));};});ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(k,M,H){var R=k("../snippets").snippetManager,L=k("../autocomplete").Autocomplete,x=k("../config"),s=k("../lib/lang"),l=k("../autocomplete/util"),r=k("../autocomplete/text_completer"),e={getCompletions:function(v,C,y,b,f){if(C.$mode.completer)return C.$mode.completer.getCompletions(v,C,y,b,f);var p=v.session.getState(y.row),c=C.$mode.getCompletions(p,C,y,b);c=c.map(function(g){return g.completerId=e.id,g}),f(null,c);},id:"keywordCompleter"},i=function(v){var C={};return v.replace(/\${(\d+)(:(.*?))?}/g,function(y,b,f,p){return C[b]=p||""}).replace(/\$(\d+?)/g,function(y,b){return C[b]})},n={getCompletions:function(v,C,y,b,f){var p=[],c=C.getTokenAt(y.row,y.column);c&&c.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?p.push("html-tag"):p=R.getActiveScopes(v);var g=R.snippetMap,A=[];p.forEach(function(T){for(var E=g[T]||[],_=E.length;_--;){var O=E[_],I=O.name||O.tabTrigger;I&&A.push({caption:I,snippet:O.content,meta:O.tabTrigger&&!O.name?O.tabTrigger+"\u21E5 ":"snippet",completerId:n.id});}},this),f(null,A);},getDocTooltip:function(v){v.snippet&&!v.docHTML&&(v.docHTML=["<b>",s.escapeHTML(v.caption),"</b>","<hr></hr>",s.escapeHTML(i(v.snippet))].join(""));},id:"snippetCompleter"},t=[n,r,e];M.setCompleters=function(v){t.length=0,v&&t.push.apply(t,v);},M.addCompleter=function(v){t.push(v);},M.textCompleter=r,M.keyWordCompleter=e,M.snippetCompleter=n;var o={name:"expandSnippet",exec:function(v){return R.expandWithTab(v)},bindKey:"Tab"},a=function(v,C){u(C.session.$mode);},u=function(v){typeof v=="string"&&(v=x.$modes[v]),v&&(R.files||(R.files={}),w(v.$id,v.snippetFileId),v.modes&&v.modes.forEach(u));},w=function(v,C){!C||!v||R.files[v]||(R.files[v]={},x.loadModule(C,function(y){y&&(R.files[v]=y,!y.snippets&&y.snippetText&&(y.snippets=R.parseSnippetFile(y.snippetText)),R.register(y.snippets||[],y.scope),y.includeScopes&&(R.snippetMap[y.scope].includeScopes=y.includeScopes,y.includeScopes.forEach(function(b){u("ace/mode/"+b);})));}));},S=function(v){var C=v.editor,y=C.completer&&C.completer.activated;if(v.command.name==="backspace")y&&!l.getCompletionPrefix(C)&&C.completer.detach();else if(v.command.name==="insertstring"&&!y){m=v;var b=v.editor.$liveAutocompletionDelay;b?$.delay(b):d(v);}},m,$=s.delayedCall(function(){d(m);},0),d=function(v){var C=v.editor,y=l.getCompletionPrefix(C),b=v.args,f=l.triggerAutocomplete(C,b);if(y&&y.length>=C.$liveAutocompletionThreshold||f){var p=L.for(C);p.autoShown=!0,p.showPopup(C);}},h=k("../editor").Editor;k("../config").defineOptions(h.prototype,"editor",{enableBasicAutocompletion:{set:function(v){v?(this.completers||(this.completers=Array.isArray(v)?v:t),this.commands.addCommand(L.startCommand)):this.commands.removeCommand(L.startCommand);},value:!1},enableLiveAutocompletion:{set:function(v){v?(this.completers||(this.completers=Array.isArray(v)?v:t),this.commands.on("afterExec",S)):this.commands.off("afterExec",S);},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(v){v?(this.commands.addCommand(o),this.on("changeMode",a),a(null,this)):(this.commands.removeCommand(o),this.off("changeMode",a));},value:!1}});});(function(){ace.require(["ace/ext/language_tools"],function(k){typeof _e=="object"&&typeof at=="object"&&_e&&(_e.exports=k);});})();});var ht=a((ct,Ie)=>{ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(k,M,H){var R=k("../lib/oop"),L=k("./text_highlight_rules").TextHighlightRules,x=function(){var s="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with",l="true|false",r="avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",e="int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string",i=this.createKeywordMapper({"support.function":r,keyword:s,"constant.language":l,"storage.type":e},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules();};R.inherits(x,L),M.SqlHighlightRules=x;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(k,M,H){var R=k("../../lib/oop"),L=k("../../range").Range,x=k("./fold_mode").FoldMode,s=M.FoldMode=function(l){l&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+l.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+l.end)));};R.inherits(s,x),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(l,r,e){var i=l.getLine(e);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return "";var n=this._getFoldWidgetBase(l,r,e);return !n&&this.startRegionRe.test(i)?"start":n},this.getFoldWidgetRange=function(l,r,e,i){var n=l.getLine(e);if(this.startRegionRe.test(n))return this.getCommentRegionBlock(l,n,e);var a=n.match(this.foldingStartMarker);if(a){var t=a.index;if(a[1])return this.openingBracketBlock(l,a[1],e,t);var o=l.getCommentFoldRange(e,t+a[0].length,1);return o&&!o.isMultiLine()&&(i?o=this.getSectionRange(l,e):r!="all"&&(o=null)),o}if(r!=="markbegin"){var a=n.match(this.foldingStopMarker);if(a){var t=a.index+a[0].length;return a[1]?this.closingBracketBlock(l,a[1],e,t):l.getCommentFoldRange(e,t,-1)}}},this.getSectionRange=function(l,r){var e=l.getLine(r),i=e.search(/\S/),n=r,t=e.length;r=r+1;for(var o=r,a=l.getLength();++r<a;){e=l.getLine(r);var u=e.search(/\S/);if(u!==-1){if(i>u)break;var w=this.getFoldWidgetRange(l,"all",r);if(w){if(w.start.row<=n)break;if(w.isMultiLine())r=w.end.row;else if(i==u)break}o=r;}}return new L(n,t,o,l.getLine(o).length)},this.getCommentRegionBlock=function(l,r,e){for(var i=r.search(/\s*$/),n=l.getLength(),t=e,o=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;++e<n;){r=l.getLine(e);var u=o.exec(r);if(u&&(u[1]?a--:a++,!a))break}var w=e;if(w>t)return new L(t,i,w,r.length)};}.call(s.prototype);});ace.define("ace/mode/folding/sql",["require","exports","module","ace/lib/oop","ace/mode/folding/cstyle"],function(k,M,H){var R=k("../../lib/oop"),L=k("./cstyle").FoldMode,x=M.FoldMode=function(){};R.inherits(x,L),function(){}.call(x.prototype);});ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules","ace/mode/folding/sql"],function(k,M,H){var R=k("../lib/oop"),L=k("./text").Mode,x=k("./sql_highlight_rules").SqlHighlightRules,s=k("./folding/sql").FoldMode,l=function(){this.HighlightRules=x,this.foldingRules=new s,this.$behaviour=this.$defaultBehaviour;};R.inherits(l,L),function(){this.lineCommentStart="--",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/sql",this.snippetFileId="ace/snippets/sql";}.call(l.prototype),M.Mode=l;});(function(){ace.require(["ace/mode/sql"],function(k){typeof Ie=="object"&&typeof ct=="object"&&Ie&&(Ie.exports=k);});})();});var dt=a((ut,Oe)=>{ace.define("ace/theme/chrome-css",["require","exports","module"],function(k,M,H){H.exports=`.ace-chrome .ace_gutter {
1082
+ `,"autocompletion.css",!1),M.AcePopup=w,M.$singleLineEditor=u,M.getAriaId=n;});ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],function(k,M,H){var R=function(){function L(x){this.editor=x,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv);}return L.prototype.setScreenReaderContent=function(x){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var c=this.popup.getRow(),r=this.popup.renderer.$textLayer,t=r.element.childNodes[c-r.config.firstRow];if(t){for(var i="doc-tooltip ",n=0;n<this._lines.length;n++)i+="ace-inline-screenreader-line-".concat(n," ");t.setAttribute("aria-describedby",i);}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=x.split(/\r\n|\r|\n/);var s=this.createCodeBlock();this.screenReaderDiv.appendChild(s);},L.prototype.destroy=function(){this.screenReaderDiv.remove();},L.prototype.createCodeBlock=function(){var x=document.createElement("pre");x.setAttribute("id","ace-inline-screenreader");for(var s=0;s<this._lines.length;s++){var c=document.createElement("code");c.setAttribute("id","ace-inline-screenreader-line-".concat(s));var r=document.createTextNode(this._lines[s]);c.appendChild(r),x.appendChild(c);}return x},L}();M.AceInlineScreenReader=R;});ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],function(k,M,H){var R=k("../snippets").snippetManager,L=k("./inline_screenreader").AceInlineScreenReader,x=function(){function s(){this.editor=null;}return s.prototype.show=function(c,r,t){if(t=t||"",c&&this.editor&&this.editor!==c&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!c||!r)return !1;this.inlineScreenReader||(this.inlineScreenReader=new L(c));var i=r.snippet?R.getDisplayTextForSnippet(c,r.snippet):r.value;return r.hideInlinePreview||!i||!i.startsWith(t)?!1:(this.editor=c,this.inlineScreenReader.setScreenReaderContent(i),i=i.slice(t.length),i===""?c.removeGhostText():c.setGhostText(i),!0)},s.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},s.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},s.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null);},s}();M.AceInline=x;});ace.define("ace/autocomplete/util",["require","exports","module"],function(k,M,H){M.parForEach=function(L,x,s){var c=0,r=L.length;r===0&&s();for(var t=0;t<r;t++)x(L[t],function(i,n){c++,c===r&&s(i,n);});};var R=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;M.retrievePrecedingIdentifier=function(L,x,s){s=s||R;for(var c=[],r=x-1;r>=0&&s.test(L[r]);r--)c.push(L[r]);return c.reverse().join("")},M.retrieveFollowingIdentifier=function(L,x,s){s=s||R;for(var c=[],r=x;r<L.length&&s.test(L[r]);r++)c.push(L[r]);return c},M.getCompletionPrefix=function(L){var x=L.getCursorPosition(),s=L.session.getLine(x.row),c;return L.completers.forEach(function(r){r.identifierRegexps&&r.identifierRegexps.forEach(function(t){!c&&t&&(c=this.retrievePrecedingIdentifier(s,x.column,t));}.bind(this));}.bind(this)),c||this.retrievePrecedingIdentifier(s,x.column)},M.triggerAutocomplete=function(L,s){var s=s??L.session.getPrecedingCharacter();return L.completers.some(function(c){if(c.triggerCharacters&&Array.isArray(c.triggerCharacters))return c.triggerCharacters.includes(s)})};});ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],function(k,M,H){var R=k("./keyboard/hash_handler").HashHandler,L=k("./autocomplete/popup").AcePopup,x=k("./autocomplete/inline").AceInline,s=k("./autocomplete/popup").getAriaId,c=k("./autocomplete/util"),r=k("./lib/lang"),t=k("./lib/dom"),i=k("./snippets").snippetManager,n=k("./config"),e=k("./lib/event"),o=k("./lib/scroll").preventParentScroll,a=function(m,$){$.completer&&$.completer.destroy();},u=function(){function m(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new R,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0);}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=r.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=r.delayedCall(function(){this.stickySelection=!0;}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=r.delayedCall(function(){var $=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!$||this.editor.completers.length===0||(this.completions=new S(m.completionsForLoading),this.openPopup(this.editor,$.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0));}.bind(this),this.stickySelectionDelay);}return Object.defineProperty(m,"completionsForLoading",{get:function(){return [{caption:n.nls("autocomplete.loading","Loading..."),value:""}]},enumerable:!1,configurable:!0}),m.prototype.$init=function(){return this.popup=new L(this.parentNode||document.body||document.documentElement),this.popup.on("click",function($){this.insertMatch(),$.stop();}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),e.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},m.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new x,this.inlineRenderer},m.prototype.getPopup=function(){return this.popup||this.$init()},m.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1;},m.prototype.$seen=function($){!this.hasSeen.has($)&&$&&$.completer&&$.completer.onSeen&&typeof $.completer.onSeen=="function"&&($.completer.onSeen(this.editor,$),this.hasSeen.add($));},m.prototype.$onPopupChange=function($){if(this.inlineRenderer&&this.inlineEnabled){var d=$?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(d),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule();}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null);},m.prototype.$updateGhostText=function($){var d=this.base.row,h=this.base.column,v=this.editor.getCursorPosition().column,C=this.editor.session.getLine(d).slice(h,v);this.inlineRenderer.show(this.editor,$,C)?this.$seen($):this.inlineRenderer.hide();},m.prototype.$onPopupRender=function(){var $=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var d=this.popup.getFirstVisibleRow();d<=this.popup.getLastVisibleRow();d++){var h=this.popup.getData(d);h&&(!$||h.hideInlinePreview)&&this.$seen(h);}},m.prototype.$onPopupShow=function($){this.$onPopupChange($),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay);},m.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var $=this.editor.container.parentNode,d=[];$;)d.push($),$.addEventListener("scroll",this.onLayoutChange,{passive:!0}),$=$.parentNode;this.$elements=d;}},m.prototype.unObserveLayoutChanges=function(){var $=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach(function(d){d.removeEventListener("scroll",$.onLayoutChange,{passive:!0});}),this.$elements=null;},m.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip();},m.prototype.$updatePopupPosition=function(){var $=this.editor,d=$.renderer,h=d.layerConfig.lineHeight,v=d.$cursorLayer.getPixelPosition(this.base,!0);v.left-=this.popup.getTextLeftOffset();var C=$.container.getBoundingClientRect();v.top+=C.top-d.layerConfig.offset,v.left+=C.left-$.renderer.scrollLeft,v.left+=d.gutterWidth;var y={top:v.top,left:v.left};d.$ghostText&&d.$ghostTextWidget&&this.base.row===d.$ghostText.position.row&&(y.top+=d.$ghostTextWidget.el.offsetHeight);var b=$.container.getBoundingClientRect().bottom-h,f=b<y.top?{top:b,left:y.left}:y;this.popup.tryShow(f,h,"bottom")||this.popup.tryShow(v,h,"top")||this.popup.show(v,h);},m.prototype.openPopup=function($,d,h){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var v=this.popup.getRow(),C=this.popup.data[v];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:s(this.popup.getRow()),inline:this.inlineEnabled}),$.keyBinding.addKeyboardHandler(this.keyboardHandler);var y;this.stickySelection&&(y=this.popup.data.indexOf(C)),(!y||y===-1)&&(y=0),this.popup.setRow(this.autoSelect?y:-1),y===v&&C!==this.completions.filtered[y]&&this.$onPopupChange();var b=this.inlineRenderer&&this.inlineEnabled;if(y===v&&b){var f=this.popup.getData(this.popup.getRow());this.$updateGhostText(f);}h||(this.popup.setTheme($.getTheme()),this.popup.setFontSize($.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges();},m.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges();},m.prototype.changeListener=function($){var d=this.editor.selection.lead;(d.row!=this.base.row||d.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach();},m.prototype.blurListener=function($){var d=document.activeElement,h=this.editor.textInput.getElement(),v=$.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains($.relatedTarget),C=this.popup&&this.popup.container;d!=h&&d.parentNode!=C&&!v&&d!=this.tooltipNode&&$.relatedTarget!=h&&this.detach();},m.prototype.mousedownListener=function($){this.detach();},m.prototype.mousewheelListener=function($){this.popup&&!this.popup.isMouseOver&&this.detach();},m.prototype.mouseOutListener=function($){this.popup.isOpen&&this.$updatePopupPosition();},m.prototype.goTo=function($){this.popup.goTo($);},m.prototype.insertMatch=function($,d){if($||($=this.popup.getData(this.popup.getRow())),!$)return !1;if($.value==="")return this.detach();var h=this.completions,v=this.getCompletionProvider().insertMatch(this.editor,$,h.filterText,d);return this.completions==h&&this.detach(),v},m.prototype.showPopup=function($,d){this.editor&&this.detach(),this.activated=!0,this.editor=$,$.completer!=this&&($.completer&&$.completer.detach(),$.completer=this),$.on("changeSelection",this.changeListener),$.on("blur",this.blurListener),$.on("mousedown",this.mousedownListener),$.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,d);},m.prototype.getCompletionProvider=function($){return this.completionProvider||(this.completionProvider=new w($)),this.completionProvider},m.prototype.gatherCompletions=function($,d){return this.getCompletionProvider().gatherCompletions($,d)},m.prototype.updateCompletions=function($,d){if($&&this.base&&this.completions){var v=this.editor.getCursorPosition(),C=this.editor.session.getTextRange({start:this.base,end:v});if(C==this.completions.filterText)return;if(this.completions.setFilter(C),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==C&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,C,$);return}if(d&&d.matches){var v=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(v.row,v.column),this.base.$insertRight=!0,this.completions=new S(d.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",$)}var h=this.editor.getSession(),v=this.editor.getCursorPosition(),C=c.getCompletionPrefix(this.editor);this.base=h.doc.createAnchor(v.row,v.column-C.length),this.base.$insertRight=!0;var y={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:C,pos:v}).provideCompletions(this.editor,y,function(b,f,p){var l=f.filtered,g=c.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),p){if(!l.length){var A=!this.autoShown&&this.emptyMessage;if(typeof A=="function"&&(A=this.emptyMessage(g)),A){var T=[{caption:A,value:""}];this.completions=new S(T),this.openPopup(this.editor,g,$),this.popup.renderer.setStyle("ace_loading",!1),this.popup.renderer.setStyle("ace_empty-message",!0);return}return this.detach()}if(l.length==1&&l[0].value==g&&!l[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&l.length==1)return this.insertMatch(l[0])}this.completions=!p&&this.showLoadingState?new S(m.completionsForLoading.concat(l),f.filterText):f,this.openPopup(this.editor,g,$),this.popup.renderer.setStyle("ace_empty-message",!1),this.popup.renderer.setStyle("ace_loading",!p);}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2);},m.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu();},m.prototype.updateDocTooltip=function(){var $=this.popup,d=this.completions.filtered,h=d&&(d[$.getHoveredRow()]||d[$.getRow()]),v=null;if(!h||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var C=this.editor.completers.length,y=0;y<C;y++){var b=this.editor.completers[y];if(b.getDocTooltip&&h.completerId===b.id){v=b.getDocTooltip(h);break}}if(!v&&typeof h!="string"&&(v=h),typeof v=="string"&&(v={docText:v}),!v||!(v.docHTML||v.docText))return this.hideDocTooltip();this.showDocTooltip(v);},m.prototype.showDocTooltip=function($){this.tooltipNode||(this.tooltipNode=t.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",o));var d=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(d.isDark?"ace_dark ":"")+(d.cssClass||"");var h=this.tooltipNode;$.docHTML?h.innerHTML=$.docHTML:$.docText&&(h.textContent=$.docText),h.parentNode||this.popup.container.appendChild(this.tooltipNode);var v=this.popup,C=v.container.getBoundingClientRect();h.style.top=v.container.style.top,h.style.bottom=v.container.style.bottom,h.style.display="block",window.innerWidth-C.right<320?C.left<320?v.isTopdown?(h.style.top=C.bottom+"px",h.style.left=C.left+"px",h.style.right="",h.style.bottom=""):(h.style.top=v.container.offsetTop-h.offsetHeight+"px",h.style.left=C.left+"px",h.style.right="",h.style.bottom=""):(h.style.right=window.innerWidth-C.left+"px",h.style.left=""):(h.style.left=C.right+1+"px",h.style.right="");},m.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var $=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==$&&this.editor.focus(),this.tooltipNode=null,$.parentNode&&$.parentNode.removeChild($);}},m.prototype.onTooltipClick=function($){for(var d=$.target;d&&d!=this.tooltipNode;){if(d.nodeName=="A"&&d.href){d.rel="noreferrer",d.target="_blank";break}d=d.parentNode;}},m.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var $=this.popup.container;$&&$.parentNode&&$.parentNode.removeChild($);}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",a),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null;},m}();u.prototype.commands={Up:function(m){m.completer.goTo("up");},Down:function(m){m.completer.goTo("down");},"Ctrl-Up|Ctrl-Home":function(m){m.completer.goTo("start");},"Ctrl-Down|Ctrl-End":function(m){m.completer.goTo("end");},Esc:function(m){m.completer.detach();},Return:function(m){return m.completer.insertMatch()},"Shift-Return":function(m){m.completer.insertMatch(null,{deleteSuffix:!0});},Tab:function(m){var $=m.completer.insertMatch();if(!$&&!m.tabstopManager)m.completer.goTo("down");else return $},Backspace:function(m){m.execCommand("backspace");var $=c.getCompletionPrefix(m);!$&&m.completer&&m.completer.detach();},PageUp:function(m){m.completer.popup.gotoPageUp();},PageDown:function(m){m.completer.popup.gotoPageDown();}},u.for=function(m){return m.completer instanceof u||(m.completer&&(m.completer.destroy(),m.completer=null),n.get("sharedPopups")?(u.$sharedInstance||(u.$sharedInstance=new u),m.completer=u.$sharedInstance):(m.completer=new u,m.once("destroy",a))),m.completer},u.startCommand={name:"startAutocomplete",exec:function(m,$){var d=u.for(m);d.autoInsert=!1,d.autoSelect=!0,d.autoShown=!1,d.showPopup(m,$),d.cancelContextMenu();},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var w=function(){function m($){this.initialPosition=$,this.active=!0;}return m.prototype.insertByIndex=function($,d,h){return !this.completions||!this.completions.filtered?!1:this.insertMatch($,this.completions.filtered[d],h)},m.prototype.insertMatch=function($,d,h){if(!d)return !1;if($.startOperation({command:{name:"insertMatch"}}),d.completer&&d.completer.insertMatch)d.completer.insertMatch($,d);else {if(!this.completions)return !1;var v=this.completions.filterText.length,C=0;if(d.range&&d.range.start.row===d.range.end.row&&(v-=this.initialPosition.prefix.length,v+=this.initialPosition.pos.column-d.range.start.column,C+=d.range.end.column-this.initialPosition.pos.column),v||C){var y;$.selection.getAllRanges?y=$.selection.getAllRanges():y=[$.getSelectionRange()];for(var b=0,f;f=y[b];b++)f.start.column-=v,f.end.column+=C,$.session.remove(f);}d.snippet?i.insertSnippet($,d.snippet):this.$insertString($,d),d.completer&&d.completer.onInsert&&typeof d.completer.onInsert=="function"&&d.completer.onInsert($,d),d.command&&d.command==="startAutocomplete"&&$.execCommand(d.command);}return $.endOperation(),!0},m.prototype.$insertString=function($,d){var h=d.value||d;$.execCommand("insertstring",h);},m.prototype.gatherCompletions=function($,d){var h=$.getSession(),v=$.getCursorPosition(),C=c.getCompletionPrefix($),y=[];this.completers=$.completers;var b=$.completers.length;return $.completers.forEach(function(f,p){f.getCompletions($,h,v,C,function(l,g){f.hideInlinePreview&&(g=g.map(function(A){return Object.assign(A,{hideInlinePreview:f.hideInlinePreview})})),!l&&g&&(y=y.concat(g)),d(null,{prefix:c.getCompletionPrefix($),matches:y,finished:--b===0});});}),!0},m.prototype.provideCompletions=function($,d,h){var v=function(f){var p=f.prefix,l=f.matches;this.completions=new S(l),d.exactMatch&&(this.completions.exactMatch=!0),d.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(p),(f.finished||this.completions.filtered.length)&&h(null,this.completions,f.finished);}.bind(this),C=!0,y=null;if(this.gatherCompletions($,function(f,p){if(this.active){f&&(h(f,[],!0),this.detach());var l=p.prefix;if(l.indexOf(p.prefix)===0){if(C){y=p;return}v(p);}}}.bind(this)),C=!1,y){var b=y;y=null,v(b);}},m.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function($){typeof $.cancel=="function"&&$.cancel();});},m}(),S=function(){function m($,d){this.all=$,this.filtered=$,this.filterText=d||"",this.exactMatch=!1,this.ignoreCaption=!1;}return m.prototype.setFilter=function($){if($.length>this.filterText&&$.lastIndexOf(this.filterText,0)===0)var d=this.filtered;else var d=this.all;this.filterText=$,d=this.filterCompletions(d,this.filterText),d=d.sort(function(v,C){return C.exactMatch-v.exactMatch||C.$score-v.$score||(v.caption||v.value).localeCompare(C.caption||C.value)});var h=null;d=d.filter(function(v){var C=v.snippet||v.caption||v.value;return C===h?!1:(h=C,!0)}),this.filtered=d;},m.prototype.filterCompletions=function($,d){var h=[],v=d.toUpperCase(),C=d.toLowerCase();e:for(var y=0,b;b=$[y];y++){var f=!this.ignoreCaption&&b.caption||b.value||b.snippet;if(f){var p=-1,l=0,g=0,A,T;if(this.exactMatch){if(d!==f.substr(0,d.length))continue e}else {var E=f.toLowerCase().indexOf(C);if(E>-1)g=E;else for(var _=0;_<d.length;_++){var O=f.indexOf(C[_],p+1),I=f.indexOf(v[_],p+1);if(A=O>=0&&(I<0||O<I)?O:I,A<0)continue e;T=A-p-1,T>0&&(p===-1&&(g+=10),g+=T,l=l|1<<_),p=A;}}b.matchMask=l,b.exactMatch=g?0:1,b.$score=(b.score||0)-g,h.push(b);}}return h},m}();M.Autocomplete=u,M.CompletionProvider=w,M.FilteredList=S;});ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(k,M,H){var R=k("../range").Range,L=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function x(c,r){var t=c.getTextRange(R.fromPoints({row:0,column:0},r));return t.split(L).length-1}function s(c,r){var t=x(c,r),i=c.getValue().split(L),n=Object.create(null),e=i[t];return i.forEach(function(o,a){if(!(!o||o===e)){var u=Math.abs(t-a),w=i.length-u;n[o]?n[o]=Math.max(w,n[o]):n[o]=w;}}),n}M.getCompletions=function(c,r,t,i,n){var e=s(r,t),o=Object.keys(e);n(null,o.map(function(a){return {caption:a,value:a,score:e[a],meta:"local"}}));};});ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(k,M,H){var R=k("../snippets").snippetManager,L=k("../autocomplete").Autocomplete,x=k("../config"),s=k("../lib/lang"),c=k("../autocomplete/util"),r=k("../autocomplete/text_completer"),t={getCompletions:function(v,C,y,b,f){if(C.$mode.completer)return C.$mode.completer.getCompletions(v,C,y,b,f);var p=v.session.getState(y.row),l=C.$mode.getCompletions(p,C,y,b);l=l.map(function(g){return g.completerId=t.id,g}),f(null,l);},id:"keywordCompleter"},i=function(v){var C={};return v.replace(/\${(\d+)(:(.*?))?}/g,function(y,b,f,p){return C[b]=p||""}).replace(/\$(\d+?)/g,function(y,b){return C[b]})},n={getCompletions:function(v,C,y,b,f){var p=[],l=C.getTokenAt(y.row,y.column);l&&l.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?p.push("html-tag"):p=R.getActiveScopes(v);var g=R.snippetMap,A=[];p.forEach(function(T){for(var E=g[T]||[],_=E.length;_--;){var O=E[_],I=O.name||O.tabTrigger;I&&A.push({caption:I,snippet:O.content,meta:O.tabTrigger&&!O.name?O.tabTrigger+"\u21E5 ":"snippet",completerId:n.id});}},this),f(null,A);},getDocTooltip:function(v){v.snippet&&!v.docHTML&&(v.docHTML=["<b>",s.escapeHTML(v.caption),"</b>","<hr></hr>",s.escapeHTML(i(v.snippet))].join(""));},id:"snippetCompleter"},e=[n,r,t];M.setCompleters=function(v){e.length=0,v&&e.push.apply(e,v);},M.addCompleter=function(v){e.push(v);},M.textCompleter=r,M.keyWordCompleter=t,M.snippetCompleter=n;var o={name:"expandSnippet",exec:function(v){return R.expandWithTab(v)},bindKey:"Tab"},a=function(v,C){u(C.session.$mode);},u=function(v){typeof v=="string"&&(v=x.$modes[v]),v&&(R.files||(R.files={}),w(v.$id,v.snippetFileId),v.modes&&v.modes.forEach(u));},w=function(v,C){!C||!v||R.files[v]||(R.files[v]={},x.loadModule(C,function(y){y&&(R.files[v]=y,!y.snippets&&y.snippetText&&(y.snippets=R.parseSnippetFile(y.snippetText)),R.register(y.snippets||[],y.scope),y.includeScopes&&(R.snippetMap[y.scope].includeScopes=y.includeScopes,y.includeScopes.forEach(function(b){u("ace/mode/"+b);})));}));},S=function(v){var C=v.editor,y=C.completer&&C.completer.activated;if(v.command.name==="backspace")y&&!c.getCompletionPrefix(C)&&C.completer.detach();else if(v.command.name==="insertstring"&&!y){m=v;var b=v.editor.$liveAutocompletionDelay;b?$.delay(b):d(v);}},m,$=s.delayedCall(function(){d(m);},0),d=function(v){var C=v.editor,y=c.getCompletionPrefix(C),b=v.args,f=c.triggerAutocomplete(C,b);if(y&&y.length>=C.$liveAutocompletionThreshold||f){var p=L.for(C);p.autoShown=!0,p.showPopup(C);}},h=k("../editor").Editor;k("../config").defineOptions(h.prototype,"editor",{enableBasicAutocompletion:{set:function(v){v?(this.completers||(this.completers=Array.isArray(v)?v:e),this.commands.addCommand(L.startCommand)):this.commands.removeCommand(L.startCommand);},value:!1},enableLiveAutocompletion:{set:function(v){v?(this.completers||(this.completers=Array.isArray(v)?v:e),this.commands.on("afterExec",S)):this.commands.off("afterExec",S);},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(v){v?(this.commands.addCommand(o),this.on("changeMode",a),a(null,this)):(this.commands.removeCommand(o),this.off("changeMode",a));},value:!1}});});(function(){ace.require(["ace/ext/language_tools"],function(k){typeof _e=="object"&&typeof at=="object"&&_e&&(_e.exports=k);});})();});var ht=a((ct,Ie)=>{ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(k,M,H){var R=k("../lib/oop"),L=k("./text_highlight_rules").TextHighlightRules,x=function(){var s="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with",c="true|false",r="avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",t="int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string",i=this.createKeywordMapper({"support.function":r,keyword:s,"constant.language":c,"storage.type":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules();};R.inherits(x,L),M.SqlHighlightRules=x;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(k,M,H){var R=k("../../lib/oop"),L=k("../../range").Range,x=k("./fold_mode").FoldMode,s=M.FoldMode=function(c){c&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+c.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+c.end)));};R.inherits(s,x),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(c,r,t){var i=c.getLine(t);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return "";var n=this._getFoldWidgetBase(c,r,t);return !n&&this.startRegionRe.test(i)?"start":n},this.getFoldWidgetRange=function(c,r,t,i){var n=c.getLine(t);if(this.startRegionRe.test(n))return this.getCommentRegionBlock(c,n,t);var a=n.match(this.foldingStartMarker);if(a){var e=a.index;if(a[1])return this.openingBracketBlock(c,a[1],t,e);var o=c.getCommentFoldRange(t,e+a[0].length,1);return o&&!o.isMultiLine()&&(i?o=this.getSectionRange(c,t):r!="all"&&(o=null)),o}if(r!=="markbegin"){var a=n.match(this.foldingStopMarker);if(a){var e=a.index+a[0].length;return a[1]?this.closingBracketBlock(c,a[1],t,e):c.getCommentFoldRange(t,e,-1)}}},this.getSectionRange=function(c,r){var t=c.getLine(r),i=t.search(/\S/),n=r,e=t.length;r=r+1;for(var o=r,a=c.getLength();++r<a;){t=c.getLine(r);var u=t.search(/\S/);if(u!==-1){if(i>u)break;var w=this.getFoldWidgetRange(c,"all",r);if(w){if(w.start.row<=n)break;if(w.isMultiLine())r=w.end.row;else if(i==u)break}o=r;}}return new L(n,e,o,c.getLine(o).length)},this.getCommentRegionBlock=function(c,r,t){for(var i=r.search(/\s*$/),n=c.getLength(),e=t,o=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;++t<n;){r=c.getLine(t);var u=o.exec(r);if(u&&(u[1]?a--:a++,!a))break}var w=t;if(w>e)return new L(e,i,w,r.length)};}.call(s.prototype);});ace.define("ace/mode/folding/sql",["require","exports","module","ace/lib/oop","ace/mode/folding/cstyle"],function(k,M,H){var R=k("../../lib/oop"),L=k("./cstyle").FoldMode,x=M.FoldMode=function(){};R.inherits(x,L),function(){}.call(x.prototype);});ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules","ace/mode/folding/sql"],function(k,M,H){var R=k("../lib/oop"),L=k("./text").Mode,x=k("./sql_highlight_rules").SqlHighlightRules,s=k("./folding/sql").FoldMode,c=function(){this.HighlightRules=x,this.foldingRules=new s,this.$behaviour=this.$defaultBehaviour;};R.inherits(c,L),function(){this.lineCommentStart="--",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/sql",this.snippetFileId="ace/snippets/sql";}.call(c.prototype),M.Mode=c;});(function(){ace.require(["ace/mode/sql"],function(k){typeof Ie=="object"&&typeof ct=="object"&&Ie&&(Ie.exports=k);});})();});var dt=a((ut,Oe)=>{ace.define("ace/theme/chrome-css",["require","exports","module"],function(k,M,H){H.exports=`.ace-chrome .ace_gutter {
1082
1083
  background: #ebebeb;
1083
1084
  color: #333;
1084
1085
  overflow : hidden;
@@ -1236,7 +1237,7 @@ var st=a((ot,Ee)=>{(function(){var k="ace",M=function(){return this}();if(!M&&ty
1236
1237
  .ace-chrome .ace_indent-guide-active {
1237
1238
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1238
1239
  }
1239
- `;});ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,M,H){M.isDark=!1,M.cssClass="ace-chrome",M.cssText=k("./chrome-css");var R=k("../lib/dom");R.importCssString(M.cssText,M.cssClass,!1);});(function(){ace.require(["ace/theme/chrome"],function(k){typeof Oe=="object"&&typeof ut=="object"&&Oe&&(Oe.exports=k);});})();});function Be(k,M){if(!M||!k)return "";let R=k.map(L=>{if(!L.operator||!L.conditionals)return "";let s=L.conditionals.map(l=>{if(!l.field||!l.conditional)return "";let r="";if(l.type==="value")if(l.conditional==="IS NOT NULL"||l.conditional==="IS NULL")r=`this.${l.field} ${l.conditional}`;else if(l.conditional==="LIKE"||l.conditional==="NOT LIKE")r=`this.${l.field} ${l.conditional} '%${l.value}%'`;else if(l.conditional==="IN"||l.conditional==="NOT IN"){let e=l.value.split(",").map(i=>`'${i.trim()}'`).join(", ");r=`this.${l.field} ${l.conditional} (${e})`;}else r=`this.${l.field} ${l.conditional} '${l.value}'`;else l.type==="field"&&(r=`this.${l.field} ${l.conditional} this.${l.value}`);return r}).join(` ${L.operator.toUpperCase()} `);return k.length>1?`(${s})`:s}).join(` ${M.toUpperCase()} `);return R||""}var Re=styled(Te)(({theme:k})=>({borderBottom:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(k.palette.grey[500],.32)}`,padding:16})),qe=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:k.palette.grey[100]}})),et=styled(Te)(({theme:k})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(k.palette.grey[500],.24)}`,cursor:"pointer",color:k.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${k.palette.primary.main}`,backgroundColor:alpha(k.palette.primary.main,.05)}})),tt=styled(Te)(({theme:k})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(k.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:k.palette.text.disabled,fontSize:12}}})),Pe=styled(Ot)({marginLeft:"auto",padding:0});var Pt=({openPopover:k,handleClose:M,argumentsValues:H,filter:R,onExecute:L})=>{let[x,s]=useState([]),l=(e,i)=>{if(i&&i!=="")x.filter(t=>t.name===e).length>0?s(x.map(t=>t.name===e?{name:e,value:i}:t)):s([...x||[],{name:e,value:i}]);else {let n=x.filter(t=>t.name===e);s(n);}},r=()=>{let e=R||"";return x.forEach(i=>{e=e.replace(`$ARG[${i.name}]`,`'${i.value}'`);}),e};return jsxs(Dt,{open:!!k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,onClose:M,title:"Pr\xE9-visualizar",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(Re,{children:H?.map((e,i)=>jsx(Wt,{name:e,label:e,size:"small",onChange:n=>l(e,n.target.value),required:!0},i))}),jsxs(Te,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:M,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(Ue,{icon:"PLAY_SIMPLE"}),onClick:()=>L(r()),disabled:x.length<H.length,children:"Executar"})]})]})},rt=Pt;b(st());b(lt());b(ht());b(dt());var Yt=({openPopover:k,handleClose:M,addItem:H})=>{let[R,L]=useState("");return jsxs(Dt,{open:!!k,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,onClose:M,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(Re,{children:jsx(Wt,{value:R,onChange:s=>L(s.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(Te,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:M,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(Ue,{icon:"SAVE_MARK"}),disabled:!R||R==="",onClick:()=>{H(R),M(),L("");},children:"Salvar"})]})]})},gt=Yt;var qt=({label:k,itens:M,argumentsValues:H,fields:R,addItem:L,removeItem:x,insertItemSQL:s})=>{let[l,r]=useState(!1),e=Jt(),i=()=>{r(!l);},n=(o,a)=>{o.stopPropagation(),x&&x(a);},t=o=>{s(H?` $ARG[${o}]`:R?` this.${o}`:` ${o}`);};return jsxs(Te,{children:[jsxs(Te,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(Pe,{edge:"end",onClick:i,children:jsx(Ue,{icon:l?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(mt,{variant:"overline",color:"text.primary",children:k}),L&&jsxs(Fragment,{children:[jsx(Pe,{edge:"end",onClick:e.onOpen,children:jsx(Ue,{icon:"SIMPLE_ADD"})}),jsx(gt,{addItem:L,handleClose:e.onClose,openPopover:e.open})]})]}),l&&jsx(Te,{spacing:.5,children:jsx(Zt,{sx:{maxHeight:150},children:M?.map((o,a)=>jsxs(et,{direction:"row",justifyContent:"space-between",onClick:()=>t(o),children:[jsx(mt,{variant:"caption",textAlign:"center",width:"100%",children:o}),x&&jsx(Ot,{edge:"end",onClick:u=>n(u,o),children:jsx(Ue,{icon:"DELETE_MARK_BUTTON_02"})})]},a))})})]})},Le=qt;var oi=({fieldsSelect:k,argumentsValues:M,onChangeArguments:H,sql:R,setSql:L,setFilterRule:x})=>{let[s,l]=useState(),{setValue:r}=useFormContext(),[e,i]=useState(1),[n,t]=useState(),o=m=>{n.session.insert(e,` ${m} `);},a=m=>{H([...M||[],m]);},u=m=>{H(M?.filter($=>$!==m));},w=m=>{L(m),x(m),r("groups",void 0);},S=s?k.filter(m=>m.id.toString().toLocaleLowerCase().includes(s)||m.description.toString().toLocaleLowerCase().includes(s)||m.name?.toString().toLocaleLowerCase().includes(s)):k;return jsxs(Te,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(qe,{children:[jsx(ni,{value:s,trigger:"change",onSearch:m=>l(m?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(Le,{label:"Campos",fields:!0,itens:S.map(m=>m.name),insertItemSQL:o}),jsx(Le,{label:"Argumentos",argumentsValues:!0,itens:M,addItem:a,removeItem:u,insertItemSQL:o}),jsx(Le,{label:"Operadores",insertItemSQL:o,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(Le,{label:"Filtros",fields:!0,insertItemSQL:o,itens:S.map(m=>m.name)})]}),jsx(tt,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(ti,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:w,onCursorChange:m=>i(m.getCursor()),value:R,onLoad:m=>t(m),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},vt=oi;var li=({data:k,fields:M,isLoading:H,isError:R})=>jsxs(Te,{children:[jsx(mt,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),R&&jsx(Te,{children:"Falha ao gerar resultado"}),k&&jsx(ai,{columns:M?.map(L=>({field:L,headerName:L,width:150,type:"string"})),loading:H,rows:k,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),wt=li;var $t=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.primary.main,.32)}`,backgroundColor:alpha(k.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ct=styled(Ot)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),De=styled(Ne)(()=>({width:230}));var vi=({index:k,indexGroup:M,removeConditional:H,fieldsSelect:R})=>{let{watch:L}=useFormContext(),x=`groups.[${M}].conditionals[${k}].field`,s=`groups.[${M}].conditionals[${k}].conditional`,l=`groups.[${M}].conditionals[${k}].type`,r=`groups.[${M}].conditionals[${k}].value`,e=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],i=L(l);return jsxs(Te,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(Ne,{label:"Se",name:x,size:"small",fullWidth:!0,options:R?.map(n=>({value:n.name,label:n.description}))}),jsx(Ne,{label:"Estado",name:s,size:"small",fullWidth:!0,options:e}),jsx(Ne,{label:"Objetivo",name:`groups.[${M}].conditionals[${k}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),i==="value"?jsx(mi,{label:"Valor",name:r,size:"small",fullWidth:!0}):jsx(Ne,{label:"Se",name:r,size:"small",fullWidth:!0,options:R?.map(n=>({value:n.name,label:n.description}))}),jsx(Ct,{color:"error",onClick:()=>{H(k);},children:jsx(Ue,{icon:"DELETE_MARK_BUTTON_02"})})]})},St=vi;var Ai=({index:k,removeGroup:M,fieldsSelect:H})=>{let{control:R}=useFormContext(),L=`groups.[${k}].operator`,{fields:x,append:s,remove:l}=useFieldArray({name:`groups.${k}.conditionals`,control:R});return jsx(Si,{name:`GRUPO ${k+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(De,{name:L,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>M(k),children:jsxs(Te,{spacing:1.5,alignItems:"flex-start",children:[x.map((r,e)=>jsx(St,{index:e,indexGroup:k,removeConditional:i=>l(i),fieldsSelect:H},r.id)),jsx(Ci,{actionType:"NEW",onClick:()=>s({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},At=Ai;var Ri=({fieldsSelect:k})=>{let{control:M}=useFormContext(),{fields:H,append:R,remove:L}=useFieldArray({name:"groups",control:M});return jsxs(Te,{gap:1.5,children:[jsxs($t,{direction:"row",spacing:1.5,children:[jsx(mt,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(Te,{children:jsx(De,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(mt,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),H.map((x,s)=>jsx(At,{index:s,removeGroup:l=>L(l),fieldsSelect:k},x.id)),jsx(it,{size:"large",color:"inherit",startIcon:jsx(Ue,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{R({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},kt=Ri;var Mt=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),Tt=styled(Te)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Qe=styled(_i)(()=>({lineHeight:"1em"})),Rt=styled(Te)(()=>({padding:12}));var Bi=({argumentsValues:k,onChangeArguments:M,fieldsSelect:H,onChangeRule:R,onChangeSqlProcessed:L,defaultMode:x,defaultFilter:s,dataPreview:l,errorPreview:r,loadingPreview:e})=>{let[i,n]=useState(s||""),[t,o]=Hi(),[a,u]=useState(x||"simple"),{watch:w,setValue:S}=useFormContext(),m=Jt(),$=w("operator"),d=w("groups");useEffect(()=>()=>{S("config",{});},[]);let h=(y,b)=>{if(b==="advanced"){let f=Be(d,$);n(f),L(f),R(f);}u(b);},v=y=>{t||a==="simple"||k.length===0?o():m.onOpen(y);},C=y=>{o(),L(y);};return jsx(Fragment,{children:jsxs(Mt,{children:[jsxs(Tt,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(Di,{color:"primary",value:a,size:"small",exclusive:!0,onChange:h,children:[jsx(Qe,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Qe,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(it,{variant:"outlined",color:"inherit",onClick:y=>v(y),startIcon:!t&&jsx(Ue,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:t?"Voltar":"Executar"}),!!m.open&&jsx(rt,{handleClose:m.onClose,openPopover:m.open,argumentsValues:k,filter:i,onExecute:y=>C(y)})]}),jsx(Rt,{children:t?jsx(wt,{fields:H.map(y=>y.name),data:l,isError:r,isLoading:e}):jsx(Fragment,{children:a==="simple"?jsx(kt,{fieldsSelect:H,sql:i,setSql:n}):jsx(vt,{fieldsSelect:H,argumentsValues:k,onChangeArguments:M,sql:i,setSql:n,setFilterRule:R})})})]})})},Nr=Bi;/*! Bundled license information:
1240
+ `;});ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,M,H){M.isDark=!1,M.cssClass="ace-chrome",M.cssText=k("./chrome-css");var R=k("../lib/dom");R.importCssString(M.cssText,M.cssClass,!1);});(function(){ace.require(["ace/theme/chrome"],function(k){typeof Oe=="object"&&typeof ut=="object"&&Oe&&(Oe.exports=k);});})();});var Re=styled(Te)(({theme:k})=>({borderBottom:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(k.palette.grey[500],.32)}`,padding:16})),qe=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:k.palette.grey[100]}})),et=styled(Te)(({theme:k})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(k.palette.grey[500],.24)}`,cursor:"pointer",color:k.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${k.palette.primary.main}`,backgroundColor:alpha(k.palette.primary.main,.05)}})),tt=styled(Te)(({theme:k})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(k.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:k.palette.text.disabled,fontSize:12}}})),Be=styled(Ot)({marginLeft:"auto",padding:0});var Pt=({openPopover:k,handleClose:M,argumentsValues:H,filter:R,onExecute:L})=>{let[x,s]=useState([]),c=(t,i)=>{if(i&&i!=="")x.filter(e=>e.name===t).length>0?s(x.map(e=>e.name===t?{name:t,value:i}:e)):s([...x||[],{name:t,value:i}]);else {let n=x.filter(e=>e.name===t);s(n);}},r=()=>{let t=R||"";return x.forEach(i=>{t=t.replace(`$ARG[${i.name}]`,`'${i.value}'`);}),t};return jsxs(Dt,{open:!!k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,onClose:M,title:"Pr\xE9-visualizar",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(Re,{children:H?.map((t,i)=>jsx(Wt,{name:t,label:t,size:"small",onChange:n=>c(t,n.target.value),required:!0},i))}),jsxs(Te,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:M,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"PLAY_SIMPLE"}),onClick:()=>L(r()),disabled:x.length<H.length,children:"Executar"})]})]})},rt=Pt;b(st());b(lt());b(ht());b(dt());var Yt=({openPopover:k,handleClose:M,addItem:H})=>{let[R,L]=useState("");return jsxs(Dt,{open:!!k,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,onClose:M,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(Re,{children:jsx(Wt,{value:R,onChange:s=>L(s.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(Te,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:M,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"SAVE_MARK"}),disabled:!R||R==="",onClick:()=>{H(R),M(),L("");},children:"Salvar"})]})]})},gt=Yt;var qt=({label:k,itens:M,argumentsValues:H,fields:R,addItem:L,removeItem:x,insertItemSQL:s})=>{let[c,r]=useState(!1),t=Jt(),i=()=>{r(!c);},n=(o,a)=>{o.stopPropagation(),x&&x(a);},e=o=>{s(H?` $ARG[${o}]`:R?` this.${o}`:` ${o}`);};return jsxs(Te,{children:[jsxs(Te,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(Be,{edge:"end",onClick:i,children:jsx(ze,{icon:c?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(mt,{variant:"overline",color:"text.primary",children:k}),L&&jsxs(Fragment,{children:[jsx(Be,{edge:"end",onClick:t.onOpen,children:jsx(ze,{icon:"SIMPLE_ADD"})}),jsx(gt,{addItem:L,handleClose:t.onClose,openPopover:t.open})]})]}),c&&jsx(Te,{spacing:.5,children:jsx(Zt,{sx:{maxHeight:150},children:M?.map((o,a)=>jsxs(et,{direction:"row",justifyContent:"space-between",onClick:()=>e(o),children:[jsx(mt,{variant:"caption",textAlign:"center",width:"100%",children:o}),x&&jsx(Ot,{edge:"end",onClick:u=>n(u,o),children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]},a))})})]})},Le=qt;var oi=({fieldsSelect:k,argumentsValues:M,onChangeArguments:H,sql:R,setSql:L,setFilterRule:x})=>{let[s,c]=useState(),{setValue:r}=useFormContext(),[t,i]=useState(1),[n,e]=useState(),o=m=>{n.session.insert(t,` ${m} `);},a=m=>{H([...M||[],m]);},u=m=>{H(M?.filter($=>$!==m));},w=m=>{L(m),x(m),r("groups",void 0);},S=s?k.filter(m=>m.id.toString().toLocaleLowerCase().includes(s)||m.description.toString().toLocaleLowerCase().includes(s)||m.name?.toString().toLocaleLowerCase().includes(s)):k;return jsxs(Te,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(qe,{children:[jsx(ni,{value:s,trigger:"change",onSearch:m=>c(m?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(Le,{label:"Campos",fields:!0,itens:S.map(m=>m.name),insertItemSQL:o}),jsx(Le,{label:"Argumentos",argumentsValues:!0,itens:M,addItem:a,removeItem:u,insertItemSQL:o}),jsx(Le,{label:"Operadores",insertItemSQL:o,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(Le,{label:"Filtros",fields:!0,insertItemSQL:o,itens:S.map(m=>m.name)})]}),jsx(tt,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(ti,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:w,onCursorChange:m=>i(m.getCursor()),value:R,onLoad:m=>e(m),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},vt=oi;var li=({data:k,fields:M,isLoading:H,isError:R})=>jsxs(Te,{children:[jsx(mt,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),R&&jsx(Te,{children:"Falha ao gerar resultado"}),k&&jsx(ai,{columns:M?.map(L=>({field:L,headerName:L,width:150,type:"string"})),loading:H,rows:k,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),wt=li;var $t=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.primary.main,.32)}`,backgroundColor:alpha(k.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ct=styled(Ot)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),De=styled(Ne)(()=>({width:230}));var vi=({index:k,indexGroup:M,removeConditional:H,fieldsSelect:R})=>{let{watch:L}=useFormContext(),x=`groups.[${M}].conditionals[${k}].field`,s=`groups.[${M}].conditionals[${k}].conditional`,c=`groups.[${M}].conditionals[${k}].type`,r=`groups.[${M}].conditionals[${k}].value`,t=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],i=L(c);return jsxs(Te,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(Ne,{label:"Se",name:x,size:"small",fullWidth:!0,options:R?.map(n=>({value:n.name,label:n.description}))}),jsx(Ne,{label:"Estado",name:s,size:"small",fullWidth:!0,options:t}),jsx(Ne,{label:"Objetivo",name:`groups.[${M}].conditionals[${k}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),i==="value"?jsx(mi,{label:"Valor",name:r,size:"small",fullWidth:!0}):jsx(Ne,{label:"Se",name:r,size:"small",fullWidth:!0,options:R?.map(n=>({value:n.name,label:n.description}))}),jsx(Ct,{color:"error",onClick:()=>{H(k);},children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]})},St=vi;var Ai=({index:k,removeGroup:M,fieldsSelect:H})=>{let{control:R}=useFormContext(),L=`groups.[${k}].operator`,{fields:x,append:s,remove:c}=useFieldArray({name:`groups.${k}.conditionals`,control:R});return jsx(Si,{name:`GRUPO ${k+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(De,{name:L,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>M(k),children:jsxs(Te,{spacing:1.5,alignItems:"flex-start",children:[x.map((r,t)=>jsx(St,{index:t,indexGroup:k,removeConditional:i=>c(i),fieldsSelect:H},r.id)),jsx(Ci,{actionType:"NEW",onClick:()=>s({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},At=Ai;var Ri=({fieldsSelect:k})=>{let{control:M}=useFormContext(),{fields:H,append:R,remove:L}=useFieldArray({name:"groups",control:M});return jsxs(Te,{gap:1.5,children:[jsxs($t,{direction:"row",spacing:1.5,children:[jsx(mt,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(Te,{children:jsx(De,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(mt,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),H.map((x,s)=>jsx(At,{index:s,removeGroup:c=>L(c),fieldsSelect:k},x.id)),jsx(it,{size:"large",color:"inherit",startIcon:jsx(ze,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{R({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},kt=Ri;var Mt=styled(Te)(({theme:k})=>({border:`1px solid ${alpha(k.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),Tt=styled(Te)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Xe=styled(_i)(()=>({lineHeight:"1em"})),Rt=styled(Te)(()=>({padding:12}));var Bi=({argumentsValues:k,onChangeArguments:M,fieldsSelect:H,onChangeRule:R,onChangeSqlProcessed:L,defaultMode:x,defaultFilter:s,dataPreview:c,errorPreview:r,loadingPreview:t})=>{let[i,n]=useState(s||""),[e,o]=Hi(),[a,u]=useState(x||"simple"),{watch:w,setValue:S}=useFormContext(),m=Jt(),$=w("operator"),d=w("groups");useEffect(()=>()=>{S("config",{});},[]);let h=(y,b)=>{if(b==="advanced"){let f=a$1(d,$);n(f),L(f),R(f);}u(b);},v=y=>{e||a==="simple"||k.length===0?o():m.onOpen(y);},C=y=>{o(),L(y);};return jsx(Fragment,{children:jsxs(Mt,{children:[jsxs(Tt,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(Di,{color:"primary",value:a,size:"small",exclusive:!0,onChange:h,children:[jsx(Xe,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Xe,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(it,{variant:"outlined",color:"inherit",onClick:y=>v(y),startIcon:!e&&jsx(ze,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:e?"Voltar":"Executar"}),!!m.open&&jsx(rt,{handleClose:m.onClose,openPopover:m.open,argumentsValues:k,filter:i,onExecute:y=>C(y)})]}),jsx(Rt,{children:e?jsx(wt,{fields:H.map(y=>y.name),data:c,isError:r,isLoading:t}):jsx(Fragment,{children:a==="simple"?jsx(kt,{fieldsSelect:H,sql:i,setSql:n}):jsx(vt,{fieldsSelect:H,argumentsValues:k,onChangeArguments:M,sql:i,setSql:n,setFilterRule:R})})})]})})},Dr=Bi;/*! Bundled license information:
1240
1241
 
1241
1242
  ace-builds/src-noconflict/ace.js:
1242
1243
  (*
@@ -1248,4 +1249,4 @@ ace-builds/src-noconflict/ace.js:
1248
1249
  *)
1249
1250
  */
1250
1251
 
1251
- export { Nr as default };
1252
+ export { Dr as default };