/* ***** BEGIN LICENSE BLOCK *****
 * Distributed under the BSD license:
 *
 * Copyright (c) 2010, Ajax.org B.V.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Ajax.org B.V. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ***** END LICENSE BLOCK ***** */
(function(){var e="ace";var t=function(){return this}();if(!t&&typeof window!="undefined")t=window;if(!e&&typeof requirejs!=="undefined")return;var i=function(e,t,n){if(typeof e!=="string"){if(i.original)i.original.apply(this,arguments);else{console.error("dropping module because define wasn't a string.");console.trace()}return}if(arguments.length==2)n=t;if(!i.modules[e]){i.payloads[e]=n;i.modules[e]=null}};i.modules={};i.payloads={};var n=function(e,t,i){if(typeof t==="string"){var n=s(e,t);if(n!=undefined){i&&i();return n}}else if(Object.prototype.toString.call(t)==="[object Array]"){var o=[];for(var a=0,l=t.length;a<l;++a){var c=s(e,t[a]);if(c==undefined&&r.original)return;o.push(c)}return i&&i.apply(null,o)||true}};var r=function(e,t){var i=n("",e,t);if(i==undefined&&r.original)return r.original.apply(this,arguments);return i};var o=function(e,t){if(t.indexOf("!")!==-1){var i=t.split("!");return o(e,i[0])+"!"+o(e,i[1])}if(t.charAt(0)=="."){var n=e.split("/").slice(0,-1).join("/");t=n+"/"+t;while(t.indexOf(".")!==-1&&r!=t){var r=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t};var s=function(e,t){t=o(e,t);var r=i.modules[t];if(!r){r=i.payloads[t];if(typeof r==="function"){var s={};var a={id:t,uri:"",exports:s,packaged:true};var l=function(e,i){return n(t,e,i)};var c=r(l,s,a);s=c||a.exports;i.modules[t]=s;delete i.payloads[t]}r=i.modules[t]=s||r}return r};function a(e){var n=t;if(e){if(!t[e])t[e]={};n=t[e]}if(!n.define||!n.define.packaged){i.original=n.define;n.define=i;n.define.packaged=true}if(!n.require||!n.require.packaged){r.original=n.require;n.require=r;n.require.packaged=true}}a(e)})();ace.define("ace/lib/es6-shim",["require","exports","module"],function(e,t,i){function n(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:false,writable:true,configurable:true})}if(!String.prototype.startsWith){n(String.prototype,"startsWith",function(e,t){t=t||0;return this.lastIndexOf(e,t)===t})}if(!String.prototype.endsWith){n(String.prototype,"endsWith",function(e,t){var i=this;if(t===undefined||t>i.length){t=i.length}t-=e.length;var n=i.indexOf(e,t);return n!==-1&&n===t})}if(!String.prototype.repeat){n(String.prototype,"repeat",function(e){var t="";var i=this;while(e>0){if(e&1)t+=i;if(e>>=1)i+=i}return t})}if(!String.prototype.includes){n(String.prototype,"includes",function(e,t){return this.indexOf(e,t)!=-1})}if(!Object.assign){Object.assign=function(e){if(e===undefined||e===null){throw new TypeError("Cannot convert undefined or null to object")}var t=Object(e);for(var i=1;i<arguments.length;i++){var n=arguments[i];if(n!==undefined&&n!==null){Object.keys(n).forEach(function(e){t[e]=n[e]})}}return t}}if(!Object.values){Object.values=function(e){return Object.keys(e).map(function(t){return e[t]})}}if(!Array.prototype.find){n(Array.prototype,"find",function(e){var t=this.length;var i=arguments[1];for(var n=0;n<t;n++){var r=this[n];if(e.call(i,r,n,this)){return r}}})}if(!Array.prototype.findIndex){n(Array.prototype,"findIndex",function(e){var t=this.length;var i=arguments[1];for(var n=0;n<t;n++){var r=this[n];if(e.call(i,r,n,this)){return n}}})}if(!Array.prototype.includes){n(Array.prototype,"includes",function(e,t){return this.indexOf(e,t)!=-1})}if(!Array.prototype.fill){n(Array.prototype,"fill",function(e){var t=this;var i=t.length>>>0;var n=arguments[1];var r=n>>0;var o=r<0?Math.max(i+r,0):Math.min(r,i);var s=arguments[2];var a=s===undefined?i:s>>0;var l=a<0?Math.max(i+a,0):Math.min(a,i);while(o<l){t[o]=e;o++}return t})}if(!Array.of){n(Array,"of",function(){return Array.prototype.slice.call(arguments)})}});ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(e,t,i){"use strict";e("./es6-shim")});ace.define("ace/lib/deep_copy",["require","exports","module"],function(e,t,i){t.deepCopy=function e(t){if(typeof t!=="object"||!t)return t;var i;if(Array.isArray(t)){i=[];for(var n=0;n<t.length;n++){i[n]=e(t[n])}return i}if(Object.prototype.toString.call(t)!=="[object Object]")return t;i={};for(var n in t)i[n]=e(t[n]);return i}});ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]};t.stringReverse=function(e){return e.split("").reverse().join("")};t.stringRepeat=function(e,t){var i="";while(t>0){if(t&1)i+=e;if(t>>=1)e+=e}return i};var n=/^\s\s*/;var r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")};t.stringTrimRight=function(e){return e.replace(r,"")};t.copyObject=function(e){var t={};for(var i in e){t[i]=e[i]}return t};t.copyArray=function(e){var t=[];for(var i=0,n=e.length;i<n;i++){if(e[i]&&typeof e[i]=="object")t[i]=this.copyObject(e[i]);else t[i]=e[i]}return t};t.deepCopy=e("./deep_copy").deepCopy;t.arrayToMap=function(e){var t={};for(var i=0;i<e.length;i++){t[e[i]]=1}return t};t.createMap=function(e){var t=Object.create(null);for(var i in e){t[i]=e[i]}return t};t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++){if(t===e[i]){e.splice(i,1)}}};t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")};t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")};t.getMatchOffsets=function(e,t){var i=[];e.replace(t,function(e){i.push({offset:arguments[arguments.length-2],length:e.length})});return i};t.deferredCall=function(e){var t=null;var i=function(){t=null;e()};var n=function(e){n.cancel();t=setTimeout(i,e||0);return n};n.schedule=n;n.call=function(){this.cancel();e();return n};n.cancel=function(){clearTimeout(t);t=null;return n};n.isPending=function(){return t};return n};t.delayedCall=function(e,t){var i=null;var n=function(){i=null;e()};var r=function(e){if(i==null)i=setTimeout(n,e||t)};r.delay=function(e){i&&clearTimeout(i);i=setTimeout(n,e||t)};r.schedule=r;r.call=function(){this.cancel();e()};r.cancel=function(){i&&clearTimeout(i);i=null};r.isPending=function(){return i};return r};t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return false}return true};t.skipEmptyMatch=function(e,t,i){return i&&e.codePointAt(t)>65535?2:1}});ace.define("ace/lib/useragent",["require","exports","module"],function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"};t.getOS=function(){if(t.isMac){return t.OS.MAC}else if(t.isLinux){return t.OS.LINUX}else{return t.OS.WINDOWS}};var n=typeof navigator=="object"?navigator:{};var r=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase();var o=n.userAgent||"";var s=n.appName||"";t.isWin=r=="win";t.isMac=r=="mac";t.isLinux=r=="linux";t.isIE=s=="Microsoft Internet Explorer"||s.indexOf("MSAppHost")>=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]);t.isOldIE=t.isIE&&t.isIE<9;t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/);t.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window["opera"])=="[object Opera]";t.isWebKit=parseFloat(o.split("WebKit/")[1])||undefined;t.isChrome=parseFloat(o.split(" Chrome/")[1])||undefined;t.isSafari=parseFloat(o.split(" Safari/")[1])&&!t.isChrome||undefined;t.isEdge=parseFloat(o.split(" Edge/")[1])||undefined;t.isAIR=o.indexOf("AdobeAIR")>=0;t.isAndroid=o.indexOf("Android")>=0;t.isChromeOS=o.indexOf(" CrOS ")>=0;t.isIOS=/iPad|iPhone|iPod/.test(o)&&!window["MSStream"];if(t.isIOS)t.isMac=true;t.isMobile=t.isIOS||t.isAndroid});ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./useragent");var r="http://www.w3.org/1999/xhtml";t.buildDom=function e(t,i,n){if(typeof t=="string"&&t){var r=document.createTextNode(t);if(i)i.appendChild(r);return r}if(!Array.isArray(t)){if(t&&t.appendChild&&i)i.appendChild(t);return t}if(typeof t[0]!="string"||!t[0]){var o=[];for(var s=0;s<t.length;s++){var a=e(t[s],i,n);a&&o.push(a)}return o}var l=document.createElement(t[0]);var c=t[1];var h=1;if(c&&typeof c=="object"&&!Array.isArray(c))h=2;for(var s=h;s<t.length;s++)e(t[s],l,n);if(h==2){Object.keys(c).forEach(function(e){var t=c[e];if(e==="class"){l.className=Array.isArray(t)?t.join(" "):t}else if(typeof t=="function"||e=="value"||e[0]=="$"){l[e]=t}else if(e==="ref"){if(n)n[t]=l}else if(e==="style"){if(typeof t=="string")l.style.cssText=t}else if(t!=null){l.setAttribute(e,t)}})}if(i)i.appendChild(l);return l};t.getDocumentHead=function(e){if(!e)e=document;return e.head||e.getElementsByTagName("head")[0]||e.documentElement};t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||r,e):document.createElement(e)};t.removeChildren=function(e){e.innerHTML=""};t.createTextNode=function(e,t){var i=t?t.ownerDocument:document;return i.createTextNode(e)};t.createFragment=function(e){var t=e?e.ownerDocument:document;return t.createDocumentFragment()};t.hasCssClass=function(e,t){var i=(e.className+"").split(/\s+/g);return i.indexOf(t)!==-1};t.addCssClass=function(e,i){if(!t.hasCssClass(e,i)){e.className+=" "+i}};t.removeCssClass=function(e,t){var i=e.className.split(/\s+/g);while(true){var n=i.indexOf(t);if(n==-1){break}i.splice(n,1)}e.className=i.join(" ")};t.toggleCssClass=function(e,t){var i=e.className.split(/\s+/g),n=true;while(true){var r=i.indexOf(t);if(r==-1){break}n=false;i.splice(r,1)}if(n)i.push(t);e.className=i.join(" ");return n};t.setCssClass=function(e,i,n){if(n){t.addCssClass(e,i)}else{t.removeCssClass(e,i)}};t.hasCssString=function(e,t){var i=0,n;t=t||document;if(n=t.querySelectorAll("style")){while(i<n.length){if(n[i++].id===e){return true}}}};t.removeElementById=function(e,t){t=t||document;if(t.getElementById(e)){t.getElementById(e).remove()}};var o;var s=[];t.useStrictCSP=function(e){o=e;if(e==false)a();else if(!s)s=[]};function a(){var e=s;s=null;e&&e.forEach(function(e){l(e[0],e[1])})}function l(e,t,i){if(typeof document=="undefined")return;if(s){if(i){a()}else if(i===false){return s.push([e,t])}}if(o)return;throw new Error("The method importCssString can not be used without strictCSP due to CSP inline styles violations")}t.importCssString=l;t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))};t.scrollbarWidth=function(e){var i=t.createElement("ace_inner");i.style.width="100%";i.style.minWidth="0px";i.style.height="200px";i.style.display="block";var n=t.createElement("ace_outer");var r=n.style;r.position="absolute";r.left="-10000px";r.overflow="hidden";r.width="200px";r.minWidth="0px";r.height="150px";r.display="block";n.appendChild(i);var o=e&&e.documentElement||document&&document.documentElement;if(!o)return 0;o.appendChild(n);var s=i.offsetWidth;r.overflow="scroll";var a=i.offsetWidth;if(s===a){a=n.clientWidth}o.removeChild(n);return s-a};t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}};t.setStyle=function(e,t,i){if(e[t]!==i){e[t]=i}};t.HAS_CSS_ANIMATION=false;t.HAS_CSS_TRANSFORMS=false;t.HI_DPI=n.isWin?typeof window!=="undefined"&&window.devicePixelRatio>=1.5:true;if(n.isChromeOS)t.HI_DPI=false;if(typeof document!=="undefined"){var c=document.createElement("div");if(t.HI_DPI&&c.style.transform!==undefined)t.HAS_CSS_TRANSFORMS=true;if(!n.isEdge&&typeof c.style.animationName!=="undefined")t.HAS_CSS_ANIMATION=true;c=null}if(t.HAS_CSS_TRANSFORMS){t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}}else{t.translate=function(e,t,i){e.style.top=Math.round(i)+"px";e.style.left=Math.round(t)+"px"}}});ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,i){
/*
 * based on code from:
 *
 * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
"use strict";var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,true);i.onreadystatechange=function(){if(i.readyState===4){t(i.responseText)}};i.send(null)};t.loadScript=function(e,t){var i=n.getDocumentHead();var r=document.createElement("script");r.src=e;i.appendChild(r);r.onload=r.onreadystatechange=function(e,i){if(i||!r.readyState||r.readyState=="loaded"||r.readyState=="complete"){r=r.onload=r.onreadystatechange=null;if(!i)t()}}};t.qualifyURL=function(e){var t=document.createElement("a");t.href=e;return t.href}});ace.define("ace/lib/oop",["require","exports","module"],function(e,t,i){"use strict";t.inherits=function(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})};t.mixin=function(e,t){for(var i in t){e[i]=t[i]}return e};t.implement=function(e,i){t.mixin(e,i)}});ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,i){"use strict";var n={};var r=function(){this.propagationStopped=true};var o=function(){this.defaultPrevented=true};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={});this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[];var n=this._defaultHandlers[e];if(!i.length&&!n)return;if(typeof t!="object"||!t)t={};if(!t.type)t.type=e;if(!t.stopPropagation)t.stopPropagation=r;if(!t.preventDefault)t.preventDefault=o;i=i.slice();for(var s=0;s<i.length;s++){i[s](t,this);if(t.propagationStopped)break}if(n&&!t.defaultPrevented)return n(t,this)};n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(!i)return;i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)};n.once=function(e,t){var i=this;this.on(e,function n(){i.off(e,n);t.apply(null,arguments)});if(!t){return new Promise(function(e){t=e})}};n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(!i)i=this._defaultHandlers={_disabled_:{}};if(i[e]){var n=i[e];var r=i._disabled_[e];if(!r)i._disabled_[e]=r=[];r.push(n);var o=r.indexOf(t);if(o!=-1)r.splice(o,1)}i[e]=t};n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(!i)return;var n=i._disabled_[e];if(i[e]==t){if(n)this.setDefaultHandler(e,n.pop())}else if(n){var r=n.indexOf(t);if(r!=-1)n.splice(r,1)}};n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)n=this._eventRegistry[e]=[];if(n.indexOf(t)==-1)n[i?"unshift":"push"](t);return t};n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(!i)return;var n=i.indexOf(t);if(n!==-1)i.splice(n,1)};n.removeAllListeners=function(e){if(!e)this._eventRegistry=this._defaultHandlers=undefined;if(this._eventRegistry)this._eventRegistry[e]=undefined;if(this._defaultHandlers)this._defaultHandlers[e]=undefined};t.EventEmitter=n});ace.define("ace/lib/report_error",["require","exports","module"],function(e,t,i){t.reportError=function e(t,i){var n=new Error(t);n["data"]=i;if(typeof console=="object"&&console.error)console.error(n);setTimeout(function(){throw n})}});ace.define("ace/lib/default_english_messages",["require","exports","module"],function(e,t,i){var n={"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","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};t.defaultEnglishMessages=n});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(e,t,i){"no use strict";var n=e("./oop");var r=e("./event_emitter").EventEmitter;var o=e("./report_error").reportError;var s=e("./default_english_messages").defaultEnglishMessages;var a={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(!e){var i=this.$options;e=Object.keys(i).filter(function(e){return!i[e].hidden})}else if(!Array.isArray(e)){t=e;e=Object.keys(t)}e.forEach(function(e){t[e]=this.getOption(e)},this);return t},setOption:function(e,t){if(this["$"+e]===t)return;var i=this.$options[e];if(!i){return l('misspelled option "'+e+'"')}if(i.forwardTo)return this[i.forwardTo]&&this[i.forwardTo].setOption(e,t);if(!i.handlesSet)this["$"+e]=t;if(i&&i.set)i.set.call(this,t)},getOption:function(e){var t=this.$options[e];if(!t){return l('misspelled option "'+e+'"')}if(t.forwardTo)return this[t.forwardTo]&&this[t.forwardTo].getOption(e);return t&&t.get?t.get.call(this):this["$"+e]}};function l(e){if(typeof console!="undefined"&&console.warn)console.warn.apply(console,arguments)}var c;var h;var u=function(){function e(){this.$defaultOptions={};c=s;h="dollarSigns"}e.prototype.defineOptions=function(e,t,i){if(!e.$options)this.$defaultOptions[t]=e.$options={};Object.keys(i).forEach(function(t){var n=i[t];if(typeof n=="string")n={forwardTo:n};n.name||(n.name=t);e.$options[n.name]=n;if("initialValue"in n)e["$"+n.name]=n.initialValue});n.implement(e,a);return this};e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var i=e.$options[t];if("value"in i)e.setOption(t,i.value)})};e.prototype.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return false}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});if(n[t]){if(n.forwardTo)this.setDefaultValue(n.forwardTo,t,i);else n[t].value=i}};e.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach(function(i){this.setDefaultValue(e,i,t[i])},this)};e.prototype.setMessages=function(e,t){c=e;if(t&&t.placeholders){h=t.placeholders}};e.prototype.nls=function(e,t,i){if(!c[e]){l("No message found for the key '"+e+"' in the provided messages, trying to find a translation for the default string '"+t+"'.");if(!c[t]){l("No message found for the default string '"+t+"' in the provided messages. Falling back to the default English message.")}}var n=c[e]||c[t]||t;if(i){if(h==="dollarSigns"){n=n.replace(/\$(\$|[\d]+)/g,function(e,t){if(t=="$")return"$";return i[t]})}if(h==="curlyBrackets"){n=n.replace(/\{([^\}]+)\}/g,function(e,t){return i[t]})}}return n};return e}();u.prototype.warn=l;u.prototype.reportError=o;n.implement(u.prototype,r);t.AppConfig=u});ace.define("ace/theme/textmate-css",["require","exports","module"],function(e,t,i){i.exports='.ace-tm .ace_gutter {\n  background: #f0f0f0;\n  color: #333;\n}\n\n.ace-tm .ace_print-margin {\n  width: 1px;\n  background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n    background-color: #6B72E6;\n}\n\n.ace-tm {\n  background-color: #FFFFFF;\n  color: black;\n}\n\n.ace-tm .ace_cursor {\n  color: black;\n}\n        \n.ace-tm .ace_invisible {\n  color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n  color: blue;\n}\n\n.ace-tm .ace_constant {\n  color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n  color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n  color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n  background-color: rgba(255, 0, 0, 0.1);\n  color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n  color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n  color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n  color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n  color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n  color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n  color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n  color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n  color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n  color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n  color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n  color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n  color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n  color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n  color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n  color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n  background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n  box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n  background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n  background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n  margin: -1px 0 0 -1px;\n  border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n  background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n    background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n  background: rgb(250, 250, 255);\n  border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n'});ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(e,t,i){"use strict";t.isDark=false;t.cssClass="ace-tm";t.cssText=e("./textmate-css");t.$id="ace/theme/textmate";var n=e("../lib/dom");n.importCssString(t.cssText,t.cssClass,false)});ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(e,t,i){"no use strict";var n=e("./lib/lang");var r=e("./lib/net");var o=e("./lib/dom");var s=e("./lib/app_config").AppConfig;i.exports=t=new s;var a={packaged:false,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:true,sharedPopups:false,useStrictCSP:null};t.get=function(e){if(!a.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return a[e]};t.set=function(e,t){if(a.hasOwnProperty(e))a[e]=t;else if(this.setDefaultValue("",e,t)==false)throw new Error("Unknown config key: "+e);if(e=="useStrictCSP")o.useStrictCSP(t)};t.all=function(){return n.copyObject(a)};t.$modes={};t.moduleUrl=function(e,t){if(a.$moduleUrls[e])return a.$moduleUrls[e];var i=e.split("/");t=t||i[i.length-2]||"";var n=t=="snippets"?"/":"-";var r=i[i.length-1];if(t=="worker"&&n=="-"){var o=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");r=r.replace(o,"")}if((!r||r==t)&&i.length>1)r=i[i.length-2];var s=a[t+"Path"];if(s==null){s=a.basePath}else if(n=="/"){t=n=""}if(s&&s.slice(-1)!="/")s+="/";return s+t+n+r+this.get("suffix")};t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t};var l=function(t,i){if(t==="ace/theme/textmate"||t==="./theme/textmate")return i(null,e("./theme/textmate"));if(c)return c(t,i);console.error("loader is not configured")};var c;t.setLoader=function(e){c=e};t.dynamicModules=Object.create(null);t.$loading={};t.$loaded={};t.loadModule=function(e,i){var n;if(Array.isArray(e)){var o=e[0];var s=e[1]}else if(typeof e=="string"){var s=e}var a=function(e){if(e&&!t.$loading[s])return i&&i(e);if(!t.$loading[s])t.$loading[s]=[];t.$loading[s].push(i);if(t.$loading[s].length>1)return;var n=function(){l(s,function(e,i){if(i)t.$loaded[s]=i;t._emit("load.module",{name:s,module:i});var n=t.$loading[s];t.$loading[s]=null;n.forEach(function(e){e&&e(i)})})};if(!t.get("packaged"))return n();r.loadScript(t.moduleUrl(s,o),n);h()};if(t.dynamicModules[s]){t.dynamicModules[s]().then(function(e){if(e.default){a(e.default)}else{a(e)}})}else{try{n=this.$require(s)}catch(e){}a(n||t.$loaded[s])}};t.$require=function(e){if(typeof i["require"]=="function"){var t="require";return i[t](e)}};t.setModuleLoader=function(e,i){t.dynamicModules[e]=i};var h=function(){if(!a.basePath&&!a.workerPath&&!a.modePath&&!a.themePath&&!Object.keys(a.$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");h=function(){}}};t.version="1.36.5"});ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var n=e("./config");n.setLoader(function(t,i){e([t],function(e){i(null,e)})});var r=function(){return this||typeof window!="undefined"&&window}();i.exports=function(t){n.init=o;n.$require=e;t.require=e;if(typeof define==="function")t.define=define};o(true);function o(t){if(!r||!r.document)return;n.set("packaged",t||e.packaged||i.packaged||r.define&&define.packaged);var o={};var a="";var l=document.currentScript||document._currentScript;var c=l&&l.ownerDocument||document;if(l&&l.src){a=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||""}var h=c.getElementsByTagName("script");for(var u=0;u<h.length;u++){var d=h[u];var f=d.src||d.getAttribute("src");if(!f)continue;var g=d.attributes;for(var p=0,m=g.length;p<m;p++){var v=g[p];if(v.name.indexOf("data-ace-")===0){o[s(v.name.replace(/^data-ace-/,""))]=v.value}}var y=f.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);if(y)a=y[1]}if(a){o.base=o.base||a;o.packaged=true}o.basePath=o.base;o.workerPath=o.workerPath||o.base;o.modePath=o.modePath||o.base;o.themePath=o.themePath||o.base;delete o.base;for(var w in o)if(typeof o[w]!=="undefined")n.set(w,o[w])}function s(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}});ace.define("ace/range",["require","exports","module"],function(e,t,i){"use strict";var n=function(){function e(e,t,i,n){this.start={row:e,column:t};this.end={row:i,column:n}}e.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column};e.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"};e.prototype.contains=function(e,t){return this.compare(e,t)==0};e.prototype.compareRange=function(e){var t,i=e.end,n=e.start;t=this.compare(i.row,i.column);if(t==1){t=this.compare(n.row,n.column);if(t==1){return 2}else if(t==0){return 1}else{return 0}}else if(t==-1){return-2}else{t=this.compare(n.row,n.column);if(t==-1){return-1}else if(t==1){return 42}else{return 0}}};e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)};e.prototype.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0};e.prototype.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1};e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t};e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t};e.prototype.setStart=function(e,t){if(typeof e=="object"){this.start.column=e.column;this.start.row=e.row}else{this.start.row=e;this.start.column=t}};e.prototype.setEnd=function(e,t){if(typeof e=="object"){this.end.column=e.column;this.end.row=e.row}else{this.end.row=e;this.end.column=t}};e.prototype.inside=function(e,t){if(this.compare(e,t)==0){if(this.isEnd(e,t)||this.isStart(e,t)){return false}else{return true}}return false};e.prototype.insideStart=function(e,t){if(this.compare(e,t)==0){if(this.isEnd(e,t)){return false}else{return true}}return false};e.prototype.insideEnd=function(e,t){if(this.compare(e,t)==0){if(this.isStart(e,t)){return false}else{return true}}return false};e.prototype.compare=function(e,t){if(!this.isMultiLine()){if(e===this.start.row){return t<this.start.column?-1:t>this.end.column?1:0}}if(e<this.start.row)return-1;if(e>this.end.row)return 1;if(this.start.row===e)return t>=this.start.column?0:-1;if(this.end.row===e)return t<=this.end.column?0:1;return 0};e.prototype.compareStart=function(e,t){if(this.start.row==e&&this.start.column==t){return-1}else{return this.compare(e,t)}};e.prototype.compareEnd=function(e,t){if(this.end.row==e&&this.end.column==t){return 1}else{return this.compare(e,t)}};e.prototype.compareInside=function(e,t){if(this.end.row==e&&this.end.column==t){return 1}else if(this.start.row==e&&this.start.column==t){return-1}else{return this.compare(e,t)}};e.prototype.clipRows=function(t,i){if(this.end.row>i)var n={row:i+1,column:0};else if(this.end.row<t)var n={row:t,column:0};if(this.start.row>i)var r={row:i+1,column:0};else if(this.start.row<t)var r={row:t,column:0};return e.fromPoints(r||this.start,n||this.end)};e.prototype.extend=function(t,i){var n=this.compare(t,i);if(n==0)return this;else if(n==-1)var r={row:t,column:i};else var o={row:t,column:i};return e.fromPoints(r||this.start,o||this.end)};e.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column};e.prototype.isMultiLine=function(){return this.start.row!==this.end.row};e.prototype.clone=function(){return e.fromPoints(this.start,this.end)};e.prototype.collapseRows=function(){if(this.end.column==0)return new e(this.start.row,0,Math.max(this.start.row,this.end.row-1),0);else return new e(this.start.row,0,this.end.row,0)};e.prototype.toScreenRange=function(t){var i=t.documentToScreenPosition(this.start);var n=t.documentToScreenPosition(this.end);return new e(i.row,i.column,n.row,n.column)};e.prototype.moveBy=function(e,t){this.start.row+=e;this.start.column+=t;this.end.row+=e;this.end.column+=t};return e}();n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)};n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column};t.Range=n});ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./oop");var r={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:"*"}};var o={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};for(var s=0;s<10;s++){o["Digit"+s]=48+s;o["Numpad"+s]=96+s;r.PRINTABLE_KEYS[48+s]=""+s;r.FUNCTION_KEYS[96+s]="Numpad"+s}for(var s=65;s<91;s++){var a=String.fromCharCode(s+32);o["Key"+a.toUpperCase()]=s;r.PRINTABLE_KEYS[s]=a}for(var s=1;s<13;s++){o["F"+s]=111+s;r.FUNCTION_KEYS[111+s]="F"+s}var l={Shift:16,Control:17,Alt:18,Meta:224};for(var c in l){o[c]=o[c+"Left"]=o[c+"Right"]=l[c]}t.$codeToKeyCode=o;r.PRINTABLE_KEYS[173]="-";for(var h in r.FUNCTION_KEYS){var u=r.FUNCTION_KEYS[h].toLowerCase();r[u]=parseInt(h,10)}for(var h in r.PRINTABLE_KEYS){var u=r.PRINTABLE_KEYS[h].toLowerCase();r[u]=parseInt(h,10)}n.mixin(r,r.MODIFIER_KEYS);n.mixin(r,r.PRINTABLE_KEYS);n.mixin(r,r.FUNCTION_KEYS);r.enter=r["return"];r.escape=r.esc;r.del=r["delete"];(function(){var e=["cmd","ctrl","alt","shift"];for(var t=Math.pow(2,e.length);t--;){r.KEY_MODS[t]=e.filter(function(e){return t&r.KEY_MODS[e]}).join("-")+"-"}})();r.KEY_MODS[0]="";r.KEY_MODS[-1]="input-";n.mixin(t,r);t.default=t;t.keyCodeToString=function(e){var t=r[e];if(typeof t!="string")t=String.fromCharCode(e);return t.toLowerCase()}});ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("./keys");var r=e("./useragent");var o=null;var s=0;var a;function l(){a=false;try{document.createComment("").addEventListener("test",function(){},{get passive(){a={passive:false};return true}})}catch(e){}}function c(){if(a==undefined)l();return a}function h(e,t,i){this.elem=e;this.type=t;this.callback=i}h.prototype.destroy=function(){d(this.elem,this.type,this.callback);this.elem=this.type=this.callback=undefined};var u=t.addListener=function(e,t,i,n){e.addEventListener(t,i,c());if(n)n.$toDestroy.push(new h(e,t,i))};var d=t.removeListener=function(e,t,i){e.removeEventListener(t,i,c())};t.stopEvent=function(e){t.stopPropagation(e);t.preventDefault(e);return false};t.stopPropagation=function(e){if(e.stopPropagation)e.stopPropagation()};t.preventDefault=function(e){if(e.preventDefault)e.preventDefault()};t.getButton=function(e){if(e.type=="dblclick")return 0;if(e.type=="contextmenu"||r.isMac&&(e.ctrlKey&&!e.altKey&&!e.shiftKey))return 2;return e.button};t.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function r(e){t&&t(e);i&&i(e);d(n,"mousemove",t);d(n,"mouseup",r);d(n,"dragstart",r)}u(n,"mousemove",t);u(n,"mouseup",r);u(n,"dragstart",r);return r};t.addMouseWheelListener=function(e,t,i){u(e,"wheel",function(e){var i=.15;var n=e.deltaX||0;var r=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=n*i;e.wheelY=r*i;break;case e.DOM_DELTA_LINE:var o=15;e.wheelX=n*o;e.wheelY=r*o;break;case e.DOM_DELTA_PAGE:var s=150;e.wheelX=n*s;e.wheelY=r*s;break}t(e)},i)};t.addMultiMouseDownListener=function(e,i,n,o,s){var a=0;var l,c,h;var d={2:"dblclick",3:"tripleclick",4:"quadclick"};function f(e){if(t.getButton(e)!==0){a=0}else if(e.detail>1){a++;if(a>4)a=1}else{a=1}if(r.isIE){var s=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-c)>5;if(!h||s)a=1;if(h)clearTimeout(h);h=setTimeout(function(){h=null},i[a-1]||600);if(a==1){l=e.clientX;c=e.clientY}}e._clicks=a;n[o]("mousedown",e);if(a>4)a=0;else if(a>1)return n[o](d[a],e)}if(!Array.isArray(e))e=[e];e.forEach(function(e){u(e,"mousedown",f,s)})};function f(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}t.getModifierString=function(e){return n.KEY_MODS[f(e)]};function g(e,t,i){var a=f(t);if(!i&&t.code){i=n.$codeToKeyCode[t.code]||i}if(!r.isMac&&o){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win")))a|=8;if(o.altGr){if((3&a)!=3)o.altGr=0;else return}if(i===18||i===17){var l=t.location;if(i===17&&l===1){if(o[i]==1)s=t.timeStamp}else if(i===18&&a===3&&l===2){var c=t.timeStamp-s;if(c<50)o.altGr=true}}}if(i in n.MODIFIER_KEYS){i=-1}if(!a&&i===13){if(t.location===3){e(t,a,-i);if(t.defaultPrevented)return}}if(r.isChromeOS&&a&8){e(t,a,i);if(t.defaultPrevented)return;else a&=~8}if(!a&&!(i in n.FUNCTION_KEYS)&&!(i in n.PRINTABLE_KEYS)){return false}return e(t,a,i)}t.addCommandKeyListener=function(e,i,n){var r=null;u(e,"keydown",function(e){o[e.keyCode]=(o[e.keyCode]||0)+1;var t=g(i,e,e.keyCode);r=e.defaultPrevented;return t},n);u(e,"keypress",function(e){if(r&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)){t.stopEvent(e);r=null}},n);u(e,"keyup",function(e){o[e.keyCode]=null},n);if(!o){p();u(window,"focus",p)}};function p(){o=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!r.isOldIE){var m=1;t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+m++;var r=function(o){if(o.data==n){t.stopPropagation(o);d(i,"message",r);e()}};u(i,"message",r);i.postMessage(n,"*")}}t.$idleBlocked=false;t.onIdle=function(e,i){return setTimeout(function i(){if(!t.$idleBlocked){e()}else{setTimeout(i,100)}},i)};t.$idleBlockId=null;t.blockIdle=function(e){if(t.$idleBlockId)clearTimeout(t.$idleBlockId);t.$idleBlocked=true;t.$idleBlockId=setTimeout(function(){t.$idleBlocked=false},e||100)};t.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]);if(t.nextFrame)t.nextFrame=t.nextFrame.bind(window);else t.nextFrame=function(e){setTimeout(e,17)}});ace.define("ace/clipboard",["require","exports","module"],function(e,t,i){"use strict";var n;i.exports={lineMode:false,pasteCancelled:function(){if(n&&n>Date.now()-50)return true;return n=false},cancel:function(){n=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(e,t,i){"use strict";var n=e("../lib/event");var r=e("../config").nls;var o=e("../lib/useragent");var s=e("../lib/dom");var a=e("../lib/lang");var l=e("../clipboard");var c=o.isChrome<18;var h=o.isIE;var u=o.isChrome>63;var d=400;var f=e("../lib/keys");var g=f.KEY_MODS;var p=o.isIOS;var m=p?/\s/:/\n/;var v=o.isMobile;var y;y=function(e,t){var i=s.createElement("textarea");i.className="ace_text-input";i.setAttribute("wrap","off");i.setAttribute("autocorrect","off");i.setAttribute("autocapitalize","off");i.setAttribute("spellcheck","false");i.style.opacity="0";e.insertBefore(i,e.firstChild);var y=false;var w=false;var b=false;var $=false;var C="";if(!v)i.style.fontSize="1px";var S=false;var x=false;var A="";var M=0;var k=0;var L=0;var T=Number.MAX_SAFE_INTEGER;var E=Number.MIN_SAFE_INTEGER;var R=0;try{var I=document.activeElement===i}catch(e){}this.setNumberOfExtraLines=function(e){T=Number.MAX_SAFE_INTEGER;E=Number.MIN_SAFE_INTEGER;if(e<0){R=0;return}R=e};this.setAriaLabel=function(){var e="";if(t.$textInputAriaLabel){e+="".concat(t.$textInputAriaLabel,", ")}if(t.session){var n=t.session.selection.cursor.row;e+=r("text-input.aria-label","Cursor at row $0",[n+1])}i.setAttribute("aria-label",e)};this.setAriaOptions=function(e){if(e.activeDescendant){i.setAttribute("aria-haspopup","true");i.setAttribute("aria-autocomplete",e.inline?"both":"list");i.setAttribute("aria-activedescendant",e.activeDescendant)}else{i.setAttribute("aria-haspopup","false");i.setAttribute("aria-autocomplete","both");i.removeAttribute("aria-activedescendant")}if(e.role){i.setAttribute("role",e.role)}if(e.setLabel){i.setAttribute("aria-roledescription",r("text-input.aria-roledescription","editor"));this.setAriaLabel()}};this.setAriaOptions({role:"textbox"});n.addListener(i,"blur",function(e){if(x)return;t.onBlur(e);I=false},t);n.addListener(i,"focus",function(e){if(x)return;I=true;if(o.isEdge){try{if(!document.hasFocus())return}catch(e){}}t.onFocus(e);if(o.isEdge)setTimeout(D);else D()},t);this.$focusScroll=false;this.focus=function(){this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility});if(C||u||this.$focusScroll=="browser")return i.focus({preventScroll:true});var e=i.style.top;i.style.position="fixed";i.style.top="0px";try{var n=i.getBoundingClientRect().top!=0}catch(e){return}var r=[];if(n){var o=i.parentElement;while(o&&o.nodeType==1){r.push(o);o.setAttribute("ace_nocontext","true");if(!o.parentElement&&o.getRootNode)o=o.getRootNode()["host"];else o=o.parentElement}}i.focus({preventScroll:true});if(n){r.forEach(function(e){e.removeAttribute("ace_nocontext")})}setTimeout(function(){i.style.position="";if(i.style.top=="0px")i.style.top=e},0)};this.blur=function(){i.blur()};this.isFocused=function(){return I};t.on("beforeEndOperation",function(){var e=t.curOp;var n=e&&e.command&&e.command.name;if(n=="insertstring")return;var r=n&&(e.docChanged||e.selectionChanged);if(b&&r){A=i.value="";Y()}D()});t.on("changeSelection",this.setAriaLabel);var _=function(e,i){var n=i;for(var r=1;r<=e-T&&r<2*R+1;r++){n+=t.session.getLine(e-r).length+1}return n};var D=p?function(e){if(!I||y&&!e||$)return;if(!e)e="";var n="\n ab"+e+"cde fg\n";if(n!=i.value)i.value=A=n;var r=4;var o=4+(e.length||(t.selection.isEmpty()?0:1));if(M!=r||k!=o){i.setSelectionRange(r,o)}M=r;k=o}:function(){if(b||$)return;if(!I&&!F)return;b=true;var e=0;var n=0;var r="";if(t.session){var o=t.selection;var s=o.getRange();var a=o.cursor.row;if(a===E+1){T=E+1;E=T+2*R}else if(a===T-1){E=T-1;T=E-2*R}else if(a<T-1||a>E+1){T=a>R?a-R:0;E=a>R?a+R:2*R}var l=[];for(var c=T;c<=E;c++){l.push(t.session.getLine(c))}r=l.join("\n");e=_(s.start.row,s.start.column);n=_(s.end.row,s.end.column);if(s.start.row<T){var h=t.session.getLine(T-1);e=s.start.row<T-1?0:e;n+=h.length+1;r=h+"\n"+r}else if(s.end.row>E){var u=t.session.getLine(E+1);n=s.end.row>E+1?u.length:s.end.column;n+=r.length+1;r=r+"\n"+u}else if(v&&a>0){r="\n"+r;n+=1;e+=1}if(r.length>d){if(e<d&&n<d){r=r.slice(0,d)}else{r="\n";if(e==n){e=n=0}else{e=0;n=1}}}var f=r+"\n\n";if(f!=A){i.value=A=f;M=k=f.length}}if(F){M=i.selectionStart;k=i.selectionEnd}if(k!=n||M!=e||i.selectionEnd!=k){try{i.setSelectionRange(e,n);M=e;k=n}catch(e){}}b=false};this.resetSelection=D;if(I)t.onFocus();var N=function(e){return e.selectionStart===0&&e.selectionEnd>=A.length&&e.value===A&&A&&e.selectionEnd!==k};var O=function(e){if(b)return;if(y){y=false}else if(N(i)){t.selectAll();D()}else if(v&&i.selectionStart!=M){D()}};var W=null;this.setInputHandler=function(e){W=e};this.getInputHandler=function(){return W};var F=false;var z=function(e,n){if(F)F=false;if(w){D();if(e)t.onPaste(e);w=false;return""}else{var r=i.selectionStart;var s=i.selectionEnd;var a=M;var l=A.length-k;var c=e;var h=e.length-r;var u=e.length-s;var d=0;while(a>0&&A[d]==e[d]){d++;a--}c=c.slice(d);d=1;while(l>0&&A.length-d>M-1&&A[A.length-d]==e[e.length-d]){d++;l--}h-=d-1;u-=d-1;var f=c.length-d+1;if(f<0){a=-f;f=0}c=c.slice(0,f);if(!n&&!c&&!h&&!a&&!l&&!u)return"";$=true;var g=false;if(o.isAndroid&&c==". "){c="  ";g=true}if(c&&!a&&!l&&!h&&!u||S){t.onTextInput(c)}else{t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:u})}$=false;A=e;M=r;k=s;L=u;return g?"\n":c}};var H=function(e){if(b)return K();if(e&&e.inputType){if(e.inputType=="historyUndo")return t.execCommand("undo");if(e.inputType=="historyRedo")return t.execCommand("redo")}var n=i.value;var r=z(n,true);if(n.length>d+100||m.test(r)||v&&M<1&&M==k){D()}};var B=function(e,t,i){var n=e.clipboardData||window["clipboardData"];if(!n||c)return;var r=h||i?"Text":"text/plain";try{if(t){return n.setData(r,t)!==false}else{return n.getData(r)}}catch(e){if(!i)return B(e,t,true)}};var P=function(e,r){var o=t.getCopyText();if(!o)return n.preventDefault(e);if(B(e,o)){if(p){D(o);y=o;setTimeout(function(){y=false},10)}r?t.onCut():t.onCopy();n.preventDefault(e)}else{y=true;i.value=o;i.select();setTimeout(function(){y=false;D();r?t.onCut():t.onCopy()})}};var j=function(e){P(e,true)};var U=function(e){P(e,false)};var V=function(e){var r=B(e);if(l.pasteCancelled())return;if(typeof r=="string"){if(r)t.onPaste(r,e);if(o.isIE)setTimeout(D);n.preventDefault(e)}else{i.value="";w=true}};n.addCommandKeyListener(i,function(e,i,n){if(b)return;return t.onCommandKey(e,i,n)},t);n.addListener(i,"select",O,t);n.addListener(i,"input",H,t);n.addListener(i,"cut",j,t);n.addListener(i,"copy",U,t);n.addListener(i,"paste",V,t);if(!("oncut"in i)||!("oncopy"in i)||!("onpaste"in i)){n.addListener(e,"keydown",function(e){if(o.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:U(e);break;case 86:V(e);break;case 88:j(e);break}},t)}var G=function(e){if(b||!t.onCompositionStart||t.$readOnly)return;b={};if(S)return;if(e.data)b.useTextareaForIME=false;setTimeout(K,0);t._signal("compositionStart");t.on("mousedown",Q);var n=t.getSelectionRange();n.end.row=n.start.row;n.end.column=n.start.column;b.markerRange=n;b.selectionStart=M;t.onCompositionStart(b);if(b.useTextareaForIME){A=i.value="";M=0;k=0}else{if(i.msGetInputContext)b.context=i.msGetInputContext();if(i.getInputContext)b.context=i.getInputContext()}};var K=function(){if(!b||!t.onCompositionUpdate||t.$readOnly)return;if(S)return Q();if(b.useTextareaForIME){t.onCompositionUpdate(i.value)}else{var e=i.value;z(e);if(b.markerRange){if(b.context){b.markerRange.start.column=b.selectionStart=b.context.compositionStartOffset}b.markerRange.end.column=b.markerRange.start.column+k-b.selectionStart+L}}};var Y=function(e){if(!t.onCompositionEnd||t.$readOnly)return;b=false;t.onCompositionEnd();t.off("mousedown",Q);if(e)H()};function Q(){x=true;i.blur();i.focus();x=false}var Z=a.delayedCall(K,50).schedule.bind(null,null);function X(e){if(e.keyCode==27&&i.value.length<i.selectionStart){if(!b)A=i.value;M=k=-1;D()}Z()}n.addListener(i,"compositionstart",G,t);n.addListener(i,"compositionupdate",K,t);n.addListener(i,"keyup",X,t);n.addListener(i,"keydown",Z,t);n.addListener(i,"compositionend",Y,t);this.getElement=function(){return i};this.setCommandMode=function(e){S=e;i.readOnly=false};this.setReadOnly=function(e){if(!S)i.readOnly=e};this.setCopyWithEmptySelection=function(e){};this.onContextMenu=function(e){F=true;D();t._emit("nativecontextmenu",{target:t,domEvent:e});this.moveToMouse(e,true)};this.moveToMouse=function(e,r){if(!C)C=i.style.cssText;i.style.cssText=(r?"z-index:100000;":"")+(o.isIE?"opacity:0.1;":"")+"text-indent: -"+(M+k)*t.renderer.characterWidth*.5+"px;";var a=t.container.getBoundingClientRect();var l=s.computedStyle(t.container);var c=a.top+(parseInt(l.borderTopWidth)||0);var h=a.left+(parseInt(a.borderLeftWidth)||0);var u=a.bottom-c-i.clientHeight-2;var d=function(e){s.translate(i,e.clientX-h-2,Math.min(e.clientY-c-2,u))};d(e);if(e.type!="mousedown")return;t.renderer.$isMousePressed=true;clearTimeout(q);if(o.isWin)n.capture(t.container,d,J)};this.onContextMenuClose=J;var q;function J(){clearTimeout(q);q=setTimeout(function(){if(C){i.style.cssText=C;C=""}t.renderer.$isMousePressed=false;if(t.renderer.$keepTextAreaAtCursor)t.renderer.$moveTextAreaToCursor()},0)}var ee=function(e){t.textInput.onContextMenu(e);J()};n.addListener(i,"mouseup",ee,t);n.addListener(i,"mousedown",function(e){e.preventDefault();J()},t);n.addListener(t.renderer.scroller,"contextmenu",ee,t);n.addListener(i,"contextmenu",ee,t);if(p)te(e,t,i);function te(e,t,i){var n=null;var r=false;i.addEventListener("keydown",function(e){if(n)clearTimeout(n);r=true},true);i.addEventListener("keyup",function(e){n=setTimeout(function(){r=false},100)},true);var o=function(e){if(document.activeElement!==i)return;if(r||b||t.$mouseHandler.isMousePressed)return;if(y){return}var n=i.selectionStart;var o=i.selectionEnd;var s=null;var a=0;if(n==0){s=f.up}else if(n==1){s=f.home}else if(o>k&&A[o]=="\n"){s=f.end}else if(n<M&&A[n-1]==" "){s=f.left;a=g.option}else if(n<M||n==M&&k!=M&&n==o){s=f.left}else if(o>k&&A.slice(0,o).split("\n").length>2){s=f.down}else if(o>k&&A[o-1]==" "){s=f.right;a=g.option}else if(o>k||o==k&&k!=M&&n==o){s=f.right}if(n!==o)a|=g.shift;if(s){var l=t.onCommandKey({},a,s);if(!l&&t.commands){s=f.keyCodeToString(s);var c=t.commands.findKeyCommand(a,s);if(c)t.execCommand(c)}M=n;k=o;D("")}};document.addEventListener("selectionchange",o);t.on("destroy",function(){document.removeEventListener("selectionchange",o)})}this.destroy=function(){if(i.parentElement)i.parentElement.removeChild(i)}};t.TextInput=y;t.$setUserAgentForTests=function(e,t){v=e;p=t}});ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/useragent");var r=0;var o=550;var s=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e));t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e));t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e));t.setDefaultHandler("quadclick",this.onQuadClick.bind(e));t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(t){e[t]=this[t]},this);e["selectByLines"]=this.extendSelectionBy.bind(e,"getLineRange");e["selectByWords"]=this.extendSelectionBy.bind(e,"getWordRange")}e.prototype.onMouseDown=function(e){var t=e.inSelection();var i=e.getDocumentPosition();this.mousedownEvent=e;var r=this.editor;var o=e.getButton();if(o!==0){var s=r.getSelectionRange();var a=s.isEmpty();if(a||o==1)r.selection.moveToPosition(i);if(o==2){r.textInput.onContextMenu(e.domEvent);if(!n.isMozilla)e.preventDefault()}return}this.mousedownEvent.time=Date.now();if(t&&!r.isFocused()){r.focus();if(this.$focusTimeout&&!this.$clickSelection&&!r.inMultiSelectMode){this.setState("focusWait");this.captureMouse(e);return}}this.captureMouse(e);this.startSelect(i,e.domEvent._clicks>1);return e.preventDefault()};e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;if(!this.mousedownEvent)return;if(this.mousedownEvent.getShiftKey())i.selection.selectToPosition(e);else if(!t)i.selection.moveToPosition(e);if(!t)this.select();i.setStyle("ace_selecting");this.setState("select")};e.prototype.select=function(){var e,t=this.editor;var i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(n==-1){e=this.$clickSelection.end}else if(n==1){e=this.$clickSelection.start}else{var r=l(this.$clickSelection,i);i=r.cursor;e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i);t.renderer.scrollCursorIntoView()};e.prototype.extendSelectionBy=function(e){var t,i=this.editor;var n=i.renderer.screenToTextCoordinates(this.x,this.y);var r=i.selection[e](n.row,n.column);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(r.start);var s=this.$clickSelection.comparePoint(r.end);if(o==-1&&s<=0){t=this.$clickSelection.end;if(r.end.row!=n.row||r.end.column!=n.column)n=r.start}else if(s==1&&o>=0){t=this.$clickSelection.start;if(r.start.row!=n.row||r.start.column!=n.column)n=r.end}else if(o==-1&&s==1){n=r.end;t=r.start}else{var a=l(this.$clickSelection,n);n=a.cursor;t=a.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n);i.renderer.scrollCursorIntoView()};e.prototype.selectByLinesEnd=function(){this.$clickSelection=null;this.editor.unsetStyle("ace_selecting")};e.prototype.focusWait=function(){var e=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);var t=Date.now();if(e>r||t-this.mousedownEvent.time>this.$focusTimeout)this.startSelect(this.mousedownEvent.getDocumentPosition())};e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition();var i=this.editor;var n=i.session;var r=n.getBracketRange(t);if(r){if(r.isEmpty()){r.start.column--;r.end.column++}this.setState("select")}else{r=i.selection.getWordRange(t.row,t.column);this.setState("selectByWords")}this.$clickSelection=r;this.select()};e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition();var i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();if(n.isMultiLine()&&n.contains(t.row,t.column)){this.$clickSelection=i.selection.getLineRange(n.start.row);this.$clickSelection.end=i.selection.getLineRange(n.end.row).end}else{this.$clickSelection=i.selection.getLineRange(t.row)}this.select()};e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll();this.$clickSelection=t.getSelectionRange();this.setState("selectAll")};e.prototype.onMouseWheel=function(e){if(e.getAccelKey())return;if(e.getShiftKey()&&e.wheelY&&!e.wheelX){e.wheelX=e.wheelY;e.wheelY=0}var t=this.editor;if(!this.$lastScroll)this.$lastScroll={t:0,vx:0,vy:0,allowed:0};var i=this.$lastScroll;var n=e.domEvent.timeStamp;var r=n-i.t;var s=r?e.wheelX/r:i.vx;var a=r?e.wheelY/r:i.vy;if(r<o){s=(s+i.vx)/2;a=(a+i.vy)/2}var l=Math.abs(s/a);var c=false;if(l>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0))c=true;if(l<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed))c=true;if(c){i.allowed=n}else if(n-i.allowed<o){var h=Math.abs(s)<=1.5*Math.abs(i.vx)&&Math.abs(a)<=1.5*Math.abs(i.vy);if(h){c=true;i.allowed=n}else{i.allowed=0}}i.t=n;i.vx=s;i.vy=a;if(c){t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed);return e.stop()}};return e}();s.prototype.selectEnd=s.prototype.selectByLinesEnd;s.prototype.selectAllEnd=s.prototype.selectByLinesEnd;s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd;t.DefaultHandlers=s;function a(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}function l(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var i=t.column-4;else var i=2*t.row-e.start.row-e.end.row;if(i<0)return{cursor:e.start,anchor:e.end};else return{cursor:e.end,anchor:e.start}}});ace.define("ace/lib/scroll",["require","exports","module"],function(e,t,i){t.preventParentScroll=function e(t){t.stopPropagation();var i=t.currentTarget;var n=i.scrollHeight>i.clientHeight;if(!n){t.preventDefault()}}});ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&n>=e.length)e=void 0;return{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var o=e("./lib/dom");var s=e("./lib/event");var a=e("./range").Range;var l=e("./lib/scroll").preventParentScroll;var c="ace_tooltip";var h=function(){function e(e){this.isOpen=false;this.$element=null;this.$parentNode=e}e.prototype.$init=function(){this.$element=o.createElement("div");this.$element.className=c;this.$element.style.display="none";this.$parentNode.appendChild(this.$element);return this.$element};e.prototype.getElement=function(){return this.$element||this.$init()};e.prototype.setText=function(e){this.getElement().textContent=e};e.prototype.setHtml=function(e){throw new Error("Can not set html for tooltip to avoid any CSP inline styles violations")};e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px";this.getElement().style.top=t+"px"};e.prototype.setClassName=function(e){o.addCssClass(this.getElement(),e)};e.prototype.setTheme=function(e){this.$element.className=c+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")};e.prototype.show=function(e,t,i){if(e!=null)this.setText(e);if(t!=null&&i!=null)this.setPosition(t,i);if(!this.isOpen){this.getElement().style.display="block";this.isOpen=true}};e.prototype.hide=function(e){if(this.isOpen){this.getElement().style.display="none";this.getElement().className=c;this.isOpen=false}};e.prototype.getHeight=function(){return this.getElement().offsetHeight};e.prototype.getWidth=function(){return this.getElement().offsetWidth};e.prototype.destroy=function(){this.isOpen=false;if(this.$element&&this.$element.parentNode){this.$element.parentNode.removeChild(this.$element)}};return e}();var u=function(){function e(){this.popups=[]}e.prototype.addPopup=function(e){this.popups.push(e);this.updatePopups()};e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);if(t!==-1){this.popups.splice(t,1);this.updatePopups()}};e.prototype.updatePopups=function(){var e,t,i,n;this.popups.sort(function(e,t){return t.priority-e.priority});var o=[];try{for(var s=r(this.popups),a=s.next();!a.done;a=s.next()){var l=a.value;var c=true;try{for(var h=(i=void 0,r(o)),u=h.next();!u.done;u=h.next()){var d=u.value;if(this.doPopupsOverlap(d,l)){c=false;break}}}catch(e){i={error:e}}finally{try{if(u&&!u.done&&(n=h.return))n.call(h)}finally{if(i)throw i.error}}if(c){o.push(l)}else{l.hide()}}}catch(t){e={error:t}}finally{try{if(a&&!a.done&&(t=s.return))t.call(s)}finally{if(e)throw e.error}}};e.prototype.doPopupsOverlap=function(e,t){var i=e.getElement().getBoundingClientRect();var n=t.getElement().getBoundingClientRect();return i.left<n.right&&i.right>n.left&&i.top<n.bottom&&i.bottom>n.top};return e}();var d=new u;t.popupManager=d;t.Tooltip=h;var f=function(e){n(t,e);function t(t){if(t===void 0){t=document.body}var i=e.call(this,t)||this;i.timeout=undefined;i.lastT=0;i.idleTime=350;i.lastEvent=undefined;i.onMouseOut=i.onMouseOut.bind(i);i.onMouseMove=i.onMouseMove.bind(i);i.waitForHover=i.waitForHover.bind(i);i.hide=i.hide.bind(i);var n=i.getElement();n.style.whiteSpace="pre-wrap";n.style.pointerEvents="auto";n.addEventListener("mouseout",i.onMouseOut);n.tabIndex=-1;n.addEventListener("blur",function(){if(!n.contains(document.activeElement))this.hide()}.bind(i));n.addEventListener("wheel",l);return i}t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove);e.on("mousedown",this.hide);e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,true)};t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove);e.off("mousedown",this.hide);e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,true);if(this.timeout){clearTimeout(this.timeout);this.timeout=null}};t.prototype.onMouseMove=function(e,t){this.lastEvent=e;this.lastT=Date.now();var i=t.$mouseHandler.isMousePressed;if(this.isOpen){var n=this.lastEvent&&this.lastEvent.getDocumentPosition();if(!this.range||!this.range.contains(n.row,n.column)||i||this.isOutsideOfText(this.lastEvent)){this.hide()}}if(this.timeout||i)return;this.lastEvent=e;this.timeout=setTimeout(this.waitForHover,this.idleTime)};t.prototype.waitForHover=function(){if(this.timeout)clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null;if(this.lastEvent&&!this.isOutsideOfText(this.lastEvent)){this.$gatherData(this.lastEvent,this.lastEvent.editor)}};t.prototype.isOutsideOfText=function(e){var t=e.editor;var i=e.getDocumentPosition();var n=t.session.getLine(i.row);if(i.column==n.length){var r=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY);var o=t.session.documentToScreenPosition(i.row,i.column);if(o.column!=r.column||o.row!=r.row){return true}}return false};t.prototype.setDataProvider=function(e){this.$gatherData=e};t.prototype.showForRange=function(e,t,i,n){var r=10;if(n&&n!=this.lastEvent)return;if(this.isOpen&&document.activeElement==this.getElement())return;var o=e.renderer;if(!this.isOpen){d.addPopup(this);this.$registerCloseEvents();this.setTheme(o.theme)}this.isOpen=true;this.addMarker(t,e.session);this.range=a.fromPoints(t.start,t.end);var s=o.textToScreenCoordinates(t.start.row,t.start.column);var l=o.scroller.getBoundingClientRect();if(s.pageX<l.left)s.pageX=l.left;var c=this.getElement();c.innerHTML="";c.appendChild(i);c.style.maxHeight="";c.style.display="block";var h=c.clientHeight;var u=c.clientWidth;var f=window.innerHeight-s.pageY-o.lineHeight;var g=true;if(s.pageY-h<0&&s.pageY<f){g=false}c.style.maxHeight=(g?s.pageY:f)-r+"px";c.style.top=g?"":s.pageY+o.lineHeight+"px";c.style.bottom=g?window.innerHeight-s.pageY+"px":"";c.style.left=Math.min(s.pageX,window.innerWidth-u-r)+"px"};t.prototype.addMarker=function(e,t){if(this.marker){this.$markerSession.removeMarker(this.marker)}this.$markerSession=t;this.marker=t&&t.addMarker(e,"ace_highlight-marker","text")};t.prototype.hide=function(e){if(!e&&document.activeElement==this.getElement())return;if(e&&e.target&&(e.type!="keydown"||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target))return;this.lastEvent=null;if(this.timeout)clearTimeout(this.timeout);this.timeout=null;this.addMarker(null);if(this.isOpen){this.$removeCloseEvents();this.getElement().style.display="none";this.isOpen=false;d.removePopup(this)}};t.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,true);window.addEventListener("wheel",this.hide,true);window.addEventListener("mousedown",this.hide,true)};t.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,true);window.removeEventListener("wheel",this.hide,true);window.removeEventListener("mousedown",this.hide,true)};t.prototype.onMouseOut=function(e){if(this.timeout){clearTimeout(this.timeout);this.timeout=null}this.lastEvent=null;if(!this.isOpen)return;if(!e.relatedTarget||this.getElement().contains(e.relatedTarget))return;if(e&&e.currentTarget.contains(e.relatedTarget))return;if(!e.relatedTarget.classList.contains("ace_content"))this.hide()};return t}(h);t.HoverTooltip=f});ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&n>=e.length)e=void 0;return{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var o=e("../lib/dom");var s=e("../lib/event");var a=e("../tooltip").Tooltip;var l=e("../config").nls;var c=e("../lib/lang");function h(e){var t=e.editor;var i=t.renderer.$gutterLayer;var n=new u(t);e.editor.setDefaultHandler("guttermousedown",function(n){if(!t.isFocused()||n.getButton()!=0)return;var r=i.getRegion(n);if(r=="foldWidgets")return;var o=n.getDocumentPosition().row;var s=t.session.selection;if(n.getShiftKey())s.selectTo(o,0);else{if(n.domEvent.detail==2){t.selectAll();return n.preventDefault()}e.$clickSelection=t.selection.getLineRange(o)}e.setState("selectByLines");e.captureMouse(n);return n.preventDefault()});var r,a;function l(){var r=a.getDocumentPosition().row;var o=t.session.getLength();if(r==o){var s=t.renderer.pixelToScreenCoordinates(0,a.y).row;var l=a.$pos;if(s>t.session.documentToScreenRow(l.row,l.column))return c()}n.showTooltip(r);if(!n.isOpen)return;t.on("mousewheel",c);if(e.$tooltipFollowsMouse){h(a)}else{var u=a.getGutterRow();var d=i.$lines.get(u);if(d){var f=d.element.querySelector(".ace_gutter_annotation");var g=f.getBoundingClientRect();var p=n.getElement().style;p.left=g.right+"px";p.top=g.bottom+"px"}else{h(a)}}}function c(){if(r)r=clearTimeout(r);if(n.isOpen){n.hideTooltip();t.off("mousewheel",c)}}function h(e){n.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousemove",function(t){var i=t.domEvent.target||t.domEvent.srcElement;if(o.hasCssClass(i,"ace_fold-widget"))return c();if(n.isOpen&&e.$tooltipFollowsMouse)h(t);a=t;if(r)return;r=setTimeout(function(){r=null;if(a&&!e.isMousePressed)l();else c()},50)});s.addListener(t.renderer.$gutter,"mouseout",function(e){a=null;if(!n.isOpen||r)return;r=setTimeout(function(){r=null;c()},50)},t);t.on("changeSession",c);t.on("input",c)}t.GutterHandler=h;var u=function(e){n(t,e);function t(t){var i=e.call(this,t.container)||this;i.editor=t;return i}t.prototype.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth;var n=window.innerHeight||document.documentElement.clientHeight;var r=this.getWidth();var o=this.getHeight();e+=15;t+=15;if(e+r>i){e-=e+r-i}if(t+o>n){t-=20+o}a.prototype.setPosition.call(this,e,t)};Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:l("gutter-tooltip.aria-label.error.singular","error"),plural:l("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:l("gutter-tooltip.aria-label.security.singular","security finding"),plural:l("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:l("gutter-tooltip.aria-label.warning.singular","warning"),plural:l("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:l("gutter-tooltip.aria-label.info.singular","information message"),plural:l("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:l("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:l("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:false,configurable:true});t.prototype.showTooltip=function(e){var i;var n=this.editor.renderer.$gutterLayer;var r=n.$annotations[e];var s;if(r)s={displayText:Array.from(r.displayText),type:Array.from(r.type)};else s={displayText:[],type:[]};var a=n.session.getFoldLine(e);if(a&&n.$showFoldedAnnotations){var l={error:[],security:[],warning:[],info:[],hint:[]};var c={error:1,security:2,warning:3,info:4,hint:5};var h;for(var u=e+1;u<=a.end.row;u++){if(!n.$annotations[u])continue;for(var d=0;d<n.$annotations[u].text.length;d++){var f=n.$annotations[u].type[d];l[f].push(n.$annotations[u].text[d]);if(!h||c[f]<c[h]){h=f}}}if(["error","security","warning"].includes(h)){var g="".concat(t.annotationsToSummaryString(l)," in folded code.");s.displayText.push(g);s.type.push(h+"_fold")}}if(s.displayText.length===0)return this.hide();var p={error:[],security:[],warning:[],info:[],hint:[]};var m=n.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";for(var u=0;u<s.displayText.length;u++){var v=o.createElement("span");var y=o.createElement("span");(i=y.classList).add.apply(i,["ace_".concat(s.type[u]),m]);y.setAttribute("aria-label","".concat(t.annotationLabels[s.type[u].replace("_fold","")].singular));y.setAttribute("role","img");y.appendChild(o.createTextNode(" "));v.appendChild(y);v.appendChild(o.createTextNode(s.displayText[u]));v.appendChild(o.createElement("br"));p[s.type[u].replace("_fold","")].push(v)}var w=this.getElement();o.removeChildren(w);p.error.forEach(function(e){return w.appendChild(e)});p.security.forEach(function(e){return w.appendChild(e)});p.warning.forEach(function(e){return w.appendChild(e)});p.info.forEach(function(e){return w.appendChild(e)});p.hint.forEach(function(e){return w.appendChild(e)});w.setAttribute("aria-live","polite");if(!this.isOpen){this.setTheme(this.editor.renderer.theme);this.setClassName("ace_gutter-tooltip")}this.show();this.editor._signal("showGutterTooltip",this)};t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live");this.hide();this.editor._signal("hideGutterTooltip",this)};t.annotationsToSummaryString=function(e){var i,n;var o=[];var s=["error","security","warning","info","hint"];try{for(var a=r(s),l=a.next();!l.done;l=a.next()){var c=l.value;if(!e[c].length)continue;var h=e[c].length===1?t.annotationLabels[c].singular:t.annotationLabels[c].plural;o.push("".concat(e[c].length," ").concat(h))}}catch(e){i={error:e}}finally{try{if(l&&!l.done&&(n=a.return))n.call(a)}finally{if(i)throw i.error}}return o.join(", ")};return t}(a);t.GutterTooltip=u});ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/event");var r=e("../lib/useragent");var o=function(){function e(e,t){this.speed;this.wheelX;this.wheelY;this.domEvent=e;this.editor=t;this.x=this.clientX=e.clientX;this.y=this.clientY=e.clientY;this.$pos=null;this.$inSelection=null;this.propagationStopped=false;this.defaultPrevented=false}e.prototype.stopPropagation=function(){n.stopPropagation(this.domEvent);this.propagationStopped=true};e.prototype.preventDefault=function(){n.preventDefault(this.domEvent);this.defaultPrevented=true};e.prototype.stop=function(){this.stopPropagation();this.preventDefault()};e.prototype.getDocumentPosition=function(){if(this.$pos)return this.$pos;this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY);return this.$pos};e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;var t=this.editor.session.documentToScreenRow(e,0);var i=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return t-i};e.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor;var t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=false;else{var i=this.getDocumentPosition();this.$inSelection=t.contains(i.row,i.column)}return this.$inSelection};e.prototype.getButton=function(){return n.getButton(this.domEvent)};e.prototype.getShiftKey=function(){return this.domEvent.shiftKey};e.prototype.getAccelKey=function(){return r.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey};return e}();t.MouseEvent=o});ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=e("../lib/event");var o=e("../lib/useragent");var s=200;var a=200;var l=5;function c(e){var t=e.editor;var i=n.createElement("div");i.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5";i.textContent=" ";var c=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];c.forEach(function(t){e[t]=this[t]},this);t.on("mousedown",this.onMouseDown.bind(e));var u=t.container;var d,f,g;var p,m;var v,y=0;var w;var b;var $;var C;var S;this.onDragStart=function(e){if(this.cancelDrag||!u.draggable){var n=this;setTimeout(function(){n.startSelect();n.captureMouse(e)},0);return e.preventDefault()}m=t.getSelectionRange();var r=e.dataTransfer;r.effectAllowed=t.getReadOnly()?"copy":"copyMove";t.container.appendChild(i);r.setDragImage&&r.setDragImage(i,0,0);setTimeout(function(){t.container.removeChild(i)});r.clearData();r.setData("Text",t.session.getTextRange());b=true;this.setState("drag")};this.onDragEnd=function(e){u.draggable=false;b=false;this.setState(null);if(!t.getReadOnly()){var i=e.dataTransfer.dropEffect;if(!w&&i=="move")t.session.remove(t.getSelectionRange());t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging");this.editor.renderer.setCursorStyle("")};this.onDragEnter=function(e){if(t.getReadOnly()||!R(e.dataTransfer))return;f=e.clientX;g=e.clientY;if(!d)k();y++;e.dataTransfer.dropEffect=w=I(e);return r.preventDefault(e)};this.onDragOver=function(e){if(t.getReadOnly()||!R(e.dataTransfer))return;f=e.clientX;g=e.clientY;if(!d){k();y++}if(T!==null)T=null;e.dataTransfer.dropEffect=w=I(e);return r.preventDefault(e)};this.onDragLeave=function(e){y--;if(y<=0&&d){L();w=null;return r.preventDefault(e)}};this.onDrop=function(e){if(!v)return;var i=e.dataTransfer;if(b){switch(w){case"move":if(m.contains(v.row,v.column)){m={start:v,end:v}}else{m=t.moveText(m,v)}break;case"copy":m=t.moveText(m,v,true);break}}else{var n=i.getData("Text");m={start:v,end:t.session.insert(v,n)};t.focus();w=null}L();return r.preventDefault(e)};r.addListener(u,"dragstart",this.onDragStart.bind(e),t);r.addListener(u,"dragend",this.onDragEnd.bind(e),t);r.addListener(u,"dragenter",this.onDragEnter.bind(e),t);r.addListener(u,"dragover",this.onDragOver.bind(e),t);r.addListener(u,"dragleave",this.onDragLeave.bind(e),t);r.addListener(u,"drop",this.onDrop.bind(e),t);function x(e,i){var n=Date.now();var r=!i||e.row!=i.row;var o=!i||e.column!=i.column;if(!C||r||o){t.moveCursorToPosition(e);C=n;S={x:f,y:g}}else{var s=h(S.x,S.y,f,g);if(s>l){C=null}else if(n-C>=a){t.renderer.scrollCursorIntoView();C=null}}}function A(e,i){var n=Date.now();var r=t.renderer.layerConfig.lineHeight;var o=t.renderer.layerConfig.characterWidth;var a=t.renderer.scroller.getBoundingClientRect();var l={x:{left:f-a.left,right:a.right-f},y:{top:g-a.top,bottom:a.bottom-g}};var c=Math.min(l.x.left,l.x.right);var h=Math.min(l.y.top,l.y.bottom);var u={row:e.row,column:e.column};if(c/o<=2){u.column+=l.x.left<l.x.right?-3:+2}if(h/r<=1){u.row+=l.y.top<l.y.bottom?-1:+1}var d=e.row!=u.row;var p=e.column!=u.column;var m=!i||e.row!=i.row;if(d||p&&!m){if(!$)$=n;else if(n-$>=s)t.renderer.scrollCursorIntoView(u)}else{$=null}}function M(){var e=v;v=t.renderer.screenToTextCoordinates(f,g);x(v,e);A(v,e)}function k(){m=t.selection.toOrientedRange();d=t.session.addMarker(m,"ace_selection",t.getSelectionStyle());t.clearSelection();if(t.isFocused())t.renderer.$cursorLayer.setBlinking(false);clearInterval(p);M();p=setInterval(M,20);y=0;r.addListener(document,"mousemove",E)}function L(){clearInterval(p);t.session.removeMarker(d);d=null;t.selection.fromOrientedRange(m);if(t.isFocused()&&!b)t.$resetCursorStyle();m=null;v=null;y=0;$=null;C=null;r.removeListener(document,"mousemove",E)}var T=null;function E(){if(T==null){T=setTimeout(function(){if(T!=null&&d)L()},20)}}function R(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function I(e){var t=["copy","copymove","all","uninitialized"];var i=["move","copymove","linkmove","all","uninitialized"];var n=o.isMac?e.altKey:e.ctrlKey;var r="uninitialized";try{r=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";if(n&&t.indexOf(r)>=0)s="copy";else if(i.indexOf(r)>=0)s="move";else if(t.indexOf(r)>=0)s="copy";return s}}(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;if(e>this.editor.getDragDelay())this.startDrag()};this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=false;this.startSelect(this.mousedownEvent.getDocumentPosition());this.selectEnd()};this.dragReadyEnd=function(e){this.editor.$resetCursorStyle();this.editor.unsetStyle("ace_dragging");this.editor.renderer.setCursorStyle("");this.dragWaitEnd()};this.startDrag=function(){this.cancelDrag=false;var e=this.editor;var t=e.container;t.draggable=true;e.renderer.$cursorLayer.setBlinking(false);e.setStyle("ace_dragging");var i=o.isWin?"default":"move";e.renderer.setCursorStyle(i);this.setState("dragReady")};this.onMouseDrag=function(e){var t=this.editor.container;if(o.isIE&&this.state=="dragReady"){var i=h(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);if(i>3)t.dragDrop()}if(this.state==="dragWait"){var i=h(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);if(i>0){t.draggable=false;this.startSelect(this.mousedownEvent.getDocumentPosition())}}};this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor;var i=e.inSelection();var n=e.getButton();var r=e.domEvent.detail||1;if(r===1&&n===0&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s)s.unselectable="on";if(t.getDragDelay()){if(o.isWebKit){this.cancelDrag=true;var a=t.container;a.draggable=true}this.setState("dragWait")}else{this.startDrag()}this.captureMouse(e,this.onMouseDrag.bind(this));e.defaultPrevented=true}}}).call(c.prototype);function h(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}t.DragdropHandler=c});ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./mouse_event").MouseEvent;var r=e("../lib/event");var o=e("../lib/dom");t.addTouchListeners=function(e,t){var i="scroll";var s;var a;var l;var c;var h;var u;var d=0;var f;var g=0;var p=0;var m=0;var v;var y;function w(){var e=window.navigator&&window.navigator.clipboard;var n=false;var r=function(){var i=t.getCopyText();var r=t.session.getUndoManager().hasUndo();y.replaceChild(o.buildDom(n?["span",!i&&s("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],i&&s("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],i&&s("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&s("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],r&&s("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],s("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],s("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),y.firstChild)};var s=function(e){return t.commands.canExecute(e,t)};var a=function(i){var o=i.target.getAttribute("action");if(o=="more"||!n){n=!n;return r()}if(o=="paste"){e.readText().then(function(e){t.execCommand(o,e)})}else if(o){if(o=="cut"||o=="copy"){if(e)e.writeText(t.getCopyText());else document.execCommand("copy")}t.execCommand(o)}y.firstChild.style.display="none";n=false;if(o!="openCommandPalette")t.focus()};y=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){i="menu";e.stopPropagation();e.preventDefault();t.textInput.focus()},ontouchend:function(e){e.stopPropagation();e.preventDefault();a(e)},onclick:a},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function b(){if(!t.getOption("enableMobileMenu")){if(y){$()}return}if(!y)w();var e=t.selection.cursor;var i=t.renderer.textToScreenCoordinates(e.row,e.column);var n=t.renderer.textToScreenCoordinates(0,0).pageX;var r=t.renderer.scrollLeft;var o=t.container.getBoundingClientRect();y.style.top=i.pageY-o.top-3+"px";if(i.pageX-o.left<o.width-70){y.style.left="";y.style.right="10px"}else{y.style.right="";y.style.left=n+r-o.left+"px"}y.style.display="";y.firstChild.style.display="none";t.on("input",$)}function $(e){if(y)y.style.display="none";t.off("input",$)}function C(){h=null;clearTimeout(h);var e=t.selection.getRange();var n=e.contains(f.row,f.column);if(e.isEmpty()||!n){t.selection.moveToPosition(f);t.selection.selectWord()}i="wait";b()}function S(){h=null;clearTimeout(h);t.selection.moveToPosition(f);var e=g>=2?t.selection.getLineRange(f.row):t.session.getBracketRange(f);if(e&&!e.isEmpty()){t.selection.setRange(e)}else{t.selection.selectWord()}i="wait"}r.addListener(e,"contextmenu",function(e){if(!v)return;var i=t.textInput.getElement();i.focus()},t);r.addListener(e,"touchstart",function(e){var r=e.touches;if(h||r.length>1){clearTimeout(h);h=null;l=-1;i="zoom";return}v=t.$mouseHandler.isMousePressed=true;var o=t.renderer.layerConfig.lineHeight;var u=t.renderer.layerConfig.lineHeight;var y=e.timeStamp;c=y;var w=r[0];var b=w.clientX;var $=w.clientY;if(Math.abs(s-b)+Math.abs(a-$)>o)l=-1;s=e.clientX=b;a=e.clientY=$;p=m=0;var x=new n(e,t);f=x.getDocumentPosition();if(y-l<500&&r.length==1&&!d){g++;e.preventDefault();e.button=0;S()}else{g=0;var A=t.selection.cursor;var M=t.selection.isEmpty()?A:t.selection.anchor;var k=t.renderer.$cursorLayer.getPixelPosition(A,true);var L=t.renderer.$cursorLayer.getPixelPosition(M,true);var T=t.renderer.scroller.getBoundingClientRect();var E=t.renderer.layerConfig.offset;var R=t.renderer.scrollLeft;var I=function(e,t){e=e/u;t=t/o-.75;return e*e+t*t};if(e.clientX<T.left){i="zoom";return}var _=I(e.clientX-T.left-k.left+R,e.clientY-T.top-k.top+E);var D=I(e.clientX-T.left-L.left+R,e.clientY-T.top-L.top+E);if(_<3.5&&D<3.5)i=_>D?"cursor":"anchor";if(D<3.5)i="anchor";else if(_<3.5)i="cursor";else i="scroll";h=setTimeout(C,450)}l=y},t);r.addListener(e,"touchend",function(e){v=t.$mouseHandler.isMousePressed=false;if(u)clearInterval(u);if(i=="zoom"){i="";d=0}else if(h){t.selection.moveToPosition(f);d=0;b()}else if(i=="scroll"){x();$()}else{b()}clearTimeout(h);h=null},t);r.addListener(e,"touchmove",function(e){if(h){clearTimeout(h);h=null}var r=e.touches;if(r.length>1||i=="zoom")return;var o=r[0];var l=s-o.clientX;var u=a-o.clientY;if(i=="wait"){if(l*l+u*u>4)i="cursor";else return e.preventDefault()}s=o.clientX;a=o.clientY;e.clientX=o.clientX;e.clientY=o.clientY;var d=e.timeStamp;var f=d-c;c=d;if(i=="scroll"){var g=new n(e,t);g.speed=1;g.wheelX=l;g.wheelY=u;if(10*Math.abs(l)<Math.abs(u))l=0;if(10*Math.abs(u)<Math.abs(l))u=0;if(f!=0){p=l/f;m=u/f}t._emit("mousewheel",g);if(!g.propagationStopped){p=m=0}}else{var v=new n(e,t);var y=v.getDocumentPosition();if(i=="cursor")t.selection.moveCursorToPosition(y);else if(i=="anchor")t.selection.setSelectionAnchor(y.row,y.column);t.renderer.scrollCursorIntoView(y);e.preventDefault()}},t);function x(){d+=60;u=setInterval(function(){if(d--<=0){clearInterval(u);u=null}if(Math.abs(p)<.01)p=0;if(Math.abs(m)<.01)m=0;if(d<20)p=.9*p;if(d<20)m=.9*m;var e=t.session.getScrollTop();t.renderer.scrollBy(10*p,10*m);if(e==t.session.getScrollTop())d=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(e,t,i){"use strict";var n=e("../lib/event");var r=e("../lib/useragent");var o=e("./default_handlers").DefaultHandlers;var s=e("./default_gutter_handler").GutterHandler;var a=e("./mouse_event").MouseEvent;var l=e("./dragdrop_handler").DragdropHandler;var c=e("./touch_handler").addTouchListeners;var h=e("../config");var u=function(){function e(e){this.$dragDelay;this.$dragEnabled;this.$mouseMoved;this.mouseEvent;this.$focusTimeout;var t=this;this.editor=e;new o(this);new s(this);new l(this);var i=function(t){var i=!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement());if(i)window.focus();e.focus();setTimeout(function(){if(!e.isFocused())e.focus()})};var a=e.renderer.getMouseEventTarget();n.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e);n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e);n.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e);n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e);c(e.container,e);var h=e.renderer.$gutter;n.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e);n.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick"),e);n.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e);n.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e);n.addListener(a,"mousedown",i,e);n.addListener(h,"mousedown",i,e);if(r.isIE&&e.renderer.scrollBarV){n.addListener(e.renderer.scrollBarV.element,"mousedown",i,e);n.addListener(e.renderer.scrollBarH.element,"mousedown",i,e)}e.on("mousemove",function(i){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var n=e.renderer.screenToTextCoordinates(i.x,i.y);var r=e.session.selection.getRange();var o=e.renderer;if(!r.isEmpty()&&r.insideStart(n.row,n.column)){o.setCursorStyle("default")}else{o.setCursorStyle("")}},e)}e.prototype.onMouseEvent=function(e,t){if(!this.editor.session)return;this.editor._emit(e,new a(t,this.editor))};e.prototype.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!i||!i.length)return;this.editor._emit(e,new a(t,this.editor))};e.prototype.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=this.$scrollSpeed*2;i.wheelX=t.wheelX;i.wheelY=t.wheelY;this.editor._emit(e,i)};e.prototype.setState=function(e){this.state=e};e.prototype.captureMouse=function(e,t){this.x=e.x;this.y=e.y;this.isMousePressed=true;var i=this.editor;var o=this.editor.renderer;o.$isMousePressed=true;var s=this;var l=function(e){if(!e)return;if(r.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX;s.y=e.clientY;t&&t(e);s.mouseEvent=new a(e,s.editor);s.$mouseMoved=true};var c=function(e){i.off("beforeEndOperation",u);clearInterval(d);if(i.session)h();s[s.state+"End"]&&s[s.state+"End"](e);s.state="";s.isMousePressed=o.$isMousePressed=false;if(o.$keepTextAreaAtCursor)o.$moveTextAreaToCursor();s.$onCaptureMouseMove=s.releaseMouse=null;e&&s.onMouseEvent("mouseup",e);i.endOperation()};var h=function(){s[s.state]&&s[s.state]();s.$mouseMoved=false};if(r.isOldIE&&e.domEvent.type=="dblclick"){return setTimeout(function(){c(e)})}var u=function(e){if(!s.releaseMouse)return;if(i.curOp.command.name&&i.curOp.selectionChanged){s[s.state+"End"]&&s[s.state+"End"]();s.state="";s.releaseMouse()}};i.on("beforeEndOperation",u);i.startOperation({command:{name:"mouse"}});s.$onCaptureMouseMove=l;s.releaseMouse=n.capture(this.editor.container,l,c);var d=setInterval(h,20)};e.prototype.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e);if(t&&t.domEvent)n.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10);this.editor.on("nativecontextmenu",e)};e.prototype.destroy=function(){if(this.releaseMouse)this.releaseMouse()};return e}();u.prototype.releaseMouse=null;h.defineOptions(u.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:r.isMac?150:0},dragEnabled:{initialValue:true},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:true}});t.MouseHandler=u});ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=function(){function e(e){e.on("click",function(t){var i=t.getDocumentPosition();var r=e.session;var o=r.getFoldAt(i.row,i.column,1);if(o){if(t.getAccelKey())r.removeFold(o);else r.expandFold(o);t.stop()}var s=t.domEvent&&t.domEvent.target;if(s&&n.hasCssClass(s,"ace_inline_button")){if(n.hasCssClass(s,"ace_toggle_wrap")){r.setOption("wrap",!r.getUseWrapMode());e.renderer.scrollCursorIntoView()}}});e.on("gutterclick",function(t){var i=e.renderer.$gutterLayer.getRegion(t);if(i=="foldWidgets"){var n=t.getDocumentPosition().row;var r=e.session;if(r.foldWidgets&&r.foldWidgets[n])e.session.onFoldWidgetClick(n,t);if(!e.isFocused())e.focus();t.stop()}});e.on("gutterdblclick",function(t){var i=e.renderer.$gutterLayer.getRegion(t);if(i=="foldWidgets"){var n=t.getDocumentPosition().row;var r=e.session;var o=r.getParentFoldRangeData(n,true);var s=o.range||o.firstRange;if(s){n=s.start.row;var a=r.getFoldAt(n,r.getLine(n).length,1);if(a){r.removeFold(a)}else{r.addFold("...",s);e.renderer.scrollCursorIntoView({row:s.start.row,column:0})}}t.stop()}})}return e}();t.FoldHandler=r});ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,i){"use strict";var n=e("../lib/keys");var r=e("../lib/event");var o=function(){function e(e){this.$editor=e;this.$data={editor:e};this.$handlers=[];this.setDefaultHandler(e.commands)}e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler);this.$defaultHandler=e;this.addKeyboardHandler(e,0)};e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)};e.prototype.addKeyboardHandler=function(e,t){if(!e)return;if(typeof e=="function"&&!e.handleKeyboard)e.handleKeyboard=e;var i=this.$handlers.indexOf(e);if(i!=-1)this.$handlers.splice(i,1);if(t==undefined)this.$handlers.push(e);else this.$handlers.splice(t,0,e);if(i==-1&&e.attach)e.attach(this.$editor)};e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);if(t==-1)return false;this.$handlers.splice(t,1);e.detach&&e.detach(this.$editor);return true};e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]};e.prototype.getStatusText=function(){var e=this.$data;var t=e.editor;return this.$handlers.map(function(i){return i.getStatusText&&i.getStatusText(t,e)||""}).filter(Boolean).join(" ")};e.prototype.$callKeyboardHandlers=function(e,t,i,n){var o;var s=false;var a=this.$editor.commands;for(var l=this.$handlers.length;l--;){o=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n);if(!o||!o.command)continue;if(o.command=="null"){s=true}else{s=a.exec(o.command,this.$editor,o.args,n)}if(s&&n&&e!=-1&&o["passEvent"]!=true&&o.command["passEvent"]!=true){r.stopEvent(n)}if(s)break}if(!s&&e==-1){o={command:"insertstring"};s=a.exec("insertstring",this.$editor,t)}if(s&&this.$editor._signal)this.$editor._signal("keyboardActivity",o);return s};e.prototype.onCommandKey=function(e,t,i){var r=n.keyCodeToString(i);return this.$callKeyboardHandlers(t,r,i,e)};e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)};return e}();t.KeyBinding=o});ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t,i){"use strict";var n=["ء","ف"];var r=["غ","ي"];var o=0,s=0;var a=false,l=false,c=false,h=false,u=false,d=false;var f=[[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]];var g=[[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]];var p=0,m=1;var v=0;var y=1;var w=2;var b=3;var $=4;var C=5;var S=6;var x=7;var A=8;var M=9;var k=10;var L=11;var T=12;var E=13;var R=14;var I=15;var _=16;var D=17;var N=18;var O=[N,N,N,N,N,N,N,N,N,S,C,S,A,C,N,N,N,N,N,N,N,N,N,N,N,N,N,N,C,C,C,S,A,$,$,L,L,L,$,$,$,$,$,k,M,k,M,M,w,w,w,w,w,w,w,w,w,w,M,$,$,$,$,$,$,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,$,$,$,$,$,$,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,$,$,$,$,N,N,N,N,N,N,C,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,M,$,L,L,L,L,$,$,$,$,v,$,$,N,$,$,L,L,w,w,$,v,$,$,$,w,v,$,$,$,$,$];var W=[A,A,A,A,A,A,A,A,A,A,A,N,N,N,v,y,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,A,C,E,R,I,_,D,M,L,L,L,L,L,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,M,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,A];function F(e,t,i,n){var r=o?g:f,u=null,d=null,p=null,m=0,v=null,y=null,w=-1,b=null,$=null,x=[];if(!n){for(b=0,n=[];b<i;b++){n[b]=B(e[b])}}s=o;a=false;l=false;c=false;h=false;for($=0;$<i;$++){u=m;x[$]=d=H(e,n,x,$);m=r[u][d];v=m&240;m&=15;t[$]=p=r[m][5];if(v>0){if(v==16){for(b=w;b<$;b++){t[b]=1}w=-1}else{w=-1}}y=r[m][6];if(y){if(w==-1){w=$}}else{if(w>-1){for(b=w;b<$;b++){t[b]=p}w=-1}}if(n[$]==C){t[$]=0}s|=p}if(h){for(b=0;b<i;b++){if(n[b]==S){t[b]=o;for(var M=b-1;M>=0;M--){if(n[M]==A){t[M]=o}else{break}}}}}}function z(e,t,i){if(s<e){return}if(e==1&&o==m&&!c){i.reverse();return}var n=i.length,r=0,a,l,h,u;while(r<n){if(t[r]>=e){a=r+1;while(a<n&&t[a]>=e){a++}for(l=r,h=a-1;l<h;l++,h--){u=i[l];i[l]=i[h];i[h]=u}r=a}r++}}function H(e,t,i,n){var r=t[n],s,u,d,f;switch(r){case v:case y:a=false;case $:case b:return r;case w:return a?b:w;case x:a=true;l=true;return y;case A:return $;case M:if(n<1||n+1>=t.length||(s=i[n-1])!=w&&s!=b||(u=t[n+1])!=w&&u!=b){return $}if(a){u=b}return u==s?u:$;case k:s=n>0?i[n-1]:C;if(s==w&&n+1<t.length&&t[n+1]==w){return w}return $;case L:if(n>0&&i[n-1]==w){return w}if(a){return $}f=n+1;d=t.length;while(f<d&&t[f]==L){f++}if(f<d&&t[f]==w){return w}return $;case T:d=t.length;f=n+1;while(f<d&&t[f]==T){f++}if(f<d){var g=e[n],p=g>=1425&&g<=2303||g==64286;s=t[f];if(p&&(s==y||s==x)){return y}}if(n<1||(s=t[n-1])==C){return $}return i[n-1];case C:a=false;c=true;return o;case S:h=true;return $;case E:case R:case _:case D:case I:a=false;case N:return $}}function B(e){var t=e.charCodeAt(0),i=t>>8;if(i==0){return t>191?v:O[t]}else if(i==5){return/[\u0591-\u05f4]/.test(e)?y:v}else if(i==6){if(/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e))return T;else if(/[\u0660-\u0669\u066b-\u066c]/.test(e))return b;else if(t==1642)return L;else if(/[\u06f0-\u06f9]/.test(e))return w;else return x}else if(i==32&&t<=8287){return W[t&255]}else if(i==254){return t>=65136?x:$}return $}function P(e){return e>="ً"&&e<="ٕ"}t.L=v;t.R=y;t.EN=w;t.ON_R=3;t.AN=4;t.R_H=5;t.B=6;t.RLE=7;t.DOT="·";t.doBidiReorder=function(e,i,n){if(e.length<2)return{};var r=e.split(""),s=new Array(r.length),a=new Array(r.length),l=[];o=n?m:p;F(r,l,r.length,i);for(var c=0;c<s.length;s[c]=c,c++);z(2,l,s);z(1,l,s);for(var c=0;c<s.length-1;c++){if(i[c]===b){l[c]=t.AN}else if(l[c]===y&&(i[c]>x&&i[c]<E||i[c]===$||i[c]===N)){l[c]=t.ON_R}else if(c>0&&r[c-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(r[c])){l[c-1]=l[c]=t.R_H;c++}}if(r[r.length-1]===t.DOT)l[r.length-1]=t.B;if(r[0]==="‫")l[0]=t.RLE;for(var c=0;c<s.length;c++){a[c]=l[s[c]]}return{logicalFromVisual:s,bidiLevels:a}};t.hasBidiCharacters=function(e,t){var i=false;for(var n=0;n<e.length;n++){t[n]=B(e.charAt(n));if(!i&&(t[n]==y||t[n]==x||t[n]==b))i=true}return i};t.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++){if(t.logicalFromVisual[i]==e)return i}return 0}});ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t,i){"use strict";var n=e("./lib/bidiutil");var r=e("./lib/lang");var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;var s=function(){function e(e){this.session=e;this.bidiMap={};this.currentRow=null;this.bidiUtil=n;this.charWidths=[];this.EOL="¬";this.showInvisibles=true;this.isRtlDir=false;this.$isRtl=false;this.line="";this.wrapIndent=0;this.EOF="¶";this.RLE="‫";this.contentWidth=0;this.fontMetrics=null;this.rtlLineOffset=0;this.wrapOffset=0;this.isMoveLeftOperation=false;this.seenBidi=o.test(e.getValue())}e.prototype.isBidiRow=function(e,t,i){if(!this.seenBidi)return false;if(e!==this.currentRow){this.currentRow=e;this.updateRowLine(t,i);this.updateBidiMap()}return this.bidiMap.bidiLevels};e.prototype.onChange=function(e){if(!this.seenBidi){if(e.action=="insert"&&o.test(e.lines.join("\n"))){this.seenBidi=true;this.currentRow=null}}else{this.currentRow=null}};e.prototype.getDocumentRow=function(){var e=0;var t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);if(i>=0)e=this.session.$docRowCache[i]}return e};e.prototype.getSplitIndex=function(){var e=0;var t=this.session.$screenRowCache;if(t.length){var i,n=this.session.$getRowCacheIndex(t,this.currentRow);while(this.currentRow-e>0){i=this.session.$getRowCacheIndex(t,this.currentRow-e-1);if(i!==n)break;n=i;e++}}else{e=this.currentRow}return e};e.prototype.updateRowLine=function(e,t){if(e===undefined)e=this.getDocumentRow();var i=e===this.session.getLength()-1,o=i?this.EOF:this.EOL;this.wrapIndent=0;this.line=this.session.getLine(e);this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE;if(this.session.$useWrapMode){var s=this.session.$wrapData[e];if(s){if(t===undefined)t=this.getSplitIndex();if(t>0&&s.length){this.wrapIndent=s.indent;this.wrapOffset=this.wrapIndent*this.charWidths[n.L];this.line=t<s.length?this.line.substring(s[t-1],s[t]):this.line.substring(s[s.length-1])}else{this.line=this.line.substring(0,s[t])}if(t==s.length){this.line+=this.showInvisibles?o:n.DOT}}}else{this.line+=this.showInvisibles?o:n.DOT}var a=this.session,l=0,c;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){if(e==="\t"||a.isFullWidth(e.charCodeAt(0))){c=e==="\t"?a.getScreenTabSize(t+l):2;l+=c-1;return r.stringRepeat(n.DOT,c)}return e});if(this.isRtlDir){this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line;this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width}};e.prototype.updateBidiMap=function(){var e=[];if(n.hasBidiCharacters(this.line,e)||this.isRtlDir){this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir)}else{this.bidiMap={}}};e.prototype.markAsDirty=function(){this.currentRow=null};e.prototype.updateCharacterWidths=function(e){if(this.characterWidth===e.$characterSize.width)return;this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width;var i=e.$measureCharWidth("ה");this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t;this.charWidths[n.R]=this.charWidths[n.AN]=i;this.charWidths[n.R_H]=i*.45;this.charWidths[n.B]=this.charWidths[n.RLE]=0;this.currentRow=null};e.prototype.setShowInvisibles=function(e){this.showInvisibles=e;this.currentRow=null};e.prototype.setEolChar=function(e){this.EOL=e};e.prototype.setContentWidth=function(e){this.contentWidth=e};e.prototype.isRtlLine=function(e){if(this.$isRtl)return true;if(e!=undefined)return this.session.getLine(e).charAt(0)==this.RLE;else return this.isRtlDir};e.prototype.setRtlDirection=function(e,t){var i=e.getCursorPosition();for(var n=e.selection.getSelectionAnchor().row;n<=i.row;n++){if(!t&&e.session.getLine(n).charAt(0)===e.session.$bidiHandler.RLE)e.session.doc.removeInLine(n,0,1);else if(t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE)e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE)}};e.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0;var i=e>t?this.session.getOverwrite()?e:e-1:t;var r=n.getVisualFromLogicalIdx(i,this.bidiMap),o=this.bidiMap.bidiLevels,s=0;if(!this.session.getOverwrite()&&e<=t&&o[r]%2!==0)r++;for(var a=0;a<r;a++){s+=this.charWidths[o[a]]}if(!this.session.getOverwrite()&&e>t&&o[r]%2===0)s+=this.charWidths[o[r]];if(this.wrapIndent)s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;if(this.isRtlDir)s+=this.rtlLineOffset;return s};e.prototype.getSelections=function(e,t){var i=this.bidiMap,n=i.bidiLevels,r,o=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=false,h=false,u=0;if(this.wrapIndent)s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;for(var d,f=0;f<n.length;f++){d=i.logicalFromVisual[f];r=n[f];c=d>=a&&d<l;if(c&&!h){u=s}else if(!c&&h){o.push({left:u,width:s-u})}s+=this.charWidths[r];h=c}if(c&&f===n.length){o.push({left:u,width:s-u})}if(this.isRtlDir){for(var g=0;g<o.length;g++){o[g].left+=this.rtlLineOffset}}return o};e.prototype.offsetToCol=function(e){if(this.isRtlDir)e-=this.rtlLineOffset;var t=0,e=Math.max(e,0),i=0,n=0,r=this.bidiMap.bidiLevels,o=this.charWidths[r[n]];if(this.wrapIndent)e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset;while(e>i+o/2){i+=o;if(n===r.length-1){o=0;break}o=this.charWidths[r[++n]]}if(n>0&&r[n-1]%2!==0&&r[n]%2===0){if(e<i)n--;t=this.bidiMap.logicalFromVisual[n]}else if(n>0&&r[n-1]%2===0&&r[n]%2!==0){t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1])}else if(this.isRtlDir&&n===r.length-1&&o===0&&r[n-1]%2===0||!this.isRtlDir&&n===0&&r[n]%2!==0){t=1+this.bidiMap.logicalFromVisual[n]}else{if(n>0&&r[n-1]%2!==0&&o!==0)n--;t=this.bidiMap.logicalFromVisual[n]}if(t===0&&this.isRtlDir)t++;return t+this.wrapIndent};return e}();t.BidiHandler=s});ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/lang");var o=e("./lib/event_emitter").EventEmitter;var s=e("./range").Range;var a=function(){function e(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=false;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=true;if(!t.$silent)t._emit("changeCursor");if(!t.$isEmpty&&!t.$silent)t._emit("changeSelection");if(!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column)t.$desiredColumn=null});this.anchor.on("change",function(){t.$anchorChanged=true;if(!t.$isEmpty&&!t.$silent)t._emit("changeSelection")})}e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column};e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row};e.prototype.getCursor=function(){return this.lead.getPosition()};e.prototype.setAnchor=function(e,t){this.$isEmpty=false;this.anchor.setPosition(e,t)};e.prototype.getAnchor=function(){if(this.$isEmpty)return this.getSelectionLead();return this.anchor.getPosition()};e.prototype.getSelectionLead=function(){return this.lead.getPosition()};e.prototype.isBackwards=function(){var e=this.anchor;var t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column};e.prototype.getRange=function(){var e=this.anchor;var t=this.lead;if(this.$isEmpty)return s.fromPoints(t,t);return this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)};e.prototype.clearSelection=function(){if(!this.$isEmpty){this.$isEmpty=true;this._emit("changeSelection")}};e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)};e.prototype.setRange=function(e,t){var i=t?e.end:e.start;var n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)};e.prototype.$setSelection=function(e,t,i,n){if(this.$silent)return;var r=this.$isEmpty;var o=this.inMultiSelectMode;this.$silent=true;this.$cursorChanged=this.$anchorChanged=false;this.anchor.setPosition(e,t);this.cursor.setPosition(i,n);this.$isEmpty=!s.comparePoints(this.anchor,this.cursor);this.$silent=false;if(this.$cursorChanged)this._emit("changeCursor");if(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||o)this._emit("changeSelection")};e.prototype.$moveSelection=function(e){var t=this.lead;if(this.$isEmpty)this.setSelectionAnchor(t.row,t.column);e.call(this)};e.prototype.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})};e.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})};e.prototype.moveTo=function(e,t){this.clearSelection();this.moveCursorTo(e,t)};e.prototype.moveToPosition=function(e){this.clearSelection();this.moveCursorToPosition(e)};e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)};e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)};e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)};e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)};e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)};e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)};e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)};e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)};e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)};e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)};e.prototype.getWordRange=function(e,t){if(typeof t=="undefined"){var i=e||this.lead;e=i.row;t=i.column}return this.session.getWordRange(e,t)};e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())};e.prototype.selectAWord=function(){var e=this.getCursor();var t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)};e.prototype.getLineRange=function(e,t){var i=typeof e=="number"?e:this.lead.row;var n;var r=this.session.getFoldLine(i);if(r){i=r.start.row;n=r.end.row}else{n=i}if(t===true)return new s(i,0,n,this.session.getLine(n).length);else return new s(i,0,n+1,0)};e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())};e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)};e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)};e.prototype.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column;var r=e.column+t;if(i<0){n=e.column-t;r=e.column}return this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,r).split(" ").length-1==t};e.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1)){this.moveCursorTo(t.start.row,t.start.column)}else if(e.column===0){if(e.row>0){this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length)}}else{var i=this.session.getTabSize();if(this.wouldMoveIntoSoftTab(e,i,-1)&&!this.session.getNavigateWithinSoftTabs()){this.moveCursorBy(0,-i)}else{this.moveCursorBy(0,-1)}}};e.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1)){this.moveCursorTo(t.end.row,t.end.column)}else if(this.lead.column==this.doc.getLine(this.lead.row).length){if(this.lead.row<this.doc.getLength()-1){this.moveCursorTo(this.lead.row+1,0)}}else{var i=this.session.getTabSize();var e=this.lead;if(this.wouldMoveIntoSoftTab(e,i,1)&&!this.session.getNavigateWithinSoftTabs()){this.moveCursorBy(0,i)}else{this.moveCursorBy(0,1)}}};e.prototype.moveCursorLineStart=function(){var e=this.lead.row;var t=this.lead.column;var i=this.session.documentToScreenRow(e,t);var n=this.session.screenToDocumentPosition(i,0);var r=this.session.getDisplayLine(e,null,n.row,n.column);var o=r.match(/^\s*/);if(o[0].length!=t&&!this.session.$useEmacsStyleLineStart)n.column+=o[0].length;this.moveCursorToPosition(n)};e.prototype.moveCursorLineEnd=function(){var e=this.lead;var t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);if(n>0)t.column=n}}this.moveCursorTo(t.row,t.column)};e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1;var t=this.doc.getLine(e).length;this.moveCursorTo(e,t)};e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)};e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row;var t=this.lead.column;var i=this.doc.getLine(e);var n=i.substring(t);this.session.nonTokenRe.lastIndex=0;this.session.tokenRe.lastIndex=0;var r=this.session.getFoldAt(e,t,1);if(r){this.moveCursorTo(r.end.row,r.end.column);return}if(this.session.nonTokenRe.exec(n)){t+=this.session.nonTokenRe.lastIndex;this.session.nonTokenRe.lastIndex=0;n=i.substring(t)}if(t>=i.length){this.moveCursorTo(e,i.length);this.moveCursorRight();if(e<this.doc.getLength()-1)this.moveCursorWordRight();return}if(this.session.tokenRe.exec(n)){t+=this.session.tokenRe.lastIndex;this.session.tokenRe.lastIndex=0}this.moveCursorTo(e,t)};e.prototype.moveCursorLongWordLeft=function(){var e=this.lead.row;var t=this.lead.column;var i;if(i=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(i.start.row,i.start.column);return}var n=this.session.getFoldStringAt(e,t,-1);if(n==null){n=this.doc.getLine(e).substring(0,t)}var o=r.stringReverse(n);this.session.nonTokenRe.lastIndex=0;this.session.tokenRe.lastIndex=0;if(this.session.nonTokenRe.exec(o)){t-=this.session.nonTokenRe.lastIndex;o=o.slice(this.session.nonTokenRe.lastIndex);this.session.nonTokenRe.lastIndex=0}if(t<=0){this.moveCursorTo(e,0);this.moveCursorLeft();if(e>0)this.moveCursorWordLeft();return}if(this.session.tokenRe.exec(o)){t-=this.session.tokenRe.lastIndex;this.session.tokenRe.lastIndex=0}this.moveCursorTo(e,t)};e.prototype.$shortWordEndIndex=function(e){var t=0,i;var n=/\s/;var r=this.session.tokenRe;r.lastIndex=0;if(this.session.tokenRe.exec(e)){t=this.session.tokenRe.lastIndex}else{while((i=e[t])&&n.test(i))t++;if(t<1){r.lastIndex=0;while((i=e[t])&&!r.test(i)){r.lastIndex=0;t++;if(n.test(i)){if(t>2){t--;break}else{while((i=e[t])&&n.test(i))t++;if(t>2)break}}}}}r.lastIndex=0;return t};e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row;var t=this.lead.column;var i=this.doc.getLine(e);var n=i.substring(t);var r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==i.length){var o=this.doc.getLength();do{e++;n=this.doc.getLine(e)}while(e<o&&/^\s*$/.test(n));if(!/^\s+/.test(n))n="";t=0}var s=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+s)};e.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row;var t=this.lead.column;var i;if(i=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(i.start.row,i.start.column);var n=this.session.getLine(e).substring(0,t);if(t===0){do{e--;n=this.doc.getLine(e)}while(e>0&&/^\s*$/.test(n));t=n.length;if(!/\s+$/.test(n))n=""}var o=r.stringReverse(n);var s=this.$shortWordEndIndex(o);return this.moveCursorTo(e,t-s)};e.prototype.moveCursorWordRight=function(){if(this.session.$selectLongWords)this.moveCursorLongWordRight();else this.moveCursorShortWordRight()};e.prototype.moveCursorWordLeft=function(){if(this.session.$selectLongWords)this.moveCursorLongWordLeft();else this.moveCursorShortWordLeft()};e.prototype.moveCursorBy=function(e,t){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);var n;if(t===0){if(e!==0){if(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)){n=this.session.$bidiHandler.getPosLeft(i.column);i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])}else{n=i.column*this.session.$bidiHandler.charWidths[0]}}if(this.$desiredColumn)i.column=this.$desiredColumn;else this.$desiredColumn=i.column}if(e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var r=this.session.lineWidgets[this.lead.row];if(e<0)e-=r.rowsAbove||0;else if(e>0)e+=r.rowCount-(r.rowsAbove||0)}var o=this.session.screenToDocumentPosition(i.row+e,i.column,n);if(e!==0&&t===0&&o.row===this.lead.row&&o.column===this.lead.column){}this.moveCursorTo(o.row,o.column+t,t===0)};e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)};e.prototype.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);if(n){e=n.start.row;t=n.start.column}this.$keepDesiredColumnOnChange=true;var r=this.session.getLine(e);if(/[\uDC00-\uDFFF]/.test(r.charAt(t))&&r.charAt(t-1)){if(this.lead.row==e&&this.lead.column==t+1)t=t-1;else t=t+1}this.lead.setPosition(e,t);this.$keepDesiredColumnOnChange=false;if(!i)this.$desiredColumn=null};e.prototype.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)};e.prototype.detach=function(){this.lead.detach();this.anchor.detach()};e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start);this.$desiredColumn=e.desiredColumn||this.$desiredColumn};e.prototype.toOrientedRange=function(e){var t=this.getRange();if(e){e.start.column=t.start.column;e.start.row=t.start.row;e.end.column=t.end.column;e.end.row=t.end.row}else{e=t}e.cursor=this.isBackwards()?e.start:e.end;e.desiredColumn=this.$desiredColumn;return e};e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return s.fromPoints(t,i)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}};e.prototype.toJSON=function(){if(this.rangeCount){var e=this.ranges.map(function(e){var t=e.clone();t.isBackwards=e.cursor==e.start;return t})}else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e};e.prototype.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=s.fromPoints(e[t].start,e[t].end);if(e[t].isBackwards)i.cursor=i.start;this.addRange(i,true)}return}else{e=e[0]}}if(this.rangeList)this.toSingleRange(e);this.setSelectionRange(e,e.isBackwards)};e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return false;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;){if(!this.ranges[t].isEqual(e[t]))return false}return true};return e}();a.prototype.setSelectionAnchor=a.prototype.setAnchor;a.prototype.getSelectionAnchor=a.prototype.getAnchor;a.prototype.setSelectionRange=a.prototype.setRange;n.implement(a.prototype,o);t.Selection=a});ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(e,t,i){"use strict";var n=e("./lib/report_error").reportError;var r=2e3;var o=function(){function e(e){this.splitRegex;this.states=e;this.regExps={};this.matchMappings={};for(var t in this.states){var i=this.states[t];var n=[];var r=0;var o=this.matchMappings[t]={defaultToken:"text"};var s="g";var a=[];for(var l=0;l<i.length;l++){var c=i[l];if(c.defaultToken)o.defaultToken=c.defaultToken;if(c.caseInsensitive&&s.indexOf("i")===-1)s+="i";if(c.unicode&&s.indexOf("u")===-1)s+="u";if(c.regex==null)continue;if(c.regex instanceof RegExp)c.regex=c.regex.toString().slice(1,-1);var h=c.regex;var u=new RegExp("(?:("+h+")|(.))").exec("a").length-2;if(Array.isArray(c.token)){if(c.token.length==1||u==1){c.token=c.token[0]}else if(u-1!=c.token.length){this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:u-1});c.token=c.token[0]}else{c.tokenArray=c.token;c.token=null;c.onMatch=this.$arrayTokens}}else if(typeof c.token=="function"&&!c.onMatch){if(u>1)c.onMatch=this.$applyToken;else c.onMatch=c.token}if(u>1){if(/\\\d/.test(c.regex)){h=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+r+1)})}else{u=1;h=this.removeCapturingGroups(c.regex)}if(!c.splitRegex&&typeof c.token!="string")a.push(c)}o[r]=l;r+=u;n.push(h);if(!c.onMatch)c.onMatch=null}if(!n.length){o[0]=0;n.push("$")}a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)},this);this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}}e.prototype.$setMaxTokenCount=function(e){r=e|0};e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1);var i=this.token.apply(this,t);if(typeof i==="string")return[{type:i,value:e}];var n=[];for(var r=0,o=i.length;r<o;r++){if(t[r])n[n.length]={type:i[r],value:t[r]}}return n};e.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";var i=[];var n=this.tokenArray;for(var r=0,o=n.length;r<o;r++){if(t[r+1])i[i.length]={type:n[r],value:t[r+1]}}return i};e.prototype.removeCapturingGroups=function(e){var t=e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(e,t){return t?"(?:":e});return t};e.prototype.createSplitterRegexp=function(e,t){if(e.indexOf("(?=")!=-1){var i=0;var n=false;var r={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,o,s,a,l){if(n){n=a!="]"}else if(a){n=true}else if(s){if(i==r.stack){r.end=l+1;r.stack=-1}i--}else if(o){i++;if(o.length!=1){r.stack=i;r.start=l}}return e});if(r.end!=null&&/^\)*$/.test(e.substr(r.end)))e=e.substring(0,r.start)+e.substr(r.end)}if(e.charAt(0)!="^")e="^"+e;if(e.charAt(e.length-1)!="$")e+="$";return new RegExp(e,(t||"").replace("g",""))};e.prototype.getLineTokens=function(e,t){if(t&&typeof t!="string"){var i=t.slice(0);t=i[0];if(t==="#tmp"){i.shift();t=i.shift()}}else var i=[];var n=t||"start";var o=this.states[n];if(!o){n="start";o=this.states[n]}var s=this.matchMappings[n];var a=this.regExps[n];a.lastIndex=0;var l,c=[];var h=0;var u=0;var d={type:null,value:""};while(l=a.exec(e)){var f=s.defaultToken;var g=null;var p=l[0];var m=a.lastIndex;if(m-p.length>h){var v=e.substring(h,m-p.length);if(d.type==f){d.value+=v}else{if(d.type)c.push(d);d={type:f,value:v}}}for(var y=0;y<l.length-2;y++){if(l[y+1]===undefined)continue;g=o[s[y]];if(g.onMatch)f=g.onMatch(p,n,i,e);else f=g.token;if(g.next){if(typeof g.next=="string"){n=g.next}else{n=g.next(n,i)}o=this.states[n];if(!o){this.reportError("state doesn't exist",n);n="start";o=this.states[n]}s=this.matchMappings[n];h=m;a=this.regExps[n];a.lastIndex=m}if(g.consumeLineEnd)h=m;break}if(p){if(typeof f==="string"){if((!g||g.merge!==false)&&d.type===f){d.value+=p}else{if(d.type)c.push(d);d={type:f,value:p}}}else if(f){if(d.type)c.push(d);d={type:null,value:""};for(var y=0;y<f.length;y++)c.push(f[y])}}if(h==e.length)break;h=m;if(u++>r){if(u>2*e.length){this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e})}while(h<e.length){if(d.type)c.push(d);d={value:e.substring(h,h+=500),type:"overflow"}}n="start";i=[];break}}if(d.type)c.push(d);if(i.length>1){if(i[0]!==n)i.unshift("#tmp",n)}return{tokens:c,state:i.length?i:n}};return e}();o.prototype.reportError=n;t.Tokenizer=o});ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(e,t,i){"use strict";var n=e("../lib/deep_copy").deepCopy;var r;r=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var i in e)this.$rules[i]=e[i];return}for(var i in e){var n=e[i];for(var r=0;r<n.length;r++){var o=n[r];if(o.next||o.onMatch){if(typeof o.next=="string"){if(o.next.indexOf(t)!==0)o.next=t+o.next}if(o.nextState&&o.nextState.indexOf(t)!==0)o.nextState=t+o.nextState}}this.$rules[t+i]=n}};this.getRules=function(){return this.$rules};this.embedRules=function(e,t,i,r,o){var s=typeof e=="function"?(new e).getRules():e;if(r){for(var a=0;a<r.length;a++)r[a]=t+r[a]}else{r=[];for(var l in s)r.push(t+l)}this.addRules(s,t);if(i){var c=Array.prototype[o?"push":"unshift"];for(var a=0;a<r.length;a++)c.apply(this.$rules[r[a]],n(i))}if(!this.$embeds)this.$embeds=[];this.$embeds.push(t)};this.getEmbeds=function(){return this.$embeds};var e=function(e,t){if(e!="start"||t.length)t.unshift(this.nextState,e);return this.nextState};var t=function(e,t){t.shift();return t.shift()||"start"};this.normalizeRules=function(){var i=0;var n=this.$rules;function r(o){var s=n[o];s["processed"]=true;for(var a=0;a<s.length;a++){var l=s[a];var c=null;if(Array.isArray(l)){c=l;l={}}if(!l.regex&&l.start){l.regex=l.start;if(!l.next)l.next=[];l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"});l.token=l.token+".start";l.push=true}var h=l.next||l.push;if(h&&Array.isArray(h)){var u=l.stateName;if(!u){u=l.token;if(typeof u!="string")u=u[0]||"";if(n[u])u+=i++}n[u]=h;l.next=u;r(u)}else if(h=="pop"){l.next=t}if(l.push){l.nextState=l.next||l.push;l.next=e;delete l.push}if(l.rules){for(var d in l.rules){if(n[d]){if(n[d].push)n[d].push.apply(n[d],l.rules[d])}else{n[d]=l.rules[d]}}}var f=typeof l=="string"?l:l.include;if(f){if(f==="$self")f="start";if(Array.isArray(f))c=f.map(function(e){return n[e]});else c=n[f]}if(c){var g=[a,1].concat(c);if(l.noEscape)g=g.filter(function(e){return!e.next});s.splice.apply(s,g);a--}if(l.keywordMap){l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive);delete l.defaultToken}}}Object.keys(n).forEach(r,this)};this.createKeywordMapper=function(e,t,i,n){var r=Object.create(null);this.$keywordList=[];Object.keys(e).forEach(function(t){var o=e[t];var s=o.split(n||"|");for(var a=s.length;a--;){var l=s[a];this.$keywordList.push(l);if(i)l=l.toLowerCase();r[l]=t}},this);e=null;return i?function(e){return r[e.toLowerCase()]||t}:function(e){return r[e]||t}};this.getKeywords=function(){return this.$keywords}}).call(r.prototype);t.TextHighlightRules=r});ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,i){"use strict";var n;n=function(){this.$behaviours={}};(function(){this.add=function(e,t,i){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i};this.addBehaviours=function(e){for(var t in e){for(var i in e[t]){this.add(t,i,e[t][i])}}};this.remove=function(e){if(this.$behaviours&&this.$behaviours[e]){delete this.$behaviours[e]}};this.inherit=function(e,t){if(typeof e==="function"){var i=(new e).getBehaviours(t)}else{var i=e.getBehaviours(t)}this.addBehaviours(i)};this.getBehaviours=function(e){if(!e){return this.$behaviours}else{var t={};for(var i=0;i<e.length;i++){if(this.$behaviours[e[i]]){t[e[i]]=this.$behaviours[e[i]]}}return t}}}).call(n.prototype);t.Behaviour=n});ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range;var r=function(){function e(e,t,i){this.$session=e;this.$row=t;this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1}e.prototype.stepBackward=function(){this.$tokenIndex-=1;while(this.$tokenIndex<0){this.$row-=1;if(this.$row<0){this.$row=0;return null}this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]};e.prototype.stepForward=function(){this.$tokenIndex+=1;var e;while(this.$tokenIndex>=this.$rowTokens.length){this.$row+=1;if(!e)e=this.$session.getLength();if(this.$row>=e){this.$row=e-1;return null}this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]};e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]};e.prototype.getCurrentTokenRow=function(){return this.$row};e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens;var t=this.$tokenIndex;var i=e[t].start;if(i!==undefined)return i;i=0;while(t>0){t-=1;i+=e[t].value.length}return i};e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}};e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex];var t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)};return e}();t.TokenIterator=r});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,i){"use strict";var n=e("../../lib/oop");var r=e("../behaviour").Behaviour;var o=e("../../token_iterator").TokenIterator;var s=e("../../lib/lang");var a=["text","paren.rparen","rparen","paren","punctuation.operator"];var l=["text","paren.rparen","rparen","paren","punctuation.operator","comment"];var c;var h={};var u={'"':'"',"'":"'"};var d=function(e){var t=-1;if(e.multiSelect){t=e.selection.index;if(h.rangeCount!=e.multiSelect.rangeCount)h={rangeCount:e.multiSelect.rangeCount}}if(h[t])return c=h[t];c=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}};var f=function(e,t,i,n){var r=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}};var g;g=function(e){e=e||{};this.add("braces","insertion",function(t,i,n,r,o){var a=n.getCursorPosition();var l=r.doc.getLine(a.row);if(o=="{"){d(n);var h=n.getSelectionRange();var u=r.doc.getTextRange(h);var p=r.getTokenAt(a.row,a.column);if(u!==""&&u!=="{"&&n.getWrapBehavioursEnabled()){return f(h,u,"{","}")}else if(p&&/(?:string)\.quasi|\.xml/.test(p.type)){var m=[/tag\-(?:open|name)/,/attribute\-name/];if(m.some(function(e){return e.test(p.type)})||/(string)\.quasi/.test(p.type)&&p.value[a.column-p.start-1]!=="$")return;g.recordAutoInsert(n,r,"}");return{text:"{}",selection:[1,1]}}else if(g.isSaneInsertion(n,r)){if(/[\]\}\)]/.test(l[a.column])||n.inMultiSelectMode||e.braces){g.recordAutoInsert(n,r,"}");return{text:"{}",selection:[1,1]}}else{g.recordMaybeInsert(n,r,"{");return{text:"{",selection:[1,1]}}}}else if(o=="}"){d(n);var v=l.substring(a.column,a.column+1);if(v=="}"){var y=r.$findOpeningBracket("}",{column:a.column+1,row:a.row});if(y!==null&&g.isAutoInsertedClosing(a,l,o)){g.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}else if(o=="\n"||o=="\r\n"){d(n);var w="";if(g.isMaybeInsertedClosing(a,l)){w=s.stringRepeat("}",c.maybeInsertedBrackets);g.clearMaybeInsertedClosing()}var v=l.substring(a.column,a.column+1);if(v==="}"){var b=r.findMatchingBracket({row:a.row,column:a.column+1},"}");if(!b)return null;var $=this.$getIndent(r.getLine(b.row))}else if(w){var $=this.$getIndent(l)}else{g.clearMaybeInsertedClosing();return}var C=$+r.getTabString();return{text:"\n"+C+"\n"+$+w,selection:[1,C.length,1,C.length]}}else{g.clearMaybeInsertedClosing()}});this.add("braces","deletion",function(e,t,i,n,r){var o=n.doc.getTextRange(r);if(!r.isMultiLine()&&o=="{"){d(i);var s=n.doc.getLine(r.start.row);var a=s.substring(r.end.column,r.end.column+1);if(a=="}"){r.end.column++;return r}else{c.maybeInsertedBrackets--}}});this.add("parens","insertion",function(e,t,i,n,r){if(r=="("){d(i);var o=i.getSelectionRange();var s=n.doc.getTextRange(o);if(s!==""&&i.getWrapBehavioursEnabled()){return f(o,s,"(",")")}else if(g.isSaneInsertion(i,n)){g.recordAutoInsert(i,n,")");return{text:"()",selection:[1,1]}}}else if(r==")"){d(i);var a=i.getCursorPosition();var l=n.doc.getLine(a.row);var c=l.substring(a.column,a.column+1);if(c==")"){var h=n.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(h!==null&&g.isAutoInsertedClosing(a,l,r)){g.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}});this.add("parens","deletion",function(e,t,i,n,r){var o=n.doc.getTextRange(r);if(!r.isMultiLine()&&o=="("){d(i);var s=n.doc.getLine(r.start.row);var a=s.substring(r.start.column+1,r.start.column+2);if(a==")"){r.end.column++;return r}}});this.add("brackets","insertion",function(e,t,i,n,r){if(r=="["){d(i);var o=i.getSelectionRange();var s=n.doc.getTextRange(o);if(s!==""&&i.getWrapBehavioursEnabled()){return f(o,s,"[","]")}else if(g.isSaneInsertion(i,n)){g.recordAutoInsert(i,n,"]");return{text:"[]",selection:[1,1]}}}else if(r=="]"){d(i);var a=i.getCursorPosition();var l=n.doc.getLine(a.row);var c=l.substring(a.column,a.column+1);if(c=="]"){var h=n.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(h!==null&&g.isAutoInsertedClosing(a,l,r)){g.popAutoInsertedClosing();return{text:"",selection:[1,1]}}}}});this.add("brackets","deletion",function(e,t,i,n,r){var o=n.doc.getTextRange(r);if(!r.isMultiLine()&&o=="["){d(i);var s=n.doc.getLine(r.start.row);var a=s.substring(r.start.column+1,r.start.column+2);if(a=="]"){r.end.column++;return r}}});this.add("string_dquotes","insertion",function(e,t,i,n,r){var o=n.$mode.$quotes||u;if(r.length==1&&o[r]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(r)!=-1)return;d(i);var s=r;var a=i.getSelectionRange();var l=n.doc.getTextRange(a);if(l!==""&&(l.length!=1||!o[l])&&i.getWrapBehavioursEnabled()){return f(a,l,s,s)}else if(!l){var c=i.getCursorPosition();var h=n.doc.getLine(c.row);var g=h.substring(c.column-1,c.column);var p=h.substring(c.column,c.column+1);var m=n.getTokenAt(c.row,c.column);var v=n.getTokenAt(c.row,c.column+1);if(g=="\\"&&m&&/escape/.test(m.type))return null;var y=m&&/string|escape/.test(m.type);var w=!v||/string|escape/.test(v.type);var b;if(p==s){b=y!==w;if(b&&/string\.end/.test(v.type))b=false}else{if(y&&!w)return null;if(y&&w)return null;var $=n.$mode.tokenRe;$.lastIndex=0;var C=$.test(g);$.lastIndex=0;var S=$.test(p);var x=n.$mode.$pairQuotesAfter;var A=x&&x[s]&&x[s].test(g);if(!A&&C||S)return null;if(p&&!/[\s;,.})\]\\]/.test(p))return null;var M=h[c.column-2];if(g==s&&(M==s||$.test(M)))return null;b=true}return{text:b?s+s:"",selection:[1,1]}}}});this.add("string_dquotes","deletion",function(e,t,i,n,r){var o=n.$mode.$quotes||u;var s=n.doc.getTextRange(r);if(!r.isMultiLine()&&o.hasOwnProperty(s)){d(i);var a=n.doc.getLine(r.start.row);var l=a.substring(r.start.column+1,r.start.column+2);if(l==s){r.end.column++;return r}}});if(e.closeDocComment!==false){this.add("doc comment end","insertion",function(e,t,i,n,r){if(e==="doc-start"&&(r==="\n"||r==="\r\n")&&i.selection.isEmpty()){var o=i.getCursorPosition();if(o.column===0){return}var s=n.doc.getLine(o.row);var a=n.doc.getLine(o.row+1);var l=n.getTokens(o.row);var c=0;for(var h=0;h<l.length;h++){c+=l[h].value.length;var u=l[h];if(c>=o.column){if(c===o.column){if(!/\.doc/.test(u.type)){return}if(/\*\//.test(u.value)){var d=l[h+1];if(!d||!/\.doc/.test(d.type)){return}}}var f=o.column-(c-u.value.length);var g=u.value.indexOf("*/");var p=u.value.indexOf("/**",g>-1?g+2:0);if(p!==-1&&f>p&&f<p+3){return}if(g!==-1&&p!==-1&&f>=g&&f<=p||!/\.doc/.test(u.type)){return}break}}var m=this.$getIndent(s);if(/\s*\*/.test(a)){if(/^\s*\*/.test(s)){return{text:r+m+"* ",selection:[1,2+m.length,1,2+m.length]}}else{return{text:r+m+" * ",selection:[1,3+m.length,1,3+m.length]}}}if(/\/\*\*/.test(s.substring(0,o.column))){return{text:r+m+" * "+r+" "+m+"*/",selection:[1,4+m.length,1,4+m.length]}}}})}};g.isSaneInsertion=function(e,t){var i=e.getCursorPosition();var n=new o(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",a)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return true;var r=new o(t,i.row,i.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",a))return false}n.stepForward();return n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",l)};g["$matchTokenType"]=function(e,t){return t.indexOf(e.type||e)>-1};g["recordAutoInsert"]=function(e,t,i){var n=e.getCursorPosition();var r=t.doc.getLine(n.row);if(!this["isAutoInsertedClosing"](n,r,c.autoInsertedLineEnd[0]))c.autoInsertedBrackets=0;c.autoInsertedRow=n.row;c.autoInsertedLineEnd=i+r.substr(n.column);c.autoInsertedBrackets++};g["recordMaybeInsert"]=function(e,t,i){var n=e.getCursorPosition();var r=t.doc.getLine(n.row);if(!this["isMaybeInsertedClosing"](n,r))c.maybeInsertedBrackets=0;c.maybeInsertedRow=n.row;c.maybeInsertedLineStart=r.substr(0,n.column)+i;c.maybeInsertedLineEnd=r.substr(n.column);c.maybeInsertedBrackets++};g["isAutoInsertedClosing"]=function(e,t,i){return c.autoInsertedBrackets>0&&e.row===c.autoInsertedRow&&i===c.autoInsertedLineEnd[0]&&t.substr(e.column)===c.autoInsertedLineEnd};g["isMaybeInsertedClosing"]=function(e,t){return c.maybeInsertedBrackets>0&&e.row===c.maybeInsertedRow&&t.substr(e.column)===c.maybeInsertedLineEnd&&t.substr(0,e.column)==c.maybeInsertedLineStart};g["popAutoInsertedClosing"]=function(){c.autoInsertedLineEnd=c.autoInsertedLineEnd.substr(1);c.autoInsertedBrackets--};g["clearMaybeInsertedClosing"]=function(){if(c){c.maybeInsertedBrackets=0;c.maybeInsertedRow=-1}};n.inherits(g,r);t.CstyleBehaviour=g});ace.define("ace/unicode",["require","exports","module"],function(e,t,i){"use strict";var n=[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];var r=0;var o=[];for(var s=0;s<n.length;s+=2){o.push(r+=n[s]);if(n[s+1])o.push(45,r+=n[s+1])}t.wordChars=String.fromCharCode.apply(null,o)});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(e,t,i){"use strict";var n=e("../config");var r=e("../tokenizer").Tokenizer;var o=e("./text_highlight_rules").TextHighlightRules;var s=e("./behaviour/cstyle").CstyleBehaviour;var a=e("../unicode");var l=e("../lib/lang");var c=e("../token_iterator").TokenIterator;var h=e("../range").Range;var u;u=function(){this.HighlightRules=o};(function(){this.$defaultBehaviour=new s;this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g");this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g");this.getTokenizer=function(){if(!this.$tokenizer){this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig);this.$tokenizer=new r(this.$highlightRules.getRules())}return this.$tokenizer};this.lineCommentStart="";this.blockComment="";this.toggleCommentLines=function(e,t,i,n){var r=t.doc;var o=true;var s=true;var a=Infinity;var c=t.getTabSize();var h=false;if(!this.lineCommentStart){if(!this.blockComment)return false;var u=this.blockComment.start;var d=this.blockComment.end;var f=new RegExp("^(\\s*)(?:"+l.escapeRegExp(u)+")");var g=new RegExp("(?:"+l.escapeRegExp(d)+")\\s*$");var p=function(e,t){if(v(e,t))return;if(!o||/\S/.test(e)){r.insertInLine({row:t,column:e.length},d);r.insertInLine({row:t,column:a},u)}};var m=function(e,t){var i;if(i=e.match(g))r.removeInLine(t,e.length-i[0].length,e.length);if(i=e.match(f))r.removeInLine(t,i[1].length,i[0].length)};var v=function(e,i){if(f.test(e))return true;var n=t.getTokens(i);for(var r=0;r<n.length;r++){if(n[r].type==="comment")return true}}}else{if(Array.isArray(this.lineCommentStart)){var f=this.lineCommentStart.map(l.escapeRegExp).join("|");var u=this.lineCommentStart[0]}else{var f=l.escapeRegExp(this.lineCommentStart);var u=this.lineCommentStart}f=new RegExp("^(\\s*)(?:"+f+") ?");h=t.getUseSoftTabs();var m=function(e,t){var i=e.match(f);if(!i)return;var n=i[1].length,o=i[0].length;if(!w(e,n,o)&&i[0][o-1]==" ")o--;r.removeInLine(t,n,o)};var y=u+" ";var p=function(e,t){if(!o||/\S/.test(e)){if(w(e,a,a))r.insertInLine({row:t,column:a},y);else r.insertInLine({row:t,column:a},u)}};var v=function(e,t){return f.test(e)};var w=function(e,t,i){var n=0;while(t--&&e.charAt(t)==" ")n++;if(n%c!=0)return false;var n=0;while(e.charAt(i++)==" ")n++;if(c>2)return n%c!=c-1;else return n%c==0}}function b(e){for(var t=i;t<=n;t++)e(r.getLine(t),t)}var $=Infinity;b(function(e,t){var i=e.search(/\S/);if(i!==-1){if(i<a)a=i;if(s&&!v(e,t))s=false}else if($>e.length){$=e.length}});if(a==Infinity){a=$;o=false;s=false}if(h&&a%c!=0)a=Math.floor(a/c)*c;b(s?m:p)};this.toggleBlockComment=function(e,t,i,n){var r=this.blockComment;if(!r)return;if(!r.start&&r[0])r=r[0];var o=new c(t,n.row,n.column);var s=o.getCurrentToken();var a=t.selection;var l=t.selection.toOrientedRange();var u,d;if(s&&/comment/.test(s.type)){var f,g;while(s&&/comment/.test(s.type)){var p=s.value.indexOf(r.start);if(p!=-1){var m=o.getCurrentTokenRow();var v=o.getCurrentTokenColumn()+p;f=new h(m,v,m,v+r.start.length);break}s=o.stepBackward()}var o=new c(t,n.row,n.column);var s=o.getCurrentToken();while(s&&/comment/.test(s.type)){var p=s.value.indexOf(r.end);if(p!=-1){var m=o.getCurrentTokenRow();var v=o.getCurrentTokenColumn()+p;g=new h(m,v,m,v+r.end.length);break}s=o.stepForward()}if(g)t.remove(g);if(f){t.remove(f);u=f.start.row;d=-r.start.length}}else{d=r.start.length;u=i.start.row;t.insert(i.end,r.end);t.insert(i.start,r.start)}if(l.start.row==u)l.start.column+=d;if(l.end.row==u)l.end.column+=d;t.selection.fromOrientedRange(l)};this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)};this.checkOutdent=function(e,t,i){return false};this.autoOutdent=function(e,t,i){};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 t in e){if(e[t]){var i=e[t];var r=i.prototype.$id;var o=n.$modes[r];if(!o)n.$modes[r]=o=new i;if(!n.$modes[t])n.$modes[t]=o;this.$embeds.push(t);this.$modes[t]=o}}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];var a=function(e){(function(t){var i=s[e];var n=t[i];t[s[e]]=function(){return this.$delegator(i,arguments,n)}})(l)};var l=this;for(var t=0;t<s.length;t++){a(t)}};this.$delegator=function(e,t,i){var n=t[0]||"start";if(typeof n!="string"){if(Array.isArray(n[2])){var r=n[2][n[2].length-1];var o=this.$modes[r];if(o)return o[e].apply(o,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var s=0;s<this.$embeds.length;s++){if(!this.$modes[this.$embeds[s]])continue;var a=n.split(this.$embeds[s]);if(!a[0]&&a[1]){t[0]=a[1];var o=this.$modes[this.$embeds[s]];return o[e].apply(o,t)}}var l=i.apply(this,t);return i?l:undefined};this.transformAction=function(e,t,i,n,r){if(this.$behaviour){var o=this.$behaviour.getBehaviours();for(var s in o){if(o[s][t]){var a=o[s][t].apply(this,arguments);if(a){return a}}}}};this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer["rules"];var i=[];for(var n in t){var r=t[n];for(var o=0,s=r.length;o<s;o++){if(typeof r[o].token==="string"){if(/keyword|support|storage/.test(r[o].token))i.push(r[o].regex)}else if(typeof r[o].token==="object"){for(var a=0,l=r[o].token.length;a<l;a++){if(/keyword|support|storage/.test(r[o].token[a])){var n=r[o].regex.match(/\(.+?\)/g)[a];i.push(n.substr(1,n.length-2))}}}}}this.completionKeywords=i}if(!e)return this.$keywordList;return i.concat(this.$keywordList||[])};this.$createKeywordList=function(){if(!this.$highlightRules)this.getTokenizer();return this.$keywordList=this.$highlightRules.$keywordList||[]};this.getCompletions=function(e,t,i,n){var r=this.$keywordList||this.$createKeywordList();return r.map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})};this.$id="ace/mode/text"}).call(u.prototype);t.Mode=u});ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("./lib/dom");var r=function(){function e(e){this.session=e;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)}e.prototype.getRowLength=function(e){var t;if(this.lineWidgets)t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;if(!this["$useWrapMode"]||!this["$wrapData"][e]){return 1+t}else{return this["$wrapData"][e].length+1+t}};e.prototype.$getWidgetScreenLength=function(){var e=0;this.lineWidgets.forEach(function(t){if(t&&t.rowCount&&!t.hidden)e+=t.rowCount});return e};e.prototype.$onChangeEditor=function(e){this.attach(e.editor)};e.prototype.attach=function(e){if(e&&e.widgetManager&&e.widgetManager!=this)e.widgetManager.detach();if(this.editor==e)return;this.detach();this.editor=e;if(e){e.widgetManager=this;e.renderer.on("beforeRender",this.measureWidgets);e.renderer.on("afterRender",this.renderWidgets)}};e.prototype.detach=function(e){var t=this.editor;if(!t)return;this.editor=null;t.widgetManager=null;t.renderer.off("beforeRender",this.measureWidgets);t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(e){if(e&&e.el&&e.el.parentNode){e._inDocument=false;e.el.parentNode.removeChild(e.el)}})};e.prototype.updateOnFold=function(e,t){var i=t.lineWidgets;if(!i||!e.action)return;var n=e.data;var r=n.start.row;var o=n.end.row;var s=e.action=="add";for(var a=r+1;a<o;a++){if(i[a])i[a].hidden=s}if(i[o]){if(s){if(!i[r])i[r]=i[o];else i[o].hidden=s}else{if(i[r]==i[o])i[r]=undefined;i[o].hidden=s}}};e.prototype.updateOnChange=function(e){var t=this.session.lineWidgets;if(!t)return;var i=e.start.row;var n=e.end.row-i;if(n===0){}else if(e.action=="remove"){var r=t.splice(i+1,n);if(!t[i]&&r[r.length-1]){t[i]=r.pop()}r.forEach(function(e){e&&this.removeLineWidget(e)},this);this.$updateRows()}else{var o=new Array(n);if(t[i]&&t[i].column!=null){if(e.start.column>t[i].column)i++}o.unshift(i,0);t.splice.apply(t,o);this.$updateRows()}};e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(!e)return;var t=true;e.forEach(function(e,i){if(e){t=false;e.row=i;while(e.$oldWidget){e.$oldWidget.row=i;e=e.$oldWidget}}});if(t)this.session.lineWidgets=null};e.prototype.$registerLineWidget=function(e){if(!this.session.lineWidgets)this.session.lineWidgets=new Array(this.session.getLength());var t=this.session.lineWidgets[e.row];if(t){e.$oldWidget=t;if(t.el&&t.el.parentNode){t.el.parentNode.removeChild(t.el);t._inDocument=false}}this.session.lineWidgets[e.row]=e;return e};e.prototype.addLineWidget=function(e){this.$registerLineWidget(e);e.session=this.session;if(!this.editor)return e;var t=this.editor.renderer;if(e.html&&!e.el){throw new Error("Setting html as string for a line widget is not supported to avoid CSP inline styles violations.")}if(e.text&&!e.el){e.el=n.createElement("div");e.el.textContent=e.text}if(e.el){n.addCssClass(e.el,"ace_lineWidgetContainer");if(e.className){n.addCssClass(e.el,e.className)}e.el.style.position="absolute";e.el.style.zIndex="5";t.container.appendChild(e.el);e._inDocument=true;if(!e.coverGutter){e.el.style.zIndex="3"}if(e.pixelHeight==null){e.pixelHeight=e.el.offsetHeight}}if(e.rowCount==null){e.rowCount=e.pixelHeight/t.layerConfig.lineHeight}var i=this.session.getFoldAt(e.row,0);e.$fold=i;if(i){var r=this.session.lineWidgets;if(e.row==i.end.row&&!r[i.start.row])r[i.start.row]=e;else e.hidden=true}this.session._emit("changeFold",{data:{start:{row:e.row}}});this.$updateRows();this.renderWidgets(null,t);this.onWidgetChanged(e);return e};e.prototype.removeLineWidget=function(e){e._inDocument=false;e.session=null;if(e.el&&e.el.parentNode)e.el.parentNode.removeChild(e.el);if(e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e){this.session.lineWidgets[e.row]=e.$oldWidget;if(e.$oldWidget)this.onWidgetChanged(e.$oldWidget)}else{while(t){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}}this.session._emit("changeFold",{data:{start:{row:e.row}}});this.$updateRows()};e.prototype.getWidgetsAtRow=function(e){var t=this.session.lineWidgets;var i=t&&t[e];var n=[];while(i){n.push(i);i=i.$oldWidget}return n};e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e);this.editor&&this.editor.renderer.updateFull()};e.prototype.measureWidgets=function(e,t){var i=this.session._changedWidgets;var n=t.layerConfig;if(!i||!i.length)return;var r=Infinity;for(var o=0;o<i.length;o++){var s=i[o];if(!s||!s.el)continue;if(s.session!=this.session)continue;if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=true;t.container.appendChild(s.el)}s.h=s.el.offsetHeight;if(!s.fixedWidth){s.w=s.el.offsetWidth;s.screenWidth=Math.ceil(s.w/n.characterWidth)}var a=s.h/n.lineHeight;if(s.coverLine){a-=this.session.getRowLineCount(s.row);if(a<0)a=0}if(s.rowCount!=a){s.rowCount=a;if(s.row<r)r=s.row}}if(r!=Infinity){this.session._emit("changeFold",{data:{start:{row:r}}});this.session.lineWidgetWidth=null}this.session._changedWidgets=[]};e.prototype.renderWidgets=function(e,t){var i=t.layerConfig;var n=this.session.lineWidgets;if(!n)return;var r=Math.min(this.firstRow,i.firstRow);var o=Math.max(this.lastRow,i.lastRow,n.length);while(r>0&&!n[r])r--;this.firstRow=i.firstRow;this.lastRow=i.lastRow;t.$cursorLayer.config=i;for(var s=r;s<=o;s++){var a=n[s];if(!a||!a.el)continue;if(a.hidden){a.el.style.top=-100-(a.pixelHeight||0)+"px";continue}if(!a._inDocument){a._inDocument=true;t.container.appendChild(a.el)}var l=t.$cursorLayer.getPixelPosition({row:s,column:0},true).top;if(!a.coverLine)l+=i.lineHeight*this.session.getRowLineCount(a.row);a.el.style.top=l-i.offset+"px";var c=a.coverGutter?0:t.gutterWidth;if(!a.fixedWidth)c-=t.scrollLeft;a.el.style.left=c+"px";if(a.fullWidth&&a.screenWidth){a.el.style.minWidth=i.width+2*i.padding+"px"}if(a.fixedWidth){a.el.style.right=t.scrollBar.getWidth()+"px"}else{a.el.style.right=""}}};return e}();t.LineWidgets=r});ace.define("ace/apply_delta",["require","exports","module"],function(e,t,i){"use strict";function n(e,t){console.log("Invalid Delta:",e);throw"Invalid Delta: "+t}function r(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}function o(e,t){if(t.action!="insert"&&t.action!="remove")n(t,"delta.action must be 'insert' or 'remove'");if(!(t.lines instanceof Array))n(t,"delta.lines must be an Array");if(!t.start||!t.end)n(t,"delta.start/end must be an present");var i=t.start;if(!r(e,t.start))n(t,"delta.start must be contained in document");var o=t.end;if(t.action=="remove"&&!r(e,o))n(t,"delta.end must contained in document for 'remove' actions");var s=o.row-i.row;var a=o.column-(s==0?i.column:0);if(s!=t.lines.length-1||t.lines[s].length!=a)n(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,i){var n=t.start.row;var r=t.start.column;var o=e[n]||"";switch(t.action){case"insert":var s=t.lines;if(s.length===1){e[n]=o.substring(0,r)+t.lines[0]+o.substring(r)}else{var a=[n,1].concat(t.lines);e.splice.apply(e,a);e[n]=o.substring(0,r)+e[n];e[n+t.lines.length-1]+=o.substring(r)}break;case"remove":var l=t.end.column;var c=t.end.row;if(n===c){e[n]=o.substring(0,r)+o.substring(l)}else{e.splice(n,c-n+1,o.substring(0,r)+e[c].substring(l))}break}}});ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/event_emitter").EventEmitter;var o=function(){function e(e,t,i){this.$onChange=this.onChange.bind(this);this.attach(e);if(typeof t!="number")this.setPosition(t.row,t.column);else this.setPosition(t,i)}e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)};e.prototype.getDocument=function(){return this.document};e.prototype.onChange=function(e){if(e.start.row==e.end.row&&e.start.row!=this.row)return;if(e.start.row>this.row)return;var t=a(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,true)};e.prototype.setPosition=function(e,t,i){var n;if(i){n={row:e,column:t}}else{n=this.$clipPositionToDocument(e,t)}if(this.row==n.row&&this.column==n.column)return;var r={row:this.row,column:this.column};this.row=n.row;this.column=n.column;this._signal("change",{old:r,value:n})};e.prototype.detach=function(){this.document.off("change",this.$onChange)};e.prototype.attach=function(e){this.document=e||this.document;this.document.on("change",this.$onChange)};e.prototype.$clipPositionToDocument=function(e,t){var i={};if(e>=this.document.getLength()){i.row=Math.max(0,this.document.getLength()-1);i.column=this.document.getLine(i.row).length}else if(e<0){i.row=0;i.column=0}else{i.row=e;i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))}if(t<0)i.column=0;return i};return e}();o.prototype.$insertRight=false;n.implement(o.prototype,r);function s(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}function a(e,t,i){var n=e.action=="insert";var r=(n?1:-1)*(e.end.row-e.start.row);var o=(n?1:-1)*(e.end.column-e.start.column);var a=e.start;var l=n?a:e.end;if(s(t,a,i)){return{row:t.row,column:t.column}}if(s(l,t,!i)){return{row:t.row+r,column:t.column+(t.row==l.row?o:0)}}return{row:a.row,column:a.column}}t.Anchor=o});ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./apply_delta").applyDelta;var o=e("./lib/event_emitter").EventEmitter;var s=e("./range").Range;var a=e("./anchor").Anchor;var l=function(){function e(e){this.$lines=[""];if(e.length===0){this.$lines=[""]}else if(Array.isArray(e)){this.insertMergedLines({row:0,column:0},e)}else{this.insert({row:0,column:0},e)}}e.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length));this.insert({row:0,column:0},e||"")};e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())};e.prototype.createAnchor=function(e,t){return new a(this,e,t)};e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n";this._signal("changeNewLineMode")};e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}};e.prototype.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e;this._signal("changeNewLineMode")};e.prototype.getNewLineMode=function(){return this.$newLineMode};e.prototype.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"};e.prototype.getLine=function(e){return this.$lines[e]||""};e.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)};e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())};e.prototype.getLength=function(){return this.$lines.length};e.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())};e.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row){t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]}else{t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;if(e.end.row-e.start.row==i)t[i]=t[i].substring(0,e.end.column)}return t};e.prototype.insertLines=function(e,t){console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");return this.insertFullLines(e,t)};e.prototype.removeLines=function(e,t){console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");return this.removeFullLines(e,t)};e.prototype.insertNewLine=function(e){console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");return this.insertMergedLines(e,["",""])};e.prototype.insert=function(e,t){if(this.getLength()<=1)this.$detectNewLine(t);return this.insertMergedLines(e,this.$split(t))};e.prototype.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column);var n=this.pos(e.row,e.column+t.length);this.applyDelta({start:i,end:n,action:"insert",lines:[t]},true);return this.clonePos(n)};e.prototype.clippedPos=function(e,t){var i=this.getLength();if(e===undefined){e=i}else if(e<0){e=0}else if(e>=i){e=i-1;t=undefined}var n=this.getLine(e);if(t==undefined)t=n.length;t=Math.min(Math.max(t,0),n.length);return{row:e,column:t}};e.prototype.clonePos=function(e){return{row:e.row,column:e.column}};e.prototype.pos=function(e,t){return{row:e,column:t}};e.prototype.$clipPosition=function(e){var t=this.getLength();if(e.row>=t){e.row=Math.max(0,t-1);e.column=this.getLine(t-1).length}else{e.row=Math.max(0,e.row);e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)}return e};e.prototype.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var i=0;if(e<this.getLength()){t=t.concat([""]);i=0}else{t=[""].concat(t);e--;i=this.$lines[e].length}this.insertMergedLines({row:e,column:i},t)};e.prototype.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column);var n={row:i.row+t.length-1,column:(t.length==1?i.column:0)+t[t.length-1].length};this.applyDelta({start:i,end:n,action:"insert",lines:t});return this.clonePos(n)};e.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column);var i=this.clippedPos(e.end.row,e.end.column);this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})});return this.clonePos(t)};e.prototype.removeInLine=function(e,t,i){var n=this.clippedPos(e,t);var r=this.clippedPos(e,i);this.applyDelta({start:n,end:r,action:"remove",lines:this.getLinesForRange({start:n,end:r})},true);return this.clonePos(n)};e.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);t=Math.min(Math.max(0,t),this.getLength()-1);var i=t==this.getLength()-1&&e>0;var n=t<this.getLength()-1;var r=i?e-1:e;var o=i?this.getLine(r).length:0;var a=n?t+1:t;var l=n?0:this.getLine(a).length;var c=new s(r,o,a,l);var h=this.$lines.slice(e,t+1);this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)});return h};e.prototype.removeNewLine=function(e){if(e<this.getLength()-1&&e>=0){this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})}};e.prototype.replace=function(e,t){if(!(e instanceof s))e=s.fromPoints(e.start,e.end);if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var i;if(t){i=this.insert(e.start,t)}else{i=e.start}return i};e.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++){this.applyDelta(e[t])}};e.prototype.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){this.revertDelta(e[t])}};e.prototype.applyDelta=function(e,t){var i=e.action=="insert";if(i?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end)){return}if(i&&e.lines.length>2e4){this.$splitAndapplyLargeDelta(e,2e4)}else{r(this.$lines,e,t);this._signal("change",e)}};e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;if(e.action=="remove"&&e.start.row<t&&e.end.row<t||e.action=="insert"&&e.start.row<=t){this.applyDelta(e)}};e.prototype.$splitAndapplyLargeDelta=function(e,t){var i=e.lines;var n=i.length-t+1;var r=e.start.row;var o=e.start.column;for(var s=0,a=0;s<n;s=a){a+=t-1;var l=i.slice(s,a);l.push("");this.applyDelta({start:this.pos(r+s,o),end:this.pos(r+a,o=0),action:e.action,lines:l},true)}e.lines=i.slice(s);e.start.row=r+s;e.start.column=o;this.applyDelta(e,true)};e.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})};e.prototype.indexToPosition=function(e,t){var i=this.$lines||this.getAllLines();var n=this.getNewLineCharacter().length;for(var r=t||0,o=i.length;r<o;r++){e-=i[r].length+n;if(e<0)return{row:r,column:e+i[r].length+n}}return{row:o-1,column:e+i[o-1].length+n}};e.prototype.positionToIndex=function(e,t){var i=this.$lines||this.getAllLines();var n=this.getNewLineCharacter().length;var r=0;var o=Math.min(e.row,i.length);for(var s=t||0;s<o;++s)r+=i[s].length+n;return r+e.column};e.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)};return e}();l.prototype.$autoNewLine="";l.prototype.$newLineMode="auto";n.implement(l.prototype,o);t.Document=l});ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/event_emitter").EventEmitter;var o=function(){function e(e,t){this.running=false;this.lines=[];this.states=[];this.currentLine=0;this.tokenizer=e;var i=this;this.$worker=function(){if(!i.running){return}var e=new Date;var t=i.currentLine;var n=-1;var r=i.doc;var o=t;while(i.lines[t])t++;var s=r.getLength();var a=0;i.running=false;while(t<s){i.$tokenizeRow(t);n=t;do{t++}while(i.lines[t]);a++;if(a%5===0&&new Date-e>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t;if(n==-1)n=t;if(o<=n)i.fireUpdateEvent(o,n)}}e.prototype.setTokenizer=function(e){this.tokenizer=e;this.lines=[];this.states=[];this.start(0)};e.prototype.setDocument=function(e){this.doc=e;this.lines=[];this.states=[];this.stop()};e.prototype.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})};e.prototype.start=function(e){if(!this.doc){return}this.currentLine=Math.min(e||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)};e.prototype.scheduleStart=function(){if(!this.running)this.running=setTimeout(this.$worker,700)};e.prototype.$updateOnChange=function(e){var t=e.start.row;var i=e.end.row-t;if(i===0){this.lines[t]=null}else if(e.action=="remove"){this.lines.splice(t,i+1,null);this.states.splice(t,i+1,null)}else{var n=Array(i+1);n.unshift(t,1);this.lines.splice.apply(this.lines,n);this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength());this.stop()};e.prototype.stop=function(){if(this.running)clearTimeout(this.running);this.running=false};e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)};e.prototype.getState=function(e){if(this.currentLine==e)this.$tokenizeRow(e);return this.states[e]||"start"};e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e);var i=this.states[e-1];var n=this.tokenizer.getLineTokens(t,i,e);if(this.states[e]+""!==n.state+""){this.states[e]=n.state;this.lines[e+1]=null;if(this.currentLine>e+1)this.currentLine=e+1}else if(this.currentLine==e){this.currentLine=e+1}return this.lines[e]=n.tokens};e.prototype.cleanup=function(){this.running=false;this.lines=[];this.states=[];this.currentLine=0;this.removeAllListeners()};return e}();n.implement(o.prototype,r);t.BackgroundTokenizer=o});ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(e,t,i){"use strict";var n=e("./lib/lang");var r=e("./range").Range;var o=function(){function e(e,t,i){if(i===void 0){i="text"}this.setRegexp(e);this.clazz=t;this.type=i}e.prototype.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e;this.cache=[]};e.prototype.update=function(e,t,i,o){if(!this.regExp)return;var s=o.firstRow,a=o.lastRow;var l={};for(var c=s;c<=a;c++){var h=this.cache[c];if(h==null){h=n.getMatchOffsets(i.getLine(c),this.regExp);if(h.length>this.MAX_RANGES)h=h.slice(0,this.MAX_RANGES);h=h.map(function(e){return new r(c,e.offset,c,e.offset+e.length)});this.cache[c]=h.length?h:""}for(var u=h.length;u--;){var d=h[u].toScreenRange(i);var f=d.toString();if(l[f])continue;l[f]=true;t.drawSingleLineMarker(e,d,this.clazz,o)}}};return e}();o.prototype.MAX_RANGES=500;t.SearchHighlight=o});ace.define("ace/undomanager",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=function(){function e(){this.$keepRedoStack;this.$maxRev=0;this.$fromUndo=false;this.$undoDepth=Infinity;this.reset()}e.prototype.addSession=function(e){this.$session=e};e.prototype.add=function(e,t,i){if(this.$fromUndo)return;if(e==this.$lastDelta)return;if(!this.$keepRedoStack)this.$redoStack.length=0;if(t===false||!this.lastDeltas){this.lastDeltas=[];var n=this.$undoStack.length;if(n>this.$undoDepth-1){this.$undoStack.splice(0,n-this.$undoDepth+1)}this.$undoStack.push(this.lastDeltas);e.id=this.$rev=++this.$maxRev}if(e.action=="remove"||e.action=="insert")this.$lastDelta=e;this.lastDeltas.push(e)};e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})};e.prototype.startNewGroup=function(){this.lastDeltas=null;return this.$rev};e.prototype.markIgnored=function(e,t){if(t==null)t=this.$rev+1;var i=this.$undoStack;for(var n=i.length;n--;){var r=i[n][0];if(r.id<=e)break;if(r.id<t)r.ignore=true}this.lastDeltas=null};e.prototype.getSelection=function(e,t){var i=this.selections;for(var n=i.length;n--;){var r=i[n];if(r.rev<e){if(t)r=i[n+1];return r}}};e.prototype.getRevision=function(){return this.$rev};e.prototype.getDeltas=function(e,t){if(t==null)t=this.$rev+1;var i=this.$undoStack;var n=null,r=0;for(var o=i.length;o--;){var s=i[o][0];if(s.id<t&&!n)n=o+1;if(s.id<=e){r=o+1;break}}return i.slice(r,n)};e.prototype.getChangedRanges=function(e,t){if(t==null)t=this.$rev+1};e.prototype.getChangedLines=function(e,t){if(t==null)t=this.$rev+1};e.prototype.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(!r(i,i.length))return;if(!e)e=this.$session;if(this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length)this.$redoStack=[];this.$fromUndo=true;var n=i.pop();var o=null;if(n){o=e.undoChanges(n,t);this.$redoStack.push(n);this.$syncRev()}this.$fromUndo=false;return o};e.prototype.redo=function(e,t){this.lastDeltas=null;if(!e)e=this.$session;this.$fromUndo=true;if(this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);b(this.$redoStack,i);this.$redoStackBaseRev=this.$rev;this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var n=this.$redoStack.pop();var r=null;if(n){r=e.redoChanges(n,t);this.$undoStack.push(n);this.$syncRev()}this.$fromUndo=false;return r};e.prototype.$syncRev=function(){var e=this.$undoStack;var t=e[e.length-1];var i=t&&t[0].id||0;this.$redoStackBaseRev=i;this.$rev=i};e.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=[]};e.prototype.canUndo=function(){return this.$undoStack.length>0};e.prototype.canRedo=function(){return this.$redoStack.length>0};e.prototype.bookmark=function(e){if(e==undefined)e=this.$rev;this.mark=e};e.prototype.isAtBookmark=function(){return this.$rev===this.mark};e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}};e.prototype.fromJSON=function(e){this.reset();this.$undoStack=e.$undoStack;this.$redoStack=e.$redoStack};e.prototype.$prettyPrint=function(e){if(e)return u(e);return u(this.$undoStack)+"\n---\n"+u(this.$redoStack)};return e}();n.prototype.hasUndo=n.prototype.canUndo;n.prototype.hasRedo=n.prototype.canRedo;n.prototype.isClean=n.prototype.isAtBookmark;n.prototype.markClean=n.prototype.bookmark;function r(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){while(i<t-1){var r=g(e[i],e[i+1]);e[i]=r[0];e[i+1]=r[1];i++}return true}}}var o=e("./range").Range;var s=o.comparePoints;var a=o.comparePoints;function l(e){var t=e.action=="insert";var i=e.start;var n=e.end;var r=(n.row-i.row)*(t?1:-1);var o=(n.column-i.column)*(t?1:-1);if(t)n=i;for(var s in this.marks){var l=this.marks[s];var c=a(l,i);if(c<0){continue}if(c===0){if(t){if(l.bias==1){c=1}else{l.bias==-1;continue}}}var h=t?c:a(l,n);if(h>0){l.row+=r;l.column+=l.row==n.row?o:0;continue}if(!t&&h<=0){l.row=i.row;l.column=i.column;if(h===0)l.bias=1}}}function c(e){return{row:e.row,column:e.column}}function h(e){return{start:c(e.start),end:c(e.end),action:e.action,lines:e.lines.slice()}}function u(e){e=e||this;if(Array.isArray(e)){return e.map(u).join("\n")}var t="";if(e.action){t=e.action=="insert"?"+":"-";t+="["+e.lines+"]"}else if(e.value){if(Array.isArray(e.value)){t=e.value.map(d).join("\n")}else{t=d(e.value)}}if(e.start){t+=d(e)}if(e.id||e.rev){t+="\t("+(e.id||e.rev)+")"}return t}function d(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function f(e,t){var i=e.action=="insert";var n=t.action=="insert";if(i&&n){if(s(t.start,e.end)>=0){m(t,e,-1)}else if(s(t.start,e.start)<=0){m(e,t,+1)}else{return null}}else if(i&&!n){if(s(t.start,e.end)>=0){m(t,e,-1)}else if(s(t.end,e.start)<=0){m(e,t,-1)}else{return null}}else if(!i&&n){if(s(t.start,e.start)>=0){m(t,e,+1)}else if(s(t.start,e.start)<=0){m(e,t,+1)}else{return null}}else if(!i&&!n){if(s(t.start,e.start)>=0){m(t,e,+1)}else if(s(t.end,e.start)<=0){m(e,t,-1)}else{return null}}return[t,e]}function g(e,t){for(var i=e.length;i--;){for(var n=0;n<t.length;n++){if(!f(e[i],t[n])){while(i<e.length){while(n--){f(t[n],e[i])}n=t.length;i++}return[e,t]}}}e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null;return[t,e]}function p(e,t){var i=e.action=="insert";var n=t.action=="insert";if(i&&n){if(s(e.start,t.start)<0){m(t,e,1)}else{m(e,t,1)}}else if(i&&!n){if(s(e.start,t.end)>=0){m(e,t,-1)}else if(s(e.start,t.start)<=0){m(t,e,+1)}else{m(e,o.fromPoints(t.start,e.start),-1);m(t,e,+1)}}else if(!i&&n){if(s(t.start,e.end)>=0){m(t,e,-1)}else if(s(t.start,e.start)<=0){m(e,t,+1)}else{m(t,o.fromPoints(e.start,t.start),-1);m(e,t,+1)}}else if(!i&&!n){if(s(t.start,e.end)>=0){m(t,e,-1)}else if(s(t.end,e.start)<=0){m(e,t,-1)}else{var r,a;if(s(e.start,t.start)<0){r=e;e=y(e,t.start)}if(s(e.end,t.end)>0){a=y(e,t.end)}v(t.end,e.start,e.end,-1);if(a&&!r){e.lines=a.lines;e.start=a.start;e.end=a.end;a=e}return[t,r,a].filter(Boolean)}}return[t,e]}function m(e,t,i){v(e.start,t.start,t.end,i);v(e.end,t.start,t.end,i)}function v(e,t,i,n){if(e.row==(n==1?t:i).row){e.column+=n*(i.column-t.column)}e.row+=n*(i.row-t.row)}function y(e,t){var i=e.lines;var n=e.end;e.end=c(t);var r=e.end.row-e.start.row;var o=i.splice(r,i.length);var s=r?t.column:t.column-e.start.column;i.push(o[0].substring(0,s));o[0]=o[0].substr(s);var a={start:c(t),end:n,lines:o,action:e.action};return a}function w(e,t){t=h(t);for(var i=e.length;i--;){var n=e[i];for(var r=0;r<n.length;r++){var o=n[r];var s=p(o,t);t=s[0];if(s.length!=2){if(s[2]){n.splice(r+1,1,s[1],s[2]);r++}else if(!s[1]){n.splice(r,1);r--}}}if(!n.length){e.splice(i,1)}}return e}function b(e,t){for(var i=0;i<t.length;i++){var n=t[i];for(var r=0;r<n.length;r++){w(e,n[r])}}}t.UndoManager=n});ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../range").Range;var r=function(){function e(e,t){this.foldData=e;if(Array.isArray(t)){this.folds=t}else{t=this.folds=[t]}var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column);this.start=this.range.start;this.end=this.range.end;this.folds.forEach(function(e){e.setFoldLine(this)},this)}e.prototype.shiftRow=function(e){this.start.row+=e;this.end.row+=e;this.folds.forEach(function(t){t.start.row+=e;t.end.row+=e})};e.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow){throw new Error("Can't add a fold to this FoldLine as it has no connection")}this.folds.push(e);this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)});if(this.range.compareEnd(e.start.row,e.start.column)>0){this.end.row=e.end.row;this.end.column=e.end.column}else if(this.range.compareStart(e.end.row,e.end.column)<0){this.start.row=e.start.row;this.start.column=e.start.column}}else if(e.start.row==this.end.row){this.folds.push(e);this.end.row=e.end.row;this.end.column=e.end.column}else if(e.end.row==this.start.row){this.folds.unshift(e);this.start.row=e.start.row;this.start.column=e.start.column}else{throw new Error("Trying to add fold to FoldRow that doesn't have a matching row")}e.foldLine=this};e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row};e.prototype.walk=function(e,t,i){var n=0,r=this.folds,o,s,a,l=true;if(t==null){t=this.end.row;i=this.end.column}for(var c=0;c<r.length;c++){o=r[c];s=o.range.compareStart(t,i);if(s==-1){e(null,t,i,n,l);return}a=e(null,o.start.row,o.start.column,n,l);a=!a&&e(o.placeholder,o.start.row,o.start.column,n);if(a||s===0){return}l=!o.sameRow;n=o.end.column}e(null,t,i,n,l)};e.prototype.getNextFoldTo=function(e,t){var i,n;for(var r=0;r<this.folds.length;r++){i=this.folds[r];n=i.range.compareEnd(e,t);if(n==-1){return{fold:i,kind:"after"}}else if(n===0){return{fold:i,kind:"inside"}}}return null};e.prototype.addRemoveChars=function(e,t,i){var n=this.getNextFoldTo(e,t),r,o;if(n){r=n.fold;if(n.kind=="inside"&&r.start.column!=t&&r.start.row!=e){window.console&&window.console.log(e,t,r)}else if(r.start.row==e){o=this.folds;var s=o.indexOf(r);if(s===0){this.start.column+=i}for(s;s<o.length;s++){r=o[s];r.start.column+=i;if(!r.sameRow){return}r.end.column+=i}this.end.column+=i}}};e.prototype.split=function(t,i){var n=this.getNextFoldTo(t,i);if(!n||n.kind=="inside")return null;var r=n.fold;var o=this.folds;var s=this.foldData;var a=o.indexOf(r);var l=o[a-1];this.end.row=l.end.row;this.end.column=l.end.column;o=o.splice(a,o.length-a);var c=new e(s,o);s.splice(s.indexOf(this)+1,0,c);return c};e.prototype.merge=function(e){var t=e.folds;for(var i=0;i<t.length;i++){this.addFold(t[i])}var n=this.foldData;n.splice(n.indexOf(e),1)};e.prototype.toString=function(){var e=[this.range.toString()+": ["];this.folds.forEach(function(t){e.push("  "+t.toString())});e.push("]");return e.join("\n")};e.prototype.idxToPosition=function(e){var t=0;for(var i=0;i<this.folds.length;i++){var n=this.folds[i];e-=n.start.column-t;if(e<0){return{row:n.start.row,column:n.start.column+e}}e-=n.placeholder.length;if(e<0){return n.start}t=n.end.column}return{row:this.end.row,column:this.end.column+e}};return e}();t.FoldLine=r});ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("./range").Range;var r=n.comparePoints;var o=function(){function e(){this.ranges=[];this.$bias=1}e.prototype.pointIndex=function(e,t,i){var n=this.ranges;for(var o=i||0;o<n.length;o++){var s=n[o];var a=r(e,s.end);if(a>0)continue;var l=r(e,s.start);if(a===0)return t&&l!==0?-o-2:o;if(l>0||l===0&&!t)return o;return-o-1}return-o-1};e.prototype.add=function(e){var t=!e.isEmpty();var i=this.pointIndex(e.start,t);if(i<0)i=-i-1;var n=this.pointIndex(e.end,t,i);if(n<0)n=-n-1;else n++;return this.ranges.splice(i,n-i,e)};e.prototype.addList=function(e){var t=[];for(var i=e.length;i--;){t.push.apply(t,this.add(e[i]))}return t};e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)};e.prototype.merge=function(){var e=[];var t=this.ranges;t=t.sort(function(e,t){return r(e.start,t.start)});var i=t[0],n;for(var o=1;o<t.length;o++){n=i;i=t[o];var s=r(n.end,i.start);if(s<0)continue;if(s==0&&!n.isEmpty()&&!i.isEmpty())continue;if(r(n.end,i.end)<0){n.end.row=i.end.row;n.end.column=i.end.column}t.splice(o,1);e.push(i);i=n;o--}this.ranges=t;return e};e.prototype.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0};e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0};e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]};e.prototype.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});if(n<0)n=-n-1;var r=this.pointIndex({row:t,column:0},n);if(r<0)r=-r-1;var o=[];for(var s=n;s<r;s++){o.push(i[s])}return o};e.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)};e.prototype.attach=function(e){if(this.session)this.detach();this.session=e;this.onChange=this.$onChange.bind(this);this.session.on("change",this.onChange)};e.prototype.detach=function(){if(!this.session)return;this.session.removeListener("change",this.onChange);this.session=null};e.prototype.$onChange=function(e){var t=e.start;var i=e.end;var n=t.row;var r=i.row;var o=this.ranges;for(var s=0,a=o.length;s<a;s++){var l=o[s];if(l.end.row>=n)break}if(e.action=="insert"){var c=r-n;var h=-t.column+i.column;for(;s<a;s++){var l=o[s];if(l.start.row>n)break;if(l.start.row==n&&l.start.column>=t.column){if(l.start.column==t.column&&this.$bias<=0){}else{l.start.column+=h;l.start.row+=c}}if(l.end.row==n&&l.end.column>=t.column){if(l.end.column==t.column&&this.$bias<0){continue}if(l.end.column==t.column&&h>0&&s<a-1){if(l.end.column>l.start.column&&l.end.column==o[s+1].start.column)l.end.column-=h}l.end.column+=h;l.end.row+=c}}}else{var c=n-r;var h=t.column-i.column;for(;s<a;s++){var l=o[s];if(l.start.row>r)break;if(l.end.row<r&&(n<l.end.row||n==l.end.row&&t.column<l.end.column)){l.end.row=n;l.end.column=t.column}else if(l.end.row==r){if(l.end.column<=i.column){if(c||l.end.column>t.column){l.end.column=t.column;l.end.row=t.row}}else{l.end.column+=h;l.end.row+=c}}else if(l.end.row>r){l.end.row+=c}if(l.start.row<r&&(n<l.start.row||n==l.start.row&&t.column<l.start.column)){l.start.row=n;l.start.column=t.column}else if(l.start.row==r){if(l.start.column<=i.column){if(c||l.start.column>t.column){l.start.column=t.column;l.start.row=t.row}}else{l.start.column+=h;l.start.row+=c}}else if(l.start.row>r){l.start.row+=c}}}if(c!=0&&s<a){for(;s<a;s++){var l=o[s];l.start.row+=c;l.end.row+=c}}};return e}();o.prototype.comparePoints=r;t.RangeList=o});ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=e("../range_list").RangeList;var o=function(e){n(t,e);function t(t,i){var n=e.call(this)||this;n.foldLine=null;n.placeholder=i;n.range=t;n.start=t.start;n.end=t.end;n.sameRow=t.start.row==t.end.row;n.subFolds=n.ranges=[];return n}t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()};t.prototype.setFoldLine=function(e){this.foldLine=e;this.subFolds.forEach(function(t){t.setFoldLine(e)})};t.prototype.clone=function(){var e=this.range.clone();var i=new t(e,this.placeholder);this.subFolds.forEach(function(e){i.subFolds.push(e.clone())});i.collapseChildren=this.collapseChildren;return i};t.prototype.addSubFold=function(e){if(this.range.isEqual(e))return;a(e,this.start);var t=e.start.row,i=e.start.column;for(var n=0,r=-1;n<this.subFolds.length;n++){r=this.subFolds[n].range.compare(t,i);if(r!=1)break}var o=this.subFolds[n];var s=0;if(r==0){if(o.range.containsRange(e))return o.addSubFold(e);else s=1}var t=e.range.end.row,i=e.range.end.column;for(var l=n,r=-1;l<this.subFolds.length;l++){r=this.subFolds[l].range.compare(t,i);if(r!=1)break}if(r==0)l++;var c=this.subFolds.splice(n,l-n,e);var h=r==0?c.length-1:c.length;for(var u=s;u<h;u++){e.addSubFold(c[u])}e.setFoldLine(this.foldLine);return e};t.prototype.restoreRange=function(e){return c(e,this.start)};return t}(r);function s(e,t){e.row-=t.row;if(e.row==0)e.column-=t.column}function a(e,t){s(e.start,t);s(e.end,t)}function l(e,t){if(e.row==0)e.column+=t.column;e.row+=t.row}function c(e,t){l(e.start,t);l(e.end,t)}t.Fold=o});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(e,t,i){"use strict";var n=e("../range").Range;var r=e("./fold_line").FoldLine;var o=e("./fold").Fold;var s=e("../token_iterator").TokenIterator;var a=e("../mouse/mouse_event").MouseEvent;function l(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;var r=n.folds;for(var o=0;o<r.length;o++){var s=r[o].range;if(s.contains(e,t)){if(i==1&&s.isEnd(e,t)&&!s.isEmpty()){continue}else if(i==-1&&s.isStart(e,t)&&!s.isEmpty()){continue}return r[o]}}};this.getFoldsInRange=function(e){var t=e.start;var i=e.end;var n=this.$foldData;var r=[];t.column+=1;i.column-=1;for(var o=0;o<n.length;o++){var s=n[o].range.compareRange(e);if(s==2){continue}else if(s==-2){break}var a=n[o].folds;for(var l=0;l<a.length;l++){var c=a[l];s=c.range.compareRange(e);if(s==-2){break}else if(s==2){continue}else if(s==42){break}r.push(c)}}t.column-=1;i.column+=1;return r};this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else{var t=this.getFoldsInRange(e)}return t};this.getAllFolds=function(){var e=[];var t=this.$foldData;for(var i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e};this.getFoldStringAt=function(e,t,i,n){n=n||this.getFoldLine(e);if(!n)return null;var r={end:{column:0}};var o,s;for(var a=0;a<n.folds.length;a++){s=n.folds[a];var l=s.range.compareEnd(e,t);if(l==-1){o=this.getLine(s.start.row).substring(r.end.column,s.start.column);break}else if(l===0){return null}r=s}if(!o)o=this.getLine(s.start.row).substring(r.end.column);if(i==-1)return o.substring(0,t-r.end.column);else if(i==1)return o.substring(t-r.end.column);else return o};this.getFoldLine=function(e,t){var i=this.$foldData;var n=0;if(t)n=i.indexOf(t);if(n==-1)n=0;for(n;n<i.length;n++){var r=i[n];if(r.start.row<=e&&r.end.row>=e){return r}else if(r.end.row>e){return null}}return null};this.getNextFoldLine=function(e,t){var i=this.$foldData;var n=0;if(t)n=i.indexOf(t);if(n==-1)n=0;for(n;n<i.length;n++){var r=i[n];if(r.end.row>=e){return r}}return null};this.getFoldedRowCount=function(e,t){var i=this.$foldData,n=t-e+1;for(var r=0;r<i.length;r++){var o=i[r],s=o.end.row,a=o.start.row;if(s>=t){if(a<t){if(a>=e)n-=t-a;else n=0}break}else if(s>=e){if(a>=e)n-=s-a;else n-=s-e+1}}return n};this.$addFoldLine=function(e){this.$foldData.push(e);this.$foldData.sort(function(e,t){return e.start.row-t.start.row});return e};this.addFold=function(e,t){var i=this.$foldData;var n=false;var s;if(e instanceof o)s=e;else{s=new o(t,e);s.collapseChildren=t.collapseChildren}this.$clipRangeToDocument(s.range);var a=s.start.row;var l=s.start.column;var c=s.end.row;var h=s.end.column;var u=this.getFoldAt(a,l,1);var d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(s);if(u&&!u.range.isStart(a,l))this.removeFold(u);if(d&&!d.range.isEnd(c,h))this.removeFold(d);var f=this.getFoldsInRange(s.range);if(f.length>0){this.removeFolds(f);if(!s.collapseChildren){f.forEach(function(e){s.addSubFold(e)})}}for(var g=0;g<i.length;g++){var p=i[g];if(c==p.start.row){p.addFold(s);n=true;break}else if(a==p.end.row){p.addFold(s);n=true;if(!s.sameRow){var m=i[g+1];if(m&&m.start.row==c){p.merge(m);break}}break}else if(c<=p.start.row){break}}if(!n)p=this.$addFoldLine(new r(this.$foldData,s));if(this.$useWrapMode)this.$updateWrapData(p.start.row,p.start.row);else this.$updateRowLengthCache(p.start.row,p.start.row);this.$modified=true;this._signal("changeFold",{data:s,action:"add"});return s};this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)};this.removeFold=function(e){var t=e.foldLine;var i=t.start.row;var n=t.end.row;var r=this.$foldData;var o=t.folds;if(o.length==1){r.splice(r.indexOf(t),1)}else if(t.range.isEnd(e.end.row,e.end.column)){o.pop();t.end.row=o[o.length-1].end.row;t.end.column=o[o.length-1].end.column}else if(t.range.isStart(e.start.row,e.start.column)){o.shift();t.start.row=o[0].start.row;t.start.column=o[0].start.column}else if(e.sameRow){o.splice(o.indexOf(e),1)}else{var s=t.split(e.start.row,e.start.column);o=s.folds;o.shift();s.start.row=o[0].start.row;s.start.column=o[0].start.column}if(!this.$updating){if(this.$useWrapMode)this.$updateWrapData(i,n);else this.$updateRowLengthCache(i,n)}this.$modified=true;this._signal("changeFold",{data:e,action:"remove"})};this.removeFolds=function(e){var t=[];for(var i=0;i<e.length;i++){t.push(e[i])}t.forEach(function(e){this.removeFold(e)},this);this.$modified=true};this.expandFold=function(e){this.removeFold(e);e.subFolds.forEach(function(t){e.restoreRange(t);this.addFold(t)},this);if(e.collapseChildren>0){this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1)}e.subFolds=[]};this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)};this.unfold=function(e,t){var i,r;if(e==null){i=new n(0,0,this.getLength(),0);if(t==null)t=true}else if(typeof e=="number"){i=new n(e,0,e,this.getLine(e).length)}else if("row"in e){i=n.fromPoints(e,e)}else if(Array.isArray(e)){r=[];e.forEach(function(e){r=r.concat(this.unfold(e))},this);return r}else{i=e}r=this.getFoldsInRangeList(i);var o=r;while(r.length==1&&n.comparePoints(r[0].start,i.start)<0&&n.comparePoints(r[0].end,i.end)>0){this.expandFolds(r);r=this.getFoldsInRangeList(i)}if(t!=false){this.removeFolds(r)}else{this.expandFolds(r)}if(o.length)return o};this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)};this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e};this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e};this.getFoldDisplayLine=function(e,t,i,n,r){if(n==null)n=e.start.row;if(r==null)r=0;if(t==null)t=e.end.row;if(i==null)i=this.getLine(t).length;var o=this.doc;var s="";e.walk(function(e,t,i,a){if(t<n)return;if(t==n){if(i<r)return;a=Math.max(r,a)}if(e!=null){s+=e}else{s+=o.getLine(t).substring(a,i)}},t,i);return s};this.getDisplayLine=function(e,t,i,n){var r=this.getFoldLine(e);if(!r){var o;o=this.doc.getLine(e);return o.substring(n||0,t||o.length)}else{return this.getFoldDisplayLine(r,e,t,i,n)}};this.$cloneFoldData=function(){var e=[];e=this.$foldData.map(function(t){var i=t.folds.map(function(e){return e.clone()});return new r(e,i)});return e};this.toggleFold=function(e){var t=this.selection;var i=t.getRange();var n;var r;if(i.isEmpty()){var o=i.start;n=this.getFoldAt(o.row,o.column);if(n){this.expandFold(n);return}else if(r=this.findMatchingBracket(o)){if(i.comparePoint(r)==1){i.end=r}else{i.start=r;i.start.column++;i.end.column--}}else if(r=this.findMatchingBracket({row:o.row,column:o.column+1})){if(i.comparePoint(r)==1)i.end=r;else i.start=r;i.start.column++}else{i=this.getCommentFoldRange(o.row,o.column)||i}}else{var s=this.getFoldsInRange(i);if(e&&s.length){this.expandFolds(s);return}else if(s.length==1){n=s[0]}}if(!n)n=this.getFoldAt(i.start.row,i.start.column);if(n&&n.range.toString()==i.toString()){this.expandFold(n);return}var a="...";if(!i.isMultiLine()){a=this.getTextRange(i);if(a.length<4)return;a=a.trim().substring(0,2)+".."}this.addFold(a,i)};this.getCommentFoldRange=function(e,t,i){var r=new s(this,e,t);var o=r.getCurrentToken();var a=o&&o.type;if(o&&/^comment|string/.test(a)){a=a.match(/comment|string/)[0];if(a=="comment")a+="|doc-start|\\.doc";var l=new RegExp(a);var c=new n;if(i!=1){do{o=r.stepBackward()}while(o&&l.test(o.type));o=r.stepForward()}c.start.row=r.getCurrentTokenRow();c.start.column=r.getCurrentTokenColumn()+o.value.length;r=new s(this,e,t);var h=this.getState(r.$row);if(i!=-1){var u=-1;do{o=r.stepForward();if(u==-1){var d=this.getState(r.$row);if(h.toString()!==d.toString())u=r.$row}else if(r.$row>u){break}}while(o&&l.test(o.type));o=r.stepBackward()}else o=r.getCurrentToken();c.end.row=r.getCurrentTokenRow();c.end.column=r.getCurrentTokenColumn();return c}};this.foldAll=function(e,t,i,n){if(i==undefined)i=1e5;var r=this.foldWidgets;if(!r)return;t=t||this.getLength();e=e||0;for(var o=e;o<t;o++){if(r[o]==null)r[o]=this.getFoldWidget(o);if(r[o]!="start")continue;if(n&&!n(o))continue;var s=this.getFoldWidgetRange(o);if(s&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e){o=s.end.row;s.collapseChildren=i;this.addFold("...",s)}}};this.foldToLevel=function(e){this.foldAll();while(e-- >0)this.unfold(null,false)};this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(t){var i=e.getTokens(t);for(var n=0;n<i.length;n++){var r=i[n];if(r.type=="text"&&/^\s+$/.test(r.value))continue;if(/comment/.test(r.type))return true;return false}})};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)return;this.$foldStyle=e;if(e=="manual")this.unfold();var t=this.$foldMode;this.$setFolding(null);this.$setFolding(t)};this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e;this.off("change",this.$updateFoldWidgets);this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets);this._signal("changeAnnotation");if(!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,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};var n=e-1,r;while(n>=0){var o=i[n];if(o==null)o=i[n]=this.getFoldWidget(n);if(o=="start"){var s=this.getFoldWidgetRange(n);if(!r)r=s;if(s&&s.end.row>=e)break}n--}return{range:n!==-1&&s,firstRange:r}};this.onFoldWidgetClick=function(e,t){if(t instanceof a)t=t.domEvent;var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};var n=this.$toggleFoldWidget(e,i);if(!n){var r=t.target||t.srcElement;if(r&&/ace_fold-widget/.test(r.className))r.className+=" ace_invalid"}};this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var i=this.getFoldWidget(e);var n=this.getLine(e);var r=i==="end"?-1:1;var o=this.getFoldAt(e,r===-1?0:n.length,r);if(o){if(t.children||t.all)this.removeFold(o);else this.expandFold(o);return o}var s=this.getFoldWidgetRange(e,true);if(s&&!s.isMultiLine()){o=this.getFoldAt(s.start.row,s.start.column,1);if(o&&s.isEqual(o.range)){this.removeFold(o);return o}}if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range){var l=a.range.start.row+1;var c=a.range.end.row}this.foldAll(l,c,t.all?1e4:0)}else if(t.children){c=s?s.end.row:this.getLength();this.foldAll(e+1,c,t.all?1e4:0)}else if(s){if(t.all)s.collapseChildren=1e4;this.addFold("...",s)}return s};this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(i)return;var n=this.getParentFoldRangeData(t,true);i=n.range||n.firstRange;if(i){t=i.start.row;var r=this.getFoldAt(t,this.getLine(t).length,1);if(r){this.removeFold(r)}else{this.addFold("...",i)}}};this.updateFoldWidgets=function(e){var t=e.start.row;var i=e.end.row-t;if(i===0){this.foldWidgets[t]=null}else if(e.action=="remove"){this.foldWidgets.splice(t,i+1,null)}else{var n=Array(i+1);n.unshift(t,1);this.foldWidgets.splice.apply(this.foldWidgets,n)}};this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;if(t.first!=t.last){if(this.foldWidgets.length>t.first)this.foldWidgets.splice(t.first,this.foldWidgets.length)}}}t.Folding=l});ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,i){"use strict";var n=e("../token_iterator").TokenIterator;var r=e("../range").Range;function o(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(i=="")return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);if(!n)return null;if(n[1])return this.$findClosingBracket(n[1],e);else return this.$findOpeningBracket(n[2],e)};this.getBracketRange=function(e){var t=this.getLine(e.row);var i=true,n;var o=t.charAt(e.column-1);var s=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(!s){o=t.charAt(e.column);e={row:e.row,column:e.column+1};s=o&&o.match(/([\(\[\{])|([\)\]\}])/);i=false}if(!s)return null;if(s[1]){var a=this.$findClosingBracket(s[1],e);if(!a)return null;n=r.fromPoints(e,a);if(!i){n.end.column++;n.start.column--}n.cursor=n.end}else{var a=this.$findOpeningBracket(s[2],e);if(!a)return null;n=r.fromPoints(a,e);if(!i){n.start.column++;n.end.column--}n.cursor=n.start}return n};this.getMatchingBracketRanges=function(e,t){var i=this.getLine(e.row);var n=/([\(\[\{])|([\)\]\}])/;var o=!t&&i.charAt(e.column-1);var s=o&&o.match(n);if(!s){o=(t===undefined||t)&&i.charAt(e.column);e={row:e.row,column:e.column+1};s=o&&o.match(n)}if(!s)return null;var a=new r(e.row,e.column-1,e.row,e.column);var l=s[1]?this.$findClosingBracket(s[1],e):this.$findOpeningBracket(s[2],e);if(!l)return[a];var c=new r(l.row,l.column,l.row,l.column+1);return[a,c]};this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"};this.$findOpeningBracket=function(e,t,i){var r=this.$brackets[e];var o=1;var s=new n(this,t.row,t.column);var a=s.getCurrentToken();if(!a)a=s.stepForward();if(!a)return;if(!i){i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+")}var l=t.column-s.getCurrentTokenColumn()-2;var c=a.value;while(true){while(l>=0){var h=c.charAt(l);if(h==r){o-=1;if(o==0){return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}}else if(h==e){o+=1}l-=1}do{a=s.stepBackward()}while(a&&!i.test(a.type));if(a==null)break;c=a.value;l=c.length-1}return null};this.$findClosingBracket=function(e,t,i){var r=this.$brackets[e];var o=1;var s=new n(this,t.row,t.column);var a=s.getCurrentToken();if(!a)a=s.stepForward();if(!a)return;if(!i){i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+")}var l=t.column-s.getCurrentTokenColumn();while(true){var c=a.value;var h=c.length;while(l<h){var u=c.charAt(l);if(u==r){o-=1;if(o==0){return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}}else if(u==e){o+=1}l+=1}do{a=s.stepForward()}while(a&&!i.test(a.type));if(a==null)break;l=0}return null};this.getMatchingTags=function(e){var t=new n(this,e.row,e.column);var i=this.$findTagName(t);if(!i)return;var r=t.stepBackward();if(r.value==="<"){return this.$findClosingTag(t,i)}else{return this.$findOpeningTag(t,i)}};this.$findTagName=function(e){var t=e.getCurrentToken();var i=false;var n=false;if(t&&t.type.indexOf("tag-name")===-1){do{if(n)t=e.stepBackward();else t=e.stepForward();if(t){if(t.value==="/>"){n=true}else if(t.type.indexOf("tag-name")!==-1){i=true}}}while(t&&!i)}return t};this.$findClosingTag=function(e,t){var i;var n=t.value;var o=t.value;var s=0;var a=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);var c=false;do{i=t;if(i.type.indexOf("tag-close")!==-1&&!c){var h=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=true}t=e.stepForward();if(t){if(t.value===">"&&!c){var h=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=true}if(t.type.indexOf("tag-name")!==-1){n=t.value;if(o===n){if(i.value==="<"){s++}else if(i.value==="</"){s--;if(s<0){e.stepBackward();var u=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2);t=e.stepForward();var d=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(t.type.indexOf("tag-close")===-1){t=e.stepForward()}if(t&&t.value===">"){var f=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}else{return}}}}}else if(o===n&&t.value==="/>"){s--;if(s<0){var u=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2);var d=u;var f=d;var h=new r(l.end.row,l.end.column,l.end.row,l.end.column+1)}}}}while(t&&s>=0);if(a&&h&&u&&f&&l&&d){return{openTag:new r(a.start.row,a.start.column,h.end.row,h.end.column),closeTag:new r(u.start.row,u.start.column,f.end.row,f.end.column),openTagName:l,closeTagName:d}}};this.$findOpeningTag=function(e,t){var i=e.getCurrentToken();var n=t.value;var o=0;var s=e.getCurrentTokenRow();var a=e.getCurrentTokenColumn();var l=a+2;var c=new r(s,a,s,l);e.stepForward();var h=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(t.type.indexOf("tag-close")===-1){t=e.stepForward()}if(!t||t.value!==">")return;var u=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward();e.stepBackward();do{t=i;s=e.getCurrentTokenRow();a=e.getCurrentTokenColumn();l=a+t.value.length;i=e.stepBackward();if(t){if(t.type.indexOf("tag-name")!==-1){if(n===t.value){if(i.value==="<"){o++;if(o>0){var d=new r(s,a,s,l);var f=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&t.value!==">");var g=new r(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else if(i.value==="</"){o--}}}else if(t.value==="/>"){var p=0;var m=i;while(m){if(m.type.indexOf("tag-name")!==-1&&m.value===n){o--;break}else if(m.value==="<"){break}m=e.stepBackward();p++}for(var v=0;v<p;v++){e.stepForward()}}}}while(i&&o<=0);if(f&&g&&c&&u&&d&&h){return{openTag:new r(f.start.row,f.start.column,g.end.row,g.end.column),closeTag:new r(c.start.row,c.start.column,u.end.row,u.end.column),openTagName:d,closeTagName:h}}}}t.BracketMatch=o});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/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/lang");var o=e("./bidihandler").BidiHandler;var s=e("./config");var a=e("./lib/event_emitter").EventEmitter;var l=e("./selection").Selection;var c=e("./mode/text").Mode;var h=e("./range").Range;var u=e("./line_widgets").LineWidgets;var d=e("./document").Document;var f=e("./background_tokenizer").BackgroundTokenizer;var g=e("./search_highlight").SearchHighlight;var p=e("./undomanager").UndoManager;var m=function(){function e(t,i){this.doc;this.$breakpoints=[];this.$decorations=[];this.$frontMarkers={};this.$backMarkers={};this.$markerId=1;this.$undoSelect=true;this.$editor=null;this.prevOp={};this.$foldData=[];this.id="session"+ ++e.$uid;this.$foldData.toString=function(){return this.join("\n")};this.bgTokenizer=new f((new c).getTokenizer(),this);var n=this;this.bgTokenizer.on("update",function(e){n._signal("tokenizerUpdate",e)});this.on("changeFold",this.onChangeFold.bind(this));this.$onChange=this.onChange.bind(this);if(typeof t!="object"||!t.getLine)t=new d(t);this.setDocument(t);this.selection=new l(this);this.$onSelectionChange=this.onSelectionChange.bind(this);this.selection.on("changeSelection",this.$onSelectionChange);this.selection.on("changeCursor",this.$onSelectionChange);this.$bidiHandler=new o(this);s.resetOptions(this);this.setMode(i);s._signal("session",this);this.destroyed=false;this.$initOperationListeners()}e.prototype.$initOperationListeners=function(){var e=this;this.curOp=null;this.on("change",function(){if(!e.curOp){e.startOperation();e.curOp.selectionBefore=e.$lastSel}e.curOp.docChanged=true},true);this.on("changeSelection",function(){if(!e.curOp){e.startOperation();e.curOp.selectionBefore=e.$lastSel}e.curOp.selectionChanged=true},true);this.$operationResetTimer=r.delayedCall(this.endOperation.bind(this,true))};e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command){return}this.prevOp=this.curOp}if(!e){e={}}this.$operationResetTimer.schedule();this.curOp={command:e.command||{},args:e.args};this.curOp.selectionBefore=this.selection.toJSON();this._signal("startOperation",e)};e.prototype.endOperation=function(e){if(this.curOp){if(e&&e.returnValue===false){this.curOp=null;this._signal("endOperation",e);return}if(e==true&&this.curOp.command&&this.curOp.command.name=="mouse"){return}var t=this.selection.toJSON();this.curOp.selectionAfter=t;this.$lastSel=this.selection.toJSON();this.getUndoManager().addSelection(t);this._signal("beforeEndOperation");this.prevOp=this.curOp;this.curOp=null;this._signal("endOperation",e)}};e.prototype.setDocument=function(e){if(this.doc)this.doc.off("change",this.$onChange);this.doc=e;e.on("change",this.$onChange,true);this.bgTokenizer.setDocument(this.getDocument());this.resetCaches()};e.prototype.getDocument=function(){return this.doc};Object.defineProperty(e.prototype,"widgetManager",{get:function(){var e=new u(this);this.widgetManager=e;if(this.$editor)e.attach(this.$editor);return e},set:function(e){Object.defineProperty(this,"widgetManager",{writable:true,enumerable:true,configurable:true,value:e})},enumerable:false,configurable:true});e.prototype.$resetRowCache=function(e){if(!e){this.$docRowCache=[];this.$screenRowCache=[];return}var t=this.$docRowCache.length;var i=this.$getRowCacheIndex(this.$docRowCache,e)+1;if(t>i){this.$docRowCache.splice(i,t);this.$screenRowCache.splice(i,t)}};e.prototype.$getRowCacheIndex=function(e,t){var i=0;var n=e.length-1;while(i<=n){var r=i+n>>1;var o=e[r];if(t>o)i=r+1;else if(t<o)n=r-1;else return r}return i-1};e.prototype.resetCaches=function(){this.$modified=true;this.$wrapData=[];this.$rowLengthCache=[];this.$resetRowCache(0);if(!this.destroyed)this.bgTokenizer.start(0)};e.prototype.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)};e.prototype.onChange=function(e){this.$modified=true;this.$bidiHandler.onChange(e);this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);if(!this.$fromUndo&&this.$undoManager){if(t&&t.length){this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas);this.mergeUndoDeltas=true}this.$undoManager.add(e,this.mergeUndoDeltas);this.mergeUndoDeltas=true;this.$informUndoManager.schedule()}this.bgTokenizer.$updateOnChange(e);this._signal("change",e)};e.prototype.onSelectionChange=function(){this._signal("changeSelection")};e.prototype.setValue=function(e){this.doc.setValue(e);this.selection.moveTo(0,0);this.$resetRowCache(0);this.setUndoManager(this.$undoManager);this.getUndoManager().reset()};e.fromJSON=function(t){if(typeof t=="string")t=JSON.parse(t);var i=new p;i.$undoStack=t.history.undo;i.$redoStack=t.history.redo;i.mark=t.history.mark;i.$rev=t.history.rev;var n=new e(t.value);t.folds.forEach(function(e){n.addFold("...",h.fromPoints(e.start,e.end))});n.setAnnotations(t.annotations);n.setBreakpoints(t.breakpoints);n.setMode(t.mode);n.setScrollLeft(t.scrollLeft);n.setScrollTop(t.scrollTop);n.setUndoManager(i);n.selection.fromJSON(t.selection);return n};e.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(e){return e.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}};e.prototype.toString=function(){return this.doc.getValue()};e.prototype.getSelection=function(){return this.selection};e.prototype.getState=function(e){return this.bgTokenizer.getState(e)};e.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)};e.prototype.getTokenAt=function(e,t){var i=this.bgTokenizer.getTokens(e);var n,r=0;if(t==null){var o=i.length-1;r=this.getLine(e).length}else{for(var o=0;o<i.length;o++){r+=i[o].value.length;if(r>=t)break}}n=i[o];if(!n)return null;n.index=o;n.start=r-n.value.length;return n};e.prototype.setUndoManager=function(e){this.$undoManager=e;if(this.$informUndoManager)this.$informUndoManager.cancel();if(e){var t=this;e.addSession(this);this.$syncInformUndoManager=function(){t.$informUndoManager.cancel();t.mergeUndoDeltas=false};this.$informUndoManager=r.delayedCall(this.$syncInformUndoManager)}else{this.$syncInformUndoManager=function(){}}};e.prototype.markUndoGroup=function(){if(this.$syncInformUndoManager)this.$syncInformUndoManager()};e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager};e.prototype.getTabString=function(){if(this.getUseSoftTabs()){return r.stringRepeat(" ",this.getTabSize())}else{return"\t"}};e.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)};e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs};e.prototype.setTabSize=function(e){this.setOption("tabSize",e)};e.prototype.getTabSize=function(){return this.$tabSize};e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0};e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)};e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs};e.prototype.setOverwrite=function(e){this.setOption("overwrite",e)};e.prototype.getOverwrite=function(){return this.$overwrite};e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)};e.prototype.addGutterDecoration=function(e,t){if(!this.$decorations[e])this.$decorations[e]="";this.$decorations[e]+=" "+t;this._signal("changeBreakpoint",{})};e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,"");this._signal("changeBreakpoint",{})};e.prototype.getBreakpoints=function(){return this.$breakpoints};e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++){this.$breakpoints[e[t]]="ace_breakpoint"}this._signal("changeBreakpoint",{})};e.prototype.clearBreakpoints=function(){this.$breakpoints=[];this._signal("changeBreakpoint",{})};e.prototype.setBreakpoint=function(e,t){if(t===undefined)t="ace_breakpoint";if(t)this.$breakpoints[e]=t;else delete this.$breakpoints[e];this._signal("changeBreakpoint",{})};e.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e];this._signal("changeBreakpoint",{})};e.prototype.addMarker=function(e,t,i,n){var r=this.$markerId++;var o={range:e,type:i||"line",renderer:typeof i=="function"?i:null,clazz:t,inFront:!!n,id:r};if(n){this.$frontMarkers[r]=o;this._signal("changeFrontMarker")}else{this.$backMarkers[r]=o;this._signal("changeBackMarker")}return r};e.prototype.addDynamicMarker=function(e,t){if(!e.update)return;var i=this.$markerId++;e.id=i;e.inFront=!!t;if(t){this.$frontMarkers[i]=e;this._signal("changeFrontMarker")}else{this.$backMarkers[i]=e;this._signal("changeBackMarker")}return e};e.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(!t)return;var i=t.inFront?this.$frontMarkers:this.$backMarkers;delete i[e];this._signal(t.inFront?"changeFrontMarker":"changeBackMarker")};e.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers};e.prototype.highlight=function(e){if(!this.$searchHighlight){var t=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)};e.prototype.highlightLines=function(e,t,i,n){if(typeof t!="number"){i=t;t=e}if(!i)i="ace_step";var r=new h(e,0,t,Infinity);r.id=this.addMarker(r,i,"fullLine",n);return r};e.prototype.setAnnotations=function(e){this.$annotations=e;this._signal("changeAnnotation",{})};e.prototype.getAnnotations=function(){return this.$annotations||[]};e.prototype.clearAnnotations=function(){this.setAnnotations([])};e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);if(t){this.$autoNewLine=t[1]}else{this.$autoNewLine="\n"}};e.prototype.getWordRange=function(e,t){var i=this.getLine(e);var n=false;if(t>0)n=!!i.charAt(t-1).match(this.tokenRe);if(!n)n=!!i.charAt(t).match(this.tokenRe);if(n)var r=this.tokenRe;else if(/^\s+$/.test(i.slice(t-1,t+1)))var r=/\s/;else var r=this.nonTokenRe;var o=t;if(o>0){do{o--}while(o>=0&&i.charAt(o).match(r));o++}var s=t;while(s<i.length&&i.charAt(s).match(r)){s++}return new h(e,o,e,s)};e.prototype.getAWordRange=function(e,t){var i=this.getWordRange(e,t);var n=this.getLine(i.end.row);while(n.charAt(i.end.column).match(/[ \t]/)){i.end.column+=1}return i};e.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)};e.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()};e.prototype.setUseWorker=function(e){this.setOption("useWorker",e)};e.prototype.getUseWorker=function(){return this.$useWorker};e.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first);this._signal("tokenizerUpdate",e)};e.prototype.setMode=function(e,t){if(e&&typeof e==="object"){if(e.getTokenizer)return this.$onChangeMode(e);var i=e;var n=i.path}else{n=e||"ace/mode/text"}if(!this.$modes["ace/mode/text"])this.$modes["ace/mode/text"]=new c;if(this.$modes[n]&&!i){this.$onChangeMode(this.$modes[n]);t&&t();return}this.$modeId=n;s.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();if(this.$modes[n]&&!i){this.$onChangeMode(this.$modes[n])}else if(e&&e.Mode){e=new e.Mode(i);if(!i){this.$modes[n]=e;e.$id=n}this.$onChangeMode(e)}t&&t()}.bind(this));if(!this.$mode)this.$onChangeMode(this.$modes["ace/mode/text"],true)};e.prototype.$onChangeMode=function(e,t){if(!t)this.$modeId=e.$id;if(this.$mode===e)return;var i=this.$mode;this.$mode=e;this.$stopWorker();if(this.$useWorker)this.$startWorker();var n=e.getTokenizer();if(n.on!==undefined){var r=this.onReloadTokenizer.bind(this);n.on("update",r)}this.bgTokenizer.setTokenizer(n);this.bgTokenizer.setDocument(this.getDocument());this.tokenRe=e.tokenRe;this.nonTokenRe=e.nonTokenRe;if(!t){if(e.attachToSession)e.attachToSession(this);this.$options.wrapMethod.set.call(this,this.$wrapMethod);this.$setFolding(e.foldingRules);this.bgTokenizer.start(0);this._emit("changeMode",{oldMode:i,mode:e})}};e.prototype.$stopWorker=function(){if(this.$worker){this.$worker.terminate();this.$worker=null}};e.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e);this.$worker=null}};e.prototype.getMode=function(){return this.$mode};e.prototype.setScrollTop=function(e){if(this.$scrollTop===e||isNaN(e))return;this.$scrollTop=e;this._signal("changeScrollTop",e)};e.prototype.getScrollTop=function(){return this.$scrollTop};e.prototype.setScrollLeft=function(e){if(this.$scrollLeft===e||isNaN(e))return;this.$scrollLeft=e;this._signal("changeScrollLeft",e)};e.prototype.getScrollLeft=function(){return this.$scrollLeft};e.prototype.getScreenWidth=function(){this.$computeWidth();if(this.lineWidgets)return Math.max(this.getLineWidgetMaxWidth(),this.screenWidth);return this.screenWidth};e.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var e=0;this.lineWidgets.forEach(function(t){if(t&&t.screenWidth>e)e=t.screenWidth});return this.lineWidgetWidth=e};e.prototype.$computeWidth=function(e){if(this.$modified||e){this.$modified=false;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines();var i=this.$rowLengthCache;var n=0;var r=0;var o=this.$foldData[r];var s=o?o.start.row:Infinity;var a=t.length;for(var l=0;l<a;l++){if(l>s){l=o.end.row+1;if(l>=a)break;o=this.$foldData[r++];s=o?o.start.row:Infinity}if(i[l]==null)i[l]=this.$getStringScreenWidth(t[l])[0];if(i[l]>n)n=i[l]}this.screenWidth=n}};e.prototype.getLine=function(e){return this.doc.getLine(e)};e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)};e.prototype.getLength=function(){return this.doc.getLength()};e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())};e.prototype.insert=function(e,t){return this.doc.insert(e,t)};e.prototype.remove=function(e){return this.doc.remove(e)};e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)};e.prototype.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=true;for(var i=e.length-1;i!=-1;i--){var n=e[i];if(n.action=="insert"||n.action=="remove"){this.doc.revertDelta(n)}else if(n.folds){this.addFolds(n.folds)}}if(!t&&this.$undoSelect){if(e.selectionBefore)this.selection.fromJSON(e.selectionBefore);else this.selection.setRange(this.$getUndoSelection(e,true))}this.$fromUndo=false};e.prototype.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=true;for(var i=0;i<e.length;i++){var n=e[i];if(n.action=="insert"||n.action=="remove"){this.doc.$safeApplyDelta(n)}}if(!t&&this.$undoSelect){if(e.selectionAfter)this.selection.fromJSON(e.selectionAfter);else this.selection.setRange(this.$getUndoSelection(e,false))}this.$fromUndo=false};e.prototype.setUndoSelect=function(e){this.$undoSelect=e};e.prototype.$getUndoSelection=function(e,t){function i(e){return t?e.action!=="insert":e.action==="insert"}var n,r;for(var o=0;o<e.length;o++){var s=e[o];if(!s.start)continue;if(!n){if(i(s)){n=h.fromPoints(s.start,s.end)}else{n=h.fromPoints(s.start,s.start)}continue}if(i(s)){r=s.start;if(n.compare(r.row,r.column)==-1){n.setStart(r)}r=s.end;if(n.compare(r.row,r.column)==1){n.setEnd(r)}}else{r=s.start;if(n.compare(r.row,r.column)==-1){n=h.fromPoints(s.start,s.start)}}}return n};e.prototype.replace=function(e,t){return this.doc.replace(e,t)};e.prototype.moveText=function(e,t,i){var n=this.getTextRange(e);var r=this.getFoldsInRange(e);var o=h.fromPoints(t,t);if(!i){this.remove(e);var s=e.start.row-e.end.row;var a=s?-e.end.column:e.start.column-e.end.column;if(a){if(o.start.row==e.end.row&&o.start.column>e.end.column)o.start.column+=a;if(o.end.row==e.end.row&&o.end.column>e.end.column)o.end.column+=a}if(s&&o.start.row>=e.end.row){o.start.row+=s;o.end.row+=s}}o.end=this.insert(o.start,n);if(r.length){var l=e.start;var c=o.start;var s=c.row-l.row;var a=c.column-l.column;this.addFolds(r.map(function(e){e=e.clone();if(e.start.row==l.row)e.start.column+=a;if(e.end.row==l.row)e.end.column+=a;e.start.row+=s;e.end.row+=s;return e}))}return o};e.prototype.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)};e.prototype.outdentRows=function(e){var t=e.collapseRows();var i=new h(0,0,0,0);var n=this.getTabSize();for(var r=t.start.row;r<=t.end.row;++r){var o=this.getLine(r);i.start.row=r;i.end.row=r;for(var s=0;s<n;++s)if(o.charAt(s)!=" ")break;if(s<n&&o.charAt(s)=="\t"){i.start.column=s;i.end.column=s+1}else{i.start.column=0;i.end.column=s}this.remove(i)}};e.prototype.$moveLines=function(e,t,i){e=this.getRowFoldStart(e);t=this.getRowFoldEnd(t);if(i<0){var n=this.getRowFoldStart(e+i);if(n<0)return 0;var r=n-e}else if(i>0){var n=this.getRowFoldEnd(t+i);if(n>this.doc.getLength()-1)return 0;var r=n-t}else{e=this.$clipRowToDocument(e);t=this.$clipRowToDocument(t);var r=t-e+1}var o=new h(e,0,t,Number.MAX_VALUE);var s=this.getFoldsInRange(o).map(function(e){e=e.clone();e.start.row+=r;e.end.row+=r;return e});var a=i==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);this.doc.insertFullLines(e+r,a);s.length&&this.addFolds(s);return r};e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)};e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)};e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)};e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))};e.prototype.$clipColumnToRow=function(e,t){if(t<0)return 0;return Math.min(this.doc.getLine(e).length,t)};e.prototype.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0){e=0;t=0}else{var i=this.doc.getLength();if(e>=i){e=i-1;t=this.doc.getLine(i-1).length}else{t=Math.min(this.doc.getLine(e).length,t)}}return{row:e,column:t}};e.prototype.$clipRangeToDocument=function(e){if(e.start.row<0){e.start.row=0;e.start.column=0}else{e.start.column=this.$clipColumnToRow(e.start.row,e.start.column)}var t=this.doc.getLength()-1;if(e.end.row>t){e.end.row=t;e.end.column=this.doc.getLine(t).length}else{e.end.column=this.$clipColumnToRow(e.end.row,e.end.column)}return e};e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e;this.$modified=true;this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t);this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}};e.prototype.getUseWrapMode=function(){return this.$useWrapMode};e.prototype.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t){this.$wrapLimitRange={min:e,max:t};this.$modified=true;this.$bidiHandler.markAsDirty();if(this.$useWrapMode)this._signal("changeWrapMode")}};e.prototype.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;if(i.max<0)i={min:t,max:t};var n=this.$constrainWrapLimit(e,i.min,i.max);if(n!=this.$wrapLimit&&n>1){this.$wrapLimit=n;this.$modified=true;if(this.$useWrapMode){this.$updateWrapData(0,this.getLength()-1);this.$resetRowCache(0);this._signal("changeWrapLimit")}return true}return false};e.prototype.$constrainWrapLimit=function(e,t,i){if(t)e=Math.max(t,e);if(i)e=Math.min(i,e);return e};e.prototype.getWrapLimit=function(){return this.$wrapLimit};e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)};e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}};e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode;var i=e.action;var n=e.start;var r=e.end;var o=n.row;var s=r.row;var a=s-o;var l=null;this.$updating=true;if(a!=0){if(i==="remove"){this[t?"$wrapData":"$rowLengthCache"].splice(o,a);var c=this.$foldData;l=this.getFoldsInRange(e);this.removeFolds(l);var h=this.getFoldLine(r.row);var u=0;if(h){h.addRemoveChars(r.row,r.column,n.column-r.column);h.shiftRow(-a);var d=this.getFoldLine(o);if(d&&d!==h){d.merge(h);h=d}u=c.indexOf(h)+1}for(u;u<c.length;u++){var h=c[u];if(h.start.row>=r.row){h.shiftRow(-a)}}s=o}else{var f=Array(a);f.unshift(o,0);var g=t?this.$wrapData:this.$rowLengthCache;g.splice.apply(g,f);var c=this.$foldData;var h=this.getFoldLine(o);var u=0;if(h){var p=h.range.compareInside(n.row,n.column);if(p==0){h=h.split(n.row,n.column);if(h){h.shiftRow(a);h.addRemoveChars(s,0,r.column-n.column)}}else if(p==-1){h.addRemoveChars(o,0,r.column-n.column);h.shiftRow(a)}u=c.indexOf(h)+1}for(u;u<c.length;u++){var h=c[u];if(h.start.row>=o){h.shiftRow(a)}}}}else{a=Math.abs(e.start.column-e.end.column);if(i==="remove"){l=this.getFoldsInRange(e);this.removeFolds(l);a=-a}var h=this.getFoldLine(o);if(h){h.addRemoveChars(o,n.column,a)}}if(t&&this.$wrapData.length!=this.doc.getLength()){console.error("doc.getLength() and $wrapData.length have to be the same!")}this.$updating=false;if(t)this.$updateWrapData(o,s);else this.$updateRowLengthCache(o,s);return l};e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null;this.$rowLengthCache[t]=null};e.prototype.$updateWrapData=function(e,t){var i=this.doc.getAllLines();var n=this.getTabSize();var r=this.$wrapData;var o=this.$wrapLimit;var s;var a;var l=e;t=Math.min(t,i.length-1);while(l<=t){a=this.getFoldLine(l,a);if(!a){s=this.$getDisplayTokens(i[l]);r[l]=this.$computeWrapSplits(s,o,n);l++}else{s=[];a.walk(function(e,t,n,r){var o;if(e!=null){o=this.$getDisplayTokens(e,s.length);o[0]=w;for(var a=1;a<o.length;a++){o[a]=b}}else{o=this.$getDisplayTokens(i[t].substring(r,n),s.length)}s=s.concat(o)}.bind(this),a.end.row,i[a.end.row].length+1);r[a.start.row]=this.$computeWrapSplits(s,o,n);l=a.end.row+1}}};e.prototype.$computeWrapSplits=function(e,t,i){if(e.length==0){return[]}var n=[];var r=e.length;var o=0,s=0;var a=this.$wrapAsCode;var l=this.$indentedSoftWrap;var c=t<=Math.max(2*i,8)||l===false?0:Math.floor(t/2);function h(){var t=0;if(c===0)return t;if(l){for(var n=0;n<e.length;n++){var r=e[n];if(r==C)t+=1;else if(r==S)t+=i;else if(r==x)continue;else break}}if(a&&l!==false)t+=i;return Math.min(t,c)}function u(t){var i=t-o;for(var r=o;r<t;r++){var a=e[r];if(a===12||a===2)i-=1}if(!n.length){d=h();n.indent=d}s+=i;n.push(s);o=t}var d=0;while(r-o>t-d){var f=o+t-d;if(e[f-1]>=C&&e[f]>=C){u(f);continue}if(e[f]==w||e[f]==b){for(f;f!=o-1;f--){if(e[f]==w){break}}if(f>o){u(f);continue}f=o+t;for(f;f<e.length;f++){if(e[f]!=b){break}}if(f==e.length){break}u(f);continue}var g=Math.max(f-(t-(t>>2)),o-1);while(f>g&&e[f]<w){f--}if(a){while(f>g&&e[f]<w){f--}while(f>g&&e[f]==$){f--}}else{while(f>g&&e[f]<C){f--}}if(f>g){u(++f);continue}f=o+t;if(e[f]==y)f--;u(f-d)}return n};e.prototype.$getDisplayTokens=function(e,t){var i=[];var n;t=t||0;for(var r=0;r<e.length;r++){var o=e.charCodeAt(r);if(o==9){n=this.getScreenTabSize(i.length+t);i.push(S);for(var s=1;s<n;s++){i.push(x)}}else if(o==32){i.push(C)}else if(o>39&&o<48||o>57&&o<64){i.push($)}else if(o>=4352&&A(o)){i.push(v,y)}else{i.push(v)}}return i};e.prototype.$getStringScreenWidth=function(e,t,i){if(t==0)return[0,0];if(t==null)t=Infinity;i=i||0;var n,r;for(r=0;r<e.length;r++){n=e.charCodeAt(r);if(n==9){i+=this.getScreenTabSize(i)}else if(n>=4352&&A(n)){i+=2}else{i+=1}if(i>t){break}}return[i,r]};e.prototype.getRowLength=function(e){var t=1;if(this.lineWidgets)t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;if(!this.$useWrapMode||!this.$wrapData[e])return t;else return this.$wrapData[e].length+t};e.prototype.getRowLineCount=function(e){if(!this.$useWrapMode||!this.$wrapData[e]){return 1}else{return this.$wrapData[e].length+1}};e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);var i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}else{return 0}};e.prototype.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)};e.prototype.getDocumentLastRowColumn=function(e,t){var i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)};e.prototype.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)};e.prototype.getRowSplitData=function(e){if(!this.$useWrapMode){return undefined}else{return this.$wrapData[e]}};e.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)};e.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row};e.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column};e.prototype.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};var n;var r=0;var o=0;var s;var a=0;var l=0;var c=this.$screenRowCache;var h=this.$getRowCacheIndex(c,e);var u=c.length;if(u&&h>=0){var a=c[h];var r=this.$docRowCache[h];var d=e>c[u-1]}else{var d=!u}var f=this.getLength()-1;var g=this.getNextFoldLine(r);var p=g?g.start.row:Infinity;while(a<=e){l=this.getRowLength(r);if(a+l>e||r>=f){break}else{a+=l;r++;if(r>p){r=g.end.row+1;g=this.getNextFoldLine(r,g);p=g?g.start.row:Infinity}}if(d){this.$docRowCache.push(r);this.$screenRowCache.push(a)}}if(g&&g.start.row<=r){n=this.getFoldDisplayLine(g);r=g.start.row}else if(a+l<=e||r>f){return{row:f,column:this.getLine(f).length}}else{n=this.getLine(r);g=null}var m=0,v=Math.floor(e-a);if(this.$useWrapMode){var y=this.$wrapData[r];if(y){s=y[v];if(v>0&&y.length){m=y.indent;o=y[v-1]||y[y.length-1];n=n.substring(o)}}}if(i!==undefined&&this.$bidiHandler.isBidiRow(a+v,r,v))t=this.$bidiHandler.offsetToCol(i);o+=this.$getStringScreenWidth(n,t-m)[1];if(this.$useWrapMode&&o>=s)o=s-1;if(g)return g.idxToPosition(o);return{row:r,column:o}};e.prototype.documentToScreenPosition=function(e,t){if(typeof t==="undefined")var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row;t=i.column;var n=0;var r=null;var o=null;o=this.getFoldAt(e,t,1);if(o){e=o.start.row;t=o.start.column}var s,a=0;var l=this.$docRowCache;var c=this.$getRowCacheIndex(l,e);var h=l.length;if(h&&c>=0){var a=l[c];var n=this.$screenRowCache[c];var u=e>l[h-1]}else{var u=!h}var d=this.getNextFoldLine(a);var f=d?d.start.row:Infinity;while(a<e){if(a>=f){s=d.end.row+1;if(s>e)break;d=this.getNextFoldLine(s,d);f=d?d.start.row:Infinity}else{s=a+1}n+=this.getRowLength(a);a=s;if(u){this.$docRowCache.push(a);this.$screenRowCache.push(n)}}var g="";if(d&&a>=f){g=this.getFoldDisplayLine(d,e,t);r=d.start.row}else{g=this.getLine(e).substring(0,t);r=e}var p=0;if(this.$useWrapMode){var m=this.$wrapData[r];if(m){var v=0;while(g.length>=m[v]){n++;v++}g=g.substring(m[v-1]||0,g.length);p=v>0?m.indent:0}}if(this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove)n+=this.lineWidgets[a].rowsAbove;return{row:n,column:p+this.$getStringScreenWidth(g)[0]}};e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column};e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row};e.prototype.getScreenLength=function(){var e=0;var t=null;if(!this.$useWrapMode){e=this.getLength();var i=this.$foldData;for(var n=0;n<i.length;n++){t=i[n];e-=t.end.row-t.start.row}}else{var r=this.$wrapData.length;var o=0,n=0;var t=this.$foldData[n++];var s=t?t.start.row:Infinity;while(o<r){var a=this.$wrapData[o];e+=a?a.length+1:1;o++;if(o>s){o=t.end.row+1;t=this.$foldData[n++];s=t?t.start.row:Infinity}}}if(this.lineWidgets)e+=this.$getWidgetScreenLength();return e};e.prototype.$setFontMetrics=function(e){if(!this.$enableVarChar)return;this.$getStringScreenWidth=function(t,i,n){if(i===0)return[0,0];if(!i)i=Infinity;n=n||0;var r,o;for(o=0;o<t.length;o++){r=t.charAt(o);if(r==="\t"){n+=this.getScreenTabSize(n)}else{n+=e.getCharacterWidth(r)}if(n>i){break}}return[n,o]}};e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();if(e.column===0){return e.row===0?"":this.doc.getNewLineCharacter()}var t=this.getLine(e.row);return t[e.column-1]};e.prototype.destroy=function(){if(!this.destroyed){this.bgTokenizer.setDocument(null);this.bgTokenizer.cleanup();this.destroyed=true}this.endOperation();this.$stopWorker();this.removeAllListeners();if(this.doc){this.doc.off("change",this.$onChange)}if(this.selection){this.selection.off("changeCursor",this.$onSelectionChange);this.selection.off("changeSelection",this.$onSelectionChange)}this.selection.detach()};return e}();m.$uid=0;m.prototype.$modes=s.$modes;m.prototype.getValue=m.prototype.toString;m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}};m.prototype.$overwrite=false;m.prototype.$mode=null;m.prototype.$modeId=null;m.prototype.$scrollTop=0;m.prototype.$scrollLeft=0;m.prototype.$wrapLimit=80;m.prototype.$useWrapMode=false;m.prototype.$wrapLimitRange={min:null,max:null};m.prototype.lineWidgets=null;m.prototype.isFullWidth=A;n.implement(m.prototype,a);var v=1,y=2,w=3,b=4,$=9,C=10,S=11,x=12;function A(e){if(e<4352)return false;return e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}e("./edit_session/folding").Folding.call(m.prototype);e("./edit_session/bracket_match").BracketMatch.call(m.prototype);s.defineOptions(m.prototype,"session",{wrap:{set:function(e){if(!e||e=="off")e=false;else if(e=="free")e=true;else if(e=="printMargin")e=-1;else if(typeof e=="string")e=parseInt(e,10)||false;if(this.$wrap==e)return;this.$wrap=e;if(!e){this.setUseWrapMode(false)}else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t);this.setUseWrapMode(true)}},get:function(){if(this.getUseWrapMode()){if(this.$wrap==-1)return"printMargin";if(!this.getWrapLimitRange().min)return"free";return this.$wrap}return"off"},handlesSet:true},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text";if(e!=this.$wrapAsCode){this.$wrapAsCode=e;if(this.$useWrapMode){this.$useWrapMode=false;this.setUseWrapMode(true)}}},initialValue:"auto"},indentedSoftWrap:{set:function(){if(this.$useWrapMode){this.$useWrapMode=false;this.setUseWrapMode(true)}},initialValue:true},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e;this.$stopWorker();if(e)this.$startWorker()},initialValue:true},useSoftTabs:{initialValue:true},tabSize:{set:function(e){e=parseInt(e);if(e>0&&this.$tabSize!==e){this.$modified=true;this.$rowLengthCache=[];this.$tabSize=e;this._signal("changeTabSize")}},initialValue:4,handlesSet:true},navigateWithinSoftTabs:{initialValue:false},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:true},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:false},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:true},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:true}});t.EditSession=m});ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,i){"use strict";var n=e("./lib/lang");var r=e("./lib/oop");var o=e("./range").Range;var s=function(){function e(){this.$options={}}e.prototype.set=function(e){r.mixin(this.$options,e);return this};e.prototype.getOptions=function(){return n.copyObject(this.$options)};e.prototype.setOptions=function(e){this.$options=e};e.prototype.find=function(e){var t=this.$options;var i=this.$matchIterator(e,t);if(!i)return false;var n=null;i.forEach(function(e,i,r,s){n=new o(e,i,r,s);if(i==s&&t.start&&t.start.start&&t.skipCurrent!=false&&n.isEqual(t.start)){n=null;return false}return true});return n};e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range;var r=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines();var s=[];var a=t.re;if(t.$isMultiLine){var l=a.length;var c=r.length-l;var h;e:for(var u=a.offset||0;u<=c;u++){for(var d=0;d<l;d++)if(r[u+d].search(a[d])==-1)continue e;var f=r[u];var g=r[u+l-1];var p=f.length-f.match(a[0])[0].length;var m=g.match(a[l-1])[0].length;if(h&&h.end.row===u&&h.end.column>p){continue}s.push(h=new o(u,p,u+l-1,m));if(l>2)u=u+l-2}}else{for(var v=0;v<r.length;v++){var y=n.getMatchOffsets(r[v],a);for(var d=0;d<y.length;d++){var w=y[d];s.push(new o(v,w.offset,v,w.offset+w.length))}}}if(i){var b=i.start.column;var $=i.end.column;var v=0,d=s.length-1;while(v<d&&s[v].start.column<b&&s[v].start.row==0)v++;var C=i.end.row-i.start.row;while(v<d&&s[d].end.column>$&&s[d].end.row==C)d--;s=s.slice(v,d+1);for(v=0,d=s.length;v<d;v++){s[v].start.row+=i.start.row;s[v].end.row+=i.start.row}}return s};e.prototype.replace=function(e,t){var i=this.$options;var n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(!n)return;var r=n.exec(e);if(!r||r[0].length!=e.length)return null;if(!i.regExp){t=t.replace(/\$/g,"$$$$")}t=e.replace(n,t);if(i.preserveCase){t=t.split("");for(var o=Math.min(e.length,e.length);o--;){var s=e[o];if(s&&s.toLowerCase()!=s)t[o]=t[o].toUpperCase();else t[o]=t[o].toLowerCase()}t=t.join("")}return t};e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=false;if(!e.regExp)i=n.escapeRegExp(i);var r=e.caseSensitive?"gm":"gmi";try{new RegExp(i,"u");e.$supportsUnicodeFlag=true;r+="u"}catch(t){e.$supportsUnicodeFlag=false}if(e.wholeWord)i=a(i,e);e.$isMultiLine=!t&&/[\n\r]/.test(i);if(e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,r);try{var o=new RegExp(i,r)}catch(e){o=false}return e.re=o};e.prototype.$assembleMultilineRegExp=function(e,t){var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n");var n=[];for(var r=0;r<i.length;r++)try{n.push(new RegExp(i[r],t))}catch(e){return false}return n};e.prototype.$matchIterator=function(e,t){var i=this.$assembleRegExp(t);if(!i)return false;var r=t.backwards==true;var o=t.skipCurrent!=false;var s=i.unicode;var a=t.range;var l=t.start;if(!l)l=a?a[r?"end":"start"]:e.selection.getRange();if(l.start)l=l[o!=r?"end":"start"];var c=a?a.start.row:0;var h=a?a.end.row:e.getLength()-1;if(r){var u=function(e){var i=l.row;if(f(i,l.column,e))return;for(i--;i>=c;i--)if(f(i,Number.MAX_VALUE,e))return;if(t.wrap==false)return;for(i=h,c=l.row;i>=c;i--)if(f(i,Number.MAX_VALUE,e))return}}else{var u=function(e){var i=l.row;if(f(i,l.column,e))return;for(i=i+1;i<=h;i++)if(f(i,0,e))return;if(t.wrap==false)return;for(i=c,h=l.row;i<=h;i++)if(f(i,0,e))return}}if(t.$isMultiLine){var d=i.length;var f=function(t,n,o){var s=r?t-d+1:t;if(s<0||s+d>e.getLength())return;var a=e.getLine(s);var l=a.search(i[0]);if(!r&&l<n||l===-1)return;for(var c=1;c<d;c++){a=e.getLine(s+c);if(a.search(i[c])==-1)return}var h=a.match(i[d-1])[0].length;if(r&&h>n)return;if(o(s,l,s+d-1,h))return true}}else if(r){var f=function(t,r,o){var a=e.getLine(t);var l=[];var c,h=0;i.lastIndex=0;while(c=i.exec(a)){var u=c[0].length;h=c.index;if(!u){if(h>=a.length)break;i.lastIndex=h+=n.skipEmptyMatch(a,h,s)}if(c.index+u>r)break;l.push(c.index,u)}for(var d=l.length-1;d>=0;d-=2){var f=l[d-1];var u=l[d];if(o(t,f,t,f+u))return true}}}else{var f=function(t,r,o){var a=e.getLine(t);var l;var c;i.lastIndex=r;while(c=i.exec(a)){var h=c[0].length;l=c.index;if(o(t,l,t,l+h))return true;if(!h){i.lastIndex=l+=n.skipEmptyMatch(a,l,s);if(l>=a.length)return false}}}}return{forEach:u}};return e}();function a(e,t){var i=n.supportsLookbehind();function r(e,n){if(n===void 0){n=true}var r=i&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");if(r.test(e)||t.regExp){if(i&&t.$supportsUnicodeFlag){if(n)return"(?<=^|[^\\p{L}\\p{N}_])";return"(?=[^\\p{L}\\p{N}_]|$)"}return"\\b"}return""}var o=Array.from(e);var s=o[0];var a=o[o.length-1];return r(s)+e+r(a,false)}t.Search=s});ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=e("../lib/keys");var o=e("../lib/useragent");var s=r.KEY_MODS;var a=function(){function e(e,t){this.$init(e,t,false)}e.prototype.$init=function(e,t,i){this.platform=t||(o.isMac?"mac":"win");this.commands={};this.commandKeyBinding={};this.addCommands(e);this.$singleCommand=i};e.prototype.addCommand=function(e){if(this.commands[e.name])this.removeCommand(e);this.commands[e.name]=e;if(e.bindKey)this._buildKeyHash(e)};e.prototype.removeCommand=function(e,t){var i=e&&(typeof e==="string"?e:e.name);e=this.commands[i];if(!t)delete this.commands[i];var n=this.commandKeyBinding;for(var r in n){var o=n[r];if(o==e){delete n[r]}else if(Array.isArray(o)){var s=o.indexOf(e);if(s!=-1){o.splice(s,1);if(o.length==1)n[r]=o[0]}}}};e.prototype.bindKey=function(e,t,i){if(typeof e=="object"&&e){if(i==undefined)i=e.position;e=e[this.platform]}if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var n="";if(e.indexOf(" ")!=-1){var r=e.split(/\s+/);e=r.pop();r.forEach(function(e){var t=this.parseKeys(e);var i=s[t.hashId]+t.key;n+=(n?" ":"")+i;this._addCommandToBinding(n,"chainKeys")},this);n+=" "}var o=this.parseKeys(e);var a=s[o.hashId]+o.key;this._addCommandToBinding(n+a,t,i)},this)};e.prototype._addCommandToBinding=function(e,t,i){var n=this.commandKeyBinding,r;if(!t){delete n[e]}else if(!n[e]||this.$singleCommand){n[e]=t}else{if(!Array.isArray(n[e])){n[e]=[n[e]]}else if((r=n[e].indexOf(t))!=-1){n[e].splice(r,1)}if(typeof i!="number"){i=l(t)}var o=n[e];for(r=0;r<o.length;r++){var s=o[r];var a=l(s);if(a>i)break}o.splice(r,0,t)}};e.prototype.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var i=e[t];if(!i)return;if(typeof i==="string")return this.bindKey(i,t);if(typeof i==="function")i={exec:i};if(typeof i!=="object")return;if(!i.name)i.name=t;this.addCommand(i)},this)};e.prototype.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)};e.prototype.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)};e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)};e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e});var i=t.pop();var n=r[i];if(r.FUNCTION_KEYS[n])i=r.FUNCTION_KEYS[n].toLowerCase();else if(!t.length)return{key:i,hashId:-1};else if(t.length==1&&t[0]=="shift")return{key:i.toUpperCase(),hashId:-1};var o=0;for(var s=t.length;s--;){var a=r.KEY_MODS[t[s]];if(a==null){if(typeof console!="undefined")console.error("invalid modifier "+t[s]+" in "+e);return false}o|=a}return{key:i,hashId:o}};e.prototype.findKeyCommand=function(e,t){var i=s[e]+t;return this.commandKeyBinding[i]};e.prototype.handleKeyboard=function(e,t,i,n){if(n<0)return;var r=s[t]+i;var o=this.commandKeyBinding[r];if(e.$keyChain){e.$keyChain+=" "+r;o=this.commandKeyBinding[e.$keyChain]||o}if(o){if(o=="chainKeys"||o[o.length-1]=="chainKeys"){e.$keyChain=e.$keyChain||r;return{command:"null"}}}if(e.$keyChain){if((!t||t==4)&&i.length==1)e.$keyChain=e.$keyChain.slice(0,-r.length-1);else if(t==-1||n>0)e.$keyChain=""}return{command:o}};e.prototype.getStatusText=function(e,t){return t.$keyChain||""};return e}();function l(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var c=function(e){n(t,e);function t(t,i){var n=e.call(this,t,i)||this;n.$singleCommand=true;return n}return t}(a);c.call=function(e,t,i){a.prototype.$init.call(e,t,i,true)};a.call=function(e,t,i){a.prototype.$init.call(e,t,i,false)};t.HashHandler=c;t.MultiHashHandler=a});ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=e("../lib/oop");var o=e("../keyboard/hash_handler").MultiHashHandler;var s=e("../lib/event_emitter").EventEmitter;var a=function(e){n(t,e);function t(t,i){var n=e.call(this,i,t)||this;n.byName=n.commands;n.setDefaultHandler("exec",function(e){if(!e.args){return e.command.exec(e.editor,{},e.event,true)}return e.command.exec(e.editor,e.args,e.event,false)});return n}t.prototype.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;){if(this.exec(e[n],t,i))return true}return false}if(typeof e==="string")e=this.commands[e];if(!this.canExecute(e,t)){return false}var r={editor:t,command:e,args:i};r.returnValue=this._emit("exec",r);this._signal("afterExec",r);return r.returnValue===false?false:true};t.prototype.canExecute=function(e,t){if(typeof e==="string")e=this.commands[e];if(!e)return false;if(t&&t.$readOnly&&!e.readOnly)return false;if(this.$checkCommandState!=false&&e.isAvailable&&!e.isAvailable(t))return false;return true};t.prototype.toggleRecording=function(e){if(this.$inReplay)return;e&&e._emit("changeStatus");if(this.recording){this.macro.pop();this.off("exec",this.$addCommandToMacro);if(!this.macro.length)this.macro=this.oldMacro;return this.recording=false}if(!this.$addCommandToMacro){this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)}this.oldMacro=this.macro;this.macro=[];this.on("exec",this.$addCommandToMacro);return this.recording=true};t.prototype.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=true;this.macro.forEach(function(t){if(typeof t=="string")this.exec(t,e);else this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=false}};t.prototype.trimMacro=function(e){return e.map(function(e){if(typeof e[0]!="string")e[0]=e[0].name;if(!e[1])e=e[0];return e})};return t}(o);r.implement(a.prototype,s);t.CommandManager=a});ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,i){"use strict";var n=e("../lib/lang");var r=e("../config");var o=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){r.loadModule("ace/ext/settings_menu",function(t){t.init(e);e.showSettingsMenu()})},readOnly:true},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){r.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:true},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){r.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:true},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:true},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:true},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,t){if(typeof t==="number"&&!isNaN(t))e.gotoLine(t);e.prompt({$type:"gotoLine"})},readOnly:true},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(false)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(true)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(true)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:true},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:true},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll();e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:true},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:true},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:true},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){if(e.selection.isEmpty())e.selection.selectWord();else e.findNext()},readOnly:true},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){if(e.selection.isEmpty())e.selection.selectWord();else e.findPrevious()},readOnly:true},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){r.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:true},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:true},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:true,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:true},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:true},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:true},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:true},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:true},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:true},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:true},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:true},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:true},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:true},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(true)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(true,true)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:true},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:true,readOnly:true},{name:"copy",description:"Copy",exec:function(e){},readOnly:true},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty();var i=t?e.selection.getLineRange():e.selection.getRange();e._emit("cut",i);if(!i.isEmpty())e.session.remove(i);e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){r.loadModule("ace/ext/searchbox",function(t){t.Search(e,true)})}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(e.selection.isEmpty()){e.remove("left")}else{return false}},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0;e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE;e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(n.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0;t.end.row++;e.selection.setRange(t,false)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:true},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){var t=e.selection.isBackwards();var i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor();var r=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead();var s=e.session.doc.getLine(i.row).length;var a=e.session.doc.getTextRange(e.selection.getRange());var l=a.replace(/\n\s*/," ").length;var c=e.session.doc.getLine(i.row);for(var h=i.row+1;h<=r.row+1;h++){var u=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(h)));if(u.length!==0){u=" "+u}c+=u}if(r.row+1<e.session.doc.getLength()-1){c+=e.session.doc.getNewLineCharacter()}e.clearSelection();e.session.doc.replace(new o(i.row,0,r.row+2,0),c);if(l>0){e.selection.moveCursorTo(i.row,i.column);e.selection.selectTo(i.row,i.column+l)}else{s=e.session.doc.getLine(i.row).length>s?s+1:s;e.selection.moveCursorTo(i.row,s)}},multiSelectAction:"forEach",readOnly:true},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1;var i=e.session.doc.getLine(t).length;var n=e.selection.rangeList.ranges;var r=[];if(n.length<1){n=[e.selection.getRange()]}for(var s=0;s<n.length;s++){if(s==n.length-1){if(!(n[s].end.row===t&&n[s].end.column===i)){r.push(new o(n[s].end.row,n[s].end.column,t,i))}}if(s===0){if(!(n[s].start.row===0&&n[s].start.column===0)){r.push(new o(0,0,n[s].start.row,n[s].start.column))}}else{r.push(new o(n[s-1].end.row,n[s-1].end.column,n[s].start.row,n[s].start.column))}}e.exitMultiSelectMode();e.clearSelection();for(var s=0;s<r.length;s++){e.selection.addRange(r[s],false)}},readOnly:true,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection();e.navigateLineEnd();e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE);e.insert("\n");if(t.row===0)e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead.");e.prompt({$type:"commands"})},readOnly:true},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:true},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:true}];for(var a=1;a<9;a++){t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:true})}});ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(e,t,i){"use strict";var n=e("../lib/keys");var r=e("../mouse/default_gutter_handler").GutterTooltip;var o=function(){function e(e){this.editor=e;this.gutterLayer=e.renderer.$gutterLayer;this.element=e.renderer.$gutter;this.lines=e.renderer.$gutterLayer.$lines;this.activeRowIndex=null;this.activeLane=null;this.annotationTooltip=new r(this.editor)}e.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))};e.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))};e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen){e.preventDefault();if(e.keyCode===n["escape"])this.annotationTooltip.hideTooltip();return}if(e.target===this.element){if(e.keyCode!=n["enter"]){return}e.preventDefault();var t=this.editor.getCursorPosition().row;if(!this.editor.isRowVisible(t))this.editor.scrollToLine(t,true,true);setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row);var t=this.$findNearestFoldWidget(e);var i=this.$findNearestAnnotation(e);if(t===null&&i===null)return;if(t===null&&i!==null){this.activeRowIndex=i;this.activeLane="annotation";this.$focusAnnotation(this.activeRowIndex);return}if(t!==null&&i===null){this.activeRowIndex=t;this.activeLane="fold";this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-e)<Math.abs(t-e)){this.activeRowIndex=i;this.activeLane="annotation";this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=t;this.activeLane="fold";this.$focusFoldWidget(this.activeRowIndex);return}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(e);setTimeout(function(){this.editor._signal("gutterkeydown",new s(e,this))}.bind(this),10)};e.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode===n["tab"]){e.preventDefault();return}if(e.keyCode===n["escape"]){e.preventDefault();this.$blurGutter();this.element.focus();this.lane=null;return}if(e.keyCode===n["up"]){e.preventDefault();switch(this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(e.keyCode===n["down"]){e.preventDefault();switch(this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(e.keyCode===n["left"]){e.preventDefault();this.$switchLane("annotation");return}if(e.keyCode===n["right"]){e.preventDefault();this.$switchLane("fold");return}if(e.keyCode===n["enter"]||e.keyCode===n["space"]){e.preventDefault();switch(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),e);setTimeout(function(){if(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];var r=i.getBoundingClientRect();var o=this.annotationTooltip.getElement().style;o.left=r.right+"px";o.top=r.bottom+"px";this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}};e.prototype.$blurGutter=function(){if(this.activeRowIndex!==null){switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}}if(this.annotationTooltip.isOpen)this.annotationTooltip.hideTooltip();return};e.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));var i=this.$getFoldWidget(e).style.display!=="none";return t&&i};e.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));var i=this.$getAnnotation(e).style.display!=="none";return t&&i};e.prototype.$getFoldWidget=function(e){var t=this.lines.get(e);var i=t.element;return i.childNodes[1]};e.prototype.$getAnnotation=function(e){var t=this.lines.get(e);var i=t.element;return i.childNodes[2]};e.prototype.$findNearestFoldWidget=function(e){if(this.$isFoldWidgetVisible(e))return e;var t=0;while(e-t>0||e+t<this.lines.getLength()-1){t++;if(e-t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null};e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;var t=0;while(e-t>0||e+t<this.lines.getLength()-1){t++;if(e-t>=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null};e.prototype.$focusFoldWidget=function(e){if(e==null)return;var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName);t.focus()};e.prototype.$focusAnnotation=function(e){if(e==null)return;var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName);t.focus()};e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName);t.blur()};e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName);t.blur()};e.prototype.$moveFoldWidgetUp=function(){var e=this.activeRowIndex;while(e>0){e--;if(this.$isFoldWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex);this.activeRowIndex=e;this.$focusFoldWidget(this.activeRowIndex);return}}return};e.prototype.$moveFoldWidgetDown=function(){var e=this.activeRowIndex;while(e<this.lines.getLength()-1){e++;if(this.$isFoldWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex);this.activeRowIndex=e;this.$focusFoldWidget(this.activeRowIndex);return}}return};e.prototype.$moveAnnotationUp=function(){var e=this.activeRowIndex;while(e>0){e--;if(this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex);this.activeRowIndex=e;this.$focusAnnotation(this.activeRowIndex);return}}return};e.prototype.$moveAnnotationDown=function(){var e=this.activeRowIndex;while(e<this.lines.getLength()-1){e++;if(this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex);this.activeRowIndex=e;this.$focusAnnotation(this.activeRowIndex);return}}return};e.prototype.$switchLane=function(e){switch(e){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}return};e.prototype.$rowIndexToRow=function(e){var t=this.lines.get(e);if(t)return t.row;return null};e.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++){var i=this.lines.get(t);if(i.row==e)return t}return null};return e}();t.GutterKeyboardHandler=o;var s=function(){function e(e,t){this.gutterKeyboardHandler=t;this.domEvent=e}e.prototype.getKey=function(){return n.keyCodeToString(this.domEvent.keyCode)};e.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)};e.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"};e.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"};return e}();t.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/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(e,t,i){"use strict";var n=this&&this.__values||function(e){var t=typeof Symbol==="function"&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&n>=e.length)e=void 0;return{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var r=e("./lib/oop");var o=e("./lib/dom");var s=e("./lib/lang");var a=e("./lib/useragent");var l=e("./keyboard/textinput").TextInput;var c=e("./mouse/mouse_handler").MouseHandler;var h=e("./mouse/fold_handler").FoldHandler;var u=e("./keyboard/keybinding").KeyBinding;var d=e("./edit_session").EditSession;var f=e("./search").Search;var g=e("./range").Range;var p=e("./lib/event_emitter").EventEmitter;var m=e("./commands/command_manager").CommandManager;var v=e("./commands/default_commands").commands;var y=e("./config");var w=e("./token_iterator").TokenIterator;var b=e("./keyboard/gutter_handler").GutterKeyboardHandler;var $=e("./config").nls;var C=e("./clipboard");var S=e("./lib/keys");var x=function(){function e(t,i,n){this.session;e._instancesCnt++;this.$toDestroy=[];var r=t.getContainerElement();this.container=r;this.renderer=t;this.id="editor"+ ++e.$uid;this.commands=new m(a.isMac?"mac":"win",v);if(typeof document=="object"){this.textInput=new l(t.getTextAreaContainer(),this);this.renderer.textarea=this.textInput.getElement();this.$mouseHandler=new c(this);new h(this)}this.keyBinding=new u(this);this.$search=(new f).set({wrap:true});this.$historyTracker=this.$historyTracker.bind(this);this.commands.on("exec",this.$historyTracker);this.$initOperationListeners();this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{});if(this.session&&!this.session.destroyed)this.session.bgTokenizer.scheduleStart()}.bind(this));this.on("change",function(e,t){t._$emitInputEvent.schedule(31)});this.setSession(i||n&&n.session||new d(""));y.resetOptions(this);if(n)this.setOptions(n);y._signal("editor",this)}e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),true);this.commands.on("afterExec",this.endOperation.bind(this),true)};e.prototype.startOperation=function(e){this.session.startOperation(e)};e.prototype.endOperation=function(e){this.session.endOperation(e)};e.prototype.onStartOperation=function(e){this.curOp=this.session.curOp;this.curOp.scrollTop=this.renderer.scrollTop;this.prevOp=this.session.prevOp;if(!e){this.previousCommand=null}};e.prototype.onEndOperation=function(e){if(this.curOp&&this.session){if(e&&e.returnValue===false){this.curOp=null;return}this._signal("beforeEndOperation");if(!this.curOp)return;var t=this.curOp.command;var i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange();var r=this.renderer.layerConfig;if(n.start.row>=r.lastRow||n.end.row<=r.firstRow){this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}break;default:break}if(i=="animate")this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON();this.prevOp=this.curOp;this.curOp=null}};e.prototype.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp;var i=this.$mergeableCommands;var n=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var r=e.args;if(this.mergeNextCommand===undefined)this.mergeNextCommand=true;n=n&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args));this.mergeNextCommand=true}else{n=n&&i.indexOf(e.command.name)!==-1}if(this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3){n=false}if(n)this.session.mergeUndoDeltas=true;else if(i.indexOf(e.command.name)!==-1)this.sequenceStartTime=Date.now()};e.prototype.setKeyboardHandler=function(e,t){if(e&&typeof e==="string"&&e!="ace"){this.$keybindingId=e;var i=this;y.loadModule(["keybinding",e],function(n){if(i.$keybindingId==e)i.keyBinding.setKeyboardHandler(n&&n.handler);t&&t()})}else{this.$keybindingId=null;this.keyBinding.setKeyboardHandler(e);t&&t()}};e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()};e.prototype.setSession=function(e){if(this.session==e)return;if(this.curOp)this.endOperation();this.curOp={};var t=this.session;if(t){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);this.session.off("startOperation",this.$onStartOperation);this.session.off("endOperation",this.$onEndOperation);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange);i.off("changeSelection",this.$onSelectionChange)}this.session=e;if(e){this.$onDocumentChange=this.onDocumentChange.bind(this);e.on("change",this.$onDocumentChange);this.renderer.setSession(e);this.$onChangeMode=this.onChangeMode.bind(this);e.on("changeMode",this.$onChangeMode);this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this);e.on("tokenizerUpdate",this.$onTokenizerUpdate);this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer);e.on("changeTabSize",this.$onChangeTabSize);this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this);e.on("changeWrapLimit",this.$onChangeWrapLimit);this.$onChangeWrapMode=this.onChangeWrapMode.bind(this);e.on("changeWrapMode",this.$onChangeWrapMode);this.$onChangeFold=this.onChangeFold.bind(this);e.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=e.getSelection();this.selection.on("changeCursor",this.$onCursorChange);this.$onSelectionChange=this.onSelectionChange.bind(this);this.selection.on("changeSelection",this.$onSelectionChange);this.$onStartOperation=this.onStartOperation.bind(this);this.session.on("startOperation",this.$onStartOperation);this.$onEndOperation=this.onEndOperation.bind(this);this.session.on("endOperation",this.$onEndOperation);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()}else{this.selection=null;this.renderer.setSession(e)}this._signal("changeSession",{session:e,oldSession:t});this.curOp=null;t&&t._signal("changeEditor",{oldEditor:this});if(t)t.$editor=null;e&&e._signal("changeEditor",{editor:this});if(e)e.$editor=this;if(e&&!e.destroyed)e.bgTokenizer.scheduleStart()};e.prototype.getSession=function(){return this.session};e.prototype.setValue=function(e,t){this.session.doc.setValue(e);if(!t)this.selectAll();else if(t==1)this.navigateFileEnd();else if(t==-1)this.navigateFileStart();return e};e.prototype.getValue=function(){return this.session.getValue()};e.prototype.getSelection=function(){return this.selection};e.prototype.resize=function(e){this.renderer.onResize(e)};e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)};e.prototype.getTheme=function(){return this.renderer.getTheme()};e.prototype.setStyle=function(e){this.renderer.setStyle(e)};e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)};e.prototype.getFontSize=function(){return this.getOption("fontSize")||o.computedStyle(this.container).fontSize};e.prototype.setFontSize=function(e){this.setOption("fontSize",e)};e.prototype.$highlightBrackets=function(){if(this.$highlightPending){return}var e=this;this.$highlightPending=true;setTimeout(function(){e.$highlightPending=false;var t=e.session;if(!t||t.destroyed)return;if(t.$bracketHighlight){t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)});t.$bracketHighlight=null}var i=e.getCursorPosition();var n=e.getKeyboardHandler();var r=n&&n.$getDirectionForHighlight&&n.$getDirectionForHighlight(e);var o=t.getMatchingBracketRanges(i,r);if(!o){var s=new w(t,i.row,i.column);var a=s.getCurrentToken();if(a&&/\b(?:tag-open|tag-name)/.test(a.type)){var l=t.getMatchingTags(i);if(l){o=[l.openTagName.isEmpty()?l.openTag:l.openTagName,l.closeTagName.isEmpty()?l.closeTag:l.closeTagName]}}}if(!o&&t.$mode.getMatching)o=t.$mode.getMatching(e.session);if(!o){if(e.getHighlightIndentGuides())e.renderer.$textLayer.$highlightIndentGuide();return}var c="ace_bracket";if(!Array.isArray(o)){o=[o]}else if(o.length==1){c="ace_error_bracket"}if(o.length==2){if(g.comparePoints(o[0].end,o[1].start)==0)o=[g.fromPoints(o[0].start,o[1].end)];else if(g.comparePoints(o[0].start,o[1].end)==0)o=[g.fromPoints(o[1].start,o[0].end)]}t.$bracketHighlight={ranges:o,markerIds:o.map(function(e){return t.addMarker(e,c,"text")})};if(e.getHighlightIndentGuides())e.renderer.$textLayer.$highlightIndentGuide()},50)};e.prototype.focus=function(){this.textInput.focus()};e.prototype.isFocused=function(){return this.textInput.isFocused()};e.prototype.blur=function(){this.textInput.blur()};e.prototype.onFocus=function(e){if(this.$isFocused)return;this.$isFocused=true;this.renderer.showCursor();this.renderer.visualizeFocus();this._emit("focus",e)};e.prototype.onBlur=function(e){if(!this.$isFocused)return;this.$isFocused=false;this.renderer.hideCursor();this.renderer.visualizeBlur();this._emit("blur",e)};e.prototype.$cursorChange=function(){this.renderer.updateCursor();this.$highlightBrackets();this.$updateHighlightActiveLine()};e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode;var i=e.start.row==e.end.row?e.end.row:Infinity;this.renderer.updateLines(e.start.row,i,t);this._signal("change",e);this.$cursorChange()};e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)};e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())};e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())};e.prototype.onCursorChange=function(){this.$cursorChange();this._signal("changeSelection")};e.prototype.$updateHighlightActiveLine=function(){var e=this.getSession();var t;if(this.$highlightActiveLine){if(this.$selectionStyle!="line"||!this.selection.isMultiLine())t=this.getCursorPosition();if(this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty())t=false;if(this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1))t=false}if(e.$highlightLineMarker&&!t){e.removeMarker(e.$highlightLineMarker.id);e.$highlightLineMarker=null}else if(!e.$highlightLineMarker&&t){var i=new g(t.row,t.column,t.row,Infinity);i.id=e.addMarker(i,"ace_active-line","screenLine");e.$highlightLineMarker=i}else if(t){e.$highlightLineMarker.start.row=t.row;e.$highlightLineMarker.end.row=t.row;e.$highlightLineMarker.start.column=t.column;e._signal("changeBackMarker")}};e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker){t.removeMarker(t.$selectionMarker)}t.$selectionMarker=null;if(!this.selection.isEmpty()){var i=this.selection.getRange();var n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}else{this.$updateHighlightActiveLine()}var r=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(r);this._signal("changeSelection")};e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session;var t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var i=t.start.column;var n=t.end.column;var r=e.getLine(t.start.row);var o=r.substring(i,n);if(o.length>5e3||!/[\w\d]/.test(o))return;var s=this.$search.$assembleRegExp({wholeWord:true,caseSensitive:true,needle:o});var a=r.substring(i-1,n+1);if(!s.test(a))return;return s};e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()};e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()};e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()};e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())};e.prototype.onChangeMode=function(e){this.renderer.updateText();this._emit("changeMode",e)};e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()};e.prototype.onChangeWrapMode=function(){this.renderer.onResize(true)};e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine();this.renderer.updateFull()};e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())};e.prototype.getCopyText=function(){var e=this.getSelectedText();var t=this.session.doc.getNewLineCharacter();var i=false;if(!e&&this.$copyWithEmptySelection){i=true;var n=this.selection.getAllRanges();for(var r=0;r<n.length;r++){var o=n[r];if(r&&n[r-1].start.row==o.start.row)continue;e+=this.session.getLine(o.start.row)+t}}var s={text:e};this._signal("copy",s);C.lineMode=i?s.text:false;return s.text};e.prototype.onCopy=function(){this.commands.exec("copy",this)};e.prototype.onCut=function(){this.commands.exec("cut",this)};e.prototype.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)};e.prototype.$handlePaste=function(e){if(typeof e=="string")e={text:e};this._signal("paste",e);var t=e.text;var i=t===C.lineMode;var n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode){if(i)n.insert({row:this.selection.lead.row,column:0},t);else this.insert(t)}else if(i){this.selection.rangeList.ranges.forEach(function(e){n.insert({row:e.start.row,column:0},t)})}else{var r=t.split(/\r\n|\r|\n/);var o=this.selection.rangeList.ranges;var s=r.length==2&&(!r[0]||!r[1]);if(r.length!=o.length||s)return this.commands.exec("insertstring",this,t);for(var a=o.length;a--;){var l=o[a];if(!l.isEmpty())n.remove(l);n.insert(l.start,r[a])}}};e.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)};e.prototype.insert=function(e,t){var i=this.session;var n=i.getMode();var r=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var o=n.transformAction(i.getState(r.row),"insertion",this,i,e);if(o){if(e!==o.text){if(!this.inVirtualSelectionMode){this.session.mergeUndoDeltas=false;this.mergeNextCommand=false}}e=o.text}}if(e=="\t")e=this.session.getTabString();if(!this.selection.isEmpty()){var s=this.getSelectionRange();r=this.session.remove(s);this.clearSelection()}else if(this.session.getOverwrite()&&e.indexOf("\n")==-1){var s=g.fromPoints(r,r);s.end.column+=e.length;this.session.remove(s)}if(e=="\n"||e=="\r\n"){var a=i.getLine(r.row);if(r.column>a.search(/\S|$/)){var l=a.substr(r.column).search(/\S|$/);i.doc.removeInLine(r.row,r.column,r.column+l)}}this.clearSelection();var c=r.column;var h=i.getState(r.row);var a=i.getLine(r.row);var u=n.checkOutdent(h,a,e);i.insert(r,e);if(o&&o.selection){if(o.selection.length==2){this.selection.setSelectionRange(new g(r.row,c+o.selection[0],r.row,c+o.selection[1]))}else{this.selection.setSelectionRange(new g(r.row+o.selection[0],o.selection[1],r.row+o.selection[2],o.selection[3]))}}if(this.$enableAutoIndent){if(i.getDocument().isNewLine(e)){var d=n.getNextLineIndent(h,a.slice(0,r.column),i.getTabString());i.insert({row:r.row+1,column:0},d)}if(u)n.autoOutdent(h,i,r.row)}};e.prototype.autoIndent=function(){var e=this.session;var t=e.getMode();var i=this.selection.isEmpty()?[new g(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges();var n="";var r="";var o="";var s=e.getTabString();for(var a=0;a<i.length;a++){var l=i[a].start.row;var c=i[a].end.row;for(var h=l;h<=c;h++){if(h>0){n=e.getState(h-1);r=e.getLine(h-1);o=t.getNextLineIndent(n,r,s)}var u=e.getLine(h);var d=t.$getIndent(u);if(o!==d){if(d.length>0){var f=new g(h,0,h,d.length);e.remove(f)}if(o.length>0){e.insert({row:h,column:0},o)}}t.autoOutdent(n,e,h)}}};e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);if(this.selection.rangeCount)this.forEachSelection(i);else i();this.endOperation()};e.prototype.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var i=this.selection.getRange();i.start.column-=t.extendLeft;i.end.column+=t.extendRight;if(i.start.column<0){i.start.row--;i.start.column+=this.session.getLine(i.start.row).length+1}this.selection.setRange(i);if(!e&&!i.isEmpty())this.remove()}if(e||!this.selection.isEmpty())this.insert(e,true);if(t.restoreStart||t.restoreEnd){var i=this.selection.getRange();i.start.column-=t.restoreStart;i.end.column-=t.restoreEnd;this.selection.setRange(i)}};e.prototype.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)};e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)};e.prototype.getOverwrite=function(){return this.session.getOverwrite()};e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()};e.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)};e.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")};e.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)};e.prototype.getDragDelay=function(){return this.getOption("dragDelay")};e.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)};e.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")};e.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)};e.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")};e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)};e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")};e.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)};e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord};e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)};e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()};e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)};e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()};e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)};e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()};e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)};e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()};e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)};e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()};e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)};e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()};e.prototype.setReadOnly=function(e){this.setOption("readOnly",e)};e.prototype.getReadOnly=function(){return this.getOption("readOnly")};e.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)};e.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")};e.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)};e.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")};e.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)};e.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")};e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)};e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")};e.prototype.remove=function(e){if(this.selection.isEmpty()){if(e=="left")this.selection.selectLeft();else this.selection.selectRight()}var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session;var n=i.getState(t.start.row);var r=i.getMode().transformAction(n,"deletion",this,i,t);if(t.end.column===0){var o=i.getTextRange(t);if(o[o.length-1]=="\n"){var s=i.getLine(t.end.row);if(/^\s+$/.test(s)){t.end.column=s.length}}}if(r)t=r}this.session.remove(t);this.clearSelection()};e.prototype.removeWordRight=function(){if(this.selection.isEmpty())this.selection.selectWordRight();this.session.remove(this.getSelectionRange());this.clearSelection()};e.prototype.removeWordLeft=function(){if(this.selection.isEmpty())this.selection.selectWordLeft();this.session.remove(this.getSelectionRange());this.clearSelection()};e.prototype.removeToLineStart=function(){if(this.selection.isEmpty())this.selection.selectLineStart();if(this.selection.isEmpty())this.selection.selectLeft();this.session.remove(this.getSelectionRange());this.clearSelection()};e.prototype.removeToLineEnd=function(){if(this.selection.isEmpty())this.selection.selectLineEnd();var e=this.getSelectionRange();if(e.start.column==e.end.column&&e.start.row==e.end.row){e.end.column=0;e.end.row++}this.session.remove(e);this.clearSelection()};e.prototype.splitLine=function(){if(!this.selection.isEmpty()){this.session.remove(this.getSelectionRange());this.clearSelection()}var e=this.getCursorPosition();this.insert("\n");this.moveCursorToPosition(e)};e.prototype.setGhostText=function(e,t){this.renderer.setGhostText(e,t)};e.prototype.removeGhostText=function(){this.renderer.removeGhostText()};e.prototype.transposeLetters=function(){if(!this.selection.isEmpty()){return}var e=this.getCursorPosition();var t=e.column;if(t===0)return;var i=this.session.getLine(e.row);var n,r;if(t<i.length){n=i.charAt(t)+i.charAt(t-1);r=new g(e.row,t-1,e.row,t+1)}else{n=i.charAt(t-1)+i.charAt(t-2);r=new g(e.row,t-2,e.row,t)}this.session.replace(r,n);this.session.selection.moveToPosition(r.end)};e.prototype.toLowerCase=function(){var e=this.getSelectionRange();if(this.selection.isEmpty()){this.selection.selectWord()}var t=this.getSelectionRange();var i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase());this.selection.setSelectionRange(e)};e.prototype.toUpperCase=function(){var e=this.getSelectionRange();if(this.selection.isEmpty()){this.selection.selectWord()}var t=this.getSelectionRange();var i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase());this.selection.setSelectionRange(e)};e.prototype.indent=function(){var e=this.session;var t=this.getSelectionRange();if(t.start.row<t.end.row){var i=this.$getSelectedRows();e.indentRows(i.first,i.last,"\t");return}else if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n)){var i=this.$getSelectedRows();e.indentRows(i.first,i.last,"\t");return}}var r=e.getLine(t.start.row);var o=t.start;var a=e.getTabSize();var l=e.documentToScreenColumn(o.row,o.column);if(this.session.getUseSoftTabs()){var c=a-l%a;var h=s.stringRepeat(" ",c)}else{var c=l%a;while(r[t.start.column-1]==" "&&c){t.start.column--;c--}this.selection.setSelectionRange(t);h="\t"}return this.insert(h)};e.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")};e.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())};e.prototype.sortLines=function(){var e=this.$getSelectedRows();var t=this.session;var i=[];for(var n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort(function(e,t){if(e.toLowerCase()<t.toLowerCase())return-1;if(e.toLowerCase()>t.toLowerCase())return 1;return 0});var r=new g(0,0,0,0);for(var n=e.first;n<=e.last;n++){var o=t.getLine(n);r.start.row=n;r.end.row=n;r.end.column=o.length;t.replace(r,i[n-e.first])}};e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row);var t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)};e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition();var t=this.session.getState(e.row);var i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)};e.prototype.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;var n=this.session.getLine(e);while(i.lastIndex<t){var r=i.exec(n);if(r.index<=t&&r.index+r[0].length>=t){var o={value:r[0],start:r.index,end:r.index+r[0].length};return o}}return null};e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row;var i=this.selection.getCursor().column;var n=new g(t,i-1,t,i);var r=this.session.getTextRange(n);if(!isNaN(parseFloat(r))&&isFinite(r)){var o=this.getNumberAt(t,i);if(o){var s=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end;var a=o.start+o.value.length-s;var l=parseFloat(o.value);l*=Math.pow(10,a);if(s!==o.end&&i<s){e*=Math.pow(10,o.end-i-1)}else{e*=Math.pow(10,o.end-i)}l+=e;l/=Math.pow(10,a);var c=l.toFixed(a);var h=new g(t,o.start,t,o.end);this.session.replace(h,c);this.moveCursorTo(t,Math.max(o.start+1,i+c.length-o.value.length))}}else{this.toggleWord()}};e.prototype.toggleWord=function(){var e=this.selection.getCursor().row;var t=this.selection.getCursor().column;this.selection.selectWord();var i=this.getSelectedText();var n=this.selection.getWordRange().start.column;var r=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/);var o=t-n-1;if(o<0)o=0;var a=0,l=0;var c=this;if(i.match(/[A-Za-z0-9_]+/)){r.forEach(function(t,r){l=a+t.length;if(o>=a&&o<=l){i=t;c.selection.clearSelection();c.moveCursorTo(e,a+n);c.selection.selectTo(e,l+n)}a=l})}var h=this.$toggleWordPairs;var u;for(var d=0;d<h.length;d++){var f=h[d];for(var g=0;g<=1;g++){var p=+!g;var m=i.match(new RegExp("^\\s?_?("+s.escapeRegExp(f[g])+")\\s?$","i"));if(m){var v=i.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(m[1])+")($|\\s)","g"));if(v){u=i.replace(new RegExp(s.escapeRegExp(f[g]),"i"),function(e){var t=f[p];if(e.toUpperCase()==e){t=t.toUpperCase()}else if(e.charAt(0).toUpperCase()==e.charAt(0)){t=t.substr(0,0)+f[p].charAt(0).toUpperCase()+t.substr(1)}return t});this.insert(u);u=""}}}}};e.prototype.findLinkAt=function(e,t){var i,r;var o=this.session.getLine(e);var s=o.split(/((?:https?|ftp):\/\/[\S]+)/);var a=t;if(a<0)a=0;var l=0,c=0,h;try{for(var u=n(s),d=u.next();!d.done;d=u.next()){var f=d.value;c=l+f.length;if(a>=l&&a<=c){if(f.match(/((?:https?|ftp):\/\/[\S]+)/)){h=f.replace(/[\s:.,'";}\]]+$/,"");break}}l=c}}catch(e){i={error:e}}finally{try{if(d&&!d.done&&(r=u.return))r.call(u)}finally{if(i)throw i.error}}return h};e.prototype.openLink=function(){var e=this.selection.getCursor();var t=this.findLinkAt(e.row,e.column);if(t)window.open(t,"_blank");return t!=null};e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last);this.clearSelection()};e.prototype.duplicateSelection=function(){var e=this.selection;var t=this.session;var i=e.getRange();var n=e.isBackwards();if(i.isEmpty()){var r=i.start.row;t.duplicateLines(r,r)}else{var o=n?i.start:i.end;var s=t.insert(o,t.getTextRange(i));i.start=o;i.end=s;e.setSelectionRange(i,n)}};e.prototype.moveLinesDown=function(){this.$moveLines(1,false)};e.prototype.moveLinesUp=function(){this.$moveLines(-1,false)};e.prototype.moveText=function(e,t,i){return this.session.moveText(e,t,i)};e.prototype.copyLinesUp=function(){this.$moveLines(-1,true)};e.prototype.copyLinesDown=function(){this.$moveLines(1,true)};e.prototype.$moveLines=function(e,t){var i,n;var r=this.selection;if(!r.inMultiSelectMode||this.inVirtualSelectionMode){var o=r.toOrientedRange();i=this.$getSelectedRows(o);n=this.session.$moveLines(i.first,i.last,t?0:e);if(t&&e==-1)n=0;o.moveBy(n,0);r.fromOrientedRange(o)}else{var s=r.rangeList.ranges;r.rangeList.detach(this.session);this.inVirtualSelectionMode=true;var a=0;var l=0;var c=s.length;for(var h=0;h<c;h++){var u=h;s[h].moveBy(a,0);i=this.$getSelectedRows(s[h]);var d=i.first;var f=i.last;while(++h<c){if(l)s[h].moveBy(l,0);var g=this.$getSelectedRows(s[h]);if(t&&g.first!=f)break;else if(!t&&g.first>f+1)break;f=g.last}h--;a=this.session.$moveLines(d,f,t?0:e);if(t&&e==-1)u=h+1;while(u<=h){s[u].moveBy(a,0);u++}if(!t)a=0;l+=a}r.fromOrientedRange(r.ranges[0]);r.rangeList.attach(this.session);this.inVirtualSelectionMode=false}};e.prototype.$getSelectedRows=function(e){e=(e||this.getSelectionRange()).collapseRows();return{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}};e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)};e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)};e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()};e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()};e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()};e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()};e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()};e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1};e.prototype.$moveByPage=function(e,t){var i=this.renderer;var n=this.renderer.layerConfig;var r=e*Math.floor(n.height/n.lineHeight);if(t===true){this.selection.$moveSelection(function(){this.moveCursorBy(r,0)})}else if(t===false){this.selection.moveCursorBy(r,0);this.selection.clearSelection()}var o=i.scrollTop;i.scrollBy(0,r*n.lineHeight);if(t!=null)i.scrollCursorIntoView(null,.5);i.animateScrolling(o)};e.prototype.selectPageDown=function(){this.$moveByPage(1,true)};e.prototype.selectPageUp=function(){this.$moveByPage(-1,true)};e.prototype.gotoPageDown=function(){this.$moveByPage(1,false)};e.prototype.gotoPageUp=function(){this.$moveByPage(-1,false)};e.prototype.scrollPageDown=function(){this.$moveByPage(1)};e.prototype.scrollPageUp=function(){this.$moveByPage(-1)};e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)};e.prototype.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)};e.prototype.centerSelection=function(){var e=this.getSelectionRange();var t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)};e.prototype.getCursorPosition=function(){return this.selection.getCursor()};e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())};e.prototype.getSelectionRange=function(){return this.selection.getRange()};e.prototype.selectAll=function(){this.selection.selectAll()};e.prototype.clearSelection=function(){this.selection.clearSelection()};e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)};e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)};e.prototype.jumpToMatching=function(e,t){var i=this.getCursorPosition();var n=new w(this.session,i.row,i.column);var r=n.getCurrentToken();var o=0;if(r&&r.type.indexOf("tag-name")!==-1){r=n.stepBackward()}var s=r||n.stepForward();if(!s)return;var a;var l=false;var c={};var h=i.column-s.start;var u;var d={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;h<s.value.length&&!l;h++){if(!d[s.value[h]]){continue}u=d[s.value[h]]+"."+s.type.replace("rparen","lparen");if(isNaN(c[u])){c[u]=0}switch(s.value[h]){case"(":case"[":case"{":c[u]++;break;case")":case"]":case"}":c[u]--;if(c[u]===-1){a="bracket";l=true}break}}}else if(s.type.indexOf("tag-name")!==-1){if(isNaN(c[s.value])){c[s.value]=0}if(r.value==="<"&&o>1){c[s.value]++}else if(r.value==="</"){c[s.value]--}if(c[s.value]===-1){a="tag";l=true}}if(!l){r=s;o++;s=n.stepForward();h=0}}while(s&&!l);if(!a)return;var f,p;if(a==="bracket"){f=this.session.getBracketRange(i);if(!f){f=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+h-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+h-1);p=f.start;if(t||p.row===i.row&&Math.abs(p.column-i.column)<2)f=this.session.getBracketRange(p)}}else if(a==="tag"){if(!s||s.type.indexOf("tag-name")===-1)return;f=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2);if(f.compare(i.row,i.column)===0){var m=this.session.getMatchingTags(i);if(m){if(m.openTag.contains(i.row,i.column)){f=m.closeTag;p=f.start}else{f=m.openTag;if(m.closeTag.start.row===i.row&&m.closeTag.start.column===i.column)p=f.end;else p=f.start}}}p=p||f.start}p=f&&f.cursor||p;if(p){if(e){if(f&&t){this.selection.setRange(f)}else if(f&&f.isEqual(this.getSelectionRange())){this.clearSelection()}else{this.selection.selectTo(p.row,p.column)}}else{this.selection.moveTo(p.row,p.column)}}};e.prototype.gotoLine=function(e,t,i){this.selection.clearSelection();this.session.unfold({row:e-1,column:t||0});this.exitMultiSelectMode&&this.exitMultiSelectMode();this.moveCursorTo(e-1,t||0);if(!this.isRowFullyVisible(e-1))this.scrollToLine(e-1,true,i)};e.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)};e.prototype.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection();this.selection.moveCursorBy(-e||-1,0)};e.prototype.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection();this.selection.moveCursorBy(e||1,0)};e.prototype.navigateLeft=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}else{e=e||1;while(e--){this.selection.moveCursorLeft()}}this.clearSelection()};e.prototype.navigateRight=function(e){if(!this.selection.isEmpty()){var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}else{e=e||1;while(e--){this.selection.moveCursorRight()}}this.clearSelection()};e.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart();this.clearSelection()};e.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd();this.clearSelection()};e.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd();this.clearSelection()};e.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart();this.clearSelection()};e.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight();this.clearSelection()};e.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft();this.clearSelection()};e.prototype.replace=function(e,t){if(t)this.$search.set(t);var i=this.$search.find(this.session);var n=0;if(!i)return n;if(this.$tryReplace(i,e)){n=1}this.selection.setSelectionRange(i);this.renderer.scrollSelectionIntoView(i.start,i.end);return n};e.prototype.replaceAll=function(e,t){if(t){this.$search.set(t)}var i=this.$search.findAll(this.session);var n=0;if(!i.length)return n;var r=this.getSelectionRange();this.selection.moveTo(0,0);for(var o=i.length-1;o>=0;--o){if(this.$tryReplace(i[o],e)){n++}}this.selection.setSelectionRange(r);return n};e.prototype.$tryReplace=function(e,t){var i=this.session.getTextRange(e);t=this.$search.replace(i,t);if(t!==null){e.end=this.session.replace(e,t);return e}else{return null}};e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()};e.prototype.find=function(e,t,i){if(!t)t={};if(typeof e=="string"||e instanceof RegExp)t.needle=e;else if(typeof e=="object")r.mixin(t,e);var n=this.selection.getRange();if(t.needle==null){e=this.session.getTextRange(n)||this.$search.$options.needle;if(!e){n=this.session.getWordRange(n.start.row,n.start.column);e=this.session.getTextRange(n)}this.$search.set({needle:e})}this.$search.set(t);if(!t.start)this.$search.set({start:n});var o=this.$search.find(this.session);if(t.preventScroll)return o;if(o){this.revealRange(o,i);return o}if(t.backwards)n.start=n.end;else n.end=n.start;this.selection.setRange(n)};e.prototype.findNext=function(e,t){this.find({skipCurrent:true,backwards:false},e,t)};e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:true,backwards:true},t)};e.prototype.revealRange=function(e,t){this.session.unfold(e);this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5);if(t!==false)this.renderer.animateScrolling(i)};e.prototype.undo=function(){this.session.getUndoManager().undo(this.session);this.renderer.scrollCursorIntoView(null,.5)};e.prototype.redo=function(){this.session.getUndoManager().redo(this.session);this.renderer.scrollCursorIntoView(null,.5)};e.prototype.destroy=function(){if(this.$toDestroy){this.$toDestroy.forEach(function(e){e.destroy()});this.$toDestroy=null}if(this.$mouseHandler)this.$mouseHandler.destroy();this.renderer.destroy();this._signal("destroy",this);if(this.session)this.session.destroy();if(this._$emitInputEvent)this._$emitInputEvent.cancel();this.removeAllListeners();e._instancesCnt--;var t=document.getElementById("sap-ui-codeeditor-ace-worker-proxy");if(e._instancesCnt===0&&t){t.remove()}};e.prototype.setAutoScrollEditorIntoView=function(e){if(!e)return;var t;var i=this;var n=false;if(!this.$scrollAnchor)this.$scrollAnchor=document.createElement("div");var r=this.$scrollAnchor;r.style.cssText="position:absolute";this.container.insertBefore(r,this.container.firstChild);var o=this.on("changeSelection",function(){n=true});var s=this.renderer.on("beforeRender",function(){if(n)t=i.renderer.container.getBoundingClientRect()});var a=this.renderer.on("afterRender",function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer;var o=e.$cursorLayer.$pixelPos;var s=e.layerConfig;var a=o.top-s.offset;if(o.top>=0&&a+t.top<0){n=true}else if(o.top<s.height&&o.top+t.top+s.lineHeight>window.innerHeight){n=false}else{n=null}if(n!=null){r.style.top=a+"px";r.style.left=o.left+"px";r.style.height=s.lineHeight+"px";r.scrollIntoView(n)}n=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView;this.off("changeSelection",o);this.renderer.off("afterRender",a);this.renderer.off("beforeRender",s)}};e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace";var t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e));t.isBlinking=!this.$readOnly&&e!="wide";o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))};e.prototype.prompt=function(e,t,i){var n=this;y.loadModule("ace/ext/prompt",function(r){r.prompt(n,e,t,i)})};return e}();x._instancesCnt=0;x.$uid=0;x.prototype.curOp=null;x.prototype.prevOp={};x.prototype.$mergeableCommands=["backspace","del","insertstring"];x.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"],["&&","||"],["==","!="]];r.implement(x.prototype,p);y.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange();this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:true},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:true},readOnly:{set:function(e){this.textInput.setReadOnly(e);this.$resetCursorStyle()},initialValue:false},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:false},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[false,true,"always"],initialValue:true},behavioursEnabled:{initialValue:true},wrapBehavioursEnabled:{initialValue:true},enableAutoIndent:{initialValue:true},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:true},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:true,hidden:true},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:true,hidden:true},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e);this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);if(e&&this.$relativeLineNumbers)A.attach(this);else A.detach(this)},initialValue:true},relativeLineNumbers:{set:function(e){if(this.$showLineNumbers&&e)A.attach(this);else A.detach(this)}},placeholder:{set:function(e){if(!this.$updatePlaceholder){this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode){this.renderer.off("afterRender",this.$updatePlaceholder);o.removeCssClass(this.container,"ace_hasPlaceholder");this.renderer.placeholderNode.remove();this.renderer.placeholderNode=null}else if(!e&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder);o.addCssClass(this.container,"ace_hasPlaceholder");var t=o.createElement("div");t.className="ace_placeholder";t.textContent=this.$placeholder||"";this.renderer.placeholderNode=t;this.renderer.content.appendChild(this.renderer.placeholderNode)}else if(!e&&this.renderer.placeholderNode){this.renderer.placeholderNode.textContent=this.$placeholder||""}}.bind(this);this.on("input",this.$updatePlaceholder)}this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur();e.renderer.scroller.focus()},readOnly:true};var i=function(e){if(e.target==this.renderer.scroller&&e.keyCode===S["enter"]){e.preventDefault();var t=this.getCursorPosition().row;if(!this.isRowVisible(t))this.scrollToLine(t,true,true);this.focus()}};var n;if(e){this.renderer.enableKeyboardAccessibility=true;this.renderer.keyboardFocusClassName="ace_keyboard-focus";this.textInput.getElement().setAttribute("tabindex",-1);this.textInput.setNumberOfExtraLines(a.isWin?3:0);this.renderer.scroller.setAttribute("tabindex",0);this.renderer.scroller.setAttribute("role","group");this.renderer.scroller.setAttribute("aria-roledescription",$("editor.scroller.aria-roledescription","editor"));this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName);this.renderer.scroller.setAttribute("aria-label",$("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit"));this.renderer.scroller.addEventListener("keyup",i.bind(this));this.commands.addCommand(t);this.renderer.$gutter.setAttribute("tabindex",0);this.renderer.$gutter.setAttribute("aria-hidden",false);this.renderer.$gutter.setAttribute("role","group");this.renderer.$gutter.setAttribute("aria-roledescription",$("editor.gutter.aria-roledescription","editor"));this.renderer.$gutter.setAttribute("aria-label",$("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",true);if(!n)n=new b(this);n.addListener();this.textInput.setAriaOptions({setLabel:true})}else{this.renderer.enableKeyboardAccessibility=false;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",i.bind(this));this.commands.removeCommand(t);this.renderer.content.removeAttribute("aria-hidden");this.renderer.$gutter.setAttribute("tabindex",-1);this.renderer.$gutter.setAttribute("aria-hidden",true);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);if(n)n.removeListener()}},initialValue:false},textInputAriaLabel:{set:function(e){this.$textInputAriaLabel=e},initialValue:""},enableMobileMenu:{set:function(e){this.$enableMobileMenu=e},initialValue:true},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 A={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this;e.on("changeSelection",this.update);this.update(null,e)},detach:function(e){if(e.renderer.$gutterLayer.$renderer==this)e.renderer.$gutterLayer.$renderer=null;e.off("changeSelection",this.update);this.update(null,e)}};t.Editor=x});ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=function(){function e(e,t){this.element=e;this.canvasHeight=t||5e5;this.element.style.height=this.canvasHeight*2+"px";this.cells=[];this.cellCache=[];this.$offsetCoefficient=0}e.prototype.moveContainer=function(e){n.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)};e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)};e.prototype.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight;var r=Math.floor(n/this.canvasHeight);var o=i.documentToScreenRow(e,0)*t.lineHeight;return o-r*this.canvasHeight};e.prototype.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)};e.prototype.getLength=function(){return this.cells.length};e.prototype.get=function(e){return this.cells[e]};e.prototype.shift=function(){this.$cacheCell(this.cells.shift())};e.prototype.pop=function(){this.$cacheCell(this.cells.pop())};e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);var t=n.createFragment(this.element);for(var i=0;i<e.length;i++){t.appendChild(e[i].element)}this.element.appendChild(t)}else{this.cells.push(e);this.element.appendChild(e.element)}};e.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);var t=n.createFragment(this.element);for(var i=0;i<e.length;i++){t.appendChild(e[i].element)}if(this.element.firstChild)this.element.insertBefore(t,this.element.firstChild);else this.element.appendChild(t)}else{this.cells.unshift(e);this.element.insertAdjacentElement("afterbegin",e.element)}};e.prototype.last=function(){if(this.cells.length)return this.cells[this.cells.length-1];else return null};e.prototype.$cacheCell=function(e){if(!e)return;e.element.remove();this.cellCache.push(e)};e.prototype.createCell=function(e,t,i,r){var o=this.cellCache.pop();if(!o){var s=n.createElement("div");if(r)r(s);this.element.appendChild(s);o={element:s,text:"",row:e}}o.row=e;return o};return e}();t.Lines=r});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(e,t,i){"use strict";var n=e("../lib/dom");var r=e("../lib/oop");var o=e("../lib/lang");var s=e("../lib/event_emitter").EventEmitter;var a=e("./lines").Lines;var l=e("../config").nls;var c=function(){function e(e){this.element=n.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 a(this.element);this.$lines.$offsetCoefficient=1}e.prototype.setSession=function(e){if(this.session)this.session.off("change",this.$updateAnnotations);this.session=e;if(e)e.on("change",this.$updateAnnotations)};e.prototype.addGutterDecoration=function(e,t){if(window.console)console.warn&&console.warn("deprecated use session.addGutterDecoration");this.session.addGutterDecoration(e,t)};e.prototype.removeGutterDecoration=function(e,t){if(window.console)console.warn&&console.warn("deprecated use session.removeGutterDecoration");this.session.removeGutterDecoration(e,t)};e.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t];var n=i.row;var r=this.$annotations[n];if(!r)r=this.$annotations[n]={text:[],type:[],displayText:[]};var s=i.text;var a=i.text;var l=i.type;s=s?o.escapeHTML(s):i.html||"";a=a?a:i.html||"";if(r.text.indexOf(s)===-1){r.text.push(s);r.type.push(l);r.displayText.push(a)}var c=i.className;if(c){r.className=c}else if(l==="error"){r.className=" ace_error"}else if(l==="security"&&!/\bace_error\b/.test(r.className)){r.className=" ace_security"}else if(l==="warning"&&!/\bace_(error|security)\b/.test(r.className)){r.className=" ace_warning"}else if(l==="info"&&!r.className){r.className=" ace_info"}else if(l==="hint"&&!r.className){r.className=" ace_hint"}}};e.prototype.$updateAnnotations=function(e){if(!this.$annotations.length)return;var t=e.start.row;var i=e.end.row-t;if(i===0){}else if(e.action=="remove"){this.$annotations.splice(t,i+1,null)}else{var n=new Array(i+1);n.unshift(t,1);this.$annotations.splice.apply(this.$annotations,n)}};e.prototype.update=function(e){this.config=e;var t=this.session;var i=e.firstRow;var n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=n;this.config=e;this.$lines.moveContainer(e);this.$updateCursorRow();var r=t.getNextFoldLine(i);var o=r?r.start.row:Infinity;var s=null;var a=-1;var l=i;while(true){if(l>o){l=r.end.row+1;r=t.getNextFoldLine(l,r);o=r?r.start.row:Infinity}if(l>n){while(this.$lines.getLength()>a+1)this.$lines.pop();break}s=this.$lines.get(++a);if(s){s.row=l}else{s=this.$lines.createCell(l,e,this.session,h);this.$lines.push(s)}this.$renderCell(s,e,r,l);l++}this._signal("afterRender");this.$updateGutterWidth(e)};e.prototype.$updateGutterWidth=function(e){var t=this.session;var i=t.gutterRenderer||this.$renderer;var n=t.$firstLineNumber;var r=this.$lines.last()?this.$lines.last().text:"";if(this.$fixedWidth||t.$useWrapMode)r=t.getLength()+n-1;var o=i?i.getWidth(t,r,e):r.toString().length*e.characterWidth;var s=this.$padding||this.$computePadding();o+=s.left+s.right;if(o!==this.gutterWidth&&!isNaN(o)){this.gutterWidth=o;this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px";this._signal("changeGutterWidth",o)}};e.prototype.$updateCursorRow=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.getCursor();if(this.$cursorRow===e.row)return;this.$cursorRow=e.row};e.prototype.updateLineHighlight=function(){if(!this.$highlightGutterLine)return;var e=this.session.selection.cursor.row;this.$cursorRow=e;if(this.$cursorCell&&this.$cursorCell.row==e)return;if(this.$cursorCell)this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","");var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var r=this.session.getFoldLine(this.$cursorRow);if(i>0&&r&&r.start.row==t[i-1].row)n=t[i-1];else break}n.element.className="ace_gutter-active-line "+n.element.className;this.$cursorCell=n;break}}};e.prototype.scrollLines=function(e){var t=this.config;this.config=e;this.$updateCursorRow();if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1);var n=this.oldLastRow;this.oldLastRow=i;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);r>0;r--)this.$lines.shift();if(n>i)for(var r=this.session.getFoldedRowCount(i+1,n);r>0;r--)this.$lines.pop();if(e.firstRow<t.firstRow){this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1))}if(i>n){this.$lines.push(this.$renderLines(e,n+1,i))}this.updateLineHighlight();this._signal("afterRender");this.$updateGutterWidth(e)};e.prototype.$renderLines=function(e,t,i){var n=[];var r=t;var o=this.session.getNextFoldLine(r);var s=o?o.start.row:Infinity;while(true){if(r>s){r=o.end.row+1;o=this.session.getNextFoldLine(r,o);s=o?o.start.row:Infinity}if(r>i)break;var a=this.$lines.createCell(r,e,this.session,h);this.$renderCell(a,e,o,r);n.push(a);r++}return n};e.prototype.$renderCell=function(e,t,i,r){var o=e.element;var s=this.session;var a=o.childNodes[0];var c=o.childNodes[1];var h=o.childNodes[2];var u=h.firstChild;var d=s.$firstLineNumber;var f=s.$breakpoints;var g=s.$decorations;var p=s.gutterRenderer||this.$renderer;var m=this.$showFoldWidgets&&s.foldWidgets;var v=i?i.start.row:Number.MAX_VALUE;var y=t.lineHeight+"px";var w=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ";var b=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";var $=(p?p.getText(s,r):r+d).toString();if(this.$highlightGutterLine){if(r==this.$cursorRow||i&&r<this.$cursorRow&&r>=v&&this.$cursorRow<=i.end.row){w+="ace_gutter-active-line ";if(this.$cursorCell!=e){if(this.$cursorCell)this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","");this.$cursorCell=e}}}if(f[r])w+=f[r];if(g[r])w+=g[r];if(this.$annotations[r]&&r!==v)w+=this.$annotations[r].className;if(m){var C=m[r];if(C==null)C=m[r]=s.getFoldWidget(r)}if(C){var S="ace_fold-widget ace_"+C;var x=C=="start"&&r==v&&r<i.end.row;if(x){S+=" ace_closed";var A="";var M=false;for(var k=r+1;k<=i.end.row;k++){if(!this.$annotations[k])continue;if(this.$annotations[k].className===" ace_error"){M=true;A=" ace_error_fold";break}if(this.$annotations[k].className===" ace_security"){M=true;A=" ace_security_fold"}else if(this.$annotations[k].className===" ace_warning"&&A!==" ace_security_fold"){M=true;A=" ace_warning_fold"}}w+=A}else S+=" ace_open";if(c.className!=S)c.className=S;n.setStyle(c.style,"height",y);n.setStyle(c.style,"display","inline-block");c.setAttribute("role","button");c.setAttribute("tabindex","-1");var L=s.getFoldWidgetRange(r);if(L)c.setAttribute("aria-label",l("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[L.start.row+1,L.end.row+1]));else{if(i)c.setAttribute("aria-label",l("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[i.start.row+1,i.end.row+1]));else c.setAttribute("aria-label",l("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[r+1]))}if(x){c.setAttribute("aria-expanded","false");c.setAttribute("title",l("gutter.code-folding.closed.title","Unfold code"))}else{c.setAttribute("aria-expanded","true");c.setAttribute("title",l("gutter.code-folding.open.title","Fold code"))}}else{if(c){n.setStyle(c.style,"display","none");c.setAttribute("tabindex","0");c.removeAttribute("role");c.removeAttribute("aria-label")}}if(M&&this.$showFoldedAnnotations){h.className="ace_gutter_annotation";u.className=b;u.className+=A;n.setStyle(u.style,"height",y);n.setStyle(h.style,"display","block");n.setStyle(h.style,"height",y);var T;switch(A){case" ace_error_fold":T=l("gutter.annotation.aria-label.error","Error, read annotations row $0",[$]);break;case" ace_security_fold":T=l("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[$]);break;case" ace_warning_fold":T=l("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[$]);break}h.setAttribute("aria-label",T);h.setAttribute("tabindex","-1");h.setAttribute("role","button")}else if(this.$annotations[r]){h.className="ace_gutter_annotation";u.className=b;if(this.$useSvgGutterIcons)u.className+=this.$annotations[r].className;else o.classList.add(this.$annotations[r].className.replace(" ",""));n.setStyle(u.style,"height",y);n.setStyle(h.style,"display","block");n.setStyle(h.style,"height",y);var T;switch(this.$annotations[r].className){case" ace_error":T=l("gutter.annotation.aria-label.error","Error, read annotations row $0",[$]);break;case" ace_security":T=l("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[$]);break;case" ace_warning":T=l("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[$]);break;case" ace_info":T=l("gutter.annotation.aria-label.info","Info, read annotations row $0",[$]);break;case" ace_hint":T=l("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[$]);break}h.setAttribute("aria-label",T);h.setAttribute("tabindex","-1");h.setAttribute("role","button")}else{n.setStyle(h.style,"display","none");h.removeAttribute("aria-label");h.removeAttribute("role");h.setAttribute("tabindex","0")}if($!==a.data){a.data=$}if(o.className!=w)o.className=w;n.setStyle(e.element.style,"height",this.$lines.computeLineHeight(r,t,s)+"px");n.setStyle(e.element.style,"top",this.$lines.computeLineTop(r,t,s)+"px");e.text=$;if(h.style.display==="none"&&c.style.display==="none")e.element.setAttribute("aria-hidden",true);else e.element.setAttribute("aria-hidden",false);return e};e.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e};e.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}};e.prototype.getShowLineNumbers=function(){return this.$showLineNumbers};e.prototype.setShowFoldWidgets=function(e){if(e)n.addCssClass(this.element,"ace_folding-enabled");else n.removeCssClass(this.element,"ace_folding-enabled");this.$showFoldWidgets=e;this.$padding=null};e.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets};e.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=n.computedStyle(this.element.firstChild);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);return this.$padding};e.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding();var i=this.element.getBoundingClientRect();if(e.x<t.left+i.left)return"markers";if(this.$showFoldWidgets&&e.x>i.right-t.right)return"foldWidgets"};return e}();c.prototype.$fixedWidth=false;c.prototype.$highlightGutterLine=true;c.prototype.$renderer="";c.prototype.$showLineNumbers=true;c.prototype.$showFoldWidgets=true;r.implement(c.prototype,s);function h(e){var t=document.createTextNode("");e.appendChild(t);var i=n.createElement("span");e.appendChild(i);var r=n.createElement("span");e.appendChild(r);var o=n.createElement("span");r.appendChild(o);return e}t.Gutter=c});ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../range").Range;var r=e("../lib/dom");var o=function(){function e(e){this.element=r.createElement("div");this.element.className="ace_layer ace_marker-layer";e.appendChild(this.element)}e.prototype.setPadding=function(e){this.$padding=e};e.prototype.setSession=function(e){this.session=e};e.prototype.setMarkers=function(e){this.markers=e};e.prototype.elt=function(e,t){var i=this.i!=-1&&this.element.childNodes[this.i];if(!i){i=document.createElement("div");this.element.appendChild(i);this.i=-1}else{this.i++}i.style.cssText=t;i.className=e};e.prototype.update=function(e){if(!e)return;this.config=e;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,e);continue}var r=n.range.clipRows(e.firstRow,e.lastRow);if(r.isEmpty())continue;r=r.toScreenRange(this.session);if(n.renderer){var o=this.$getTop(r.start.row,e);var s=this.$padding+r.start.column*e.characterWidth;n.renderer(t,r,s,o,e)}else if(n.type=="fullLine"){this.drawFullLineMarker(t,r,n.clazz,e)}else if(n.type=="screenLine"){this.drawScreenLineMarker(t,r,n.clazz,e)}else if(r.isMultiLine()){if(n.type=="text")this.drawTextMarker(t,r,n.clazz,e);else this.drawMultiLineMarker(t,r,n.clazz,e)}else{this.drawSingleLineMarker(t,r,n.clazz+" ace_start"+" ace_br15",e)}}if(this.i!=-1){while(this.i<this.element.childElementCount)this.element.removeChild(this.element.lastChild)}};e.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight};e.prototype.drawTextMarker=function(e,t,i,r,o){var a=this.session;var l=t.start.row;var c=t.end.row;var h=l;var u=0;var d=0;var f=a.getScreenLastRowColumn(h);var g=new n(h,t.start.column,h,d);for(;h<=c;h++){g.start.row=g.end.row=h;g.start.column=h==l?t.start.column:a.getRowWrapIndent(h);g.end.column=f;u=d;d=f;f=h+1<c?a.getScreenLastRowColumn(h+1):h==c?0:t.end.column;this.drawSingleLineMarker(e,g,i+(h==l?" ace_start":"")+" ace_br"+s(h==l||h==l+1&&t.start.column,u<d,d>f,h==c),r,h==c?0:1,o)}};e.prototype.drawMultiLineMarker=function(e,t,i,n,r){var o=this.$padding;var s=n.lineHeight;var a=this.$getTop(t.start.row,n);var l=o+t.start.column*n.characterWidth;r=r||"";if(this.session.$bidiHandler.isBidiRow(t.start.row)){var c=t.clone();c.end.row=c.start.row;c.end.column=this.session.getLine(c.start.row).length;this.drawBidiSingleLineMarker(e,c,i+" ace_br1 ace_start",n,null,r)}else{this.elt(i+" ace_br1 ace_start","height:"+s+"px;"+"right:"+o+"px;"+"top:"+a+"px;left:"+l+"px;"+(r||""))}if(this.session.$bidiHandler.isBidiRow(t.end.row)){var c=t.clone();c.start.row=c.end.row;c.start.column=0;this.drawBidiSingleLineMarker(e,c,i+" ace_br12",n,null,r)}else{a=this.$getTop(t.end.row,n);var h=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+s+"px;"+"width:"+h+"px;"+"top:"+a+"px;"+"left:"+o+"px;"+(r||""))}s=(t.end.row-t.start.row-1)*n.lineHeight;if(s<=0)return;a=this.$getTop(t.start.row+1,n);var u=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(u?" ace_br"+u:""),"height:"+s+"px;"+"right:"+o+"px;"+"top:"+a+"px;"+"left:"+o+"px;"+(r||""))};e.prototype.drawSingleLineMarker=function(e,t,i,n,r,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,r,o);var s=n.lineHeight;var a=(t.end.column+(r||0)-t.start.column)*n.characterWidth;var l=this.$getTop(t.start.row,n);var c=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+s+"px;"+"width:"+a+"px;"+"top:"+l+"px;"+"left:"+c+"px;"+(o||""))};e.prototype.drawBidiSingleLineMarker=function(e,t,i,n,r,o){var s=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;var c=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);c.forEach(function(e){this.elt(i,"height:"+s+"px;"+"width:"+(e.width+(r||0))+"px;"+"top:"+a+"px;"+"left:"+(l+e.left)+"px;"+(o||""))},this)};e.prototype.drawFullLineMarker=function(e,t,i,n,r){var o=this.$getTop(t.start.row,n);var s=n.lineHeight;if(t.start.row!=t.end.row)s+=this.$getTop(t.end.row,n)-o;this.elt(i,"height:"+s+"px;"+"top:"+o+"px;"+"left:0;right:0;"+(r||""))};e.prototype.drawScreenLineMarker=function(e,t,i,n,r){var o=this.$getTop(t.start.row,n);var s=n.lineHeight;this.elt(i,"height:"+s+"px;"+"top:"+o+"px;"+"left:0;right:0;"+(r||""))};return e}();o.prototype.$padding=0;function s(e,t,i,n){return(e?1:0)|(t?2:0)|(i?4:0)|(n?8:0)}t.Marker=o});ace.define("ace/layer/text_util",["require","exports","module"],function(e,t,i){var n=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return n.has(e)}});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(e,t,i){"use strict";var n=e("../lib/oop");var r=e("../lib/dom");var o=e("../lib/lang");var s=e("./lines").Lines;var a=e("../lib/event_emitter").EventEmitter;var l=e("../config").nls;var c=e("./text_util").isTextToken;var h=function(){function e(e){this.dom=r;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)}e.prototype.$updateEolChar=function(){var e=this.session.doc;var t=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows";var i=t?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=i){this.EOL_CHAR=i;return true}};e.prototype.setPadding=function(e){this.$padding=e;this.element.style.margin="0 "+e+"px"};e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0};e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0};e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e;this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this));this.$pollSizeChanges()};e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()};e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()};e.prototype.setSession=function(e){this.session=e;if(e)this.$computeTabString()};e.prototype.setShowInvisibles=function(e){if(this.showInvisibles==e)return false;this.showInvisibles=e;if(typeof e=="string"){this.showSpaces=/tab/i.test(e);this.showTabs=/space/i.test(e);this.showEOL=/eol/i.test(e)}else{this.showSpaces=this.showTabs=this.showEOL=e}this.$computeTabString();return true};e.prototype.setDisplayIndentGuides=function(e){if(this.displayIndentGuides==e)return false;this.displayIndentGuides=e;this.$computeTabString();return true};e.prototype.setHighlightIndentGuides=function(e){if(this.$highlightIndentGuides===e)return false;this.$highlightIndentGuides=e;return e};e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var i=1;i<e+1;i++){if(this.showTabs){var n=this.dom.createElement("span");n.className="ace_invisible ace_invisible_tab";n.textContent=o.stringRepeat(this.TAB_CHAR,i);t.push(n)}else{t.push(this.dom.createTextNode(o.stringRepeat(" ",i),this.element))}}if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var r="ace_indent-guide";var s=this.showSpaces?" ace_invisible ace_invisible_space":"";var a=this.showSpaces?o.stringRepeat(this.SPACE_CHAR,this.tabSize):o.stringRepeat(" ",this.tabSize);var l=this.showTabs?" ace_invisible ace_invisible_tab":"";var c=this.showTabs?o.stringRepeat(this.TAB_CHAR,this.tabSize):a;var n=this.dom.createElement("span");n.className=r+s;n.textContent=a;this.$tabStrings[" "]=n;var n=this.dom.createElement("span");n.className=r+l;n.textContent=c;this.$tabStrings["\t"]=n}};e.prototype.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow){return this.update(e)}this.config=e;var n=Math.max(t,e.firstRow);var r=Math.min(i,e.lastRow);var o=this.element.childNodes;var s=0;for(var a=e.firstRow;a<n;a++){var l=this.session.getFoldLine(a);if(l){if(l.containsRow(n)){n=l.start.row;break}else{a=l.end.row}}s++}var c=false;var a=n;var l=this.session.getNextFoldLine(a);var h=l?l.start.row:Infinity;while(true){if(a>h){a=l.end.row+1;l=this.session.getNextFoldLine(a,l);h=l?l.start.row:Infinity}if(a>r)break;var u=o[s++];if(u){this.dom.removeChildren(u);this.$renderLine(u,a,a==h?l:false);if(c)u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px";var d=e.lineHeight*this.session.getRowLength(a)+"px";if(u.style.height!=d){c=true;u.style.height=d}}a++}if(c){while(s<this.$lines.cells.length){var f=this.$lines.cells[s++];f.element.style.top=this.$lines.computeLineTop(f.row,e,this.session)+"px"}}};e.prototype.scrollLines=function(e){var t=this.config;this.config=e;if(this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow;var n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);r>0;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);r>0;r--)this.$lines.pop();if(e.firstRow<t.firstRow){this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1))}if(e.lastRow>t.lastRow){this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow))}this.$highlightIndentGuide()};e.prototype.$renderLinesFragment=function(e,t,i){var n=[];var o=t;var s=this.session.getNextFoldLine(o);var a=s?s.start.row:Infinity;while(true){if(o>a){o=s.end.row+1;s=this.session.getNextFoldLine(o,s);a=s?s.start.row:Infinity}if(o>i)break;var l=this.$lines.createCell(o,e,this.session);var c=l.element;this.dom.removeChildren(c);r.setStyle(c.style,"height",this.$lines.computeLineHeight(o,e,this.session)+"px");r.setStyle(c.style,"top",this.$lines.computeLineTop(o,e,this.session)+"px");this.$renderLine(c,o,o==a?s:false);if(this.$useLineGroups()){c.className="ace_line_group"}else{c.className="ace_line"}n.push(l);o++}return n};e.prototype.update=function(e){this.$lines.moveContainer(e);this.config=e;var t=e.firstRow;var i=e.lastRow;var n=this.$lines;while(n.getLength())n.pop();n.push(this.$renderLinesFragment(e,t,i))};e.prototype.$renderToken=function(e,t,i,n){var r=this;var 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\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\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;var a=this.dom.createFragment(this.element);var h;var u=0;while(h=s.exec(n)){var d=h[1];var f=h[2];var g=h[3];var p=h[4];var m=h[5];if(!r.showSpaces&&f)continue;var v=u!=h.index?n.slice(u,h.index):"";u=h.index+h[0].length;if(v){a.appendChild(this.dom.createTextNode(v,this.element))}if(d){var y=r.session.getScreenTabSize(t+h.index);a.appendChild(r.$tabStrings[y].cloneNode(true));t+=y-1}else if(f){if(r.showSpaces){var w=this.dom.createElement("span");w.className="ace_invisible ace_invisible_space";w.textContent=o.stringRepeat(r.SPACE_CHAR,f.length);a.appendChild(w)}else{a.appendChild(this.dom.createTextNode(f,this.element))}}else if(g){var w=this.dom.createElement("span");w.className="ace_invisible ace_invisible_space ace_invalid";w.textContent=o.stringRepeat(r.SPACE_CHAR,g.length);a.appendChild(w)}else if(p){t+=1;var w=this.dom.createElement("span");w.style.width=r.config.characterWidth*2+"px";w.className=r.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk";w.textContent=r.showSpaces?r.SPACE_CHAR:p;a.appendChild(w)}else if(m){t+=1;var w=this.dom.createElement("span");w.style.width=r.config.characterWidth*2+"px";w.className="ace_cjk";w.textContent=m;a.appendChild(w)}}a.appendChild(this.dom.createTextNode(u?n.slice(u):n,this.element));if(!c(i.type)){var b="ace_"+i.type.replace(/\./g," ace_");var w=this.dom.createElement("span");if(i.type=="fold"){w.style.width=i.value.length*this.config.characterWidth+"px";w.setAttribute("title",l("inline-fold.closed.title","Unfold code"))}w.className=b;w.appendChild(a);e.appendChild(w)}else{e.appendChild(a)}return t+n.length};e.prototype.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||n>=i)return t;if(t[0]==" "){n-=n%this.tabSize;var r=n/this.tabSize;for(var o=0;o<r;o++){e.appendChild(this.$tabStrings[" "].cloneNode(true))}this.$highlightIndentGuide();return t.substr(n)}else if(t[0]=="\t"){for(var o=0;o<n;o++){e.appendChild(this.$tabStrings["\t"].cloneNode(true))}this.$highlightIndentGuide();return t.substr(n)}this.$highlightIndentGuide();return t};e.prototype.$highlightIndentGuide=function(){if(!this.$highlightIndentGuides||!this.displayIndentGuides)return;this.$highlightIndentGuideMarker={indentLevel:undefined,start:undefined,end:undefined,dir:undefined};var e=this.session.doc.$lines;if(!e)return;var t=this.session.selection.getCursor();var i=/^\s*/.exec(this.session.doc.getLine(t.row))[0].length;var n=Math.floor(i/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:n,start:t.row};var r=this.session.$bracketHighlight;if(r){var o=this.session.$bracketHighlight.ranges;for(var s=0;s<o.length;s++){if(t.row!==o[s].start.row){this.$highlightIndentGuideMarker.end=o[s].start.row;if(t.row>o[s].start.row){this.$highlightIndentGuideMarker.dir=-1}else{this.$highlightIndentGuideMarker.dir=1}break}}}if(!this.$highlightIndentGuideMarker.end){if(e[t.row]!==""&&t.column===e[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(var s=t.row+1;s<e.length;s++){var a=e[s];var l=/^\s*/.exec(a)[0].length;if(a!==""){this.$highlightIndentGuideMarker.end=s;if(l<=i)break}}}}this.$renderHighlightIndentGuide()};e.prototype.$clearActiveIndentGuide=function(){var e=this.$lines.cells;for(var t=0;t<e.length;t++){var i=e[t];var n=i.element.childNodes;if(n.length>0){for(var r=0;r<n.length;r++){if(n[r].classList&&n[r].classList.contains("ace_indent-guide-active")){n[r].classList.remove("ace_indent-guide-active");break}}}}};e.prototype.$setIndentGuideActive=function(e,t){var i=this.session.doc.getLine(e.row);if(i!==""){var n=e.element.childNodes;if(n){var r=n[t-1];if(r&&r.classList&&r.classList.contains("ace_indent-guide"))r.classList.add("ace_indent-guide-active")}}};e.prototype.$renderHighlightIndentGuide=function(){if(!this.$lines)return;var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(t!==0){if(this.$highlightIndentGuideMarker.dir===1){for(var i=0;i<e.length;i++){var n=e[i];if(this.$highlightIndentGuideMarker.end&&n.row>=this.$highlightIndentGuideMarker.start+1){if(n.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}}else{for(var i=e.length-1;i>=0;i--){var n=e[i];if(this.$highlightIndentGuideMarker.end&&n.row<this.$highlightIndentGuideMarker.start){if(n.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}}}};e.prototype.$createLineElement=function(e){var t=this.dom.createElement("div");t.className="ace_line";t.style.height=this.config.lineHeight+"px";return t};e.prototype.$renderWrappedLine=function(e,t,i){var n=0;var r=0;var s=i[0];var a=0;var l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var h=t[c];var u=h.value;if(c==0&&this.displayIndentGuides){n=u.length;u=this.renderIndentGuide(l,u,s);if(!u)continue;n-=u.length}if(n+u.length<s){a=this.$renderToken(l,a,h,u);n+=u.length}else{while(n+u.length>=s){a=this.$renderToken(l,a,h,u.substring(0,s-n));u=u.substring(s-n);n=s;l=this.$createLineElement();e.appendChild(l);l.appendChild(this.dom.createTextNode(o.stringRepeat(" ",i.indent),this.element));r++;a=0;s=i[r]||Number.MAX_VALUE}if(u.length!=0){n+=u.length;a=this.$renderToken(l,a,h,u)}}}if(i[i.length-1]>this.MAX_LINE_LENGTH)this.$renderOverflowMessage(l,a,null,"",true)};e.prototype.$renderSimpleLine=function(e,t){var i=0;for(var n=0;n<t.length;n++){var r=t[n];var o=r.value;if(n==0&&this.displayIndentGuides){o=this.renderIndentGuide(e,o);if(!o)continue}if(i+o.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,r,o);i=this.$renderToken(e,i,r,o)}};e.prototype.$renderOverflowMessage=function(e,t,i,n,r){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var o=this.dom.createElement("span");o.className="ace_inline_button ace_keyword ace_toggle_wrap";o.textContent=r?"<hide>":"<click to see more...>";e.appendChild(o)};e.prototype.$renderLine=function(e,t,i){if(!i&&i!=false)i=this.session.getFoldLine(t);if(i)var n=this.$getFoldLineTokens(t,i);else var n=this.session.getTokens(t);var r=e;if(n.length){var o=this.session.getRowSplitData(t);if(o&&o.length){this.$renderWrappedLine(e,n,o);var r=e.lastChild}else{var r=e;if(this.$useLineGroups()){r=this.$createLineElement();e.appendChild(r)}this.$renderSimpleLine(r,n)}}else if(this.$useLineGroups()){r=this.$createLineElement();e.appendChild(r)}if(this.showEOL&&r){if(i)t=i.end.row;var s=this.dom.createElement("span");s.className="ace_invisible ace_invisible_eol";s.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR;r.appendChild(s)}};e.prototype.$getFoldLineTokens=function(e,t){var i=this.session;var n=[];function r(e,t,i){var r=0,o=0;while(o+e[r].value.length<t){o+=e[r].value.length;r++;if(r==e.length)return}if(o!=t){var s=e[r].value.substring(t-o);if(s.length>i-t)s=s.substring(0,i-t);n.push({type:e[r].type,value:s});o=t+s.length;r+=1}while(o<i&&r<e.length){var s=e[r].value;if(s.length+o>i){n.push({type:e[r].type,value:s.substring(0,i-o)})}else n.push(e[r]);o+=s.length;r+=1}}var o=i.getTokens(e);t.walk(function(e,t,s,a,l){if(e!=null){n.push({type:"fold",value:e})}else{if(l)o=i.getTokens(t);if(o.length)r(o,a,s)}},t.end.row,this.session.getLine(t.end.row).length);return n};e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()};return e}();h.prototype.EOF_CHAR="¶";h.prototype.EOL_CHAR_LF="¬";h.prototype.EOL_CHAR_CRLF="¤";h.prototype.EOL_CHAR=h.prototype.EOL_CHAR_LF;h.prototype.TAB_CHAR="—";h.prototype.SPACE_CHAR="·";h.prototype.$padding=0;h.prototype.MAX_LINE_LENGTH=1e4;h.prototype.showInvisibles=false;h.prototype.showSpaces=false;h.prototype.showTabs=false;h.prototype.showEOL=false;h.prototype.displayIndentGuides=true;h.prototype.$highlightIndentGuides=true;h.prototype.$tabStrings=[];h.prototype.destroy={};h.prototype.onChangeTabSize=h.prototype.$computeTabString;n.implement(h.prototype,a);t.Text=h});ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=function(){function e(e){this.element=n.createElement("div");this.element.className="ace_layer ace_cursor-layer";e.appendChild(this.element);this.isVisible=false;this.isBlinking=true;this.blinkInterval=1e3;this.smoothBlinking=false;this.cursors=[];this.cursor=this.addCursor();n.addCssClass(this.element,"ace_hidden-cursors");this.$updateCursors=this.$updateOpacity.bind(this)}e.prototype.$updateOpacity=function(e){var t=this.cursors;for(var i=t.length;i--;)n.setStyle(t[i].style,"opacity",e?"":"0")};e.prototype.$startCssAnimation=function(){var e=this.cursors;for(var t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=true;setTimeout(function(){if(this.$isAnimating){n.addCssClass(this.element,"ace_animate-blinking")}}.bind(this))};e.prototype.$stopCssAnimation=function(){this.$isAnimating=false;n.removeCssClass(this.element,"ace_animate-blinking")};e.prototype.setPadding=function(e){this.$padding=e};e.prototype.setSession=function(e){this.session=e};e.prototype.setBlinking=function(e){if(e!=this.isBlinking){this.isBlinking=e;this.restartTimer()}};e.prototype.setBlinkInterval=function(e){if(e!=this.blinkInterval){this.blinkInterval=e;this.restartTimer()}};e.prototype.setSmoothBlinking=function(e){if(e!=this.smoothBlinking){this.smoothBlinking=e;n.setCssClass(this.element,"ace_smooth-blinking",e);this.$updateCursors(true);this.restartTimer()}};e.prototype.addCursor=function(){var e=n.createElement("div");e.className="ace_cursor";this.element.appendChild(e);this.cursors.push(e);return e};e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();e.parentNode.removeChild(e);return e}};e.prototype.hideCursor=function(){this.isVisible=false;n.addCssClass(this.element,"ace_hidden-cursors");this.restartTimer()};e.prototype.showCursor=function(){this.isVisible=true;n.removeCssClass(this.element,"ace_hidden-cursors");this.restartTimer()};e.prototype.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId);clearTimeout(this.timeoutId);this.$stopCssAnimation();if(this.smoothBlinking){this.$isSmoothBlinking=false;n.removeCssClass(this.element,"ace_smooth-blinking")}e(true);if(!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking){this.$isSmoothBlinking=true;setTimeout(function(){if(this.$isSmoothBlinking){n.addCssClass(this.element,"ace_smooth-blinking")}}.bind(this))}if(n.HAS_CSS_ANIMATION){this.$startCssAnimation()}else{var t=function(){this.timeoutId=setTimeout(function(){e(false)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(true);t()},this.blinkInterval);t()}};e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};if(!e)e=this.session.selection.getCursor();var i=this.session.documentToScreenPosition(e);var n=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth);var r=(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:n,top:r}};e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight};e.prototype.update=function(e){this.config=e;var t=this.session.$selectionMarkers;var i=0,r=0;if(t===undefined||t.length===0){t=[{cursor:null}]}for(var i=0,o=t.length;i<o;i++){var s=this.getPixelPosition(t[i].cursor,true);if((s.top>e.height+e.offset||s.top<0)&&i>1){continue}var a=this.cursors[r++]||this.addCursor();var l=a.style;if(!this.drawCursor){if(!this.isCursorInView(s,e)){n.setStyle(l,"display","none")}else{n.setStyle(l,"display","block");n.translate(a,s.left,s.top);n.setStyle(l,"width",Math.round(e.characterWidth)+"px");n.setStyle(l,"height",e.lineHeight+"px")}}else{this.drawCursor(a,s,e,t[i],this.session)}}while(this.cursors.length>r)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c);this.$pixelPos=s;this.restartTimer()};e.prototype.$setOverwrite=function(e){if(e!=this.overwrite){this.overwrite=e;if(e)n.addCssClass(this.element,"ace_overwrite-cursors");else n.removeCssClass(this.element,"ace_overwrite-cursors")}};e.prototype.destroy=function(){clearInterval(this.intervalId);clearTimeout(this.timeoutId)};return e}();r.prototype.$padding=0;r.prototype.drawCursor=null;t.Cursor=r});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=e("./lib/oop");var o=e("./lib/dom");var s=e("./lib/event");var a=e("./lib/event_emitter").EventEmitter;var l=32768;var c=function(){function e(e,t){this.element=o.createElement("div");this.element.className="ace_scrollbar ace_scrollbar"+t;this.inner=o.createElement("div");this.inner.className="ace_scrollbar-inner";this.inner.textContent=" ";this.element.appendChild(this.inner);e.appendChild(this.element);this.setVisible(false);this.skipEvent=false;s.addListener(this.element,"scroll",this.onScroll.bind(this));s.addListener(this.element,"mousedown",s.preventDefault)}e.prototype.setVisible=function(e){this.element.style.display=e?"":"none";this.isVisible=e;this.coeff=1};return e}();r.implement(c.prototype,a);var h=function(e){n(t,e);function t(t,i){var n=e.call(this,t,"-v")||this;n.scrollTop=0;n.scrollHeight=0;i.$scrollbarWidth=n.width=o.scrollbarWidth(t.ownerDocument);n.inner.style.width=n.element.style.width=(n.width||15)+5+"px";n.$minWidth=0;return n}t.prototype.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=false};t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)};t.prototype.setHeight=function(e){this.element.style.height=e+"px"};t.prototype.setScrollHeight=function(e){this.scrollHeight=e;if(e>l){this.coeff=l/e;e=l}else if(this.coeff!=1){this.coeff=1}this.inner.style.height=e+"px"};t.prototype.setScrollTop=function(e){if(this.scrollTop!=e){this.skipEvent=true;this.scrollTop=e;this.element.scrollTop=e*this.coeff}};return t}(c);h.prototype.setInnerHeight=h.prototype.setScrollHeight;var u=function(e){n(t,e);function t(t,i){var n=e.call(this,t,"-h")||this;n.scrollLeft=0;n.height=i.$scrollbarWidth;n.inner.style.height=n.element.style.height=(n.height||15)+5+"px";return n}t.prototype.onScroll=function(){if(!this.skipEvent){this.scrollLeft=this.element.scrollLeft;this._emit("scroll",{data:this.scrollLeft})}this.skipEvent=false};t.prototype.getHeight=function(){return this.isVisible?this.height:0};t.prototype.setWidth=function(e){this.element.style.width=e+"px"};t.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"};t.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"};t.prototype.setScrollLeft=function(e){if(this.scrollLeft!=e){this.skipEvent=true;this.scrollLeft=this.element.scrollLeft=e}};return t}(c);t.ScrollBar=h;t.ScrollBarV=h;t.ScrollBarH=u;t.VScrollBar=h;t.HScrollBar=u});ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=function(t,i){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]};return e(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");e(t,i);function n(){this.constructor=t}t.prototype=i===null?Object.create(i):(n.prototype=i.prototype,new n)}}();var r=e("./lib/oop");var o=e("./lib/dom");var s=e("./lib/event");var a=e("./lib/event_emitter").EventEmitter;o.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n  position: absolute;\n  background: rgba(128, 128, 128, 0.6);\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  border: 1px solid #bbb;\n  border-radius: 2px;\n  z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n  position: absolute;\n  z-index: 6;\n  background: none;\n  overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n  z-index: 6;\n  right: 0;\n  top: 0;\n  width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n  z-index: 8;\n  right: 0;\n  width: 100%;\n}\n.ace_editor>.ace_sb-h {\n  bottom: 0;\n  left: 0;\n  height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n  bottom: 0;\n  height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n  z-index: 8;\n  background: #000;\n}","ace_scrollbar.css",false);var l=function(){function e(e,t){this.element=o.createElement("div");this.element.className="ace_sb"+t;this.inner=o.createElement("div");this.inner.className="";this.element.appendChild(this.inner);this.VScrollWidth=12;this.HScrollHeight=12;e.appendChild(this.element);this.setVisible(false);this.skipEvent=false;s.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}e.prototype.setVisible=function(e){this.element.style.display=e?"":"none";this.isVisible=e;this.coeff=1};return e}();r.implement(l.prototype,a);var c=function(e){n(t,e);function t(t,i){var n=e.call(this,t,"-v")||this;n.scrollTop=0;n.scrollHeight=0;n.parent=t;n.width=n.VScrollWidth;n.renderer=i;n.inner.style.width=n.element.style.width=(n.width||15)+"px";n.$minWidth=0;return n}t.prototype.onMouseDown=function(e,t){if(e!=="mousedown")return;if(s.getButton(t)!==0||t.detail===2){return}if(t.target===this.inner){var i=this;var n=t.clientY;var r=function(e){n=e.clientY};var o=function(){clearInterval(h)};var a=t.clientY;var l=this.thumbTop;var c=function(){if(n===undefined)return;var e=i.scrollTopFromThumbTop(l+n-a);if(e===i.scrollTop)return;i._emit("scroll",{data:e})};s.capture(this.inner,r,o);var h=setInterval(c,20);return s.preventDefault(t)}var u=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;this._emit("scroll",{data:this.scrollTopFromThumbTop(u)});return s.preventDefault(t)};t.prototype.getHeight=function(){return this.height};t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);t=t>>0;if(t<0){t=0}else if(t>this.pageHeight-this.viewHeight){t=this.pageHeight-this.viewHeight}return t};t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)};t.prototype.setHeight=function(e){this.height=Math.max(0,e);this.slideHeight=this.height;this.viewHeight=this.height;this.setScrollHeight(this.pageHeight,true)};t.prototype.setScrollHeight=function(e,t){if(this.pageHeight===e&&!t)return;this.pageHeight=e;this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight;if(this.thumbHeight>this.slideHeight)this.thumbHeight=this.slideHeight;if(this.thumbHeight<15)this.thumbHeight=15;this.inner.style.height=this.thumbHeight+"px";if(this.scrollTop>this.pageHeight-this.viewHeight){this.scrollTop=this.pageHeight-this.viewHeight;if(this.scrollTop<0)this.scrollTop=0;this._emit("scroll",{data:this.scrollTop})}};t.prototype.setScrollTop=function(e){this.scrollTop=e;if(e<0)e=0;this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight);this.inner.style.top=this.thumbTop+"px"};return t}(l);c.prototype.setInnerHeight=c.prototype.setScrollHeight;var h=function(e){n(t,e);function t(t,i){var n=e.call(this,t,"-h")||this;n.scrollLeft=0;n.scrollWidth=0;n.height=n.HScrollHeight;n.inner.style.height=n.element.style.height=(n.height||12)+"px";n.renderer=i;return n}t.prototype.onMouseDown=function(e,t){if(e!=="mousedown")return;if(s.getButton(t)!==0||t.detail===2){return}if(t.target===this.inner){var i=this;var n=t.clientX;var r=function(e){n=e.clientX};var o=function(){clearInterval(h)};var a=t.clientX;var l=this.thumbLeft;var c=function(){if(n===undefined)return;var e=i.scrollLeftFromThumbLeft(l+n-a);if(e===i.scrollLeft)return;i._emit("scroll",{data:e})};s.capture(this.inner,r,o);var h=setInterval(c,20);return s.preventDefault(t)}var u=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;this._emit("scroll",{data:this.scrollLeftFromThumbLeft(u)});return s.preventDefault(t)};t.prototype.getHeight=function(){return this.isVisible?this.height:0};t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);t=t>>0;if(t<0){t=0}else if(t>this.pageWidth-this.viewWidth){t=this.pageWidth-this.viewWidth}return t};t.prototype.setWidth=function(e){this.width=Math.max(0,e);this.element.style.width=this.width+"px";this.slideWidth=this.width;this.viewWidth=this.width;this.setScrollWidth(this.pageWidth,true)};t.prototype.setScrollWidth=function(e,t){if(this.pageWidth===e&&!t)return;this.pageWidth=e;this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth;if(this.thumbWidth>this.slideWidth)this.thumbWidth=this.slideWidth;if(this.thumbWidth<15)this.thumbWidth=15;this.inner.style.width=this.thumbWidth+"px";if(this.scrollLeft>this.pageWidth-this.viewWidth){this.scrollLeft=this.pageWidth-this.viewWidth;if(this.scrollLeft<0)this.scrollLeft=0;this._emit("scroll",{data:this.scrollLeft})}};t.prototype.setScrollLeft=function(e){this.scrollLeft=e;if(e<0)e=0;this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth);this.inner.style.left=this.thumbLeft+"px"};return t}(l);h.prototype.setInnerWidth=h.prototype.setScrollWidth;t.ScrollBar=c;t.ScrollBarV=c;t.ScrollBarH=h;t.VScrollBar=c;t.HScrollBar=h});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,i){"use strict";var n=e("./lib/event");var r=function(){function e(e,t){this.onRender=e;this.pending=false;this.changes=0;this.$recursionLimit=2;this.window=t||window;var i=this;this._flush=function(e){i.pending=false;var t=i.changes;if(t){n.blockIdle(100);i.changes=0;i.onRender(t)}if(i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else{i.$recursionLimit=2}}}e.prototype.schedule=function(e){this.changes=this.changes|e;if(this.changes&&!this.pending){n.nextFrame(this._flush);this.pending=true}};e.prototype.clear=function(e){var t=this.changes;this.changes=0;return t};return e}();t.RenderLoop=r});ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,i){var n=e("../lib/oop");var r=e("../lib/dom");var o=e("../lib/lang");var s=e("../lib/event");var a=e("../lib/useragent");var l=e("../lib/event_emitter").EventEmitter;var c=512;var h=typeof ResizeObserver=="function";var u=200;var d=function(){function e(e){this.el=r.createElement("div");this.$setMeasureNodeStyles(this.el.style,true);this.$main=r.createElement("div");this.$setMeasureNodeStyles(this.$main.style);this.$measureNode=r.createElement("div");this.$setMeasureNodeStyles(this.$measureNode.style);this.el.appendChild(this.$main);this.el.appendChild(this.$measureNode);e.appendChild(this.el);this.$measureNode.textContent=o.stringRepeat("X",c);this.$characterSize={width:0,height:0};if(h)this.$addObserver();else this.checkForSizeChanges()}e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto";e.left=e.top="0px";e.visibility="hidden";e.position="absolute";e.whiteSpace="pre";if(a.isIE<8){e["font-family"]="inherit"}else{e.font="inherit"}e.overflow=t?"hidden":"visible"};e.prototype.checkForSizeChanges=function(e){if(e===undefined)e=this.$measureSizes();if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="";this.$characterSize=e;this.charSizes=Object.create(null);this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height;this._emit("changeCharacterSize",{data:e})}};e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()});this.$observer.observe(this.$measureNode)};e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=s.onIdle(function t(){e.checkForSizeChanges();s.onIdle(t,500)},500)};e.prototype.setPolling=function(e){if(e){this.$pollSizeChanges()}else if(this.$pollSizeChangesTimer){clearInterval(this.$pollSizeChangesTimer);this.$pollSizeChangesTimer=0}};e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/c};if(t.width===0||t.height===0)return null;return t};e.prototype.$measureCharWidth=function(e){this.$main.textContent=o.stringRepeat(e,c);var t=this.$main.getBoundingClientRect();return t.width/c};e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];if(t===undefined){t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width}return t};e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer);if(this.$observer)this.$observer.disconnect();if(this.el&&this.el.parentNode)this.el.parentNode.removeChild(this.el)};e.prototype.$getZoom=function(e){if(!e||!e.parentElement)return 1;return(Number(window.getComputedStyle(e)["zoom"])||1)*this.$getZoom(e.parentElement)};e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=r.buildDom([e(0,0),e(u,0),e(0,u),e(u,u)],this.el)};e.prototype.transformCoordinates=function(e,t){if(e){var i=this.$getZoom(this.el);e=s(1/i,e)}function n(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function s(e,t){return[e*t[0],e*t[1]]}if(!this.els)this.$initTransformMeasureNodes();function a(e){var t=e.getBoundingClientRect();return[t.left,t.top]}var l=a(this.els[0]);var c=a(this.els[1]);var h=a(this.els[2]);var d=a(this.els[3]);var f=n(r(d,c),r(d,h),r(o(c,h),o(d,l)));var g=s(1+f[0],r(c,l));var p=s(1+f[1],r(h,l));if(t){var m=t;var v=f[0]*m[0]/u+f[1]*m[1]/u+1;var y=o(s(m[0],g),s(m[1],p));return o(s(1/v/u,y),l)}var w=r(e,l);var b=n(r(g,s(f[0],w)),r(p,s(f[1],w)),w);return s(u,b)};return e}();d.prototype.$characterSize={width:0,height:0};n.implement(d.prototype,l);t.FontMetrics=d});ace.define("ace/css/editor-css",["require","exports","module"],function(e,t,i){i.exports='\n.ace_br1 {border-top-left-radius    : 3px;}\n.ace_br2 {border-top-right-radius   : 3px;}\n.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}\n.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}\n.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n    position: relative;\n    overflow: hidden;\n    padding: 0;\n    font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n    direction: ltr;\n    text-align: left;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n    forced-color-adjust: none;\n}\n\n.ace_scroller {\n    position: absolute;\n    overflow: hidden;\n    top: 0;\n    bottom: 0;\n    background-color: inherit;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    cursor: text;\n}\n\n.ace_content {\n    position: absolute;\n    box-sizing: border-box;\n    min-width: 100%;\n    contain: style size layout;\n    font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n    box-shadow: inset 0 0 0 2px #5E9ED6;\n    outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    content: \'\';\n    background: rgba(250, 250, 250, 0.01);\n    z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n    background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n    position: absolute;\n    overflow : hidden;\n    width: auto;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    cursor: default;\n    z-index: 4;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    contain: style size layout;\n}\n\n.ace_gutter-active-line {\n    position: absolute;\n    left: 0;\n    right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n    content: "";\n    position: absolute;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n    pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    padding-left: 19px;\n    padding-right: 6px;\n    background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n    margin-left: -14px;\n    float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n    margin-left: -19px;\n    float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n    background-repeat: no-repeat;\n    background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n    background-repeat: no-repeat;\n    background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n    background-repeat: no-repeat;\n    background-position: 2px center;\n}\n\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n    background-color: crimson;\n}\n.ace_icon_svg.ace_security {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+");\n    background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n    background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n    background-color: royalblue;\n}\n.ace_icon_svg.ace_hint {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==");\n    background-color: silver;\n}\n\n.ace_icon_svg.ace_error_fold {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n    background-color: crimson;\n}\n.ace_icon_svg.ace_security_fold {\n    -webkit-mask-image: url("data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n    background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n    background-color: darkorange;\n}\n\n.ace_scrollbar {\n    contain: strict;\n    position: absolute;\n    right: 0;\n    bottom: 0;\n    z-index: 6;\n}\n\n.ace_scrollbar-inner {\n    position: absolute;\n    cursor: text;\n    left: 0;\n    top: 0;\n}\n\n.ace_scrollbar-v{\n    overflow-x: hidden;\n    overflow-y: scroll;\n    top: 0;\n}\n\n.ace_scrollbar-h {\n    overflow-x: scroll;\n    overflow-y: hidden;\n    left: 0;\n}\n\n.ace_print-margin {\n    position: absolute;\n    height: 100%;\n}\n\n.ace_text-input {\n    position: absolute;\n    z-index: 0;\n    width: 0.5em;\n    height: 1em;\n    opacity: 0;\n    background: transparent;\n    -moz-appearance: none;\n    appearance: none;\n    border: none;\n    resize: none;\n    outline: none;\n    overflow: hidden;\n    font: inherit;\n    padding: 0 1px;\n    margin: 0 -1px;\n    contain: strict;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-user-select: text;\n    user-select: text;\n    /*with `pre-line` chrome inserts &nbsp; instead of space*/\n    white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n    background: transparent;\n    color: inherit;\n    z-index: 1000;\n    opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n    border-bottom: 1px solid;\n    position: absolute;\n    border-radius: 0;\n    margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n    transform: none!important;\n    filter: none!important;\n    clip-path: none!important;\n    mask : none!important;\n    contain: none!important;\n    perspective: none!important;\n    mix-blend-mode: initial!important;\n    z-index: auto;\n}\n\n.ace_layer {\n    z-index: 1;\n    position: absolute;\n    overflow: hidden;\n    /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n    word-wrap: normal;\n    white-space: pre;\n    height: 100%;\n    width: 100%;\n    box-sizing: border-box;\n    /* setting pointer-events: auto; on node under the mouse, which changes\n        during scroll, will break mouse wheel scrolling in Safari */\n    pointer-events: none;\n}\n\n.ace_gutter-layer {\n    position: relative;\n    width: auto;\n    text-align: right;\n    pointer-events: auto;\n    height: 1000000px;\n    contain: style size layout;\n}\n\n.ace_text-layer {\n    font: inherit !important;\n    position: absolute;\n    height: 1000000px;\n    width: 1000000px;\n    contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n    contain: style size layout;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n    contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n    contain: strict;\n}\n\n.ace_cjk {\n    display: inline-block;\n    text-align: center;\n}\n\n.ace_cursor-layer {\n    z-index: 4;\n}\n\n.ace_cursor {\n    z-index: 4;\n    position: absolute;\n    box-sizing: border-box;\n    border-left: 2px solid;\n    /* workaround for smooth cursor repaintng whole screen in chrome */\n    transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n    border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n    border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n    border-left-width: 0;\n    border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n    opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n    opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n    transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n    animation-duration: 1000ms;\n    animation-timing-function: step-end;\n    animation-name: blink-ace-animate;\n    animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n    animation-duration: 1000ms;\n    animation-timing-function: ease-in-out;\n    animation-name: blink-ace-animate-smooth;\n}\n    \n@keyframes blink-ace-animate {\n    from, to { opacity: 1; }\n    60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n    from, to { opacity: 1; }\n    45% { opacity: 1; }\n    60% { opacity: 0; }\n    85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n    position: absolute;\n    z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n    position: absolute;\n    z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n    position: absolute;\n    z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n    position: absolute;\n    border-bottom: 1px solid #DE5555;\n    border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n    position: absolute;\n    z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n    position: absolute;\n    z-index: 4;\n    box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n    box-sizing: border-box;\n\n    display: inline-block;\n    height: 11px;\n    margin-top: -2px;\n    vertical-align: middle;\n\n    background-image:\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n    background-repeat: no-repeat, repeat-x;\n    background-position: center center, top left;\n    color: transparent;\n\n    border: 1px solid black;\n    border-radius: 2px;\n\n    cursor: pointer;\n    pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n    background-image:\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n    background-color: #f5f5f5;\n    border: 1px solid gray;\n    border-radius: 1px;\n    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n    color: black;\n    max-width: 100%;\n    padding: 3px 4px;\n    position: fixed;\n    z-index: 999999;\n    box-sizing: border-box;\n    cursor: default;\n    white-space: pre-wrap;\n    word-wrap: break-word;\n    line-height: normal;\n    font-style: normal;\n    font-weight: normal;\n    letter-spacing: normal;\n    pointer-events: none;\n    overflow: auto;\n    max-width: min(60em, 66vw);\n    overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n    white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n    background-color: #636363;\n    color: #fff;\n}\n\n.ace_tooltip:focus {\n    outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n    display: inline-block;\n    width: 18px;\n    vertical-align: top;\n}\n\n.ace_icon_svg {\n    display: inline-block;\n    width: 12px;\n    vertical-align: top;\n    -webkit-mask-repeat: no-repeat;\n    -webkit-mask-size: 12px;\n    -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n    padding-right: 13px;\n}\n\n.ace_fold-widget {\n    box-sizing: border-box;\n\n    margin: 0 -12px 0 1px;\n    display: none;\n    width: 11px;\n    vertical-align: top;\n\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n    background-repeat: no-repeat;\n    background-position: center;\n\n    border-radius: 3px;\n    \n    border: 1px solid transparent;\n    cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n    display: inline-block;   \n}\n\n.ace_fold-widget.ace_end {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n    border: 1px solid rgba(0, 0, 0, 0.3);\n    background-color: rgba(255, 255, 255, 0.2);\n    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n    border: 1px solid rgba(0, 0, 0, 0.4);\n    background-color: rgba(0, 0, 0, 0.05);\n    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n    background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n    border: 1px solid lightgray;\n    display: inline-block;\n    margin: -1px 8px;\n    padding: 0 5px;\n    pointer-events: auto;\n    cursor: pointer;\n}\n.ace_inline_button:hover {\n    border-color: gray;\n    background: rgba(200,200,200,0.2);\n    display: inline-block;\n    pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n    background-color: #FFB4B4;\n    border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n    transition: opacity 0.4s ease 0.05s;\n    opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n    transition: opacity 0.05s ease 0.05s;\n    opacity:1;\n}\n\n.ace_underline {\n    text-decoration: underline;\n}\n\n.ace_bold {\n    font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n    font-weight: normal;\n}\n\n.ace_italic {\n    font-style: italic;\n}\n\n\n.ace_error-marker {\n    background-color: rgba(255, 0, 0,0.2);\n    position: absolute;\n    z-index: 9;\n}\n\n.ace_highlight-marker {\n    background-color: rgba(255, 255, 0,0.2);\n    position: absolute;\n    z-index: 8;\n}\n\n.ace_mobile-menu {\n    position: absolute;\n    line-height: 1.5;\n    border-radius: 4px;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    background: white;\n    box-shadow: 1px 3px 2px grey;\n    border: 1px solid #dcdcdc;\n    color: black;\n}\n.ace_dark > .ace_mobile-menu {\n    background: #333;\n    color: #ccc;\n    box-shadow: 1px 3px 2px grey;\n    border: 1px solid #444;\n\n}\n.ace_mobile-button {\n    padding: 2px;\n    cursor: pointer;\n    overflow: hidden;\n}\n.ace_mobile-button:hover {\n    background-color: #eee;\n    opacity:1;\n}\n.ace_mobile-button:active {\n    background-color: #ddd;\n}\n\n.ace_placeholder {\n    position: relative;\n    font-family: arial;\n    transform: scale(0.9);\n    transform-origin: left;\n    white-space: pre;\n    opacity: 0.7;\n    margin: 0 10px;\n    z-index: 1;\n}\n\n.ace_ghost_text {\n    opacity: 0.5;\n    font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n    white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n    content: "↩";\n    position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n    margin: 0px 4px\n}\n\n.ace_screenreader-only {\n    position:absolute;\n    left:-10000px;\n    top:auto;\n    width:1px;\n    height:1px;\n    overflow:hidden;\n}\n\n.ace_hidden_token {\n    display: none;\n}'});ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=e("../lib/oop");var o=e("../lib/event_emitter").EventEmitter;var s=function(){function e(e,t){this.canvas=n.createElement("canvas");this.renderer=t;this.pixelRatio=1;this.maxHeight=t.layerConfig.maxHeight;this.lineHeight=t.layerConfig.lineHeight;this.canvasHeight=e.parent.scrollHeight;this.heightRatio=this.canvasHeight/this.maxHeight;this.canvasWidth=e.width;this.minDecorationHeight=2*this.pixelRatio|0;this.halfMinDecorationHeight=this.minDecorationHeight/2|0;this.canvas.width=this.canvasWidth;this.canvas.height=this.canvasHeight;this.canvas.style.top=0+"px";this.canvas.style.right=0+"px";this.canvas.style.zIndex=7+"px";this.canvas.style.position="absolute";this.colors={};this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"};this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"};e.element.appendChild(this.canvas)}e.prototype.$updateDecorators=function(e){var t=this.renderer.theme.isDark===true?this.colors.dark:this.colors.light;if(e){this.maxHeight=e.maxHeight;this.lineHeight=e.lineHeight;this.canvasHeight=e.height;var i=(e.lastRow+1)*this.lineHeight;if(i<this.canvasHeight){this.heightRatio=1}else{this.heightRatio=this.canvasHeight/this.maxHeight}}var n=this.canvas.getContext("2d");function r(e,t){if(e.priority<t.priority)return-1;if(e.priority>t.priority)return 1;return 0}var o=this.renderer.session.$annotations;n.clearRect(0,0,this.canvas.width,this.canvas.height);if(o){var s={info:1,warning:2,error:3};o.forEach(function(e){e.priority=s[e.type]||null});o=o.sort(r);var a=this.renderer.session.$foldData;for(var l=0;l<o.length;l++){var c=o[l].row;var h=this.compensateFoldRows(c,a);var u=Math.round((c-h)*this.lineHeight*this.heightRatio);var d=Math.round((c-h)*this.lineHeight*this.heightRatio);var f=Math.round(((c-h)*this.lineHeight+this.lineHeight)*this.heightRatio);var g=f-d;if(g<this.minDecorationHeight){var p=(d+f)/2|0;if(p<this.halfMinDecorationHeight){p=this.halfMinDecorationHeight}else if(p+this.halfMinDecorationHeight>this.canvasHeight){p=this.canvasHeight-this.halfMinDecorationHeight}d=Math.round(p-this.halfMinDecorationHeight);f=Math.round(p+this.halfMinDecorationHeight)}n.fillStyle=t[o[l].type]||null;n.fillRect(0,u,this.canvasWidth,f-d)}}var m=this.renderer.session.selection.getCursor();if(m){var h=this.compensateFoldRows(m.row,a);var u=Math.round((m.row-h)*this.lineHeight*this.heightRatio);n.fillStyle="rgba(0, 0, 0, 0.5)";n.fillRect(0,u,this.canvasWidth,2)}};e.prototype.compensateFoldRows=function(e,t){var i=0;if(t&&t.length>0){for(var n=0;n<t.length;n++){if(e>t[n].start.row&&e<t[n].end.row){i+=e-t[n].start.row}else if(e>=t[n].end.row){i+=t[n].end.row-t[n].start.row}}}return i};return e}();r.implement(s.prototype,o);t.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(e,t,i){"use strict";var n=e("./lib/oop");var r=e("./lib/dom");var o=e("./lib/lang");var s=e("./config");var a=e("./layer/gutter").Gutter;var l=e("./layer/marker").Marker;var c=e("./layer/text").Text;var h=e("./layer/cursor").Cursor;var u=e("./scrollbar").HScrollBar;var d=e("./scrollbar").VScrollBar;var f=e("./scrollbar_custom").HScrollBar;var g=e("./scrollbar_custom").VScrollBar;var p=e("./renderloop").RenderLoop;var m=e("./layer/font_metrics").FontMetrics;var v=e("./lib/event_emitter").EventEmitter;var y=e("./css/editor-css");var w=e("./layer/decorators").Decorator;var b=e("./lib/useragent");var $=e("./layer/text_util").isTextToken;r.importCssString(y,"ace_editor.css",false);var C=function(){function e(e,t){var i=this;this.container=e||r.createElement("div");r.addCssClass(this.container,"ace_editor");if(r.HI_DPI)r.addCssClass(this.container,"ace_hidpi");this.setTheme(t);if(s.get("useStrictCSP")==null)s.set("useStrictCSP",false);this.$gutter=r.createElement("div");this.$gutter.className="ace_gutter";this.container.appendChild(this.$gutter);this.$gutter.setAttribute("aria-hidden","true");this.scroller=r.createElement("div");this.scroller.className="ace_scroller";this.container.appendChild(this.scroller);this.content=r.createElement("div");this.content.className="ace_content";this.scroller.appendChild(this.content);this.$gutterLayer=new a(this.$gutter);this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this));this.$markerBack=new l(this.content);var n=this.$textLayer=new c(this.content);this.canvas=n.element;this.$markerFront=new l(this.content);this.$cursorLayer=new h(this.content);this.$horizScroll=false;this.$vScroll=false;this.scrollBar=this.scrollBarV=new d(this.container,this);this.scrollBarH=new u(this.container,this);this.scrollBarV.on("scroll",function(e){if(!i.$scrollAnimation)i.session.setScrollTop(e.data-i.scrollMargin.top)});this.scrollBarH.on("scroll",function(e){if(!i.$scrollAnimation)i.session.setScrollLeft(e.data-i.scrollMargin.left)});this.scrollTop=0;this.scrollLeft=0;this.cursorPos={row:0,column:0};this.$fontMetrics=new m(this.container);this.$textLayer.$setFontMetrics(this.$fontMetrics);this.$textLayer.on("changeCharacterSize",function(e){i.updateCharacterSize();i.onResize(true,i.gutterWidth,i.$size.width,i.$size.height);i._signal("changeCharacterSize",e)});this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:true};this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1};this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0};this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0};this.$keepTextAreaAtCursor=!b.isIOS;this.$loop=new p(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)}e.prototype.updateCharacterSize=function(){if(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();r.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")};e.prototype.setSession=function(e){if(this.session)this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode);this.session=e;if(e&&this.scrollMargin.top&&e.getScrollTop()<=0)e.setScrollTop(-this.scrollMargin.top);this.$cursorLayer.setSession(e);this.$markerBack.setSession(e);this.$markerFront.setSession(e);this.$gutterLayer.setSession(e);this.$textLayer.setSession(e);if(!e)return;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)};e.prototype.updateLines=function(e,t,i){if(t===undefined)t=Infinity;if(!this.$changedLines){this.$changedLines={firstRow:e,lastRow:t}}else{if(this.$changedLines.firstRow>e)this.$changedLines.firstRow=e;if(this.$changedLines.lastRow<t)this.$changedLines.lastRow=t}if(this.$changedLines.lastRow<this.layerConfig.firstRow){if(i)this.$changedLines.lastRow=this.layerConfig.lastRow;else return}if(this.$changedLines.firstRow>this.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)};e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT);this.$textLayer.$updateEolChar();this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)};e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER);this.$textLayer.onChangeTabSize()};e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)};e.prototype.updateFull=function(e){if(e)this.$renderChanges(this.CHANGE_FULL,true);else this.$loop.schedule(this.CHANGE_FULL)};e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()};e.prototype.$updateSizeAsync=function(){if(this.$loop.pending)this.$size.$dirty=true;else this.onResize()};e.prototype.onResize=function(e,t,i,n){if(this.resizing>2)return;else if(this.resizing>0)this.resizing++;else this.resizing=e?1:0;var r=this.container;if(!n)n=r.clientHeight||r.scrollHeight;if(!n&&this.$maxLines&&this.lineHeight>1){if(!r.style.height||r.style.height=="0px"){r.style.height="1px";n=r.clientHeight||r.scrollHeight}}if(!i)i=r.clientWidth||r.scrollWidth;var o=this.$updateCachedSize(e,t,i,n);if(this.$resizeTimer)this.$resizeTimer.cancel();if(!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;if(e)this.$gutterLayer.$padding=null;if(e)this.$renderChanges(o|this.$changes,true);else this.$loop.schedule(o|this.$changes);if(this.resizing)this.resizing=0;this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null;if(this.$customScrollbar){this.$updateCustomScrollbar(true)}};e.prototype.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var o=0;var s=this.$size;var a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(n&&(e||s.height!=n)){s.height=n;o|=this.CHANGE_SIZE;s.scrollerHeight=s.height;if(this.$horizScroll)s.scrollerHeight-=this.scrollBarH.getHeight();this.scrollBarV.setHeight(s.scrollerHeight);this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px";o=o|this.CHANGE_SCROLL}if(i&&(e||s.width!=i)){o|=this.CHANGE_SIZE;s.width=i;if(t==null)t=this.$showGutter?this.$gutter.offsetWidth:0;this.gutterWidth=t;r.setStyle(this.scrollBarH.element.style,"left",t+"px");r.setStyle(this.scroller.style,"left",t+this.margin.left+"px");s.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h);r.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";r.setStyle(this.scrollBarH.element.style,"right",l);r.setStyle(this.scroller.style,"right",l);r.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight());this.scrollBarH.setWidth(s.scrollerWidth);if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e){o|=this.CHANGE_FULL}}s.$dirty=!i||!n;if(o)this._signal("resize",a);return o};e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;if(t!=this.gutterWidth)this.$changes|=this.$updateCachedSize(true,t,this.$size.width,this.$size.height);if(this.session.getUseWrapMode()&&this.adjustWrapLimit()){this.$loop.schedule(this.CHANGE_FULL)}else if(this.$size.$dirty){this.$loop.schedule(this.CHANGE_FULL)}else{this.$computeLayerConfig()}};e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2;var t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)};e.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)};e.prototype.getAnimatedScroll=function(){return this.$animatedScroll};e.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e);this.session.$bidiHandler.setShowInvisibles(e)};e.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")};e.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")};e.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)};e.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")};e.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)};e.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)};e.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")};e.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)};e.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")};e.prototype.getShowGutter=function(){return this.getOption("showGutter")};e.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)};e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")};e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)};e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)};e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")};e.prototype.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=r.createElement("div");e.className="ace_layer ace_print-margin-layer";this.$printMarginEl=r.createElement("div");this.$printMarginEl.className="ace_print-margin";e.appendChild(this.$printMarginEl);this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px";t.visibility=this.$showPrintMargin?"visible":"hidden";if(this.session&&this.session.$wrap==-1)this.adjustWrapLimit()};e.prototype.getContainerElement=function(){return this.container};e.prototype.getMouseEventTarget=function(){return this.scroller};e.prototype.getTextAreaContainer=function(){return this.container};e.prototype.$moveTextAreaToCursor=function(){if(this.$isMousePressed)return;var e=this.textarea.style;var t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){r.translate(this.textarea,-100,0);return}var i=this.$cursorLayer.$pixelPos;if(!i)return;if(t&&t.markerRange)i=this.$cursorLayer.getPixelPosition(t.markerRange.start,true);var n=this.layerConfig;var o=i.top;var s=i.left;o-=n.offset;var a=t&&t.useTextareaForIME||b.isMobile?this.lineHeight:1;if(o<0||o>n.height-a){r.translate(this.textarea,0,0);return}var l=1;var c=this.$size.height-a;if(!t){o+=this.lineHeight}else{if(t.useTextareaForIME){var h=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(h)[0]}else{o+=this.lineHeight+2}}s-=this.scrollLeft;if(s>this.$size.scrollerWidth-l)s=this.$size.scrollerWidth-l;s+=this.gutterWidth+this.margin.left;r.setStyle(e,"height",a+"px");r.setStyle(e,"width",l+"px");r.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-l),Math.min(o,c))};e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow};e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)};e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig;var t=e.lastRow;var i=this.session.documentToScreenRow(t,0)*e.lineHeight;if(i-this.session.getScrollTop()>e.height-e.lineHeight)return t-1;return t};e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow};e.prototype.setPadding=function(e){this.$padding=e;this.$textLayer.setPadding(e);this.$cursorLayer.setPadding(e);this.$markerFront.setPadding(e);this.$markerBack.setPadding(e);this.$loop.schedule(this.CHANGE_FULL);this.$updatePrintMargin()};e.prototype.setScrollMargin=function(e,t,i,n){var r=this.scrollMargin;r.top=e|0;r.bottom=t|0;r.right=n|0;r.left=i|0;r.v=r.top+r.bottom;r.h=r.left+r.right;if(r.top&&this.scrollTop<=0&&this.session)this.session.setScrollTop(-r.top);this.updateFull()};e.prototype.setMargin=function(e,t,i,n){var r=this.margin;r.top=e|0;r.bottom=t|0;r.right=n|0;r.left=i|0;r.v=r.top+r.bottom;r.h=r.left+r.right;this.$updateCachedSize(true,this.gutterWidth,this.$size.width,this.$size.height);this.updateFull()};e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible};e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)};e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible};e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)};e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight;var t=this.$size.scrollerHeight;if(!this.$maxLines&&this.$scrollPastEnd){e-=(t-this.lineHeight)*this.$scrollPastEnd;if(this.scrollTop>e-t){e=this.scrollTop+t;this.scrollBarV.scrollTop=null}}this.scrollBarV.setScrollHeight(e+this.scrollMargin.v);this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)};e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h);this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)};e.prototype.freeze=function(){this.$frozen=true};e.prototype.unfreeze=function(){this.$frozen=false};e.prototype.$renderChanges=function(e,t){if(this.$changes){e|=this.$changes;this.$changes=0}if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty){this.$changes|=e;return this.onResize(true)}if(!this.lineHeight){this.$textLayer.checkForSizeChanges()}this._signal("beforeRender",e);if(this.session&&this.session.$bidiHandler)this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig()|this.$loop.clear();if(i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;if(n>0){this.scrollTop=n;e=e|this.CHANGE_SCROLL;e|=this.$computeLayerConfig()|this.$loop.clear()}}i=this.layerConfig;this.$updateScrollBarV();if(e&this.CHANGE_H_SCROLL)this.$updateScrollBarH();r.translate(this.content,-this.scrollLeft,-i.offset);var o=i.width+2*this.$padding+"px";var s=i.minHeight+"px";r.setStyle(this.content.style,"width",o);r.setStyle(this.content.style,"height",s)}if(e&this.CHANGE_H_SCROLL){r.translate(this.content,-this.scrollLeft,-i.offset);this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ";if(this.enableKeyboardAccessibility)this.scroller.className+=this.keyboardFocusClassName}if(e&this.CHANGE_FULL){this.$changedLines=null;this.$textLayer.update(i);if(this.$showGutter)this.$gutterLayer.update(i);if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}this.$markerBack.update(i);this.$markerFront.update(i);this.$cursorLayer.update(i);this.$moveTextAreaToCursor();this._signal("afterRender",e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null;if(e&this.CHANGE_TEXT||e&this.CHANGE_LINES)this.$textLayer.update(i);else this.$textLayer.scrollLines(i);if(this.$showGutter){if(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES)this.$gutterLayer.update(i);else this.$gutterLayer.scrollLines(i)}if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}this.$markerBack.update(i);this.$markerFront.update(i);this.$cursorLayer.update(i);this.$moveTextAreaToCursor();this._signal("afterRender",e);return}if(e&this.CHANGE_TEXT){this.$changedLines=null;this.$textLayer.update(i);if(this.$showGutter)this.$gutterLayer.update(i);if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}}else if(e&this.CHANGE_LINES){if(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)this.$gutterLayer.update(i);if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}}else if(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER){if(this.$showGutter)this.$gutterLayer.update(i);if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}}else if(e&this.CHANGE_CURSOR){if(this.$highlightGutterLine)this.$gutterLayer.updateLineHighlight(i);if(this.$customScrollbar){this.$scrollDecorator.$updateDecorators(i)}}if(e&this.CHANGE_CURSOR){this.$cursorLayer.update(i);this.$moveTextAreaToCursor()}if(e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)){this.$markerFront.update(i)}if(e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)){this.$markerBack.update(i)}this._signal("afterRender",e)};e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight;var t=this.$maxLines*this.lineHeight;var i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);if(this.$horizScroll)i+=this.scrollBarH.getHeight();if(this.$maxPixelHeight&&i>this.$maxPixelHeight)i=this.$maxPixelHeight;var n=i<=2*this.lineHeight;var r=!n&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){if(r!=this.$vScroll){this.$vScroll=r;this.scrollBarV.setVisible(r)}var o=this.container.clientWidth;this.container.style.height=i+"px";this.$updateCachedSize(true,this.$gutterWidth,o,i);this.desiredHeight=i;this._signal("autosize")}};e.prototype.$computeLayerConfig=function(){var e=this.session;var t=this.$size;var i=t.height<=2*this.lineHeight;var n=this.session.getScreenLength();var r=n*this.lineHeight;var o=this.$getLongestLine();var s=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0);var a=this.$horizScroll!==s;if(a){this.$horizScroll=s;this.scrollBarH.setVisible(s)}var l=this.$vScroll;if(this.$maxLines&&this.lineHeight>1)this.$autosize();var c=t.scrollerHeight+this.lineHeight;var h=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=h;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,r-t.scrollerHeight+u.bottom)));this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+u.right)));var d=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+h<0||this.scrollTop>u.top);var f=l!==d;if(f){this.$vScroll=d;this.scrollBarV.setVisible(d)}var g=this.scrollTop%this.lineHeight;var p=Math.ceil(c/this.lineHeight)-1;var m=Math.max(0,Math.round((this.scrollTop-g)/this.lineHeight));var v=m+p;var y,w;var b=this.lineHeight;m=e.screenToDocumentRow(m,0);var $=e.getFoldLine(m);if($){m=$.start.row}y=e.documentToScreenRow(m,0);w=e.getRowLength(m)*b;v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1);c=t.scrollerHeight+e.getRowLength(v)*b+w;g=this.scrollTop-y*b;var C=0;if(this.layerConfig.width!=o||a)C=this.CHANGE_H_SCROLL;if(a||f){C|=this.$updateCachedSize(true,this.gutterWidth,t.width,t.height);this._signal("scrollbarVisibilityChanged");if(f)o=this.$getLongestLine()}this.layerConfig={width:o,padding:this.$padding,firstRow:m,firstRowScreen:y,lastRow:v,lineHeight:b,characterWidth:this.characterWidth,minHeight:c,maxHeight:r,offset:g,gutterOffset:b?Math.max(0,Math.ceil((g+t.height-t.scrollerHeight)/b)):0,height:this.$size.scrollerHeight};if(this.session.$bidiHandler)this.session.$bidiHandler.setContentWidth(o-this.$padding);return C};e.prototype.$updateLines=function(){if(!this.$changedLines)return;var e=this.$changedLines.firstRow;var t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(e>i.lastRow+1){return}if(t<i.firstRow){return}if(t===Infinity){if(this.$showGutter)this.$gutterLayer.update(i);this.$textLayer.update(i);return}this.$textLayer.updateLines(i,e,t);return true};e.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();if(this.showInvisibles&&!this.session.$useWrapMode)e+=1;if(this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH)e=this.$textLayer.MAX_LINE_LENGTH+30;return Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))};e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(true));this.$loop.schedule(this.CHANGE_MARKER_FRONT)};e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers());this.$loop.schedule(this.CHANGE_MARKER_BACK)};e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)};e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)};e.prototype.updateBreakpoints=function(e){this._rows=e;this.$loop.schedule(this.CHANGE_GUTTER)};e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e);this.$loop.schedule(this.CHANGE_GUTTER)};e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)};e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()};e.prototype.showCursor=function(){this.$cursorLayer.showCursor()};e.prototype.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i);this.scrollCursorIntoView(t,i)};e.prototype.scrollCursorIntoView=function(e,t,i){if(this.$size.scrollerHeight===0)return;var n=this.$cursorLayer.getPixelPosition(e);var r=n.left;var o=n.top;var s=i&&i.top||0;var a=i&&i.bottom||0;if(this.$scrollAnimation){this.$stopAnimation=true}var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;if(l+s>o){if(t&&l+s>o+this.lineHeight)o-=t*this.$size.scrollerHeight;if(o===0)o=-this.scrollMargin.top;this.session.setScrollTop(o)}else if(l+this.$size.scrollerHeight-a<o+this.lineHeight){if(t&&l+this.$size.scrollerHeight-a<o-this.lineHeight)o+=t*this.$size.scrollerHeight;this.session.setScrollTop(o+this.lineHeight+a-this.$size.scrollerHeight)}var c=this.scrollLeft;var h=2*this.layerConfig.characterWidth;if(r-h<c){r-=h;if(r<this.$padding+h){r=-this.scrollMargin.left}this.session.setScrollLeft(r)}else{r+=h;if(c+this.$size.scrollerWidth<r+this.characterWidth){this.session.setScrollLeft(Math.round(r+this.characterWidth-this.$size.scrollerWidth))}else if(c<=this.$padding&&r-c<this.characterWidth){this.session.setScrollLeft(0)}}};e.prototype.getScrollTop=function(){return this.session.getScrollTop()};e.prototype.getScrollLeft=function(){return this.session.getScrollLeft()};e.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight};e.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)};e.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)};e.prototype.alignCursor=function(e,t){if(typeof e=="number")e={row:e,column:0};var i=this.$cursorLayer.getPixelPosition(e);var n=this.$size.scrollerHeight-this.lineHeight;var r=i.top-n*(t||0);this.session.setScrollTop(r);return r};e.prototype.$calcSteps=function(e,t){var i=0;var n=this.STEPS;var r=[];var o=function(e,t,i){return i*(Math.pow(e-1,3)+1)+t};for(i=0;i<n;++i)r.push(o(i/this.STEPS,e,t-e));return r};e.prototype.scrollToLine=function(e,t,i,n){var r=this.$cursorLayer.getPixelPosition({row:e,column:0});var o=r.top;if(t)o-=this.$size.scrollerHeight/2;var s=this.scrollTop;this.session.setScrollTop(o);if(i!==false)this.animateScrolling(s,n)};e.prototype.animateScrolling=function(e,t){var i=this.scrollTop;if(!this.$animatedScroll)return;var n=this;if(e==i)return;if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length){e=r[0];if(e==i)return}}var o=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:o};clearInterval(this.$timer);n.session.setScrollTop(o.shift());n.session.$scrollTop=i;function s(){n.$timer=clearInterval(n.$timer);n.$scrollAnimation=null;n.$stopAnimation=false;t&&t()}this.$timer=setInterval(function(){if(n.$stopAnimation){s();return}if(!n.session)return clearInterval(n.$timer);if(o.length){n.session.setScrollTop(o.shift());n.session.$scrollTop=i}else if(i!=null){n.session.$scrollTop=-1;n.session.setScrollTop(i);i=null}else{s()}},10)};e.prototype.scrollToY=function(e){if(this.scrollTop!==e){this.$loop.schedule(this.CHANGE_SCROLL);this.scrollTop=e}};e.prototype.scrollToX=function(e){if(this.scrollLeft!==e)this.scrollLeft=e;this.$loop.schedule(this.CHANGE_H_SCROLL)};e.prototype.scrollTo=function(e,t){this.session.setScrollTop(t);this.session.setScrollLeft(e)};e.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t);e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)};e.prototype.isScrollableBy=function(e,t){if(t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top)return true;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return true;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return true;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return true};e.prototype.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left;t=n[0]}else{i=this.scroller.getBoundingClientRect()}var r=e+this.scrollLeft-i.left-this.$padding;var o=r/this.characterWidth;var s=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);var a=this.$blockCursor?Math.floor(o):Math.round(o);return{row:s,column:a,side:o-a>0?1:-1,offsetX:r}};e.prototype.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left;t=n[0]}else{i=this.scroller.getBoundingClientRect()}var r=e+this.scrollLeft-i.left-this.$padding;var o=r/this.characterWidth;var s=this.$blockCursor?Math.floor(o):Math.round(o);var a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(s,0),r)};e.prototype.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect();var n=this.session.documentToScreenPosition(e,t);var r=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth));var o=n.row*this.lineHeight;return{pageX:i.left+r-this.scrollLeft,pageY:i.top+o-this.scrollTop}};e.prototype.visualizeFocus=function(){r.addCssClass(this.container,"ace_focus")};e.prototype.visualizeBlur=function(){r.removeCssClass(this.container,"ace_focus")};e.prototype.showComposition=function(e){this.$composition=e;if(!e.cssText){e.cssText=this.textarea.style.cssText}if(e.useTextareaForIME==undefined)e.useTextareaForIME=this.$useTextareaForIME;if(this.$useTextareaForIME){r.addCssClass(this.textarea,"ace_composition");this.textarea.style.cssText="";this.$moveTextAreaToCursor();this.$cursorLayer.element.style.display="none"}else{e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")}};e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column);this.$moveTextAreaToCursor()};e.prototype.hideComposition=function(){if(!this.$composition)return;if(this.$composition.markerId)this.session.removeMarker(this.$composition.markerId);r.removeCssClass(this.textarea,"ace_composition");this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column);this.$composition=null;this.$cursorLayer.element.style.display=""};e.prototype.setGhostText=function(e,t){var i=this.session.selection.cursor;var n=t||{row:i.row,column:i.column};this.removeGhostText();var o=this.$calculateWrappedTextChunks(e,n);this.addToken(o[0].text,"ghost_text",n.row,n.column);this.$ghostText={text:e,position:{row:n.row,column:n.column}};var s=r.createElement("div");if(o.length>1){var a=this.hideTokensAfterPosition(n.row,n.column);var l;o.slice(1).forEach(function(e){var t=r.createElement("div");var i=r.createElement("span");i.className="ace_ghost_text";if(e.wrapped)t.className="ghost_text_line_wrapped";if(e.text.length===0)e.text=" ";i.appendChild(r.createTextNode(e.text));t.appendChild(i);s.appendChild(t);l=t});a.forEach(function(e){var t=r.createElement("span");if(!$(e.type))t.className="ace_"+e.type.replace(/\./g," ace_");t.appendChild(r.createTextNode(e.value));l.appendChild(t)});this.$ghostTextWidget={el:s,row:n.row,column:n.column,className:"ace_ghost_text_container"};this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var c=this.$cursorLayer.getPixelPosition(n,true);var h=this.container;var u=h.getBoundingClientRect().height;var d=o.length*this.lineHeight;var f=d<u-c.top;if(f)return;if(d<u){this.scrollBy(0,(o.length-1)*this.lineHeight)}else{this.scrollToRow(n.row)}}};e.prototype.$calculateWrappedTextChunks=function(e,t){var i=this.$size.scrollerWidth-this.$padding*2;var n=Math.floor(i/this.characterWidth)-2;n=n<=0?60:n;var r=e.split(/\r?\n/);var o=[];for(var s=0;s<r.length;s++){var a=this.session.$getDisplayTokens(r[s],t.column);var l=this.session.$computeWrapSplits(a,n,this.session.$tabSize);if(l.length>0){var c=0;l.push(r[s].length);for(var h=0;h<l.length;h++){var u=r[s].slice(c,l[h]);o.push({text:u,wrapped:true});c=l[h]}}else{o.push({text:r[s],wrapped:false})}}return o};e.prototype.removeGhostText=function(){if(!this.$ghostText)return;var e=this.$ghostText.position;this.removeExtraToken(e.row,e.column);if(this.$ghostTextWidget){this.session.widgetManager.removeLineWidget(this.$ghostTextWidget);this.$ghostTextWidget=null}this.$ghostText=null};e.prototype.addToken=function(e,t,i,n){var r=this.session;r.bgTokenizer.lines[i]=null;var o={type:t,value:e};var s=r.getTokens(i);if(n==null||!s.length){s.push(o)}else{var a=0;for(var l=0;l<s.length;l++){var c=s[l];a+=c.value.length;if(n<=a){var h=c.value.length-(a-n);var u=c.value.slice(0,h);var d=c.value.slice(h);s.splice(l,1,{type:c.type,value:u},o,{type:c.type,value:d});break}}}this.updateLines(i,i)};e.prototype.hideTokensAfterPosition=function(e,t){var i=this.session.getTokens(e);var n=0;var r=false;var o=[];for(var s=0;s<i.length;s++){var a=i[s];n+=a.value.length;if(a.type==="ghost_text")continue;if(r){o.push({type:a.type,value:a.value});a.type="hidden_token";continue}if(n===t){r=true}}this.updateLines(e,e);return o};e.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null;this.updateLines(e,e)};e.prototype.setTheme=function(e,t){var i=this;this.$themeId=e;i._dispatchEvent("themeChange",{theme:e});if(!e||typeof e=="string"){var n=e||this.$options.theme.initialValue;s.loadModule(["theme",n],o)}else{o(e)}function o(n){if(i.$themeId!=e)return t&&t();if(!n||!n.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");if(n.$id)i.$themeId=n.$id;r.importCssString(n.cssText,n.cssClass,i.container);if(i.theme)r.removeCssClass(i.container,i.theme.cssClass);var o="padding"in n?n.padding:"padding"in(i.theme||{})?4:i.$padding;if(i.$padding&&o!=i.$padding)i.setPadding(o);i.$theme=n.cssClass;i.theme=n;r.addCssClass(i.container,n.cssClass);r.setCssClass(i.container,"ace_dark",n.isDark);if(i.$size){i.$size.width=0;i.$updateSizeAsync()}i._dispatchEvent("themeLoaded",{theme:n});t&&t();if(b.isSafari&&i.scroller){i.scroller.style.background="red";i.scroller.style.background=""}}};e.prototype.getTheme=function(){return this.$themeId};e.prototype.setStyle=function(e,t){r.setCssClass(this.container,e,t!==false)};e.prototype.unsetStyle=function(e){r.removeCssClass(this.container,e)};e.prototype.setCursorStyle=function(e){r.setStyle(this.scroller.style,"cursor",e)};e.prototype.setMouseCursor=function(e){r.setStyle(this.scroller.style,"cursor",e)};e.prototype.attachToShadowRoot=function(){r.importCssString(y,"ace_editor.css",this.container)};e.prototype.destroy=function(){this.freeze();this.$fontMetrics.destroy();this.$cursorLayer.destroy();this.removeAllListeners();this.container.textContent="";this.setOption("useResizeObserver",false)};e.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null;this.scrollBarV.element.remove();this.scrollBarH.element.remove();if(this.$scrollDecorator){delete this.$scrollDecorator}if(e===true){this.scrollBarV=new g(this.container,this);this.scrollBarH=new f(this.container,this);this.scrollBarV.setHeight(this.$size.scrollerHeight);this.scrollBarH.setWidth(this.$size.scrollerWidth);this.scrollBarV.addEventListener("scroll",function(e){if(!t.$scrollAnimation)t.session.setScrollTop(e.data-t.scrollMargin.top)});this.scrollBarH.addEventListener("scroll",function(e){if(!t.$scrollAnimation)t.session.setScrollLeft(e.data-t.scrollMargin.left)});this.$scrollDecorator=new w(this.scrollBarV,this);this.$scrollDecorator.$updateDecorators()}else{this.scrollBarV=new d(this.container,this);this.scrollBarH=new u(this.container,this);this.scrollBarV.addEventListener("scroll",function(e){if(!t.$scrollAnimation)t.session.setScrollTop(e.data-t.scrollMargin.top)});this.scrollBarH.addEventListener("scroll",function(e){if(!t.$scrollAnimation)t.session.setScrollLeft(e.data-t.scrollMargin.left)})}};e.prototype.$addResizeObserver=function(){if(!window.ResizeObserver||this.$resizeObserver)return;var e=this;this.$resizeTimer=o.delayedCall(function(){if(!e.destroyed)e.onResize()},50);this.$resizeObserver=new window.ResizeObserver(function(t){var i=t[0].contentRect.width;var n=t[0].contentRect.height;if(Math.abs(e.$size.width-i)>1||Math.abs(e.$size.height-n)>1){e.$resizeTimer.delay()}else{e.$resizeTimer.cancel()}});this.$resizeObserver.observe(this.container)};return e}();C.prototype.CHANGE_CURSOR=1;C.prototype.CHANGE_MARKER=2;C.prototype.CHANGE_GUTTER=4;C.prototype.CHANGE_SCROLL=8;C.prototype.CHANGE_LINES=16;C.prototype.CHANGE_TEXT=32;C.prototype.CHANGE_SIZE=64;C.prototype.CHANGE_MARKER_BACK=128;C.prototype.CHANGE_MARKER_FRONT=256;C.prototype.CHANGE_FULL=512;C.prototype.CHANGE_H_SCROLL=1024;C.prototype.$changes=0;C.prototype.$padding=null;C.prototype.$frozen=false;C.prototype.STEPS=8;n.implement(C.prototype,v);s.defineOptions(C.prototype,"renderer",{useResizeObserver:{set:function(e){if(!e&&this.$resizeObserver){this.$resizeObserver.disconnect();this.$resizeTimer.cancel();this.$resizeTimer=this.$resizeObserver=null}else if(e&&!this.$resizeObserver){this.$addResizeObserver()}}},animatedScroll:{initialValue:false},showInvisibles:{set:function(e){if(this.$textLayer.setShowInvisibles(e))this.$loop.schedule(this.CHANGE_TEXT)},initialValue:false},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:true},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){if(typeof e=="number")this.$printMarginColumn=e;this.$showPrintMargin=!!e;this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none";this.$loop.schedule(this.CHANGE_FULL);this.onGutterResize()},initialValue:true},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:false},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:false},fadeFoldWidgets:{set:function(e){r.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:false},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e);this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:true},displayIndentGuides:{set:function(e){if(this.$textLayer.setDisplayIndentGuides(e))this.$loop.schedule(this.CHANGE_TEXT)},initialValue:true},highlightIndentGuides:{set:function(e){if(this.$textLayer.setHighlightIndentGuides(e)==true){this.$textLayer.$highlightIndentGuide()}else{this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)}},initialValue:true},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e);this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:true},hScrollBarAlwaysVisible:{set:function(e){if(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:false},vScrollBarAlwaysVisible:{set:function(e){if(!this.$vScrollBarAlwaysVisible||!this.$vScroll)this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:false},fontSize:{set:function(e){if(typeof e=="number")e=e+"px";this.container.style.fontSize=e;this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e;this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){if(!(this.$minLines<562949953421311))this.$minLines=0;this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0;if(this.$scrollPastEnd==e)return;this.$scrollPastEnd=e;this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:0,handlesSet:true},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e;this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:false},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:true},hasCssTransforms:{},useTextareaForIME:{initialValue:!b.isMobile&&!b.isIE}});t.VirtualRenderer=C});ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,i){"use strict";var n=e("../lib/oop");var r=e("../lib/net");var o=e("../lib/event_emitter").EventEmitter;var s=e("../config");function a(e){var t="importScripts('"+r.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;var n=new i;n.append(t);return n.getBlob("application/javascript")}}var l=0;function c(e){if(typeof Worker=="undefined")return{postMessage:function(){},terminate:function(){}};var t=document.getElementById("sap-ui-codeeditor-ace-worker-proxy");var i=true;if(!t){i=false;t=document.createElement("iframe");t.id="sap-ui-codeeditor-ace-worker-proxy";t.src=sap.ui.require.toUrl("sap/ui/codeeditor/aceWorkerProxy.html");t.hidden=true;t.sandbox="allow-scripts allow-same-origin";document.body.appendChild(t);t.onload=function(){i=true;r.forEach(function(e){e.workerProxy.postMessage(e.message)})}}var n=new URL(t.src).origin;var r=[];var o={postMessage:function(e){if(!i){r.push({workerProxy:this,message:e});return}var o={workerId:this._id,message:e};t.contentWindow.postMessage.call(t.contentWindow,o,n)},terminate:function(){this.postMessage({terminateWorker:true});window.removeEventListener("message",this._messageFromFrameListener)},set onmessage(e){this._messageCb=e},_id:l++,_listenForMessageFromFrame:function(){this._messageFromFrameListener=function(e){if(!t||e.origin!==n||e.source!==t.contentWindow||e.data.workerId!==this._id){return}this._messageCb.call(this._messageCb,e)}.bind(this);window.addEventListener("message",this._messageFromFrameListener)}};o.postMessage({createWorker:true,workerUrl:e});o._listenForMessageFromFrame();return o}var h=function(e){if(!e.postMessage)e=this.$createWorkerFromOldConfig.apply(this,arguments);this.$worker=e;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(){n.implement(this,o);this.$createWorkerFromOldConfig=function(t,i,n,r,o){if(e.nameToUrl&&!e.toUrl)e.toUrl=e.nameToUrl;if(s.get("packaged")||!e.toUrl){r=r||s.moduleUrl(i,"worker")}else{var a=this.$normalizePath;r=r||a(e.toUrl("ace/worker/worker.js",null,"_"));var l={};t.forEach(function(t){l[t]=a(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}this.$worker=c(r);if(o){this.send("importScripts",o)}this.$worker.postMessage({init:true,tlns:l,module:i,classname:n});return this.$worker};this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];if(i){i(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(e){window.console&&console.error&&console.error(e)};this.$normalizePath=function(e){return r.qualifyURL(e)};this.terminate=function(){this._signal("terminate",{});this.deltaQueue=null;this.$worker.terminate();this.$worker.onerror=function(e){e.preventDefault()};this.$worker=null;if(this.$doc)this.$doc.off("change",this.changeListener);this.$doc=null};this.send=function(e,t){this.$worker.postMessage({command:e,args:t})};this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i;t.push(n)}this.send(e,t)};this.emit=function(e,t){try{if(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:e,data:{data:t.data}})}catch(e){console.error(e.stack)}};this.attachToDocument=function(e){if(this.$doc)this.terminate();this.$doc=e;this.call("setValue",[e.getValue()]);e.on("change",this.changeListener,true)};this.changeListener=function(e){if(!this.deltaQueue){this.deltaQueue=[];setTimeout(this.$sendDeltaQueue,0)}if(e.action=="insert")this.deltaQueue.push(e.start,e.lines);else this.deltaQueue.push(e.start,e.end)};this.$sendDeltaQueue=function(){var e=this.deltaQueue;if(!e)return;this.deltaQueue=null;if(e.length>50&&e.length>this.$doc.getLength()>>1){this.call("setValue",[this.$doc.getValue()])}else this.emit("change",{data:e})}}).call(h.prototype);var u=function(e,t,i){var n=null;var r=false;var a=Object.create(o);var l=[];var c=new h({messageBuffer:l,terminate:function(){},postMessage:function(e){l.push(e);if(!n)return;if(r)setTimeout(u);else u()}});c.setEmitSync=function(e){r=e};var u=function(){var e=l.shift();if(e.command)n[e.command].apply(n,e.args);else if(e.event)a._signal(e.event,e.data)};a.postMessage=function(e){c.onMessage({data:e})};a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})};a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})};s.loadModule(["worker",t],function(e){n=new e[i](a);while(l.length)u()});return c};t.UIWorkerClient=u;t.WorkerClient=h;t.createWorker=c});ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,i){"use strict";var n=e("./range").Range;var r=e("./lib/event_emitter").EventEmitter;var o=e("./lib/oop");var s=function(){function e(e,t,i,n,r,o){var s=this;this.length=t;this.session=e;this.doc=e.getDocument();this.mainClass=r;this.othersClass=o;this.$onUpdate=this.onUpdate.bind(this);this.doc.on("change",this.$onUpdate,true);this.$others=n;this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})};this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager()["$undostack"]||{length:-1};this.$undoStackDepth=a.length;this.setup();e.selection.on("changeCursor",this.$onCursorChange)}e.prototype.setup=function(){var e=this;var t=this.doc;var i=this.session;this.selectionBefore=i.selection.toJSON();if(i.selection.inMultiSelectMode)i.selection.toSingleRange();this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var r=this.pos;r.$insertRight=true;r.detach();r.markerId=i.addMarker(new n(r.row,r.column,r.row,r.column+this.length),this.mainClass,null,false);this.others=[];this.$others.forEach(function(i){var n=t.createAnchor(i.row,i.column);n.$insertRight=true;n.detach();e.others.push(n)});i.setUndoSelect(false)};e.prototype.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session;var t=this;this.othersActive=true;this.others.forEach(function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,false)})};e.prototype.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=false;for(var e=0;e<this.others.length;e++){this.session.removeMarker(this.others[e].markerId)}};e.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row!==t.end.row)return;if(t.start.row!==this.pos.row)return;this.$updating=true;var i=e.action==="insert"?t.end.column-t.start.column:t.start.column-t.end.column;var r=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1;var o=t.start.column-this.pos.column;this.updateAnchors(e);if(r)this.length+=i;if(r&&!this.session.$fromUndo){if(e.action==="insert"){for(var s=this.others.length-1;s>=0;s--){var a=this.others[s];var l={row:a.row,column:a.column+o};this.doc.insertMergedLines(l,e.lines)}}else if(e.action==="remove"){for(var s=this.others.length-1;s>=0;s--){var a=this.others[s];var l={row:a.row,column:a.column+o};this.doc.remove(new n(l.row,l.column,l.row,l.column-i))}}}this.$updating=false;this.updateMarkers()};e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()};e.prototype.updateMarkers=function(){if(this.$updating)return;var e=this;var t=this.session;var i=function(i,r){t.removeMarker(i.markerId);i.markerId=t.addMarker(new n(i.row,i.column,i.row,i.column+e.length),r,null,false)};i(this.pos,this.mainClass);for(var r=this.others.length;r--;)i(this.others[r],this.othersClass)};e.prototype.onCursorChange=function(e){if(this.$updating||!this.session)return;var t=this.session.selection.getCursor();if(t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length){this.showOtherMarkers();this._emit("cursorEnter",e)}else{this.hideOtherMarkers();this._emit("cursorLeave",e)}};e.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(true);this.session=null};e.prototype.cancel=function(){if(this.$undoStackDepth===-1)return;var e=this.session.getUndoManager();var t=(e.$undoStack||e["$undostack"]).length-this.$undoStackDepth;for(var i=0;i<t;i++){e.undo(this.session,true)}if(this.selectionBefore)this.session.selection.fromJSON(this.selectionBefore)};return e}();o.implement(s.prototype,r);t.PlaceHolder=s});ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,i){var n=e("../lib/event");var r=e("../lib/useragent");function o(e,t){return e.row==t.row&&e.column==t.column}function s(e){var t=e.domEvent;var i=t.altKey;var s=t.shiftKey;var a=t.ctrlKey;var l=e.getAccelKey();var c=e.getButton();if(a&&r.isMac)c=t.button;if(e.editor.inMultiSelectMode&&c==2){e.editor.textInput.onContextMenu(e.domEvent);return}if(!a&&!i&&!l){if(c===0&&e.editor.inMultiSelectMode)e.editor.exitMultiSelectMode();return}if(c!==0)return;var h=e.editor;var u=h.selection;var d=h.inMultiSelectMode;var f=e.getDocumentPosition();var g=u.getCursor();var p=e.inSelection()||u.isEmpty()&&o(f,g);var m=e.x,v=e.y;var y=function(e){m=e.clientX;v=e.clientY};var w=h.session;var b=h.renderer.pixelToScreenCoordinates(m,v);var $=b;var C;if(h.$mouseHandler.$enableJumpToDef){if(a&&i||l&&i)C=s?"block":"add";else if(i&&h.$blockSelectEnabled)C="block"}else{if(l&&!i){C="add";if(!d&&s)return}else if(i&&h.$blockSelectEnabled){C="block"}}if(C&&r.isMac&&t.ctrlKey){h.$mouseHandler.cancelContextMenu()}if(C=="add"){if(!d&&p)return;if(!d){var S=u.toOrientedRange();h.addSelectionMarker(S)}var x=u.rangeList.rangeAtPoint(f);h.inVirtualSelectionMode=true;if(s){x=null;S=u.ranges[0]||S;h.removeSelectionMarker(S)}h.once("mouseup",function(){var e=u.toOrientedRange();if(x&&e.isEmpty()&&o(x.cursor,e.cursor))u.substractPoint(e.cursor);else{if(s){u.substractPoint(S.cursor)}else if(S){h.removeSelectionMarker(S);u.addRange(S)}u.addRange(e)}h.inVirtualSelectionMode=false})}else if(C=="block"){e.stop();h.inVirtualSelectionMode=true;var A;var M=[];var k=function(){var e=h.renderer.pixelToScreenCoordinates(m,v);var t=w.screenToDocumentPosition(e.row,e.column,e.offsetX);if(o($,e)&&o(t,u.lead))return;$=e;h.selection.moveToPosition(t);h.renderer.scrollCursorIntoView();h.removeSelectionMarkers(M);M=u.rectangularRangeBlock($,b);if(h.$mouseHandler.$clickSelection&&M.length==1&&M[0].isEmpty())M[0]=h.$mouseHandler.$clickSelection.clone();M.forEach(h.addSelectionMarker,h);h.updateSelectionMarkers()};if(d&&!l){u.toSingleRange()}else if(!d&&l){A=u.toOrientedRange();h.addSelectionMarker(A)}if(s)b=w.documentToScreenPosition(u.lead);else u.moveToPosition(f);$={row:-1,column:-1};var L=function(e){k();clearInterval(E);h.removeSelectionMarkers(M);if(!M.length)M=[u.toOrientedRange()];if(A){h.removeSelectionMarker(A);u.toSingleRange(A)}for(var t=0;t<M.length;t++)u.addRange(M[t]);h.inVirtualSelectionMode=false;h.$mouseHandler.$clickSelection=null};var T=k;n.capture(h.container,y,L);var E=setInterval(function(){T()},20);return e.preventDefault()}}t.onMouseDown=s});ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,true)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:true},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,true)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:true},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:true},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:true},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,true)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:true},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,true)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:true},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(e){if(e.multiSelect.rangeCount>1)e.multiSelect.joinSelections();else e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:true},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:true},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:true}];t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:true,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)});ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(e,t,i){var n=e("./range_list").RangeList;var r=e("./range").Range;var o=e("./selection").Selection;var s=e("./mouse/multi_select_handler").onMouseDown;var a=e("./lib/event");var l=e("./lib/lang");var c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=e("./search").Search;var u=new h;function d(e,t,i){u.$options.wrap=true;u.$options.needle=t;u.$options.backwards=i==-1;return u.find(e)}var f=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(f.prototype);(function(){this.ranges=null;this.rangeList=null;this.addRange=function(e,t){if(!e)return;if(!this.inMultiSelectMode&&this.rangeCount===0){var i=this.toOrientedRange();this.rangeList.add(i);this.rangeList.add(e);if(this.rangeList.ranges.length!=2){this.rangeList.removeAll();return t||this.fromOrientedRange(e)}this.rangeList.removeAll();this.rangeList.add(i);this.$onAddRange(i)}if(!e.cursor)e.cursor=e.end;var n=this.rangeList.add(e);this.$onAddRange(e);if(n.length)this.$onRemoveRange(n);if(this.rangeCount>1&&!this.inMultiSelectMode){this._signal("multiSelect");this.inMultiSelectMode=true;this.session.$undoSelect=false;this.rangeList.attach(this.session)}return t||this.fromOrientedRange(e)};this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();if(t.length)this.$onRemoveRange(t);e&&this.fromOrientedRange(e)};this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t){this.$onRemoveRange(t);return t[0]}};this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();if(e.length)this.$onRemoveRange(e)};this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length;this.ranges.unshift(e);this._signal("addRange",{range:e})};this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t);this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e});if(this.rangeCount===0&&this.inMultiSelectMode){this.inMultiSelectMode=false;this._signal("singleSelect");this.session.$undoSelect=true;this.rangeList.detach(this.session)}t=t||this.ranges[0];if(t&&!t.isEqual(this.getRange()))this.fromOrientedRange(t)};this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new n;this.ranges=[];this.rangeCount=0};this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]};this.splitIntoLines=function(){var e=this.ranges.length?this.ranges:[this.getRange()];var t=[];for(var i=0;i<e.length;i++){var n=e[i];var o=n.start.row;var s=n.end.row;if(o===s){t.push(n.clone())}else{t.push(new r(o,n.start.column,o,this.session.getLine(o).length));while(++o<s)t.push(this.getLineRange(o,true));t.push(new r(s,0,s,n.end.column))}if(i==0&&!this.isBackwards())t=t.reverse()}this.toSingleRange();for(var i=t.length;i--;)this.addRange(t[i])};this.joinSelections=function(){var e=this.rangeList.ranges;var t=e[e.length-1];var i=r.fromPoints(e[0].start,t.end);this.toSingleRange();this.setSelectionRange(i,t.cursor==t.start)};this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges;var t=e[e.length-1];var i=r.fromPoints(e[0].start,t.end);this.toSingleRange();this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor);var o=this.session.documentToScreenPosition(this.anchor);var s=this.rectangularRangeBlock(n,o);s.forEach(this.addRange,this)}};this.rectangularRangeBlock=function(e,t,i){var n=[];var o=e.column<t.column;if(o){var s=e.column;var a=t.column;var l=e.offsetX;var c=t.offsetX}else{var s=t.column;var a=e.column;var l=t.offsetX;var c=e.offsetX}var h=e.row<t.row;if(h){var u=e.row;var d=t.row}else{var u=t.row;var d=e.row}if(s<0)s=0;if(u<0)u=0;if(u==d)i=true;var f;for(var g=u;g<=d;g++){var m=r.fromPoints(this.session.screenToDocumentPosition(g,s,l),this.session.screenToDocumentPosition(g,a,c));if(m.isEmpty()){if(f&&p(m.end,f))break;f=m.end}m.cursor=o?m.start:m.end;n.push(m)}if(h)n.reverse();if(!i){var v=n.length-1;while(n[v].isEmpty()&&v>0)v--;if(v>0){var y=0;while(n[y].isEmpty())y++}for(var w=v;w>=y;w--){if(n[w].isEmpty())n.splice(w,1)}}return n}}).call(o.prototype);var g=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.addSelectionMarker=function(e){if(!e.cursor)e.cursor=e.end;var t=this.getSelectionStyle();e.marker=this.session.addMarker(e,"ace_selection",t);this.session.$selectionMarkers.push(e);this.session.selectionMarkerCount=this.session.$selectionMarkers.length;return e};this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);if(t!=-1)this.session.$selectionMarkers.splice(t,1);this.session.selectionMarkerCount=this.session.$selectionMarkers.length};this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var i=e.length;i--;){var n=e[i];if(!n.marker)continue;this.session.removeMarker(n.marker);var r=t.indexOf(n);if(r!=-1)t.splice(r,1)}this.session.selectionMarkerCount=t.length};this.$onAddRange=function(e){this.addSelectionMarker(e.range);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=true;this.setStyle("ace_multiselect");this.keyBinding.addKeyboardHandler(c.keyboardHandler);this.commands.setDefaultHandler("exec",this.$onMultiSelectExec);this.renderer.updateCursor();this.renderer.updateBackMarkers()};this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=false;this.unsetStyle("ace_multiselect");this.keyBinding.removeKeyboardHandler(c.keyboardHandler);this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec);this.renderer.updateCursor();this.renderer.updateBackMarkers();this._emit("changeSelection")};this.$onMultiSelectExec=function(e){var t=e.command;var i=e.editor;if(!i.multiSelect)return;if(!t.multiSelectAction){var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange());i.multiSelect.mergeOverlappingRanges()}else if(t.multiSelectAction=="forEach"){n=i.forEachSelection(t,e.args)}else if(t.multiSelectAction=="forEachLine"){n=i.forEachSelection(t,e.args,true)}else if(t.multiSelectAction=="single"){i.exitMultiSelectMode();n=t.exec(i,e.args||{})}else{n=t.multiSelectAction(i,e.args||{})}return n};this.forEachSelection=function(e,t,i){if(this.inVirtualSelectionMode)return;var n=i&&i.keepOrder;var r=i==true||i&&i.$byLines;var s=this.session;var a=this.selection;var l=a.rangeList;var c=(n?a:l).ranges;var h;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var u=a._eventRegistry;a._eventRegistry={};var d=new o(s);this.inVirtualSelectionMode=true;for(var f=c.length;f--;){if(r){while(f>0&&c[f].start.row==c[f-1].end.row)f--}d.fromOrientedRange(c[f]);d.index=f;this.selection=s.selection=d;var g=e.exec?e.exec(this,t||{}):e(this,t||{});if(!h&&g!==undefined)h=g;d.toOrientedRange(c[f])}d.detach();this.selection=s.selection=a;this.inVirtualSelectionMode=false;a._eventRegistry=u;a.mergeOverlappingRanges();if(a.ranges[0])a.fromOrientedRange(a.ranges[0]);var p=this.renderer.$scrollAnimation;this.onCursorChange();this.onSelectionChange();if(p&&p.from==p.to)this.renderer.animateScrolling(p.from);return h};this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()};this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges;var i=[];for(var n=0;n<t.length;n++){i.push(this.session.getTextRange(t[n]))}var r=this.session.getDocument().getNewLineCharacter();e=i.join(r);if(e.length==(i.length-1)*r.length)e=""}else if(!this.selection.isEmpty()){e=this.session.getTextRange(this.getSelectionRange())}return e};this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;if(n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column)this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());else this.multiSelect.mergeOverlappingRanges()}};this.findAll=function(e,t,i){t=t||{};t.needle=e||t.needle;if(t.needle==undefined){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var r=this.$search.findAll(this.session);if(!r.length)return 0;var o=this.multiSelect;if(!i)o.toSingleRange(r[0]);for(var s=r.length;s--;)o.addRange(r[s],true);if(n&&o.rangeList.rangeAtPoint(n.start))o.addRange(n,true);return r.length};this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange();var n=i.cursor==i.end;var o=this.session.documentToScreenPosition(i.cursor);if(this.selection.$desiredColumn)o.column=this.selection.$desiredColumn;var s=this.session.screenToDocumentPosition(o.row+e,o.column);if(!i.isEmpty()){var a=this.session.documentToScreenPosition(n?i.end:i.start);var l=this.session.screenToDocumentPosition(a.row+e,a.column)}else{var l=s}if(n){var c=r.fromPoints(s,l);c.cursor=c.start}else{var c=r.fromPoints(l,s);c.cursor=c.end}c.desiredColumn=o.column;if(!this.selection.inMultiSelectMode){this.selection.addRange(i)}else{if(t)var h=i.cursor}this.selection.addRange(c);if(h)this.selection.substractPoint(h)};this.transposeSelections=function(e){var t=this.session;var i=t.multiSelect;var n=i.ranges;for(var r=n.length;r--;){var o=n[r];if(o.isEmpty()){var s=t.getWordRange(o.start.row,o.start.column);o.start.row=s.start.row;o.start.column=s.start.column;o.end.row=s.end.row;o.end.column=s.end.column}}i.mergeOverlappingRanges();var a=[];for(var r=n.length;r--;){var o=n[r];a.unshift(t.getTextRange(o))}if(e<0)a.unshift(a.pop());else a.push(a.shift());for(var r=n.length;r--;){var o=n[r];var l=o.clone();t.replace(o,a[r]);o.start.row=l.start.row;o.start.column=l.start.column}i.fromOrientedRange(i.ranges[0])};this.selectMore=function(e,t,i){var n=this.session;var r=n.multiSelect;var o=r.toOrientedRange();if(o.isEmpty()){o=n.getWordRange(o.start.row,o.start.column);o.cursor=e==-1?o.start:o.end;this.multiSelect.addRange(o);if(i)return}var s=n.getTextRange(o);var a=d(n,s,e);if(a){a.cursor=e==-1?a.start:a.end;this.session.unfold(a);this.multiSelect.addRange(a);this.renderer.scrollCursorIntoView(null,.5)}if(t)this.multiSelect.substractPoint(o.cursor)};this.alignCursors=function(){var e=this.session;var t=e.multiSelect;var i=t.ranges;var n=-1;var o=i.filter(function(e){if(e.cursor.row==n)return true;n=e.cursor.row});if(!i.length||o.length==i.length-1){var s=this.selection.getRange();var a=s.start.row,c=s.end.row;var h=a==c;if(h){var u=this.session.getLength();var d;do{d=this.session.getLine(c)}while(/[=:]/.test(d)&&++c<u);do{d=this.session.getLine(a)}while(/[=:]/.test(d)&&--a>0);if(a<0)a=0;if(c>=u)c=u-1}var f=this.session.removeFullLines(a,c);f=this.$reAlignText(f,h);this.session.insert({row:a,column:0},f.join("\n")+"\n");if(!h){s.start.column=0;s.end.column=f[f.length-1].length}this.selection.setRange(s)}else{o.forEach(function(e){t.substractPoint(e.cursor)});var g=0;var p=Infinity;var m=i.map(function(t){var i=t.cursor;var n=e.getLine(i.row);var r=n.substr(i.column).search(/\S/g);if(r==-1)r=0;if(i.column>g)g=i.column;if(r<p)p=r;return r});i.forEach(function(t,i){var n=t.cursor;var o=g-n.column;var s=m[i]-p;if(o>s)e.insert(n,l.stringRepeat(" ",o-s));else e.remove(new r(n.row,n.column,n.row,n.column-o+s));t.start.column=t.end.column=g;t.start.row=t.end.row=n.row;t.cursor=t.end});t.fromOrientedRange(i[0]);this.renderer.updateCursor();this.renderer.updateBackMarkers()}};this.$reAlignText=function(e,t){var i=true,n=true;var r,o,s;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);if(!t)return[e];if(r==null){r=t[1].length;o=t[2].length;s=t[3].length;return t}if(r+o+s!=t[1].length+t[2].length+t[3].length)n=false;if(r!=t[1].length)i=false;if(r>t[1].length)r=t[1].length;if(o<t[2].length)o=t[2].length;if(s>t[3].length)s=t[3].length;return t}).map(t?c:i?n?h:c:u);function a(e){return l.stringRepeat(" ",e)}function c(e){return!e[2]?e[0]:a(r)+e[2]+a(o-e[2].length+s)+e[4].replace(/^([=:])\s+/,"$1 ")}function h(e){return!e[2]?e[0]:a(r+o-e[2].length)+e[2]+a(s)+e[4].replace(/^([=:])\s+/,"$1 ")}function u(e){return!e[2]?e[0]:a(r)+e[2]+a(s)+e[4].replace(/^([=:])\s+/,"$1 ")}}}).call(g.prototype);function p(e,t){return e.row==t.row&&e.column==t.column}t.onSessionChange=function(e){var t=e.session;if(t&&!t.multiSelect){t.$selectionMarkers=[];t.selection.$initRangeList();t.multiSelect=t.selection}this.multiSelect=t&&t.multiSelect;var i=e.oldSession;if(i){i.multiSelect.off("addRange",this.$onAddRange);i.multiSelect.off("removeRange",this.$onRemoveRange);i.multiSelect.off("multiSelect",this.$onMultiSelect);i.multiSelect.off("singleSelect",this.$onSingleSelect);i.multiSelect.lead.off("change",this.$checkMultiselectChange);i.multiSelect.anchor.off("change",this.$checkMultiselectChange)}if(t){t.multiSelect.on("addRange",this.$onAddRange);t.multiSelect.on("removeRange",this.$onRemoveRange);t.multiSelect.on("multiSelect",this.$onMultiSelect);t.multiSelect.on("singleSelect",this.$onSingleSelect);t.multiSelect.lead.on("change",this.$checkMultiselectChange);t.multiSelect.anchor.on("change",this.$checkMultiselectChange)}if(t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode){if(t.selection.inMultiSelectMode)this.$onMultiSelect();else this.$onSingleSelect()}};function m(e){if(e.$multiselectOnSessionChange)return;e.$onAddRange=e.$onAddRange.bind(e);e.$onRemoveRange=e.$onRemoveRange.bind(e);e.$onMultiSelect=e.$onMultiSelect.bind(e);e.$onSingleSelect=e.$onSingleSelect.bind(e);e.$multiselectOnSessionChange=t.onSessionChange.bind(e);e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e);e.$multiselectOnSessionChange(e);e.on("changeSession",e.$multiselectOnSessionChange);e.on("mousedown",s);e.commands.addCommands(c.defaultCommands);v(e)}function v(e){if(!e.textInput)return;var t=e.textInput.getElement();var i=false;a.addListener(t,"keydown",function(t){var r=t.keyCode==18&&!(t.ctrlKey||t.shiftKey||t.metaKey);if(e.$blockSelectEnabled&&r){if(!i){e.renderer.setMouseCursor("crosshair");i=true}}else if(i){n()}},e);a.addListener(t,"keyup",n,e);a.addListener(t,"blur",n,e);function n(t){if(i){e.renderer.setMouseCursor("");i=false}}}t.MultiSelect=m;e("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(e){m(this);if(e){this.on("mousedown",s)}else{this.off("mousedown",s)}},value:true},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:true}})});ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,i){"use strict";var n=e("../../range").Range;var r=t.FoldMode=function(){};(function(){this.foldingStartMarker=null;this.foldingStopMarker=null;this.getFoldWidget=function(e,t,i){var n=e.getLine(i);if(this.foldingStartMarker.test(n))return"start";if(t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(n))return"end";return""};this.getFoldWidgetRange=function(e,t,i){return null};this.indentationBlock=function(e,t,i){var r=/\S/;var o=e.getLine(t);var s=o.search(r);if(s==-1)return;var a=i||o.length;var l=e.getLength();var c=t;var h=t;while(++t<l){var u=e.getLine(t).search(r);if(u==-1)continue;if(u<=s){var d=e.getTokenAt(t,0);if(!d||d.type!=="string")break}h=t}if(h>c){var f=e.getLine(h).length;return new n(c,a,h,f)}};this.openingBracketBlock=function(e,t,i,r,o){var s={row:i,column:r+1};var a=e.$findClosingBracket(t,s,o);if(!a)return;var l=e.foldWidgets[a.row];if(l==null)l=e.getFoldWidget(a.row);if(l=="start"&&a.row>s.row){a.row--;a.column=e.getLine(a.row).length}return n.fromPoints(s,a)};this.closingBracketBlock=function(e,t,i,r,o){var s={row:i,column:r};var a=e.$findOpeningBracket(t,s);if(!a)return;a.column++;s.column--;return n.fromPoints(a,s)}}).call(r.prototype)});ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(e,t,i){"use strict";var n=e("../lib/dom");var r=e("../range").Range;var o=e("../config").nls;function s(e,t,i){var n=0;var r=e.length-1;while(n<=r){var o=n+r>>1;var s=i(t,e[o]);if(s>0)n=o+1;else if(s<0)r=o-1;else return o}return-(n+1)}function a(e,t,i){var n=e.getAnnotations().sort(r.comparePoints);if(!n.length)return;var o=s(n,{row:t,column:-1},r.comparePoints);if(o<0)o=-o-1;if(o>=n.length)o=i>0?0:n.length-1;else if(o===0&&i<0)o=n.length-1;var a=n[o];if(!a||!i)return;if(a.row===t){do{a=n[o+=i]}while(a&&a.row===t);if(!a)return n.slice()}var l=[];t=a.row;do{l[i<0?"unshift":"push"](a);a=n[o+=i]}while(a&&a.row==t);return l.length&&l}t.showErrorMarker=function(e,t){var i=e.session;var r=e.getCursorPosition();var s=r.row;var l=i.widgetManager.getWidgetsAtRow(s).filter(function(e){return e.type=="errorMarker"})[0];if(l){l.destroy()}else{s-=t}var c=a(i,s,t);var h;if(c){var u=c[0];r.column=(u.pos&&typeof u.column!="number"?u.pos.sc:u.column)||0;r.row=u.row;h=e.renderer.$gutterLayer.$annotations[r.row]}else if(l){return}else{h={displayText:[o("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(r.row);e.selection.moveToPosition(r);var d={row:r.row,fixedWidth:true,coverGutter:true,el:n.createElement("div"),type:"errorMarker"};var f=d.el.appendChild(n.createElement("div"));var g=d.el.appendChild(n.createElement("div"));g.className="error_widget_arrow "+h.className;var p=e.renderer.$cursorLayer.getPixelPosition(r).left;g.style.left=p+e.renderer.gutterWidth-5+"px";d.el.className="error_widget_wrapper";f.className="error_widget "+h.className;h.displayText.forEach(function(e,t){f.appendChild(n.createTextNode(e));if(t<h.displayText.length-1){f.appendChild(n.createElement("br"))}});f.appendChild(n.createElement("div"));var m=function(e,t,i){if(t===0&&(i==="esc"||i==="return")){d.destroy();return{command:"null"}}};d.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(m);i.widgetManager.removeLineWidget(d);e.off("changeSelection",d.destroy);e.off("changeSession",d.destroy);e.off("mouseup",d.destroy);e.off("change",d.destroy)};e.keyBinding.addKeyboardHandler(m);e.on("changeSelection",d.destroy);e.on("changeSession",d.destroy);e.on("mouseup",d.destroy);e.on("change",d.destroy);e.session.widgetManager.addLineWidget(d);d.el.onmousedown=e.focus.bind(e);e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})};n.importCssString("\n    .error_widget_wrapper {\n        background: inherit;\n        color: inherit;\n        border:none\n    }\n    .error_widget {\n        border-top: solid 2px;\n        border-bottom: solid 2px;\n        margin: 5px 0;\n        padding: 10px 40px;\n        white-space: pre-wrap;\n    }\n    .error_widget.ace_error, .error_widget_arrow.ace_error{\n        border-color: #ff5a5a\n    }\n    .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n        border-color: #F1D817\n    }\n    .error_widget.ace_info, .error_widget_arrow.ace_info{\n        border-color: #5a5a5a\n    }\n    .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n        border-color: #5aaa5a\n    }\n    .error_widget_arrow {\n        position: absolute;\n        border: solid 5px;\n        border-top-color: transparent!important;\n        border-right-color: transparent!important;\n        border-left-color: transparent!important;\n        top: -5px;\n    }\n","error_marker.css",false)});ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(e,t,i){"use strict";e("./loader_build")(t);var n=e("./lib/dom");var r=e("./range").Range;var o=e("./editor").Editor;var s=e("./edit_session").EditSession;var a=e("./undomanager").UndoManager;var l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client");e("./keyboard/hash_handler");e("./placeholder");e("./multi_select");e("./mode/folding/fold_mode");e("./theme/textmate");e("./ext/error_marker");t.config=e("./config");t.edit=function(e,i){if(typeof e=="string"){var r=e;e=document.getElementById(r);if(!e)throw new Error("ace.edit can't find div #"+r)}if(e&&e.env&&e.env.editor instanceof o)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;s=a.value;e=n.createElement("pre");a.parentNode.replaceChild(e,a)}else if(e){s=e.textContent;e.innerHTML=""}var c=t.createEditSession(s);var h=new o(new l(e),c,i);var u={document:c,editor:h,onResize:h.resize.bind(h,null)};if(a)u.textarea=a;h.on("destroy",function(){u.editor.container.env=null});h.container.env=h.env=u;return h};t.createEditSession=function(e,t){var i=new s(e,t);i.setUndoManager(new a);return i};t.Range=r;t.Editor=o;t.EditSession=s;t.UndoManager=a;t.VirtualRenderer=l;var c=t.config.version;t.version=c});(function(){ace.require(["ace/ace"],function(e){if(e){e.config.init(true);e.define=ace.define}var t=function(){return this}();if(!t&&typeof window!="undefined")t=window;if(!t&&typeof self!="undefined")t=self;if(!t.ace)t.ace=e;for(var i in e)if(e.hasOwnProperty(i))t.ace[i]=e[i];t.ace["default"]=t.ace;if(typeof module=="object"&&typeof exports=="object"&&module){module.exports=t.ace}})})();
//# sourceMappingURL=ace.js.map