@liascript/editor
Version:
An extended Markdown interpreter for the creation of interactive online courses.
1 lines • 965 kB
JavaScript
function e(e){return e&&e.__esModule?e.default:e}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i={},n={},o=t.parcelRequirea18f;null==o&&((o=function(e){if(e in i)return i[e].exports;if(e in n){var t=n[e];delete n[e];var o={id:e,exports:{}};return i[e]=o,t.call(o.exports,o,o.exports),o.exports}var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){n[e]=t},t.parcelRequirea18f=o),o.register("k391a",(function(e,t){(function(){var e=function(){return this}();!e&&"undefined"!=typeof window&&(e=window);var t=function(e,i,n){"string"==typeof e?(2==arguments.length&&(n=i),t.modules[e]||(t.payloads[e]=n,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var i=function(e,t,i){if("string"==typeof t){var o=r(e,t);if(null!=o)return i&&i(),o}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],a=0,l=t.length;a<l;++a){var c=r(e,t[a]);if(null==c&&n.original)return;s.push(c)}return i&&i.apply(null,s)||!0}},n=function(e,t){var o=i("",e,t);return null==o&&n.original?n.original.apply(this,arguments):o},o=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return o(e,i[0])+"!"+o(e,i[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},r=function(e,n){n=o(e,n);var r=t.modules[n];if(!r){if("function"==typeof(r=t.payloads[n])){var s={},a={id:n,uri:"",exports:s,packaged:!0},l=r((function(e,t){return i(n,e,t)}),s,a);s=l||a.exports,t.modules[n]=s,delete t.payloads[n]}r=t.modules[n]=s||r}return r};!function(i){var o=e;i&&(e[i]||(e[i]={}),o=e[i]),o.define&&o.define.packaged||(t.original=o.define,o.define=t,o.define.packaged=!0),o.require&&o.require.packaged||(n.original=o.require,o.require=n,o.require.packaged=!0)}("ace")})(),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:!1,writable:!0,configurable:!0})}String.prototype.startsWith||n(String.prototype,"startsWith",(function(e,t){return t=t||0,this.lastIndexOf(e,t)===t})),String.prototype.endsWith||n(String.prototype,"endsWith",(function(e,t){var i=this;(void 0===t||t>i.length)&&(t=i.length),t-=e.length;var n=i.indexOf(e,t);return-1!==n&&n===t})),String.prototype.repeat||n(String.prototype,"repeat",(function(e){for(var t="",i=this;e>0;)1&e&&(t+=i),(e>>=1)&&(i+=i);return t})),String.prototype.includes||n(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];null!=n&&Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||n(Array.prototype,"find",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return o}})),Array.prototype.findIndex||n(Array.prototype,"findIndex",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return n}})),Array.prototype.includes||n(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||n(Array.prototype,"fill",(function(e){for(var t=this,i=t.length>>>0,n=0|arguments[1],o=n<0?Math.max(i+n,0):Math.min(n,i),r=arguments[2],s=void 0===r?i:0|r,a=s<0?Math.max(i+s,0):Math.min(s,i);o<a;)t[o]=e,o++;return t})),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){e("./es6-shim")})),ace.define("ace/lib/deep_copy",["require","exports","module"],(function(e,t,i){t.deepCopy=function e(t){if("object"!=typeof t||!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 Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n]);return i}})),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],(function(e,t,i){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},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++)t===e[i]&&e.splice(i,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(e,t){var i=[];return e.replace(t,(function(e){i.push({offset:arguments[arguments.length-2],length:e.length})})),i},t.deferredCall=function(e){var t=null,i=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(i,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n.isPending=function(){return t},n},t.delayedCall=function(e,t){var i=null,n=function(){i=null,e()},o=function(e){null==i&&(i=setTimeout(n,e||t))};return o.delay=function(e){i&&clearTimeout(i),i=setTimeout(n,e||t)},o.schedule=o,o.call=function(){this.cancel(),e()},o.cancel=function(){i&&clearTimeout(i),i=null},o.isPending=function(){return i},o},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},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){t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},o=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),r=n.userAgent||"",s=n.appName||"";t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE="Microsoft Internet Explorer"==s||s.indexOf("MSAppHost")>=0?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(r.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=r.indexOf("AdobeAIR")>=0,t.isAndroid=r.indexOf("Android")>=0,t.isChromeOS=r.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,i){function n(){var e=a;a=null,e&&e.forEach((function(e){o(e[0],e[1])}))}function o(e,i,o){if("undefined"!=typeof document){if(a)if(o)n();else if(!1===o)return a.push([e,i]);if(!s){var r=o;o&&o.getRootNode&&(r=o.getRootNode())&&r!=o||(r=document);var l=r.ownerDocument||r;if(i&&t.hasCssString(i,r))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var c=t.createElement("style");c.appendChild(l.createTextNode(e)),i&&(c.id=i),r==l&&(r=t.getDocumentHead(l)),r.insertBefore(c,r.firstChild)}}}var r=e("./useragent");t.buildDom=function e(t,i,n){if("string"==typeof t&&t){var o=document.createTextNode(t);return i&&i.appendChild(o),o}if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var a=e(t[s],i,n);a&&r.push(a)}return r}var l=document.createElement(t[0]),c=t[1],h=1;for(c&&"object"==typeof c&&!Array.isArray(c)&&(h=2),s=h;s<t.length;s++)e(t[s],l,n);return 2==h&&Object.keys(c).forEach((function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?l[e]=t:"ref"===e?n&&(n[t]=l):"style"===e?"string"==typeof t&&(l.style.cssText=t):null!=t&&l.setAttribute(e,t)})),i&&i.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var o=i.indexOf(t);if(-1==o)break;n=!1,i.splice(o,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()};var s,a=[];if(t.useStrictCSP=function(e){s=e,0==e?n():a||(a=[])},t.importCssString=o,t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.$fixPositionBug=function(e){var t=e.getBoundingClientRect();if(e.style.left){var i=parseFloat(e.style.left),n=+t.left;Math.abs(i-n)>1&&(e.style.left=2*i-n+"px")}e.style.right&&(i=parseFloat(e.style.right),n=window.innerWidth-t.right,Math.abs(i-n)>1&&(e.style.right=2*i-n+"px")),e.style.top&&(i=parseFloat(e.style.top),n=+t.top,Math.abs(i-n)>1&&(e.style.top=2*i-n+"px")),e.style.bottom&&(i=parseFloat(e.style.bottom),n=window.innerHeight-t.bottom,Math.abs(i-n)>1&&(e.style.bottom=2*i-n+"px"))},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"),o=n.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",n.appendChild(i);var r=e&&e.documentElement||document&&document.documentElement;if(!r)return 0;r.appendChild(n);var s=i.offsetWidth;o.overflow="scroll";var a=i.offsetWidth;return s===a&&(a=n.clientWidth),r.removeChild(n),s-a},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!r.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,r.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var l=document.createElement("div");t.HI_DPI&&void 0!==l.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&void 0!==l.style.animationName&&(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}: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){var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,i){!i&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,i){t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},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){var n={},o=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=r),i=i.slice();for(var s=0;s<i.length&&(i[s](t,this),!t.propagationStopped);s++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(i){i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)}},n.once=function(e,t){var i=this;if(this.on(e,(function n(){i.off(e,n),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[e]){var n=i[e],o=i._disabled_[e];o||(i._disabled_[e]=o=[]),o.push(n);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}i[e]=t},n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i){var n=i._disabled_[e];if(i[e]==t)n&&this.setDefaultHandler(e,n.pop());else if(n){var o=n.indexOf(t);-1!=o&&n.splice(o,1)}}},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}},n.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=n})),ace.define("ace/lib/report_error",["require","exports","module"],(function(e,t,i){t.reportError=function(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout((function(){throw i}))}})),ace.define("ace/lib/default_english_messages",["require","exports","module"],(function(e,t,i){t.defaultEnglishMessages={"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 gutter","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","editor.tooltip.disable-editing":"Editing is disabled"}})),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){function n(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}var o,r,s=e("./oop"),a=e("./event_emitter").EventEmitter,l=e("./report_error").reportError,c=e("./default_english_messages").defaultEnglishMessages,h={setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var i=this.$options;e=Object.keys(i).filter((function(e){return!i[e].hidden}))}return e.forEach((function(e){t[e]=this.getOption(e)}),this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}},u=function(){function e(){this.$defaultOptions={},o=c,r="dollarSigns"}return e.prototype.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach((function(t){var n=i[t];"string"==typeof n&&(n={forwardTo:n}),n.name||(n.name=t),e.$options[n.name]=n,"initialValue"in n&&(e["$"+n.name]=n.initialValue)})),s.implement(e,h),this},e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var i=e.$options[t];"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!1}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):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){o=e,t&&t.placeholders&&(r=t.placeholders)},e.prototype.nls=function(e,t,i){o[e]||(n("No message found for the key '"+e+"' in messages with id "+o.$id+", trying to find a translation for the default string '"+t+"'."),o[t]||n("No message found for the default string '"+t+"' in the provided messages. Falling back to the default English message."));var s=o[e]||o[t]||t;return i&&("dollarSigns"===r&&(s=s.replace(/\$(\$|[\d]+)/g,(function(e,t){return"$"==t?"$":i[t]}))),"curlyBrackets"===r&&(s=s.replace(/\{([^\}]+)\}/g,(function(e,t){return i[t]})))),s},e}();u.prototype.warn=n,u.prototype.reportError=l,s.implement(u.prototype,a),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){t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],(function(e,t,i){var n=e("./lib/lang"),o=e("./lib/net"),r=e("./lib/dom"),s=e("./lib/app_config").AppConfig;i.exports=t=new s;var a={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,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(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&r.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("/"),n="snippets"==(t=t||i[i.length-2]||"")?"/":"-",o=i[i.length-1];if("worker"==t&&"-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&i.length>1&&(o=i[i.length-2]);var s=a[t+"Path"];return null==s?s=a.basePath:"/"==n&&(t=n=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+n+o+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t};var l,c=function(t,i){return"ace/theme/textmate"===t||"./theme/textmate"===t?i(null,e("./theme/textmate")):l?l(t,i):void console.error("loader is not configured")};t.setLoader=function(e){l=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(e,i){var n;if(Array.isArray(e))var r=e[0],s=e[1];else"string"==typeof e&&(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),!(t.$loading[s].length>1)){var n=function(){c(s,(function(e,i){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();o.loadScript(t.moduleUrl(s,r),n),h()}};if(t.dynamicModules[s])t.dynamicModules[s]().then((function(e){e.default?a(e.default):a(e)}));else{try{n=this.$require(s)}catch(e){}a(n||t.$loaded[s])}},t.$require=function(e){if("function"==typeof i.require)return i.require(e)},t.setModuleLoader=function(e,i){t.dynamicModules[e]=i};var h=function(){!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.43.5"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,i){function n(t){if(s&&s.document){r.set("packaged",t||e.packaged||i.packaged||s.define&&define.packaged);var n={},a="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(a=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var h=c.getElementsByTagName("script"),u=0;u<h.length;u++){var d=h[u],p=d.src||d.getAttribute("src");if(p){for(var g=d.attributes,f=0,m=g.length;f<m;f++){var y=g[f];0===y.name.indexOf("data-ace-")&&(n[o(y.name.replace(/^data-ace-/,""))]=y.value)}var v=p.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);v&&(a=v[1])}}for(var w in a&&(n.base=n.base||a,n.packaged=!0),n.basePath=n.base,n.workerPath=n.workerPath||n.base,n.modePath=n.modePath||n.base,n.themePath=n.themePath||n.base,delete n.base,n)void 0!==n[w]&&r.set(w,n[w])}}function o(e){return e.replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))}e("./lib/fixoldbrowsers");var r=e("./config");r.setLoader((function(t,i){e([t],(function(e){i(null,e)}))}));var s=function(){return this||"undefined"!=typeof window&&window}();i.exports=function(t){r.init=n,r.$require=e,t.require=e,"function"==typeof define&&(t.define=define)}})),ace.define("ace/range",["require","exports","module"],(function(e,t,i){var n=function(){function e(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}}return 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 0==this.compare(e,t)},e.prototype.compareRange=function(e){var t,i=e.end,n=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(n.row,n.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(n.row,n.column))?-1:1==t?42:0},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},e.prototype.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},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){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},e.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},e.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},e.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,i){if(this.end.row>i)var n={row:i+1,column:0};else this.end.row<t&&(n={row:t,column:0});if(this.start.row>i)var o={row:i+1,column:0};else this.start.row<t&&(o={row:t,column:0});return e.fromPoints(o||this.start,n||this.end)},e.prototype.extend=function(t,i){var n=this.compare(t,i);if(0==n)return this;if(-1==n)var o={row:t,column:i};else var r={row:t,column:i};return e.fromPoints(o||this.start,r||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(){return 0==this.end.column?new e(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new e(this.start.row,0,this.end.row,0)},e.prototype.toScreenRange=function(t){var i=t.documentToScreenPosition(this.start),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},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){for(var n=e("./oop"),o={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:"*"}},r={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},s=0;s<10;s++)r["Digit"+s]=48+s,r["Numpad"+s]=96+s,o.PRINTABLE_KEYS[48+s]=""+s,o.FUNCTION_KEYS[96+s]="Numpad"+s;for(s=65;s<91;s++){var a=String.fromCharCode(s+32);r["Key"+a.toUpperCase()]=s,o.PRINTABLE_KEYS[s]=a}for(s=1;s<13;s++)r["F"+s]=111+s,o.FUNCTION_KEYS[111+s]="F"+s;var l={Shift:16,Control:17,Alt:18,Meta:224};for(var c in l)r[c]=r[c+"Left"]=r[c+"Right"]=l[c];for(var h in t.$codeToKeyCode=r,o.PRINTABLE_KEYS[173]="-",o.FUNCTION_KEYS){var u=o.FUNCTION_KEYS[h].toLowerCase();o[u]=parseInt(h,10)}for(var h in o.PRINTABLE_KEYS)u=o.PRINTABLE_KEYS[h].toLowerCase(),o[u]=parseInt(h,10);n.mixin(o,o.MODIFIER_KEYS),n.mixin(o,o.PRINTABLE_KEYS),n.mixin(o,o.FUNCTION_KEYS),o.enter=o.return,o.escape=o.esc,o.del=o.delete,function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)o.KEY_MODS[t]=e.filter((function(e){return t&o.KEY_MODS[e]})).join("-")+"-"}(),o.KEY_MODS[0]="",o.KEY_MODS[-1]="input-",n.mixin(t,o),t.default=t,t.keyCodeToString=function(e){var t=o[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){function n(){return null==a&&function(){a=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){return a={passive:!1},!0}})}catch(e){}}(),a}function o(e,t,i){this.elem=e,this.type=t,this.callback=i}function r(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}function s(){h=Object.create(null)}var a,l=e("./keys"),c=e("./useragent"),h=null,u=0;o.prototype.destroy=function(){p(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d=t.addListener=function(e,t,i,r){e.addEventListener(t,i,n()),r&&r.$toDestroy.push(new o(e,t,i))},p=t.removeListener=function(e,t,i){e.removeEventListener(t,i,n())};if(t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||c.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,i){function n(e){t&&t(e),i&&i(e),p(o,"mousemove",t),p(o,"mouseup",n),p(o,"dragstart",n)}var o=e&&e.ownerDocument||document;return d(o,"mousemove",t),d(o,"mouseup",n),d(o,"dragstart",n),n},t.addMouseWheelListener=function(e,t,i){d(e,"wheel",(function(e){var i=e.deltaX||0,n=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.15*i,e.wheelY=.15*n;break;case e.DOM_DELTA_LINE:e.wheelX=15*i,e.wheelY=15*n;break;case e.DOM_DELTA_PAGE:e.wheelX=150*i,e.wheelY=150*n}t(e)}),i)},t.addMultiMouseDownListener=function(e,i,n,o,r){function s(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,c.isIE){var r=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-l)>5;h&&!r||(u=1),h&&clearTimeout(h),h=setTimeout((function(){h=null}),i[u-1]||600),1==u&&(a=e.clientX,l=e.clientY)}if(e._clicks=u,n[o]("mousedown",e),u>4)u=0;else if(u>1)return n[o](p[u],e)}var a,l,h,u=0,p={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach((function(e){d(e,"mousedown",s,r)}))},t.getModifierString=function(e){return l.KEY_MODS[r(e)]},t.addCommandKeyListener=function(e,i,n){var o=null;d(e,"keydown",(function(e){h[e.keyCode]=(h[e.keyCode]||0)+1;var t=function(e,t,i){var n=r(t);if(!i&&t.code&&(i=l.$codeToKeyCode[t.code]||i),!c.isMac&&h){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),h.altGr){if(!(3&~n))return;h.altGr=0}if(18===i||17===i){var o=t.location;17===i&&1===o?1==h[i]&&(u=t.timeStamp):18===i&&3===n&&2===o&&t.timeStamp-u<50&&(h.altGr=!0)}}if(i in l.MODIFIER_KEYS&&(i=-1),n||13!==i||3!==t.location||(e(t,n,-i),!t.defaultPrevented)){if(c.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in l.FUNCTION_KEYS||i in l.PRINTABLE_KEYS)&&e(t,n,i)}}(i,e,e.keyCode);return o=e.defaultPrevented,t}),n),d(e,"keypress",(function(e){o&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),o=null)}),n),d(e,"keyup",(function(e){h[e.keyCode]=null}),n),h||(s(),d(window,"focus",s))},"object"==typeof window&&window.postMessage&&!c.isOldIE){var g=1;t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+g++,o=function(r){r.data==n&&(t.stopPropagation(r),p(i,"message",o),e())};d(i,"message",o),i.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout((function i(){t.$idleBlocked?setTimeout(i,100):e()}),i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,i){var n;i.exports={lineMode:!1,pasteCancelled:function(){return!!(n&&n>Date.now()-50)||(n=!1)},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){var n=e("../lib/event"),o=e("../config").nls,r=e("../lib/useragent"),s=e("../lib/dom"),a=e("../lib/lang"),l=e("../clipboard"),c=r.isChrome<18,h=r.isIE,u=r.isChrome>63,d=400,p=e("../lib/keys"),g=p.KEY_MODS,f=r.isIOS,m=f?/\s/:/\n/,y=r.isMobile,v=function(){function e(e,t){var i=this;this.host=t,this.text=s.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocomplete","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",e.insertBefore(this.text,e.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",y||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch(e){}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),n.addListener(this.text,"blur",(function(e){i.ignoreFocusEvents||(t.onBlur(e),i.$isFocused=!1)}),t),n.addListener(this.text,"focus",(function(e){if(!i.ignoreFocusEvents){if(i.$isFocused=!0,r.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),r.isEdge?setTimeout(i.resetSelection.bind(i)):i.resetSelection()}}),t),this.$focusScroll=!1,t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;if("insertstring"!=n){var o=n&&(e.docChanged||e.selectionChanged);i.inComposition&&o&&(i.lastValue=i.text.value="",i.onCompositionEnd()),i.resetSelection()}})),t.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=f?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&t.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,n.addCommandKeyListener(this.text,(function(e,n,o){if(!i.inComposition)return t.onCommandKey(e,n,o)}),t),n.addListener(this.text,"select",this.onSelect.bind(this),t),n.addListener(this.text,"input",this.onInput.bind(this),t),n.addListener(this.text,"cut",this.onCut.bind(this),t),n.addListener(this.text,"copy",this.onCopy.bind(this),t),n.addListener(this.text,"paste",this.onPaste.bind(this),t),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&n.addListener(e,"keydown",(function(e){if((!r.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:i.onCopy(e);break;case 86:i.onPaste(e);break;case 88:i.onCut(e)}}),t),this.syncComposition=a.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),n.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),t),n.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),t),n.addListener(this.text,"keyup",this.onKeyup.bind(this),t),n.addListener(this.text,"keydown",this.syncComposition.bind(this),t),n.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),t),this.closeTimeout,n.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),t),n.addListener(this.text,"mousedown",(function(e){e.preventDefault(),i.onContextMenuClose()}),t),n.addListener(t.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),t),n.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),t),f&&this.addIosSelectionHandler(e,t,this.text)}return e.prototype.addIosSelectionHandler=function(e,t,i){var n=this,o=null,r=!1;i.addEventListener("keydown",(function(e){o&&clearTimeout(o),r=!0}),!0),i.addEventListener("keyup",(function(e){o=setTimeout((function(){r=!1}),100)}),!0);var s=function(e){if(document.activeElement===i&&!(r||n.inComposition||t.$mouseHandler.isMousePressed||n.copied)){var o=i.selectionStart,s=i.selectionEnd,a=null,l=0;if(0==o?a=p.up:1==o?a=p.home:s>n.lastSelectionEnd&&"\n"==n.lastValue[s]?a=p.end:o<n.lastSelectionStart&&" "==n.lastValue[o-1]?(a=p.left,l=g.option):o<n.lastSelectionStart||o==n.lastSelectionStart&&n.lastSelectionEnd!=n.lastSelectionStart&&o==s?a=p.left:s>n.lastSelectionEnd&&n.lastValue.slice(0,s).split("\n").length>2?a=p.down:s>n.lastSelectionEnd&&" "==n.lastValue[s-1]?(a=p.right,l=g.option):(s>n.lastSelectionEnd||s==n.lastSelectionEnd&&n.lastSelectionEnd!=n.lastSelectionStart&&o==s)&&(a=p.right),o!==s&&(l|=g.shift),a){if(!t.onCommandKey({},l,a)&&t.commands){a=p.keyCodeToString(a);var c=t.commands.findKeyCommand(l,a);c&&t.execCommand(c)}n.lastSelectionStart=o,n.lastSelectionEnd=s,n.resetSelection("")}}};document.addEventListener("selectionchange",s),t.on("destroy",(function(){document.removeEventListener("selectionchange",s)}))},e.prototype.onContextMenuClose=function(){var e=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout((function(){e.tempStyle&&(e.text.style.cssText=e.tempStyle,e.tempStyle=""),e.host.renderer.$isMousePressed=!1,e.host.renderer.$keepTextAreaAtCursor&&e.host.renderer.$moveTextAreaToCursor()}),0)},e.prototype.$onContextMenu=function(e){this.host.textInput.onContextMenu(e),this.onContextMenuClose()},e.prototype.onKeyup=function(e){27==e.keyCode&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},e.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},e.prototype.onCompositionStart=function(e){if(!this.inComposition&&this.host.onCompositionStart&&!this.host.$readOnly&&(this.inComposition={},!this.commandMode)){e.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var t=this.host.getSelectionRange();t.end.row=t.start.row,t.end.column=t.start.column,this.inComposition.markerRange=t,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},e.prototype.onCompositionUpdate=function(){if(this.inComposition&&this.host.onCompositionUpdate&&!this.host.$readOnly){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var e=this.text.value;this.sendText(e),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},e.prototype.onCompositionEnd=function(e){this.host.onCompositionEnd&&!this.host.$readOnly&&(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),e&&this.onInput())},e.prototype.onCut=function(e){this.doCopy(e,!0)},e.prototype.onCopy=function(e){this.doCopy(e,!1)},e.prototype.onPaste=function(e){var t=this.handleClipboardData(e);l.pasteCancelled()||("string"==typeof t?(t&&this.host.onPaste(t,e),r.isIE&&setTimeout(this.resetSelection),n.preventDefault(e)):(this.text.value="",this.pasted=!0))},e.prototype.doCopy=function(e,t){var i=this,o=this.host.getCopyText();if(!o)return n.preventDefault(e);this.handleClipboardData(e,o)?(f&&(this.resetSelection(o),this.copied=o,setTimeout((function(){i.copied=!1}),10)),t?this.host.onCut():this.host.onCopy(),n.preventDefault(e)):(this.copied=!0,this.text.value=o,this.text.select(),setTimeout((function(){i.copied=!1,i.resetSelection(),t?i.host.onCut():i.host.onCopy()})))},e.prototype.handleClipboardData=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!c){var o=h||i?"Text":"text/plain";try{return t?!1!==n.setData(o,t):n.getData(o)}catch(e){if(!i)return this.handleClipboardData(e,t,!0)}}},e.prototype.onInput=function(e){if(this.inComposition)return this.onCompositionUpdate();if(e&&e.inputType){if("historyUndo"==e.inputType)return this.host.execCommand("undo");if("historyRedo"==e.inputType)return this.host.execCommand("redo")}var t=this.text.value,i=this.sendText(t,!0);(t.length>500||m.test(i)||y&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},e.prototype.sendText=function(e,t){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),e&&this.host.onPaste(e),this.pasted=!1,"";for(var i=this.text.selectionStart,n=this.text.selectionEnd,o=this.lastSelectionStart,s=this.lastValue.length-this.lastSelectionEnd,a=e,l=e.length-i,c=e.length-n,h=0;o>0&&this.lastValue[h]==e[h];)h++,o--;for(a=a.slice(h),h=1;s>0&&this.lastValue.length-h>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-h]==e[e.length-h];)h++,s--;l-=h-1,c-=h-1;var u=a.length-h+1;if(u<0&&(o=-u,u=0),a=a.slice(0,u),!(t||a||l||o||s||c))return"";this.sendingText=!0;var d=!1;return r.isAndroid&&". "==a&&(a=" ",d=!0),a&&!o&&!s&&!l&&!c||this.commandMode?this.host.onTextInput(a):this.host.onTextInput(a,{extendLeft:o,extendRight:s,restoreStart:l,restoreEnd:c}),this.sendingText=!1,this.lastValue=e,this.lastSelectionStart=i,this.lastSelectionEnd=n,this.lastRestoreEnd=c,d?"\n":a},e.prototype.onSelect=function(e){var t=this;this.inComposition||(this.copied?this.copied=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=t.lastValue.length&&e.value===t.lastValue&&t.lastValue&&e.selectionEnd!==t.lastSelectionEnd}(this.text)?(this.host.selectAll(),this.resetSelection()):y&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection())},e.prototype.$resetSelectionIOS=function(e){if(this.$isFocused&&(!this.copied||e)&&!this.sendingText){e||(e="");var t="\n ab"+e+"cde fg\n";t!=this.text.value&&(this.text.value=this.lastValue=t);var i=4+(e.length||(this.host.selection.isEmpty()?0:1));(4!=this.lastSelectionStart||this.lastSelectionEnd!=i)&&this.text.setSelectionRange(4,i),this.lastSelectionStart=4,this.lastSelectionEnd=i}},e.prototype.$resetSelection=function(){var e=this;if(!this.inComposition&&!this.sendingText&&(this.$isFocused||this.afterContextMenu)){this.inComposition=!0;var t=0,i=0,n="",o=function(t,i){for(var n=i,o=1;o<=t-e.rowStart&&o<2*e.numberOfExtraLines+1;o++)n+=e.host.session.getLine(t-o).length+1;return n};if(this.host.session){var r=this.host.selection,s=r.getRange(),a=r.cursor.row;a===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):a===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(a<this.rowStart-1||a>this.rowEnd+1)&&(this.rowStart=a>this.numberOfExtraLines?a-this.numberOfExtraLines:0,this.rowEnd=a>this.numberOfExtraLines?a+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var l=[],c=this.rowStart;c<=this.rowEnd;c++)l.push(this.host.session.getLine(c));if(n=l.join("\n"),t=o(s.start.row,s.start.column),i=o(s.end.row,s.end.column),s.start.row<this.rowStart){var h=this.host.session.getLine(this.rowStart-1);t=s.start.row<this.rowStart-1?0:t,i+=h.length+1,n=h+"\n"+n}else if(s.end.row>this.rowEnd){var u=this.host.session.getLine(this.rowEnd+1);i=s.end.row>this.rowEnd+1?u.length:s.end.column,i+=n.length+1,n=n+"\n"+u}else y&&a>0&&(n="\n"+n,i+=1,t+=1);n.length>d&&(t<d&&i<d?n=n.slice(0,d):(n="\n",t==i?t=i=0:(t=0,i=1)));var p=n+"\n\n";p!=this.lastValue&&(this.text.value=this.lastValue=p,this.lastSelectionStart=this.lastSelectionEnd=p.length)}if(this.afterContextMenu&&(this.las