/*! For license information please see index.js.LICENSE.txt */ (()=>{var __webpack_modules__={44:(e,t,a)=>{e=a.nmd(e),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,a){"use strict";var n=e("./lib/dom"),s=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,i=e("./lib/lang"),r=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,d=e("./tokenizer").Tokenizer,h=e("./clipboard"),g={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,a){var n=e.session.getTextRange();return a?n.replace(/\n\r?([ \t]*\S)/g,"\n"+a+"$1"):n},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return h.getText&&h.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:p.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:p.bind(null,{year:"2-digit"}),CURRENT_MONTH:p.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:p.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:"short"}),CURRENT_DATE:p.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:p.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:"short"}),CURRENT_HOUR:p.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:"2-digit"}),CURRENT_SECOND:p.bind(null,{second:"2-digit"})};function p(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}g.SELECTED_TEXT=g.SELECTION;var u=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=g}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function a(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+a("/")+"+)/",onMatch:function(e,t,a){var n=a[0];return n.fmtString=!0,n.guard=e.slice(1,-1),n.flag="",""},next:"formatString"};return e.$tokenizer=new d({start:[{regex:/\\./,onMatch:function(e,t,a){var n=e[1];return("}"==n&&a.length||-1!="`$\\".indexOf(n))&&(e=n),[e]}},{regex:/}/,onMatch:function(e,t,a){return[a.length?a.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:t},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,a,n){var s=t(e.substr(1));return n.unshift(s[0]),s},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+a("\\|")+"*\\|",onMatch:function(e,t,a){var n=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return a[0].choices=n,[n[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,a){return a.length&&a[0].expectElse?(a[0].expectElse=!1,a[0].ifEnd={elseEnd:a[0]},[a[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,a){var n=e[1];return"}"==n&&a.length||-1!="`$\\".indexOf(n)?e=n:"n"==n?e="\n":"t"==n?e="\t":-1!="ulULE".indexOf(n)&&(e={changeCase:n,local:n>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,a){var n=a.shift();return n&&(n.flag=e.slice(1,-1)),this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,a){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,a){var n={text:e.slice(2)};return a.unshift(n),[n]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,a){var n=a.shift();return this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,a){return a[0].formatFunction=e.slice(2,-1),[a.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,a){"+"==e[1]&&(a[0].ifEnd=a[0]),"?"==e[1]&&(a[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},e.prototype.getVariableValue=function(e,t,a){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var n=this.variables[t];return"function"==typeof n&&(n=this.variables[t](e,t,a)),null==n?"":n},e.prototype.tmStrFormat=function(e,t,a){if(!t.fmt)return e;var n=t.flag||"",s=t.guard;s=new RegExp(s,n.replace(/[^gim]/g,""));var o="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,i=this,r=e.replace(s,(function(){var e=i.variables.__;i.variables.__=[].slice.call(arguments);for(var t=i.resolveVariables(o,a),n="E",s=0;s=0&&o.splice(i,1)}}e.content?s(e):Array.isArray(e)&&e.forEach(s)},e.prototype.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,a=[],n={},s=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=s.exec(e);){if(t[1])try{n=JSON.parse(t[1]),a.push(n)}catch(e){}if(t[4])n.content=t[4].replace(/^\t/gm,""),a.push(n),n={};else{var o=t[2],i=t[3];if("regex"==o){var r=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=r.exec(i)[1],n.trigger=r.exec(i)[1],n.endTrigger=r.exec(i)[1],n.endGuard=r.exec(i)[1]}else"snippet"==o?(n.tabTrigger=i.match(/^\S*/)[0],n.name||(n.name=i)):o&&(n[o]=i)}}return a},e.prototype.getSnippetByName=function(e,t){var a,n=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var s=n[t];return s&&(a=s[e]),!!a}),this),a},e}();s.implement(u.prototype,o);var m=function(e,t,a){void 0===a&&(a={});var n=e.getCursorPosition(),s=e.session.getLine(n.row),o=e.session.getTabString(),i=s.match(/^\s*/)[0];n.column1?(w=t[t.length-1].length,f+=t.length-1):w+=e.length,b+=e}else e&&(e.start?e.end={row:f,column:w}:e.start={row:f,column:w})})),{text:b,tabstops:l,tokens:r}},v=function(){function e(e){if(this.index=0,this.ranges=[],this.tabstops=[],e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=i.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}return e.prototype.attach=function(e){this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.session=e.session,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},e.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},e.prototype.onChange=function(e){for(var t="r"==e.action[0],a=this.selectedTabstop||{},n=a.parents||{},s=this.tabstops.slice(),o=0;o2&&(this.tabstops.length&&o.push(o.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,o))},e.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},e.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},e.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var e=this.selectedTabstop.snippetId;0===this.selectedTabstop.index&&e--,this.tabstops.forEach((function(t){t.snippetId===e?this.addTabstopMarkers(t):this.removeTabstopMarkers(t)}),this)}},e.prototype.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},e}();v.prototype.keyboardHandler=new c,v.prototype.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var f=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},w=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};n.importCssString("\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}","snippets.css",!1),t.snippetManager=new u;var b=e("./editor").Editor;(function(){this.insertSnippet=function(e,a){return t.snippetManager.insertSnippet(this,e,a)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(b.prototype)})),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"],(function(e,t,a){"use strict";var n=e("../virtual_renderer").VirtualRenderer,s=e("../editor").Editor,o=e("../range").Range,i=e("../lib/event"),r=e("../lib/lang"),l=e("../lib/dom"),c=e("../config").nls,d=e("./../lib/useragent"),h=function(e){return"suggest-aria-id:".concat(e)},g=d.isSafari?"menu":"listbox",p=d.isSafari?"menuitem":"option",u=d.isSafari?"aria-current":"aria-selected",m=function(e){var t=new n(e);t.$maxLines=4;var a=new s(t);return a.setHighlightActiveLine(!1),a.setShowPrintMargin(!1),a.renderer.setShowGutter(!1),a.renderer.setHighlightGutterLine(!1),a.$mouseHandler.$focusTimeout=0,a.$highlightTagPending=!0,a};l.importCssString('\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: "";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n',"autocompletion.css",!1),t.AcePopup=function(e){var t=l.createElement("div"),a=m(t);e&&e.appendChild(t),t.style.display="none",a.renderer.content.style.cursor="default",a.renderer.setStyle("ace_autocomplete"),a.renderer.$textLayer.element.setAttribute("role",g),a.renderer.$textLayer.element.setAttribute("aria-roledescription",c("autocomplete.popup.aria-roledescription","Autocomplete suggestions")),a.renderer.$textLayer.element.setAttribute("aria-label",c("autocomplete.popup.aria-label","Autocomplete suggestions")),a.renderer.textarea.setAttribute("aria-hidden","true"),a.setOption("displayIndentGuides",!1),a.setOption("dragDelay",150);var n,s=function(){};a.focus=s,a.$isFocused=!0,a.renderer.$cursorLayer.restartTimer=s,a.renderer.$cursorLayer.element.style.opacity="0",a.renderer.$maxLines=8,a.renderer.$keepTextAreaAtCursor=!1,a.setHighlightActiveLine(!1),a.session.highlight(""),a.session.$searchHighlight.clazz="ace_highlight-marker",a.on("mousedown",(function(e){var t=e.getDocumentPosition();a.selection.moveToPosition(t),v.start.row=v.end.row=t.row,e.stop()}));var d=new o(-1,0,-1,1/0),v=new o(-1,0,-1,1/0);v.id=a.session.addMarker(v,"ace_active-line","fullLine"),a.setSelectOnHover=function(e){e?d.id&&(a.session.removeMarker(d.id),d.id=null):d.id=a.session.addMarker(d,"ace_line-hover","fullLine")},a.setSelectOnHover(!1),a.on("mousemove",(function(e){if(n){if(n.x!=e.x||n.y!=e.y){(n=e).scrollTop=a.renderer.scrollTop,a.isMouseOver=!0;var t=n.getDocumentPosition().row;d.start.row!=t&&(d.id||a.setRow(t),w(t))}}else n=e})),a.renderer.on("beforeRender",(function(){if(n&&-1!=d.start.row){n.$pos=null;var e=n.getDocumentPosition().row;d.id||a.setRow(e),w(e,!0)}})),a.renderer.on("afterRender",(function(){for(var e=a.renderer.$textLayer,t=e.config.firstRow,n=e.config.lastRow;t<=n;t++){var s=e.element.childNodes[t-e.config.firstRow];s.setAttribute("role",p),s.setAttribute("aria-roledescription",c("autocomplete.popup.item.aria-roledescription","item")),s.setAttribute("aria-setsize",a.data.length),s.setAttribute("aria-describedby","doc-tooltip"),s.setAttribute("aria-posinset",t+1);var o=a.getData(t);if(o){var i="".concat(o.caption||o.value).concat(o.meta?", ".concat(o.meta):"");s.setAttribute("aria-label",i)}s.querySelectorAll(".ace_completion-highlight").forEach((function(e){e.setAttribute("role","mark")}))}})),a.renderer.on("afterRender",(function(){var e=a.getRow(),t=a.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow],s=document.activeElement;if(n!==a.selectedNode&&a.selectedNode&&(l.removeCssClass(a.selectedNode,"ace_selected"),a.selectedNode.removeAttribute(u),a.selectedNode.removeAttribute("id")),s.removeAttribute("aria-activedescendant"),a.selectedNode=n,n){var o=h(e);l.addCssClass(n,"ace_selected"),n.id=o,t.element.setAttribute("aria-activedescendant",o),s.setAttribute("aria-activedescendant",o),n.setAttribute(u,"true")}}));var f=function(){w(-1)},w=function(e,t){e!==d.start.row&&(d.start.row=d.end.row=e,t||a.session._emit("changeBackMarker"),a._emit("changeHoverMarker"))};a.getHoveredRow=function(){return d.start.row},i.addListener(a.container,"mouseout",(function(){a.isMouseOver=!1,f()})),a.on("hide",f),a.on("changeSelection",f),a.session.doc.getLength=function(){return a.data.length},a.session.doc.getLine=function(e){var t=a.data[e];return"string"==typeof t?t:t&&t.value||""};var b=a.session.bgTokenizer;return b.$tokenizeRow=function(e){var t=a.data[e],n=[];if(!t)return n;"string"==typeof t&&(t={value:t});var s=t.caption||t.value||t.name;function o(e,a){e&&n.push({type:(t.className||"")+(a||""),value:e})}for(var i=s.toLowerCase(),r=(a.filterText||"").toLowerCase(),l=0,c=0,d=0;d<=r.length;d++)if(d!=c&&(t.matchMask&1<=h?"bottom":"top"),"top"===s?(g.bottom=e.top-this.$borderSize,g.top=g.bottom-h):"bottom"===s&&(g.top=e.top+t+this.$borderSize,g.bottom=g.top+h);var m=g.top>=0&&g.bottom<=l;if(!o&&!m)return!1;d.$maxPixelHeight=m?null:"top"===s?u:p,"top"===s?(i.style.top="",i.style.bottom=l+r-g.bottom+"px",a.isTopdown=!1):(i.style.top=g.top+"px",i.style.bottom="",a.isTopdown=!0),i.style.display="";var v=e.left;return v+i.offsetWidth>c&&(v=c-i.offsetWidth),i.style.left=v+"px",i.style.right="",a.isOpen||(a.isOpen=!0,this._signal("show"),n=null),a.anchorPos=e,a.anchor=s,!0},a.show=function(e,t,a){this.tryShow(e,t,a?"bottom":void 0,!0)},a.goTo=function(e){var t=this.getRow(),a=this.session.getLength()-1;switch(e){case"up":t=t<=0?a:t-1;break;case"down":t=t>=a?-1:t+1;break;case"start":t=0;break;case"end":t=a}this.setRow(t)},a.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},a.$imageSize=0,a.$borderSize=1,a},t.$singleLineEditor=m,t.getAriaId=h})),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],(function(e,t,a){"use strict";var n=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,a=t.element.childNodes[e-t.config.firstRow];if(a){for(var n="doc-tooltip ",s=0;s=0&&a.test(e[o]);o--)s.push(e[o]);return s.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,a){a=a||n;for(var s=[],o=t;o0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var a=this.popup.getData(t);!a||e&&!a.hideInlinePreview||this.$seen(a)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(!this.$elements&&this.editor){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener("scroll",this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach((function(t){t.removeEventListener("scroll",e.onLayoutChange,{passive:!0})})),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,a=t.layerConfig.lineHeight,n=t.$cursorLayer.getPixelPosition(this.base,!0);n.left-=this.popup.getTextLeftOffset();var s=e.container.getBoundingClientRect();n.top+=s.top-t.layerConfig.offset,n.left+=s.left-e.renderer.scrollLeft,n.left+=t.gutterWidth;var o={top:n.top,left:n.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(o.top+=t.$ghostTextWidget.el.offsetHeight);var i=e.container.getBoundingClientRect().bottom-a,r=ithis.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else t=this.all;this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort((function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)}));var a=null;t=t.filter((function(e){var t=e.snippet||e.caption||e.value;return t!==a&&(a=t,!0)})),this.filtered=t},e.prototype.filterCompletions=function(e,t){var a=[],n=t.toUpperCase(),s=t.toLowerCase();e:for(var o,i=0;o=e[i];i++)if(o.skipFilter)o.$score=o.score,a.push(o);else{var r=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(r){var l,c,d=-1,h=0,g=0;if(this.exactMatch){if(t!==r.substr(0,t.length))continue e}else{var p=r.toLowerCase().indexOf(s);if(p>-1)g=p;else for(var u=0;u=0&&(v<0||m0&&(-1===d&&(g+=10),g+=c,h|=1<",i.escapeHTML(e.caption),"","
",i.escapeHTML((t=e.snippet,a={},t.replace(/\${(\d+)(:(.*?))?}/g,(function(e,t,n,s){return a[t]=s||""})).replace(/\$(\d+?)/g,(function(e,t){return a[t]}))))].join(""))},id:"snippetCompleter"},h=[d,l,c];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=l,t.keyWordCompleter=c,t.snippetCompleter=d;var g,p={name:"expandSnippet",exec:function(e){return n.expandWithTab(e)},bindKey:"Tab"},u=function(e,t){m(t.session.$mode)},m=function(e){"string"==typeof e&&(e=o.$modes[e]),e&&(n.files||(n.files={}),v(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(m))},v=function(e,t){t&&e&&!n.files[e]&&(n.files[e]={},o.loadModule(t,(function(t){t&&(n.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=n.parseSnippetFile(t.snippetText)),n.register(t.snippets||[],t.scope),t.includeScopes&&(n.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){m("ace/mode/"+e)}))))})))},f=function(e){var t=e.editor,a=t.completer&&t.completer.activated;if("backspace"===e.command.name)a&&!r.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name&&!a){g=e;var n=e.editor.$liveAutocompletionDelay;n?w.delay(n):b(e)}},w=i.delayedCall((function(){b(g)}),0),b=function(e){var t=e.editor,a=r.getCompletionPrefix(t),n=e.args,o=r.triggerAutocomplete(t,n);if(a&&a.length>=t.$liveAutocompletionThreshold||o){var i=s.for(t);i.autoShown=!0,i.showPopup(t)}},y=e("../editor").Editor;e("../config").defineOptions(y.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(s.startCommand)):this.commands.removeCommand(s.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",f)):this.commands.off("afterExec",f)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(p),this.on("changeMode",u),u(0,this)):(this.commands.removeCommand(p),this.off("changeMode",u))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},135:(e,t,a)=>{e.exports=a(795)()},186:(e,t,a)=>{e=a.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,a,n){"string"==typeof e?(2==arguments.length&&(n=a),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 a,n,s=function(e,t,a){if("string"==typeof t){var n=r(e,t);if(null!=n)return a&&a(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],i=0,l=t.length;ia.length)&&(t=a.length),t-=e.length;var n=a.indexOf(e,t);return-1!==n&&n===t})),String.prototype.repeat||n(String.prototype,"repeat",(function(e){for(var t="",a=this;e>0;)1&e&&(t+=a),(e>>=1)&&(a+=a);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),a=1;a>>0,n=0|arguments[1],s=n<0?Math.max(a+n,0):Math.min(n,a),o=arguments[2],i=void 0===o?a:0|o,r=i<0?Math.max(a+i,0):Math.min(i,a);s0;)1&t&&(a+=e),(t>>=1)&&(e+=e);return a};var n=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var a in e)t[a]=e[a];return t},t.copyArray=function(e){for(var t=[],a=0,n=e.length;a65535?2:1}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,a){"use strict";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:{},s=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"",i=n.appName||"";t.isWin="win"==s,t.isMac="mac"==s,t.isLinux="linux"==s,t.isIE="Microsoft Internet Explorer"==i||i.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="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(o.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,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,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,a){"use strict";var n,s=e("./useragent");t.buildDom=function e(t,a,n){if("string"==typeof t&&t){var s=document.createTextNode(t);return a&&a.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&a&&a.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var o=[],i=0;i=1.5,s.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),s.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,a){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(a)+"px)"}:t.translate=function(e,t,a){e.style.top=Math.round(a)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("./dom");t.get=function(e,t){var a=new XMLHttpRequest;a.open("GET",e,!0),a.onreadystatechange=function(){4===a.readyState&&t(a.responseText)},a.send(null)},t.loadScript=function(e,t){var a=n.getDocumentHead(),s=document.createElement("script");s.src=e,a.appendChild(s),s.onload=s.onreadystatechange=function(e,a){!a&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,a||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,a){"use strict";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 a in t)e[a]=t[a];return e},t.implement=function(e,a){t.mixin(e,a)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,a){"use strict";var n={},s=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var a=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(a.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=o),a=a.slice();for(var i=0;i1&&(s=a[a.length-2]);var i=l[t+"Path"];return null==i?i=l.basePath:"/"==n&&(t=n=""),i&&"/"!=i.slice(-1)&&(i+="/"),i+t+n+s+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){r=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(a,n){var o;if(Array.isArray(a))var i=a[0],l=a[1];else"string"==typeof a&&(l=a);var d=function(a){if(a&&!t.$loading[l])return n&&n(a);if(t.$loading[l]||(t.$loading[l]=[]),t.$loading[l].push(n),!(t.$loading[l].length>1)){var o=function(){!function(t,a){"ace/theme/textmate"===t||"./theme/textmate"===t?a(0,e("./theme/textmate")):r?r(t,a):console.error("loader is not configured")}(l,(function(e,a){a&&(t.$loaded[l]=a),t._emit("load.module",{name:l,module:a});var n=t.$loading[l];t.$loading[l]=null,n.forEach((function(e){e&&e(a)}))}))};if(!t.get("packaged"))return o();s.loadScript(t.moduleUrl(l,i),o),c()}};if(t.dynamicModules[l])t.dynamicModules[l]().then((function(e){e.default?d(e.default):d(e)}));else{try{o=this.$require(l)}catch(e){}d(o||t.$loaded[l])}},t.$require=function(e){if("function"==typeof a.require)return a.require(e)},t.setModuleLoader=function(e,a){t.dynamicModules[e]=a};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};t.version="1.43.1"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var s=e("./config");s.setLoader((function(t,a){e([t],(function(e){a(null,e)}))}));var o=function(){return this||"undefined"!=typeof window&&window}();function i(t){if(o&&o.document){s.set("packaged",t||e.packaged||n.packaged||o.define&&a.amdD.packaged);var i={},r="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(r=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var d,h=c.getElementsByTagName("script"),g=0;g ["+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,a=e.end,n=e.start;return 1==(t=this.compare(a.row,a.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?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.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,a){if(this.end.row>a)var n={row:a+1,column:0};else this.end.rowa)var s={row:a+1,column:0};else this.start.row1?++h>4&&(h=1):h=1,o.isIE){var i=Math.abs(e.clientX-r)>5||Math.abs(e.clientY-l)>5;c&&!i||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),a[h-1]||600),1==h&&(r=e.clientX,l=e.clientY)}if(e._clicks=h,n[s]("mousedown",e),h>4)h=0;else if(h>1)return n[s](g[h],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){d(e,"mousedown",p,i)}))},t.getModifierString=function(e){return s.KEY_MODS[g(e)]},t.addCommandKeyListener=function(e,a,n){var l=null;d(e,"keydown",(function(e){i[e.keyCode]=(i[e.keyCode]||0)+1;var t=function(e,t,a){var n=g(t);if(!a&&t.code&&(a=s.$codeToKeyCode[t.code]||a),!o.isMac&&i){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),i.altGr){if(!(3&~n))return;i.altGr=0}if(18===a||17===a){var l=t.location;17===a&&1===l?1==i[a]&&(r=t.timeStamp):18===a&&3===n&&2===l&&t.timeStamp-r<50&&(i.altGr=!0)}}if(a in s.MODIFIER_KEYS&&(a=-1),n||13!==a||3!==t.location||(e(t,n,-a),!t.defaultPrevented)){if(o.isChromeOS&&8&n){if(e(t,n,a),t.defaultPrevented)return;n&=-9}return!!(n||a in s.FUNCTION_KEYS||a in s.PRINTABLE_KEYS)&&e(t,n,a)}}(a,e,e.keyCode);return l=e.defaultPrevented,t}),n),d(e,"keypress",(function(e){l&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),l=null)}),n),d(e,"keyup",(function(e){i[e.keyCode]=null}),n),i||(p(),d(window,"focus",p))},"object"==typeof window&&window.postMessage&&!o.isOldIE){var u=1;t.nextTick=function(e,a){a=a||window;var n="zero-timeout-message-"+u++,s=function(o){o.data==n&&(t.stopPropagation(o),h(a,"message",s),e())};d(a,"message",s),a.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,a){return setTimeout((function a(){t.$idleBlocked?setTimeout(a,100):e()}),a)},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,a){"use strict";var n;a.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,a){"use strict";var n=e("../lib/event"),s=e("../config").nls,o=e("../lib/useragent"),i=e("../lib/dom"),r=e("../lib/lang"),l=e("../clipboard"),c=o.isChrome<18,d=o.isIE,h=o.isChrome>63,g=400,p=e("../lib/keys"),u=p.KEY_MODS,m=o.isIOS,v=m?/\s/:/\n/,f=o.isMobile,w=function(){function e(e,t){var a=this;this.host=t,this.text=i.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","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="",f||(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){a.ignoreFocusEvents||(t.onBlur(e),a.$isFocused=!1)}),t),n.addListener(this.text,"focus",(function(e){if(!a.ignoreFocusEvents){if(a.$isFocused=!0,o.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),o.isEdge?setTimeout(a.resetSelection.bind(a)):a.resetSelection()}}),t),this.$focusScroll=!1,t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;if("insertstring"!=n){var s=n&&(e.docChanged||e.selectionChanged);a.inComposition&&s&&(a.lastValue=a.text.value="",a.onCompositionEnd()),a.resetSelection()}})),t.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=m?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&t.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,n.addCommandKeyListener(this.text,(function(e,n,s){if(!a.inComposition)return t.onCommandKey(e,n,s)}),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((!o.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:a.onCopy(e);break;case 86:a.onPaste(e);break;case 88:a.onCut(e)}}),t),this.syncComposition=r.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(),a.onContextMenuClose()}),t),n.addListener(t.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),t),n.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),t),m&&this.addIosSelectionHandler(e,t,this.text)}return e.prototype.addIosSelectionHandler=function(e,t,a){var n=this,s=null,o=!1;a.addEventListener("keydown",(function(e){s&&clearTimeout(s),o=!0}),!0),a.addEventListener("keyup",(function(e){s=setTimeout((function(){o=!1}),100)}),!0);var i=function(e){if(document.activeElement===a&&!(o||n.inComposition||t.$mouseHandler.isMousePressed||n.copied)){var s=a.selectionStart,i=a.selectionEnd,r=null,l=0;if(0==s?r=p.up:1==s?r=p.home:i>n.lastSelectionEnd&&"\n"==n.lastValue[i]?r=p.end:sn.lastSelectionEnd&&n.lastValue.slice(0,i).split("\n").length>2?r=p.down:i>n.lastSelectionEnd&&" "==n.lastValue[i-1]?(r=p.right,l=u.option):(i>n.lastSelectionEnd||i==n.lastSelectionEnd&&n.lastSelectionEnd!=n.lastSelectionStart&&s==i)&&(r=p.right),s!==i&&(l|=u.shift),r){if(!t.onCommandKey({},l,r)&&t.commands){r=p.keyCodeToString(r);var c=t.commands.findKeyCommand(l,r);c&&t.execCommand(c)}n.lastSelectionStart=s,n.lastSelectionEnd=i,n.resetSelection("")}}};document.addEventListener("selectionchange",i),t.on("destroy",(function(){document.removeEventListener("selectionchange",i)}))},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.length500||v.test(a)||f&&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 a=this.text.selectionStart,n=this.text.selectionEnd,s=this.lastSelectionStart,i=this.lastValue.length-this.lastSelectionEnd,r=e,l=e.length-a,c=e.length-n,d=0;s>0&&this.lastValue[d]==e[d];)d++,s--;for(r=r.slice(d),d=1;i>0&&this.lastValue.length-d>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-d]==e[e.length-d];)d++,i--;l-=d-1,c-=d-1;var h=r.length-d+1;if(h<0&&(s=-h,h=0),r=r.slice(0,h),!(t||r||l||s||i||c))return"";this.sendingText=!0;var g=!1;return o.isAndroid&&". "==r&&(r=" ",g=!0),r&&!s&&!i&&!l&&!c||this.commandMode?this.host.onTextInput(r):this.host.onTextInput(r,{extendLeft:s,extendRight:i,restoreStart:l,restoreEnd:c}),this.sendingText=!1,this.lastValue=e,this.lastSelectionStart=a,this.lastSelectionEnd=n,this.lastRestoreEnd=c,g?"\n":r},e.prototype.onSelect=function(e){var t,a=this;this.inComposition||(this.copied?this.copied=!1:0===(t=this.text).selectionStart&&t.selectionEnd>=a.lastValue.length&&t.value===a.lastValue&&a.lastValue&&t.selectionEnd!==a.lastSelectionEnd?(this.host.selectAll(),this.resetSelection()):f&&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 a=4+(e.length||(this.host.selection.isEmpty()?0:1));4==this.lastSelectionStart&&this.lastSelectionEnd==a||this.text.setSelectionRange(4,a),this.lastSelectionStart=4,this.lastSelectionEnd=a}},e.prototype.$resetSelection=function(){var e=this;if(!this.inComposition&&!this.sendingText&&(this.$isFocused||this.afterContextMenu)){this.inComposition=!0;var t=0,a=0,n="",s=function(t,a){for(var n=a,s=1;s<=t-e.rowStart&&s<2*e.numberOfExtraLines+1;s++)n+=e.host.session.getLine(t-s).length+1;return n};if(this.host.session){var o=this.host.selection,i=o.getRange(),r=o.cursor.row;r===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):r===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(rthis.rowEnd+1)&&(this.rowStart=r>this.numberOfExtraLines?r-this.numberOfExtraLines:0,this.rowEnd=r>this.numberOfExtraLines?r+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=s(i.start.row,i.start.column),a=s(i.end.row,i.end.column),i.start.rowthis.rowEnd){var h=this.host.session.getLine(this.rowEnd+1);a=i.end.row>this.rowEnd+1?h.length:i.end.column,a+=n.length+1,n=n+"\n"+h}else f&&r>0&&(n="\n"+n,a+=1,t+=1);n.length>g&&(t1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var a=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?a.selection.selectToPosition(e):t||a.selection.moveToPosition(e),t||this.select(),a.setStyle("ace_selecting"),this.setState("select"))},e.prototype.select=function(){var e,t=this.editor,a=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(a);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var s=o(this.$clickSelection,a);a=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(a),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,a=this.editor,n=a.renderer.screenToTextCoordinates(this.x,this.y),s=a.selection[e](n.row,n.column);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(s.start),r=this.$clickSelection.comparePoint(s.end);if(-1==i&&r<=0)t=this.$clickSelection.end,s.end.row==n.row&&s.end.column==n.column||(n=s.start);else if(1==r&&i>=0)t=this.$clickSelection.start,s.start.row==n.row&&s.start.column==n.column||(n=s.end);else if(-1==i&&1==r)n=s.end,t=s.start;else{var l=o(this.$clickSelection,n);n=l.cursor,t=l.anchor}a.selection.setSelectionAnchor(t.row,t.column)}a.selection.selectToPosition(n),a.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e,t,a,n,s=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,a=this.x,n=this.y,Math.sqrt(Math.pow(a-e,2)+Math.pow(n-t,2))),o=Date.now();(s>0||o-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),a=this.editor,n=a.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=a.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),a=this.editor;this.setState("selectByLines");var n=a.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=a.selection.getLineRange(n.start.row),this.$clickSelection.end=a.selection.getLineRange(n.end.row).end):this.$clickSelection=a.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()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var a=this.$lastScroll,n=e.domEvent.timeStamp,s=n-a.t,o=s?e.wheelX/s:a.vx,i=s?e.wheelY/s:a.vy;s<550&&(o=(o+a.vx)/2,i=(i+a.vy)/2);var r=Math.abs(o/i),l=!1;return r>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),r<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?a.allowed=n:n-a.allowed<550&&(Math.abs(o)<=1.5*Math.abs(a.vx)&&Math.abs(i)<=1.5*Math.abs(a.vy)?(l=!0,a.allowed=n):a.allowed=0),a.t=n,a.vx=o,a.vy=i,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},e}();function o(e,t){if(e.start.row==e.end.row)var a=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)a=2*t.row-e.start.row-e.end.row;else a=t.column-4;return a<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}s.prototype.selectEnd=s.prototype.selectByLinesEnd,s.prototype.selectAllEnd=s.prototype.selectByLinesEnd,s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd,t.DefaultHandlers=s})),ace.define("ace/lib/scroll",["require","exports","module"],(function(e,t,a){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],n=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=e("./lib/dom"),r=(e("./lib/event"),e("./range").Range),l=e("./lib/scroll").preventParentScroll,c="ace_tooltip",d=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=i.createElement("div"),this.$element.className=c,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),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){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){i.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,a){null!=e&&this.setText(e),null!=t&&null!=a&&this.setPosition(t,a),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=c,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),h=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);-1!==t&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,a,n;this.popups.sort((function(e,t){return t.priority-e.priority}));var s=[];try{for(var i=o(this.popups),r=i.next();!r.done;r=i.next()){var l=r.value,c=!0;try{for(var d=(a=void 0,o(s)),h=d.next();!h.done;h=d.next()){var g=h.value;if(this.doPopupsOverlap(g,l)){c=!1;break}}}catch(e){a={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(a)throw a.error}}c?s.push(l):l.hide()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var a=e.getElement().getBoundingClientRect(),n=t.getElement().getBoundingClientRect();return a.leftn.left&&a.topn.top},e}());t.popupManager=h,t.Tooltip=d;var g=function(e){function t(t){void 0===t&&(t=document.body);var a=e.call(this,t)||this;a.timeout=void 0,a.lastT=0,a.idleTime=350,a.lastEvent=void 0,a.onMouseOut=a.onMouseOut.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.waitForHover=a.waitForHover.bind(a),a.hide=a.hide.bind(a);var n=a.getElement();return n.style.whiteSpace="pre-wrap",n.style.pointerEvents="auto",n.addEventListener("mouseout",a.onMouseOut),n.tabIndex=-1,n.addEventListener("blur",function(){n.contains(document.activeElement)||this.hide()}.bind(a)),n.addEventListener("wheel",l),a}return s(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var a=t.$mouseHandler.isMousePressed;if(this.isOpen){var n=this.lastEvent&&this.lastEvent.getDocumentPosition();this.range&&this.range.contains(n.row,n.column)&&!a&&!this.isOutsideOfText(this.lastEvent)||this.hide()}this.timeout||a||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;this.idleTime-e>10?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},t.prototype.isOutsideOfText=function(e){var t=e.editor,a=e.getDocumentPosition(),n=t.session.getLine(a.row);if(a.column==n.length){var s=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),o=t.session.documentToScreenPosition(a.row,a.column);if(o.column!=s.column||o.row!=s.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,a,n){if(!(n&&n!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement())){var s=e.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(s.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=r.fromPoints(t.start,t.end);var o=s.textToScreenCoordinates(t.start.row,t.start.column),i=s.scroller.getBoundingClientRect();o.pageX=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=e("../lib/dom"),r=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GUTTER_TOOLTIP_LEFT_OFFSET=5,t.GUTTER_TOOLTIP_TOP_OFFSET=3,t.GutterHandler=function(e){var t,a,n=e.editor,s=n.renderer.$gutterLayer,o=new d(n,!0);function l(e){e&&"keydown"===e.type&&(e.ctrlKey||e.metaKey)||(!e||"mouseout"!==e.type||e.relatedTarget&&!o.getElement().contains(e.relatedTarget))&&(t&&(t=clearTimeout(t)),o.isOpen&&(o.hideTooltip(),n.off("mousewheel",l),n.off("changeSession",l),window.removeEventListener("keydown",l,!0)))}function c(e){o.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(n.isFocused()&&0==t.getButton()&&"foldWidgets"!=s.getRegion(t)){var a=t.getDocumentPosition().row,o=n.session.selection;if(t.getShiftKey())o.selectTo(a,0);else{if(2==t.domEvent.detail)return n.selectAll(),t.preventDefault();e.$clickSelection=n.selection.getLineRange(a)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(r){var d=r.domEvent.target||r.domEvent.srcElement;if(i.hasCssClass(d,"ace_fold-widget")||i.hasCssClass(d,"ace_custom-widget"))return l();o.isOpen&&e.$tooltipFollowsMouse&&c(r),a=r,t||(t=setTimeout((function(){t=null,a&&!e.isMousePressed&&function(){var t=a.getDocumentPosition().row;if(t==n.session.getLength()){var i=n.renderer.pixelToScreenCoordinates(0,a.y).row,r=a.$pos;if(i>n.session.documentToScreenRow(r.row,r.column))return l()}if(o.showTooltip(t),o.isOpen)if(n.on("mousewheel",l),n.on("changeSession",l),window.addEventListener("keydown",l,!0),e.$tooltipFollowsMouse)c(a);else{var d=a.getGutterRow(),h=s.$lines.get(d);if(h){var g=h.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),p=o.getElement().style;p.left=g.right-5+"px",p.top=g.bottom-3+"px"}else c(a)}}()}),50))})),r.addListener(n.renderer.$gutter,"mouseout",(function(e){a=null,o.isOpen&&(t=setTimeout((function(){t=null,l(e)}),50))}),n)};var d=function(e){function t(a,n){void 0===n&&(n=!1);var s=e.call(this,a.container)||this;s.id="gt"+ ++t.$uid,s.editor=a,s.visibleTooltipRow;var o=s.getElement();return o.setAttribute("role","tooltip"),o.setAttribute("id",s.id),o.style.pointerEvents="auto",n&&(s.onMouseOut=s.onMouseOut.bind(s),o.addEventListener("mouseout",s.onMouseOut)),s}return s(t,e),t.prototype.onMouseOut=function(e){this.isOpen&&e.relatedTarget&&!this.getElement().contains(e.relatedTarget)&&(e&&e.currentTarget.contains(e.relatedTarget)||this.hideTooltip())},t.prototype.setPosition=function(e,t){var a=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),o=this.getHeight();(e+=15)+s>a&&(e-=e+s-a),(t+=15)+o>n&&(t-=20+o),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c("gutter-tooltip.aria-label.error.singular","error"),plural:c("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:c("gutter-tooltip.aria-label.security.singular","security finding"),plural:c("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:c("gutter-tooltip.aria-label.warning.singular","warning"),plural:c("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:c("gutter-tooltip.aria-label.info.singular","information message"),plural:c("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:c("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:c("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var a,n,s=this.editor.renderer.$gutterLayer,o=s.$annotations[e];n=o?{displayText:Array.from(o.displayText),type:Array.from(o.type)}:{displayText:[],type:[]};var r=s.session.getFoldLine(e);if(r&&s.$showFoldedAnnotations){for(var l,c={error:[],security:[],warning:[],info:[],hint:[]},d={error:1,security:2,warning:3,info:4,hint:5},h=e+1;h<=r.end.row;h++)if(s.$annotations[h])for(var g=0;g2)return a.childNodes[2]}},t.prototype.$findCellByRow=function(e){return this.editor.renderer.$gutterLayer.$lines.cells.find((function(t){return t.row===e}))},t.prototype.hideTooltip=function(){if(this.isOpen){if(this.$element.removeAttribute("aria-live"),this.hide(),null!=this.visibleTooltipRow){var e=this.$findLinkedAnnotationNode(this.visibleTooltipRow);e&&e.removeAttribute("aria-describedby")}this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this)}},t.annotationsToSummaryString=function(e){var a,n,s=[];try{for(var i=o(["error","security","warning","info","hint"]),r=i.next();!r.done;r=i.next()){var l=r.value;if(e[l].length){var c=1===e[l].length?t.annotationLabels[l].singular:t.annotationLabels[l].plural;s.push("".concat(e[l].length," ").concat(c))}}}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s.join(", ")},t}(l);d.$uid=0,t.GutterTooltip=d})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,a){"use strict";var n=e("../lib/event"),s=e("../lib/useragent"),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=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.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 s.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},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,a){"use strict";var n=e("../lib/dom"),s=e("../lib/event"),o=e("../lib/useragent");function i(e){var t=e.editor,a=n.createElement("div");a.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",a.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var i,l,c,d,h,g,p,u,m,v,f,w=t.container,b=0;function y(){var e=g;(function(e,a){var n=Date.now(),s=!a||e.row!=a.row,o=!a||e.column!=a.column;!v||s||o?(t.moveCursorToPosition(e),v=n,f={x:l,y:c}):r(f.x,f.y,l,c)>5?v=null:n-v>=200&&(t.renderer.scrollCursorIntoView(),v=null)})(g=t.renderer.screenToTextCoordinates(l,c),e),function(e,a){var n=Date.now(),s=t.renderer.layerConfig.lineHeight,o=t.renderer.layerConfig.characterWidth,i=t.renderer.scroller.getBoundingClientRect(),r={x:{left:l-i.left,right:i.right-l},y:{top:c-i.top,bottom:i.bottom-c}},d=Math.min(r.x.left,r.x.right),h=Math.min(r.y.top,r.y.bottom),g={row:e.row,column:e.column};d/o<=2&&(g.column+=r.x.left=200&&t.renderer.scrollCursorIntoView(g):m=n:m=null}(g,e)}function x(){h=t.selection.toOrientedRange(),i=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),y(),d=setInterval(y,20),b=0,s.addListener(document,"mousemove",C)}function k(){clearInterval(d),t.session.removeMarker(i),i=null,t.selection.fromOrientedRange(h),t.isFocused()&&!u&&t.$resetCursorStyle(),h=null,g=null,b=0,m=null,v=null,s.removeListener(document,"mousemove",C)}this.onDragStart=function(e){if(this.cancelDrag||!w.draggable){var n=this;return setTimeout((function(){n.startSelect(),n.captureMouse(e)}),0),e.preventDefault()}h=t.getSelectionRange();var s=e.dataTransfer;s.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(a),s.setDragImage&&s.setDragImage(a,0,0),setTimeout((function(){t.container.removeChild(a)})),s.clearData(),s.setData("Text",t.session.getTextRange()),u=!0,this.setState("drag")},this.onDragEnd=function(e){if(w.draggable=!1,u=!1,this.setState(null),!t.getReadOnly()){var a=e.dataTransfer.dropEffect;p||"move"!=a||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&z(e.dataTransfer))return l=e.clientX,c=e.clientY,i||x(),b++,e.dataTransfer.dropEffect=p=E(e),s.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&z(e.dataTransfer))return l=e.clientX,c=e.clientY,i||(x(),b++),null!==M&&(M=null),e.dataTransfer.dropEffect=p=E(e),s.preventDefault(e)},this.onDragLeave=function(e){if(--b<=0&&i)return k(),p=null,s.preventDefault(e)},this.onDrop=function(e){if(g){var a=e.dataTransfer;if(u)switch(p){case"move":h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case"copy":h=t.moveText(h,g,!0)}else{var n=a.getData("Text");h={start:g,end:t.session.insert(g,n)},t.focus(),p=null}return k(),s.preventDefault(e)}},s.addListener(w,"dragstart",this.onDragStart.bind(e),t),s.addListener(w,"dragend",this.onDragEnd.bind(e),t),s.addListener(w,"dragenter",this.onDragEnter.bind(e),t),s.addListener(w,"dragover",this.onDragOver.bind(e),t),s.addListener(w,"dragleave",this.onDragLeave.bind(e),t),s.addListener(w,"drop",this.onDrop.bind(e),t);var M=null;function C(){null==M&&(M=setTimeout((function(){null!=M&&i&&k()}),20))}function z(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function E(e){var t=["copy","copymove","all","uninitialized"],a=o.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";return a&&t.indexOf(n)>=0?s="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(n)>=0?s="move":t.indexOf(n)>=0&&(s="copy"),s}}function r(e,t,a,n){return Math.sqrt(Math.pow(a-e,2)+Math.pow(n-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,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=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=o.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;o.isIE&&"dragReady"==this.state&&r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,a=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&a){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;"unselectable"in s&&(s.unselectable="on"),t.getDragDelay()?(o.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("./mouse_event").MouseEvent,s=e("../lib/event"),o=e("../lib/dom");t.addTouchListeners=function(e,t){var a,i,r,l,c,d,h,g,p,u="scroll",m=0,v=0,f=0,w=0;function b(){if(t.getOption("enableMobileMenu")){p||(r=window.navigator&&window.navigator.clipboard,l=!1,c=function(e){return t.commands.canExecute(e,t)},d=function(e){var a,n,s=e.target.getAttribute("action");if("more"==s||!l)return l=!l,a=t.getCopyText(),n=t.session.getUndoManager().hasUndo(),void p.replaceChild(o.buildDom(l?["span",!a&&c("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],a&&c("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],a&&c("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],r&&c("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],n&&c("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],c("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],c("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),p.firstChild);"paste"==s?r.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(r?r.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),p.firstChild.style.display="none",l=!1,"openCommandPalette"!=s&&t.focus()},p=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){u="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),d(e)},onclick:d},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var e=t.selection.cursor,a=t.renderer.textToScreenCoordinates(e.row,e.column),n=t.renderer.textToScreenCoordinates(0,0).pageX,s=t.renderer.scrollLeft,i=t.container.getBoundingClientRect();p.style.top=a.pageY-i.top-3+"px",a.pageX-i.left1)return clearTimeout(c),c=null,r=-1,void(u="zoom");g=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,p=e.timeStamp;l=p;var b=s[0],y=b.clientX,k=b.clientY;Math.abs(a-y)+Math.abs(i-k)>o&&(r=-1),a=e.clientX=y,i=e.clientY=k,f=w=0;var M=new n(e,t);if(h=M.getDocumentPosition(),p-r<500&&1==s.length&&!m)v++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(h);var e=v>=2?t.selection.getLineRange(h.row):t.session.getBracketRange(h);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),u="wait"}();else{v=0;var C=t.selection.cursor,z=t.selection.isEmpty()?C:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(C,!0),_=t.renderer.$cursorLayer.getPixelPosition(z,!0),L=t.renderer.scroller.getBoundingClientRect(),H=t.renderer.layerConfig.offset,S=t.renderer.scrollLeft,V=function(e,t){return(e/=d)*e+(t=t/o-.75)*t};if(e.clientXA?"cursor":"anchor"),u=A<3.5?"anchor":T<3.5?"cursor":"scroll",c=setTimeout(x,450)}r=p}),t),s.addListener(e,"touchend",(function(e){g=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),"zoom"==u?(u="",m=0):c?(t.selection.moveToPosition(h),m=0,b()):"scroll"==u?(m+=60,d=setInterval((function(){m--<=0&&(clearInterval(d),d=null),Math.abs(f)<.01&&(f=0),Math.abs(w)<.01&&(w=0),m<20&&(f*=.9),m<20&&(w*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*f,10*w),e==t.session.getScrollTop()&&(m=0)}),10),y()):b(),clearTimeout(c),c=null}),t),s.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var s=e.touches;if(!(s.length>1||"zoom"==u)){var o=s[0],r=a-o.clientX,d=i-o.clientY;if("wait"==u){if(!(r*r+d*d>4))return e.preventDefault();u="cursor"}a=o.clientX,i=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,g=h-l;if(l=h,"scroll"==u){var p=new n(e,t);p.speed=1,p.wheelX=r,p.wheelY=d,10*Math.abs(r)=e){for(o=h+1;o=e;)o++;for(r=h,l=o-1;r=t.length||2!=(l=a[s-1])&&3!=l||2!=(c=t[s+1])&&3!=c?4:(o&&(c=3),c==l?c:4);case 10:return 2==(l=s>0?a[s-1]:5)&&s+10&&2==a[s-1])return 2;if(o)return 4;for(p=s+1,g=t.length;p=1425&&m<=2303||64286==m;if(l=t[p],v&&(1==l||7==l))return 1}return s<1||5==(l=t[s-1])?4:a[s-1];case 5:return o=!1,i=!0,n;case 6:return r=!0,4;case 13:case 14:case 16:case 17:case 15:o=!1;case h:return 4}}function v(e){var t=e.charCodeAt(0),a=t>>8;return 0==a?t>191?0:g[t]:5==a?/[\u0591-\u05f4]/.test(e)?1:0:6==a?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?d:/[\u06f0-\u06f9]/.test(e)?2:7:32==a&&t<=8287?p[255&t]:254==a&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,a,d){if(e.length<2)return{};var g=e.split(""),p=new Array(g.length),f=new Array(g.length),w=[];n=d?1:0,function(e,t,a,d){var h=n?c:l,g=null,p=null,u=null,f=0,w=null,b=-1,y=null,x=null,k=[];if(!d)for(y=0,d=[];y0)if(16==w){for(y=b;y-1){for(y=b;y=0&&8==d[M];M--)t[M]=n}}(g,w,g.length,a);for(var b=0;b7&&a[b]<13||4===a[b]||a[b]===h)?w[b]=t.ON_R:b>0&&"ل"===g[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(g[b])&&(w[b-1]=w[b]=t.R_H,b++);for(g[g.length-1]===t.DOT&&(w[g.length-1]=t.B),"‫"===g[0]&&(w[0]=t.RLE),b=0;b=0&&(e=this.session.$docRowCache[a])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var a,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(a=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=a,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var a=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(void 0===t&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,s=n.getVisualFromLogicalIdx(a,this.bidiMap),o=this.bidiMap.bidiLevels,i=0;!this.session.getOverwrite()&&e<=t&&o[s]%2!=0&&s++;for(var r=0;rt&&o[s]%2==0&&(i+=this.charWidths[o[s]]),this.wrapIndent&&(i+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(i+=this.rtlLineOffset),i},e.prototype.getSelections=function(e,t){var a,n=this.bidiMap,s=n.bidiLevels,o=[],i=0,r=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,d=!1,h=0;this.wrapIndent&&(i+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var g,p=0;p=r&&ga+o/2;){if(a+=o,n===s.length-1){o=0;break}o=this.charWidths[s[++n]]}return n>0&&s[n-1]%2!=0&&s[n]%2==0?(e0&&s[n-1]%2==0&&s[n]%2!=0?t=1+(e>a?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===s.length-1&&0===o&&s[n-1]%2==0||!this.isRtlDir&&0===n&&s[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&s[n-1]%2!=0&&0!==o&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=i})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,i=e("./range").Range,r=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=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))}return 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=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?i.fromPoints(t,t):this.isBackwards()?i.fromPoints(t,e):i.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var a=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(a.row,a.column,n.row,n.column)},e.prototype.$setSelection=function(e,t,a,n){if(!this.$silent){var s=this.$isEmpty,o=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(a,n),this.$isEmpty=!i.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||o)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(e){var t=this.lead;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(void 0===t){var a=e||this.lead;e=a.row,t=a.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var a,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,a=s.end.row):a=n,!0===t?new i(n,0,a,this.session.getLine(a).length):new i(n,0,a+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,a){var n=e.column,s=e.column+t;return a<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},e.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var a=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,a,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-a):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,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,t=this.lead.column,a=this.doc.getLine(e),n=a.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s)this.moveCursorTo(s.end.row,s.end.column);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=a.substring(t)),t>=a.length)return this.moveCursorTo(e,a.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(o)&&(a-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,a)}},e.prototype.$shortWordEndIndex=function(e){var t,a=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))a=this.session.tokenRe.lastIndex;else{for(;(t=e[a])&&n.test(t);)a++;if(a<1)for(s.lastIndex=0;(t=e[a])&&!s.test(t);)if(s.lastIndex=0,a++,n.test(t)){if(a>2){a--;break}for(;(t=e[a])&&n.test(t);)a++;if(a>2)break}}return s.lastIndex=0,a},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,a=this.doc.getLine(e),n=a.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==a.length){var o=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e0&&/^\s*$/.test(n));a=n.length,/\s+$/.test(n)||(n="")}var o=s.stringReverse(n),i=this.$shortWordEndIndex(o);return this.moveCursorTo(t,a-i)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var a,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(a=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(a/this.session.$bidiHandler.charWidths[0])):a=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var s=this.session.lineWidgets[this.lead.row];e<0?e-=s.rowsAbove||0:e>0&&(e+=s.rowCount-(s.rowsAbove||0))}var o=this.session.screenToDocumentPosition(n.row+e,n.column,a);0!==e&&0===t&&o.row===this.lead.row&&(o.column,this.lead.column),this.moveCursorTo(o.row,o.column+t,0===t)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,a){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,a||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,a){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,a)},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();return 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):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var a=this.getCursor();return i.fromPoints(t,a)}catch(e){return i.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();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},e.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var a=i.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(a.cursor=a.start),this.addRange(a,!0)}return}e=e[0]}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!1;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!1;return!0},e}();r.prototype.setSelectionAnchor=r.prototype.setAnchor,r.prototype.getSelectionAnchor=r.prototype.getAnchor,r.prototype.setSelectionRange=r.prototype.setRange,n.implement(r.prototype,o),t.Selection=r})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,a){"use strict";var n=e("./lib/report_error").reportError,s=2e3,o=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var a=this.states[t],n=[],s=0,o=this.matchMappings[t]={defaultToken:"text"},i="g",r=[],l=0;l1?this.$applyToken:c.token),h>1&&(/\\\d/.test(c.regex)?d=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+s+1)})):(h=1,d=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||r.push(c)),o[s]=l,s+=h,n.push(d),c.onMatch||(c.onMatch=null)}}n.length||(o[0]=0,n.push("$")),r.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,i)}),this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",i)}}return e.prototype.$setMaxTokenCount=function(e){s=0|e},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),a=this.token.apply(this,t);if("string"==typeof a)return[{type:a,value:e}];for(var n=[],s=0,o=a.length;sd){var f=e.substring(d,v-m.length);g.type==p?g.value+=f:(g.type&&c.push(g),g={type:p,value:f})}for(var w=0;ws){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});d1&&a[0]!==n&&a.unshift("#tmp",n),{tokens:c,state:a.length?a:n}},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,a){"use strict";var n,s=e("../lib/deep_copy").deepCopy;(function(){this.addRules=function(e,t){if(t)for(var a in e){for(var n=e[a],s=0;s=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,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,t=this.$tokenIndex,a=e[t].start;if(void 0!==a)return a;for(a=0;t>0;)a+=e[t-=1].value.length;return a},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=s})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,a){"use strict";var n,s,o=e("../../lib/oop"),i=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,l=e("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],d=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},g={'"':'"',"'":"'"},p=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,h.rangeCount!=e.multiSelect.rangeCount&&(h={rangeCount:e.multiSelect.rangeCount})),h[t])return n=h[t];n=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(e,t,a,n){var s=e.end.row-e.start.row;return{text:a+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}};(s=function(e){e=e||{},this.add("braces","insertion",(function(t,a,o,i,r){var c=o.getCursorPosition(),d=i.doc.getLine(c.row);if("{"==r){p(o);var h=o.getSelectionRange(),g=i.doc.getTextRange(h),m=i.getTokenAt(c.row,c.column);if(""!==g&&"{"!==g&&o.getWrapBehavioursEnabled())return u(h,g,"{","}");if(m&&/(?:string)\.quasi|\.xml/.test(m.type)){if([/tag\-(?:open|name)/,/attribute\-name/].some((function(e){return e.test(m.type)}))||/(string)\.quasi/.test(m.type)&&"$"!==m.value[c.column-m.start-1])return;return s.recordAutoInsert(o,i,"}"),{text:"{}",selection:[1,1]}}if(s.isSaneInsertion(o,i))return/[\]\}\)]/.test(d[c.column])||o.inMultiSelectMode||e.braces?(s.recordAutoInsert(o,i,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(o,i,"{"),{text:"{",selection:[1,1]})}else if("}"==r){if(p(o),"}"==d.substring(c.column,c.column+1)&&null!==i.$findOpeningBracket("}",{column:c.column+1,row:c.row})&&s.isAutoInsertedClosing(c,d,r))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==r||"\r\n"==r){p(o);var v="";if(s.isMaybeInsertedClosing(c,d)&&(v=l.stringRepeat("}",n.maybeInsertedBrackets),s.clearMaybeInsertedClosing()),"}"===d.substring(c.column,c.column+1)){var f=i.findMatchingBracket({row:c.row,column:c.column+1},"}");if(!f)return null;var w=this.$getIndent(i.getLine(f.row))}else{if(!v)return void s.clearMaybeInsertedClosing();w=this.$getIndent(d)}var b=w+i.getTabString();return{text:"\n"+b+"\n"+w+v,selection:[1,b.length,1,b.length]}}s.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,a,s,o){var i=s.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==i){if(p(a),"}"==s.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;n.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,a,n,o){if("("==o){p(a);var i=a.getSelectionRange(),r=n.doc.getTextRange(i);if(""!==r&&a.getWrapBehavioursEnabled())return u(i,r,"(",")");if(s.isSaneInsertion(a,n))return s.recordAutoInsert(a,n,")"),{text:"()",selection:[1,1]}}else if(")"==o){p(a);var l=a.getCursorPosition(),c=n.doc.getLine(l.row);if(")"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&s.isAutoInsertedClosing(l,c,o))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,a,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==o&&(p(a),")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s})),this.add("brackets","insertion",(function(e,t,a,n,o){if("["==o){p(a);var i=a.getSelectionRange(),r=n.doc.getTextRange(i);if(""!==r&&a.getWrapBehavioursEnabled())return u(i,r,"[","]");if(s.isSaneInsertion(a,n))return s.recordAutoInsert(a,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){p(a);var l=a.getCursorPosition(),c=n.doc.getLine(l.row);if("]"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&s.isAutoInsertedClosing(l,c,o))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,a,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==o&&(p(a),"]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s})),this.add("string_dquotes","insertion",(function(e,t,a,n,s){var o=n.$mode.$quotes||g;if(1==s.length&&o[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;p(a);var i=s,r=a.getSelectionRange(),l=n.doc.getTextRange(r);if(!(""===l||1==l.length&&o[l])&&a.getWrapBehavioursEnabled())return u(r,l,i,i);if(!l){var c=a.getCursorPosition(),d=n.doc.getLine(c.row),h=d.substring(c.column-1,c.column),m=d.substring(c.column,c.column+1),v=n.getTokenAt(c.row,c.column),f=n.getTokenAt(c.row,c.column+1);if("\\"==h&&v&&/escape/.test(v.type))return null;var w,b=v&&/string|escape/.test(v.type),y=!f||/string|escape/.test(f.type);if(m==i)(w=b!==y)&&/string\.end/.test(f.type)&&(w=!1);else{if(b&&!y)return null;if(b&&y)return null;var x=n.$mode.tokenRe;x.lastIndex=0;var k=x.test(h);x.lastIndex=0;var M=x.test(m),C=n.$mode.$pairQuotesAfter;if(!(C&&C[i]&&C[i].test(h))&&k||M)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var z=d[c.column-2];if(h==i&&(z==i||x.test(z)))return null;w=!0}return{text:w?i+i:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,a,n,s){var o=n.$mode.$quotes||g,i=n.doc.getTextRange(s);if(!s.isMultiLine()&&o.hasOwnProperty(i)&&(p(a),n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==i))return s.end.column++,s})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,a,n,s){if("doc-start"===e&&("\n"===s||"\r\n"===s)&&a.selection.isEmpty()){var o=a.getCursorPosition();if(0===o.column)return;for(var i=n.doc.getLine(o.row),r=n.doc.getLine(o.row+1),l=n.getTokens(o.row),c=0,d=0;d=o.column){if(c===o.column){if(!/\.doc/.test(h.type))return;if(/\*\//.test(h.value)){var g=l[d+1];if(!g||!/\.doc/.test(g.type))return}}var p=o.column-(c-h.value.length),u=h.value.indexOf("*/"),m=h.value.indexOf("/**",u>-1?u+2:0);if(-1!==m&&p>m&&p=u&&p<=m||!/\.doc/.test(h.type))return;break}}var v=this.$getIndent(i);if(/\s*\*/.test(r))return/^\s*\*/.test(i)?{text:s+v+"* ",selection:[1,2+v.length,1,2+v.length]}:{text:s+v+" * ",selection:[1,3+v.length,1,3+v.length]};if(/\/\*\*/.test(i.substring(0,o.column)))return{text:s+v+" * "+s+" "+v+"*/",selection:[1,4+v.length,1,4+v.length]}}}))}).isSaneInsertion=function(e,t){var a=e.getCursorPosition(),n=new r(t,a.row,a.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",c)){if(/[)}\]]/.test(e.session.getLine(a.row)[a.column]))return!0;var s=new r(t,a.row,a.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",c))return!1}return n.stepForward(),n.getCurrentTokenRow()!==a.row||this.$matchTokenType(n.getCurrentToken()||"text",d)},s.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},s.recordAutoInsert=function(e,t,a){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,o,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=s.row,n.autoInsertedLineEnd=a+o.substr(s.column),n.autoInsertedBrackets++},s.recordMaybeInsert=function(e,t,a){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,o)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=s.row,n.maybeInsertedLineStart=o.substr(0,s.column)+a,n.maybeInsertedLineEnd=o.substr(s.column),n.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(e,t,a){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&a===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},o.inherits(s,i),t.CstyleBehaviour=s})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,a){"use strict";for(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],s=0,o=[],i=0;i2?n%l!=l-1:n%l==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,u=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+c.escapeRegExp(p)+")"),v=new RegExp("(?:"+c.escapeRegExp(u)+")\\s*$"),f=function(e,t){b(e,t)||o&&!/\S/.test(e)||(s.insertInLine({row:t,column:e.length},u),s.insertInLine({row:t,column:r},p))},w=function(e,t){var a;(a=e.match(v))&&s.removeInLine(t,e.length-a[0].length,e.length),(a=e.match(m))&&s.removeInLine(t,a[1].length,a[0].length)},b=function(e,a){if(m.test(e))return!0;for(var n=t.getTokens(a),s=0;se.length&&(x=e.length)})),r==1/0&&(r=x,o=!1,i=!1),d&&r%l!=0&&(r=Math.floor(r/l)*l),y(i?w:f)},this.toggleBlockComment=function(e,t,a,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var o,i,r=(m=new d(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(r&&/comment/.test(r.type)){for(var c,g;r&&/comment/.test(r.type);){if(-1!=(v=r.value.indexOf(s.start))){var p=m.getCurrentTokenRow(),u=m.getCurrentTokenColumn()+v;c=new h(p,u,p,u+s.start.length);break}r=m.stepBackward()}var m;for(r=(m=new d(t,n.row,n.column)).getCurrentToken();r&&/comment/.test(r.type);){var v;if(-1!=(v=r.value.indexOf(s.end))){p=m.getCurrentTokenRow(),u=m.getCurrentTokenColumn()+v,g=new h(p,u,p,u+s.end.length);break}r=m.stepForward()}g&&t.remove(g),c&&(t.remove(c),o=c.start.row,i=-s.start.length)}else i=s.start.length,o=a.start.row,t.insert(a.end,s.end),t.insert(a.start,s.start);l.start.row==o&&(l.start.column+=i),l.end.row==o&&(l.end.column+=i),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,a){return this.$getIndent(t)},this.checkOutdent=function(e,t,a){return!1},this.autoOutdent=function(e,t,a){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var a=e[t],n=a.prototype.$id,o=s.$modes[n];o||(s.$modes[n]=o=new a),s.$modes[t]||(s.$modes[t]=o),this.$embeds.push(t),this.$modes[t]=o}var i=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],r=function(e){var t,a,n;n=(t=l)[a=i[e]],t[i[e]]=function(){return this.$delegator(a,arguments,n)}},l=this;for(t=0;tt[a].column&&a++,o.unshift(a,0),t.splice.apply(t,o),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,a){if(e)for(t=!1,e.row=a;e.$oldWidget;)e.$oldWidget.row=a,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=n.createElement("div"),e.el.textContent=e.text),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),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=!0,e.coverGutter||(e.el.style.zIndex="3"),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var a=this.session.getFoldAt(e.row,0);if(e.$fold=a,a){var s=this.session.lineWidgets;e.row!=a.end.row||s[a.start.row]?e.hidden=!0:s[a.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),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,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;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){for(var t=this.session.lineWidgets,a=t&&t[e],n=[];a;)n.push(a),a=a.$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 a=this.session._changedWidgets,n=t.layerConfig;if(a&&a.length){for(var s=1/0,o=0;o0&&!n[s];)s--;this.firstRow=a.firstRow,this.lastRow=a.lastRow,t.$cursorLayer.config=a;for(var i=s;i<=o;i++){var r=n[i];if(r&&r.el)if(r.hidden)r.el.style.top=-100-(r.pixelHeight||0)+"px";else{r._inDocument||(r._inDocument=!0,t.container.appendChild(r.el));var l=t.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;r.coverLine||(l+=a.lineHeight*this.session.getRowLineCount(r.row)),r.el.style.top=l-a.offset+"px";var c=r.coverGutter?0:t.gutterWidth;r.fixedWidth||(c-=t.scrollLeft),r.el.style.left=c+"px",r.fullWidth&&r.screenWidth&&(r.el.style.minWidth=a.width+2*a.padding+"px"),r.fixedWidth?r.el.style.right=t.scrollBar.getWidth()+"px":r.el.style.right=""}}}},e}();t.LineWidgets=s})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,a){"use strict";t.applyDelta=function(e,t,a){var n=t.start.row,s=t.start.column,o=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=o.substring(0,s)+t.lines[0]+o.substring(s);else{var i=[n,1].concat(t.lines);e.splice.apply(e,i),e[n]=o.substring(0,s)+e[n],e[n+t.lines.length-1]+=o.substring(s)}break;case"remove":var r=t.end.column,l=t.end.row;n===l?e[n]=o.substring(0,s)+o.substring(r):e.splice(n,l-n+1,o.substring(0,s)+e[l].substring(r))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,o=function(){function e(e,t,a){this.$onChange=this.onChange.bind(this),this.attach(e),"number"!=typeof t?this.setPosition(t.row,t.column):this.setPosition(t,a)}return 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||e.start.row>this.row)){var t=function(e,t,a){var n="insert"==e.action,s=(n?1:-1)*(e.end.row-e.start.row),o=(n?1:-1)*(e.end.column-e.start.column),r=e.start,l=n?r:e.end;return i(t,r,a)?{row:t.row,column:t.column}:i(l,t,!a)?{row:t.row+s,column:t.column+(t.row==l.row?o:0)}:{row:r.row,column:r.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,a){var n;if(n=a?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,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 a={};return e>=this.document.getLength()?(a.row=Math.max(0,this.document.getLength()-1),a.column=this.document.getLine(a.row).length):e<0?(a.row=0,a.column=0):(a.row=e,a.column=Math.min(this.document.getLine(a.row).length,Math.max(0,t))),t<0&&(a.column=0),a},e}();function i(e,t,a){var n=a?e.column<=t.column:e.column=a&&(e=a-1,t=void 0);var n=this.getLine(e);return null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},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();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){var a=0;(e=Math.min(Math.max(e,0),this.getLength()))0,n=t=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){return e instanceof i||(e=i.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var a="insert"==e.action;(a?e.lines.length<=1&&!e.lines[0]:!i.comparePoints(e.start,e.end))||(a&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row20){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t,-1==n&&(n=t),o<=n&&a.fireUpdateEvent(o,n)}}}return 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 a={first:e,last:t};this._signal("update",{data:a})},e.prototype.start=function(e){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(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,a=e.end.row-t;if(0===a)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,a+1,null),this.states.splice(t,a+1,null);else{var n=Array(a+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(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),a=this.states[e-1],n=this.tokenizer.getLineTokens(t,a,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();n.implement(o.prototype,s),t.BackgroundTokenizer=o})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/lang"),s=e("./range").Range,o=function(){function e(e,t,a){void 0===a&&(a="text"),this.setRegexp(e),this.clazz=t,this.type=a,this.docLen=0}return e.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,a,o){if(this.regExp){for(var i=o.firstRow,r=o.lastRow,l={},c=a.$editor&&a.$editor.$search,d=c&&c.$isMultilineSearch(a.$editor.getLastSearchOptions()),h=i;h<=r;h++){var g=this.cache[h];if(null==g||a.getValue().length!=this.docLen){if(d){g=[];var p=c.$multiLineForward(a,this.regExp,h,r);if(p){var u=p.endRow<=r?p.endRow-1:r;u>h&&(h=u),g.push(new s(p.startRow,p.startCol,p.endRow,p.endCol))}g.length>this.MAX_RANGES&&(g=g.slice(0,this.MAX_RANGES))}else(g=n.getMatchOffsets(a.getLine(h),this.regExp)).length>this.MAX_RANGES&&(g=g.slice(0,this.MAX_RANGES)),g=g.map((function(e){return new s(h,e.offset,h,e.offset+e.length)}));this.cache[h]=g.length?g:""}if(0!==g.length)for(var m=g.length;m--;){var v=g[m].toScreenRange(a),f=v.toString();l[f]||(l[f]=!0,t.drawSingleLineMarker(e,v,this.clazz,o))}}this.docLen=a.getValue().length}},e}();o.prototype.MAX_RANGES=500,t.SearchHighlight=o})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,a){"use strict";var n=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,a){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),!1===t||!this.lastDeltas){this.lastDeltas=[];var n=this.$undoStack.length;n>this.$undoDepth-1&&this.$undoStack.splice(0,n-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}"remove"!=e.action&&"insert"!=e.action||(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(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var a=this.$undoStack,n=a.length;n--;){var s=a[n][0];if(s.id<=e)break;s.id0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){null==e&&(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){return e?r(e):r(this.$undoStack)+"\n---\n"+r(this.$redoStack)},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;var s=e("./range").Range,o=s.comparePoints;function i(e){return{row:e.row,column:e.column}}function r(e){if(e=e||this,Array.isArray(e))return e.map(r).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var a="insert"==e.action,n="insert"==t.action;if(a&&n)if(o(t.start,e.end)>=0)g(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;g(e,t,1)}else if(a&&!n)if(o(t.start,e.end)>=0)g(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;g(e,t,-1)}else if(!a&&n)if(o(t.start,e.start)>=0)g(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;g(e,t,1)}else if(!a&&!n)if(o(t.start,e.start)>=0)g(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;g(e,t,-1)}return[t,e]}function d(e,t){for(var a=e.length;a--;)for(var n=0;n=0?g(e,t,-1):(o(e.start,t.start)<=0||g(e,s.fromPoints(t.start,e.start),-1),g(t,e,1));else if(!a&&n)o(t.start,e.end)>=0?g(t,e,-1):(o(t.start,e.start)<=0||g(t,s.fromPoints(e.start,t.start),-1),g(e,t,1));else if(!a&&!n)if(o(t.start,e.end)>=0)g(t,e,-1);else{var i,r;if(!(o(t.end,e.start)<=0))return o(e.start,t.start)<0&&(i=e,e=u(e,t.start)),o(e.end,t.end)>0&&(r=u(e,t.end)),p(t.end,e.start,e.end,-1),r&&!i&&(e.lines=r.lines,e.start=r.start,e.end=r.end,r=e),[t,i,r].filter(Boolean);g(e,t,-1)}return[t,e]}function g(e,t,a){p(e.start,t.start,t.end,a),p(e.end,t.start,t.end,a)}function p(e,t,a,n){e.row==(1==n?t:a).row&&(e.column+=n*(a.column-t.column)),e.row+=n*(a.row-t.row)}function u(e,t){var a=e.lines,n=e.end;e.end=i(t);var s=e.end.row-e.start.row,o=a.splice(s,a.length),r=s?t.column:t.column-e.start.column;return a.push(o[0].substring(0,r)),o[0]=o[0].substr(r),{start:i(t),end:n,lines:o,action:e.action}}function m(e,t){t=function(e){return{start:i(e.start),end:i(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var a=e.length;a--;){for(var n=e[a],s=0;sthis.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)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):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)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,a){var n,s,o=0,i=this.folds,r=!0;null==t&&(t=this.end.row,a=this.end.column);for(var l=0;l0)){var l=n(e,i.start);return 0===r?t&&0!==l?-o-2:o:l>0||0===l&&!t?o:-o-1}}return-o-1},e.prototype.add=function(e){var t=!e.isEmpty(),a=this.pointIndex(e.start,t);a<0&&(a=-a-1);var n=this.pointIndex(e.end,t,a);return n<0?n=-n-1:n++,this.ranges.splice(a,n-a,e)},e.prototype.addList=function(e){for(var t=[],a=e.length;a--;)t.push.apply(t,this.add(e[a]));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(){for(var e,t=[],a=this.ranges,s=(a=a.sort((function(e,t){return n(e.start,t.start)})))[0],o=1;o=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 a=this.ranges;if(a[0].start.row>t||a[a.length-1].start.row=n);i++);if("insert"==e.action){for(var l=s-n,c=-t.column+a.column;in);i++)if(d.start.row==n&&d.start.column>=t.column&&(d.start.column==t.column&&this.$bias<=0||(d.start.column+=c,d.start.row+=l)),d.end.row==n&&d.end.column>=t.column){if(d.end.column==t.column&&this.$bias<0)continue;d.end.column==t.column&&c>0&&id.start.column&&d.end.column==o[i+1].start.column&&(d.end.column-=c),d.end.column+=c,d.end.row+=l}}else for(l=n-s,c=t.column-a.column;is);i++)d.end.rowt.column)&&(d.end.column=t.column,d.end.row=t.row):(d.end.column+=c,d.end.row+=l):d.end.row>s&&(d.end.row+=l),d.start.rowt.column)&&(d.start.column=t.column,d.start.row=t.row):(d.start.column+=c,d.start.row+=l):d.start.row>s&&(d.start.row+=l);if(0!=l&&i=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var a=this.$foldData,n=0;for(t&&(n=a.indexOf(t)),-1==n&&(n=0);n=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var a=this.$foldData,n=t-e+1,s=0;s=t){r=e?n-=t-r:n=0);break}i>=e&&(n-=r>=e?i-r:i-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var a,n=this.$foldData,i=!1;e instanceof o?a=e:(a=new o(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(a.range);var r=a.start.row,l=a.start.column,c=a.end.row,d=a.end.column,h=this.getFoldAt(r,l,1),g=this.getFoldAt(c,d,-1);if(h&&g==h)return h.addSubFold(a);h&&!h.range.isStart(r,l)&&this.removeFold(h),g&&!g.range.isEnd(c,d)&&this.removeFold(g);var p=this.getFoldsInRange(a.range);p.length>0&&(this.removeFolds(p),a.collapseChildren||p.forEach((function(e){a.addSubFold(e)})));for(var u=0;u0&&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 a,s;if(null==e)a=new n(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)a=new n(e,0,e,this.getLine(e).length);else if("row"in e)a=n.fromPoints(e,e);else{if(Array.isArray(e))return s=[],e.forEach((function(e){s=s.concat(this.unfold(e))}),this),s;a=e}for(var o=s=this.getFoldsInRangeList(a);1==s.length&&n.comparePoints(s[0].start,a.start)<0&&n.comparePoints(s[0].end,a.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(a);if(0!=t?this.removeFolds(s):this.expandFolds(s),o.length)return o},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var a=this.getFoldLine(e,t);return a?a.end.row:e},this.getRowFoldStart=function(e,t){var a=this.getFoldLine(e,t);return a?a.start.row:e},this.getFoldDisplayLine=function(e,t,a,n,s){null==n&&(n=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==a&&(a=this.getLine(t).length);var o=this.doc,i="";return e.walk((function(e,t,a,r){if(!(th)break}while(o&&l.test(o.type));o=s.stepBackward()}else o=s.getCurrentToken();if(c.end.row=s.getCurrentTokenRow(),c.end.column=s.getCurrentTokenColumn(),c.start.row==c.end.row&&c.start.column>c.end.column)return;return c}},this.foldAll=function(e,t,a,n){null==a&&(a=1e5);var s=this.foldWidgets;if(s){t=t||this.getLength();for(var o=e=e||0;o=e&&(o=i.end.row,i.collapseChildren=a,this.addFold("...",i))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var a=e.getTokens(t),n=0;n=0;){var o=a[s];if(null==o&&(o=a[s]=this.getFoldWidget(s)),"start"==o){var i=this.getFoldWidgetRange(s);if(n||(n=i),i&&i.end.row>=e)break}s--}return{range:-1!==s&&i,firstRange:n}},this.onFoldWidgetClick=function(e,t){t instanceof r&&(t=t.domEvent);var a={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,a)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var a=this.getFoldWidget(e),n=this.getLine(e),s="end"===a?-1:1,o=this.getFoldAt(e,-1===s?0:n.length,s);if(o)return t.children||t.all?this.removeFold(o):this.expandFold(o),o;var i=this.getFoldWidgetRange(e,!0);if(i&&!i.isMultiLine()&&(o=this.getFoldAt(i.start.row,i.start.column,1))&&i.isEqual(o.range))return this.removeFold(o),o;if(t.siblings){var r=this.getParentFoldRangeData(e);if(r.range)var l=r.range.start.row+1,c=r.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=i?i.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):i&&(t.all&&(i.collapseChildren=1e4),this.addFold("...",i));return i}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var a=this.$toggleFoldWidget(t,{});if(!a){var n=this.getParentFoldRangeData(t,!0);if(a=n.range||n.firstRange){t=a.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",a)}}},this.updateFoldWidgets=function(e){var t=e.start.row,a=e.end.row-t;if(0===a)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,a+1,null);else{var n=Array(a+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,a){"use strict";var n=e("../token_iterator").TokenIterator,s=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var a=t||this.getLine(e.row).charAt(e.column-1);if(""==a)return null;var n=a.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,a=this.getLine(e.row),n=!0,o=a.charAt(e.column-1),i=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(i||(o=a.charAt(e.column),e={row:e.row,column:e.column+1},i=o&&o.match(/([\(\[\{])|([\)\]\}])/),n=!1),!i)return null;if(i[1]){if(!(r=this.$findClosingBracket(i[1],e)))return null;t=s.fromPoints(e,r),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var r;if(!(r=this.$findOpeningBracket(i[2],e)))return null;t=s.fromPoints(r,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var a=this.getLine(e.row),n=/([\(\[\{])|([\)\]\}])/,o=!t&&a.charAt(e.column-1),i=o&&o.match(n);if(i||(o=(void 0===t||t)&&a.charAt(e.column),e={row:e.row,column:e.column+1},i=o&&o.match(n)),!i)return null;var r=new s(e.row,e.column-1,e.row,e.column),l=i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e);return l?[r,new s(l.row,l.column,l.row,l.column+1)]:[r]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,a){var s=this.$brackets[e],o=1,i=new n(this,t.row,t.column),r=i.getCurrentToken();if(r||(r=i.stepForward()),r){a||(a=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=t.column-i.getCurrentTokenColumn()-2,c=r.value;;){for(;l>=0;){var d=c.charAt(l);if(d==s){if(0==(o-=1))return{row:i.getCurrentTokenRow(),column:l+i.getCurrentTokenColumn()}}else d==e&&(o+=1);l-=1}do{r=i.stepBackward()}while(r&&!a.test(r.type));if(null==r)break;l=(c=r.value).length-1}return null}},this.$findClosingBracket=function(e,t,a){var s=this.$brackets[e],o=1,i=new n(this,t.row,t.column),r=i.getCurrentToken();if(r||(r=i.stepForward()),r){a||(a=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=t.column-i.getCurrentTokenColumn();;){for(var c=r.value,d=c.length;l"===t.value?n=!0:-1!==t.type.indexOf("tag-name")&&(a=!0))}while(t&&!a);return t},this.$findClosingTag=function(e,t){var a,n=t.value,o=t.value,i=0,r=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),c=!1;do{if(-1!==(a=t).type.indexOf("tag-close")&&!c){var d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(t=e.stepForward())if(">"!==t.value||c||(d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),c=!0),-1!==t.type.indexOf("tag-name")){if(o===(n=t.value))if("<"===a.value)i++;else if(""!==t.value)return;var p=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else o===n&&"/>"===t.value&&--i<0&&(p=g=h=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),d=new s(l.end.row,l.end.column,l.end.row,l.end.column+1))}while(t&&i>=0);if(r&&d&&h&&p&&l&&g)return{openTag:new s(r.start.row,r.start.column,d.end.row,d.end.column),closeTag:new s(h.start.row,h.start.column,p.end.row,p.end.column),openTagName:l,closeTagName:g}},this.$findOpeningTag=function(e,t){var a=e.getCurrentToken(),n=t.value,o=0,i=e.getCurrentTokenRow(),r=e.getCurrentTokenColumn(),l=r+2,c=new s(i,r,i,l);e.stepForward();var d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(-1===t.type.indexOf("tag-close")&&(t=e.stepForward()),t&&">"===t.value){var h=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=a,i=e.getCurrentTokenRow(),l=(r=e.getCurrentTokenColumn())+t.value.length,a=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(n===t.value)if("<"===a.value){if(++o>0){var g=new s(i,r,i,l),p=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&">"!==t.value);var u=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else""===t.value){for(var m=0,v=a;v;){if(-1!==v.type.indexOf("tag-name")&&v.value===n){o--;break}if("<"===v.value)break;v=e.stepBackward(),m++}for(var f=0;fa&&(this.$docRowCache.splice(a,t),this.$screenRowCache.splice(a,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var a=0,n=e.length-1;a<=n;){var s=a+n>>1,o=e[s];if(t>o)a=s+1;else{if(!(t=t);o++);return(a=n[o])?(a.index=o,a.start=s-a.value.length,a):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\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){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},e.prototype.removeGutterCustomWidget=function(e){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(e)},e.prototype.addGutterCustomWidget=function(e,t){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(e,t)},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;t0&&(n=!!a.charAt(t-1).match(this.tokenRe)),n||(n=!!a.charAt(t).match(this.tokenRe)),n)var s=this.tokenRe;else s=/^\s+$/.test(a.slice(t-1,t+1))?/\s/:this.nonTokenRe;var o=t;if(o>0){do{o--}while(o>=0&&a.charAt(o).match(s));o++}for(var i=t;ie&&(e=t.screenWidth)})),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),a=this.$rowLengthCache,n=0,s=0,o=this.$foldData[s],i=o?o.start.row:1/0,r=t.length,l=0;li){if((l=o.end.row+1)>=r)break;i=(o=this.$foldData[s++])?o.start.row:1/0}null==a[l]&&(a[l]=this.$getStringScreenWidth(t[l])[0]),a[l]>n&&(n=a[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){this.$fromUndo=!0;for(var a=e.length-1;-1!=a;a--){var n=e[a];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var a=0;ae.end.column&&(o.start.column+=c),o.end.row==e.end.row&&o.end.column>e.end.column&&(o.end.column+=c)),i&&o.start.row>=e.end.row&&(o.start.row+=i,o.end.row+=i)}if(o.end=this.insert(o.start,n),s.length){var r=e.start,l=o.start,c=(i=l.row-r.row,l.column-r.column);this.addFolds(s.map((function(e){return(e=e.clone()).start.row==r.row&&(e.start.column+=c),e.end.row==r.row&&(e.end.column+=c),e.start.row+=i,e.end.row+=i,e})))}return o},e.prototype.indentRows=function(e,t,a){a=a.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},a)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),a=new d(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var o=this.getLine(s);a.start.row=s,a.end.row=s;for(var i=0;i0){var s;if((s=this.getRowFoldEnd(t+a))>this.doc.getLength()-1)return 0;n=s-t}else e=this.$clipRowToDocument(e),n=(t=this.$clipRowToDocument(t))-e+1;var o=new d(e,0,t,Number.MAX_VALUE),i=this.getFoldsInRange(o).map((function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e})),r=0==a?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,r),i.length&&this.addFolds(i),n},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){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var a=this.doc.getLength();e>=a?(e=a-1,t=this.doc.getLine(a-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),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){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},e.prototype.adjustWrapLimit=function(e,t){var a=this.$wrapLimitRange;a.max<0&&(a={min:t,max:t});var n=this.$constrainWrapLimit(e,a.min,a.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},e.prototype.$constrainWrapLimit=function(e,t,a){return t&&(e=Math.max(t,e)),a&&(e=Math.min(a,e)),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,a=e.action,n=e.start,s=e.end,o=n.row,i=s.row,r=i-o,l=null;if(this.$updating=!0,0!=r)if("remove"===a){this[t?"$wrapData":"$rowLengthCache"].splice(o,r);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var d=0;if(m=this.getFoldLine(s.row)){m.addRemoveChars(s.row,s.column,n.column-s.column),m.shiftRow(-r);var h=this.getFoldLine(o);h&&h!==m&&(h.merge(m),m=h),d=c.indexOf(m)+1}for(;d=s.row&&m.shiftRow(-r);i=o}else{var g=Array(r);g.unshift(o,0);var p=t?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,g),c=this.$foldData,d=0,m=this.getFoldLine(o)){var u=m.range.compareInside(n.row,n.column);0==u?(m=m.split(n.row,n.column))&&(m.shiftRow(r),m.addRemoveChars(i,0,s.column-n.column)):-1==u&&(m.addRemoveChars(o,0,s.column-n.column),m.shiftRow(r)),d=c.indexOf(m)+1}for(;d=o&&m.shiftRow(r)}}else r=Math.abs(e.start.column-e.end.column),"remove"===a&&(l=this.getFoldsInRange(e),this.removeFolds(l),r=-r),(m=this.getFoldLine(o))&&m.addRemoveChars(o,n.column,r);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(o,i):this.$updateRowLengthCache(o,i),l},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var a,n,s=this.doc.getAllLines(),o=this.getTabSize(),i=this.$wrapData,r=this.$wrapLimit,l=e;for(t=Math.min(t,s.length-1);l<=t;)(n=this.getFoldLine(l,n))?(a=[],n.walk(function(e,t,n,o){var i;if(null!=e){(i=this.$getDisplayTokens(e,a.length))[0]=b;for(var r=1;rt-h;){var g=o+t-h;if(e[g-1]>=k&&e[g]>=k)d(g);else if(e[g]!=b&&e[g]!=y){for(var p=Math.max(g-(t-(t>>2)),o-1);g>p&&e[g]p&&e[g]p&&e[g]==x;)g--}else for(;g>p&&e[g]p?d(++g):(e[g=o+t]==w&&g--,d(g-h))}else{for(;g!=o-1&&e[g]!=b;g--);if(g>o){d(g);continue}for(g=o+t;g39&&o<48||o>57&&o<64?n.push(x):o>=4352&&z(o)?n.push(f,w):n.push(f)}return n},e.prototype.$getStringScreenWidth=function(e,t,a){if(0==t)return[0,0];var n,s;for(null==t&&(t=1/0),a=a||0,s=0;s=4352&&z(n)?a+=2:a+=1,!(a>t));s++);return[a,s]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},e.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),a=this.$wrapData[t.row];return a.length&&a[0]=0){r=c[d],o=this.$docRowCache[d];var g=e>c[h-1]}else g=!h;for(var p=this.getLength()-1,u=this.getNextFoldLine(o),m=u?u.start.row:1/0;r<=e&&!(r+(l=this.getRowLength(o))>e||o>=p);)r+=l,++o>m&&(o=u.end.row+1,m=(u=this.getNextFoldLine(o,u))?u.start.row:1/0),g&&(this.$docRowCache.push(o),this.$screenRowCache.push(r));if(u&&u.start.row<=o)n=this.getFoldDisplayLine(u),o=u.start.row;else{if(r+l<=e||o>p)return{row:p,column:this.getLine(p).length};n=this.getLine(o),u=null}var v=0,f=Math.floor(e-r);if(this.$useWrapMode){var w=this.$wrapData[o];w&&(s=w[f],f>0&&w.length&&(v=w.indent,i=w[f-1]||w[w.length-1],n=n.substring(i)))}return void 0!==a&&this.$bidiHandler.isBidiRow(r+f,o,f)&&(t=this.$bidiHandler.offsetToCol(a)),i+=this.$getStringScreenWidth(n,t-v)[1],this.$useWrapMode&&i>=s&&(i=s-1),u?u.idxToPosition(i):{row:o,column:i}},e.prototype.documentToScreenPosition=function(e,t){if(void 0===t)var a=this.$clipPositionToDocument(e.row,e.column);else a=this.$clipPositionToDocument(e,t);e=a.row,t=a.column;var n,s=0,o=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var i,r=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),d=l.length;if(d&&c>=0){r=l[c],s=this.$screenRowCache[c];var h=e>l[d-1]}else h=!d;for(var g=this.getNextFoldLine(r),p=g?g.start.row:1/0;r=p){if((i=g.end.row+1)>e)break;p=(g=this.getNextFoldLine(i,g))?g.start.row:1/0}else i=r+1;s+=this.getRowLength(r),r=i,h&&(this.$docRowCache.push(r),this.$screenRowCache.push(s))}var u="";g&&r>=p?(u=this.getFoldDisplayLine(g,e,t),o=g.start.row):(u=this.getLine(e).substring(0,t),o=e);var m=0;if(this.$useWrapMode){var v=this.$wrapData[o];if(v){for(var f=0;u.length>=v[f];)s++,f++;u=u.substring(v[f-1]||0,u.length),m=f>0?v.indent:0}}return this.lineWidgets&&this.lineWidgets[r]&&this.lineWidgets[r].rowsAbove&&(s+=this.lineWidgets[r].rowsAbove),{row:s,column:m+this.$getStringScreenWidth(u)[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,t=null;if(this.$useWrapMode)for(var a=this.$wrapData.length,n=0,s=(r=0,(t=this.$foldData[r++])?t.start.row:1/0);ns&&(n=t.end.row+1,s=(t=this.$foldData[r++])?t.start.row:1/0)}else{e=this.getLength();for(var i=this.$foldData,r=0;ra);o++);return[n,o]})},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();return 0===e.column?0===e.row?"":this.doc.getNewLineCharacter():this.getLine(e.row)[e.column-1]},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},e}();v.$uid=0,v.prototype.$modes=i.$modes,v.prototype.getValue=v.prototype.toString,v.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},v.prototype.$overwrite=!1,v.prototype.$mode=null,v.prototype.$modeId=null,v.prototype.$scrollTop=0,v.prototype.$scrollLeft=0,v.prototype.$wrapLimit=80,v.prototype.$useWrapMode=!1,v.prototype.$wrapLimitRange={min:null,max:null},v.prototype.lineWidgets=null,v.prototype.isFullWidth=z,n.implement(v.prototype,r);var f=1,w=2,b=3,y=4,x=9,k=10,M=11,C=12;function z(e){return!(e<4352)&&(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(v.prototype),e("./edit_session/bracket_match").BracketMatch.call(v.prototype),i.defineOptions(v.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=v})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/lang"),s=e("./lib/oop"),o=e("./range").Range,i=function(){function e(){this.$options={}}return e.prototype.set=function(e){return s.mixin(this.$options,e),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,a=this.$matchIterator(e,t);if(!a)return!1;var n=null;return a.forEach((function(e,a,s,i){return n=new o(e,a,s,i),!(a==i&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start)&&(n=null,1))})),n},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var a=t.range,s=a?e.getLines(a.start.row,a.end.row):e.doc.getAllLines(),i=[],r=t.re;if(t.$isMultiLine){var l,c=r.length,d=s.length-c;e:for(var h=r.offset||0;h<=d;h++){for(var g=0;gm||(i.push(l=new o(h,m,h+c-1,v)),c>2&&(h=h+c-2))}}else for(var f,w=0;ww&&(w=y),i.push(new o(f.startRow,f.startCol,f.endRow,f.endCol))}}else for(f=n.getMatchOffsets(s[w],r),g=0;gM&&i[g].end.row==C;)g--;for(i=i.slice(w,g+1),w=0,g=i.length;w=n){t+="$";break}var o=e.charCodeAt(a);if(36===o){t+="$$";continue}if(48===o||38===o){t+="$&";continue}if(49<=o&&o<=57){t+="$"+e[a];continue}}t+=e[a]}else{if(++a>=n){t+="\\";break}switch(e.charCodeAt(a)){case 92:t+="\\";break;case 110:t+="\n";break;case 116:t+="\t"}}}return t||e},e.prototype.replace=function(e,t){var a=this.$options,n=this.$assembleRegExp(a);if(a.$isMultiLine)return t;if(n){var s=this.$isMultilineSearch(a);s&&(e=e.replace(/\r\n|\r|\n/g,"\n"));var o=n.exec(e);if(!o||!s&&o[0].length!=e.length)return null;if(t=a.regExp?this.parseReplaceString(t):t.replace(/\$/g,"$$$$"),t=e.replace(n,t),a.preserveCase){t=t.split("");for(var i=Math.min(e.length,e.length);i--;){var r=e[i];r&&r.toLowerCase()!=r?t[i]=t[i].toUpperCase():t[i]=t[i].toLowerCase()}t=t.join("")}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var a=e.needle;if(!e.needle)return e.re=!1;e.regExp||(a=n.escapeRegExp(a));var s=e.caseSensitive?"gm":"gmi";try{new RegExp(a,"u"),e.$supportsUnicodeFlag=!0,s+="u"}catch(t){e.$supportsUnicodeFlag=!1}if(e.wholeWord&&(a=function(e,t){var a=n.supportsLookbehind();function s(e,n){return void 0===n&&(n=!0),(a&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||t.regExp?a&&t.$supportsUnicodeFlag?n?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var o=Array.from(e),i=o[0],r=o[o.length-1];return s(i)+e+s(r,!1)}(a,e)),e.$isMultiLine=!t&&/[\n\r]/.test(a),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(a,s);try{var o=new RegExp(a,s)}catch(e){o=!1}return e.re=o},e.prototype.$assembleMultilineRegExp=function(e,t){for(var a=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;sn);r++){var c=e.getLine(i++);s=null==s?c:s+"\n"+c}var d=t.exec(s);if(t.lastIndex=0,d){var h=s.slice(0,d.index).split("\n"),g=d[0].split("\n"),p=a+h.length-1,u=h[h.length-1].length;return{startRow:p,startCol:u,endRow:p+g.length-1,endCol:1==g.length?u+g[0].length:g[g.length-1].length}}}return null},e.prototype.$multiLineBackward=function(e,t,a,n,s){for(var o,i=l(e,n),c=e.getLine(n).length-a,d=n;d>=s;){for(var h=0;h=s;h++){var g=e.getLine(d--);o=null==o?g:g+"\n"+o}var p=r(o,t,c);if(p){var u=o.slice(0,p.index).split("\n"),m=p[0].split("\n"),v=d+u.length,f=u[u.length-1].length;return{startRow:v,startCol:f,endRow:v+m.length-1,endCol:1==m.length?f+m[0].length:m[m.length-1].length}}}return null},e.prototype.$matchIterator=function(e,t){var a=this.$assembleRegExp(t);if(!a)return!1;var s=this.$isMultilineSearch(t),o=this.$multiLineForward,i=this.$multiLineBackward,r=1==t.backwards,l=0!=t.skipCurrent,c=a.unicode,d=t.range,h=t.start;h||(h=d?d[r?"end":"start"]:e.selection.getRange()),h.start&&(h=h[l!=r?"end":"start"]);var g=d?d.start.row:0,p=d?d.end.row:e.getLength()-1;if(r)var u=function(e){var a=h.row;if(!v(a,h.column,e)){for(a--;a>=g;a--)if(v(a,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(a=p,g=h.row;a>=g;a--)if(v(a,Number.MAX_VALUE,e))return}};else u=function(e){var a=h.row;if(!v(a,h.column,e)){for(a+=1;a<=p;a++)if(v(a,0,e))return;if(0!=t.wrap)for(a=g,p=h.row;a<=p;a++)if(v(a,0,e))return}};if(t.$isMultiLine)var m=a.length,v=function(t,n,s){var o=r?t-m+1:t;if(!(o<0||o+m>e.getLength())){var i=e.getLine(o),l=i.search(a[0]);if(!(!r&&ln))return!!s(o,l,o+m-1,d)||void 0}}};else v=r?function(t,o,r){if(s){var l=i(e,a,o,t,g);if(!l)return!1;if(r(l.startRow,l.startCol,l.endRow,l.endCol))return!0}else{var d,h=e.getLine(t),p=[],u=0;for(a.lastIndex=0;d=a.exec(h);){var m=d[0].length;if(u=d.index,!m){if(u>=h.length)break;a.lastIndex=u+=n.skipEmptyMatch(h,u,c)}if(d.index+m>o)break;p.push(d.index,m)}for(var v=p.length-1;v>=0;v-=2){var f=p[v-1];if(r(t,f,t,f+(m=p[v])))return!0}}}:function(t,i,r){if(a.lastIndex=i,s){var l=o(e,a,t,p);if(l){var d=l.endRow<=p?l.endRow-1:p;d>t&&(t=d)}if(!l)return!1;if(r(l.startRow,l.startCol,l.endRow,l.endCol))return!0}else for(var h,g,u=e.getLine(t);g=a.exec(u);){var m=g[0].length;if(r(t,h=g.index,t,h+m))return!0;if(!m&&(a.lastIndex=h+=n.skipEmptyMatch(u,h,c),h>=u.length))return!1}};return{forEach:u}},e}();function r(e,t,a){for(var n=null,s=0;s<=e.length;){t.lastIndex=s;var o=t.exec(e);if(!o)break;var i=o.index+o[0].length;if(i>e.length-a)break;(!n||i>n.index+n[0].length)&&(n=o),s=o.index+1}return n}function l(e,t){var a={row:t,column:0},n=e.doc.positionToIndex(a)+5e3;return e.doc.indexToPosition(n).row+1}t.Search=i})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("../lib/keys"),i=e("../lib/useragent"),r=o.KEY_MODS,l=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,a){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=a},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var a=e&&("string"==typeof e?e:e.name);e=this.commands[a],t||delete this.commands[a];var n=this.commandKeyBinding;for(var s in n){var o=n[s];if(o==e)delete n[s];else if(Array.isArray(o)){var i=o.indexOf(e);-1!=i&&(o.splice(i,1),1==o.length&&(n[s]=o[0]))}}},e.prototype.bindKey=function(e,t,a){if("object"==typeof e&&e&&(null==a&&(a=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var n="";if(-1!=e.indexOf(" ")){var s=e.split(/\s+/);e=s.pop(),s.forEach((function(e){var t=this.parseKeys(e),a=r[t.hashId]+t.key;n+=(n?" ":"")+a,this._addCommandToBinding(n,"chainKeys")}),this),n+=" "}var o=this.parseKeys(e),i=r[o.hashId]+o.key;this._addCommandToBinding(n+i,t,a)}),this)},e.prototype._addCommandToBinding=function(e,t,a){var n,s=this.commandKeyBinding;if(t)if(!s[e]||this.$singleCommand)s[e]=t;else{Array.isArray(s[e])?-1!=(n=s[e].indexOf(t))&&s[e].splice(n,1):s[e]=[s[e]],"number"!=typeof a&&(a=c(t));var o=s[e];for(n=0;na);n++);o.splice(n,0,t)}else delete s[e]},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var a=e[t];if(a){if("string"==typeof a)return this.bindKey(a,t);"function"==typeof a&&(a={exec:a}),"object"==typeof a&&(a.name||(a.name=t),this.addCommand(a))}}),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})),a=t.pop(),n=o[a];if(o.FUNCTION_KEYS[n])a=o.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:a,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:a.toUpperCase(),hashId:-1}}for(var s=0,i=t.length;i--;){var r=o.KEY_MODS[t[i]];if(null==r)return"undefined"!=typeof console&&console.error("invalid modifier "+t[i]+" in "+e),!1;s|=r}return{key:a,hashId:s}},e.prototype.findKeyCommand=function(e,t){var a=r[e]+t;return this.commandKeyBinding[a]},e.prototype.handleKeyboard=function(e,t,a,n){if(!(n<0)){var s=r[t]+a,o=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=a.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:o}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}();function c(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var d=function(e){function t(t,a){var n=e.call(this,t,a)||this;return n.$singleCommand=!0,n}return s(t,e),t}(l);d.call=function(e,t,a){l.prototype.$init.call(e,t,a,!0)},l.call=function(e,t,a){l.prototype.$init.call(e,t,a,!1)},t.HashHandler=d,t.MultiHashHandler=l})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,l=function(e){function t(t,a){var n=e.call(this,a,t)||this;return n.byName=n.commands,n.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),n}return s(t,e),t.prototype.exec=function(e,t,a){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,a))return!0;return!1}"string"==typeof e&&(e=this.commands[e]);var s={editor:t,command:e,args:a};return this.canExecute(e,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue):(this._signal("commandUnavailable",s),!1)},t.prototype.canExecute=function(e,t){return"string"==typeof e&&(e=this.commands[e]),!(!e||t&&t.$readOnly&&!e.readOnly||0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))},t}(i);o.implement(l.prototype,r),t.CommandManager=l})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,a){"use strict";var n=e("../lib/lang"),s=e("../config"),o=e("../range").Range;function i(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:i("Ctrl-,","Command-,"),exec:function(e){s.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:i("Alt-E","F4"),exec:function(e){s.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:i("Alt-Shift-E","Shift-F4"),exec:function(e){s.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:i("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:i(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:i("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:i("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:i("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:i("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:i("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:i("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:i("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:i("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:i("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:i("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:i("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:i("Ctrl-F","Command-F"),exec:function(e){s.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:i("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:i("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:i("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:i("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:i("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:i("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:i("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:i("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:i("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:i("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:i("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:i("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:i("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:i("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:i("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:i("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:i("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:i("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:i("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:i("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:i(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:i("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:i(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:i("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:i("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:i("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:i("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:i("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:i("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:i("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:i(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),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:i("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:i("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:i("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:i("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:i("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:i("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:i("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:i("Ctrl-H","Command-Option-F"),exec:function(e){s.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:i("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:i("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:i("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:i("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:i("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:i("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:i("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:i("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:i("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:i("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:i("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:i("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:i("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:i("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:i("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:i("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:i("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:i("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:i("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:i(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:i("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:i("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:i("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:i(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:i("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,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:i("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:i(null,null),exec:function(e){for(var t=e.selection.isBackwards(),a=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),s=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),i=e.session.doc.getLine(a.row).length,r=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(a.row),c=a.row+1;c<=s.row+1;c++){var d=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(c)));0!==d.length&&(d=" "+d),l+=d}s.row+10?(e.selection.moveCursorTo(a.row,a.column),e.selection.selectTo(a.row,a.column+r)):(i=e.session.doc.getLine(a.row).length>i?i+1:i,e.selection.moveCursorTo(a.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:i(null,null),exec:function(e){var t=e.session.doc.getLength()-1,a=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(var i=0;i0||e+t=0&&this.$isCustomWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(e+t))return e+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;for(var t=0;e-t>0||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(null!=e){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusCustomWidget=function(e){if(null!=e){var t=this.$getCustomWidget(e);t&&(t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus())}},e.prototype.$focusAnnotation=function(e){if(null!=e){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.$blurCustomWidget=function(e){var t=this.$getCustomWidget(e);t&&(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(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,void(this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex))},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e0;)if(e--,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/oop"),o=e("./lib/dom"),i=e("./lib/lang"),r=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,d=e("./mouse/fold_handler").FoldHandler,h=e("./keyboard/keybinding").KeyBinding,g=e("./edit_session").EditSession,p=e("./search").Search,u=e("./range").Range,m=e("./lib/event_emitter").EventEmitter,v=e("./commands/command_manager").CommandManager,f=e("./commands/default_commands").commands,w=e("./config"),b=e("./token_iterator").TokenIterator,y=e("./keyboard/gutter_handler").GutterKeyboardHandler,x=e("./config").nls,k=e("./clipboard"),M=e("./lib/keys"),C=e("./lib/event"),z=e("./tooltip").HoverTooltip,E=function(){function e(t,a,n){this.id="editor"+ ++e.$uid,this.session,this.$toDestroy=[];var s=t.getContainerElement();this.container=s,this.renderer=t,this.commands=new v(r.isMac?"mac":"win",f),"object"==typeof document&&(this.textInput=new l(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new d(this)),this.keyBinding=new h(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=i.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(a||n&&n.session||new g("")),w.resetOptions(this),n&&this.setOptions(n),w._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},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,e||(this.previousCommand=null)},e.prototype.onEndOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue)return void(this.curOp=null);if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,a=t&&t.scrollIntoView;if(a){switch(a){case"center-animate":a="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),s=this.renderer.layerConfig;(n.start.row>=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==a&&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){var t=this.prevOp,a=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==a.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==a.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var a=this;w.loadModule(["keybinding",e],(function(n){a.$keybindingId==e&&a.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){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 a=this.session.getSelection();a.off("changeCursor",this.$onCursorChange),a.off("changeSelection",this.$onSelectionChange)}this.session=e,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()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),t&&(t.$editor=null),e&&e._signal("changeEditor",{editor:this}),e&&(e.$editor=this),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),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,t){this.renderer.setStyle(e,t)},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){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&!t.destroyed){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var a=e.getCursorPosition(),n=e.getKeyboardHandler(),s=n&&n.$getDirectionForHighlight&&n.$getDirectionForHighlight(e),o=t.getMatchingBracketRanges(a,s);if(!o){var i=new b(t,a.row,a.column).getCurrentToken();if(i&&/\b(?:tag-open|tag-name)/.test(i.type)){var r=t.getMatchingTags(a);r&&(o=[r.openTagName.isEmpty()?r.openTag:r.openTagName,r.closeTagName.isEmpty()?r.closeTag:r.closeTagName])}}if(!o&&t.$mode.getMatching&&(o=t.$mode.getMatching(e.session)),o){var l="ace_bracket";Array.isArray(o)?1==o.length&&(l="ace_error_bracket"):o=[o],2==o.length&&(0==u.comparePoints(o[0].end,o[1].start)?o=[u.fromPoints(o[0].start,o[1].end)]:0==u.comparePoints(o[0].start,o[1].end)&&(o=[u.fromPoints(o[1].start,o[0].end)])),t.$bracketHighlight={ranges:o,markerIds:o.map((function(e){return t.addMarker(e,l,"text")}))},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}else 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){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,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,a=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,a,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,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var a=new u(e.row,e.column,e.row,1/0);a.id=t.addMarker(a,"ace_active-line","screenLine"),t.$highlightLineMarker=a}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var a=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(a,"ace_selection",n)}var s=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(s),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var a=t.start.column,n=t.end.column,s=e.getLine(t.start.row),o=s.substring(a,n);if(!(o.length>5e3)&&/[\w\d]/.test(o)){var i=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o}),r=s.substring(a-1,n+1);if(i.test(r))return i}}},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(!0)},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(),t=this.session.doc.getNewLineCharacter(),a=!1;if(!e&&this.$copyWithEmptySelection){a=!0;for(var n=this.selection.getAllRanges(),s=0;sr.search(/\S|$/)){var l=r.substr(s.column).search(/\S|$/);a.doc.removeInLine(s.row,s.column,s.column+l)}}this.clearSelection();var c=s.column,d=a.getState(s.row),h=(r=a.getLine(s.row),n.checkOutdent(d,r,e));if(a.insert(s,e),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new u(s.row,c+o.selection[0],s.row,c+o.selection[1])):this.selection.setSelectionRange(new u(s.row+o.selection[0],o.selection[1],s.row+o.selection[2],o.selection[3]))),this.$enableAutoIndent){if(a.getDocument().isNewLine(e)){var g=n.getNextLineIndent(d,r.slice(0,s.column),a.getTabString());a.insert({row:s.row+1,column:0},g)}h&&n.autoOutdent(d,a,s.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),a=this.selection.isEmpty()?[new u(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),n="",s="",o="",i=e.getTabString(),r=0;r0&&(n=e.getState(d-1),s=e.getLine(d-1),o=t.getNextLineIndent(n,s,i));var h=e.getLine(d),g=t.$getIndent(h);if(o!==g){if(g.length>0){var p=new u(d,0,d,g.length);e.remove(p)}o.length>0&&e.insert({row:d,column:0},o)}t.autoOutdent(n,e,d)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var a=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(a):a(),this.endOperation()},e.prototype.applyComposition=function(e,t){var a;(t.extendLeft||t.extendRight)&&((a=this.selection.getRange()).start.column-=t.extendLeft,a.end.column+=t.extendRight,a.start.column<0&&(a.start.row--,a.start.column+=this.session.getLine(a.start.row).length+1),this.selection.setRange(a),e||a.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((a=this.selection.getRange()).start.column-=t.restoreStart,a.end.column-=t.restoreEnd,this.selection.setRange(a))},e.prototype.onCommandKey=function(e,t,a){return this.keyBinding.onCommandKey(e,t,a)},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){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var a=this.session,n=a.getState(t.start.row),s=a.getMode().transformAction(n,"deletion",this,a,t);if(0===t.end.column){var o=a.getTextRange(t);if("\n"==o[o.length-1]){var i=a.getLine(t.end.row);/^\s+$/.test(i)&&(t.end.column=i.length)}}s&&(t=s)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();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(){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()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var a,n,s=this.session.getLine(e.row);tt.toLowerCase()?1:0}));var s=new u(0,0,0,0);for(n=e.first;n<=e.last;n++){var o=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=o.length,t.replace(s,a[n-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),a=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,a,e)},e.prototype.getNumberAt=function(e,t){var a=/[\-]?[0-9]+(?:\.[0-9]+)?/g;a.lastIndex=0;for(var n=this.session.getLine(e);a.lastIndex=t)return{value:s[0],start:s.index,end:s.index+s[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,a=this.selection.getCursor().column,n=new u(t,a-1,t,a),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var o=this.getNumberAt(t,a);if(o){var i=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end,r=o.start+o.value.length-i,l=parseFloat(o.value);l*=Math.pow(10,r),i!==o.end&&a=r&&o<=l&&(a=t,c.selection.clearSelection(),c.moveCursorTo(e,r+n),c.selection.selectTo(e,l+n)),r=l}));for(var d,h=this.$toggleWordPairs,g=0;g=l&&i<=c&&g.match(/((?:https?|ftp):\/\/[\S]+)/)){r=g.replace(/[\s:.,'";}\]]+$/,"");break}l=c}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}return r},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),null!=t},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,t=this.session,a=e.getRange(),n=e.isBackwards();if(a.isEmpty()){var s=a.start.row;t.duplicateLines(s,s)}else{var o=n?a.start:a.end,i=t.insert(o,t.getTextRange(a));a.start=o,a.end=i,e.setSelectionRange(a,n)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,a){return this.session.moveText(e,t,a)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var a,n,s=this.selection;if(!s.inMultiSelectMode||this.inVirtualSelectionMode){var o=s.toOrientedRange();a=this.$getSelectedRows(o),n=this.session.$moveLines(a.first,a.last,t?0:e),t&&-1==e&&(n=0),o.moveBy(n,0),s.fromOrientedRange(o)}else{var i=s.rangeList.ranges;s.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var r=0,l=0,c=i.length,d=0;dp+1)break;p=u.last}for(d--,r=this.session.$moveLines(g,p,t?0:e),t&&-1==e&&(h=d+1);h<=d;)i[h].moveBy(r,0),h++;t||(r=0),l+=r}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{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 a=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(s,0)})):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var o=a.scrollTop;a.scrollBy(0,s*n.lineHeight),null!=t&&a.scrollCursorIntoView(null,.5),a.animateScrolling(o)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},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,a,n){this.renderer.scrollToLine(e,t,a,n)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),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 a=this.getCursorPosition(),n=new b(this.session,a.row,a.column),s=n.getCurrentToken(),o=0;s&&-1!==s.type.indexOf("tag-name")&&(s=n.stepBackward());var i=s||n.stepForward();if(i){var r,l,c=!1,d={},h=a.column-i.start,g={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(i.value.match(/[{}()\[\]]/g)){for(;h1?d[i.value]++:"=0;--o)this.$tryReplace(a[o],e)&&n++;return this.selection.setSelectionRange(s),n},e.prototype.$tryReplace=function(e,t){var a=this.session.getTextRange(e);return null!==(t=this.$search.replace(a,t))?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,a){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&s.mixin(t,e);var n=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),e=this.session.getTextRange(n)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:n});var o=this.$search.find(this.session);return t.preventScroll?o:o?(this.revealRange(o,a),o):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var a=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(a)},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(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,a=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var s=this.$scrollAnchor;s.style.cssText="position:absolute",this.container.insertBefore(s,this.container.firstChild);var o=this.on("changeSelection",(function(){n=!0})),i=this.renderer.on("beforeRender",(function(){n&&(t=a.renderer.container.getBoundingClientRect())})),r=this.renderer.on("afterRender",(function(){if(n&&t&&(a.isFocused()||a.searchBox&&a.searchBox.isFocused())){var e=a.renderer,o=e.$cursorLayer.$pixelPos,i=e.layerConfig,r=o.top-i.offset;null!=(n=o.top>=0&&r+t.top<0||!(o.topwindow.innerHeight)&&null)&&(s.style.top=r+"px",s.style.left=o.left+"px",s.style.height=i.lineHeight+"px",s.scrollIntoView(n)),n=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",r),this.renderer.off("beforeRender",i))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},e.prototype.prompt=function(e,t,a){var n=this;w.loadModule("ace/ext/prompt",(function(s){s.prompt(n,e,t,a)}))},e}();E.$uid=0,E.prototype.curOp=null,E.prototype.prevOp={},E.prototype.$mergeableCommands=["backspace","del","insertstring"],E.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"],["&&","||"],["==","!="]],s.implement(E.prototype,m),w.defineOptions(E.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){var t=this;this.textInput.setReadOnly(e),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(e){var a=!1;if(e&&"keydown"==e.type){if(!(a=e&&e.key&&1==e.key.length&&!e.ctrlKey&&!e.metaKey))return}else e&&"exec"!==e.type&&(a=!0);if(a){t.hoverTooltip||(t.hoverTooltip=new z);var n=o.createElement("div");n.textContent=x("editor.tooltip.disable-editing","Editing is disabled"),t.hoverTooltip.isOpen||t.hoverTooltip.showForRange(t,t.getSelectionRange(),n)}else t.hoverTooltip&&t.hoverTooltip.isOpen&&t.hoverTooltip.hide()});var a=this.textInput.getElement();e?(C.addListener(a,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(C.removeListener(a,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?_.attach(this):_.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?_.attach(this):_.detach(this)}},placeholder:{set:function(e){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)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{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)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t,a={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:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===M.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(r.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",x("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",x("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",n.bind(this)),this.commands.addCommand(a),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",x("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",x("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),t||(t=new y(this)),t.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",n.bind(this)),this.commands.removeCommand(a),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),t&&t.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(e){this.$textInputAriaLabel=e},initialValue:""},enableMobileMenu:{set:function(e){this.$enableMobileMenu=e},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var _={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,a){return Math.max(t.toString().length,(a.lastRow+1).toString().length,2)*a.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){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=E})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return 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,a){var n=t.firstRowScreen*t.lineHeight,s=Math.floor(n/this.canvasHeight);return a.documentToScreenRow(e,0)*t.lineHeight-s*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,a){return t.lineHeight*a.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);for(var t=n.createFragment(this.element),a=0;ao&&(l=s.end.row+1,o=(s=t.getNextFoldLine(l,s))?s.start.row:1/0),l>n){for(;this.$lines.getLength()>r+1;)this.$lines.pop();break}(i=this.$lines.get(++r))?i.row=l:(i=this.$lines.createCell(l,e,this.session,d),this.$lines.push(i)),this.$renderCell(i,e,s,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,a=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,s=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(s=t.getLength()+n-1);var o=a?a.getWidth(t,s,e):s.toString().length*e.characterWidth,i=this.$padding||this.$computePadding();(o+=i.left+i.right)===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){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var a=0;a=this.$cursorRow){if(n.row>this.$cursorRow){var s=this.session.getFoldLine(this.$cursorRow);if(!(a>0&&s&&s.start.row==t[a-1].row))break;n=t[a-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var a=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=a,!t||n0;s--)this.$lines.shift();if(n>a)for(s=this.session.getFoldedRowCount(a+1,n);s>0;s--)this.$lines.pop();e.firstRown&&this.$lines.push(this.$renderLines(e,n+1,a)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,a){for(var n=[],s=t,o=this.session.getNextFoldLine(s),i=o?o.start.row:1/0;s>i&&(s=o.end.row+1,i=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>a);){var r=this.$lines.createCell(s,e,this.session,d);this.$renderCell(r,e,o,s),n.push(r),s++}return n},e.prototype.$renderCell=function(e,t,a,s){var o=e.element,i=this.session,r=o.childNodes[0],c=o.childNodes[1],d=o.childNodes[2],h=o.childNodes[3],g=d.firstChild,p=i.$firstLineNumber,u=i.$breakpoints,m=i.$decorations,v=i.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&i.foldWidgets,w=a?a.start.row:Number.MAX_VALUE,b=t.lineHeight+"px",y=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",x=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(v?v.getText(i,s):s+p).toString();if(this.$highlightGutterLine&&(s==this.$cursorRow||a&&s=w&&this.$cursorRow<=a.end.row)&&(y+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),u[s]&&(y+=u[s]),m[s]&&(y+=m[s]),this.$annotations[s]&&s!==w&&(y+=this.$annotations[s].className),f){var M=f[s];null==M&&(M=f[s]=i.getFoldWidget(s))}if(M){var C="ace_fold-widget ace_"+M,z="start"==M&&s==w&&sa.right-t.right?"foldWidgets":void 0},e}();function d(e){var t=document.createTextNode("");e.appendChild(t);var a=n.createElement("span");e.appendChild(a);var s=n.createElement("span");e.appendChild(s);var o=n.createElement("span");return s.appendChild(o),e}c.prototype.$fixedWidth=!1,c.prototype.$highlightGutterLine=!0,c.prototype.$renderer="",c.prototype.$showLineNumbers=!0,c.prototype.$showFoldWidgets=!0,s.implement(c.prototype,i),t.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../range").Range,s=e("../lib/dom"),o=function(){function e(e){this.element=s.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return 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 a=-1!=this.i&&this.element.childNodes[this.i];a?this.i++:(a=document.createElement("div"),this.element.appendChild(a),this.i=-1),a.style.cssText=t,a.className=e},e.prototype.update=function(e){if(e){var t;for(var a in this.config=e,this.i=0,this.markers){var n=this.markers[a];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var o=this.$getTop(s.start.row,e),i=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,i,o,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.ig?4:0)|(c==l?8:0)),s,c==l?0:1,o)},e.prototype.drawMultiLineMarker=function(e,t,a,n,s){var o=this.$padding,i=n.lineHeight,r=this.$getTop(t.start.row,n),l=o+t.start.column*n.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,a+" ace_br1 ace_start",n,null,s)):this.elt(a+" ace_br1 ace_start","height:"+i+"px;right:"+o+"px;top:"+r+"px;left:"+l+"px;"+(s||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,a+" ace_br12",n,null,s)}else{r=this.$getTop(t.end.row,n);var d=t.end.column*n.characterWidth;this.elt(a+" ace_br12","height:"+i+"px;width:"+d+"px;top:"+r+"px;left:"+o+"px;"+(s||""))}if(!((i=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){r=this.$getTop(t.start.row+1,n);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(a+(h?" ace_br"+h:""),"height:"+i+"px;right:"+o+"px;top:"+r+"px;left:"+o+"px;"+(s||""))}},e.prototype.drawSingleLineMarker=function(e,t,a,n,s,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,a,n,s,o);var i=n.lineHeight,r=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),c=this.$padding+t.start.column*n.characterWidth;this.elt(a,"height:"+i+"px;width:"+r+"px;top:"+l+"px;left:"+c+"px;"+(o||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,a,n,s,o){var i=n.lineHeight,r=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(a,"height:"+i+"px;width:"+(e.width+(s||0))+"px;top:"+r+"px;left:"+(l+e.left)+"px;"+(o||""))}),this)},e.prototype.drawFullLineMarker=function(e,t,a,n,s){var o=this.$getTop(t.start.row,n),i=n.lineHeight;t.start.row!=t.end.row&&(i+=this.$getTop(t.end.row,n)-o),this.elt(a,"height:"+i+"px;top:"+o+"px;left:0;right:0;"+(s||""))},e.prototype.drawScreenLineMarker=function(e,t,a,n,s){var o=this.$getTop(t.start.row,n),i=n.lineHeight;this.elt(a,"height:"+i+"px;top:"+o+"px;left:0;right:0;"+(s||""))},e}();o.prototype.$padding=0,t.Marker=o})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,a){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,a){"use strict";var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),i=e("./lines").Lines,r=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken,d=function(){function e(e){this.dom=s,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 i(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},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,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],a=1;ad&&(r=l.end.row+1,d=(l=this.session.getNextFoldLine(r,l))?l.start.row:1/0),!(r>s);){var h=o[i++];if(h){this.dom.removeChildren(h),this.$renderLine(h,r,r==d&&l),c&&(h.style.top=this.$lines.computeLineTop(r,e,this.session)+"px");var g=e.lineHeight*this.session.getRowLength(r)+"px";h.style.height!=g&&(c=!0,h.style.height=g)}r++}if(c)for(;i0;s--)this.$lines.shift();if(t.lastRow>e.lastRow)for(s=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);s>0;s--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,a){for(var n=[],o=t,i=this.session.getNextFoldLine(o),r=i?i.start.row:1/0;o>r&&(o=i.end.row+1,r=(i=this.session.getNextFoldLine(o,i))?i.start.row:1/0),!(o>a);){var l=this.$lines.createCell(o,e,this.session),c=l.element;this.dom.removeChildren(c),s.setStyle(c.style,"height",this.$lines.computeLineHeight(o,e,this.session)+"px"),s.setStyle(c.style,"top",this.$lines.computeLineTop(o,e,this.session)+"px"),this.$renderLine(c,o,o==r&&i),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",n.push(l),o++}return n},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,a=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,a))},e.prototype.$renderToken=function(e,t,a,n){for(var s,i=this,r=/(\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,d=this.dom.createFragment(this.element),h=0;s=r.exec(n);){var g=s[1],p=s[2],u=s[3],m=s[4],v=s[5];if(i.showSpaces||!p){var f=h!=s.index?n.slice(h,s.index):"";if(h=s.index+s[0].length,f&&d.appendChild(this.dom.createTextNode(f,this.element)),g){var w=i.session.getScreenTabSize(t+s.index);d.appendChild(i.$tabStrings[w].cloneNode(!0)),t+=w-1}else p?i.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=o.stringRepeat(i.SPACE_CHAR,p.length),d.appendChild(y)):d.appendChild(this.dom.createTextNode(p,this.element)):u?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=o.stringRepeat(i.SPACE_CHAR,u.length),d.appendChild(y)):m?(t+=1,(y=this.dom.createElement("span")).style.width=2*i.config.characterWidth+"px",y.className=i.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=i.showSpaces?i.SPACE_CHAR:m,d.appendChild(y)):v&&(t+=1,(y=this.dom.createElement("span")).style.width=2*i.config.characterWidth+"px",y.className="ace_cjk",y.textContent=v,d.appendChild(y))}}if(d.appendChild(this.dom.createTextNode(h?n.slice(h):n,this.element)),c(a.type))e.appendChild(d);else{var b="ace_"+a.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==a.type&&(y.style.width=a.value.length*this.config.characterWidth+"px",y.setAttribute("title",l("inline-fold.closed.title","Unfold code"))),y.className=b,y.appendChild(d),e.appendChild(y)}return t+n.length},e.prototype.renderIndentGuide=function(e,t,a){var n=t.search(this.$indentGuideRe);if(n<=0||n>=a)return t;if(" "==t[0]){for(var s=(n-=n%this.tabSize)/this.tabSize,o=0;os[o].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length)for(this.$highlightIndentGuideMarker.dir=1,o=t.row+1;o0))return;a=e.element.childNodes[0]}var n=a.childNodes;if(n){var s=n[t-1];s&&s.classList&&s.classList.contains("ace_indent-guide")&&s.classList.add("ace_indent-guide-active")}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var a=0;a=this.$highlightIndentGuideMarker.start+1){if(n.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}else for(a=e.length-1;a>=0;a--)if(n=e[a],this.$highlightIndentGuideMarker.end&&n.row=i;)r=this.$renderToken(l,r,d,h.substring(0,i-n)),h=h.substring(i-n),n=i,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(o.stringRepeat(" ",a.indent),this.element)),r=0,i=a[++s]||Number.MAX_VALUE;0!=h.length&&(n+=h.length,r=this.$renderToken(l,r,d,h))}}a[a.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,r,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){for(var a=0,n=0;nthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,a,s,o);a=this.$renderToken(e,a,s,o)}}},e.prototype.$renderOverflowMessage=function(e,t,a,n,s){a&&this.$renderToken(e,t,a,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=s?"":"",e.appendChild(o)},e.prototype.$renderLine=function(e,t,a){if(a||0==a||(a=this.session.getFoldLine(t)),a)var n=this.$getFoldLineTokens(t,a);else n=this.session.getTokens(t);var s=e;if(n.length){var o=this.session.getRowSplitData(t);o&&o.length?(this.$renderWrappedLine(e,n,o),s=e.lastChild):(s=e,this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.$renderSimpleLine(s,n))}else this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s));if(this.showEOL&&s){a&&(t=a.end.row);var i=this.dom.createElement("span");i.className="ace_invisible ace_invisible_eol",i.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,s.appendChild(i)}},e.prototype.$getFoldLineTokens=function(e,t){var a=this.session,n=[],s=a.getTokens(e);return t.walk((function(e,t,o,i,r){null!=e?n.push({type:"fold",value:e}):(r&&(s=a.getTokens(t)),s.length&&function(e,t,a){for(var s=0,o=0;o+e[s].value.lengtha-t&&(i=i.substring(0,a-t)),n.push({type:e[s].type,value:i}),o=t+i.length,s+=1);oa?n.push({type:e[s].type,value:i.substring(0,a-o)}):n.push(e[s]),o+=i.length,s+=1}}(s,i,o))}),t.end.row,this.session.getLine(t.end.row).length),n},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();d.prototype.EOF_CHAR="¶",d.prototype.EOL_CHAR_LF="¬",d.prototype.EOL_CHAR_CRLF="¤",d.prototype.EOL_CHAR=d.prototype.EOL_CHAR_LF,d.prototype.TAB_CHAR="—",d.prototype.SPACE_CHAR="·",d.prototype.$padding=0,d.prototype.MAX_LINE_LENGTH=1e4,d.prototype.showInvisibles=!1,d.prototype.showSpaces=!1,d.prototype.showTabs=!1,d.prototype.showEOL=!1,d.prototype.displayIndentGuides=!0,d.prototype.$highlightIndentGuides=!0,d.prototype.$tabStrings=[],d.prototype.destroy={},d.prototype.onChangeTabSize=d.prototype.$computeTabString,n.implement(d.prototype,r),t.Text=d})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=function(){function e(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,a=t.length;a--;)n.setStyle(t[a].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,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){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,n.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var a=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(a.row,e.row)?this.session.$bidiHandler.getPosLeft(a.column):a.column*this.config.characterWidth),top:(a.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||i.top<0)&&a>1)){var r=this.cursors[s++]||this.addCursor(),l=r.style;this.drawCursor?this.drawCursor(r,i,e,t[a],this.session):this.isCursorInView(i,e)?(n.setStyle(l,"display","block"),n.translate(r,i.left,i.top),n.setStyle(l,"width",Math.round(e.characterWidth)+"px"),n.setStyle(l,"height",e.lineHeight+"px")):n.setStyle(l,"display","none")}}for(;this.cursors.length>s;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=i,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();s.prototype.$padding=0,s.prototype.drawCursor=null,t.Cursor=s})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("./lib/oop"),i=e("./lib/dom"),r=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter,c=32768,d=function(){function e(e,t){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();o.implement(d.prototype,l);var h=function(e){function t(t,a){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,a.$scrollbarWidth=n.width=i.scrollbarWidth(t.ownerDocument),n.inner.style.width=n.element.style.width=(n.width||15)+5+"px",n.$minWidth=0,n}return s(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},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,e>c?(this.coeff=c/e,e=c):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(d);h.prototype.setInnerHeight=h.prototype.setScrollHeight;var g=function(e){function t(t,a){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.height=a.$scrollbarWidth,n.inner.style.height=n.element.style.height=(n.height||15)+5+"px",n}return s(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},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){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(d);t.ScrollBar=h,t.ScrollBarV=h,t.ScrollBarH=g,t.VScrollBar=h,t.HScrollBar=g})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("./lib/oop"),i=e("./lib/dom"),r=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter;i.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",!1);var c=function(){function e(e,t){this.element=i.createElement("div"),this.element.className="ace_sb"+t,this.inner=i.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();o.implement(c.prototype,l);var d=function(e){function t(t,a){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,n.parent=t,n.width=n.VScrollWidth,n.renderer=a,n.inner.style.width=n.element.style.width=(n.width||15)+"px",n.$minWidth=0,n}return s(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===r.getButton(t)&&2!==t.detail){if(t.target===this.inner){var a=this,n=t.clientY,s=t.clientY,o=this.thumbTop;r.capture(this.inner,(function(e){n=e.clientY}),(function(){clearInterval(i)}));var i=setInterval((function(){if(void 0!==n){var e=a.scrollTopFromThumbTop(o+n-s);e!==a.scrollTop&&a._emit("scroll",{data:e})}}),20);return r.preventDefault(t)}var l=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(l)}),r.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);return(t|=0)<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),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,!0)},t.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(c);d.prototype.setInnerHeight=d.prototype.setScrollHeight;var h=function(e){function t(t,a){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.scrollWidth=0,n.height=n.HScrollHeight,n.inner.style.height=n.element.style.height=(n.height||12)+"px",n.renderer=a,n}return s(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===r.getButton(t)&&2!==t.detail){if(t.target===this.inner){var a=this,n=t.clientX,s=t.clientX,o=this.thumbLeft;r.capture(this.inner,(function(e){n=e.clientX}),(function(){clearInterval(i)}));var i=setInterval((function(){if(void 0!==n){var e=a.scrollLeftFromThumbLeft(o+n-s);e!==a.scrollLeft&&a._emit("scroll",{data:e})}}),20);return r.preventDefault(t)}var l=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(l)}),r.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);return(t|=0)<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),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,!0)},t.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(c);h.prototype.setInnerWidth=h.prototype.setScrollWidth,t.ScrollBar=d,t.ScrollBarV=d,t.ScrollBarH=h,t.VScrollBar=d,t.HScrollBar=h})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,a){"use strict";var n=e("./lib/event"),s=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var a=this;this._flush=function(e){a.pending=!1;var t=a.changes;if(t&&(n.blockIdle(100),a.changes=0,a.onRender(t)),a.changes){if(a.$recursionLimit--<0)return;a.schedule()}else a.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=s})),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,a){var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),i=e("../lib/event"),r=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=512,d="function"==typeof ResizeObserver,h=200,g=function(){function e(e){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.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},d?this.$addObserver():this.checkForSizeChanges()}return 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",r.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),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=i.onIdle((function t(){e.checkForSizeChanges(),i.onIdle(t,500)}),500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():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};return 0===t.width||0===t.height?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=o.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return e&&e.parentElement?(Number(window.getComputedStyle(e).zoom)||1)*this.$getZoom(e.parentElement):1},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=s.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},e.prototype.transformCoordinates=function(e,t){function a(e,t,a){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*a[0]+t[0]*a[1])/n,(+e[1]*a[0]-e[0]*a[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function i(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=o(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var r=i(this.els[0]),l=i(this.els[1]),c=i(this.els[2]),d=i(this.els[3]),g=a(n(d,l),n(d,c),n(s(l,c),s(d,r))),p=o(1+g[0],n(l,r)),u=o(1+g[1],n(c,r));if(t){var m=t,v=g[0]*m[0]/h+g[1]*m[1]/h+1,f=s(o(m[0],p),o(m[1],u));return s(o(1/v/h,f),r)}var w=n(e,r),b=a(n(p,o(g[0],w)),n(u,o(g[1],w)),w);return o(h,b)},e}();g.prototype.$characterSize={width:0,height:0},n.implement(g.prototype,l),t.FontMetrics=g})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,a){a.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.ace_invisible {\n font-variant-ligatures: none;\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   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 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(33em, 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, .ace_custom-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 pointer-events: auto;\n}\n\n.ace_custom-widget {\n background: none;\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,a){"use strict";var n=e("../lib/dom"),s=e("../lib/oop"),o=e("../lib/event_emitter").EventEmitter,i=function(){function e(e,t){this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,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)"},this.setScrollBarV(e)}return e.prototype.$createCanvas=function(){this.canvas=n.createElement("canvas"),this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7",this.canvas.style.position="absolute"},e.prototype.setScrollBarV=function(e){this.$createCanvas(),this.scrollbarV=e,e.element.appendChild(this.canvas),this.setDimensions()},e.prototype.$updateDecorators=function(e){if("function"==typeof this.canvas.getContext){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light;this.setDimensions(e);var a=this.canvas.getContext("2d"),n=this.renderer.session.$annotations;if(a.clearRect(0,0,this.canvas.width,this.canvas.height),n){var s={info:1,warning:2,error:3};n.forEach((function(e){e.priority=s[e.type]||null})),n=n.sort((function(e,t){return e.priorityt.priority?1:0}));for(var o=0;othis.canvasHeight&&(h=this.canvasHeight-g);var p=h-g,u=h+g-p;a.fillStyle=t[n[o].type]||null,a.fillRect(0,p,Math.round(this.oneZoneWidth-1),u)}}var m=this.renderer.session.selection.getCursor();if(m){var v=Math.round(this.getVerticalOffsetForRow(m.row)*this.heightRatio);a.fillStyle="rgba(0, 0, 0, 0.5)",a.fillRect(0,v,this.canvasWidth,2)}}},e.prototype.getVerticalOffsetForRow=function(e){return e|=0,this.renderer.session.documentToScreenRow(e,0)*this.lineHeight},e.prototype.setDimensions=function(e){e=e||this.renderer.layerConfig,this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeighte&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||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){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,a,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),!n&&this.$maxLines&&this.lineHeight>1&&(s.style.height&&"0px"!=s.style.height||(s.style.height="1px",n=s.clientHeight||s.scrollHeight)),a||(a=s.clientWidth||s.scrollWidth);var o=this.$updateCachedSize(e,t,a,n);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!a&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(o|this.$changes,!0):this.$loop.schedule(o|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,a,n){n-=this.$extraHeight||0;var o=0,i=this.$size,r={width:i.width,height:i.height,scrollerHeight:i.scrollerHeight,scrollerWidth:i.scrollerWidth};if(n&&(e||i.height!=n)&&(i.height=n,o|=this.CHANGE_SIZE,i.scrollerHeight=i.height,this.$horizScroll&&(i.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(i.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),a&&(e||i.width!=a)){o|=this.CHANGE_SIZE,i.width=a,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,s.setStyle(this.scrollBarH.element.style,"left",t+"px"),s.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),i.scrollerWidth=Math.max(0,a-t-this.scrollBarV.getWidth()-this.margin.h),s.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";s.setStyle(this.scrollBarH.element.style,"right",l),s.setStyle(this.scroller.style,"right",l),s.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(i.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(o|=this.CHANGE_FULL)}return i.$dirty=!a||!n,o&&this._signal("resize",r),o},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,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){if(!this.$printMarginEl){var e=s.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=s.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",this.session&&-1==this.session.$wrap&&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){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var a=this.$cursorLayer.$pixelPos;if(a){t&&t.markerRange&&(a=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var n=this.layerConfig,o=a.top,i=a.left;o-=n.offset;var r=t&&t.useTextareaForIME||y.isMobile?this.lineHeight:1;if(o<0||o>n.height-r)s.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-r;if(t)if(t.useTextareaForIME){var d=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(d)[0]}else o+=this.lineHeight+2;else o+=this.lineHeight;(i-=this.scrollLeft)>this.$size.scrollerWidth-l&&(i=this.$size.scrollerWidth-l),i+=this.gutterWidth+this.margin.left,s.setStyle(e,"height",r+"px"),s.setStyle(e,"width",l+"px"),s.translate(this.textarea,Math.min(i,this.$size.scrollerWidth-l),Math.min(o,c))}}}else s.translate(this.textarea,-100,0)}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1: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,a,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|a,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},e.prototype.setMargin=function(e,t,a,n){var s=this.margin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|a,s.v=s.top+s.bottom,s.h=s.left+s.right,this.$updateCachedSize(!0,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,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,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=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var a=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){if(e|=this.$computeLayerConfig()|this.$loop.clear(),a.firstRow!=this.layerConfig.firstRow&&a.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(a.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}a=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),s.translate(this.content,-this.scrollLeft,-a.offset);var o=a.width+2*this.$padding+"px",i=a.minHeight+"px";s.setStyle(this.content.style,"width",o),s.setStyle(this.content.style,"height",i)}if(e&this.CHANGE_H_SCROLL&&(s.translate(this.content,-this.scrollLeft,-a.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(a):this.$textLayer.scrollLines(a),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(a):this.$gutterLayer.scrollLines(a)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(a),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(a),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(a),this._signal("afterRender",e)}else this.$changes|=e},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,a=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(a+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&a>this.$maxPixelHeight&&(a=this.$maxPixelHeight);var n=!(a<=2*this.lineHeight)&&e>t;if(a!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var s=this.container.clientWidth;this.container.style.height=a+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,a),this.desiredHeight=a,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,a=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),o=!a&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),i=this.$horizScroll!==o;i&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var r=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),a=t.height<=2*this.lineHeight);var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=c;var d=this.scrollMargin;this.session.setScrollTop(Math.max(-d.top,Math.min(this.scrollTop,n-t.scrollerHeight+d.bottom))),this.session.setScrollLeft(Math.max(-d.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+d.right)));var h=!a&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+c<0||this.scrollTop>d.top),g=r!==h;g&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var p,u,m=this.scrollTop%this.lineHeight,v=Math.ceil(l/this.lineHeight)-1,f=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),w=f+v,b=this.lineHeight;f=e.screenToDocumentRow(f,0);var y=e.getFoldLine(f);y&&(f=y.start.row),p=e.documentToScreenRow(f,0),u=e.getRowLength(f)*b,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*b+u,(m=this.scrollTop-p*b)<0&&p>0&&(p=Math.max(0,p+Math.floor(m/b)),m=this.scrollTop-p*b);var x=0;return(this.layerConfig.width!=s||i)&&(x=this.CHANGE_H_SCROLL),(i||g)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),g&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:f,firstRowScreen:p,lastRow:w,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:b?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),x},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var a=this.layerConfig;if(!(e>a.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),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,a){this.scrollCursorIntoView(e,a),this.scrollCursorIntoView(t,a)},e.prototype.scrollCursorIntoView=function(e,t,a){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,o=n.top,i=a&&a.top||0,r=a&&a.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+i>o?(t&&l+i>o+this.lineHeight&&(o-=t*this.$size.scrollerHeight),0===o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):l+this.$size.scrollerHeight-r=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},e.prototype.pixelToScreenCoordinates=function(e,t){var a;if(this.$hasCssTransforms){a={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else a=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-a.left-this.$padding,o=s/this.characterWidth,i=Math.floor((t+this.scrollTop-a.top)/this.lineHeight),r=this.$blockCursor?Math.floor(o):Math.round(o);return{row:i,column:r,side:o-r>0?1:-1,offsetX:s}},e.prototype.screenToTextCoordinates=function(e,t){var a;if(this.$hasCssTransforms){a={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else a=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-a.left-this.$padding,o=s/this.characterWidth,i=this.$blockCursor?Math.floor(o):Math.round(o),r=Math.floor((t+this.scrollTop-a.top)/this.lineHeight);return this.session.screenToDocumentPosition(r,Math.max(i,0),s)},e.prototype.textToScreenCoordinates=function(e,t){var a=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),o=n.row*this.lineHeight;return{pageX:a.left+s-this.scrollLeft,pageY:a.top+o-this.scrollTop}},e.prototype.visualizeFocus=function(){s.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){s.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(s.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):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){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),s.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 a=this.session.selection.cursor,n=t||{row:a.row,column:a.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 i=s.createElement("div");if(o.length>1){var r,l=this.hideTokensAfterPosition(n.row,n.column);o.slice(1).forEach((function(e){var t=s.createElement("div"),a=s.createElement("span");a.className="ace_ghost_text",e.wrapped&&(t.className="ghost_text_line_wrapped"),0===e.text.length&&(e.text=" "),a.appendChild(s.createTextNode(e.text)),t.appendChild(a),i.appendChild(t),r=t})),l.forEach((function(e){var t=s.createElement("span");x(e.type)||(t.className="ace_"+e.type.replace(/\./g," ace_")),t.appendChild(s.createTextNode(e.value)),r.appendChild(t)})),this.$ghostTextWidget={el:i,row:n.row,column:n.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var c=this.$cursorLayer.getPixelPosition(n,!0),d=this.container.getBoundingClientRect().height,h=o.length*this.lineHeight;if(h0){var c=0;l.push(s[i].length);for(var d=0;d1||Math.abs(e.$size.height-n)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container)}},e}();k.prototype.CHANGE_CURSOR=1,k.prototype.CHANGE_MARKER=2,k.prototype.CHANGE_GUTTER=4,k.prototype.CHANGE_SCROLL=8,k.prototype.CHANGE_LINES=16,k.prototype.CHANGE_TEXT=32,k.prototype.CHANGE_SIZE=64,k.prototype.CHANGE_MARKER_BACK=128,k.prototype.CHANGE_MARKER_FRONT=256,k.prototype.CHANGE_FULL=512,k.prototype.CHANGE_H_SCROLL=1024,k.prototype.$changes=0,k.prototype.$padding=null,k.prototype.$frozen=!1,k.prototype.STEPS=8,n.implement(k.prototype,f),i.defineOptions(k.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(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:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){s.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof 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){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!y.isMobile&&!y.isIE}}),t.VirtualRenderer=k})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,a){"use strict";var n=e("../lib/oop"),s=e("../lib/net"),o=e("../lib/event_emitter").EventEmitter,i=e("../config");function r(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(i.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+s.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return a.append(t),a.getBlob("application/javascript")}}(e),a=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(a)}return new Worker(e)}var l=function(e){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,a,n,s,o){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),i.get("packaged")||!e.toUrl)s=s||i.moduleUrl(a,"worker");else{var l=this.$normalizePath;s=s||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=r(s),o&&this.send("importScripts",o),this.$worker.postMessage({init:!0,tlns:c,module:a,classname:n}),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 a=this.callbacks[t.id];a&&(a(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)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return s.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,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,a){if(a){var n=this.callbackId++;this.callbacks[n]=a,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,a){var n=null,s=!1,r=Object.create(o),c=[],d=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),n&&(s?setTimeout(h):h())}});d.setEmitSync=function(e){s=e};var h=function(){var e=c.shift();e.command?n[e.command].apply(n,e.args):e.event&&r._signal(e.event,e.data)};return r.postMessage=function(e){d.onMessage({data:e})},r.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},r.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},i.loadModule(["worker",t],(function(e){for(n=new e[a](r);c.length;)h()})),d},t.WorkerClient=l,t.createWorker=r})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,a){"use strict";var n=e("./range").Range,s=e("./lib/event_emitter").EventEmitter,o=e("./lib/oop"),i=function(){function e(e,t,a,n,s,o){var i=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout((function(){i.onCursorChange()}))},this.$pos=a;var r=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=r.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,a=this.session;this.selectionBefore=a.selection.toJSON(),a.selection.inMultiSelectMode&&a.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=a.addMarker(new n(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(a){var n=t.createAnchor(a.row,a.column);n.$insertRight=!0,n.detach(),e.others.push(n)})),a.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(a){a.markerId=e.addMarker(new n(a.row,a.column,a.row,a.column+t.length),t.othersClass,null,!1)}))}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),s&&(this.length+=a),s&&!this.session.$fromUndo)if("insert"===e.action)for(var i=this.others.length-1;i>=0;i--){var r={row:(l=this.others[i]).row,column:l.column+o};this.doc.insertMergedLines(r,e.lines)}else if("remove"===e.action)for(i=this.others.length-1;i>=0;i--){var l;r={row:(l=this.others[i]).row,column:l.column+o},this.doc.remove(new n(r.row,r.column,r.row,r.column-a))}this.$updating=!1,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){var e=this,t=this.session,a=function(a,s){t.removeMarker(a.markerId),a.markerId=t.addMarker(new n(a.row,a.column,a.row,a.column+e.length),s,null,!1)};a(this.pos,this.mainClass);for(var s=this.others.length;s--;)a(this.others[s],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(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(!0),this.session=null},e.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,a=0;a1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{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:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,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,a){var n=e("./range_list").RangeList,s=e("./range").Range,o=e("./selection").Selection,i=e("./mouse/multi_select_handler").onMouseDown,r=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var d=new(0,e("./search").Search),h=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(h.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var a=this.toOrientedRange();if(this.rangeList.add(a),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(a),this.$onAddRange(a)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();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){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var a=e.length;a--;){var n=this.ranges.indexOf(e[a]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new n,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],a=0;a1){var e=this.rangeList.ranges,t=e[e.length-1],a=s.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(a,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),o=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,o).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,a){var n=[],o=e.column0;)w--;if(w>0)for(var b=0;n[b].isEmpty();)b++;for(var y=w;y>=b;y--)n[y].isEmpty()&&n.splice(y,1)}return n}}.call(o.prototype);var g=e("./editor").Editor;function p(e){e.$multiselectOnSessionChange||(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",i),e.commands.addCommands(c.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),a=!1;r.addListener(t,"keydown",(function(t){var s=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&s?a||(e.renderer.setMouseCursor("crosshair"),a=!0):a&&n()}),e),r.addListener(t,"keyup",n,e),r.addListener(t,"blur",n,e)}function n(t){a&&(e.renderer.setMouseCursor(""),a=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,a=e.length;a--;){var n=e[a];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,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){this.inMultiSelectMode||(this.inMultiSelectMode=!0,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){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,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,a=e.editor;if(a.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=a.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=a.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(a.exitMultiSelectMode(),n=t.exec(a,e.args||{})):n=t.multiSelectAction(a,e.args||{});else{var n=t.exec(a,e.args||{});a.multiSelect.addRange(a.multiSelect.toOrientedRange()),a.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,a){if(!this.inVirtualSelectionMode){var n,s=a&&a.keepOrder,i=1==a||a&&a.$byLines,r=this.session,l=this.selection,c=l.rangeList,d=(s?l:c).ranges;if(!d.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var g=new o(r);this.inVirtualSelectionMode=!0;for(var p=d.length;p--;){if(i)for(;p>0&&d[p].start.row==d[p-1].end.row;)p--;g.fromOrientedRange(d[p]),g.index=p,this.selection=r.selection=g;var u=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===u||(n=u),g.toOrientedRange(d[p])}g.detach(),this.selection=r.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,a=[],n=0;ni&&(i=a.column),nd?e.insert(n,l.stringRepeat(" ",o-d)):e.remove(new s(n.row,n.column,n.row,n.column-o+d)),t.start.column=t.end.column=i,t.start.row=t.end.row=n.row,t.cursor=t.end})),t.fromOrientedRange(a[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var d=this.selection.getRange(),h=d.start.row,g=d.end.row,p=h==g;if(p){var u,m=this.session.getLength();do{u=this.session.getLine(g)}while(/[=:]/.test(u)&&++g0);h<0&&(h=0),g>=m&&(g=m-1)}var v=this.session.removeFullLines(h,g);v=this.$reAlignText(v,p),this.session.insert({row:h,column:0},v.join("\n")+"\n"),p||(d.start.column=0,d.end.column=v[v.length-1].length),this.selection.setRange(d)}},this.$reAlignText=function(e,t){var a,n,s,o=!0,i=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==a?(a=t[1].length,n=t[2].length,s=t[3].length,t):(a+n+s!=t[1].length+t[2].length+t[3].length&&(i=!1),a!=t[1].length&&(o=!1),a>t[1].length&&(a=t[1].length),nt[3].length&&(s=t[3].length),t):[e]})).map(t?c:o?i?function(e){return e[2]?r(a+n-e[2].length)+e[2]+r(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?r(a)+e[2]+r(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function r(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?r(a)+e[2]+r(n-e[2].length+s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(g.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var a=e.oldSession;a&&(a.multiSelect.off("addRange",this.$onAddRange),a.multiSelect.off("removeRange",this.$onRemoveRange),a.multiSelect.off("multiSelect",this.$onMultiSelect),a.multiSelect.off("singleSelect",this.$onSingleSelect),a.multiSelect.lead.off("change",this.$checkMultiselectChange),a.multiSelect.anchor.off("change",this.$checkMultiselectChange)),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)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?this.on("mousedown",i):this.off("mousedown",i)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,a){"use strict";var n=e("../../range").Range,s=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,a){var n=e.getLine(a);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,a){return null},this.indentationBlock=function(e,t,a){var s=/\S/,o=e.getLine(t),i=o.search(s);if(-1!=i){for(var r=a||o.length,l=e.getLength(),c=t,d=t;++tc){var p=e.getLine(d).length;return new n(c,r,d,p)}}},this.openingBracketBlock=function(e,t,a,s,o){var i={row:a,column:s+1},r=e.$findClosingBracket(t,i,o);if(r){var l=e.foldWidgets[r.row];return null==l&&(l=e.getFoldWidget(r.row)),"start"==l&&r.row>i.row&&(r.row--,r.column=e.getLine(r.row).length),n.fromPoints(i,r)}},this.closingBracketBlock=function(e,t,a,s,o){var i={row:a,column:s},r=e.$findOpeningBracket(t,i);if(r)return r.column++,i.column--,n.fromPoints(r,i)}}).call(s.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=e("../range").Range,o=e("../config").nls;t.showErrorMarker=function(e,t){var a=e.session,i=e.getCursorPosition(),r=i.row,l=a.widgetManager.getWidgetsAtRow(r).filter((function(e){return"errorMarker"==e.type}))[0];l?l.destroy():r-=t;var c,d=function(e,t,a){var n=e.getAnnotations().sort(s.comparePoints);if(n.length){var o=function(e,t,a){for(var n=0,s=e.length-1;n<=s;){var o=n+s>>1,i=a(t,e[o]);if(i>0)n=o+1;else{if(!(i<0))return o;s=o-1}}return-(n+1)}(n,{row:t,column:-1},s.comparePoints);o<0&&(o=-o-1),o>=n.length?o=a>0?0:n.length-1:0===o&&a<0&&(o=n.length-1);var i=n[o];if(i&&a){if(i.row===t){do{i=n[o+=a]}while(i&&i.row===t);if(!i)return n.slice()}var r=[];t=i.row;do{r[a<0?"unshift":"push"](i),i=n[o+=a]}while(i&&i.row==t);return r.length&&r}}}(a,r,t);if(d){var h=d[0];i.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,i.row=h.row,c=e.renderer.$gutterLayer.$annotations[i.row]}else{if(l)return;c={displayText:[o("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(i.row),e.selection.moveToPosition(i);var g={row:i.row,fixedWidth:!0,coverGutter:!0,el:n.createElement("div"),type:"errorMarker"},p=g.el.appendChild(n.createElement("div")),u=g.el.appendChild(n.createElement("div"));u.className="error_widget_arrow "+c.className;var m=e.renderer.$cursorLayer.getPixelPosition(i).left;u.style.left=m+e.renderer.gutterWidth-5+"px",g.el.className="error_widget_wrapper",p.className="error_widget "+c.className,c.displayText.forEach((function(e,t){p.appendChild(n.createTextNode(e)),t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAceInstance=t.debounce=t.editorEvents=t.editorOptions=void 0,t.editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"],t.editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"],t.getAceInstance=function(){var e;return"undefined"==typeof window?(a.g.window={},e=a(186),delete a.g.window):window.ace?(e=window.ace).acequire=window.ace.require||window.ace.acequire:e=a(186),e},t.debounce=function(e,t){var a=null;return function(){var n=this,s=arguments;clearTimeout(a),a=setTimeout((function(){e.apply(n,s)}),t)}}},436:function(e,t,a){"object"==typeof navigator&&(e.exports=function(){"use strict";function e(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function t(e,t){for(var a=0;a(a=100/l.width*(s.clientX-l.left))?a=0:100a?a-=(100-2*a)*c:50t){var a=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(a))}return Math.round(e/t)*t}(a/100*(i-o),r)}},{key:"set",value:function(t){e.enabled&&u.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var a=new Event(t,{bubbles:!0});e.dispatchEvent(a)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var a=1null!=e?e.constructor:null,f=(e,t)=>Boolean(e&&t&&e instanceof t),w=e=>null==e,b=e=>v(e)===Object,y=e=>v(e)===String,x=e=>"function"==typeof e,k=e=>Array.isArray(e),M=e=>f(e,NodeList),C=e=>w(e)||(y(e)||k(e)||M(e))&&!e.length||b(e)&&!Object.keys(e).length;var z=w,E=b,_=e=>v(e)===Number&&!Number.isNaN(e),L=y,H=e=>v(e)===Boolean,S=x,V=k,T=M,A=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,$=e=>f(e,Event),B=e=>f(e,KeyboardEvent),N=e=>f(e,TextTrack)||!w(e)&&y(e.kind),P=e=>f(e,Promise)&&x(e.then),I=e=>{if(f(e,window.URL))return!0;if(!y(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!C(new URL(t).hostname)}catch(e){return!1}},O=C;const R=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},a=Object.keys(t).find((t=>void 0!==e.style[t]));return!!L(a)&&t[a]})();function D(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var j={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function F(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function q(e={},...t){if(!t.length)return e;const a=t.shift();return E(a)?(Object.keys(a).forEach((t=>{E(a[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),q(e[t],a[t])):Object.assign(e,{[t]:a[t]})})),q(e,...t)):e}function W(e,t){const a=e.length?e:[e];Array.from(a).reverse().forEach(((e,a)=>{const n=a>0?t.cloneNode(!0):t,s=e.parentNode,o=e.nextSibling;n.appendChild(e),o?s.insertBefore(n,o):s.appendChild(n)}))}function U(e,t){A(e)&&!O(t)&&Object.entries(t).filter((([,e])=>!z(e))).forEach((([t,a])=>e.setAttribute(t,a)))}function G(e,t,a){const n=document.createElement(e);return E(t)&&U(n,t),L(a)&&(n.innerText=a),n}function Y(e,t,a,n){A(t)&&t.appendChild(G(e,a,n))}function Z(e){T(e)||V(e)?Array.from(e).forEach(Z):A(e)&&A(e.parentNode)&&e.parentNode.removeChild(e)}function Q(e){if(!A(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function K(e,t){return A(t)&&A(t.parentNode)&&A(e)?(t.parentNode.replaceChild(e,t),e):null}function X(e,t){if(!L(e)||O(e))return{};const a={},n=q({},t);return e.split(",").forEach((e=>{const t=e.trim(),s=t.replace(".",""),o=t.replace(/[[\]]/g,"").split("="),[i]=o,r=o.length>1?o[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":L(n.class)?a.class=`${n.class} ${s}`:a.class=s;break;case"#":a.id=t.replace("#","");break;case"[":a[i]=r}})),q(n,a)}function J(e,t){if(!A(e))return;let a=t;H(a)||(a=!e.hidden),e.hidden=a}function ee(e,t,a){if(T(e))return Array.from(e).map((e=>ee(e,t,a)));if(A(e)){let n="toggle";return void 0!==a&&(n=a?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function te(e,t){return A(e)&&e.classList.contains(t)}function ae(e,t){const{prototype:a}=Element;return(a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ne(e){return this.elements.container.querySelectorAll(e)}function se(e){return this.elements.container.querySelector(e)}function oe(e=null,t=!1){A(e)&&e.focus({preventScroll:!0,focusVisible:t})}const ie={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},re={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const a=re[e]||"html5"!==t;return{api:a,ui:a&&re.rangeInput}},pip:!(j.isIPhone||!S(G("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||G("video").disablePictureInPicture)),airplay:S(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(O(e))return!1;const[t]=e.split("/");let a=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(ie).includes(a)&&(a+=`; codecs="${ie[e]}"`);try{return Boolean(a&&this.media.canPlayType(a).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==R,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},le=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function ce(e,t,a,n=!1,s=!0,o=!1){if(!e||!("addEventListener"in e)||O(t)||!S(a))return;const i=t.split(" ");let r=o;le&&(r={passive:s,capture:o}),i.forEach((t=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:t,callback:a,options:r}),e[n?"addEventListener":"removeEventListener"](t,a,r)}))}function de(e,t="",a,n=!0,s=!1){ce.call(this,e,t,a,!0,n,s)}function he(e,t="",a,n=!0,s=!1){ce.call(this,e,t,a,!1,n,s)}function ge(e,t="",a,n=!0,s=!1){const o=(...i)=>{he(e,t,o,n,s),a.apply(this,i)};ce.call(this,e,t,o,!0,n,s)}function pe(e,t="",a=!1,n={}){if(!A(e)||O(t))return;const s=new CustomEvent(t,{bubbles:a,detail:{...n,plyr:this}});e.dispatchEvent(s)}function ue(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:a,callback:n,options:s}=e;t.removeEventListener(a,n,s)})),this.eventListeners=[])}function me(){return new Promise((e=>this.ready?setTimeout(e,0):de.call(this,this.elements.container,"ready",e))).then((()=>{}))}function ve(e){P(e)&&e.then(null,(()=>{}))}function fe(e){return V(e)?e.filter(((t,a)=>e.indexOf(t)===a)):e}function we(e,t){return V(e)&&e.length?e.reduce(((e,a)=>Math.abs(a-t)({...e,[t/a]:[t,a]})),{});function xe(e){return!!(V(e)||L(e)&&e.includes(":"))&&(V(e)?e:e.split(":")).map(Number).every(_)}function ke(e){if(!V(e)||!e.every(_))return null;const[t,a]=e,n=(e,t)=>0===t?e:n(t,e%t),s=n(t,a);return[t/s,a/s]}function Me(e){const t=e=>xe(e)?e.split(":").map(Number):null;let a=t(e);if(null===a&&(a=t(this.config.ratio)),null===a&&!O(this.embed)&&V(this.embed.ratio)&&({ratio:a}=this.embed),null===a&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;a=[e,t]}return ke(a)}function Ce(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,a=Me.call(this,e);if(!V(a))return{};const[n,s]=ke(a),o=100/n*s;if(be(`aspect-ratio: ${n}/${s}`)?t.style.aspectRatio=`${n}/${s}`:t.style.paddingBottom=`${o}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),a=(e-o)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${a}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:o,ratio:a}}function ze(e,t,a=.05){const n=e/t,s=we(Object.keys(ye),n);return Math.abs(s-n)<=a?ye[s]:[e,t]}const Ee={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!O(t)||re.mime.call(this,t)})):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ee.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,O(this.config.ratio)||Ce.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Ee.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&S(e.config.quality.onChange))e.config.quality.onChange(t);else{const a=Ee.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!a)return;const{currentTime:n,paused:s,preload:o,readyState:i,playbackRate:r}=e.media;e.media.src=a.getAttribute("src"),("none"!==o||i)&&(e.once("loadedmetadata",(()=>{e.speed=r,e.currentTime=n,s||ve(e.play())})),e.media.load())}pe.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(Z(Ee.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function _e(e,...t){return O(e)?e:e.toString().replace(/{(\d+)}/g,((e,a)=>t[a].toString()))}const Le=(e="",t="",a="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),a.toString()),He=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function Se(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Ve={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Te={get(e="",t={}){if(O(e)||O(t))return"";let a=F(t.i18n,e);if(O(a))return Object.keys(Ve).includes(e)?Ve[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((([e,t])=>{a=Le(a,e,t)})),a}};class Ae{constructor(t){e(this,"get",(e=>{if(!Ae.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(O(t))return null;const a=JSON.parse(t);return L(e)&&e.length?a[e]:a})),e(this,"set",(e=>{if(!Ae.supported||!this.enabled)return;if(!E(e))return;let t=this.get();O(t)&&(t={}),q(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch(e){}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function $e(e,t="text"){return new Promise(((a,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",(()=>{if("text"===t)try{a(JSON.parse(n.responseText))}catch(e){a(n.responseText)}else a(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function Be(e,t){if(!L(e))return;const a="cache",n=L(t);let s=!1;const o=()=>null!==document.getElementById(t),i=(e,t)=>{e.innerHTML=t,n&&o()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!o()){const o=Ae.supported,r=document.createElement("div");if(r.setAttribute("hidden",""),n&&r.setAttribute("id",t),o){const e=window.localStorage.getItem(`${a}-${t}`);if(s=null!==e,s){const t=JSON.parse(e);i(r,t.content)}}$e(e).then((e=>{if(!O(e)){if(o)try{window.localStorage.setItem(`${a}-${t}`,JSON.stringify({content:e}))}catch(e){}i(r,e)}})).catch((()=>{}))}}const Ne=e=>Math.trunc(e/60/60%60,10);function Pe(e=0,t=!1,a=!1){if(!_(e))return Pe(void 0,t,a);const n=e=>`0${e}`.slice(-2);let s=Ne(e);const o=(e=>Math.trunc(e/60%60,10))(e),i=(e=>Math.trunc(e%60,10))(e);return s=t||s>0?`${s}:`:"",`${a&&e>0?"-":""}${s}${n(o)}:${n(i)}`}const Ie={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,a=e.host!==t||j.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:a}},findElements(){try{return this.elements.controls=se.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ne.call(this,this.config.selectors.buttons.play),pause:se.call(this,this.config.selectors.buttons.pause),restart:se.call(this,this.config.selectors.buttons.restart),rewind:se.call(this,this.config.selectors.buttons.rewind),fastForward:se.call(this,this.config.selectors.buttons.fastForward),mute:se.call(this,this.config.selectors.buttons.mute),pip:se.call(this,this.config.selectors.buttons.pip),airplay:se.call(this,this.config.selectors.buttons.airplay),settings:se.call(this,this.config.selectors.buttons.settings),captions:se.call(this,this.config.selectors.buttons.captions),fullscreen:se.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=se.call(this,this.config.selectors.progress),this.elements.inputs={seek:se.call(this,this.config.selectors.inputs.seek),volume:se.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:se.call(this,this.config.selectors.display.buffer),currentTime:se.call(this,this.config.selectors.display.currentTime),duration:se.call(this,this.config.selectors.display.duration)},A(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const a="http://www.w3.org/2000/svg",n=Ie.getIconUrl.call(this),s=`${n.cors?"":n.url}#${this.config.iconPrefix}`,o=document.createElementNS(a,"svg");U(o,q(t,{"aria-hidden":"true",focusable:"false"}));const i=document.createElementNS(a,"use"),r=`${s}-${e}`;return"href"in i&&i.setAttributeNS("http://www.w3.org/1999/xlink","href",r),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),o.appendChild(i),o},createLabel(e,t={}){const a=Te.get(e,this.config);return G("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},a)},createBadge(e){if(O(e))return null;const t=G("span",{class:this.config.classNames.menu.value});return t.appendChild(G("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const a=q({},t);let n=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=Le(t,"-"," "),t=Le(t,"_"," "),t=He(t),Le(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(a).includes(e)&&(s[e]=a[e],delete a[e])})),"button"!==s.element||Object.keys(a).includes("type")||(a.type="button"),Object.keys(a).includes("class")?a.class.split(" ").some((e=>e===this.config.classNames.control))||q(a,{class:`${a.class} ${this.config.classNames.control}`}):a.class=this.config.classNames.control,e){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":a.class+=` ${this.config.classNames.control}--overlaid`,n="play",s.label="play",s.icon="play";break;default:O(s.label)&&(s.label=n),O(s.icon)&&(s.icon=e)}const o=G(s.element);return s.toggle?(o.appendChild(Ie.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),o.appendChild(Ie.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),o.appendChild(Ie.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),o.appendChild(Ie.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(o.appendChild(Ie.createIcon.call(this,s.icon)),o.appendChild(Ie.createLabel.call(this,s.label))),q(a,X(this.config.selectors.buttons[n],a)),U(o,a),"play"===n?(V(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(o)):this.elements.buttons[n]=o,o},createRange(e,t){const a=G("input",q(X(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Te.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=a,Ie.updateRangeFill.call(this,a),m.setup(a),a},createProgress(e,t){const a=G("progress",q(X(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){a.appendChild(G("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],n=t?Te.get(t,this.config):"";a.innerText=`% ${n.toLowerCase()}`}return this.elements.display[e]=a,a},createTime(e,t){const a=X(this.config.selectors.display[e],t),n=G("div",q(a,{class:`${a.class?a.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Te.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts(e,t){de.call(this,e,"keydown keyup",(a=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(a.key))return;if(a.preventDefault(),a.stopPropagation(),"keydown"===a.type)return;const n=ae(e,'[role="menuitemradio"]');if(!n&&[" ","ArrowRight"].includes(a.key))Ie.showMenuPanel.call(this,t,!0);else{let t;" "!==a.key&&("ArrowDown"===a.key||n&&"ArrowRight"===a.key?(t=e.nextElementSibling,A(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,A(t)||(t=e.parentNode.lastElementChild)),oe.call(this,t,!0))}}),!1),de.call(this,e,"keyup",(e=>{"Return"===e.key&&Ie.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:a,title:n,badge:s=null,checked:o=!1}){const i=X(this.config.selectors.inputs[a]),r=G("button",q(i,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${i.class?i.class:""}`.trim(),"aria-checked":o,value:e})),l=G("span");l.innerHTML=n,A(s)&&l.appendChild(s),r.appendChild(l),Object.defineProperty(r,"checked",{enumerable:!0,get:()=>"true"===r.getAttribute("aria-checked"),set(e){e&&Array.from(r.parentNode.children).filter((e=>ae(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),r.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(r,"click keyup",(t=>{if(!B(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),r.checked=!0,a){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Ie.showMenuPanel.call(this,"home",B(t))}}),a,!1),Ie.bindMenuItemShortcuts.call(this,r,a),t.appendChild(r)},formatTime(e=0,t=!1){return _(e)?Pe(e,Ne(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,a=!1){A(e)&&_(t)&&(e.innerText=Ie.formatTime(t,a))},updateVolume(){this.supported.ui&&(A(this.elements.inputs.volume)&&Ie.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),A(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){A(e)&&(e.value=t,Ie.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!$(e))return;let t=0;const a=(e,t)=>{const a=_(t)?t:0,n=A(e)?e:this.elements.display.buffer;if(A(n)){n.value=a;const e=n.getElementsByTagName("span")[0];A(e)&&(e.childNodes[0].nodeValue=a)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,s=this.duration,t=0===n||0===s||Number.isNaN(n)||Number.isNaN(s)?0:(n/s*100).toFixed(2),"timeupdate"===e.type&&Ie.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":a(this.elements.display.buffer,100*this.buffered)}var n,s},updateRangeFill(e){const t=$(e)?e.target:e;if(A(t)&&"range"===t.getAttribute("type")){if(ae(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Ie.formatTime(this.currentTime),a=Ie.formatTime(this.duration),n=Te.get("seekLabel",this.config);t.setAttribute("aria-valuetext",n.replace("{currentTime}",e).replace("{duration}",a))}else if(ae(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(j.isWebKit||j.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,a;if(!this.config.tooltips.seek||!A(this.elements.inputs.seek)||!A(this.elements.display.seekTooltip)||0===this.duration)return;const n=this.elements.display.seekTooltip,s=`${this.config.classNames.tooltip}--visible`,o=e=>ee(n,s,e);if(this.touch)return void o(!1);let i=0;const r=this.elements.progress.getBoundingClientRect();if($(e))i=100/r.width*(e.pageX-r.left);else{if(!te(n,s))return;i=parseFloat(n.style.left,10)}i<0?i=0:i>100&&(i=100);const l=this.duration/100*i;n.innerText=Ie.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(a=t.points)||void 0===a?void 0:a.find((({time:e})=>e===Math.round(l)));c&&n.insertAdjacentHTML("afterbegin",`${c.label}
`),n.style.left=`${i}%`,$(e)&&["mouseenter","mouseleave"].includes(e.type)&&o("mouseenter"===e.type)},timeUpdate(e){const t=!A(this.elements.display.duration)&&this.config.invertTime;Ie.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Ie.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return J(this.elements.display.currentTime,!0),void J(this.elements.progress,!0);A(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=A(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Ie.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Ie.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Ie.setMarkers.call(this),Ie.updateSeekTooltip.call(this)},toggleMenuButton(e,t){J(this.elements.settings.buttons[e],!t)},updateSetting(e,t,a){const n=this.elements.settings.panels[e];let s=null,o=t;if("captions"===e)s=this.currentTrack;else{if(s=O(a)?this[e]:a,O(s)&&(s=this.config[e].default),!O(this.options[e])&&!this.options[e].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${e}`);if(!this.config[e].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${e}`)}if(A(o)||(o=n&&n.querySelector('[role="menu"]')),!A(o))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Ie.getLabel.call(this,e,s);const i=o&&o.querySelector(`[value="${s}"]`);A(i)&&(i.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Te.get("normal",this.config):`${t}×`;case"quality":if(_(t)){const e=Te.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return He(t);case"captions":return De.getLabel.call(this);default:return null}},setQualityMenu(e){if(!A(this.elements.settings.panels.quality))return;const t="quality",a=this.elements.settings.panels.quality.querySelector('[role="menu"]');V(e)&&(this.options.quality=fe(e).filter((e=>this.config.quality.options.includes(e))));const n=!O(this.options.quality)&&this.options.quality.length>1;if(Ie.toggleMenuButton.call(this,t,n),Q(a),Ie.checkMenu.call(this),!n)return;const s=e=>{const t=Te.get(`qualityBadge.${e}`,this.config);return t.length?Ie.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const a=this.config.quality.options;return a.indexOf(e)>a.indexOf(t)?1:-1})).forEach((e=>{Ie.createMenuItem.call(this,{value:e,list:a,type:t,title:Ie.getLabel.call(this,"quality",e),badge:s(e)})})),Ie.updateSetting.call(this,t,a)},setCaptionsMenu(){if(!A(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),a=De.getTracks.call(this),n=Boolean(a.length);if(Ie.toggleMenuButton.call(this,e,n),Q(t),Ie.checkMenu.call(this),!n)return;const s=a.map(((e,a)=>({value:a,checked:this.captions.toggled&&this.currentTrack===a,title:De.getLabel.call(this,e),badge:e.language&&Ie.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));s.unshift({value:-1,checked:!this.captions.toggled,title:Te.get("disabled",this.config),list:t,type:"language"}),s.forEach(Ie.createMenuItem.bind(this)),Ie.updateSetting.call(this,e,t)},setSpeedMenu(){if(!A(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const a=!O(this.options.speed)&&this.options.speed.length>1;Ie.toggleMenuButton.call(this,e,a),Q(t),Ie.checkMenu.call(this),a&&(this.options.speed.forEach((a=>{Ie.createMenuItem.call(this,{value:a,list:t,type:e,title:Ie.getLabel.call(this,"speed",a)})})),Ie.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!O(e)&&Object.values(e).some((e=>!e.hidden));J(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let a=e;A(a)||(a=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const n=a.querySelector('[role^="menuitem"]');oe.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,a=this.elements.buttons.settings;if(!A(t)||!A(a))return;const{hidden:n}=t;let s=n;if(H(e))s=e;else if(B(e)&&"Escape"===e.key)s=!1;else if($(e)){const n=S(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(n);if(o||!o&&e.target!==a&&s)return}a.setAttribute("aria-expanded",s),J(t,!s),ee(this.elements.container,this.config.classNames.menu.open,s),s&&B(e)?Ie.focusFirstMenuItem.call(this,null,!0):s||n||oe.call(this,a,B(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const a=t.scrollWidth,n=t.scrollHeight;return Z(t),{width:a,height:n}},showMenuPanel(e="",t=!1){const a=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!A(a))return;const n=a.parentNode,s=Array.from(n.children).find((e=>!e.hidden));if(re.transitions&&!re.reducedMotion){n.style.width=`${s.scrollWidth}px`,n.style.height=`${s.scrollHeight}px`;const e=Ie.getMenuSize.call(this,a),t=e=>{e.target===n&&["width","height"].includes(e.propertyName)&&(n.style.width="",n.style.height="",he.call(this,n,R,t))};de.call(this,n,R,t),n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}J(s,!0),J(a,!1),Ie.focusFirstMenuItem.call(this,a,t)},setDownloadUrl(){const e=this.elements.buttons.download;A(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:a,createProgress:n,createRange:s,createTime:o,setQualityMenu:i,setSpeedMenu:r,showMenuPanel:l}=Ie;this.elements.controls=null,V(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(a.call(this,"play-large"));const c=G("div",X(this.config.selectors.controls.wrapper));this.elements.controls=c;const d={class:"plyr__controls__item"};return fe(V(this.config.controls)?this.config.controls:[]).forEach((i=>{if("restart"===i&&c.appendChild(a.call(this,"restart",d)),"rewind"===i&&c.appendChild(a.call(this,"rewind",d)),"play"===i&&c.appendChild(a.call(this,"play",d)),"fast-forward"===i&&c.appendChild(a.call(this,"fast-forward",d)),"progress"===i){const t=G("div",{class:`${d.class} plyr__progress__container`}),a=G("div",X(this.config.selectors.progress));if(a.appendChild(s.call(this,"seek",{id:`plyr-seek-${e.id}`})),a.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const e=G("span",{class:this.config.classNames.tooltip},"00:00");a.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=a,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===i&&c.appendChild(o.call(this,"currentTime",d)),"duration"===i&&c.appendChild(o.call(this,"duration",d)),"mute"===i||"volume"===i){let{volume:t}=this.elements;if(A(t)&&c.contains(t)||(t=G("div",q({},d,{class:`${d.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===i&&t.appendChild(a.call(this,"mute")),"volume"===i&&!j.isIos&&!j.isIPadOS){const a={max:1,step:.05,value:this.config.volume};t.appendChild(s.call(this,"volume",q(a,{id:`plyr-volume-${e.id}`})))}}if("captions"===i&&c.appendChild(a.call(this,"captions",d)),"settings"===i&&!O(this.config.settings)){const n=G("div",q({},d,{class:`${d.class} plyr__menu`.trim(),hidden:""}));n.appendChild(a.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const s=G("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),o=G("div"),i=G("div",{id:`plyr-settings-${e.id}-home`}),r=G("div",{role:"menu"});i.appendChild(r),o.appendChild(i),this.elements.settings.panels.home=i,this.config.settings.forEach((a=>{const n=G("button",q(X(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,n,a),de.call(this,n,"click",(()=>{l.call(this,a,!1)}));const s=G("span",null,Te.get(a,this.config)),i=G("span",{class:this.config.classNames.menu.value});i.innerHTML=e[a],s.appendChild(i),n.appendChild(s),r.appendChild(n);const c=G("div",{id:`plyr-settings-${e.id}-${a}`,hidden:""}),d=G("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});d.appendChild(G("span",{"aria-hidden":!0},Te.get(a,this.config))),d.appendChild(G("span",{class:this.config.classNames.hidden},Te.get("menuBack",this.config))),de.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),de.call(this,d,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(d),c.appendChild(G("div",{role:"menu"})),o.appendChild(c),this.elements.settings.buttons[a]=n,this.elements.settings.panels[a]=c})),s.appendChild(o),n.appendChild(s),c.appendChild(n),this.elements.settings.popup=s,this.elements.settings.menu=n}if("pip"===i&&re.pip&&c.appendChild(a.call(this,"pip",d)),"airplay"===i&&re.airplay&&c.appendChild(a.call(this,"airplay",d)),"download"===i){const e=q({},d,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!I(t)&&this.isEmbed&&q(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(a.call(this,"download",e))}"fullscreen"===i&&c.appendChild(a.call(this,"fullscreen",d))})),this.isHTML5&&i.call(this,Ee.getQualityOptions.call(this)),r.call(this),c},inject(){if(this.config.loadSprite){const e=Ie.getIconUrl.call(this);e.cors&&Be(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let a,n=!0;if(S(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),A(this.config.controls)||L(this.config.controls)?e=this.config.controls:(e=Ie.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:De.getLabel.call(this)}),n=!1),n&&L(this.config.controls)&&(e=(e=>{let a=e;return Object.entries(t).forEach((([e,t])=>{a=Le(a,`{${e}}`,t)})),a})(e)),L(this.config.selectors.controls.container)&&(a=document.querySelector(this.config.selectors.controls.container)),A(a)||(a=this.elements.container),a[A(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),A(this.elements.controls)||Ie.findElements.call(this),!O(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>te(e,t),set(a=!1){ee(e,t,a),e.setAttribute("aria-pressed",a?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{V(t)||T(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(j.isEdge&&D(a),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,a=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,n=ne.call(this,a);Array.from(n).forEach((e=>{ee(e,this.config.classNames.hidden,!1),ee(e,this.config.classNames.tooltip,!0)}))}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const a=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&eee(o,i,e);a.forEach((e=>{const t=G("span",{class:this.config.classNames.marker},""),a=e.time/this.duration*100+"%";o&&(t.addEventListener("mouseenter",(()=>{e.label||(o.style.left=a,o.innerHTML=e.label,r(!0))})),t.addEventListener("mouseleave",(()=>{r(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=a,s.appendChild(t)})),n.appendChild(s),this.config.tooltips.seek||(o=G("span",{class:this.config.classNames.tooltip},""),n.appendChild(o)),this.elements.markers={points:s,tip:o},this.elements.progress.appendChild(n)}};function Oe(e,t=!0){let a=e;if(t){const e=document.createElement("a");e.href=a,a=e.href}try{return new URL(a)}catch(e){return null}}function Re(e){const t=new URLSearchParams;return E(e)&&Object.entries(e).forEach((([e,a])=>{t.set(e,a)})),t}const De={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!re.textTracks)return void(V(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ie.setCaptionsMenu.call(this));var e,t;if(A(this.elements.captions)||(this.elements.captions=G("div",X(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,A(e)&&A(t)&&t.parentNode.insertBefore(e,t.nextSibling)),j.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),a=Oe(t);null!==a&&a.hostname!==window.location.href.hostname&&["http:","https:"].includes(a.protocol)&&$e(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{Z(e)}))}))}const a=fe((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&([n]=a);let s=this.storage.get("captions");if(H(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:a}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";de.call(this,this.media.textTracks,e,De.update.bind(this))}setTimeout(De.update.bind(this),0)},update(){const e=De.getTracks.call(this,!0),{active:t,language:a,meta:n,currentTrackNode:s}=this.captions,o=Boolean(e.find((e=>e.language===a)));this.isHTML5&&this.isVideo&&e.filter((e=>!n.get(e))).forEach((e=>{this.debug.log("Track added",e),n.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),de.call(this,e,"cuechange",(()=>De.updateCues.call(this)))})),(o&&this.language!==a||!e.includes(s))&&(De.setLanguage.call(this,a),De.toggle.call(this,t&&o)),this.elements&&ee(this.elements.container,this.config.classNames.captions.enabled,!O(e)),V(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ie.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:a}=this.captions,n=this.config.classNames.captions.active,s=z(e)?!a:e;if(s!==a){if(t||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!t){const e=De.getTracks.call(this),t=De.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void De.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),ee(this.elements.container,n,s),this.captions.toggled=s,Ie.updateSetting.call(this,"captions"),pe.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout((()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const a=De.getTracks.call(this);if(-1!==e)if(_(e))if(e in a){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=a[e],{language:s}=n||{};this.captions.currentTrackNode=n,Ie.updateSetting.call(this,"captions"),t||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),pe.call(this,this.media,"languagechange")}De.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&De.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else De.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!L(e))return void this.debug.warn("Invalid language argument",e);const a=e.toLowerCase();this.captions.language=a;const n=De.getTracks.call(this),s=De.findTrack.call(this,[a]);De.set.call(this,n.indexOf(s),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const a=De.getTracks.call(this),n=e=>Number((this.captions.meta.get(e)||{}).default),s=Array.from(a).sort(((e,t)=>n(t)-n(e)));let o;return e.every((e=>(o=s.find((t=>t.language===e)),!o))),o||(t?s[0]:void 0)},getCurrentTrack(){return De.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!N(t)&&re.textTracks&&this.captions.toggled&&(t=De.getCurrentTrack.call(this)),N(t)?O(t.label)?O(t.language)?Te.get("enabled",this.config):e.language.toUpperCase():t.label:Te.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!A(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!z(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=De.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(Se)}const a=t.map((e=>e.trim())).join("\n");if(a!==this.elements.captions.innerHTML){Q(this.elements.captions);const e=G("span",X(this.config.selectors.caption));e.innerHTML=a,this.elements.captions.appendChild(e),pe.call(this,this.media,"cuechange")}}},je={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Fe="picture-in-picture",qe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},We="video",Ue=()=>{};class Ge{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Ue}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Ue}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Ue}}class Ye{constructor(t){e(this,"onChange",(()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;A(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;pe.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",ee(this.target,this.player.config.classNames.fullscreen.fallback,e),j.isIos){let t=document.head.querySelector('meta[name="viewport"]');const a="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const n=L(t.content)&&t.content.includes(a);e?(this.cleanupViewport=!n,n||(t.content+=`,${a}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==a)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(j.isIos||j.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,a=ne.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=a,s=a[a.length-1];t!==s||e.shiftKey?t===n&&e.shiftKey&&(s.focus(),e.preventDefault()):(n.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":Ye.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");ee(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)})),e(this,"enter",(()=>{this.supported&&(j.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ye.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?O(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.supported)if(j.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),ve(this.player.play());else if(!Ye.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!O(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=Ye.prefix,this.property=Ye.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:a}=Element;return(a.closest||function(){let e=this;do{if(ae.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),de.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),de.call(this.player,this.player.elements.container,"dblclick",(e=>{A(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),de.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Ye.nativeSupported&&!this.forceFallback}static get prefix(){if(S(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!S(document[`${t}ExitFullscreen`])&&!S(document[`${t}CancelFullScreen`])||(e=t,0)))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Ye.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Ye.nativeSupported||!j.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Ye.nativeSupported||this.forceFallback)return te(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return j.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}function Ze(e,t=1){return new Promise(((a,n)=>{const s=new Image,o=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=t?a:n)(s)};Object.assign(s,{onload:o,onerror:o,src:e})}))}const Qe={addStyleHook(){ee(this.elements.container,this.config.selectors.container.replace(".",""),!0),ee(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Qe.toggleNativeControls.call(this,!0);A(this.elements.controls)||(Ie.inject.call(this),this.listeners.controls()),Qe.toggleNativeControls.call(this),this.isHTML5&&De.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ie.updateVolume.call(this),Ie.timeUpdate.call(this),Ie.durationUpdate.call(this),Qe.checkPlaying.call(this),ee(this.elements.container,this.config.classNames.pip.supported,re.pip&&this.isHTML5&&this.isVideo),ee(this.elements.container,this.config.classNames.airplay.supported,re.airplay&&this.isHTML5),ee(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{pe.call(this,this.media,"ready")}),0),Qe.setTitle.call(this),this.poster&&Qe.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Ie.durationUpdate.call(this),this.config.mediaMetadata&&Ie.setMediaMetadata.call(this)},setTitle(){let e=Te.get("play",this.config);if(L(this.config.title)&&!O(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=se.call(this,"iframe");if(!A(e))return;const t=O(this.config.title)?"video":this.config.title,a=Te.get("frameTitle",this.config);e.setAttribute("title",a.replace("{title}",t))}},togglePoster(e){ee(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),me.call(this).then((()=>Ze(e))).catch((t=>{throw e===this.poster&&Qe.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Qe.togglePoster.call(this,!0),e))))},checkPlaying(e){ee(this.elements.container,this.config.classNames.playing,this.playing),ee(this.elements.container,this.config.classNames.paused,this.paused),ee(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Te.get(this.playing?"pause":"play",this.config))})),$(e)&&"timeupdate"===e.type||Qe.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{ee(this.elements.container,this.config.classNames.loading,this.loading),Qe.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const a=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||a))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!O(e)&&L(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),O(this.media.style)&&this.media.removeAttribute("style")}};class Ke{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,ee(t.container,e.config.classNames.isTouch,!0)})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&ce.call(t,window,"keydown keyup",this.handleKey,e,!1),ce.call(t,document.body,"click",this.toggleMenu,e),ge.call(t,document.body,"touchstart",this.firstTouch)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:a,timers:n}=e;!t.keyboard.global&&t.keyboard.focused&&de.call(e,a.container,"keydown keyup",this.handleKey,!1),de.call(e,a.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:s}=a;s&&"enterfullscreen"===t.type&&(s.pressed=!1,s.hover=!1);let o=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Qe.toggleControls.call(e,!0),o=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),o)}));const s=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=a.wrapper,{active:n}=e.fullscreen,[s,o]=Me.call(e),i=be(`aspect-ratio: ${s} / ${o}`);if(!n)return void(i?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[r,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=r/l>s/o;i?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/o*s+"px":null,t.style.margin=c?"0 auto":null)},o=()=>{clearTimeout(n.resized),n.resized=setTimeout(s,50)};de.call(e,a.container,"enterfullscreen exitfullscreen",(t=>{const{target:n}=e.fullscreen;n===a.container&&(!e.isEmbed&&O(e.config.ratio)||(s(),("enterfullscreen"===t.type?de:he).call(e,window,"resize",o)))}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(de.call(e,e.media,"timeupdate seeking seeked",(t=>Ie.timeUpdate.call(e,t))),de.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Ie.durationUpdate.call(e,t))),de.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),de.call(e,e.media,"progress playing seeking seeked",(t=>Ie.updateProgress.call(e,t))),de.call(e,e.media,"volumechange",(t=>Ie.updateVolume.call(e,t))),de.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Qe.checkPlaying.call(e,t))),de.call(e,e.media,"waiting canplay seeked playing",(t=>Qe.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const a=se.call(e,`.${e.config.classNames.video}`);if(!A(a))return;de.call(e,t.container,"click",(n=>{([t.container,a].includes(n.target)||a.contains(n.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(n,e.restart,"restart"),this.proxy(n,(()=>{ve(e.play())}),"play")):this.proxy(n,(()=>{ve(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&de.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),de.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),de.call(e,e.media,"ratechange",(()=>{Ie.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),de.call(e,e.media,"qualitychange",(t=>{Ie.updateSetting.call(e,"quality",null,t.detail.quality)})),de.call(e,e.media,"ready qualitychange",(()=>{Ie.setDownloadUrl.call(e)}));const a=e.config.events.concat(["keyup","keydown"]).join(" ");de.call(e,e.media,a,(a=>{let{detail:n={}}=a;"error"===a.type&&(n=e.media.error),pe.call(e,t.container,a.type,!0,n)}))})),e(this,"proxy",((e,t,a)=>{const{player:n}=this,s=n.config.listeners[a];let o=!0;S(s)&&(o=s.call(n,e)),!1!==o&&S(t)&&t.call(n,e)})),e(this,"bind",((e,t,a,n,s=!0)=>{const{player:o}=this,i=o.config.listeners[n],r=S(i);de.call(o,e,t,(e=>this.proxy(e,a,n)),s&&!r)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,a=j.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{ve(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{pe.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Ie.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Ie.toggleMenu.call(e,t)):Ie.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Ie.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const a=t.progress.getBoundingClientRect(),n=100/a.width*(e.pageX-a.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const a=t.currentTarget,n="play-on-seeked";if(B(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const s=a.hasAttribute(n),o=["mouseup","touchend","keyup"].includes(t.type);s&&o?(a.removeAttribute(n),ve(e.play())):!o&&e.playing&&(a.setAttribute(n,""),e.pause())})),j.isIos){const t=ne.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,a,(e=>D(e.target)))))}this.bind(t.inputs.seek,a,(t=>{const a=t.currentTarget;let n=a.getAttribute("seek-value");O(n)&&(n=a.value),a.removeAttribute("seek-value"),e.currentTime=n/a.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Ie.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:a}=e;a&&a.loaded&&a.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:a}=e;a&&a.loaded&&a.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:a}=e;a&&a.loaded&&a.endScrubbing(t)})),j.isWebKit&&Array.from(ne.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Ie.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!A(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Ie.timeUpdate.call(e))})),this.bind(t.inputs.volume,a,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(a=>{t.controls.hover=!e.touch&&"mouseenter"===a.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((a=>{this.bind(a,"mouseenter mouseleave",(a=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===a.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:a,timers:n}=e;ee(t.controls,a.classNames.noTransition,!0),Qe.toggleControls.call(e,!0),setTimeout((()=>{ee(t.controls,a.classNames.noTransition,!1)}),0);const s=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout((()=>Qe.toggleControls.call(e,!1)),s)})),this.bind(t.inputs.volume,"wheel",(t=>{const a=t.webkitDirectionInvertedFromDevice,[n,s]=[t.deltaX,-t.deltaY].map((e=>a?-e:e)),o=Math.sign(Math.abs(n)>Math.abs(s)?n:s);e.increaseVolume(o/50);const{volume:i}=e.media;(1===o&&i<1||-1===o&&i>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:a}=t,{key:n,type:s,altKey:o,ctrlKey:i,metaKey:r,shiftKey:l}=e,c="keydown"===s,d=c&&n===this.lastKey;var h;if(!(o||i||r||l)&&n)if(c){const s=document.activeElement;if(A(s)){const{editable:n}=t.config.selectors,{seek:o}=a.inputs;if(s!==o&&ae(s,n))return;if(" "===e.key&&ae(s,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d||(h=parseInt(n,10),t.currentTime=t.duration/10*h);break;case" ":case"k":d||ve(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":d||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":d||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}toggleMenu(e){Ie.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==a.g?a.g:"undefined"!=typeof self&&self;var Xe=function(e,t){return function(e){e.exports=function(){var e=function(){},t={},a={},n={};function s(e,t){e=e.push?e:[e];var s,o,i,r=[],l=e.length,c=l;for(s=function(e,a){a.length&&r.push(e),--c||t(r)};l--;)o=e[l],(i=a[o])?s(o,i):(n[o]=n[o]||[]).push(s)}function o(e,t){if(e){var s=n[e];if(a[e]=t,s)for(;s.length;)s[0](e,t),s.splice(0,1)}}function i(t,a){t.call&&(t={success:t}),a.length?(t.error||e)(a):(t.success||e)(t)}function r(t,a,n,s){var o,i,l=document,c=n.async,d=(n.numRetries||0)+1,h=n.before||e,g=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");s=s||0,/(^css!|\.css$)/.test(g)?((i=l.createElement("link")).rel="stylesheet",i.href=p,(o="hideFocus"in i)&&i.relList&&(o=0,i.rel="preload",i.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(g)?(i=l.createElement("img")).src=p:((i=l.createElement("script")).src=t,i.async=void 0===c||c),i.onload=i.onerror=i.onbeforeload=function(e){var l=e.type[0];if(o)try{i.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((s+=1){Xe(e,{success:t,error:a})}))}function et(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,pe.call(this,this.media,e?"play":"pause"))}const tt={setup(){const e=this;ee(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Ce.call(e),E(window.Vimeo)?tt.ready.call(e):Je(e.config.urls.vimeo.sdk).then((()=>{tt.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:a,referrerPolicy:n,...s}=t;let o=e.media.getAttribute("src"),i="";O(o)?(o=e.media.getAttribute(e.config.attributes.embed.id),i=e.media.getAttribute(e.config.attributes.embed.hash)):i=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(o);const r=i?{h:i}:{};a&&Object.assign(s,{controls:!1,sidedock:!1});const l=Re({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...r,...s}),c=O(d=o)?null:_(Number(d))?d:d.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:d;var d;const h=G("iframe"),g=_e(e.config.urls.vimeo.iframe,c,l);if(h.setAttribute("src",g),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),O(n)||h.setAttribute("referrerPolicy",n),a||!t.customControls)h.setAttribute("data-poster",e.poster),e.media=K(h,e.media);else{const t=G("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(h),e.media=K(t,e.media)}t.customControls||$e(_e(e.config.urls.vimeo.api,g)).then((t=>{!O(t)&&t.thumbnail_url&&Qe.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(et.call(e,!0),e.embed.play()),e.media.pause=()=>(et.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:p}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>p,set(t){const{embed:a,media:n,paused:s,volume:o}=e,i=s&&!a.hasPlayed;n.seeking=!0,pe.call(e,n,"seeking"),Promise.resolve(i&&a.setVolume(0)).then((()=>a.setCurrentTime(t))).then((()=>i&&a.pause())).then((()=>i&&a.setVolume(o))).catch((()=>{}))}});let u=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>u,set(t){e.embed.setPlaybackRate(t).then((()=>{u=t,pe.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(t){e.embed.setVolume(t).then((()=>{m=t,pe.call(e,e.media,"volumechange")}))}});let{muted:v}=e.config;Object.defineProperty(e.media,"muted",{get:()=>v,set(t){const a=!!H(t)&&t;e.embed.setMuted(!!a||e.config.muted).then((()=>{v=a,pe.call(e,e.media,"volumechange")}))}});let f,{loop:w}=e.config;Object.defineProperty(e.media,"loop",{get:()=>w,set(t){const a=H(t)?t:e.config.loop.active;e.embed.setLoop(a).then((()=>{w=a}))}}),e.embed.getVideoUrl().then((t=>{f=t,Ie.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>f}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[a,n]=t;e.embed.ratio=ze(a,n),Ce.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Qe.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{p=t,pe.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,pe.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,De.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const a=t.map((e=>function(e){const t=document.createDocumentFragment(),a=document.createElement("div");return t.appendChild(a),a.innerHTML=e,t.firstChild.innerText}(e.text)));De.updateCues.call(e,a)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{et.call(e,!t),t||pe.call(e,e.media,"playing")})),A(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{pe.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{pe.call(e,e.media,"playing")})),e.embed.on("play",(()=>{et.call(e,!0),pe.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{et.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,p=t.seconds,pe.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,pe.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&pe.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,pe.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,pe.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,pe.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,pe.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Qe.build.call(e)),0)}};function at(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,pe.call(this,this.media,e?"play":"pause"))}function nt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const st={setup(){if(ee(this.elements.wrapper,this.config.classNames.embed,!0),E(window.YT)&&S(window.YT.Player))st.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{S(e)&&e(),st.ready.call(this)},Je(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){$e(_e(this.config.urls.youtube.api,e)).then((e=>{if(E(e)){const{title:t,height:a,width:n}=e;this.config.title=t,Qe.setTitle.call(this),this.embed.ratio=ze(n,a)}Ce.call(this)})).catch((()=>{Ce.call(this)}))},ready(){const e=this,t=e.config.youtube,a=e.media&&e.media.getAttribute("id");if(!O(a)&&a.startsWith("youtube-"))return;let n=e.media.getAttribute("src");O(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const s=O(o=n)?null:o.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:o;var o;const i=G("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=K(i,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${s}/${e}default.jpg`;Ze(t("maxres"),121).catch((()=>Ze(t("sd"),121))).catch((()=>Ze(t("hq")))).then((t=>Qe.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:s,host:nt(t),playerVars:q({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const a=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[a]||"An unknown error occurred";e.media.error={code:a,message:n},pe.call(e,e.media,"error")}},onPlaybackRateChange(t){const a=t.target;e.media.playbackRate=a.getPlaybackRate(),pe.call(e,e.media,"ratechange")},onReady(a){if(S(e.media.play))return;const n=a.target;st.getTitle.call(e,s),e.media.play=()=>{at.call(e,!0),n.playVideo()},e.media.pause=()=>{at.call(e,!1),n.pauseVideo()},e.media.stop=()=>{n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(n.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,pe.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>n.getPlaybackRate(),set(e){n.setPlaybackRate(e)}});let{volume:o}=e.config;Object.defineProperty(e.media,"volume",{get:()=>o,set(t){o=t,n.setVolume(100*o),pe.call(e,e.media,"volumechange")}});let{muted:i}=e.config;Object.defineProperty(e.media,"muted",{get:()=>i,set(t){const a=H(t)?t:i;i=a,n[a?"mute":"unMute"](),n.setVolume(100*o),pe.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>n.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const r=n.getAvailablePlaybackRates();e.options.speed=r.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),pe.call(e,e.media,"timeupdate"),pe.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBufferedQe.build.call(e)),50)},onStateChange(a){const n=a.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(a.data)&&(e.media.seeking=!1,pe.call(e,e.media,"seeked")),a.data){case-1:pe.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),pe.call(e,e.media,"progress");break;case 0:at.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):pe.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(at.call(e,!0),pe.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{pe.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),pe.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),at.call(e,!1);break;case 3:pe.call(e,e.media,"waiting")}pe.call(e,e.elements.container,"statechange",!1,{code:a.data})}}})}},ot={setup(){this.media?(ee(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ee(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ee(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=G("div",{class:this.config.classNames.video}),W(this.media,this.elements.wrapper),this.elements.poster=G("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ee.setup.call(this):this.isYouTube?st.setup.call(this):this.isVimeo&&tt.setup.call(this)):this.debug.warn("No media element found!")}};class it{constructor(t){e(this,"load",(()=>{this.enabled&&(E(window.google)&&E(window.google.ima)?this.ready():Je(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=G("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Pe(Math.max(this.manager.getRemainingTime(),0)),t=`${Te.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{O(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e{const{container:t}=this.player.elements,a=e.getAd(),n=e.getAdData();switch((e=>{pe.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),a.isLinear()||(a.width=t.offsetWidth,a.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;O(this.cuePoints)||this.cuePoints.forEach(((a,n)=>{t{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,ve(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const a=this.events[e];V(a)&&a.forEach((e=>{S(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(V(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{z(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!O(e.publisherId)||I(e.tagUrl))}get tagUrl(){const{config:e}=this;return I(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Re({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function rt(e=0,t=0,a=255){return Math.min(Math.max(e,t),a)}const lt=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const a={};e.split(/\r\n|\n|\r/).forEach((e=>{if(_(a.startTime)){if(!O(e.trim())&&O(a.text)){const t=e.trim().split("#xywh=");[a.text]=t,t[1]&&([a.x,a.y,a.w,a.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(a.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),a.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),a.text&&t.push(a)})),t},ct=(e,t)=>{const a={};return e>t.width/t.height?(a.width=t.width,a.height=1/e*t.width):(a.height=t.height,a.width=e*t.height),a};class dt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(O(t))throw new Error("Missing previewThumbnails.src config attribute");const a=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(S(t))t((e=>{this.thumbnails=e,a()}));else{const e=(L(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(a)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{$e(e).then((a=>{const n={frames:lt(a),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const s=new Image;s.onload=()=>{n.height=s.naturalHeight,n.width=s.naturalWidth,this.thumbnails.push(n),t()},s.src=n.urlPrefix+n.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&$(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,a;const n=this.player.elements.progress.getBoundingClientRect(),s=100/n.width*(e.pageX-n.left);this.seekTime=this.player.media.duration*(s/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Pe(this.seekTime);const o=null===(t=this.player.config.markers)||void 0===t||null===(a=t.points)||void 0===a?void 0:a.find((({time:e})=>e===Math.round(this.seekTime)));o&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${o.label}
`)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(z(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ge.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=G("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=G("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=G("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=G("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),A(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=G("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let a=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,n)=>{this.loadedImages.includes(t.frames[e].text)&&(a=n)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(a)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,a=this.thumbnails[e],{urlPrefix:n}=a,s=a.frames[t],o=a.frames[t].text,i=n+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,s,e,t,o,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const a=new Image;a.src=i,a.dataset.index=t,a.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log(`Loading image: ${i}`),a.onload=()=>this.showImage(a,s,e,t,o,!0),this.loadingImage=a,this.removeOldImages(a)}})),e(this,"showImage",((e,t,a,n,s,o=!0)=>{this.player.debug.log(`Showing thumb: ${s}. num: ${n}. qual: ${a}. newimg: ${o}`),this.setImageSizeAndOffset(e,t),o&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(s)||this.loadedImages.push(s)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(a,e,t,s))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const a=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),a)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((a=>{setTimeout((()=>{const n=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===n){let s;s=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let o=!1;s.forEach((e=>{const t=e.text;if(t!==n&&!this.loadedImages.includes(t)){o=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],n=e+t,s=new Image;s.src=n,s.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),a()}}})),o||a()}}),300)})))),e(this,"getHigherQuality",((e,t,a,n)=>{if(e{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const a=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(a,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:a}=this.elements.thumb,n=t.left-e.left+10,s=t.right-e.left-a.clientWidth-10,o=this.mousePosX-e.left-a.clientWidth/2,i=rt(o,n,s);a.style.left=`${i}px`,a.style.setProperty("--preview-arrow-offset",o-i+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=ct(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const a=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*a+"px",e.style.width=e.naturalWidth*a+"px",e.style.left=`-${t.x*a}px`,e.style.top=`-${t.y*a}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=ct(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const ht={insertElements(e,t){L(t)?Y(e,this.media,{src:t}):V(t)&&t.forEach((t=>{Y(e,this.media,t)}))},change(e){F(e,"sources.length")?(Ee.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],Z(this.media),this.media=null,A(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:a}=e,[{provider:n=qe.html5,src:s}]=t,o="html5"===n?a:"div",i="html5"===n?{}:{src:s};Object.assign(this,{provider:n,type:a,supported:re.check(a,n,this.config.playsinline),media:G(o,i)}),this.elements.container.appendChild(this.media),H(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),O(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Qe.addStyleHook.call(this),this.isHTML5&&ht.insertElements.call(this,"source",t),this.config.title=e.title,ot.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&ht.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.isHTML5&&this.media.load(),O(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new dt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class gt{constructor(t,a){if(e(this,"play",(()=>S(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>ve(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&S(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(H(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):S(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=_(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=_(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(_(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{re.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=te(this.elements.container,this.config.classNames.hideControls),a=void 0===e?void 0:!e,n=ee(this.elements.container,this.config.classNames.hideControls,a);if(n&&V(this.config.controls)&&this.config.controls.includes("settings")&&!O(this.config.settings)&&Ie.toggleMenu.call(this,!1),n!==t){const e=n?"controlshidden":"controlsshown";pe.call(this,this.media,e)}return!n}return!1})),e(this,"on",((e,t)=>{de.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{ge.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{he(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const a=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(Z(this.elements.buttons.play),Z(this.elements.captions),Z(this.elements.controls),Z(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),S(e)&&e()):(ue.call(this),Ee.cancelRequests.call(this),K(this.elements.original,this.elements.container),pe.call(this,this.elements.original,"destroyed",!0),S(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Qe.toggleNativeControls.call(this,!0),a()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&S(this.embed.destroy)&&this.embed.destroy(),a()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(a),setTimeout(a,200))})),e(this,"supports",(e=>re.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=re.touch,this.media=t,L(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||T(this.media)||V(this.media))&&(this.media=this.media[0]),this.config=q({},je,gt.defaults,a||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Ge(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",re),z(this.media)||!A(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!re.check().api)return void this.debug.error("Setup failed: no support");const n=this.media.cloneNode(!0);n.autoplay=!1,this.elements.original=n;const s=this.media.tagName.toLowerCase();let o=null,i=null;switch(s){case"div":if(o=this.media.querySelector("iframe"),A(o)){if(i=Oe(o.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?qe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?qe.vimeo:null}(i.toString()),this.elements.container=this.media,this.media=o,this.elements.container.className="",i.search.length){const e=["1","true"];e.includes(i.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(i.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(i.searchParams.get("playsinline")),this.config.youtube.hl=i.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(O(this.provider)||!Object.values(qe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=We;break;case"video":case"audio":this.type=s,this.provider=qe.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=re.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Ke(this),this.storage=new Ae(this),this.media.plyr=this,A(this.elements.container)||(this.elements.container=G("div"),W(this.media,this.elements.container)),Qe.migrateStyles.call(this),Qe.addStyleHook.call(this),ot.setup.call(this),this.config.debug&&de.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ye(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new it(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>ve(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new dt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===qe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===qe.youtube}get isVimeo(){return this.provider===qe.vimeo}get isVideo(){return this.type===We}get isAudio(){return"audio"===this.type}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=_(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return _(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,a=_(t)&&t!==1/0?t:0;return e||a}set volume(e){let t=e;L(t)&&(t=Number(t)),_(t)||(t=this.storage.get("volume")),_(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!O(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;H(t)||(t=this.storage.get("muted")),H(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;_(e)&&(t=e),_(t)||(t=this.storage.get("speed")),_(t)||(t=this.config.speed.selected);const{minimumSpeed:a,maximumSpeed:n}=this;t=rt(t,a,n),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,a=this.options.quality;if(!a.length)return;let n=[!O(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(_),s=!0;if(!a.includes(n)){const e=we(a,n);this.debug.warn(`Unsupported quality option: ${n}, using ${e} instead`),n=e,s=!1}t.selected=n,this.media.quality=n,s&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=H(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){ht.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return I(e)?e:this.source}set download(e){I(e)&&(this.config.urls.download=e,Ie.setDownloadUrl.call(this))}set poster(e){this.isVideo?Qe.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=ke(Me.call(this));return V(e)?e.join(":"):e}set ratio(e){this.isVideo?L(e)&&xe(e)?(this.config.ratio=ke(e),Ce.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=H(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){De.toggle.call(this,e,!1)}set currentTrack(e){De.set.call(this,e,!1),De.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){De.setLanguage.call(this,e,!1)}get language(){return(De.getCurrentTrack.call(this)||{}).language}set pip(e){if(!re.pip)return;const t=H(e)?e:!this.pip;S(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Fe:"inline"),S(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return re.pip?O(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Fe:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new dt(this))}static supported(e,t){return re.check(e,t)}static loadSprite(e,t){return Be(e,t)}static setup(e,t={}){let a=null;return L(e)?a=Array.from(document.querySelectorAll(e)):T(e)?a=Array.from(e):V(e)&&(a=e.filter(A)),O(a)?null:a.map((e=>new gt(e,t)))}}var pt;return gt.defaults=(pt=je,JSON.parse(JSON.stringify(pt))),gt}())},462:(e,t)=>{var a;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t{function t(e){this.options=e,!e.deferSetup&&this.setup()}t.prototype={constructor:t,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(e){return this.options===e||this.options.match===e}},e.exports=t},703:(e,t,a)=>{e=a.nmd(e),ace.define("ace/theme/monokai-css",["require","exports","module"],(function(e,t,a){a.exports=".ace-monokai .ace_gutter {\n background: #2F3129;\n color: #8F908A\n}\n\n.ace-monokai .ace_print-margin {\n width: 1px;\n background: #555651\n}\n\n.ace-monokai {\n background-color: #272822;\n color: #F8F8F2\n}\n\n.ace-monokai .ace_cursor {\n color: #F8F8F0\n}\n\n.ace-monokai .ace_marker-layer .ace_selection {\n background: #49483E\n}\n\n.ace-monokai.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #272822;\n}\n\n.ace-monokai .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-monokai .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_marker-layer .ace_active-line {\n background: #202020\n}\n\n.ace-monokai .ace_gutter-active-line {\n background-color: #272727\n}\n\n.ace-monokai .ace_marker-layer .ace_selected-word {\n border: 1px solid #49483E\n}\n\n.ace-monokai .ace_invisible {\n color: #52524d\n}\n\n.ace-monokai .ace_entity.ace_name.ace_tag,\n.ace-monokai .ace_keyword,\n.ace-monokai .ace_meta.ace_tag,\n.ace-monokai .ace_storage {\n color: #F92672\n}\n\n.ace-monokai .ace_punctuation,\n.ace-monokai .ace_punctuation.ace_tag {\n color: #fff\n}\n\n.ace-monokai .ace_constant.ace_character,\n.ace-monokai .ace_constant.ace_language,\n.ace-monokai .ace_constant.ace_numeric,\n.ace-monokai .ace_constant.ace_other {\n color: #AE81FF\n}\n\n.ace-monokai .ace_invalid {\n color: #F8F8F0;\n background-color: #F92672\n}\n\n.ace-monokai .ace_invalid.ace_deprecated {\n color: #F8F8F0;\n background-color: #AE81FF\n}\n\n.ace-monokai .ace_support.ace_constant,\n.ace-monokai .ace_support.ace_function {\n color: #66D9EF\n}\n\n.ace-monokai .ace_fold {\n background-color: #A6E22E;\n border-color: #F8F8F2\n}\n\n.ace-monokai .ace_storage.ace_type,\n.ace-monokai .ace_support.ace_class,\n.ace-monokai .ace_support.ace_type {\n font-style: italic;\n color: #66D9EF\n}\n\n.ace-monokai .ace_entity.ace_name.ace_function,\n.ace-monokai .ace_entity.ace_other,\n.ace-monokai .ace_entity.ace_other.ace_attribute-name,\n.ace-monokai .ace_variable {\n color: #A6E22E\n}\n\n.ace-monokai .ace_variable.ace_parameter {\n font-style: italic;\n color: #FD971F\n}\n\n.ace-monokai .ace_string {\n color: #E6DB74\n}\n\n.ace-monokai .ace_comment {\n color: #75715E\n}\n\n.ace-monokai .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-monokai .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n"})),ace.define("ace/theme/monokai",["require","exports","module","ace/theme/monokai-css","ace/lib/dom"],(function(e,t,a){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=e("./monokai-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.require(["ace/theme/monokai"],(function(t){e&&(e.exports=t)}))},795:(e,t,a)=>{"use strict";var n=a(1212);function s(){}function o(){}o.resetWarningCache=s,e.exports=function(){function e(e,t,a,s,o,i){if(i!==n){var r=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw r.name="Invariant Violation",r}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:s};return a.PropTypes=a,a}},949:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>M});var n=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var a=-1;return e.some((function(e,n){return e[0]===t&&(a=n,!0)})),a}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var a=e(this.__entries__,t),n=this.__entries__[a];return n&&n[1]},t.prototype.set=function(t,a){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=a:this.__entries__.push([t,a])},t.prototype.delete=function(t){var a=this.__entries__,n=e(a,t);~n&&a.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var a=0,n=this.__entries__;a0},e.prototype.connect_=function(){s&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){s&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=void 0===t?"":t;r.some((function(e){return!!~a.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),d=function(e,t){for(var a=0,n=Object.keys(t);a0},e}(),x="undefined"!=typeof WeakMap?new WeakMap:new n,k=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var a=c.getInstance(),n=new y(t,a,this);x.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){k.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}}));const M=void 0!==o.ResizeObserver?o.ResizeObserver:k},997:(e,t,a)=>{e=a.nmd(e),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],(function(e,t,a){"use strict";var n=e("../lib/oop"),s=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",i=t.supportFunction="rgb|rgba|url|attr|counter|counters",r=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",l=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",c=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",d=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",g=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",p=function(){var e=this.createKeywordMapper({"support.function":i,"support.constant":r,"support.type":o,"support.constant.color":l,"support.constant.fonts":c},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:d},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+d+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:d},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:g},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{token:"paren.lparen",regex:"\\{"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};n.inherits(p,s),t.CssHighlightRules=p})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,a){"use strict";var n=e("../range").Range,s=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var a=e.getLine(t).match(/^(\s*\})/);if(!a)return 0;var s=a[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var i=this.$getIndent(e.getLine(o.row));e.replace(new n(t,0,t,s-1),i)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(s.prototype),t.MatchingBraceOutdent=s})),ace.define("ace/mode/css_completions",["require","exports","module"],(function(e,t,a){"use strict";var n={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,double:2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{default:1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},float:{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,static:1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},s=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e)if("string"==typeof e[t]){var a=t.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));n.hasOwnProperty(a)||(n[a]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,a,n){if(this.completionsDefined||this.defineCompletions(),"ruleset"===e||"ace/mode/scss"==t.$mode.$id){var s=t.getLine(a.row).substr(0,a.column),o=/\([^)]*$/.test(s);return o&&(s=s.substr(s.lastIndexOf("(")+1)),/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,a,n)):this.getPropertyCompletions(e,t,a,n,o)}return[]},this.getPropertyCompletions=function(e,t,a,s,o){return o=o||!1,Object.keys(n).map((function(e){return{caption:e,snippet:e+": $0"+(o?"":";"),meta:"property",score:1e6}}))},this.getPropertyValueCompletions=function(e,t,a,s){var o=t.getLine(a.row).substr(0,a.column),i=(/([\w\-]+):[^:]*$/.exec(o)||{})[1];if(!i)return[];var r=[];return i in n&&"object"==typeof n[i]&&(r=Object.keys(n[i])),r.map((function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}}))}}).call(s.prototype),t.CssCompletions=s})),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],(function(e,t,a){"use strict";var n=e("../../lib/oop"),s=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),o=e("../../token_iterator").TokenIterator,i=function(){this.inherit(s),this.add("colon","insertion",(function(e,t,a,n,s){if(":"===s&&a.selection.isEmpty()){var i=a.getCursorPosition(),r=new o(n,i.row,i.column),l=r.getCurrentToken();if(l&&l.value.match(/\s+/)&&(l=r.stepBackward()),l&&"support.type"===l.type){var c=n.doc.getLine(i.row);if(":"===c.substring(i.column,i.column+1))return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(c.substring(i.column)))return{text:":;",selection:[1,1]}}}})),this.add("colon","deletion",(function(e,t,a,n,s){var i=n.doc.getTextRange(s);if(!s.isMultiLine()&&":"===i){var r=a.getCursorPosition(),l=new o(n,r.row,r.column),c=l.getCurrentToken();if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type&&";"===n.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s}})),this.add("semicolon","insertion",(function(e,t,a,n,s){if(";"===s&&a.selection.isEmpty()){var o=a.getCursorPosition();if(";"===n.doc.getLine(o.row).substring(o.column,o.column+1))return{text:"",selection:[1,1]}}})),this.add("!important","insertion",(function(e,t,a,n,s){if("!"===s&&a.selection.isEmpty()){var o=a.getCursorPosition(),i=n.doc.getLine(o.row);if(/^\s*(;|}|$)/.test(i.substring(o.column)))return{text:"!important",selection:[10,10]}}}))};n.inherits(i,s),t.CssBehaviour=i})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,a){"use strict";var n=e("../../lib/oop"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,i=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};n.inherits(i,o),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,a){var n=e.getLine(a);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"";var s=this._getFoldWidgetBase(e,t,a);return!s&&this.startRegionRe.test(n)?"start":s},this.getFoldWidgetRange=function(e,t,a,n){var s,o=e.getLine(a);if(this.startRegionRe.test(o))return this.getCommentRegionBlock(e,o,a);if(s=o.match(this.foldingStartMarker)){var i=s.index;if(s[1])return this.openingBracketBlock(e,s[1],a,i);var r=e.getCommentFoldRange(a,i+s[0].length,1);return r&&!r.isMultiLine()&&(n?r=this.getSectionRange(e,a):"all"!=t&&(r=null)),r}return"markbegin"!==t&&(s=o.match(this.foldingStopMarker))?(i=s.index+s[0].length,s[1]?this.closingBracketBlock(e,s[1],a,i):e.getCommentFoldRange(a,i,-1)):void 0},this.getSectionRange=function(e,t){for(var a=e.getLine(t),n=a.search(/\S/),o=t,i=a.length,r=t+=1,l=e.getLength();++tc)break;var d=this.getFoldWidgetRange(e,"all",t);if(d){if(d.start.row<=o)break;if(d.isMultiLine())t=d.end.row;else if(n==c)break}r=t}}return new s(o,i,r,e.getLine(r).length)},this.getCommentRegionBlock=function(e,t,a){for(var n=t.search(/\s*$/),o=e.getLength(),i=a,r=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++ai)return new s(i,n,a,t.length)}}.call(i.prototype)})),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],(function(e,t,a){"use strict";var n=e("../lib/oop"),s=e("./text").Mode,o=e("./css_highlight_rules").CssHighlightRules,i=e("./matching_brace_outdent").MatchingBraceOutdent,r=e("../worker/worker_client").WorkerClient,l=e("./css_completions").CssCompletions,c=e("./behaviour/css").CssBehaviour,d=e("./folding/cstyle").FoldMode,h=function(){this.HighlightRules=o,this.$outdent=new i,this.$behaviour=new c,this.$completer=new l,this.foldingRules=new d};n.inherits(h,s),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,a){var n=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,e).tokens;return s.length&&"comment"==s[s.length-1].type||t.match(/^.*\{\s*$/)&&(n+=a),n},this.checkOutdent=function(e,t,a){return this.$outdent.checkOutdent(t,a)},this.autoOutdent=function(e,t,a){this.$outdent.autoOutdent(t,a)},this.getCompletions=function(e,t,a,n){return this.$completer.getCompletions(e,t,a,n)},this.createWorker=function(e){var t=new r(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/css",this.snippetFileId="ace/snippets/css"}.call(h.prototype),t.Mode=h})),ace.require(["ace/mode/css"],(function(t){e&&(e.exports=t)}))},1097:(e,t,a)=>{e=a.nmd(e);var n="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",i="[object Array]",r="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object Map]",g="[object Number]",p="[object Object]",u="[object Promise]",m="[object RegExp]",v="[object Set]",f="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",y="[object DataView]",x=/^\[object .+?Constructor\]$/,k=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[o]=M[i]=M[b]=M[r]=M[y]=M[l]=M[c]=M[d]=M[h]=M[g]=M[p]=M[m]=M[v]=M[f]=M[w]=!1;var C="object"==typeof a.g&&a.g&&a.g.Object===Object&&a.g,z="object"==typeof self&&self&&self.Object===Object&&self,E=C||z||Function("return this")(),_=t&&!t.nodeType&&t,L=_&&e&&!e.nodeType&&e,H=L&&L.exports===_,S=H&&C.process,V=function(){try{return S&&S.binding&&S.binding("util")}catch(e){}}(),T=V&&V.isTypedArray;function A(e,t){for(var a=-1,n=null==e?0:e.length;++ar))return!1;var c=o.get(e);if(c&&o.get(t))return c==t;var d=-1,h=!0,g=2&a?new be:void 0;for(o.set(e,t),o.set(t,e);++d-1},fe.prototype.set=function(e,t){var a=this.__data__,n=xe(a,e);return n<0?(++this.size,a.push([e,t])):a[n][1]=t,this},we.prototype.clear=function(){this.size=0,this.__data__={hash:new ve,map:new(se||fe),string:new ve}},we.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},we.prototype.get=function(e){return _e(this,e).get(e)},we.prototype.has=function(e){return _e(this,e).has(e)},we.prototype.set=function(e,t){var a=_e(this,e),n=a.size;return a.set(e,t),this.size+=a.size==n?0:1,this},be.prototype.add=be.prototype.push=function(e){return this.__data__.set(e,n),this},be.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.clear=function(){this.__data__=new fe,this.size=0},ye.prototype.delete=function(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a},ye.prototype.get=function(e){return this.__data__.get(e)},ye.prototype.has=function(e){return this.__data__.has(e)},ye.prototype.set=function(e,t){var a=this.__data__;if(a instanceof fe){var n=a.__data__;if(!se||n.length<199)return n.push([e,t]),this.size=++a.size,this;a=this.__data__=new we(n)}return a.set(e,t),this.size=a.size,this};var He=ee?function(e){return null==e?[]:(e=Object(e),function(t){for(var a=-1,n=null==t?0:t.length,s=0,o=[];++a-1&&e%1==0&&e-1&&e%1==0&&e<=s}function Oe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Re(e){return null!=e&&"object"==typeof e}var De=T?function(e){return function(t){return e(t)}}(T):function(e){return Re(e)&&Ie(e.length)&&!!M[ke(e)]};function je(e){return null!=(t=e)&&Ie(t.length)&&!Pe(t)?function(e,t){var a=Be(e),n=!a&&$e(e),s=!a&&!n&&Ne(e),o=!a&&!n&&!s&&De(e),i=a||n||s||o,r=i?function(e,t){for(var a=-1,n=Array(e);++a{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1609:e=>{"use strict";e.exports=window.React},1707:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0,targetSlide:0}},1751:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1755:(e,t,a)=>{e=a.nmd(e),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],(function(e,t,a){"use strict";var n,s=e("./lib/oop"),o=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),i=e("./editor").Editor,r=e("./virtual_renderer").VirtualRenderer,l=e("./edit_session").EditSession;(function(){s.implement(this,o),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new i(new r(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splitse;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach((function(t){t.setTheme(e)}))},this.setKeyboardHandler=function(e){this.$editors.forEach((function(t){t.setKeyboardHandler(e)}))},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach((function(t){t.setFontSize(e)}))},this.$cloneSession=function(e){var t=new l(e.getDocument(),e.getMode()),a=e.getUndoManager();return t.setUndoManager(a),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var a;a=null==t?this.$cEditor:this.$editors[t];var n=this.$editors.some((function(t){return t.session===e}));return n&&(e=this.$cloneSession(e)),a.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,a=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var n=t/this.$splits,s=0;s{e=a.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,a,n){"string"==typeof e?(2==arguments.length&&(n=a),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 a,n,s=function(e,t,a){if("string"==typeof t){var n=r(e,t);if(null!=n)return a&&a(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var s=[],i=0,l=t.length;ia.length)&&(t=a.length),t-=e.length;var n=a.indexOf(e,t);return-1!==n&&n===t})),String.prototype.repeat||n(String.prototype,"repeat",(function(e){for(var t="",a=this;e>0;)1&e&&(t+=a),(e>>=1)&&(a+=a);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),a=1;a>>0,n=0|arguments[1],s=n<0?Math.max(a+n,0):Math.min(n,a),o=arguments[2],i=void 0===o?a:0|o,r=i<0?Math.max(a+i,0):Math.min(i,a);s0;)1&t&&(a+=e),(t>>=1)&&(e+=e);return a};var n=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var a in e)t[a]=e[a];return t},t.copyArray=function(e){for(var t=[],a=0,n=e.length;a65535?2:1}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,a){"use strict";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:{},s=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"",i=n.appName||"";t.isWin="win"==s,t.isMac="mac"==s,t.isLinux="linux"==s,t.isIE="Microsoft Internet Explorer"==i||i.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="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(o.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,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,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,a){"use strict";var n,s=e("./useragent");t.buildDom=function e(t,a,n){if("string"==typeof t&&t){var s=document.createTextNode(t);return a&&a.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&a&&a.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var o=[],i=0;i=1.5,s.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),s.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,a){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(a)+"px)"}:t.translate=function(e,t,a){e.style.top=Math.round(a)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("./dom");t.get=function(e,t){var a=new XMLHttpRequest;a.open("GET",e,!0),a.onreadystatechange=function(){4===a.readyState&&t(a.responseText)},a.send(null)},t.loadScript=function(e,t){var a=n.getDocumentHead(),s=document.createElement("script");s.src=e,a.appendChild(s),s.onload=s.onreadystatechange=function(e,a){!a&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,a||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,a){"use strict";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 a in t)e[a]=t[a];return e},t.implement=function(e,a){t.mixin(e,a)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,a){"use strict";var n={},s=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var a=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(a.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=o),a=a.slice();for(var i=0;i1&&(s=a[a.length-2]);var i=l[t+"Path"];return null==i?i=l.basePath:"/"==n&&(t=n=""),i&&"/"!=i.slice(-1)&&(i+="/"),i+t+n+s+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){r=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(a,n){var o;if(Array.isArray(a))var i=a[0],l=a[1];else"string"==typeof a&&(l=a);var d=function(a){if(a&&!t.$loading[l])return n&&n(a);if(t.$loading[l]||(t.$loading[l]=[]),t.$loading[l].push(n),!(t.$loading[l].length>1)){var o=function(){!function(t,a){"ace/theme/textmate"===t||"./theme/textmate"===t?a(0,e("./theme/textmate")):r?r(t,a):console.error("loader is not configured")}(l,(function(e,a){a&&(t.$loaded[l]=a),t._emit("load.module",{name:l,module:a});var n=t.$loading[l];t.$loading[l]=null,n.forEach((function(e){e&&e(a)}))}))};if(!t.get("packaged"))return o();s.loadScript(t.moduleUrl(l,i),o),c()}};if(t.dynamicModules[l])t.dynamicModules[l]().then((function(e){e.default?d(e.default):d(e)}));else{try{o=this.$require(l)}catch(e){}d(o||t.$loaded[l])}},t.$require=function(e){if("function"==typeof a.require)return a.require(e)},t.setModuleLoader=function(e,a){t.dynamicModules[e]=a};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};t.version="1.39.1"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var s=e("./config");s.setLoader((function(t,a){e([t],(function(e){a(null,e)}))}));var o=function(){return this||"undefined"!=typeof window&&window}();function i(t){if(o&&o.document){s.set("packaged",t||e.packaged||n.packaged||o.define&&a.amdD.packaged);var i={},r="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(r=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var d,h=c.getElementsByTagName("script"),g=0;g ["+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,a=e.end,n=e.start;return 1==(t=this.compare(a.row,a.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?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.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,a){if(this.end.row>a)var n={row:a+1,column:0};else this.end.rowa)var s={row:a+1,column:0};else this.start.row1?++h>4&&(h=1):h=1,o.isIE){var i=Math.abs(e.clientX-r)>5||Math.abs(e.clientY-l)>5;c&&!i||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),a[h-1]||600),1==h&&(r=e.clientX,l=e.clientY)}if(e._clicks=h,n[s]("mousedown",e),h>4)h=0;else if(h>1)return n[s](g[h],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){d(e,"mousedown",p,i)}))},t.getModifierString=function(e){return s.KEY_MODS[g(e)]},t.addCommandKeyListener=function(e,a,n){var l=null;d(e,"keydown",(function(e){i[e.keyCode]=(i[e.keyCode]||0)+1;var t=function(e,t,a){var n=g(t);if(!a&&t.code&&(a=s.$codeToKeyCode[t.code]||a),!o.isMac&&i){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),i.altGr){if(!(3&~n))return;i.altGr=0}if(18===a||17===a){var l=t.location;17===a&&1===l?1==i[a]&&(r=t.timeStamp):18===a&&3===n&&2===l&&t.timeStamp-r<50&&(i.altGr=!0)}}if(a in s.MODIFIER_KEYS&&(a=-1),n||13!==a||3!==t.location||(e(t,n,-a),!t.defaultPrevented)){if(o.isChromeOS&&8&n){if(e(t,n,a),t.defaultPrevented)return;n&=-9}return!!(n||a in s.FUNCTION_KEYS||a in s.PRINTABLE_KEYS)&&e(t,n,a)}}(a,e,e.keyCode);return l=e.defaultPrevented,t}),n),d(e,"keypress",(function(e){l&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),l=null)}),n),d(e,"keyup",(function(e){i[e.keyCode]=null}),n),i||(p(),d(window,"focus",p))},"object"==typeof window&&window.postMessage&&!o.isOldIE){var u=1;t.nextTick=function(e,a){a=a||window;var n="zero-timeout-message-"+u++,s=function(o){o.data==n&&(t.stopPropagation(o),h(a,"message",s),e())};d(a,"message",s),a.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,a){return setTimeout((function a(){t.$idleBlocked?setTimeout(a,100):e()}),a)},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,a){"use strict";var n;a.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,a){"use strict";var n,s=e("../lib/event"),o=e("../config").nls,i=e("../lib/useragent"),r=e("../lib/dom"),l=e("../lib/lang"),c=e("../clipboard"),d=i.isChrome<18,h=i.isIE,g=i.isChrome>63,p=400,u=e("../lib/keys"),m=u.KEY_MODS,v=i.isIOS,f=v?/\s/:/\n/,w=i.isMobile;n=function(e,t){var a=r.createElement("textarea");a.className="ace_text-input",a.setAttribute("wrap","off"),a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck","false"),a.style.opacity="0",e.insertBefore(a,e.firstChild);var n=!1,b=!1,y=!1,x=!1,k="";w||(a.style.fontSize="1px");var M=!1,C=!1,z="",E=0,_=0,L=0,H=Number.MAX_SAFE_INTEGER,S=Number.MIN_SAFE_INTEGER,V=0;try{var T=document.activeElement===a}catch(e){}this.setNumberOfExtraLines=function(e){H=Number.MAX_SAFE_INTEGER,S=Number.MIN_SAFE_INTEGER,V=e<0?0:e},this.setAriaLabel=function(){var e="";if(t.$textInputAriaLabel&&(e+="".concat(t.$textInputAriaLabel,", ")),t.session){var n=t.session.selection.cursor.row;e+=o("text-input.aria-label","Cursor at row $0",[n+1])}a.setAttribute("aria-label",e)},this.setAriaOptions=function(e){e.activeDescendant?(a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-autocomplete",e.inline?"both":"list"),a.setAttribute("aria-activedescendant",e.activeDescendant)):(a.setAttribute("aria-haspopup","false"),a.setAttribute("aria-autocomplete","both"),a.removeAttribute("aria-activedescendant")),e.role&&a.setAttribute("role",e.role),e.setLabel&&(a.setAttribute("aria-roledescription",o("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),s.addListener(a,"blur",(function(e){C||(t.onBlur(e),T=!1)}),t),s.addListener(a,"focus",(function(e){if(!C){if(T=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout($):$()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),k||g||"browser"==this.$focusScroll)return a.focus({preventScroll:!0});var e=a.style.top;a.style.position="fixed",a.style.top="0px";try{var n=0!=a.getBoundingClientRect().top}catch(e){return}var s=[];if(n)for(var o=a.parentElement;o&&1==o.nodeType;)s.push(o),o.setAttribute("ace_nocontext","true"),o=!o.parentElement&&o.getRootNode?o.getRootNode().host:o.parentElement;a.focus({preventScroll:!0}),n&&s.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){a.style.position="","0px"==a.style.top&&(a.style.top=e)}),0)},this.blur=function(){a.blur()},this.isFocused=function(){return T},t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;if("insertstring"!=n){var s=n&&(e.docChanged||e.selectionChanged);y&&s&&(z=a.value="",W()),$()}})),t.on("changeSelection",this.setAriaLabel);var A=function(e,a){for(var n=a,s=1;s<=e-H&&s<2*V+1;s++)n+=t.session.getLine(e-s).length+1;return n},$=v?function(e){if(T&&(!n||e)&&!x){e||(e="");var s="\n ab"+e+"cde fg\n";s!=a.value&&(a.value=z=s);var o=4+(e.length||(t.selection.isEmpty()?0:1));4==E&&_==o||a.setSelectionRange(4,o),E=4,_=o}}:function(){if(!y&&!x&&(T||N)){y=!0;var e=0,n=0,s="";if(t.session){var o=t.selection,i=o.getRange(),r=o.cursor.row;r===S+1?S=(H=S+1)+2*V:r===H-1?H=(S=H-1)-2*V:(rS+1)&&(H=r>V?r-V:0,S=r>V?r+V:2*V);for(var l=[],c=H;c<=S;c++)l.push(t.session.getLine(c));if(s=l.join("\n"),e=A(i.start.row,i.start.column),n=A(i.end.row,i.end.column),i.start.rowS){var h=t.session.getLine(S+1);n=i.end.row>S+1?h.length:i.end.column,n+=s.length+1,s=s+"\n"+h}else w&&r>0&&(s="\n"+s,n+=1,e+=1);s.length>p&&(e0&&z[g]==e[g];)g++,r--;for(c=c.slice(g),g=1;l>0&&z.length-g>E-1&&z[z.length-g]==e[e.length-g];)g++,l--;d-=g-1,h-=g-1;var p=c.length-g+1;if(p<0&&(r=-p,p=0),c=c.slice(0,p),!(n||c||d||r||l||h))return"";x=!0;var u=!1;return i.isAndroid&&". "==c&&(c=" ",u=!0),c&&!r&&!l&&!d&&!h||M?t.onTextInput(c):t.onTextInput(c,{extendLeft:r,extendRight:l,restoreStart:d,restoreEnd:h}),x=!1,z=e,E=s,_=o,L=h,u?"\n":c},I=function(e){if(y)return q();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var n=a.value,s=P(n,!0);(n.length>500||f.test(s)||w&&E<1&&E==_)&&$()},O=function(e,t,a){var n=e.clipboardData||window.clipboardData;if(n&&!d){var s=h||a?"Text":"text/plain";try{return t?!1!==n.setData(s,t):n.getData(s)}catch(e){if(!a)return O(e,t,!0)}}},R=function(e,o){var i=t.getCopyText();if(!i)return s.preventDefault(e);O(e,i)?(v&&($(i),n=i,setTimeout((function(){n=!1}),10)),o?t.onCut():t.onCopy(),s.preventDefault(e)):(n=!0,a.value=i,a.select(),setTimeout((function(){n=!1,$(),o?t.onCut():t.onCopy()})))},D=function(e){R(e,!0)},j=function(e){R(e,!1)},F=function(e){var n=O(e);c.pasteCancelled()||("string"==typeof n?(n&&t.onPaste(n,e),i.isIE&&setTimeout($),s.preventDefault(e)):(a.value="",b=!0))};s.addCommandKeyListener(a,(function(e,a,n){if(!y)return t.onCommandKey(e,a,n)}),t),s.addListener(a,"select",(function(e){y||(n?n=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=z.length&&e.value===z&&z&&e.selectionEnd!==_}(a)?(t.selectAll(),$()):w&&a.selectionStart!=E&&$())}),t),s.addListener(a,"input",I,t),s.addListener(a,"cut",D,t),s.addListener(a,"copy",j,t),s.addListener(a,"paste",F,t),"oncut"in a&&"oncopy"in a&&"onpaste"in a||s.addListener(e,"keydown",(function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:j(e);break;case 86:F(e);break;case 88:D(e)}}),t);var q=function(){if(y&&t.onCompositionUpdate&&!t.$readOnly){if(M)return U();if(y.useTextareaForIME)t.onCompositionUpdate(a.value);else{var e=a.value;P(e),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+_-y.selectionStart+L)}}},W=function(e){t.onCompositionEnd&&!t.$readOnly&&(y=!1,t.onCompositionEnd(),t.off("mousedown",U),e&&I())};function U(){C=!0,a.blur(),a.focus(),C=!1}var G,Y=l.delayedCall(q,50).schedule.bind(null,null);function Z(){clearTimeout(G),G=setTimeout((function(){k&&(a.style.cssText=k,k=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}s.addListener(a,"compositionstart",(function(e){if(!y&&t.onCompositionStart&&!t.$readOnly&&(y={},!M)){e.data&&(y.useTextareaForIME=!1),setTimeout(q,0),t._signal("compositionStart"),t.on("mousedown",U);var n=t.getSelectionRange();n.end.row=n.start.row,n.end.column=n.start.column,y.markerRange=n,y.selectionStart=E,t.onCompositionStart(y),y.useTextareaForIME?(z=a.value="",E=0,_=0):(a.msGetInputContext&&(y.context=a.msGetInputContext()),a.getInputContext&&(y.context=a.getInputContext()))}}),t),s.addListener(a,"compositionupdate",q,t),s.addListener(a,"keyup",(function(e){27==e.keyCode&&a.value.length_&&"\n"==z[i]?r=u.end:s_&&z.slice(0,i).split("\n").length>2?r=u.down:i>_&&" "==z[i-1]?(r=u.right,l=m.option):(i>_||i==_&&_!=E&&s==i)&&(r=u.right),s!==i&&(l|=m.shift),r){if(!t.onCommandKey({},l,r)&&t.commands){r=u.keyCodeToString(r);var c=t.commands.findKeyCommand(l,r);c&&t.execCommand(c)}E=s,_=i,$("")}}};document.addEventListener("selectionchange",i),t.on("destroy",(function(){document.removeEventListener("selectionchange",i)}))}(0,t,a),this.destroy=function(){a.parentElement&&a.parentElement.removeChild(a)}},t.TextInput=n,t.$setUserAgentForTests=function(e,t){w=e,v=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,a){"use strict";var n=e("../lib/useragent"),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)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),a=e.getDocumentPosition();this.mousedownEvent=e;var s=this.editor,o=e.getButton();return 0!==o?((s.getSelectionRange().isEmpty()||1==o)&&s.selection.moveToPosition(a),void(2==o&&(s.textInput.onContextMenu(e.domEvent),n.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||s.isFocused()||(s.focus(),!this.$focusTimeout||this.$clickSelection||s.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(a,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var a=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?a.selection.selectToPosition(e):t||a.selection.moveToPosition(e),t||this.select(),a.setStyle("ace_selecting"),this.setState("select"))},e.prototype.select=function(){var e,t=this.editor,a=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(a);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var s=o(this.$clickSelection,a);a=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(a),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,a=this.editor,n=a.renderer.screenToTextCoordinates(this.x,this.y),s=a.selection[e](n.row,n.column);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(s.start),r=this.$clickSelection.comparePoint(s.end);if(-1==i&&r<=0)t=this.$clickSelection.end,s.end.row==n.row&&s.end.column==n.column||(n=s.start);else if(1==r&&i>=0)t=this.$clickSelection.start,s.start.row==n.row&&s.start.column==n.column||(n=s.end);else if(-1==i&&1==r)n=s.end,t=s.start;else{var l=o(this.$clickSelection,n);n=l.cursor,t=l.anchor}a.selection.setSelectionAnchor(t.row,t.column)}a.selection.selectToPosition(n),a.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e,t,a,n,s=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,a=this.x,n=this.y,Math.sqrt(Math.pow(a-e,2)+Math.pow(n-t,2))),o=Date.now();(s>0||o-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),a=this.editor,n=a.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=a.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),a=this.editor;this.setState("selectByLines");var n=a.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=a.selection.getLineRange(n.start.row),this.$clickSelection.end=a.selection.getLineRange(n.end.row).end):this.$clickSelection=a.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()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var a=this.$lastScroll,n=e.domEvent.timeStamp,s=n-a.t,o=s?e.wheelX/s:a.vx,i=s?e.wheelY/s:a.vy;s<550&&(o=(o+a.vx)/2,i=(i+a.vy)/2);var r=Math.abs(o/i),l=!1;return r>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),r<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?a.allowed=n:n-a.allowed<550&&(Math.abs(o)<=1.5*Math.abs(a.vx)&&Math.abs(i)<=1.5*Math.abs(a.vy)?(l=!0,a.allowed=n):a.allowed=0),a.t=n,a.vx=o,a.vy=i,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},e}();function o(e,t){if(e.start.row==e.end.row)var a=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)a=2*t.row-e.start.row-e.end.row;else a=t.column-4;return a<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}s.prototype.selectEnd=s.prototype.selectByLinesEnd,s.prototype.selectAllEnd=s.prototype.selectByLinesEnd,s.prototype.selectByWordsEnd=s.prototype.selectByLinesEnd,t.DefaultHandlers=s})),ace.define("ace/lib/scroll",["require","exports","module"],(function(e,t,a){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,a=t&&e[t],n=0;if(a)return a.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=e("./lib/dom"),r=(e("./lib/event"),e("./range").Range),l=e("./lib/scroll").preventParentScroll,c="ace_tooltip",d=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=i.createElement("div"),this.$element.className=c,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),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){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){i.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,a){null!=e&&this.setText(e),null!=t&&null!=a&&this.setPosition(t,a),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=c,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),h=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);-1!==t&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,a,n;this.popups.sort((function(e,t){return t.priority-e.priority}));var s=[];try{for(var i=o(this.popups),r=i.next();!r.done;r=i.next()){var l=r.value,c=!0;try{for(var d=(a=void 0,o(s)),h=d.next();!h.done;h=d.next()){var g=h.value;if(this.doPopupsOverlap(g,l)){c=!1;break}}}catch(e){a={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(a)throw a.error}}c?s.push(l):l.hide()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var a=e.getElement().getBoundingClientRect(),n=t.getElement().getBoundingClientRect();return a.leftn.left&&a.topn.top},e}());t.popupManager=h,t.Tooltip=d;var g=function(e){function t(t){void 0===t&&(t=document.body);var a=e.call(this,t)||this;a.timeout=void 0,a.lastT=0,a.idleTime=350,a.lastEvent=void 0,a.onMouseOut=a.onMouseOut.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.waitForHover=a.waitForHover.bind(a),a.hide=a.hide.bind(a);var n=a.getElement();return n.style.whiteSpace="pre-wrap",n.style.pointerEvents="auto",n.addEventListener("mouseout",a.onMouseOut),n.tabIndex=-1,n.addEventListener("blur",function(){n.contains(document.activeElement)||this.hide()}.bind(a)),n.addEventListener("wheel",l),a}return s(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var a=t.$mouseHandler.isMousePressed;if(this.isOpen){var n=this.lastEvent&&this.lastEvent.getDocumentPosition();this.range&&this.range.contains(n.row,n.column)&&!a&&!this.isOutsideOfText(this.lastEvent)||this.hide()}this.timeout||a||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;this.idleTime-e>10?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},t.prototype.isOutsideOfText=function(e){var t=e.editor,a=e.getDocumentPosition(),n=t.session.getLine(a.row);if(a.column==n.length){var s=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),o=t.session.documentToScreenPosition(a.row,a.column);if(o.column!=s.column||o.row!=s.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,a,n){if(!(n&&n!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement())){var s=e.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(s.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=r.fromPoints(t.start,t.end);var o=s.textToScreenCoordinates(t.start.row,t.start.column),i=s.scroller.getBoundingClientRect();o.pageX=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=e("../lib/dom"),r=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GUTTER_TOOLTIP_LEFT_OFFSET=5,t.GUTTER_TOOLTIP_TOP_OFFSET=3,t.GutterHandler=function(e){var t,a,n=e.editor,s=n.renderer.$gutterLayer,o=new d(n,!0);function l(e){e&&"keydown"===e.type&&(e.ctrlKey||e.metaKey)||(!e||"mouseout"!==e.type||e.relatedTarget&&!o.getElement().contains(e.relatedTarget))&&(t&&(t=clearTimeout(t)),o.isOpen&&(o.hideTooltip(),n.off("mousewheel",l),n.off("changeSession",l),window.removeEventListener("keydown",l,!0)))}function c(e){o.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(n.isFocused()&&0==t.getButton()&&"foldWidgets"!=s.getRegion(t)){var a=t.getDocumentPosition().row,o=n.session.selection;if(t.getShiftKey())o.selectTo(a,0);else{if(2==t.domEvent.detail)return n.selectAll(),t.preventDefault();e.$clickSelection=n.selection.getLineRange(a)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(r){var d=r.domEvent.target||r.domEvent.srcElement;if(i.hasCssClass(d,"ace_fold-widget"))return l();o.isOpen&&e.$tooltipFollowsMouse&&c(r),a=r,t||(t=setTimeout((function(){t=null,a&&!e.isMousePressed&&function(){var t=a.getDocumentPosition().row;if(t==n.session.getLength()){var i=n.renderer.pixelToScreenCoordinates(0,a.y).row,r=a.$pos;if(i>n.session.documentToScreenRow(r.row,r.column))return l()}if(o.showTooltip(t),o.isOpen)if(n.on("mousewheel",l),n.on("changeSession",l),window.addEventListener("keydown",l,!0),e.$tooltipFollowsMouse)c(a);else{var d=a.getGutterRow(),h=s.$lines.get(d);if(h){var g=h.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),p=o.getElement().style;p.left=g.right-5+"px",p.top=g.bottom-3+"px"}else c(a)}}()}),50))})),r.addListener(n.renderer.$gutter,"mouseout",(function(e){a=null,o.isOpen&&(t=setTimeout((function(){t=null,l(e)}),50))}),n)};var d=function(e){function t(t,a){void 0===a&&(a=!1);var n=e.call(this,t.container)||this;n.editor=t,n.visibleTooltipRow;var s=n.getElement();return s.setAttribute("role","tooltip"),s.style.pointerEvents="auto",a&&(n.onMouseOut=n.onMouseOut.bind(n),s.addEventListener("mouseout",n.onMouseOut)),n}return s(t,e),t.prototype.onMouseOut=function(e){this.isOpen&&e.relatedTarget&&!this.getElement().contains(e.relatedTarget)&&(e&&e.currentTarget.contains(e.relatedTarget)||this.hideTooltip())},t.prototype.setPosition=function(e,t){var a=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),o=this.getHeight();(e+=15)+s>a&&(e-=e+s-a),(t+=15)+o>n&&(t-=20+o),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c("gutter-tooltip.aria-label.error.singular","error"),plural:c("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:c("gutter-tooltip.aria-label.security.singular","security finding"),plural:c("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:c("gutter-tooltip.aria-label.warning.singular","warning"),plural:c("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:c("gutter-tooltip.aria-label.info.singular","information message"),plural:c("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:c("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:c("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var a,n,s=this.editor.renderer.$gutterLayer,o=s.$annotations[e];n=o?{displayText:Array.from(o.displayText),type:Array.from(o.type)}:{displayText:[],type:[]};var r=s.session.getFoldLine(e);if(r&&s.$showFoldedAnnotations){for(var l,c={error:[],security:[],warning:[],info:[],hint:[]},d={error:1,security:2,warning:3,info:4,hint:5},h=e+1;h<=r.end.row;h++)if(s.$annotations[h])for(var g=0;g5?v=null:n-v>=200&&(t.renderer.scrollCursorIntoView(),v=null)})(g=t.renderer.screenToTextCoordinates(l,c),e),function(e,a){var n=Date.now(),s=t.renderer.layerConfig.lineHeight,o=t.renderer.layerConfig.characterWidth,i=t.renderer.scroller.getBoundingClientRect(),r={x:{left:l-i.left,right:i.right-l},y:{top:c-i.top,bottom:i.bottom-c}},d=Math.min(r.x.left,r.x.right),h=Math.min(r.y.top,r.y.bottom),g={row:e.row,column:e.column};d/o<=2&&(g.column+=r.x.left=200&&t.renderer.scrollCursorIntoView(g):m=n:m=null}(g,e)}function x(){h=t.selection.toOrientedRange(),i=t.session.addMarker(h,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(d),y(),d=setInterval(y,20),b=0,s.addListener(document,"mousemove",C)}function k(){clearInterval(d),t.session.removeMarker(i),i=null,t.selection.fromOrientedRange(h),t.isFocused()&&!u&&t.$resetCursorStyle(),h=null,g=null,b=0,m=null,v=null,s.removeListener(document,"mousemove",C)}this.onDragStart=function(e){if(this.cancelDrag||!w.draggable){var n=this;return setTimeout((function(){n.startSelect(),n.captureMouse(e)}),0),e.preventDefault()}h=t.getSelectionRange();var s=e.dataTransfer;s.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(a),s.setDragImage&&s.setDragImage(a,0,0),setTimeout((function(){t.container.removeChild(a)})),s.clearData(),s.setData("Text",t.session.getTextRange()),u=!0,this.setState("drag")},this.onDragEnd=function(e){if(w.draggable=!1,u=!1,this.setState(null),!t.getReadOnly()){var a=e.dataTransfer.dropEffect;p||"move"!=a||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&z(e.dataTransfer))return l=e.clientX,c=e.clientY,i||x(),b++,e.dataTransfer.dropEffect=p=E(e),s.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&z(e.dataTransfer))return l=e.clientX,c=e.clientY,i||(x(),b++),null!==M&&(M=null),e.dataTransfer.dropEffect=p=E(e),s.preventDefault(e)},this.onDragLeave=function(e){if(--b<=0&&i)return k(),p=null,s.preventDefault(e)},this.onDrop=function(e){if(g){var a=e.dataTransfer;if(u)switch(p){case"move":h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case"copy":h=t.moveText(h,g,!0)}else{var n=a.getData("Text");h={start:g,end:t.session.insert(g,n)},t.focus(),p=null}return k(),s.preventDefault(e)}},s.addListener(w,"dragstart",this.onDragStart.bind(e),t),s.addListener(w,"dragend",this.onDragEnd.bind(e),t),s.addListener(w,"dragenter",this.onDragEnter.bind(e),t),s.addListener(w,"dragover",this.onDragOver.bind(e),t),s.addListener(w,"dragleave",this.onDragLeave.bind(e),t),s.addListener(w,"drop",this.onDrop.bind(e),t);var M=null;function C(){null==M&&(M=setTimeout((function(){null!=M&&i&&k()}),20))}function z(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function E(e){var t=["copy","copymove","all","uninitialized"],a=o.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var s="none";return a&&t.indexOf(n)>=0?s="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(n)>=0?s="move":t.indexOf(n)>=0&&(s="copy"),s}}function r(e,t,a,n){return Math.sqrt(Math.pow(a-e,2)+Math.pow(n-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,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=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=o.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;o.isIE&&"dragReady"==this.state&&r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&r(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,a=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&a){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;"unselectable"in s&&(s.unselectable="on"),t.getDragDelay()?(o.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("./mouse_event").MouseEvent,s=e("../lib/event"),o=e("../lib/dom");t.addTouchListeners=function(e,t){var a,i,r,l,c,d,h,g,p,u="scroll",m=0,v=0,f=0,w=0;function b(){if(t.getOption("enableMobileMenu")){p||(r=window.navigator&&window.navigator.clipboard,l=!1,c=function(e){return t.commands.canExecute(e,t)},d=function(e){var a,n,s=e.target.getAttribute("action");if("more"==s||!l)return l=!l,a=t.getCopyText(),n=t.session.getUndoManager().hasUndo(),void p.replaceChild(o.buildDom(l?["span",!a&&c("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],a&&c("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],a&&c("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],r&&c("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],n&&c("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],c("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],c("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),p.firstChild);"paste"==s?r.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(r?r.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),p.firstChild.style.display="none",l=!1,"openCommandPalette"!=s&&t.focus()},p=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){u="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),d(e)},onclick:d},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var e=t.selection.cursor,a=t.renderer.textToScreenCoordinates(e.row,e.column),n=t.renderer.textToScreenCoordinates(0,0).pageX,s=t.renderer.scrollLeft,i=t.container.getBoundingClientRect();p.style.top=a.pageY-i.top-3+"px",a.pageX-i.left1)return clearTimeout(c),c=null,r=-1,void(u="zoom");g=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,p=e.timeStamp;l=p;var b=s[0],y=b.clientX,k=b.clientY;Math.abs(a-y)+Math.abs(i-k)>o&&(r=-1),a=e.clientX=y,i=e.clientY=k,f=w=0;var M=new n(e,t);if(h=M.getDocumentPosition(),p-r<500&&1==s.length&&!m)v++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(h);var e=v>=2?t.selection.getLineRange(h.row):t.session.getBracketRange(h);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),u="wait"}();else{v=0;var C=t.selection.cursor,z=t.selection.isEmpty()?C:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(C,!0),_=t.renderer.$cursorLayer.getPixelPosition(z,!0),L=t.renderer.scroller.getBoundingClientRect(),H=t.renderer.layerConfig.offset,S=t.renderer.scrollLeft,V=function(e,t){return(e/=d)*e+(t=t/o-.75)*t};if(e.clientXA?"cursor":"anchor"),u=A<3.5?"anchor":T<3.5?"cursor":"scroll",c=setTimeout(x,450)}r=p}),t),s.addListener(e,"touchend",(function(e){g=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),"zoom"==u?(u="",m=0):c?(t.selection.moveToPosition(h),m=0,b()):"scroll"==u?(m+=60,d=setInterval((function(){m--<=0&&(clearInterval(d),d=null),Math.abs(f)<.01&&(f=0),Math.abs(w)<.01&&(w=0),m<20&&(f*=.9),m<20&&(w*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*f,10*w),e==t.session.getScrollTop()&&(m=0)}),10),y()):b(),clearTimeout(c),c=null}),t),s.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var s=e.touches;if(!(s.length>1||"zoom"==u)){var o=s[0],r=a-o.clientX,d=i-o.clientY;if("wait"==u){if(!(r*r+d*d>4))return e.preventDefault();u="cursor"}a=o.clientX,i=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=e.timeStamp,g=h-l;if(l=h,"scroll"==u){var p=new n(e,t);p.speed=1,p.wheelX=r,p.wheelY=d,10*Math.abs(r)=e){for(o=h+1;o=e;)o++;for(r=h,l=o-1;r=t.length||2!=(l=a[s-1])&&3!=l||2!=(c=t[s+1])&&3!=c?4:(o&&(c=3),c==l?c:4);case 10:return 2==(l=s>0?a[s-1]:5)&&s+10&&2==a[s-1])return 2;if(o)return 4;for(p=s+1,g=t.length;p=1425&&m<=2303||64286==m;if(l=t[p],v&&(1==l||7==l))return 1}return s<1||5==(l=t[s-1])?4:a[s-1];case 5:return o=!1,i=!0,n;case 6:return r=!0,4;case 13:case 14:case 16:case 17:case 15:o=!1;case h:return 4}}function v(e){var t=e.charCodeAt(0),a=t>>8;return 0==a?t>191?0:g[t]:5==a?/[\u0591-\u05f4]/.test(e)?1:0:6==a?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?d:/[\u06f0-\u06f9]/.test(e)?2:7:32==a&&t<=8287?p[255&t]:254==a&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,a,d){if(e.length<2)return{};var g=e.split(""),p=new Array(g.length),f=new Array(g.length),w=[];n=d?1:0,function(e,t,a,d){var h=n?c:l,g=null,p=null,u=null,f=0,w=null,b=-1,y=null,x=null,k=[];if(!d)for(y=0,d=[];y0)if(16==w){for(y=b;y-1){for(y=b;y=0&&8==d[M];M--)t[M]=n}}(g,w,g.length,a);for(var b=0;b7&&a[b]<13||4===a[b]||a[b]===h)?w[b]=t.ON_R:b>0&&"ل"===g[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(g[b])&&(w[b-1]=w[b]=t.R_H,b++);for(g[g.length-1]===t.DOT&&(w[g.length-1]=t.B),"‫"===g[0]&&(w[0]=t.RLE),b=0;b=0&&(e=this.session.$docRowCache[a])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var a,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(a=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=a,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var a=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var o=this.session.$wrapData[e];o&&(void 0===t&&(t=this.getSplitIndex()),t>0&&o.length?(this.wrapIndent=o.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=tt?this.session.getOverwrite()?e:e-1:t,s=n.getVisualFromLogicalIdx(a,this.bidiMap),o=this.bidiMap.bidiLevels,i=0;!this.session.getOverwrite()&&e<=t&&o[s]%2!=0&&s++;for(var r=0;rt&&o[s]%2==0&&(i+=this.charWidths[o[s]]),this.wrapIndent&&(i+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(i+=this.rtlLineOffset),i},e.prototype.getSelections=function(e,t){var a,n=this.bidiMap,s=n.bidiLevels,o=[],i=0,r=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,d=!1,h=0;this.wrapIndent&&(i+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var g,p=0;p=r&&ga+o/2;){if(a+=o,n===s.length-1){o=0;break}o=this.charWidths[s[++n]]}return n>0&&s[n-1]%2!=0&&s[n]%2==0?(e0&&s[n-1]%2==0&&s[n]%2!=0?t=1+(e>a?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===s.length-1&&0===o&&s[n-1]%2==0||!this.isRtlDir&&0===n&&s[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&s[n-1]%2!=0&&0!==o&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=i})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/oop"),s=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,i=e("./range").Range,r=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=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))}return 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=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?i.fromPoints(t,t):this.isBackwards()?i.fromPoints(t,e):i.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var a=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(a.row,a.column,n.row,n.column)},e.prototype.$setSelection=function(e,t,a,n){if(!this.$silent){var s=this.$isEmpty,o=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(a,n),this.$isEmpty=!i.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||s!=this.$isEmpty||o)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(e){var t=this.lead;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(void 0===t){var a=e||this.lead;e=a.row,t=a.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var a,n="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(n);return s?(n=s.start.row,a=s.end.row):a=n,!0===t?new i(n,0,a,this.session.getLine(a).length):new i(n,0,a+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,a){var n=e.column,s=e.column+t;return a<0&&(n=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,s).split(" ").length-1==t},e.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var a=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,a,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-a):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,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,t=this.lead.column,a=this.doc.getLine(e),n=a.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s)this.moveCursorTo(s.end.row,s.end.column);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=a.substring(t)),t>=a.length)return this.moveCursorTo(e,a.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(o)&&(a-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,a)}},e.prototype.$shortWordEndIndex=function(e){var t,a=0,n=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))a=this.session.tokenRe.lastIndex;else{for(;(t=e[a])&&n.test(t);)a++;if(a<1)for(s.lastIndex=0;(t=e[a])&&!s.test(t);)if(s.lastIndex=0,a++,n.test(t)){if(a>2){a--;break}for(;(t=e[a])&&n.test(t);)a++;if(a>2)break}}return s.lastIndex=0,a},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,a=this.doc.getLine(e),n=a.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==a.length){var o=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e0&&/^\s*$/.test(n));a=n.length,/\s+$/.test(n)||(n="")}var o=s.stringReverse(n),i=this.$shortWordEndIndex(o);return this.moveCursorTo(t,a-i)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var a,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(a=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(a/this.session.$bidiHandler.charWidths[0])):a=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var s=this.session.lineWidgets[this.lead.row];e<0?e-=s.rowsAbove||0:e>0&&(e+=s.rowCount-(s.rowsAbove||0))}var o=this.session.screenToDocumentPosition(n.row+e,n.column,a);0!==e&&0===t&&o.row===this.lead.row&&(o.column,this.lead.column),this.moveCursorTo(o.row,o.column+t,0===t)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,a){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,a||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,a){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,a)},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();return 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):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var a=this.getCursor();return i.fromPoints(t,a)}catch(e){return i.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();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},e.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var a=i.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(a.cursor=a.start),this.addRange(a,!0)}return}e=e[0]}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!1;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!1;return!0},e}();r.prototype.setSelectionAnchor=r.prototype.setAnchor,r.prototype.getSelectionAnchor=r.prototype.getAnchor,r.prototype.setSelectionRange=r.prototype.setRange,n.implement(r.prototype,o),t.Selection=r})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,a){"use strict";var n=e("./lib/report_error").reportError,s=2e3,o=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var a=this.states[t],n=[],s=0,o=this.matchMappings[t]={defaultToken:"text"},i="g",r=[],l=0;l1?this.$applyToken:c.token),h>1&&(/\\\d/.test(c.regex)?d=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+s+1)})):(h=1,d=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||r.push(c)),o[s]=l,s+=h,n.push(d),c.onMatch||(c.onMatch=null)}}n.length||(o[0]=0,n.push("$")),r.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,i)}),this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",i)}}return e.prototype.$setMaxTokenCount=function(e){s=0|e},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),a=this.token.apply(this,t);if("string"==typeof a)return[{type:a,value:e}];for(var n=[],s=0,o=a.length;sd){var f=e.substring(d,v-m.length);g.type==p?g.value+=f:(g.type&&c.push(g),g={type:p,value:f})}for(var w=0;ws){for(h>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});d1&&a[0]!==n&&a.unshift("#tmp",n),{tokens:c,state:a.length?a:n}},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,a){"use strict";var n,s=e("../lib/deep_copy").deepCopy;(function(){this.addRules=function(e,t){if(t)for(var a in e){for(var n=e[a],s=0;s=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,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,t=this.$tokenIndex,a=e[t].start;if(void 0!==a)return a;for(a=0;t>0;)a+=e[t-=1].value.length;return a},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=s})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,a){"use strict";var n,s,o=e("../../lib/oop"),i=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,l=e("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],d=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},g={'"':'"',"'":"'"},p=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,h.rangeCount!=e.multiSelect.rangeCount&&(h={rangeCount:e.multiSelect.rangeCount})),h[t])return n=h[t];n=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(e,t,a,n){var s=e.end.row-e.start.row;return{text:a+t+n,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}};(s=function(e){e=e||{},this.add("braces","insertion",(function(t,a,o,i,r){var c=o.getCursorPosition(),d=i.doc.getLine(c.row);if("{"==r){p(o);var h=o.getSelectionRange(),g=i.doc.getTextRange(h),m=i.getTokenAt(c.row,c.column);if(""!==g&&"{"!==g&&o.getWrapBehavioursEnabled())return u(h,g,"{","}");if(m&&/(?:string)\.quasi|\.xml/.test(m.type)){if([/tag\-(?:open|name)/,/attribute\-name/].some((function(e){return e.test(m.type)}))||/(string)\.quasi/.test(m.type)&&"$"!==m.value[c.column-m.start-1])return;return s.recordAutoInsert(o,i,"}"),{text:"{}",selection:[1,1]}}if(s.isSaneInsertion(o,i))return/[\]\}\)]/.test(d[c.column])||o.inMultiSelectMode||e.braces?(s.recordAutoInsert(o,i,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(o,i,"{"),{text:"{",selection:[1,1]})}else if("}"==r){if(p(o),"}"==d.substring(c.column,c.column+1)&&null!==i.$findOpeningBracket("}",{column:c.column+1,row:c.row})&&s.isAutoInsertedClosing(c,d,r))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==r||"\r\n"==r){p(o);var v="";if(s.isMaybeInsertedClosing(c,d)&&(v=l.stringRepeat("}",n.maybeInsertedBrackets),s.clearMaybeInsertedClosing()),"}"===d.substring(c.column,c.column+1)){var f=i.findMatchingBracket({row:c.row,column:c.column+1},"}");if(!f)return null;var w=this.$getIndent(i.getLine(f.row))}else{if(!v)return void s.clearMaybeInsertedClosing();w=this.$getIndent(d)}var b=w+i.getTabString();return{text:"\n"+b+"\n"+w+v,selection:[1,b.length,1,b.length]}}s.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,a,s,o){var i=s.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==i){if(p(a),"}"==s.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;n.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,a,n,o){if("("==o){p(a);var i=a.getSelectionRange(),r=n.doc.getTextRange(i);if(""!==r&&a.getWrapBehavioursEnabled())return u(i,r,"(",")");if(s.isSaneInsertion(a,n))return s.recordAutoInsert(a,n,")"),{text:"()",selection:[1,1]}}else if(")"==o){p(a);var l=a.getCursorPosition(),c=n.doc.getLine(l.row);if(")"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&s.isAutoInsertedClosing(l,c,o))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,a,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"("==o&&(p(a),")"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s})),this.add("brackets","insertion",(function(e,t,a,n,o){if("["==o){p(a);var i=a.getSelectionRange(),r=n.doc.getTextRange(i);if(""!==r&&a.getWrapBehavioursEnabled())return u(i,r,"[","]");if(s.isSaneInsertion(a,n))return s.recordAutoInsert(a,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){p(a);var l=a.getCursorPosition(),c=n.doc.getLine(l.row);if("]"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&s.isAutoInsertedClosing(l,c,o))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,a,n,s){var o=n.doc.getTextRange(s);if(!s.isMultiLine()&&"["==o&&(p(a),"]"==n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)))return s.end.column++,s})),this.add("string_dquotes","insertion",(function(e,t,a,n,s){var o=n.$mode.$quotes||g;if(1==s.length&&o[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;p(a);var i=s,r=a.getSelectionRange(),l=n.doc.getTextRange(r);if(!(""===l||1==l.length&&o[l])&&a.getWrapBehavioursEnabled())return u(r,l,i,i);if(!l){var c=a.getCursorPosition(),d=n.doc.getLine(c.row),h=d.substring(c.column-1,c.column),m=d.substring(c.column,c.column+1),v=n.getTokenAt(c.row,c.column),f=n.getTokenAt(c.row,c.column+1);if("\\"==h&&v&&/escape/.test(v.type))return null;var w,b=v&&/string|escape/.test(v.type),y=!f||/string|escape/.test(f.type);if(m==i)(w=b!==y)&&/string\.end/.test(f.type)&&(w=!1);else{if(b&&!y)return null;if(b&&y)return null;var x=n.$mode.tokenRe;x.lastIndex=0;var k=x.test(h);x.lastIndex=0;var M=x.test(m),C=n.$mode.$pairQuotesAfter;if(!(C&&C[i]&&C[i].test(h))&&k||M)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var z=d[c.column-2];if(h==i&&(z==i||x.test(z)))return null;w=!0}return{text:w?i+i:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,a,n,s){var o=n.$mode.$quotes||g,i=n.doc.getTextRange(s);if(!s.isMultiLine()&&o.hasOwnProperty(i)&&(p(a),n.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==i))return s.end.column++,s})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,a,n,s){if("doc-start"===e&&("\n"===s||"\r\n"===s)&&a.selection.isEmpty()){var o=a.getCursorPosition();if(0===o.column)return;for(var i=n.doc.getLine(o.row),r=n.doc.getLine(o.row+1),l=n.getTokens(o.row),c=0,d=0;d=o.column){if(c===o.column){if(!/\.doc/.test(h.type))return;if(/\*\//.test(h.value)){var g=l[d+1];if(!g||!/\.doc/.test(g.type))return}}var p=o.column-(c-h.value.length),u=h.value.indexOf("*/"),m=h.value.indexOf("/**",u>-1?u+2:0);if(-1!==m&&p>m&&p=u&&p<=m||!/\.doc/.test(h.type))return;break}}var v=this.$getIndent(i);if(/\s*\*/.test(r))return/^\s*\*/.test(i)?{text:s+v+"* ",selection:[1,2+v.length,1,2+v.length]}:{text:s+v+" * ",selection:[1,3+v.length,1,3+v.length]};if(/\/\*\*/.test(i.substring(0,o.column)))return{text:s+v+" * "+s+" "+v+"*/",selection:[1,4+v.length,1,4+v.length]}}}))}).isSaneInsertion=function(e,t){var a=e.getCursorPosition(),n=new r(t,a.row,a.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",c)){if(/[)}\]]/.test(e.session.getLine(a.row)[a.column]))return!0;var s=new r(t,a.row,a.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",c))return!1}return n.stepForward(),n.getCurrentTokenRow()!==a.row||this.$matchTokenType(n.getCurrentToken()||"text",d)},s.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},s.recordAutoInsert=function(e,t,a){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,o,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=s.row,n.autoInsertedLineEnd=a+o.substr(s.column),n.autoInsertedBrackets++},s.recordMaybeInsert=function(e,t,a){var s=e.getCursorPosition(),o=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,o)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=s.row,n.maybeInsertedLineStart=o.substr(0,s.column)+a,n.maybeInsertedLineEnd=o.substr(s.column),n.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(e,t,a){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&a===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},o.inherits(s,i),t.CstyleBehaviour=s})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,a){"use strict";for(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],s=0,o=[],i=0;i2?n%l!=l-1:n%l==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,u=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+c.escapeRegExp(p)+")"),v=new RegExp("(?:"+c.escapeRegExp(u)+")\\s*$"),f=function(e,t){b(e,t)||o&&!/\S/.test(e)||(s.insertInLine({row:t,column:e.length},u),s.insertInLine({row:t,column:r},p))},w=function(e,t){var a;(a=e.match(v))&&s.removeInLine(t,e.length-a[0].length,e.length),(a=e.match(m))&&s.removeInLine(t,a[1].length,a[0].length)},b=function(e,a){if(m.test(e))return!0;for(var n=t.getTokens(a),s=0;se.length&&(x=e.length)})),r==1/0&&(r=x,o=!1,i=!1),d&&r%l!=0&&(r=Math.floor(r/l)*l),y(i?w:f)},this.toggleBlockComment=function(e,t,a,n){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var o,i,r=(m=new d(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(r&&/comment/.test(r.type)){for(var c,g;r&&/comment/.test(r.type);){if(-1!=(v=r.value.indexOf(s.start))){var p=m.getCurrentTokenRow(),u=m.getCurrentTokenColumn()+v;c=new h(p,u,p,u+s.start.length);break}r=m.stepBackward()}var m;for(r=(m=new d(t,n.row,n.column)).getCurrentToken();r&&/comment/.test(r.type);){var v;if(-1!=(v=r.value.indexOf(s.end))){p=m.getCurrentTokenRow(),u=m.getCurrentTokenColumn()+v,g=new h(p,u,p,u+s.end.length);break}r=m.stepForward()}g&&t.remove(g),c&&(t.remove(c),o=c.start.row,i=-s.start.length)}else i=s.start.length,o=a.start.row,t.insert(a.end,s.end),t.insert(a.start,s.start);l.start.row==o&&(l.start.column+=i),l.end.row==o&&(l.end.column+=i),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,a){return this.$getIndent(t)},this.checkOutdent=function(e,t,a){return!1},this.autoOutdent=function(e,t,a){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var a=e[t],n=a.prototype.$id,o=s.$modes[n];o||(s.$modes[n]=o=new a),s.$modes[t]||(s.$modes[t]=o),this.$embeds.push(t),this.$modes[t]=o}var i=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],r=function(e){var t,a,n;n=(t=l)[a=i[e]],t[i[e]]=function(){return this.$delegator(a,arguments,n)}},l=this;for(t=0;tt[a].column&&a++,o.unshift(a,0),t.splice.apply(t,o),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,a){if(e)for(t=!1,e.row=a;e.$oldWidget;)e.$oldWidget.row=a,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=n.createElement("div"),e.el.textContent=e.text),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),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=!0,e.coverGutter||(e.el.style.zIndex="3"),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var a=this.session.getFoldAt(e.row,0);if(e.$fold=a,a){var s=this.session.lineWidgets;e.row!=a.end.row||s[a.start.row]?e.hidden=!0:s[a.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),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,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;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){for(var t=this.session.lineWidgets,a=t&&t[e],n=[];a;)n.push(a),a=a.$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 a=this.session._changedWidgets,n=t.layerConfig;if(a&&a.length){for(var s=1/0,o=0;o0&&!n[s];)s--;this.firstRow=a.firstRow,this.lastRow=a.lastRow,t.$cursorLayer.config=a;for(var i=s;i<=o;i++){var r=n[i];if(r&&r.el)if(r.hidden)r.el.style.top=-100-(r.pixelHeight||0)+"px";else{r._inDocument||(r._inDocument=!0,t.container.appendChild(r.el));var l=t.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;r.coverLine||(l+=a.lineHeight*this.session.getRowLineCount(r.row)),r.el.style.top=l-a.offset+"px";var c=r.coverGutter?0:t.gutterWidth;r.fixedWidth||(c-=t.scrollLeft),r.el.style.left=c+"px",r.fullWidth&&r.screenWidth&&(r.el.style.minWidth=a.width+2*a.padding+"px"),r.fixedWidth?r.el.style.right=t.scrollBar.getWidth()+"px":r.el.style.right=""}}}},e}();t.LineWidgets=s})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,a){"use strict";t.applyDelta=function(e,t,a){var n=t.start.row,s=t.start.column,o=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=o.substring(0,s)+t.lines[0]+o.substring(s);else{var i=[n,1].concat(t.lines);e.splice.apply(e,i),e[n]=o.substring(0,s)+e[n],e[n+t.lines.length-1]+=o.substring(s)}break;case"remove":var r=t.end.column,l=t.end.row;n===l?e[n]=o.substring(0,s)+o.substring(r):e.splice(n,l-n+1,o.substring(0,s)+e[l].substring(r))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n=e("./lib/oop"),s=e("./lib/event_emitter").EventEmitter,o=function(){function e(e,t,a){this.$onChange=this.onChange.bind(this),this.attach(e),"number"!=typeof t?this.setPosition(t.row,t.column):this.setPosition(t,a)}return 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||e.start.row>this.row)){var t=function(e,t,a){var n="insert"==e.action,s=(n?1:-1)*(e.end.row-e.start.row),o=(n?1:-1)*(e.end.column-e.start.column),r=e.start,l=n?r:e.end;return i(t,r,a)?{row:t.row,column:t.column}:i(l,t,!a)?{row:t.row+s,column:t.column+(t.row==l.row?o:0)}:{row:r.row,column:r.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,a){var n;if(n=a?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var s={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:s,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 a={};return e>=this.document.getLength()?(a.row=Math.max(0,this.document.getLength()-1),a.column=this.document.getLine(a.row).length):e<0?(a.row=0,a.column=0):(a.row=e,a.column=Math.min(this.document.getLine(a.row).length,Math.max(0,t))),t<0&&(a.column=0),a},e}();function i(e,t,a){var n=a?e.column<=t.column:e.column=a&&(e=a-1,t=void 0);var n=this.getLine(e);return null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},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();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){var a=0;(e=Math.min(Math.max(e,0),this.getLength()))0,n=t=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){return e instanceof i||(e=i.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var a="insert"==e.action;(a?e.lines.length<=1&&!e.lines[0]:!i.comparePoints(e.start,e.end))||(a&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(s(this.$lines,e,t),this._signal("change",e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row20){a.running=setTimeout(a.$worker,20);break}}a.currentLine=t,-1==n&&(n=t),o<=n&&a.fireUpdateEvent(o,n)}}}return 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 a={first:e,last:t};this._signal("update",{data:a})},e.prototype.start=function(e){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(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,a=e.end.row-t;if(0===a)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,a+1,null),this.states.splice(t,a+1,null);else{var n=Array(a+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(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),a=this.states[e-1],n=this.tokenizer.getLineTokens(t,a,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();n.implement(o.prototype,s),t.BackgroundTokenizer=o})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/lang"),s=e("./range").Range,o=function(){function e(e,t,a){void 0===a&&(a="text"),this.setRegexp(e),this.clazz=t,this.type=a,this.docLen=0}return e.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,a,o){if(this.regExp){for(var i=o.firstRow,r=o.lastRow,l={},c=a.$editor.$search,d=c.$isMultilineSearch(a.$editor.getLastSearchOptions()),h=i;h<=r;h++){var g=this.cache[h];if(null==g||a.getValue().length!=this.docLen){if(d){g=[];var p=c.$multiLineForward(a,this.regExp,h,r);if(p){var u=p.endRow<=r?p.endRow-1:r;u>h&&(h=u),g.push(new s(p.startRow,p.startCol,p.endRow,p.endCol))}g.length>this.MAX_RANGES&&(g=g.slice(0,this.MAX_RANGES))}else(g=n.getMatchOffsets(a.getLine(h),this.regExp)).length>this.MAX_RANGES&&(g=g.slice(0,this.MAX_RANGES)),g=g.map((function(e){return new s(h,e.offset,h,e.offset+e.length)}));this.cache[h]=g.length?g:""}if(0!==g.length)for(var m=g.length;m--;){var v=g[m].toScreenRange(a),f=v.toString();l[f]||(l[f]=!0,t.drawSingleLineMarker(e,v,this.clazz,o))}}this.docLen=a.getValue().length}},e}();o.prototype.MAX_RANGES=500,t.SearchHighlight=o})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,a){"use strict";var n=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,a){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),!1===t||!this.lastDeltas){this.lastDeltas=[];var n=this.$undoStack.length;n>this.$undoDepth-1&&this.$undoStack.splice(0,n-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}"remove"!=e.action&&"insert"!=e.action||(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(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var a=this.$undoStack,n=a.length;n--;){var s=a[n][0];if(s.id<=e)break;s.id0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){null==e&&(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){return e?r(e):r(this.$undoStack)+"\n---\n"+r(this.$redoStack)},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;var s=e("./range").Range,o=s.comparePoints;function i(e){return{row:e.row,column:e.column}}function r(e){if(e=e||this,Array.isArray(e))return e.map(r).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var a="insert"==e.action,n="insert"==t.action;if(a&&n)if(o(t.start,e.end)>=0)g(t,e,-1);else{if(!(o(t.start,e.start)<=0))return null;g(e,t,1)}else if(a&&!n)if(o(t.start,e.end)>=0)g(t,e,-1);else{if(!(o(t.end,e.start)<=0))return null;g(e,t,-1)}else if(!a&&n)if(o(t.start,e.start)>=0)g(t,e,1);else{if(!(o(t.start,e.start)<=0))return null;g(e,t,1)}else if(!a&&!n)if(o(t.start,e.start)>=0)g(t,e,1);else{if(!(o(t.end,e.start)<=0))return null;g(e,t,-1)}return[t,e]}function d(e,t){for(var a=e.length;a--;)for(var n=0;n=0?g(e,t,-1):(o(e.start,t.start)<=0||g(e,s.fromPoints(t.start,e.start),-1),g(t,e,1));else if(!a&&n)o(t.start,e.end)>=0?g(t,e,-1):(o(t.start,e.start)<=0||g(t,s.fromPoints(e.start,t.start),-1),g(e,t,1));else if(!a&&!n)if(o(t.start,e.end)>=0)g(t,e,-1);else{var i,r;if(!(o(t.end,e.start)<=0))return o(e.start,t.start)<0&&(i=e,e=u(e,t.start)),o(e.end,t.end)>0&&(r=u(e,t.end)),p(t.end,e.start,e.end,-1),r&&!i&&(e.lines=r.lines,e.start=r.start,e.end=r.end,r=e),[t,i,r].filter(Boolean);g(e,t,-1)}return[t,e]}function g(e,t,a){p(e.start,t.start,t.end,a),p(e.end,t.start,t.end,a)}function p(e,t,a,n){e.row==(1==n?t:a).row&&(e.column+=n*(a.column-t.column)),e.row+=n*(a.row-t.row)}function u(e,t){var a=e.lines,n=e.end;e.end=i(t);var s=e.end.row-e.start.row,o=a.splice(s,a.length),r=s?t.column:t.column-e.start.column;return a.push(o[0].substring(0,r)),o[0]=o[0].substr(r),{start:i(t),end:n,lines:o,action:e.action}}function m(e,t){t=function(e){return{start:i(e.start),end:i(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var a=e.length;a--;){for(var n=e[a],s=0;sthis.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)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):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)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,a){var n,s,o=0,i=this.folds,r=!0;null==t&&(t=this.end.row,a=this.end.column);for(var l=0;l0)){var l=n(e,i.start);return 0===r?t&&0!==l?-o-2:o:l>0||0===l&&!t?o:-o-1}}return-o-1},e.prototype.add=function(e){var t=!e.isEmpty(),a=this.pointIndex(e.start,t);a<0&&(a=-a-1);var n=this.pointIndex(e.end,t,a);return n<0?n=-n-1:n++,this.ranges.splice(a,n-a,e)},e.prototype.addList=function(e){for(var t=[],a=e.length;a--;)t.push.apply(t,this.add(e[a]));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(){for(var e,t=[],a=this.ranges,s=(a=a.sort((function(e,t){return n(e.start,t.start)})))[0],o=1;o=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 a=this.ranges;if(a[0].start.row>t||a[a.length-1].start.row=n);i++);if("insert"==e.action){for(var l=s-n,c=-t.column+a.column;in);i++)if(d.start.row==n&&d.start.column>=t.column&&(d.start.column==t.column&&this.$bias<=0||(d.start.column+=c,d.start.row+=l)),d.end.row==n&&d.end.column>=t.column){if(d.end.column==t.column&&this.$bias<0)continue;d.end.column==t.column&&c>0&&id.start.column&&d.end.column==o[i+1].start.column&&(d.end.column-=c),d.end.column+=c,d.end.row+=l}}else for(l=n-s,c=t.column-a.column;is);i++)d.end.rowt.column)&&(d.end.column=t.column,d.end.row=t.row):(d.end.column+=c,d.end.row+=l):d.end.row>s&&(d.end.row+=l),d.start.rowt.column)&&(d.start.column=t.column,d.start.row=t.row):(d.start.column+=c,d.start.row+=l):d.start.row>s&&(d.start.row+=l);if(0!=l&&i=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var a=this.$foldData,n=0;for(t&&(n=a.indexOf(t)),-1==n&&(n=0);n=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var a=this.$foldData,n=t-e+1,s=0;s=t){r=e?n-=t-r:n=0);break}i>=e&&(n-=r>=e?i-r:i-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var a,n=this.$foldData,i=!1;e instanceof o?a=e:(a=new o(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(a.range);var r=a.start.row,l=a.start.column,c=a.end.row,d=a.end.column,h=this.getFoldAt(r,l,1),g=this.getFoldAt(c,d,-1);if(h&&g==h)return h.addSubFold(a);h&&!h.range.isStart(r,l)&&this.removeFold(h),g&&!g.range.isEnd(c,d)&&this.removeFold(g);var p=this.getFoldsInRange(a.range);p.length>0&&(this.removeFolds(p),a.collapseChildren||p.forEach((function(e){a.addSubFold(e)})));for(var u=0;u0&&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 a,s;if(null==e)a=new n(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)a=new n(e,0,e,this.getLine(e).length);else if("row"in e)a=n.fromPoints(e,e);else{if(Array.isArray(e))return s=[],e.forEach((function(e){s=s.concat(this.unfold(e))}),this),s;a=e}for(var o=s=this.getFoldsInRangeList(a);1==s.length&&n.comparePoints(s[0].start,a.start)<0&&n.comparePoints(s[0].end,a.end)>0;)this.expandFolds(s),s=this.getFoldsInRangeList(a);if(0!=t?this.removeFolds(s):this.expandFolds(s),o.length)return o},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var a=this.getFoldLine(e,t);return a?a.end.row:e},this.getRowFoldStart=function(e,t){var a=this.getFoldLine(e,t);return a?a.start.row:e},this.getFoldDisplayLine=function(e,t,a,n,s){null==n&&(n=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==a&&(a=this.getLine(t).length);var o=this.doc,i="";return e.walk((function(e,t,a,r){if(!(th)break}while(o&&l.test(o.type));o=s.stepBackward()}else o=s.getCurrentToken();return c.end.row=s.getCurrentTokenRow(),c.end.column=s.getCurrentTokenColumn(),c}},this.foldAll=function(e,t,a,n){null==a&&(a=1e5);var s=this.foldWidgets;if(s){t=t||this.getLength();for(var o=e=e||0;o=e&&(o=i.end.row,i.collapseChildren=a,this.addFold("...",i))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var a=e.getTokens(t),n=0;n=0;){var o=a[s];if(null==o&&(o=a[s]=this.getFoldWidget(s)),"start"==o){var i=this.getFoldWidgetRange(s);if(n||(n=i),i&&i.end.row>=e)break}s--}return{range:-1!==s&&i,firstRange:n}},this.onFoldWidgetClick=function(e,t){t instanceof r&&(t=t.domEvent);var a={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,a)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var a=this.getFoldWidget(e),n=this.getLine(e),s="end"===a?-1:1,o=this.getFoldAt(e,-1===s?0:n.length,s);if(o)return t.children||t.all?this.removeFold(o):this.expandFold(o),o;var i=this.getFoldWidgetRange(e,!0);if(i&&!i.isMultiLine()&&(o=this.getFoldAt(i.start.row,i.start.column,1))&&i.isEqual(o.range))return this.removeFold(o),o;if(t.siblings){var r=this.getParentFoldRangeData(e);if(r.range)var l=r.range.start.row+1,c=r.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=i?i.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):i&&(t.all&&(i.collapseChildren=1e4),this.addFold("...",i));return i}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var a=this.$toggleFoldWidget(t,{});if(!a){var n=this.getParentFoldRangeData(t,!0);if(a=n.range||n.firstRange){t=a.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",a)}}},this.updateFoldWidgets=function(e){var t=e.start.row,a=e.end.row-t;if(0===a)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,a+1,null);else{var n=Array(a+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,a){"use strict";var n=e("../token_iterator").TokenIterator,s=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var a=t||this.getLine(e.row).charAt(e.column-1);if(""==a)return null;var n=a.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,a=this.getLine(e.row),n=!0,o=a.charAt(e.column-1),i=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(i||(o=a.charAt(e.column),e={row:e.row,column:e.column+1},i=o&&o.match(/([\(\[\{])|([\)\]\}])/),n=!1),!i)return null;if(i[1]){if(!(r=this.$findClosingBracket(i[1],e)))return null;t=s.fromPoints(e,r),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var r;if(!(r=this.$findOpeningBracket(i[2],e)))return null;t=s.fromPoints(r,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var a=this.getLine(e.row),n=/([\(\[\{])|([\)\]\}])/,o=!t&&a.charAt(e.column-1),i=o&&o.match(n);if(i||(o=(void 0===t||t)&&a.charAt(e.column),e={row:e.row,column:e.column+1},i=o&&o.match(n)),!i)return null;var r=new s(e.row,e.column-1,e.row,e.column),l=i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e);return l?[r,new s(l.row,l.column,l.row,l.column+1)]:[r]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,a){var s=this.$brackets[e],o=1,i=new n(this,t.row,t.column),r=i.getCurrentToken();if(r||(r=i.stepForward()),r){a||(a=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=t.column-i.getCurrentTokenColumn()-2,c=r.value;;){for(;l>=0;){var d=c.charAt(l);if(d==s){if(0==(o-=1))return{row:i.getCurrentTokenRow(),column:l+i.getCurrentTokenColumn()}}else d==e&&(o+=1);l-=1}do{r=i.stepBackward()}while(r&&!a.test(r.type));if(null==r)break;l=(c=r.value).length-1}return null}},this.$findClosingBracket=function(e,t,a){var s=this.$brackets[e],o=1,i=new n(this,t.row,t.column),r=i.getCurrentToken();if(r||(r=i.stepForward()),r){a||(a=new RegExp("(\\.?"+r.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=t.column-i.getCurrentTokenColumn();;){for(var c=r.value,d=c.length;l"===t.value?n=!0:-1!==t.type.indexOf("tag-name")&&(a=!0))}while(t&&!a);return t},this.$findClosingTag=function(e,t){var a,n=t.value,o=t.value,i=0,r=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),c=!1;do{if(-1!==(a=t).type.indexOf("tag-close")&&!c){var d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(t=e.stepForward())if(">"!==t.value||c||(d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),c=!0),-1!==t.type.indexOf("tag-name")){if(o===(n=t.value))if("<"===a.value)i++;else if(""!==t.value)return;var p=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else o===n&&"/>"===t.value&&--i<0&&(p=g=h=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),d=new s(l.end.row,l.end.column,l.end.row,l.end.column+1))}while(t&&i>=0);if(r&&d&&h&&p&&l&&g)return{openTag:new s(r.start.row,r.start.column,d.end.row,d.end.column),closeTag:new s(h.start.row,h.start.column,p.end.row,p.end.column),openTagName:l,closeTagName:g}},this.$findOpeningTag=function(e,t){var a=e.getCurrentToken(),n=t.value,o=0,i=e.getCurrentTokenRow(),r=e.getCurrentTokenColumn(),l=r+2,c=new s(i,r,i,l);e.stepForward();var d=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(-1===t.type.indexOf("tag-close")&&(t=e.stepForward()),t&&">"===t.value){var h=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=a,i=e.getCurrentTokenRow(),l=(r=e.getCurrentTokenColumn())+t.value.length,a=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(n===t.value)if("<"===a.value){if(++o>0){var g=new s(i,r,i,l),p=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&">"!==t.value);var u=new s(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else""===t.value){for(var m=0,v=a;v;){if(-1!==v.type.indexOf("tag-name")&&v.value===n){o--;break}if("<"===v.value)break;v=e.stepBackward(),m++}for(var f=0;fa&&(this.$docRowCache.splice(a,t),this.$screenRowCache.splice(a,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var a=0,n=e.length-1;a<=n;){var s=a+n>>1,o=e[s];if(t>o)a=s+1;else{if(!(t=t);o++);return(a=n[o])?(a.index=o,a.start=s-a.value.length,a):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\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){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;t0&&(n=!!a.charAt(t-1).match(this.tokenRe)),n||(n=!!a.charAt(t).match(this.tokenRe)),n)var s=this.tokenRe;else s=/^\s+$/.test(a.slice(t-1,t+1))?/\s/:this.nonTokenRe;var o=t;if(o>0){do{o--}while(o>=0&&a.charAt(o).match(s));o++}for(var i=t;ie&&(e=t.screenWidth)})),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),a=this.$rowLengthCache,n=0,s=0,o=this.$foldData[s],i=o?o.start.row:1/0,r=t.length,l=0;li){if((l=o.end.row+1)>=r)break;i=(o=this.$foldData[s++])?o.start.row:1/0}null==a[l]&&(a[l]=this.$getStringScreenWidth(t[l])[0]),a[l]>n&&(n=a[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){this.$fromUndo=!0;for(var a=e.length-1;-1!=a;a--){var n=e[a];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var a=0;ae.end.column&&(o.start.column+=c),o.end.row==e.end.row&&o.end.column>e.end.column&&(o.end.column+=c)),i&&o.start.row>=e.end.row&&(o.start.row+=i,o.end.row+=i)}if(o.end=this.insert(o.start,n),s.length){var r=e.start,l=o.start,c=(i=l.row-r.row,l.column-r.column);this.addFolds(s.map((function(e){return(e=e.clone()).start.row==r.row&&(e.start.column+=c),e.end.row==r.row&&(e.end.column+=c),e.start.row+=i,e.end.row+=i,e})))}return o},e.prototype.indentRows=function(e,t,a){a=a.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},a)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),a=new d(0,0,0,0),n=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var o=this.getLine(s);a.start.row=s,a.end.row=s;for(var i=0;i0){var s;if((s=this.getRowFoldEnd(t+a))>this.doc.getLength()-1)return 0;n=s-t}else e=this.$clipRowToDocument(e),n=(t=this.$clipRowToDocument(t))-e+1;var o=new d(e,0,t,Number.MAX_VALUE),i=this.getFoldsInRange(o).map((function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e})),r=0==a?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,r),i.length&&this.addFolds(i),n},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){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var a=this.doc.getLength();e>=a?(e=a-1,t=this.doc.getLine(a-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),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){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},e.prototype.adjustWrapLimit=function(e,t){var a=this.$wrapLimitRange;a.max<0&&(a={min:t,max:t});var n=this.$constrainWrapLimit(e,a.min,a.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},e.prototype.$constrainWrapLimit=function(e,t,a){return t&&(e=Math.max(t,e)),a&&(e=Math.min(a,e)),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,a=e.action,n=e.start,s=e.end,o=n.row,i=s.row,r=i-o,l=null;if(this.$updating=!0,0!=r)if("remove"===a){this[t?"$wrapData":"$rowLengthCache"].splice(o,r);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var d=0;if(m=this.getFoldLine(s.row)){m.addRemoveChars(s.row,s.column,n.column-s.column),m.shiftRow(-r);var h=this.getFoldLine(o);h&&h!==m&&(h.merge(m),m=h),d=c.indexOf(m)+1}for(;d=s.row&&m.shiftRow(-r);i=o}else{var g=Array(r);g.unshift(o,0);var p=t?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,g),c=this.$foldData,d=0,m=this.getFoldLine(o)){var u=m.range.compareInside(n.row,n.column);0==u?(m=m.split(n.row,n.column))&&(m.shiftRow(r),m.addRemoveChars(i,0,s.column-n.column)):-1==u&&(m.addRemoveChars(o,0,s.column-n.column),m.shiftRow(r)),d=c.indexOf(m)+1}for(;d=o&&m.shiftRow(r)}}else r=Math.abs(e.start.column-e.end.column),"remove"===a&&(l=this.getFoldsInRange(e),this.removeFolds(l),r=-r),(m=this.getFoldLine(o))&&m.addRemoveChars(o,n.column,r);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(o,i):this.$updateRowLengthCache(o,i),l},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var a,n,s=this.doc.getAllLines(),o=this.getTabSize(),i=this.$wrapData,r=this.$wrapLimit,l=e;for(t=Math.min(t,s.length-1);l<=t;)(n=this.getFoldLine(l,n))?(a=[],n.walk(function(e,t,n,o){var i;if(null!=e){(i=this.$getDisplayTokens(e,a.length))[0]=b;for(var r=1;rt-h;){var g=o+t-h;if(e[g-1]>=k&&e[g]>=k)d(g);else if(e[g]!=b&&e[g]!=y){for(var p=Math.max(g-(t-(t>>2)),o-1);g>p&&e[g]p&&e[g]p&&e[g]==x;)g--}else for(;g>p&&e[g]p?d(++g):(e[g=o+t]==w&&g--,d(g-h))}else{for(;g!=o-1&&e[g]!=b;g--);if(g>o){d(g);continue}for(g=o+t;g39&&o<48||o>57&&o<64?n.push(x):o>=4352&&z(o)?n.push(f,w):n.push(f)}return n},e.prototype.$getStringScreenWidth=function(e,t,a){if(0==t)return[0,0];var n,s;for(null==t&&(t=1/0),a=a||0,s=0;s=4352&&z(n)?a+=2:a+=1,!(a>t));s++);return[a,s]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},e.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),a=this.$wrapData[t.row];return a.length&&a[0]=0){r=c[d],o=this.$docRowCache[d];var g=e>c[h-1]}else g=!h;for(var p=this.getLength()-1,u=this.getNextFoldLine(o),m=u?u.start.row:1/0;r<=e&&!(r+(l=this.getRowLength(o))>e||o>=p);)r+=l,++o>m&&(o=u.end.row+1,m=(u=this.getNextFoldLine(o,u))?u.start.row:1/0),g&&(this.$docRowCache.push(o),this.$screenRowCache.push(r));if(u&&u.start.row<=o)n=this.getFoldDisplayLine(u),o=u.start.row;else{if(r+l<=e||o>p)return{row:p,column:this.getLine(p).length};n=this.getLine(o),u=null}var v=0,f=Math.floor(e-r);if(this.$useWrapMode){var w=this.$wrapData[o];w&&(s=w[f],f>0&&w.length&&(v=w.indent,i=w[f-1]||w[w.length-1],n=n.substring(i)))}return void 0!==a&&this.$bidiHandler.isBidiRow(r+f,o,f)&&(t=this.$bidiHandler.offsetToCol(a)),i+=this.$getStringScreenWidth(n,t-v)[1],this.$useWrapMode&&i>=s&&(i=s-1),u?u.idxToPosition(i):{row:o,column:i}},e.prototype.documentToScreenPosition=function(e,t){if(void 0===t)var a=this.$clipPositionToDocument(e.row,e.column);else a=this.$clipPositionToDocument(e,t);e=a.row,t=a.column;var n,s=0,o=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var i,r=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),d=l.length;if(d&&c>=0){r=l[c],s=this.$screenRowCache[c];var h=e>l[d-1]}else h=!d;for(var g=this.getNextFoldLine(r),p=g?g.start.row:1/0;r=p){if((i=g.end.row+1)>e)break;p=(g=this.getNextFoldLine(i,g))?g.start.row:1/0}else i=r+1;s+=this.getRowLength(r),r=i,h&&(this.$docRowCache.push(r),this.$screenRowCache.push(s))}var u="";g&&r>=p?(u=this.getFoldDisplayLine(g,e,t),o=g.start.row):(u=this.getLine(e).substring(0,t),o=e);var m=0;if(this.$useWrapMode){var v=this.$wrapData[o];if(v){for(var f=0;u.length>=v[f];)s++,f++;u=u.substring(v[f-1]||0,u.length),m=f>0?v.indent:0}}return this.lineWidgets&&this.lineWidgets[r]&&this.lineWidgets[r].rowsAbove&&(s+=this.lineWidgets[r].rowsAbove),{row:s,column:m+this.$getStringScreenWidth(u)[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,t=null;if(this.$useWrapMode)for(var a=this.$wrapData.length,n=0,s=(r=0,(t=this.$foldData[r++])?t.start.row:1/0);ns&&(n=t.end.row+1,s=(t=this.$foldData[r++])?t.start.row:1/0)}else{e=this.getLength();for(var i=this.$foldData,r=0;ra);o++);return[n,o]})},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();return 0===e.column?0===e.row?"":this.doc.getNewLineCharacter():this.getLine(e.row)[e.column-1]},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},e}();v.$uid=0,v.prototype.$modes=i.$modes,v.prototype.getValue=v.prototype.toString,v.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},v.prototype.$overwrite=!1,v.prototype.$mode=null,v.prototype.$modeId=null,v.prototype.$scrollTop=0,v.prototype.$scrollLeft=0,v.prototype.$wrapLimit=80,v.prototype.$useWrapMode=!1,v.prototype.$wrapLimitRange={min:null,max:null},v.prototype.lineWidgets=null,v.prototype.isFullWidth=z,n.implement(v.prototype,r);var f=1,w=2,b=3,y=4,x=9,k=10,M=11,C=12;function z(e){return!(e<4352)&&(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(v.prototype),e("./edit_session/bracket_match").BracketMatch.call(v.prototype),i.defineOptions(v.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=v})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,a){"use strict";var n=e("./lib/lang"),s=e("./lib/oop"),o=e("./range").Range,i=function(){function e(){this.$options={}}return e.prototype.set=function(e){return s.mixin(this.$options,e),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,a=this.$matchIterator(e,t);if(!a)return!1;var n=null;return a.forEach((function(e,a,s,i){return n=new o(e,a,s,i),!(a==i&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start)&&(n=null,1))})),n},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var a=t.range,s=a?e.getLines(a.start.row,a.end.row):e.doc.getAllLines(),i=[],r=t.re;if(t.$isMultiLine){var l,c=r.length,d=s.length-c;e:for(var h=r.offset||0;h<=d;h++){for(var g=0;gm||(i.push(l=new o(h,m,h+c-1,v)),c>2&&(h=h+c-2))}}else for(var f,w=0;ww&&(w=y),i.push(new o(f.startRow,f.startCol,f.endRow,f.endCol))}}else for(f=n.getMatchOffsets(s[w],r),g=0;gM&&i[g].end.row==C;)g--;for(i=i.slice(w,g+1),w=0,g=i.length;w=n){t+="$";break}var o=e.charCodeAt(a);if(36===o){t+="$$";continue}if(48===o||38===o){t+="$&";continue}if(49<=o&&o<=57){t+="$"+e[a];continue}}t+=e[a]}else{if(++a>=n){t+="\\";break}switch(e.charCodeAt(a)){case 92:t+="\\";break;case 110:t+="\n";break;case 116:t+="\t"}}}return t||e},e.prototype.replace=function(e,t){var a=this.$options,n=this.$assembleRegExp(a);if(a.$isMultiLine)return t;if(n){var s=this.$isMultilineSearch(a);s&&(e=e.replace(/\r\n|\r|\n/g,"\n"));var o=n.exec(e);if(!o||!s&&o[0].length!=e.length)return null;if(t=a.regExp?this.parseReplaceString(t):t.replace(/\$/g,"$$$$"),t=e.replace(n,t),a.preserveCase){t=t.split("");for(var i=Math.min(e.length,e.length);i--;){var r=e[i];r&&r.toLowerCase()!=r?t[i]=t[i].toUpperCase():t[i]=t[i].toLowerCase()}t=t.join("")}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var a=e.needle;if(!e.needle)return e.re=!1;e.regExp||(a=n.escapeRegExp(a));var s=e.caseSensitive?"gm":"gmi";try{new RegExp(a,"u"),e.$supportsUnicodeFlag=!0,s+="u"}catch(t){e.$supportsUnicodeFlag=!1}if(e.wholeWord&&(a=function(e,t){var a=n.supportsLookbehind();function s(e,n){return void 0===n&&(n=!0),(a&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||t.regExp?a&&t.$supportsUnicodeFlag?n?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var o=Array.from(e),i=o[0],r=o[o.length-1];return s(i)+e+s(r,!1)}(a,e)),e.$isMultiLine=!t&&/[\n\r]/.test(a),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(a,s);try{var o=new RegExp(a,s)}catch(e){o=!1}return e.re=o},e.prototype.$assembleMultilineRegExp=function(e,t){for(var a=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],s=0;sn);r++){var c=e.getLine(i++);s=null==s?c:s+"\n"+c}var d=t.exec(s);if(t.lastIndex=0,d){var h=s.slice(0,d.index).split("\n"),g=d[0].split("\n"),p=a+h.length-1,u=h[h.length-1].length;return{startRow:p,startCol:u,endRow:p+g.length-1,endCol:1==g.length?u+g[0].length:g[g.length-1].length}}}return null},e.prototype.$multiLineBackward=function(e,t,a,n,s){for(var o,i=l(e,n),c=e.getLine(n).length-a,d=n;d>=s;){for(var h=0;h=s;h++){var g=e.getLine(d--);o=null==o?g:g+"\n"+o}var p=r(o,t,c);if(p){var u=o.slice(0,p.index).split("\n"),m=p[0].split("\n"),v=d+u.length,f=u[u.length-1].length;return{startRow:v,startCol:f,endRow:v+m.length-1,endCol:1==m.length?f+m[0].length:m[m.length-1].length}}}return null},e.prototype.$matchIterator=function(e,t){var a=this.$assembleRegExp(t);if(!a)return!1;var s=this.$isMultilineSearch(t),o=this.$multiLineForward,i=this.$multiLineBackward,r=1==t.backwards,l=0!=t.skipCurrent,c=a.unicode,d=t.range,h=t.start;h||(h=d?d[r?"end":"start"]:e.selection.getRange()),h.start&&(h=h[l!=r?"end":"start"]);var g=d?d.start.row:0,p=d?d.end.row:e.getLength()-1;if(r)var u=function(e){var a=h.row;if(!v(a,h.column,e)){for(a--;a>=g;a--)if(v(a,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(a=p,g=h.row;a>=g;a--)if(v(a,Number.MAX_VALUE,e))return}};else u=function(e){var a=h.row;if(!v(a,h.column,e)){for(a+=1;a<=p;a++)if(v(a,0,e))return;if(0!=t.wrap)for(a=g,p=h.row;a<=p;a++)if(v(a,0,e))return}};if(t.$isMultiLine)var m=a.length,v=function(t,n,s){var o=r?t-m+1:t;if(!(o<0||o+m>e.getLength())){var i=e.getLine(o),l=i.search(a[0]);if(!(!r&&ln))return!!s(o,l,o+m-1,d)||void 0}}};else v=r?function(t,o,r){if(s){var l=i(e,a,o,t,g);if(!l)return!1;if(r(l.startRow,l.startCol,l.endRow,l.endCol))return!0}else{var d,h=e.getLine(t),p=[],u=0;for(a.lastIndex=0;d=a.exec(h);){var m=d[0].length;if(u=d.index,!m){if(u>=h.length)break;a.lastIndex=u+=n.skipEmptyMatch(h,u,c)}if(d.index+m>o)break;p.push(d.index,m)}for(var v=p.length-1;v>=0;v-=2){var f=p[v-1];if(r(t,f,t,f+(m=p[v])))return!0}}}:function(t,i,r){if(a.lastIndex=i,s){var l=o(e,a,t,p);if(l){var d=l.endRow<=p?l.endRow-1:p;d>t&&(t=d)}if(!l)return!1;if(r(l.startRow,l.startCol,l.endRow,l.endCol))return!0}else for(var h,g,u=e.getLine(t);g=a.exec(u);){var m=g[0].length;if(r(t,h=g.index,t,h+m))return!0;if(!m&&(a.lastIndex=h+=n.skipEmptyMatch(u,h,c),h>=u.length))return!1}};return{forEach:u}},e}();function r(e,t,a){for(var n=null,s=0;s<=e.length;){t.lastIndex=s;var o=t.exec(e);if(!o)break;var i=o.index+o[0].length;if(i>e.length-a)break;(!n||i>n.index+n[0].length)&&(n=o),s=o.index+1}return n}function l(e,t){var a={row:t,column:0},n=e.doc.positionToIndex(a)+5e3;return e.doc.indexToPosition(n).row+1}t.Search=i})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("../lib/keys"),i=e("../lib/useragent"),r=o.KEY_MODS,l=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,a){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=a},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var a=e&&("string"==typeof e?e:e.name);e=this.commands[a],t||delete this.commands[a];var n=this.commandKeyBinding;for(var s in n){var o=n[s];if(o==e)delete n[s];else if(Array.isArray(o)){var i=o.indexOf(e);-1!=i&&(o.splice(i,1),1==o.length&&(n[s]=o[0]))}}},e.prototype.bindKey=function(e,t,a){if("object"==typeof e&&e&&(null==a&&(a=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var n="";if(-1!=e.indexOf(" ")){var s=e.split(/\s+/);e=s.pop(),s.forEach((function(e){var t=this.parseKeys(e),a=r[t.hashId]+t.key;n+=(n?" ":"")+a,this._addCommandToBinding(n,"chainKeys")}),this),n+=" "}var o=this.parseKeys(e),i=r[o.hashId]+o.key;this._addCommandToBinding(n+i,t,a)}),this)},e.prototype._addCommandToBinding=function(e,t,a){var n,s=this.commandKeyBinding;if(t)if(!s[e]||this.$singleCommand)s[e]=t;else{Array.isArray(s[e])?-1!=(n=s[e].indexOf(t))&&s[e].splice(n,1):s[e]=[s[e]],"number"!=typeof a&&(a=c(t));var o=s[e];for(n=0;na);n++);o.splice(n,0,t)}else delete s[e]},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var a=e[t];if(a){if("string"==typeof a)return this.bindKey(a,t);"function"==typeof a&&(a={exec:a}),"object"==typeof a&&(a.name||(a.name=t),this.addCommand(a))}}),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})),a=t.pop(),n=o[a];if(o.FUNCTION_KEYS[n])a=o.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:a,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:a.toUpperCase(),hashId:-1}}for(var s=0,i=t.length;i--;){var r=o.KEY_MODS[t[i]];if(null==r)return"undefined"!=typeof console&&console.error("invalid modifier "+t[i]+" in "+e),!1;s|=r}return{key:a,hashId:s}},e.prototype.findKeyCommand=function(e,t){var a=r[e]+t;return this.commandKeyBinding[a]},e.prototype.handleKeyboard=function(e,t,a,n){if(!(n<0)){var s=r[t]+a,o=this.commandKeyBinding[s];return e.$keyChain&&(e.$keyChain+=" "+s,o=this.commandKeyBinding[e.$keyChain]||o),!o||"chainKeys"!=o&&"chainKeys"!=o[o.length-1]?(e.$keyChain&&(t&&4!=t||1!=a.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-s.length-1)),{command:o}):(e.$keyChain=e.$keyChain||s,{command:"null"})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}();function c(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var d=function(e){function t(t,a){var n=e.call(this,t,a)||this;return n.$singleCommand=!0,n}return s(t,e),t}(l);d.call=function(e,t,a){l.prototype.$init.call(e,t,a,!0)},l.call=function(e,t,a){l.prototype.$init.call(e,t,a,!1)},t.HashHandler=d,t.MultiHashHandler=l})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,r=e("../lib/event_emitter").EventEmitter,l=function(e){function t(t,a){var n=e.call(this,a,t)||this;return n.byName=n.commands,n.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),n}return s(t,e),t.prototype.exec=function(e,t,a){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,a))return!0;return!1}"string"==typeof e&&(e=this.commands[e]);var s={editor:t,command:e,args:a};return this.canExecute(e,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),!1!==s.returnValue):(this._signal("commandUnavailable",s),!1)},t.prototype.canExecute=function(e,t){return"string"==typeof e&&(e=this.commands[e]),!(!e||t&&t.$readOnly&&!e.readOnly||0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))},t}(i);o.implement(l.prototype,r),t.CommandManager=l})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,a){"use strict";var n=e("../lib/lang"),s=e("../config"),o=e("../range").Range;function i(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:i("Ctrl-,","Command-,"),exec:function(e){s.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:i("Alt-E","F4"),exec:function(e){s.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:i("Alt-Shift-E","Shift-F4"),exec:function(e){s.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:i("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:i(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:i("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:i("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:i("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:i("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:i("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:i(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:i("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:i("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:i("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:i("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:i("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:i("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:i("Ctrl-F","Command-F"),exec:function(e){s.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:i("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:i("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:i("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:i("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:i("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:i("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:i("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:i("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:i("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:i("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:i("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:i("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:i("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:i("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:i("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:i("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:i("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:i("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:i("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:i("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:i(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:i("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:i(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:i("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:i("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:i("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:i("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:i("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:i("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:i("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:i(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),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:i("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:i("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:i("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:i("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:i("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:i("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:i("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:i("Ctrl-H","Command-Option-F"),exec:function(e){s.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:i("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:i("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:i("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:i("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:i("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:i("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:i("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:i("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:i("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:i("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:i("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:i("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:i("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:i("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:i("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:i("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:i("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:i("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:i("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:i(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:i("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:i("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:i("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:i(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:i("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,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:i("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:i(null,null),exec:function(e){for(var t=e.selection.isBackwards(),a=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),s=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),i=e.session.doc.getLine(a.row).length,r=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(a.row),c=a.row+1;c<=s.row+1;c++){var d=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(c)));0!==d.length&&(d=" "+d),l+=d}s.row+10?(e.selection.moveCursorTo(a.row,a.column),e.selection.selectTo(a.row,a.column+r)):(i=e.session.doc.getLine(a.row).length>i?i+1:i,e.selection.moveCursorTo(a.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:i(null,null),exec:function(e){var t=e.session.doc.getLength()-1,a=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,s=[];n.length<1&&(n=[e.selection.getRange()]);for(var i=0;i0||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;for(var t=0;e-t>0||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(null!=e){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusAnnotation=function(e){if(null!=e){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(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e0;)if(e--,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/oop"),o=e("./lib/dom"),i=e("./lib/lang"),r=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,d=e("./mouse/fold_handler").FoldHandler,h=e("./keyboard/keybinding").KeyBinding,g=e("./edit_session").EditSession,p=e("./search").Search,u=e("./range").Range,m=e("./lib/event_emitter").EventEmitter,v=e("./commands/command_manager").CommandManager,f=e("./commands/default_commands").commands,w=e("./config"),b=e("./token_iterator").TokenIterator,y=e("./keyboard/gutter_handler").GutterKeyboardHandler,x=e("./config").nls,k=e("./clipboard"),M=e("./lib/keys"),C=e("./lib/event"),z=e("./tooltip").HoverTooltip,E=function(){function e(t,a,n){this.session,this.$toDestroy=[];var s=t.getContainerElement();this.container=s,this.renderer=t,this.id="editor"+ ++e.$uid,this.commands=new v(r.isMac?"mac":"win",f),"object"==typeof document&&(this.textInput=new l(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new d(this)),this.keyBinding=new h(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=i.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(a||n&&n.session||new g("")),w.resetOptions(this),n&&this.setOptions(n),w._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},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,e||(this.previousCommand=null)},e.prototype.onEndOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue)return void(this.curOp=null);if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,a=t&&t.scrollIntoView;if(a){switch(a){case"center-animate":a="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),s=this.renderer.layerConfig;(n.start.row>=s.lastRow||n.end.row<=s.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==a&&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){var t=this.prevOp,a=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var s=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(s)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==a.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==a.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var a=this;w.loadModule(["keybinding",e],(function(n){a.$keybindingId==e&&a.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){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 a=this.session.getSelection();a.off("changeCursor",this.$onCursorChange),a.off("changeSelection",this.$onSelectionChange)}this.session=e,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()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),t&&(t.$editor=null),e&&e._signal("changeEditor",{editor:this}),e&&(e.$editor=this),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),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){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&!t.destroyed){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var a=e.getCursorPosition(),n=e.getKeyboardHandler(),s=n&&n.$getDirectionForHighlight&&n.$getDirectionForHighlight(e),o=t.getMatchingBracketRanges(a,s);if(!o){var i=new b(t,a.row,a.column).getCurrentToken();if(i&&/\b(?:tag-open|tag-name)/.test(i.type)){var r=t.getMatchingTags(a);r&&(o=[r.openTagName.isEmpty()?r.openTag:r.openTagName,r.closeTagName.isEmpty()?r.closeTag:r.closeTagName])}}if(!o&&t.$mode.getMatching&&(o=t.$mode.getMatching(e.session)),o){var l="ace_bracket";Array.isArray(o)?1==o.length&&(l="ace_error_bracket"):o=[o],2==o.length&&(0==u.comparePoints(o[0].end,o[1].start)?o=[u.fromPoints(o[0].start,o[1].end)]:0==u.comparePoints(o[0].start,o[1].end)&&(o=[u.fromPoints(o[1].start,o[0].end)])),t.$bracketHighlight={ranges:o,markerIds:o.map((function(e){return t.addMarker(e,l,"text")}))},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}else 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){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,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,a=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,a,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,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var a=new u(e.row,e.column,e.row,1/0);a.id=t.addMarker(a,"ace_active-line","screenLine"),t.$highlightLineMarker=a}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var a=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(a,"ace_selection",n)}var s=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(s),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var a=t.start.column,n=t.end.column,s=e.getLine(t.start.row),o=s.substring(a,n);if(!(o.length>5e3)&&/[\w\d]/.test(o)){var i=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o}),r=s.substring(a-1,n+1);if(i.test(r))return i}}},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(!0)},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(),t=this.session.doc.getNewLineCharacter(),a=!1;if(!e&&this.$copyWithEmptySelection){a=!0;for(var n=this.selection.getAllRanges(),s=0;sr.search(/\S|$/)){var l=r.substr(s.column).search(/\S|$/);a.doc.removeInLine(s.row,s.column,s.column+l)}}this.clearSelection();var c=s.column,d=a.getState(s.row),h=(r=a.getLine(s.row),n.checkOutdent(d,r,e));if(a.insert(s,e),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new u(s.row,c+o.selection[0],s.row,c+o.selection[1])):this.selection.setSelectionRange(new u(s.row+o.selection[0],o.selection[1],s.row+o.selection[2],o.selection[3]))),this.$enableAutoIndent){if(a.getDocument().isNewLine(e)){var g=n.getNextLineIndent(d,r.slice(0,s.column),a.getTabString());a.insert({row:s.row+1,column:0},g)}h&&n.autoOutdent(d,a,s.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),a=this.selection.isEmpty()?[new u(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),n="",s="",o="",i=e.getTabString(),r=0;r0&&(n=e.getState(d-1),s=e.getLine(d-1),o=t.getNextLineIndent(n,s,i));var h=e.getLine(d),g=t.$getIndent(h);if(o!==g){if(g.length>0){var p=new u(d,0,d,g.length);e.remove(p)}o.length>0&&e.insert({row:d,column:0},o)}t.autoOutdent(n,e,d)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var a=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(a):a(),this.endOperation()},e.prototype.applyComposition=function(e,t){var a;(t.extendLeft||t.extendRight)&&((a=this.selection.getRange()).start.column-=t.extendLeft,a.end.column+=t.extendRight,a.start.column<0&&(a.start.row--,a.start.column+=this.session.getLine(a.start.row).length+1),this.selection.setRange(a),e||a.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((a=this.selection.getRange()).start.column-=t.restoreStart,a.end.column-=t.restoreEnd,this.selection.setRange(a))},e.prototype.onCommandKey=function(e,t,a){return this.keyBinding.onCommandKey(e,t,a)},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){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var a=this.session,n=a.getState(t.start.row),s=a.getMode().transformAction(n,"deletion",this,a,t);if(0===t.end.column){var o=a.getTextRange(t);if("\n"==o[o.length-1]){var i=a.getLine(t.end.row);/^\s+$/.test(i)&&(t.end.column=i.length)}}s&&(t=s)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();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(){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()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var a,n,s=this.session.getLine(e.row);tt.toLowerCase()?1:0}));var s=new u(0,0,0,0);for(n=e.first;n<=e.last;n++){var o=t.getLine(n);s.start.row=n,s.end.row=n,s.end.column=o.length,t.replace(s,a[n-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),a=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,a,e)},e.prototype.getNumberAt=function(e,t){var a=/[\-]?[0-9]+(?:\.[0-9]+)?/g;a.lastIndex=0;for(var n=this.session.getLine(e);a.lastIndex=t)return{value:s[0],start:s.index,end:s.index+s[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,a=this.selection.getCursor().column,n=new u(t,a-1,t,a),s=this.session.getTextRange(n);if(!isNaN(parseFloat(s))&&isFinite(s)){var o=this.getNumberAt(t,a);if(o){var i=o.value.indexOf(".")>=0?o.start+o.value.indexOf(".")+1:o.end,r=o.start+o.value.length-i,l=parseFloat(o.value);l*=Math.pow(10,r),i!==o.end&&a=r&&o<=l&&(a=t,c.selection.clearSelection(),c.moveCursorTo(e,r+n),c.selection.selectTo(e,l+n)),r=l}));for(var d,h=this.$toggleWordPairs,g=0;g=l&&i<=c&&g.match(/((?:https?|ftp):\/\/[\S]+)/)){r=g.replace(/[\s:.,'";}\]]+$/,"");break}l=c}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}return r},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),null!=t},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,t=this.session,a=e.getRange(),n=e.isBackwards();if(a.isEmpty()){var s=a.start.row;t.duplicateLines(s,s)}else{var o=n?a.start:a.end,i=t.insert(o,t.getTextRange(a));a.start=o,a.end=i,e.setSelectionRange(a,n)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,a){return this.session.moveText(e,t,a)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var a,n,s=this.selection;if(!s.inMultiSelectMode||this.inVirtualSelectionMode){var o=s.toOrientedRange();a=this.$getSelectedRows(o),n=this.session.$moveLines(a.first,a.last,t?0:e),t&&-1==e&&(n=0),o.moveBy(n,0),s.fromOrientedRange(o)}else{var i=s.rangeList.ranges;s.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var r=0,l=0,c=i.length,d=0;dp+1)break;p=u.last}for(d--,r=this.session.$moveLines(g,p,t?0:e),t&&-1==e&&(h=d+1);h<=d;)i[h].moveBy(r,0),h++;t||(r=0),l+=r}s.fromOrientedRange(s.ranges[0]),s.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{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 a=this.renderer,n=this.renderer.layerConfig,s=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(s,0)})):!1===t&&(this.selection.moveCursorBy(s,0),this.selection.clearSelection());var o=a.scrollTop;a.scrollBy(0,s*n.lineHeight),null!=t&&a.scrollCursorIntoView(null,.5),a.animateScrolling(o)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},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,a,n){this.renderer.scrollToLine(e,t,a,n)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),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 a=this.getCursorPosition(),n=new b(this.session,a.row,a.column),s=n.getCurrentToken(),o=0;s&&-1!==s.type.indexOf("tag-name")&&(s=n.stepBackward());var i=s||n.stepForward();if(i){var r,l,c=!1,d={},h=a.column-i.start,g={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(i.value.match(/[{}()\[\]]/g)){for(;h1?d[i.value]++:"=0;--o)this.$tryReplace(a[o],e)&&n++;return this.selection.setSelectionRange(s),n},e.prototype.$tryReplace=function(e,t){var a=this.session.getTextRange(e);return null!==(t=this.$search.replace(a,t))?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,a){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&s.mixin(t,e);var n=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),e=this.session.getTextRange(n)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:n});var o=this.$search.find(this.session);return t.preventScroll?o:o?(this.revealRange(o,a),o):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var a=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(a)},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(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,a=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var s=this.$scrollAnchor;s.style.cssText="position:absolute",this.container.insertBefore(s,this.container.firstChild);var o=this.on("changeSelection",(function(){n=!0})),i=this.renderer.on("beforeRender",(function(){n&&(t=a.renderer.container.getBoundingClientRect())})),r=this.renderer.on("afterRender",(function(){if(n&&t&&(a.isFocused()||a.searchBox&&a.searchBox.isFocused())){var e=a.renderer,o=e.$cursorLayer.$pixelPos,i=e.layerConfig,r=o.top-i.offset;null!=(n=o.top>=0&&r+t.top<0||!(o.topwindow.innerHeight)&&null)&&(s.style.top=r+"px",s.style.left=o.left+"px",s.style.height=i.lineHeight+"px",s.scrollIntoView(n)),n=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",r),this.renderer.off("beforeRender",i))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},e.prototype.prompt=function(e,t,a){var n=this;w.loadModule("ace/ext/prompt",(function(s){s.prompt(n,e,t,a)}))},e}();E.$uid=0,E.prototype.curOp=null,E.prototype.prevOp={},E.prototype.$mergeableCommands=["backspace","del","insertstring"],E.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"],["&&","||"],["==","!="]],s.implement(E.prototype,m),w.defineOptions(E.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){var t=this;this.textInput.setReadOnly(e),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(e){var a=!1;if(e&&"keydown"==e.type){if(!(a=e&&e.key&&1==e.key.length&&!e.ctrlKey&&!e.metaKey))return}else e&&"exec"!==e.type&&(a=!0);if(a){t.hoverTooltip||(t.hoverTooltip=new z);var n=o.createElement("div");n.textContent=x("editor.tooltip.disable-editing","Editing is disabled"),t.hoverTooltip.isOpen||t.hoverTooltip.showForRange(t,t.getSelectionRange(),n)}else t.hoverTooltip&&t.hoverTooltip.isOpen&&t.hoverTooltip.hide()});var a=this.textInput.getElement();e?(C.addListener(a,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(C.removeListener(a,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?_.attach(this):_.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?_.attach(this):_.detach(this)}},placeholder:{set:function(e){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)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{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)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t,a={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:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===M.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(r.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",x("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",x("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",n.bind(this)),this.commands.addCommand(a),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",x("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",x("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),t||(t=new y(this)),t.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",n.bind(this)),this.commands.removeCommand(a),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),t&&t.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(e){this.$textInputAriaLabel=e},initialValue:""},enableMobileMenu:{set:function(e){this.$enableMobileMenu=e},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var _={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,a){return Math.max(t.toString().length,(a.lastRow+1).toString().length,2)*a.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){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=E})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return 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,a){var n=t.firstRowScreen*t.lineHeight,s=Math.floor(n/this.canvasHeight);return a.documentToScreenRow(e,0)*t.lineHeight-s*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,a){return t.lineHeight*a.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);for(var t=n.createFragment(this.element),a=0;ao&&(l=s.end.row+1,o=(s=t.getNextFoldLine(l,s))?s.start.row:1/0),l>n){for(;this.$lines.getLength()>r+1;)this.$lines.pop();break}(i=this.$lines.get(++r))?i.row=l:(i=this.$lines.createCell(l,e,this.session,d),this.$lines.push(i)),this.$renderCell(i,e,s,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,a=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,s=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(s=t.getLength()+n-1);var o=a?a.getWidth(t,s,e):s.toString().length*e.characterWidth,i=this.$padding||this.$computePadding();(o+=i.left+i.right)===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){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var a=0;a=this.$cursorRow){if(n.row>this.$cursorRow){var s=this.session.getFoldLine(this.$cursorRow);if(!(a>0&&s&&s.start.row==t[a-1].row))break;n=t[a-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var a=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=a,!t||n0;s--)this.$lines.shift();if(n>a)for(s=this.session.getFoldedRowCount(a+1,n);s>0;s--)this.$lines.pop();e.firstRown&&this.$lines.push(this.$renderLines(e,n+1,a)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,a){for(var n=[],s=t,o=this.session.getNextFoldLine(s),i=o?o.start.row:1/0;s>i&&(s=o.end.row+1,i=(o=this.session.getNextFoldLine(s,o))?o.start.row:1/0),!(s>a);){var r=this.$lines.createCell(s,e,this.session,d);this.$renderCell(r,e,o,s),n.push(r),s++}return n},e.prototype.$renderCell=function(e,t,a,s){var o=e.element,i=this.session,r=o.childNodes[0],c=o.childNodes[1],d=o.childNodes[2],h=d.firstChild,g=i.$firstLineNumber,p=i.$breakpoints,u=i.$decorations,m=i.gutterRenderer||this.$renderer,v=this.$showFoldWidgets&&i.foldWidgets,f=a?a.start.row:Number.MAX_VALUE,w=t.lineHeight+"px",b=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",y=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",x=(m?m.getText(i,s):s+g).toString();if(this.$highlightGutterLine&&(s==this.$cursorRow||a&&s=f&&this.$cursorRow<=a.end.row)&&(b+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),p[s]&&(b+=p[s]),u[s]&&(b+=u[s]),this.$annotations[s]&&s!==f&&(b+=this.$annotations[s].className),v){var k=v[s];null==k&&(k=v[s]=i.getFoldWidget(s))}if(k){var M="ace_fold-widget ace_"+k,C="start"==k&&s==f&&sa.right-t.right?"foldWidgets":void 0},e}();function d(e){var t=document.createTextNode("");e.appendChild(t);var a=n.createElement("span");e.appendChild(a);var s=n.createElement("span");e.appendChild(s);var o=n.createElement("span");return s.appendChild(o),e}c.prototype.$fixedWidth=!1,c.prototype.$highlightGutterLine=!0,c.prototype.$renderer="",c.prototype.$showLineNumbers=!0,c.prototype.$showFoldWidgets=!0,s.implement(c.prototype,i),t.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../range").Range,s=e("../lib/dom"),o=function(){function e(e){this.element=s.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return 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 a=-1!=this.i&&this.element.childNodes[this.i];a?this.i++:(a=document.createElement("div"),this.element.appendChild(a),this.i=-1),a.style.cssText=t,a.className=e},e.prototype.update=function(e){if(e){var t;for(var a in this.config=e,this.i=0,this.markers){var n=this.markers[a];if(n.range){var s=n.range.clipRows(e.firstRow,e.lastRow);if(!s.isEmpty())if(s=s.toScreenRange(this.session),n.renderer){var o=this.$getTop(s.start.row,e),i=this.$padding+s.start.column*e.characterWidth;n.renderer(t,s,i,o,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,s,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,s,n.clazz,e):s.isMultiLine()?"text"==n.type?this.drawTextMarker(t,s,n.clazz,e):this.drawMultiLineMarker(t,s,n.clazz,e):this.drawSingleLineMarker(t,s,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.ig?4:0)|(c==l?8:0)),s,c==l?0:1,o)},e.prototype.drawMultiLineMarker=function(e,t,a,n,s){var o=this.$padding,i=n.lineHeight,r=this.$getTop(t.start.row,n),l=o+t.start.column*n.characterWidth;if(s=s||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,a+" ace_br1 ace_start",n,null,s)):this.elt(a+" ace_br1 ace_start","height:"+i+"px;right:"+o+"px;top:"+r+"px;left:"+l+"px;"+(s||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,a+" ace_br12",n,null,s)}else{r=this.$getTop(t.end.row,n);var d=t.end.column*n.characterWidth;this.elt(a+" ace_br12","height:"+i+"px;width:"+d+"px;top:"+r+"px;left:"+o+"px;"+(s||""))}if(!((i=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){r=this.$getTop(t.start.row+1,n);var h=(t.start.column?1:0)|(t.end.column?0:8);this.elt(a+(h?" ace_br"+h:""),"height:"+i+"px;right:"+o+"px;top:"+r+"px;left:"+o+"px;"+(s||""))}},e.prototype.drawSingleLineMarker=function(e,t,a,n,s,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,a,n,s,o);var i=n.lineHeight,r=(t.end.column+(s||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),c=this.$padding+t.start.column*n.characterWidth;this.elt(a,"height:"+i+"px;width:"+r+"px;top:"+l+"px;left:"+c+"px;"+(o||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,a,n,s,o){var i=n.lineHeight,r=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(a,"height:"+i+"px;width:"+(e.width+(s||0))+"px;top:"+r+"px;left:"+(l+e.left)+"px;"+(o||""))}),this)},e.prototype.drawFullLineMarker=function(e,t,a,n,s){var o=this.$getTop(t.start.row,n),i=n.lineHeight;t.start.row!=t.end.row&&(i+=this.$getTop(t.end.row,n)-o),this.elt(a,"height:"+i+"px;top:"+o+"px;left:0;right:0;"+(s||""))},e.prototype.drawScreenLineMarker=function(e,t,a,n,s){var o=this.$getTop(t.start.row,n),i=n.lineHeight;this.elt(a,"height:"+i+"px;top:"+o+"px;left:0;right:0;"+(s||""))},e}();o.prototype.$padding=0,t.Marker=o})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,a){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,a){"use strict";var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),i=e("./lines").Lines,r=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken,d=function(){function e(e){this.dom=s,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 i(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},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,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],a=1;ad&&(r=l.end.row+1,d=(l=this.session.getNextFoldLine(r,l))?l.start.row:1/0),!(r>s);){var h=o[i++];if(h){this.dom.removeChildren(h),this.$renderLine(h,r,r==d&&l),c&&(h.style.top=this.$lines.computeLineTop(r,e,this.session)+"px");var g=e.lineHeight*this.session.getRowLength(r)+"px";h.style.height!=g&&(c=!0,h.style.height=g)}r++}if(c)for(;i0;s--)this.$lines.shift();if(t.lastRow>e.lastRow)for(s=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);s>0;s--)this.$lines.pop();e.firstRowt.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,a){for(var n=[],o=t,i=this.session.getNextFoldLine(o),r=i?i.start.row:1/0;o>r&&(o=i.end.row+1,r=(i=this.session.getNextFoldLine(o,i))?i.start.row:1/0),!(o>a);){var l=this.$lines.createCell(o,e,this.session),c=l.element;this.dom.removeChildren(c),s.setStyle(c.style,"height",this.$lines.computeLineHeight(o,e,this.session)+"px"),s.setStyle(c.style,"top",this.$lines.computeLineTop(o,e,this.session)+"px"),this.$renderLine(c,o,o==r&&i),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",n.push(l),o++}return n},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,a=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,a))},e.prototype.$renderToken=function(e,t,a,n){for(var s,i=this,r=/(\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,d=this.dom.createFragment(this.element),h=0;s=r.exec(n);){var g=s[1],p=s[2],u=s[3],m=s[4],v=s[5];if(i.showSpaces||!p){var f=h!=s.index?n.slice(h,s.index):"";if(h=s.index+s[0].length,f&&d.appendChild(this.dom.createTextNode(f,this.element)),g){var w=i.session.getScreenTabSize(t+s.index);d.appendChild(i.$tabStrings[w].cloneNode(!0)),t+=w-1}else p?i.showSpaces?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",y.textContent=o.stringRepeat(i.SPACE_CHAR,p.length),d.appendChild(y)):d.appendChild(this.dom.createTextNode(p,this.element)):u?((y=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",y.textContent=o.stringRepeat(i.SPACE_CHAR,u.length),d.appendChild(y)):m?(t+=1,(y=this.dom.createElement("span")).style.width=2*i.config.characterWidth+"px",y.className=i.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",y.textContent=i.showSpaces?i.SPACE_CHAR:m,d.appendChild(y)):v&&(t+=1,(y=this.dom.createElement("span")).style.width=2*i.config.characterWidth+"px",y.className="ace_cjk",y.textContent=v,d.appendChild(y))}}if(d.appendChild(this.dom.createTextNode(h?n.slice(h):n,this.element)),c(a.type))e.appendChild(d);else{var b="ace_"+a.type.replace(/\./g," ace_"),y=this.dom.createElement("span");"fold"==a.type&&(y.style.width=a.value.length*this.config.characterWidth+"px",y.setAttribute("title",l("inline-fold.closed.title","Unfold code"))),y.className=b,y.appendChild(d),e.appendChild(y)}return t+n.length},e.prototype.renderIndentGuide=function(e,t,a){var n=t.search(this.$indentGuideRe);if(n<=0||n>=a)return t;if(" "==t[0]){for(var s=(n-=n%this.tabSize)/this.tabSize,o=0;os[o].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length)for(this.$highlightIndentGuideMarker.dir=1,o=t.row+1;o0))return;a=e.element.childNodes[0]}var n=a.childNodes;if(n){var s=n[t-1];s&&s.classList&&s.classList.contains("ace_indent-guide")&&s.classList.add("ace_indent-guide-active")}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var a=0;a=this.$highlightIndentGuideMarker.start+1){if(n.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}else for(a=e.length-1;a>=0;a--)if(n=e[a],this.$highlightIndentGuideMarker.end&&n.row=i;)r=this.$renderToken(l,r,d,h.substring(0,i-n)),h=h.substring(i-n),n=i,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(o.stringRepeat(" ",a.indent),this.element)),r=0,i=a[++s]||Number.MAX_VALUE;0!=h.length&&(n+=h.length,r=this.$renderToken(l,r,d,h))}}a[a.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,r,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){for(var a=0,n=0;nthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,a,s,o);a=this.$renderToken(e,a,s,o)}}},e.prototype.$renderOverflowMessage=function(e,t,a,n,s){a&&this.$renderToken(e,t,a,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=s?"":"",e.appendChild(o)},e.prototype.$renderLine=function(e,t,a){if(a||0==a||(a=this.session.getFoldLine(t)),a)var n=this.$getFoldLineTokens(t,a);else n=this.session.getTokens(t);var s=e;if(n.length){var o=this.session.getRowSplitData(t);o&&o.length?(this.$renderWrappedLine(e,n,o),s=e.lastChild):(s=e,this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s)),this.$renderSimpleLine(s,n))}else this.$useLineGroups()&&(s=this.$createLineElement(),e.appendChild(s));if(this.showEOL&&s){a&&(t=a.end.row);var i=this.dom.createElement("span");i.className="ace_invisible ace_invisible_eol",i.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,s.appendChild(i)}},e.prototype.$getFoldLineTokens=function(e,t){var a=this.session,n=[],s=a.getTokens(e);return t.walk((function(e,t,o,i,r){null!=e?n.push({type:"fold",value:e}):(r&&(s=a.getTokens(t)),s.length&&function(e,t,a){for(var s=0,o=0;o+e[s].value.lengtha-t&&(i=i.substring(0,a-t)),n.push({type:e[s].type,value:i}),o=t+i.length,s+=1);oa?n.push({type:e[s].type,value:i.substring(0,a-o)}):n.push(e[s]),o+=i.length,s+=1}}(s,i,o))}),t.end.row,this.session.getLine(t.end.row).length),n},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();d.prototype.EOF_CHAR="¶",d.prototype.EOL_CHAR_LF="¬",d.prototype.EOL_CHAR_CRLF="¤",d.prototype.EOL_CHAR=d.prototype.EOL_CHAR_LF,d.prototype.TAB_CHAR="—",d.prototype.SPACE_CHAR="·",d.prototype.$padding=0,d.prototype.MAX_LINE_LENGTH=1e4,d.prototype.showInvisibles=!1,d.prototype.showSpaces=!1,d.prototype.showTabs=!1,d.prototype.showEOL=!1,d.prototype.displayIndentGuides=!0,d.prototype.$highlightIndentGuides=!0,d.prototype.$tabStrings=[],d.prototype.destroy={},d.prototype.onChangeTabSize=d.prototype.$computeTabString,n.implement(d.prototype,r),t.Text=d})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=function(){function e(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,a=t.length;a--;)n.setStyle(t[a].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,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){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,n.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var a=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(a.row,e.row)?this.session.$bidiHandler.getPosLeft(a.column):a.column*this.config.characterWidth),top:(a.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.tope.height+e.offset||i.top<0)&&a>1)){var r=this.cursors[s++]||this.addCursor(),l=r.style;this.drawCursor?this.drawCursor(r,i,e,t[a],this.session):this.isCursorInView(i,e)?(n.setStyle(l,"display","block"),n.translate(r,i.left,i.top),n.setStyle(l,"width",Math.round(e.characterWidth)+"px"),n.setStyle(l,"height",e.lineHeight+"px")):n.setStyle(l,"display","none")}}for(;this.cursors.length>s;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=i,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();s.prototype.$padding=0,s.prototype.drawCursor=null,t.Cursor=s})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("./lib/oop"),i=e("./lib/dom"),r=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter,c=32768,d=function(){function e(e,t){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addListener(this.element,"scroll",this.onScroll.bind(this)),r.addListener(this.element,"mousedown",r.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();o.implement(d.prototype,l);var h=function(e){function t(t,a){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,a.$scrollbarWidth=n.width=i.scrollbarWidth(t.ownerDocument),n.inner.style.width=n.element.style.width=(n.width||15)+5+"px",n.$minWidth=0,n}return s(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},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,e>c?(this.coeff=c/e,e=c):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(d);h.prototype.setInnerHeight=h.prototype.setScrollHeight;var g=function(e){function t(t,a){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.height=a.$scrollbarWidth,n.inner.style.height=n.element.style.height=(n.height||15)+5+"px",n}return s(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},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){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(d);t.ScrollBar=h,t.ScrollBarV=h,t.ScrollBarH=g,t.VScrollBar=h,t.HScrollBar=g})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,a){"use strict";var n,s=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}),o=e("./lib/oop"),i=e("./lib/dom"),r=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter;i.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",!1);var c=function(){function e(e,t){this.element=i.createElement("div"),this.element.className="ace_sb"+t,this.inner=i.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,r.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();o.implement(c.prototype,l);var d=function(e){function t(t,a){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,n.parent=t,n.width=n.VScrollWidth,n.renderer=a,n.inner.style.width=n.element.style.width=(n.width||15)+"px",n.$minWidth=0,n}return s(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===r.getButton(t)&&2!==t.detail){if(t.target===this.inner){var a=this,n=t.clientY,s=t.clientY,o=this.thumbTop;r.capture(this.inner,(function(e){n=e.clientY}),(function(){clearInterval(i)}));var i=setInterval((function(){if(void 0!==n){var e=a.scrollTopFromThumbTop(o+n-s);e!==a.scrollTop&&a._emit("scroll",{data:e})}}),20);return r.preventDefault(t)}var l=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(l)}),r.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);return(t|=0)<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),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,!0)},t.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(c);d.prototype.setInnerHeight=d.prototype.setScrollHeight;var h=function(e){function t(t,a){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.scrollWidth=0,n.height=n.HScrollHeight,n.inner.style.height=n.element.style.height=(n.height||12)+"px",n.renderer=a,n}return s(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===r.getButton(t)&&2!==t.detail){if(t.target===this.inner){var a=this,n=t.clientX,s=t.clientX,o=this.thumbLeft;r.capture(this.inner,(function(e){n=e.clientX}),(function(){clearInterval(i)}));var i=setInterval((function(){if(void 0!==n){var e=a.scrollLeftFromThumbLeft(o+n-s);e!==a.scrollLeft&&a._emit("scroll",{data:e})}}),20);return r.preventDefault(t)}var l=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(l)}),r.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);return(t|=0)<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),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,!0)},t.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(c);h.prototype.setInnerWidth=h.prototype.setScrollWidth,t.ScrollBar=d,t.ScrollBarV=d,t.ScrollBarH=h,t.VScrollBar=d,t.HScrollBar=h})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,a){"use strict";var n=e("./lib/event"),s=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var a=this;this._flush=function(e){a.pending=!1;var t=a.changes;if(t&&(n.blockIdle(100),a.changes=0,a.onRender(t)),a.changes){if(a.$recursionLimit--<0)return;a.schedule()}else a.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=s})),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,a){var n=e("../lib/oop"),s=e("../lib/dom"),o=e("../lib/lang"),i=e("../lib/event"),r=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=512,d="function"==typeof ResizeObserver,h=200,g=function(){function e(e){this.el=s.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=s.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=s.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},d?this.$addObserver():this.checkForSizeChanges()}return 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",r.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),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=i.onIdle((function t(){e.checkForSizeChanges(),i.onIdle(t,500)}),500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():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};return 0===t.width||0===t.height?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=o.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return e&&e.parentElement?(Number(window.getComputedStyle(e).zoom)||1)*this.$getZoom(e.parentElement):1},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=s.buildDom([e(0,0),e(h,0),e(0,h),e(h,h)],this.el)},e.prototype.transformCoordinates=function(e,t){function a(e,t,a){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*a[0]+t[0]*a[1])/n,(+e[1]*a[0]-e[0]*a[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function s(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function i(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=o(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var r=i(this.els[0]),l=i(this.els[1]),c=i(this.els[2]),d=i(this.els[3]),g=a(n(d,l),n(d,c),n(s(l,c),s(d,r))),p=o(1+g[0],n(l,r)),u=o(1+g[1],n(c,r));if(t){var m=t,v=g[0]*m[0]/h+g[1]*m[1]/h+1,f=s(o(m[0],p),o(m[1],u));return s(o(1/v/h,f),r)}var w=n(e,r),b=a(n(p,o(g[0],w)),n(u,o(g[1],w)),w);return o(h,b)},e}();g.prototype.$characterSize={width:0,height:0},n.implement(g.prototype,l),t.FontMetrics=g})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,a){a.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.ace_invisible {\n font-variant-ligatures: none;\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   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 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(33em, 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,a){"use strict";var n=e("../lib/dom"),s=e("../lib/oop"),o=e("../lib/event_emitter").EventEmitter,i=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="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return e.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light;e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeightt.priority?1:0}));for(var o=this.renderer.session.$foldData,i=0;ithis.canvasHeight&&(g=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(g-this.halfMinDecorationHeight),h=Math.round(g+this.halfMinDecorationHeight)}a.fillStyle=t[n[i].type]||null,a.fillRect(0,c,this.canvasWidth,h-d)}}var p=this.renderer.session.selection.getCursor();p&&(l=this.compensateFoldRows(p.row,o),c=Math.round((p.row-l)*this.lineHeight*this.heightRatio),a.fillStyle="rgba(0, 0, 0, 0.5)",a.fillRect(0,c,this.canvasWidth,2))},e.prototype.compensateFoldRows=function(e,t){var a=0;if(t&&t.length>0)for(var n=0;nt[n].start.row&&e=t[n].end.row&&(a+=t[n].end.row-t[n].start.row);return a},e}();s.implement(i.prototype,o),t.Decorator=i})),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,a){"use strict";var n=e("./lib/oop"),s=e("./lib/dom"),o=e("./lib/lang"),i=e("./config"),r=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,d=e("./layer/cursor").Cursor,h=e("./scrollbar").HScrollBar,g=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,u=e("./scrollbar_custom").VScrollBar,m=e("./renderloop").RenderLoop,v=e("./layer/font_metrics").FontMetrics,f=e("./lib/event_emitter").EventEmitter,w=e("./css/editor-css"),b=e("./layer/decorators").Decorator,y=e("./lib/useragent"),x=e("./layer/text_util").isTextToken;s.importCssString(w,"ace_editor.css",!1);var k=function(){function e(e,t){var a=this;this.container=e||s.createElement("div"),s.addCssClass(this.container,"ace_editor"),s.HI_DPI&&s.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==i.get("useStrictCSP")&&i.set("useStrictCSP",!1),this.$gutter=s.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=s.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=s.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new r(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 d(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new g(this.container,this),this.scrollBarH=new h(this.container,this),this.scrollBarV.on("scroll",(function(e){a.$scrollAnimation||a.session.setScrollTop(e.data-a.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){a.$scrollAnimation||a.session.setScrollLeft(e.data-a.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new v(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){a.updateCharacterSize(),a.onResize(!0,a.gutterWidth,a.$size.width,a.$size.height),a._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!y.isIOS,this.$loop=new m(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),i.resetOptions(this),i._signal("renderer",this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),s.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},e.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,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),e&&(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,a){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow||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){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,a,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var s=this.container;n||(n=s.clientHeight||s.scrollHeight),!n&&this.$maxLines&&this.lineHeight>1&&(s.style.height&&"0px"!=s.style.height||(s.style.height="1px",n=s.clientHeight||s.scrollHeight)),a||(a=s.clientWidth||s.scrollWidth);var o=this.$updateCachedSize(e,t,a,n);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!a&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(o|this.$changes,!0):this.$loop.schedule(o|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,a,n){n-=this.$extraHeight||0;var o=0,i=this.$size,r={width:i.width,height:i.height,scrollerHeight:i.scrollerHeight,scrollerWidth:i.scrollerWidth};if(n&&(e||i.height!=n)&&(i.height=n,o|=this.CHANGE_SIZE,i.scrollerHeight=i.height,this.$horizScroll&&(i.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(i.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",o|=this.CHANGE_SCROLL),a&&(e||i.width!=a)){o|=this.CHANGE_SIZE,i.width=a,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,s.setStyle(this.scrollBarH.element.style,"left",t+"px"),s.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),i.scrollerWidth=Math.max(0,a-t-this.scrollBarV.getWidth()-this.margin.h),s.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";s.setStyle(this.scrollBarH.element.style,"right",l),s.setStyle(this.scroller.style,"right",l),s.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(i.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(o|=this.CHANGE_FULL)}return i.$dirty=!a||!n,o&&this._signal("resize",r),o},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,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){if(!this.$printMarginEl){var e=s.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=s.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",this.session&&-1==this.session.$wrap&&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){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var a=this.$cursorLayer.$pixelPos;if(a){t&&t.markerRange&&(a=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var n=this.layerConfig,o=a.top,i=a.left;o-=n.offset;var r=t&&t.useTextareaForIME||y.isMobile?this.lineHeight:1;if(o<0||o>n.height-r)s.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-r;if(t)if(t.useTextareaForIME){var d=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(d)[0]}else o+=this.lineHeight+2;else o+=this.lineHeight;(i-=this.scrollLeft)>this.$size.scrollerWidth-l&&(i=this.$size.scrollerWidth-l),i+=this.gutterWidth+this.margin.left,s.setStyle(e,"height",r+"px"),s.setStyle(e,"width",l+"px"),s.translate(this.textarea,Math.min(i,this.$size.scrollerWidth-l),Math.min(o,c))}}}else s.translate(this.textarea,-100,0)}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1: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,a,n){var s=this.scrollMargin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|a,s.v=s.top+s.bottom,s.h=s.left+s.right,s.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-s.top),this.updateFull()},e.prototype.setMargin=function(e,t,a,n){var s=this.margin;s.top=0|e,s.bottom=0|t,s.right=0|n,s.left=0|a,s.v=s.top+s.bottom,s.h=s.left+s.right,this.$updateCachedSize(!0,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,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,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=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var a=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){if(e|=this.$computeLayerConfig()|this.$loop.clear(),a.firstRow!=this.layerConfig.firstRow&&a.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(a.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}a=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),s.translate(this.content,-this.scrollLeft,-a.offset);var o=a.width+2*this.$padding+"px",i=a.minHeight+"px";s.setStyle(this.content.style,"width",o),s.setStyle(this.content.style,"height",i)}if(e&this.CHANGE_H_SCROLL&&(s.translate(this.content,-this.scrollLeft,-a.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(a):this.$textLayer.scrollLines(a),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(a):this.$gutterLayer.scrollLines(a)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a),this.$markerBack.update(a),this.$markerFront.update(a),this.$cursorLayer.update(a),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(a),this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(a),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(a)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(a),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(a),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(a),this._signal("afterRender",e)}else this.$changes|=e},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,a=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(a+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&a>this.$maxPixelHeight&&(a=this.$maxPixelHeight);var n=!(a<=2*this.lineHeight)&&e>t;if(a!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var s=this.container.clientWidth;this.container.style.height=a+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,a),this.desiredHeight=a,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,a=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),o=!a&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-s-2*this.$padding<0),i=this.$horizScroll!==o;i&&(this.$horizScroll=o,this.scrollBarH.setVisible(o));var r=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),a=t.height<=2*this.lineHeight);var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=c;var d=this.scrollMargin;this.session.setScrollTop(Math.max(-d.top,Math.min(this.scrollTop,n-t.scrollerHeight+d.bottom))),this.session.setScrollLeft(Math.max(-d.left,Math.min(this.scrollLeft,s+2*this.$padding-t.scrollerWidth+d.right)));var h=!a&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+c<0||this.scrollTop>d.top),g=r!==h;g&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var p,u,m=this.scrollTop%this.lineHeight,v=Math.ceil(l/this.lineHeight)-1,f=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),w=f+v,b=this.lineHeight;f=e.screenToDocumentRow(f,0);var y=e.getFoldLine(f);y&&(f=y.start.row),p=e.documentToScreenRow(f,0),u=e.getRowLength(f)*b,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*b+u,m=this.scrollTop-p*b;var x=0;return(this.layerConfig.width!=s||i)&&(x=this.CHANGE_H_SCROLL),(i||g)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),g&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:f,firstRowScreen:p,lastRow:w,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:b?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),x},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var a=this.layerConfig;if(!(e>a.lastRow+1||tthis.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),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,a){this.scrollCursorIntoView(e,a),this.scrollCursorIntoView(t,a)},e.prototype.scrollCursorIntoView=function(e,t,a){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),s=n.left,o=n.top,i=a&&a.top||0,r=a&&a.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+i>o?(t&&l+i>o+this.lineHeight&&(o-=t*this.$size.scrollerHeight),0===o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):l+this.$size.scrollerHeight-r=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},e.prototype.pixelToScreenCoordinates=function(e,t){var a;if(this.$hasCssTransforms){a={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else a=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-a.left-this.$padding,o=s/this.characterWidth,i=Math.floor((t+this.scrollTop-a.top)/this.lineHeight),r=this.$blockCursor?Math.floor(o):Math.round(o);return{row:i,column:r,side:o-r>0?1:-1,offsetX:s}},e.prototype.screenToTextCoordinates=function(e,t){var a;if(this.$hasCssTransforms){a={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else a=this.scroller.getBoundingClientRect();var s=e+this.scrollLeft-a.left-this.$padding,o=s/this.characterWidth,i=this.$blockCursor?Math.floor(o):Math.round(o),r=Math.floor((t+this.scrollTop-a.top)/this.lineHeight);return this.session.screenToDocumentPosition(r,Math.max(i,0),s)},e.prototype.textToScreenCoordinates=function(e,t){var a=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),s=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),o=n.row*this.lineHeight;return{pageX:a.left+s-this.scrollLeft,pageY:a.top+o-this.scrollTop}},e.prototype.visualizeFocus=function(){s.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){s.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(s.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):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){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),s.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 a=this.session.selection.cursor,n=t||{row:a.row,column:a.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 i=s.createElement("div");if(o.length>1){var r,l=this.hideTokensAfterPosition(n.row,n.column);o.slice(1).forEach((function(e){var t=s.createElement("div"),a=s.createElement("span");a.className="ace_ghost_text",e.wrapped&&(t.className="ghost_text_line_wrapped"),0===e.text.length&&(e.text=" "),a.appendChild(s.createTextNode(e.text)),t.appendChild(a),i.appendChild(t),r=t})),l.forEach((function(e){var t=s.createElement("span");x(e.type)||(t.className="ace_"+e.type.replace(/\./g," ace_")),t.appendChild(s.createTextNode(e.value)),r.appendChild(t)})),this.$ghostTextWidget={el:i,row:n.row,column:n.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var c=this.$cursorLayer.getPixelPosition(n,!0),d=this.container.getBoundingClientRect().height,h=o.length*this.lineHeight;if(h0){var c=0;l.push(s[i].length);for(var d=0;d1||Math.abs(e.$size.height-n)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container)}},e}();k.prototype.CHANGE_CURSOR=1,k.prototype.CHANGE_MARKER=2,k.prototype.CHANGE_GUTTER=4,k.prototype.CHANGE_SCROLL=8,k.prototype.CHANGE_LINES=16,k.prototype.CHANGE_TEXT=32,k.prototype.CHANGE_SIZE=64,k.prototype.CHANGE_MARKER_BACK=128,k.prototype.CHANGE_MARKER_FRONT=256,k.prototype.CHANGE_FULL=512,k.prototype.CHANGE_H_SCROLL=1024,k.prototype.$changes=0,k.prototype.$padding=null,k.prototype.$frozen=!1,k.prototype.STEPS=8,n.implement(k.prototype,f),i.defineOptions(k.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(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:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){s.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof 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){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!y.isMobile&&!y.isIE}}),t.VirtualRenderer=k})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,a){"use strict";var n=e("../lib/oop"),s=e("../lib/net"),o=e("../lib/event_emitter").EventEmitter,i=e("../config");function r(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(i.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+s.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var a=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return a.append(t),a.getBlob("application/javascript")}}(e),a=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(a)}return new Worker(e)}var l=function(e){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,a,n,s,o){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),i.get("packaged")||!e.toUrl)s=s||i.moduleUrl(a,"worker");else{var l=this.$normalizePath;s=s||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=r(s),o&&this.send("importScripts",o),this.$worker.postMessage({init:!0,tlns:c,module:a,classname:n}),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 a=this.callbacks[t.id];a&&(a(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)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return s.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,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,a){if(a){var n=this.callbackId++;this.callbacks[n]=a,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,a){var n=null,s=!1,r=Object.create(o),c=[],d=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),n&&(s?setTimeout(h):h())}});d.setEmitSync=function(e){s=e};var h=function(){var e=c.shift();e.command?n[e.command].apply(n,e.args):e.event&&r._signal(e.event,e.data)};return r.postMessage=function(e){d.onMessage({data:e})},r.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},r.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},i.loadModule(["worker",t],(function(e){for(n=new e[a](r);c.length;)h()})),d},t.WorkerClient=l,t.createWorker=r})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,a){"use strict";var n=e("./range").Range,s=e("./lib/event_emitter").EventEmitter,o=e("./lib/oop"),i=function(){function e(e,t,a,n,s,o){var i=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=s,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout((function(){i.onCursorChange()}))},this.$pos=a;var r=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=r.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,a=this.session;this.selectionBefore=a.selection.toJSON(),a.selection.inMultiSelectMode&&a.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=a.addMarker(new n(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(a){var n=t.createAnchor(a.row,a.column);n.$insertRight=!0,n.detach(),e.others.push(n)})),a.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(a){a.markerId=e.addMarker(new n(a.row,a.column,a.row,a.column+t.length),t.othersClass,null,!1)}))}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),s&&(this.length+=a),s&&!this.session.$fromUndo)if("insert"===e.action)for(var i=this.others.length-1;i>=0;i--){var r={row:(l=this.others[i]).row,column:l.column+o};this.doc.insertMergedLines(r,e.lines)}else if("remove"===e.action)for(i=this.others.length-1;i>=0;i--){var l;r={row:(l=this.others[i]).row,column:l.column+o},this.doc.remove(new n(r.row,r.column,r.row,r.column-a))}this.$updating=!1,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){var e=this,t=this.session,a=function(a,s){t.removeMarker(a.markerId),a.markerId=t.addMarker(new n(a.row,a.column,a.row,a.column+e.length),s,null,!1)};a(this.pos,this.mainClass);for(var s=this.others.length;s--;)a(this.others[s],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(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(!0),this.session=null},e.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,a=0;a1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{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:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,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,a){var n=e("./range_list").RangeList,s=e("./range").Range,o=e("./selection").Selection,i=e("./mouse/multi_select_handler").onMouseDown,r=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var d=new(0,e("./search").Search),h=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(h.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var a=this.toOrientedRange();if(this.rangeList.add(a),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(a),this.$onAddRange(a)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();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){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var a=e.length;a--;){var n=this.ranges.indexOf(e[a]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new n,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],a=0;a1){var e=this.rangeList.ranges,t=e[e.length-1],a=s.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(a,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),o=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,o).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,a){var n=[],o=e.column0;)w--;if(w>0)for(var b=0;n[b].isEmpty();)b++;for(var y=w;y>=b;y--)n[y].isEmpty()&&n.splice(y,1)}return n}}.call(o.prototype);var g=e("./editor").Editor;function p(e){e.$multiselectOnSessionChange||(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",i),e.commands.addCommands(c.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),a=!1;r.addListener(t,"keydown",(function(t){var s=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&s?a||(e.renderer.setMouseCursor("crosshair"),a=!0):a&&n()}),e),r.addListener(t,"keyup",n,e),r.addListener(t,"blur",n,e)}function n(t){a&&(e.renderer.setMouseCursor(""),a=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,a=e.length;a--;){var n=e[a];if(n.marker){this.session.removeMarker(n.marker);var s=t.indexOf(n);-1!=s&&t.splice(s,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){this.inMultiSelectMode||(this.inMultiSelectMode=!0,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){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,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,a=e.editor;if(a.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=a.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=a.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(a.exitMultiSelectMode(),n=t.exec(a,e.args||{})):n=t.multiSelectAction(a,e.args||{});else{var n=t.exec(a,e.args||{});a.multiSelect.addRange(a.multiSelect.toOrientedRange()),a.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,a){if(!this.inVirtualSelectionMode){var n,s=a&&a.keepOrder,i=1==a||a&&a.$byLines,r=this.session,l=this.selection,c=l.rangeList,d=(s?l:c).ranges;if(!d.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var h=l._eventRegistry;l._eventRegistry={};var g=new o(r);this.inVirtualSelectionMode=!0;for(var p=d.length;p--;){if(i)for(;p>0&&d[p].start.row==d[p-1].end.row;)p--;g.fromOrientedRange(d[p]),g.index=p,this.selection=r.selection=g;var u=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===u||(n=u),g.toOrientedRange(d[p])}g.detach(),this.selection=r.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=h,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,a=[],n=0;ni&&(i=a.column),nd?e.insert(n,l.stringRepeat(" ",o-d)):e.remove(new s(n.row,n.column,n.row,n.column-o+d)),t.start.column=t.end.column=i,t.start.row=t.end.row=n.row,t.cursor=t.end})),t.fromOrientedRange(a[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var d=this.selection.getRange(),h=d.start.row,g=d.end.row,p=h==g;if(p){var u,m=this.session.getLength();do{u=this.session.getLine(g)}while(/[=:]/.test(u)&&++g0);h<0&&(h=0),g>=m&&(g=m-1)}var v=this.session.removeFullLines(h,g);v=this.$reAlignText(v,p),this.session.insert({row:h,column:0},v.join("\n")+"\n"),p||(d.start.column=0,d.end.column=v[v.length-1].length),this.selection.setRange(d)}},this.$reAlignText=function(e,t){var a,n,s,o=!0,i=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==a?(a=t[1].length,n=t[2].length,s=t[3].length,t):(a+n+s!=t[1].length+t[2].length+t[3].length&&(i=!1),a!=t[1].length&&(o=!1),a>t[1].length&&(a=t[1].length),nt[3].length&&(s=t[3].length),t):[e]})).map(t?c:o?i?function(e){return e[2]?r(a+n-e[2].length)+e[2]+r(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?r(a)+e[2]+r(s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function r(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?r(a)+e[2]+r(n-e[2].length+s)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(g.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var a=e.oldSession;a&&(a.multiSelect.off("addRange",this.$onAddRange),a.multiSelect.off("removeRange",this.$onRemoveRange),a.multiSelect.off("multiSelect",this.$onMultiSelect),a.multiSelect.off("singleSelect",this.$onSingleSelect),a.multiSelect.lead.off("change",this.$checkMultiselectChange),a.multiSelect.anchor.off("change",this.$checkMultiselectChange)),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)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(g.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?this.on("mousedown",i):this.off("mousedown",i)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,a){"use strict";var n=e("../../range").Range,s=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,a){var n=e.getLine(a);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,a){return null},this.indentationBlock=function(e,t,a){var s=/\S/,o=e.getLine(t),i=o.search(s);if(-1!=i){for(var r=a||o.length,l=e.getLength(),c=t,d=t;++tc){var p=e.getLine(d).length;return new n(c,r,d,p)}}},this.openingBracketBlock=function(e,t,a,s,o){var i={row:a,column:s+1},r=e.$findClosingBracket(t,i,o);if(r){var l=e.foldWidgets[r.row];return null==l&&(l=e.getFoldWidget(r.row)),"start"==l&&r.row>i.row&&(r.row--,r.column=e.getLine(r.row).length),n.fromPoints(i,r)}},this.closingBracketBlock=function(e,t,a,s,o){var i={row:a,column:s},r=e.$findOpeningBracket(t,i);if(r)return r.column++,i.column--,n.fromPoints(r,i)}}).call(s.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],(function(e,t,a){"use strict";var n=e("../lib/dom"),s=e("../range").Range,o=e("../config").nls;t.showErrorMarker=function(e,t){var a=e.session,i=e.getCursorPosition(),r=i.row,l=a.widgetManager.getWidgetsAtRow(r).filter((function(e){return"errorMarker"==e.type}))[0];l?l.destroy():r-=t;var c,d=function(e,t,a){var n=e.getAnnotations().sort(s.comparePoints);if(n.length){var o=function(e,t,a){for(var n=0,s=e.length-1;n<=s;){var o=n+s>>1,i=a(t,e[o]);if(i>0)n=o+1;else{if(!(i<0))return o;s=o-1}}return-(n+1)}(n,{row:t,column:-1},s.comparePoints);o<0&&(o=-o-1),o>=n.length?o=a>0?0:n.length-1:0===o&&a<0&&(o=n.length-1);var i=n[o];if(i&&a){if(i.row===t){do{i=n[o+=a]}while(i&&i.row===t);if(!i)return n.slice()}var r=[];t=i.row;do{r[a<0?"unshift":"push"](i),i=n[o+=a]}while(i&&i.row==t);return r.length&&r}}}(a,r,t);if(d){var h=d[0];i.column=(h.pos&&"number"!=typeof h.column?h.pos.sc:h.column)||0,i.row=h.row,c=e.renderer.$gutterLayer.$annotations[i.row]}else{if(l)return;c={displayText:[o("error-marker.good-state","Looks good!")],className:"ace_ok"}}e.session.unfold(i.row),e.selection.moveToPosition(i);var g={row:i.row,fixedWidth:!0,coverGutter:!0,el:n.createElement("div"),type:"errorMarker"},p=g.el.appendChild(n.createElement("div")),u=g.el.appendChild(n.createElement("div"));u.className="error_widget_arrow "+c.className;var m=e.renderer.$cursorLayer.getPixelPosition(i).left;u.style.left=m+e.renderer.gutterWidth-5+"px",g.el.className="error_widget_wrapper",p.className="error_widget "+c.className,c.displayText.forEach((function(e,t){p.appendChild(n.createTextNode(e)),t{var n=a(8258),s=function(e){var t="",a=Object.keys(e);return a.forEach((function(s,o){var i=e[s];(function(e){return/[height|width]$/.test(e)})(s=n(s))&&"number"==typeof i&&(i+="px"),t+=!0===i?s:!1===i?"not "+s:"("+s+": "+i+")",o0&&e.handleMarkers(x,t),n=0;n{"use strict";var n=a(5787);a(9217).default,a(2188).default,t.Ay=n.default},2347:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkSpecKeys=t.checkNavigable=t.changeSlide=t.canUseDOM=t.canGoNext=void 0,t.clamp=c,t.extractObject=void 0,t.filterSettings=function(e){return A.reduce((function(t,a){return e.hasOwnProperty(a)&&(t[a]=e[a]),t}),{})},t.validSettings=t.swipeStart=t.swipeMove=t.swipeEnd=t.slidesOnRight=t.slidesOnLeft=t.slideHandler=t.siblingDirection=t.safePreventDefault=t.lazyStartIndex=t.lazySlidesOnRight=t.lazySlidesOnLeft=t.lazyEndIndex=t.keyHandler=t.initializedState=t.getWidth=t.getTrackLeft=t.getTrackCSS=t.getTrackAnimateCSS=t.getTotalSlides=t.getSwipeDirection=t.getSlideCount=t.getRequiredLazySlides=t.getPreClones=t.getPostClones=t.getOnDemandLazySlides=t.getNavigableIndexes=t.getHeight=void 0;var n=o(a(1609)),s=o(a(6385));function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t0?1:0):0},m=t.lazySlidesOnRight=function(e){return e.centerMode?Math.floor((e.slidesToShow-1)/2)+1+(parseInt(e.centerPadding)>0?1:0):e.slidesToShow},v=t.getWidth=function(e){return e&&e.offsetWidth||0},f=t.getHeight=function(e){return e&&e.offsetHeight||0},w=t.getSwipeDirection=function(e){var t,a,n,s,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=e.startX-e.curX,a=e.startY-e.curY,n=Math.atan2(a,t),(s=Math.round(180*n/Math.PI))<0&&(s=360-Math.abs(s)),s<=45&&s>=0||s<=360&&s>=315?"left":s>=135&&s<=225?"right":!0===o?s>=35&&s<=135?"up":"down":"vertical"},b=t.canGoNext=function(e){var t=!0;return e.infinite||(e.centerMode&&e.currentSlide>=e.slideCount-1||e.slideCount<=e.slidesToShow||e.currentSlide>=e.slideCount-e.slidesToShow)&&(t=!1),t},y=(t.extractObject=function(e,t){var a={};return t.forEach((function(t){return a[t]=e[t]})),a},t.initializedState=function(e){var t,a=n.default.Children.count(e.children),s=e.listRef,o=Math.ceil(v(s)),i=e.trackRef&&e.trackRef.node,r=Math.ceil(v(i));if(e.vertical)t=o;else{var c=e.centerMode&&2*parseInt(e.centerPadding);"string"==typeof e.centerPadding&&"%"===e.centerPadding.slice(-1)&&(c*=o/100),t=Math.ceil((o-c)/e.slidesToShow)}var d=s&&f(s.querySelector('[data-index="0"]')),g=d*e.slidesToShow,p=void 0===e.currentSlide?e.initialSlide:e.currentSlide;e.rtl&&void 0===e.currentSlide&&(p=a-1-e.initialSlide);var u=e.lazyLoadedList||[],m=h(l(l({},e),{},{currentSlide:p,lazyLoadedList:u})),w={slideCount:a,slideWidth:t,listWidth:o,trackWidth:r,currentSlide:p,slideHeight:d,listHeight:g,lazyLoadedList:u=u.concat(m)};return null===e.autoplaying&&e.autoplay&&(w.autoplaying="playing"),w},t.slideHandler=function(e){var t=e.waitForAnimate,a=e.animating,n=e.fade,s=e.infinite,o=e.index,i=e.slideCount,r=e.lazyLoad,d=e.currentSlide,g=e.centerMode,p=e.slidesToScroll,u=e.slidesToShow,m=e.useCSS,v=e.lazyLoadedList;if(t&&a)return{};var f,w,y,x=o,k={},M={},_=s?o:c(o,0,i-1);if(n){if(!s&&(o<0||o>=i))return{};o<0?x=o+i:o>=i&&(x=o-i),r&&v.indexOf(x)<0&&(v=v.concat(x)),k={animating:!0,currentSlide:x,lazyLoadedList:v,targetSlide:x},M={animating:!1,targetSlide:x}}else f=x,x<0?(f=x+i,s?i%p!=0&&(f=i-i%p):f=0):!b(e)&&x>d?x=f=d:g&&x>=i?(x=s?i:i-1,f=s?0:i-1):x>=i&&(f=x-i,s?i%p!=0&&(f=0):f=i-u),!s&&x+u>=i&&(f=i-u),w=E(l(l({},e),{},{slideIndex:x})),y=E(l(l({},e),{},{slideIndex:f})),s||(w===y&&(x=f),w=y),r&&(v=v.concat(h(l(l({},e),{},{currentSlide:x})))),m?(k={animating:!0,currentSlide:f,trackStyle:z(l(l({},e),{},{left:w})),lazyLoadedList:v,targetSlide:_},M={animating:!1,currentSlide:f,trackStyle:C(l(l({},e),{},{left:y})),swipeLeft:null,targetSlide:_}):k={currentSlide:f,trackStyle:C(l(l({},e),{},{left:y})),lazyLoadedList:v,targetSlide:_};return{state:k,nextState:M}},t.changeSlide=function(e,t){var a,n,s,o,i=e.slidesToScroll,r=e.slidesToShow,c=e.slideCount,d=e.currentSlide,h=e.targetSlide,g=e.lazyLoad,p=e.infinite;if(a=c%i!=0?0:(c-d)%i,"previous"===t.message)o=d-(s=0===a?i:r-a),g&&!p&&(o=-1==(n=d-s)?c-1:n),p||(o=h-i);else if("next"===t.message)o=d+(s=0===a?i:a),g&&!p&&(o=(d+i)%c+a),p||(o=h+i);else if("dots"===t.message)o=t.index*t.slidesToScroll;else if("children"===t.message){if(o=t.index,p){var u=S(l(l({},e),{},{targetSlide:o}));o>t.currentSlide&&"left"===u?o-=c:o10)return{scrolling:!0};i&&(x.swipeLength=S);var V=(r?-1:1)*(x.curX>x.startX?1:-1);i&&(V=x.curY>x.startY?1:-1);var T=Math.ceil(v/f),A=w(t.touchObject,i),$=x.swipeLength;return y||(0===c&&("right"===A||"down"===A)||c+1>=T&&("left"===A||"up"===A)||!b(t)&&("left"===A||"up"===A))&&($=x.swipeLength*h,!1===g&&p&&(p(A),L.edgeDragged=!0)),!u&&k&&(k(A),L.swiped=!0),_=s?H+$*(M/z)*V:r?H-$*V:H+$*V,i&&(_=H+$*V),L=l(l({},L),{},{touchObject:x,swipeLeft:_,trackStyle:C(l(l({},t),{},{left:_}))}),Math.abs(x.curX-x.startX)<.8*Math.abs(x.curY-x.startY)||x.swipeLength>10&&(L.swiping=!0,d(e)),L}},t.swipeEnd=function(e,t){var a=t.dragging,n=t.swipe,s=t.touchObject,o=t.listWidth,i=t.touchThreshold,r=t.verticalSwiping,c=t.listHeight,h=t.swipeToSlide,g=t.scrolling,p=t.onSwipe,u=t.targetSlide,m=t.currentSlide,v=t.infinite;if(!a)return n&&d(e),{};var f=r?c/i:o/i,b=w(s,r),y={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(g)return y;if(!s.swipeLength)return y;if(s.swipeLength>f){var M,C;d(e),p&&p(b);var _=v?m:u;switch(b){case"left":case"up":C=_+k(t),M=h?x(t,C):C,y.currentDirection=0;break;case"right":case"down":C=_-k(t),M=h?x(t,C):C,y.currentDirection=1;break;default:M=_}y.triggerSlideHandler=M}else{var L=E(t);y.trackStyle=z(l(l({},t),{},{left:L}))}return y},t.getNavigableIndexes=function(e){for(var t=e.infinite?2*e.slideCount:e.slideCount,a=e.infinite?-1*e.slidesToShow:0,n=e.infinite?-1*e.slidesToShow:0,s=[];aa[a.length-1])t=a[a.length-1];else for(var s in a){if(t-1*e.swipeLeft)return a=n,!1}else if(n.offsetLeft-t+v(n)/2>-1*e.swipeLeft)return a=n,!1;return!0})),!a)return 0;var o=!0===e.rtl?e.slideCount-e.currentSlide:e.currentSlide;return Math.abs(a.dataset.index-o)||1}return e.slidesToScroll},M=t.checkSpecKeys=function(e,t){return t.reduce((function(t,a){return t&&e.hasOwnProperty(a)}),!0)?null:console.error("Keys Missing:",e)},C=t.getTrackCSS=function(e){var t,a;M(e,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var n=e.slideCount+2*e.slidesToShow;e.vertical?a=n*e.slideHeight:t=H(e)*e.slideWidth;var s={opacity:1,transition:"",WebkitTransition:""};if(e.useTransform){var o=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",i=e.vertical?"translate3d(0px, "+e.left+"px, 0px)":"translate3d("+e.left+"px, 0px, 0px)",r=e.vertical?"translateY("+e.left+"px)":"translateX("+e.left+"px)";s=l(l({},s),{},{WebkitTransform:o,transform:i,msTransform:r})}else e.vertical?s.top=e.left:s.left=e.left;return e.fade&&(s={opacity:1}),t&&(s.width=t),a&&(s.height=a),window&&!window.addEventListener&&window.attachEvent&&(e.vertical?s.marginTop=e.left+"px":s.marginLeft=e.left+"px"),s},z=t.getTrackAnimateCSS=function(e){M(e,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var t=C(e);return e.useTransform?(t.WebkitTransition="-webkit-transform "+e.speed+"ms "+e.cssEase,t.transition="transform "+e.speed+"ms "+e.cssEase):e.vertical?t.transition="top "+e.speed+"ms "+e.cssEase:t.transition="left "+e.speed+"ms "+e.cssEase,t},E=t.getTrackLeft=function(e){if(e.unslick)return 0;M(e,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var t,a,n=e.slideIndex,s=e.trackRef,o=e.infinite,i=e.centerMode,r=e.slideCount,l=e.slidesToShow,c=e.slidesToScroll,d=e.slideWidth,h=e.listWidth,g=e.variableWidth,p=e.slideHeight,u=e.fade,m=e.vertical;if(u||1===e.slideCount)return 0;var v=0;if(o?(v=-_(e),r%c!=0&&n+c>r&&(v=-(n>r?l-(n-r):r%c)),i&&(v+=parseInt(l/2))):(r%c!=0&&n+c>r&&(v=l-r%c),i&&(v=parseInt(l/2))),t=m?n*p*-1+v*p:n*d*-1+v*d,!0===g){var f,w=s&&s.node;if(f=n+_(e),t=(a=w&&w.childNodes[f])?-1*a.offsetLeft:0,!0===i){f=o?n+_(e):n,a=w&&w.children[f],t=0;for(var b=0;be.currentSlide?e.targetSlide>e.currentSlide+V(e)?"left":"right":e.targetSlide0&&(o+=1),n&&t%2==0&&(o+=1),o}return n?0:t-1},T=t.slidesOnLeft=function(e){var t=e.slidesToShow,a=e.centerMode,n=e.rtl,s=e.centerPadding;if(a){var o=(t-1)/2+1;return parseInt(s)>0&&(o+=1),n||t%2!=0||(o+=1),o}return n?t-1:0},A=(t.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)},t.validSettings=Object.keys(s.default))},2516:(e,t,a)=>{var n=a(4152);e.exports=new n},2585:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{I:()=>useRunJs});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1609),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);const useRunJs=(htmlCode,delay=300)=>{const timer=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{if(htmlCode)return timer.current&&clearTimeout(timer.current),timer.current=setTimeout((()=>{const matchedScripts=htmlCode.match(/]*>([\s\S]*?)<\/script>/gm);matchedScripts&&matchedScripts.forEach((scriptTag=>{const scriptContentMatch=scriptTag.match(/]*>([\s\S]*?)<\/script>/i);scriptContentMatch&&scriptContentMatch[1]&&eval(scriptContentMatch[1])}))}),delay),()=>{timer.current&&clearTimeout(timer.current)}}),[htmlCode,delay])}},2827:(e,t,a)=>{var n=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,r=parseInt,l="object"==typeof a.g&&a.g&&a.g.Object===Object&&a.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=l||c||Function("return this")(),h=Object.prototype.toString,g=Math.max,p=Math.min,u=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=o.test(e);return a||i.test(e)?r(e.slice(2),a?2:8):s.test(e)?NaN:+e}e.exports=function(e,t,a){var n,s,o,i,r,l,c=0,d=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function w(t){var a=n,o=s;return n=s=void 0,c=t,i=e.apply(o,a)}function b(e){var a=e-l;return void 0===l||a>=t||a<0||h&&e-c>=o}function y(){var e=u();if(b(e))return x(e);r=setTimeout(y,function(e){var a=t-(e-l);return h?p(a,o-(e-c)):a}(e))}function x(e){return r=void 0,f&&n?w(e):(n=s=void 0,i)}function k(){var e=u(),a=b(e);if(n=arguments,s=this,l=e,a){if(void 0===r)return function(e){return c=e,r=setTimeout(y,t),d?w(e):i}(l);if(h)return r=setTimeout(y,t),w(l)}return void 0===r&&(r=setTimeout(y,t)),i}return t=v(t)||0,m(a)&&(d=!!a.leading,o=(h="maxWait"in a)?g(v(a.maxWait)||0,t):o,f="trailing"in a?!!a.trailing:f),k.cancel=function(){void 0!==r&&clearTimeout(r),c=0,n=l=s=r=void 0},k.flush=function(){return void 0===r?i:x(u())},k}},2879:(e,t,a)=>{e=a.nmd(e),ace.define("ace/snippets/html.snippets",["require","exports","module"],(function(e,t,a){a.exports='# Some useful Unicode entities\n# Non-Breaking Space\nsnippet nbs\n\t \n# ←\nsnippet left\n\t←\n# →\nsnippet right\n\t→\n# ↑\nsnippet up\n\t↑\n# ↓\nsnippet down\n\t↓\n# ↩\nsnippet return\n\t↩\n# ⇤\nsnippet backtab\n\t⇤\n# ⇥\nsnippet tab\n\t⇥\n# ⇧\nsnippet shift\n\t⇧\n# ⌃\nsnippet ctrl\n\t⌃\n# ⌅\nsnippet enter\n\t⌅\n# ⌘\nsnippet cmd\n\t⌘\n# ⌥\nsnippet option\n\t⌥\n# ⌦\nsnippet delete\n\t⌦\n# ⌫\nsnippet backspace\n\t⌫\n# ⎋\nsnippet esc\n\t⎋\n# Generic Doctype\nsnippet doctype HTML 4.01 Strict\n\t\nsnippet doctype HTML 4.01 Transitional\n\t\nsnippet doctype HTML 5\n\t\nsnippet doctype XHTML 1.0 Frameset\n\t\nsnippet doctype XHTML 1.0 Strict\n\t\nsnippet doctype XHTML 1.0 Transitional\n\t\nsnippet doctype XHTML 1.1\n\t\n# HTML Doctype 4.01 Strict\nsnippet docts\n\t\n# HTML Doctype 4.01 Transitional\nsnippet doct\n\t\n# HTML Doctype 5\nsnippet doct5\n\t\n# XHTML Doctype 1.0 Frameset\nsnippet docxf\n\t\n# XHTML Doctype 1.0 Strict\nsnippet docxs\n\t\n# XHTML Doctype 1.0 Transitional\nsnippet docxt\n\t\n# XHTML Doctype 1.1\nsnippet docx\n\t\n# html5shiv\nsnippet html5shiv\n\t\x3c!--[if lte IE 8]>\n\t\t