????

Your IP : 216.73.216.90


Current Path : C:/opt/pgsql/pgAdmin 4/web/pgadmin/static/js/generated/
Upload File :
Current File : C:/opt/pgsql/pgAdmin 4/web/pgadmin/static/js/generated/vendor.sqleditor.js

/*! For license information please see vendor.sqleditor.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[667],{28691:(e,t,i)=>{"use strict";i(63534),i(17),i(58476),i(36012),i(15852),i(10678),i(3101),i(7899),i(5086),i(58379);var n=i(24994);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{".jsoneditor-menu a.jsoneditor-poweredBy":{display:"none"},".jsoneditor":{borderColor:e.otherVars.borderColor,"& .jsoneditor-validation-errors":{backgroundColor:e.palette.error.light+" !important",color:e.palette.text.primary,border:"1px solid ".concat(e.palette.error.main)},"& .jsoneditor-text-errors":{width:"100%",borderCollapse:"collapse",borderColor:e.palette.default.borderColor},"& .jsoneditor-text-errors tr, & .jsoneditor-text-errors td, & .jsoneditor-text-errors td pre, & .jsoneditor-text-errors tr.parse-error":{backgroundColor:e.palette.error.light+" !important",color:e.palette.text.primary}},".jsoneditor-navigation-bar":{fontFamily:e.typography.fontFamily+" !important",backgroundColor:e.palette.default.main,color:e.palette.text.primary+" !important",borderBottom:"1px solid ".concat(e.otherVars.borderColor)},".jsoneditor-menu":{backgroundColor:e.palette.grey[400],border:"1px solid ".concat(e.otherVars.borderColor)},".jsoneditor-menu>button":{fontFamily:'"Font Awesome 5 Free" !important',fontSize:".925rem !important",lineHeight:"1.5rem",backgroundImage:"none !important",borderRadius:"0.25em",borderColor:e.palette.default.borderColor+" !important",opacity:1,backgroundColor:e.palette.default.main+" !important",color:e.palette.text.primary+" !important",fontWeight:"normal !important","&.jsoneditor-format::before":{content:'"\\f03c"',fontWeight:"600 !important"},"&.jsoneditor-expand-all::before":{content:'"\\f424"',fontWeight:"600 !important"},"&.jsoneditor-collapse-all::before":{content:'"\\f422"',fontWeight:"600 !important"},"&.jsoneditor-redo::before":{content:'"\\f01e"',fontWeight:"600 !important"},"&.jsoneditor-undo::before":{content:'"\\f0e2"',fontWeight:"600 !important"},"&.jsoneditor-compact::before":{content:'"\\f066"',fontWeight:"600 !important"},"&.jsoneditor-sort::before":{content:'"\\f160"',fontWeight:"600 !important"},"&.jsoneditor-repair::before":{content:'"\\f0ad"',fontWeight:"600 !important"},"&.jsoneditor-transform::before":{content:'"\\f0b0"',fontWeight:"600 !important"}},".jsoneditor-menu>.jsoneditor-modes>button:disabled, .jsoneditor-menu>button:disabled":{color:e.palette.text.primary+" !important",opacity:.65,borderColor:e.palette.grey[400],borderRadius:"0.25em",backgroundColor:e.palette.default.main+" !important"},".jsoneditor-menu>.jsoneditor-modes>button:active, .jsoneditor-menu>.jsoneditor-modes>button:focus, .jsoneditor-menu>.jsoneditor-modes>button":{fontFamily:e.typography.fontFamily+" !important",fontSize:".925rem !important",lineHeight:"1.5rem",backgroundImage:"none !important",borderRadius:"0.25em",borderColor:e.palette.default.borderColor+" !important",opacity:1,backgroundColor:e.palette.default.main+" !important",color:e.palette.text.primary+" !important",fontWeight:"normal !important"},".jsoneditor-contextmenu":{"& .jsoneditor-icon":{backgroundImage:"none"},"& .jsoneditor-text":{padding:"4px 4px 4px 5px"},"& .jsoneditor-menu":{border:"1px solid ".concat(e.palette.primary.light),backgroundColor:e.palette.default.main+" !important",color:e.palette.text.primary+" !important"},"& .jsoneditor-menu button.jsoneditor-expand":{height:"0px",backgroundColor:e.palette.background.default+" !important"},"&.jsoneditor-menu li ul":{padding:0,border:"1px solid ".concat(e.palette.primary.light)},"& .jsoneditor-separator":{height:0,borderTop:"1px solid ".concat(e.palette.primary.light),paddingTop:"5px",marginTop:"5px"},"& .jsoneditor-menu button, & .jsoneditor-separator":{fontFamily:e.typography.fontFamily+" !important",backgroundColor:e.palette.default.main+" !important",color:e.palette.text.primary+" !important",border:"none"},"& .jsoneditor-menu li button":{"&:hover":{backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main+" !important",color:e.palette.primary.contrastText+" !important"},"&.jsoneditor-selected, &.jsoneditor-selected:focus, &.jsoneditor-selected:hover":{backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main+" !important",color:e.palette.primary.contrastText+" !important"}}},".jsoneditor-frame, .jsoneditor-search input":{color:e.palette.text.primary,backgroundColor:e.palette.default.main},"div.jsoneditor-tree button.jsoneditor-button:focus":{backgroundColor:e.palette.text.primary+" !important",outline:"none"},".jsoneditor-results":{color:e.palette.text.primary+" !important"},".ace-jsoneditor":s(s({},e.mixins.fontSourceCode),{},{lineHeight:"1.5 !important",fontSize:"0.875em",color:e.palette.text.primary+" !important","& .ace_gutter":{backgroundColor:e.palette.grey[400],color:e.palette.text.primary},"& .ace_scroller":{backgroundColor:e.palette.background.default},"& .ace_indent-guide":{background:"none"},"& .ace_variable":{color:e.palette.text.primary+" !important"},"&.ace_editor":{backgroundColor:e.palette.background.default+" !important",color:e.palette.text.primary+" !important"},"& .ace_text-layer":{color:e.palette.text.primary+" !important"},"& .ace_marker-layer .ace_active-line":{backgroundColor:e.otherVars.editor.selectionBg,border:0,borderRadius:"0.25em"},"& .ace_gutter-active-line":{backgroundColor:e.palette.grey[200]},"& .ace_marker-layer .ace_selected-word, & .ace_marker-layer .ace_selection":{border:"1px solid ".concat(e.palette.primary.light)}}),"div.jsoneditor td.jsoneditor-tree":{verticalAlign:"middle"},"pre.jsoneditor-preview":{backgroundColor:e.palette.grey[200]+" !important",opacity:.8,color:e.palette.text.primary+" !important"},div:{"&.jsoneditor-field.jsoneditor-highlight, &.jsoneditor-field[contenteditable=true]:focus, &.jsoneditor-field[contenteditable=true]:hover, &.jsoneditor-value.jsoneditor-highlight, &.jsoneditor-value[contenteditable=true]:focus, &.jsoneditor-value[contenteditable=true]:hover":{backgroundColor:e.otherVars.editor.selectionBg,border:"1px solid ".concat(e.otherVars.editor.selectionBg),borderRadius:.25}},"div.jsoneditor-default, div.jsoneditor-field, div.jsoneditor-value, div.jsoneditor textarea, div.jsoneditor td, div.jsoneditor-readonly, .jsoneditor-popover, div.jsoneditor-tree":{fontFamily:e.typography.fontFamily+" !important",fontSize:".875rem !important",lineHeight:"1.5rem",backgroundColor:e.palette.background.default+" !important",color:e.palette.text.primary+" !important"},".jsoneditor-statusbar":{backgroundColor:e.palette.grey[400]+" !important",color:e.palette.text.primary+" !important",borderTop:"1px solid ".concat(e.otherVars.borderColor)},".jsoneditor-modal .pico-modal-header":{fontFamily:e.typography.fontFamily+" !important",fontSize:".875rem !important",fontWeight:"bold",backgroundColor:e.palette.primary.main+" !important",color:e.palette.text.primary},".pico-content":{backgroundColor:e.palette.background.default+" !important"},".jsoneditor-modal a":{color:e.palette.text.primary+" !important"},".pico-modal-contents p":{visibility:"hidden",display:"flex",marginBottom:"-1rem","&::after":{visibility:"visible",position:"absolute",content:'"Enter a JMESPath query to filter, sort, or transform the JSON data."'}},".jsoneditor-modal":{"& #query, & input, & input[type=text], & input[type=text]:focus, & option, & select, & table td, & table th, & textarea, & label":{color:e.palette.text.primary+" !important",backgroundColor:e.palette.background.default+" !important",fontFamily:e.typography.fontFamily+" !important",fontSize:".875rem !important",padding:"4px"},"& input[type=button]":{color:e.palette.text.primary,backgroundColor:e.palette.default.main},"& input[type=submit]":{color:e.palette.primary.contrastText+" !important",backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main+" !important",textTransform:"uppercase"},"& .jsoneditor-jmespath-label":{color:e.palette.text.primary+" !important",fontWeight:"bold"},"& option":{backgroundColor:e.palette.primary.light+" !important",border:"1px solid ".concat(e.palette.primary.light)+" !important",borderRadius:"0.25",color:e.palette.text.primary+" !important"},"& .jsoneditor-button-group.jsoneditor-button-group-value-asc input.jsoneditor-button-asc, & .jsoneditor-button-group.jsoneditor-button-group-value-desc input.jsoneditor-button-desc":{backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main+" !important",color:e.palette.primary.contrastText+" !important"},"& .selectr-selected":{color:e.palette.text.primary+" !important",backgroundColor:e.palette.background.default},"& .selectr-selected .selectr-tag":{backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),color:e.palette.primary.contrastText+" !important"},"& .selectr-selected .selectr-tag-remove::before":{color:e.palette.primary.main+" !important"}},".selectr-option, .selectr-options-container":{color:e.palette.text.primary+" !important",backgroundColor:e.palette.default.main},".selectr-option.active, .selectr-option.selected":{backgroundColor:e.palette.primary.main+" !important",borderColor:e.palette.primary.main,color:e.palette.primary.contrastText+" !important"},".ace_variable":{color:e.otherVars.editor.variable+" !important"},".ace_string":{color:e.otherVars.editor.string+" !important"},".ace_constant.ace_numeric":{color:e.otherVars.editor.number+" !important"},"div.jsoneditor-value":{"&.jsoneditor-string":{color:e.otherVars.editor.string+" !important"}," &.jsoneditor-number":{color:e.otherVars.editor.number+" !important"}},"#pg-json-editor[readonly]":{"& div.jsoneditor-tree, & div.jsoneditor td, & div.jsoneditor-readonly, & div.jsoneditor-value, & div.jsoneditor-field, & div.jsoneditor-tree button.jsoneditor-button:focus":{backgroundColor:e.palette.grey[400]+" !important",opacity:.85}},"#pg-json-editor[readonly] .ace-jsoneditor .ace_scroller":{backgroundColor:e.palette.grey[400]+" !important",opacity:.85}}};var o=n(i(43693));function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){(0,o.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}},88358:e=>{self,e.exports=function(){return t={897:function(e,t,i){"use strict";i.d(t,{x:function(){return l}});var n=i(2602),o=i(9791),r=i(7907);function s(e){return(s="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})(e)}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==s(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==s(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===s(e)?e:String(e)}(n.key),n)}}var l=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.dom={};var n=this,o=this.dom,s=((this.anchor=void 0,this.items=t,this.eventListeners={},this.selection=void 0,this.onClose=i?i.close:void 0,this.limitHeight=!!i&&i.limitHeight,i=document.createElement("div")).className="jsoneditor-contextmenu-root",o.root=i,document.createElement("div"));(s.className="jsoneditor-contextmenu",o.menu=s,i.appendChild(s),i=document.createElement("ul")).className="jsoneditor-menu",s.appendChild(i),o.list=i,o.items=[],((s=document.createElement("button")).type="button",o.focusButton=s,o=document.createElement("li")).style.overflow="hidden",o.style.height="0",o.appendChild(s),i.appendChild(o),function e(t,i,o){o.forEach((function(o){var s,a,l,c,h,d;"separator"===o.type?((h=document.createElement("div")).className="jsoneditor-separator",(a=document.createElement("li")).appendChild(h),t.appendChild(a)):(s={},h=document.createElement("li"),t.appendChild(h),(a=document.createElement("button")).type="button",a.className=o.className,s.button=a,o.title&&(a.title=o.title),o.click&&(a.onclick=function(e){e.preventDefault(),n.hide(),o.click()}),h.appendChild(a),o.submenu?((c=document.createElement("div")).className="jsoneditor-icon",a.appendChild(c),(c=document.createElement("div")).className="jsoneditor-text"+(o.click?"":" jsoneditor-right-margin"),c.appendChild(document.createTextNode(o.text)),a.appendChild(c),(l=o.click?(a.className+=" jsoneditor-default",(c=document.createElement("button")).type="button",(s.buttonExpand=c).className="jsoneditor-expand",(d=document.createElement("div")).className="jsoneditor-expand",c.appendChild(d),h.appendChild(c),o.submenuTitle&&(c.title=o.submenuTitle),c):((d=document.createElement("div")).className="jsoneditor-expand",a.appendChild(d),a)).onclick=function(e){e.preventDefault(),n._onExpandItem(s),l.focus()},s.subItems=c=[],d=document.createElement("ul"),(s.ul=d).className="jsoneditor-menu",d.style.height="0",h.appendChild(d),e(d,c,o.submenu)):((h=document.createElement("div")).className="jsoneditor-icon",a.appendChild(h),(d=document.createElement("div")).className="jsoneditor-text",d.appendChild(document.createTextNode((0,r.Iu)(o.text))),a.appendChild(d)),i.push(s))}))}(i,this.dom.items,t),this.maxHeight=0,t.forEach((function(e){e=24*(t.length+(e.submenu?e.submenu.length:0)),n.maxHeight=Math.max(n.maxHeight,e)}))}var t,i,s;return t=e,(i=[{key:"_getVisibleButtons",value:function(){var e=[],t=this;return this.dom.items.forEach((function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i===t.expandedItem&&i.subItems.forEach((function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)}))})),e}},{key:"show",value:function(t,i,r){this.hide();var s=!0,a=t.parentNode,l=t.getBoundingClientRect(),c=(a=a.getBoundingClientRect(),i.getBoundingClientRect()),h=this;this.dom.absoluteAnchor=(0,n.w)(t,i,(function(){h.hide()})),l.bottom+this.maxHeight<c.bottom||l.top-this.maxHeight>c.top&&(s=!1),i=r?0:l.top-a.top,s?(r=t.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=i+r+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.limitHeight&&(a=s?c.bottom-l.bottom-10:l.top-c.top-10,this.dom.list.style.maxHeight=a+"px",this.dom.list.style.overflowY="auto"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,o.getSelection)(),this.anchor=t,setTimeout((function(){h.dom.focusButton.focus()}),0),e.visibleMenu&&e.visibleMenu.hide(),e.visibleMenu=this}},{key:"hide",value:function(){this.dom.absoluteAnchor&&(this.dom.absoluteAnchor.destroy(),delete this.dom.absoluteAnchor),this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose)&&this.onClose(),e.visibleMenu===this&&(e.visibleMenu=void 0)}},{key:"_onExpandItem",value:function(e){var t,i=this,n=e===this.expandedItem,r=this.expandedItem;r&&(r.ul.style.height="0",r.ul.style.padding="",setTimeout((function(){i.expandedItem!==r&&(r.ul.style.display="",o.removeClassName)(r.ul.parentNode,"jsoneditor-selected")}),300),this.expandedItem=void 0),n||((t=e.ul).style.display="block",t.clientHeight,setTimeout((function(){if(i.expandedItem===e){for(var n=0,o=0;o<t.childNodes.length;o++)n+=t.childNodes[o].clientHeight;t.style.height=n+"px",t.style.padding="5px 10px"}}),0),(0,o.addClassName)(t.parentNode,"jsoneditor-selected"),this.expandedItem=e)}},{key:"_onKeyDown",value:function(e){var t,i,n,r,s=e.target,a=e.which,l=!1;27===a?(this.selection&&(0,o.setSelection)(this.selection),this.anchor&&this.anchor.focus(),this.hide(),l=!0):9===a?e.shiftKey?0===(i=(t=this._getVisibleButtons()).indexOf(s))&&(t[t.length-1].focus(),l=!0):(i=(t=this._getVisibleButtons()).indexOf(s))===t.length-1&&(t[0].focus(),l=!0):37===a?("jsoneditor-expand"===s.className&&(i=(t=this._getVisibleButtons()).indexOf(s),n=t[i-1])&&n.focus(),l=!0):38===a?(i=(t=this._getVisibleButtons()).indexOf(s),(n=(n=(n=t[i-1])&&"jsoneditor-expand"===n.className?t[i-2]:n)||t[t.length-1])&&n.focus(),l=!0):39===a?(i=(t=this._getVisibleButtons()).indexOf(s),(r=t[i+1])&&"jsoneditor-expand"===r.className&&r.focus(),l=!0):40===a&&(i=(t=this._getVisibleButtons()).indexOf(s),(r=(r=(r=t[i+1])&&"jsoneditor-expand"===r.className?t[i+2]:r)||t[0])&&(r.focus(),l=!0),l=!0),l&&(e.stopPropagation(),e.preventDefault())}}])&&a(t.prototype,i),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();l.visibleMenu=void 0},6436:function(e,t,i){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==n(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===n(e)?e:String(e)}(o.key),o)}}i.d(t,{Q:function(){return r}});var r=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var i;this.errorTableVisible=t.errorTableVisible,this.onToggleVisibility=t.onToggleVisibility,this.onFocusLine=t.onFocusLine||function(){},this.onChangeHeight=t.onChangeHeight,this.dom={},((t=document.createElement("div")).className="jsoneditor-validation-errors-container",this.dom.validationErrorsContainer=t,i=document.createElement("div")).style.display="none",i.className="jsoneditor-additional-errors fadein",i.textContent="Scroll for more ▿",this.dom.additionalErrorsIndication=i,t.appendChild(i),((t=document.createElement("span")).className="jsoneditor-validation-error-icon",t.style.display="none",this.dom.validationErrorIcon=t,i=document.createElement("span")).className="jsoneditor-validation-error-count",i.style.display="none",this.dom.validationErrorCount=i,this.dom.parseErrorIndication=document.createElement("span"),this.dom.parseErrorIndication.className="jsoneditor-parse-error-icon",this.dom.parseErrorIndication.style.display="none"}var t,i,n;return t=e,(i=[{key:"getErrorTable",value:function(){return this.dom.validationErrorsContainer}},{key:"getErrorCounter",value:function(){return this.dom.validationErrorCount}},{key:"getWarningIcon",value:function(){return this.dom.validationErrorIcon}},{key:"getErrorIcon",value:function(){return this.dom.parseErrorIndication}},{key:"toggleTableVisibility",value:function(){this.errorTableVisible=!this.errorTableVisible,this.onToggleVisibility(this.errorTableVisible)}},{key:"setErrors",value:function(e,t){var i,n,o=this,r=(this.dom.validationErrors&&(this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors),this.dom.validationErrors=null,this.dom.additionalErrorsIndication.style.display="none"),this.errorTableVisible&&0<e.length?((r=document.createElement("div")).className="jsoneditor-validation-errors",(n=document.createElement("table")).className="jsoneditor-text-errors",r.appendChild(n),i=document.createElement("tbody"),n.appendChild(i),e.forEach((function(e){isNaN(e.line)?e.dataPath&&(s=t.find((function(t){return t.path===e.dataPath})))&&(n=s.line+1):n=e.line;var n,r,s=document.createElement("tr"),a=(s.className=isNaN(n)?"":"jump-to-line","error"===e.type?s.className+=" parse-error":s.className+=" validation-error",document.createElement("td"));((r=document.createElement("button")).className="jsoneditor-schema-error",a.appendChild(r),s.appendChild(a),r=document.createElement("td")).style="white-space: nowrap;",r.textContent=isNaN(n)?"":"Ln "+n,s.appendChild(r),"string"==typeof e?((a=document.createElement("td")).colSpan=2,(r=document.createElement("pre")).appendChild(document.createTextNode(e)),a.appendChild(r),s.appendChild(a)):((r=document.createElement("td")).appendChild(document.createTextNode(e.dataPath||"")),s.appendChild(r),a=document.createElement("td"),(r=document.createElement("pre")).appendChild(document.createTextNode(e.message.replace(/<br>/gi,"\n"))),a.appendChild(r),s.appendChild(a)),s.onclick=function(){o.onFocusLine(n)},i.appendChild(s)})),this.dom.validationErrors=r,this.dom.validationErrorsContainer.appendChild(r),this.dom.additionalErrorsIndication.title=e.length+" errors total",this.dom.validationErrorsContainer.clientHeight<this.dom.validationErrorsContainer.scrollHeight?(this.dom.additionalErrorsIndication.style.display="block",this.dom.validationErrorsContainer.onscroll=function(){o.dom.additionalErrorsIndication.style.display=0<o.dom.validationErrorsContainer.clientHeight&&0===o.dom.validationErrorsContainer.scrollTop?"block":"none"}):this.dom.validationErrorsContainer.onscroll=void 0,n=this.dom.validationErrorsContainer.clientHeight+(this.dom.statusBar?this.dom.statusBar.clientHeight:0),this.onChangeHeight(n)):this.onChangeHeight(0),e.filter((function(e){return"error"!==e.type})).length);0<r?(this.dom.validationErrorCount.style.display="inline",this.dom.validationErrorCount.innerText=r,this.dom.validationErrorCount.onclick=this.toggleTableVisibility.bind(this),this.dom.validationErrorIcon.style.display="inline",this.dom.validationErrorIcon.title=r+" schema validation error(s) found",this.dom.validationErrorIcon.onclick=this.toggleTableVisibility.bind(this)):(this.dom.validationErrorCount.style.display="none",this.dom.validationErrorIcon.style.display="none"),e.some((function(e){return"error"===e.type}))?(n=e[0].line,this.dom.parseErrorIndication.style.display="block",this.dom.parseErrorIndication.title=isNaN(n)?"parse error - check that the json is valid":"parse error on line "+n,this.dom.parseErrorIndication.onclick=this.toggleTableVisibility.bind(this)):this.dom.parseErrorIndication.style.display="none"}}])&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2474:function(e,t,i){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==n(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===n(e)?e:String(e)}(o.key),o)}}i.d(t,{R:function(){return r}});var r=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");if(this.target=t.target||null,!this.target)throw new Error('FocusTracker constructor called without a "target" to track.');this.onFocus="function"==typeof t.onFocus?t.onFocus:null,this.onBlur="function"==typeof t.onBlur?t.onBlur:null,this._onClick=this._onEvent.bind(this),this._onKeyUp=function(e){9!==e.which&&9!==e.keyCode||this._onEvent(e)}.bind(this),this._onBlur=this._onEvent.bind(this),this.focusFlag=!1,this.firstEventFlag=!0,(this.onFocus||this.onBlur)&&(document.addEventListener("click",this._onClick),document.addEventListener("keyup",this._onKeyUp),document.addEventListener("blur",this._onBlur))}var t,i,n;return t=e,(i=[{key:"destroy",value:function(){document.removeEventListener("click",this._onClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("blur",this._onBlur),this._onEvent({target:document.body})}},{key:"_onEvent",value:function(e){(e=(e=e.target)===this.target||!(!this.target.contains(e)&&!this.target.contains(document.activeElement)))?this.focusFlag||(this.onFocus&&this.onFocus({type:"focus",target:this.target}),this.focusFlag=!0):(this.focusFlag||this.firstEventFlag)&&(this.onBlur&&this.onBlur({type:"blur",target:this.target}),this.focusFlag=!1,this.firstEventFlag)&&(this.firstEventFlag=!1)}}])&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3161:function(e,t,i){"use strict";var n=i(8170),o=i(8037),r=i(8038).treeModeMixins,s=i(8458).textModeMixins,a=i(341).previewModeMixins,l=(p=i(9791)).clear,c=p.extend,h=p.getInnerText,d=p.getInternetExplorerVersion,u=p.parse,p=i(2744).tryRequireAjv,g=i(2558).showTransformModal,m=i(6210).showSortModal,f=p();function y(e,t,i){if(!(this instanceof y))throw new Error('JSONEditor constructor called without "new".');var n=d();if(-1!==n&&n<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t.onChangeJSON&&("text"===t.mode||"code"===t.mode||t.modes&&(-1!==t.modes.indexOf("text")||-1!==t.modes.indexOf("code")))&&console.warn('Option "onChangeJSON" is not applicable to modes "text" and "code". Use "onChangeText" or "onChange" instead.'),t)&&Object.keys(t).forEach((function(e){-1===y.VALID_OPTIONS.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')})),arguments.length&&this._create(e,t,i)}"undefined"==typeof Promise&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),y.modes={},y.prototype.DEBOUNCE_INTERVAL=150,y.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onExpand","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","onFocus","onBlur","colorPicker","onColorPicker","timestampTag","timestampFormat","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","limitDragging","maxVisibleChilds","onValidationError","modalAnchor","popupAnchor","createQuery","executeQuery","queryDescription","allowSchemaSuggestions","showErrorTable"],y.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{},e=this.options.mode||this.options.modes&&this.options.modes[0]||"tree",this.setMode(e)},y.prototype.destroy=function(){},y.prototype.set=function(e){this.json=e},y.prototype.get=function(){return this.json},y.prototype.setText=function(e){this.json=u(e)},y.prototype.getText=function(){return JSON.stringify(this.json)},y.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},y.prototype.getName=function(){return this.options&&this.options.name},y.prototype.setMode=function(e){if(e!==this.options.mode||!this.create){var t=this.container,i=c({},this.options),n=i.mode,o=(i.mode=e,y.modes[e]);if(!o)throw new Error('Unknown mode "'+i.mode+'"');var r="text"===o.data,s=this.getName(),a=this[r?"getText":"get"]();if(this.destroy(),l(this),c(this,o.mixin),this.create(t,i),this.setName(s),this[r?"setText":"set"](a),"function"==typeof o.load)try{o.load.call(this)}catch(e){console.error(e)}if("function"==typeof i.onModeChange&&e!==n)try{i.onModeChange(e,n)}catch(e){console.error(e)}}},y.prototype.getMode=function(){return this.options.mode},y.prototype._onError=function(e){this.options&&"function"==typeof this.options.onError?this.options.onError(e):window.alert(e.toString())},y.prototype.setSchema=function(e,t){if(e){var n;try{this.options.ajv?n=this.options.ajv:((n=f({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(i(7171)),n.addMetaSchema(i(6273)))}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(n){if(t){for(var o in t)n.removeSchema(o),t[o]&&n.addSchema(t[o],o);this.options.schemaRefs=t}this.validateSchema=n.compile(e),this.options.schema=e,this.options.schemaRefs=t,this.validate()}}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate();this.refresh(),"function"==typeof this._onSchemaChange&&this._onSchemaChange(e,t)},y.prototype.validate=function(){},y.prototype.refresh=function(){},(y.registerMode=function(e){var t;if(Array.isArray(e))for(o=0;o<e.length;o++)y.registerMode(e[o]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var i=e.mode;if(i in y.modes)throw new Error('Mode "'+i+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');for(var n=["setMode","registerMode","modes"],o=0;o<n.length;o++)if((t=n[o])in e.mixin)throw new Error('Reserved property "'+t+'" not allowed in mixin');y.modes[i]=e}})(r),y.registerMode(s),y.registerMode(a),y.ace=n,y.Ajv=f,y.VanillaPicker=o,y.showTransformModal=g,y.showSortModal=m,y.getInnerText=h,e.exports=y.default=y},6617:function(e,t,i){"use strict";i.d(t,{x:function(){return a}});var n=i(897),o=i(7907);function r(e){return(r="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})(e)}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==r(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==r(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===r(e)?e:String(e)}(n.key),n)}}var a=function(){function e(t,i,r,s){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(var a={code:{text:(0,o.Iu)("modeCodeText"),title:(0,o.Iu)("modeCodeTitle"),click:function(){s("code")}},form:{text:(0,o.Iu)("modeFormText"),title:(0,o.Iu)("modeFormTitle"),click:function(){s("form")}},text:{text:(0,o.Iu)("modeTextText"),title:(0,o.Iu)("modeTextTitle"),click:function(){s("text")}},tree:{text:(0,o.Iu)("modeTreeText"),title:(0,o.Iu)("modeTreeTitle"),click:function(){s("tree")}},view:{text:(0,o.Iu)("modeViewText"),title:(0,o.Iu)("modeViewTitle"),click:function(){s("view")}},preview:{text:(0,o.Iu)("modePreviewText"),title:(0,o.Iu)("modePreviewTitle"),click:function(){s("preview")}}},l=[],c=0;c<i.length;c++){var h=i[c],d=a[h];if(!d)throw new Error('Unknown mode "'+h+'"');d.className="jsoneditor-type-modes"+(r===h?" jsoneditor-selected":""),l.push(d)}if(!(u=a[r]))throw new Error('Unknown mode "'+r+'"');var u=u.text,p=document.createElement("button");(p.type="button",p.className="jsoneditor-modes jsoneditor-separator",p.textContent=u+" ▾",p.title=(0,o.Iu)("modeEditorTitle"),p.onclick=function(){new n.x(l).show(p,t)},u=document.createElement("div")).className="jsoneditor-modes",u.style.position="relative",u.appendChild(p),t.appendChild(u),this.dom={container:t,box:p,frame:u}}var t,i,r;return t=e,(i=[{key:"focus",value:function(){this.dom.box.focus()}},{key:"destroy",value:function(){this.dom&&this.dom.frame&&this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom=null}}])&&s(t.prototype,i),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},8170:function(e,t,i){var n;if(window.ace)n=window.ace;else try{n=i(6225),i(4091),i(3330),i(4317);var o=i(7923);n.config.setModuleUrl("ace/mode/json_worker",o)}catch(e){}e.exports=n},4864:function(){window.ace.define("ace/theme/jsoneditor",["require","exports","module","ace/lib/dom"],(function(e,t,i){t.isDark=!1,t.cssClass="ace-jsoneditor",t.cssText='.ace-jsoneditor .ace_gutter {\nbackground: #ebebeb;\ncolor: #333\n}\n\n.ace-jsoneditor.ace_editor {\nline-height: 1.3;\nbackground-color: #fff;\n}\n.ace-jsoneditor .ace_print-margin {\nwidth: 1px;\nbackground: #e8e8e8\n}\n.ace-jsoneditor .ace_scroller {\nbackground-color: #FFFFFF\n}\n.ace-jsoneditor .ace_text-layer {\ncolor: gray\n}\n.ace-jsoneditor .ace_variable {\ncolor: #1a1a1a\n}\n.ace-jsoneditor .ace_cursor {\nborder-left: 2px solid #000000\n}\n.ace-jsoneditor .ace_overwrite-cursors .ace_cursor {\nborder-left: 0px;\nborder-bottom: 1px solid #000000\n}\n.ace-jsoneditor .ace_marker-layer .ace_selection {\nbackground: lightgray\n}\n.ace-jsoneditor.ace_multiselect .ace_selection.ace_start {\nbox-shadow: 0 0 3px 0px #FFFFFF;\nborder-radius: 2px\n}\n.ace-jsoneditor .ace_marker-layer .ace_step {\nbackground: rgb(255, 255, 0)\n}\n.ace-jsoneditor .ace_marker-layer .ace_bracket {\nmargin: -1px 0 0 -1px;\nborder: 1px solid #BFBFBF\n}\n.ace-jsoneditor .ace_marker-layer .ace_active-line {\nbackground: #FFFBD1\n}\n.ace-jsoneditor .ace_gutter-active-line {\nbackground-color : #dcdcdc\n}\n.ace-jsoneditor .ace_marker-layer .ace_selected-word {\nborder: 1px solid lightgray\n}\n.ace-jsoneditor .ace_invisible {\ncolor: #BFBFBF\n}\n.ace-jsoneditor .ace_keyword,\n.ace-jsoneditor .ace_meta,\n.ace-jsoneditor .ace_support.ace_constant.ace_property-value {\ncolor: #AF956F\n}\n.ace-jsoneditor .ace_keyword.ace_operator {\ncolor: #484848\n}\n.ace-jsoneditor .ace_keyword.ace_other.ace_unit {\ncolor: #96DC5F\n}\n.ace-jsoneditor .ace_constant.ace_language {\ncolor: darkorange\n}\n.ace-jsoneditor .ace_constant.ace_numeric {\ncolor: red\n}\n.ace-jsoneditor .ace_constant.ace_character.ace_entity {\ncolor: #BF78CC\n}\n.ace-jsoneditor .ace_invalid {\ncolor: #FFFFFF;\nbackground-color: #FF002A;\n}\n.ace-jsoneditor .ace_fold {\nbackground-color: #AF956F;\nborder-color: #000000\n}\n.ace-jsoneditor .ace_storage,\n.ace-jsoneditor .ace_support.ace_class,\n.ace-jsoneditor .ace_support.ace_function,\n.ace-jsoneditor .ace_support.ace_other,\n.ace-jsoneditor .ace_support.ace_type {\ncolor: #C52727\n}\n.ace-jsoneditor .ace_string {\ncolor: green\n}\n.ace-jsoneditor .ace_comment {\ncolor: #BCC8BA\n}\n.ace-jsoneditor .ace_entity.ace_name.ace_tag,\n.ace-jsoneditor .ace_entity.ace_other.ace_attribute-name {\ncolor: #606060\n}\n.ace-jsoneditor .ace_markup.ace_underline {\ntext-decoration: underline\n}\n.ace-jsoneditor .ace_indent-guide {\nbackground: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y\n}',e("../lib/dom").importCssString(t.cssText,t.cssClass)}))},6589:function(e,t){var i;(i={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,i,n,o,r,s){var a=r.length-1;switch(o){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=r[a-1];case 13:this.$={};break;case 14:case 19:this.$=r[a-1];break;case 15:this.$=[r[a-2],r[a]];break;case 16:this.$={},this.$[r[a][0]]=r[a][1];break;case 17:this.$=r[a-2],r[a-2][r[a][0]]=r[a][1];break;case 18:this.$=[];break;case 20:this.$=[r[a]];break;case 21:this.$=r[a-2],r[a-2].push(r[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,i=[0],n=[null],o=[],r=this.table,s="",a=0,l=0,c=0,h=(this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={}),this.lexer.yylloc);function d(){var e=t.lexer.lex()||1;return"number"!=typeof e&&t.symbols_[e]||e}o.push(h),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var u,p,g,m,f,y,v,C,I,b={};;){if(g=i[i.length-1],void 0===(m=this.defaultActions[g]||(null==u&&(u=d()),r[g]&&r[g][u]))||!m.length||!m[0]){if(!c){for(f in C=[],r[g])this.terminals_[f]&&2<f&&C.push("'"+this.terminals_[f]+"'");var A="";A=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[u]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'"),this.parseError(A,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:C})}if(3==c){if(1==u)throw new Error(A||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,h=this.lexer.yylloc,u=d()}for(;!(2..toString()in r[g]);){if(0==g)throw new Error(A||"Parsing halted.");I=1,i.length=i.length-2*I,n.length=n.length-I,o.length=o.length-I,g=i[i.length-1]}p=u,u=2,m=r[g=i[i.length-1]]&&r[g][2],c=3}if(m[0]instanceof Array&&1<m.length)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+u);switch(m[0]){case 1:i.push(u),n.push(this.lexer.yytext),o.push(this.lexer.yylloc),i.push(m[1]),u=null,p?(u=p,p=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,h=this.lexer.yylloc,0<c&&c--);break;case 2:if(y=this.productions_[m[1]][1],b.$=n[n.length-y],b._$={first_line:o[o.length-(y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(y||1)].first_column,last_column:o[o.length-1].last_column},void 0!==(v=this.performAction.call(b,s,l,a,this.yy,m[1],n,o)))return v;y&&(i=i.slice(0,-1*y*2),n=n.slice(0,-1*y),o=o.slice(0,-1*y)),i.push(this.productions_[m[1]][0]),n.push(b.$),o.push(b._$),v=r[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}}).lexer={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(20<e.length?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(20<e.length?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,i,n,o=this._currentRules(),r=0;r<o.length&&(!(t=this._input.match(this.rules[o[r]]))||e&&!(t[0].length>e[0].length)||(e=t,i=r,this.options.flex));r++);return e?((n=e[0].match(/\n.*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,i,n){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}},t.parser=i,t.parse=i.parse.bind(i)},3879:function(e){"use strict";function t(){}t.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},t.mixin=function(e){for(var i=["on","off","emit"],n=0;n<i.length;n++)"function"==typeof e?e.prototype[i[n]]=t.prototype[i[n]]:e[i[n]]=t.prototype[i[n]];return e};var i={escapeRegExp:function(e){var t=/[\\^$.*+?()[\]{}|]/g,i=new RegExp(t.source);return e&&i.test(e)?e.replace(t,"\\$&"):e},extend:function(e,t){for(var n in t){var o;t.hasOwnProperty(n)&&((o=t[n])&&"[object Object]"===Object.prototype.toString.call(o)?(e[n]=e[n]||{},i.extend(e[n],o)):e[n]=o)}return e},each:function(e,t,i){if("[object Object]"===Object.prototype.toString.call(e))for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(i,n,e[n],e);else for(var o=0,r=e.length;o<r;o++)t.call(i,o,e[o],e)},createElement:function(e,t){var i,n=document.createElement(e);if(t&&"[object Object]"===Object.prototype.toString.call(t))for(i in t)i in n?n[i]=t[i]:"html"===i?n.innerHTML=t[i]:n.setAttribute(i,t[i]);return n},hasClass:function(e,t){if(e)return e.classList?e.classList.contains(t):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){i.hasClass(e,t)||(e.classList?e.classList.add(t):e.className=e.className.trim()+" "+t)},removeClass:function(e,t){i.hasClass(e,t)&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," "))},closest:function(e,t){return e&&e!==document.body&&(t(e)?e:i.closest(e.parentNode,t))},isInt:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},debounce:function(e,t,i){var n;return function(){var o=this,r=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(o,r)}),t),s&&e.apply(o,r)}},rect:function(e,t){var i=window,n=(e=e.getBoundingClientRect(),t?i.pageXOffset:0);return t=t?i.pageYOffset:0,{bottom:e.bottom+t,height:e.height,left:e.left+n,right:e.right+n,top:e.top+t,width:e.width}},includes:function(e,t){return-1<e.indexOf(t)},startsWith:function(e,t){return e.substr(0,t.length)===t},truncate:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}};function n(e,t){return e.hasOwnProperty(t)&&(!0===e[t]||e[t].length)}function o(e,t,n){e.parentNode?e.parentNode.parentNode||t.appendChild(e.parentNode):t.appendChild(e),i.removeClass(e,"excluded"),n||(e.textContent=e.textContent)}function r(){var e,t;this.items.length&&(e=document.createDocumentFragment(),this.config.pagination?(t=this.pages.slice(0,this.pageIndex),i.each(t,(function(t,n){i.each(n,(function(t,i){o(i,e,this.customOption)}),this)}),this)):i.each(this.items,(function(t,i){o(i,e,this.customOption)}),this),e.childElementCount&&(i.removeClass(this.items[this.navIndex],"active"),this.navIndex=(e.querySelector(".selectr-option.selected")||e.querySelector(".selectr-option")).idx,i.addClass(this.items[this.navIndex],"active")),this.tree.appendChild(e))}function s(e,t){t=t||e;var n={class:"selectr-option",role:"treeitem","aria-selected":!1};return this.customOption?n.html=this.config.renderOption(t):n.textContent=e.textContent,(t=i.createElement("li",n)).idx=e.idx,this.items.push(t),e.defaultSelected&&this.defaultSelected.push(e.idx),e.disabled&&(t.disabled=!0,i.addClass(t,"disabled")),t}function a(){var e,t=this.tree,n=t.scrollTop;t.scrollHeight-t.offsetHeight<=n&&this.pageIndex<this.pages.length&&(e=document.createDocumentFragment(),i.each(this.pages[this.pageIndex],(function(t,i){o(i,e,this.customOption)}),this),t.appendChild(e),this.pageIndex++,this.emit("selectr.paginate",{items:this.items.length,total:this.data.length,page:this.pageIndex,pages:this.pages.length}))}function l(){(this.config.searchable||this.config.taggable)&&(this.input.value=null,this.searching=!1,this.config.searchable&&i.removeClass(this.inputContainer,"active"),i.hasClass(this.container,"notice")&&(i.removeClass(this.container,"notice"),i.addClass(this.container,"open"),this.input.focus()),i.each(this.items,(function(e,t){i.removeClass(t,"excluded"),this.customOption||(t.textContent=t.textContent)}),this))}function c(e,t){if(!e)throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");if("string"==typeof(this.el=e)&&(this.el=document.querySelector(e)),null===this.el)throw new Error("The element you passed to Selectr can not be found.");if("select"!==this.el.nodeName.toLowerCase())throw new Error("The element you passed to Selectr is not a HTMLSelectElement.");this.render(t)}c.prototype.render=function(e){var o;this.rendered||((this.el.selectr=this).config=i.extend({defaultSelected:!0,width:"auto",disabled:!1,disabledMobile:!1,searchable:!0,clearable:!1,sortSelected:!1,allowDeselect:!1,closeOnScroll:!1,nativeDropdown:!1,nativeKeyboard:!1,placeholder:"Select an option...",taggable:!1,tagPlaceholder:"Enter a tag...",messages:{noResults:"No results.",noOptions:"No options available.",maxSelections:"A maximum of {max} items can be selected.",tagDuplicate:"That tag is already in use.",searchPlaceholder:"Search options..."}},e),this.originalType=this.el.type,this.originalIndex=this.el.tabIndex,this.defaultSelected=[],this.originalOptionCount=this.el.options.length,(this.config.multiple||this.config.taggable)&&(this.el.multiple=!0),this.disabled=n(this.config,"disabled"),this.opened=!1,this.config.taggable&&(this.config.searchable=!1),this.navigating=!1,this.mobileDevice=!1,!this.config.disabledMobile&&/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(navigator.userAgent)&&(this.mobileDevice=!0),this.customOption=this.config.hasOwnProperty("renderOption")&&"function"==typeof this.config.renderOption,this.customSelected=this.config.hasOwnProperty("renderSelection")&&"function"==typeof this.config.renderSelection,this.supportsEventPassiveOption=this.detectEventPassiveOption(),t.mixin(this),function(){this.requiresPagination=this.config.pagination&&0<this.config.pagination,n(this.config,"width")&&(i.isInt(this.config.width)?this.width=this.config.width+"px":"auto"===this.config.width?this.width="100%":i.includes(this.config.width,"%")&&(this.width=this.config.width)),this.container=i.createElement("div",{class:"selectr-container"}),this.config.customClass&&i.addClass(this.container,this.config.customClass),this.mobileDevice?i.addClass(this.container,"selectr-mobile"):i.addClass(this.container,"selectr-desktop"),this.el.tabIndex=-1,this.config.nativeDropdown||this.mobileDevice?i.addClass(this.el,"selectr-visible"):i.addClass(this.el,"selectr-hidden"),this.selected=i.createElement("div",{class:"selectr-selected",disabled:this.disabled,tabIndex:0,"aria-expanded":!1}),this.label=i.createElement(this.el.multiple?"ul":"span",{class:"selectr-label"});var e=i.createElement("div",{class:"selectr-options-container"});if(this.tree=i.createElement("ul",{class:"selectr-options",role:"tree","aria-hidden":!0,"aria-expanded":!1}),this.notice=i.createElement("div",{class:"selectr-notice"}),this.el.setAttribute("aria-hidden",!0),this.disabled&&(this.el.disabled=!0),this.el.multiple?(i.addClass(this.label,"selectr-tags"),i.addClass(this.container,"multiple"),this.tags=[],this.selectedValues=this.config.defaultSelected?this.getSelectedProperties("value"):[],this.selectedIndexes=this.getSelectedProperties("idx")):(this.selectedValue=null,this.selectedIndex=-1),this.selected.appendChild(this.label),this.config.clearable&&(this.selectClear=i.createElement("button",{class:"selectr-clear",type:"button"}),this.container.appendChild(this.selectClear),i.addClass(this.container,"clearable")),this.config.taggable){var t=i.createElement("li",{class:"input-tag"});if(this.input=i.createElement("input",{class:"selectr-tag-input",placeholder:this.config.tagPlaceholder,tagIndex:0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search"}),t.appendChild(this.input),this.label.appendChild(t),i.addClass(this.container,"taggable"),this.tagSeperators=[","],this.config.tagSeperators){this.tagSeperators=this.tagSeperators.concat(this.config.tagSeperators);for(var o=[],r=0;r<this.tagSeperators.length;r++)o.push(i.escapeRegExp(this.tagSeperators[r]));this.tagSeperatorsRegex=new RegExp(o.join("|"),"i")}else this.tagSeperatorsRegex=new RegExp(",","i")}this.config.searchable&&(this.input=i.createElement("input",{class:"selectr-input",tagIndex:-1,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search",placeholder:this.config.messages.searchPlaceholder}),this.inputClear=i.createElement("button",{class:"selectr-input-clear",type:"button"}),this.inputContainer=i.createElement("div",{class:"selectr-input-container"}),this.inputContainer.appendChild(this.input),this.inputContainer.appendChild(this.inputClear),e.appendChild(this.inputContainer)),e.appendChild(this.notice),e.appendChild(this.tree),this.items=[],this.options=[],this.el.options.length&&(this.options=[].slice.call(this.el.options));var a,l,c,h=!1,d=0;this.el.children.length&&i.each(this.el.children,(function(e,t){"OPTGROUP"===t.nodeName?(h=i.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.label+"</li>"}),i.each(t.children,(function(e,t){t.idx=d,h.appendChild(s.call(this,t,h)),d++}),this)):(t.idx=d,s.call(this,t),d++)}),this),this.config.data&&Array.isArray(this.config.data)&&(a=!(this.data=[]),h=!1,d=0,i.each(this.config.data,(function(e,t){n(t,"children")?(a=i.createElement("optgroup",{label:t.text}),h=i.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.text+"</li>"}),i.each(t.children,(function(e,t){(l=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=n(t,"disabled"),this.options.push(l),a.appendChild(l),l.idx=d,h.appendChild(s.call(this,l,t)),this.data[d]=t,d++}),this),this.el.appendChild(a)):((l=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=n(t,"disabled"),this.options.push(l),l.idx=d,s.call(this,l,t),this.data[d]=t,d++)}),this)),this.setSelected(!0);for(var u=this.navIndex=0;u<this.items.length;u++)if(c=this.items[u],!i.hasClass(c,"disabled")){i.addClass(c,"active"),this.navIndex=u;break}this.requiresPagination&&(this.pageIndex=1,this.paginate()),this.container.appendChild(this.selected),this.container.appendChild(e),this.placeEl=i.createElement("div",{class:"selectr-placeholder"}),this.setPlaceholder(),this.selected.appendChild(this.placeEl),this.disabled&&this.disable(),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el)}.call(this),this.bindEvents(),this.update(),this.optsRect=i.rect(this.tree),this.rendered=!0,this.el.multiple||(this.el.selectedIndex=this.selectedIndex),o=this,setTimeout((function(){o.emit("selectr.init")}),20))},c.prototype.getSelected=function(){return this.el.querySelectorAll("option:checked")},c.prototype.getSelectedProperties=function(e){var t=this.getSelected();return[].slice.call(t).map((function(t){return t[e]})).filter((function(e){return null!=e}))},c.prototype.detectEventPassiveOption=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e},c.prototype.bindEvents=function(){var e,t=this;this.events={},this.events.dismiss=function(e){e=e.target,this.container.contains(e)||!this.opened&&!i.hasClass(this.container,"notice")||this.close()}.bind(this),this.events.navigate=function(e){if(e=e||window.event,this.items.length&&this.opened&&i.includes([13,38,40],e.which)){if(e.preventDefault(),13===e.which)return!(this.noResults||this.config.taggable&&0<this.input.value.length)&&this.change(this.navIndex);var t,n=this.items[this.navIndex],o=this.navIndex;switch(e.which){case 38:(t=0)<this.navIndex&&this.navIndex--;break;case 40:this.navIndex<this.items.length-(t=1)&&this.navIndex++}for(this.navigating=!0;i.hasClass(this.items[this.navIndex],"disabled")||i.hasClass(this.items[this.navIndex],"excluded");){if(!(0<this.navIndex&&this.navIndex<this.items.length-1)){this.navIndex=o;break}if(t?this.navIndex++:this.navIndex--,this.searching){if(this.navIndex>this.tree.lastElementChild.idx){this.navIndex=this.tree.lastElementChild.idx;break}if(this.navIndex<this.tree.firstElementChild.idx){this.navIndex=this.tree.firstElementChild.idx;break}}}e=i.rect(this.items[this.navIndex]),t?(0===this.navIndex?this.tree.scrollTop=0:e.top+e.height>this.optsRect.top+this.optsRect.height&&(this.tree.scrollTop=this.tree.scrollTop+(e.top+e.height-(this.optsRect.top+this.optsRect.height))),this.navIndex===this.tree.childElementCount-1&&this.requiresPagination&&a.call(this)):0===this.navIndex?this.tree.scrollTop=0:e.top-this.optsRect.top<0&&(this.tree.scrollTop=this.tree.scrollTop+(e.top-this.optsRect.top)),n&&i.removeClass(n,"active"),i.addClass(this.items[this.navIndex],"active")}else this.navigating=!1}.bind(this),this.events.reset=this.reset.bind(this),(this.config.nativeDropdown||this.mobileDevice)&&(this.container.addEventListener("touchstart",(function(e){e.changedTouches[0].target===t.el&&t.toggle()}),!!this.supportsEventPassiveOption&&{passive:!0}),this.container.addEventListener("click",(function(e){e.target===t.el&&t.toggle()})),this.el.addEventListener("change",(function(e){e.__selfTriggered||(t.el.multiple?(e=t.getSelectedProperties("idx"),e=function(e,t){for(var i,n=[],o=e.slice(0),r=0;r<t.length;r++)-1<(i=o.indexOf(t[r]))?o.splice(i,1):n.push(t[r]);return[n,o]}(t.selectedIndexes,e),i.each(e[0],(function(e,i){t.select(i)}),t),i.each(e[1],(function(e,i){t.deselect(i)}),t)):-1<t.el.selectedIndex&&t.select(t.el.selectedIndex))}))),this.config.nativeDropdown&&this.container.addEventListener("keydown",(function(e){"Enter"===e.key&&t.selected===document.activeElement&&(t.toggle(),setTimeout((function(){t.el.focus()}),200))})),this.selected.addEventListener("click",(function(e){t.disabled||t.toggle(),e.preventDefault()})),this.config.nativeKeyboard&&(e="",this.selected.addEventListener("keydown",(function(i){var n;t.disabled||t.selected!==document.activeElement||i.altKey||i.ctrlKey||i.metaKey||(" "===i.key||!t.opened&&-1<["Enter","ArrowUp","ArrowDown"].indexOf(i.key)?(t.toggle(),i.preventDefault(),i.stopPropagation()):i.key.length<=2&&String[String.fromCodePoint?"fromCodePoint":"fromCharCode"](i.key[String.codePointAt?"codePointAt":"charCodeAt"](0))===i.key&&(t.config.multiple?(t.open(),t.config.searchable&&(t.input.value=i.key,t.input.focus(),t.search(null,!0))):(e+=i.key,(n=t.search(e,!0))&&n.length&&(t.clear(),t.setValue(n[0].value)),setTimeout((function(){e=""}),1e3)),i.preventDefault(),i.stopPropagation()))})),this.container.addEventListener("keyup",(function(e){t.opened&&"Escape"===e.key&&(t.close(),e.stopPropagation(),t.selected.focus())}))),this.label.addEventListener("click",(function(e){i.hasClass(e.target,"selectr-tag-remove")&&t.deselect(e.target.parentNode.idx)})),this.selectClear&&this.selectClear.addEventListener("click",this.clear.bind(this)),this.tree.addEventListener("mousedown",(function(e){e.preventDefault()})),this.tree.addEventListener("click",(function(e){var n=i.closest(e.target,(function(e){return e&&i.hasClass(e,"selectr-option")}));n&&!i.hasClass(n,"disabled")&&(i.hasClass(n,"selected")?(t.el.multiple||!t.el.multiple&&t.config.allowDeselect)&&t.deselect(n.idx):t.select(n.idx),t.opened&&!t.el.multiple)&&t.close(),e.preventDefault(),e.stopPropagation()})),this.tree.addEventListener("mouseover",(function(e){!i.hasClass(e.target,"selectr-option")||i.hasClass(e.target,"disabled")||(i.removeClass(t.items[t.navIndex],"active"),i.addClass(e.target,"active"),t.navIndex=[].slice.call(t.items).indexOf(e.target))})),this.config.searchable&&(this.input.addEventListener("focus",(function(e){t.searching=!0})),this.input.addEventListener("blur",(function(e){t.searching=!1})),this.input.addEventListener("keyup",(function(e){t.search(),t.config.taggable||(this.value.length?i.addClass(this.parentNode,"active"):i.removeClass(this.parentNode,"active"))})),this.inputClear.addEventListener("click",(function(e){t.input.value=null,l.call(t),t.tree.childElementCount||r.call(t)}))),this.config.taggable&&this.input.addEventListener("keyup",(function(e){var n,o;t.search(),t.config.taggable&&this.value.length&&(n=this.value.trim()).length&&(13===e.which||t.tagSeperatorsRegex.test(n))&&(e=n.replace(t.tagSeperatorsRegex,""),(o=(e=(e=i.escapeRegExp(e)).trim()).length?t.add({value:e,textContent:e,selected:!0},!0):o)?(t.close(),l.call(t)):(this.value="",t.setMessage(t.config.messages.tagDuplicate)))})),this.update=i.debounce((function(){t.opened&&t.config.closeOnScroll&&t.close(),t.width&&(t.container.style.width=t.width),t.invert()}),50),this.requiresPagination&&(this.paginateItems=i.debounce((function(){a.call(this)}),50),this.tree.addEventListener("scroll",this.paginateItems.bind(this))),document.addEventListener("click",this.events.dismiss),window.addEventListener("keydown",this.events.navigate),window.addEventListener("resize",this.update),window.addEventListener("scroll",this.update),this.on("selectr.destroy",(function(){document.removeEventListener("click",this.events.dismiss),window.removeEventListener("keydown",this.events.navigate),window.removeEventListener("resize",this.update),window.removeEventListener("scroll",this.update)})),this.el.form&&(this.el.form.addEventListener("reset",this.events.reset),this.on("selectr.destroy",(function(){this.el.form.removeEventListener("reset",this.events.reset)})))},c.prototype.setSelected=function(e){var t;this.config.data||this.el.multiple||!this.el.options.length||(0!==this.el.selectedIndex||this.el.options[0].defaultSelected||this.config.defaultSelected||(this.el.selectedIndex=-1),this.selectedIndex=this.el.selectedIndex,-1<this.selectedIndex&&this.select(this.selectedIndex)),this.config.multiple&&"select-one"===this.originalType&&!this.config.data&&this.el.options[0].selected&&!this.el.options[0].defaultSelected&&(this.el.options[0].selected=!1),i.each(this.options,(function(e,t){t.selected&&t.defaultSelected&&this.select(t.idx)}),this),this.config.selectedValue&&this.setValue(this.config.selectedValue),this.config.data&&(!this.el.multiple&&this.config.defaultSelected&&this.el.selectedIndex<0&&0<this.config.data.length&&this.select(0),t=0,i.each(this.config.data,(function(e,o){n(o,"children")?i.each(o.children,(function(e,i){i.hasOwnProperty("selected")&&!0===i.selected&&this.select(t),t++}),this):(o.hasOwnProperty("selected")&&!0===o.selected&&this.select(t),t++)}),this))},c.prototype.destroy=function(){this.rendered&&(this.emit("selectr.destroy"),"select-one"===this.originalType&&(this.el.multiple=!1),this.config.data&&(this.el.innerHTML=""),i.removeClass(this.el,"selectr-hidden"),this.container.parentNode.replaceChild(this.el,this.container),this.rendered=!1,delete this.el.selectr)},c.prototype.change=function(e){var t=this.items[e],n=this.options[e];n.disabled||(n.selected&&i.hasClass(t,"selected")?this.deselect(e):this.select(e),this.opened&&!this.el.multiple&&this.close())},c.prototype.select=function(e){var t=this.items[e],n=[].slice.call(this.el.options),o=this.options[e];if(this.el.multiple){if(i.includes(this.selectedIndexes,e))return!1;if(this.config.maxSelections&&this.tags.length===this.config.maxSelections)return this.setMessage(this.config.messages.maxSelections.replace("{max}",this.config.maxSelections),!0),!1;this.selectedValues.push(o.value),this.selectedIndexes.push(e),function(e){var t,n=this,o=document.createDocumentFragment(),r=this.options[e.idx],s=this.data?this.data[e.idx]:r,a={class:"selectr-tag"};this.customSelected?a.html=this.config.renderSelection(s):a.textContent=r.textContent,s=i.createElement("li",a),a=i.createElement("button",{class:"selectr-tag-remove",type:"button"}),s.appendChild(a),s.idx=e.idx,s.tag=r.value,this.tags.push(s),this.config.sortSelected?(a=this.tags.slice(),t=function(e,t){e.replace(/(\d+)|(\D+)/g,(function(e,i,n){t.push([i||1/0,n||""])}))},a.sort((function(e,i){var o,r,s=[],a=[];for(!0===n.config.sortSelected?(o=e.tag,r=i.tag):"text"===n.config.sortSelected&&(o=e.textContent,r=i.textContent),t(o,s),t(r,a);s.length&&a.length;){var l=s.shift(),c=a.shift();if(l=l[0]-c[0]||l[1].localeCompare(c[1]))return l}return s.length-a.length})),i.each(a,(function(e,t){o.appendChild(t)})),this.label.innerHTML=""):o.appendChild(s),this.config.taggable?this.label.insertBefore(o,this.input.parentNode):this.label.appendChild(o)}.call(this,t)}else{var r=this.data?this.data[e]:o;this.customSelected?this.label.innerHTML=this.config.renderSelection(r):this.label.textContent=o.textContent,this.selectedValue=o.value,this.selectedIndex=e,i.each(this.options,(function(t,n){var o=this.items[t];t!==e&&(o&&i.removeClass(o,"selected"),n.selected=!1,n.removeAttribute("selected"))}),this)}i.includes(n,o)||this.el.add(o),t.setAttribute("aria-selected",!0),i.addClass(t,"selected"),i.addClass(this.container,"has-selected"),o.selected=!0,o.setAttribute("selected",""),this.emit("selectr.change",o),this.emit("selectr.select",o),"createEvent"in document?((r=document.createEvent("HTMLEvents")).initEvent("change",!0,!0),r.__selfTriggered=!0,this.el.dispatchEvent(r)):this.el.fireEvent("onchange")},c.prototype.deselect=function(e,t){var n=this.items[e],o=this.options[e];if(this.el.multiple){var r=this.selectedIndexes.indexOf(e);this.selectedIndexes.splice(r,1),r=this.selectedValues.indexOf(o.value),this.selectedValues.splice(r,1),function(e){var t=!1;i.each(this.tags,(function(i,n){n.idx===e.idx&&(t=n)}),this),t&&(this.label.removeChild(t),this.tags.splice(this.tags.indexOf(t),1))}.call(this,n),this.tags.length||i.removeClass(this.container,"has-selected")}else{if(!t&&!this.config.clearable&&!this.config.allowDeselect)return!1;this.label.innerHTML="",this.selectedValue=null,this.el.selectedIndex=this.selectedIndex=-1,i.removeClass(this.container,"has-selected")}this.items[e].setAttribute("aria-selected",!1),i.removeClass(this.items[e],"selected"),o.selected=!1,o.removeAttribute("selected"),this.emit("selectr.change",null),this.emit("selectr.deselect",o),"createEvent"in document?((r=document.createEvent("HTMLEvents")).initEvent("change",!0,!0),r.__selfTriggered=!0,this.el.dispatchEvent(r)):this.el.fireEvent("onchange")},c.prototype.setValue=function(e){var t=Array.isArray(e);if(t||(e=e.toString().trim()),!this.el.multiple&&t)return!1;i.each(this.options,(function(i,n){(t&&-1<e.indexOf(n.value)||n.value===e)&&this.change(n.idx)}),this)},c.prototype.getValue=function(e,t){var n,o;return this.el.multiple?e?this.selectedIndexes.length&&(o={values:[]},i.each(this.selectedIndexes,(function(e,t){t=this.options[t],o.values[e]={value:t.value,text:t.textContent}}),this)):o=this.selectedValues.slice():o=e?{value:(n=this.options[this.selectedIndex]).value,text:n.textContent}:this.selectedValue,o=e&&t?JSON.stringify(o):o},c.prototype.add=function(e,t){if(e){if(this.data=this.data||[],this.items=this.items||[],this.options=this.options||[],Array.isArray(e))i.each(e,(function(e,i){this.add(i,t)}),this);else if("[object Object]"===Object.prototype.toString.call(e)){if(t){var n=!1;if(i.each(this.options,(function(t,i){i.value.toLowerCase()===e.value.toLowerCase()&&(n=!0)})),n)return!1}var o=i.createElement("option",e);return this.data.push(e),this.mobileDevice&&this.el.add(o),this.options.push(o),o.idx=0<this.options.length?this.options.length-1:0,s.call(this,o),e.selected&&this.select(o.idx),this.setPlaceholder(),o}return this.config.pagination&&this.paginate(),!0}},c.prototype.remove=function(e){var t,n=[];Array.isArray(e)?i.each(e,(function(e,t){i.isInt(t)?n.push(this.getOptionByIndex(t)):"string"==typeof t&&n.push(this.getOptionByValue(t))}),this):i.isInt(e)?n.push(this.getOptionByIndex(e)):"string"==typeof e&&n.push(this.getOptionByValue(e)),n.length&&(i.each(n,(function(e,n){t=n.idx,this.el.remove(n),this.options.splice(t,1),(n=this.items[t].parentNode)&&n.removeChild(this.items[t]),this.items.splice(t,1),i.each(this.options,(function(e,t){t.idx=e,this.items[e].idx=e}),this)}),this),this.setPlaceholder(),this.config.pagination)&&this.paginate()},c.prototype.removeAll=function(){this.clear(!0),i.each(this.el.options,(function(e,t){this.el.remove(t)}),this),i.truncate(this.tree),this.items=[],this.options=[],this.data=[],this.navIndex=0,this.requiresPagination&&(this.requiresPagination=!1,this.pageIndex=1,this.pages=[]),this.setPlaceholder()},c.prototype.search=function(e,t){var n,s,a,l,c;if(!this.navigating)return n=!1,e||(e=this.input.value,n=!0,this.removeMessage(),i.truncate(this.tree)),s=[],a=document.createDocumentFragment(),0<(e=e.trim().toLowerCase()).length?(l=t?i.startsWith:i.includes,i.each(this.options,(function(t,r){var c,h,d,u,p=this.items[r.idx];l(r.textContent.trim().toLowerCase(),e)&&!r.disabled?(s.push({text:r.textContent,value:r.value}),n&&(o(p,a,this.customOption),i.removeClass(p,"excluded"),!this.customOption)&&(c=e,d=r.textContent,u=(c=new RegExp(c,"ig")).exec(d))&&(r.innerHTML="",(h=document.createElement("span")).classList.add("selectr-match"),h.textContent=u[0],r.appendChild(document.createTextNode(d.substring(0,u.index))),r.appendChild(h),r.appendChild(document.createTextNode(d.substring(c.lastIndex))))):n&&i.addClass(p,"excluded")}),this),n&&(a.childElementCount?(t=this.items[this.navIndex],c=a.querySelector(".selectr-option:not(.excluded)"),this.noResults=!1,i.removeClass(t,"active"),this.navIndex=c.idx,i.addClass(c,"active")):this.config.taggable||(this.noResults=!0,this.setMessage(this.config.messages.noResults)),this.tree.appendChild(a))):r.call(this),s},c.prototype.toggle=function(){this.disabled||(this.opened?this.close():this.open())},c.prototype.open=function(){var e=this;if(!this.options.length)return!1;this.opened||this.emit("selectr.open"),this.opened=!0,this.mobileDevice||this.config.nativeDropdown?(i.addClass(this.container,"native-open"),this.config.data&&i.each(this.options,(function(e,t){this.el.add(t)}),this)):(i.addClass(this.container,"open"),r.call(this),this.invert(),this.tree.scrollTop=0,i.removeClass(this.container,"notice"),this.selected.setAttribute("aria-expanded",!0),this.tree.setAttribute("aria-hidden",!1),this.tree.setAttribute("aria-expanded",!0),this.config.searchable&&!this.config.taggable&&setTimeout((function(){e.input.focus(),e.input.tabIndex=0}),10))},c.prototype.close=function(){var e;this.opened&&this.emit("selectr.close"),this.opened=!1,this.navigating=!1,this.mobileDevice||this.config.nativeDropdown?i.removeClass(this.container,"native-open"):(e=i.hasClass(this.container,"notice"),this.config.searchable&&!e&&(this.input.blur(),this.input.tabIndex=-1,this.searching=!1),e&&(i.removeClass(this.container,"notice"),this.notice.textContent=""),i.removeClass(this.container,"open"),i.removeClass(this.container,"native-open"),this.selected.setAttribute("aria-expanded",!1),this.tree.setAttribute("aria-hidden",!0),this.tree.setAttribute("aria-expanded",!1),i.truncate(this.tree),l.call(this))},c.prototype.enable=function(){this.disabled=!1,this.el.disabled=!1,this.selected.tabIndex=this.originalIndex,this.el.multiple&&i.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=0})),i.removeClass(this.container,"selectr-disabled")},c.prototype.disable=function(e){e||(this.el.disabled=!0),this.selected.tabIndex=-1,this.el.multiple&&i.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=-1})),this.disabled=!0,i.addClass(this.container,"selectr-disabled")},c.prototype.reset=function(){this.disabled||(this.clear(),this.setSelected(!0),i.each(this.defaultSelected,(function(e,t){this.select(t)}),this),this.emit("selectr.reset"))},c.prototype.clear=function(e,t){var n;this.el.multiple?this.selectedIndexes.length&&(n=this.selectedIndexes.slice(),t?this.deselect(n.slice(-1)[0]):i.each(n,(function(e,t){this.deselect(t)}),this)):-1<this.selectedIndex&&this.deselect(this.selectedIndex,e),this.emit("selectr.clear")},c.prototype.serialise=function(e){var t=[];return i.each(this.options,(function(e,i){var n={value:i.value,text:i.textContent};i.selected&&(n.selected=!0),i.disabled&&(n.disabled=!0),t[e]=n})),e?JSON.stringify(t):t},c.prototype.serialize=function(e){return this.serialise(e)},c.prototype.setPlaceholder=function(e){e=e||this.config.placeholder||this.el.getAttribute("placeholder"),this.options.length||(e=this.config.messages.noOptions),this.placeEl.innerHTML=e},c.prototype.paginate=function(){var e;if(this.items.length)return(e=this).pages=this.items.map((function(t,i){return i%e.config.pagination==0?e.items.slice(i,i+e.config.pagination):null})).filter((function(e){return e})),this.pages},c.prototype.setMessage=function(e,t){t&&this.close(),i.addClass(this.container,"notice"),this.notice.textContent=e},c.prototype.removeMessage=function(){i.removeClass(this.container,"notice"),this.notice.innerHTML=""},c.prototype.invert=function(){var e=i.rect(this.selected),t=this.tree.parentNode.offsetHeight,n=window.innerHeight;e.top+e.height+t>n?(i.addClass(this.container,"inverted"),this.isInverted=!0):(i.removeClass(this.container,"inverted"),this.isInverted=!1),this.optsRect=i.rect(this.tree)},c.prototype.getOptionByIndex=function(e){return this.options[e]},c.prototype.getOptionByValue=function(e){for(var t=!1,i=0,n=this.options.length;i<n;i++)if(this.options[i].value.trim()===e.toString().trim()){t=this.options[i];break}return t},e.exports=c},4188:function(e,t,i){"use strict";i.d(t,{EX:function(){return o},WF:function(){return r},oW:function(){return s},qD:function(){return n}});var n=document.body,o=10485760,r=2e4,s=2147483648},2602:function(e,t,i){"use strict";i.d(t,{w:function(){return o}});var n=i(9791);function o(e,t,i){var o,r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s="function"==typeof(l=e).getRootNode?l.getRootNode():window,a={},l=e.getBoundingClientRect(),c=t.getBoundingClientRect(),h=document.createElement("div");function d(){if(h&&h.parentNode){for(var t in h.parentNode.removeChild(h),a)o=t,Object.prototype.hasOwnProperty.call(a,o)&&((o=a[t])&&(0,n.removeEventListener)(s,t,o),delete a[t]);"function"==typeof i&&i(e)}var o}function u(e){(e=e.target)===h||(0,n.isChildOf)(e,h)||d()}return h.className="jsoneditor-anchor",h.style.position="absolute",h.style.left=l.left-c.left+"px",h.style.top=l.top-c.top+"px",h.style.width=l.width-2+"px",h.style.height=l.height-2+"px",h.style.boxSizing="border-box",t.appendChild(h),a.mousedown=(0,n.addEventListener)(s,"mousedown",u),a.mousewheel=(0,n.addEventListener)(s,"mousewheel",u),r&&(o=null,h.onmouseover=function(){clearTimeout(o),o=null},h.onmouseout=function(){o=o||setTimeout(d,200)}),h.destroy=d,h}},7923:function(e){e.exports="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBjb21wYXJlUG9pbnRzID0gZnVuY3Rpb24gKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBlbmRDb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgICAgICByb3c6IHN0YXJ0Um93LAogICAgICAgICAgICBjb2x1bW46IHN0YXJ0Q29sdW1uCiAgICAgICAgfTsKICAgICAgICB0aGlzLmVuZCA9IHsKICAgICAgICAgICAgcm93OiBlbmRSb3csCiAgICAgICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICAgICAgfTsKICAgIH0KICAgIFJhbmdlLnByb3RvdHlwZS5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKCJSYW5nZTogWyIgKyB0aGlzLnN0YXJ0LnJvdyArICIvIiArIHRoaXMuc3RhcnQuY29sdW1uICsKICAgICAgICAgICAgIl0gLT4gWyIgKyB0aGlzLmVuZC5yb3cgKyAiLyIgKyB0aGlzLmVuZC5jb2x1bW4gKyAiXSIpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWlucyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDA7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVQb2ludCA9IGZ1bmN0aW9uIChwKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWluc1JhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pc0VuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW47CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbjsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnNldEVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0eXBlb2Ygcm93ID09ICJvYmplY3QiKSB7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdy5yb3c7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3c7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNFbmQocm93LCBjb2x1bW4pIHx8IHRoaXMuaXNTdGFydChyb3csIGNvbHVtbikpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pbnNpZGVFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzU3RhcnQocm93LCBjb2x1bW4pKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmUgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAoIXRoaXMuaXNNdWx0aUxpbmUoKSkgewogICAgICAgICAgICBpZiAocm93ID09PSB0aGlzLnN0YXJ0LnJvdykgewogICAgICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8IHRoaXMuc3RhcnQuY29sdW1uID8gLTEgOiAoY29sdW1uID4gdGhpcy5lbmQuY29sdW1uID8gMSA6IDApOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdykKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIGlmIChyb3cgPiB0aGlzLmVuZC5yb3cpCiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgIGlmICh0aGlzLnN0YXJ0LnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uID49IHRoaXMuc3RhcnQuY29sdW1uID8gMCA6IC0xOwogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdykKICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8PSB0aGlzLmVuZC5jb2x1bW4gPyAwIDogMTsKICAgICAgICByZXR1cm4gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZUluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmV4dGVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIGlmIChjbXAgPT0gMCkKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIGVsc2UKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaXNFbXB0eSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKHRoaXMuc3RhcnQucm93ID09PSB0aGlzLmVuZC5yb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT09IHRoaXMuZW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHRoaXMuc3RhcnQsIHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29sbGFwc2VSb3dzID0gZnVuY3Rpb24gKCkgewogICAgICAgIGlmICh0aGlzLmVuZC5jb2x1bW4gPT0gMCkKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgTWF0aC5tYXgodGhpcy5zdGFydC5yb3csIHRoaXMuZW5kLnJvdyAtIDEpLCAwKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHJldHVybiBuZXcgUmFuZ2UodGhpcy5zdGFydC5yb3csIDAsIHRoaXMuZW5kLnJvdywgMCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLm1vdmVCeSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuc3RhcnQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiArPSBjb2x1bW47CiAgICAgICAgdGhpcy5lbmQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLmVuZC5jb2x1bW4gKz0gY29sdW1uOwogICAgfTsKICAgIHJldHVybiBSYW5nZTsKfSgpKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7ClJhbmdlLmNvbXBhcmVQb2ludHMgPSBmdW5jdGlvbiAocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKZXhwb3J0cy5SYW5nZSA9IFJhbmdlOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvYW5jaG9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBvb3AgPSByZXF1aXJlKCIuL2xpYi9vb3AiKTsKdmFyIEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoIi4vbGliL2V2ZW50X2VtaXR0ZXIiKS5FdmVudEVtaXR0ZXI7CnZhciBBbmNob3IgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7CiAgICBmdW5jdGlvbiBBbmNob3IoZG9jLCByb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuJG9uQ2hhbmdlID0gdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpOwogICAgICAgIHRoaXMuYXR0YWNoKGRvYyk7CiAgICAgICAgaWYgKHR5cGVvZiBjb2x1bW4gPT0gInVuZGVmaW5lZCIpCiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LnJvdywgcm93LmNvbHVtbik7CiAgICAgICAgZWxzZQogICAgICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdywgY29sdW1uKTsKICAgIH0KICAgIEFuY2hvci5wcm90b3R5cGUuZ2V0UG9zaXRpb24gPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQodGhpcy5yb3csIHRoaXMuY29sdW1uKTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmdldERvY3VtZW50ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmRvY3VtZW50OwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUub25DaGFuZ2UgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID09IGRlbHRhLmVuZC5yb3cgJiYgZGVsdGEuc3RhcnQucm93ICE9IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIHBvaW50ID0gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHsgcm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbiB9LCB0aGlzLiRpbnNlcnRSaWdodCk7CiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihwb2ludC5yb3csIHBvaW50LmNvbHVtbiwgdHJ1ZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS5zZXRQb3NpdGlvbiA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbiwgbm9DbGlwKSB7CiAgICAgICAgdmFyIHBvczsKICAgICAgICBpZiAobm9DbGlwKSB7CiAgICAgICAgICAgIHBvcyA9IHsKICAgICAgICAgICAgICAgIHJvdzogcm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBjb2x1bW4KICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvcyA9IHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdmFyIG9sZCA9IHsKICAgICAgICAgICAgcm93OiB0aGlzLnJvdywKICAgICAgICAgICAgY29sdW1uOiB0aGlzLmNvbHVtbgogICAgICAgIH07CiAgICAgICAgdGhpcy5yb3cgPSBwb3Mucm93OwogICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIHsKICAgICAgICAgICAgb2xkOiBvbGQsCiAgICAgICAgICAgIHZhbHVlOiBwb3MKICAgICAgICB9KTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLmRldGFjaCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9mZigiY2hhbmdlIiwgdGhpcy4kb25DaGFuZ2UpOwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUuYXR0YWNoID0gZnVuY3Rpb24gKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBwb3MgPSB7fTsKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KICAgICAgICBpZiAoY29sdW1uIDwgMCkKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgcmV0dXJuIHBvczsKICAgIH07CiAgICByZXR1cm4gQW5jaG9yOwp9KCkpOwpBbmNob3IucHJvdG90eXBlLiRpbnNlcnRSaWdodCA9IGZhbHNlOwpvb3AuaW1wbGVtZW50KEFuY2hvci5wcm90b3R5cGUsIEV2ZW50RW1pdHRlcik7CmZ1bmN0aW9uICRwb2ludHNJbk9yZGVyKHBvaW50MSwgcG9pbnQyLCBlcXVhbFBvaW50c0luT3JkZXIpIHsKICAgIHZhciBiQ29sSXNBZnRlciA9IGVxdWFsUG9pbnRzSW5PcmRlciA/IHBvaW50MS5jb2x1bW4gPD0gcG9pbnQyLmNvbHVtbiA6IHBvaW50MS5jb2x1bW4gPCBwb2ludDIuY29sdW1uOwogICAgcmV0dXJuIChwb2ludDEucm93IDwgcG9pbnQyLnJvdykgfHwgKHBvaW50MS5yb3cgPT0gcG9pbnQyLnJvdyAmJiBiQ29sSXNBZnRlcik7Cn0KZnVuY3Rpb24gJGdldFRyYW5zZm9ybWVkUG9pbnQoZGVsdGEsIHBvaW50LCBtb3ZlSWZFcXVhbCkgewogICAgdmFyIGRlbHRhSXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICB2YXIgZGVsdGFSb3dTaGlmdCA9IChkZWx0YUlzSW5zZXJ0ID8gMSA6IC0xKSAqIChkZWx0YS5lbmQucm93IC0gZGVsdGEuc3RhcnQucm93KTsKICAgIHZhciBkZWx0YUNvbFNoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5jb2x1bW4gLSBkZWx0YS5zdGFydC5jb2x1bW4pOwogICAgdmFyIGRlbHRhU3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIHZhciBkZWx0YUVuZCA9IGRlbHRhSXNJbnNlcnQgPyBkZWx0YVN0YXJ0IDogZGVsdGEuZW5kOyAvLyBDb2xsYXBzZSBpbnNlcnQgcmFuZ2UuCiAgICBpZiAoJHBvaW50c0luT3JkZXIocG9pbnQsIGRlbHRhU3RhcnQsIG1vdmVJZkVxdWFsKSkgewogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHJvdzogcG9pbnQucm93LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbgogICAgICAgIH07CiAgICB9CiAgICBpZiAoJHBvaW50c0luT3JkZXIoZGVsdGFFbmQsIHBvaW50LCAhbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgcm93OiBwb2ludC5yb3cgKyBkZWx0YVJvd1NoaWZ0LAogICAgICAgICAgICBjb2x1bW46IHBvaW50LmNvbHVtbiArIChwb2ludC5yb3cgPT0gZGVsdGFFbmQucm93ID8gZGVsdGFDb2xTaGlmdCA6IDApCiAgICAgICAgfTsKICAgIH0KICAgIHJldHVybiB7CiAgICAgICAgcm93OiBkZWx0YVN0YXJ0LnJvdywKICAgICAgICBjb2x1bW46IGRlbHRhU3RhcnQuY29sdW1uCiAgICB9Owp9CmV4cG9ydHMuQW5jaG9yID0gQW5jaG9yOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvZG9jdW1lbnQiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpeyJ1c2Ugc3RyaWN0IjsKdmFyIG9vcCA9IHJlcXVpcmUoIi4vbGliL29vcCIpOwp2YXIgYXBwbHlEZWx0YSA9IHJlcXVpcmUoIi4vYXBwbHlfZGVsdGEiKS5hcHBseURlbHRhOwp2YXIgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgiLi9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKdmFyIFJhbmdlID0gcmVxdWlyZSgiLi9yYW5nZSIpLlJhbmdlOwp2YXIgQW5jaG9yID0gcmVxdWlyZSgiLi9hbmNob3IiKS5BbmNob3I7CnZhciBEb2N1bWVudCA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIERvY3VtZW50KHRleHRPckxpbmVzKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIGlmICh0ZXh0T3JMaW5lcy5sZW5ndGggPT09IDApIHsKICAgICAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChBcnJheS5pc0FycmF5KHRleHRPckxpbmVzKSkgewogICAgICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiAwLCBjb2x1bW46IDAgfSwgdGV4dE9yTGluZXMpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICAgICAgfQogICAgfQogICAgRG9jdW1lbnQucHJvdG90eXBlLnNldFZhbHVlID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbGVuID0gdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdGhpcy5yZW1vdmUobmV3IFJhbmdlKDAsIDAsIGxlbiwgdGhpcy5nZXRMaW5lKGxlbikubGVuZ3RoKSk7CiAgICAgICAgdGhpcy5pbnNlcnQoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0IHx8ICIiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0VmFsdWUgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0QWxsTGluZXMoKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuY3JlYXRlQW5jaG9yID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIG5ldyBBbmNob3IodGhpcywgcm93LCBjb2x1bW4pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kZGV0ZWN0TmV3TGluZSA9IGZ1bmN0aW9uICh0ZXh0KSB7CiAgICAgICAgdmFyIG1hdGNoID0gdGV4dC5tYXRjaCgvXi4qPyhcclxufFxyfFxuKS9tKTsKICAgICAgICB0aGlzLiRhdXRvTmV3TGluZSA9IG1hdGNoID8gbWF0Y2hbMV0gOiAiXG4iOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TmV3TGluZUNoYXJhY3RlciA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBzd2l0Y2ggKHRoaXMuJG5ld0xpbmVNb2RlKSB7CiAgICAgICAgICAgIGNhc2UgIndpbmRvd3MiOgogICAgICAgICAgICAgICAgcmV0dXJuICJcclxuIjsKICAgICAgICAgICAgY2FzZSAidW5peCI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxuIjsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLiRhdXRvTmV3TGluZSB8fCAiXG4iOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuc2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAobmV3TGluZU1vZGUpIHsKICAgICAgICBpZiAodGhpcy4kbmV3TGluZU1vZGUgPT09IG5ld0xpbmVNb2RlKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgdGhpcy4kbmV3TGluZU1vZGUgPSBuZXdMaW5lTW9kZTsKICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZU5ld0xpbmVNb2RlIik7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldE5ld0xpbmVNb2RlID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRuZXdMaW5lTW9kZTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaXNOZXdMaW5lID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gKHRleHQgPT0gIlxyXG4iIHx8IHRleHQgPT0gIlxyIiB8fCB0ZXh0ID09ICJcbiIpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lID0gZnVuY3Rpb24gKHJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lc1tyb3ddIHx8ICIiOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5zbGljZShmaXJzdFJvdywgbGFzdFJvdyArIDEpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRBbGxMaW5lcyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRMaW5lcygwLCB0aGlzLmdldExlbmd0aCgpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TGVuZ3RoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldFRleHRSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzRm9yUmFuZ2UocmFuZ2UpLmpvaW4odGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMaW5lc0ZvclJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIGxpbmVzOwogICAgICAgIGlmIChyYW5nZS5zdGFydC5yb3cgPT09IHJhbmdlLmVuZC5yb3cpIHsKICAgICAgICAgICAgbGluZXMgPSBbdGhpcy5nZXRMaW5lKHJhbmdlLnN0YXJ0LnJvdykuc3Vic3RyaW5nKHJhbmdlLnN0YXJ0LmNvbHVtbiwgcmFuZ2UuZW5kLmNvbHVtbildOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgbGluZXMgPSB0aGlzLmdldExpbmVzKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2UuZW5kLnJvdyk7CiAgICAgICAgICAgIGxpbmVzWzBdID0gKGxpbmVzWzBdIHx8ICIiKS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSAxOwogICAgICAgICAgICBpZiAocmFuZ2UuZW5kLnJvdyAtIHJhbmdlLnN0YXJ0LnJvdyA9PSBsKQogICAgICAgICAgICAgICAgbGluZXNbbF0gPSBsaW5lc1tsXS5zdWJzdHJpbmcoMCwgcmFuZ2UuZW5kLmNvbHVtbik7CiAgICAgICAgfQogICAgICAgIHJldHVybiBsaW5lczsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TGluZXMgPSBmdW5jdGlvbiAocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlTGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5yZW1vdmVMaW5lcyBpcyBkZXByZWNhdGVkLiBVc2UgdGhlIHJlbW92ZUZ1bGxMaW5lcyBtZXRob2QgaW5zdGVhZC4iKTsKICAgICAgICByZXR1cm4gdGhpcy5yZW1vdmVGdWxsTGluZXMoZmlyc3RSb3csIGxhc3RSb3cpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnROZXdMaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQuaW5zZXJ0TmV3TGluZSBpcyBkZXByZWNhdGVkLiBVc2UgaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsnJywgJyddKSBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydE1lcmdlZExpbmVzKHBvc2l0aW9uLCBbIiIsICIiXSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydCA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0SW5MaW5lID0gZnVuY3Rpb24gKHBvc2l0aW9uLCB0ZXh0KSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5wb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4gKyB0ZXh0Lmxlbmd0aCk7CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IFt0ZXh0XQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsaXBwZWRQb3MgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocm93ID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChyb3cgPCAwKSB7CiAgICAgICAgICAgIHJvdyA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcm93ID0gbGVuZ3RoIC0gMTsKICAgICAgICAgICAgY29sdW1uID0gdW5kZWZpbmVkOwogICAgICAgIH0KICAgICAgICB2YXIgbGluZSA9IHRoaXMuZ2V0TGluZShyb3cpOwogICAgICAgIGlmIChjb2x1bW4gPT0gdW5kZWZpbmVkKQogICAgICAgICAgICBjb2x1bW4gPSBsaW5lLmxlbmd0aDsKICAgICAgICBjb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChjb2x1bW4sIDApLCBsaW5lLmxlbmd0aCk7CiAgICAgICAgcmV0dXJuIHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmNsb25lUG9zID0gZnVuY3Rpb24gKHBvcykgewogICAgICAgIHJldHVybiB7IHJvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kY2xpcFBvc2l0aW9uID0gZnVuY3Rpb24gKHBvc2l0aW9uKSB7CiAgICAgICAgdmFyIGxlbmd0aCA9IHRoaXMuZ2V0TGVuZ3RoKCk7CiAgICAgICAgaWYgKHBvc2l0aW9uLnJvdyA+PSBsZW5ndGgpIHsKICAgICAgICAgICAgcG9zaXRpb24ucm93ID0gTWF0aC5tYXgoMCwgbGVuZ3RoIC0gMSk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IHRoaXMuZ2V0TGluZShsZW5ndGggLSAxKS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBwb3NpdGlvbi5yb3cpOwogICAgICAgICAgICBwb3NpdGlvbi5jb2x1bW4gPSBNYXRoLm1pbihNYXRoLm1heChwb3NpdGlvbi5jb2x1bW4sIDApLCB0aGlzLmdldExpbmUocG9zaXRpb24ucm93KS5sZW5ndGgpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcG9zaXRpb247CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgcm93ID0gTWF0aC5taW4oTWF0aC5tYXgocm93LCAwKSwgdGhpcy5nZXRMZW5ndGgoKSk7CiAgICAgICAgdmFyIGNvbHVtbiA9IDA7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgbGluZXMgPSBsaW5lcy5jb25jYXQoWyIiXSk7CiAgICAgICAgICAgIGNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH0sIGxpbmVzKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0TWVyZ2VkTGluZXMgPSBmdW5jdGlvbiAocG9zaXRpb24sIGxpbmVzKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gewogICAgICAgICAgICByb3c6IHN0YXJ0LnJvdyArIGxpbmVzLmxlbmd0aCAtIDEsCiAgICAgICAgICAgIGNvbHVtbjogKGxpbmVzLmxlbmd0aCA9PSAxID8gc3RhcnQuY29sdW1uIDogMCkgKyBsaW5lc1tsaW5lcy5sZW5ndGggLSAxXS5sZW5ndGgKICAgICAgICB9OwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogImluc2VydCIsCiAgICAgICAgICAgIGxpbmVzOiBsaW5lcwogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5zdGFydC5yb3csIHJhbmdlLnN0YXJ0LmNvbHVtbik7CiAgICAgICAgdmFyIGVuZCA9IHRoaXMuY2xpcHBlZFBvcyhyYW5nZS5lbmQucm93LCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlSW5MaW5lID0gZnVuY3Rpb24gKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHsgc3RhcnQ6IHN0YXJ0LCBlbmQ6IGVuZCB9KQogICAgICAgIH0sIHRydWUpOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlRnVsbExpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgZmlyc3RSb3cgPSBNYXRoLm1pbihNYXRoLm1heCgwLCBmaXJzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICBsYXN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgbGFzdFJvdyksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICB2YXIgZGVsZXRlRmlyc3ROZXdMaW5lID0gbGFzdFJvdyA9PSB0aGlzLmdldExlbmd0aCgpIC0gMSAmJiBmaXJzdFJvdyA+IDA7CiAgICAgICAgdmFyIGRlbGV0ZUxhc3ROZXdMaW5lID0gbGFzdFJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxOwogICAgICAgIHZhciBzdGFydFJvdyA9IChkZWxldGVGaXJzdE5ld0xpbmUgPyBmaXJzdFJvdyAtIDEgOiBmaXJzdFJvdyk7CiAgICAgICAgdmFyIHN0YXJ0Q29sID0gKGRlbGV0ZUZpcnN0TmV3TGluZSA/IHRoaXMuZ2V0TGluZShzdGFydFJvdykubGVuZ3RoIDogMCk7CiAgICAgICAgdmFyIGVuZFJvdyA9IChkZWxldGVMYXN0TmV3TGluZSA/IGxhc3RSb3cgKyAxIDogbGFzdFJvdyk7CiAgICAgICAgdmFyIGVuZENvbCA9IChkZWxldGVMYXN0TmV3TGluZSA/IDAgOiB0aGlzLmdldExpbmUoZW5kUm93KS5sZW5ndGgpOwogICAgICAgIHZhciByYW5nZSA9IG5ldyBSYW5nZShzdGFydFJvdywgc3RhcnRDb2wsIGVuZFJvdywgZW5kQ29sKTsKICAgICAgICB2YXIgZGVsZXRlZExpbmVzID0gdGhpcy4kbGluZXMuc2xpY2UoZmlyc3RSb3csIGxhc3RSb3cgKyAxKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogcmFuZ2Uuc3RhcnQsCiAgICAgICAgICAgIGVuZDogcmFuZ2UuZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHJhbmdlKQogICAgICAgIH0pOwogICAgICAgIHJldHVybiBkZWxldGVkTGluZXM7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlbW92ZU5ld0xpbmUgPSBmdW5jdGlvbiAocm93KSB7CiAgICAgICAgaWYgKHJvdyA8IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxICYmIHJvdyA+PSAwKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93LCB0aGlzLmdldExpbmUocm93KS5sZW5ndGgpLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyAxLCAwKSwKICAgICAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgICAgICBsaW5lczogWyIiLCAiIl0KICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZXBsYWNlID0gZnVuY3Rpb24gKHJhbmdlLCB0ZXh0KSB7CiAgICAgICAgaWYgKCEocmFuZ2UgaW5zdGFuY2VvZiBSYW5nZSkpCiAgICAgICAgICAgIHJhbmdlID0gUmFuZ2UuZnJvbVBvaW50cyhyYW5nZS5zdGFydCwgcmFuZ2UuZW5kKTsKICAgICAgICBpZiAodGV4dC5sZW5ndGggPT09IDAgJiYgcmFuZ2UuaXNFbXB0eSgpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgaWYgKHRleHQgPT0gdGhpcy5nZXRUZXh0UmFuZ2UocmFuZ2UpKQogICAgICAgICAgICByZXR1cm4gcmFuZ2UuZW5kOwogICAgICAgIHRoaXMucmVtb3ZlKHJhbmdlKTsKICAgICAgICB2YXIgZW5kOwogICAgICAgIGlmICh0ZXh0KSB7CiAgICAgICAgICAgIGVuZCA9IHRoaXMuaW5zZXJ0KHJhbmdlLnN0YXJ0LCB0ZXh0KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGVuZCA9IHJhbmdlLnN0YXJ0OwogICAgICAgIH0KICAgICAgICByZXR1cm4gZW5kOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5hcHBseURlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRlbHRhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJldmVydERlbHRhcyA9IGZ1bmN0aW9uIChkZWx0YXMpIHsKICAgICAgICBmb3IgKHZhciBpID0gZGVsdGFzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgICAgIHRoaXMucmV2ZXJ0RGVsdGEoZGVsdGFzW2ldKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgICAgICB2YXIgaXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgaWYgKGlzSW5zZXJ0ID8gZGVsdGEubGluZXMubGVuZ3RoIDw9IDEgJiYgIWRlbHRhLmxpbmVzWzBdCiAgICAgICAgICAgIDogIVJhbmdlLmNvbXBhcmVQb2ludHMoZGVsdGEuc3RhcnQsIGRlbHRhLmVuZCkpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAoaXNJbnNlcnQgJiYgZGVsdGEubGluZXMubGVuZ3RoID4gMjAwMDApIHsKICAgICAgICAgICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEoZGVsdGEsIDIwMDAwKTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGFwcGx5RGVsdGEodGhpcy4kbGluZXMsIGRlbHRhLCBkb05vdFZhbGlkYXRlKTsKICAgICAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2UiLCBkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kc2FmZUFwcGx5RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB2YXIgZG9jTGVuZ3RoID0gdGhpcy4kbGluZXMubGVuZ3RoOwogICAgICAgIGlmIChkZWx0YS5hY3Rpb24gPT0gInJlbW92ZSIgJiYgZGVsdGEuc3RhcnQucm93IDwgZG9jTGVuZ3RoICYmIGRlbHRhLmVuZC5yb3cgPCBkb2NMZW5ndGgKICAgICAgICAgICAgfHwgZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiICYmIGRlbHRhLnN0YXJ0LnJvdyA8PSBkb2NMZW5ndGgpIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRzcGxpdEFuZGFwcGx5TGFyZ2VEZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSwgTUFYKSB7CiAgICAgICAgdmFyIGxpbmVzID0gZGVsdGEubGluZXM7CiAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSBNQVggKyAxOwogICAgICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICAgICAgdmFyIGNvbHVtbiA9IGRlbHRhLnN0YXJ0LmNvbHVtbjsKICAgICAgICBmb3IgKHZhciBmcm9tID0gMCwgdG8gPSAwOyBmcm9tIDwgbDsgZnJvbSA9IHRvKSB7CiAgICAgICAgICAgIHRvICs9IE1BWCAtIDE7CiAgICAgICAgICAgIHZhciBjaHVuayA9IGxpbmVzLnNsaWNlKGZyb20sIHRvKTsKICAgICAgICAgICAgY2h1bmsucHVzaCgiIik7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgICAgICBzdGFydDogdGhpcy5wb3Mocm93ICsgZnJvbSwgY29sdW1uKSwKICAgICAgICAgICAgICAgIGVuZDogdGhpcy5wb3Mocm93ICsgdG8sIGNvbHVtbiA9IDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiBkZWx0YS5hY3Rpb24sCiAgICAgICAgICAgICAgICBsaW5lczogY2h1bmsKICAgICAgICAgICAgfSwgdHJ1ZSk7CiAgICAgICAgfQogICAgICAgIGRlbHRhLmxpbmVzID0gbGluZXMuc2xpY2UoZnJvbSk7CiAgICAgICAgZGVsdGEuc3RhcnQucm93ID0gcm93ICsgZnJvbTsKICAgICAgICBkZWx0YS5zdGFydC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhLCB0cnVlKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmV2ZXJ0RGVsdGEgPSBmdW5jdGlvbiAoZGVsdGEpIHsKICAgICAgICB0aGlzLiRzYWZlQXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiB0aGlzLmNsb25lUG9zKGRlbHRhLnN0YXJ0KSwKICAgICAgICAgICAgZW5kOiB0aGlzLmNsb25lUG9zKGRlbHRhLmVuZCksCiAgICAgICAgICAgIGFjdGlvbjogKGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiA/ICJyZW1vdmUiIDogImluc2VydCIpLAogICAgICAgICAgICBsaW5lczogZGVsdGEubGluZXMuc2xpY2UoKQogICAgICAgIH0pOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbmRleFRvUG9zaXRpb24gPSBmdW5jdGlvbiAoaW5kZXgsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwLCBsID0gbGluZXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7CiAgICAgICAgICAgIGluZGV4IC09IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgICAgIGlmIChpbmRleCA8IDApCiAgICAgICAgICAgICAgICByZXR1cm4geyByb3c6IGksIGNvbHVtbjogaW5kZXggKyBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoIH07CiAgICAgICAgfQogICAgICAgIHJldHVybiB7IHJvdzogbCAtIDEsIGNvbHVtbjogaW5kZXggKyBsaW5lc1tsIC0gMV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aCB9OwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5wb3NpdGlvblRvSW5kZXggPSBmdW5jdGlvbiAocG9zLCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICB2YXIgaW5kZXggPSAwOwogICAgICAgIHZhciByb3cgPSBNYXRoLm1pbihwb3Mucm93LCBsaW5lcy5sZW5ndGgpOwogICAgICAgIGZvciAodmFyIGkgPSBzdGFydFJvdyB8fCAwOyBpIDwgcm93OyArK2kpCiAgICAgICAgICAgIGluZGV4ICs9IGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGg7CiAgICAgICAgcmV0dXJuIGluZGV4ICsgcG9zLmNvbHVtbjsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuJHNwbGl0ID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICByZXR1cm4gdGV4dC5zcGxpdCgvXHJcbnxccnxcbi8pOwogICAgfTsKICAgIHJldHVybiBEb2N1bWVudDsKfSgpKTsKRG9jdW1lbnQucHJvdG90eXBlLiRhdXRvTmV3TGluZSA9ICIiOwpEb2N1bWVudC5wcm90b3R5cGUuJG5ld0xpbmVNb2RlID0gImF1dG8iOwpvb3AuaW1wbGVtZW50KERvY3VtZW50LnByb3RvdHlwZSwgRXZlbnRFbWl0dGVyKTsKZXhwb3J0cy5Eb2N1bWVudCA9IERvY3VtZW50OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbGliL2RlZXBfY29weSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7ZXhwb3J0cy5kZWVwQ29weSA9IGZ1bmN0aW9uIGRlZXBDb3B5KG9iaikgewogICAgaWYgKHR5cGVvZiBvYmogIT09ICJvYmplY3QiIHx8ICFvYmopCiAgICAgICAgcmV0dXJuIG9iajsKICAgIHZhciBjb3B5OwogICAgaWYgKEFycmF5LmlzQXJyYXkob2JqKSkgewogICAgICAgIGNvcHkgPSBbXTsKICAgICAgICBmb3IgKHZhciBrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgewogICAgICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBjb3B5OwogICAgfQogICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopICE9PSAiW29iamVjdCBPYmplY3RdIikKICAgICAgICByZXR1cm4gb2JqOwogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9sYW5nIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMubGFzdCA9IGZ1bmN0aW9uIChhKSB7CiAgICByZXR1cm4gYVthLmxlbmd0aCAtIDFdOwp9OwpleHBvcnRzLnN0cmluZ1JldmVyc2UgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnNwbGl0KCIiKS5yZXZlcnNlKCkuam9pbigiIik7Cn07CmV4cG9ydHMuc3RyaW5nUmVwZWF0ID0gZnVuY3Rpb24gKHN0cmluZywgY291bnQpIHsKICAgIHZhciByZXN1bHQgPSAnJzsKICAgIHdoaWxlIChjb3VudCA+IDApIHsKICAgICAgICBpZiAoY291bnQgJiAxKQogICAgICAgICAgICByZXN1bHQgKz0gc3RyaW5nOwogICAgICAgIGlmIChjb3VudCA+Pj0gMSkKICAgICAgICAgICAgc3RyaW5nICs9IHN0cmluZzsKICAgIH0KICAgIHJldHVybiByZXN1bHQ7Cn07CnZhciB0cmltQmVnaW5SZWdleHAgPSAvXlxzXHMqLzsKdmFyIHRyaW1FbmRSZWdleHAgPSAvXHNccyokLzsKZXhwb3J0cy5zdHJpbmdUcmltTGVmdCA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSh0cmltQmVnaW5SZWdleHAsICcnKTsKfTsKZXhwb3J0cy5zdHJpbmdUcmltUmlnaHQgPSBmdW5jdGlvbiAoc3RyaW5nKSB7CiAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UodHJpbUVuZFJlZ2V4cCwgJycpOwp9OwpleHBvcnRzLmNvcHlPYmplY3QgPSBmdW5jdGlvbiAob2JqKSB7CiAgICB2YXIgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikgewogICAgICAgIGNvcHlba2V5XSA9IG9ialtrZXldOwogICAgfQogICAgcmV0dXJuIGNvcHk7Cn07CmV4cG9ydHMuY29weUFycmF5ID0gZnVuY3Rpb24gKGFycmF5KSB7CiAgICB2YXIgY29weSA9IFtdOwogICAgZm9yICh2YXIgaSA9IDAsIGwgPSBhcnJheS5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICBpZiAoYXJyYXlbaV0gJiYgdHlwZW9mIGFycmF5W2ldID09ICJvYmplY3QiKQogICAgICAgICAgICBjb3B5W2ldID0gdGhpcy5jb3B5T2JqZWN0KGFycmF5W2ldKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNvcHlbaV0gPSBhcnJheVtpXTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwpleHBvcnRzLmRlZXBDb3B5ID0gcmVxdWlyZSgiLi9kZWVwX2NvcHkiKS5kZWVwQ29weTsKZXhwb3J0cy5hcnJheVRvTWFwID0gZnVuY3Rpb24gKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHsKICAgICAgICBtYXBbYXJyW2ldXSA9IDE7CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmNyZWF0ZU1hcCA9IGZ1bmN0aW9uIChwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24gKGFycmF5LCB2YWx1ZSkgewogICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAodmFsdWUgPT09IGFycmF5W2ldKSB7CiAgICAgICAgICAgIGFycmF5LnNwbGljZShpLCAxKTsKICAgICAgICB9CiAgICB9Cn07CmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8oWy4qKz9eJHt9KCl8W1xdXC9cXF0pL2csICdcXCQxJyk7Cn07CmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHJldHVybiAoIiIgKyBzdHIpLnJlcGxhY2UoLyYvZywgIiYjMzg7IikucmVwbGFjZSgvIi9nLCAiJiMzNDsiKS5yZXBsYWNlKC8nL2csICImIzM5OyIpLnJlcGxhY2UoLzwvZywgIiYjNjA7Iik7Cn07CmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24gKHN0cmluZywgcmVnRXhwKSB7CiAgICB2YXIgbWF0Y2hlcyA9IFtdOwogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbiAoc3RyKSB7CiAgICAgICAgbWF0Y2hlcy5wdXNoKHsKICAgICAgICAgICAgb2Zmc2V0OiBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwogICAgcmV0dXJuIG1hdGNoZXM7Cn07CmV4cG9ydHMuZGVmZXJyZWRDYWxsID0gZnVuY3Rpb24gKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBkZWZlcnJlZC5jYW5jZWwoKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgMCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CiAgICBkZWZlcnJlZC5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKICAgIGRlZmVycmVkLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gZGVmZXJyZWQ7Cn07CmV4cG9ydHMuZGVsYXllZENhbGwgPSBmdW5jdGlvbiAoZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICBpZiAodGltZXIgPT0gbnVsbCkKICAgICAgICAgICAgdGltZXIgPSBzZXRUaW1lb3V0KGNhbGxiYWNrLCB0aW1lb3V0IHx8IGRlZmF1bHRUaW1lb3V0KTsKICAgIH07CiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uICh0aW1lb3V0KSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLnNjaGVkdWxlID0gX3NlbGY7CiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICB9OwogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyICYmIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgfTsKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwogICAgcmV0dXJuIF9zZWxmOwp9OwpleHBvcnRzLnN1cHBvcnRzTG9va2JlaGluZCA9IGZ1bmN0aW9uICgpIHsKICAgIHRyeSB7CiAgICAgICAgbmV3IFJlZ0V4cCgnKD88PS4pJyk7CiAgICB9CiAgICBjYXRjaCAoZSkgewogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9OwpleHBvcnRzLnN1cHBvcnRzVW5pY29kZUZsYWcgPSBmdW5jdGlvbiAoKSB7CiAgICB0cnkgewogICAgICAgIG5ldyBSZWdFeHAoJ14uJCcsICd1Jyk7CiAgICB9CiAgICBjYXRjaCAoZXJyb3IpIHsKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3dvcmtlci9taXJyb3IiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIERvY3VtZW50ID0gcmVxdWlyZSgiLi4vZG9jdW1lbnQiKS5Eb2N1bWVudDsKdmFyIGxhbmcgPSByZXF1aXJlKCIuLi9saWIvbGFuZyIpOwogICAgCnZhciBNaXJyb3IgPSBleHBvcnRzLk1pcnJvciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgdGhpcy5zZW5kZXIgPSBzZW5kZXI7CiAgICB2YXIgZG9jID0gdGhpcy5kb2MgPSBuZXcgRG9jdW1lbnQoIiIpOwogICAgCiAgICB2YXIgZGVmZXJyZWRVcGRhdGUgPSB0aGlzLmRlZmVycmVkVXBkYXRlID0gbGFuZy5kZWxheWVkQ2FsbCh0aGlzLm9uVXBkYXRlLmJpbmQodGhpcykpOwogICAgCiAgICB2YXIgX3NlbGYgPSB0aGlzOwogICAgc2VuZGVyLm9uKCJjaGFuZ2UiLCBmdW5jdGlvbihlKSB7CiAgICAgICAgdmFyIGRhdGEgPSBlLmRhdGE7CiAgICAgICAgaWYgKGRhdGFbMF0uc3RhcnQpIHsKICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGFzKGRhdGEpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkgKz0gMikgewogICAgICAgICAgICAgICAgdmFyIGQsIGVycjsgCiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShkYXRhW2krMV0pKSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJpbnNlcnQiLCBzdGFydDogZGF0YVtpXSwgbGluZXM6IGRhdGFbaSsxXX07CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGQgPSB7YWN0aW9uOiAicmVtb3ZlIiwgc3RhcnQ6IGRhdGFbaV0sIGVuZDogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgaWYgKChkLmFjdGlvbiA9PSAiaW5zZXJ0IiA/IGQuc3RhcnQgOiBkLmVuZCkucm93ID49IGRvYy4kbGluZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgZXJyID0gbmV3IEVycm9yKCJJbnZhbGlkIGRlbHRhIik7CiAgICAgICAgICAgICAgICAgICAgZXJyLmRhdGEgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IF9zZWxmLiRwYXRoLAogICAgICAgICAgICAgICAgICAgICAgICBsaW5lc0xlbmd0aDogZG9jLiRsaW5lcy5sZW5ndGgsCiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBkLnN0YXJ0LAogICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IGQuZW5kCiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICB0aHJvdyBlcnI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZG9jLmFwcGx5RGVsdGEoZCwgdHJ1ZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKF9zZWxmLiR0aW1lb3V0KQogICAgICAgICAgICByZXR1cm4gZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUoX3NlbGYuJHRpbWVvdXQpOwogICAgICAgIF9zZWxmLm9uVXBkYXRlKCk7CiAgICB9KTsKfTsKCihmdW5jdGlvbigpIHsKICAgIAogICAgdGhpcy4kdGltZW91dCA9IDUwMDsKICAgIAogICAgdGhpcy5zZXRUaW1lb3V0ID0gZnVuY3Rpb24odGltZW91dCkgewogICAgICAgIHRoaXMuJHRpbWVvdXQgPSB0aW1lb3V0OwogICAgfTsKICAgIAogICAgdGhpcy5zZXRWYWx1ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7CiAgICAgICAgdGhpcy5kb2Muc2V0VmFsdWUodmFsdWUpOwogICAgICAgIHRoaXMuZGVmZXJyZWRVcGRhdGUuc2NoZWR1bGUodGhpcy4kdGltZW91dCk7CiAgICB9OwogICAgCiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24oY2FsbGJhY2tJZCkgewogICAgICAgIHRoaXMuc2VuZGVyLmNhbGxiYWNrKHRoaXMuZG9jLmdldFZhbHVlKCksIGNhbGxiYWNrSWQpOwogICAgfTsKICAgIAogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgfTsKICAgIAogICAgdGhpcy5pc1BlbmRpbmcgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gdGhpcy5kZWZlcnJlZFVwZGF0ZS5pc1BlbmRpbmcoKTsKICAgIH07CiAgICAKfSkuY2FsbChNaXJyb3IucHJvdG90eXBlKTsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbi9qc29uX3BhcnNlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCiAgICB2YXIgYXQsICAgICAvLyBUaGUgaW5kZXggb2YgdGhlIGN1cnJlbnQgY2hhcmFjdGVyCiAgICAgICAgY2gsICAgICAvLyBUaGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBlc2NhcGVlID0gewogICAgICAgICAgICAnIic6ICAnIicsCiAgICAgICAgICAgICdcXCc6ICdcXCcsCiAgICAgICAgICAgICcvJzogICcvJywKICAgICAgICAgICAgYjogICAgJ1xiJywKICAgICAgICAgICAgZjogICAgJ1xmJywKICAgICAgICAgICAgbjogICAgJ1xuJywKICAgICAgICAgICAgcjogICAgJ1xyJywKICAgICAgICAgICAgdDogICAgJ1x0JwogICAgICAgIH0sCiAgICAgICAgdGV4dCwKCiAgICAgICAgZXJyb3IgPSBmdW5jdGlvbiAobSkgewoKICAgICAgICAgICAgdGhyb3cgewogICAgICAgICAgICAgICAgbmFtZTogICAgJ1N5bnRheEVycm9yJywKICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG0sCiAgICAgICAgICAgICAgICBhdDogICAgICBhdCwKICAgICAgICAgICAgICAgIHRleHQ6ICAgIHRleHQKICAgICAgICAgICAgfTsKICAgICAgICB9LAoKICAgICAgICBuZXh0ID0gZnVuY3Rpb24gKGMpIHsKCiAgICAgICAgICAgIGlmIChjICYmIGMgIT09IGNoKSB7CiAgICAgICAgICAgICAgICBlcnJvcigiRXhwZWN0ZWQgJyIgKyBjICsgIicgaW5zdGVhZCBvZiAnIiArIGNoICsgIiciKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgY2ggPSB0ZXh0LmNoYXJBdChhdCk7CiAgICAgICAgICAgIGF0ICs9IDE7CiAgICAgICAgICAgIHJldHVybiBjaDsKICAgICAgICB9LAoKICAgICAgICBudW1iZXIgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgbnVtYmVyLAogICAgICAgICAgICAgICAgc3RyaW5nID0gJyc7CgogICAgICAgICAgICBpZiAoY2ggPT09ICctJykgewogICAgICAgICAgICAgICAgc3RyaW5nID0gJy0nOwogICAgICAgICAgICAgICAgbmV4dCgnLScpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnLicpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSAnLic7CiAgICAgICAgICAgICAgICB3aGlsZSAobmV4dCgpICYmIGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGNoID09PSAnZScgfHwgY2ggPT09ICdFJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgbmV4dCgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnLScgfHwgY2ggPT09ICcrJykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB3aGlsZSAoY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgbnVtYmVyID0gK3N0cmluZzsKICAgICAgICAgICAgaWYgKGlzTmFOKG51bWJlcikpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJCYWQgbnVtYmVyIik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyOwogICAgICAgICAgICB9CiAgICAgICAgfSwKCiAgICAgICAgc3RyaW5nID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGhleCwKICAgICAgICAgICAgICAgIGksCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJywKICAgICAgICAgICAgICAgIHVmZmZmOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnIicpIHsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ3UnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSArPSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4ID0gcGFyc2VJbnQobmV4dCgpLCAxNik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0Zpbml0ZShoZXgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ZmZmZiA9IHVmZmZmICogMTYgKyBoZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gU3RyaW5nLmZyb21DaGFyQ29kZSh1ZmZmZik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGVzY2FwZWVbY2hdID09PSAnc3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGVzY2FwZWVbY2hdOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09ICJcbiIgfHwgY2ggPT0gIlxyIikgewogICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgc3RyaW5nIik7CiAgICAgICAgfSwKCiAgICAgICAgd2hpdGUgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB3aGlsZSAoY2ggJiYgY2ggPD0gJyAnKSB7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICB3b3JkID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgc3dpdGNoIChjaCkgewogICAgICAgICAgICBjYXNlICd0JzoKICAgICAgICAgICAgICAgIG5leHQoJ3QnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3InKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICBjYXNlICdmJzoKICAgICAgICAgICAgICAgIG5leHQoJ2YnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2EnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ3MnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2UnKTsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgY2FzZSAnbic6CiAgICAgICAgICAgICAgICBuZXh0KCduJyk7CiAgICAgICAgICAgICAgICBuZXh0KCd1Jyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICBuZXh0KCdsJyk7CiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiVW5leHBlY3RlZCAnIiArIGNoICsgIiciKTsKICAgICAgICB9LAoKICAgICAgICB2YWx1ZSwgIC8vIFBsYWNlIGhvbGRlciBmb3IgdGhlIHZhbHVlIGZ1bmN0aW9uLgoKICAgICAgICBhcnJheSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBhcnJheSA9IFtdOwoKICAgICAgICAgICAgaWYgKGNoID09PSAnWycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ1snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXk7ICAgLy8gZW1wdHkgYXJyYXkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGFycmF5LnB1c2godmFsdWUoKSk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICddJykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCddJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBhcnJheSIpOwogICAgICAgIH0sCgogICAgICAgIG9iamVjdCA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBrZXksCiAgICAgICAgICAgICAgICBvYmplY3QgPSB7fTsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJ3snKSB7CiAgICAgICAgICAgICAgICBuZXh0KCd7Jyk7CiAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgaWYgKGNoID09PSAnfScpIHsKICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsgICAvLyBlbXB0eSBvYmplY3QKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCkgewogICAgICAgICAgICAgICAgICAgIGtleSA9IHN0cmluZygpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnOicpOwogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ0R1cGxpY2F0ZSBrZXkgIicgKyBrZXkgKyAnIicpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBvYmplY3Rba2V5XSA9IHZhbHVlKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgICAgICBuZXh0KCd9Jyk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3Q7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG5leHQoJywnKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJCYWQgb2JqZWN0Iik7CiAgICAgICAgfTsKCiAgICB2YWx1ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgd2hpdGUoKTsKICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgY2FzZSAneyc6CiAgICAgICAgICAgIHJldHVybiBvYmplY3QoKTsKICAgICAgICBjYXNlICdbJzoKICAgICAgICAgICAgcmV0dXJuIGFycmF5KCk7CiAgICAgICAgY2FzZSAnIic6CiAgICAgICAgICAgIHJldHVybiBzdHJpbmcoKTsKICAgICAgICBjYXNlICctJzoKICAgICAgICAgICAgcmV0dXJuIG51bWJlcigpOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHJldHVybiBjaCA+PSAnMCcgJiYgY2ggPD0gJzknID8gbnVtYmVyKCkgOiB3b3JkKCk7CiAgICAgICAgfQogICAgfTsKCiAgICByZXR1cm4gZnVuY3Rpb24gKHNvdXJjZSwgcmV2aXZlcikgewogICAgICAgIHZhciByZXN1bHQ7CgogICAgICAgIHRleHQgPSBzb3VyY2U7CiAgICAgICAgYXQgPSAwOwogICAgICAgIGNoID0gJyAnOwogICAgICAgIHJlc3VsdCA9IHZhbHVlKCk7CiAgICAgICAgd2hpdGUoKTsKICAgICAgICBpZiAoY2gpIHsKICAgICAgICAgICAgZXJyb3IoIlN5bnRheCBlcnJvciIpOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHR5cGVvZiByZXZpdmVyID09PSAnZnVuY3Rpb24nID8gZnVuY3Rpb24gd2Fsayhob2xkZXIsIGtleSkgewogICAgICAgICAgICB2YXIgaywgdiwgdmFsdWUgPSBob2xkZXJba2V5XTsKICAgICAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIGZvciAoayBpbiB2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QuaGFzT3duUHJvcGVydHkuY2FsbCh2YWx1ZSwgaykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdiA9IHdhbGsodmFsdWUsIGspOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAodiAhPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVtrXSA9IHY7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgdmFsdWVba107CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHJldml2ZXIuY2FsbChob2xkZXIsIGtleSwgdmFsdWUpOwogICAgICAgIH0oeycnOiByZXN1bHR9LCAnJykgOiByZXN1bHQ7CiAgICB9Owp9KTsKCmFjZS5kZWZpbmUoImFjZS9tb2RlL2pzb25fd29ya2VyIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCnZhciBvb3AgPSByZXF1aXJlKCIuLi9saWIvb29wIik7CnZhciBNaXJyb3IgPSByZXF1aXJlKCIuLi93b3JrZXIvbWlycm9yIikuTWlycm9yOwp2YXIgcGFyc2UgPSByZXF1aXJlKCIuL2pzb24vanNvbl9wYXJzZSIpOwoKdmFyIEpzb25Xb3JrZXIgPSBleHBvcnRzLkpzb25Xb3JrZXIgPSBmdW5jdGlvbihzZW5kZXIpIHsKICAgIE1pcnJvci5jYWxsKHRoaXMsIHNlbmRlcik7CiAgICB0aGlzLnNldFRpbWVvdXQoMjAwKTsKfTsKCm9vcC5pbmhlcml0cyhKc29uV29ya2VyLCBNaXJyb3IpOwoKKGZ1bmN0aW9uKCkgewoKICAgIHRoaXMub25VcGRhdGUgPSBmdW5jdGlvbigpIHsKICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmRvYy5nZXRWYWx1ZSgpOwogICAgICAgIHZhciBlcnJvcnMgPSBbXTsKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAodmFsdWUpCiAgICAgICAgICAgICAgICBwYXJzZSh2YWx1ZSk7CiAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB2YXIgcG9zID0gdGhpcy5kb2MuaW5kZXhUb1Bvc2l0aW9uKGUuYXQtMSk7CiAgICAgICAgICAgIGVycm9ycy5wdXNoKHsKICAgICAgICAgICAgICAgIHJvdzogcG9zLnJvdywKICAgICAgICAgICAgICAgIGNvbHVtbjogcG9zLmNvbHVtbiwKICAgICAgICAgICAgICAgIHRleHQ6IGUubWVzc2FnZSwKICAgICAgICAgICAgICAgIHR5cGU6ICJlcnJvciIKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIHRoaXMuc2VuZGVyLmVtaXQoImFubm90YXRlIiwgZXJyb3JzKTsKICAgIH07Cgp9KS5jYWxsKEpzb25Xb3JrZXIucHJvdG90eXBlKTsKCn0pOwo="},7907:function(e,t,i){"use strict";i.d(t,{Iu:function(){return h},cC:function(){return c},m0:function(){return l}}),i(4987);var n={en:{array:"Array",auto:"Auto",appendText:"Append",appendTitle:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",appendSubmenuTitle:"Select the type of the field to be appended",appendTitleAuto:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascending",ascendingTitle:"Sort the childs of this ${type} in ascending order",actionsMenu:"Click to open the actions menu (Ctrl+M)",cannotParseFieldError:"Cannot parse field into JSON",cannotParseValueError:"Cannot parse value into JSON",collapseAll:"Collapse all fields",compactTitle:"Compact JSON data, remove all whitespaces (Ctrl+Shift+I)",descending:"Descending",descendingTitle:"Sort the childs of this ${type} in descending order",drag:"Drag to move this field (Alt+Shift+Arrows)",duplicateKey:"duplicate key",duplicateText:"Duplicate",duplicateTitle:"Duplicate selected fields (Ctrl+D)",duplicateField:"Duplicate this field (Ctrl+D)",duplicateFieldError:"Duplicate field name",empty:"empty",expandAll:"Expand all fields",expandTitle:"Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs.",formatTitle:"Format JSON data, with proper indentation and line feeds (Ctrl+I)",insert:"Insert",insertTitle:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",insertSub:"Select the type of the field to be inserted",object:"Object",ok:"Ok",redo:"Redo (Ctrl+Shift+Z)",removeText:"Remove",removeTitle:"Remove selected fields (Ctrl+Del)",removeField:"Remove this field (Ctrl+Del)",repairTitle:"Repair JSON: fix quotes and escape characters, remove comments and JSONP notation, turn JavaScript objects into JSON.",searchTitle:"Search fields and values",searchNextResultTitle:"Next result (Enter)",searchPreviousResultTitle:"Previous result (Shift + Enter)",selectNode:"Select a node...",showAll:"show all",showMore:"show more",showMoreStatus:"displaying ${visibleChilds} of ${totalChilds} items.",sort:"Sort",sortTitle:"Sort the childs of this ${type}",sortTitleShort:"Sort contents",sortFieldLabel:"Field:",sortDirectionLabel:"Direction:",sortFieldTitle:"Select the nested field by which to sort the array or object",sortAscending:"Ascending",sortAscendingTitle:"Sort the selected field in ascending order",sortDescending:"Descending",sortDescendingTitle:"Sort the selected field in descending order",string:"String",transform:"Transform",transformTitle:"Filter, sort, or transform the childs of this ${type}",transformTitleShort:"Filter, sort, or transform contents",extract:"Extract",extractTitle:"Extract this ${type}",transformQueryTitle:"Enter a JMESPath query",transformWizardLabel:"Wizard",transformWizardFilter:"Filter",transformWizardSortBy:"Sort by",transformWizardSelectFields:"Select fields",transformQueryLabel:"Query",transformPreviewLabel:"Preview",type:"Type",typeTitle:"Change the type of this field",openUrl:"Ctrl+Click or Ctrl+Enter to open url in new window",undo:"Undo last action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',objectType:'Field type "object". An object contains an unordered set of key/value pairs.',arrayType:'Field type "array". An array contains an ordered collection of values.',stringType:'Field type "string". Field type is not determined from the value, but always returned as string.',modeEditorTitle:"Switch Editor Mode",modeCodeText:"Code",modeCodeTitle:"Switch to code highlighter",modeFormText:"Form",modeFormTitle:"Switch to form editor",modeTextText:"Text",modeTextTitle:"Switch to plain text editor",modeTreeText:"Tree",modeTreeTitle:"Switch to tree editor",modeViewText:"View",modeViewTitle:"Switch to tree view",modePreviewText:"Preview",modePreviewTitle:"Switch to preview mode",examples:"Examples",default:"Default",containsInvalidProperties:"Contains invalid properties",containsInvalidItems:"Contains invalid items"},es:{array:"Matriz",auto:"Auto",appendText:"Agregar",appendTitle:"Agregue un nuevo campo con el tipo 'auto' después de este campo (Ctrl + Shift + Ins)",appendSubmenuTitle:"Seleccione el tipo de campo que se agregará",appendTitleAuto:"Agregue un nuevo campo con el tipo 'auto' (Ctrl + Shift + Ins)",ascending:"Ascendente",ascendingTitle:"Ordene los elementos secundarios de este ${type} en orden ascendente",actionsMenu:"Haga clic para abrir el menú de acciones (Ctrl + M)",cannotParseFieldError:"No se puede parsear el campo en JSON",cannotParseValueError:"No se puede parsear el valor en JSON",collapseAll:"Contraer todos los campos",compactTitle:"Compactar datos JSON, eliminar todos los espacios en blanco (Ctrl + Shift + I)",descending:"Descendente",descendingTitle:"Ordene los hijos de este ${type} en orden descendente",drag:"Arrastre para mover este campo (Alt + Mayús + Flechas)",duplicateKey:"llave duplicada",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos seleccionados (Ctrl + D)",duplicateField:"Duplicar este campo (Ctrl + D)",duplicateFieldError:"Nombre de campo duplicado",empty:"vacio",expandAll:"Expandir todos los campos",expandTitle:"Haga clic para expandir/contraer este campo (Ctrl + E). \n  Ctrl+Clic para expandir/contraer incluyendo todos los niños.",formatTitle:"Formatee los datos JSON, con la sangría y los avances de línea adecuados (Ctrl + I)",insert:"Insertar",insertTitle:"Inserte un nuevo campo con el tipo 'auto' antes de este campo (Ctrl + Ins)",insertSub:"Seleccione el tipo de campo a insertar",object:"Objeto",ok:"Ok",redo:"Rehacer (Ctrl+Mayús+Z)",removeText:"Eliminar",removeTitle:"Eliminar campos seleccionados (Ctrl+Supr)",removeField:"Eliminar este campo (Ctrl+Supr)",repairTitle:"Reparar JSON: corrija comillas y caracteres de escape, elimine comentarios y notación JSONP, convierta objetos JavaScript en JSON.",searchTitle:"Campos de búsqueda y valores",searchNextResultTitle:"Siguiente resultado (Entrar)",searchPreviousResultTitle:"Resultado anterior (Shift + Enter)",selectNode:"Seleccione un nodo...",showAll:"mostrar todo",showMore:"mostrar más",showMoreStatus:"mostrando ${visibleChilds} de ${totalChilds} elementos.",sort:"Ordenar",sortTitle:"Ordene los hijos de este ${type}",sortTitleShort:"Ordenar contenidos",sortFieldLabel:"Campo:",sortDirectionLabel:"Dirección:",sortFieldTitle:"Seleccione el campo anidado por el cual ordenar la matriz u objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar el campo seleccionado en orden ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar por el campo seleccionado, en orden descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar o transformar los hijos de este ${type}",transformTitleShort:"Filtrar, ordenar o transformar contenidos",extract:"Extraer",extractTitle:"Extrae este ${type}",transformQueryTitle:"Ingrese una consulta JMESPath",transformWizardLabel:"Wizard",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Seleccione un campo",transformQueryLabel:"Consulta",transformPreviewLabel:"Vista Previa",type:"Tipo",typeTitle:"Cambiar el tipo de campo",openUrl:"Ctrl+Click o Ctrl+Enter para abrir la URL en una nueva ventana",undo:"Deshacer la última acción (Ctrl+Z)",validationCannotMove:"No se puede mover un campo a un hijo de sí mismo.",autoType:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',objectType:'Tipo de campo "objeto".  Un objeto contiene un conjunto desordenado de pares clave/valor.',arrayType:'Tipo de campo "matriz".  Una matriz contiene una colección ordenada de valores.',stringType:'Tipo de campo "cadena".  El tipo de campo no se determina a partir del valor,  pero siempre se devuelve como una cadena.',modeEditorTitle:"Cambiar modo de editor",modeCodeText:"Codigo",modeCodeTitle:"Cambiar al resaltador de código",modeFormText:"Formulario",modeFormTitle:"Cambiar al editor de formularios",modeTextText:"Texto",modeTextTitle:"Cambiar al editor de texto sin formato",modeTreeText:"Arbol",modeTreeTitle:"Cambiar al editor de árbol",modeViewText:"Vista",modeViewTitle:"Cambiar a la vista de árbol",modePreviewText:"Vista Previa",modePreviewTitle:"Cambiar al modo de vista previa",examples:"Ejemplos",default:"Predeterminado",containsInvalidProperties:"Contiene propiedades no validas",containsInvalidItems:"Contiene items no validos"},"zh-CN":{array:"数组",auto:"自动",appendText:"追加",appendTitle:"在此字段后追加一个类型为“auto”的新字段 (Ctrl+Shift+Ins)",appendSubmenuTitle:"选择要追加的字段类型",appendTitleAuto:"追加类型为“auto”的新字段 (Ctrl+Shift+Ins)",ascending:"升序",ascendingTitle:"升序排列${type}的子节点",actionsMenu:"点击打开动作菜单(Ctrl+M)",cannotParseFieldError:"无法将字段解析为JSON",cannotParseValueError:"无法将值解析为JSON",collapseAll:"缩进所有字段",compactTitle:"压缩JSON数据,删除所有空格 (Ctrl+Shift+I)",descending:"降序",descendingTitle:"降序排列${type}的子节点",drag:"拖拽移动该节点(Alt+Shift+Arrows)",duplicateKey:"重复键",duplicateText:"复制",duplicateTitle:"复制选中字段(Ctrl+D)",duplicateField:"复制该字段(Ctrl+D)",duplicateFieldError:"重复的字段名称",empty:"清空",expandAll:"展开所有字段",expandTitle:"点击 展开/收缩 该字段(Ctrl+E). \nCtrl+Click 展开/收缩 包含所有子节点.",formatTitle:"使用适当的缩进和换行符格式化JSON数据 (Ctrl+I)",insert:"插入",insertTitle:"在此字段前插入类型为“auto”的新字段 (Ctrl+Ins)",insertSub:"选择要插入的字段类型",object:"对象",ok:"Ok",redo:"重做 (Ctrl+Shift+Z)",removeText:"移除",removeTitle:"移除选中字段 (Ctrl+Del)",removeField:"移除该字段 (Ctrl+Del)",repairTitle:"修复JSON:修复引号和转义符,删除注释和JSONP表示法,将JavaScript对象转换为JSON。",selectNode:"选择一个节点...",showAll:"展示全部",showMore:"展示更多",showMoreStatus:"显示${totalChilds}的${visibleChilds}项目.",sort:"排序",sortTitle:"排序${type}的子节点",sortTitleShort:"内容排序",sortFieldLabel:"字段:",sortDirectionLabel:"方向:",sortFieldTitle:"选择用于对数组或对象排序的嵌套字段",sortAscending:"升序排序",sortAscendingTitle:"按照该字段升序排序",sortDescending:"降序排序",sortDescendingTitle:"按照该字段降序排序",string:"字符串",transform:"变换",transformTitle:"筛选,排序,或者转换${type}的子节点",transformTitleShort:"筛选,排序,或者转换内容",extract:"提取",extractTitle:"提取这个 ${type}",transformQueryTitle:"输入JMESPath查询",transformWizardLabel:"向导",transformWizardFilter:"筛选",transformWizardSortBy:"排序",transformWizardSelectFields:"选择字段",transformQueryLabel:"查询",transformPreviewLabel:"预览",type:"类型",typeTitle:"更改字段类型",openUrl:"Ctrl+Click 或者 Ctrl+Enter 在新窗口打开链接",undo:"撤销上次动作 (Ctrl+Z)",validationCannotMove:"无法将字段移入其子节点",autoType:'字段类型 "auto". 字段类型由值自动确定 可以为 string,number,boolean,或者 null.',objectType:'字段类型 "object". 对象包含一组无序的键/值对.',arrayType:'字段类型 "array". 数组包含值的有序集合.',stringType:'字段类型 "string". 字段类型由值自动确定,但始终作为字符串返回.',modeCodeText:"代码",modeCodeTitle:"切换至代码高亮",modeFormText:"表单",modeFormTitle:"切换至表单编辑",modeTextText:"文本",modeTextTitle:"切换至文本编辑",modeTreeText:"树",modeTreeTitle:"切换至树编辑",modeViewText:"视图",modeViewTitle:"切换至树视图",modePreviewText:"预览",modePreviewTitle:"切换至预览模式",examples:"例子",default:"缺省",containsInvalidProperties:"包含无效的属性",containsInvalidItems:"包含无效项目"},"pt-BR":{array:"Lista",auto:"Automatico",appendText:"Adicionar",appendTitle:"Adicionar novo campo com tipo 'auto' depois deste campo (Ctrl+Shift+Ins)",appendSubmenuTitle:"Selecione o tipo do campo a ser adicionado",appendTitleAuto:"Adicionar novo campo com tipo 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendente",ascendingTitle:"Organizar filhor do tipo ${type} em crescente",actionsMenu:"Clique para abrir o menu de ações (Ctrl+M)",cannotParseFieldError:"Não é possível analisar o campo no JSON",cannotParseValueError:"Não é possível analisar o valor em JSON",collapseAll:"Fechar todos campos",compactTitle:"Dados JSON compactos, remova todos os espaços em branco (Ctrl+Shift+I)",descending:"Descendente",descendingTitle:"Organizar o filhos do tipo ${type} em decrescente",duplicateKey:"chave duplicada",drag:"Arraste para mover este campo (Alt+Shift+Arrows)",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos selecionados (Ctrl+D)",duplicateField:"Duplicar este campo (Ctrl+D)",duplicateFieldError:"Nome do campo duplicado",empty:"vazio",expandAll:"Expandir todos campos",expandTitle:"Clique para expandir/encolher este campo (Ctrl+E). \nCtrl+Click para expandir/encolher incluindo todos os filhos.",formatTitle:"Formate dados JSON, com recuo e feeds de linha adequados (Ctrl+I)",insert:"Inserir",insertTitle:"Inserir um novo campo do tipo 'auto' antes deste campo (Ctrl+Ins)",insertSub:"Selecionar o tipo de campo a ser inserido",object:"Objeto",ok:"Ok",redo:"Refazer (Ctrl+Shift+Z)",removeText:"Remover",removeTitle:"Remover campos selecionados (Ctrl+Del)",removeField:"Remover este campo (Ctrl+Del)",repairTitle:"Repare JSON: corrija aspas e caracteres de escape, remova comentários e notação JSONP, transforme objetos JavaScript em JSON.",selectNode:"Selecione um nódulo...",showAll:"mostrar todos",showMore:"mostrar mais",showMoreStatus:"exibindo ${visibleChilds} de ${totalChilds} itens.",sort:"Organizar",sortTitle:"Organizar os filhos deste ${type}",sortTitleShort:"Organizar os filhos",sortFieldLabel:"Campo:",sortDirectionLabel:"Direção:",sortFieldTitle:"Selecione um campo filho pelo qual ordenar o array ou objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar o campo selecionado por ordem ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar o campo selecionado por ordem descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar ou transformar os filhos deste ${type}",transformTitleShort:"Filtrar, ordenar ou transformar conteúdos",transformQueryTitle:"Insira uma expressão JMESPath",transformWizardLabel:"Assistente",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Selecionar campos",transformQueryLabel:"Expressão",transformPreviewLabel:"Visualizar",type:"Tipo",typeTitle:"Mudar o tipo deste campo",openUrl:"Ctrl+Click ou Ctrl+Enter para abrir link em nova janela",undo:"Desfazer último ação (Ctrl+Z)",validationCannotMove:"Não pode mover um campo como filho dele mesmo",autoType:'Campo do tipo "auto". O tipo do campo é determinao automaticamente a partir do seu valor e pode ser texto, número, verdade/falso ou nulo.',objectType:'Campo do tipo "objeto". Um objeto contém uma lista de pares com chave e valor.',arrayType:'Campo do tipo "lista". Uma lista contem uma coleção de valores ordenados.',stringType:'Campo do tipo "string". Campo do tipo nao é determinado através do seu valor, mas sempre retornara um texto.',examples:"Exemplos",default:"Revelia",containsInvalidProperties:"Contém propriedades inválidas",containsInvalidItems:"Contém itens inválidos"},tr:{array:"Dizin",auto:"Otomatik",appendText:"Ekle",appendTitle:"Bu alanın altına 'otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",appendSubmenuTitle:"Eklenecek alanın tipini seç",appendTitleAuto:"'Otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",ascending:"Artan",ascendingTitle:"${type}'ın alt tiplerini artan düzende sırala",actionsMenu:"Aksiyon menüsünü açmak için tıklayın (Ctrl+M)",collapseAll:"Tüm alanları kapat",descending:"Azalan",descendingTitle:"${type}'ın alt tiplerini azalan düzende sırala",drag:"Bu alanı taşımak için sürükleyin (Alt+Shift+Arrows)",duplicateKey:"Var olan anahtar",duplicateText:"Aşağıya kopyala",duplicateTitle:"Seçili alanlardan bir daha oluştur (Ctrl+D)",duplicateField:"Bu alandan bir daha oluştur (Ctrl+D)",duplicateFieldError:"Duplicate field name",cannotParseFieldError:"Alan JSON'a ayrıştırılamıyor",cannotParseValueError:"JSON'a değer ayrıştırılamıyor",empty:"boş",expandAll:"Tüm alanları aç",expandTitle:"Bu alanı açmak/kapatmak için tıkla (Ctrl+E). \nAlt alanlarda dahil tüm alanları açmak için Ctrl+Click ",insert:"Ekle",insertTitle:"Bu alanın üstüne 'otomatik' tipinde yeni bir alan ekle (Ctrl+Ins)",insertSub:"Araya eklenecek alanın tipini seç",object:"Nesne",ok:"Tamam",redo:"Yeniden yap (Ctrl+Shift+Z)",removeText:"Kaldır",removeTitle:"Seçilen alanları kaldır (Ctrl+Del)",removeField:"Bu alanı kaldır (Ctrl+Del)",selectNode:"Bir nesne seç...",showAll:"tümünü göster",showMore:"daha fazla göster",showMoreStatus:"${totalChilds} alanın ${visibleChilds} alt alanları gösteriliyor",sort:"Sırala",sortTitle:"${type}'ın alt alanlarını sırala",sortTitleShort:"İçerikleri sırala",sortFieldLabel:"Alan:",sortDirectionLabel:"Yön:",sortFieldTitle:"Diziyi veya nesneyi sıralamak için iç içe geçmiş alanı seçin",sortAscending:"Artan",sortAscendingTitle:"Seçili alanı artan düzende sırala",sortDescending:"Azalan",sortDescendingTitle:"Seçili alanı azalan düzende sırala",string:"Karakter Dizisi",transform:"Dönüştür",transformTitle:"${type}'ın alt alanlarını filtrele, sırala veya dönüştür",transformTitleShort:"İçerikleri filterele, sırala veya dönüştür",transformQueryTitle:"JMESPath sorgusu gir",transformWizardLabel:"Sihirbaz",transformWizardFilter:"Filtre",transformWizardSortBy:"Sırala",transformWizardSelectFields:"Alanları seç",transformQueryLabel:"Sorgu",transformPreviewLabel:"Önizleme",type:"Tip",typeTitle:"Bu alanın tipini değiştir",openUrl:"URL'i yeni bir pencerede açmak için Ctrl+Click veya Ctrl+Enter",undo:"Son değişikliği geri al (Ctrl+Z)",validationCannotMove:"Alt alan olarak taşınamıyor",autoType:'Alan tipi "otomatik". Alan türü otomatik olarak değerden belirlenirve bir dize, sayı, boolean veya null olabilir.',objectType:'Alan tipi "nesne". Bir nesne, sıralanmamış bir anahtar / değer çifti kümesi içerir.',arrayType:'Alan tipi "dizi". Bir dizi, düzenli değerler koleksiyonu içerir.',stringType:'Alan tipi "karakter dizisi". Alan türü değerden belirlenmez,ancak her zaman karakter dizisi olarak döndürülür.',modeCodeText:"Kod",modeCodeTitle:"Kod vurgulayıcıya geç",modeFormText:"Form",modeFormTitle:"Form düzenleyiciye geç",modeTextText:"Metin",modeTextTitle:"Düz metin düzenleyiciye geç",modeTreeText:"Ağaç",modeTreeTitle:"Ağaç düzenleyiciye geç",modeViewText:"Görünüm",modeViewTitle:"Ağaç görünümüne geç",examples:"Örnekler",default:"Varsayılan",containsInvalidProperties:"Geçersiz özellikler içeriyor",containsInvalidItems:"Geçersiz öğeler içeriyor"},ja:{array:"配列",auto:"オート",appendText:"追加",appendTitle:'次のフィールドに"オート"のフィールドを追加 (Ctrl+Shift+Ins)',appendSubmenuTitle:"追加するフィールドの型を選択してください",appendTitleAuto:'"オート"のフィールドを追加 (Ctrl+Shift+Ins)',ascending:"昇順",ascendingTitle:"${type}の子要素を昇順に並べ替え",actionsMenu:"クリックしてアクションメニューを開く (Ctrl+M)",collapseAll:"すべてを折りたたむ",descending:"降順",descendingTitle:"${type}の子要素を降順に並べ替え",drag:"ドラッグして選択中のフィールドを移動 (Alt+Shift+Arrows)",duplicateKey:"複製キー",duplicateText:"複製",duplicateTitle:"選択中のフィールドを複製 (Ctrl+D)",duplicateField:"選択中のフィールドを複製 (Ctrl+D)",duplicateFieldError:"フィールド名が重複しています",cannotParseFieldError:"JSONのフィールドを解析できません",cannotParseValueError:"JSONの値を解析できません",empty:"空",expandAll:"すべてを展開",expandTitle:"クリックしてフィールドを展開/折りたたむ (Ctrl+E). \nCtrl+Click ですべての子要素を展開/折りたたむ",insert:"挿入",insertTitle:"選択中のフィールドの前に新しいフィールドを挿入 (Ctrl+Ins)",insertSub:"挿入するフィールドの型を選択",object:"オブジェクト",ok:"実行",redo:"やり直す (Ctrl+Shift+Z)",removeText:"削除",removeTitle:"選択中のフィールドを削除 (Ctrl+Del)",removeField:"選択中のフィールドを削除 (Ctrl+Del)",selectNode:"ノードを選択...",showAll:"すべてを表示",showMore:"もっと見る",showMoreStatus:"${totalChilds}個のアイテムのうち ${visibleChilds}個を表示しています。",sort:"並べ替え",sortTitle:"${type}の子要素を並べ替え",sortTitleShort:"並べ替え",sortFieldLabel:"フィールド:",sortDirectionLabel:"順序:",sortFieldTitle:"配列またはオブジェクトを並び替えるためのフィールドを選択",sortAscending:"昇順",sortAscendingTitle:"選択中のフィールドを昇順に並び替え",sortDescending:"降順",sortDescendingTitle:"選択中のフィールドを降順に並び替え",string:"文字列",transform:"変換",transformTitle:"${type}の子要素をフィルター・並び替え・変換する",transformTitleShort:"内容をフィルター・並び替え・変換する",extract:"抽出",extractTitle:"${type}を抽出",transformQueryTitle:"JMESPathクエリを入力",transformWizardLabel:"ウィザード",transformWizardFilter:"フィルター",transformWizardSortBy:"並び替え",transformWizardSelectFields:"フィールドを選択",transformQueryLabel:"クエリ",transformPreviewLabel:"プレビュー",type:"型",typeTitle:"選択中のフィールドの型を変更",openUrl:"Ctrl+Click または Ctrl+Enter で 新規ウィンドウでURLを開く",undo:"元に戻す (Ctrl+Z)",validationCannotMove:"子要素に移動できません ",autoType:"オート: フィールドの型は値から自動的に決定されます。 (文字列・数値・ブール・null)",objectType:"オブジェクト: オブジェクトは順序が決まっていないキーと値のペア組み合わせです。",arrayType:"配列: 配列は順序が決まっている値の集合体です。",stringType:"文字列: フィールド型は値から決定されませんが、常に文字列として返されます。",modeCodeText:"コードモード",modeCodeTitle:"ハイライトモードに切り替え",modeFormText:"フォームモード",modeFormTitle:"フォームモードに切り替え",modeTextText:"テキストモード",modeTextTitle:"テキストモードに切り替え",modeTreeText:"ツリーモード",modeTreeTitle:"ツリーモードに切り替え",modeViewText:"ビューモード",modeViewTitle:"ビューモードに切り替え",modePreviewText:"プレビュー",modePreviewTitle:"プレビューに切り替え",examples:"例",default:"デフォルト",containsInvalidProperties:"無効なプロパティが含まれています",containsInvalidItems:"無効なアイテムが含まれています"},"fr-FR":{array:"Liste",auto:"Auto",appendText:"Ajouter",appendTitle:"Ajouter un champ de type 'auto' après ce champ (Ctrl+Shift+Ins)",appendSubmenuTitle:"Sélectionner le type du champ à ajouter",appendTitleAuto:"Ajouter un champ de type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendant",ascendingTitle:"Trier les enfants de ce ${type} par ordre ascendant",actionsMenu:"Ouvrir le menu des actions (Ctrl+M)",collapseAll:"Regrouper",descending:"Descendant",descendingTitle:"Trier les enfants de ce ${type} par ordre descendant",drag:"Déplacer (Alt+Shift+Arrows)",duplicateKey:"Dupliquer la clé",duplicateText:"Dupliquer",duplicateTitle:"Dupliquer les champs sélectionnés (Ctrl+D)",duplicateField:"Dupliquer ce champ (Ctrl+D)",duplicateFieldError:"Dupliquer le nom de champ",cannotParseFieldError:"Champ impossible à parser en JSON",cannotParseValueError:"Valeur impossible à parser en JSON",empty:"vide",expandAll:"Étendre",expandTitle:"Étendre/regrouper ce champ (Ctrl+E). \nCtrl+Click pour étendre/regrouper avec tous les champs.",insert:"Insérer",insertTitle:"Insérer un champ de type 'auto' avant ce champ (Ctrl+Ins)",insertSub:"Sélectionner le type de champ à insérer",object:"Objet",ok:"Ok",redo:"Rejouer (Ctrl+Shift+Z)",removeText:"Supprimer",removeTitle:"Supprimer les champs sélectionnés (Ctrl+Del)",removeField:"Supprimer ce champ (Ctrl+Del)",searchTitle:"Rechercher champs et valeurs",searchNextResultTitle:"Résultat suivant (Enter)",searchPreviousResultTitle:"Résultat précédent (Shift + Enter)",selectNode:"Sélectionner un nœud...",showAll:"voir tout",showMore:"voir plus",showMoreStatus:"${visibleChilds} éléments affichés de ${totalChilds}.",sort:"Trier",sortTitle:"Trier les champs de ce ${type}",sortTitleShort:"Trier",sortFieldLabel:"Champ:",sortDirectionLabel:"Direction:",sortFieldTitle:"Sélectionner les champs permettant de trier les listes et objet",sortAscending:"Ascendant",sortAscendingTitle:"Trier les champs sélectionnés par ordre ascendant",sortDescending:"Descendant",sortDescendingTitle:"Trier les champs sélectionnés par ordre descendant",string:"Chaîne",transform:"Transformer",transformTitle:"Filtrer, trier, or transformer les enfants de ce ${type}",transformTitleShort:"Filtrer, trier ou transformer le contenu",extract:"Extraire",extractTitle:"Extraire ce ${type}",transformQueryTitle:"Saisir une requête JMESPath",transformWizardLabel:"Assistant",transformWizardFilter:"Filtrer",transformWizardSortBy:"Trier par",transformWizardSelectFields:"Sélectionner les champs",transformQueryLabel:"Requête",transformPreviewLabel:"Prévisualisation",type:"Type",typeTitle:"Changer le type de ce champ",openUrl:"Ctrl+Click ou Ctrl+Enter pour ouvrir l'url dans une autre fenêtre",undo:"Annuler la dernière action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Champe de type "auto". Ce type de champ est automatiquement déterminé en fonction de la valeur et peut être de type "chaîne", "nombre", "booléen" ou null.',objectType:'Champ de type "objet". Un objet contient un ensemble non ordonné de paires clé/valeur.',arrayType:'Champ de type "liste". Une liste contient une collection ordonnée de valeurs.',stringType:'Champ de type "chaîne". Ce type de champ n\'est pas déterminé en fonction de la valeur, mais retourne systématiquement une chaîne de caractères.',modeEditorTitle:"Changer mode d'édition",modeCodeText:"Code",modeCodeTitle:"Activer surlignage code",modeFormText:"Formulaire",modeFormTitle:"Activer formulaire",modeTextText:"Texte",modeTextTitle:"Activer éditeur texte",modeTreeText:"Arbre",modeTreeTitle:"Activer éditeur arbre",modeViewText:"Lecture seule",modeViewTitle:"Activer vue arbre",modePreviewText:"Prévisualisation",modePreviewTitle:"Activer mode prévisualiser",examples:"Exemples",default:"Défaut",containsInvalidProperties:"Contient des propriétés non valides",containsInvalidItems:"Contient des éléments invalides"},de:{array:"Auflistung",auto:"Auto",appendText:"anhängen",appendTitle:"Fügen Sie nach diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Umschalt+Ein)",appendSubmenuTitle:"Wählen Sie den Typ des neuen Feldes",appendTitleAuto:"Ein neues Feld vom Typ 'auto' hinzufügen (Strg+Umschalt+Ein)",ascending:"Aufsteigend",ascendingTitle:"Sortieren Sie die Elemente dieses ${type} in aufsteigender Reihenfolge",actionsMenu:"Klicken Sie zum Öffnen des Aktionsmenüs (Strg+M)",cannotParseFieldError:"Feld kann nicht in JSON geparst werden",cannotParseValueError:"Wert kann nicht in JSON geparst werden",collapseAll:"Alle Felder zuklappen",compactTitle:"JSON-Daten verdichten, alle Leerzeichen entfernen (Strg+Umschalt+\\)",descending:"Absteigend",descendingTitle:"Sortieren Sie die Elemente dieses ${type} in absteigender Reihenfolge",drag:"Ziehen, um dieses Feld zu verschieben (Alt+Umschalt+Pfeile)",duplicateKey:"Doppelter Schlüssel",duplicateText:"Duplikat",duplicateTitle:"Ausgewählte Felder duplizieren (Strg+D)",duplicateField:"Dieses Feld duplizieren (Strg+D)",duplicateFieldError:"Doppelter Feldname",empty:"leer",expandAll:"Alle Felder anzeigen",expandTitle:"Klicken Sie, um dieses Feld zu erweitern/zu kollabieren (Strg+E). \nStrg+Klicken Sie, um dieses Feld einschließlich aller Elemente zu erweitern/zu kollabieren.",formatTitle:"JSON-Daten mit korrekter Einrückung und Zeilenvorschüben formatieren (Strg+\\)",insert:"einfügen",insertTitle:"Fügen Sie vor diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Einfg)",insertSub:"Wählen Sie den Typ des neuen Feldes",object:"Objekt",ok:"Ok",redo:"Wiederholen (Strg+Umschalt+Z)",removeText:"entfernen",removeTitle:"Ausgewählte Felder entfernen (Strg+Entf)",removeField:"Dieses Feld entfernen (Strg+Entf)",repairTitle:"JSON reparieren: Anführungszeichen und Escape-Zeichen korrigieren, Kommentare und JSONP-Notation entfernen, JavaScript-Objekte in JSON umwandeln.",searchTitle:"Suchfelder und Werte",searchNextResultTitle:"Nächstes Ergebnis (Enter)",searchPreviousResultTitle:"Vorheriges Ergebnis (Umschalt + Eingabe)",selectNode:"Wählen Sie einen Knoten aus...",showAll:"alle anzeigen",showMore:"mehr anzeigen",showMoreStatus:"Anzeige von ${visibleChilds} von ${totalChilds}-Elementen.",sort:"Sortieren",sortTitle:"Sortieren Sie die Elemente dieses ${type}",sortTitleShort:"Inhalt sortieren",sortFieldLabel:"Feld:",sortDirectionLabel:"Richtung:",sortFieldTitle:"Wählen Sie das verschachtelte Feld, nach dem das Array oder Objekt sortiert werden soll.",sortAscending:"Aufsteigend",sortAscendingTitle:"Sortieren Sie das ausgewählte Feld in aufsteigender Reihenfolge",sortDescending:"Absteigend",sortDescendingTitle:"Sortieren Sie das ausgewählte Feld in absteigender Reihenfolge",string:"Zeichenfolge",transform:"Verwandeln",transformTitle:"Die Elemente dieses ${type} filtern, sortieren oder transformieren",transformTitleShort:"Inhalte filtern, sortieren oder transformieren",extract:"Auszug",extractTitle:"Extrahieren Sie diesen ${type}",transformQueryTitle:"Eine JMESPath-Abfrage eingeben",transformWizardLabel:"Zauberer",transformWizardFilter:"Filter",transformWizardSortBy:"Sortieren nach",transformWizardSelectFields:"Felder auswählen",transformQueryLabel:"Anfrage",transformPreviewLabel:"Vorschau",type:"Geben Sie  ein.",typeTitle:"Ändern Sie den Typ dieses Feldes",openUrl:"Strg+Klicken oder Strg+Eingabe, um die URL in einem neuen Fenster zu öffnen",undo:"Letzte Aktion rückgängig machen (Strg+Z)",validationCannotMove:"Kann ein Feld nicht in ein Kind seiner selbst verschieben",autoType:'Feldtyp "auto". Der Feldtyp wird automatisch aus dem Wert bestimmt und kann ein String, eine Zahl, boolesch oder null sein.',objectType:'Feldtyp "Objekt". Ein Objekt enthält eine ungeordnete Menge von Schlüssel/Wert-Paaren.',arrayType:'Feldtyp "Array". Ein Array enthält eine geordnete Sammlung von Werten.',stringType:'Feldtyp "Zeichenfolge". Der Feldtyp wird nicht aus dem Wert bestimmt, sondern immer als Zeichenfolge zurückgegeben.',modeEditorTitle:"Editor-Modus umschalten",modeCodeText:"Code",modeCodeTitle:"Umschalten auf Code-Highlighter",modeFormText:"Formular",modeFormTitle:"Zum Formular-Editor wechseln",modeTextText:"Text",modeTextTitle:"Zum Editor für einfachen Text wechseln",modeTreeText:"Baum",modeTreeTitle:"Zum Baum-Editor wechseln",modeViewText:"Siehe",modeViewTitle:"Zur Baumansicht wechseln",modePreviewText:"Vorschau",modePreviewTitle:"In den Vorschau-Modus wechseln",examples:"Beispiele",default:"Standardmäßig",containsInvalidProperties:"Enthält ungültige Eigenschaften",containsInvalidItems:"Enthält ungültige Elemente"},ru:{array:"Массив",auto:"Авто",appendText:"Добавить",appendTitle:"Добавить новое поле с типом 'авто' после этого поля (Ctrl+Shift+Ins)",appendSubmenuTitle:"Выбрать тип поля для добавления",appendTitleAuto:"Добавить новое поле с типом 'авто' (Ctrl+Shift+Ins)",ascending:"По возрастанию",ascendingTitle:"Сортировать ${type} по возрастанию",actionsMenu:"Нажмите для открытия меню действий (Ctrl+M)",cannotParseFieldError:"Невозможно преобразовать поле в JSON",cannotParseValueError:"Невозможно преобразовать значение в JSON",collapseAll:"Свернуть все",compactTitle:"Минификация JSON (Ctrl+Shift+I)",descending:"По убыванию",descendingTitle:"Сортировать ${type} по убыванию",drag:"Потяните для перемещения этого поля (Alt+Shift+Arrows)",duplicateKey:"повторяющийся ключ",duplicateText:"Дублировать",duplicateTitle:"Дублирование полей (Ctrl+D)",duplicateField:"Дублировать поле (Ctrl+D)",duplicateFieldError:"Дублирование названия поля",empty:"пустой",expandAll:"Развернуть все",expandTitle:"Нажмите для раскрытия/скрытия поля (Ctrl+E)\nили Ctrl+Click для раскрытия/скрытия всех потомков.",formatTitle:"Форматирование JSON (Ctrl+I)",insert:"Вставить",insertTitle:"Вставить новое поле с типом 'авто' перед этим полем (Ctrl+Ins)",insertSub:"Выбрать тип поля для вставки",object:"Объект",ok:"ОК",redo:"Повторить (Ctrl+Shift+Z)",removeText:"Удалить",removeTitle:"Удалить выбранные поля (Ctrl+Del)",removeField:"Удалить поле (Ctrl+Del)",repairTitle:"Восстановите JSON: исправьте кавычки и escape-символы, удалите комментарии и нотацию JSONP, модифицируйте объекты JavaScript в JSON.",searchTitle:"Поиск",searchNextResultTitle:"Следующий результат (Enter)",searchPreviousResultTitle:"Предыдущий результат (Shift + Enter)",selectNode:"Выбор узла...",showAll:"показать все",showMore:"больше",showMoreStatus:"${visibleChilds} из ${totalChilds}",sort:"Сортировка",sortTitle:"Сортировка потомков типа ${type}",sortTitleShort:"Сортировка содержимого",sortFieldLabel:"Поле:",sortDirectionLabel:"Направление:",sortFieldTitle:"Выберите поле для сортировки массива или объекта",sortAscending:"По возрастанию",sortAscendingTitle:"Сортировка выбранного поря по возрастанию",sortDescending:"По убыванию",sortDescendingTitle:"Сортировка выбранного поря по убыванию",string:"Строка",transform:"Модификация",transformTitle:"Фильтрация, сортировка или модификация данных типа ${type}",transformTitleShort:"Фильтрация, сортировка или модификация данных",extract:"Извлечение",extractTitle:"Извлечь тип ${type}",transformQueryTitle:"Введите JMESpath запрос",transformWizardLabel:"Мастер",transformWizardFilter:"Фильтр",transformWizardSortBy:"Сортировка",transformWizardSelectFields:"Поля",transformQueryLabel:"Запрос",transformPreviewLabel:"Просмотр",type:"Тип",typeTitle:"Изменить тип этого поля",openUrl:"Ctrl+Click или Ctrl+Enter для открытия url в новом окне",undo:"Отменить (Ctrl+Z)",validationCannotMove:"Поле не может быть перемещено в потомка",autoType:"Тип поля автоматически определяется по значению и может быть строкой, числом, логическим значением или null.",objectType:"Объект содержит неупорядоченный набор пар ключ/значение.",arrayType:"Массив содержит упорядоченный набор значений.",stringType:"Тип поля не определяется из значения, но всегда возвращается как строка.",modeEditorTitle:"Переключение режима редактора",modeCodeText:"Код",modeCodeTitle:"Переключить в режим редактора кода",modeFormText:"Форма",modeFormTitle:"Переключить в режим формы",modeTextText:"Текст",modeTextTitle:"Переключить в режим редактора текста",modeTreeText:"Дерево",modeTreeTitle:"Переключить в режим редактора дерева",modeViewText:"Просмотр дерева",modeViewTitle:"Переключить в режим просмотра дерева",modePreviewText:"Просмотр",modePreviewTitle:"Переключить в режим просмотра",examples:"Примеры",default:"По умолчанию",containsInvalidProperties:"Содержит недопустимые свойства",containsInvalidItems:"Содержит недопустимые элементы"},ko:{array:"배열",auto:"자동",appendText:"추가",appendTitle:'선택한 요소 아래에 "자동" 요소를 추가합니다. (Ctrl + Shift + Ins)',appendSubmenuTitle:"추가할 요소의 유형을 선택해주세요.",appendTitleAuto:'"자동" 요소를 추가합니다. (Ctrl + Shift + Ins)',ascending:"오름차순",ascendingTitle:"선택한 ${type}의 하위 요소를 오름차순 정렬합니다.",actionsMenu:"메뉴 열기 (Ctrl + M)",cannotParseFieldError:"JSON의 요소를 해석할 수 없습니다.",cannotParseValueError:"JSON의 값을 해석할 수 없습니다.",collapseAll:"모두 접기",compactTitle:"모든 공백을 제거하여 JSON 데이터를 작게 만듭니다. (Ctrl + Shift + I)",descending:"내림차순",descendingTitle:"선택한 ${type}의 하위 요소를 내림차순으로 정렬",drag:"드래그하여 요소를 이동합니다. (Alt + Shift + Arrows)",duplicateKey:"복제키",duplicateText:"복제",duplicateTitle:"선택한 요소를 복제합니다. (Ctrl + D)",duplicateField:"선택한 요소를 복제합니다. (Ctrl + D)",duplicateFieldError:"요소 이름이 중복되었습니다.",empty:"비어있음",expandAll:"모두 열기",expandTitle:"클릭하여 요소를 열거나 닫습니다. (Ctrl + E) \nCtrl + Click으로 모든 하위 요소를 열거나 닫습니다.",formatTitle:"적절한 들여쓰기 및 줄바꿈으로 JSON 데이터를 정형화합니다. (Ctrl + I)",insert:"삽입",insertTitle:"선택한 요소 위에 새요소를 삽입합니다. (Ctrl + Ins)",insertSub:"삽입할 요소의 유형을 선택해주세요.",object:"객체",ok:"확인",redo:"다시 실행 (Ctrl + Shift + Z)",removeText:"삭제",removeTitle:"선택한 요소를 삭제합니다. (Ctrl + Del)",removeField:"선택한 요소를 삭제합니다. (Ctrl + Del)",repairTitle:"JSON 교정: JSON 내의 주석과 JSONP 표기법을 지우고 따옴표와 이스케이프 문자를 수정합니다.",searchTitle:"요소 또는 값 찾기",searchNextResultTitle:"다음으로 찾기 (Enter)",searchPreviousResultTitle:"이전으로 찾기 (Shift + Enter)",selectNode:"요소를 선택해주세요...",showAll:"모두보기",showMore:"더보기",showMoreStatus:"${totalChilds} 개의 항목 중 ${visibleChilds} 개를 표시합니다.",sort:"정렬",sortTitle:"선택한 ${type}의 하위 요소를 정렬합니다.",sortTitleShort:"정렬",sortFieldLabel:"요소:",sortDirectionLabel:"순서:",sortFieldTitle:"배열이나 객체를 정렬하는 요소를 선택해주세요.",sortAscending:"오름차순",sortAscendingTitle:"선택한 요소를 오름차순으로 정렬합니다.",sortDescending:"내림차순",sortDescendingTitle:"선택한 요소를 내림차순으로 정렬합니다.",string:"문자",transform:"변환",transformTitle:"선택한 ${type}의 하위 요소를 필터하거나 정렬 또는 변환합니다.",transformTitleShort:"내용을 필터하거나 정렬 또는 변환합니다.",extract:"추출",extractTitle:"선택한 ${type}의 값을 최상위에 위치시킵니다.",transformQueryTitle:"JMESPath 쿼리를 입력해주세요.",transformWizardLabel:"마법사",transformWizardFilter:"필터",transformWizardSortBy:"정렬",transformWizardSelectFields:"요소를 선택해주세요.",transformQueryLabel:"쿼리",transformPreviewLabel:"미리보기",type:"유형",typeTitle:"선택한 요소의 유형을 변경합니다.",openUrl:"Ctrl + Click 또는 Ctrl + Enter로 새 창에서 URL 열기",undo:"실행 취소 (Ctrl + Z)",validationCannotMove:"하위 요소로 이동할 수 없습니다.",autoType:"자동: 요소의 형식이 값의 유형으로 결정됩니다. 문자, 숫자, 부울, 또는 null만 허용됩니다.",objectType:"객체: 순서대로 나열되지 않은 이름/값 쌍으로 이루어진 집합입니다.",arrayType:"배열: 순서대로 나열된 값의 집합입니다.",stringType:"문자: 요소의 유형이 값에서 결정되지 않지만 항상 문자로 반환됩니다.",modeEditorTitle:"편집기 유형 변경",modeCodeText:"코드",modeCodeTitle:"형식 교정을 도와주는 기능이 포함된 문자 편집기",modeFormText:"입력 양식",modeFormTitle:"정해진 요소에 값을 입력하는 편집기",modeTextText:"문자",modeTextTitle:"단순 문자 편집기",modeTreeText:"트리",modeTreeTitle:"트리 구조로 표시되는 편집기",modeViewText:"보기",modeViewTitle:"읽기전용 트리 구조로 JSON을 표시",modePreviewText:"미리보기",modePreviewTitle:"읽기전용 문자로 JSON을 표시",examples:"예제",default:"기본값",containsInvalidProperties:"잘못된 속성이 포함되어 있습니다.",containsInvalidItems:"잘못된 항목이 포함되어 있습니다"}},o=Object.keys(n),r="en",s="undefined"!=typeof navigator?navigator.language||navigator.userLanguage:void 0,a=o.find((function(e){return e===s}))||r;function l(e){var t;e&&((t=o.find((function(t){return t===e})))?a=t:console.error("Language not found"))}function c(e){if(e)for(var t in e)!function(t){o.find((function(e){return e===t}))||o.push(t),n[t]=Object.assign({},n[r],n[t],e[t])}(t)}function h(e,t,i){var o=n[i=i||a][e]||n[r][e]||e;if(t)for(var s in t)o=o.replace("${"+s+"}",t[s]);return o}},6056:function(e,t,i){"use strict";i.d(t,{J:function(){return s},r:function(){return r}}),t=i(5156);var n=i.n(t),o=i(9791);function r(e,t){var i,n=t.sort,r=t.filter,s=(t=t.projection,"");return r?(i="@"!==r.field?["0"].concat((0,o.parsePath)("."+r.field)):["0"],i="string"==typeof(0,o.get)(e,i)?r.value:(0,o.parseString)(r.value),s+="[? "+r.field+" "+r.relation+" `"+JSON.stringify(i)+"`]"):s+=Array.isArray(e)?"[*]":"@",n&&("desc"===n.direction?s+=" | reverse(sort_by(@, &"+n.field+"))":s+=" | sort_by(@, &"+n.field+")"),t&&("]"!==s[s.length-1]&&(s+=" | [*]"),1===t.fields.length?s+="."+t.fields[0]:1<t.fields.length&&(s+=".{"+t.fields.map((function(e){var t=e.split(".");return t[t.length-1]+": "+e})).join(", ")+"}")),s}function s(e,t){return n().search(e,t)}},4987:function(){function e(e){void 0===e||"remove"in e||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){void 0!==this.parentNode&&this.parentNode.removeChild(this)}})}"undefined"!=typeof Element&&(void 0!==window.Element&&e(window.Element.prototype),void 0!==window.CharacterData&&e(window.CharacterData.prototype),void 0!==window.DocumentType)&&e(window.DocumentType.prototype),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){for(var t=0;t<this.length;t++){var i=this[t];if(e.call(this,i,t,this))return t}return-1},configurable:!0,writable:!0}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){return this[e=this.findIndex(e)]},configurable:!0,writable:!0}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},341:function(e,t,i){"use strict";i.r(t),i.d(t,{previewModeMixins:function(){return f}});var n=i(1262),o=i(4188),r=i(6436),s=i(2474);function a(e){return(a="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})(e)}function l(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==a(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==a(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===a(e)?e:String(e)}(n.key),n)}}var c=function(){function e(t,i,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.onChange=t,this.calculateItemSize=i||function(){return 1},this.limit=n,this.items=[],this.index=-1}var t,i,n;return t=e,(i=[{key:"add",value:function(e){for(;this._calculateHistorySize()>this.limit&&1<this.items.length;)this.items.shift(),this.index--;this.items=this.items.slice(0,this.index+1),this.items.push(e),this.index++,this.onChange()}},{key:"_calculateHistorySize",value:function(){var e=this.calculateItemSize,t=0;return this.items.forEach((function(i){t+=e(i)})),t}},{key:"undo",value:function(){if(this.canUndo())return this.index--,this.onChange(),this.items[this.index]}},{key:"redo",value:function(){if(this.canRedo())return this.index++,this.onChange(),this.items[this.index]}},{key:"canUndo",value:function(){return 0<this.index}},{key:"canRedo",value:function(){return this.index<this.items.length-1}},{key:"clear",value:function(){this.items=[],this.index=-1,this.onChange()}}])&&l(t.prototype,i),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),h=i(7907),d=i(6056),u=i(6617),p=i(6210),g=i(2558),m=(t=i(8458),i(9791)),f=(i=t.textModeMixins[0].mixin,t={create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=(void 0===t.statusBar&&(t.statusBar=!0),t.mainMenuBar=!1!==t.mainMenuBar,t.enableSort=!1!==t.enableSort,t.enableTransform=!1!==t.enableTransform,t.createQuery=t.createQuery||d.r,t.executeQuery=t.executeQuery||d.J,"number"==typeof(this.options=t).indentation?this.indentation=Number(t.indentation):this.indentation=2,(0,h.cC)(this.options.languages),(0,h.m0)(this.options.language),this.mode="preview",this);this.container=e,this.dom={},this.json=void 0,this.text="",this._debouncedValidate=(0,m.debounce)(this.validate.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-preview",this.frame.onclick=function(e){e.preventDefault()},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null},this.frameFocusTracker=new s.R(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.dom.busy=document.createElement("div"),this.dom.busy.className="jsoneditor-busy",this.dom.busyContent=document.createElement("span"),this.dom.busyContent.textContent="busy...",this.dom.busy.appendChild(this.dom.busyContent),this.content.appendChild(this.dom.busy),this.dom.previewContent=document.createElement("pre"),this.dom.previewContent.className="jsoneditor-preview",this.dom.previewText=document.createTextNode(""),this.dom.previewContent.appendChild(this.dom.previewText),this.content.appendChild(this.dom.previewContent),this.options.mainMenuBar&&((0,m.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,h.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){i.executeWithBusyMessage((function(){try{i.format()}catch(e){i._onError(e)}}),"formatting...")},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,h.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){i.executeWithBusyMessage((function(){try{i.compact()}catch(e){i._onError(e)}}),"compacting...")},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,h.Iu)("sortTitleShort"),e.onclick=function(){i._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,h.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){i._showTransformModal()},this.dom.transform=e,this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,h.Iu)("repairTitle"),this.menu.appendChild(e),!(e.onclick=function(){void 0===i.json&&i.executeWithBusyMessage((function(){try{i.repair()}catch(e){i._onError(e)}}),"repairing...")})!==this.options.history&&(this.history=new c((function(){i.dom.undo.disabled=!i.history.canUndo(),i.dom.redo.disabled=!i.history.canRedo()}),(function(e){return 2*e.text.length}),o.oW),(e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,h.Iu)("undo"),e.onclick=function(){var e=i.history.undo();e&&i._applyHistory(e)},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,h.Iu)("redo"),e.onclick=function(){var e=i.history.redo();e&&i._applyHistory(e)},this.menu.appendChild(e),this.dom.redo=e,this.history.onChange()),this.options)&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new u.x(this.menu,this.options.modes,this.options.mode,(function(e){try{i.setMode(e),i.modeSwitcher.focus()}catch(e){i._onError(e)}}))),e=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable,this.errorTable=new r.Q({errorTableVisible:e,onToggleVisibility:function(){i.validate()},onFocusLine:null,onChangeHeight:function(e){e=e+(i.dom.statusBar?i.dom.statusBar.clientHeight:0)+1,i.content.style.marginBottom=-e+"px",i.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.content),this.frame.appendChild(this.errorTable.getErrorTable()),this.container.appendChild(this.frame),t.statusBar&&((0,m.addClassName)(this.content,"has-status-bar"),e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),this.dom.fileSizeInfo=document.createElement("span"),this.dom.fileSizeInfo.className="jsoneditor-size-info",this.dom.fileSizeInfo.innerText="",e.appendChild(this.dom.fileSizeInfo),this.dom.arrayInfo=document.createElement("span"),this.dom.arrayInfo.className="jsoneditor-size-info",this.dom.arrayInfo.innerText="",e.appendChild(this.dom.arrayInfo),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.appendChild(this.errorTable.getErrorIcon())),this._renderPreview(),this.setSchema(this.options.schema,this.options.schemaRefs)},_renderPreview:function(){var e=this.getText();this.dom.previewText.nodeValue=(0,m.limitCharacters)(e,o.WF),this.dom.fileSizeInfo&&(this.dom.fileSizeInfo.innerText="Size: "+(0,m.formatSize)(e.length)),this.dom.arrayInfo&&(Array.isArray(this.json)?this.dom.arrayInfo.innerText="Array: "+this.json.length+" items":this.dom.arrayInfo.innerText="")},_onChange:function(){if(this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}}},t._showSortModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=e.options.modalAnchor||o.qD,i=e.get();e._renderPreview(),(0,p.showSortModal)(t,i,(function(t){e.executeWithBusyMessage((function(){var n,o,r;n=i,o=t,Array.isArray(n)&&(r=(0,m.sort)(n,o.path,o.direction),e.sortedBy=o,e._setAndFireOnChange(r)),(0,m.isObject)(n)&&(r=(0,m.sortObjectKeys)(n,o.direction),e.sortedBy=o,e._setAndFireOnChange(r))}),"sorting...")}),e.sortedBy)}),"parsing...")},t._showTransformModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=(r=e.options).createQuery,i=r.executeQuery,n=r.modalAnchor,r=r.queryDescription,s=e.get();e._renderPreview(),(0,g.showTransformModal)({container:n||o.qD,json:s,queryDescription:r,createQuery:t,executeQuery:i,onTransform:function(t){e.executeWithBusyMessage((function(){var n=i(s,t);e._setAndFireOnChange(n)}),"transforming...")}})}),"parsing...")},t.destroy=function(){this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this._debouncedValidate=null,this.history&&(this.history.clear(),this.history=null),this.frameFocusTracker.destroy()},t.compact=function(){var e=this.get(),t=JSON.stringify(e);this._setTextAndFireOnChange(t,e)},t.format=function(){var e=this.get(),t=JSON.stringify(e,null,this.indentation);this._setTextAndFireOnChange(t,e)},t.repair=function(){var e=this.getText();try{var t=(0,n.K)(e);this._setTextAndFireOnChange(t)}catch(e){}},t.focus=function(){this.dom.transform.focus()},t.set=function(e){this.history&&this.history.clear(),this._set(e)},t.update=function(e){this._set(e)},t._set=function(e){this.text=void 0,this.json=e,this._renderPreview(),this._pushHistory(),this._debouncedValidate()},t._setAndFireOnChange=function(e){this._set(e),this._onChange()},t.get=function(){var e;return void 0===this.json&&(e=this.getText(),this.json=(0,m.parse)(e)),this.json},t.getText=function(){return void 0===this.text&&(this.text=JSON.stringify(this.json,null,this.indentation),!0===this.options.escapeUnicode)&&(this.text=(0,m.escapeUnicodeChars)(this.text)),this.text},t.setText=function(e){this.history&&this.history.clear(),this._setText(e)},t.updateText=function(e){this.getText()!==e&&this._setText(e)},t._setText=function(e,t){var i;!0===this.options.escapeUnicode?this.text=(0,m.escapeUnicodeChars)(e):this.text=e,this.json=t,this._renderPreview(),void 0===this.json?(i=this).executeWithBusyMessage((function(){try{i.json=i.get(),i._renderPreview(),i._pushHistory()}catch(e){}}),"parsing..."):this._pushHistory(),this._debouncedValidate()},t._setTextAndFireOnChange=function(e,t){this._setText(e,t),this._onChange()},t._applyHistory=function(e){this.json=e.json,this.text=e.text,this._renderPreview(),this._debouncedValidate()},t._pushHistory=function(){var e;this.history&&(e={text:this.text,json:this.json},this.history.add(e))},t.executeWithBusyMessage=function(e,t){var i;this.getText().length>o.EX?((0,m.addClassName)((i=this).frame,"busy"),i.dom.busyContent.innerText=t,setTimeout((function(){e(),(0,m.removeClassName)(i.frame,"busy"),i.dom.busyContent.innerText=""}),100)):e()},t.validate=i.validate,t._renderErrors=i._renderErrors,[{mode:"preview",mixin:t,data:"json"}])},6210:function(e,t,i){"use strict";i.r(t),i.d(t,{showSortModal:function(){return s}}),t=i(483);var n=i.n(t),o=i(7907),r=i(9791);function s(e,t,i,s){var a=Array.isArray(t)?(0,r.getChildPaths)(t):[""],l=s&&s.path&&(0,r.contains)(a,s.path)?s.path:a[0],c=s&&s.direction||"asc";t='<div class="pico-modal-contents"><div class="pico-modal-header">'+(0,o.Iu)("sort")+"</div><form><table><tbody><tr>  <td>"+(0,o.Iu)("sortFieldLabel")+' </td>  <td class="jsoneditor-modal-input">  <div class="jsoneditor-select-wrapper">    <select id="field" title="'+(0,o.Iu)("sortFieldTitle")+'">    </select>  </div>  </td></tr><tr>  <td>'+(0,o.Iu)("sortDirectionLabel")+' </td>  <td class="jsoneditor-modal-input">  <div id="direction" class="jsoneditor-button-group"><input type="button" value="'+(0,o.Iu)("sortAscending")+'" title="'+(0,o.Iu)("sortAscendingTitle")+'" data-value="asc" class="jsoneditor-button-first jsoneditor-button-asc"/><input type="button" value="'+(0,o.Iu)("sortDescending")+'" title="'+(0,o.Iu)("sortDescendingTitle")+'" data-value="desc" class="jsoneditor-button-last jsoneditor-button-desc"/>  </div>  </td></tr><tr><td colspan="2" class="jsoneditor-modal-input jsoneditor-modal-actions">  <input type="submit" id="ok" value="'+(0,o.Iu)("ok")+'" /></td></tr></tbody></table></form></div>',n()({parent:e,content:t,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-sort"}).afterCreate((function(e){var t=e.modalElem().querySelector("form"),n=e.modalElem().querySelector("#ok"),o=e.modalElem().querySelector("#field"),r=e.modalElem().querySelector("#direction");function s(e){r.value=e,r.className="jsoneditor-button-group jsoneditor-button-group-value-"+r.value}a.forEach((function(e){var t,i=document.createElement("option");i.text=""===(t=e)?"@":"."===t[0]?t.slice(1):t,i.value=e,o.appendChild(i)})),o.value=l||a[0],s(c||"asc"),r.onclick=function(e){s(e.target.getAttribute("data-value"))},n.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),i({path:o.value,direction:r.value})},t&&(t.onsubmit=n.onclick)})).afterClose((function(e){e.destroy()})).show()}},2558:function(e,t,i){"use strict";i.r(t),i.d(t,{showTransformModal:function(){return u}}),t=i(483);var n=i.n(t),o=(t=i(3879),i.n(t)),r=i(7907);function s(e){return(s="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})(e)}function a(e,t,i,n){if("boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date)return JSON.stringify(e);if(Array.isArray(e)){for(var o=e,r=t,l=i,c=n,h=r?l+r:void 0,d=r?"[\n":"[",u=0;u<o.length;u++){var p=o[u];if(r&&(d+=h),d+=void 0!==p&&"function"!=typeof p?a(p,r,h,c):"null",u<o.length-1&&(d+=r?",\n":","),d.length>c)return d+"..."}return d+(r?"\n"+l+"]":"]")}if(e&&"object"===s(e)){var g,m=e,f=t,y=(l=i,n),v=f?l+f:void 0,C=!0,I=f?"{\n":"{";if("function"==typeof m.toJSON)return a(m.toJSON(),f,l,y);for(g in m)if(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(m,g)&&(C?C=!1:I+=f?",\n":",",(I=(I+=f?v+'"'+g+'": ':'"'+g+'":')+a(m[g],f,v,y)).length>y))return I+"...";return I+(f?"\n"+l+"}":"}")}}function l(e,t){for(var i="";0<t--;)i+=e;return i}var c=i(9791),h=i(4188),d='Enter a <a href="http://jmespath.org" target="_blank">JMESPath</a> query to filter, sort, or transform the JSON data.<br/>To learn JMESPath, go to <a href="http://jmespath.org/tutorial.html" target="_blank">the interactive tutorial</a>.';function u(e){var t=e.container,i=e.json,s=void 0===(s=e.queryDescription)?d:s,u=e.createQuery,p=e.executeQuery,g=e.onTransform,m=i;e='<label class="pico-modal-contents"><div class="pico-modal-header">'+(0,r.Iu)("transform")+"</div><p>"+s+'</p><div class="jsoneditor-jmespath-label">'+(0,r.Iu)("transformWizardLabel")+' </div><div id="wizard" class="jsoneditor-jmespath-block jsoneditor-jmespath-wizard">  <table class="jsoneditor-jmespath-wizard-table">    <tbody>      <tr>        <th>'+(0,r.Iu)("transformWizardFilter")+'</th>        <td class="jsoneditor-jmespath-filter">          <div class="jsoneditor-inline jsoneditor-jmespath-filter-field" >            <select id="filterField">            </select>          </div>          <div class="jsoneditor-inline jsoneditor-jmespath-filter-relation" >            <select id="filterRelation">              <option value="==">==</option>              <option value="!=">!=</option>              <option value="<">&lt;</option>              <option value="<=">&lt;=</option>              <option value=">">&gt;</option>              <option value=">=">&gt;=</option>            </select>          </div>          <div class="jsoneditor-inline jsoneditor-jmespath-filter-value" >            <input type="text" class="value" placeholder="value..." id="filterValue" />          </div>        </td>      </tr>      <tr>        <th>'+(0,r.Iu)("transformWizardSortBy")+'</th>        <td class="jsoneditor-jmespath-filter">          <div class="jsoneditor-inline jsoneditor-jmespath-sort-field">            <select id="sortField">            </select>          </div>          <div class="jsoneditor-inline jsoneditor-jmespath-sort-order" >            <select id="sortOrder">              <option value="asc">Ascending</option>              <option value="desc">Descending</option>            </select>          </div>        </td>      </tr>      <tr id="selectFieldsPart">        <th>'+(0,r.Iu)("transformWizardSelectFields")+'</th>        <td class="jsoneditor-jmespath-filter">          <select class="jsoneditor-jmespath-select-fields" id="selectFields" multiple></select>        </td>      </tr>    </tbody>  </table></div><div class="jsoneditor-jmespath-label">'+(0,r.Iu)("transformQueryLabel")+' </div><div class="jsoneditor-jmespath-block">  <textarea id="query"             rows="4"             autocomplete="off"             autocorrect="off"             autocapitalize="off"             spellcheck="false"            title="'+(0,r.Iu)("transformQueryTitle")+'">[*]</textarea></div><div class="jsoneditor-jmespath-label">'+(0,r.Iu)("transformPreviewLabel")+' </div><div class="jsoneditor-jmespath-block">  <textarea id="preview"       class="jsoneditor-transform-preview"      readonly> </textarea></div><div class="jsoneditor-jmespath-block jsoneditor-modal-actions">  <input type="submit" id="ok" value="'+(0,r.Iu)("ok")+'" autofocus /></div></div>',n()({parent:t,content:e,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-transform",focus:!1}).afterCreate((function(e){var t=e.modalElem(),n=t.querySelector("#wizard"),r=t.querySelector("#ok"),s=t.querySelector("#filterField"),d=t.querySelector("#filterRelation"),f=t.querySelector("#filterValue"),y=t.querySelector("#sortField"),v=t.querySelector("#sortOrder"),C=t.querySelector("#selectFields"),I=t.querySelector("#query"),b=t.querySelector("#preview");Array.isArray(m)||(n.style.fontStyle="italic",n.textContent="(wizard not available for objects, only for arrays)"),(0,c.getChildPaths)(i).forEach((function(e){var t;e=S(e),((t=document.createElement("option")).text=e,t.value=e,s.appendChild(t),t=document.createElement("option")).text=e,t.value=e,y.appendChild(t)})),n=(0,c.getChildPaths)(i,!0).filter((function(e){return""!==e})),0<n.length?n.forEach((function(e){e=S(e);var t=document.createElement("option");t.text=e,t.value=e,C.appendChild(t)})):(n=t.querySelector("#selectFieldsPart"))&&(n.style.display="none"),n=new(o())(s,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."});var A=new(o())(d,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"compare..."}),w=new(o())(y,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."}),_=new(o())(v,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"order..."}),x=new(o())(C,{multiple:!0,clearable:!0,defaultSelected:!1,placeholder:"select fields..."});function S(e){return""===e?"@":"."===e[0]?e.slice(1):e}n.on("selectr.change",E),A.on("selectr.change",E),f.oninput=E,w.on("selectr.change",E),_.on("selectr.change",E),x.on("selectr.change",E),t.querySelector(".pico-modal-contents").onclick=function(e){"A"!==e.target.nodeName&&e.preventDefault()};var k=(0,c.debounce)((function(){try{var e=p(m,I.value);b.className="jsoneditor-transform-preview",b.value=(t=e,i=2,n=h.WF,"number"==typeof i?10<i?o=l(" ",10):1<=i&&(o=l(" ",i)):"string"==typeof i&&""!==i&&(o=i),(i=a(t,o,"",n)).length>n?(t=i,("number"==typeof(o=n)?t.slice(0,o):t)+"..."):i),r.disabled=!1}catch(e){b.className="jsoneditor-transform-preview jsoneditor-error",b.value=e.toString(),r.disabled=!0}var t,i,n,o}),300);function T(e,t){try{I.value=u(e,t),r.disabled=!1,k()}catch(t){e='Error: an error happened when executing "createQuery": '+(t.message||t.toString()),I.value="",r.disabled=!0,b.className="jsoneditor-transform-preview jsoneditor-error",b.value=e}}function E(){var e={};if(s.value&&d.value&&f.value&&(e.filter={field:s.value,relation:d.value,value:f.value}),y.value&&v.value&&(e.sort={field:y.value,direction:v.value}),C.value){for(var t,n=[],o=0;o<C.options.length;o++)C.options[o].selected&&(t=C.options[o].value,n.push(t));e.projection={fields:n}}T(i,e)}I.oninput=k,r.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),g(I.value)},T(i,{}),setTimeout((function(){I.select(),I.focus(),I.selectionStart=3,I.selectionEnd=3}))})).afterClose((function(e){e.destroy()})).show()}},8458:function(e,t,i){"use strict";i.r(t),i.d(t,{textModeMixins:function(){return A}});var n=i(1262),o=(t=i(8170),i.n(t)),r=i(4188),s=i(6436),a=i(2474),l=i(7907),c=i(6056),h=i(6617),d=i(6210),u=i(2558),p=i(9125),g=i(7026),m=i(9791);function f(e){return(f="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})(e)}function y(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==f(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==f(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===f(e)?e:String(e)}(n.key),n)}}var v=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.schema=t,this.schemaRefs=i||{},this.suggestions={},this.suggestionsRefs={},this._buildSuggestions()}var t,i,n;return t=e,(i=[{key:"_buildSuggestions",value:function(){for(var e in this._handleSchemaEntry("",this.schema,this.suggestions),this.schemaRefs)this.suggestionsRefs[e]={},this._handleSchemaEntry("",this.schemaRefs[e],this.suggestionsRefs[e])}},{key:"_handleRef",value:function(e,t,i){i[e]=i[e]||{},i[e].refs=i[e].refs||[],i[e].refs=(0,m.uniqueMergeArrays)(i[e].refs,[t])}},{key:"_handleSchemaEntry",value:function(e,t,i){if(t)if(t.$ref)this._handleRef(e,t.$ref,i);else{var n=this._checkOfConditon(t);if(n)this._handleOfCondition(e,t[n],i);else switch(t.type){case"object":this._handleObject(e,t,i);break;case"string":case"number":case"integer":this._handlePrimitive(e,t,i);break;case"boolean":this._handleBoolean(e,t,i);break;case"array":this._handleArray(e,t,i)}}else console.error("SchemaTextCompleter: schema node is missing for path",e)}},{key:"_handleObject",value:function(e,t,i){var n,o=this;(0,m.isObject)(t.properties)&&(n=Object.keys(t.properties),i[e]=i[e]||{},i[e].props=i[e].props||[],i[e].props=(0,m.uniqueMergeArrays)(i[e].props,n),n.forEach((function(n){(0,m.asyncExec)((function(){o._handleSchemaEntry("".concat(e,"/").concat(n),t.properties[n],i)}))})))}},{key:"_handlePrimitive",value:function(e,t,i){i[e]=i[e]||{},(0,m.isArray)(t.examples)&&(i[e].examples=i[e].examples||[],i[e].examples=(0,m.uniqueMergeArrays)(i[e].examples,t.examples)),(0,m.isArray)(t.enum)&&(i[e].enum=i[e].enum||[],i[e].enum=(0,m.uniqueMergeArrays)(i[e].enum,t.enum))}},{key:"_handleBoolean",value:function(e,t,i){i[e]||(i[e]={bool:[!0,!1]})}},{key:"_handleArray",value:function(e,t,i){var n=this;t.items&&(0,m.asyncExec)((function(){n._handleSchemaEntry("".concat(e,"/\\d+"),t.items,i)}))}},{key:"_handleOfCondition",value:function(e,t,i){var n=this;t&&t.length&&t.forEach((function(t){(0,m.asyncExec)((function(){n._handleSchemaEntry(e,t,i)}))}))}},{key:"_checkOfConditon",value:function(e){if(e)return e.oneOf?"oneOf":e.anyOf?"anyOf":e.allOf?"allOf":void 0}},{key:"getCompletions",value:function(e,t,i,n,o){var r=this;try{var s=g.parse(t.getValue()).pointers||{},a=function(e){function t(t){var o,r={props:"property",enum:"enum",bool:"boolean",examples:"examples"};e&&null!=(o=e[t])&&o.length&&(i=i.concat(e[t].map((function(e){return{caption:e+"",meta:"schema [".concat(r[t],"]"),score:n++,value:e+""}}))))}var i=[],n=0;t("props"),t("enum"),t("bool"),t("examples"),i.length&&o(null,i)};Object.keys(s).forEach((function(e){(0,m.asyncExec)((function(){function t(e,i,n){var o,s=Object.keys(i).reduce((function(t,i){return new RegExp("^".concat(n).concat(i)).test(e)&&(!t||t.length<i.length)?i:t}));if("string"==typeof s){if(null!=(o=i[s])&&null!=(o=o.refs)&&o.length){var a,l={};for(a in i[s].refs){var c=i[s].refs[a];r.suggestionsRefs[c]&&(null!=(c=t(e,r.suggestionsRefs[c],"".concat(n).concat(s)))&&c.enum&&(l.enum=(0,m.uniqueMergeArrays)(l.enum,c.enum)),null!=c&&c.examples&&(l.examples=(0,m.uniqueMergeArrays)(l.examples,c.examples)),null!=c&&c.bool&&(l.bool=(0,m.uniqueMergeArrays)(l.bool,c.bool)),null!=c)&&c.props&&(l.props=(0,m.uniqueMergeArrays)(l.props,c.props))}return l}if(new RegExp("^".concat(n).concat(s,"$")).test(e))return i[s]}}var n,o;(null==(o=s[e].key)?void 0:o.line)===i.row&&i.column>=s[e].key.column&&i.column<=s[e].keyEnd.column&&(n=e.slice(0,e.lastIndexOf("/"))),(n=(null==(o=s[e].value)?void 0:o.line)===i.row&&(null==(o=s[e].value)?void 0:o.line)===(null==(o=s[e].valueEnd)?void 0:o.line)&&i.column>=s[e].value.column&&i.column<=s[e].valueEnd.column?e:n)&&(o=t(n,r.suggestions,""),a(o))}))}))}catch(e){}}}])&&y(t.prototype,i),n&&y(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function C(e){return(C="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})(e)}var I="ace/theme/jsoneditor";function b(){try{this.format()}catch(e){}}(t={}).create=function(e){var t,i,n,r=this,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},u=(void 0===d.statusBar&&(d.statusBar=!0),d.mainMenuBar=!1!==d.mainMenuBar,d.enableSort=!1!==d.enableSort,d.enableTransform=!1!==d.enableTransform,d.createQuery=d.createQuery||c.r,d.executeQuery=d.executeQuery||c.J,d.showErrorTable=void 0!==d.showErrorTable?d.showErrorTable:["text","preview"],"number"==typeof(this.options=d).indentation?this.indentation=Number(d.indentation):this.indentation=2,(0,l.cC)(this.options.languages),(0,l.m0)(this.options.language),d.ace||o()),g=(this.mode="code"===d.mode?"code":"text","code"===this.mode&&void 0===u&&(this.mode="text",console.warn("Failed to load Ace editor, falling back to plain text mode. Please use a JSONEditor bundle including Ace, or pass Ace as via the configuration option `ace`.")),this.theme=d.theme||I,this.theme===I&&u&&(0,p.O)(),d.onTextSelectionChange&&this.onTextSelectionChange(d.onTextSelectionChange),this);this.container=e,this.dom={},this.aceEditor=void 0,this.textarea=void 0,this.validateSchema=null,this.annotations=[],this.lastSchemaErrors=void 0,this._debouncedValidate=(0,m.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.frame.onclick=function(e){e.preventDefault()},this.frame.onkeydown=function(e){g._onKeyDown(e)},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null},this.frameFocusTracker=new a.R(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.options.mainMenuBar&&((0,m.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,l.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.format(),g._onChange()}catch(e){g._onError(e)}},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,l.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.compact(),g._onChange()}catch(e){g._onError(e)}},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,l.Iu)("sortTitleShort"),e.onclick=function(){g._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,l.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){g._showTransformModal()},this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,l.Iu)("repairTitle"),this.menu.appendChild(e),e.onclick=function(){try{g.repair(),g._onChange()}catch(e){g._onError(e)}},"code"===this.mode&&((e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,l.Iu)("undo"),e.onclick=function(){r.aceEditor.getSession().getUndoManager().undo()},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,l.Iu)("redo"),e.onclick=function(){r.aceEditor.getSession().getUndoManager().redo()},this.menu.appendChild(e),this.dom.redo=e),this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new h.x(this.menu,this.options.modes,this.options.mode,(function(e){try{g.setMode(e),g.modeSwitcher.focus()}catch(e){g._onError(e)}}))),"code"===this.mode)&&((t=document.createElement("a")).appendChild(document.createTextNode("powered by ace")),t.href="https://ace.c9.io/",t.target="_blank",t.className="jsoneditor-poweredBy",t.onclick=function(){window.open(t.href,t.target,"noreferrer")},this.menu.appendChild(t)),e=this.options.onEditable&&C("function"===this.options.onEditable)&&!this.options.onEditable({}),this.frame.appendChild(this.content),this.container.appendChild(this.frame),"code"===this.mode?(this.editorDom=document.createElement("div"),this.editorDom.style.height="100%",this.editorDom.style.width="100%",this.content.appendChild(this.editorDom),n=(u=u.edit(this.editorDom)).getSession(),u.$blockScrolling=1/0,u.setTheme(this.theme),u.setOptions({readOnly:e}),u.setShowPrintMargin(!1),u.setFontSize("14px"),n.setMode("ace/mode/json"),n.setTabSize(this.indentation),n.setUseSoftTabs(!0),n.setUseWrapMode(!0),i=n.setAnnotations,n.setAnnotations=function(e){i.call(this,e&&e.length?e:g.annotations)},u.commands.bindKey("Ctrl-L",null),u.commands.bindKey("Command-L",null),u.commands.bindKey("Ctrl-\\",null),u.commands.bindKey("Command-\\",null),u.commands.bindKey("Ctrl-Shift-\\",null),u.commands.bindKey("Command-Shift-\\",null),(this.aceEditor=u).on("change",this._onChange.bind(this)),u.on("changeSelection",this._onSelect.bind(this))):((n=document.createElement("textarea")).className="jsoneditor-text",n.spellcheck=!1,this.content.appendChild(n),this.textarea=n,this.textarea.readOnly=e,null===this.textarea.oninput?this.textarea.oninput=this._onChange.bind(this):this.textarea.onchange=this._onChange.bind(this),n.onselect=this._onSelect.bind(this),n.onmousedown=this._onMouseDown.bind(this),n.onblur=this._onBlur.bind(this)),this._updateHistoryButtons(),u=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable,this.errorTable=new s.Q({errorTableVisible:u,onToggleVisibility:function(){g._validateAndCatch()},onFocusLine:function(e){g.isFocused=!0,isNaN(e)||g.setTextSelection({row:e,column:1},{row:e,column:1e3})},onChangeHeight:function(e){e=e+(g.dom.statusBar?g.dom.statusBar.clientHeight:0)+1,g.content.style.marginBottom=-e+"px",g.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.errorTable.getErrorTable()),d.statusBar&&((0,m.addClassName)(this.content,"has-status-bar"),this.curserInfoElements={},e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),(n=document.createElement("span")).className="jsoneditor-curserinfo-label",n.innerText="Ln:",(u=document.createElement("span")).className="jsoneditor-curserinfo-val",u.innerText="1",e.appendChild(n),e.appendChild(u),(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="Col:",(n=document.createElement("span")).className="jsoneditor-curserinfo-val",n.innerText="1",e.appendChild(d),e.appendChild(n),this.curserInfoElements.colVal=n,this.curserInfoElements.lnVal=u,(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="characters selected",d.style.display="none",(n=document.createElement("span")).className="jsoneditor-curserinfo-count",n.innerText="0",n.style.display="none",this.curserInfoElements.countLabel=d,this.curserInfoElements.countVal=n,e.appendChild(n),e.appendChild(d),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.appendChild(this.errorTable.getErrorIcon())),this.setSchema(this.options.schema,this.options.schemaRefs)},t._onSchemaChange=function(e,t){this.aceEditor&&(this.options.allowSchemaSuggestions&&e?(this.aceEditor.setOption("enableBasicAutocompletion",[new v(e,t)]),this.aceEditor.setOption("enableLiveAutocompletion",!0)):(this.aceEditor.setOption("enableBasicAutocompletion",void 0),this.aceEditor.setOption("enableLiveAutocompletion",!1)))},t._onChange=function(){var e=this;if(!this.onChangeDisabled){if(setTimeout((function(){e._updateHistoryButtons&&e._updateHistoryButtons()})),this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}}},t._updateHistoryButtons=function(){var e;this.aceEditor&&this.dom.undo&&this.dom.redo&&(e=this.aceEditor.getSession().getUndoManager())&&e.hasUndo&&e.hasRedo&&(this.dom.undo.disabled=!e.hasUndo(),this.dom.redo.disabled=!e.hasRedo())},t._showSortModal=function(){try{var e=this,t=this.options.modalAnchor||r.qD,i=this.get();(0,d.showSortModal)(t,i,(function(t){var n;Array.isArray(i)&&(n=(0,m.sort)(i,t.path,t.direction),e.sortedBy=t,e.update(n)),(0,m.isObject)(i)&&(n=(0,m.sortObjectKeys)(i,t.direction),e.sortedBy=t,e.update(n))}),e.sortedBy)}catch(t){this._onError(t)}},t._showTransformModal=function(){var e=this;try{var t=this.options,i=t.modalAnchor,n=t.createQuery,o=t.executeQuery,s=t.queryDescription,a=this.get();(0,u.showTransformModal)({container:i||r.qD,json:a,queryDescription:s,createQuery:n,executeQuery:o,onTransform:function(t){t=o(a,t),e.update(t)}})}catch(t){this._onError(t)}},t._onSelect=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onKeyDown=function(e){var t=!1;73===(e.which||e.keyCode)&&e.ctrlKey&&(e.shiftKey?this.compact():this.format(),this._onChange(),t=!0),t&&(e.preventDefault(),e.stopPropagation()),this._updateCursorInfo(),this._emitSelectionChange()},t._onMouseDown=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onBlur=function(){var e=this;setTimeout((function(){e.isFocused||(e._updateCursorInfo(),e._emitSelectionChange()),e.isFocused=!1}))},t._updateCursorInfo=function(){var e,t,i,n,o,r=this;function s(){r.curserInfoElements.countVal.innerText!==o&&(r.curserInfoElements.countVal.innerText=o,r.curserInfoElements.countVal.style.display=o?"inline":"none",r.curserInfoElements.countLabel.style.display=o?"inline":"none"),r.curserInfoElements.lnVal.innerText=i,r.curserInfoElements.colVal.innerText=n}this.textarea?setTimeout((function(){var e=(0,m.getInputSelection)(r.textarea);e.startIndex!==e.endIndex&&(o=e.endIndex-e.startIndex),n=(o&&r.cursorInfo&&r.cursorInfo.line===e.end.row&&r.cursorInfo.column===e.end.column?(i=e.start.row,e.start):(i=e.end.row,e.end)).column,r.cursorInfo={line:i,column:n,count:o},r.options.statusBar&&s()}),0):this.aceEditor&&this.curserInfoElements&&(e=this.aceEditor.getCursorPosition(),t=this.aceEditor.getSelectedText(),i=e.row+1,n=e.column+1,o=t.length,r.cursorInfo={line:i,column:n,count:o},this.options.statusBar)&&s()},t._emitSelectionChange=function(){var e;this._selectionChangedHandler&&(e=this.getTextSelection(),this._selectionChangedHandler(e.start,e.end,e.text))},t._refreshAnnotations=function(){var e,t=this.aceEditor&&this.aceEditor.getSession();t&&(e=t.getAnnotations().filter((function(e){return"error"===e.type})),t.setAnnotations(e))},t.destroy=function(){this.aceEditor&&(this.aceEditor.destroy(),this.aceEditor=null),this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.textarea=null,this._debouncedValidate=null,this.frameFocusTracker.destroy()},t.compact=function(){var e=this.get();e=JSON.stringify(e),this.updateText(e)},t.format=function(){var e=this.get();e=JSON.stringify(e,null,this.indentation),this.updateText(e)},t.repair=function(){var e=this.getText();try{var t=(0,n.K)(e);this.updateText(t)}catch(e){}},t.focus=function(){this.textarea&&this.textarea.focus(),this.aceEditor&&this.aceEditor.focus()},t.resize=function(){this.aceEditor&&this.aceEditor.resize(!1)},t.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},t.update=function(e){this.updateText(JSON.stringify(e,null,this.indentation))},t.get=function(){var e=this.getText();return(0,m.parse)(e)},t.getText=function(){return this.textarea?this.textarea.value:this.aceEditor?this.aceEditor.getValue():""},t._setText=function(e,t){var i,n=this;e=!0===this.options.escapeUnicode?(0,m.escapeUnicodeChars)(e):e,this.textarea&&(this.textarea.value=e),this.aceEditor&&(this.onChangeDisabled=!0,this.aceEditor.setValue(e,-1),this.onChangeDisabled=!1,t&&(i=this,setTimeout((function(){i.aceEditor&&i.aceEditor.session.getUndoManager().reset()}))),setTimeout((function(){n._updateHistoryButtons&&n._updateHistoryButtons()}))),this._debouncedValidate()},t.setText=function(e){this._setText(e,!0)},t.updateText=function(e){this.getText()!==e&&this._setText(e,!1)},t.validate=function(){var e,t=this,i=[],n=[];try{var o=this.get(),r=(this.validateSchema&&!this.validateSchema(o)&&(i=this.validateSchema.errors.map((function(e){return e.type="validation",(0,m.improveSchemaError)(e)}))),this.validationSequence=(this.validationSequence||0)+1,this),s=this.validationSequence;return function(e,t){if(!t)return Promise.resolve([]);try{var i=t(e);return((0,m.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,m.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){return{dataPath:(0,m.stringifyPath)(e.path),message:e.message,type:"customValidation"}})):[]}))}catch(e){return Promise.reject(e)}}(o,this.options.onValidate).then((function(e){return s===r.validationSequence&&(e=i.concat(n).concat(e),r._renderErrors(e),"function"==typeof t.options.onValidationError&&(0,m.isValidationErrorChanged)(e,t.lastSchemaErrors)&&t.options.onValidationError.call(t,e),t.lastSchemaErrors=e),t.lastSchemaErrors}))}catch(t){return this.getText()&&((o=/\w*line\s*(\d+)\w*/g.exec(t.message))&&(e=+o[1]),n=[{type:"error",message:t.message.replace(/\n/g,"<br>"),line:e}]),this._renderErrors(n),"function"==typeof this.options.onValidationError&&(0,m.isValidationErrorChanged)(n,this.lastSchemaErrors)&&this.options.onValidationError.call(this,n),this.lastSchemaErrors=n,Promise.resolve(this.lastSchemaErrors)}},t._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},t._renderErrors=function(e){var t=this.getText(),i=[];e.reduce((function(e,t){return"string"==typeof t.dataPath&&-1===e.indexOf(t.dataPath)&&e.push(t.dataPath),e}),i),t=(0,m.getPositionForPath)(t,i),this.aceEditor&&(this.annotations=t.map((function(t){var i=e.filter((function(e){return e.dataPath===t.path})),n=i.map((function(e){return e.message})).join("\n");return n?{row:t.line,column:t.column,text:"Schema validation error"+(1!==i.length?"s":"")+": \n"+n,type:"warning",source:"jsoneditor"}:{}})),this._refreshAnnotations()),this.errorTable.setErrors(e,t),this.aceEditor&&this.aceEditor.resize(!1)},t.getTextSelection=function(){var e,t,i,n={};return this.textarea?(i=(0,m.getInputSelection)(this.textarea),this.cursorInfo&&this.cursorInfo.line===i.end.row&&this.cursorInfo.column===i.end.column?(n.start=i.end,n.end=i.start):n=i,{start:n.start,end:n.end,text:this.textarea.value.substring(i.startIndex,i.endIndex)}):this.aceEditor?(i=this.aceEditor.getSelection(),e=this.aceEditor.getSelectedText(),t=i.getRange(),(i=i.getSelectionLead()).row===t.end.row&&i.column===t.end.column?n=t:(n.start=t.end,n.end=t.start),{start:{row:n.start.row+1,column:n.start.column+1},end:{row:n.end.row+1,column:n.end.column+1},text:e}):void 0},t.onTextSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,m.debounce)(e,this.DEBOUNCE_INTERVAL))},t.setTextSelection=function(e,t){var i,n,o;e&&t&&(this.textarea?(i=(0,m.getIndexForPosition)(this.textarea,e.row,e.column),o=(0,m.getIndexForPosition)(this.textarea,t.row,t.column),-1<i&&-1<o&&(this.textarea.setSelectionRange?(this.textarea.focus(),this.textarea.setSelectionRange(i,o)):this.textarea.createTextRange&&((n=this.textarea.createTextRange()).collapse(!0),n.moveEnd("character",o),n.moveStart("character",i),n.select()),o=(this.textarea.value.match(/\n/g)||[]).length+1,i=this.textarea.scrollHeight/o,n=e.row*i,this.textarea.scrollTop=n>this.textarea.clientHeight?n-this.textarea.clientHeight/2:0)):this.aceEditor&&(o={start:{row:e.row-1,column:e.column-1},end:{row:t.row-1,column:t.column-1}},this.aceEditor.selection.setRange(o),this.aceEditor.scrollToLine(e.row-1,!0)))};var A=[{mode:"text",mixin:t,data:"text",load:b},{mode:"code",mixin:t,data:"text",load:b}]},8038:function(e,t,i){"use strict";i.r(t),i.d(t,{treeModeMixins:function(){return V}});var n={start:function(e,t,i){return 0===t.indexOf(e)},contain:function(e,t,i){return-1<t.indexOf(e)}},o=i(897),r=i(2474);function s(e){return(s="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})(e)}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==s(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==s(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===s(e)?e:String(e)}(n.key),n)}}var l=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.locked=!1}var t,i,n;return t=e,(i=[{key:"highlight",value:function(e){this.locked||(this.node!==e&&(this.node&&this.node.setHighlight(!1),this.node=e,this.node.setHighlight(!0)),this._cancelUnhighlight())}},{key:"unhighlight",value:function(){var e;this.locked||(e=this).node&&(this._cancelUnhighlight(),this.unhighlightTimer=setTimeout((function(){e.node.setHighlight(!1),e.node=void 0,e.unhighlightTimer=void 0}),0))}},{key:"_cancelUnhighlight",value:function(){this.unhighlightTimer&&(clearTimeout(this.unhighlightTimer),this.unhighlightTimer=void 0)}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}}])&&a(t.prototype,i),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),c=i(7907),h=i(6056),d=i(6617),u=(t=i(233),i.n(t)),p=i(2602),g=i(9791),m=i(6210),f=i(2558),y=i(4188);function v(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){var i,n,o,r,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return n=!(i=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return i=e.done,e},e:function(e){n=!0,o=e},f:function(){try{i||null==s.return||s.return()}finally{if(n)throw o}}};if(Array.isArray(e)||(s=b(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function b(e,t){var i;if(e)return"string"==typeof e?A(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?A(e,t):void 0}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function w(e){return(w="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})(e)}function _(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==w(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==w(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===w(e)?e:String(e)}(n.key),n)}}var x=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.editor=t,this.dom={},this.expanded=!1,i&&i instanceof Object?(this.setField(i.field,i.fieldEditable),"value"in i&&this.setValue(i.value,i.type),"internalValue"in i&&this.setInternalValue(i.internalValue)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=(0,g.debounce)(this._onChangeValue.bind(this),e.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=(0,g.debounce)(this._onChangeField.bind(this),e.prototype.DEBOUNCE_INTERVAL),this.visibleChilds=this.getMaxVisibleChilds()}var t,i,n;return t=e,(i=[{key:"getMaxVisibleChilds",value:function(){return this.editor&&this.editor.options&&this.editor.options.maxVisibleChilds?this.editor.options.maxVisibleChilds:S}},{key:"_updateEditability",value:function(){var e,t;this.editable={field:!0,value:!0},this.editor&&(this.editable.field="tree"===this.editor.options.mode,this.editable.value="view"!==this.editor.options.mode,"tree"!==this.editor.options.mode&&"form"!==this.editor.options.mode||"function"!=typeof this.editor.options.onEditable||(e=this.getValue.bind(this),"boolean"==typeof(t=this.editor.options.onEditable({field:this.field,get value(){return e()},path:this.getPath()}))?(this.editable.field=t,this.editable.value=t):"object"===w(t)&&null!==t?("boolean"==typeof t.field&&(this.editable.field=t.field),"boolean"==typeof t.value&&(this.editable.value=t.value)):(console.error("Invalid return value for function onEditable.","Actual value:",t,".","Either a boolean or object { field: boolean, value: boolean } expected."),this.editable.field=!1,this.editable.value=!1)))}},{key:"getPath",value:function(){for(var e=this,t=[];e;){var i=e.getName();void 0!==i&&t.unshift(i),e=e.parent}return t}},{key:"getInternalPath",value:function(){for(var e=this,t=[];e;)e.parent&&t.unshift(e.getIndex()),e=e.parent;return t}},{key:"getName",value:function(){return this.parent?"array"!==this.parent.type?this.field:this.index:void 0}},{key:"findNodeByPath",value:function(e){if(e){if(0===e.length)return this;if(e.length&&this.childs&&this.childs.length)for(var t=0;t<this.childs.length;++t)if(""+e[0]==""+this.childs[t].getName())return this.childs[t].findNodeByPath(e.slice(1))}}},{key:"findNodeByInternalPath",value:function(e){if(e){for(var t=this,i=0;i<e.length&&t;i++){var n=e[i];t=t.childs[n]}return t}}},{key:"serialize",value:function(){return{value:this.getValue(),path:this.getPath()}}},{key:"findNode",value:function(e){for(var t=(0,g.parsePath)(e),i=this;i&&0<t.length;)!function(){var e=t.shift();if("number"==typeof e){if("array"!==i.type)throw new Error("Cannot get child node at index "+e+": node is no array");i=i.childs[e]}else{if("object"!==i.type)throw new Error("Cannot get child node "+e+": node is no object");i=i.childs.filter((function(t){return t.field===e}))[0]}}();return i}},{key:"findParents",value:function(){for(var e=[],t=this.parent;t;)e.unshift(t),t=t.parent;return e}},{key:"setError",value:function(e,t){this.error=e,this.errorChild=t,this.dom&&this.dom.tr&&this.updateError()}},{key:"updateError",value:function(){var e=this,t=this.fieldError||this.valueError||this.error,i=this.dom.tdError;if(t&&this.dom&&this.dom.tr){(0,g.addClassName)(this.dom.tr,"jsoneditor-validation-error"),i||(i=document.createElement("td"),this.dom.tdError=i,this.dom.tdValue.parentNode.appendChild(i));var n=document.createElement("button"),o=(n.type="button",n.className="jsoneditor-button jsoneditor-schema-error",function(){e.dom.popupAnchor&&e.dom.popupAnchor.destroy()}),r=function(){delete e.dom.popupAnchor},s=function(i){var o=e.editor.frame;e.dom.popupAnchor=(0,p.w)(n,e.editor.getPopupAnchor(),r,i),i=n.getBoundingClientRect(),o=120<o.getBoundingClientRect().width-i.x?"jsoneditor-above":"jsoneditor-left",(i=document.createElement("div")).className="jsoneditor-popover "+o,i.appendChild(document.createTextNode(t.message)),e.dom.popupAnchor.appendChild(i)},a=(n.onmouseover=function(){e.dom.popupAnchor||s(!0)},n.onfocus=function(){o(),s(!1)},n.onblur=function(){o()},this.errorChild);for(a&&(n.onclick=function(){a.findParents().forEach((function(e){e.expand(!1)})),a.scrollTo((function(){a.focus()}))});i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n)}else this.dom.tr&&(0,g.removeClassName)(this.dom.tr,"jsoneditor-validation-error"),i&&(this.dom.tdError.parentNode.removeChild(this.dom.tdError),delete this.dom.tdError)}},{key:"getIndex",value:function(){var e;return this.parent?-1!==(e=this.parent.childs.indexOf(this))?e:null:-1}},{key:"setParent",value:function(e){this.parent=e}},{key:"setField",value:function(e,t){this.field=e,this.previousField=e,this.fieldEditable=!0===t}},{key:"getField",value:function(){return void 0===this.field&&this._getDomField(),this.field}},{key:"setValue",value:function(t,i){var n,o,r,s,a,l,c=this.childs;if(this.type=this._getType(t),i&&i!==this.type){if("string"!==i||"auto"!==this.type)throw new Error('Type mismatch: cannot cast value of type "'+this.type+' to the specified type "'+i+'"');this.type=i}if("array"===this.type){for(this.childs||(this.childs=[]),n=0;n<t.length;n++)void 0===(a=t[n])||a instanceof Function||(n<this.childs.length?((r=this.childs[n]).fieldEditable=!1,r.index=n,r.setValue(a)):(r=new e(this.editor,{value:a}),s=n<this.getMaxVisibleChilds(),this.appendChild(r,s,!1)));for(o=this.childs.length;o>=t.length;o--)this.removeChild(this.childs[o],!1)}else if("object"===this.type){for(this.childs||(this.childs=[]),o=this.childs.length-1;0<=o;o--)E(t,this.childs[o].field)||this.removeChild(this.childs[o],!1);for(var h in n=0,t)E(t,h)&&(void 0===(a=t[h])||a instanceof Function||((l=this.findChildByProperty(h))?(l.setField(h,!0),l.setValue(a)):(l=new e(this.editor,{field:h,value:a}),h=n<this.getMaxVisibleChilds(),this.appendChild(l,h,!1))),n++);!(this.value="")===this.editor.options.sortObjectKeys&&this.sort([],"asc",!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t;Array.isArray(c)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"setInternalValue",value:function(t){var i,n,o,r,s,a=this.childs;if(this.type=t.type,"array"===t.type){for(this.childs||(this.childs=[]),r=0;r<t.childs.length;r++)void 0===(i=t.childs[r])||i instanceof Function||(r<this.childs.length?((n=this.childs[r]).fieldEditable=!1,n.index=r,n.setInternalValue(i)):(n=new e(this.editor,{internalValue:i}),o=r<this.getMaxVisibleChilds(),this.appendChild(n,o,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else if("object"===t.type){for(this.childs||(this.childs=[]),r=0;r<t.childs.length;r++)void 0===(i=t.childs[r])||i instanceof Function||(r<this.childs.length?(delete(n=this.childs[r]).index,n.setField(i.field,!0),n.setInternalValue(i.value)):(n=new e(this.editor,{field:i.field,internalValue:i.value}),o=r<this.getMaxVisibleChilds(),this.appendChild(n,o,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t.value;Array.isArray(a)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"recreateDom",value:function(){var e;this.dom&&this.dom.tr&&this.dom.tr.parentNode?(e=this._detachFromDom(),this.clearDom(),this._attachToDom(e)):this.clearDom()}},{key:"getValue",value:function(){var e,t;return"array"===this.type?(e=[],this.childs.forEach((function(t){e.push(t.getValue())})),e):"object"===this.type?(t={},this.childs.forEach((function(e){t[e.getField()]=e.getValue()})),t):(void 0===this.value&&this._getDomValue(),this.value)}},{key:"getInternalValue",value:function(){return"array"===this.type?{type:this.type,childs:this.childs.map((function(e){return e.getInternalValue()}))}:"object"===this.type?{type:this.type,childs:this.childs.map((function(e){return{field:e.getField(),value:e.getInternalValue()}}))}:(void 0===this.value&&this._getDomValue(),{type:this.type,value:this.value})}},{key:"getLevel",value:function(){return this.parent?this.parent.getLevel()+1:0}},{key:"getNodePath",value:function(){var e=this.parent?this.parent.getNodePath():[];return e.push(this),e}},{key:"clone",value:function(){var t,i;return(t=new e(this.editor)).type=this.type,t.field=this.field,t.fieldInnerText=this.fieldInnerText,t.fieldEditable=this.fieldEditable,t.previousField=this.previousField,t.value=this.value,t.valueInnerText=this.valueInnerText,t.previousValue=this.previousValue,t.expanded=this.expanded,t.visibleChilds=this.visibleChilds,this.childs?(i=[],this.childs.forEach((function(e){(e=e.clone()).setParent(t),i.push(e)})),t.childs=i):t.childs=void 0,t}},{key:"expand",value:function(e){this.childs&&(this.expanded=!0,this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-expanded"),this.showChilds(),!1!==e&&this.childs.forEach((function(t){t.expand(e)})),this.updateDom({recurse:!1}))}},{key:"collapse",value:function(e){this.childs&&(this.hideChilds(),!1!==e&&this.childs.forEach((function(t){t.collapse(e)})),this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-collapsed"),this.expanded=!1,this.updateDom({recurse:!1}))}},{key:"showChilds",value:function(){if((e=this.childs)&&this.expanded){var e,t=(e=this.dom.tr)?e.parentNode:void 0;if(t){for(var i=this.getAppendDom(),n=(i.parentNode||((o=e.nextSibling)?t.insertBefore(i,o):t.appendChild(i)),Math.min(this.childs.length,this.visibleChilds)),o=this._getNextTr(),r=0;r<n;r++){var s=this.childs[r];s.getDom().parentNode||t.insertBefore(s.getDom(),o),s.showChilds()}e=this.getShowMoreDom(),o=this._getNextTr(),e.parentNode||t.insertBefore(e,o),this.showMore.updateDom()}}}},{key:"_getNextTr",value:function(){return this.showMore&&this.showMore.getDom().parentNode?this.showMore.getDom():this.append&&this.append.getDom().parentNode?this.append.getDom():void 0}},{key:"hide",value:function(e){var t=this.dom.tr,i=t?t.parentNode:void 0;i&&i.removeChild(t),this.dom.popupAnchor&&this.dom.popupAnchor.destroy(),this.hideChilds(e)}},{key:"hideChilds",value:function(e){var t;this.childs&&this.expanded&&((t=this.getAppendDom()).parentNode&&t.parentNode.removeChild(t),this.childs.forEach((function(e){e.hide()})),(t=this.getShowMoreDom()).parentNode&&t.parentNode.removeChild(t),e&&!e.resetVisibleChilds||(this.visibleChilds=this.getMaxVisibleChilds()))}},{key:"_updateCssClassName",value:function(){var e,t;this.dom.field&&this.editor&&this.editor.options&&"function"==typeof this.editor.options.onClassName&&this.dom.tree&&((0,g.removeAllClassNames)(this.dom.tree),e=this.getValue.bind(this),t=this.editor.options.onClassName({path:this.getPath(),field:this.field,get value(){return e()}})||"",(0,g.addClassName)(this.dom.tree,"jsoneditor-values "+t))}},{key:"recursivelyUpdateCssClassesOnNodes",value:function(){if(this._updateCssClassName(),Array.isArray(this.childs))for(var e=0;e<this.childs.length;e++)this.childs[e].recursivelyUpdateCssClassesOnNodes()}},{key:"expandTo",value:function(){for(var e=this.parent;e;)e.expanded||e.expand(),e=e.parent}},{key:"appendChild",value:function(e,t,i){var n,o;this._hasChilds()&&(e.setParent(this),e.fieldEditable="object"===this.type,"array"===this.type&&(e.index=this.childs.length),"object"===this.type&&void 0===e.field&&e.setField(""),this.childs.push(e),this.expanded&&!1!==t&&(t=e.getDom(),o=(n=this._getNextTr())?n.parentNode:void 0,n&&o&&o.insertBefore(t,n),e.showChilds(),this.visibleChilds++),!1!==i)&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}},{key:"moveBefore",value:function(e,t,i){var n,o,r;this._hasChilds()&&((n=this.dom.tr?this.dom.tr.parentNode:void 0)&&((o=document.createElement("tr")).style.height=n.clientHeight+"px",n.appendChild(o)),e.parent&&e.parent.removeChild(e),t instanceof R||!t?this.childs.length+1>this.visibleChilds?(r=this.childs[this.visibleChilds-1],this.insertBefore(e,r,i)):this.appendChild(e,!0,i):this.insertBefore(e,t,i),n)&&o&&n.removeChild(o)}},{key:"insertBefore",value:function(e,t,i){if(this._hasChilds()){if(this.visibleChilds++,"object"===this.type&&void 0===e.field&&e.setField(""),t===this.append)e.setParent(this),e.fieldEditable="object"===this.type,this.childs.push(e);else{var n=this.childs.indexOf(t);if(-1===n)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"===this.type,this.childs.splice(n,0,e)}var o;this.expanded&&(n=e.getDom(),o=(t=t.getDom())?t.parentNode:void 0,t&&o&&o.insertBefore(n,t),e.showChilds(),this.showChilds()),!1!==i&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}}},{key:"insertAfter",value:function(e,t){this._hasChilds()&&(t=this.childs.indexOf(t),(t=this.childs[t+1])?this.insertBefore(e,t):this.appendChild(e))}},{key:"search",value:function(e,t){Array.isArray(t)||(t=[]);var i=e?e.toLowerCase():void 0;return delete this.searchField,delete this.searchValue,void 0!==this.field&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.field).toLowerCase().indexOf(i)&&(this.searchField=!0,t.push({node:this,elem:"field"})),this._updateDomField()),this._hasChilds()?this.childs&&this.childs.forEach((function(i){i.search(e,t)})):void 0!==this.value&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.value).toLowerCase().indexOf(i)&&(this.searchValue=!0,t.push({node:this,elem:"value"})),this._updateDomValue()),t}},{key:"scrollTo",value:function(e){this.expandPathToNode(),this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)}},{key:"expandPathToNode",value:function(){for(var e=this;e&&e.parent;){for(var t="array"===e.parent.type?e.index:e.parent.childs.indexOf(e);e.parent.visibleChilds<t+1;)e.parent.visibleChilds+=this.getMaxVisibleChilds();e.parent.expand(!1),e=e.parent}}},{key:"focus",value:function(t){if(e.focusElement=t,this.dom.tr&&this.dom.tr.parentNode){var i=this.dom;switch(t){case"drag":(i.drag||i.menu).focus();break;case"menu":i.menu.focus();break;case"expand":this._hasChilds()?i.expand.focus():i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):i.menu.focus();break;case"field":i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):(this._hasChilds()?i.expand:i.menu).focus();break;default:i.select?i.select.focus():i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):(this._hasChilds()?i.expand:i.menu).focus()}}}},{key:"containsNode",value:function(e){if(this===e)return!0;var t=this.childs;if(t)for(var i=0,n=t.length;i<n;i++)if(t[i].containsNode(e))return!0;return!1}},{key:"removeChild",value:function(e,t){if(this.childs){var i=this.childs.indexOf(e);if(-1!==i)return i<this.visibleChilds&&this.expanded&&this.visibleChilds--,e.hide(),delete e.searchField,delete e.searchValue,(e=this.childs.splice(i,1)[0]).parent=null,!1!==t&&this.updateDom({updateIndexes:!0}),e}}},{key:"_remove",value:function(e){this.removeChild(e)}},{key:"changeType",value:function(e){var t,i=this.type;i!==e&&("string"!==e&&"auto"!==e||"string"!==i&&"auto"!==i?(t=this._detachFromDom(),this.clearDom(),"object"===(this.type=e)?(this.childs||(this.childs=[]),this.childs.forEach((function(e){e.clearDom(),delete e.index,e.fieldEditable=!0,void 0===e.field&&(e.field="")})),"string"!==i&&"auto"!==i||(this.expanded=!0)):"array"===e?(this.childs||(this.childs=[]),this.childs.forEach((function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t})),"string"!==i&&"auto"!==i||(this.expanded=!0)):this.expanded=!1,this._attachToDom(t)):this.type=e,"auto"!==e&&"string"!==e||(this.value="string"===e?String(this.value):(0,g.parseString)(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0}))}},{key:"deepEqual",value:function(e){var t;if("array"===this.type){if(!Array.isArray(e))return!1;if(this.childs.length!==e.length)return!1;for(t=0;t<this.childs.length;t++)if(!this.childs[t].deepEqual(e[t]))return!1}else if("object"===this.type){if("object"!==w(e)||!e)return!1;var i=Object.keys(e);if(this.childs.length!==i.length)return!1;for(t=0;t<i.length;t++){var n=this.childs[t];if(n.field!==i[t]||!n.deepEqual(e[n.field]))return!1}}else if(this.value!==e)return!1;return!0}},{key:"_getDomValue",value:function(){if(this._clearValueError(),this.dom.value&&"array"!==this.type&&"object"!==this.type&&(this.valueInnerText=(0,g.getInnerText)(this.dom.value),""===this.valueInnerText)&&""!==this.dom.value.innerHTML&&(this.dom.value.textContent=""),void 0!==this.valueInnerText)try{var e,t;(t="string"===this.type?this._unescapeHTML(this.valueInnerText):(e=this._unescapeHTML(this.valueInnerText),(0,g.parseString)(e)))!==this.value&&(this.value=t,this._debouncedOnChangeValue())}catch(e){this._setValueError((0,c.Iu)("cannotParseValueError"))}}},{key:"_setValueError",value:function(e){this.valueError={message:e},this.updateError()}},{key:"_clearValueError",value:function(){this.valueError&&(this.valueError=null,this.updateError())}},{key:"_setFieldError",value:function(e){this.fieldError={message:e},this.updateError()}},{key:"_clearFieldError",value:function(){this.fieldError&&(this.fieldError=null,this.updateError())}},{key:"_onChangeValue",value:function(){var e,t=this.editor.getDomSelection(),i=(t.range&&(i=(0,g.textDiff)(String(this.value),String(this.previousValue)),t.range.startOffset=i.start,t.range.endOffset=i.end),this.editor.getDomSelection());i.range&&(e=(0,g.textDiff)(String(this.previousValue),String(this.value)),i.range.startOffset=e.start,i.range.endOffset=e.end),this.editor._onAction("editValue",{path:this.getInternalPath(),oldValue:this.previousValue,newValue:this.value,oldSelection:t,newSelection:i}),this.previousValue=this.value}},{key:"_onChangeField",value:function(){var e=this.editor.getDomSelection(),t=this.previousField||"",i=(e.range&&(i=(0,g.textDiff)(this.field,t),e.range.startOffset=i.start,e.range.endOffset=i.end),this.editor.getDomSelection());i.range&&(t=(0,g.textDiff)(t,this.field),i.range.startOffset=t.start,i.range.endOffset=t.end),this.editor._onAction("editField",{parentPath:this.parent.getInternalPath(),index:this.getIndex(),oldValue:this.previousField,newValue:this.field,oldSelection:e,newSelection:i}),this.previousField=this.field}},{key:"_updateDomValue",value:function(){var e=this.dom.value;if(e){var t=["jsoneditor-value"],i=this.value,n="auto"===this.type?(0,g.getType)(i):this.type,o="string"===n&&(0,g.isUrl)(i);if(t.push("jsoneditor-"+n),o&&t.push("jsoneditor-url"),""===String(this.value)&&"array"!==this.type&&"object"!==this.type&&t.push("jsoneditor-empty"),this.searchValueActive&&t.push("jsoneditor-highlight-active"),this.searchValue&&t.push("jsoneditor-highlight"),e.className=t.join(" "),"array"===n||"object"===n?(t=this.childs?this.childs.length:0,e.title=this.type+" containing "+t+" items"):o&&this.editable.value?e.title=(0,c.Iu)("openUrl"):e.title="","boolean"===n&&this.editable.value?(this.dom.checkbox||(this.dom.checkbox=document.createElement("input"),this.dom.checkbox.type="checkbox",this.dom.tdCheckbox=document.createElement("td"),this.dom.tdCheckbox.className="jsoneditor-tree",this.dom.tdCheckbox.appendChild(this.dom.checkbox),this.dom.tdValue.parentNode.insertBefore(this.dom.tdCheckbox,this.dom.tdValue)),this.dom.checkbox.checked=this.value):this.dom.tdCheckbox&&(this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox),delete this.dom.tdCheckbox,delete this.dom.checkbox),this.enum&&this.editable.value?(this.dom.select||(this.dom.select=document.createElement("select"),this.id=this.field+"_"+(new Date).getUTCMilliseconds(),this.dom.select.id=this.id,this.dom.select.name=this.dom.select.id,(t=document.createElement("option")).value="",t.textContent="--",this.dom.select.appendChild(t),this._updateEnumOptions(),this.dom.tdSelect=document.createElement("td"),this.dom.tdSelect.className="jsoneditor-tree",this.dom.tdSelect.appendChild(this.dom.select),this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect,this.dom.tdValue)),this.dom.select.value=-1!==this.enum.indexOf(this.value)?this.value:"",!this.schema||E(this.schema,"oneOf")||E(this.schema,"anyOf")||E(this.schema,"allOf")?delete this.valueFieldHTML:(this.valueFieldHTML=this.dom.tdValue.innerHTML,this.dom.tdValue.style.visibility="hidden",this.dom.tdValue.textContent="")):this.dom.tdSelect&&(this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect),delete this.dom.tdSelect,delete this.dom.select,this.dom.tdValue.innerHTML=this.valueFieldHTML,this.dom.tdValue.style.visibility="",delete this.valueFieldHTML,this.dom.tdValue.appendChild(this.dom.value)),this.editor.options.colorPicker&&"string"==typeof i&&(0,g.isValidColor)(i)?(this.dom.color||(this.dom.color=document.createElement("div"),this.dom.color.className="jsoneditor-color",this.dom.tdColor=document.createElement("td"),this.dom.tdColor.className="jsoneditor-tree",this.dom.tdColor.appendChild(this.dom.color),this.dom.tdValue.parentNode.insertBefore(this.dom.tdColor,this.dom.tdValue)),(0,g.addClassName)(this.dom.value,"jsoneditor-color-value"),(this.editable.value?g.removeClassName:g.addClassName)(this.dom.color,"jsoneditor-color-readonly"),this.dom.color.style.backgroundColor=i):this._deleteDomColor(),this._showTimestampTag()){if(this.dom.date||(this.dom.date=document.createElement("div"),this.dom.date.className="jsoneditor-date",this.dom.value.parentNode.appendChild(this.dom.date)),o=null,o="function"==typeof this.editor.options.timestampFormat?this.editor.options.timestampFormat({field:this.field,value:this.value,path:this.getPath()}):o){for(;this.dom.date.firstChild;)this.dom.date.removeChild(this.dom.date.firstChild);this.dom.date.appendChild(document.createTextNode(o))}else this.dom.date.textContent=new Date(i).toISOString();this.dom.date.title=new Date(i).toString()}else this.dom.date&&(this.dom.date.parentNode.removeChild(this.dom.date),delete this.dom.date);(0,g.stripFormatting)(e),this._updateDomDefault()}}},{key:"_updateEnumOptions",value:function(){if(this.enum&&this.dom.select){this.dom.select.innerHTML="";for(var e=0;e<this.enum.length;e++){var t=document.createElement("option");t.value=this.enum[e],t.textContent=this.enum[e],this.dom.select.appendChild(t)}}}},{key:"_deleteDomColor",value:function(){this.dom.color&&(this.dom.tdColor.parentNode.removeChild(this.dom.tdColor),delete this.dom.tdColor,delete this.dom.color,(0,g.removeClassName)(this.dom.value,"jsoneditor-color-value"))}},{key:"_updateDomField",value:function(){var e,t=this.dom.field;t&&((e=(0,g.makeFieldTooltip)(this.schema,this.editor.options.language))&&(t.title=e),(""===String(this.field)&&this.parent&&"array"!==this.parent.type?g.addClassName:g.removeClassName)(t,"jsoneditor-empty"),(this.searchFieldActive?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight-active"),(this.searchField?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight"),(0,g.stripFormatting)(t))}},{key:"_getDomField",value:function(e){if(this._clearFieldError(),this.dom.field&&this.fieldEditable&&(this.fieldInnerText=(0,g.getInnerText)(this.dom.field),""===this.fieldInnerText)&&""!==this.dom.field.innerHTML&&(this.dom.field.textContent=""),void 0!==this.fieldInnerText)try{var t=this._unescapeHTML(this.fieldInnerText),i=this.parent.getFieldNames(this);-1!==i.indexOf(t)?e?(t=(0,g.findUniqueName)(t,i))!==this.field&&(this.field=t,this._debouncedOnChangeField()):this._setFieldError((0,c.Iu)("duplicateFieldError")):t!==this.field&&(this.field=t,this._debouncedOnChangeField())}catch(e){this._setFieldError((0,c.Iu)("cannotParseFieldError"))}}},{key:"_updateDomDefault",value:function(){var e;this.schema&&void 0!==this.schema.default&&!this._hasChilds()&&(e=this.dom.select||this.dom.value)&&(this.value===this.schema.default?(e.title=(0,c.Iu)("default"),(0,g.addClassName)(e,"jsoneditor-is-default"),g.removeClassName):(e.removeAttribute("title"),(0,g.removeClassName)(e,"jsoneditor-is-default"),g.addClassName))(e,"jsoneditor-is-not-default")}},{key:"_showTimestampTag",value:function(){var e,t;return"number"==typeof this.value&&("function"==typeof(e=this.editor.options.timestampTag)?"boolean"==typeof(t=e({field:this.field,value:this.value,path:this.getPath()}))?t:(0,g.isTimestamp)(this.field,this.value):!0===e&&(0,g.isTimestamp)(this.field,this.value))}},{key:"clearDom",value:function(){this.dom={}}},{key:"getDom",value:function(){var e,t,i=this.dom;return i.tr||(this._updateEditability(),i.tr=document.createElement("tr"),"tree"===(i.tr.node=this).editor.options.mode&&(t=document.createElement("td"),this.editable.field&&this.parent&&((e=document.createElement("button")).type="button",(i.drag=e).className="jsoneditor-button jsoneditor-dragarea",e.title=(0,c.Iu)("drag"),t.appendChild(e)),i.tr.appendChild(t),e=document.createElement("td"),(t=document.createElement("button")).type="button",(i.menu=t).className="jsoneditor-button jsoneditor-contextmenu-button",t.title=(0,c.Iu)("actionsMenu"),e.appendChild(i.menu),i.tr.appendChild(e)),t=document.createElement("td"),i.tr.appendChild(t),i.tree=this._createDomTree(),t.appendChild(i.tree),this.updateDom({updateIndexes:!0})),i.tr}},{key:"isVisible",value:function(){return this.dom&&this.dom.tr&&this.dom.tr.parentNode||!1}},{key:"isDescendantOf",value:function(e){for(var t=this.parent;t;){if(t===e)return!0;t=t.parent}return!1}},{key:"_createDomField",value:function(){return document.createElement("div")}},{key:"setHighlight",value:function(e){this.dom.tr&&((e?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-highlight"),this.append&&this.append.setHighlight(e),this.childs)&&this.childs.forEach((function(t){t.setHighlight(e)}))}},{key:"setSelected",value:function(e,t){this.selected=e,this.dom.tr&&((e?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-selected"),(t?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-first"),this.append&&this.append.setSelected(e),this.showMore&&this.showMore.setSelected(e),this.childs)&&this.childs.forEach((function(t){t.setSelected(e)}))}},{key:"updateValue",value:function(e){this.value=e,this.previousValue=e,this.valueError=void 0,this.updateDom()}},{key:"updateField",value:function(e){this.field=e,this.previousField=e,this.fieldError=void 0,this.updateDom()}},{key:"updateDom",value:function(t){var i,n;(n=this.dom.tree)&&(n.style.marginLeft=24*this.getLevel()+"px"),(n=this.dom.field)&&(this.fieldEditable?(n.contentEditable=this.editable.field,n.spellcheck=!1,n.className="jsoneditor-field"):(n.contentEditable=!1,n.className="jsoneditor-readonly"),i=void 0!==this.index?this.index:void 0!==this.field?this.field:(i=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):void 0)&&i.title?i.title:this._hasChilds()?this.type:"",i=this._escapeHTML(i),document.activeElement!==n&&i!==this._unescapeHTML((0,g.getInnerText)(n))&&(n.innerHTML=i),this._updateSchema(),this._updateEnumOptions()),(n=this.dom.value)&&("array"===this.type||"object"===this.type?this.updateNodeName():(i=this._escapeHTML(this.value),document.activeElement!==n&&i!==this._unescapeHTML((0,g.getInnerText)(n))&&(n.innerHTML=i))),(n=this.dom.tr)&&("array"===this.type||"object"===this.type?((0,g.addClassName)(n,"jsoneditor-expandable"),this.expanded?((0,g.addClassName)(n,"jsoneditor-expanded"),(0,g.removeClassName)(n,"jsoneditor-collapsed")):((0,g.addClassName)(n,"jsoneditor-collapsed"),(0,g.removeClassName)(n,"jsoneditor-expanded"))):((0,g.removeClassName)(n,"jsoneditor-expandable"),(0,g.removeClassName)(n,"jsoneditor-expanded"),(0,g.removeClassName)(n,"jsoneditor-collapsed"))),this._updateDomField(),this._updateDomValue(),t&&!0===t.updateIndexes&&this._updateDomIndexes(),t&&!0===t.recurse&&this.childs&&this.childs.forEach((function(e){e.updateDom(t)})),this.error&&this.updateError(),this.append&&this.append.updateDom(),this.showMore&&this.showMore.updateDom(),this._updateCssClassName()}},{key:"_updateSchema",value:function(){this.editor&&this.editor.options&&(this.schema=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):null,this.schema?this.enum=e._findEnum(this.schema):delete this.enum)}},{key:"_updateDomIndexes",value:function(){var e=this.dom.value,t=this.childs;e&&t&&("array"===this.type?t.forEach((function(e,t){e.index=t,(e=e.dom.field)&&(e.textContent=t)})):"object"===this.type&&t.forEach((function(e){void 0!==e.index&&(delete e.index,void 0===e.field)&&(e.field="")})))}},{key:"_createDomValue",value:function(){var e;return"array"===this.type?(e=document.createElement("div")).textContent="[...]":"object"===this.type?(e=document.createElement("div")).textContent="{...}":(!this.editable.value&&(0,g.isUrl)(this.value)?(e=document.createElement("a")).href=this.value:((e=document.createElement("div")).contentEditable=this.editable.value,e.spellcheck=!1),e.innerHTML=this._escapeHTML(this.value)),e}},{key:"_createDomExpandButton",value:function(){var e=document.createElement("button");return e.type="button",this._hasChilds()?(e.className=this.expanded?"jsoneditor-button jsoneditor-expanded":"jsoneditor-button jsoneditor-collapsed",e.title=(0,c.Iu)("expandTitle")):(e.className="jsoneditor-button jsoneditor-invisible",e.title=""),e}},{key:"_createDomTree",value:function(){var e=this.dom,t=document.createElement("table"),i=document.createElement("tbody"),n=(t.style.borderCollapse="collapse",t.className="jsoneditor-values",t.appendChild(i),document.createElement("tr"));return((((i.appendChild(n),i=document.createElement("td")).className="jsoneditor-tree",n.appendChild(i),e.expand=this._createDomExpandButton(),i.appendChild(e.expand),e.tdExpand=i,i=document.createElement("td")).className="jsoneditor-tree",n.appendChild(i),e.field=this._createDomField(),i.appendChild(e.field),e.tdField=i,i=document.createElement("td")).className="jsoneditor-tree",n.appendChild(i),"object"!==this.type&&"array"!==this.type&&(i.appendChild(document.createTextNode(":")),i.className="jsoneditor-separator"),e.tdSeparator=i,i=document.createElement("td")).className="jsoneditor-tree",n.appendChild(i),e.value=this._createDomValue(),i.appendChild(e.value),e.tdValue=i,t}},{key:"onEvent",value:function(e){var t,i=e.type,n=e.target||e.srcElement,o=this.dom,r=this,s=this._hasChilds(),a=(n!==o.drag&&n!==o.menu||("mouseover"===i?this.editor.highlighter.highlight(this):"mouseout"===i&&this.editor.highlighter.unhighlight()),"click"===i&&n===o.menu&&((t=r.editor.highlighter).highlight(r),t.lock(),(0,g.addClassName)(o.menu,"jsoneditor-selected"),this.showContextMenu(o.menu,(function(){(0,g.removeClassName)(o.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"click"===i&&n===o.expand&&s&&(d=e.ctrlKey,this._onExpand(d)),"click"!==i||e.target!==r.dom.tdColor&&e.target!==r.dom.color||!this.editable.value||this._showColorPicker(),"change"===i&&n===o.checkbox&&(this.dom.value.textContent=String(!this.value),this._getDomValue(),this._updateDomDefault()),"change"===i&&n===o.select&&(this.dom.value.innerHTML=this._escapeHTML(o.select.value),this._getDomValue(),this._updateDomValue()),o.value);if(n===a)switch(i){case"blur":case"change":this._getDomValue(),this._clearValueError(),this._updateDomValue();var l=this._escapeHTML(this.value);l!==this._unescapeHTML((0,g.getInnerText)(a))&&(a.innerHTML=l);break;case"input":case"keyup":this._getDomValue(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"click":e.ctrlKey&&this.editable.value&&(0,g.isUrl)(this.value)&&(e.preventDefault(),window.open(this.value,"_blank","noreferrer"));break;case"cut":case"paste":setTimeout((function(){r._getDomValue(),r._updateDomValue()}),1)}var c=o.field;if(n===c)switch(i){case"blur":this._getDomField(!0),this._updateDomField();var h=this._escapeHTML(this.field);h!==this._unescapeHTML((0,g.getInnerText)(c))&&(c.innerHTML=h);break;case"input":this._getDomField(),this._updateSchema(),this._updateDomField(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"keyup":this._getDomField(),this._updateDomField();break;case"cut":case"paste":setTimeout((function(){r._getDomField(),r._updateDomField()}),1)}var d=o.tree;d&&n===d.parentNode&&"click"===i&&!e.hasMoved&&((void 0!==e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageX<(0,g.getAbsoluteLeft)(o.tdSeparator))||s?c&&((0,g.setEndOfContentEditable)(c),c.focus()):a&&!this.enum&&((0,g.setEndOfContentEditable)(a),a.focus())),(n!==o.tdExpand||s)&&n!==o.tdField&&n!==o.tdSeparator||"click"!==i||e.hasMoved||c&&((0,g.setEndOfContentEditable)(c),c.focus()),"keydown"===i&&this.onKeyDown(e),"function"==typeof this.editor.options.onEvent&&this._onEvent(e)}},{key:"_onEvent",value:function(e){var t=(i=e.target)===this.dom.field,i=i===this.dom.value||i===this.dom.checkbox||i===this.dom.select;(t||i)&&(t={field:this.getField(),path:this.getPath()},i&&!this._hasChilds()&&(t.value=this.getValue()),this.editor.options.onEvent(t,e))}},{key:"onKeyDown",value:function(t){var i,n,o,r,s,a,l,c,h,d,u,p,m,f,y=t.which||t.keyCode,v=t.target||t.srcElement,C=t.ctrlKey,I=t.shiftKey,b=t.altKey,A=!1,w="tree"===this.editor.options.mode,_=0<this.editor.multiselection.nodes.length?this.editor.multiselection.nodes:[this],x=_[0],S=_[_.length-1];13===y?v===this.dom.value?this.editable.value&&!t.ctrlKey||(0,g.isUrl)(this.value)&&(window.open(this.value,"_blank","noreferrer"),A=!0):v===this.dom.expand&&this._hasChilds()&&(m=t.ctrlKey,this._onExpand(m),v.focus(),A=!0):68===y?C&&w&&(e.onDuplicate(_),A=!0):69===y?C&&(this._onExpand(I),v.focus(),A=!0):77===y&&w?C&&(this.showContextMenu(v),A=!0):46===y&&w?C&&(e.onRemove(_),A=!0):45===y&&w?C&&!I?(this._onInsertBefore(),A=!0):C&&I&&(this._onInsertAfter(),A=!0):35===y?b&&((m=this._lastNode())&&m.focus(e.focusElement||this._getElementName(v)),A=!0):36===y?b&&((m=this._firstNode())&&m.focus(e.focusElement||this._getElementName(v)),A=!0):37===y?b&&!I?((m=this._previousElement(v))&&this.focus(this._getElementName(m)),A=!0):b&&I&&w&&(m=S.expanded?(m=S.getAppendDom())?m.nextSibling:void 0:S.getDom().nextSibling)&&(u=e.getNodeFromTarget(m),m=m.nextSibling,p=e.getNodeFromTarget(m),u)&&u instanceof R&&1!==S.parent.childs.length&&p&&p.parent&&(n=this.editor.getDomSelection(),o=(r=x.parent).childs[S.getIndex()+1]||r.append,s=x.getIndex(),a=p.getIndex(),l=r.getInternalPath(),c=p.parent.getInternalPath(),_.forEach((function(e){p.parent.moveBefore(e,p)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:_.length,fieldNames:_.map(T),oldParentPath:r.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:o.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()})):38===y?b&&!I?((i=this._previousNode())&&(this.editor.deselect(!0),i.focus(e.focusElement||this._getElementName(v))),A=!0):!b&&C&&I&&w?((i=this._previousNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=i,h=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(h),i.focus("field")),A=!0):b&&I&&w&&((i=x._previousNode())&&i.parent&&(n=this.editor.getDomSelection(),o=(r=x.parent).childs[S.getIndex()+1]||r.append,s=x.getIndex(),a=i.getIndex(),l=r.getInternalPath(),c=i.parent.getInternalPath(),_.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:_.length,fieldNames:_.map(T),oldParentPath:r.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:o.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()})),A=!0):39===y?b&&!I?((m=this._nextElement(v))&&this.focus(this._getElementName(m)),A=!0):b&&I&&w&&(m=x.getDom().previousSibling)&&(i=e.getNodeFromTarget(m))&&i.parent&&!i.isVisible()&&(n=this.editor.getDomSelection(),o=(r=x.parent).childs[S.getIndex()+1]||r.append,s=x.getIndex(),a=i.getIndex(),l=r.getInternalPath(),c=i.parent.getInternalPath(),_.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:_.length,fieldNames:_.map(T),oldParentPath:r.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:o.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()})):40===y&&(b&&!I?((u=this._nextNode())&&(this.editor.deselect(!0),u.focus(e.focusElement||this._getElementName(v))),A=!0):!b&&C&&I&&w?((u=this._nextNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=u,h=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(h),u.focus("field")),A=!0):b&&I&&w&&((f=(u=(u=(u=S.expanded?S.append?S.append._nextNode():void 0:S._nextNode())&&!u.isVisible()?u.parent.showMore:u)&&u instanceof R?S:u)&&(u._nextNode()||u.parent.append))&&f.parent&&(n=this.editor.getDomSelection(),o=(r=x.parent).childs[S.getIndex()+1]||r.append,s=x.getIndex(),a=f.getIndex(),l=r.getInternalPath(),c=f.parent.getInternalPath(),_.forEach((function(e){f.parent.moveBefore(e,f)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:_.length,fieldNames:_.map(T),oldParentPath:r.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldParentPathRedo:l,newParentPathRedo:c,oldIndexRedo:s,newIndexRedo:a,oldIndex:o.getIndex(),newIndex:x.getIndex(),oldSelection:n,newSelection:this.editor.getDomSelection()})),A=!0)),A&&(t.preventDefault(),t.stopPropagation())}},{key:"_onExpand",value:function(e){var t,i,n;e&&(n=(i=(t=this.dom.tr.parentNode).parentNode).scrollTop,i.removeChild(t)),this.expanded?this.collapse(e):this.expand(e),e&&(i.appendChild(t),i.scrollTop=n),"function"==typeof this.editor.options.onExpand&&this.editor.options.onExpand({path:this.getPath(),isExpand:this.expanded,recursive:e})}},{key:"_showColorPicker",value:function(){var e,t;"function"==typeof this.editor.options.onColorPicker&&this.dom.color&&((e=this)._deleteDomColor(),e.updateDom(),t=(0,p.w)(this.dom.color,this.editor.getPopupAnchor()),this.editor.options.onColorPicker(t,this.value,(function(t){"string"==typeof t&&t!==e.value&&(e._deleteDomColor(),e.value=t,e.updateDom(),e._debouncedOnChangeValue())})))}},{key:"getFieldNames",value:function(e){return"object"===this.type?this.childs.filter((function(t){return t!==e})).map((function(e){return e.field})):[]}},{key:"_onInsertBefore",value:function(t,i,n){var o=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),i=this.getInternalPath(),this.parent.insertBefore(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),n=this.editor.getDomSelection(),this.editor._onAction("insertBeforeNodes",{nodes:[t],paths:[t.getInternalPath()],beforePath:i,parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:n})}},{key:"_onInsertAfter",value:function(t,i,n){var o=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),this.parent.insertAfter(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),i=this.editor.getDomSelection(),this.editor._onAction("insertAfterNodes",{nodes:[t],paths:[t.getInternalPath()],afterPath:this.getInternalPath(),parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:i})}},{key:"_onAppend",value:function(t,i,n){var o=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),this.parent.appendChild(t),this.editor.highlighter.unhighlight(),t.focus("field"),i=this.editor.getDomSelection(),this.editor._onAction("appendNodes",{nodes:[t],paths:[t.getInternalPath()],parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:i})}},{key:"_onChangeType",value:function(e){var t,i,n=this.type;e!==n&&(t=this.editor.getDomSelection(),this.changeType(e),i=this.editor.getDomSelection(),this.editor._onAction("changeType",{path:this.getInternalPath(),oldType:n,newType:e,oldSelection:t,newSelection:i}))}},{key:"sort",value:function(e,t){var i,n,o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];"string"==typeof e&&(e=(0,g.parsePath)(e)),this._hasChilds()&&(this.hideChilds(),i=this.childs,this.childs=this.childs.concat(),n="desc"===t?-1:1,"object"===this.type?this.childs.sort((function(e,t){return n*u()(e.field,t.field)})):this.childs.sort((function(t,i){return t=t.getNestedChild(e),i=i.getNestedChild(e),t?i?(t=t.value,i=i.value,"string"!=typeof t&&"string"!=typeof i?i<t?n:t<i?-n:0:n*u()(t,i)):-n:n})),this._updateDomIndexes(),this.showChilds(),!0===o)&&this.editor._onAction("sort",{path:this.getInternalPath(),oldChilds:i,newChilds:this.childs})}},{key:"update",value:function(e){var t=this.getInternalValue();this.setValue(e),this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:this.getInternalValue()})}},{key:"_detachFromDom",value:function(){var e=this.dom.tr?this.dom.tr.parentNode:void 0,t=(t=this.expanded?this.getAppendDom():this.getDom())&&t.parentNode?t.nextSibling:void 0;return this.hide({resetVisibleChilds:!1}),{table:e,nextTr:t}}},{key:"_attachToDom",value:function(e){e.table&&(e.nextTr?e.table.insertBefore(this.getDom(),e.nextTr):e.table.appendChild(this.getDom())),this.expanded&&this.showChilds()}},{key:"transform",value:function(e){if(this._hasChilds()){this.hideChilds();try{var t=this.getInternalValue(),i=this.getValue(),n=this.editor.options.executeQuery(i,e),o=(this.setValue(n),this.getInternalValue());this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:o}),this.showChilds()}catch(e){this.showChilds(),this.editor._onError(e)}}}},{key:"extract",value:function(){this.editor.node.hideChilds(),this.hideChilds();try{var e=this.editor.node.getInternalValue(),t=(this.editor._setRoot(this),this.editor.node.getInternalValue());this.editor._onAction("transform",{path:this.editor.node.getInternalPath(),oldValue:e,newValue:t})}catch(e){this.editor._onError(e)}finally{this.updateDom({recurse:!0}),this.showChilds()}}},{key:"getNestedChild",value:function(e){for(var t=0,i=this;i&&t<e.length;)i=i.findChildByProperty(e[t]),t++;return i}},{key:"findChildByProperty",value:function(e){if("object"===this.type)return this.childs.find((function(t){return t.field===e}))}},{key:"getAppendDom",value:function(){return this.append||(this.append=new R(this.editor),this.append.setParent(this)),this.append.getDom()}},{key:"getShowMoreDom",value:function(){return this.showMore||(this.showMore=new $(this.editor,this)),this.showMore.getDom()}},{key:"nextSibling",value:function(){var e=this.parent.childs.indexOf(this);return this.parent.childs[e+1]||this.parent.append}},{key:"_previousNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode)for(var n=i;n=n.previousSibling,t=e.getNodeFromTarget(n),n&&t&&t instanceof R&&!t.isVisible(););return t}},{key:"_nextNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode)for(var n=i;n=n.nextSibling,t=e.getNodeFromTarget(n),n&&t&&t instanceof R&&!t.isVisible(););return t}},{key:"_firstNode",value:function(){var t=null,i=this.getDom();return i&&i.parentNode&&(i=i.parentNode.firstChild,t=e.getNodeFromTarget(i)),t}},{key:"_lastNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode){var n=i.parentNode.lastChild;for(t=e.getNodeFromTarget(n);n&&t&&!t.isVisible();)n=n.previousSibling,t=e.getNodeFromTarget(n)}return t}},{key:"_previousElement",value:function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}}},{key:"_nextElement",value:function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}}},{key:"_getElementName",value:function(e){var t=this;return Object.keys(this.dom).find((function(i){return t.dom[i]===e}))}},{key:"_hasChilds",value:function(){return"array"===this.type||"object"===this.type}},{key:"addTemplates",value:function(e,t){var i=this,n=i.editor.options.templates;null!=n&&(n.length&&e.push({type:"separator"}),n.forEach((function(n){e.push({text:n.text,className:n.className||"jsoneditor-type-object",title:n.title,click:(t?function(e,t){i._onAppend(e,t)}:function(e,t){i._onInsertBefore(e,t)}).bind(this,n.field,n.value)})})))}},{key:"showContextMenu",value:function(t,i){var n,r=this,s=[];this.editable.value&&s.push({text:(0,c.Iu)("type"),title:(0,c.Iu)("typeTitle"),className:"jsoneditor-type-"+this.type,submenu:[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto"+("auto"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("autoType"),click:function(){r._onChangeType("auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array"+("array"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("arrayType"),click:function(){r._onChangeType("array")}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object"+("object"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("objectType"),click:function(){r._onChangeType("object")}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string"+("string"===this.type?" jsoneditor-selected":""),title:(0,c.Iu)("stringType"),click:function(){r._onChangeType("string")}}]}),this._hasChilds()&&(this.editor.options.enableSort&&s.push({text:(0,c.Iu)("sort"),title:(0,c.Iu)("sortTitle",{type:this.type}),className:"jsoneditor-sort-asc",click:function(){r.showSortModal()}}),this.editor.options.enableTransform&&s.push({text:(0,c.Iu)("transform"),title:(0,c.Iu)("transformTitle",{type:this.type}),className:"jsoneditor-transform",click:function(){r.showTransformModal()}}),this.parent)&&s.push({text:(0,c.Iu)("extract"),title:(0,c.Iu)("extractTitle",{type:this.type}),className:"jsoneditor-extract",click:function(){r.extract()}}),this.parent&&this.parent._hasChilds()&&(s.length&&s.push({type:"separator"}),n=r.parent.childs,r===n[n.length-1]&&(n=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){r._onAppend("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){r._onAppend("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){r._onAppend("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){r._onAppend("","","string")}}],r.addTemplates(n,!0),s.push({text:(0,c.Iu)("appendText"),title:(0,c.Iu)("appendTitle"),submenuTitle:(0,c.Iu)("appendSubmenuTitle"),className:"jsoneditor-append",click:function(){r._onAppend("","","auto")},submenu:n})),n=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){r._onInsertBefore("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){r._onInsertBefore("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){r._onInsertBefore("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){r._onInsertBefore("","","string")}}],r.addTemplates(n,!1),s.push({text:(0,c.Iu)("insert"),title:(0,c.Iu)("insertTitle"),submenuTitle:(0,c.Iu)("insertSub"),className:"jsoneditor-insert",click:function(){r._onInsertBefore("","","auto")},submenu:n}),this.editable.field)&&(s.push({text:(0,c.Iu)("duplicateText"),title:(0,c.Iu)("duplicateField"),className:"jsoneditor-duplicate",click:function(){e.onDuplicate(r)}}),s.push({text:(0,c.Iu)("removeText"),title:(0,c.Iu)("removeField"),className:"jsoneditor-remove",click:function(){e.onRemove(r)}})),this.editor.options.onCreateMenu&&(n=r.getPath(),s=this.editor.options.onCreateMenu(s,{type:"single",path:n,paths:[n]})),new o.x(s,{close:i}).show(t,this.editor.getPopupAnchor())}},{key:"showSortModal",value:function(){var e=this,t=this.editor.options.modalAnchor||y.qD,i=this.getValue();(0,m.showSortModal)(t,i,(function(t){var i=t.path;i=(0,g.parsePath)(i),e.sortedBy=t,e.sort(i,t.direction)}),e.sortedBy)}},{key:"showTransformModal",value:function(){var e=this,t=(o=this.editor.options).modalAnchor,i=o.createQuery,n=o.executeQuery,o=o.queryDescription,r=this.getValue();(0,f.showTransformModal)({container:t||y.qD,json:r,queryDescription:o,createQuery:i,executeQuery:n,onTransform:function(t){e.transform(t)}})}},{key:"_getType",value:function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof(0,g.parseString)(e)?"string":"auto"}},{key:"_escapeHTML",value:function(e){return"string"!=typeof e?String(e):(e=String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ {2}/g," &nbsp;").replace(/^ /,"&nbsp;").replace(/ $/,"&nbsp;"),e=(e=JSON.stringify(e)).substring(1,e.length-1),!0===this.editor.options.escapeUnicode?(0,g.escapeUnicodeChars)(e):e)}},{key:"_unescapeHTML",value:function(e){return e='"'+this._escapeJSON(e)+'"',(0,g.parse)(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;|\u00A0/g," ").replace(/&amp;/g,"&")}},{key:"_escapeJSON",value:function(e){for(var t="",i=0;i<e.length;){var n=e.charAt(i);"\n"===n?t+="\\n":"\\"===n?(t+=n,i++,""!==(n=e.charAt(i))&&-1!=='"\\/bfnrtu'.indexOf(n)||(t+="\\"),t+=n):t+='"'===n?'\\"':n,i++}return t}},{key:"updateNodeName",value:function(){var e=this.childs?this.childs.length:0;if("object"===this.type||"array"===this.type){if(this.editor.options.onNodeName)try{var t=this.getValue.bind(this),i=this.editor.options.onNodeName({path:this.getPath(),size:e,type:this.type,get value(){return t()}})}catch(e){console.error("Error in onNodeName callback: ",e)}this.dom.value.textContent="object"===this.type?"{"+(i||e)+"}":"["+(i||e)+"]"}}},{key:"recursivelyUpdateNodeName",value:function(){if(this.expanded&&(this.updateNodeName(),"undefined"!==this.childs))for(var e in this.childs)this.childs[e].recursivelyUpdateNodeName()}}])&&_(t.prototype,i),n&&_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),S=(x.prototype.DEBOUNCE_INTERVAL=150,x.prototype.MAX_SEARCH_RESULTS=999,100);function k(e){return e.getInternalPath()}function T(e){return e.getField()}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}x.focusElement=void 0,x.select=function(e){setTimeout((function(){(0,g.selectContentEditable)(e)}),0)},x.onDragStart=function(e,t){if(!Array.isArray(e))return x.onDragStart([e],t);var i,n,o,r,s;0!==e.length&&(i=e[0],n=e[e.length-1],o=i.parent,s=x.getNodeFromTarget(t.target),r=i.editor,s=(0,g.getAbsoluteTop)(s.dom.tr)-(0,g.getAbsoluteTop)(i.dom.tr),r.mousemove||(r.mousemove=(0,g.addEventListener)(t.view,"mousemove",(function(t){x.onDrag(e,t)}))),r.mouseup||(r.mouseup=(0,g.addEventListener)(t.view,"mouseup",(function(t){x.onDragEnd(e,t)}))),r.highlighter.lock(),r.drag={oldCursor:document.body.style.cursor,oldSelection:r.getDomSelection(),oldPaths:e.map(k),oldParent:o,oldNextNode:o.childs[n.getIndex()+1]||o.append,oldParentPathRedo:o.getInternalPath(),oldIndexRedo:i.getIndex(),mouseX:t.pageX,offsetY:s,level:i.getLevel()},document.body.style.cursor="move",t.preventDefault())},x.onDrag=function(e,t){if(!Array.isArray(e))return x.onDrag([e],t);if(0!==e.length){var i,n,o,r,s,a=e[0].editor,l=t.pageY-a.drag.offsetY,c=t.pageX,h=!1,d=e[0],u=d.dom.tr,p=(0,g.getAbsoluteTop)(u),m=u.offsetHeight;if(l<p){for(C=u;C=C.previousSibling,I=x.getNodeFromTarget(C),o=C?(0,g.getAbsoluteTop)(C):0,C&&l<o;);(I=I&&!I.parent?void 0:I)||(C=(u=u.parentNode.firstChild)?u.nextSibling:void 0,(I=x.getNodeFromTarget(C))===d&&(I=void 0)),!(I=I&&I.isVisible()&&(o=(C=I.dom.tr)?(0,g.getAbsoluteTop)(C):0)+m<l?void 0:I)||!1!==a.options.limitDragging&&I.parent!==e[0].parent||(e.forEach((function(e){I.parent.moveBefore(e,I)})),h=!0)}else{var f=e[e.length-1];if(m=(u=f.expanded&&f.append?f.append.getDom():f.dom.tr)?u.nextSibling:void 0){for(r=(0,g.getAbsoluteTop)(m),i=m;n=x.getNodeFromTarget(i),i&&(s=i.nextSibling?(0,g.getAbsoluteTop)(i.nextSibling):0,s=i?s-r:0,n&&n.parent.childs.length===e.length&&n.parent.childs[e.length-1]===f&&(p+=27),i=i.nextSibling),i&&p+s<l;);if(n&&n.parent){m=c-a.drag.mouseX,m=Math.round(m/24/2);for(var y=a.drag.level+m,v=n.getLevel(),C=n.dom.tr&&n.dom.tr.previousSibling;v<y&&C;){var I=x.getNodeFromTarget(C),b=e.some((function(e){return e===I||I.isDescendantOf(e)}));if(!b){if(!(I instanceof R))break;if((b=I.parent.childs).length===e.length&&b[e.length-1]===f)break;v=(n=x.getNodeFromTarget(C)).getLevel()}C=C.previousSibling}(n=n instanceof R&&!n.isVisible()&&n.parent.showMore.isVisible()?n._nextNode():n)&&(!1===a.options.limitDragging||n.parent===e[0].parent)&&n.dom.tr&&n.dom.tr!==u.nextSibling&&(e.forEach((function(e){n.parent.moveBefore(e,n)})),h=!0)}}}h&&(a.drag.mouseX=c,a.drag.level=d.getLevel()),a.startAutoScroll(l),t.preventDefault()}},x.onDragEnd=function(e,t){if(!Array.isArray(e))return x.onDrag([e],t);var i,n,o,r,s,a,l,c,h;0!==e.length&&(a=e[0],i=a.editor,a&&a.dom.menu&&a.dom.menu.focus(),n=i.drag.oldParent.getInternalPath(),o=a.parent.getInternalPath(),r=i.drag.oldParent===a.parent,s=i.drag.oldNextNode.getIndex(),a=a.getIndex(),l=i.drag.oldParentPathRedo,c=i.drag.oldIndexRedo,h=r&&c<a?a+e.length:a,r&&c===a||i._onAction("moveNodes",{count:e.length,fieldNames:e.map(T),oldParentPath:n,newParentPath:o,oldIndex:s,newIndex:a,oldIndexRedo:c,newIndexRedo:h,oldParentPathRedo:l,newParentPathRedo:null,oldSelection:i.drag.oldSelection,newSelection:i.getDomSelection()}),document.body.style.cursor=i.drag.oldCursor,i.highlighter.unlock(),e.forEach((function(e){e.updateDom(),t.target!==e.dom.drag&&t.target!==e.dom.menu&&i.highlighter.unhighlight()})),delete i.drag,i.mousemove&&((0,g.removeEventListener)(t.view,"mousemove",i.mousemove),delete i.mousemove),i.mouseup&&((0,g.removeEventListener)(t.view,"mouseup",i.mouseup),delete i.mouseup),i.stopAutoScroll(),t.preventDefault())},x._findEnum=function(e){return e.enum?e.enum:(e=e.oneOf||e.anyOf||e.allOf)&&0<(e=e.filter((function(e){return e.enum}))).length?e[0].enum:null},x._findSchema=function(e,t,i){for(var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:e,o=i.slice(1,i.length),r=i[0],s=[n],a=0,l=[n.oneOf,n.anyOf,n.allOf];a<l.length;a++){var c=l[a];Array.isArray(c)&&(s=s.concat(c))}var h,d=I(s);try{for(d.s();!(h=d.n()).done;){if("$ref"in(n=h.value)&&"string"==typeof n.$ref){var u,p=n.$ref;if(p in t)n=t[p];else{if(!p.startsWith("#/")){if(1===(null==(u=p.match(/#\//g))?void 0:u.length)){var g,m,f,y=C(p.split("#/"),2),b=y[0],A=y[1];if(b in t)return g=t[b],m={$ref:"#/".concat(A)},(f=[]).push(r),0<o.length&&f.push.apply(f,v(o)),x._findSchema(g,t,f,m)}throw Error("Unable to resolve reference ".concat(p))}var _,S=p.substring(2).split("/"),k=(n=e,I(S));try{for(k.s();!(_=k.n()).done;){var T=_.value;if(!(T in n))throw Error("Unable to resolve reference ".concat(p));n=n[T]}}catch(e){k.e(e)}finally{k.f()}}}if(void 0===r)return n;if("string"==typeof r){if("object"===w(n.properties)&&null!==n.properties&&r in n.properties)return n=n.properties[r],x._findSchema(e,t,o,n);if("object"===w(n.patternProperties)&&null!==n.patternProperties)for(var E in n.patternProperties)if(r.match(E))return n=n.patternProperties[E],x._findSchema(e,t,o,n);if("object"===w(n.additionalProperties))return n=n.additionalProperties,x._findSchema(e,t,o,n)}else if("number"==typeof r&&"object"===w(n.items)&&null!==n.items)return n=n.items,x._findSchema(e,t,o,n)}}catch(e){d.e(e)}finally{d.f()}return null},x.onRemove=function(e){if(!Array.isArray(e))return x.onRemove([e]);var t,i,n,o,r,s;e&&0<e.length&&(t=(n=e[0]).parent,i=n.editor,n=n.getIndex(),i.highlighter.unhighlight(),o=i.getDomSelection(),x.blurNodes(e),r=i.getDomSelection(),s=e.map(k),e.forEach((function(e){e.parent._remove(e)})),i._onAction("removeNodes",{nodes:e,paths:s,parentPath:t.getInternalPath(),index:n,oldSelection:o,newSelection:r}))},x.onDuplicate=function(e){if(!Array.isArray(e))return x.onDuplicate([e]);var t,i,n,o,r,s,a;e&&0<e.length&&(t=e[e.length-1],i=t.parent,(n=t.editor).deselect(n.multiselection.nodes),o=n.getDomSelection(),r=t,s=e.map((function(e){var t,n=e.clone();return"object"===e.parent.type&&(t=e.parent.getFieldNames(),n.field=(0,g.findUniqueName)(e.field,t)),i.insertAfter(n,r),r=n})),1===e.length?"object"===s[0].parent.type?(s[0].dom.field.innerHTML=e[0]._escapeHTML(e[0].field),s[0].focus("field")):s[0].focus():n.select(s),a=n.getDomSelection(),n._onAction("duplicateNodes",{paths:e.map(k),clonePaths:s.map(k),afterPath:t.getInternalPath(),parentPath:i.getInternalPath(),oldSelection:o,newSelection:a}))},x.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}},x.targetIsColorPicker=function(e){var t=x.getNodeFromTarget(e);if(t)for(var i=e&&e.parentNode;i;){if(i===t.dom.color)return!0;i=i.parentNode}return!1},x.blurNodes=function(e){var t,i;Array.isArray(e)?(t=(i=e[0]).parent,i=i.getIndex(),(t.childs[i+e.length]?t.childs[i+e.length]:t.childs[i-1]||t).focus()):x.blurNodes([e])},(L.prototype=new x).getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr"),i=(t.className="jsoneditor-append",t.node=this,e.tr=t,"tree"===this.editor.options.mode&&(e.tdDrag=document.createElement("td"),n=document.createElement("td"),e.tdMenu=n,(i=document.createElement("button")).type="button",i.className="jsoneditor-button jsoneditor-contextmenu-button",i.title="Click to open the actions menu (Ctrl+M)",e.menu=i,n.appendChild(e.menu)),document.createElement("td")),n=document.createElement("div");return n.appendChild(document.createTextNode("("+(0,c.Iu)("empty")+")")),n.className="jsoneditor-readonly",i.appendChild(n),e.td=i,e.text=n,this.updateDom(),t},L.prototype.getPath=function(){return null},L.prototype.getIndex=function(){return null},L.prototype.updateDom=function(e){var t=this.dom,i=t.td,n=(i&&(i.style.paddingLeft=24*this.getLevel()+26+"px"),(n=t.text)&&(n.firstChild.nodeValue="("+(0,c.Iu)("empty")+" "+this.parent.type+")"),t.tr);this.isVisible()?t.tr.firstChild||(t.tdDrag&&n.appendChild(t.tdDrag),t.tdMenu&&n.appendChild(t.tdMenu),n.appendChild(i)):t.tr.firstChild&&(t.tdDrag&&n.removeChild(t.tdDrag),t.tdMenu&&n.removeChild(t.tdMenu),n.removeChild(i))},L.prototype.isVisible=function(){return 0===this.parent.childs.length},L.prototype.showContextMenu=function(e,t){var i,n=this,r=[{text:(0,c.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,c.Iu)("autoType"),click:function(){n._onAppend("","","auto")}},{text:(0,c.Iu)("array"),className:"jsoneditor-type-array",title:(0,c.Iu)("arrayType"),click:function(){n._onAppend("",[])}},{text:(0,c.Iu)("object"),className:"jsoneditor-type-object",title:(0,c.Iu)("objectType"),click:function(){n._onAppend("",{})}},{text:(0,c.Iu)("string"),className:"jsoneditor-type-string",title:(0,c.Iu)("stringType"),click:function(){n._onAppend("","","string")}}];n.addTemplates(r,!0),r=[{text:(0,c.Iu)("appendText"),title:(0,c.Iu)("appendTitleAuto"),submenuTitle:(0,c.Iu)("appendSubmenuTitle"),className:"jsoneditor-insert",click:function(){n._onAppend("","","auto")},submenu:r}],this.editor.options.onCreateMenu&&(i=n.parent.getPath(),r=this.editor.options.onCreateMenu(r,{type:"append",path:i,paths:[i]})),new o.x(r,{close:t}).show(e,this.editor.getPopupAnchor())},L.prototype.onEvent=function(e){var t,i=e.type,n=e.target||e.srcElement,o=this.dom;n===o.menu&&("mouseover"===i?this.editor.highlighter.highlight(this.parent):"mouseout"===i&&this.editor.highlighter.unhighlight()),"click"===i&&n===o.menu&&((t=this.editor.highlighter).highlight(this.parent),t.lock(),(0,g.addClassName)(o.menu,"jsoneditor-selected"),this.showContextMenu(o.menu,(function(){(0,g.removeClassName)(o.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"keydown"===i&&this.onKeyDown(e)};var R=L;function L(e){this.editor=e,this.dom={}}(P.prototype=new x).getDom=function(){var e,t,i,n,o,r;return this.dom.tr||(this._updateEditability(),this.dom.tr||(t=(e=this).parent,(o=document.createElement("a")).appendChild(document.createTextNode((0,c.Iu)("showMore"))),o.href="#",o.onclick=function(i){return t.visibleChilds=Math.floor(t.visibleChilds/t.getMaxVisibleChilds()+1)*t.getMaxVisibleChilds(),e.updateDom(),t.showChilds(),i.preventDefault(),!1},(r=document.createElement("a")).appendChild(document.createTextNode((0,c.Iu)("showAll"))),r.href="#",r.onclick=function(i){return t.visibleChilds=1/0,e.updateDom(),t.showChilds(),i.preventDefault(),!1},i=document.createElement("div"),n=document.createTextNode(this._getShowMoreText()),i.className="jsoneditor-show-more",i.appendChild(n),i.appendChild(o),i.appendChild(document.createTextNode(". ")),i.appendChild(r),i.appendChild(document.createTextNode(". ")),(o=document.createElement("td")).appendChild(i),r=document.createElement("tr"),"tree"===this.editor.options.mode&&(r.appendChild(document.createElement("td")),r.appendChild(document.createElement("td"))),r.appendChild(o),r.className="jsoneditor-show-more",this.dom.tr=r,this.dom.moreContents=i,this.dom.moreText=n),this.updateDom()),this.dom.tr},P.prototype.updateDom=function(e){var t;this.isVisible()?(this.dom.tr.node=this.parent.childs[this.parent.visibleChilds],this.dom.tr.parentNode||(t=this.parent._getNextTr())&&t.parentNode.insertBefore(this.dom.tr,t),this.dom.moreText.nodeValue=this._getShowMoreText(),this.dom.moreContents.style.marginLeft=24*(this.getLevel()+1)+"px"):this.dom.tr&&this.dom.tr.parentNode&&this.dom.tr.parentNode.removeChild(this.dom.tr)},P.prototype._getShowMoreText=function(){return(0,c.Iu)("showMoreStatus",{visibleChilds:this.parent.visibleChilds,totalChilds:this.parent.childs.length})+" "},P.prototype.isVisible=function(){return this.parent.expanded&&this.parent.childs.length>this.parent.visibleChilds},P.prototype.onEvent=function(e){"keydown"===e.type&&this.onKeyDown(e)};var $=P;function P(e,t){this.editor=e,this.parent=t,this.dom={}}function M(e){return(M="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})(e)}function B(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==M(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==M(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===M(e)?e:String(e)}(n.key),n)}}var N=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");function i(e){return t.node.findNodeByInternalPath(e)}this.editor=t,this.history=[],this.index=-1,this.clear(),this.actions={editField:{undo:function(e){i(e.parentPath).childs[e.index].updateField(e.oldValue)},redo:function(e){i(e.parentPath).childs[e.index].updateField(e.newValue)}},editValue:{undo:function(e){i(e.path).updateValue(e.oldValue)},redo:function(e){i(e.path).updateValue(e.newValue)}},changeType:{undo:function(e){i(e.path).changeType(e.oldType)},redo:function(e){i(e.path).changeType(e.newType)}},appendNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath);e.nodes.forEach((function(e){t.appendChild(e)}))}},insertBeforeNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.beforePath);e.nodes.forEach((function(e){t.insertBefore(e,n)}))}},insertAfterNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.afterPath);e.nodes.forEach((function(e){t.insertAfter(e,n),n=e}))}},removeNodes:{undo:function(e){var t=i(e.parentPath),n=t.childs[e.index]||t.append;e.nodes.forEach((function(e){t.insertBefore(e,n)}))},redo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))}},duplicateNodes:{undo:function(e){var t=i(e.parentPath);e.clonePaths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.afterPath);e.paths.map(i).forEach((function(e){var i,o=e.clone();"object"===t.type&&(i=t.getFieldNames(),o.field=(0,g.findUniqueName)(e.field,i)),t.insertAfter(o,n),n=o}))}},moveNodes:{undo:function(e){var t=i(e.oldParentPath),n=i(e.newParentPath),o=t.childs[e.oldIndex]||t.append;n.childs.slice(e.newIndex,e.newIndex+e.count).forEach((function(i,n){i.field=e.fieldNames[n],t.moveBefore(i,o)})),null===e.newParentPathRedo&&(e.newParentPathRedo=n.getInternalPath())},redo:function(e){var t=i(e.oldParentPathRedo),n=i(e.newParentPathRedo),o=n.childs[e.newIndexRedo]||n.append;t.childs.slice(e.oldIndexRedo,e.oldIndexRedo+e.count).forEach((function(t,i){t.field=e.fieldNames[i],n.moveBefore(t,o)}))}},sort:{undo:function(e){var t=i(e.path);t.hideChilds(),t.childs=e.oldChilds,t.updateDom({updateIndexes:!0}),t.showChilds()},redo:function(e){var t=i(e.path);t.hideChilds(),t.childs=e.newChilds,t.updateDom({updateIndexes:!0}),t.showChilds()}},transform:{undo:function(e){i(e.path).setInternalValue(e.oldValue)},redo:function(e){i(e.path).setInternalValue(e.newValue)}}}}var t,i,n;return t=e,(i=[{key:"onChange",value:function(){}},{key:"add",value:function(e,t){this.index++,this.history[this.index]={action:e,params:t,timestamp:new Date},this.index<this.history.length-1&&this.history.splice(this.index+1,this.history.length-this.index-1),this.onChange()}},{key:"clear",value:function(){this.history=[],this.index=-1,this.onChange()}},{key:"canUndo",value:function(){return 0<=this.index}},{key:"canRedo",value:function(){return this.index<this.history.length-1}},{key:"undo",value:function(){if(this.canUndo()){var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.undo){if(t.undo(e.params),e.params.oldSelection)try{this.editor.setDomSelection(e.params.oldSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.index--,this.onChange()}}},{key:"redo",value:function(){if(this.canRedo()){this.index++;var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.redo){if(t.redo(e.params),e.params.newSelection)try{this.editor.setDomSelection(e.params.newSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.onChange()}}},{key:"destroy",value:function(){this.editor=null,this.history=[],this.index=-1}}])&&B(t.prototype,i),n&&B(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function W(e){return(W="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})(e)}function Z(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==W(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==W(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===W(e)?e:String(e)}(n.key),n)}}var H=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var n=this,o=(this.editor=t,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.results=null,this.dom={},this.dom.container=i,t=document.createElement("div"),(this.dom.wrapper=t).className="jsoneditor-search",i.appendChild(t),i=document.createElement("div"),(this.dom.results=i).className="jsoneditor-results",t.appendChild(i),i=document.createElement("div"),((this.dom.input=i).className="jsoneditor-frame",i.title=(0,c.Iu)("searchTitle"),t.appendChild(i),t=document.createElement("button")).type="button",t.className="jsoneditor-refresh",i.appendChild(t),document.createElement("input"));((o.type="text",(this.dom.search=o).oninput=function(e){n._onDelayedSearch(e)},o.onchange=function(e){n._onSearch()},o.onkeydown=function(e){n._onKeyDown(e)},o.onkeyup=function(e){n._onKeyUp(e)},t.onclick=function(e){o.select()},i.appendChild(o),t=document.createElement("button")).type="button",t.title=(0,c.Iu)("searchNextResultTitle"),t.className="jsoneditor-next",t.onclick=function(){n.next()},i.appendChild(t),t=document.createElement("button")).type="button",t.title=(0,c.Iu)("searchPreviousResultTitle"),t.className="jsoneditor-previous",t.onclick=function(){n.previous()},i.appendChild(t)}var t,i,n;return t=e,(i=[{key:"next",value:function(e){var t;this.results&&((t=null!==this.resultIndex?this.resultIndex+1:0)>this.results.length-1&&(t=0),this._setActiveResult(t,e))}},{key:"previous",value:function(e){var t,i;this.results&&(t=this.results.length-1,i=null!==this.resultIndex?this.resultIndex-1:t,this._setActiveResult(i=i<0?t:i,e))}},{key:"_setActiveResult",value:function(e,t){var i,n,o;this.activeResult&&(i=this.activeResult.node,"field"===this.activeResult.elem?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()),this.results&&this.results[e]?(this.resultIndex=e,n=this.results[this.resultIndex].node,"field"===(o=this.results[this.resultIndex].elem)?n.searchFieldActive=!0:n.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],n.updateDom(),n.scrollTo((function(){t&&n.focus(o)}))):(this.resultIndex=void 0,this.activeResult=void 0)}},{key:"_clearDelay",value:function(){void 0!==this.timeout&&(clearTimeout(this.timeout),delete this.timeout)}},{key:"_onDelayedSearch",value:function(e){this._clearDelay();var t=this;this.timeout=setTimeout((function(e){t._onSearch()}),this.delay)}},{key:"_onSearch",value:function(e){var t;if(this._clearDelay(),(t=0<(t=this.dom.search.value).length?t:void 0)!==this.lastText||e){this.lastText=t,this.results=this.editor.search(t),e=this.results[0]?this.results[0].node.MAX_SEARCH_RESULTS:1/0;var i=0;if(this.activeResult)for(var n=0;n<this.results.length;n++)if(this.results[n].node===this.activeResult.node){i=n;break}this._setActiveResult(i,!1),void 0!==t?(t=this.results.length,this.dom.results.textContent=0===t?"no results":1===t?"1 result":e<t?e+"+ results":t+" results"):this.dom.results.textContent=""}}},{key:"_onKeyDown",value:function(e){var t=e.which;27===t?(this.dom.search.value="",this._onSearch(),e.preventDefault(),e.stopPropagation()):13===t&&(e.ctrlKey?this._onSearch(!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())}},{key:"_onKeyUp",value:function(e){var t=e.keyCode;27!==t&&13!==t&&this._onDelayedSearch(e)}},{key:"clear",value:function(){this.dom.search.value="",this._onSearch()}},{key:"forceSearch",value:function(){this._onSearch(!0)}},{key:"isEmpty",value:function(){return""===this.dom.search.value}},{key:"destroy",value:function(){this.editor=null,this.dom.container.removeChild(this.dom.wrapper),this.dom=null,this.results=null,this.activeResult=null,this._clearDelay()}}])&&Z(t.prototype,i),n&&Z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function O(e){return(O="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})(e)}function F(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==O(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==O(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===O(e)?e:String(e)}(n.key),n)}}var G=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");t&&(this.root=i,this.path=document.createElement("div"),this.path.className="jsoneditor-treepath",this.path.setAttribute("tabindex",0),this.contentMenuClicked=!1,t.appendChild(this.path),this.reset())}var t,i,n;return t=e,(i=[{key:"reset",value:function(){this.path.textContent=(0,c.Iu)("selectNode")}},{key:"setPath",value:function(e){var t=this;this.path.textContent="",e&&e.length&&e.forEach((function(i,n){var r,s=document.createElement("span");s.className="jsoneditor-treepath-element",s.innerText=i.name,s.onclick=function(e){this.selectionCallback&&this.selectionCallback(e)}.bind(t,i),t.path.appendChild(s),i.children.length&&((r=document.createElement("span")).className="jsoneditor-treepath-seperator",r.textContent="►",r.onclick=function(){t.contentMenuClicked=!0;var s=[];i.children.forEach((function(o){s.push({text:o.name,className:"jsoneditor-type-modes"+(e[n+1]+1&&e[n+1].name===o.name?" jsoneditor-selected":""),click:function(e,t){this.contextMenuCallback&&this.contextMenuCallback(e,t)}.bind(t,i,o.name)})})),new o.x(s,{limitHeight:!0}).show(r,t.root,!0)},t.path.appendChild(r)),n===e.length-1&&(s=(r||s).getBoundingClientRect().right,t.path.offsetWidth<s&&(t.path.scrollLeft=s),t.path.scrollLeft)&&((s=document.createElement("span")).className="jsoneditor-treepath-show-all-btn",s.title="show all path",s.textContent="...",s.onclick=function(e){(t.contentMenuClicked=!1,g.addClassName)(t.path,"show-all"),t.path.style.width=t.path.parentNode.getBoundingClientRect().width-10+"px",t.path.onblur=function(){t.contentMenuClicked?(t.contentMenuClicked=!1,t.path.focus()):((0,g.removeClassName)(t.path,"show-all"),t.path.onblur=void 0,t.path.style.width="",t.setPath(e))}}.bind(t,e),t.path.insertBefore(s,t.path.firstChild))}))}},{key:"onSectionSelected",value:function(e){"function"==typeof e&&(this.selectionCallback=e)}},{key:"onContextMenuItemSelected",value:function(e){"function"==typeof e&&(this.contextMenuCallback=e)}}])&&F(t.prototype,i),n&&F(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),D=(t=i(8037),i.n(t)),V=((i={}).create=function(e,t){if(!e)throw new Error("No container element provided.");function i(e){var t,i;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(i=window.getSelection()).removeAllRanges(),i.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())}function o(e){return void 0===h&&((h=document.createElement("span")).style.visibility="hidden",h.style.position="fixed",h.style.outline="0",h.style.margin="0",h.style.padding="0",h.style.border="0",h.style.left="0",h.style.whiteSpace="pre",h.style.fontSize=u,h.style.fontFamily=p,h.style.fontWeight="normal",document.body.appendChild(h)),h.textContent=e,h.getBoundingClientRect().right}function r(){this.style.backgroundColor="#ddd"}function s(){this.style.backgroundColor=""}function a(){I.hide(),I.onmouseselection(this.__hint,I.rs)}var c,h,d,u,p,g,m,f,y,v,C,I,b,A,w,_;this.container=e,this.dom={},this.highlighter=new l,this.selection=void 0,this.multiselection={nodes:[]},this.validateSchema=null,this.validationSequence=0,this.errorNodes=[],this.lastSchemaErrors=void 0,this.node=null,this.focusTarget=null,this._setOptions(t),t.autocomplete&&(this.autocomplete=((c=(c=t.autocomplete)||{}).filter=c.filter||"start",c.trigger=c.trigger||"keydown",c.confirmKeys=c.confirmKeys||[39,35,9],c.caseSensitive=c.caseSensitive||!1,p=u="",(g=document.createElement("div")).style.position="relative",g.style.outline="0",g.style.border="0",g.style.margin="0",g.style.padding="0",(m=document.createElement("div")).className="autocomplete dropdown",m.style.position="absolute",m.style.visibility="hidden",f=m,y=[],C=-1,A=I={rs:b={onArrowDown:function(){},onArrowUp:function(){},onEnter:function(){},onTab:function(){},startFrom:v=0,options:[],element:null,elementHint:null,elementStyle:null,wrapper:g,show:function(e,t,i){var n=this;this.startFrom=t,this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null),""===u&&(u=window.getComputedStyle(e).getPropertyValue("font-size")),""===p&&(p=window.getComputedStyle(e).getPropertyValue("font-family")),m.style.marginLeft="0",m.style.marginTop=e.getBoundingClientRect().height+"px",this.options=i.map(String),this.element!==e&&(this.element=e,this.elementStyle={zIndex:this.element.style.zIndex,position:this.element.style.position,backgroundColor:this.element.style.backgroundColor,borderColor:this.element.style.borderColor}),this.element.style.zIndex=3,this.element.style.position="relative",this.element.style.backgroundColor="transparent",this.element.style.borderColor="transparent",this.elementHint=e.cloneNode(),this.elementHint.className="autocomplete hint",this.elementHint.style.zIndex=2,this.elementHint.style.position="absolute",this.elementHint.onfocus=function(){n.element.focus()},this.element.addEventListener&&(this.element.removeEventListener("keydown",w),this.element.addEventListener("keydown",w,!1),this.element.removeEventListener("blur",_),this.element.addEventListener("blur",_,!1)),g.appendChild(this.elementHint),g.appendChild(m),e.parentElement.appendChild(g),this.repaint(e)},setText:function(e){this.element.innerText=e},getText:function(){return this.element.innerText},hideDropDown:function(){this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null,A.hide(),this.element.style.zIndex=this.elementStyle.zIndex,this.element.style.position=this.elementStyle.position,this.element.style.backgroundColor=this.elementStyle.backgroundColor,this.element.style.borderColor=this.elementStyle.borderColor)},repaint:function(e){e=(e=e.innerText).replace("\n","");var t=this.options.length,i=e.substring(this.startFrom);d=e.substring(0,this.startFrom);for(var n=0;n<t;n++){var r=this.options[n];if(!c.caseSensitive&&0===r.toLowerCase().indexOf(i.toLowerCase())||c.caseSensitive&&0===r.indexOf(i)){this.elementHint.innerText=d+i+r.substring(i.length),this.elementHint.realInnerText=d+r;break}}m.style.left=o(d)+"px",A.refresh(i,this.options),this.elementHint.style.width=o(this.elementHint.innerText)+10+"px","hidden"!==m.style.visibility&&(this.elementHint.style.width=o(this.elementHint.innerText)+m.clientWidth+"px")}},hide:function(){f.style.visibility="hidden"},refresh:function(e,t){f.style.visibility="hidden",v=0,f.textContent="";var i=window.innerHeight||document.documentElement.clientHeight,o=(h=f.parentNode.getBoundingClientRect()).top-6,l=(i=i-h.bottom-6,y=[],"function"==typeof c.filter?c.filter:n[c.filter]),h=l?t.filter((function(t){return l(c.caseSensitive?e:e.toLowerCase(),c.caseSensitive?t:t.toLowerCase(),c)})):[];0===(y=h.map((function(t){var i=document.createElement("div"),n=(i.className="item",i.onmouseover=r,i.onmouseout=s,i.onmousedown=a,i.__hint=t,i.textContent="",i.appendChild(document.createTextNode(t.substring(0,e.length))),document.createElement("b"));return n.appendChild(document.createTextNode(t.substring(e.length))),i.appendChild(n),f.appendChild(i),i}))).length||1===y.length&&(e.toLowerCase()===y[0].__hint.toLowerCase()&&!c.caseSensitive||e===y[0].__hint&&c.caseSensitive)||y.length<2||(I.highlight(0),3*i<o?(f.style.maxHeight=o+"px",f.style.top="",f.style.bottom="100%"):(f.style.top="100%",f.style.bottom="",f.style.maxHeight=i+"px"),f.style.visibility="visible")},highlight:function(e){-1!==C&&y[C]&&(y[C].className="item"),y[e].className="item hover",C=e},move:function(e){return"hidden"===f.style.visibility?"":(v+e!==-1&&v+e!==y.length&&(v+=e,I.highlight(v)),y[v].__hint)},onmouseselection:function(){}},w=function(e){var t=(e=e||window.event).keyCode;if(null!=this.elementHint&&33!==t&&34!==t)if(27===t)b.hideDropDown(),b.element.focus(),e.preventDefault(),e.stopPropagation();else{var n,o=(o=this.element.innerText).replace("\n","");if(0<=c.confirmKeys.indexOf(t))9===t&&0===this.elementHint.innerText.length&&b.onTab(),0<this.elementHint.innerText.length&&this.element.innerText!==this.elementHint.realInnerText&&(this.element.innerText=this.elementHint.realInnerText,b.hideDropDown(),i(this.element),9===t)&&(b.element.focus(),e.preventDefault(),e.stopPropagation());else if(13===t)if(0===this.elementHint.innerText.length)b.onEnter();else{var r="hidden"===m.style.visibility;if(A.hide(),r)return b.hideDropDown(),b.element.focus(),void b.onEnter();this.element.innerText=this.elementHint.realInnerText,b.hideDropDown(),i(this.element),e.preventDefault(),e.stopPropagation()}else 40===t?(r=o.substring(this.startFrom),""===(n=A.move(1))&&b.onArrowDown(),this.elementHint.innerText=d+r+n.substring(r.length),this.elementHint.realInnerText=d+n,e.preventDefault(),e.stopPropagation()):38===t&&(r=o.substring(this.startFrom),""===(n=A.move(-1))&&b.onArrowUp(),this.elementHint.innerText=d+r+n.substring(r.length),this.elementHint.realInnerText=d+n,e.preventDefault(),e.stopPropagation())}}.bind(b),_=function(e){b.hideDropDown()},A.onmouseselection=function(e,t){t.element.innerText=t.elementHint.innerText=d+e,t.hideDropDown(),window.setTimeout((function(){t.element.focus(),i(t.element)}),1)},b)),this.options.history&&"view"!==this.options.mode&&(this.history=new N(this)),this._createFrame(),this._createTable()},i.destroy=function(){this.frame&&this.container&&this.frame.parentNode===this.container&&(this.container.removeChild(this.frame),this.frame=null),this.container=null,this.dom=null,this.clear(),this.node=null,this.focusTarget=null,this.selection=null,this.multiselection=null,this.errorNodes=null,this.validateSchema=null,this._debouncedValidate=null,this.history&&(this.history.destroy(),this.history=null),this.searchBox&&(this.searchBox.destroy(),this.searchBox=null),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.frameFocusTracker.destroy()},i._setOptions=function(e){var t=this;this.options={search:!0,history:!0,mode:"tree",name:void 0,schema:null,schemaRefs:null,autocomplete:null,navigationBar:!0,mainMenuBar:!0,limitDragging:!1,onSelectionChange:null,colorPicker:!0,onColorPicker:function(e,t,i){var n;D()?(n=e.getBoundingClientRect().top,n=(0,g.getWindow)(e).innerHeight-n<300&&300<n,new(D())({parent:e,color:t,popup:n?"top":"bottom",onDone:function(e){e=1===e.rgba[3]?e.hex.substr(0,7):e.hex,i(e)}}).show()):console.warn("Cannot open color picker: the `vanilla-picker` library is not included in the bundle. Either use the full bundle or implement your own color picker using `onColorPicker`.")},timestampTag:!0,timestampFormat:null,createQuery:h.r,executeQuery:h.J,onEvent:null,enableSort:!0,enableTransform:!0},e&&(Object.keys(e).forEach((function(i){t.options[i]=e[i]})),null==e.limitDragging)&&null!=e.schema&&(this.options.limitDragging=!0),this.setSchema(this.options.schema,this.options.schemaRefs),this._debouncedValidate=(0,g.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),e.onSelectionChange&&this.onSelectionChange(e.onSelectionChange),(0,c.cC)(this.options.languages),(0,c.m0)(this.options.language)},i.set=function(e){e instanceof Function||void 0===e?this.clear():(this.content.removeChild(this.table),e={field:this.options.name,value:e},e=new x(this,e),this._setRoot(e),this._validateAndCatch(),this.node.expand(!1),this.content.appendChild(this.table)),this.history&&this.history.clear(),this.searchBox&&this.searchBox.clear()},i.update=function(e){var t,i;this.node.deepEqual(e)||(t=this.getSelection(),this.onChangeDisabled=!0,this.node.update(e),this.onChangeDisabled=!1,this._validateAndCatch(),this.searchBox&&!this.searchBox.isEmpty()&&this.searchBox.forceSearch(),t&&t.start&&t.end&&(e=this.node.findNodeByPath(t.start.path),i=this.node.findNodeByPath(t.end.path),e)&&i?this.setSelection(t.start,t.end):this.setSelection({},{}))},i.get=function(){if(this.node)return this.node.getValue()},i.getText=function(){return JSON.stringify(this.get())},i.setText=function(e){try{this.set((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.set((0,g.parse)(e))}},i.updateText=function(e){try{this.update((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.update((0,g.parse)(e))}},i.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},i.getName=function(){return this.options.name},i.focus=function(){var e=this.scrollableContent.querySelector("[contenteditable=true]");e?e.focus():this.node.dom.expand?this.node.dom.expand.focus():this.node.dom.menu?this.node.dom.menu.focus():(e=this.frame.querySelector("button"))&&e.focus()},i.clear=function(){this.node&&(this.node.hide(),delete this.node),this.treePath&&this.treePath.reset()},i._setRoot=function(e){this.clear(),(this.node=e).setParent(null),e.setField(this.getName(),!1),delete e.index,this.tbody.appendChild(e.getDom())},i.search=function(e){var t;return this.node?(this.content.removeChild(this.table),t=this.node.search(e),this.content.appendChild(this.table)):t=[],t},i.expandAll=function(){this.node&&(this.content.removeChild(this.table),this.node.expand(),this.content.appendChild(this.table))},i.collapseAll=function(){this.node&&(this.content.removeChild(this.table),this.node.collapse(),this.content.appendChild(this.table))},i.expand=function(e){var t;e&&(t=this.node?this.node.findNodeByPath(e.path):null)&&(e.isExpand?t.expand(e.recursive):t.collapse(e.recursive))},i._onAction=function(e,t){this.history&&this.history.add(e,t),this._onChange()},i._onChange=function(){if(!this.onChangeDisabled){var e;if(this.selection=this.getDomSelection(),this._debouncedValidate(),this.treePath&&((e=this.node&&this.selection?this.node.findNodeByInternalPath(this.selection.path):this.multiselection?this.multiselection.nodes[0]:void 0)?this._updateTreePath(e.getNodePath()):this.treePath.reset()),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}if(this.options.onClassName&&this.node.recursivelyUpdateCssClassesOnNodes(),this.options.onNodeName&&this.node.childs)try{this.node.recursivelyUpdateNodeName()}catch(e){console.error("Error in onNodeName callback: ",e)}}},i.validate=function(){var e=this,t=this.node;if(t){var i=t.getValue(),n=[];this.validateSchema&&!this.validateSchema(i)&&(n=this.validateSchema.errors.map((function(e){return(0,g.improveSchemaError)(e)})).map((function(e){return{node:t.findNode(e.dataPath),error:e,type:"validation"}})).filter((function(e){return null!=e.node})));try{this.validationSequence++;var o=this,r=this.validationSequence;return this._validateCustom(i).then((function(t){return r===o.validationSequence&&(t=[].concat(n,t||[]),o._renderValidationErrors(t),"function"==typeof e.options.onValidationError&&(0,g.isValidationErrorChanged)(t,e.lastSchemaErrors)&&e.options.onValidationError.call(e,t),e.lastSchemaErrors=t),e.lastSchemaErrors}))}catch(i){return Promise.reject(i)}}},i._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},i._renderValidationErrors=function(e){this.errorNodes&&this.errorNodes.forEach((function(e){e.setError(null)}));var t=e.reduce((function(e,t){return t.node.findParents().filter((function(t){return!e.some((function(e){return e[0]===t}))})).map((function(e){return[e,t.node]})).concat(e)}),[]);this.errorNodes=t.map((function(e){return{node:e[0],child:e[1],error:{message:"object"===e[0].type?(0,c.Iu)("containsInvalidProperties"):(0,c.Iu)("containsInvalidItems")}}})).concat(e).map((function(e){return e.node.setError(e.error,e.child),e.node}))},i._validateCustom=function(e){try{var t,i;if(this.options.onValidate)return t=this.node,i=this.options.onValidate(e),((0,g.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,g.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){var i;try{i=e&&e.path?t.findNodeByPath(e.path):null}catch(e){}return i||console.warn("Ignoring validation error: node not found. Path:",e.path,"Error:",e),{node:i,error:e,type:"customValidation"}})).filter((function(e){return e&&e.node&&e.error&&e.error.message})):null}))}catch(e){return Promise.reject(e)}return Promise.resolve(null)},i.refresh=function(){this.node&&this.node.updateDom({recurse:!0})},i.startAutoScroll=function(e){var t=this,i=this.scrollableContent,n=(0,g.getAbsoluteTop)(i),o=i.clientHeight,r=n+o;e<n+24&&0<i.scrollTop?this.autoScrollStep=(n+24-e)/3:r-24<e&&o+i.scrollTop<i.scrollHeight?this.autoScrollStep=(r-24-e)/3:this.autoScrollStep=void 0,this.autoScrollStep?this.autoScrollTimer||(this.autoScrollTimer=setInterval((function(){t.autoScrollStep?i.scrollTop-=t.autoScrollStep:t.stopAutoScroll()}),50)):this.stopAutoScroll()},i.stopAutoScroll=function(){this.autoScrollTimer&&(clearTimeout(this.autoScrollTimer),delete this.autoScrollTimer),this.autoScrollStep&&delete this.autoScrollStep},i.setDomSelection=function(e){var t,i,n;e&&("scrollTop"in e&&this.scrollableContent&&(this.scrollableContent.scrollTop=e.scrollTop),e.paths?(t=this,i=e.paths.map((function(e){return t.node.findNodeByInternalPath(e)})),this.select(i)):(n=(i=e.path?this.node.findNodeByInternalPath(e.path):null)&&e.domName?i.dom[e.domName]:null,e.range&&n?(e=Object.assign({},e.range,{container:n}),(0,g.setSelectionOffset)(e)):i&&i.focus()))},i.getDomSelection=function(){var e=x.getNodeFromTarget(this.focusTarget),t=this.focusTarget,i=e?Object.keys(e.dom).find((function(i){return e.dom[i]===t})):null,n=(0,g.getSelectionOffset)();return(n=(n=n&&"DIV"!==n.container.nodeName?null:n)&&n.container!==t?null:n)&&delete n.container,{path:e?e.getInternalPath():null,domName:i,range:n,paths:0<this.multiselection.length?this.multiselection.nodes.map((function(e){return e.getInternalPath()})):null,scrollTop:this.scrollableContent?this.scrollableContent.scrollTop:0}},i.scrollTo=function(e,t){var i,n,o,r,s=this.scrollableContent;s?((i=this).animateTimeout&&(clearTimeout(i.animateTimeout),delete i.animateTimeout),i.animateCallback&&(i.animateCallback(!1),delete i.animateCallback),n=s.clientHeight,o=s.scrollHeight-n,r=Math.min(Math.max(e-n/4,0),o),function e(){var n=s.scrollTop;n=r-n,3<Math.abs(n)?(s.scrollTop+=n/3,i.animateCallback=t,i.animateTimeout=setTimeout(e,50)):(t&&t(!0),s.scrollTop=r,delete i.animateTimeout,delete i.animateCallback)}()):t&&t(!1)},i._createFrame=function(){var e=this,t=(this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.container.appendChild(this.frame),this.contentOuter=document.createElement("div"),this.contentOuter.className="jsoneditor-outer",this);function i(e){t._onEvent&&t._onEvent(e)}var n,o,s,a={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};this.frameFocusTracker=new r.R(a),this.frame.onclick=function(e){var t=e.target;i(e),"BUTTON"===t.nodeName&&e.preventDefault()},this.frame.oninput=i,this.frame.onchange=i,this.frame.onkeydown=i,this.frame.onkeyup=i,this.frame.oncut=i,this.frame.onpaste=i,this.frame.onmousedown=i,this.frame.onmouseup=i,this.frame.onmouseover=i,this.frame.onmouseout=i,(0,g.addEventListener)(this.frame,"focus",i,!0),(0,g.addEventListener)(this.frame,"blur",i,!0),this.frame.onfocusin=i,this.frame.onfocusout=i,this.options.mainMenuBar&&((0,g.addClassName)(this.contentOuter,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(a=document.createElement("button")).type="button",a.className="jsoneditor-expand-all",a.title=(0,c.Iu)("expandAll"),a.onclick=function(){t.expandAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!0,recursive:!0})},this.menu.appendChild(a),(a=document.createElement("button")).type="button",a.title=(0,c.Iu)("collapseAll"),a.className="jsoneditor-collapse-all",a.onclick=function(){t.collapseAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!1,recursive:!0})},this.menu.appendChild(a),this.options.enableSort&&((a=document.createElement("button")).type="button",a.className="jsoneditor-sort",a.title=(0,c.Iu)("sortTitleShort"),a.onclick=function(){t.node.showSortModal()},this.menu.appendChild(a)),this.options.enableTransform&&((a=document.createElement("button")).type="button",a.title=(0,c.Iu)("transformTitleShort"),a.className="jsoneditor-transform",a.onclick=function(){t.node.showTransformModal()},this.menu.appendChild(a)),this.history&&((n=document.createElement("button")).type="button",n.className="jsoneditor-undo jsoneditor-separator",n.title=(0,c.Iu)("undo"),n.onclick=function(){t._onUndo()},this.menu.appendChild(n),this.dom.undo=n,(o=document.createElement("button")).type="button",o.className="jsoneditor-redo",o.title=(0,c.Iu)("redo"),o.onclick=function(){t._onRedo()},this.menu.appendChild(o),this.dom.redo=o,this.history.onChange=function(){n.disabled=!t.history.canUndo(),o.disabled=!t.history.canRedo()},this.history.onChange()),this.options&&this.options.modes&&this.options.modes.length&&((s=this).modeSwitcher=new d.x(this.menu,this.options.modes,this.options.mode,(function(e){try{s.setMode(e),s.modeSwitcher.focus()}catch(e){s._onError(e)}}))),this.options.search)&&(this.searchBox=new H(this,this.menu)),this.options.navigationBar&&(this.navBar=document.createElement("div"),this.navBar.className="jsoneditor-navigation-bar nav-bar-empty",this.frame.appendChild(this.navBar),this.treePath=new G(this.navBar,this.getPopupAnchor()),this.treePath.onSectionSelected(this._onTreePathSectionSelected.bind(this)),this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)))},i._onUndo=function(){this.history&&(this.history.undo(),this._onChange())},i._onRedo=function(){this.history&&(this.history.redo(),this._onChange())},i._onEvent=function(e){if(!x.targetIsColorPicker(e.target)){var t,i=x.getNodeFromTarget(e.target);if("keydown"===e.type&&this._onKeyDown(e),i&&"focus"===e.type&&(this.focusTarget=e.target,this.options.autocomplete)&&"focus"===this.options.autocomplete.trigger&&this._showAutoComplete(e.target),"mousedown"===e.type&&this._startDragDistance(e),"mousemove"!==e.type&&"mouseup"!==e.type&&"click"!==e.type||this._updateDragDistance(e),i&&this.options&&this.options.navigationBar&&i&&("keydown"===e.type||"mousedown"===e.type)&&(t=this,setTimeout((function(){t._updateTreePath(i.getNodePath())}))),i&&i.selected){if("click"===e.type){if(e.target===i.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"===e.type&&x.onDragStart(this.multiselection.nodes,e)}else"mousedown"===e.type&&(0,g.hasParentNode)(e.target,this.content)&&(this.deselect(),i&&e.target===i.dom.drag?x.onDragStart(i,e):i&&(e.target===i.dom.field||e.target===i.dom.value||e.target===i.dom.select)||this._onMultiSelectStart(e));i&&i.onEvent(e)}},i._updateTreePath=function(e){var t;function i(e){return e.parent?"array"===e.parent.type?e.index:e.field:e.field||e.type}e&&e.length?((0,g.removeClassName)(this.navBar,"nav-bar-empty"),t=[],e.forEach((function(e){var n={name:i(e),node:e,children:[]};e.childs&&e.childs.length&&e.childs.forEach((function(e){n.children.push({name:i(e),node:e})})),t.push(n)})),this.treePath.setPath(t)):(0,g.addClassName)(this.navBar,"nav-bar-empty")},i._onTreePathSectionSelected=function(e){e&&e.node&&(e.node.expandTo(),e.node.focus())},i._onTreePathMenuItemSelected=function(e,t){e&&e.children.length&&(e=e.children.find((function(e){return e.name===t})))&&e.node&&(this._updateTreePath(e.node.getNodePath()),e.node.expandTo(),e.node.focus())},i._startDragDistance=function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},i._updateDragDistance=function(e){this.dragDistanceEvent||this._startDragDistance(e);var t=e.pageX-this.dragDistanceEvent.initialPageX,i=e.pageY-this.dragDistanceEvent.initialPageY;return this.dragDistanceEvent.dragDistance=Math.sqrt(t*t+i*i),this.dragDistanceEvent.hasMoved=this.dragDistanceEvent.hasMoved||10<this.dragDistanceEvent.dragDistance,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},i._onMultiSelectStart=function(e){var t,i=x.getNodeFromTarget(e.target);"tree"===this.options.mode&&void 0===this.options.onEditable&&(this.multiselection={start:i||null,end:null,nodes:[]},this._startDragDistance(e),(t=this).mousemove||(this.mousemove=(0,g.addEventListener)(e.view,"mousemove",(function(e){t._onMultiSelect(e)}))),this.mouseup||(this.mouseup=(0,g.addEventListener)(e.view,"mouseup",(function(e){t._onMultiSelectEnd(e)}))),e.preventDefault())},i._onMultiSelect=function(e){var t;e.preventDefault(),this._updateDragDistance(e),e.hasMoved&&((e=x.getNodeFromTarget(e.target))&&(null==this.multiselection.start&&(this.multiselection.start=e),this.multiselection.end=e),this.deselect(),e=this.multiselection.start,t=this.multiselection.end||this.multiselection.start,e)&&t&&(this.multiselection.nodes=this._findTopLevelNodes(e,t),this.multiselection.nodes&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],this.multiselection.start===e||this.multiselection.start.isDescendantOf(e)?this.multiselection.direction="down":this.multiselection.direction="up"),this.select(this.multiselection.nodes))},i._onMultiSelectEnd=function(e){var t=this.multiselection.nodes[0];t&&t.dom.menu&&t.dom.menu.focus(),this.multiselection.start=null,this.multiselection.end=null,this.mousemove&&((0,g.removeEventListener)(e.view,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&((0,g.removeEventListener)(e.view,"mouseup",this.mouseup),delete this.mouseup)},i.deselect=function(e){var t=!!this.multiselection.nodes.length;this.multiselection.nodes.forEach((function(e){e.setSelected(!1)})),this.multiselection.nodes=[],e&&(this.multiselection.start=null,this.multiselection.end=null),t&&this._selectionChangedHandler&&this._selectionChangedHandler()},i.select=function(e){if(!Array.isArray(e))return this.select([e]);var t;e&&(this.deselect(),this.multiselection.nodes=e.slice(0),t=e[0],e.forEach((function(e){e.expandPathToNode(),e.setSelected(!0,e===t)})),this._selectionChangedHandler)&&(e=this.getSelection(),this._selectionChangedHandler(e.start,e.end))},i._findTopLevelNodes=function(e,t){for(var i=e.getNodePath(),n=t.getNodePath(),o=0;o<i.length&&i[o]===n[o];)o++;e=i[o-1],t=i[o];var r,s=n[o];return t&&s||(e.parent?e=(s=t=e).parent:(t=e.childs[0],s=e.childs[e.childs.length-1])),e&&t&&s?(t=e.childs.indexOf(t),s=e.childs.indexOf(s),r=Math.min(t,s),t=Math.max(t,s),e.childs.slice(r,t+1)):[]},i._showAutoComplete=function(e){var t,i=x.getNodeFromTarget(e),n="";0<=e.className.indexOf("jsoneditor-value")&&(n="value"),""!==(n=0<=e.className.indexOf("jsoneditor-field")?"field":n)&&(t=this,setTimeout((function(){var o;i&&("focus"===t.options.autocomplete.trigger||0<e.innerText.length)&&null!==(o=t.options.autocomplete.getOptions(e.innerText,i.getPath(),n,i.editor))?"function"==typeof o.then?o.then((function(i){null===i?t.autocomplete.hideDropDown():i.options?t.autocomplete.show(e,i.startFrom,i.options):t.autocomplete.show(e,0,i)})).catch((function(e){console.error(e)})):o.options?t.autocomplete.show(e,o.startFrom,o.options):t.autocomplete.show(e,0,o):t.autocomplete.hideDropDown()}),50))},i._onKeyDown=function(e){var t,i=e.which||e.keyCode,n=e.altKey,o=e.ctrlKey,r=e.metaKey,s=e.shiftKey,a=!1,l=this.focusTarget;9===i&&(t=this,setTimeout((function(){t.focusTarget!==l&&(0,g.selectContentEditable)(t.focusTarget)}),0)),this.searchBox&&(o&&70===i?(this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),a=!0):(114===i||o&&71===i)&&(s?this.searchBox.previous(!0):this.searchBox.next(!0),a=!0)),this.history&&(o&&!s&&90===i?(this._onUndo(),a=!0):o&&s&&90===i&&(this._onRedo(),a=!0)),!this.options.autocomplete||a||o||n||r||1!==e.key.length&&8!==i&&46!==i||(a=!1,this._showAutoComplete(e.target)),a&&(e.preventDefault(),e.stopPropagation())},i._createTable=function(){var e;this.options.navigationBar&&(0,g.addClassName)(this.contentOuter,"has-nav-bar"),this.scrollableContent=document.createElement("div"),this.scrollableContent.className="jsoneditor-tree",this.contentOuter.appendChild(this.scrollableContent),this.content=document.createElement("div"),this.content.className="jsoneditor-tree-inner",this.scrollableContent.appendChild(this.content),this.table=document.createElement("table"),this.table.className="jsoneditor-tree",this.content.appendChild(this.table),this.colgroupContent=document.createElement("colgroup"),"tree"===this.options.mode&&((e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e)),(e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e),e=document.createElement("col"),this.colgroupContent.appendChild(e),this.table.appendChild(this.colgroupContent),this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.frame.appendChild(this.contentOuter)},i.showContextMenu=function(e,t){var i,n=[],r=this.multiselection.nodes.slice();n.push({text:(0,c.Iu)("duplicateText"),title:(0,c.Iu)("duplicateTitle"),className:"jsoneditor-duplicate",click:function(){x.onDuplicate(r)}}),n.push({text:(0,c.Iu)("remove"),title:(0,c.Iu)("removeTitle"),className:"jsoneditor-remove",click:function(){x.onRemove(r)}}),this.options.onCreateMenu&&(i=r.map((function(e){return e.getPath()})),n=this.options.onCreateMenu(n,{type:"multiple",path:i[0],paths:i})),new o.x(n,{close:t}).show(e,this.getPopupAnchor())},i.getPopupAnchor=function(){return this.options.popupAnchor||this.frame},i.getSelection=function(){var e,t,i={start:null,end:null};return this.multiselection.nodes&&this.multiselection.nodes.length&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],t=this.multiselection.nodes[this.multiselection.nodes.length-1],"down"===this.multiselection.direction?(i.start=e.serialize(),i.end=t.serialize()):(i.start=t.serialize(),i.end=e.serialize())),i},i.onSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,g.debounce)(e,this.DEBOUNCE_INTERVAL))},i.setSelection=function(e,t){e&&e.dom&&e.range&&(console.warn("setSelection/getSelection usage for text selection is deprecated and should not be used, see documentation for supported selection options"),this.setDomSelection(e)),(e=this._getNodeInstancesByRange(e,t)).forEach((function(e){e.expandTo()})),this.select(e)},i._getNodeInstancesByRange=function(e,t){e&&e.path&&(i=this.node.findNodeByPath(e.path),t)&&t.path&&(n=this.node.findNodeByPath(t.path));var i,n,o=[];if(i instanceof x)if(n instanceof x&&n!==i)if(i.parent===n.parent){t=i.getIndex()<n.getIndex()?(e=i,n):(e=n,i);var r=e;for(o.push(r);r=r.nextSibling(),o.push(r),r&&r!==t;);}else o=this._findTopLevelNodes(i,n);else o.push(i);return o},i.getNodesByRange=function(e,t){e=this._getNodeInstancesByRange(e,t);var i=[];return e.forEach((function(e){i.push(e.serialize())})),i},[{mode:"tree",mixin:i,data:"json"},{mode:"view",mixin:i,data:"json"},{mode:"form",mixin:i,data:"json"}])},2744:function(e,t,i){t.tryRequireAjv=function(){try{return i(8903)}catch(e){}}},9125:function(e,t,i){t.O=function(){try{i(4864)}catch(e){console.error(e)}}},9791:function(e,t,i){"use strict";i.r(t),i.d(t,{addClassName:function(){return S},addEventListener:function(){return G},asyncExec:function(){return Ce},clear:function(){return v},compileJSONPointer:function(){return ie},contains:function(){return fe},debounce:function(){return U},escapeUnicodeChars:function(){return m},extend:function(){return y},findUniqueName:function(){return ae},formatSize:function(){return pe},get:function(){return se},getAbsoluteLeft:function(){return _},getAbsoluteTop:function(){return x},getChildPaths:function(){return le},getColorCSS:function(){return ne},getIndexForPosition:function(){return ee},getInnerText:function(){return N},getInputSelection:function(){return q},getInternetExplorerVersion:function(){return H},getPositionForPath:function(){return te},getSelection:function(){return $},getSelectionOffset:function(){return M},getType:function(){return C},getWindow:function(){return w},hasParentNode:function(){return Z},improveSchemaError:function(){return K},insideRect:function(){return J},isArray:function(){return A},isChildOf:function(){return V},isFirefox:function(){return F},isObject:function(){return me},isPromise:function(){return X},isTimestamp:function(){return ue},isUrl:function(){return b},isValidColor:function(){return oe},isValidValidationError:function(){return Y},isValidationErrorChanged:function(){return ye},limitCharacters:function(){return ge},makeFieldTooltip:function(){return re},parse:function(){return p},parsePath:function(){return j},parseString:function(){return de},removeAllClassNames:function(){return k},removeClassName:function(){return T},removeEventListener:function(){return D},removeReturnsAndSurroundingWhitespace:function(){return W},selectContentEditable:function(){return L},setEndOfContentEditable:function(){return R},setSelection:function(){return P},setSelectionOffset:function(){return B},sort:function(){return ce},sortObjectKeys:function(){return he},stringifyPath:function(){return z},stripFormatting:function(){return E},textDiff:function(){return Q},tryJsonRepair:function(){return g},uniqueMergeArrays:function(){return ve},validate:function(){return f}}),i(4987),t=i(233);var n=i.n(t),o=i(1262),r=i(6589),s=i(7026),a=i(7907);function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var i;if(e)return"string"==typeof e?c(e,t):"Map"===(i="Object"===(i=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function h(e){return(h="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})(e)}var d=1e4,u=9466848e5;function p(e){try{return JSON.parse(e)}catch(t){throw f(e),t}}function g(e){try{return(0,o.K)(e)}catch(t){return e}}function m(e){return e.replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))}function f(e){(void 0!==r?r:JSON).parse(e)}function y(e,t){for(var i in t)Ie(t,i)&&(e[i]=t[i]);return e}function v(e){for(var t in e)Ie(e,t)&&delete e[t];return e}function C(e){return null===e?"null":void 0===e?"undefined":e instanceof Number||"number"==typeof e?"number":e instanceof String||"string"==typeof e?"string":e instanceof Boolean||"boolean"==typeof e?"boolean":e instanceof RegExp?"regexp":A(e)?"array":"object"}var I=/^https?:\/\/\S+$/;function b(e){return("string"==typeof e||e instanceof String)&&I.test(e)}function A(e){return"[object Array]"===Object.prototype.toString.call(e)}function w(e){return e.ownerDocument.defaultView}function _(e){return e.getBoundingClientRect().left+window.pageXOffset||document.scrollLeft||0}function x(e){return e.getBoundingClientRect().top+window.pageYOffset||document.scrollTop||0}function S(e,t){var i=e.className.split(" ");-1===i.indexOf(t)&&(i.push(t),e.className=i.join(" "))}function k(e){e.className=""}function T(e,t){var i=e.className.split(" ");-1!==(t=i.indexOf(t))&&(i.splice(t,1),e.className=i.join(" "))}function E(e){for(var t=e.childNodes,i=0,n=t.length;i<n;i++){var o=t[i],r=(o.style&&o.removeAttribute("style"),o.attributes);if(r)for(var s=r.length-1;0<=s;s--){var a=r[s];!0===a.specified&&o.removeAttribute(a.name)}E(o)}}function R(e){var t;document.createRange&&((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function L(e){var t;e&&"DIV"===e.nodeName&&window.getSelection&&document.createRange&&((t=document.createRange()).selectNodeContents(e),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function $(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null}function P(e){var t;e&&window.getSelection&&((t=window.getSelection()).removeAllRanges(),t.addRange(e))}function M(){var e=$();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer===e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null}function B(e){var t;document.createRange&&window.getSelection&&window.getSelection()&&(t=document.createRange(),e.container.firstChild||e.container.appendChild(document.createTextNode("")),t.setStart(e.container.firstChild,e.startOffset),t.setEnd(e.container.firstChild,e.endOffset),P(t))}function N(e,t){var i;if(void 0===t&&(t={_text:"",flush:function(){var e=this._text;return this._text="",e},set:function(e){this._text=e}}),e.nodeValue)return""!==(i=W(e.nodeValue))?t.flush()+i:"";if(e.hasChildNodes()){for(var n=e.childNodes,o="",r=0,s=n.length;r<s;r++){var a,l=n[r];"DIV"===l.nodeName||"P"===l.nodeName?((a=(a=n[r-1])?a.nodeName:void 0)&&"DIV"!==a&&"P"!==a&&"BR"!==a&&(""!==o&&(o+="\n"),t.flush()),o+=N(l,t),t.set("\n")):"BR"===l.nodeName?(o+=t.flush(),t.set("\n")):o+=N(l,t)}return o}return""}function W(e){return e.replace(/(\b|^)\s*(\b|$)/g,(function(e){return/\n/.exec(e)?"":e}))}function Z(e,t){for(var i=e?e.parentNode:void 0;i;){if(i===t)return!0;i=i.parentNode}return!1}function H(){var e;return-1===O&&(e=-1,"undefined"!=typeof navigator&&"Microsoft Internet Explorer"===navigator.appName&&null!=/MSIE ([0-9]+[.0-9]+)/.exec(navigator.userAgent)&&(e=parseFloat(RegExp.$1)),O=e),O}var O=-1;function F(){return"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")}function G(e,t,i,n){return e.addEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&F()&&(t="DOMMouseScroll"),e.addEventListener(t,i,n),i):e.attachEvent?(e.attachEvent("on"+t,n=function(){return i.call(e,window.event)}),n):void 0}function D(e,t,i,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&F()&&(t="DOMMouseScroll"),e.removeEventListener(t,i,n)):e.detachEvent&&e.detachEvent("on"+t,i)}function V(e,t){for(var i=e.parentNode;i;){if(i===t)return!0;i=i.parentNode}return!1}function j(e){var t=[],i=0;function n(t){for(var n="";void 0!==e[i]&&e[i]!==t;)n+=e[i],i++;if(e[i]!==t)throw new Error("Invalid JSON path: unexpected end, character "+t+" expected");return n}for(;void 0!==e[i];)if("."===e[i])i++,t.push(function(){for(var t="";void 0!==e[i]&&/[\w$]/.test(e[i]);)t+=e[i],i++;if(""===t)throw new Error("Invalid JSON path: property name expected at index "+i);return t}());else{if("["!==e[i])throw new Error('Invalid JSON path: unexpected character "'+e[i]+'" at index '+i);if("'"===e[++i]||'"'===e[i]){var o=e[i];if(i++,t.push(n(o)),e[i]!==o)throw new Error("Invalid JSON path: closing quote ' expected at index "+i);i++}else{if(0===(o=n("]").trim()).length)throw new Error("Invalid JSON path: array value expected at index "+i);o="*"===o?o:JSON.parse(o),t.push(o)}if("]"!==e[i])throw new Error("Invalid JSON path: closing bracket ] expected at index "+i);i++}return t}function z(e){return e.map((function(e){return"number"==typeof e?"["+e+"]":"string"==typeof e&&e.match(/^[A-Za-z0-9_$]+$/)?"."+e:'["'+e+'"]'})).join("")}function K(e){var t,i;return"enum"===e.keyword&&Array.isArray(e.schema)&&(i=e.schema)&&(5<(i=i.map((function(e){return JSON.stringify(e)}))).length&&(t=["("+(i.length-5)+" more...)"],(i=i.slice(0,5)).push(t)),e.message="should be equal to one of: "+i.join(", ")),"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e}function X(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function Y(e){return"object"===h(e)&&Array.isArray(e.path)&&"string"==typeof e.message}function J(e,t,i){return i=void 0!==i?i:0,t.left-i>=e.left&&t.right+i<=e.right&&t.top-i>=e.top&&t.bottom+i<=e.bottom}function U(e,t,i){var n;return function(){var o=this,r=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(o,r)}),t),s&&e.apply(o,r)}}function Q(e,t){for(var i=t.length,n=0,o=e.length,r=t.length;t.charAt(n)===e.charAt(n)&&n<i;)n++;for(;t.charAt(r-1)===e.charAt(o-1)&&n<r&&0<o;)r--,o--;return{start:n,end:r}}function q(e){var t,i,n,o,r=0,s=0;return"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd?(r=e.selectionStart,s=e.selectionEnd):(o=document.selection.createRange())&&o.parentElement()===e&&(n=e.value.length,t=e.value.replace(/\r\n/g,"\n"),(i=e.createTextRange()).moveToBookmark(o.getBookmark()),(o=e.createTextRange()).collapse(!1),-1<i.compareEndPoints("StartToEnd",o)?r=s=n:(r=-i.moveStart("character",-n),r+=t.slice(0,r).split("\n").length-1,-1<i.compareEndPoints("EndToEnd",o)?s=n:(s=-i.moveEnd("character",-n),s+=t.slice(0,s).split("\n").length-1))),{startIndex:r,endIndex:s,start:a(r),end:a(s)};function a(t){return{row:((t=e.value.substring(0,t)).match(/\n/g)||[]).length+1,column:t.length-t.lastIndexOf("\n")}}}function ee(e,t,i){return e=e.value||"",0<t&&0<i?(e=e.split("\n",t),t=Math.min(e.length,t),i=Math.min(e[t-1].length,i-1),i=1===t?i:i+1,e.slice(0,t-1).join("\n").length+i):-1}function te(e,t){var i,n=[];if(t&&t.length){try{i=s.parse(e)}catch(e){return n}t.forEach((function(e){var t=ie(j(e));(t=i.pointers[t])&&n.push({path:e,line:t.key?t.key.line:t.value?t.value.line:0,column:t.key?t.key.column:t.value?t.value.column:0})}))}return n}function ie(e){return e.map((function(e){return"/"+String(e).replace(/~/g,"~0").replace(/\//g,"~1")})).join("")}function ne(e){var t=document.createElement("div");return t.style.color=e,t.style.color.split(/\s+/).join("").toLowerCase()||null}function oe(e){return!!ne(e)}function re(e,t){var i;return e?(i="",e.title&&(i+=e.title),e.description&&(0<i.length&&(i+="\n"),i+=e.description),e.default&&(0<i.length&&(i+="\n\n"),i=(i+=(0,a.Iu)("default",void 0,t)+"\n")+JSON.stringify(e.default,null,2)),Array.isArray(e.examples)&&0<e.examples.length&&(0<i.length&&(i+="\n\n"),i+=(0,a.Iu)("examples",void 0,t)+"\n",e.examples.forEach((function(t,n){i+=JSON.stringify(t,null,2),n!==e.examples.length-1&&(i+="\n")}))),i):""}function se(e,t){for(var i=e,n=0;n<t.length&&null!=i;n++)i=i[t[n]];return i}function ae(e,t){for(var i=e.replace(/ \(copy( \d+)?\)$/,""),n=i,o=1;-1!==t.indexOf(n);)n=i+" (copy"+(1<o?" "+o:"")+")",o++;return n}function le(e,t){var i={};if(Array.isArray(e))for(var n=Math.min(e.length,d),o=0;o<n;o++)!function e(t,i,n,o){(Array.isArray(t)||me(t))&&!o||(i[n||""]=!0),me(t)&&Object.keys(t).forEach((function(r){e(t[r],i,n+"."+r,o)}))}(e[o],i,"",t);else i[""]=!0;return Object.keys(i).sort()}function ce(e,t,i){var n=t&&"."!==t?j(t):[],o="desc"===i?-1:1;return(t=e.slice()).sort((function(e,t){return e=se(e,n),t=se(t,n),o*(t<e?1:e<t?-1:0)})),t}function he(e,t){var i="desc"===t?-1:1,o=(t=Object.keys(e).sort((function(e,t){return i*n()(e,t)})),{});return t.forEach((function(t){o[t]=e[t]})),o}function de(e){var t,i;return""===e?"":"null"===(t=e.toLowerCase())?null:"true"===t||"false"!==t&&(/^0\d+$/.test(e)||(t=Number(e),i=parseFloat(e),isNaN(t))||isNaN(i)?e:t)}function ue(e,t){return"number"==typeof t&&u<t&&isFinite(t)&&Math.floor(t)===t&&!isNaN(new Date(t).valueOf())}function pe(e){return e<900?e.toFixed()+" B":(e/=1e3)<900?e.toFixed(1)+" KB":(e/=1e3)<900?e.toFixed(1)+" MB":(e/=1e3)<900?e.toFixed(1)+" GB":(e/1e3).toFixed(1)+" TB"}function ge(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function me(e){return"object"===h(e)&&null!==e&&!Array.isArray(e)}function fe(e,t){return-1!==e.indexOf(t)}function ye(e,t){if(t||e){if(t&&!e||!t&&e)return!0;if(t.length!==e.length)return!0;for(var i,n=0;n<e.length;++n)if(i=function(i){if(!("error"===e[i].type?t.find((function(t){return t.line===e[i].line})):t.find((function(t){return t.dataPath===e[i].dataPath&&t.schemaPath===e[i].schemaPath}))))return{v:!0}}(n))return i.v}return!1}function ve(e,t){return e=null!=e&&e.length?e:[],t=null!=t&&t.length?t:[],l(new Set(e.concat(t)))}function Ce(e){setTimeout(e)}function Ie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},8037:function(e,t,i){var n;if(window.Picker)n=window.Picker;else try{n=i(4049)}catch(e){}e.exports=n},6225:function(e,t,i){function n(e,t){var i,n;return t=h(e,t),(e=a.modules[t])||("function"==typeof(e=a.payloads[t])&&(i={id:t,uri:"",exports:n={},packaged:!0},n=e((function(e,i){return l(t,e,i)}),n,i)||i.exports,a.modules[t]=n,delete a.payloads[t]),e=a.modules[t]=n||e),e}var o,r,s,a,l,c,h;e=i.nmd(e),(s=function(){return this}())||"undefined"==typeof window||(s=window),(a=function(e,t,i){"string"!=typeof e?a.original?a.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(2==arguments.length&&(i=t),a.modules[e]||(a.payloads[e]=i,a.modules[e]=null))}).modules={},a.payloads={},l=function(e,t,i){if("string"==typeof t){var o=n(e,t);if(null!=o)return i&&i(),o}else if("[object Array]"===Object.prototype.toString.call(t)){for(var r=[],s=0,a=t.length;s<a;++s){var l=n(e,t[s]);if(null==l&&c.original)return;r.push(l)}return i&&i.apply(null,r)||!0}},c=function(e,t){var i=l("",e,t);return null==i&&c.original?c.original.apply(this,arguments):i},h=function(e,t){var i;if(-1!==t.indexOf("!"))return i=t.split("!"),h(e,i[0])+"!"+h(e,i[1]);if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},r=s,(o="ace")&&(s[o]||(s[o]={}),r=s[o]),r.define&&r.define.packaged||(a.original=r.define,r.define=a,r.define.packaged=!0),r.require&&r.require.packaged||(c.original=r.require,r.require=c,r.require.packaged=!0),ace.define("ace/lib/es6-shim",["require","exports","module"],(function(e,t,i){function n(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||n(String.prototype,"startsWith",(function(e,t){return this.lastIndexOf(e,t=t||0)===t})),String.prototype.endsWith||n(String.prototype,"endsWith",(function(e,t){return(void 0===t||t>this.length)&&(t=this.length),t-=e.length,-1!==(e=this.indexOf(e,t))&&e===t})),String.prototype.repeat||n(String.prototype,"repeat",(function(e){for(var t="",i=this;0<e;)1&e&&(t+=i),(e>>=1)&&(i+=i);return t})),String.prototype.includes||n(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];null!=n&&Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||n(Array.prototype,"find",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return o}})),Array.prototype.findIndex||n(Array.prototype,"findIndex",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return n}})),Array.prototype.includes||n(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||n(Array.prototype,"fill",(function(e){for(var t,i=this.length>>>0,n=(t=0|arguments[1])<0?Math.max(i+t,0):Math.min(t,i),o=(t=void 0===(t=arguments[2])?i:0|t)<0?Math.max(i+t,0):Math.min(t,i);n<o;)this[n]=e,n++;return this})),Array.of||n(Array,"of",(function(){return Array.prototype.slice.call(arguments)}))})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],(function(e,t,i){"use strict";e("./es6-shim")})),ace.define("ace/lib/deep_copy",["require","exports","module"],(function(e,t,i){t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;if(Array.isArray(t))for(var i=[],n=0;n<t.length;n++)i[n]=e(t[n]);else{if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n])}return i}})),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],(function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";0<t;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t,i={};for(t in e)i[t]=e[t];return i},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t,i=Object.create(null);for(t in e)i[t]=e[t];return i},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var i=[];return e.replace(t,(function(e){i.push({offset:arguments[arguments.length-2],length:e.length})})),i},t.deferredCall=function(e){function t(){n=null,e()}function i(e){return i.cancel(),n=setTimeout(t,e||0),i}var n=null;return(i.schedule=i).call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(n),n=null,i},i.isPending=function(){return n},i},t.delayedCall=function(e,t){function i(){o=null,e()}function n(e){null==o&&(o=setTimeout(i,e||t))}var o=null;return n.delay=function(e){o&&clearTimeout(o),o=setTimeout(i,e||t)},(n.schedule=n).call=function(){this.cancel(),e()},n.cancel=function(){o&&clearTimeout(o),o=null},n.isPending=function(){return o},n},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},t.supportsUnicodeFlag=function(){try{new RegExp("^.$","u")}catch(e){return!1}return!0}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},o=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),r=n.userAgent||"";n=n.appName||"",t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE="Microsoft Internet Explorer"==n||0<=n.indexOf("MSAppHost")?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=0<=r.indexOf("AdobeAIR"),t.isAndroid=0<=r.indexOf("Android"),t.isChromeOS=0<=r.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,i){"use strict";e=e("./useragent");var n,o,r=(t.buildDom=function e(t,i,n){if("string"==typeof t&&t)return c=document.createTextNode(t),i&&i.appendChild(c),c;if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var o=[],r=0;r<t.length;r++){var s=e(t[r],i,n);s&&o.push(s)}return o}var a=document.createElement(t[0]),l=t[1],c=1;for(r=c=l&&"object"==typeof l&&!Array.isArray(l)?2:c;r<t.length;r++)e(t[r],a,n);return 2==c&&Object.keys(l).forEach((function(e){var t=l[e];"class"===e?a.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?a[e]=t:"ref"===e?n&&(n[t]=a):"style"===e?"string"==typeof t&&(a.style.cssText=t):null!=t&&a.setAttribute(e,t)})),i&&i.appendChild(a),a},t.getDocumentHead=function(e){return(e=e||document).head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var o=i.indexOf(t);if(-1==o)break;n=!1,i.splice(o,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()},[]);function s(){var e=r;r=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,i,o){if("undefined"!=typeof document){if(r)if(o)s();else if(!1===o)return r.push([e,i]);if(!n){var a=o;if(o=(a=o&&o.getRootNode&&(a=o.getRootNode())&&a!=o?a:document).ownerDocument||a,i&&t.hasCssString(i,a))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var l=t.createElement("style");l.appendChild(o.createTextNode(e)),i&&(l.id=i),(a=a==o?t.getDocumentHead(o):a).insertBefore(l,a.firstChild)}}}t.useStrictCSP=function(e){0==(n=e)?s():r=r||[]},t.importCssString=a,t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.scrollbarWidth=function(e){var i=t.createElement("ace_inner"),n=(i.style.width="100%",i.style.minWidth="0px",i.style.height="200px",i.style.display="block",t.createElement("ace_outer"));if((o=n.style).position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",n.appendChild(i),!(e=e&&e.documentElement||document&&document.documentElement))return 0;e.appendChild(n);var o,r=i.offsetWidth;return r===(o.overflow="scroll",o=i.offsetWidth)&&(o=n.clientWidth),e.removeChild(n),r-o},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!e.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,e.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document&&(o=document.createElement("div"),t.HI_DPI&&void 0!==o.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),e.isEdge||void 0===o.style.animationName||(t.HAS_CSS_ANIMATION=!0),o=null),t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:t.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,i){!i&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,i)||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,i){"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 i in t)e[i]=t[i];return e},t.implement=function(e,i){t.mixin(e,i)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,i){"use strict";function n(){this.propagationStopped=!0}function o(){this.defaultPrevented=!0}var r={};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(i.length||r){(t="object"==typeof t&&t?t:{}).type||(t.type=e),t.stopPropagation||(t.stopPropagation=n),t.preventDefault||(t.preventDefault=o),i=i.slice();for(var s=0;s<i.length&&(i[s](t,this),!t.propagationStopped);s++);return r&&!t.defaultPrevented?r(t,this):void 0}},r._signal=function(e,t){if(i=(this._eventRegistry||{})[e])for(var i=i.slice(),n=0;n<i.length;n++)i[n](t,this)},r.once=function(e,t){var i=this;if(this.on(e,(function n(){i.off(e,n),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},r.setDefaultHandler=function(e,t){var i,n,o=this._defaultHandlers;(o=o||(this._defaultHandlers={_disabled_:{}}))[e]&&(n=o[e],(i=o._disabled_[e])||(o._disabled_[e]=i=[]),i.push(n),-1!=(n=i.indexOf(t)))&&i.splice(n,1),o[e]=t},r.removeDefaultHandler=function(e,t){var i,n=this._defaultHandlers;n&&(i=n._disabled_[e],n[e]==t?i&&this.setDefaultHandler(e,i.pop()):i&&-1!=(n=i.indexOf(t))&&i.splice(n,1))},r.on=r.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return-1==(n=n||(this._eventRegistry[e]=[])).indexOf(t)&&n[i?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{},(e=this._eventRegistry[e])&&-1!==(t=e.indexOf(t))&&e.splice(t,1)},r.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=r})),ace.define("ace/lib/report_error",["require","exports","module"],(function(e,t,i){t.reportError=function(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout((function(){throw i}))}})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error"],(function(e,t,i){var n,o=e("./oop"),r=e("./event_emitter").EventEmitter,s=(e=e("./report_error").reportError,{setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t,i={};return e?Array.isArray(e)||(i=e,e=Object.keys(i)):(t=this.$options,e=Object.keys(t).filter((function(e){return!t[e].hidden}))),e.forEach((function(e){i[e]=this.getOption(e)}),this),i},setOption:function(e,t){var i;if(this["$"+e]!==t)return(i=this.$options[e])?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):a('misspelled option "'+e+'"')},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:a('misspelled option "'+e+'"')}});function a(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}c.prototype.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach((function(t){var n=i[t];(n="string"==typeof n?{forwardTo:n}:n).name||(n.name=t),"initialValue"in(e.$options[n.name]=n)&&(e["$"+n.name]=n.initialValue)})),o.implement(e,s),this},c.prototype.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var i=e.$options[t];"value"in i&&e.setOption(t,i.value)}))},c.prototype.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},c.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach((function(i){this.setDefaultValue(e,i,t[i])}),this)},c.prototype.setMessages=function(e){n=e},c.prototype.nls=function(e,t){return n&&!n[e]&&a("No message found for '"+e+"' in the provided messages, falling back to default English message."),e=n&&n[e]||e,t?e.replace(/\$(\$|[\d]+)/g,(function(e,i){return"$"==i?"$":t[i]})):e};var l=c;function c(){this.$defaultOptions={}}l.prototype.warn=a,l.prototype.reportError=e,o.implement(l.prototype,r),t.AppConfig=l})),ace.define("ace/theme/textmate-css",["require","exports","module"],(function(e,t,i){i.exports='.ace-tm .ace_gutter {\n  background: #f0f0f0;\n  color: #333;\n}\n\n.ace-tm .ace_print-margin {\n  width: 1px;\n  background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n    background-color: #6B72E6;\n}\n\n.ace-tm {\n  background-color: #FFFFFF;\n  color: black;\n}\n\n.ace-tm .ace_cursor {\n  color: black;\n}\n        \n.ace-tm .ace_invisible {\n  color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n  color: blue;\n}\n\n.ace-tm .ace_constant {\n  color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n  color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n  color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n  background-color: rgba(255, 0, 0, 0.1);\n  color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n  color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n  color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n  color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n  color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n  color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n  color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n  color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n  color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n  color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n  color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n  color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n  color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n  color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n  color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n  color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n  background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n  box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n  background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n  background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n  margin: -1px 0 0 -1px;\n  border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n  background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n    background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n  background: rgb(250, 250, 255);\n  border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n'})),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],(function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],(function(e,t,i){var n,o=e("./lib/lang"),r=e("./lib/net"),s=e("./lib/dom"),a=e("./lib/app_config").AppConfig,l=(i.exports=t=new a,{packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null}),c=(t.get=function(e){if(l.hasOwnProperty(e))return l[e];throw new Error("Unknown config key: "+e)},t.set=function(e,t){if(l.hasOwnProperty(e))l[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&s.useStrictCSP(t)},t.all=function(){return o.copyObject(l)},t.$modes={},t.moduleUrl=function(e,t){var i,n,o;return l.$moduleUrls[e]||(e=e.split("/"),i="snippets"==(t=t||e[e.length-2]||"")?"/":"-",n=e[e.length-1],"worker"==t&&"-"==i&&(o=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g"),n=n.replace(o,"")),(!n||n==t)&&1<e.length&&(n=e[e.length-2]),null==(o=l[t+"Path"])?o=l.basePath:"/"==i&&(t=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+i+n+this.get("suffix"))},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){n=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(i,o){function s(s){if(s&&!t.$loading[i])return o&&o(s);if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(o),!(1<t.$loading[i].length)){function a(){var o,r;r=function(e,n){n&&(t.$loaded[i]=n),t._emit("load.module",{name:i,module:n});var o=t.$loading[i];t.$loading[i]=null,o.forEach((function(e){e&&e(n)}))},"ace/theme/textmate"===(o=i)||"./theme/textmate"===o?r(null,e("./theme/textmate")):n?n(o,r):console.error("loader is not configured")}if(!t.get("packaged"))return a();r.loadScript(t.moduleUrl(i,l),a),c()}}var a,l;if(Array.isArray(i)&&(l=i[0],i=i[1]),t.dynamicModules[i])t.dynamicModules[i]().then((function(e){e.default?s(e.default):s(e)}));else{try{a=this.$require(i)}catch(a){}s(a||t.$loaded[i])}},t.$require=function(e){if("function"==typeof i.require)return i.require(e)},t.setModuleLoader=function(e,i){t.dynamicModules[e]=i},function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})});t.version="1.31.1"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var o=e("./config"),r=(o.setLoader((function(t,i){e([t],(function(e){i(null,e)}))})),function(){return this||"undefined"!=typeof window&&window}());function s(t){if(r&&r.document){o.set("packaged",t||e.packaged||n.packaged||r.define&&i.amdD.packaged);for(var s,a={},l="",c=(t=document.currentScript||document._currentScript)&&t.ownerDocument||document,h=(t&&t.src&&(l=t.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||""),c.getElementsByTagName("script")),d=0;d<h.length;d++){var u=h[d],p=u.src||u.getAttribute("src");if(p){for(var g=u.attributes,m=0,f=g.length;m<f;m++){var y=g[m];0===y.name.indexOf("data-ace-")&&(a[y.name.replace(/^data-ace-/,"").replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))]=y.value)}(u=p.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/))&&(l=u[1])}}for(s in l&&(a.base=a.base||l,a.packaged=!0),a.basePath=a.base,a.workerPath=a.workerPath||a.base,a.modePath=a.modePath||a.base,a.themePath=a.themePath||a.base,delete a.base,a)void 0!==a[s]&&o.set(s,a[s])}}n.exports=function(t){o.init=s,o.$require=e,t.require=e,t.define=i.amdD},s(!0)})),ace.define("ace/range",["require","exports","module"],(function(e,t,i){"use strict";o.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},o.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},o.prototype.contains=function(e,t){return 0==this.compare(e,t)},o.prototype.compareRange=function(e){var t=e.end;return e=e.start,1==(t=this.compare(t.row,t.column))?1==(t=this.compare(e.row,e.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(e.row,e.column))?-1:1==t?42:0},o.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},o.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},o.prototype.intersects=function(e){return-1==(e=this.compareRange(e))||0==e||1==e},o.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},o.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},o.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)},o.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)},o.prototype.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},o.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},o.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},o.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row!==e||t<=this.end.column?0:1:t<this.start.column?-1:t>this.end.column?1:0},o.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},o.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},o.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)},o.prototype.clipRows=function(e,t){var i,n;return this.end.row>t?i={row:t+1,column:0}:this.end.row<e&&(i={row:e,column:0}),this.start.row>t?n={row:t+1,column:0}:this.start.row<e&&(n={row:e,column:0}),o.fromPoints(n||this.start,i||this.end)},o.prototype.extend=function(e,t){var i,n,r=this.compare(e,t);return 0==r?this:(-1==r?i={row:e,column:t}:n={row:e,column:t},o.fromPoints(i||this.start,n||this.end))},o.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},o.prototype.isMultiLine=function(){return this.start.row!==this.end.row},o.prototype.clone=function(){return o.fromPoints(this.start,this.end)},o.prototype.collapseRows=function(){return 0==this.end.column?new o(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new o(this.start.row,0,this.end.row,0)},o.prototype.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start);return e=e.documentToScreenPosition(this.end),new o(t.row,t.column,e.row,e.column)},o.prototype.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t};var n=o;function o(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}}n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("./oop"),o=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.PRINTABLE_KEYS[173]="-",i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete;for(var o=["cmd","ctrl","alt","shift"],r=Math.pow(2,o.length);r--;)i.KEY_MODS[r]=o.filter((function(e){return r&i.KEY_MODS[e]})).join("-")+"-";return i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,o),(t.default=t).keyCodeToString=function(e){var t=o[e];return(t="string"!=typeof t?String.fromCharCode(e):t).toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){"use strict";var n,o=e("./keys"),r=e("./useragent"),s=null,a=0;function l(){if(null==n){n=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){n={passive:!1}}})}catch(e){}}return n}function c(e,t,i){this.elem=e,this.type=t,this.callback=i}function h(e){return(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}c.prototype.destroy=function(){p(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d,u=t.addListener=function(e,t,i,n){e.addEventListener(t,i,l()),n&&n.$toDestroy.push(new c(e,t,i))},p=t.removeListener=function(e,t,i){e.removeEventListener(t,i,l())};function g(e,t,i){var n=h(t);if(!r.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),s.altGr){if(!(3&~n))return;s.altGr=0}18!==i&&17!==i||(l="location"in t?t.location:t.keyLocation,17===i&&1===l?1==s[i]&&(a=t.timeStamp):18===i&&3===n&&2===l&&t.timeStamp-a<50&&(s.altGr=!0))}if(i in o.MODIFIER_KEYS&&(i=-1),!n&&13===i){var l="location"in t?t.location:t.keyLocation;if(3===l&&(e(t,n,-i),t.defaultPrevented))return}if(r.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in o.FUNCTION_KEYS||i in o.PRINTABLE_KEYS)&&e(t,n,i)}function m(){s=Object.create(null)}t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function o(e){t&&t(e),i&&i(e),p(n,"mousemove",t),p(n,"mouseup",o),p(n,"dragstart",o)}return u(n,"mousemove",t),u(n,"mouseup",o),u(n,"dragstart",o),o},t.addMouseWheelListener=function(e,t,i){u(e,"wheel",(function(e){var i=e.deltaX||0,n=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.15*i,e.wheelY=.15*n;break;case e.DOM_DELTA_LINE:e.wheelX=15*i,e.wheelY=15*n;break;case e.DOM_DELTA_PAGE:e.wheelX=150*i,e.wheelY=150*n}t(e)}),i)},t.addMultiMouseDownListener=function(e,i,n,o,s){var a,l,c,h=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(e){var s;if(0!==t.getButton(e)?h=0:1<e.detail&&!(4<++h)||(h=1),r.isIE&&(s=5<Math.abs(e.clientX-a)||5<Math.abs(e.clientY-l),c&&!s||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),i[h-1]||600),1==h)&&(a=e.clientX,l=e.clientY),e._clicks=h,n[o]("mousedown",e),4<h)h=0;else if(1<h)return n[o](d[h],e)}(e=Array.isArray(e)?e:[e]).forEach((function(e){u(e,"mousedown",p,s)}))},t.getModifierString=function(e){return o.KEY_MODS[h(e)]},t.addCommandKeyListener=function(e,i,n){var o,a;r.isOldGecko||r.isOpera&&!("KeyboardEvent"in window)?(o=null,u(e,"keydown",(function(e){o=e.keyCode}),n),u(e,"keypress",(function(e){return g(i,e,o)}),n)):(a=null,u(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=g(i,e,e.keyCode);return a=e.defaultPrevented,t}),n),u(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),n),u(e,"keyup",(function(e){s[e.keyCode]=null}),n),s||(m(),u(window,"focus",m)))},"object"==typeof window&&window.postMessage&&!r.isOldIE&&(d=1,t.nextTick=function(e,i){function n(r){r.data==o&&(t.stopPropagation(r),p(i,"message",n),e())}i=i||window;var o="zero-timeout-message-"+d++;u(i,"message",n),i.postMessage(o,"*")}),t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout((function i(){t.$idleBlocked?setTimeout(i,100):e()}),i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,i){"use strict";var n;i.exports={lineMode:!1,pasteCancelled:function(){return!!(n&&n>Date.now()-50)||(n=!1)},cancel:function(){n=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,i){"use strict";var n=e("../lib/event"),o=e("../config").nls,r=e("../lib/useragent"),s=e("../lib/dom"),a=e("../lib/lang"),l=e("../clipboard"),c=r.isChrome<18,h=r.isIE,d=63<r.isChrome,u=e("../lib/keys"),p=u.KEY_MODS,g=r.isIOS,m=g?/\s/:/\n/,f=r.isMobile;t.TextInput=function(e,t){var i=s.createElement("textarea"),y=(i.className="ace_text-input",i.setAttribute("wrap","off"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck",!1),i.style.opacity="0",e.insertBefore(i,e.firstChild),!1),v=!1,C=!1,I=!1,b="",A=(f||(i.style.fontSize="1px"),!1),w=!1,_="",x=0,S=0,k=0,T=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,R=0;try{var L=document.activeElement===i}catch(e){}function $(e,i){for(var n=i,o=1;o<=e-T&&o<2*R+1;o++)n+=t.session.getLine(e-o).length+1;return n}function P(e){D(e,!0)}function M(e){D(e,!1)}function B(e){var o=G(e);l.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),r.isIE&&setTimeout(N),n.preventDefault(e)):(i.value="",v=!0))}this.setNumberOfExtraLines=function(e){T=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,R=e<0?0:e},this.setAriaOptions=function(e){e.activeDescendant?(i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-autocomplete",e.inline?"both":"list"),i.setAttribute("aria-activedescendant",e.activeDescendant)):(i.setAttribute("aria-haspopup","false"),i.setAttribute("aria-autocomplete","both"),i.removeAttribute("aria-activedescendant")),e.role&&i.setAttribute("role",e.role),e.setLabel&&(i.setAttribute("aria-roledescription",o("editor")),t.session)&&(e=t.session.selection.cursor.row,i.setAttribute("aria-label",o("Cursor at row $0",[e+1])))},this.setAriaOptions({role:"textbox"}),n.addListener(i,"blur",(function(e){w||(t.onBlur(e),L=!1)}),t),n.addListener(i,"focus",(function(e){if(!w){if(L=!0,r.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),r.isEdge?setTimeout(N):N()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),b||d||"browser"==this.$focusScroll)return i.focus({preventScroll:!0});var e=i.style.top;i.style.position="fixed",i.style.top="0px";try{var n=0!=i.getBoundingClientRect().top}catch(e){return}var o=[];if(n)for(var r=i.parentElement;r&&1==r.nodeType;)o.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;i.focus({preventScroll:!0}),n&&o.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){i.style.position="","0px"==i.style.top&&(i.style.top=e)}),0)},this.blur=function(){i.blur()},this.isFocused=function(){return L},t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;"insertstring"!=n&&(n=n&&(e.docChanged||e.selectionChanged),C&&n&&(_=i.value="",j()),N())}));var N=g?function(e){var n;!L||y&&!e||I||((n="\n ab"+(e=e||"")+"cde fg\n")!=i.value&&(i.value=_=n),n=4+(e.length||(t.selection.isEmpty()?0:1)),4==x&&S==n||i.setSelectionRange(4,n),x=4,S=n)}:function(){if(!C&&!I&&(L||H)){C=!0;var e=0,n=0,o="";if(t.session){for(var r,s,a=(s=t.selection).getRange(),l=((s=s.cursor.row)===E+1?E=(T=E+1)+2*R:s===T-1?T=(E=T-1)-2*R:(s<T-1||E+1<s)&&(T=R<s?s-R:0,E=R<s?s+R:2*R),[]),c=T;c<=E;c++)l.push(t.session.getLine(c));o=l.join("\n"),e=$(a.start.row,a.start.column),n=$(a.end.row,a.end.column),a.start.row<T?(r=t.session.getLine(T-1),e=a.start.row<T-1?0:e,n+=r.length+1,o=r+"\n"+o):a.end.row>E?(r=t.session.getLine(E+1),n=a.end.row>E+1?r.length:a.end.column,n+=o.length+1,o=o+"\n"+r):f&&0<s&&(o="\n"+o,n+=1,e+=1),400<o.length&&(e<400&&n<400?o=o.slice(0,400):(o="\n",e==n?e=n=0:(e=0,n=1))),(a=o+"\n\n")!=_&&(i.value=_=a,x=S=a.length)}if(H&&(x=i.selectionStart,S=i.selectionEnd),S!=n||x!=e||i.selectionEnd!=S)try{i.setSelectionRange(e,n),x=e,S=n}catch(e){}C=!1}},W=(this.resetSelection=N,L&&t.onFocus(),function(e){return 0===e.selectionStart&&e.selectionEnd>=_.length&&e.value===_&&_&&e.selectionEnd!==S}),Z=null,H=(this.setInputHandler=function(e){Z=e},!(this.getInputHandler=function(){return Z})),O=function(e,n){if(H=H&&!1,v)return N(),e&&t.onPaste(e),v=!1,"";for(var o=i.selectionStart,s=i.selectionEnd,a=x,l=_.length-S,c=e,h=e.length-o,d=e.length-s,u=0;0<a&&_[u]==e[u];)u++,a--;for(c=c.slice(u),u=1;0<l&&_.length-u>x-1&&_[_.length-u]==e[e.length-u];)u++,l--;h-=u-1,d-=u-1;var p=c.length-u+1;return p<0&&(a=-p,p=0),c=c.slice(0,p),n||c||h||a||l||d?(p=!(I=!0),r.isAndroid&&". "==c&&(c="  ",p=!0),c&&!a&&!l&&!h&&!d||A?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:d}),I=!1,_=e,x=o,S=s,k=d,p?"\n":c):""},F=function(e){if(C)return V();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}e=i.value;var n=O(e,!0);(500<e.length||m.test(n)||f&&x<1&&x==S)&&N()},G=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!c){var o=h||i?"Text":"text/plain";try{return t?!1!==n.setData(o,t):n.getData(o)}catch(e){if(!i)return G(e,t,!0)}}},D=function(e,o){var r=t.getCopyText();if(!r)return n.preventDefault(e);G(e,r)?(g&&(N(r),y=r,setTimeout((function(){y=!1}),10)),o?t.onCut():t.onCopy(),n.preventDefault(e)):(y=!0,i.value=r,i.select(),setTimeout((function(){y=!1,N(),o?t.onCut():t.onCopy()})))},V=(n.addCommandKeyListener(i,t.onCommandKey.bind(t),t),n.addListener(i,"select",(function(e){C||(y?y=!1:W(i)?(t.selectAll(),N()):f&&i.selectionStart!=x&&N())}),t),n.addListener(i,"input",F,t),n.addListener(i,"cut",P,t),n.addListener(i,"copy",M,t),n.addListener(i,"paste",B,t),"oncut"in i&&"oncopy"in i&&"onpaste"in i||n.addListener(e,"keydown",(function(e){if((!r.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:M(e);break;case 86:B(e);break;case 88:P(e)}}),t),function(){var e;if(C&&t.onCompositionUpdate&&!t.$readOnly)return A?z():void(C.useTextareaForIME?t.onCompositionUpdate(i.value):(e=i.value,O(e),C.markerRange&&(C.context&&(C.markerRange.start.column=C.selectionStart=C.context.compositionStartOffset),C.markerRange.end.column=C.markerRange.start.column+S-C.selectionStart+k)))}),j=function(e){t.onCompositionEnd&&!t.$readOnly&&(C=!1,t.onCompositionEnd(),t.off("mousedown",z),e)&&F()};function z(){w=!0,i.blur(),i.focus(),w=!1}var K,X=a.delayedCall(V,50).schedule.bind(null,null);function Y(){clearTimeout(K),K=setTimeout((function(){b&&(i.style.cssText=b,b=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}function J(e){t.textInput.onContextMenu(e),Y()}if(n.addListener(i,"compositionstart",(function(e){C||!t.onCompositionStart||t.$readOnly||(C={},A)||(e.data&&(C.useTextareaForIME=!1),setTimeout(V,0),t._signal("compositionStart"),t.on("mousedown",z),(e=t.getSelectionRange()).end.row=e.start.row,e.end.column=e.start.column,C.markerRange=e,C.selectionStart=x,t.onCompositionStart(C),C.useTextareaForIME?(_=i.value="",S=x=0):(i.msGetInputContext&&(C.context=i.msGetInputContext()),i.getInputContext&&(C.context=i.getInputContext())))}),t),n.addListener(i,"compositionupdate",V,t),n.addListener(i,"keyup",(function(e){27==e.keyCode&&i.value.length<i.selectionStart&&(C||(_=i.value),x=S=-1,N()),X()}),t),n.addListener(i,"keydown",X,t),n.addListener(i,"compositionend",j,t),this.getElement=function(){return i},this.setCommandMode=function(e){A=e,i.readOnly=!1},this.setReadOnly=function(e){A||(i.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){H=!0,N(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){function a(e){s.translate(i,e.clientX-h-2,Math.min(e.clientY-c-2,d))}b=b||i.style.cssText,i.style.cssText=(o?"z-index:100000;":"")+(r.isIE?"opacity:0.1;":"")+"text-indent: -"+(x+S)*t.renderer.characterWidth*.5+"px;",o=t.container.getBoundingClientRect();var l=s.computedStyle(t.container),c=o.top+(parseInt(l.borderTopWidth)||0),h=o.left+(parseInt(o.borderLeftWidth)||0),d=o.bottom-c-i.clientHeight-2;a(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(K),r.isWin)&&n.capture(t.container,a,Y)},this.onContextMenuClose=Y,n.addListener(i,"mouseup",J,t),n.addListener(i,"mousedown",(function(e){e.preventDefault(),Y()}),t),n.addListener(t.renderer.scroller,"contextmenu",J,t),n.addListener(i,"contextmenu",J,t),g){var U=t,Q=i;function te(e){var t,i,n,o;document.activeElement!==Q||ee||C||U.$mouseHandler.isMousePressed||y||(t=Q.selectionStart,i=Q.selectionEnd,n=null,(o=0)==t?n=u.up:1==t?n=u.home:S<i&&"\n"==_[i]?n=u.end:t<x&&" "==_[t-1]?(n=u.left,o=p.option):t<x||t==x&&S!=x&&t==i?n=u.left:S<i&&2<_.slice(0,i).split("\n").length?n=u.down:S<i&&" "==_[i-1]?(n=u.right,o=p.option):(S<i||i==S&&S!=x&&t==i)&&(n=u.right),t!==i&&(o|=p.shift),n&&(!U.onCommandKey({},o,n)&&U.commands&&(n=u.keyCodeToString(n),o=U.commands.findKeyCommand(o,n))&&U.execCommand(o),x=t,S=i,N("")))}var q=null,ee=!1;Q.addEventListener("keydown",(function(e){q&&clearTimeout(q),ee=!0}),!0),Q.addEventListener("keyup",(function(e){q=setTimeout((function(){ee=!1}),100)}),!0),document.addEventListener("selectionchange",te),U.on("destroy",(function(){document.removeEventListener("selectionchange",te)}))}this.destroy=function(){i.parentElement&&i.parentElement.removeChild(i)}},t.$setUserAgentForTests=function(e,t){f=e,g=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/useragent");function o(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")}function r(e,t){return(e.start.row==e.end.row?2*t.column-e.start.column-e.end.column:e.start.row!=e.end.row-1||e.start.column||e.end.column?2*t.row-e.start.row-e.end.row:t.column-4)<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}o.prototype.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition(),o=(this.mousedownEvent=e,this.editor),r=e.getButton();if(0!==r)!o.getSelectionRange().isEmpty()&&1!=r||o.selection.moveToPosition(i),2==r&&(o.textInput.onContextMenu(e.domEvent),n.isMozilla||e.preventDefault());else{if(this.mousedownEvent.time=Date.now(),!t||o.isFocused()||(o.focus(),!this.$focusTimeout)||this.$clickSelection||o.inMultiSelectMode)return this.captureMouse(e),this.startSelect(i,1<e.domEvent._clicks),e.preventDefault();this.setState("focusWait"),this.captureMouse(e)}},o.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);this.$clickSelection&&(e=-1==(e=this.$clickSelection.comparePoint(i))?this.$clickSelection.end:1==e?this.$clickSelection.start:(i=(e=r(this.$clickSelection,i)).cursor,e.anchor),t.selection.setSelectionAnchor(e.row,e.column)),t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(e){var t,i,n,o=this.editor,s=o.renderer.screenToTextCoordinates(this.x,this.y);e=o.selection[e](s.row,s.column),this.$clickSelection&&(i=this.$clickSelection.comparePoint(e.start),t=this.$clickSelection.comparePoint(e.end),-1==i&&t<=0?(n=this.$clickSelection.end,e.end.row==s.row&&e.end.column==s.column||(s=e.start)):1==t&&0<=i?(n=this.$clickSelection.start,e.start.row==s.row&&e.start.column==s.column||(s=e.end)):n=-1==i&&1==t?(s=e.end,e.start):(s=(i=r(this.$clickSelection,s)).cursor,i.anchor),o.selection.setSelectionAnchor(n.row,n.column)),o.selection.selectToPosition(s),o.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){n=this.mousedownEvent.x,e=this.mousedownEvent.y,i=this.x,t=this.y;var e,t,i=Math.sqrt(Math.pow(i-n,2)+Math.pow(t-e,2)),n=Date.now();(0<i||n-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(e){e=e.getDocumentPosition();var t=this.editor,i=t.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=t.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},o.prototype.onTripleClick=function(e){e=e.getDocumentPosition();var t=this.editor,i=(this.setState("selectByLines"),t.getSelectionRange());i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(i.start.row),this.$clickSelection.end=t.selection.getLineRange(i.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},o.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(e){var t,i,n,o,r,s,a;if(!e.getAccelKey())return e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0),t=this.editor,this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0}),i=this.$lastScroll,o=(a=(n=e.domEvent.timeStamp)-i.t)?e.wheelX/a:i.vx,r=a?e.wheelY/a:i.vy,a<550&&(o=(o+i.vx)/2,r=(r+i.vy)/2),a=!1,1<=(s=Math.abs(o/r))&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(a=!0),(a=!!(s<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed))||a)?i.allowed=n:n-i.allowed<550&&(Math.abs(o)<=1.5*Math.abs(i.vx)&&Math.abs(r)<=1.5*Math.abs(i.vy)?(a=!0,i.allowed=n):i.allowed=0),i.t=n,i.vx=o,i.vy=r,a?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0},(e=o).prototype.selectEnd=e.prototype.selectByLinesEnd,e.prototype.selectAllEnd=e.prototype.selectByLinesEnd,e.prototype.selectByWordsEnd=e.prototype.selectByLinesEnd,t.DefaultHandlers=e})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/range"],(function(e,t,i){"use strict";var n,o=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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/dom"),a=e("./range").Range,l="ace_tooltip";function c(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}function h(){this.popups=[]}c.prototype.$init=function(){return this.$element=s.createElement("div"),this.$element.className=l,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},c.prototype.getElement=function(){return this.$element||this.$init()},c.prototype.setText=function(e){this.getElement().textContent=e},c.prototype.setHtml=function(e){this.getElement().innerHTML=e},c.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},c.prototype.setClassName=function(e){s.addCssClass(this.getElement(),e)},c.prototype.setTheme=function(e){this.$element.className=l+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},c.prototype.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},c.prototype.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=l,this.isOpen=!1)},c.prototype.getHeight=function(){return this.getElement().offsetHeight},c.prototype.getWidth=function(){return this.getElement().offsetWidth},c.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e=c,h.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},h.prototype.removePopup=function(e){-1!==(e=this.popups.indexOf(e))&&(this.popups.splice(e,1),this.updatePopups())},h.prototype.updatePopups=function(){this.popups.sort((function(e,t){return t.priority-e.priority}));var e,t,i,n,o=[];try{for(var s=r(this.popups),a=s.next();!a.done;a=s.next()){var l=a.value,c=!0;try{i=void 0;for(var h=r(o),d=h.next();!d.done;d=h.next()){var u=d.value;if(this.doPopupsOverlap(u,l)){c=!1;break}}}catch(t){i={error:t}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}c?o.push(l):l.hide()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}},h.prototype.doPopupsOverlap=function(e,t){return e=e.getElement().getBoundingClientRect(),t=t.getElement().getBoundingClientRect(),e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top};var d,u=new h;function p(e){void 0===e&&(e=document.body);var t=((e=d.call(this,e)||this).timeout=void 0,e.lastT=0,e.idleTime=350,e.lastEvent=void 0,e.onMouseOut=e.onMouseOut.bind(e),e.onMouseMove=e.onMouseMove.bind(e),e.waitForHover=e.waitForHover.bind(e),e.hide=e.hide.bind(e),e.getElement());return t.style.whiteSpace="pre-wrap",t.style.pointerEvents="auto",t.addEventListener("mouseout",e.onMouseOut),t.tabIndex=-1,t.addEventListener("blur",function(){t.contains(document.activeElement)||this.hide()}.bind(e)),e}t.popupManager=u,t.Tooltip=e,o(p,d=e),p.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},p.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)},p.prototype.onMouseMove=function(e,t){var i;this.lastEvent=e,this.lastT=Date.now(),t=t.$mouseHandler.isMousePressed,this.isOpen&&(i=this.lastEvent&&this.lastEvent.getDocumentPosition(),this.range&&this.range.contains(i.row,i.column)&&!t&&!this.isOutsideOfText(this.lastEvent)||this.hide()),this.timeout||t||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},p.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;10<this.idleTime-e?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},p.prototype.isOutsideOfText=function(e){var t=e.editor,i=e.getDocumentPosition(),n=t.session.getLine(i.row);return i.column==n.length&&(n=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),(e=t.session.documentToScreenPosition(i.row,i.column)).column!=n.column||e.row!=n.row)},p.prototype.setDataProvider=function(e){this.$gatherData=e},p.prototype.showForRange=function(e,t,i,n){var o,r;n&&n!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement()||(n=e.renderer,this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(n.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=a.fromPoints(t.start,t.end),(e=this.getElement()).innerHTML="",e.appendChild(i),e.style.display="block",i=n.textToScreenCoordinates(t.start.row,t.start.column),t=e.clientHeight,o=n.scroller.getBoundingClientRect(),r=!0,(r=!(i.pageY-t<0)&&r)?i.pageY-=t:i.pageY+=n.lineHeight,e.style.maxWidth=o.width-(i.pageX-o.left)+"px",this.setPosition(i.pageX,i.pageY))},p.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,"ace_highlight-marker","text")},p.prototype.hide=function(e){!e&&document.activeElement==this.getElement()||e&&e.target&&("keydown"!=e.type||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,u.removePopup(this)))},p.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("mousewheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},p.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("mousewheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},p.prototype.onMouseOut=function(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,!this.isOpen||!e.relatedTarget||e.relatedTarget==this.getElement()||e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains("ace_content")||this.hide()},o=p,t.HoverTooltip=o})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],(function(e,t,i){"use strict";var n,o=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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../lib/dom"),a=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GutterHandler=function(e){var t,i,n=e.editor,o=n.renderer.$gutterLayer,r=new d(n);function l(){t=t&&clearTimeout(t),r.isOpen&&(r.hideTooltip(),n.off("mousewheel",l))}function c(e){r.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(n.isFocused()&&0==t.getButton()&&"foldWidgets"!=(i=o.getRegion(t))){var i=t.getDocumentPosition().row,r=n.session.selection;if(t.getShiftKey())r.selectTo(i,0);else{if(2==t.domEvent.detail)return n.selectAll(),t.preventDefault();e.$clickSelection=n.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(a){var h=a.domEvent.target||a.domEvent.srcElement;if(s.hasCssClass(h,"ace_fold-widget"))return l();r.isOpen&&e.$tooltipFollowsMouse&&c(a),i=a,t=t||setTimeout((function(){if(t=null,i&&!e.isMousePressed){var s=i.getDocumentPosition().row;if(s==n.session.getLength()){var a=n.renderer.pixelToScreenCoordinates(0,i.y).row,h=i.$pos;if(a>n.session.documentToScreenRow(h.row,h.column))return void l()}r.showTooltip(s),r.isOpen&&(n.on("mousewheel",l),!e.$tooltipFollowsMouse&&(a=i.getGutterRow(),h=o.$lines.get(a))?(s=h.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),(a=r.getElement().style).left=s.right+"px",a.top=s.bottom+"px"):c(i))}else l()}),50)})),a.addListener(n.renderer.$gutter,"mouseout",(function(e){i=null,r.isOpen&&(t=t||setTimeout((function(){t=null,l()}),50))}),n),n.on("changeSession",l),n.on("input",l)},o(u,h=l),u.prototype.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();i<(e+=15)+o&&(e-=e+o-i),n<(t+=15)+r&&(t-=20+r),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(u,"annotationLabels",{get:function(){return{error:{singular:c("error"),plural:c("errors")},warning:{singular:c("warning"),plural:c("warnings")},info:{singular:c("information message"),plural:c("information messages")}}},enumerable:!1,configurable:!0}),u.prototype.showTooltip=function(e){var t=this.editor.renderer.$gutterLayer,i=t.$annotations[e],n=i?{text:Array.from(i.text),type:Array.from(i.type)}:{text:[],type:[]},o=t.session.getFoldLine(e);if(o&&t.$showFoldedAnnotations){for(var r,s={error:[],warning:[],info:[]},a=e+1;a<=o.end.row;a++)if(t.$annotations[a])for(var l=0;l<t.$annotations[a].text.length;l++){var c=t.$annotations[a].type[l];s[c].push(t.$annotations[a].text[l]),"error"===c?r="error_fold":"warning"===c&&(r="warning_fold")}"error_fold"!==r&&"warning_fold"!==r||(i="".concat(u.annotationsToSummaryString(s)," in folded code."),n.text.push(i),n.type.push(r))}if(0===n.text.length)return this.hide();var h={error:[],warning:[],info:[]},d=t.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";for(a=0;a<n.text.length;a++){var p="<span class='ace_".concat(n.type[a]," ").concat(d,"' aria-label='").concat(u.annotationLabels[n.type[a].replace("_fold","")].singular,"' role=img> </span> ").concat(n.text[a]);h[n.type[a].replace("_fold","")].push(p)}e=[].concat(h.error,h.warning,h.info).join("<br>"),this.setHtml(e),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},u.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},u.annotationsToSummaryString=function(e){var t,i,n=[];try{for(var o=r(["error","warning","info"]),s=o.next();!s.done;s=o.next()){var a,l=s.value;e[l].length&&(a=1===e[l].length?u.annotationLabels[l].singular:u.annotationLabels[l].plural,n.push("".concat(e[l].length," ").concat(a)))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return n.join(", ")};var h,d=u;function u(e){var t=h.call(this,e.container)||this;return t.editor=e,t}t.GutterTooltip=d})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/event"),o=e("../lib/useragent");function r(e,t){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}r.prototype.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},r.prototype.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},r.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},r.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},r.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)},r.prototype.inSelection=function(){var e,t;return null===this.$inSelection&&((e=this.editor.getSelectionRange()).isEmpty()?this.$inSelection=!1:(t=this.getDocumentPosition(),this.$inSelection=e.contains(t.row,t.column))),this.$inSelection},r.prototype.getButton=function(){return n.getButton(this.domEvent)},r.prototype.getShiftKey=function(){return this.domEvent.shiftKey},r.prototype.getAccelKey=function(){return o.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},t.MouseEvent=r})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/event"),r=e("../lib/useragent");function s(e){var t,i,s,l,c,h,d,u,p,g,m,f=e.editor,y=n.createElement("div"),v=(y.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",y.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),f.on("mousedown",this.onMouseDown.bind(e)),f.container),C=0;function I(){var e,t,n,o,r,l,c,d,u=h;n=h=f.renderer.screenToTextCoordinates(i,s),t=u,o=Date.now(),e=!t||n.row!=t.row,t=!t||n.column!=t.column,!g||e||t?(f.moveCursorToPosition(n),g=o,m={x:i,y:s}):5<a(m.x,m.y,i,s)?g=null:200<=o-g&&(f.renderer.scrollCursorIntoView(),g=null),e=h,t=u,n=Date.now(),o=f.renderer.layerConfig.lineHeight,u=f.renderer.layerConfig.characterWidth,r=f.renderer.scroller.getBoundingClientRect(),r={x:{left:i-r.left,right:r.right-i},y:{top:s-r.top,bottom:r.bottom-s}},l=Math.min(r.x.left,r.x.right),c=Math.min(r.y.top,r.y.bottom),d={row:e.row,column:e.column},l/u<=2&&(d.column+=r.x.left<r.x.right?-3:2),c/o<=1&&(d.row+=r.y.top<r.y.bottom?-1:1),l=e.row!=d.row,u=e.column!=d.column,c=!t||e.row!=t.row,l||u&&!c?p?200<=n-p&&f.renderer.scrollCursorIntoView(d):p=n:p=null}function b(){c=f.selection.toOrientedRange(),t=f.session.addMarker(c,"ace_selection",f.getSelectionStyle()),f.clearSelection(),f.isFocused()&&f.renderer.$cursorLayer.setBlinking(!1),clearInterval(l),I(),l=setInterval(I,20),C=0,o.addListener(document,"mousemove",_)}function A(){clearInterval(l),f.session.removeMarker(t),t=null,f.selection.fromOrientedRange(c),f.isFocused()&&!u&&f.$resetCursorStyle(),C=0,g=p=h=c=null,o.removeListener(document,"mousemove",_)}this.onDragStart=function(e){var t;if(this.cancelDrag||!v.draggable)return t=this,setTimeout((function(){t.startSelect(),t.captureMouse(e)}),0),e.preventDefault();c=f.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=f.getReadOnly()?"copy":"copyMove",f.container.appendChild(y),i.setDragImage&&i.setDragImage(y,0,0),setTimeout((function(){f.container.removeChild(y)})),i.clearData(),i.setData("Text",f.session.getTextRange()),u=!0,this.setState("drag")},this.onDragEnd=function(e){v.draggable=!1,u=!1,this.setState(null),f.getReadOnly()||(e=e.dataTransfer.dropEffect,d||"move"!=e||f.session.remove(f.getSelectionRange()),f.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!f.getReadOnly()&&x(e.dataTransfer))return i=e.clientX,s=e.clientY,t||b(),C++,e.dataTransfer.dropEffect=d=S(e),o.preventDefault(e)},this.onDragOver=function(e){if(!f.getReadOnly()&&x(e.dataTransfer))return i=e.clientX,s=e.clientY,t||(b(),C++),null!==w&&(w=null),e.dataTransfer.dropEffect=d=S(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--C<=0&&t)return A(),d=null,o.preventDefault(e)},this.onDrop=function(e){if(h){var t=e.dataTransfer;if(u)switch(d){case"move":c=c.contains(h.row,h.column)?{start:h,end:h}:f.moveText(c,h);break;case"copy":c=f.moveText(c,h,!0)}else t=t.getData("Text"),c={start:h,end:f.session.insert(h,t)},f.focus(),d=null;return A(),o.preventDefault(e)}},o.addListener(v,"dragstart",this.onDragStart.bind(e),f),o.addListener(v,"dragend",this.onDragEnd.bind(e),f),o.addListener(v,"dragenter",this.onDragEnter.bind(e),f),o.addListener(v,"dragover",this.onDragOver.bind(e),f),o.addListener(v,"dragleave",this.onDragLeave.bind(e),f),o.addListener(v,"drop",this.onDrop.bind(e),f);var w=null;function _(){null==w&&(w=setTimeout((function(){null!=w&&t&&A()}),20))}function x(e){return!(e=e.types)||Array.prototype.some.call(e,(function(e){return"text/plain"==e||"Text"==e}))}function S(e){var t=["copy","copymove","all","uninitialized"],i=r.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return i&&0<=t.indexOf(n)?o="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(n)?o="move":0<=t.indexOf(n)&&(o="copy"),o}}function a(e,t,i,n){return Math.sqrt(Math.pow(i-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,t=(e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging"),r.isWin?"default":"move");e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;r.isIE&&"dragReady"==this.state&&3<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop(),"dragWait"===this.state&&0<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){var t,i,n;this.$dragEnabled&&(this.mousedownEvent=e,t=this.editor,i=e.inSelection(),n=e.getButton(),1!==(e.domEvent.detail||1)||0!==n||!i||e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey())||(this.mousedownEvent.time=Date.now(),"unselectable"in(n=e.domEvent.target||e.domEvent.srcElement)&&(n.unselectable="on"),t.getDragDelay()?(r.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0))}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./mouse_event").MouseEvent,o=e("../lib/event"),r=e("../lib/dom");t.addTouchListeners=function(e,t){var i,s,a,l,c,h,d,u,p,g="scroll",m=0,f=0,y=0,v=0;function C(){function e(e){var o,s=e.target.getAttribute("action");"more"!=s&&n?("paste"==s?i.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(i?i.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),p.firstChild.style.display="none",n=!1,"openCommandPalette"!=s&&t.focus()):(n=!n,e=t.getCopyText(),o=t.session.getUndoManager().hasUndo(),p.replaceChild(r.buildDom(n?["span",!e&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],e&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],e&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],i&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],o&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),p.firstChild))}var i=window.navigator&&window.navigator.clipboard,n=!1;p=r.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){g="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),e(t)},onclick:e},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function I(){p||C();var e=t.selection.cursor,i=(e=t.renderer.textToScreenCoordinates(e.row,e.column),t.renderer.textToScreenCoordinates(0,0).pageX),n=t.renderer.scrollLeft,o=t.container.getBoundingClientRect();p.style.top=e.pageY-o.top-3+"px",e.pageX-o.left<o.width-70?(p.style.left="",p.style.right="10px"):(p.style.right="",p.style.left=i+n-o.left+"px"),p.style.display="",p.firstChild.style.display="none",t.on("input",b)}function b(e){p&&(p.style.display="none"),t.off("input",b)}function A(){c=null,clearTimeout(c);var e=t.selection.getRange(),i=e.contains(d.row,d.column);!e.isEmpty()&&i||(t.selection.moveToPosition(d),t.selection.selectWord()),g="wait",I()}o.addListener(e,"contextmenu",(function(e){u&&t.textInput.getElement().focus()}),t),o.addListener(e,"touchstart",(function(e){var o=e.touches;if(c||1<o.length)clearTimeout(c),c=null,a=-1,g="zoom";else{u=t.$mouseHandler.isMousePressed=!0;var r=t.renderer.layerConfig.lineHeight,h=t.renderer.layerConfig.lineHeight,p=e.timeStamp,C=(l=p,I=o[0]).clientX,I=I.clientY;if(Math.abs(i-C)+Math.abs(s-I)>r&&(a=-1),i=e.clientX=C,s=e.clientY=I,y=v=0,C=new n(e,t),d=C.getDocumentPosition(),p-a<500&&1==o.length&&!m)f++,e.preventDefault(),e.button=0,c=null,clearTimeout(c),t.selection.moveToPosition(d),(I=2<=f?t.selection.getLineRange(d.row):t.session.getBracketRange(d))&&!I.isEmpty()?t.selection.setRange(I):t.selection.selectWord(),g="wait";else{f=0,C=t.selection.cursor,o=t.selection.isEmpty()?C:t.selection.anchor,I=t.renderer.$cursorLayer.getPixelPosition(C,!0),C=t.renderer.$cursorLayer.getPixelPosition(o,!0),o=t.renderer.scroller.getBoundingClientRect();var b=t.renderer.layerConfig.offset,w=t.renderer.scrollLeft,_=function(e,t){return(e/=h)*e+(t=t/r-.75)*t};if(e.clientX<o.left)return void(g="zoom");I=_(e.clientX-o.left-I.left+w,e.clientY-o.top-I.top+b),_=_(e.clientX-o.left-C.left+w,e.clientY-o.top-C.top+b),I<3.5&&_<3.5&&(g=_<I?"cursor":"anchor"),g=_<3.5?"anchor":I<3.5?"cursor":"scroll",c=setTimeout(A,450)}a=p}}),t),o.addListener(e,"touchend",(function(e){u=t.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==g?(g="",m=0):(c?(t.selection.moveToPosition(d),m=0,I):"scroll"==g?(m+=60,h=setInterval((function(){m--<=0&&(clearInterval(h),h=null),Math.abs(y)<.01&&(y=0),Math.abs(v)<.01&&(v=0),m<20&&(y*=.9),m<20&&(v*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*y,10*v),e==t.session.getScrollTop()&&(m=0)}),10),b):I)(),clearTimeout(c),c=null}),t),o.addListener(e,"touchmove",(function(e){if(c&&(clearTimeout(c),c=null),!(1<(o=e.touches).length||"zoom"==g)){var o=o[0],r=i-o.clientX,a=s-o.clientY;if("wait"==g){if(!(4<r*r+a*a))return e.preventDefault();g="cursor"}i=o.clientX,s=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var h=(o=e.timeStamp)-l;l=o,"scroll"==g?((o=new n(e,t)).speed=1,o.wheelX=r,o.wheelY=a,10*Math.abs(r)<Math.abs(a)&&(r=0),10*Math.abs(a)<Math.abs(r)&&(a=0),0!=h&&(y=r/h,v=a/h),t._emit("mousewheel",o),o.propagationStopped||(y=v=0)):(r=new n(e,t).getDocumentPosition(),"cursor"==g?t.selection.moveCursorToPosition(r):"anchor"==g&&t.selection.setSelectionAnchor(r.row,r.column),t.renderer.scrollCursorIntoView(r),e.preventDefault())}}),t)}})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/event"),o=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("./touch_handler").addTouchListeners,h=(e=e("../config"),d.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new a(t,this.editor))},d.prototype.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new a(t,this.editor))},d.prototype.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},d.prototype.setState=function(e){this.state=e},d.prototype.captureMouse=function(e,t){function i(e){if(e){if(o.isWebKit&&!e.which&&h.releaseMouse)return h.releaseMouse();h.x=e.clientX,h.y=e.clientY,t&&t(e),h.mouseEvent=new a(e,h.editor),h.$mouseMoved=!0}}function r(e){l.off("beforeEndOperation",d),clearInterval(u),l.session&&s(),h[h.state+"End"]&&h[h.state+"End"](e),h.state="",h.isMousePressed=c.$isMousePressed=!1,c.$keepTextAreaAtCursor&&c.$moveTextAreaToCursor(),h.$onCaptureMouseMove=h.releaseMouse=null,e&&h.onMouseEvent("mouseup",e),l.endOperation()}function s(){h[h.state]&&h[h.state](),h.$mouseMoved=!1}this.x=e.x,this.y=e.y,this.isMousePressed=!0;var l=this.editor,c=this.editor.renderer,h=(c.$isMousePressed=!0,this);if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){r(e)}));var d=function(e){h.releaseMouse&&l.curOp.command.name&&l.curOp.selectionChanged&&(h[h.state+"End"]&&h[h.state+"End"](),h.state="",h.releaseMouse())},u=(l.on("beforeEndOperation",d),l.startOperation({command:{name:"mouse"}}),h.$onCaptureMouseMove=i,h.releaseMouse=n.capture(this.editor.container,i,r),setInterval(s,20))},d.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},d.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},d);function d(e){function t(t){document.hasFocus&&document.hasFocus()&&(e.isFocused()||document.activeElement!=(e.textInput&&e.textInput.getElement()))||window.focus(),e.focus(),setTimeout((function(){e.isFocused()||e.focus()}))}var i=this,a=(this.editor=e,new r(this),new s(this),new l(this),e.renderer.getMouseEventTarget()),h=(n.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),n.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),c(e.container,e),e.renderer.$gutter);n.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),n.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick"),e),n.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),n.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),n.addListener(a,"mousedown",t,e),n.addListener(h,"mousedown",t,e),o.isIE&&e.renderer.scrollBarV&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",t,e),n.addListener(e.renderer.scrollBarH.element,"mousedown",t,e)),e.on("mousemove",(function(t){var n,o;i.state||i.$dragDelay||!i.$dragEnabled||(t=e.renderer.screenToTextCoordinates(t.x,t.y),n=e.session.selection.getRange(),o=e.renderer,!n.isEmpty()&&n.insideStart(t.row,t.column)?o.setCursorStyle("default"):o.setCursorStyle(""))}),e)}h.prototype.releaseMouse=null,e.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=h})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom");t.FoldHandler=function(e){e.on("click",(function(t){var i=t.getDocumentPosition(),o=e.session;(i=o.getFoldAt(i.row,i.column,1))&&(t.getAccelKey()?o.removeFold(i):o.expandFold(i),t.stop()),(i=t.domEvent&&t.domEvent.target)&&n.hasCssClass(i,"ace_inline_button")&&n.hasCssClass(i,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){var i,n;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(i=t.getDocumentPosition().row,(n=e.session).foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop())})),e.on("gutterdblclick",(function(t){var i,n,o;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(o=t.getDocumentPosition().row,(n=(n=(i=e.session).getParentFoldRangeData(o,!0)).range||n.firstRange)&&(o=n.start.row,(o=i.getFoldAt(o,i.getLine(o).length,1))?i.removeFold(o):(i.addFold("...",n),e.renderer.scrollCursorIntoView({row:n.start.row,column:0}))),t.stop())}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,i){"use strict";var n=e("../lib/keys"),o=e("../lib/event");function r(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}r.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},r.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},r.prototype.addKeyboardHandler=function(e,t){var i;e&&("function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e),-1!=(i=this.$handlers.indexOf(e))&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i)&&e.attach&&e.attach(this.$editor)},r.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},r.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},r.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(i){return i.getStatusText&&i.getStatusText(t,e)||""})).filter(Boolean).join(" ")},r.prototype.$callKeyboardHandlers=function(e,t,i,n){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n))&&r.command&&((s="null"==r.command||a.exec(r.command,this.$editor,r.args,n))&&n&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&o.stopEvent(n),s)););return s||-1!=e||(r={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},r.prototype.onCommandKey=function(e,t,i){var o=n.keyCodeToString(i);return this.$callKeyboardHandlers(t,o,i,e)},r.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},t.KeyBinding=r})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,i){"use strict";var n=0,o=0,r=!1,s=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=0,d=1,u=2,p=3,g=4,m=5,f=6,y=7,v=8,C=9,I=10,b=11,A=12,w=13,_=14,x=15,S=16,k=17,T=18,E=[T,T,T,T,T,T,T,T,T,f,m,f,v,m,T,T,T,T,T,T,T,T,T,T,T,T,T,T,m,m,m,f,v,g,g,b,b,b,g,g,g,g,g,I,C,I,C,C,u,u,u,u,u,u,u,u,u,u,C,g,g,g,g,g,g,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,g,g,g,g,g,g,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,g,g,g,g,T,T,T,T,T,T,m,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,C,g,b,b,b,b,g,g,g,g,h,g,g,T,g,g,b,b,u,u,g,h,g,g,g,u,h,g,g,g,g,g],R=[v,v,v,v,v,v,v,v,v,v,v,T,T,T,h,d,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,v,m,w,_,x,S,k,C,b,b,b,b,b,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,C,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,v];function L(e,t,i,E){var R,L,$,M=n?c:l,B=0,N=-1,W=null,Z=null,H=[];if(!E)for(W=0,E=[];W<i;W++)E[W]=P(e[W]);for(o=n,a=s=r=!1,Z=0;Z<i;Z++){if($=B,H[Z]=R=function(e,t,i,o){var l,c,E,R=t[o];switch(R){case h:case d:r=!1;case g:case p:return R;case u:return r?p:u;case y:return r=!0,d;case v:return g;case C:return o<1||o+1>=t.length||(l=i[o-1])!=u&&l!=p||(L=t[o+1])!=u&&L!=p?g:(L=r?p:L)==l?L:g;case I:return(l=0<o?i[o-1]:m)==u&&o+1<t.length&&t[o+1]==u?u:g;case b:if(0<o&&i[o-1]==u)return u;if(r)return g;for(E=o+1,c=t.length;E<c&&t[E]==b;)E++;return E<c&&t[E]==u?u:g;case A:for(c=t.length,E=o+1;E<c&&t[E]==A;)E++;if(E<c){var L=1425<=(L=e[o])&&L<=2303||64286==L;if(l=t[E],L&&(l==d||l==y))return d}return o<1||(l=t[o-1])==m?g:i[o-1];case m:return s=!(r=!1),n;case f:return a=!0,g;case w:case _:case S:case k:case x:r=!1;case T:return g}}(e,E,H,Z),$=240&(B=M[$][R]),B&=15,t[Z]=L=M[B][5],0<$){if(16==$)for(W=N;W<Z;W++)t[W]=1;N=-1}if(M[B][6])-1==N&&(N=Z);else if(-1<N){for(W=N;W<Z;W++)t[W]=L;N=-1}E[Z]==m&&(t[Z]=0),o|=L}if(a)for(W=0;W<i;W++)if(E[W]==f){t[W]=n;for(var O=W-1;0<=O&&E[O]==v;O--)t[O]=n}}function $(e,t,i){if(!(o<e))if(1!=e||1!=n||s)for(var r,a,l,c,h=i.length,d=0;d<h;){if(t[d]>=e){for(r=d+1;r<h&&t[r]>=e;)r++;for(a=d,l=r-1;a<l;a++,l--)c=i[a],i[a]=i[l],i[l]=c;d=r}d++}else i.reverse()}function P(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?191<t?h:E[t]:5==i?/[\u0591-\u05f4]/.test(e)?d:h:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?p:1642==t?b:/[\u06f0-\u06f9]/.test(e)?u:y:32==i&&t<=8287?R[255&t]:254==i&&65136<=t?y:g}t.L=h,t.R=d,t.EN=u,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,i,o){if(e.length<2)return{};var r=e.split(""),s=new Array(r.length),a=new Array(r.length),l=[];n=o?1:0,L(r,l,r.length,i);for(var c=0;c<s.length;s[c]=c,c++);for($(2,l,s),$(1,l,s),c=0;c<s.length-1;c++)i[c]===p?l[c]=t.AN:l[c]===d&&(i[c]>y&&i[c]<w||i[c]===g||i[c]===T)?l[c]=t.ON_R:0<c&&"ل"===r[c-1]&&/\u0622|\u0623|\u0625|\u0627/.test(r[c])&&(l[c-1]=l[c]=t.R_H,c++);for(r[r.length-1]===t.DOT&&(l[r.length-1]=t.B),"‫"===r[0]&&(l[0]=t.RLE),c=0;c<s.length;c++)a[c]=l[s[c]];return{logicalFromVisual:s,bidiLevels:a}},t.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=P(e.charAt(n)),i||t[n]!=d&&t[n]!=y&&t[n]!=p||(i=!0);return i},t.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}})),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],(function(e,t,i){"use strict";var n=e("./lib/bidiutil"),o=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;function s(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=n,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())}s.prototype.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},s.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},s.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;return t.length&&0<=(t=this.session.$getRowCacheIndex(t,this.currentRow))?this.session.$docRowCache[t]:e},s.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},s.prototype.updateRowLine=function(e,t){var i,r=(e=void 0===e?this.getDocumentRow():e)===this.session.getLength()-1?this.EOF:this.EOL,s=(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,(!this.session.$useWrapMode||(e=this.session.$wrapData[e])&&(0<(t=void 0===t?this.getSplitIndex():t)&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=t<e.length?this.line.substring(e[t-1],e[t]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[t]),t==e.length))&&(this.line+=this.showInvisibles?r:n.DOT),this.session),a=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||s.isFullWidth(e.charCodeAt(0))?(i="\t"===e?s.getScreenTabSize(t+a):2,a+=i-1,o.stringRepeat(n.DOT,i)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},s.prototype.updateBidiMap=function(){var e=[];n.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},s.prototype.markAsDirty=function(){this.currentRow=null},s.prototype.updateCharacterWidths=function(e){var t;this.characterWidth!==e.$characterSize.width&&(this.fontMetrics=e,t=this.characterWidth=e.$characterSize.width,e=e.$measureCharWidth("ה"),this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t,this.charWidths[n.R]=this.charWidths[n.AN]=e,this.charWidths[n.R_H]=.45*e,this.charWidths[n.B]=this.charWidths[n.RLE]=0,this.currentRow=null)},s.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},s.prototype.setEolChar=function(e){this.EOL=e},s.prototype.setContentWidth=function(e){this.contentWidth=e},s.prototype.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},s.prototype.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},s.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=t<e?this.session.getOverwrite()?e:e-1:t,o=n.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[o]%2!=0&&o++;for(var a=0;a<o;a++)s+=this.charWidths[r[a]];return!this.session.getOverwrite()&&t<e&&r[o]%2==0&&(s+=this.charWidths[r[o]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},s.prototype.getSelections=function(e,t){var i,n=this.bidiMap,o=n.bidiLevels,r=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,h=!1,d=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var u,p=0;p<o.length;p++)u=n.logicalFromVisual[p],i=o[p],(c=a<=u&&u<l)&&!h?d=s:!c&&h&&r.push({left:d,width:s-d}),s+=this.charWidths[i],h=c;if(c&&p===o.length&&r.push({left:d,width:s-d}),this.isRtlDir)for(var g=0;g<r.length;g++)r[g].left+=this.rtlLineOffset;return r},s.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,i=(e=Math.max(e,0),0),n=0,o=this.bidiMap.bidiLevels,r=this.charWidths[o[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i+r/2<e;){if(i+=r,n===o.length-1){r=0;break}r=this.charWidths[o[++n]]}return 0===(t=0<n&&o[n-1]%2!=0&&o[n]%2==0?(e<i&&n--,this.bidiMap.logicalFromVisual[n]):0<n&&o[n-1]%2==0&&o[n]%2!=0?1+(i<e?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===o.length-1&&0===r&&o[n-1]%2==0||!this.isRtlDir&&0===n&&o[n]%2!=0?1+this.bidiMap.logicalFromVisual[n]:(0<n&&o[n-1]%2!=0&&0!==r&&n--,this.bidiMap.logicalFromVisual[n]))&&this.isRtlDir&&t++,t+this.wrapIndent},t.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range;function a(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")}))}a.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},a.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},a.prototype.getCursor=function(){return this.lead.getPosition()},a.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},a.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},a.prototype.getSelectionLead=function(){return this.lead.getPosition()},a.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},a.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},a.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},a.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},a.prototype.setRange=function(e,t){var i=t?e.end:e.start;t=t?e.start:e.end,this.$setSelection(i.row,i.column,t.row,t.column)},a.prototype.$setSelection=function(e,t,i,n){var o,r;!this.$silent&&(o=this.$isEmpty,r=this.inMultiSelectMode,this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||r)&&this._emit("changeSelection")},a.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},a.prototype.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},a.prototype.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},a.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},a.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},a.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},a.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},a.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},a.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},a.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},a.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},a.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},a.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},a.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},a.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},a.prototype.getWordRange=function(e,t){var i;return void 0===t&&(e=(i=e||this.lead).row,t=i.column),this.session.getWordRange(e,t)},a.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},a.prototype.selectAWord=function(){var e=this.getCursor();e=this.session.getAWordRange(e.row,e.column),this.setSelectionRange(e)},a.prototype.getLineRange=function(e,t){e="number"==typeof e?e:this.lead.row;var i=(i=this.session.getFoldLine(e))?(e=i.start.row,i.end.row):e;return!0===t?new s(e,0,i,this.session.getLine(i).length):new s(e,0,i+1,0)},a.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},a.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},a.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},a.prototype.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,o=e.column+t;return i<0&&(n=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,o).split(" ").length-1==t},a.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,-1))?this.moveCursorTo(e.start.row,e.start.column):0===t.column?0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length):(e=this.session.getTabSize(),this.wouldMoveIntoSoftTab(t,e,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-e):this.moveCursorBy(0,-1))},a.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,1))?this.moveCursorTo(e.end.row,e.end.column):this.lead.column==this.doc.getLine(this.lead.row).length?this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0):(e=this.session.getTabSize(),t=this.lead,this.wouldMoveIntoSoftTab(t,e,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,e):this.moveCursorBy(0,1))},a.prototype.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t);i=this.session.screenToDocumentPosition(i,0),(e=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/))[0].length==t||this.session.$useEmacsStyleLineStart||(i.column+=e[0].length),this.moveCursorToPosition(i)},a.prototype.moveCursorLineEnd=function(){var e,t=this.lead;t=this.session.getDocumentLastRowColumnPosition(t.row,t.column),this.lead.column==t.column&&(e=this.session.getLine(t.row),t.column==e.length)&&0<(e=e.search(/\s+$/))&&(t.column=e),this.moveCursorTo(t.row,t.column)},a.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},a.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},a.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),o=(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.getFoldAt(e,t,1));o?this.moveCursorTo(o.end.row,o.end.column):(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length?(this.moveCursorTo(e,i.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight()):(this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)))},a.prototype.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;(e=this.session.getFoldAt(t,i,-1))?this.moveCursorTo(e.start.row,e.start.column):(null==(e=this.session.getFoldStringAt(t,i,-1))&&(e=this.doc.getLine(t).substring(0,i)),e=o.stringReverse(e),this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(e)&&(i-=this.session.nonTokenRe.lastIndex,e=e.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0?(this.moveCursorTo(t,0),this.moveCursorLeft(),0<t&&this.moveCursorWordLeft()):(this.session.tokenRe.exec(e)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)))},a.prototype.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(o.lastIndex=0;(t=e[i])&&!o.test(t);)if(o.lastIndex=0,i++,n.test(t)){if(2<i){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(2<i)break}}return o.lastIndex=0,i},a.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==i.length){for(var r=this.doc.getLength();n=this.doc.getLine(++e),e<r&&/^\s*$/.test(n););/^\s+/.test(n)||(n=""),t=0}o=this.$shortWordEndIndex(n),this.moveCursorTo(e,t+o)},a.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var i=this.session.getLine(e).substring(0,t);if(0===t){for(;i=this.doc.getLine(--e),0<e&&/^\s*$/.test(i););t=i.length,/\s+$/.test(i)||(i="")}var n=o.stringReverse(i);return n=this.$shortWordEndIndex(n),this.moveCursorTo(e,t-n)},a.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},a.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},a.prototype.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),o=(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=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]&&(o=this.session.lineWidgets[this.lead.row],e<0?e-=o.rowsAbove||0:0<e&&(e+=o.rowCount-(o.rowsAbove||0))),this.session.screenToDocumentPosition(n.row+e,n.column,i));0!==e&&0===t&&o.row===this.lead.row&&(o.column,this.lead.column),this.moveCursorTo(o.row,o.column+t,0===t)},a.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},a.prototype.moveCursorTo=function(e,t,i){var n=((n=this.session.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.session.getLine(e));/[\uDC00-\uDFFF]/.test(n.charAt(t))&&n.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},a.prototype.moveCursorToScreen=function(e,t,i){e=this.session.screenToDocumentPosition(e,t),this.moveCursorTo(e.row,e.column,i)},a.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},a.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},a.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},a.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return s.fromPoints(t,i)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},a.prototype.toJSON=function(){var e;return this.rangeCount?e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t})):(e=this.getRange()).isBackwards=this.isBackwards(),e},a.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&1<e.length){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},a.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=a).prototype.setSelectionAnchor=e.prototype.setAnchor,e.prototype.getSelectionAnchor=e.prototype.getAnchor,e.prototype.setSelectionRange=e.prototype.setRange,n.implement(e.prototype,r),t.Selection=e})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,i){"use strict";e=e("./lib/report_error").reportError;var n=2e3,o=(r.prototype.$setMaxTokenCount=function(e){n=0|e},r.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],o=0,r=i.length;o<r;o++)t[o]&&(n[n.length]={type:i[o],value:t[o]});return n},r.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,o=0,r=n.length;o<r;o++)t[o+1]&&(i[i.length]={type:n[o],value:t[o+1]});return i},r.prototype.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},r.prototype.createSplitterRegexp=function(e,t){var i,n,o;return"$"!=(e="^"!=(e=-1!=e.indexOf("(?=")&&(i=0,n=!1,o={},e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,r,s,a,l){return n?n="]"!=a:a?n=!0:s?(i==o.stack&&(o.end=l+1,o.stack=-1),i--):r&&(i++,1!=r.length)&&(o.stack=i,o.start=l),e})),null!=o.end)&&/^\)*$/.test(e.substr(o.end))?e.substring(0,o.start)+e.substr(o.end):e).charAt(0)?"^"+e:e).charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},r.prototype.getLineTokens=function(e,t){t&&"string"!=typeof t?"#tmp"===(t=(i=t.slice(0))[0])&&(i.shift(),t=i.shift()):i=[];for(var i,o,r=t||"start",s=(s=this.states[r])||this.states[r="start"],a=this.matchMappings[r],l=this.regExps[r],c=[],h=l.lastIndex=0,d=0,u={type:null,value:""};o=l.exec(e);){var p,g=a.defaultToken,m=null,f=o[0],y=l.lastIndex;y-f.length>h&&(p=e.substring(h,y-f.length),u.type==g?u.value+=p:(u.type&&c.push(u),u={type:g,value:p}));for(var v=0;v<o.length-2;v++)if(void 0!==o[v+1]){g=(m=s[a[v]]).onMatch?m.onMatch(f,r,i,e):m.token,m.next&&(r="string"==typeof m.next?m.next:m.next(r,i),(s=this.states[r])||(this.reportError("state doesn't exist",r),s=this.states[r="start"]),a=this.matchMappings[r],(l=this.regExps[r]).lastIndex=h=y),m.consumeLineEnd&&(h=y);break}if(f)if("string"==typeof g)m&&!1===m.merge||u.type!==g?(u.type&&c.push(u),u={type:g,value:f}):u.value+=f;else if(g)for(u.type&&c.push(u),u={type:null,value:""},v=0;v<g.length;v++)c.push(g[v]);if(h==e.length)break;if(h=y,d++>n){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)u.type&&c.push(u),u={value:e.substring(h,h+=500),type:"overflow"};r="start",i=[];break}}return u.type&&c.push(u),1<i.length&&i[0]!==r&&i.unshift("#tmp",r),{tokens:c,state:i.length?i:r}},r);function r(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<i.length;l++){var c,h,d=i[l];d.defaultToken&&(r.defaultToken=d.defaultToken),d.caseInsensitive&&-1===s.indexOf("i")&&(s+="i"),d.unicode&&-1===s.indexOf("u")&&(s+="u"),null==d.regex||(d.regex instanceof RegExp&&(d.regex=d.regex.toString().slice(1,-1)),c=d.regex,h=new RegExp("(?:("+c+")|(.))").exec("a").length-2,Array.isArray(d.token)?1==d.token.length||1==h?d.token=d.token[0]:h-1!=d.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:d,groupCount:h-1}),d.token=d.token[0]):(d.tokenArray=d.token,d.token=null,d.onMatch=this.$arrayTokens):"function"!=typeof d.token||d.onMatch||(d.onMatch=1<h?this.$applyToken:d.token),1<h&&(c=/\\\d/.test(d.regex)?d.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(h=1,this.removeCapturingGroups(d.regex)),d.splitRegex||"string"==typeof d.token||a.push(d)),r[o]=l,o+=h,n.push(c),d.onMatch)||(d.onMatch=null)}n.length||(r[0]=0,n.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}}o.prototype.reportError=e,t.Tokenizer=o})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],(function(e,t,i){"use strict";function n(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}}var o=e("../lib/deep_copy").deepCopy;(function(){function e(e,t){return"start"==e&&!t.length||t.unshift(this.nextState,e),this.nextState}function t(e,t){return t.shift(),t.shift()||"start"}this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],o=0;o<n.length;o++){var r=n[o];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState)&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState)}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,n,r){if(e="function"==typeof e?(new e).getRules():e,n)for(var s=0;s<n.length;s++)n[s]=t+n[s];else for(var a in n=[],e)n.push(t+a);if(this.addRules(e,t),i){var l=Array.prototype[r?"push":"unshift"];for(s=0;s<n.length;s++)l.apply(this.$rules[n[s]],o(i))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds},this.normalizeRules=function(){var i=0,n=this.$rules;Object.keys(n).forEach((function o(r){var s=n[r];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null,h=(Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0),l.next||l.push);if(h&&Array.isArray(h)?((u=l.stateName)||("string"!=typeof(u=l.token)&&(u=u[0]||""),n[u]&&(u+=i++)),n[u]=h,o(l.next=u)):"pop"==h&&(l.next=t),l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)n[d]?n[d].push&&n[d].push.apply(n[d],l.rules[d]):n[d]=l.rules[d];var u="string"==typeof l?l:l.include;u&&("$self"===u&&(u="start"),c=Array.isArray(u)?u.map((function(e){return n[e]})):n[u]),c&&(h=[a,1].concat(c),l.noEscape&&(h=h.filter((function(e){return!e.next}))),s.splice.apply(s,h),a--),l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}),this)},this.createKeywordMapper=function(e,t,i,n){var o=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var r=e[t].split(n||"|"),s=r.length;s--;){var a=r[s];this.$keywordList.push(a),i&&(a=a.toLowerCase()),o[a]=t}}),this),e=null,i?function(e){return o[e.toLowerCase()]||t}:function(e){return o[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(n.prototype),t.TextHighlightRules=n})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,i){"use strict";function n(){this.$behaviours={}}(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){e=("function"==typeof e?new e:e).getBehaviours(t),this.addBehaviours(e)},this.getBehaviours=function(e){if(e){for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}return this.$behaviours}}).call(n.prototype),t.Behaviour=n})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("./range").Range;function o(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t),e=e.getTokenAt(t,i),this.$tokenIndex=e?e.index:-1}o.prototype.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},o.prototype.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=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]},o.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},o.prototype.getCurrentTokenRow=function(){return this.$row},o.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0===i)for(i=0;0<t;)i+=e[--t].value.length;return i},o.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},o.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)},t.TokenIterator=o})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,i){"use strict";function n(e){var t=-1;if((p=e.multiSelect&&(t=e.selection.index,p.rangeCount!=e.multiSelect.rangeCount)?{rangeCount:e.multiSelect.rangeCount}:p)[t])return s=p[t];s=p[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}}function o(e,t,i,n){var o=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}}function r(e){e=e||{},this.add("braces","insertion",(function(t,i,a,l,c){var d=a.getCursorPosition(),u=l.doc.getLine(d.row);if("{"==c)return n(a),g=a.getSelectionRange(),""!==(m=l.doc.getTextRange(g))&&"{"!==m&&a.getWrapBehavioursEnabled()?o(g,m,"{","}"):r.isSaneInsertion(a,l)?/[\]\}\)]/.test(u[d.column])||a.inMultiSelectMode||e.braces?(r.recordAutoInsert(a,l,"}"),{text:"{}",selection:[1,1]}):(r.recordMaybeInsert(a,l,"{"),{text:"{",selection:[1,1]}):void 0;if("}"==c){n(a);var p=u.substring(d.column,d.column+1);if("}"==p&&null!==l.$findOpeningBracket("}",{column:d.column+1,row:d.row})&&r.isAutoInsertedClosing(d,u,c))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==c||"\r\n"==c){n(a);var g="";if(r.isMaybeInsertedClosing(d,u)&&(g=h.stringRepeat("}",s.maybeInsertedBrackets),r.clearMaybeInsertedClosing()),"}"===(p=u.substring(d.column,d.column+1))){var m=l.findMatchingBracket({row:d.row,column:d.column+1},"}");if(!m)return null;var f=this.$getIndent(l.getLine(m.row))}else{if(!g)return void r.clearMaybeInsertedClosing();f=this.$getIndent(u)}return{text:"\n"+(c=f+l.getTabString())+"\n"+f+g,selection:[1,c.length,1,c.length]}}r.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,i,o,r){var a=o.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==a){if(n(i),"}"==o.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;s.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,i,s,a){if("("==a)return n(i),l=i.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&i.getWrapBehavioursEnabled()?o(l,c,"(",")"):r.isSaneInsertion(i,s)?(r.recordAutoInsert(i,s,")"),{text:"()",selection:[1,1]}):void 0;if(")"==a){n(i);var l=i.getCursorPosition(),c=s.doc.getLine(l.row);if(")"==(i=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&r.isAutoInsertedClosing(l,c,a))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,i,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"("==s&&(n(i),")"==o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("brackets","insertion",(function(e,t,i,s,a){if("["==a)return n(i),l=i.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&i.getWrapBehavioursEnabled()?o(l,c,"[","]"):r.isSaneInsertion(i,s)?(r.recordAutoInsert(i,s,"]"),{text:"[]",selection:[1,1]}):void 0;if("]"==a){n(i);var l=i.getCursorPosition(),c=s.doc.getLine(l.row);if("]"==(i=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&r.isAutoInsertedClosing(l,c,a))return r.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,i,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"["==s&&(n(i),"]"==o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)))return r.end.column++,r})),this.add("string_dquotes","insertion",(function(e,t,i,r,s){var a=r.$mode.$quotes||g;if(1==s.length&&a[s]&&(!this.lineCommentStart||-1==this.lineCommentStart.indexOf(s))){n(i);var l=i.getSelectionRange();if(!(""===(c=r.doc.getTextRange(l))||1==c.length&&a[c])&&i.getWrapBehavioursEnabled())return o(l,c,s,s);if(!c){a=i.getCursorPosition();var c=(l=r.doc.getLine(a.row)).substring(a.column-1,a.column),h=(i=l.substring(a.column,a.column+1),r.getTokenAt(a.row,a.column)),d=r.getTokenAt(a.row,a.column+1);if("\\"==c&&h&&/escape/.test(h.type))return null;h=h&&/string|escape/.test(h.type);var u,p=!d||/string|escape/.test(d.type);if(i==s)(u=h!==p)&&/string\.end/.test(d.type)&&(u=!1);else{if(h&&!p)return null;if(h&&p)return null;if((d=r.$mode.tokenRe).lastIndex=0,h=d.test(c),d.lastIndex=0,p=d.test(i),!((r=r.$mode.$pairQuotesAfter)&&r[s]&&r[s].test(c))&&h||p)return null;if(i&&!/[\s;,.})\]\\]/.test(i))return null;if(r=l[a.column-2],c==s&&(r==s||d.test(r)))return null;u=!0}return{text:u?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,i,o,r){var s=o.$mode.$quotes||g,a=o.doc.getTextRange(r);if(!r.isMultiLine()&&s.hasOwnProperty(a)&&(n(i),o.doc.getLine(r.start.row).substring(r.start.column+1,r.start.column+2)==a))return r.end.column++,r})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,i,n,o){var r;if("doc-start"===e&&("\n"===o||"\r\n"===o)&&i.selection.isEmpty())return e=i.getCursorPosition(),i=n.doc.getLine(e.row),n=n.doc.getLine(e.row+1),r=this.$getIndent(i),/\s*\*/.test(n)?/^\s*\*/.test(i)?{text:o+r+"* ",selection:[1,3+r.length,1,3+r.length]}:{text:o+r+" * ",selection:[1,3+r.length,1,3+r.length]}:/\/\*\*/.test(i.substring(0,e.column))?{text:o+r+" * "+o+" "+r+"*/",selection:[1,4+r.length,1,4+r.length]}:void 0}))}var s,a=e("../../lib/oop"),l=e("../behaviour").Behaviour,c=e("../../token_iterator").TokenIterator,h=e("../../lib/lang"),d=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],p={},g={'"':'"',"'":"'"};r.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new c(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",d)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return!0;if(e=new c(t,i.row,i.column+1),!this.$matchTokenType(e.getCurrentToken()||"text",d))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",u)},r.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},r.recordAutoInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isAutoInsertedClosing(e,t,s.autoInsertedLineEnd[0])||(s.autoInsertedBrackets=0),s.autoInsertedRow=e.row,s.autoInsertedLineEnd=i+t.substr(e.column),s.autoInsertedBrackets++},r.recordMaybeInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isMaybeInsertedClosing(e,t)||(s.maybeInsertedBrackets=0),s.maybeInsertedRow=e.row,s.maybeInsertedLineStart=t.substr(0,e.column)+i,s.maybeInsertedLineEnd=t.substr(e.column),s.maybeInsertedBrackets++},r.isAutoInsertedClosing=function(e,t,i){return 0<s.autoInsertedBrackets&&e.row===s.autoInsertedRow&&i===s.autoInsertedLineEnd[0]&&t.substr(e.column)===s.autoInsertedLineEnd},r.isMaybeInsertedClosing=function(e,t){return 0<s.maybeInsertedBrackets&&e.row===s.maybeInsertedRow&&t.substr(e.column)===s.maybeInsertedLineEnd&&t.substr(0,e.column)==s.maybeInsertedLineStart},r.popAutoInsertedClosing=function(){s.autoInsertedLineEnd=s.autoInsertedLineEnd.substr(1),s.autoInsertedBrackets--},r.clearMaybeInsertedClosing=function(){s&&(s.maybeInsertedBrackets=0,s.maybeInsertedRow=-1)},a.inherits(r,l),t.CstyleBehaviour=r})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,i){"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],o=0,r=[],s=0;s<n.length;s+=2)r.push(o+=n[s]),n[s+1]&&r.push(45,o+=n[s+1]);t.wordChars=String.fromCharCode.apply(null,r)})),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,i){"use strict";function n(){this.HighlightRules=s}var o=e("../config"),r=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("../unicode"),c=e("../lib/lang"),h=e("../token_iterator").TokenIterator,d=e("../range").Range;(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){var o=t.doc,r=!0,s=!0,a=1/0,l=t.getTabSize(),h=!1;if(this.lineCommentStart){f=Array.isArray(this.lineCommentStart)?(v=this.lineCommentStart.map(c.escapeRegExp).join("|"),this.lineCommentStart[0]):(v=c.escapeRegExp(this.lineCommentStart),this.lineCommentStart),v=new RegExp("^(\\s*)(?:"+v+") ?"),h=t.getUseSoftTabs();var d=function(e,t){var i,n,r=e.match(v);r&&(i=r[1].length,n=r[0].length,m(e,i,n)||" "!=r[0][n-1]||n--,o.removeInLine(t,i,n))},u=f+" ",p=function(e,t){r&&!/\S/.test(e)||(m(e,a,a)?o.insertInLine({row:t,column:a},u):o.insertInLine({row:t,column:a},f))},g=function(e,t){return v.test(e)},m=function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%l!=0)return!1;for(n=0;" "==e.charAt(i++);)n++;return 2<l?n%l!=l-1:n%l==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,y=this.blockComment.end,v=new RegExp("^(\\s*)(?:"+c.escapeRegExp(f)+")"),C=new RegExp("(?:"+c.escapeRegExp(y)+")\\s*$");p=function(e,t){g(e,t)||r&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},y),o.insertInLine({row:t,column:a},f))},d=function(e,t){var i;(i=e.match(C))&&o.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(v))&&o.removeInLine(t,i[1].length,i[0].length)},g=function(e,i){if(v.test(e))return!0;for(var n=t.getTokens(i),o=0;o<n.length;o++)if("comment"===n[o].type)return!0}}function I(e){for(var t=i;t<=n;t++)e(o.getLine(t),t)}var b=1/0;I((function(e,t){var i=e.search(/\S/);-1!==i?(i<a&&(a=i),s&&!g(e,t)&&(s=!1)):b>e.length&&(b=e.length)})),a==1/0&&(a=b,s=r=!1),h&&a%l!=0&&(a=Math.floor(a/l)*l),I(s?d:p)},this.toggleBlockComment=function(e,t,i,n){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,a=(g=new h(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(o.start))){var c=g.getCurrentTokenRow(),u=g.getCurrentTokenColumn()+m,p=new d(c,u,c,u+o.start.length);break}a=g.stepBackward()}var g,m;for(a=(g=new h(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(o.end))){c=g.getCurrentTokenRow(),u=g.getCurrentTokenColumn()+m;var f=new d(c,u,c,u+o.end.length);break}a=g.stepForward()}f&&t.remove(f),p&&(t.remove(p),r=p.start.row,s=-o.start.length)}else s=o.start.length,r=i.start.row,t.insert(i.end,o.end),t.insert(i.start,o.start);l.start.row==r&&(l.start.column+=s),l.end.row==r&&(l.end.column+=s),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e){var i,n,r;e[t]&&(n=(i=e[t]).prototype.$id,(r=o.$modes[n])||(o.$modes[n]=r=new i),o.$modes[t]||(o.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r)}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<s.length;t++)!function(e){var i=s[t],n=e[i];e[s[t]]=function(){return this.$delegator(i,arguments,n)}}(this)},this.$delegator=function(e,t,i){var n=t[0]||"start";if("string"!=typeof n){if(Array.isArray(n[2])){var o=n[2][n[2].length-1];if(s=this.$modes[o])return s[e].apply(s,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var s,a=n.split(this.$embeds[r]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[r]])[e].apply(s,t)}return o=i.apply(this,t),i?o:void 0},this.transformAction=function(e,t,i,n,o){if(this.$behaviour){var r,s=this.$behaviour.getBehaviours();for(r in s)if(s[r][t]){var a=s[r][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(s in t)for(var n=t[s],o=0,r=n.length;o<r;o++)if("string"==typeof n[o].token)/keyword|support|storage/.test(n[o].token)&&i.push(n[o].regex);else if("object"==typeof n[o].token)for(var s,a=0,l=n[o].token.length;a<l;a++)/keyword|support|storage/.test(n[o].token[a])&&(s=n[o].regex.match(/\(.+?\)/g)[a],i.push(s.substr(1,s.length-2)));this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map((function(e){return{name:e,value:e,score:0,meta:"keyword"}}))},this.$id="ace/mode/text"}).call(n.prototype),t.Mode=n})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,i){"use strict";t.applyDelta=function(e,t,i){var n=t.start.row,o=t.start.column,r=e[n]||"";switch(t.action){case"insert":1===t.lines.length?e[n]=r.substring(0,o)+t.lines[0]+r.substring(o):(s=[n,1].concat(t.lines),e.splice.apply(e,s),e[n]=r.substring(0,o)+e[n],e[n+t.lines.length-1]+=r.substring(o));break;case"remove":var s=t.end.column,a=t.end.row;n===a?e[n]=r.substring(0,o)+r.substring(s):e.splice(n,a-n+1,r.substring(0,o)+e[a].substring(s))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=(e=e("./lib/event_emitter").EventEmitter,r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(e){e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row||(e=function(e,t,i){var n=((a="insert"==e.action)?1:-1)*(e.end.row-e.start.row),o=(a?1:-1)*(e.end.column-e.start.column),r=e.start,a=a?r:e.end;return s(t,r,i)?{row:t.row,column:t.column}:s(a,t,!i)?{row:t.row+n,column:t.column+(t.row==a.row?o:0)}:{row:r.row,column:r.column}}(e,{row:this.row,column:this.column},this.$insertRight),this.setPosition(e.row,e.column,!0))},r.prototype.setPosition=function(e,t,i){i=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row==i.row&&this.column==i.column||(e={row:this.row,column:this.column},this.row=i.row,this.column=i.column,this._signal("change",{old:e,value:i}))},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i},r);function r(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)}function s(e,t,i){return i=i?e.column<=t.column:e.column<t.column,e.row<t.row||e.row==t.row&&i}o.prototype.$insertRight=!1,n.implement(o.prototype,e),t.Anchor=o})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor;function l(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}l.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},l.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},l.prototype.createAnchor=function(e,t){return new a(this,e,t)},l.prototype.$detectNewLine=function(e){e=e.match(/^.*?(\r\n|\r|\n)/m),this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},l.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},l.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},l.prototype.getNewLineMode=function(){return this.$newLineMode},l.prototype.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},l.prototype.getLine=function(e){return this.$lines[e]||""},l.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},l.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},l.prototype.getLength=function(){return this.$lines.length},l.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},l.prototype.getLinesForRange=function(e){var t,i;return e.start.row===e.end.row?t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]:((t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column),i=t.length-1,e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))),t},l.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},l.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},l.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},l.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},l.prototype.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column);return e=this.pos(e.row,e.column+t.length),this.applyDelta({start:i,end:e,action:"insert",lines:[t]},!0),this.clonePos(e)},l.prototype.clippedPos=function(e,t){var i=this.getLength();return void 0===e?e=i:e<0?e=0:i<=e&&(e=i-1,t=void 0),i=this.getLine(e),null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},l.prototype.clonePos=function(e){return{row:e.row,column:e.column}},l.prototype.pos=function(e,t){return{row:e,column:t}},l.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},l.prototype.insertFullLines=function(e,t){var i=0;i=(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),0):(t=[""].concat(t),this.$lines[--e].length),this.insertMergedLines({row:e,column:i},t)},l.prototype.insertMergedLines=function(e,t){var i={row:(e=this.clippedPos(e.row,e.column)).row+t.length-1,column:(1==t.length?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:i,action:"insert",lines:t}),this.clonePos(i)},l.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column);return e=this.clippedPos(e.end.row,e.end.column),this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},l.prototype.removeInLine=function(e,t,i){return t=this.clippedPos(e,t),e=this.clippedPos(e,i),this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})},!0),this.clonePos(t)},l.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&0<e,n=t<this.getLength()-1,o=i?e-1:e,r=(i=i?this.getLine(o).length:0,n?t+1:t);return n=n?0:this.getLine(r).length,o=new s(o,i,r,n),i=this.$lines.slice(e,t+1),this.applyDelta({start:o.start,end:o.end,action:"remove",lines:this.getLinesForRange(o)}),i},l.prototype.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},l.prototype.replace=function(e,t){return e instanceof s||(e=s.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)},l.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},l.prototype.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},l.prototype.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(i&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},l.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},l.prototype.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,o=e.start.row,r=e.start.column,s=0,a=0;s<n;s=a){a+=t-1;var l=i.slice(s,a);l.push(""),this.applyDelta({start:this.pos(o+s,r),end:this.pos(o+a,r=0),action:e.action,lines:l},!0)}e.lines=i.slice(s),e.start.row=o+s,e.start.column=r,this.applyDelta(e,!0)},l.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},l.prototype.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=t||0,r=i.length;o<r;o++)if((e-=i[o].length+n)<0)return{row:o,column:e+i[o].length+n};return{row:r-1,column:e+i[r-1].length+n}},l.prototype.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,i.length),s=t||0;s<r;++s)o+=i[s].length+n;return o+e.column},l.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},(e=l).prototype.$autoNewLine="",e.prototype.$newLineMode="auto",n.implement(e.prototype,r),t.Document=e})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=(e=e("./lib/event_emitter").EventEmitter,r.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},r.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},r.prototype.fireUpdateEvent=function(e,t){this._signal("update",{data:{first:e,last:t}})},r.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)},r.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},r.prototype.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.lines[t]=null:"remove"==e.action?(this.lines.splice(t,1+i,null),this.states.splice(t,1+i,null)):((e=Array(1+i)).unshift(t,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)),this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},r.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},r.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},r.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},r.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1];return t=this.tokenizer.getLineTokens(t,i,e),this.states[e]+""!=t.state+""?(this.states[e]=t.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=t.tokens},r.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},r);function r(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var i=this;this.$worker=function(){if(i.running){for(var e=new Date,t=i.currentLine,n=-1,o=i.doc,r=t;i.lines[t];)t++;var s=o.getLength(),a=0;for(i.running=!1;t<s;){for(i.$tokenizeRow(t),n=t;t++,i.lines[t];);if(++a%5==0&&20<new Date-e){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,r<=(n=-1==n?t:n)&&i.fireUpdateEvent(r,n)}}}n.implement(o.prototype,e),t.BackgroundTokenizer=o})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/lang"),o=e("./range").Range;function r(e,t,i){void 0===i&&(i="text"),this.setRegexp(e),this.clazz=t,this.type=i}r.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},r.prototype.update=function(e,t,i,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l={},c=s;c<=a;c++){var h=this.cache[c];null==h&&(h=(h=(h=n.getMatchOffsets(i.getLine(c),this.regExp)).length>this.MAX_RANGES?h.slice(0,this.MAX_RANGES):h).map((function(e){return new o(c,e.offset,c,e.offset+e.length)})),this.cache[c]=h.length?h:"");for(var d=h.length;d--;){var u=h[d].toScreenRange(i),p=u.toString();l[p]||(l[p]=!0,t.drawSingleLineMarker(e,u,this.clazz,r))}}},(e=r).prototype.MAX_RANGES=500,t.SearchHighlight=e})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,i){"use strict";o.prototype.addSession=function(e){this.$session=e},o.prototype.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],(t=this.$undoStack.length)>this.$undoDepth-1&&this.$undoStack.splice(0,t-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))},o.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},o.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},o.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var o=i[n][0];if(o.id<=e)break;o.id<t&&(o.ignore=!0)}this.lastDeltas=null},o.prototype.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var o=i[n];if(o.rev<e)return t?i[n+1]:o}},o.prototype.getRevision=function(){return this.$rev},o.prototype.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,o=0,r=i.length;r--;){var s=i[r][0];if(s.id<t&&!n&&(n=r+1),s.id<=e){o=r+1;break}}return i.slice(o,n)},o.prototype.getChangedRanges=function(e,t){null==t&&this.$rev},o.prototype.getChangedLines=function(e,t){null==t&&this.$rev},o.prototype.undo=function(e,t){this.lastDeltas=null;var i,n=this.$undoStack;if(function(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var o=function(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!h(e[i],t[n])){for(;i<e.length;){for(;n--;)h(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}(e[i],e[i+1]);e[i]=o[0],e[i+1]=o[1],i++}return 1}}}(n,n.length))return e=e||this.$session,this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0,i=null,(n=n.pop())&&(i=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,i},o.prototype.redo=function(e,t){if(this.lastDeltas=null,e=e||this.$session,this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){for(var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1),n=this.$redoStack,o=i,l=0;l<o.length;l++)for(var c=o[l],h=0;h<c.length;h++){g=void 0,m=void 0,f=void 0,y=void 0,v=void 0,C=void 0;var g=n,m=c[h];m=function(e){return{start:a(e.start),end:a(e.end),action:e.action,lines:e.lines.slice()}}(m);for(var f=g.length;f--;){for(var y=g[f],v=0;v<y.length;v++){var C=function(e,t){var i,n,o="insert"==e.action,a="insert"==t.action;if(o&&a)s(e.start,t.start)<0?d(t,e,1):d(e,t,1);else if(o&&!a)0<=s(e.start,t.end)?d(e,t,-1):(s(e.start,t.start)<=0||d(e,r.fromPoints(t.start,e.start),-1),d(t,e,1));else if(!o&&a)0<=s(t.start,e.end)?d(t,e,-1):(s(t.start,e.start)<=0||d(t,r.fromPoints(e.start,t.start),-1),d(e,t,1));else if(!o&&!a)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return s(e.start,t.start)<0&&(e=p(i=e,t.start)),0<s(e.end,t.end)&&(n=p(e,t.end)),u(t.end,e.start,e.end,-1),n&&!i&&(e.lines=n.lines,e.start=n.start,e.end=n.end,n=e),[t,i,n].filter(Boolean);d(e,t,-1)}return[t,e]}(y[v],m);m=C[0],2!=C.length&&(C[2]?(y.splice(v+1,1,C[1],C[2]),v++):C[1]||(y.splice(v,1),v--))}y.length||g.splice(f,1)}}this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var I=null;return(i=this.$redoStack.pop())&&(I=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,I},o.prototype.$syncRev=function(){var e=(e=(e=this.$undoStack)[e.length-1])&&e[0].id||0;this.$redoStackBaseRev=e,this.$rev=e},o.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},o.prototype.canUndo=function(){return 0<this.$undoStack.length},o.prototype.canRedo=function(){return 0<this.$redoStack.length},o.prototype.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},o.prototype.isAtBookmark=function(){return this.$rev===this.mark},o.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},o.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},o.prototype.$prettyPrint=function(e){return e?l(e):l(this.$undoStack)+"\n---\n"+l(this.$redoStack)};var n=o;function o(){this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}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 r=e("./range").Range,s=r.comparePoints;function a(e){return{row:e.row,column:e.column}}function l(e){var t;return e=e||this,Array.isArray(e)?e.map(l).join("\n"):(t="",e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(c).join("\n"):c(e.value)),e.start&&(t+=c(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t)}function c(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function h(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.start,e.start)<=0))return;d(e,t,1)}else if(i&&!n)if(0<=s(t.start,e.end))d(t,e,-1);else{if(!(s(t.end,e.start)<=0))return;d(e,t,-1)}else if(!i&&n)if(0<=s(t.start,e.start))d(t,e,1);else{if(!(s(t.start,e.start)<=0))return;d(e,t,1)}else if(!i&&!n)if(0<=s(t.start,e.start))d(t,e,1);else{if(!(s(t.end,e.start)<=0))return;d(e,t,-1)}return 1}function d(e,t,i){u(e.start,t.start,t.end,i),u(e.end,t.start,t.end,i)}function u(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function p(e,t){var i=e.lines,n=e.end,o=(e.end=a(t),e.end.row-e.start.row),r=i.splice(o,i.length);return o=o?t.column:t.column-e.start.column,i.push(r[0].substring(0,o)),r[0]=r[0].substr(o),{start:a(t),end:n,lines:r,action:e.action}}r.comparePoints,t.UndoManager=n})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("../range").Range;function o(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t],e=t[t.length-1],this.range=new n(t[0].start.row,t[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}o.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},o.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),0<this.range.compareEnd(e.start.row,e.start.column)?(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},o.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},o.prototype.walk=function(e,t,i){var n,o,r=0,s=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l<s.length;l++){if(-1==(o=(n=s[l]).range.compareStart(t,i)))return void e(null,t,i,r,a);if(!e(null,n.start.row,n.start.column,r,a)&&e(n.placeholder,n.start.row,n.start.column,r)||0===o)return;a=!n.sameRow,r=n.end.column}e(null,t,i,r,a)},o.prototype.getNextFoldTo=function(e,t){for(var i,n,o=0;o<this.folds.length;o++){if(-1==(n=(i=this.folds[o]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},o.prototype.addRemoveChars=function(e,t,i){var n,o=this.getNextFoldTo(e,t);if(o)if(n=o.fold,"inside"==o.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var r,s=(r=this.folds).indexOf(n);for(0===s&&(this.start.column+=i);s<r.length;s++){if((n=r[s]).start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},o.prototype.split=function(e,t){var i,n;return(e=this.getNextFoldTo(e,t))&&"inside"!=e.kind?(t=e.fold,e=this.folds,i=this.foldData,t=e.indexOf(t),n=e[t-1],this.end.row=n.end.row,this.end.column=n.end.column,n=new o(i,e=e.splice(t,e.length-t)),i.splice(i.indexOf(this)+1,0,n),n):null},o.prototype.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.indexOf(e),1)},o.prototype.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push("  "+t.toString())})),e.push("]"),e.join("\n")},o.prototype.idxToPosition=function(e){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}},t.FoldLine=o})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("./range").Range.comparePoints;function o(){this.ranges=[],this.$bias=1}o.prototype.pointIndex=function(e,t,i){for(var o=this.ranges,r=i||0;r<o.length;r++){var s=o[r],a=n(e,s.end);if(!(0<a))return s=n(e,s.start),0===a?t&&0!==s?-r-2:r:0<s||0===s&&!t?r:-r-1}return-r-1},o.prototype.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);return(t=this.pointIndex(e.end,t,i=i<0?-i-1:i))<0?t=-t-1:t++,this.ranges.splice(i,t-i,e)},o.prototype.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},o.prototype.substractPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges.splice(e,1)},o.prototype.merge=function(){for(var e=[],t=this.ranges,i=(t=t.sort((function(e,t){return n(e.start,t.start)})))[0],o=1;o<t.length;o++){var r=i,s=(i=t[o],n(r.end,i.start));s<0||(0!=s||r.isEmpty()||i.isEmpty())&&(n(r.end,i.end)<0&&(r.end.row=i.end.row,r.end.column=i.end.column),t.splice(o,1),e.push(i),i=r,o--)}return this.ranges=t,e},o.prototype.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},o.prototype.containsPoint=function(e){return 0<=this.pointIndex(e)},o.prototype.rangeAtPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges[e]},o.prototype.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];e=this.pointIndex({row:e,column:0});for(var n=this.pointIndex({row:t,column:0},e=e<0?-e-1:e),o=(n<0&&(n=-n-1),[]),r=e;r<n;r++)o.push(i[r]);return o},o.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},o.prototype.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},o.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},o.prototype.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,o=i.row,r=this.ranges,s=0,a=r.length;s<a&&!((l=r[s]).end.row>=n);s++);var l;if("insert"==e.action)for(var c=o-n,h=-t.column+i.column;s<a&&!((l=r[s]).start.row>n);s++)l.start.row==n&&l.start.column>=t.column&&(l.start.column==t.column&&this.$bias<=0||(l.start.column+=h,l.start.row+=c)),l.end.row==n&&l.end.column>=t.column&&(l.end.column==t.column&&this.$bias<0||(l.end.column==t.column&&0<h&&s<a-1&&l.end.column>l.start.column&&l.end.column==r[s+1].start.column&&(l.end.column-=h),l.end.column+=h,l.end.row+=c));else for(c=n-o,h=t.column-i.column;s<a&&!((l=r[s]).start.row>o);s++)l.end.row<o&&(n<l.end.row||n==l.end.row&&t.column<l.end.column)?(l.end.row=n,l.end.column=t.column):l.end.row==o?l.end.column<=i.column?(c||l.end.column>t.column)&&(l.end.column=t.column,l.end.row=t.row):(l.end.column+=h,l.end.row+=c):l.end.row>o&&(l.end.row+=c),l.start.row<o&&(n<l.start.row||n==l.start.row&&t.column<l.start.column)?(l.start.row=n,l.start.column=t.column):l.start.row==o?l.start.column<=i.column?(c||l.start.column>t.column)&&(l.start.column=t.column,l.start.row=t.row):(l.start.column+=h,l.start.row+=c):l.start.row>o&&(l.start.row+=c);if(0!=c&&s<a)for(;s<a;s++)(l=r[s]).start.row+=c,l.end.row+=c},(e=o).prototype.comparePoints=n,t.RangeList=e})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],(function(e,t,i){"use strict";var n,o,r=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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});function s(e,t){var i=o.call(this)||this;return i.foldLine=null,i.placeholder=t,i.range=e,i.start=e.start,i.end=e.end,i.sameRow=e.start.row==e.end.row,i.subFolds=i.ranges=[],i}function a(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function l(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}e=e("../range_list").RangeList,r(s,o=e),s.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},s.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach((function(t){t.setFoldLine(e)}))},s.prototype.clone=function(){var e=new s(this.range.clone(),this.placeholder);return this.subFolds.forEach((function(t){e.subFolds.push(t.clone())})),e.collapseChildren=this.collapseChildren,e},s.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){r=e,s=this.start,a(r.start,s),a(r.end,s);for(var t=e.start.row,i=e.start.column,n=0,o=-1;n<this.subFolds.length&&1==(o=this.subFolds[n].range.compare(t,i));n++);var r=this.subFolds[n],s=0;if(0==o){if(r.range.containsRange(e))return r.addSubFold(e);s=1}t=e.range.end.row,i=e.range.end.column;var l=n;for(o=-1;l<this.subFolds.length&&1==(o=this.subFolds[l].range.compare(t,i));l++);0==o&&l++;for(var c=this.subFolds.splice(n,l-n,e),h=0==o?c.length-1:c.length,d=s;d<h;d++)e.addSubFold(c[d]);return e.setFoldLine(this.foldLine),e}},s.prototype.restoreRange=function(e){return t=this.start,l(e.start,t),void l(e.end,t);var t},r=s,t.Fold=r})),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],(function(e,t,i){"use strict";var n=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator,a=e("../mouse/mouse_event").MouseEvent;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var o=n.folds,r=0;r<o.length;r++){var s=o[r].range;if(s.contains(e,t)&&(1!=i||!s.isEnd(e,t)||s.isEmpty())&&(-1!=i||!s.isStart(e,t)||s.isEmpty()))return o[r]}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,o=[];t.column+=1,--i.column;for(var r=0;r<n.length;r++){var s=n[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=n[r].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;o.push(c)}}}}return--t.column,i.column+=1,o},this.getFoldsInRangeList=function(e){var t;return Array.isArray(e)?(t=[],e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)):t=this.getFoldsInRange(e),t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var o,r={end:{column:0}},s=0;s<n.folds.length;s++){var a,l=(a=n.folds[s]).range.compareEnd(e,t);if(-1==l){o=this.getLine(a.start.row).substring(r.end.column,a.start.column);break}if(0===l)return null;r=a}return o=o||this.getLine(a.start.row).substring(r.end.column),-1==i?o.substring(0,t-r.end.column):1==i?o.substring(t-r.end.column):o},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var o=i[n];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var o=i[n];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,o=0;o<i.length;o++){var r=(s=i[o]).end.row,s=s.start.row;if(t<=r){s<t&&(e<=s?n-=t-s:n=0);break}e<=r&&(n-=e<=s?r-s:r-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 i,n=this.$foldData,s=!1,a=(e instanceof r?i=e:(i=new r(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range),i.start.row),l=(e=i.start.column,i.end.row),c=(t=i.end.column,this.getFoldAt(a,e,1)),h=this.getFoldAt(l,t,-1);if(c&&h==c)return c.addSubFold(i);c&&!c.range.isStart(a,e)&&this.removeFold(c),h&&!h.range.isEnd(l,t)&&this.removeFold(h),0<(e=this.getFoldsInRange(i.range)).length&&(this.removeFolds(e),i.collapseChildren||e.forEach((function(e){i.addSubFold(e)})));for(var d=0;d<n.length;d++){var u=n[d];if(l==u.start.row){u.addFold(i),s=!0;break}if(a==u.end.row){if(u.addFold(i),s=!0,!i.sameRow){var p=n[d+1];if(p&&p.start.row==l){u.merge(p);break}}break}if(l<=u.start.row)break}return s||(u=this.$addFoldLine(new o(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(u.start.row,u.start.row):this.$updateRowLengthCache(u.start.row,u.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i},this.addFolds=function(e){e.forEach((function(e){this.addFold(e)}),this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,o=this.$foldData,r=t.folds;1==r.length?o.splice(o.indexOf(t),1):t.range.isEnd(e.end.row,e.end.column)?(r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column):t.range.isStart(e.start.row,e.start.column)?(r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column):e.sameRow?r.splice(r.indexOf(e),1):((r=(o=t.split(e.start.row,e.start.column)).folds).shift(),o.start.row=r[0].start.row,o.start.column=r[0].start.column),this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach((function(e){this.removeFold(e)}),this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach((function(t){e.restoreRange(t),this.addFold(t)}),this),0<e.collapseChildren&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var i,o;if(null==e)i=new n(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)i=new n(e,0,e,this.getLine(e).length);else if("row"in e)i=n.fromPoints(e,e);else{if(Array.isArray(e))return o=[],e.forEach((function(e){o=o.concat(this.unfold(e))}),this),o;i=e}for(e=o=this.getFoldsInRangeList(i);1==o.length&&n.comparePoints(o[0].start,i.start)<0&&0<n.comparePoints(o[0].end,i.end);)this.expandFolds(o),o=this.getFoldsInRangeList(i);if(0!=t?this.removeFolds(o):this.expandFolds(o),e.length)return e},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){return(t=this.getFoldLine(e,t))?t.end.row:e},this.getRowFoldStart=function(e,t){return(t=this.getFoldLine(e,t))?t.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,o){null==n&&(n=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var r=this.doc,s="";return e.walk((function(e,t,i,a){if(!(t<n)){if(t==n){if(i<o)return;a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,i)}}),t,i),s},this.getDisplayLine=function(e,t,i,n){var o=this.getFoldLine(e);return o?this.getFoldDisplayLine(o,e,t,i,n):(o=this.doc.getLine(e)).substring(n||0,t||o.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){return t=t.folds.map((function(e){return e.clone()})),new o(e,t)}))},this.toggleFold=function(e){var t=this.selection.getRange();if(t.isEmpty()){var i,n=t.start;if(i=this.getFoldAt(n.row,n.column))return void this.expandFold(i);(o=this.findMatchingBracket(n))?1==t.comparePoint(o)?t.end=o:(t.start=o,t.start.column++,t.end.column--):(o=this.findMatchingBracket({row:n.row,column:n.column+1}))?(1==t.comparePoint(o)?t.end=o:t.start=o,t.start.column++):t=this.getCommentFoldRange(n.row,n.column)||t}else{var o=this.getFoldsInRange(t);if(e&&o.length)return void this.expandFolds(o);1==o.length&&(i=o[0])}if((i=i||this.getFoldAt(t.start.row,t.start.column))&&i.range.toString()==t.toString())this.expandFold(i);else{if(n="...",!t.isMultiLine()){if((n=this.getTextRange(t)).length<4)return;n=n.trim().substring(0,2)+".."}this.addFold(n,t)}},this.getCommentFoldRange=function(e,t,i){var o=new s(this,e,t),r=o.getCurrentToken(),a=r&&r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start|\\.doc");var l=new RegExp(a);if(a=new n,1!=i){for(;(r=o.stepBackward())&&l.test(r.type)&&!/^comment.end/.test(r.type););r=o.stepForward()}if(a.start.row=o.getCurrentTokenRow(),a.start.column=o.getCurrentTokenColumn()+(/^comment.start/.test(r.type)?r.value.length:2),o=new s(this,e,t),-1!=i){var c=-1;do{if(r=o.stepForward(),-1==c){var h=this.getState(o.$row);l.test(h)||(c=o.$row)}else if(o.$row>c)break}while(r&&l.test(r.type)&&!/^comment.start/.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return a.end.row=o.getCurrentTokenRow(),a.end.column=o.getCurrentTokenColumn(),/^comment.end/.test(r.type)||(a.end.column+=r.value.length-2),a}},this.foldAll=function(e,t,i,n){null==i&&(i=1e5);var o=this.foldWidgets;if(o){t=t||this.getLength();for(var r,s=e=e||0;s<t;s++)null==o[s]&&(o[s]=this.getFoldWidget(s)),"start"!=o[s]||n&&!n(s)||(r=this.getFoldWidgetRange(s))&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e&&(s=r.end.row,r.collapseChildren=i,this.addFold("...",r))}},this.foldToLevel=function(e){for(this.foldAll();0<e--;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var i=e.getTokens(t),n=0;n<i.length;n++){var o=i[n];if("text"!=o.type||!/^\s+$/.test(o.value))return!!/comment/.test(o.type)}}))},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");this.$foldStyle!=e&&("manual"==(this.$foldStyle=e)&&this.unfold(),e=this.$foldMode,this.$setFolding(null),this.$setFolding(e))},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n=e-1;0<=n;){var o=i[n];if("start"==(o=null==o?i[n]=this.getFoldWidget(n):o)){var r=this.getFoldWidgetRange(n),s=s||r;if(r&&r.end.row>=e)break}n--}return{range:-1!==n&&r,firstRange:s}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t instanceof a?t.domEvent:t).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};this.$toggleFoldWidget(e,i)||(e=t.target||t.srcElement)&&/ace_fold-widget/.test(e.className)&&(e.className+=" ace_invalid")},this.$toggleFoldWidget=function(e,t){var i,n,o,r;if(this.getFoldWidget)return i=this.getFoldWidget(e),n=this.getLine(e),(n=this.getFoldAt(e,-1==(i="end"===i?-1:1)?0:n.length,i))?(t.children||t.all?this.removeFold(n):this.expandFold(n),n):(i=this.getFoldWidgetRange(e,!0))&&!i.isMultiLine()&&(n=this.getFoldAt(i.start.row,i.start.column,1))&&i.isEqual(n.range)?(this.removeFold(n),n):(t.siblings?((n=this.getParentFoldRangeData(e)).range&&(o=n.range.start.row+1,r=n.range.end.row),this.foldAll(o,r,t.all?1e4:0)):t.children?(r=i?i.end.row:this.getLength(),this.foldAll(e+1,r,t.all?1e4:0)):i&&(t.all&&(i.collapseChildren=1e4),this.addFold("...",i)),i)},this.toggleFoldWidget=function(e){var t,i=this.selection.getCursor().row;i=this.getRowFoldStart(i),!this.$toggleFoldWidget(i,{})&&(t=(t=this.getParentFoldRangeData(i,!0)).range||t.firstRange)&&(i=t.start.row,(i=this.getFoldAt(i,this.getLine(i).length,1))?this.removeFold(i):this.addFold("...",t))},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.foldWidgets[t]=null:"remove"==e.action?this.foldWidgets.splice(t,1+i,null):((e=Array(1+i)).unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,e))},this.tokenizerUpdateFoldWidgets=function(e){(e=e.data).first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,i){"use strict";var n=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){return 0!=e.column&&""!=(t=t||this.getLine(e.row).charAt(e.column-1))&&(t=t.match(/([\(\[\{])|([\)\]\}])/))?t[1]?this.$findClosingBracket(t[1],e):this.$findOpeningBracket(t[2],e):null},this.getBracketRange=function(e){var t,i,n=this.getLine(e.row),r=!0,s=n.charAt(e.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},a=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!a)return null;if(a[1]){if(!(i=this.$findClosingBracket(a[1],e)))return null;t=o.fromPoints(e,i),r||(t.end.column++,t.start.column--),t.cursor=t.end}else{if(!(i=this.$findOpeningBracket(a[2],e)))return null;t=o.fromPoints(i,e),r||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var i=this.getLine(e.row),n=/([\(\[\{])|([\)\]\}])/,r=!t&&i.charAt(e.column-1),s=r&&r.match(n);return s||(r=(void 0===t||t)&&i.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(n)),s?(t=new o(e.row,e.column-1,e.row,e.column),(i=s[1]?this.$findClosingBracket(s[1],e):this.$findOpeningBracket(s[2],e))?[t,new o(i.row,i.column,i.row,i.column+1)]:[t]):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,i){var o=this.$brackets[e],r=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){i=i||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+");for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;0<=l;){var h=c.charAt(l);if(h==o){if(0==--r)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1);--l}for(;(a=s.stepBackward())&&!i.test(a.type););if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var o=this.$brackets[e],r=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){i=i||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+");for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;l<h;){var d=c.charAt(l);if(d==o){if(0==--r)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(r+=1);l+=1}for(;(a=s.stepForward())&&!i.test(a.type););if(null==a)break;l=0}return null}},this.getMatchingTags=function(e){e=new n(this,e.row,e.column);var t=this.$findTagName(e);if(t)return"<"===e.stepBackward().value?this.$findClosingTag(e,t):this.$findOpeningTag(e,t)},this.$findTagName=function(e){var t=e.getCurrentToken(),i=!1,n=!1;if(t&&-1===t.type.indexOf("tag-name"))for(;(t=n?e.stepBackward():e.stepForward())&&("/>"===t.value?n=!0:-1!==t.type.indexOf("tag-name")&&(i=!0)),t&&!i;);return t},this.$findClosingTag=function(e,t){var i=t.value,n=t.value,r=0,s=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),a=(t=e.stepForward(),new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length)),l=!1;do{var c,h=t;if(t=e.stepForward())if(">"!==t.value||l||(c=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1),l=!0),-1!==t.type.indexOf("tag-name")){if(n===(i=t.value))if("<"===h.value)r++;else if("</"===h.value&&--r<0){e.stepBackward();var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),u=(t=e.stepForward(),new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length));if(!(t=e.stepForward())||">"!==t.value)return;var p=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else n===i&&"/>"===t.value&&--r<0&&(p=u=d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),c=new o(a.end.row,a.end.column,a.end.row,a.end.column+1))}while(t&&0<=r);if(s&&c&&d&&p&&a&&u)return{openTag:new o(s.start.row,s.start.column,c.end.row,c.end.column),closeTag:new o(d.start.row,d.start.column,p.end.row,p.end.column),openTagName:a,closeTagName:u}},this.$findOpeningTag=function(e,t){var i,n=e.getCurrentToken(),r=t.value,s=0,a=e.getCurrentTokenRow(),l=e.getCurrentTokenColumn(),c=new o(a,l,a,l+2),h=(e.stepForward(),new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length));if((t=e.stepForward())&&">"===t.value){var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=n,a=e.getCurrentTokenRow(),i=(l=e.getCurrentTokenColumn())+t.value.length,n=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(r===t.value)if("<"===n.value){if(0<++s){for(var u=new o(a,l,a,i),p=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);(t=e.stepForward())&&">"!==t.value;);var g=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else"</"===n.value&&s--}else if("/>"===t.value){for(var m=0,f=n;f;){if(-1!==f.type.indexOf("tag-name")&&f.value===r){s--;break}if("<"===f.value)break;f=e.stepBackward(),m++}for(var y=0;y<m;y++)e.stepForward()}}while(n&&s<=0);return p&&g&&c&&d&&u&&h?{openTag:new o(p.start.row,p.start.column,g.end.row,g.end.column),closeTag:new o(c.start.row,c.start.column,d.end.row,d.end.column),openTagName:u,closeTagName:h}:void 0}}}})),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/lang"),r=e("./bidihandler").BidiHandler,s=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,h=e("./range").Range,d=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,g=e("./undomanager").UndoManager,m=(f.prototype.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),(this.doc=e).on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},f.prototype.getDocument=function(){return this.doc},f.prototype.$resetRowCache=function(e){var t;e?(t=this.$docRowCache.length,(e=this.$getRowCacheIndex(this.$docRowCache,e)+1)<t&&(this.$docRowCache.splice(e,t),this.$screenRowCache.splice(e,t))):(this.$docRowCache=[],this.$screenRowCache=[])},f.prototype.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var o=i+n>>1,r=e[o];if(r<t)i=1+o;else{if(!(t<r))return o;n=o-1}}return i-1},f.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},f.prototype.onChangeFold=function(e){e=e.data,this.$resetRowCache(e.start.row)},f.prototype.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},f.prototype.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},f.fromJSON=function(e){e=JSON.parse(e);var t=new g,i=(t.$undoStack=e.history.undo,t.$redoStack=e.history.redo,t.mark=e.history.mark,t.$rev=e.history.rev,new f(e.value));return e.folds.forEach((function(e){i.addFold("...",h.fromPoints(e.start,e.end))})),i.setAnnotations(e.annotations),i.setBreakpoints(e.breakpoints),i.setMode(e.mode),i.setScrollLeft(e.scrollLeft),i.setScrollTop(e.scrollTop),i.setUndoManager(t),i.selection.fromJSON(e.selection),i},f.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map((function(e){return e.range})),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},f.prototype.toString=function(){return this.doc.getValue()},f.prototype.getSelection=function(){return this.selection},f.prototype.getState=function(e){return this.bgTokenizer.getState(e)},f.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)},f.prototype.getTokenAt=function(e,t){var i=this.bgTokenizer.getTokens(e),n=0;if(null==t){var o=i.length-1;n=this.getLine(e).length}else for(o=0;o<i.length&&!(t<=(n+=i[o].value.length));o++);return(e=i[o])?(e.index=o,e.start=n-e.value.length,e):null},f.prototype.setUndoManager=function(e){var t;this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e?(e.addSession(t=this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)):this.$syncInformUndoManager=function(){}},f.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},f.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},f.prototype.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},f.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},f.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},f.prototype.setTabSize=function(e){this.setOption("tabSize",e)},f.prototype.getTabSize=function(){return this.$tabSize},f.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},f.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},f.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},f.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},f.prototype.getOverwrite=function(){return this.$overwrite},f.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},f.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},f.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},f.prototype.getBreakpoints=function(){return this.$breakpoints},f.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},f.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},f.prototype.setBreakpoint=function(e,t){(t=void 0===t?"ace_breakpoint":t)?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},f.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},f.prototype.addMarker=function(e,t,i,n){var o=this.$markerId++;return e={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:o},n?(this.$frontMarkers[o]=e,this._signal("changeFrontMarker")):(this.$backMarkers[o]=e,this._signal("changeBackMarker")),o},f.prototype.addDynamicMarker=function(e,t){var i;if(e.update)return i=this.$markerId++,e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e},f.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},f.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},f.prototype.highlight=function(e){var t;this.$searchHighlight||(t=new p(null,"ace_selected-word","text"),this.$searchHighlight=this.addDynamicMarker(t)),this.$searchHighlight.setRegexp(e)},f.prototype.highlightLines=function(e,t,i,n){return"number"!=typeof t&&(i=t,t=e),i=i||"ace_step",(e=new h(e,0,t,1/0)).id=this.addMarker(e,i,"fullLine",n),e},f.prototype.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},f.prototype.getAnnotations=function(){return this.$annotations||[]},f.prototype.clearAnnotations=function(){this.setAnnotations([])},f.prototype.$detectNewLine=function(e){e=e.match(/^.*?(\r?\n)/m),this.$autoNewLine=e?e[1]:"\n"},f.prototype.getWordRange=function(e,t){var i,n=this.getLine(e),o=!1,r=(i=(o=(o=0<t?!!n.charAt(t-1).match(this.tokenRe):o)||!!n.charAt(t).match(this.tokenRe))?this.tokenRe:/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe,t);if(0<r){for(;0<=--r&&n.charAt(r).match(i););r++}for(var s=t;s<n.length&&n.charAt(s).match(i);)s++;return new h(e,r,e,s)},f.prototype.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},f.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)},f.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},f.prototype.setUseWorker=function(e){this.setOption("useWorker",e)},f.prototype.getUseWorker=function(){return this.$useWorker},f.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},f.prototype.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[n]&&!i?(this.$onChangeMode(this.$modes[n]),t&&t()):(this.$modeId=n,s.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||((this.$modes[n]=e).$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0))},f.prototype.$onChangeMode=function(e,t){var i,n,o;t||(this.$modeId=e.$id),this.$mode===e||(i=this.$mode,this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker(),void 0!==(n=e.getTokenizer()).on&&(o=this.onReloadTokenizer.bind(this),n.on("update",o)),this.bgTokenizer.setTokenizer(n),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t)||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:i,mode:e}))},f.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},f.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e),this.$worker=null}},f.prototype.getMode=function(){return this.$mode},f.prototype.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},f.prototype.getScrollTop=function(){return this.$scrollTop},f.prototype.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},f.prototype.getScrollLeft=function(){return this.$scrollLeft},f.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},f.prototype.getLineWidgetMaxWidth=function(){var e;return null!=this.lineWidgetsWidth?this.lineWidgetsWidth:(e=0,this.lineWidgets.forEach((function(t){t&&t.screenWidth>e&&(e=t.screenWidth)})),this.lineWidgetWidth=e)},f.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(),i=this.$rowLengthCache,n=0,o=0,r=this.$foldData[o],s=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(s<l){if(a<=(l=r.end.row+1))break;s=(r=this.$foldData[o++])?r.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},f.prototype.getLine=function(e){return this.doc.getLine(e)},f.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},f.prototype.getLength=function(){return this.doc.getLength()},f.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},f.prototype.insert=function(e,t){return this.doc.insert(e,t)},f.prototype.remove=function(e){return this.doc.remove(e)},f.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},f.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"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}},f.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];"insert"!=n.action&&"remove"!=n.action||this.doc.$safeApplyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},f.prototype.setUndoSelect=function(e){this.$undoSelect=e},f.prototype.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,o,r=0;r<e.length;r++){var s=e[r];s.start&&(n?i(s)?(o=s.start,-1==n.compare(o.row,o.column)&&n.setStart(o),o=s.end,1==n.compare(o.row,o.column)&&n.setEnd(o)):(o=s.start,-1==n.compare(o.row,o.column)&&(n=h.fromPoints(s.start,s.start))):n=i(s)?h.fromPoints(s.start,s.end):h.fromPoints(s.start,s.start))}return n},f.prototype.replace=function(e,t){return this.doc.replace(e,t)},f.prototype.moveText=function(e,t,i){var n,o,r,s=this.getTextRange(e),a=this.getFoldsInRange(e);return t=h.fromPoints(t,t),i||(this.remove(e),o=e.start.row-e.end.row,(r=o?-e.end.column:e.start.column-e.end.column)&&(t.start.row==e.end.row&&t.start.column>e.end.column&&(t.start.column+=r),t.end.row==e.end.row)&&t.end.column>e.end.column&&(t.end.column+=r),o&&t.start.row>=e.end.row&&(t.start.row+=o,t.end.row+=o)),t.end=this.insert(t.start,s),a.length&&(n=e.start,i=t.start,o=i.row-n.row,r=i.column-n.column,this.addFolds(a.map((function(e){return(e=e.clone()).start.row==n.row&&(e.start.column+=r),e.end.row==n.row&&(e.end.column+=r),e.start.row+=o,e.end.row+=o,e})))),t},f.prototype.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},f.prototype.outdentRows=function(e){for(var t=e.collapseRows(),i=new h(0,0,0,0),n=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var r=this.getLine(o);i.start.row=o,i.end.row=o;for(var s=0;s<n&&" "==r.charAt(s);++s);s<n&&"\t"==r.charAt(s)?(i.start.column=s,i.end.column=s+1):(i.start.column=0,i.end.column=s),this.remove(i)}},f.prototype.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((o=this.getRowFoldStart(e+i))<0)return 0;var n=o-e}else if(0<i){if((o=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=o-t}else e=this.$clipRowToDocument(e),n=(t=this.$clipRowToDocument(t))-e+1;var o=new h(e,0,t,Number.MAX_VALUE);return o=this.getFoldsInRange(o).map((function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e})),i=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t),this.doc.insertFullLines(e+n,i),o.length&&this.addFolds(o),n},f.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},f.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},f.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},f.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},f.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},f.prototype.$clipPositionToDocument=function(e,t){var i;return t=Math.max(0,t),t=e<0?e=0:(i=this.doc.getLength())<=e?this.doc.getLine(e=i-1).length:Math.min(this.doc.getLine(e).length,t),{row:e,column:t}},f.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},f.prototype.setUseWrapMode=function(e){e!=this.$useWrapMode&&(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e&&(e=this.getLength(),this.$wrapData=Array(e),this.$updateWrapData(0,e-1)),this._signal("changeWrapMode"))},f.prototype.getUseWrapMode=function(){return this.$useWrapMode},f.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"))},f.prototype.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;return i.max<0&&(i={min:t,max:t}),(t=this.$constrainWrapLimit(e,i.min,i.max))!=this.$wrapLimit&&1<t&&(this.$wrapLimit=t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},f.prototype.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i?Math.min(i,e):e},f.prototype.getWrapLimit=function(){return this.$wrapLimit},f.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},f.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},f.prototype.$updateInternalDataOnChange=function(e){var t,i=this.$useWrapMode,n=e.action,o=e.start,r=e.end,s=o.row,a=r.row,l=a-s,c=null;if(this.$updating=!0,0!=l)if("remove"===n){this[i?"$wrapData":"$rowLengthCache"].splice(s,l);var h=this.$foldData;c=this.getFoldsInRange(e),this.removeFolds(c);var d=0;for((t=this.getFoldLine(r.row))&&(t.addRemoveChars(r.row,r.column,o.column-r.column),t.shiftRow(-l),(u=this.getFoldLine(s))&&u!==t&&(u.merge(t),t=u),d=h.indexOf(t)+1);d<h.length;d++)(t=h[d]).start.row>=r.row&&t.shiftRow(-l);a=s}else{var u=Array(l),p=(u.unshift(s,0),i?this.$wrapData:this.$rowLengthCache);for(p.splice.apply(p,u),h=this.$foldData,d=0,(t=this.getFoldLine(s))&&(0==(p=t.range.compareInside(o.row,o.column))?(t=t.split(o.row,o.column))&&(t.shiftRow(l),t.addRemoveChars(a,0,r.column-o.column)):-1==p&&(t.addRemoveChars(s,0,r.column-o.column),t.shiftRow(l)),d=h.indexOf(t)+1);d<h.length;d++)(t=h[d]).start.row>=s&&t.shiftRow(l)}else l=Math.abs(e.start.column-e.end.column),"remove"===n&&(c=this.getFoldsInRange(e),this.removeFolds(c),l=-l),(t=this.getFoldLine(s))&&t.addRemoveChars(s,o.column,l);return i&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,i?this.$updateWrapData(s,a):this.$updateRowLengthCache(s,a),c},f.prototype.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},f.prototype.$updateWrapData=function(e,t){var i,n,o=this.doc.getAllLines(),r=this.getTabSize(),s=this.$wrapData,a=this.$wrapLimit,l=e;for(t=Math.min(t,o.length-1);l<=t;)(n=this.getFoldLine(l,n))?(i=[],n.walk(function(e,t,n,r){var s;if(null!=e){(s=this.$getDisplayTokens(e,i.length))[0]=C;for(var a=1;a<s.length;a++)s[a]=I}else s=this.$getDisplayTokens(o[t].substring(r,n),i.length);i=i.concat(s)}.bind(this),n.end.row,o[n.end.row].length+1),s[n.start.row]=this.$computeWrapSplits(i,a,r),l=n.end.row+1):(i=this.$getDisplayTokens(o[l]),s[l]=this.$computeWrapSplits(i,a,r),l++)},f.prototype.$computeWrapSplits=function(e,t,i){if(0==e.length)return[];var n=[],o=e.length,r=0,s=0,a=this.$wrapAsCode,l=this.$indentedSoftWrap,c=t<=Math.max(2*i,8)||!1===l?0:Math.floor(t/2);function h(t){for(var o=t-r,h=r;h<t;h++){var u=e[h];12!==u&&2!==u||--o}n.length||(d=function(){var t=0;if(0===c)return t;if(l)for(var n=0;n<e.length;n++){var o=e[n];if(o==A)t+=1;else if(o==w)t+=i;else if(o!=_)break}return a&&!1!==l&&(t+=i),Math.min(t,c)}(),n.indent=d),s+=o,n.push(s),r=t}for(var d=0;t-d<o-r;){var u=r+t-d;if(e[u-1]>=A&&e[u]>=A)h(u);else if(e[u]==C||e[u]==I){for(;u!=r-1&&e[u]!=C;u--);if(r<u);else{for(u=r+t;u<e.length&&e[u]==I;u++);if(u==e.length)break}h(u)}else{for(var p=Math.max(u-(t-(t>>2)),r-1);p<u&&e[u]<C;)u--;if(a){for(;p<u&&e[u]<C;)u--;for(;p<u&&e[u]==b;)u--}else for(;p<u&&e[u]<A;)u--;p<u?h(++u):(e[u=r+t]==v&&u--,h(u-d))}}return n},f.prototype.$getDisplayTokens=function(e,t){var i,n=[];t=t||0;for(var o=0;o<e.length;o++){var r=e.charCodeAt(o);if(9==r){i=this.getScreenTabSize(n.length+t),n.push(w);for(var s=1;s<i;s++)n.push(_)}else 32==r?n.push(A):39<r&&r<48||57<r&&r<64?n.push(b):4352<=r&&x(r)?n.push(y,v):n.push(y)}return n},f.prototype.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var n,o;for(null==t&&(t=1/0),i=i||0,o=0;o<e.length&&(9==(n=e.charCodeAt(o))?i+=this.getScreenTabSize(i):4352<=n&&x(n)?i+=2:i+=1,!(t<i));o++);return[i,o]},f.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},f.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},f.prototype.getRowWrapIndent=function(e){var t;return this.$useWrapMode&&(e=this.screenToDocumentPosition(e,Number.MAX_VALUE),(t=this.$wrapData[e.row]).length)&&t[0]<e.column?t.indent:0},f.prototype.getScreenLastRowColumn=function(e){return e=this.screenToDocumentPosition(e,Number.MAX_VALUE),this.documentToScreenColumn(e.row,e.column)},f.prototype.getDocumentLastRowColumn=function(e,t){return e=this.documentToScreenRow(e,t),this.getScreenLastRowColumn(e)},f.prototype.getDocumentLastRowColumnPosition=function(e,t){return e=this.documentToScreenRow(e,t),this.screenToDocumentPosition(e,Number.MAX_VALUE/10)},f.prototype.getRowSplitData=function(e){if(this.$useWrapMode)return this.$wrapData[e]},f.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},f.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},f.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},f.prototype.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};for(var n,o,r,s=0,a=0,l=0,c=0,h=this.$screenRowCache,d=this.$getRowCacheIndex(h,e),u=h.length,p=(r=u&&0<=d?(l=h[d],s=this.$docRowCache[d],e>h[u-1]):!u,this.getLength()-1),g=this.getNextFoldLine(s),m=g?g.start.row:1/0;l<=e&&!(e<l+(c=this.getRowLength(s))||p<=s);)l+=c,m<++s&&(s=g.end.row+1,m=(g=this.getNextFoldLine(s,g))?g.start.row:1/0),r&&(this.$docRowCache.push(s),this.$screenRowCache.push(l));if(g&&g.start.row<=s)n=this.getFoldDisplayLine(g),s=g.start.row;else{if(l+c<=e||p<s)return{row:p,column:this.getLine(p).length};n=this.getLine(s),g=null}return d=0,h=Math.floor(e-l),this.$useWrapMode&&(u=this.$wrapData[s])&&(o=u[h],0<h)&&u.length&&(d=u.indent,a=u[h-1]||u[u.length-1],n=n.substring(a)),void 0!==i&&this.$bidiHandler.isBidiRow(l+h,s,h)&&(t=this.$bidiHandler.offsetToCol(i)),a+=this.$getStringScreenWidth(n,t-d)[1],this.$useWrapMode&&o<=a&&(a=o-1),g?g.idxToPosition(a):{row:s,column:a}},f.prototype.documentToScreenPosition=function(e,t){var i=(e=(n=void 0===t?this.$clipPositionToDocument(e.row,e.column):this.$clipPositionToDocument(e,t)).row,t=n.column,0),n=null;(a=this.getFoldAt(e,t,1))&&(e=a.start.row,t=a.start.column);for(var o,r,s=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,e),c=a.length,h=(r=c&&0<=l?(s=a[l],i=this.$screenRowCache[l],e>a[c-1]):!c,this.getNextFoldLine(s)),d=h?h.start.row:1/0;s<e;){if(d<=s){if(e<(o=h.end.row+1))break;d=(h=this.getNextFoldLine(o,h))?h.start.row:1/0}else o=s+1;i+=this.getRowLength(s),s=o,r&&(this.$docRowCache.push(s),this.$screenRowCache.push(i))}var u="";if(n=h&&d<=s?(u=this.getFoldDisplayLine(h,e,t),h.start.row):(u=this.getLine(e).substring(0,t),e),l=0,this.$useWrapMode){var p=this.$wrapData[n];if(p){for(var g=0;u.length>=p[g];)i++,g++;u=u.substring(p[g-1]||0,u.length),l=0<g?p.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(i+=this.lineWidgets[s].rowsAbove),{row:i,column:l+this.$getStringScreenWidth(u)[0]}},f.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},f.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},f.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,o=0,r=(t=this.$foldData[o++])?t.start.row:1/0;n<i;){var s=this.$wrapData[n];e+=s?s.length+1:1,r<++n&&(n=t.end.row+1,r=(t=this.$foldData[o++])?t.start.row:1/0)}else{e=this.getLength();var a=this.$foldData;for(o=0;o<a.length;o++)e-=(t=a[o]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},f.prototype.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,i,n){if(0===i)return[0,0];var o,r;for(i=i||1/0,n=n||0,r=0;r<t.length&&!(i<(n+="\t"===(o=t.charAt(r))?this.getScreenTabSize(n):e.getCharacterWidth(o)));r++);return[n,r]})},f.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},f);function f(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++f.$uid,this.$foldData.toString=function(){return this.join("\n")},this.bgTokenizer=new u((new c).getTokenizer(),this);var i=this;this.bgTokenizer.on("update",(function(e){i._signal("tokenizerUpdate",e)})),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new d(e)),this.setDocument(e),this.selection=new l(this),this.$bidiHandler=new r(this),s.resetOptions(this),this.setMode(t),s._signal("session",this),this.destroyed=!1}m.$uid=0,m.prototype.$modes=s.$modes,m.prototype.getValue=m.prototype.toString,m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},m.prototype.$overwrite=!1,m.prototype.$mode=null,m.prototype.$modeId=null,m.prototype.$scrollTop=0,m.prototype.$scrollLeft=0,m.prototype.$wrapLimit=80,m.prototype.$useWrapMode=!1,m.prototype.$wrapLimitRange={min:null,max:null},m.prototype.lineWidgets=null,m.prototype.isFullWidth=x,n.implement(m.prototype,a);var y=1,v=2,C=3,I=4,b=9,A=10,w=11,_=12;function x(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}e("./edit_session/folding").Folding.call(m.prototype),e("./edit_session/bracket_match").BracketMatch.call(m.prototype),s.defineOptions(m.prototype,"session",{wrap:{set:function(e){e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e&&((this.$wrap=e)?(this.setWrapLimitRange(e="number"==typeof e?e:null,e),this.setUseWrapMode(!0)):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){0<(e=parseInt(e))&&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=m})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/lang"),o=e("./lib/oop"),r=e("./range").Range;function s(){this.$options={}}s.prototype.set=function(e){return o.mixin(this.$options,e),this},s.prototype.getOptions=function(){return n.copyObject(this.$options)},s.prototype.setOptions=function(e){this.$options=e},s.prototype.find=function(e){var t,i=this.$options;return!!(e=this.$matchIterator(e,i))&&(t=null,e.forEach((function(e,n,o,s){return t=new r(e,n,o,s),!(n==s&&i.start&&i.start.start&&0!=i.skipCurrent&&t.isEqual(i.start)&&(t=null,1))})),t)},s.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,o=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,h=o.length-c;e:for(var d=a.offset||0;d<=h;d++){for(var u=0;u<c;u++)if(-1==o[d+u].search(a[u]))continue e;var p=o[d],g=o[d+c-1];p=p.length-p.match(a[0])[0].length,g=g.match(a[c-1])[0].length,l&&l.end.row===d&&l.end.column>p||(s.push(l=new r(d,p,d+c-1,g)),2<c&&(d=d+c-2))}}else for(var m=0;m<o.length;m++){var f=n.getMatchOffsets(o[m],a);for(u=0;u<f.length;u++){var y=f[u];s.push(new r(m,y.offset,m,y.offset+y.length))}}if(i){var v=i.start.column,C=i.end.column;for(m=0,u=s.length-1;m<u&&s[m].start.column<v&&0==s[m].start.row;)m++;for(var I=i.end.row-i.start.row;m<u&&s[u].end.column>C&&s[u].end.row==I;)u--;for(s=s.slice(m,u+1),m=0,u=s.length;m<u;m++)s[m].start.row+=i.start.row,s[m].end.row+=i.start.row}return s},s.prototype.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var o=n.exec(e);if(!o||o[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var s=e[r];s&&s.toLowerCase()!=s?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},s.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i,o,r,s,a=e.needle;if(!e.needle)return e.re=!1;void 0===e.$supportsUnicodeFlag&&(e.$supportsUnicodeFlag=n.supportsUnicodeFlag());try{new RegExp(a,"u")}catch(t){e.$supportsUnicodeFlag=!1}function l(e,t){return void 0===t&&(t=!0),(r&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||o.regExp?r&&o.$supportsUnicodeFlag?t?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}e.regExp||(a=n.escapeRegExp(a)),e.wholeWord&&(i=a,o=e,r=n.supportsLookbehind(),c=(s=Array.from(i))[0],s=s[s.length-1],a=l(c)+i+l(s,!1));var c=e.caseSensitive?"gm":"gmi";if(e.$supportsUnicodeFlag&&(c+="u"),e.$isMultiLine=!t&&/[\n\r]/.test(a),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(a,c);try{var h=new RegExp(a,c)}catch(t){h=!1}return e.re=h},s.prototype.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],o=0;o<i.length;o++)try{n.push(new RegExp(i[o],t))}catch(e){return!1}return n},s.prototype.$matchIterator=function(e,t){var i,n,o,r,s,a,l,c,h=this.$assembleRegExp(t);return!!h&&(i=1==t.backwards,n=0!=t.skipCurrent,o=t.range,(r=(r=t.start)||(o?o[i?"end":"start"]:e.selection.getRange())).start&&(r=r[n!=i?"end":"start"]),s=o?o.start.row:0,a=o?o.end.row:e.getLength()-1,c=t.$isMultiLine?(l=h.length,function(t,n,o){var r=i?t-l+1:t;if(!(r<0||r+l>e.getLength())){var s=e.getLine(r);if(t=s.search(h[0]),!(!i&&t<n||-1===t)){for(var a=1;a<l;a++)if(-1==(s=e.getLine(r+a)).search(h[a]))return;var c=s.match(h[l-1])[0].length;if(!(i&&n<c))return!!o(r,t,r+l-1,c)||void 0}}}):i?function(t,i,n){var o,r=e.getLine(t),s=[];for(h.lastIndex=0;o=h.exec(r);){var a=o[0].length,l=o.index;if(!a){if(l>=r.length)break;h.lastIndex=l+=1}if(o.index+a>i)break;s.push(o.index,a)}for(var c=s.length-1;0<=c;c-=2){var d=s[c-1];if(n(t,d,t,d+(a=s[c])))return!0}}:function(t,i,n){var o=e.getLine(t);for(h.lastIndex=i;r=h.exec(o);){var r,s=r[0].length;if(n(t,r=r.index,t,r+s))return!0;if(!s&&(h.lastIndex=r+=1,r>=o.length))return!1}},{forEach:i?function(e){var i=r.row;if(!c(i,r.column,e)){for(i--;s<=i;i--)if(c(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=a,s=r.row;s<=i;i--)if(c(i,Number.MAX_VALUE,e))return}}:function(e){var i=r.row;if(!c(i,r.column,e)){for(i+=1;i<=a;i++)if(c(i,0,e))return;if(0!=t.wrap)for(i=s,a=r.row;i<=a;i++)if(c(i,0,e))return}}})},t.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){"use strict";var n,o,r=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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=e("../lib/keys"),a=e("../lib/useragent"),l=s.KEY_MODS,c=(h.prototype.$init=function(e,t,i){this.platform=t||(a.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=i},h.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},h.prototype.removeCommand=function(e,t){var i,n=e&&("string"==typeof e?e:e.name),o=(e=this.commands[n],t||delete this.commands[n],this.commandKeyBinding);for(i in o){var r,s=o[i];s==e?delete o[i]:Array.isArray(s)&&-1!=(r=s.indexOf(e))&&(s.splice(r,1),1==s.length)&&(o[i]=s[0])}},h.prototype.bindKey=function(e,t,i){if("object"==typeof e&&e&&(null==i&&(i=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="",o=(-1!=e.indexOf(" ")&&(e=(o=e.split(/\s+/)).pop(),o.forEach((function(e){e=this.parseKeys(e),e=l[e.hashId]+e.key,n+=(n?" ":"")+e,this._addCommandToBinding(n,"chainKeys")}),this),n+=" "),this.parseKeys(e));e=l[o.hashId]+o.key,this._addCommandToBinding(n+e,t,i)}),this)},h.prototype._addCommandToBinding=function(e,t,i){var n=this.commandKeyBinding;if(t)if(!n[e]||this.$singleCommand)n[e]=t;else{Array.isArray(n[e])?-1!=(r=n[e].indexOf(t))&&n[e].splice(r,1):n[e]=[n[e]],"number"!=typeof i&&(i=d(t));for(var o=n[e],r=0;r<o.length&&!(i<d(o[r]));r++);o.splice(r,0,t)}else delete n[e]},h.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var i=e[t];if(i){if("string"==typeof i)return this.bindKey(i,t);"object"==typeof(i="function"==typeof i?{exec:i}:i)&&(i.name||(i.name=t),this.addCommand(i))}}),this)},h.prototype.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},h.prototype.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},h.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},h.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),i=t.pop(),n=s[i];if(s.FUNCTION_KEYS[n])i=s.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var o=0,r=t.length;r--;){var a=s.KEY_MODS[t[r]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[r]+" in "+e),!1;o|=a}return{key:i,hashId:o}},h.prototype.findKeyCommand=function(e,t){return e=l[e]+t,this.commandKeyBinding[e]},h.prototype.handleKeyboard=function(e,t,i,n){var o,r;if(!(n<0))return o=l[t]+i,r=this.commandKeyBinding[o],e.$keyChain&&(e.$keyChain+=" "+o,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||0<n)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-o.length-1)),{command:r}):(e.$keyChain=e.$keyChain||o,{command:"null"})},h.prototype.getStatusText=function(e,t){return t.$keyChain||""},h);function h(e,t){this.$init(e,t,!1)}function d(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}function u(e,t){return(e=o.call(this,e,t)||this).$singleCommand=!0,e}r(u,o=c),(e=u).call=function(e,t,i){c.prototype.$init.call(e,t,i,!0)},c.call=function(e,t,i){c.prototype.$init.call(e,t,i,!1)},t.HashHandler=e,t.MultiHashHandler=c})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o,r=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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=e("../lib/oop"),a=e("../keyboard/hash_handler").MultiHashHandler;function l(e,t){return(t=o.call(this,t,e)||this).byName=t.commands,t.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)})),t}e=e("../lib/event_emitter").EventEmitter,r(l,o=a),l.prototype.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}var o;return!!(e="string"==typeof e?this.commands[e]:e)&&!(t&&t.$readOnly&&!e.readOnly||0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t)||((o={editor:t,command:e,args:i}).returnValue=this._emit("exec",o),this._signal("afterExec",o),!1===o.returnValue))},l.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)},l.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}}},l.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]?e:e[0]}))},r=l,s.implement(r.prototype,e),t.CommandManager=r})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,i){"use strict";var n=e("../lib/lang"),o=e("../config"),r=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){o.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("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:s("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:s("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:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("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:s("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:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){o.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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("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:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("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:s(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:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("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:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("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:s("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:s(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:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(n.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=(o=e.selection.isBackwards())?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=o?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(t.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,a=e.session.doc.getLine(t.row),l=t.row+1;l<=i.row+1;l++){var c=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(l)));a+=c=0!==c.length?" "+c:c}i.row+1<e.session.doc.getLength()-1&&(a+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new r(t.row,0,i.row+2,0),a),0<s?(e.selection.moveCursorTo(t.row,t.column),e.selection.selectTo(t.row,t.column+s)):(o=e.session.doc.getLine(t.row).length>o?o+1:o,e.selection.moveCursorTo(t.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,o=[];n.length<1&&(n=[e.selection.getRange()]);for(var s=0;s<n.length;s++)s!=n.length-1||n[s].end.row===t&&n[s].end.column===i||o.push(new r(n[s].end.row,n[s].end.column,t,i)),0===s?0===n[s].start.row&&0===n[s].start.column||o.push(new r(0,0,n[s].start.row,n[s].start.column)):o.push(new r(n[s-1].end.row,n[s-1].end.column,n[s].start.row,n[s].start.column));for(e.exitMultiSelectMode(),e.clearSelection(),s=0;s<o.length;s++)e.selection.addRange(o[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./lib/dom");function o(e){this.session=e,(this.session.widgetManager=this).session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}o.prototype.getRowLength=function(e){var t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},o.prototype.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},o.prototype.$onChangeEditor=function(e){this.attach(e.editor)},o.prototype.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},o.prototype.detach=function(e){var t=this.editor;t&&(this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets),t=this.session.lineWidgets)&&t.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))},o.prototype.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=(t=e.data).start.row,o=t.end.row,r="add"==e.action,s=n+1;s<o;s++)i[s]&&(i[s].hidden=r);i[o]&&(r?i[n]?i[o].hidden=r:i[n]=i[o]:(i[n]==i[o]&&(i[n]=void 0),i[o].hidden=r))}},o.prototype.updateOnChange=function(e){var t,i,n,o=this.session.lineWidgets;o&&(t=e.start.row,0!=(i=e.end.row-t))&&("remove"==e.action?(n=o.splice(t+1,i),!o[t]&&n[n.length-1]&&(o[t]=n.pop()),n.forEach((function(e){e&&this.removeLineWidget(e)}),this)):(n=new Array(i),o[t]&&null!=o[t].column&&e.start.column>o[t].column&&t++,n.unshift(t,0),o.splice.apply(o,n)),this.$updateRows())},o.prototype.$updateRows=function(){var e,t=this.session.lineWidgets;t&&(e=!0,t.forEach((function(t,i){if(t)for(e=!1,t.row=i;t.$oldWidget;)t.$oldWidget.row=i,t=t.$oldWidget})),e)&&(this.session.lineWidgets=null)},o.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).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1),this.session.lineWidgets[e.row]=e},o.prototype.addLineWidget=function(e){var t,i,o;return this.$registerLineWidget(e),e.session=this.session,this.editor&&(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),i=this.session.getFoldAt(e.row,0),(e.$fold=i)&&(o=this.session.lineWidgets,e.row!=i.end.row||o[i.start.row]?e.hidden=!0:o[i.start.row]=e),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e)),e},o.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()},o.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},o.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},o.prototype.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var o=1/0,r=0;r<i.length;r++){var s=i[r];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/n.characterWidth));var a=s.h/n.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<o)&&(o=s.row)}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},o.prototype.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var o=Math.min(this.firstRow,i.firstRow),r=Math.max(this.lastRow,i.lastRow,n.length);0<o&&!n[o];)o--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var s=o;s<=r;s++){var a,l=n[s];l&&l.el&&(l.hidden?l.el.style.top=-100-(l.pixelHeight||0)+"px":(l._inDocument||(l._inDocument=!0,t.container.appendChild(l.el)),a=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top,l.coverLine||(a+=i.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=a-i.offset+"px",a=l.coverGutter?0:t.gutterWidth,l.fixedWidth||(a-=t.scrollLeft),l.el.style.left=a+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=i.width+2*i.padding+"px"),l.fixedWidth?l.el.style.right=t.scrollBar.getWidth()+"px":l.el.style.right=""))}}},t.LineWidgets=o})),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],(function(e,t,i){"use strict";var n=e("../lib/keys"),o=e("../mouse/default_gutter_handler").GutterTooltip;function r(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new o(this.editor)}r.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},r.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},r.prototype.$onGutterKeyDown=function(e){var t;this.annotationTooltip.isOpen?(e.preventDefault(),e.keyCode===n.escape&&this.annotationTooltip.hideTooltip()):e.target===this.element?e.keyCode==n.enter&&(e.preventDefault(),t=this.editor.getCursorPosition().row,this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),i=this.$findNearestAnnotation(e);null===t&&null===i||(null===t&&null!==i||(null===t||null!==i)&&Math.abs(i-e)<Math.abs(t-e)?(this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex)):(this.activeRowIndex=t,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex)))}.bind(this),10)):(this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal("gutterkeydown",new s(e,this))}.bind(this),10))},r.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode===n.tab)e.preventDefault();else if(e.keyCode===n.escape)e.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;else if(e.keyCode===n.up)switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp()}else if(e.keyCode===n.down)switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown()}else if(e.keyCode===n.left)e.preventDefault(),this.$switchLane("annotation");else if(e.keyCode===n.right)e.preventDefault(),this.$switchLane("fold");else if(e.keyCode===n.enter||e.keyCode===n.space)switch(e.preventDefault(),this.activeLane){case"fold":if("start"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]){var t=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}if("end"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)])break;return;case"annotation":var i=this.lines.cells[this.activeRowIndex].element.childNodes[2].getBoundingClientRect(),o=this.annotationTooltip.getElement().style;o.left=i.right+"px",o.top=i.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex))}},r.prototype.$blurGutter=function(){if(null!==this.activeRowIndex)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex)}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},r.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));return e="none"!==this.$getFoldWidget(e).style.display,t&&e},r.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e));return e="none"!==this.$getAnnotation(e).style.display,t&&e},r.prototype.$getFoldWidget=function(e){return this.lines.get(e).element.childNodes[1]},r.prototype.$getAnnotation=function(e){return this.lines.get(e).element.childNodes[2]},r.prototype.$findNearestFoldWidget=function(e){if(this.$isFoldWidgetVisible(e))return e;for(var t=0;0<e-t||e+t<this.lines.getLength()-1;){if(0<=e-++t&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},r.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;0<e-t||e+t<this.lines.getLength()-1;){if(0<=e-++t&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},r.prototype.$focusFoldWidget=function(e){null!=e&&((e=this.$getFoldWidget(e)).classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())},r.prototype.$focusAnnotation=function(e){null!=e&&((e=this.$getAnnotation(e)).classList.add(this.editor.renderer.keyboardFocusClassName),e.focus())},r.prototype.$blurFoldWidget=function(e){(e=this.$getFoldWidget(e)).classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},r.prototype.$blurAnnotation=function(e){(e=this.$getAnnotation(e)).classList.remove(this.editor.renderer.keyboardFocusClassName),e.blur()},r.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;0<e;)if(this.$isFoldWidgetVisible(--e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},r.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(this.$isFoldWidgetVisible(++e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},r.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;0<e;)if(this.$isAnnotationVisible(--e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},r.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(this.$isAnnotationVisible(++e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},r.prototype.$switchLane=function(e){switch(e){case"annotation":"annotation"!==this.activeLane&&null!=(t=this.$findNearestAnnotation(this.activeRowIndex))&&(this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex));break;case"fold":var t;"fold"!==this.activeLane&&null!=(t=this.$findNearestFoldWidget(this.activeRowIndex))&&(this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=t,this.$focusFoldWidget(this.activeRowIndex))}},r.prototype.$rowIndexToRow=function(e){return(e=this.lines.get(e))?e.row:null},r.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++)if(this.lines.get(t).row==e)return t;return null},t.GutterKeyboardHandler=r,a.prototype.getKey=function(){return n.keyCodeToString(this.domEvent.keyCode)},a.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},a.prototype.isInAnnotationLane=function(){return"annotation"===this.gutterKeyboardHandler.activeLane},a.prototype.isInFoldLane=function(){return"fold"===this.gutterKeyboardHandler.activeLane};var s=a;function a(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}t.GutterKeyboardEvent=s})),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],(function(e,t,i){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=e("./lib/oop"),r=e("./lib/dom"),s=e("./lib/lang"),a=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,d=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,p=e("./search").Search,g=e("./range").Range,m=e("./lib/event_emitter").EventEmitter,f=e("./commands/command_manager").CommandManager,y=e("./commands/default_commands").commands,v=e("./config"),C=e("./token_iterator").TokenIterator,I=e("./line_widgets").LineWidgets,b=e("./keyboard/gutter_handler").GutterKeyboardHandler,A=e("./config").nls,w=e("./clipboard"),_=e("./lib/keys");function x(e,t,i){this.$toDestroy=[];var n=e.getContainerElement();this.container=n,this.renderer=e,this.id="editor"+ ++x.$uid,this.commands=new f(a.isMac?"mac":"win",y),"object"==typeof document&&(this.textInput=new l(e.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new h(this)),this.keyBinding=new d(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(t||i&&i.session||new u("")),v.resetOptions(this),i&&this.setOptions(i),v._signal("editor",this)}x.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},x.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},x.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if((1!=e||!this.curOp.command||"mouse"!=this.curOp.command.name)&&(this._signal("beforeEndOperation"),this.curOp)){var t=(e=this.curOp.command)&&e.scrollIntoView;if(t){switch(t){case"center-animate":t="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),n=this.renderer.layerConfig;(i.start.row>=n.lastRow||i.end.row<=n.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}e=this.selection.toJSON(),this.curOp.selectionAfter=e,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(e),this.prevOp=this.curOp,this.curOp=null}}},x.prototype.$historyTracker=function(e){var t,i,n,o;this.$mergeUndoDeltas&&(t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name,"insertstring"==e.command.name?(o=e.args,void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0):n=n&&-1!==i.indexOf(e.command.name),(n=!("always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime)&&n)?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now()))},x.prototype.setKeyboardHandler=function(e,t){var i;e&&"string"==typeof e&&"ace"!=e?(this.$keybindingId=e,i=this,v.loadModule(["keybinding",e],(function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()}))):(this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t())},x.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},x.prototype.setSession=function(e){var t,i;this.session!=e&&(this.curOp&&this.endOperation(),this.curOp={},(t=this.session)&&(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),(i=this.session.getSelection()).off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)),(this.session=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.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}),e&&e._signal("changeEditor",{editor:this}),e)&&!e.destroyed&&e.bgTokenizer.scheduleStart()},x.prototype.getSession=function(){return this.session},x.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},x.prototype.getValue=function(){return this.session.getValue()},x.prototype.getSelection=function(){return this.selection},x.prototype.resize=function(e){this.renderer.onResize(e)},x.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},x.prototype.getTheme=function(){return this.renderer.getTheme()},x.prototype.setStyle=function(e){this.renderer.setStyle(e)},x.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},x.prototype.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},x.prototype.setFontSize=function(e){this.setOption("fontSize",e)},x.prototype.$highlightBrackets=function(){var e;this.$highlightPending||((e=this).$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t,i,n,o,r=e.session;r&&!r.destroyed&&(r.$bracketHighlight&&(r.$bracketHighlight.markerIds.forEach((function(e){r.removeMarker(e)})),r.$bracketHighlight=null),t=e.getCursorPosition(),i=(i=e.getKeyboardHandler())&&i.$getDirectionForHighlight&&i.$getDirectionForHighlight(e),(i=r.getMatchingBracketRanges(t,i))||(n=new C(r,t.row,t.column).getCurrentToken())&&/\b(?:tag-open|tag-name)/.test(n.type)&&(n=r.getMatchingTags(t))&&(i=[n.openTagName,n.closeTagName]),(i=!i&&r.$mode.getMatching?r.$mode.getMatching(e.session):i)&&(o="ace_bracket",Array.isArray(i)?1==i.length&&(o="ace_error_bracket"):i=[i],2==i.length&&(0==g.comparePoints(i[0].end,i[1].start)?i=[g.fromPoints(i[0].start,i[1].end)]:0==g.comparePoints(i[0].start,i[1].end)&&(i=[g.fromPoints(i[1].start,i[0].end)])),r.$bracketHighlight={ranges:i,markerIds:i.map((function(e){return r.addMarker(e,o,"text")}))}),e.getHighlightIndentGuides())&&e.renderer.$textLayer.$highlightIndentGuide()}),50))},x.prototype.focus=function(){this.textInput.focus()},x.prototype.isFocused=function(){return this.textInput.isFocused()},x.prototype.blur=function(){this.textInput.blur()},x.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},x.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},x.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},x.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange()},x.prototype.onTokenizerUpdate=function(e){e=e.data,this.renderer.updateLines(e.first,e.last)},x.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},x.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},x.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},x.prototype.$updateHighlightActiveLine=function(){var e,t,i=this.getSession();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()||1<this.renderer.$minLines||(e=!1)),i.$highlightLineMarker&&!e?(i.removeMarker(i.$highlightLineMarker.id),i.$highlightLineMarker=null):!i.$highlightLineMarker&&e?((t=new g(e.row,e.column,e.row,1/0)).id=i.addMarker(t,"ace_active-line","screenLine"),i.$highlightLineMarker=t):e&&(i.$highlightLineMarker.start.row=e.row,i.$highlightLineMarker.end.row=e.row,i.$highlightLineMarker.start.column=e.column,i._signal("changeBackMarker"))},x.prototype.onSelectionChange=function(e){var t,i,n=((n=this.session).$selectionMarker&&n.removeMarker(n.$selectionMarker),n.$selectionMarker=null,this.selection.isEmpty()?this.$updateHighlightActiveLine():(t=this.selection.getRange(),i=this.getSelectionStyle(),n.$selectionMarker=n.addMarker(t,"ace_selection",i)),this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp());this.session.highlight(n),this._signal("changeSelection")},x.prototype.$getSelectionHighLightRegexp=function(){var e=this.session;if(!(t=this.getSelectionRange()).isEmpty()&&!t.isMultiLine()){var t,i=t.start.column,n=t.end.column;if(!(5e3<(t=(e=e.getLine(t.start.row)).substring(i,n)).length)&&/[\w\d]/.test(t)&&(t=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:t}),e=e.substring(i-1,n+1),t.test(e)))return t}},x.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},x.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},x.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},x.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},x.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},x.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},x.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},x.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},x.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},x.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),o=0;o<n.length;o++){var r=n[o];o&&n[o-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var s={text:e};return this._signal("copy",s),w.lineMode=!!i&&s.text,s.text},x.prototype.onCopy=function(){this.commands.exec("copy",this)},x.prototype.onCut=function(){this.commands.exec("cut",this)},x.prototype.onPaste=function(e,t){this.commands.exec("paste",this,{text:e,event:t})},x.prototype.$handlePaste=function(e){this._signal("paste",e="string"==typeof e?{text:e}:e);var t=e.text,i=(e=t===w.lineMode,this.session);if(!this.inMultiSelectMode||this.inVirtualSelectionMode)e?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(e)this.selection.rangeList.ranges.forEach((function(e){i.insert({row:e.start.row,column:0},t)}));else{var n=t.split(/\r\n|\r|\n/),o=this.selection.rangeList.ranges;if(e=!(2!=n.length||n[0]&&n[1]),n.length!=o.length||e)return this.commands.exec("insertstring",this,t);for(var r=o.length;r--;){var s=o[r];s.isEmpty()||i.remove(s),i.insert(s.start,n[r])}}},x.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)},x.prototype.insert=function(e,t){var i,n=this.session,o=n.getMode(),r=this.getCursorPosition(),s=(this.getBehavioursEnabled()&&!t&&(i=o.transformAction(n.getState(r.row),"insertion",this,n,e))&&(e===i.text||this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1),e=i.text),"\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()?this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=new g.fromPoints(r,r)).end.column+=e.length,this.session.remove(s)):(s=this.getSelectionRange(),r=this.session.remove(s),this.clearSelection()),"\n"!=e&&"\r\n"!=e||(a=n.getLine(r.row),r.column>a.search(/\S|$/)&&(t=a.substr(r.column).search(/\S|$/),n.doc.removeInLine(r.row,r.column,r.column+t))),this.clearSelection(),r.column),a=(t=n.getState(r.row),n.getLine(r.row)),l=o.checkOutdent(t,a,e);n.insert(r,e),i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new g(r.row,s+i.selection[0],r.row,s+i.selection[1])):this.selection.setSelectionRange(new g(r.row+i.selection[0],i.selection[1],r.row+i.selection[2],i.selection[3]))),this.$enableAutoIndent&&(n.getDocument().isNewLine(e)&&(s=o.getNextLineIndent(t,a.slice(0,r.column),n.getTabString()),n.insert({row:r.row+1,column:0},s)),l)&&o.autoOutdent(t,n,r.row)},x.prototype.autoIndent=function(){for(var e,t,i,n,o,r=this.session,s=r.getMode(),a=(i=this.selection.isEmpty()?(t=0,r.doc.getLength()-1):(t=(e=this.getSelectionRange()).start.row,e.end.row),""),l="",c=r.getTabString(),h=t;h<=i;h++)0<h&&(a=r.getState(h-1),n=r.getLine(h-1),l=s.getNextLineIndent(a,n,c)),n=r.getLine(h),l!==(o=s.$getIndent(n))&&(0<o.length&&(o=new g(h,0,h,o.length),r.remove(o)),0<l.length)&&r.insert({row:h,column:0},l),s.autoOutdent(a,r,h)},x.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}}),e=this.applyComposition.bind(this,e,t),this.selection.rangeCount?this.forEachSelection(e):e(),this.endOperation()},x.prototype.applyComposition=function(e,t){var i;(t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,i.start.column<0&&(i.start.row--,i.start.column+=this.session.getLine(i.start.row).length+1),this.selection.setRange(i),e||i.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((i=this.selection.getRange()).start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i))},x.prototype.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)},x.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},x.prototype.getOverwrite=function(){return this.session.getOverwrite()},x.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},x.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},x.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},x.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},x.prototype.getDragDelay=function(){return this.getOption("dragDelay")},x.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},x.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},x.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},x.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},x.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},x.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},x.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},x.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},x.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},x.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},x.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},x.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},x.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},x.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},x.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},x.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},x.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},x.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},x.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},x.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},x.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},x.prototype.getReadOnly=function(){return this.getOption("readOnly")},x.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},x.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},x.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},x.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},x.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},x.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},x.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},x.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},x.prototype.remove=function(e){var t,i,n;this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight()),e=this.getSelectionRange(),this.getBehavioursEnabled()&&(i=(t=this.session).getState(e.start.row),i=t.getMode().transformAction(i,"deletion",this,t,e),0===e.end.column&&"\n"==(n=t.getTextRange(e))[n.length-1]&&(n=t.getLine(e.end.row),/^\s+$/.test(n))&&(e.end.column=n.length),i)&&(e=i),this.session.remove(e),this.clearSelection()},x.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},x.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},x.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},x.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()},x.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},x.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new I(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},x.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},x.prototype.transposeLetters=function(){var e,t,i,n;this.selection.isEmpty()&&0!==(t=(e=this.getCursorPosition()).column)&&(n=t<(n=this.session.getLine(e.row)).length?(i=n.charAt(t)+n.charAt(t-1),new g(e.row,t-1,e.row,t+1)):(i=n.charAt(t-1)+n.charAt(t-2),new g(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end))},x.prototype.toLowerCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},x.prototype.toUpperCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},x.prototype.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i,n=e.getTextRange(t);if(!/^\s+$/.test(n))return i=this.$getSelectedRows(),void e.indentRows(i.first,i.last,"\t")}var o=e.getLine(t.start.row),r=(n=t.start,e.getTabSize());if(n=e.documentToScreenColumn(n.row,n.column),this.session.getUseSoftTabs())var a=r-n%r,l=s.stringRepeat(" ",a);else{for(a=n%r;" "==o[t.start.column-1]&&a;)t.start.column--,a--;this.selection.setSelectionRange(t),l="\t"}return this.insert(l)}i=this.$getSelectedRows(),e.indentRows(i.first,i.last,"\t")},x.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},x.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},x.prototype.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort((function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0}));var o=new g(0,0,0,0);for(n=e.first;n<=e.last;n++){var r=t.getLine(n);o.start.row=n,o.end.row=n,o.end.column=r.length,t.replace(o,i[n-e.first])}},x.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)},x.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},x.prototype.getNumberAt=function(e,t){for(var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g,n=(i.lastIndex=0,this.session.getLine(e));i.lastIndex<t;){var o=i.exec(n);if(o.index<=t&&o.index+o[0].length>=t)return{value:o[0],start:o.index,end:o.index+o[0].length}}return null},x.prototype.modifyNumber=function(e){var t,i,n,o=this.selection.getCursor().row,r=this.selection.getCursor().column,s=new g(o,r-1,o,r);s=this.session.getTextRange(s),!isNaN(parseFloat(s))&&isFinite(s)?(s=this.getNumberAt(o,r))&&(n=0<=s.value.indexOf(".")?s.start+s.value.indexOf(".")+1:s.end,t=s.start+s.value.length-n,i=parseFloat(s.value),i*=Math.pow(10,t),n!==s.end&&r<n?e*=Math.pow(10,s.end-r-1):e*=Math.pow(10,s.end-r),n=(i=(i+=e)/Math.pow(10,t)).toFixed(t),e=new g(o,s.start,o,s.end),this.session.replace(e,n),this.moveCursorTo(o,Math.max(s.start+1,r+n.length-s.value.length))):this.toggleWord()},x.prototype.toggleWord=function(){for(var e,t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=(this.selection.selectWord(),this.getSelectedText()),o=this.selection.getWordRange().start.column,r=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),a=i-o-1,l=(a<0&&(a=0),0),c=this,h=(n.match(/[A-Za-z0-9_]+/)&&r.forEach((function(i,r){e=l+i.length,l<=a&&a<=e&&(n=i,c.selection.clearSelection(),c.moveCursorTo(t,l+o),c.selection.selectTo(t,e+o)),l=e})),this.$toggleWordPairs),d=0;d<h.length;d++)for(var u=h[d],p=0;p<=1;p++){var g=+!p,m=n.match(new RegExp("^\\s?_?("+s.escapeRegExp(u[p])+")\\s?$","i"));m&&n.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(m[1])+")($|\\s)","g"))&&(m=n.replace(new RegExp(s.escapeRegExp(u[p]),"i"),(function(e){var t=u[g];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+u[g].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(m))}},x.prototype.findLinkAt=function(e,t){e=this.session.getLine(e).split(/((?:https?|ftp):\/\/[\S]+)/);var i,o,r,s=t,a=(s<0&&(s=0),0);try{for(var l=n(e),c=l.next();!c.done;c=l.next()){var h=c.value,d=a+h.length;if(a<=s&&s<=d&&h.match(/((?:https?|ftp):\/\/[\S]+)/)){r=h.replace(/[\s:.,'";}\]]+$/,"");break}a=d}}catch(e){i={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return r},x.prototype.openLink=function(){var e=this.selection.getCursor();return(e=this.findLinkAt(e.row,e.column))&&window.open(e,"_blank"),null!=e},x.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},x.prototype.duplicateSelection=function(){var e,t=this.selection,i=this.session,n=t.getRange(),o=t.isBackwards();n.isEmpty()?(e=n.start.row,i.duplicateLines(e,e)):(e=o?n.start:n.end,i=i.insert(e,i.getTextRange(n),!1),n.start=e,n.end=i,t.setSelectionRange(n,o))},x.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},x.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},x.prototype.moveText=function(e,t,i){return this.session.moveText(e,t,i)},x.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},x.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},x.prototype.$moveLines=function(e,t){var i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var n=i.toOrientedRange(),o=this.$getSelectedRows(n),r=this.session.$moveLines(o.first,o.last,t?0:e);n.moveBy(r=t&&-1==e?0:r,0),i.fromOrientedRange(n)}else{for(var s=i.rangeList.ranges,a=(i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0,0),l=0,c=s.length,h=0;h<c;h++){for(var d=h,u=(s[h].moveBy(a,0),(o=this.$getSelectedRows(s[h])).first),p=o.last;++h<c;){l&&s[h].moveBy(l,0);var g=this.$getSelectedRows(s[h]);if(t&&g.first!=p)break;if(!t&&g.first>p+1)break;p=g.last}for(h--,a=this.session.$moveLines(u,p,t?0:e),t&&-1==e&&(d=h+1);d<=h;)s[d].moveBy(a,0),d++;l+=a=t?a:0}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},x.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},x.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},x.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},x.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},x.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},x.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},x.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},x.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},x.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},x.prototype.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,o=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(o,0)})):!1===t&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection()),e=i.scrollTop,i.scrollBy(0,o*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(e)},x.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},x.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},x.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},x.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},x.prototype.scrollPageDown=function(){this.$moveByPage(1)},x.prototype.scrollPageUp=function(){this.$moveByPage(-1)},x.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},x.prototype.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},x.prototype.centerSelection=function(){var e=this.getSelectionRange();e={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(e,.5)},x.prototype.getCursorPosition=function(){return this.selection.getCursor()},x.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},x.prototype.getSelectionRange=function(){return this.selection.getRange()},x.prototype.selectAll=function(){this.selection.selectAll()},x.prototype.clearSelection=function(){this.selection.clearSelection()},x.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},x.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},x.prototype.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new C(this.session,i.row,i.column),o=n.getCurrentToken(),r=0,s=(o=o&&-1!==o.type.indexOf("tag-name")?n.stepBackward():o)||n.stepForward();if(s){var a,l,c=!1,h={},d=i.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;d<s.value.length&&!c;d++)if(u[s.value[d]])switch(l=u[s.value[d]]+"."+s.type.replace("rparen","lparen"),isNaN(h[l])&&(h[l]=0),s.value[d]){case"(":case"[":case"{":h[l]++;break;case")":case"]":case"}":h[l]--,-1===h[l]&&(a="bracket",c=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(h[s.value])&&(h[s.value]=0),"<"===o.value&&1<r?h[s.value]++:"</"===o.value&&h[s.value]--,-1===h[s.value])&&(a="tag",c=!0)}while(c||(o=s,r++,s=n.stepForward(),d=0),s&&!c);if(a){if("bracket"===a)!(m=this.session.getBracketRange(i))&&(f=(m=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1)).start,t||f.row===i.row&&Math.abs(f.column-i.column)<2)&&(m=this.session.getBracketRange(f));else if("tag"===a){if(!s||-1===s.type.indexOf("tag-name"))return;var p,m,f=(f=0===(m=new g(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column)&&(p=this.session.getMatchingTags(i))?p.openTag.contains(i.row,i.column)?(m=p.closeTag).start:(m=p.openTag,p.closeTag.start.row===i.row&&p.closeTag.start.column===i.column?m.end:m.start):f)||m.start}(f=m&&m.cursor||f)&&(e?m&&t?this.selection.setRange(m):m&&m.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},x.prototype.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},x.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)},x.prototype.navigateUp=function(e){var t;if(this.selection.isMultiLine()&&!this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},x.prototype.navigateDown=function(e){var t;if(this.selection.isMultiLine()&&this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},x.prototype.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},x.prototype.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},x.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},x.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},x.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},x.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},x.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},x.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},x.prototype.replace=function(e,t){t&&this.$search.set(t);var i=0;return(t=this.$search.find(this.session))&&(this.$tryReplace(t,e)&&(i=1),this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),i},x.prototype.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(i.length){t=this.getSelectionRange(),this.selection.moveTo(0,0);for(var o=i.length-1;0<=o;--o)this.$tryReplace(i[o],e)&&n++;this.selection.setSelectionRange(t)}return n},x.prototype.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},x.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},x.prototype.find=function(e,t,i){t=t||{},"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&o.mixin(t,e);var n=this.selection.getRange();return 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}),e=this.$search.find(this.session),t.preventScroll?e:e?(this.revealRange(e,i),e):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},x.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},x.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},x.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},x.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},x.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},x.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()},x.prototype.setAutoScrollEditorIntoView=function(e){var t,i,n,o,r,s,a;e&&(n=!1,(i=this).$scrollAnchor||(this.$scrollAnchor=document.createElement("div")),(o=this.$scrollAnchor).style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild),r=this.on("changeSelection",(function(){n=!0})),s=this.renderer.on("beforeRender",(function(){n&&(t=i.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){var e,r,s;n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())&&(e=(r=i.renderer).$cursorLayer.$pixelPos,r=r.layerConfig,s=e.top-r.offset,null!=(n=0<=e.top&&s+t.top<0||!(e.top<r.height&&e.top+t.top+r.lineHeight>window.innerHeight)&&null)&&(o.style.top=s+"px",o.style.left=e.left+"px",o.style.height=r.lineHeight+"px",o.scrollIntoView(n)),n=t=null)})),this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",r),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))})},x.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,r.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},x.prototype.prompt=function(e,t,i){var n=this;v.loadModule("ace/ext/prompt",(function(o){o.prompt(n,e,t,i)}))},(e=x).$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"],["&&","||"],["==","!="]],o.implement(e.prototype,m),v.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){this.textInput.setReadOnly(e),this.$resetCursorStyle()},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?S.attach(this):S.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?S.attach(this):S.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||1<this.session.getLength()||0<this.session.getLine(0).length);e&&this.renderer.placeholderNode?(this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null):e||this.renderer.placeholderNode?!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||""):(this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder"),(e=r.createElement("div")).className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode))}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){function t(e){e.target==this.renderer.scroller&&e.keyCode===_.enter&&(e.preventDefault(),e=this.getCursorPosition().row,this.isRowVisible(e)||this.scrollToLine(e,!0,!0),this.focus())}var i,n={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};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(a.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",A("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",A("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",t.bind(this)),this.commands.addCommand(n),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",A("editor")),this.renderer.$gutter.setAttribute("aria-label",A("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),(i=i||new b(this)).addListener()):(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",t.bind(this)),this.commands.removeCommand(n),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),i&&i.removeListener())},initialValue:!1},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 S={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){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,i){"use strict";var n=e("../lib/dom");function o(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}o.prototype.moveContainer=function(e){n.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},o.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},o.prototype.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight;return n=Math.floor(n/this.canvasHeight),i.documentToScreenRow(e,0)*t.lineHeight-n*this.canvasHeight},o.prototype.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)},o.prototype.getLength=function(){return this.cells.length},o.prototype.get=function(e){return this.cells[e]},o.prototype.shift=function(){this.$cacheCell(this.cells.shift())},o.prototype.pop=function(){this.$cacheCell(this.cells.pop())},o.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},o.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},o.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},o.prototype.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},o.prototype.createCell=function(e,t,i,o){var r,s=this.cellCache.pop();return s||(r=n.createElement("div"),o&&o(r),this.element.appendChild(r),s={element:r,text:"",row:e}),s.row=e,s},t.Lines=o})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=e("../config").nls;function c(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1}function h(e){var t=document.createTextNode(""),i=(e.appendChild(t),t=n.createElement("span"),e.appendChild(t),t=n.createElement("span"),e.appendChild(t),n.createElement("span"));return t.appendChild(i),e}c.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),(this.session=e)&&e.on("change",this.$updateAnnotations)},c.prototype.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},c.prototype.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},c.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,o=(o=this.$annotations[n])||(this.$annotations[n]={text:[],type:[]}),s=(n=i.text,i.type);n=n?r.escapeHTML(n):i.html||"",-1===o.text.indexOf(n)&&(o.text.push(n),o.type.push(s)),(n=i.className)?o.className=n:"error"==s?o.className=" ace_error":"warning"==s&&" ace_error"!=o.className?o.className=" ace_warning":"info"!=s||o.className||(o.className=" ace_info")}},c.prototype.$updateAnnotations=function(e){var t,i;this.$annotations.length&&(t=e.start.row,0!=(i=e.end.row-t))&&("remove"==e.action?this.$annotations.splice(t,1+i,null):((e=new Array(1+i)).unshift(t,1),this.$annotations.splice.apply(this.$annotations,e)))},c.prototype.update=function(e){this.config=e;for(var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1),o=(this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow(),t.getNextFoldLine(i)),r=o?o.start.row:1/0,s=null,a=-1,l=i;;){if(r<l&&(l=o.end.row+1,r=(o=t.getNextFoldLine(l,o))?o.start.row:1/0),n<l){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,e,this.session,h),this.$lines.push(s)),this.$renderCell(s,e,o,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},c.prototype.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,o=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(o=t.getLength()+n-1),n=i?i.getWidth(t,o,e):o.toString().length*e.characterWidth,(n+=(i=this.$padding||this.$computePadding()).left+i.right)===this.gutterWidth||isNaN(n)||(this.gutterWidth=n,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",n))},c.prototype.$updateCursorRow=function(){var e;this.$highlightGutterLine&&(e=this.session.selection.getCursor(),this.$cursorRow!==e.row)&&(this.$cursorRow=e.row)},c.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 i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var o=this.session.getFoldLine(this.$cursorRow);if(!(0<i&&o&&o.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},c.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 i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<o;o--)this.$lines.shift();if(i<n)for(o=this.session.getFoldedRowCount(i+1,n);0<o;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n<i&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},c.prototype.$renderLines=function(e,t,i){for(var n=[],o=t,r=this.session.getNextFoldLine(o),s=r?r.start.row:1/0;s<o&&(o=r.end.row+1,s=(r=this.session.getNextFoldLine(o,r))?r.start.row:1/0),!(i<o);){var a=this.$lines.createCell(o,e,this.session,h);this.$renderCell(a,e,r,o),n.push(a),o++}return n},c.prototype.$renderCell=function(e,t,i,o){var r,s=e.element,a=this.session,c=s.childNodes[0],h=s.childNodes[1],d=s.childNodes[2],u=d.firstChild,p=a.$firstLineNumber,g=a.$breakpoints,m=a.$decorations,f=a.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&a.foldWidgets,v=i?i.start.row:Number.MAX_VALUE,C=t.lineHeight+"px",I=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",b=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";if(f=(f?f.getText(a,o):o+p).toString(),this.$highlightGutterLine&&(o==this.$cursorRow||i&&o<this.$cursorRow&&v<=o&&this.$cursorRow<=i.end.row)&&(I+="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),g[o]&&(I+=g[o]),m[o]&&(I+=m[o]),this.$annotations[o]&&o!==v&&(I+=this.$annotations[o].className),r=y&&null==(r=y[o])?y[o]=a.getFoldWidget(o):r){if(p="ace_fold-widget ace_"+r,g="start"==r&&o==v&&o<i.end.row){p+=" ace_closed";for(var A="",w=!1,_=o+1;_<=i.end.row;_++)if(this.$annotations[_]){if(" ace_error"===this.$annotations[_].className){w=!0,A=" ace_error_fold";break}" ace_warning"===this.$annotations[_].className&&(w=!0,A=" ace_warning_fold")}I+=A}else p+=" ace_open";h.className!=p&&(h.className=p),n.setStyle(h.style,"height",C),n.setStyle(h.style,"display","inline-block"),h.setAttribute("role","button"),h.setAttribute("tabindex","-1"),(m=a.getFoldWidgetRange(o))?h.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[m.start.row+1,m.end.row+1])):i?h.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[i.start.row+1,i.end.row+1])):h.setAttribute("aria-label",l("Toggle code folding, row $0",[o+1])),g?(h.setAttribute("aria-expanded","false"),h.setAttribute("title",l("Unfold code"))):(h.setAttribute("aria-expanded","true"),h.setAttribute("title",l("Fold code")))}else h&&(n.setStyle(h.style,"display","none"),h.setAttribute("tabindex","0"),h.removeAttribute("role"),h.removeAttribute("aria-label"));return w&&this.$showFoldedAnnotations?(d.className="ace_gutter_annotation",u.className=b,u.className+=A,n.setStyle(u.style,"height",C),n.setStyle(d.style,"display","block"),n.setStyle(d.style,"height",C),d.setAttribute("aria-label",l("Read annotations row $0",[f])),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")):this.$annotations[o]?(d.className="ace_gutter_annotation",u.className=b,this.$useSvgGutterIcons?u.className+=this.$annotations[o].className:s.classList.add(this.$annotations[o].className.replace(" ","")),n.setStyle(u.style,"height",C),n.setStyle(d.style,"display","block"),n.setStyle(d.style,"height",C),d.setAttribute("aria-label",l("Read annotations row $0",[f])),d.setAttribute("tabindex","-1"),d.setAttribute("role","button")):(n.setStyle(d.style,"display","none"),d.removeAttribute("aria-label"),d.removeAttribute("role"),d.setAttribute("tabindex","0")),f!==c.data&&(c.data=f),s.className!=I&&(s.className=I),n.setStyle(e.element.style,"height",this.$lines.computeLineHeight(o,t,a)+"px"),n.setStyle(e.element.style,"top",this.$lines.computeLineTop(o,t,a)+"px"),e.text=f,"none"===d.style.display&&"none"===h.style.display?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},c.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},c.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},c.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},c.prototype.setShowFoldWidgets=function(e){e?n.addCssClass(this.element,"ace_folding-enabled"):n.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},c.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},c.prototype.$computePadding=function(){var e;return this.element.firstChild?(e=n.computedStyle(this.element.firstChild),this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding):{left:0,right:0}},c.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0},(e=c).prototype.$fixedWidth=!1,e.prototype.$highlightGutterLine=!0,e.prototype.$renderer="",e.prototype.$showLineNumbers=!0,e.prototype.$showFoldWidgets=!0,o.implement(e.prototype,s),t.Gutter=e})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../range").Range,o=e("../lib/dom");function r(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}r.prototype.setPadding=function(e){this.$padding=e},r.prototype.setSession=function(e){this.session=e},r.prototype.setMarkers=function(e){this.markers=e},r.prototype.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},r.prototype.update=function(e){if(e){var t,i;for(i in this.config=e,this.i=0,this.markers){var n,o,r,s=this.markers[i];s.range?(r=s.range.clipRows(e.firstRow,e.lastRow)).isEmpty()||(r=r.toScreenRange(this.session),s.renderer?(n=this.$getTop(r.start.row,e),o=this.$padding+r.start.column*e.characterWidth,s.renderer(t,r,o,n,e)):"fullLine"==s.type?this.drawFullLineMarker(t,r,s.clazz,e):"screenLine"==s.type?this.drawScreenLineMarker(t,r,s.clazz,e):r.isMultiLine()?"text"==s.type?this.drawTextMarker(t,r,s.clazz,e):this.drawMultiLineMarker(t,r,s.clazz,e):this.drawSingleLineMarker(t,r,s.clazz+" ace_start ace_br15",e)):s.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},r.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},r.prototype.drawTextMarker=function(e,t,i,o,r){for(var s,a=this.session,l=t.start.row,c=t.end.row,h=l,d=0,u=a.getScreenLastRowColumn(h),p=new n(h,t.start.column,h,d);h<=c;h++)p.start.row=p.end.row=h,p.start.column=h==l?t.start.column:a.getRowWrapIndent(h),p.end.column=u,s=d,d=u,u=h+1<c?a.getScreenLastRowColumn(h+1):h==c?0:t.end.column,this.drawSingleLineMarker(e,p,i+(h==l?" ace_start":"")+" ace_br"+((h==l||h==l+1&&t.start.column?1:0)|(s<d?2:0)|(u<d?4:0)|(h==c?8:0)),o,h==c?0:1,r)},r.prototype.drawMultiLineMarker=function(e,t,i,n,o){var r,s=this.$padding,a=n.lineHeight,l=this.$getTop(t.start.row,n),c=s+t.start.column*n.characterWidth;o=o||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((r=t.clone()).end.row=r.start.row,r.end.column=this.session.getLine(r.start.row).length,this.drawBidiSingleLineMarker(e,r,i+" ace_br1 ace_start",n,null,o)):this.elt(i+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(o||"")),this.session.$bidiHandler.isBidiRow(t.end.row)?((r=t.clone()).start.row=r.end.row,r.start.column=0,this.drawBidiSingleLineMarker(e,r,i+" ace_br12",n,null,o)):(l=this.$getTop(t.end.row,n),c=t.end.column*n.characterWidth,this.elt(i+" ace_br12","height:"+a+"px;width:"+c+"px;top:"+l+"px;left:"+s+"px;"+(o||""))),(a=(t.end.row-t.start.row-1)*n.lineHeight)<=0||(l=this.$getTop(t.start.row+1,n),e=(t.start.column?1:0)|(t.end.column?0:8),this.elt(i+(e?" ace_br"+e:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+s+"px;"+(o||"")))},r.prototype.drawSingleLineMarker=function(e,t,i,n,o,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,o,r);e=n.lineHeight,o=(t.end.column+(o||0)-t.start.column)*n.characterWidth;var s=this.$getTop(t.start.row,n);t=this.$padding+t.start.column*n.characterWidth,this.elt(i,"height:"+e+"px;width:"+o+"px;top:"+s+"px;left:"+t+"px;"+(r||""))},r.prototype.drawBidiSingleLineMarker=function(e,t,i,n,o,r){var s=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(i,"height:"+s+"px;width:"+(e.width+(o||0))+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))}),this)},r.prototype.drawFullLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,n)-r),this.elt(i,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},r.prototype.drawScreenLineMarker=function(e,t,i,n,o){t=this.$getTop(t.start.row,n),n=n.lineHeight,this.elt(i,"height:"+n+"px;top:"+t+"px;left:0;right:0;"+(o||""))},(e=r).prototype.$padding=0,t.Marker=e})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,i){var n=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return n.has(e)}})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken;function h(e){this.dom=o,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}h.prototype.$updateEolChar=function(){var e="\n"==(e=this.session.doc).getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},h.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},h.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},h.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},h.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},h.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},h.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},h.prototype.setSession=function(e){(this.session=e)&&this.$computeTabString()},h.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&("string"==typeof(this.showInvisibles=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)},h.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},h.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e)},h.prototype.$computeTabString=function(){for(var e,t,i,n,o,s,a=this.session.getTabSize(),l=(this.tabSize=a,this.$tabStrings=[0]),c=1;c<a+1;c++)this.showTabs?((s=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",s.textContent=r.stringRepeat(this.TAB_CHAR,c),l.push(s)):l.push(this.dom.createTextNode(r.stringRepeat(" ",c),this.element));this.displayIndentGuides&&(this.$indentGuideRe=/\s\S| \t|\t |\s$/,e="ace_indent-guide",t=this.showSpaces?" ace_invisible ace_invisible_space":"",i=this.showSpaces?r.stringRepeat(this.SPACE_CHAR,this.tabSize):r.stringRepeat(" ",this.tabSize),n=this.showTabs?" ace_invisible ace_invisible_tab":"",o=this.showTabs?r.stringRepeat(this.TAB_CHAR,this.tabSize):i,(s=this.dom.createElement("span")).className=e+t,s.textContent=i,this.$tabStrings[" "]=s,(s=this.dom.createElement("span")).className=e+n,s.textContent=o,this.$tabStrings["\t"]=s)},h.prototype.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),o=Math.min(i,e.lastRow),r=this.element.childNodes,s=0,a=e.firstRow;a<n;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(n)){n=l.start.row;break}a=l.end.row}s++}for(var l,c=!1,h=(a=n,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);h<a&&(a=l.end.row+1,h=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(o<a);){var d,u=r[s++];u&&(this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px"),d=e.lineHeight*this.session.getRowLength(a)+"px",u.style.height!=d)&&(c=!0,u.style.height=d),a++}if(c)for(;s<this.$lines.cells.length;){var p=this.$lines.cells[s++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+"px"}},h.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<o;o--)this.$lines.shift();if(t.lastRow>e.lastRow)for(o=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<o;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},h.prototype.$renderLinesFragment=function(e,t,i){for(var n=[],r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;a<r&&(r=s.end.row+1,a=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(i<r);){var l=this.$lines.createCell(r,e,this.session),c=l.element;this.dom.removeChildren(c),o.setStyle(c.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),o.setStyle(c.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(c,r,r==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",n.push(l),r++}return n},h.prototype.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},h.prototype.$renderToken=function(e,t,i,n){for(var o,s,a=this,h=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,d=this.dom.createFragment(this.element),u=0;o=h.exec(n);){var p,g,m=o[1],f=o[2],y=o[3],v=o[4],C=o[5];!a.showSpaces&&f||(p=u!=o.index?n.slice(u,o.index):"",u=o.index+o[0].length,p&&d.appendChild(this.dom.createTextNode(p,this.element)),m?(p=a.session.getScreenTabSize(t+o.index),d.appendChild(a.$tabStrings[p].cloneNode(!0)),t+=p-1):f?a.showSpaces?((g=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",g.textContent=r.stringRepeat(a.SPACE_CHAR,f.length),d.appendChild(g)):d.appendChild(this.dom.createTextNode(f,this.element)):y?((g=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",g.textContent=r.stringRepeat(a.SPACE_CHAR,y.length),d.appendChild(g)):v?(t+=1,(g=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",g.className=a.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",g.textContent=a.showSpaces?a.SPACE_CHAR:v,d.appendChild(g)):C&&(t+=1,(g=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",g.className="ace_cjk",g.textContent=C,d.appendChild(g)))}return d.appendChild(this.dom.createTextNode(u?n.slice(u):n,this.element)),c(i.type)?e.appendChild(d):(s="ace_"+i.type.replace(/\./g," ace_"),g=this.dom.createElement("span"),"fold"==i.type&&(g.style.width=i.value.length*this.config.characterWidth+"px",g.setAttribute("title",l("Unfold code"))),g.className=s,g.appendChild(d),e.appendChild(g)),t+n.length},h.prototype.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(!(n<=0||i<=n)){if(" "==t[0]){for(var o=(n-=n%this.tabSize)/this.tabSize,r=0;r<o;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(n)}if("\t"==t[0]){for(r=0;r<n;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(n)}this.$highlightIndentGuide()}return t},h.prototype.$highlightIndentGuide=function(){if(this.$highlightIndentGuides&&this.displayIndentGuides){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var t=this.session.selection.getCursor(),i=/^\s*/.exec(this.session.doc.getLine(t.row))[0].length,n=Math.floor(i/this.tabSize);if(this.$highlightIndentGuideMarker={indentLevel:n,start:t.row},this.session.$bracketHighlight)for(var o=this.session.$bracketHighlight.ranges,r=0;r<o.length;r++)if(t.row!==o[r].start.row){this.$highlightIndentGuideMarker.end=o[r].start.row,t.row>o[r].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,r=t.row+1;r<e.length;r++){var s=e[r],a=/^\s*/.exec(s)[0].length;if(""!==s&&(this.$highlightIndentGuideMarker.end=r,a<=i))break}this.$renderHighlightIndentGuide()}}},h.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,t=0;t<e.length;t++){var i=e[t].element.childNodes;if(0<i.length)for(var n=0;n<i.length;n++)if(i[n].classList&&i[n].classList.contains("ace_indent-guide-active")){i[n].classList.remove("ace_indent-guide-active");break}}},h.prototype.$setIndentGuideActive=function(e,t){""!==this.session.doc.getLine(e.row)&&(e=e.element.childNodes)&&(e=e[t-1])&&e.classList&&e.classList.contains("ace_indent-guide")&&e.classList.add("ace_indent-guide-active")},h.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells,t=(this.$clearActiveIndentGuide(),this.$highlightIndentGuideMarker.indentLevel);if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var i=0;i<e.length;i++){var n=e[i];if(this.$highlightIndentGuideMarker.end&&n.row>=this.$highlightIndentGuideMarker.start+1){if(n.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}else for(i=e.length-1;0<=i;i--)if(n=e[i],this.$highlightIndentGuideMarker.end&&n.row<this.$highlightIndentGuideMarker.start){if(n.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}},h.prototype.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},h.prototype.$renderWrappedLine=function(e,t,i){var n=0,o=0,s=i[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var h=t[c],d=h.value;if(0==c&&this.displayIndentGuides){if(n=d.length,!(d=this.renderIndentGuide(l,d,s)))continue;n-=d.length}if(n+d.length<s)a=this.$renderToken(l,a,h,d),n+=d.length;else{for(;n+d.length>=s;)a=this.$renderToken(l,a,h,d.substring(0,s-n)),d=d.substring(s-n),n=s,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(r.stringRepeat(" ",i.indent),this.element)),a=0,s=i[++o]||Number.MAX_VALUE;0!=d.length&&(n+=d.length,a=this.$renderToken(l,a,h,d))}}i[i.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},h.prototype.$renderSimpleLine=function(e,t){for(var i=0,n=0;n<t.length;n++){var o=t[n],r=o.value;if(0!=n||!this.displayIndentGuides||(r=this.renderIndentGuide(e,r))){if(i+r.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,o,r);i=this.$renderToken(e,i,o,r)}}},h.prototype.$renderOverflowMessage=function(e,t,i,n,o){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t)),(i=this.dom.createElement("span")).className="ace_inline_button ace_keyword ace_toggle_wrap",i.textContent=o?"<hide>":"<click to see more...>",e.appendChild(i)},h.prototype.$renderLine=function(e,t,i){var n,o,r=e;(n=(i=i||0==i?i:this.session.getFoldLine(t))?this.$getFoldLineTokens(t,i):this.session.getTokens(t)).length?(o=this.session.getRowSplitData(t))&&o.length?(this.$renderWrappedLine(e,n,o),r=e.lastChild):(r=e,this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r)),this.$renderSimpleLine(r,n)):this.$useLineGroups()&&(r=this.$createLineElement(),e.appendChild(r)),this.showEOL&&r&&(i&&(t=i.end.row),(o=this.dom.createElement("span")).className="ace_invisible ace_invisible_eol",o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,r.appendChild(o))},h.prototype.$getFoldLineTokens=function(e,t){var i=this.session,n=[],o=i.getTokens(e);return t.walk((function(e,t,r,s,a){if(null!=e)n.push({type:"fold",value:e});else if((o=a?i.getTokens(t):o).length){for(var l,c=o,h=s,d=r,u=0,p=0;p+c[u].value.length<h;)if(p+=c[u].value.length,++u==c.length)return;for(p!=h&&((l=c[u].value.substring(h-p)).length>d-h&&(l=l.substring(0,d-h)),n.push({type:c[u].type,value:l}),p=h+l.length,u+=1);p<d&&u<c.length;)(l=c[u].value).length+p>d?n.push({type:c[u].type,value:l.substring(0,d-p)}):n.push(c[u]),p+=l.length,u+=1}}),t.end.row,this.session.getLine(t.end.row).length),n},h.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},(e=h).prototype.EOF_CHAR="¶",e.prototype.EOL_CHAR_LF="¬",e.prototype.EOL_CHAR_CRLF="¤",e.prototype.EOL_CHAR=e.prototype.EOL_CHAR_LF,e.prototype.TAB_CHAR="—",e.prototype.SPACE_CHAR="·",e.prototype.$padding=0,e.prototype.MAX_LINE_LENGTH=1e4,e.prototype.showInvisibles=!1,e.prototype.showSpaces=!1,e.prototype.showTabs=!1,e.prototype.showEOL=!1,e.prototype.displayIndentGuides=!0,e.prototype.$highlightIndentGuides=!0,e.prototype.$tabStrings=[],e.prototype.destroy={},e.prototype.onChangeTabSize=e.prototype.$computeTabString,n.implement(e.prototype,a),t.Text=e})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom");function o(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)}o.prototype.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)n.setStyle(t[i].style,"opacity",e?"":"0")},o.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))},o.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,n.removeCssClass(this.element,"ace_animate-blinking")},o.prototype.setPadding=function(e){this.$padding=e},o.prototype.setSession=function(e){this.session=e},o.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},o.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},o.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},o.prototype.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},o.prototype.removeCursor=function(){var e;if(1<this.cursors.length)return(e=this.cursors.pop()).parentNode.removeChild(e),e},o.prototype.hideCursor=function(){this.isVisible=!1,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},o.prototype.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},o.prototype.restartTimer=function(){var e,t=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,n.removeCssClass(this.element,"ace_smooth-blinking")),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible?(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),n.HAS_CSS_ANIMATION?this.$startCssAnimation():(e=function(){this.timeoutId=setTimeout((function(){t(!1)}),.6*this.blinkInterval)}.bind(this),this.intervalId=setInterval((function(){t(!0),e()}),this.blinkInterval),e())):this.$stopCssAnimation()},o.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e=e||this.session.selection.getCursor();var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},o.prototype.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},o.prototype.update=function(e){this.config=e;for(var t=this.session.$selectionMarkers,i=0,o=0,r=(i=0,(t=void 0!==t&&0!==t.length?t:[{cursor:null}]).length);i<r;i++){var s,a,l=this.getPixelPosition(t[i].cursor,!0);(l.top>e.height+e.offset||l.top<0)&&1<i||(a=(s=this.cursors[o++]||this.addCursor()).style,this.drawCursor?this.drawCursor(s,l,e,t[i],this.session):this.isCursorInView(l,e)?(n.setStyle(a,"display","block"),n.translate(s,l.left,l.top),n.setStyle(a,"width",Math.round(e.characterWidth)+"px"),n.setStyle(a,"height",e.lineHeight+"px")):n.setStyle(a,"display","none"))}for(;this.cursors.length>o;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=l,this.restartTimer()},o.prototype.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},o.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},(e=o).prototype.$padding=0,e.prototype.drawCursor=null,t.Cursor=e})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o,r,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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),a=e("./lib/oop"),l=e("./lib/dom"),c=e("./lib/event"),h=(e=e("./lib/event_emitter").EventEmitter,d.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},d);function d(e,t){this.element=l.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=l.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,c.addListener(this.element,"scroll",this.onScroll.bind(this)),c.addListener(this.element,"mousedown",c.preventDefault)}function u(e,t){var i=o.call(this,e,"-v")||this;return i.scrollTop=0,i.scrollHeight=0,t.$scrollbarWidth=i.width=l.scrollbarWidth(e.ownerDocument),i.inner.style.width=i.element.style.width=(i.width||15)+5+"px",i.$minWidth=0,i}function p(e,t){return(e=r.call(this,e,"-h")||this).scrollLeft=0,e.height=t.$scrollbarWidth,e.inner.style.height=e.element.style.height=(e.height||15)+5+"px",e}a.implement(h.prototype,e),s(u,o=h),u.prototype.onScroll=function(){var e;this.skipEvent||(this.scrollTop=this.element.scrollTop,1!=this.coeff&&(e=this.element.clientHeight/this.scrollHeight,this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)),this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(e){this.element.style.height=e+"px"},u.prototype.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},u.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},(a=u).prototype.setInnerHeight=a.prototype.setScrollHeight,s(p,r=h),p.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},p.prototype.getHeight=function(){return this.isVisible?this.height:0},p.prototype.setWidth=function(e){this.element.style.width=e+"px"},p.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},p.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},p.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},e=p,t.ScrollBar=a,t.ScrollBarV=a,t.ScrollBarH=e,t.VScrollBar=a,t.HScrollBar=e})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o,r,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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}))(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 i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),a=e("./lib/oop"),l=e("./lib/dom"),c=e("./lib/event"),h=(e=e("./lib/event_emitter").EventEmitter,l.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),d.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},d);function d(e,t){this.element=l.createElement("div"),this.element.className="ace_sb"+t,this.inner=l.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,c.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}function u(e,t){var i=o.call(this,e,"-v")||this;return i.scrollTop=0,i.scrollHeight=0,i.parent=e,i.width=i.VScrollWidth,i.renderer=t,i.inner.style.width=i.element.style.width=(i.width||15)+"px",i.$minWidth=0,i}function p(e,t){return(e=r.call(this,e,"-h")||this).scrollLeft=0,e.scrollWidth=0,e.height=e.HScrollHeight,e.inner.style.height=e.element.style.height=(e.height||12)+"px",e.renderer=t,e}a.implement(h.prototype,e),s(u,o=h),u.prototype.onMouseDown=function(e,t){var i,n,o,r,s;if("mousedown"===e&&0===c.getButton(t)&&2!==t.detail)return t.target===this.inner?(i=this,n=t.clientY,o=t.clientY,r=this.thumbTop,c.capture(this.inner,(function(e){n=e.clientY}),(function(){clearInterval(s)})),s=setInterval((function(){var e;void 0!==n&&(e=i.scrollTopFromThumbTop(r+n-o))!==i.scrollTop&&i._emit("scroll",{data:e})}),20)):(e=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2,this._emit("scroll",{data:this.scrollTopFromThumbTop(e)})),c.preventDefault(t)},u.prototype.getHeight=function(){return this.height},u.prototype.scrollTopFromThumbTop=function(e){return e=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight),(e>>=0)<0?e=0:e>this.pageHeight-this.viewHeight&&(e=this.pageHeight-this.viewHeight),e},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},u.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}))},u.prototype.setScrollTop=function(e){this.scrollTop=e,this.thumbTop=(e=e<0?0:e)*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},(a=u).prototype.setInnerHeight=a.prototype.setScrollHeight,s(p,r=h),p.prototype.onMouseDown=function(e,t){var i,n,o,r,s;if("mousedown"===e&&0===c.getButton(t)&&2!==t.detail)return t.target===this.inner?(i=this,n=t.clientX,o=t.clientX,r=this.thumbLeft,c.capture(this.inner,(function(e){n=e.clientX}),(function(){clearInterval(s)})),s=setInterval((function(){var e;void 0!==n&&(e=i.scrollLeftFromThumbLeft(r+n-o))!==i.scrollLeft&&i._emit("scroll",{data:e})}),20)):(e=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2,this._emit("scroll",{data:this.scrollLeftFromThumbLeft(e)})),c.preventDefault(t)},p.prototype.getHeight=function(){return this.isVisible?this.height:0},p.prototype.scrollLeftFromThumbLeft=function(e){return e=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth),(e>>=0)<0?e=0:e>this.pageWidth-this.viewWidth&&(e=this.pageWidth-this.viewWidth),e},p.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)},p.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}))},p.prototype.setScrollLeft=function(e){this.scrollLeft=e,this.thumbLeft=(e=e<0?0:e)*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},(e=p).prototype.setInnerWidth=e.prototype.setScrollWidth,t.ScrollBar=a,t.ScrollBarV=a,t.ScrollBarH=e,t.VScrollBar=a,t.HScrollBar=e})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,i){"use strict";var n=e("./lib/event");function o(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;t&&(n.blockIdle(100),i.changes=0,i.onRender(t)),i.changes?i.$recursionLimit--<0||i.schedule():i.$recursionLimit=2}}o.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},o.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},t.RenderLoop=o})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,i){var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=(e=e("../lib/event_emitter").EventEmitter,"function"==typeof ResizeObserver),c=(h.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},h.prototype.checkForSizeChanges=function(e){var t;!(e=void 0===e?this.$measureSizes():e)||this.$characterSize.width===e.width&&this.$characterSize.height===e.height||(this.$measureNode.style.fontWeight="bold",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}))},h.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},h.prototype.$pollSizeChanges=function(){var e;return this.$pollSizeChangesTimer||this.$observer?this.$pollSizeChangesTimer:(e=this).$pollSizeChangesTimer=s.onIdle((function t(){e.checkForSizeChanges(),s.onIdle(t,500)}),500)},h.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},h.prototype.$measureSizes=function(e){return 0===(e={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/512}).width||0===e.height?null:e},h.prototype.$measureCharWidth=function(e){return this.$main.textContent=r.stringRepeat(e,512),this.$main.getBoundingClientRect().width/512},h.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t?this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width:t},h.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},h.prototype.$getZoom=function(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement):1},h.prototype.$initTransformMeasureNodes=function(){function e(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]}this.els=o.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},h.prototype.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function s(e){return[(e=e.getBoundingClientRect()).left,e.top]}e=e&&r(1/this.$getZoom(this.el),e),this.els||this.$initTransformMeasureNodes();var a,l,c=s(this.els[0]),h=s(this.els[1]),d=s(this.els[2]);return h=r(1+(l=i(n(l=s(this.els[3]),h),n(l,d),n(o(h,d),o(l,c))))[0],n(h,c)),d=r(1+l[1],n(d,c)),t?(a=l[0]*t[0]/200+l[1]*t[1]/200+1,t=o(r(t[0],h),r(t[1],d)),o(r(1/a/200,t),c)):(a=n(e,c),t=i(n(h,r(l[0],a)),n(d,r(l[1],a)),a),r(200,t))},h);function h(e){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=r.stringRepeat("X",512),this.$characterSize={width:0,height:0},l?this.$addObserver():this.checkForSizeChanges()}c.prototype.$characterSize={width:0,height:0},n.implement(c.prototype,e),t.FontMetrics=c})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,i){i.exports='\n.ace_br1 {border-top-left-radius    : 3px;}\n.ace_br2 {border-top-right-radius   : 3px;}\n.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}\n.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}\n.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}\n.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n    position: relative;\n    overflow: hidden;\n    padding: 0;\n    font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n    direction: ltr;\n    text-align: left;\n    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n    position: absolute;\n    overflow: hidden;\n    top: 0;\n    bottom: 0;\n    background-color: inherit;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    cursor: text;\n}\n\n.ace_content {\n    position: absolute;\n    box-sizing: border-box;\n    min-width: 100%;\n    contain: style size layout;\n    font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n    box-shadow: inset 0 0 0 2px #5E9ED6;\n    outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    content: \'\';\n    background: rgba(250, 250, 250, 0.01);\n    z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n    background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n    position: absolute;\n    overflow : hidden;\n    width: auto;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    cursor: default;\n    z-index: 4;\n    -ms-user-select: none;\n    -moz-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    contain: style size layout;\n}\n\n.ace_gutter-active-line {\n    position: absolute;\n    left: 0;\n    right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n    content: "";\n    position: absolute;\n    top: 0;\n    right: 0;\n    bottom: 0;\n    left: 0;\n    box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n    pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n    padding-left: 19px;\n    padding-right: 6px;\n    background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n    margin-left: -14px;\n    float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n    margin-left: -19px;\n    float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\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 {\n    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n    background-repeat: no-repeat;\n    background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\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_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\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_warning_fold {\n    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n    background-color: darkorange;\n}\n\n.ace_scrollbar {\n    contain: strict;\n    position: absolute;\n    right: 0;\n    bottom: 0;\n    z-index: 6;\n}\n\n.ace_scrollbar-inner {\n    position: absolute;\n    cursor: text;\n    left: 0;\n    top: 0;\n}\n\n.ace_scrollbar-v{\n    overflow-x: hidden;\n    overflow-y: scroll;\n    top: 0;\n}\n\n.ace_scrollbar-h {\n    overflow-x: scroll;\n    overflow-y: hidden;\n    left: 0;\n}\n\n.ace_print-margin {\n    position: absolute;\n    height: 100%;\n}\n\n.ace_text-input {\n    position: absolute;\n    z-index: 0;\n    width: 0.5em;\n    height: 1em;\n    opacity: 0;\n    background: transparent;\n    -moz-appearance: none;\n    appearance: none;\n    border: none;\n    resize: none;\n    outline: none;\n    overflow: hidden;\n    font: inherit;\n    padding: 0 1px;\n    margin: 0 -1px;\n    contain: strict;\n    -ms-user-select: text;\n    -moz-user-select: text;\n    -webkit-user-select: text;\n    user-select: text;\n    /*with `pre-line` chrome inserts &nbsp; instead of space*/\n    white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n    background: transparent;\n    color: inherit;\n    z-index: 1000;\n    opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n    border-bottom: 1px solid;\n    position: absolute;\n    border-radius: 0;\n    margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n    transform: none!important;\n    filter: none!important;\n    clip-path: none!important;\n    mask : none!important;\n    contain: none!important;\n    perspective: none!important;\n    mix-blend-mode: initial!important;\n    z-index: auto;\n}\n\n.ace_layer {\n    z-index: 1;\n    position: absolute;\n    overflow: hidden;\n    /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n    word-wrap: normal;\n    white-space: pre;\n    height: 100%;\n    width: 100%;\n    box-sizing: border-box;\n    /* setting pointer-events: auto; on node under the mouse, which changes\n        during scroll, will break mouse wheel scrolling in Safari */\n    pointer-events: none;\n}\n\n.ace_gutter-layer {\n    position: relative;\n    width: auto;\n    text-align: right;\n    pointer-events: auto;\n    height: 1000000px;\n    contain: style size layout;\n}\n\n.ace_text-layer {\n    font: inherit !important;\n    position: absolute;\n    height: 1000000px;\n    width: 1000000px;\n    contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n    contain: style size layout;\n    position: absolute;\n    top: 0;\n    left: 0;\n    right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n    contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n    contain: strict;\n}\n\n.ace_cjk {\n    display: inline-block;\n    text-align: center;\n}\n\n.ace_cursor-layer {\n    z-index: 4;\n}\n\n.ace_cursor {\n    z-index: 4;\n    position: absolute;\n    box-sizing: border-box;\n    border-left: 2px solid;\n    /* workaround for smooth cursor repaintng whole screen in chrome */\n    transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n    border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n    border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n    border-left-width: 0;\n    border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n    opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n    opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n    transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n    animation-duration: 1000ms;\n    animation-timing-function: step-end;\n    animation-name: blink-ace-animate;\n    animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n    animation-duration: 1000ms;\n    animation-timing-function: ease-in-out;\n    animation-name: blink-ace-animate-smooth;\n}\n    \n@keyframes blink-ace-animate {\n    from, to { opacity: 1; }\n    60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n    from, to { opacity: 1; }\n    45% { opacity: 1; }\n    60% { opacity: 0; }\n    85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n    position: absolute;\n    z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n    position: absolute;\n    z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n    position: absolute;\n    z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n    position: absolute;\n    border-bottom: 1px solid #DE5555;\n    border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n    position: absolute;\n    z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n    position: absolute;\n    z-index: 4;\n    box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n    box-sizing: border-box;\n\n    display: inline-block;\n    height: 11px;\n    margin-top: -2px;\n    vertical-align: middle;\n\n    background-image:\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n    background-repeat: no-repeat, repeat-x;\n    background-position: center center, top left;\n    color: transparent;\n\n    border: 1px solid black;\n    border-radius: 2px;\n\n    cursor: pointer;\n    pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n    background-image:\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n    background-color: #f5f5f5;\n    border: 1px solid gray;\n    border-radius: 1px;\n    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n    color: black;\n    max-width: 100%;\n    padding: 3px 4px;\n    position: fixed;\n    z-index: 999999;\n    box-sizing: border-box;\n    cursor: default;\n    white-space: pre;\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}\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    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}\n\n.ace_ghost_text {\n    opacity: 0.5;\n    font-style: italic;\n    white-space: pre;\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}'})),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/oop"),r=(e=e("../lib/event_emitter").EventEmitter,s.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light,i=(e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight),this.canvas.getContext("2d")),n=this.renderer.session.$annotations;if(i.clearRect(0,0,this.canvas.width,this.canvas.height),n)for(var o={info:1,warning:2,error:3},r=(n.forEach((function(e){e.priority=o[e.type]||null})),n=n.sort((function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0})),this.renderer.session.$foldData),s=0;s<n.length;s++){var a,l=n[s].row,c=this.compensateFoldRows(l,r),h=Math.round((l-c)*this.lineHeight*this.heightRatio),d=Math.round((l-c)*this.lineHeight*this.heightRatio);(l=Math.round(((l-c)*this.lineHeight+this.lineHeight)*this.heightRatio))-d<this.minDecorationHeight&&((a=(d+l)/2|0)<this.halfMinDecorationHeight?a=this.halfMinDecorationHeight:a+this.halfMinDecorationHeight>this.canvasHeight&&(a=this.canvasHeight-this.halfMinDecorationHeight),d=Math.round(a-this.halfMinDecorationHeight),l=Math.round(a+this.halfMinDecorationHeight)),i.fillStyle=t[n[s].type]||null,i.fillRect(0,h,this.canvasWidth,l-d)}(e=this.renderer.session.selection.getCursor())&&(c=this.compensateFoldRows(e.row,r),h=Math.round((e.row-c)*this.lineHeight*this.heightRatio),i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,h,this.canvasWidth,2))},s.prototype.compensateFoldRows=function(e,t){var i=0;if(t&&0<t.length)for(var n=0;n<t.length;n++)e>t[n].start.row&&e<t[n].end.row?i+=e-t[n].start.row:e>=t[n].end.row&&(i+=t[n].end.row-t[n].start.row);return i},s);function s(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)}o.implement(r.prototype,e),t.Decorator=r})),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"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/dom"),r=e("./lib/lang"),s=e("./config"),a=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,h=e("./layer/cursor").Cursor,d=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,g=e("./scrollbar_custom").VScrollBar,m=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,y=e("./lib/event_emitter").EventEmitter,v=e("./css/editor-css"),C=e("./layer/decorators").Decorator,I=e("./lib/useragent");function b(e,t){var i=this;this.container=e||o.createElement("div"),o.addCssClass(this.container,"ace_editor"),o.HI_DPI&&o.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==s.get("useStrictCSP")&&s.set("useStrictCSP",!1),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content),e=this.$textLayer=new c(this.content),this.canvas=e.element,this.$markerFront=new l(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",(function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._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=!I.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(),s.resetOptions(this),s._signal("renderer",this)}o.importCssString(v,"ace_editor.css",!1),b.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(),o.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},b.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=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))},b.prototype.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},b.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},b.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},b.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},b.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},b.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},b.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},b.prototype.onResize=function(e,t,i,n){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var o=this.container;if(n=n||o.clientHeight||o.scrollHeight,i=i||o.clientWidth||o.scrollWidth,o=this.$updateCachedSize(e,t,i,n),this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!i&&!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)}},b.prototype.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var r=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};return n&&(e||s.height!=n)&&(s.height=n,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(s.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),i&&(e||s.width!=i)&&(r|=this.CHANGE_SIZE,s.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,o.setStyle(this.scrollBarH.element.style,"left",t+"px"),o.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),o.setStyle(this.$gutter.style,"left",this.margin.left+"px"),t=this.scrollBarV.getWidth()+"px",o.setStyle(this.scrollBarH.element.style,"right",t),o.setStyle(this.scroller.style,"right",t),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(s.scrollerWidth),this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL),s.$dirty=!i||!n,r&&this._signal("resize",a),r},b.prototype.onGutterResize=function(e){(e=this.$showGutter?e:0)!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},b.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding;return e=Math.floor(e/this.characterWidth),this.session.adjustWrapLimit(e,this.$showPrintMargin&&this.$printMarginColumn)},b.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},b.prototype.getAnimatedScroll=function(){return this.$animatedScroll},b.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},b.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},b.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},b.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},b.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},b.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},b.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},b.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},b.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},b.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},b.prototype.getShowGutter=function(){return this.getOption("showGutter")},b.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},b.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},b.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},b.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},b.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},b.prototype.$updatePrintMargin=function(){var e;(this.$showPrintMargin||this.$printMarginEl)&&(this.$printMarginEl||((e=o.createElement("div")).className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)),(e=this.$printMarginEl.style).left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session)&&-1==this.session.$wrap&&this.adjustWrapLimit()},b.prototype.getContainerElement=function(){return this.container},b.prototype.getMouseEventTarget=function(){return this.scroller},b.prototype.getTextAreaContainer=function(){return this.container},b.prototype.$moveTextAreaToCursor=function(){var e,t,i,n,r,s,a;this.$isMousePressed||(e=this.textarea.style,s=this.$composition,this.$keepTextAreaAtCursor||s?(i=this.$cursorLayer.$pixelPos)&&(s&&s.markerRange&&(i=this.$cursorLayer.getPixelPosition(s.markerRange.start,!0)),a=this.layerConfig,t=i.top,i=i.left,t-=a.offset,n=s&&s.useTextareaForIME||I.isMobile?this.lineHeight:1,t<0||t>a.height-n?o.translate(this.textarea,0,0):(a=1,r=this.$size.height-n,s?s.useTextareaForIME?(s=this.textarea.value,a=this.characterWidth*this.session.$getStringScreenWidth(s)[0]):t+=this.lineHeight+2:t+=this.lineHeight,(i-=this.scrollLeft)>this.$size.scrollerWidth-a&&(i=this.$size.scrollerWidth-a),i+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",n+"px"),o.setStyle(e,"width",a+"px"),o.translate(this.textarea,Math.min(i,this.$size.scrollerWidth-a),Math.min(t,r)))):o.translate(this.textarea,-100,0))},b.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},b.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},b.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},b.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},b.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()},b.prototype.setScrollMargin=function(e,t,i,n){var o=this.scrollMargin;o.top=0|e,o.bottom=0|t,o.right=0|n,o.left=0|i,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),this.updateFull()},b.prototype.setMargin=function(e,t,i,n){var o=this.margin;o.top=0|e,o.bottom=0|t,o.right=0|n,o.left=0|i,o.v=o.top+o.bottom,o.h=o.left+o.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},b.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},b.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},b.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},b.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},b.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)},b.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},b.prototype.freeze=function(){this.$frozen=!0},b.prototype.unfreeze=function(){this.$frozen=!1},b.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);var i,n;this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics),t=this.layerConfig,(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL)&&(e|=this.$computeLayerConfig()|this.$loop.clear(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen&&0<(i=this.scrollTop+(t.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight)&&(this.scrollTop=i,e=(e|=this.CHANGE_SCROLL)|this.$computeLayerConfig()|this.$loop.clear()),t=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-t.offset),i=t.width+2*this.$padding+"px",n=t.minHeight+"px",o.setStyle(this.content.style,"width",i),o.setStyle(this.content.style,"height",n)),e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-t.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?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):e&this.CHANGE_SCROLL?(this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(t):this.$gutterLayer.scrollLines(t)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(t),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(t)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(t),this.$customScrollbar)&&this.$scrollDecorator.$updateDecorators(t),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t)),this._signal("afterRender",e)}else this.$changes|=e},b.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),t=!((i=this.$maxPixelHeight&&i>this.$maxPixelHeight?this.$maxPixelHeight:i)<=2*this.lineHeight)&&t<e,i==this.desiredHeight&&this.$size.height==this.desiredHeight&&t==this.$vScroll||(t!=this.$vScroll&&(this.$vScroll=t,this.scrollBarV.setVisible(t)),e=this.container.clientWidth,this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,e,i),this.desiredHeight=i,this._signal("autosize"))},b.prototype.$computeLayerConfig=function(){var e,t,i=this.session,n=this.$size,o=n.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),a=!o&&(this.$hScrollBarAlwaysVisible||n.scrollerWidth-s-2*this.$padding<0),l=this.$horizScroll!==a,c=(l&&(this.$horizScroll=a,this.scrollBarH.setVisible(a)),a=this.$vScroll,this.$maxLines&&1<this.lineHeight&&this.$autosize(),n.scrollerHeight+this.lineHeight),h=(r+=t=!this.$maxLines&&this.$scrollPastEnd?(n.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0,this.scrollMargin),d=((t=a!==(this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,r-n.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,s+2*this.$padding-n.scrollerWidth+h.right))),o=!o&&(this.$vScrollBarAlwaysVisible||n.scrollerHeight-r+t<0||this.scrollTop>h.top)))&&(this.$vScroll=o,this.scrollBarV.setVisible(o)),h=this.scrollTop%this.lineHeight,a=Math.ceil(c/this.lineHeight)-1,a=(o=Math.max(0,Math.round((this.scrollTop-h)/this.lineHeight)))+a,this.lineHeight),u=(o=i.screenToDocumentRow(o,0),i.getFoldLine(o));return u&&(o=u.start.row),u=i.documentToScreenRow(o,0),e=i.getRowLength(o)*d,a=Math.min(i.screenToDocumentRow(a,0),i.getLength()-1),c=n.scrollerHeight+i.getRowLength(a)*d+e,h=this.scrollTop-u*d,i=0,this.layerConfig.width==s&&!l||(i=this.CHANGE_H_SCROLL),(l||t)&&(i|=this.$updateCachedSize(!0,this.gutterWidth,n.width,n.height),this._signal("scrollbarVisibilityChanged"),t)&&(s=this.$getLongestLine()),this.layerConfig={width:s,padding:this.$padding,firstRow:o,firstRowScreen:u,lastRow:a,lineHeight:d,characterWidth:this.characterWidth,minHeight:c,maxHeight:r,offset:h,gutterOffset:d?Math.max(0,Math.ceil((h+n.height-n.scrollerHeight)/d)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),i},b.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow,i=(this.$changedLines=null,this.layerConfig);if(!(e>i.lastRow+1||t<i.firstRow)){if(t!==1/0)return this.$textLayer.updateLines(i,e,t),!0;this.$showGutter&&this.$gutterLayer.update(i),this.$textLayer.update(i)}}},b.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},b.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},b.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},b.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},b.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},b.prototype.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},b.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},b.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},b.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},b.prototype.showCursor=function(){this.$cursorLayer.showCursor()},b.prototype.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},b.prototype.scrollCursorIntoView=function(e,t,i){var n,o,r;0!==this.$size.scrollerHeight&&(n=(e=this.$cursorLayer.getPixelPosition(e)).left,e=e.top,o=i&&i.top||0,i=i&&i.bottom||0,this.$scrollAnimation&&(this.$stopAnimation=!0),e<(r=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop)+o?(t&&r+o>e+this.lineHeight&&(e-=t*this.$size.scrollerHeight),0===e&&(e=-this.scrollMargin.top),this.session.setScrollTop(e)):r+this.$size.scrollerHeight-i<e+this.lineHeight&&(t&&r+this.$size.scrollerHeight-i<e-this.lineHeight&&(e+=t*this.$size.scrollerHeight),this.session.setScrollTop(e+this.lineHeight+i-this.$size.scrollerHeight)),o=this.scrollLeft,n-(r=2*this.layerConfig.characterWidth)<o?((n-=r)<this.$padding+r&&(n=-this.scrollMargin.left),this.session.setScrollLeft(n)):o+this.$size.scrollerWidth<(n+=r)+this.characterWidth?this.session.setScrollLeft(Math.round(n+this.characterWidth-this.$size.scrollerWidth)):o<=this.$padding&&n-o<this.characterWidth&&this.session.setScrollLeft(0))},b.prototype.getScrollTop=function(){return this.session.getScrollTop()},b.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},b.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},b.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},b.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},b.prototype.alignCursor=function(e,t){e=this.$cursorLayer.getPixelPosition(e="number"==typeof e?{row:e,column:0}:e);var i=this.$size.scrollerHeight-this.lineHeight;return e=e.top-i*(t||0),this.session.setScrollTop(e),e},b.prototype.$calcSteps=function(e,t){var i,n,o=0,r=this.STEPS,s=[];for(o=0;o<r;++o)s.push((i=o/this.STEPS,(t-(n=e))*(Math.pow(i-1,3)+1)+n));return s},b.prototype.scrollToLine=function(e,t,i,n){e=this.$cursorLayer.getPixelPosition({row:e,column:0}).top,t&&(e-=this.$size.scrollerHeight/2),t=this.scrollTop,this.session.setScrollTop(e),!1!==i&&this.animateScrolling(t,n)},b.prototype.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var o=this.$scrollAnimation.steps;if(o.length&&(e=o[0])==i)return}var r=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:r},clearInterval(this.$timer),n.session.setScrollTop(r.shift()),n.session.$scrollTop=i,this.$timer=setInterval((function(){if(!n.$stopAnimation)return n.session?void(r.length?(n.session.setScrollTop(r.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):s()):clearInterval(n.$timer);s()}),10)}}function s(){n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,n.$stopAnimation=!1,t&&t()}},b.prototype.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},b.prototype.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},b.prototype.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},b.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},b.prototype.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},b.prototype.pixelToScreenCoordinates=function(e,t){this.$hasCssTransforms?(n={top:0,left:0},e=(i=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=i[0]):n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,n=(e=i/this.characterWidth,t=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),this.$blockCursor?Math.floor(e):Math.round(e));return{row:t,column:n,side:0<e-n?1:-1,offsetX:i}},b.prototype.screenToTextCoordinates=function(e,t){this.$hasCssTransforms?(i={top:0,left:0},e=(n=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=n[0]):i=this.scroller.getBoundingClientRect();var i,n=e+this.scrollLeft-i.left-this.$padding;return e=n/this.characterWidth,e=this.$blockCursor?Math.floor(e):Math.round(e),t=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),this.session.screenToDocumentPosition(t,Math.max(e,0),n)},b.prototype.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect();return t=this.session.documentToScreenPosition(e,t),e=this.$padding+(this.session.$bidiHandler.isBidiRow(t.row,e)?this.session.$bidiHandler.getPosLeft(t.column):Math.round(t.column*this.characterWidth)),t=t.row*this.lineHeight,{pageX:i.left+e-this.scrollLeft,pageY:i.top+t-this.scrollTop}},b.prototype.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},b.prototype.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},b.prototype.showComposition=function(e){(this.$composition=e).cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(o.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")},b.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},b.prototype.hideComposition=function(){var e;this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,e=this.session.selection.cursor,this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display="")},b.prototype.setGhostText=function(e,t){var i=this.session.selection.cursor;t=t||{row:i.row,column:i.column},this.removeGhostText(),i=e.split("\n"),this.addToken(i[0],"ghost_text",t.row,t.column),this.$ghostText={text:e,position:{row:t.row,column:t.column}},1<i.length&&(this.$ghostTextWidget={text:i.slice(1).join("\n"),row:t.row,column:t.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget))},b.prototype.removeGhostText=function(){var e;this.$ghostText&&(e=this.$ghostText.position,this.removeExtraToken(e.row,e.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null)},b.prototype.addToken=function(e,t,i,n){var o=this.session,r=(o.bgTokenizer.lines[i]=null,{type:t,value:e}),s=o.getTokens(i);if(null!=n&&s.length)for(var a=0,l=0;l<s.length;l++){var c=s[l];if(n<=(a+=c.value.length)){var h=c.value.length-(a-n),d=c.value.slice(0,h);h=c.value.slice(h),s.splice(l,1,{type:c.type,value:d},r,{type:c.type,value:h});break}}else s.push(r);this.updateLines(i,i)},b.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null,this.updateLines(e,e)},b.prototype.setTheme=function(e,t){var i,n=this;function r(i){if(n.$themeId!=e)return t&&t();if(!i||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(n.$themeId=i.$id),o.importCssString(i.cssText,i.cssClass,n.container),n.theme&&o.removeCssClass(n.container,n.theme.cssClass);var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,o.addCssClass(n.container,i.cssClass),o.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e?r(e):(i=e||this.$options.theme.initialValue,s.loadModule(["theme",i],r))},b.prototype.getTheme=function(){return this.$themeId},b.prototype.setStyle=function(e,t){o.setCssClass(this.container,e,!1!==t)},b.prototype.unsetStyle=function(e){o.removeCssClass(this.container,e)},b.prototype.setCursorStyle=function(e){o.setStyle(this.scroller.style,"cursor",e)},b.prototype.setMouseCursor=function(e){o.setStyle(this.scroller.style,"cursor",e)},b.prototype.attachToShadowRoot=function(){o.importCssString(v,"ace_editor.css",this.container)},b.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},b.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,!0===e?(this.scrollBarV=new g(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})),this.$scrollDecorator=new C(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})))},b.prototype.$addResizeObserver=function(){var e;window.ResizeObserver&&!this.$resizeObserver&&((e=this).$resizeTimer=r.delayedCall((function(){e.destroyed||e.onResize()}),50),this.$resizeObserver=new window.ResizeObserver((function(t){var i=t[0].contentRect.width;t=t[0].contentRect.height,1<Math.abs(e.$size.width-i)||1<Math.abs(e.$size.height-t)?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container))},(e=b).prototype.CHANGE_CURSOR=1,e.prototype.CHANGE_MARKER=2,e.prototype.CHANGE_GUTTER=4,e.prototype.CHANGE_SCROLL=8,e.prototype.CHANGE_LINES=16,e.prototype.CHANGE_TEXT=32,e.prototype.CHANGE_SIZE=64,e.prototype.CHANGE_MARKER_BACK=128,e.prototype.CHANGE_MARKER_FRONT=256,e.prototype.CHANGE_FULL=512,e.prototype.CHANGE_H_SCROLL=1024,e.prototype.$changes=0,e.prototype.$padding=null,e.prototype.$frozen=!1,e.prototype.STEPS=8,n.implement(e.prototype,y),s.defineOptions(e.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){o.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){this.$scrollPastEnd!=(e=+e||0)&&(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:!I.isMobile&&!I.isIE}}),t.VirtualRenderer=e})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){var t;return"undefined"==typeof Worker?{postMessage:function(){},terminate:function(){}}:s.get("loadWorkerFromBlob")?(t=function(e){e="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([e],{type:"application/javascript"})}catch(i){var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return t.append(e),t.getBlob("application/javascript")}}(e),t=(window.URL||window.webkitURL).createObjectURL(t),new Worker(t)):new Worker(e)}function l(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,r),this.$createWorkerFromOldConfig=function(t,i,n,o,r){var l,c;return e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl?o=o||s.moduleUrl(i,"worker"):(l=this.$normalizePath,o=o||l(e.toUrl("ace/worker/worker.js",null,"_")),c={},t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))),this.$worker=a(o),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:c,module:i,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 i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.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,i){var n;i&&(n=this.callbackId++,this.callbacks[n]=i,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,50<e.length&&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,i){var n=null,o=!1,a=Object.create(r),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),n&&(o?setTimeout(d):d())}}),d=(h.setEmitSync=function(e){o=e},function(){var e=c.shift();e.command?n[e.command].apply(n,e.args):e.event&&a._signal(e.event,e.data)});return a.postMessage=function(e){h.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],(function(e){for(n=new e[i](a);c.length;)d()})),h},t.WorkerClient=l,t.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,r=(e=e("./lib/oop"),s.prototype.setup=function(){var e=this,t=this.doc,i=this.session,o=(this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column),this.pos);o.$insertRight=!0,o.detach(),o.markerId=i.addMarker(new n(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(i){(i=t.createAnchor(i.row,i.column)).$insertRight=!0,i.detach(),e.others.push(i)})),i.setUndoSelect(!1)},s.prototype.showOtherMarkers=function(){var e,t;this.othersActive||(e=this.session,(t=this).othersActive=!0,this.others.forEach((function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1)})))},s.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},s.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,o=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),o&&(this.length+=i),o&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;0<=s;s--){var a={row:(l=this.others[s]).row,column:l.column+r};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;0<=s;s--){var l;a={row:(l=this.others[s]).row,column:l.column+r},this.doc.remove(new n(a.row,a.column,a.row,a.column-i))}this.$updating=!1,this.updateMarkers()}},s.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},s.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,i=function(i,o){t.removeMarker(i.markerId),i.markerId=t.addMarker(new n(i.row,i.column,i.row,i.column+e.length),o,null,!1)};i(this.pos,this.mainClass);for(var o=this.others.length;o--;)i(this.others[o],this.othersClass)}},s.prototype.onCursorChange=function(e){var t;!this.$updating&&this.session&&((t=this.session.selection.getCursor()).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)))},s.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},s.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},s);function s(e,t,i,n,o,r){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=i,t=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1},this.$undoStackDepth=t.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}e.implement(r.prototype,o),t.PlaceHolder=r})),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,i){var n=e("../lib/event"),o=e("../lib/useragent");function r(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&o.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)e.editor.textInput.onContextMenu(e.domEvent);else if(a||i||l){if(0===c){var h,d,u,p,g,m,f,y,v=e.editor,C=v.selection,I=v.inMultiSelectMode,b=e.getDocumentPosition(),A=C.getCursor(),w=(A=e.inSelection()||C.isEmpty()&&r(b,A),e.x),_=e.y,x=v.session,S=v.renderer.pixelToScreenCoordinates(w,_),k=S;if(v.$mouseHandler.$enableJumpToDef)a&&i||l&&i?h=s?"block":"add":i&&v.$blockSelectEnabled&&(h="block");else if(l&&!i){if(h="add",!I&&s)return}else i&&v.$blockSelectEnabled&&(h="block");if(h&&o.isMac&&t.ctrlKey&&v.$mouseHandler.cancelContextMenu(),"add"==h)!I&&A||(I||(d=C.toOrientedRange(),v.addSelectionMarker(d)),u=C.rangeList.rangeAtPoint(b),v.inVirtualSelectionMode=!0,s&&(u=null,d=C.ranges[0]||d,v.removeSelectionMarker(d)),v.once("mouseup",(function(){var e=C.toOrientedRange();u&&e.isEmpty()&&r(u.cursor,e.cursor)?C.substractPoint(e.cursor):(s?C.substractPoint(d.cursor):d&&(v.removeSelectionMarker(d),C.addRange(d)),C.addRange(e)),v.inVirtualSelectionMode=!1})));else if("block"==h)return e.stop(),v.inVirtualSelectionMode=!0,g=[],m=function(){var e=v.renderer.pixelToScreenCoordinates(w,_),t=x.screenToDocumentPosition(e.row,e.column,e.offsetX);r(k,e)&&r(t,C.lead)||(k=e,v.selection.moveToPosition(t),v.renderer.scrollCursorIntoView(),v.removeSelectionMarkers(g),g=C.rectangularRangeBlock(k,S),v.$mouseHandler.$clickSelection&&1==g.length&&g[0].isEmpty()&&(g[0]=v.$mouseHandler.$clickSelection.clone()),g.forEach(v.addSelectionMarker,v),v.updateSelectionMarkers())},I&&!l?C.toSingleRange():!I&&l&&(p=C.toOrientedRange(),v.addSelectionMarker(p)),s?S=x.documentToScreenPosition(C.lead):C.moveToPosition(b),k={row:-1,column:-1},f=m,n.capture(v.container,(function(e){w=e.clientX,_=e.clientY}),(function(e){m(),clearInterval(y),v.removeSelectionMarkers(g),g.length||(g=[C.toOrientedRange()]),p&&(v.removeSelectionMarker(p),C.toSingleRange(p));for(var t=0;t<g.length;t++)C.addRange(g[t]);v.inVirtualSelectionMode=!1,v.$mouseHandler.$clickSelection=null})),y=setInterval((function(){f()}),20),e.preventDefault()}}else 0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}})),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],(function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(e){1<e.multiSelect.rangeCount?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}}],e=e("../keyboard/hash_handler").HashHandler,t.keyboardHandler=new e(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,i){var n=e("./range_list").RangeList,o=e("./range").Range,r=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(e("./search").Search),d=e("./edit_session").EditSession;function u(e){var i,n;function o(e){n&&(i.renderer.setMouseCursor(""),n=!1)}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",s),e.commands.addCommands(c.defaultCommands),(i=e).textInput&&(e=i.textInput.getElement(),n=!1,a.addListener(e,"keydown",(function(e){e=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey),i.$blockSelectEnabled&&e?n||(i.renderer.setMouseCursor("crosshair"),n=!0):n&&o()}),i),a.addListener(e,"keyup",o,i),a.addListener(e,"blur",o,i)))}(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(d.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}return e.cursor||(e.cursor=e.end),i=this.rangeList.add(e),this.$onAddRange(e),i.length&&this.$onRemoveRange(i),1<this.rangeCount&&!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){if(e=this.rangeList.substractPoint(e))return this.$onRemoveRange(e),e[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){var t;this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode&&(t=this.rangeList.ranges.pop(),e.push(t),this.rangeCount=0);for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),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=[],i=0;i<e.length;i++){var n=e[i],r=n.start.row,s=n.end.row;if(r===s)t.push(n.clone());else{for(t.push(new o(r,n.start.column,r,this.session.getLine(r).length));++r<s;)t.push(this.getLineRange(r,!0));t.push(new o(s,0,s,n.end.column))}0!=i||this.isBackwards()||(t=t.reverse())}for(this.toSingleRange(),i=t.length;i--;)this.addRange(t[i])},this.joinSelections=function(){var e=(t=this.rangeList.ranges)[t.length-1],t=o.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(t,e.cursor==e.start)},this.toggleBlockSelection=function(){var e,t;1<this.rangeCount?(t=(e=this.rangeList.ranges)[e.length-1],e=o.fromPoints(e[0].start,t.end),this.toSingleRange(),this.setSelectionRange(e,t.cursor==t.start)):(e=this.session.documentToScreenPosition(this.cursor),t=this.session.documentToScreenPosition(this.anchor),this.rectangularRangeBlock(e,t).forEach(this.addRange,this))},this.rectangularRangeBlock=function(e,t,i){var n,r,s,a,l,c,h,d=[],u=e.column<t.column,p=(a=(u?(n=e.column,r=t.column,s=e.offsetX,t):(n=t.column,r=e.column,s=t.offsetX,e)).offsetX,e.row<t.row);c=(p?(l=e.row,t):(l=t.row,e)).row,n<0&&(n=0),(l=l<0?0:l)==c&&(i=!0);for(var g,m,f=l;f<=c;f++){var y=o.fromPoints(this.session.screenToDocumentPosition(f,n,s),this.session.screenToDocumentPosition(f,r,a));if(y.isEmpty()){if(h&&(m=h,(g=y.end).row==m.row)&&g.column==m.column)break;h=y.end}y.cursor=u?y.start:y.end,d.push(y)}if(p&&d.reverse(),!i){for(var v=d.length-1;d[v].isEmpty()&&0<v;)v--;if(0<v)for(var C=0;d[C].isEmpty();)C++;for(var I=v;C<=I;I--)d[I].isEmpty()&&d.splice(I,1)}return d}}.call(r.prototype),d=e("./editor").Editor,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){e.marker&&(this.session.removeMarker(e.marker),-1!=(e=this.session.$selectionMarkers.indexOf(e))&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length)},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];n.marker&&(this.session.removeMarker(n.marker),-1!=(n=t.indexOf(n)))&&t.splice(n,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,i=e.command,n=e.editor;if(n.multiSelect)return i.multiSelectAction?t="forEach"==i.multiSelectAction?n.forEachSelection(i,e.args):"forEachLine"==i.multiSelectAction?n.forEachSelection(i,e.args,!0):"single"==i.multiSelectAction?(n.exitMultiSelectMode(),i.exec(n,e.args||{})):i.multiSelectAction(n,e.args||{}):(t=i.exec(n,e.args||{}),n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()),t},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,o=i&&i.keepOrder,s=1==i||i&&i.$byLines,a=this.session,l=(i=this.selection).rangeList,c=(o?i:l).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});o=i._eventRegistry;var h=(i._eventRegistry={},new r(a));this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(s)for(;0<d&&c[d].start.row==c[d-1].end.row;)d--;h.fromOrientedRange(c[d]),h.index=d,this.selection=a.selection=h;var u=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===u||(n=u),h.toOrientedRange(c[d])}return h.detach(),this.selection=a.selection=i,this.inVirtualSelectionMode=!1,i._eventRegistry=o,i.mergeOverlappingRanges(),i.ranges[0]&&i.fromOrientedRange(i.ranges[0]),l=this.renderer.$scrollAnimation,this.onCursorChange(),this.onSelectionChange(),l&&l.from==l.to&&this.renderer.animateScrolling(l.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,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var o=this.session.getDocument().getNewLineCharacter();(e=i.join(o)).length==(i.length-1)*o.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){var i;this.inMultiSelectMode&&!this.inVirtualSelectionMode&&(i=this.multiSelect.ranges[0],this.multiSelect.isEmpty()&&t==this.multiSelect.anchor||((i=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor).row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()))},this.findAll=function(e,t,i){(t=t||{}).needle=e||t.needle,null==t.needle&&(n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange(),t.needle=this.session.getTextRange(n)),this.$search.set(t);var n,o=this.$search.findAll(this.session);if(!o.length)return 0;var r=this.multiSelect;i||r.toSingleRange(o[0]);for(var s=o.length;s--;)r.addRange(o[s],!0);return n&&r.rangeList.rangeAtPoint(n.start)&&r.addRange(n,!0),o.length},this.selectMoreLines=function(e,t){var i,n,r,s=this.selection.toOrientedRange(),a=s.cursor==s.end,l=this.session.documentToScreenPosition(s.cursor),c=(this.selection.$desiredColumn&&(l.column=this.selection.$desiredColumn),this.session.screenToDocumentPosition(l.row+e,l.column));e=s.isEmpty()?c:(i=this.session.documentToScreenPosition(a?s.end:s.start),this.session.screenToDocumentPosition(i.row+e,i.column)),a?(n=o.fromPoints(c,e)).cursor=n.start:(n=o.fromPoints(e,c)).cursor=n.end,n.desiredColumn=l.column,this.selection.inMultiSelectMode?t&&(r=s.cursor):this.selection.addRange(s),this.selection.addRange(n),r&&this.selection.substractPoint(r)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,o=n.length;o--;)(s=n[o]).isEmpty()&&(a=t.getWordRange(s.start.row,s.start.column),s.start.row=a.start.row,s.start.column=a.start.column,s.end.row=a.end.row,s.end.column=a.end.column);i.mergeOverlappingRanges();var r=[];for(o=n.length;o--;){var s=n[o];r.unshift(t.getTextRange(s))}for(e<0?r.unshift(r.pop()):r.push(r.shift()),o=n.length;o--;){var a=(s=n[o]).clone();t.replace(s,r[o]),s.start.row=a.start.row,s.start.column=a.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n,o=this.session,r=o.multiSelect.toOrientedRange();r.isEmpty()&&((r=o.getWordRange(r.start.row,r.start.column)).cursor=-1==e?r.start:r.end,this.multiSelect.addRange(r),i)||(i=o.getTextRange(r),n=e,h.$options.wrap=!0,h.$options.needle=i,h.$options.backwards=-1==n,(i=h.find(o))&&(i.cursor=-1==e?i.start:i.end,this.session.unfold(i),this.multiSelect.addRange(i),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(r.cursor))},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,r=i.filter((function(e){if(e.cursor.row==n)return!0;n=e.cursor.row}));if(i.length&&r.length!=i.length-1){r.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=i.map((function(t){t=t.cursor;var i=e.getLine(t.row).substr(t.column).search(/\S/g);return t.column>s&&(s=t.column),(i=-1==i?0:i)<a&&(a=i),i}));i.forEach((function(t,i){var n=t.cursor,r=s-n.column;(i=c[i]-a)<r?e.insert(n,l.stringRepeat(" ",r-i)):e.remove(new o(n.row,n.column,n.row,n.column-r+i)),t.start.column=t.end.column=s,t.start.row=t.end.row=n.row,t.cursor=t.end})),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=(r=this.selection.getRange()).start.row,d=r.end.row;if(i=h==d){for(var u,p=this.session.getLength();u=this.session.getLine(d),/[=:]/.test(u)&&++d<p;);for(;u=this.session.getLine(h),/[=:]/.test(u)&&0<--h;);h<0&&(h=0),p<=d&&(d=p-1)}var g=this.session.removeFullLines(h,d);g=this.$reAlignText(g,i),this.session.insert({row:h,column:0},g.join("\n")+"\n"),i||(r.start.column=0,r.end.column=g[g.length-1].length),this.selection.setRange(r)}},this.$reAlignText=function(e,t){var i,n,o,r=!0,s=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?(null==i?(i=t[1].length,n=t[2].length,o=t[3].length):(i+n+o!=t[1].length+t[2].length+t[3].length&&(s=!1),i!=t[1].length&&(r=!1),i>t[1].length&&(i=t[1].length),n<t[2].length&&(n=t[2].length),o>t[3].length&&(o=t[3].length)),t):[e]})).map(t?c:r?s?function(e){return e[2]?a(i+n-e[2].length)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(i)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?a(i)+e[2]+a(n-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}.call(d.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,(e=e.oldSession)&&(e.multiSelect.off("addRange",this.$onAddRange),e.multiSelect.off("removeRange",this.$onRemoveRange),e.multiSelect.off("multiSelect",this.$onMultiSelect),e.multiSelect.off("singleSelect",this.$onSingleSelect),e.multiSelect.lead.off("change",this.$checkMultiselectChange),e.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=u,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){u(this),e?this.on("mousedown",s):this.off("mousedown",s)},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,i){"use strict";var n=e("../../range").Range;e=t.FoldMode=function(){},function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){return e=e.getLine(i),this.foldingStartMarker.test(e)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var o=/\S/,r=(l=e.getLine(t)).search(o);if(-1!=r){i=i||l.length;for(var s,a=e.getLength(),l=t,c=t;++t<a;){var h=e.getLine(t).search(o);if(-1!=h){if(h<=r&&(!(h=e.getTokenAt(t,0))||"string"!==h.type))break;c=t}}return l<c?(s=e.getLine(c).length,new n(l,i,c,s)):void 0}},this.openingBracketBlock=function(e,t,i,o,r){if(i={row:i,column:o+1},o=e.$findClosingBracket(t,i,r))return"start"==(t=null==(t=e.foldWidgets[o.row])?e.getFoldWidget(o.row):t)&&o.row>i.row&&(o.row--,o.column=e.getLine(o.row).length),n.fromPoints(i,o)},this.closingBracketBlock=function(e,t,i,o,r){if(i={row:i,column:o},o=e.$findOpeningBracket(t,i))return o.column++,i.column--,n.fromPoints(o,i)}}.call(e.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],(function(e,t,i){"use strict";var n=e("../line_widgets").LineWidgets,o=e("../lib/dom"),r=e("../range").Range,s=e("../config").nls;function a(e,t,i){var n=e.getAnnotations().sort(r.comparePoints);if(n.length){var o=function(e,t,i){for(var n=0,o=e.length-1;n<=o;){var r=n+o>>1,s=i(t,e[r]);if(0<s)n=1+r;else{if(!(s<0))return r;o=r-1}}return-(n+1)}(n,{row:t,column:-1},r.comparePoints),s=((o=o<0?-o-1:o)>=n.length?o=0<i?0:n.length-1:0===o&&i<0&&(o=n.length-1),n[o]);if(s&&i){if(s.row===t){for(;(s=n[o+=i])&&s.row===t;);if(!s)return n.slice()}var a=[];for(t=s.row;a[i<0?"unshift":"push"](s),(s=n[o+=i])&&s.row==t;);return a.length&&a}}}t.showErrorMarker=function(e,t){var i,r=e.session,l=(r.widgetManager||(r.widgetManager=new n(r),r.widgetManager.attach(e)),e.getCursorPosition()),c=l.row,h=r.widgetManager.getWidgetsAtRow(c).filter((function(e){return"errorMarker"==e.type}))[0];if(h?h.destroy():c-=t,c=a(r,c,t))t=c[0],l.column=(t.pos&&"number"!=typeof t.column?t.pos.sc:t.column)||0,l.row=t.row,i=e.renderer.$gutterLayer.$annotations[l.row];else{if(h)return;i={text:[s("Looks good!")],className:"ace_ok"}}function d(e,t,i){if(0===t&&("esc"===i||"return"===i))return u.destroy(),{command:"null"}}e.session.unfold(l.row),e.selection.moveToPosition(l);var u={row:l.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"};c=u.el.appendChild(o.createElement("div")),(t=u.el.appendChild(o.createElement("div"))).className="error_widget_arrow "+i.className,h=e.renderer.$cursorLayer.getPixelPosition(l).left,t.style.left=h+e.renderer.gutterWidth-5+"px",u.el.className="error_widget_wrapper",c.className="error_widget "+i.className,c.innerHTML=i.text.join("<br>"),c.appendChild(o.createElement("div")),u.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(d),r.widgetManager.removeLineWidget(u),e.off("changeSelection",u.destroy),e.off("changeSession",u.destroy),e.off("mouseup",u.destroy),e.off("change",u.destroy))},e.keyBinding.addKeyboardHandler(d),e.on("changeSelection",u.destroy),e.on("changeSession",u.destroy),e.on("mouseup",u.destroy),e.on("change",u.destroy),e.session.widgetManager.addLineWidget(u),u.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:u.el.offsetHeight})},o.importCssString("\n    .error_widget_wrapper {\n        background: inherit;\n        color: inherit;\n        border:none\n    }\n    .error_widget {\n        border-top: solid 2px;\n        border-bottom: solid 2px;\n        margin: 5px 0;\n        padding: 10px 40px;\n        white-space: pre-wrap;\n    }\n    .error_widget.ace_error, .error_widget_arrow.ace_error{\n        border-color: #ff5a5a\n    }\n    .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n        border-color: #F1D817\n    }\n    .error_widget.ace_info, .error_widget_arrow.ace_info{\n        border-color: #5a5a5a\n    }\n    .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n        border-color: #5aaa5a\n    }\n    .error_widget_arrow {\n        position: absolute;\n        border: solid 5px;\n        border-top-color: transparent!important;\n        border-right-color: transparent!important;\n        border-left-color: transparent!important;\n        top: -5px;\n    }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,i){"use strict";e("./loader_build")(t);var n=e("./lib/dom"),o=e("./range").Range,r=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,i){if("string"==typeof e){var o=e;if(!(e=document.getElementById(o)))throw new Error("ace.edit can't find div #"+o)}var s,a;return e&&e.env&&e.env.editor instanceof r?e.env.editor:(o="",e&&/input|textarea/i.test(e.tagName)?(o=(s=e).value,e=n.createElement("pre"),s.parentNode.replaceChild(e,s)):e&&(o=e.textContent,e.innerHTML=""),o=t.createEditSession(o),e=new r(new l(e),o,i),a={document:o,editor:e,onResize:e.resize.bind(e,null)},s&&(a.textarea=s),e.on("destroy",(function(){a.editor.container.env=null})),e.container.env=e.env=a,e)},t.createEditSession=function(e,t){return(e=new s(e,t)).setUndoManager(new a),e},t.Range=o,t.Editor=r,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var i,n=function(){return this}();for(i in(n=(n=n||"undefined"==typeof window?n:window)||"undefined"==typeof self?n:self).ace||(n.ace=t),t)t.hasOwnProperty(i)&&(n.ace[i]=t[i]);n.ace.default=n.ace,e&&(e.exports=n.ace)}))},4317:function(e,t,i){e=i.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,i){"use strict";var n=e("./lib/dom"),o=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,h=e("./tokenizer").Tokenizer,d=e("./clipboard"),u={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,i){return e=e.session.getTextRange(),i?e.replace(/\n\r?([ \t]*\S)/g,"\n"+i+"$1"):e},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 d.getText&&d.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){return(e=e.session.$mode||{}).blockComment&&e.blockComment.start||""},BLOCK_COMMENT_END:function(e){return(e=e.session.$mode||{}).blockComment&&e.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){return 1==(e=(new Date).toLocaleString("en-us",e)).length?"0"+e:e}u.SELECTED_TEXT=u.SELECTION,m.prototype.getTokenizer=function(){return m.$tokenizer||this.createTokenizer()},m.prototype.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var i={regex:"/("+t("/")+"+)/",onMatch:function(e,t,i){return(i=i[0]).fmtString=!0,i.guard=e.slice(1,-1),i.flag=""},next:"formatString"};return m.$tokenizer=new h({start:[{regex:/\\./,onMatch:function(e,t,i){var n=e[1];return[e="}"==n&&i.length||-1!="`$\\".indexOf(n)?n:e]}},{regex:/}/,onMatch:function(e,t,i){return[i.length?i.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,i,n){return t=e(t.substr(1)),n.unshift(t[0]),t},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,i){return e=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}})),[(i[0].choices=e)[0]]},next:"start"},i,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,i){return i.length&&i[0].expectElse?(i[0].expectElse=!1,i[0].ifEnd={elseEnd:i[0]},[i[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,i){var n=e[1];return"}"==n&&i.length||-1!="`$\\".indexOf(n)?e=n:"n"==n?e="\n":"t"==n?e="\t":-1!="ulULE".indexOf(n)&&(e={changeCase:n,local:"a"<n}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,i){return(i=i.shift())&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,i){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,i){return e={text:e.slice(2)},i.unshift(e),[e]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,i){return i=i.shift(),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,i){return i[0].formatFunction=e.slice(2,-1),[i.shift()]},next:"formatString"},i,{regex:/:[\?\-+]?/,onMatch:function(e,t,i){"+"==e[1]&&(i[0].ifEnd=i[0]),"?"==e[1]&&(i[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]})},m.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},m.prototype.getVariableValue=function(e,t,i){var n;return/^\d+$/.test(t)?(this.variables.__||{})[t]||"":/^[A-Z]\d+$/.test(t)?(this.variables[t[0]+"__"]||{})[t.substr(1)]||"":(t=t.replace(/^TM_/,""),this.variables.hasOwnProperty(t)&&null!=(n="function"==typeof(n=this.variables[t])?this.variables[t](e,t,i):n)?n:"")},m.prototype.tmStrFormat=function(e,t,i){var n,o,r,s;return t.fmt?(n=t.flag||"",o=t.guard,o=new RegExp(o,n.replace(/[^gim]/g,"")),r="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,e.replace(o,(function(){for(var e=s.variables.__,t=(s.variables.__=[].slice.call(arguments),s.resolveVariables(r,i)),n="E",o=0;o<t.length;o++){var a,l=t[o];"object"==typeof l?(t[o]="",l.changeCase&&l.local?(a=t[o+1])&&"string"==typeof a&&("u"==l.changeCase?t[o]=a[0].toUpperCase():t[o]=a[0].toLowerCase(),t[o+1]=a.substr(1)):l.changeCase&&(n=l.changeCase)):"U"==n?t[o]=l.toUpperCase():"L"==n&&(t[o]=l.toLowerCase())}return s.variables.__=e,t.join("")}))):e},m.prototype.tmFormatFunction=function(e,t,i){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},m.prototype.resolveVariables=function(e,t){for(var i=[],n="",o=!0,r=0;r<e.length;r++){var s,a=e[r];"string"==typeof a?(i.push(a),"\n"==a?(o=!0,n=""):o&&(n=/^\t*/.exec(a)[0],o=/\S/.test(a))):a&&(o=!1,a.fmtString&&(-1==(s=e.indexOf(a,r+1))&&(s=e.length),a.fmt=e.slice(r+1,s),r=s),a.text?(s=this.getVariableValue(t,a.text,n)+"",a.fmtString&&(s=this.tmStrFormat(s,a,t)),(s=a.formatFunction?this.tmFormatFunction(s,a,t):s)&&!a.ifEnd?(i.push(s),l(a)):!s&&a.ifEnd&&l(a.ifEnd)):a.elseEnd?l(a.elseEnd):null==a.tabstopId&&null==a.changeCase||i.push(a))}function l(t){-1!=(t=e.indexOf(t,r+1))&&(r=t)}return i},m.prototype.getDisplayTextForSnippet=function(e,t){return f.call(this,e,t).text},m.prototype.insertSnippetForSelection=function(e,t,i){t=f.call(this,e,t,i=void 0===i?{}:i),i=e.getSelectionRange();var n=e.session.replace(i,t.text),o=new y(e);e=e.inVirtualSelectionMode&&e.selection.index,o.addTabstops(t.tabstops,i.start,n,e)},m.prototype.insertSnippet=function(e,t,i){void 0===i&&(i={});var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t,i);e.forEachSelection((function(){n.insertSnippetForSelection(e,t,i)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},m.prototype.$getScope=function(e){var t,i=e.session.$mode.$id||"";return"html"!==(i=i.split("/").pop())&&"php"!==i||("php"!==i||e.session.$mode.inlinePhp||(i="html"),t=e.getCursorPosition(),(e="object"==typeof(e=e.session.getState(t.row))?e[0]:e).substring&&("js-"==e.substring(0,3)?i="javascript":"css-"==e.substring(0,4)?i="css":"php-"==e.substring(0,4)&&(i="php"))),i},m.prototype.getActiveScopes=function(e){var t=[e=this.$getScope(e)],i=this.snippetMap;return i[e]&&i[e].includeScopes&&t.push.apply(t,i[e].includeScopes),t.push("_"),t},m.prototype.expandWithTab=function(e,t){var i=this,n=e.forEachSelection((function(){return i.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return n&&e.tabstopManager&&e.tabstopManager.tabNext(),n},m.prototype.expandSnippetForSelection=function(e,t){var i,n=e.getCursorPosition(),o=e.session.getLine(n.row),r=o.substring(0,n.column),s=o.substr(n.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){return e=a[e],!!(i=e?this.findMatchingSnippet(e,r,s):i)}),this),!!i&&(t&&t.dryRun||(e.session.doc.removeInLine(n.row,n.column-i.replaceBefore.length,n.column+i.replaceAfter.length),this.variables.M__=i.matchBefore,this.variables.T__=i.matchAfter,this.insertSnippetForSelection(e,i.content),this.variables.M__=this.variables.T__=null),!0)},m.prototype.findMatchingSnippet=function(e,t,i){for(var n=e.length;n--;){var o=e[n];if((!o.startRe||o.startRe.test(t))&&(!o.endRe||o.endRe.test(i))&&(o.startRe||o.endRe))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(i):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(i)[0]:"",o}},m.prototype.register=function(e,t){var i=this.snippetMap,n=this.snippetNameMap,o=this;function r(e){return(e=e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)?"(?:"+e+")":e)||""}function a(e,t,i){return e=r(e),t=r(t),i?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function l(e){e.scope||(e.scope=t||"_"),t=e.scope,i[t]||(i[t]=[],n[t]={});var r,l=n[t];e.name&&((r=l[e.name])&&o.unregister(r),l[e.name]=e),i[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=a(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e=e||[],Array.isArray(e)?e.forEach(l):Object.keys(e).forEach((function(t){l(e[t])})),this._signal("registerSnippets",{scope:t})},m.prototype.unregister=function(e,t){var i=this.snippetMap,n=this.snippetNameMap;function o(e){var o=n[e.scope||t];o&&o[e.name]&&(delete o[e.name],0<=(e=(o=i[e.scope||t])&&o.indexOf(e)))&&o.splice(e,1)}e.content?o(e):Array.isArray(e)&&e.forEach(o)},m.prototype.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,i,n,o=[],r={},s=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;i=s.exec(e);){if(i[1])try{r=JSON.parse(i[1]),o.push(r)}catch(e){}i[4]?(r.content=i[4].replace(/^\t/gm,""),o.push(r),r={}):(t=i[2],i=i[3],"regex"==t?(r.guard=(n=/\/((?:[^\/\\]|\\.)*)|$/g).exec(i)[1],r.trigger=n.exec(i)[1],r.endTrigger=n.exec(i)[1],r.endGuard=n.exec(i)[1]):"snippet"==t?(r.tabTrigger=i.match(/^\S*/)[0],r.name||(r.name=i)):t&&(r[t]=i))}return o},m.prototype.getSnippetByName=function(e,t){var i,n=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){return t=n[t],!!(i=t?t[e]:i)}),this),i};var g=m;function m(){this.snippetMap={},this.snippetNameMap={},this.variables=u}o.implement(g.prototype,r);var f=function(e,t,i){void 0===i&&(i={});for(var n=e.getCursorPosition(),o=e.session.getLine(n.row),r=e.session.getTabString(),s=o.match(/^\s*/)[0],a=(n.column<s.length&&(s=s.slice(0,n.column)),t=t.replace(/\r/g,""),this.tokenizeTmSnippet(t)),l=(a=(a=this.resolveVariables(a,e)).map((function(e){return"\n"!=e||i.excludeExtraIndent?"string"==typeof e?e.replace(/\t/g,r):e:e+s})),[]),c=(a.forEach((function(e,t){var i,n,o;"object"==typeof e&&(o=e.tabstopId,(i=l[o])||((i=l[o]=[]).index=o,i.value="",i.parents={}),-1===i.indexOf(e))&&(e.choices&&!i.choices&&(i.choices=e.choices),i.push(e),-1!==(n=a.indexOf(e,t+1)))&&((o=a.slice(t+1,n)).some((function(e){return"object"==typeof e}))&&!i.value?i.value=o:!o.length||i.value&&"string"==typeof i.value||(i.value=o.join("")))})),l.forEach((function(e){e.length=0})),{}),h=0;h<a.length;h++){var d,u,p,g=a[h];"object"==typeof g&&(p=g.tabstopId,d=l[p],u=a.indexOf(g,h+1),c[p]?c[p]===g&&(delete c[p],Object.keys(c).forEach((function(e){d.parents[e]=!0}))):(c[p]=g,"string"!=typeof(p=d.value)?p=function(e){for(var t=[],i=0;i<e.length;i++){if("object"==typeof(n=e[i])){if(c[n.tabstopId])continue;var n=t[e.lastIndexOf(n,i-1)]||{tabstopId:n.tabstopId}}t[i]=n}return t}(p):g.fmt&&(p=this.tmStrFormat(p,g,e)),a.splice.apply(a,[h+1,Math.max(0,u-h)].concat(p,g)),-1===d.indexOf(g)&&d.push(g)))}var m=0,f=0,y="";return a.forEach((function(e){var t;"string"==typeof e?(1<(t=e.split("\n")).length?(f=t[t.length-1].length,m+=t.length-1):f+=e.length,y+=e):e&&(e.start?e.end={row:m,column:f}:e.start={row:m,column:f})})),{text:y,tabstops:l,tokens:a}},y=(v.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)},v.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},v.prototype.onChange=function(e){for(var t="r"==e.action[0],i=this.selectedTabstop||{},n=i.parents||{},o=this.tabstops.slice(),r=0;r<o.length;r++){var s=o[r],a=s==i||n[s.index];if(s.rangeList.$bias=a?0:1,"remove"==e.action&&s!==i){a=s.parents&&s.parents[i.index];for(var l=(l=s.rangeList.pointIndex(e.start,a))<0?-l-1:l+1,c=(a=s.rangeList.pointIndex(e.end,a),s.rangeList.ranges.slice(l,a<0?-a-1:a-1)),h=0;h<c.length;h++)this.removeRange(c[h])}s.rangeList.$onChange(e)}var d=this.session;this.$inChange||!t||1!=d.getLength()||d.getValue()||this.detach()},v.prototype.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var i=this.session,n=i.getTextRange(e.firstNonLinked),o=0;o<e.length;o++){var r,s=e[o];s.linked&&(r=s.original,r=t.snippetManager.tmStrFormat(n,r,this.editor),i.replace(s,r))}this.$inChange=!1}},v.prototype.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},v.prototype.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,i=this.editor.selection.isEmpty(),n=0;n<this.ranges.length;n++)if(!this.ranges[n].linked){var o=this.ranges[n].contains(e.row,e.column),r=i||this.ranges[n].contains(t.row,t.column);if(o&&r)return}this.detach()}},v.prototype.onChangeSession=function(){this.detach()},v.prototype.tabNext=function(e){var t=this.tabstops.length;e=this.index+(e||1),e=Math.min(Math.max(e,1),t),this.selectTabstop(e=e==t?0:e),0===e&&this.detach()},v.prototype.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){if(e=(this.selectedTabstop=t).firstNonLinked||t,t.choices&&(e.cursor=e.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(e);else{var i=this.editor.multiSelect;i.toSingleRange(e);for(var n=0;n<t.length;n++)t.hasLinkedRanges&&t[n].linked||i.addRange(t[n].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},v.prototype.addTabstops=function(e,t,i){var n=this.useLink||!this.editor.getOption("enableMultiselect");this.$openTabstops||(this.$openTabstops=[]),e[0]||(i=a.fromPoints(i,i),I(i.start,t),I(i.end,t),e[0]=[i],e[0].index=0);var o=[this.index+1,0],r=this.ranges;e.forEach((function(e,i){for(var s=this.$openTabstops[i]||e,c=0;c<e.length;c++){var h=e[c],d=a.fromPoints(h.start,h.end||h.start);C(d.start,t),C(d.end,t),d.original=h,d.tabstop=s,r.push(d),s!=e?s.unshift(d):s[c]=d,h.fmtString||s.firstNonLinked&&n?(d.linked=!0,s.hasLinkedRanges=!0):s.firstNonLinked||(s.firstNonLinked=d)}s.firstNonLinked||(s.hasLinkedRanges=!1),s===e&&(o.push(s),this.$openTabstops[i]=s),this.addTabstopMarkers(s),s.rangeList=s.rangeList||new l,s.rangeList.$bias=0,s.rangeList.addList(s)}),this),2<o.length&&(this.tabstops.length&&o.push(o.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,o))},v.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},v.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},v.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()},v);function v(e){if(this.index=0,this.ranges=[],this.tabstops=[],e.tabstopManager)return e.tabstopManager;(e.tabstopManager=this).$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}y.prototype.keyboardHandler=new c,y.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 C=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},I=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 g,o=e("./editor").Editor,function(){this.insertSnippet=function(e,i){return t.snippetManager.insertSnippet(this,e,i)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}.call(o.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"],(function(e,t,i){"use strict";function n(e){return"suggest-aria-id:".concat(e)}function o(e){return(e=new s(e)).$maxLines=4,(e=new a(e)).setHighlightActiveLine(!1),e.setShowPrintMargin(!1),e.renderer.setShowGutter(!1),e.renderer.setHighlightGutterLine(!1),e.$mouseHandler.$focusTimeout=0,e.$highlightTagPending=!0,e}function r(e){function t(){}function i(){m(-1)}var r,s=d.createElement("div"),a=new o(s),p=(e&&e.appendChild(s),s.style.display="none",a.renderer.content.style.cursor="default",a.renderer.setStyle("ace_autocomplete"),a.renderer.$textLayer.element.setAttribute("role","listbox"),a.renderer.$textLayer.element.setAttribute("aria-label",u("Autocomplete suggestions")),a.renderer.textarea.setAttribute("aria-hidden","true"),a.setOption("displayIndentGuides",!1),a.setOption("dragDelay",150),a.focus=t,a.$isFocused=!0,a.renderer.$cursorLayer.restartTimer=t,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),g.start.row=g.end.row=t.row,e.stop()})),new l(-1,0,-1,1/0)),g=new l(-1,0,-1,1/0),m=(g.id=a.session.addMarker(g,"ace_active-line","fullLine"),a.setSelectOnHover=function(e){e?p.id&&(a.session.removeMarker(p.id),p.id=null):p.id=a.session.addMarker(p,"ace_line-hover","fullLine")},a.setSelectOnHover(!1),a.on("mousemove",(function(e){var t;r?r.x==e.x&&r.y==e.y||((r=e).scrollTop=a.renderer.scrollTop,a.isMouseOver=!0,t=r.getDocumentPosition().row,p.start.row!=t&&(p.id||a.setRow(t),m(t))):r=e})),a.renderer.on("beforeRender",(function(){var e;r&&-1!=p.start.row&&(r.$pos=null,e=r.getDocumentPosition().row,p.id||a.setRow(e),m(e,!0))})),a.renderer.on("afterRender",(function(){var e,t=a.getRow(),i=a.renderer.$textLayer,o=i.element.childNodes[t-i.config.firstRow],r=document.activeElement;o!==i.selectedNode&&i.selectedNode&&(d.removeCssClass(i.selectedNode,"ace_selected"),r.removeAttribute("aria-activedescendant"),i.selectedNode.removeAttribute("id")),(i.selectedNode=o)&&(d.addCssClass(o,"ace_selected"),e=n(t),o.id=e,i.element.setAttribute("aria-activedescendant",e),r.setAttribute("aria-activedescendant",e),o.setAttribute("role","option"),o.setAttribute("aria-label",a.getData(t).value),o.setAttribute("aria-setsize",a.data.length),o.setAttribute("aria-posinset",t+1),o.setAttribute("aria-describedby","doc-tooltip"))})),function(e,t){e!==p.start.row&&(p.start.row=p.end.row=e,t||a.session._emit("changeBackMarker"),a._emit("changeHoverMarker"))});return a.getHoveredRow=function(){return p.start.row},c.addListener(a.container,"mouseout",(function(){a.isMouseOver=!1,i()})),a.on("hide",i),a.on("changeSelection",i),a.session.doc.getLength=function(){return a.data.length},a.session.doc.getLine=function(e){return"string"==typeof(e=a.data[e])?e:e&&e.value||""},(e=a.session.bgTokenizer).$tokenizeRow=function(e){var t=a.data[e],i=[];if(t){for(var n,o,r=(t="string"==typeof t?{value:t}:t).caption||t.value||t.name,s=r.toLowerCase(),l=(a.filterText||"").toLowerCase(),c=0,h=0,d=0;d<=l.length;d++)d!=h&&(t.matchMask&1<<d||d==l.length)&&(n=l.slice(h,d),h=d,-1!=(o=s.indexOf(n,c)))&&(u(r.slice(c,o),""),c=o+n.length,u(r.slice(o,c),"completion-highlight"));u(r.slice(c,r.length),""),i.push({type:"completion-spacer",value:" "}),t.meta&&i.push({type:"completion-meta",value:t.meta}),t.message&&i.push({type:"completion-message",value:t.message})}return i;function u(e,n){e&&i.push({type:(t.className||"")+(n||""),value:e})}},e.$updateOnChange=t,e.start=t,a.session.$computeWidth=function(){return this.screenWidth=0},a.isOpen=!1,a.isTopdown=!1,a.autoSelect=!0,a.filterText="",a.isMouseOver=!1,a.data=[],a.setData=function(e,t){a.filterText=t||"",a.setValue(h.stringRepeat("\n",e.length),-1),a.data=e||[],a.setRow(0)},a.getData=function(e){return a.data[e]},a.getRow=function(){return g.start.row},a.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,e)),g.start.row!=e&&(a.selection.clearSelection(),g.start.row=g.end.row=e||0,a.session._emit("changeBackMarker"),a.moveCursorTo(e||0,0),a.isOpen)&&a._signal("select")},a.on("changeSelection",(function(){a.isOpen&&a.setRow(a.selection.lead.row),a.renderer.scrollCursorIntoView()})),a.hide=function(){this.container.style.display="none",a.anchorPos=null,a.anchor=null,a.isOpen&&(a.isOpen=!1,this._signal("hide"))},a.tryShow=function(e,t,i,n){if(n||!a.isOpen||!a.anchorPos||!a.anchor||a.anchorPos.top!==e.top||a.anchorPos.left!==e.left||a.anchor!==i){var o=this.container,s=window.innerHeight,l=window.innerWidth,c=this.renderer,h=c.$maxLines*t*1.4,d={top:0,bottom:0,left:0},u=s-e.top-3*this.$borderSize-t,p=e.top-3*this.$borderSize;if("top"===(i=i||(p<=u||h<=u?"bottom":"top"))?(d.bottom=e.top-this.$borderSize,d.top=d.bottom-h):"bottom"===i&&(d.top=e.top+t+this.$borderSize,d.bottom=d.top+h),t=0<=d.top&&d.bottom<=s,!n&&!t)return!1;c.$maxPixelHeight=t?null:"top"===i?p:u,"top"===i?(o.style.top="",o.style.bottom=s-d.bottom+"px",a.isTopdown=!1):(o.style.top=d.top+"px",o.style.bottom="",a.isTopdown=!0),o.style.display="",(h=e.left)+o.offsetWidth>l&&(h=l-o.offsetWidth),o.style.left=h+"px",o.style.right="",a.isOpen||(a.isOpen=!0,this._signal("show"),r=null),a.anchorPos=e,a.anchor=i}return!0},a.show=function(e,t,i){this.tryShow(e,t,i?"bottom":void 0,!0)},a.goTo=function(e){var t=this.getRow(),i=this.session.getLength()-1;switch(e){case"up":t=t<=0?i:t-1;break;case"down":t=i<=t?-1:t+1;break;case"start":t=0;break;case"end":t=i}this.setRow(t)},a.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},a.$imageSize=0,a.$borderSize=1,a}var s=e("../virtual_renderer").VirtualRenderer,a=e("../editor").Editor,l=e("../range").Range,c=e("../lib/event"),h=e("../lib/lang"),d=e("../lib/dom"),u=e("../config").nls;d.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    white-space: nowrap;\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=r,t.$singleLineEditor=o,t.getAriaId=n})),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],(function(e,t,i){"use strict";function n(e){this.editor=e,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}n.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;if(e=t.element.childNodes[e-t.config.firstRow]){for(var i="doc-tooltip ",n=0;n<this._lines.length;n++)i+="ace-inline-screenreader-line-".concat(n," ");e.setAttribute("aria-describedby",i)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\r\n|\r|\n/),e=this.createCodeBlock(),this.screenReaderDiv.appendChild(e)},n.prototype.destroy=function(){this.screenReaderDiv.remove()},n.prototype.createCodeBlock=function(){var e=document.createElement("pre");e.setAttribute("id","ace-inline-screenreader");for(var t=0;t<this._lines.length;t++){var i=document.createElement("code"),n=(i.setAttribute("id","ace-inline-screenreader-line-".concat(t)),document.createTextNode(this._lines[t]));i.appendChild(n),e.appendChild(i)}return e},t.AceInlineScreenReader=n})),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],(function(e,t,i){"use strict";var n=e("../snippets").snippetManager,o=e("./inline_screenreader").AceInlineScreenReader;function r(){this.editor=null}r.prototype.show=function(e,t,i){if(i=i||"",e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||(this.inlineScreenReader=new o(e));var r=t.snippet?n.getDisplayTextForSnippet(e,t.snippet):t.value;return!(t.hideInlinePreview||!r||!r.startsWith(i)||(this.editor=e,this.inlineScreenReader.setScreenReaderContent(r),""===(r=r.slice(i.length))?e.removeGhostText():e.setGhostText(r),0))},r.prototype.isOpen=function(){return!!this.editor&&!!this.editor.renderer.$ghostText},r.prototype.hide=function(){return!!this.editor&&(this.editor.removeGhostText(),!0)},r.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},t.AceInline=r})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,i){"use strict";t.parForEach=function(e,t,i){var n=0,o=e.length;0===o&&i();for(var r=0;r<o;r++)t(e[r],(function(e,t){++n===o&&i(e,t)}))};var n=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t-1;0<=r&&i.test(e[r]);r--)o.push(e[r]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t;r<e.length&&i.test(e[r]);r++)o.push(e[r]);return o},t.getCompletionPrefix=function(e){var t,i=e.getCursorPosition(),n=e.session.getLine(i.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(n,i.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(n,i.column)},t.triggerAutocomplete=function(e){var t=e.getCursorPosition(),i=e.session.getLine(t.row)[0===t.column?0:t.column-1];return e.completers.some((function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(i)}))}})),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event"],(function(e,t,i){"use strict";function n(e,t){t.completer&&t.completer.destroy()}var o=e("./keyboard/hash_handler").HashHandler,r=e("./autocomplete/popup").AcePopup,s=e("./autocomplete/inline").AceInline,a=e("./autocomplete/popup").getAriaId,l=e("./autocomplete/util"),c=e("./lib/lang"),h=e("./lib/dom"),d=e("./snippets").snippetManager,u=e("./config"),p=e("./lib/event"),g=(m.prototype.$init=function(){return this.popup=new r(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),p.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},m.prototype.$initInline=function(){if(this.inlineEnabled&&!this.inlineRenderer)return this.inlineRenderer=new s,this.inlineRenderer},m.prototype.getPopup=function(){return this.popup||this.$init()},m.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.stickySelection=!1},m.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){e=e?null:this.popup.getData(this.popup.getRow());var t=l.getCompletionPrefix(this.editor);if(this.inlineRenderer.show(this.editor,e,t)||this.inlineRenderer.hide(),this.popup.isMouseOver&&this.setSelectOnHover)return void this.tooltipTimer.call(null,null)}this.$updatePopupPosition(),this.tooltipTimer.call(null,null)},m.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,0<=this.stickySelectionDelay&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},m.prototype.observeLayoutChanges=function(){if(!this.$elements&&this.editor){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener("scroll",this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},m.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},m.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},m.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,i=t.layerConfig.lineHeight,n=t.$cursorLayer.getPixelPosition(this.base,!0),o=(n.left-=this.popup.getTextLeftOffset(),e.container.getBoundingClientRect());n.top+=o.top-t.layerConfig.offset,n.left+=o.left-e.renderer.scrollLeft,n.left+=t.gutterWidth,o={top:n.top,left:n.left},t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(o.top+=t.$ghostTextWidget.el.offsetHeight),this.popup.tryShow(o,i,"bottom")||this.popup.tryShow(n,i,"top")||this.popup.show(n,i)},m.prototype.openPopup=function(e,t,i){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var n=this.popup.data[this.popup.getRow()];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:a(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler),(n=this.popup.data.indexOf(n))&&this.stickySelection?this.popup.setRow(this.autoSelect?n:-1):this.popup.setRow(this.autoSelect?0:-1),i?t||this.detach():(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},m.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},m.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},m.prototype.blurListener=function(e){var t=document.activeElement,i=this.editor.textInput.getElement(),n=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t==i||t.parentNode==o||n||t==this.tooltipNode||e.relatedTarget==i||this.detach()},m.prototype.mousedownListener=function(e){this.detach()},m.prototype.mousewheelListener=function(e){this.popup.isMouseOver||this.detach()},m.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},m.prototype.goTo=function(e){this.popup.goTo(e)},m.prototype.insertMatch=function(e,t){var i;return!!(e=e||this.popup.getData(this.popup.getRow()))&&(""===e.value?this.detach():(i=this.completions,e=this.getCompletionProvider().insertMatch(this.editor,e,i.filterText,t),this.completions==i&&this.detach(),e))},m.prototype.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,(this.editor=e).completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},m.prototype.getCompletionProvider=function(e){return this.completionProvider||(this.completionProvider=new f(e)),this.completionProvider},m.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},m.prototype.updateCompletions=function(e,t){var i,n;return e&&this.base&&this.completions?(i=this.editor.getCursorPosition(),(n=this.editor.session.getTextRange({start:this.base,end:i}))==this.completions.filterText?void 0:(this.completions.setFilter(n),this.completions.filtered.length&&(1!=this.completions.filtered.length||this.completions.filtered[0].value!=n||this.completions.filtered[0].snippet)?void this.openPopup(this.editor,n,e):this.detach())):t&&t.matches?(i=this.editor.getSelectionRange().start,this.base=this.editor.session.doc.createAnchor(i.row,i.column),this.base.$insertRight=!0,this.completions=new v(t.matches),this.openPopup(this.editor,"",e)):(t=this.editor.getSession(),i=this.editor.getCursorPosition(),n=l.getCompletionPrefix(this.editor),this.base=t.doc.createAnchor(i.row,i.column-n.length),this.base.$insertRight=!0,t={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption},this.getCompletionProvider({prefix:n,pos:i}).provideCompletions(this.editor,t,function(t,i,n){var o,r=i.filtered,s=l.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),n){if(!r.length)return(o="function"==typeof(o=!this.autoShown&&this.emptyMessage)?this.emptyMessage(s):o)?(this.completions=new v([{caption:o,value:""}]),void this.openPopup(this.editor,s,e)):this.detach();if(1==r.length&&r[0].value==s&&!r[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&1==r.length)return this.insertMatch(r[0])}this.completions=i,this.openPopup(this.editor,s,e),this.popup.renderer.setStyle("ace_loading",!n)}.bind(this)),void(this.autoShown||this.popup&&this.popup.isOpen||this.$firstOpenTimer.delay(this.stickySelectionDelay/2)))},m.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},m.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions.filtered,i=t&&(t[e.getHoveredRow()]||t[e.getRow()]),n=null;if(!i||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var o=this.editor.completers.length,r=0;r<o;r++){var s=this.editor.completers[r];if(s.getDocTooltip&&i.completerId===s.id){n=s.getDocTooltip(i);break}}if(!(n="string"==typeof(n=n||"string"==typeof i?n:i)?{docText:n}:n)||!n.docHTML&&!n.docText)return this.hideDocTooltip();this.showDocTooltip(n)},m.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=h.createElement("div"),this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"));var t=this.editor.renderer.theme,i=(this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(t.isDark?"ace_dark ":"")+(t.cssClass||""),t=this.tooltipNode,(e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||this.popup.container.appendChild(this.tooltipNode),e=this.popup).container.getBoundingClientRect());t.style.top=e.container.style.top,t.style.bottom=e.container.style.bottom,t.style.display="block",window.innerWidth-i.right<320?i.left<320?(e.isTopdown?t.style.top=i.bottom+"px":t.style.top=e.container.offsetTop-t.offsetHeight+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-i.left+"px",t.style.left=""):(t.style.left=i.right+1+"px",t.style.right="")},m.prototype.hideDocTooltip=function(){var e;this.tooltipTimer.cancel(),this.tooltipNode&&(e=this.tooltipNode,this.editor.isFocused()||document.activeElement!=e||this.editor.focus(),this.tooltipNode=null,e.parentNode)&&e.parentNode.removeChild(e)},m.prototype.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},m.prototype.destroy=function(){var e;this.detach(),this.popup&&(this.popup.destroy(),e=this.popup.container)&&e.parentNode&&e.parentNode.removeChild(e),this.editor&&this.editor.completer==this&&(this.editor.off("destroy",n),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},m);function m(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new o,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=c.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=c.delayedCall(this.updateDocTooltip.bind(this),50),this.stickySelectionTimer=c.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=c.delayedCall(function(){var e,t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||(e=[{caption:u.nls("Loading..."),value:""}],this.completions=new v(e),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}g.prototype.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},g.for=function(e){return e.completer instanceof g||(e.completer&&(e.completer.destroy(),e.completer=null),u.get("sharedPopups")?(g.$sharedInstance||(g.$sharedInstance=new g),e.completer=g.$sharedInstance):(e.completer=new g,e.once("destroy",n))),e.completer},g.startCommand={name:"startAutocomplete",exec:function(e,t){var i=g.for(e);i.autoInsert=!1,i.autoSelect=!0,i.autoShown=!1,i.showPopup(e,t),i.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"},y.prototype.insertByIndex=function(e,t,i){return!(!this.completions||!this.completions.filtered)&&this.insertMatch(e,this.completions.filtered[t],i)},y.prototype.insertMatch=function(e,t,i){if(!t)return!1;if(e.startOperation({command:{name:"insertMatch"}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var n=this.completions.filterText.length,o=0;if(t.range&&t.range.start.row===t.range.end.row&&(n=(n-=this.initialPosition.prefix.length)+(this.initialPosition.pos.column-t.range.start.column),o+=t.range.end.column-this.initialPosition.pos.column),n||o)for(var r,s=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()],a=0;r=s[a];a++)r.start.column-=n,r.end.column+=o,e.session.remove(r);t.snippet?d.insertSnippet(e,t.snippet):this.$insertString(e,t),t.command&&"startAutocomplete"===t.command&&e.execCommand(t.command)}return e.endOperation(),!0},y.prototype.$insertString=function(e,t){t=t.value||t,e.execCommand("insertstring",t)},y.prototype.gatherCompletions=function(e,t){var i=e.getSession(),n=e.getCursorPosition(),o=l.getCompletionPrefix(e),r=[],s=(this.completers=e.completers,e.completers.length);return e.completers.forEach((function(a,c){a.getCompletions(e,i,n,o,(function(i,n){a.hideInlinePreview&&(n=n.map((function(e){return Object.assign(e,{hideInlinePreview:a.hideInlinePreview})}))),!i&&n&&(r=r.concat(n)),t(null,{prefix:l.getCompletionPrefix(e),matches:r,finished:0==--s})}))})),!0},y.prototype.provideCompletions=function(e,t,i){var n=function(e){var n=e.prefix,o=e.matches;this.completions=new v(o),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(n),(e.finished||this.completions.filtered.length)&&i(null,this.completions,e.finished)}.bind(this),o=!0,r=null;this.gatherCompletions(e,function(e,t){this.active&&(e&&(i(e,[],!0),this.detach()),0===t.prefix.indexOf(t.prefix))&&(o?r=t:n(t))}.bind(this)),o=!1,r&&(e=r,r=null,n(e))},y.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach((function(e){"function"==typeof e.cancel&&e.cancel()}))};var f=y;function y(e){this.initialPosition=e,this.active=!0}C.prototype.setFilter=function(e){t=e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0)?this.filtered: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 t,i=null;t=t.filter((function(e){return(e=e.snippet||e.caption||e.value)!==i&&(i=e,!0)})),this.filtered=t},C.prototype.filterCompletions=function(e,t){var i=[],n=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=!this.ignoreCaption&&r.caption||r.value||r.snippet;if(a){var l=-1,c=0,h=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue}else{var d=a.toLowerCase().indexOf(o);if(-1<d)h=d;else for(var u=0;u<t.length;u++){var p=a.indexOf(o[u],l+1),g=a.indexOf(n[u],l+1);if((p=0<=p&&(g<0||p<g)?p:g)<0)continue e;0<(g=p-l-1)&&(-1===l&&(h+=10),h+=g,c|=1<<u),l=p}}r.matchMask=c,r.exactMatch=h?0:1,r.$score=(r.score||0)-h,i.push(r)}}return i};var v=C;function C(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1,this.ignoreCaption=!1}t.Autocomplete=g,t.CompletionProvider=f,t.FilteredList=v})),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],(function(e,t,i){var n=e("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function r(e,t){var i=e.getTextRange(n.fromPoints({row:0,column:0},t)).split(o).length-1,r=e.getValue().split(o),s=Object.create(null),a=r[i];return r.forEach((function(e,t){e&&e!==a&&(t=Math.abs(i-t),t=r.length-t,s[e]?s[e]=Math.max(t,s[e]):s[e]=t)})),s}t.getCompletions=function(e,t,i,n,o){var s=r(t,i);o(null,Object.keys(s).map((function(e){return{caption:e,value:e,score:s[e],meta:"local"}})))}})),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],(function(e,t,i){"use strict";function n(e,t){f(t.session.$mode)}function o(e){var t=e.editor,i=t.completer&&t.completer.activated;"backspace"===e.command.name?i&&!h.getCompletionPrefix(t)&&t.completer.detach():"insertstring"!==e.command.name||i||((t=(r=e).editor.$liveAutocompletionDelay)?v.delay(t):C(e))}var r,s=e("../snippets").snippetManager,a=e("../autocomplete").Autocomplete,l=e("../config"),c=e("../lib/lang"),h=e("../autocomplete/util"),d=e("../autocomplete/text_completer"),u={getCompletions:function(e,t,i,n,o){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,i,n,o);e=e.session.getState(i.row),o(null,t.$mode.getCompletions(e,t,i,n).map((function(e){return e.completerId=u.id,e})))},id:"keywordCompleter"},p={getCompletions:function(e,t,i,n,o){var r=[],a=((t=t.getTokenAt(i.row,i.column))&&t.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?r.push("html-tag"):r=s.getActiveScopes(e),s.snippetMap),l=[];r.forEach((function(e){for(var t=a[e]||[],i=t.length;i--;){var n=t[i],o=n.name||n.tabTrigger;o&&l.push({caption:o,snippet:n.content,meta:n.tabTrigger&&!n.name?n.tabTrigger+"⇥ ":"snippet",completerId:p.id})}}),this),o(null,l)},getDocTooltip:function(e){var t;e.snippet&&!e.docHTML&&(e.docHTML=["<b>",c.escapeHTML(e.caption),"</b>","<hr></hr>",c.escapeHTML((e=e.snippet,t={},e.replace(/\${(\d+)(:(.*?))?}/g,(function(e,i,n,o){return t[i]=o||""})).replace(/\$(\d+?)/g,(function(e,i){return t[i]}))))].join(""))},id:"snippetCompleter"},g=[p,d,u],m=(t.setCompleters=function(e){g.length=0,e&&g.push.apply(g,e)},t.addCompleter=function(e){g.push(e)},t.textCompleter=d,t.keyWordCompleter=u,t.snippetCompleter=p,{name:"expandSnippet",exec:function(e){return s.expandWithTab(e)},bindKey:"Tab"}),f=function(e){(e="string"==typeof e?l.$modes[e]:e)&&(s.files||(s.files={}),y(e.$id,e.snippetFileId),e.modes)&&e.modes.forEach(f)},y=function(e,t){t&&e&&!s.files[e]&&(s.files[e]={},l.loadModule(t,(function(t){t&&(!(s.files[e]=t).snippets&&t.snippetText&&(t.snippets=s.parseSnippetFile(t.snippetText)),s.register(t.snippets||[],t.scope),t.includeScopes)&&(s.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){f("ace/mode/"+e)})))})))},v=c.delayedCall((function(){C(r)}),0),C=function(e){e=e.editor;var t=h.getCompletionPrefix(e),i=h.triggerAutocomplete(e);(t&&t.length>=e.$liveAutocompletionThreshold||i)&&((t=a.for(e)).autoShown=!0,t.showPopup(e))};d=e("../editor").Editor,e("../config").defineOptions(d.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:g),this.commands.addCommand(a.startCommand)):this.commands.removeCommand(a.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:g),this.commands.on("afterExec",o)):this.commands.off("afterExec",o)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(m),this.on("changeMode",n),n(0,this)):(this.commands.removeCommand(m),this.off("changeMode",n))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},3330:function(e,t,i){e=i.nmd(e),ace.define("ace/ext/searchbox-css",["require","exports","module"],(function(e,t,i){i.exports='\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n    background-color: #ddd;\n    color: #666;\n    border: 1px solid #cbcbcb;\n    border-top: 0 none;\n    overflow: hidden;\n    margin: 0;\n    padding: 4px 6px 0 4px;\n    position: absolute;\n    top: 0;\n    z-index: 99;\n    white-space: normal;\n}\n.ace_search.left {\n    border-left: 0 none;\n    border-radius: 0px 0px 5px 0px;\n    left: 0;\n}\n.ace_search.right {\n    border-radius: 0px 0px 0px 5px;\n    border-right: 0 none;\n    right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n    margin: 0 20px 4px 0;\n    overflow: hidden;\n    line-height: 1.9;\n}\n.ace_replace_form {\n    margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n    outline: 1px solid red;\n}\n\n.ace_search_field {\n    border-radius: 3px 0 0 3px;\n    background-color: white;\n    color: black;\n    border: 1px solid #cbcbcb;\n    border-right: 0 none;\n    outline: 0;\n    padding: 0;\n    font-size: inherit;\n    margin: 0;\n    line-height: inherit;\n    padding: 0 6px;\n    min-width: 17em;\n    vertical-align: top;\n    min-height: 1.8em;\n    box-sizing: content-box;\n}\n.ace_searchbtn {\n    border: 1px solid #cbcbcb;\n    line-height: inherit;\n    display: inline-block;\n    padding: 0 6px;\n    background: #fff;\n    border-right: 0 none;\n    border-left: 1px solid #dcdcdc;\n    cursor: pointer;\n    margin: 0;\n    position: relative;\n    color: #666;\n}\n.ace_searchbtn:last-child {\n    border-radius: 0 3px 3px 0;\n    border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n    background: none;\n    cursor: default;\n}\n.ace_searchbtn:hover {\n    background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n     padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n     content: "";\n     border: solid 2px #888;\n     width: 0.5em;\n     height: 0.5em;\n     border-width:  2px 0 0 2px;\n     display:inline-block;\n     transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n     border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n    border-radius: 50%;\n    border: 0 none;\n    color: #656565;\n    cursor: pointer;\n    font: 16px/16px Arial;\n    padding: 0;\n    height: 14px;\n    width: 14px;\n    top: 9px;\n    right: 7px;\n    position: absolute;\n}\n.ace_searchbtn_close:hover {\n    background-color: #656565;\n    background-position: 50% 100%;\n    color: white;\n}\n\n.ace_button {\n    margin-left: 2px;\n    cursor: pointer;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -o-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    overflow: hidden;\n    opacity: 0.7;\n    border: 1px solid rgba(100,100,100,0.23);\n    padding: 1px;\n    box-sizing:    border-box!important;\n    color: black;\n}\n\n.ace_button:hover {\n    background-color: #eee;\n    opacity:1;\n}\n.ace_button:active {\n    background-color: #ddd;\n}\n\n.ace_button.checked {\n    border-color: #3399ff;\n    opacity:1;\n}\n\n.ace_search_options{\n    margin-bottom: 3px;\n    text-align: right;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -o-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    clear: both;\n}\n\n.ace_search_counter {\n    float: left;\n    font-family: arial;\n    padding: 0 8px;\n}'})),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/lang"),r=e("../lib/event"),s=e("./searchbox-css"),a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys"),c=e("../config").nls,h=(n.importCssString(s,"ace_searchbox",!1),d.prototype.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},d.prototype.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},d.prototype.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},d.prototype.$init=function(){var e=this.element,t=(this.$initElements(e),this);r.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),r.stopPropagation(e)})),r.addListener(e,"click",(function(e){var i=(e.target||e.srcElement).getAttribute("action");i&&t[i]?t[i]():t.$searchBarKb.commands[i]&&t.$searchBarKb.commands[i].exec(t),r.stopPropagation(e)})),r.addCommandKeyListener(e,(function(e,i,n){n=l.keyCodeToString(n),(i=t.$searchBarKb.findKeyCommand(i,n))&&i.exec&&(i.exec(t),r.stopEvent(e))})),this.$onChange=o.delayedCall((function(){t.find(!1,!1)})),r.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),r.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),r.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},d.prototype.setSearchRange=function(e){(this.searchRange=e)?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},d.prototype.$syncOptions=function(e){n.setCssClass(this.replaceOption,"checked",this.searchRange),n.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",n.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),n.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),n.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},d.prototype.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},d.prototype.find=function(e,t,i){e=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:i,range:this.searchRange})&&this.searchInput.value,n.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.updateCounter()},d.prototype.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,i=0,n=0;if(t){var o,r,s=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),a=e.session.doc.positionToIndex(e.selection.anchor);for(this.searchRange&&(a-=e.session.doc.positionToIndex(this.searchRange.start)),t.lastIndex=0;(r=t.exec(s))&&((o=r.index)<=a&&n++,!(999<++i))&&(r[0]||(t.lastIndex=o+=1,!(o>=s.length))););}this.searchCounter.textContent=c("$0 of $1",[n,999<i?"999+":i])},d.prototype.findNext=function(){this.find(!0,!1)},d.prototype.findPrev=function(){this.find(!0,!0)},d.prototype.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;n.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},d.prototype.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},d.prototype.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},d.prototype.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},d.prototype.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},d.prototype.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},d.prototype.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput},d);function d(e,t,i){var o=n.createElement("div");n.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:c("Search for"),spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"​"],["span",{action:"findNext",class:"ace_searchbtn next"},"​"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},c("All")]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:c("Replace with"),spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},c("Replace")],["span",{action:"replaceAll",class:"ace_searchbtn"},c("All")]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:c("Toggle Replace mode"),style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:c("RegExp Search")},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:c("CaseSensitive Search")},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:c("Whole Word Search")},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:c("Search In Selection")},"S"]]],o),this.element=o.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),n.importCssString(s,"ace_searchbox",e.container)}(e=new a).bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout((function(){e.hide()}))},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),e.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),a=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),h.prototype.$searchBarKb=e,h.prototype.$closeSearchBarKb=a,t.SearchBox=h,t.Search=function(e,t){(e.searchBox||new h(e)).show(e.session.getTextRange(),t)}})),ace.require(["ace/ext/searchbox"],(function(t){e&&(e.exports=t)}))},4091:function(e,t,i){e=i.nmd(e),ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,i){"use strict";function n(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"punctuation.operator",regex:/[,]/},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}}var o=e("../lib/oop");e=e("./text_highlight_rules").TextHighlightRules,o.inherits(n,e),t.JsonHighlightRules=n})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,i){"use strict";function n(){}var o=e("../range").Range;(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i,n=e.getLine(t).match(/^(\s*\})/);return n&&(n=n[1].length,i=e.findMatchingBracket({row:t,column:n}))&&i.row!=t?(i=this.$getIndent(e.getLine(i.row)),void e.replace(new o(t,0,t,n-1),i)):0},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(n.prototype),t.MatchingBraceOutdent=n})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,i){"use strict";var n=e("../../lib/oop"),o=e("../../range").Range;e=e("./fold_mode").FoldMode,t=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(t,e),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,i){var n=e.getLine(i);return!this.singleLineBlockCommentRe.test(n)||this.startRegionRe.test(n)||this.tripleStarBlockCommentRe.test(n)?!(e=this._getFoldWidgetBase(e,t,i))&&this.startRegionRe.test(n)?"start":e:""},this.getFoldWidgetRange=function(e,t,i,n){var o,r,s,a=e.getLine(i);return this.startRegionRe.test(a)?this.getCommentRegionBlock(e,a,i):(r=a.match(this.foldingStartMarker))?(s=r.index,r[1]?this.openingBracketBlock(e,r[1],i,s):((o=e.getCommentFoldRange(i,s+r[0].length,1))&&!o.isMultiLine()&&(n?o=this.getSectionRange(e,i):"all"!=t&&(o=null)),o)):"markbegin"!==t&&(r=a.match(this.foldingStopMarker))?(s=r.index+r[0].length,r[1]?this.closingBracketBlock(e,r[1],i,s):e.getCommentFoldRange(i,s,-1)):void 0},this.getSectionRange=function(e,t){for(var i=(l=e.getLine(t)).search(/\S/),n=t,r=l.length,s=t+=1,a=e.getLength();++t<a;){var l,c=(l=e.getLine(t)).search(/\S/);if(-1!==c){if(c<i)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=n)break;if(h.isMultiLine())t=h.end.row;else if(i==c)break}s=t}}return new o(n,r,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,i){for(var n=t.search(/\s*$/),r=e.getLength(),s=i,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++i<r;){t=e.getLine(i);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(s<i)return new o(s,n,i,t.length)}}.call(t.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,i){"use strict";function n(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new l}var o=e("../lib/oop"),r=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("./folding/cstyle").FoldMode,c=e("../worker/worker_client").WorkerClient;o.inherits(n,r),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,i){var n=this.$getIndent(t);return"start"==e&&t.match(/^.*[\{\(\[]\s*$/)&&(n+=i),n},this.checkOutdent=function(e,t,i){return this.$outdent.checkOutdent(t,i)},this.autoOutdent=function(e,t,i){this.$outdent.autoOutdent(t,i)},this.createWorker=function(e){var t=new c(["ace"],"ace/mode/json_worker","JsonWorker");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/json"}.call(n.prototype),t.Mode=n})),ace.require(["ace/mode/json"],(function(t){e&&(e.exports=t)}))},8903:function(e,t,i){"use strict";var n=i(5689),o=i(3969),r=i(5255),s=i(4293),a=i(3508),l=i(3368),c=i(742),h=i(9394),d=i(3724),u=((e.exports=m).prototype.validate=function(e,t){var i;if("string"==typeof e){if(!(i=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else i=(e=this._addSchema(e)).validate||this._compile(e);return e=i(t),!0!==i.$async&&(this.errors=i.errors),e},m.prototype.compile=function(e,t){return(e=this._addSchema(e,void 0,t)).validate||this._compile(e)},m.prototype.addSchema=function(e,t,i,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.addSchema(e[r],void 0,i,n);else{var s=this._getId(e);if(void 0!==s&&"string"!=typeof s)throw new Error("schema id must be string");b(this,t=o.normalizeId(t||s)),this._schemas[t]=this._addSchema(e,i,n,!0)}return this},m.prototype.addMetaSchema=function(e,t,i){return this.addSchema(e,t,i,!0),this},m.prototype.validateSchema=function(e,t){var i=e.$schema;if(void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(!(i=i||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(u)?u:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);if(!(i=this.validate(i,e))&&t){if(e="schema is invalid: "+this.errorsText(),"log"!=this._opts.validateSchema)throw new Error(e);this.logger.error(e)}return i},m.prototype.getSchema=function(e){var t=f(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var i,r,a,l=o.schema.call(e,{schema:{}},t);if(l)return i=l.schema,r=l.root,l=l.baseId,a=n.call(e,i,r,void 0,l),e._fragments[t]=new s({ref:t,fragment:!0,schema:i,root:r,baseId:l,validate:a}),a}(this,e)}},m.prototype.removeSchema=function(e){if(e instanceof RegExp)y(this,this._schemas,e),y(this,this._refs,e);else switch(typeof e){case"undefined":return y(this,this._schemas),y(this,this._refs),this._cache.clear(),this;case"string":var t=f(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":t=(t=this._opts.serialize)?t(e):e,this._cache.del(t),(t=this._getId(e))&&(t=o.normalizeId(t),delete this._schemas[t],delete this._refs[t])}return this},m.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},m.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var i=void 0===(t=t||{}).separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,o="",r=0;r<e.length;r++){var s=e[r];s&&(o+=n+s.dataPath+" "+s.message+i)}return o.slice(0,-i.length)},m.prototype._addSchema=function(e,t,i,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var r,a=(a=this._opts.serialize)?a(e):e,l=this._cache.get(a);if(l)return l;n=n||!1!==this._opts.addUsedSchema,(l=o.normalizeId(this._getId(e)))&&n&&b(this,l),(t=!1!==this._opts.validateSchema&&!t)&&!(r=l&&l==o.normalizeId(e.$schema))&&this.validateSchema(e,!0);var c=o.ids.call(this,e);return c=new s({id:l,schema:e,localRefs:c,cacheKey:a,meta:i}),"#"!=l[0]&&n&&(this._refs[l]=c),this._cache.put(a,c),t&&r&&this.validateSchema(e,!0),c},m.prototype._compile=function(e,t){if(e.compiling)return(e.validate=r).schema=e.schema,r.errors=null,r.root=t||r,!0===e.schema.$async&&(r.$async=!0),r;var i,o;e.compiling=!0,e.meta&&(i=this._opts,this._opts=this._metaOpts);try{o=n.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=i)}return e.validate=o,e.refs=o.refs,e.refVal=o.refVal,e.root=o.root,o;function r(){var t=e.validate,i=t.apply(this,arguments);return r.errors=t.errors,i}},m.prototype.compileAsync=i(9677),e=i(7931),m.prototype.addKeyword=e.add,m.prototype.getKeyword=e.get,m.prototype.removeKeyword=e.remove,m.prototype.validateKeyword=e.validate,e=i(5359),m.ValidationError=e.Validation,m.MissingRefError=e.MissingRef,m.$dataMetaSchema=h,"http://json-schema.org/draft-07/schema"),p=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],g=["/properties"];function m(e){if(!(this instanceof m))return new m(e);e=this._opts=d.copy(e)||{};var t=(_=this)._opts.logger;if(!1===t)_.logger={log:A,warn:A,error:A};else{if(!("object"==typeof(t=void 0===t?console:t)&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");_.logger=t}if(this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format),this._cache=e.cache||new r,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return I;case"id":return v;default:return C}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=a),this._metaOpts=function(e){for(var t=d.copy(e._opts),i=0;i<p.length;i++)delete t[p[i]];return t}(this),e.formats){var n,o=this;for(n in o._opts.formats){var s=o._opts.formats[n];o.addFormat(n,s)}}if(e.keywords){var f,y=this;for(f in y._opts.keywords){var b=y._opts.keywords[f];y.addKeyword(f,b)}}var w,_,x=((_=this)._opts.$data&&(w=i(894),_.addMetaSchema(w,w.$id,!0)),!1!==_._opts.meta&&(w=i(6680),_._opts.$data&&(w=h(w,g)),_.addMetaSchema(w,u,!0),_._refs["http://json-schema.org/schema"]=u),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),this),S=x._opts.schemas;if(S)if(Array.isArray(S))x.addSchema(S);else for(var k in S)x.addSchema(S[k],k)}function f(e,t){return t=o.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function y(e,t,i){for(var n in t){var o=t[n];o.meta||i&&!i.test(n)||(e._cache.del(o.cacheKey),delete t[n])}}function v(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function C(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function I(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function b(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function A(){}},5255:function(e){"use strict";(e=e.exports=function(){this._cache={}}).prototype.put=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.del=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}}},9677:function(e,t,i){"use strict";var n=i(5359).MissingRef;function o(e,t,i){var r=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof t&&(i=t,t=void 0);var s=a(e).then((function(){var i=r._addSchema(e,void 0,t);return i.validate||function e(i){try{return r._compile(i)}catch(e){if(e instanceof n)return o(e);throw e}function o(n){var o=n.missingSchema;if(l(o))throw new Error("Schema "+o+" is loaded but "+n.missingRef+" cannot be resolved");return(n=r._loadingSchemas[o])||(n=r._loadingSchemas[o]=r._opts.loadSchema(o)).then(s,s),n.then((function(e){if(!l(o))return a(e).then((function(){l(o)||r.addSchema(e,o,void 0,t)}))})).then((function(){return e(i)}));function s(){delete r._loadingSchemas[o]}function l(e){return r._refs[e]||r._schemas[e]}}}(i)}));return i&&s.then((function(e){i(null,e)}),i),s;function a(e){return(e=e.$schema)&&!r.getSchema(e)?o.call(r,{$ref:e},!0):Promise.resolve()}}e.exports=o},5359:function(e,t,i){"use strict";var n=i(3969);function o(e,t,i){this.message=i||o.message(e,t),this.missingRef=n.url(e,t),this.missingSchema=n.normalizeId(n.fullPath(this.missingRef))}function r(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}e.exports={Validation:r((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:r(o)},o.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},3368:function(e,t,i){"use strict";var n=i(3724),o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31],s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=(i=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i),l=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,u=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function g(e){return n.copy(g[e="full"==e?"full":"fast"])}function m(e){var t,i;return!!(e=e.match(o))&&(t=+e[1],i=+e[2],e=+e[3],1<=i)&&i<=12&&1<=e&&e<=(2!=i||(e=t)%4!=0||e%100==0&&e%400!=0?r[i]:29)}function f(e,t){var i,n,o;return!!(e=e.match(s))&&(i=e[1],n=e[2],o=e[3],e=e[5],i<=23&&n<=59&&o<=59||23==i&&59==n&&60==o)&&(!t||e)}(e.exports=g).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":l,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":u,"relative-json-pointer":p},g.full={date:m,time:f,"date-time":function(e){return 2==(e=e.split(y)).length&&m(e[0])&&f(e[1],!0)},uri:function(e){return v.test(e)&&a.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":l,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":u,"relative-json-pointer":p};var y=/t|\s/i,v=/\/|:/,C=/[^\\]\\Z/;function I(e){if(C.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},5689:function(e,t,i){"use strict";var n=i(3969),o=i(3724),r=i(5359),s=i(3508),a=i(1869),l=o.ucs2length,c=i(2303),h=r.Validation;function d(e,t,i,v){var C=this,I=this._opts,b=[void 0],A={},w=[],_={},x=[],S={},k=[],T=function(e,t,i){var n=u.call(this,e,t,i);return 0<=n?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:i},{index:n,compiling:!1})}.call(this,e,t=t||{schema:e,refVal:b,refs:A},v),E=this._compilations[T.index];if(T.compiling)return E.callValidate=M;var R=this._formats,L=this.RULES;try{var $=B(e,t,i,v),P=(E.validate=$,E.callValidate);return P&&(P.schema=$.schema,P.errors=null,P.refs=$.refs,P.refVal=$.refVal,P.root=$.root,P.$async=$.$async,I.sourceCode)&&(P.source=$.source),$}finally{(function(e,t,i){0<=(e=u.call(this,e,t,i))&&this._compilations.splice(e,1)}).call(this,e,t,v)}function M(){var e=E.validate,t=e.apply(this,arguments);return M.errors=e.errors,t}function B(e,i,s,u){var v=!i||i.schema==e;if(i.schema!=t.schema)return d.call(C,e,i,s,u);s=!0===e.$async,u=a({isTop:!0,schema:e,isRoot:v,baseId:u,root:i,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:r.MissingRef,RULES:L,validate:a,util:o,resolve:n,resolveRef:N,usePattern:H,useDefault:O,useCustomRule:F,opts:I,formats:R,logger:C.logger,self:C}),u=y(b,m)+y(w,p)+y(x,g)+y(k,f)+u,I.processCode&&(u=I.processCode(u,e));try{var _=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",u)(C,L,R,t,b,x,k,c,l,h);b[0]=_}catch(e){throw C.logger.error("Error compiling schema, function code:",u),e}return _.schema=e,_.errors=null,_.refs=A,_.refVal=b,_.root=v?_:i,s&&(_.$async=!0),!0===I.sourceCode&&(_.source={code:u,patterns:w,defaults:x}),_}function N(e,o,r){o=n.url(e,o);var s=A[o];if(void 0!==s)return Z(a=b[s],l="refVal["+s+"]");if(!r&&t.refs&&void 0!==(s=t.refs[o]))return Z(a=t.refVal[s],l=W(o,a));var a,l=W(o);if(void 0!==(r=void 0===(r=n.call(C,B,t,o))&&(s=i&&i[o])?n.inlineRef(s,I.inlineRefs)?s:d.call(C,s,t,i,e):r))return a=r,s=A[s=o],b[s]=a,Z(r,l);delete A[o]}function W(e,t){var i=b.length;return b[i]=t,"refVal"+(A[e]=i)}function Z(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function H(e){var t=_[e];return void 0===t&&(t=_[e]=w.length,w[t]=e),"pattern"+t}function O(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return o.toQuotedString(e);case"object":var t,i;return null===e?"null":(t=s(e),void 0===(i=S[t])&&(i=S[t]=x.length,x[i]=e),"default"+i)}}function F(e,t,i,n){if(!1!==C._opts.validateSchema){if((r=e.definition.dependencies)&&!r.every((function(e){return Object.prototype.hasOwnProperty.call(i,e)})))throw new Error("parent schema must have all required keywords: "+r.join(","));if((r=e.definition.validateSchema)&&!r(t)){if(r="keyword schema is invalid: "+C.errorsText(r.errors),"log"!=C._opts.validateSchema)throw new Error(r);C.logger.error(r)}}var o,r=e.definition.compile,s=e.definition.inline,a=e.definition.macro;if(r)o=r.call(C,t,i,n);else if(a)o=a.call(C,t,i,n),!1!==I.validateSchema&&C.validateSchema(o,!0);else if(s)o=s.call(C,n,e.keyword,t,i);else if(!(o=e.definition.validate))return;if(void 0===o)throw new Error('custom keyword "'+e.keyword+'"failed to compile');return{code:"customRule"+(r=k.length),validate:k[r]=o}}}function u(e,t,i){for(var n=0;n<this._compilations.length;n++){var o=this._compilations[n];if(o.schema==e&&o.root==t&&o.baseId==i)return n}return-1}function p(e,t){return"var pattern"+e+" = new RegExp("+o.toQuotedString(t[e])+");"}function g(e){return"var default"+e+" = defaults["+e+"];"}function m(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function f(e){return"var customRule"+e+" = customRules["+e+"];"}function y(e,t){if(!e.length)return"";for(var i="",n=0;n<e.length;n++)i+=t(n,e);return i}e.exports=d},3969:function(e,t,i){"use strict";var n=i(7533),o=i(2303),r=i(3724),s=i(4293),a=i(500);function l(e,t,i){var n,o,r,a=this._refs[i];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}return(a=a||this._schemas[i])instanceof s?p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a):((a=c.call(this,t,i))&&(n=a.schema,t=a.root,r=a.baseId),n instanceof s?o=n.validate||e.call(this,n.schema,t,void 0,r):void 0!==n&&(o=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,r)),o)}function c(e,t){var i=n.parse(t),o=m(i),r=g(this._getId(e.schema));if(0===Object.keys(e.schema).length||o!==r){o=y(o);var a=this._refs[o];if("string"==typeof a)return function(e,t,i){var n,o;if(t=c.call(this,e,t))return n=t.schema,o=t.baseId,e=t.root,(t=this._getId(n))&&(o=v(o,t)),d.call(this,i,o,n,e)}.call(this,e,a,i);if(a instanceof s)a.validate||this._compile(a);else{if(!((a=this._schemas[o])instanceof s))return;if(a.validate||this._compile(a),o==y(t))return{schema:a,root:e,baseId:r}}if(!(e=a).schema)return;r=g(this._getId(e.schema))}return d.call(this,i,r,e.schema,e)}(e.exports=l).normalizeId=y,l.fullPath=g,l.url=v,l.ids=function(e){var t=y(this._getId(e)),i={"":t},s={"":g(t,!1)},l={},c=this;return a(e,{allKeys:!0},(function(e,t,a,h,d,u,p){if(""!==t){var g=c._getId(e),m=i[h];if(h=s[h]+"/"+d,void 0!==p&&(h+="/"+("number"==typeof p?p:r.escapeFragment(p))),"string"==typeof g)if(g=m=y(m?n.resolve(m,g):g),(d="string"==typeof(d=c._refs[g])?c._refs[d]:d)&&d.schema){if(!o(e,d.schema))throw new Error('id "'+g+'" resolves to more than one schema')}else if(g!=y(h))if("#"==g[0]){if(l[g]&&!o(e,l[g]))throw new Error('id "'+g+'" resolves to more than one schema');l[g]=e}else c._refs[g]=h;i[t]=m,s[t]=h}})),l},l.inlineRef=p,l.schema=c;var h=r.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,i,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var o=e.fragment.split("/"),s=1;s<o.length;s++){var a=o[s];if(a){if(void 0===(i=i[a=r.unescapeFragment(a)]))break;h[a]||((a=this._getId(i))&&(t=v(t,a)),i.$ref&&(a=v(t,i.$ref),a=c.call(this,n,a))&&(i=a.schema,n=a.root,t=a.baseId))}}return void 0!==i&&i!==n.schema?{schema:i,root:n,baseId:t}:void 0}}var u=r.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var i;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if("object"==typeof(i=t[n])&&!e(i))return!1}else for(var o in t){if("$ref"==o)return!1;if("object"==typeof(i=t[o])&&!e(i))return!1}return!0}(e):t?function e(t){var i,n=0;if(Array.isArray(t)){for(var o=0;o<t.length;o++)if("object"==typeof(i=t[o])&&(n+=e(i)),n==1/0)return 1/0}else for(var r in t){if("$ref"==r)return 1/0;if(u[r])n++;else if("object"==typeof(i=t[r])&&(n+=e(i)+1),n==1/0)return 1/0}return n}(e)<=t:void 0)}function g(e,t){return!1!==t&&(e=y(e)),m(n.parse(e))}function m(e){return n.serialize(e).split("#")[0]+"#"}var f=/#\/?$/;function y(e){return e?e.replace(f,""):""}function v(e,t){return t=y(t),n.resolve(e,t)}},742:function(e,t,i){"use strict";var n=i(9646),o=i(3724).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=o(t),e.types=o(["number","integer","string","array","object","boolean","null"]),e.forEach((function(i){i.rules=i.rules.map((function(i){var o,r;return"object"==typeof i&&(r=i[o=Object.keys(i)[0]],i=o,r.forEach((function(i){t.push(i),e.all[i]=!0}))),t.push(i),e.all[i]={keyword:i,code:n[i],implements:r}})),e.all.$comment={keyword:"$comment",code:n.$comment},i.type&&(e.types[i.type]=i)})),e.keywords=o(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},4293:function(e,t,i){"use strict";var n=i(3724);e.exports=function(e){n.copy(e,this)}},6887:function(e){"use strict";e.exports=function(e){for(var t,i=0,n=e.length,o=0;o<n;)i++,55296<=(t=e.charCodeAt(o++))&&t<=56319&&o<n&&56320==(64512&e.charCodeAt(o))&&o++;return i}},3724:function(e,t,i){"use strict";function n(e,t,i,n){var o=n?" !== ":" === ",r=n?" || ":" && ",s=n?"!":"",a=n?"":"!";switch(e){case"null":return t+o+"null";case"array":return s+"Array.isArray("+t+")";case"object":return"("+s+t+r+"typeof "+t+o+'"object"'+r+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+o+'"number"'+r+a+"("+t+" % 1)"+r+t+o+t+(i?r+s+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+o+'"'+e+'"'+(i?r+s+"isFinite("+t+")":"")+")";default:return"typeof "+t+o+'"'+e+'"'}}e.exports={copy:function(e,t){for(var i in t=t||{},e)t[i]=e[i];return t},checkDataType:n,checkDataTypes:function(e,t,i){if(1===e.length)return n(e[0],t,i,!0);var o,s="";for(o in(e=r(e)).array&&e.object&&(s=e.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete e.null,delete e.array,delete e.object),e.number&&delete e.integer,e)s+=(s?" && ":"")+n(o,t,i,!0);return s},coerceToTypes:function(e,t){if(!Array.isArray(t))return o[t]?[t]:"array"===e&&"array"===t?["array"]:void 0;for(var i=[],n=0;n<t.length;n++){var r=t[n];(o[r]||"array"===e&&"array"===r)&&(i[i.length]=r)}return i.length?i:void 0},toHash:r,getProperty:l,escapeQuotes:c,equal:i(2303),ucs2length:i(6887),varOccurences:function(e,t){return t+="[^0-9]",(e=e.match(new RegExp(t,"g")))?e.length:0},varReplace:function(e,t,i){return t+="([^0-9])",i=i.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),i+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var i in e)if(t[i])return!0},schemaHasRulesExcept:function(e,t,i){if("boolean"==typeof e)return!e&&"not"!=i;for(var n in e)if(n!=i&&t[n])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var i in e)if(!t[i])return i},toQuotedString:h,getPathExpr:function(e,t,i,n){return p(e,i?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,i){return p(e,i=h(i?"/"+g(t):l(t)))},getData:function(e,t,i){var n,o,r;if(""===e)return"rootData";if("/"==e[0]){if(!d.test(e))throw new Error("Invalid JSON-pointer: "+e);n=e,o="rootData"}else{if(!(r=e.match(u)))throw new Error("Invalid JSON-pointer: "+e);if(e=+r[1],"#"==(n=r[2])){if(t<=e)throw new Error("Cannot access property/index "+e+" levels up, current level is "+t);return i[t-e]}if(t<e)throw new Error("Cannot access data "+e+" levels up, current level is "+t);if(o="data"+(t-e||""),!n)return o}for(var s=o,a=n.split("/"),c=0;c<a.length;c++){var h=a[c];h&&(s+=" && "+(o+=l(m(h))))}return s},unescapeFragment:function(e){return m(decodeURIComponent(e))},unescapeJsonPointer:m,escapeFragment:function(e){return encodeURIComponent(g(e))},escapeJsonPointer:g};var o=r(["string","number","integer","boolean","null"]);function r(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;return t}var s=/^[a-z$_][a-z$_0-9]*$/i,a=/'|\\/g;function l(e){return"number"==typeof e?"["+e+"]":s.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(a,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function h(e){return"'"+c(e)+"'"}var d=/^\/(?:[^~]|~0|~1)*$/,u=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function g(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},9394:function(e){"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,i){for(var n=0;n<i.length;n++){e=JSON.parse(JSON.stringify(e));for(var o=i[n].split("/"),r=e,s=1;s<o.length;s++)r=r[o[s]];for(s=0;s<t.length;s++){var a=t[s],l=r[a];l&&(r[a]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},5868:function(e,t,i){"use strict";i=i(6680),e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:i.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:i.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},1796:function(e){"use strict";e.exports=function(e,t,i){var n,o,r,s,a,l=" ",c=e.level,h=e.dataLevel,d=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,g=!e.opts.allErrors,m="data"+(h||""),f=e.opts.$data&&d&&d.$data,y=f?(l+=" var schema"+c+" = "+e.util.getData(d.$data,h,e.dataPathArr)+"; ","schema"+c):d,v="maximum"==t,C=v?"exclusiveMaximum":"exclusiveMinimum",I=e.schema[C],b=e.opts.$data&&I&&I.$data,A=v?"<":">",w=v?">":"<",_=void 0;if(!f&&"number"!=typeof d&&void 0!==d)throw new Error(t+" must be number");if(!b&&void 0!==I&&"number"!=typeof I&&"boolean"!=typeof I)throw new Error(C+" must be number or boolean");b?(h=e.util.getData(I.$data,h,e.dataPathArr),r="exclIsNumber"+c,s="' + "+(a="op"+c)+" + '",_=C,(x=x||[]).push(l=l+" var schemaExcl"+c+" = "+h+";  var "+(n="exclusive"+c)+"; var "+(o="exclType"+c)+" = typeof "+(h="schemaExcl"+c)+"; if ("+o+" != 'boolean' && "+o+" != 'undefined' && "+o+" != 'number') { "),l="",!1!==e.createErrors?(l+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(l+=" , message: '"+C+" should be boolean' "),e.opts.verbose&&(l+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ",S=l,l=x.pop(),!e.compositeRule&&g?e.async?l+=" throw new ValidationError(["+S+"]); ":l+=" validate.errors = ["+S+"]; return false; ":l+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } else if ( ",f&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+o+" == 'number' ? ( ("+n+" = "+y+" === undefined || "+h+" "+A+"= "+y+") ? "+m+" "+w+"= "+h+" : "+m+" "+w+" "+y+" ) : ( ("+n+" = "+h+" === true) ? "+m+" "+w+"= "+y+" : "+m+" "+w+" "+y+" ) || "+m+" !== "+m+") { var op"+c+" = "+n+" ? '"+A+"' : '"+A+"='; ",void 0===d&&(p=e.errSchemaPath+"/"+(_=C),y=h,f=b)):(s=A,(r="number"==typeof I)&&f?(a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" ( "+y+" === undefined || "+I+" "+A+"= "+y+" ? "+m+" "+w+"= "+I+" : "+m+" "+w+" "+y+" ) || "+m+" !== "+m+") { "):(r&&void 0===d?(n=!0,p=e.errSchemaPath+"/"+(_=C),y=I,w+="="):(r&&(y=Math[v?"min":"max"](I,d)),I===(!r||y)?(n=!0,p=e.errSchemaPath+"/"+(_=C),w+="="):(n=!1,s+="=")),a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+m+" "+w+" "+y+" || "+m+" !== "+m+") { ")),_=_||t,(x=x||[]).push(l),l="",!1!==e.createErrors?(l+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+a+", limit: "+y+", exclusive: "+n+" } ",!1!==e.opts.messages&&(l=l+" , message: 'should be "+s+" "+(f?"' + "+y:y+"'")),e.opts.verbose&&(l=(l+=" , schema:  ")+(f?"validate.schema"+u:""+d)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ";var x,S=l;return l=x.pop(),!e.compositeRule&&g?e.async?l+=" throw new ValidationError(["+S+"]); ":l+=" validate.errors = ["+S+"]; return false; ":l+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } ",g&&(l+=" else { "),l}},2407:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(s=u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+r):a,u||"number"==typeof a)return o+="if ( ",u&&(o+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),(r=[]).push(o+=" "+d+".length "+("maxItems"==(n=t)?">":"<")+" "+s+") { "),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(o=(o=(o+=" , message: 'should NOT have ")+("maxItems"==t?"more":"fewer")+" than ")+(u?"' + "+s+" + '":""+a)+" items' "),e.opts.verbose&&(o=(o+=" , schema:  ")+(u?"validate.schema"+l:""+a)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",n=o,o=r.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+n+"]); ":o+=" validate.errors = ["+n+"]; return false; ":o+=" var err = "+n+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o;throw new Error(t+" must be number")}},1250:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(s=u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+r):a,u||"number"==typeof a)return o+="if ( ",u&&(o+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),!1===e.opts.unicode?o+=" "+d+".length ":o+=" ucs2length("+d+") ",(r=[]).push(o+=" "+("maxLength"==(n=t)?">":"<")+" "+s+") { "),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(o=(o=(o+=" , message: 'should NOT be ")+("maxLength"==t?"longer":"shorter")+" than ")+(u?"' + "+s+" + '":""+a)+" characters' "),e.opts.verbose&&(o=(o+=" , schema:  ")+(u?"validate.schema"+l:""+a)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",n=o,o=r.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+n+"]); ":o+=" validate.errors = ["+n+"]; return false; ":o+=" var err = "+n+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o;throw new Error(t+" must be number")}},2596:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(s=u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+r):a,u||"number"==typeof a)return o+="if ( ",u&&(o+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),(r=[]).push(o+=" Object.keys("+d+").length "+("maxProperties"==(n=t)?">":"<")+" "+s+") { "),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+s+" } ",!1!==e.opts.messages&&(o=(o=(o+=" , message: 'should NOT have ")+("maxProperties"==t?"more":"fewer")+" than ")+(u?"' + "+s+" + '":""+a)+" properties' "),e.opts.verbose&&(o=(o+=" , schema:  ")+(u?"validate.schema"+l:""+a)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",n=o,o=r.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+n+"]); ":o+=" validate.errors = ["+n+"]; return false; ":o+=" var err = "+n+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o;throw new Error(t+" must be number")}},9486:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.schema[t],r=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,a=!e.opts.allErrors,l=e.util.copy(e),c="",h=(l.level++,"valid"+l.level),d=l.baseId,u=!0,p=o;if(p)for(var g,m=-1,f=p.length-1;m<f;)g=p[m+=1],(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(u=!1,l.schema=g,l.schemaPath=r+"["+m+"]",l.errSchemaPath=s+"/"+m,n+="  "+e.validate(l)+" ",l.baseId=d,a)&&(n+=" if ("+h+") { ",c+="}");return a&&(n+=u?" if (true) { ":" "+c.slice(0,-1)+" "),n}},5347:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,r="data"+(r||""),"valid"+o),h=(o="errs__"+o,e.util.copy(e)),d="",u=(h.level++,"valid"+h.level);if(s.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&0<Object.keys(t).length||!1===t:e.util.schemaHasRules(t,e.RULES.all)}))){var p=h.baseId,g=(n+=" var "+o+" = errors; var "+c+" = false;  ",e.compositeRule),m=(e.compositeRule=h.compositeRule=!0,s);if(m)for(var f,y=-1,v=m.length-1;y<v;)f=m[y+=1],h.schema=f,h.schemaPath=a+"["+y+"]",h.errSchemaPath=l+"/"+y,n+="  "+e.validate(h)+" ",h.baseId=p,n+=" "+c+" = "+c+" || "+u+"; if (!"+c+") { ",d+="}";e.compositeRule=h.compositeRule=g,n+=" "+d+" if (!"+c+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+r+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else {  errors = "+o+"; if (vErrors !== null) { if ("+o+") vErrors.length = "+o+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else t&&(n+=" if (true) { ");return n}},923:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.schema[t];return t=e.errSchemaPath+"/"+t,e.opts.allErrors,o=e.util.toQuotedString(o),!0===e.opts.$comment?n+=" console.log("+o+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+o+", "+e.util.toQuotedString(t)+", validate.root.schema);"),n}},2617:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(r||""),h="valid"+o,d=e.opts.$data&&s&&s.$data;return(d&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; "),d||(n+=" var schema"+o+" = validate.schema"+a+";"),s=[]).push(n+="var "+h+" = equal("+c+", schema"+o+"); if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValue: schema"+o+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",r=n,n=s.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",l&&(n+=" else { "),n}},2119:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c=(r="data"+(r||""),"valid"+o),h="errs__"+o,d=e.util.copy(e),u=(d.level++,"valid"+d.level),p=(o="i"+o,d.dataLevel=e.dataLevel+1),g="data"+p,m=e.baseId,f=e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all);return(n+="var "+h+" = errors;var "+c+";",f?(c=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.schema=s,d.schemaPath=a,d.errSchemaPath=t,n+=" var "+u+" = false; for (var "+o+" = 0; "+o+" < "+r+".length; "+o+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,o,e.opts.jsonPointers,!0),s=r+"["+o+"]",d.dataPathArr[p]=o,p=e.validate(d),d.baseId=m,e.util.varOccurences(p,g)<2?n+=" "+e.util.varReplace(p,g,s)+" ":n+=" var "+g+" = "+s+"; "+p+" ",n+=" if ("+u+") break; }  ",e.compositeRule=d.compositeRule=c,n+="  if (!"+u+") {"):n+=" if ("+r+".length == 0) {",o=[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+r+" "),n+=" } "):n+=" {} ",m=n,n=o.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",f&&(n+="  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n}},1793:function(e){"use strict";e.exports=function(e,t,i){var n,o,r,s=" ",a=e.level,l=e.dataLevel,c=e.schema[t],h=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(l||""),g="valid"+a,m="errs__"+a,f=e.opts.$data&&c&&c.$data,y=f?(s+=" var schema"+a+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ","schema"+a):c,v="definition"+a,C=this.definition,I="";if(f&&C.$data){var b="keywordValidate"+a,A=C.validateSchema;s+=" var "+v+" = RULES.custom['"+t+"'].definition; var "+b+" = "+v+".validate;"}else{if(!(S=e.useCustomRule(this,c,e.schema,e)))return;y="validate.schema"+h,b=S.code,n=C.compile,o=C.inline,r=C.macro}t=b+".errors",c="i"+a;var w,_,x,S,k,T="ruleErr"+a,E=C.async;if(E&&!e.async)throw new Error("async keyword in sync schema");return o||r||(s+=t+" = null;"),s+="var "+m+" = errors;var "+g+";",f&&C.$data&&(I+="}",s+=" if ("+y+" === undefined) { "+g+" = true; } else { ",A)&&(I+="}",s+=" "+g+" = "+v+".validateSchema("+y+"); if ("+g+") { "),o?C.statements?s+=" "+S.validate+" ":s+=" "+g+" = "+S.validate+"; ":r?(I="",(f=e.util.copy(e)).level++,w="valid"+f.level,f.schema=S.validate,f.schemaPath="",A=e.compositeRule,e.compositeRule=f.compositeRule=!0,v=e.validate(f).replace(/validate\.schema/g,b),e.compositeRule=f.compositeRule=A,s+=" "+v):((k=k||[]).push(s),s="",s+="  "+b+".call( ",e.opts.passContext?s+="this":s+="self",n||!1===C.schema?s+=" , "+p+" ":s+=" , "+y+" , "+p+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),S=s+=" , "+(_=l?"data"+(l-1||""):"parentData")+" , "+(x=l?e.dataPathArr[l]:"parentDataProperty")+" , rootData )  ",s=k.pop(),!1===C.errors?(s+=" "+g+" = ",E&&(s+="await "),s+=S+"; "):s+=E?" var "+(t="customErrors"+a)+" = null; try { "+g+" = await "+S+"; } catch (e) { "+g+" = false; if (e instanceof ValidationError) "+t+" = e.errors; else throw e; } ":" "+t+" = null; "+g+" = "+S+"; "),C.modifying&&(s+=" if ("+_+") "+p+" = "+_+"["+x+"];"),s+=""+I,C.valid?u&&(s+=" if (true) { "):(s+=" if ( ",void 0===C.valid?s=s+" !"+(r?""+w:g):s+=" "+!C.valid+" ",f=this.keyword,(k=k||[]).push(s+=") { "),(k=k||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",A=s,s=k.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+A+"]); ":s+=" validate.errors = ["+A+"]; return false; ":s+=" var err = "+A+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",v=s,s=k.pop(),o?C.errors?"full"!=C.errors&&(s+="  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } "):!1===C.errors?s+=" "+v+" ":(s+=" if ("+m+" == errors) { "+v+" } else {  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+T+".schemaPath === undefined) { "+T+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } } "):r?(s+="   var err =   ",!1!==e.createErrors?(s+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),s+=" } "):s+=" {} ",s+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; ")):!1===C.errors?s+=" "+v+" ":(s+=" if (Array.isArray("+t+")) { if (vErrors === null) vErrors = "+t+"; else vErrors = vErrors.concat("+t+"); errors = vErrors.length;  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+T+" = vErrors["+c+"]; if ("+T+".dataPath === undefined) "+T+".dataPath = (dataPath || '') + "+e.errorPath+";  "+T+'.schemaPath = "'+d+'";  ',e.opts.verbose&&(s+=" "+T+".schema = "+y+"; "+T+".data = "+p+"; "),s+=" } } else { "+v+" } "),s+=" } ",u&&(s+=" else { ")),s}},9115:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=(t="errs__"+r,e.util.copy(e)),p="",g=(u.level++,"valid"+u.level),m={},f={},y=e.opts.ownProperties;for(L in a)"__proto__"!=L&&(P=a[L],(n=Array.isArray(P)?f:m)[L]=P);var v=e.errorPath;for(L in o=o+"var "+t+" = errors;var missing"+r+";",f)if((n=f[L]).length){if(o+=" if ( "+d+e.util.getProperty(L)+" !== undefined ",y&&(o+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(L)+"') "),h){o+=" && ( ";var C=n;if(C)for(var I=-1,b=C.length-1;I<b;)S=C[I+=1],I&&(o+=" || "),o+=" ( ( "+(R=d+(E=e.util.getProperty(S)))+" === undefined ",y&&(o+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(S)+"') "),o+=") && (missing"+r+" = "+e.util.toQuotedString(e.opts.jsonPointers?S:E)+") ) ";o+=")) {  ";var A="' + "+(_="missing"+r)+" + '",w=(e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(v,_,!0):v+" + "+_),w||[]),_=(w.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(L)+"', missingProperty: '"+A+"', depsCount: "+n.length+", deps: '"+e.util.escapeQuotes(1==n.length?n[0]:n.join(", "))+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should have ",1==n.length?o+="property "+e.util.escapeQuotes(n[0]):o+="properties "+e.util.escapeQuotes(n.join(", ")),o+=" when property "+e.util.escapeQuotes(L)+" is present' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",o);o=w.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+_+"]); ":o+=" validate.errors = ["+_+"]; return false; ":o+=" var err = "+_+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{o+=" ) { ";var x=n;if(x)for(var S,k=-1,T=x.length-1;k<T;){S=x[k+=1];var E=e.util.getProperty(S),R=(A=e.util.escapeQuotes(S),d+E);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(v,S,e.opts.jsonPointers)),o+=" if ( "+R+" === undefined ",y&&(o+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(S)+"') "),o+=") {  var err =   ",!1!==e.createErrors?(o+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(L)+"', missingProperty: '"+A+"', depsCount: "+n.length+", deps: '"+e.util.escapeQuotes(1==n.length?n[0]:n.join(", "))+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should have ",1==n.length?o+="property "+e.util.escapeQuotes(n[0]):o+="properties "+e.util.escapeQuotes(n.join(", ")),o+=" when property "+e.util.escapeQuotes(L)+" is present' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",o+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}o+=" }   ",h&&(p+="}",o+=" else { ")}e.errorPath=v;var L,$=u.baseId;for(L in m){var P=m[L];(e.opts.strictKeywords?"object"==typeof P&&0<Object.keys(P).length||!1===P:e.util.schemaHasRules(P,e.RULES.all))&&(o+=" "+g+" = true; if ( "+d+e.util.getProperty(L)+" !== undefined ",y&&(o+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(L)+"') "),o+=") { ",u.schema=P,u.schemaPath=l+e.util.getProperty(L),u.errSchemaPath=c+"/"+e.util.escapeFragment(L),o+="  "+e.validate(u)+" ",u.baseId=$,o+=" }  ",h)&&(o+=" if ("+g+") { ",p+="}")}return h&&(o+="   "+p+" if ("+t+" == errors) {"),o}},9317:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(r||""),h="valid"+o,d=e.opts.$data&&s&&s.$data;return d&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; "),r="schema"+o,(d||(n+=" var "+r+" = validate.schema"+a+";"),n+="var "+h+";",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=h+" = false;for (var "+(s="i"+o)+"=0; "+s+"<"+r+".length; "+s+"++) if (equal("+c+", "+r+"["+s+"])) { "+h+" = true; break; }",d&&(n+="  }  "),r=[]).push(n+=" if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValues: schema"+o+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",s=n,n=r.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+s+"]); ":n+=" validate.errors = ["+s+"]; return false; ":n+=" var err = "+s+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",l&&(n+=" else { "),n}},8327:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(r||"");if(!1===e.opts.format)l&&(n+=" if (true) { ");else{var h,d=e.opts.$data&&s&&s.$data,u=(r=d?(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ","schema"+o):s,e.opts.unknownFormats),p=Array.isArray(u);if(d)n+=" var "+(h="format"+o)+" = formats["+r+"]; var "+(g="isObject"+o)+" = typeof "+h+" == 'object' && !("+h+" instanceof RegExp) && "+h+".validate; var "+(f="formatType"+o)+" = "+g+" && "+h+".type || 'string'; if ("+g+") { ",e.async&&(n+=" var async"+o+" = "+h+".async; "),n+=" "+h+" = "+h+".validate; } if (  ",d&&(n+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),n+=" (","ignore"!=u&&(n+=" ("+r+" && !"+h+" ",p&&(n+=" && self._opts.unknownFormats.indexOf("+r+") == -1 "),n+=") || "),n+=" ("+h+" && "+f+" == '"+i+"' && !(typeof "+h+" == 'function' ? ",e.async?n+=" (async"+o+" ? await "+h+"("+c+") : "+h+"("+c+")) ":n+=" "+h+"("+c+") ",n+=" : "+h+".test("+c+"))))) {";else{if(!(h=e.formats[s])){if("ignore"==u)return e.logger.warn('unknown format "'+s+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(n+=" if (true) { "),n;if(p&&0<=u.indexOf(s))return l&&(n+=" if (true) { "),n;throw new Error('unknown format "'+s+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,m,f=(g="object"==typeof h&&!(h instanceof RegExp)&&h.validate)&&h.type||"string";if(g&&(m=!0===h.async,h=h.validate),f!=i)return l&&(n+=" if (true) { "),n;if(m){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(y="formats"+e.util.getProperty(s)+".validate")+"("+c+"))) { "}else{n+=" if (! ";var y="formats"+e.util.getProperty(s);g&&(y+=".validate"),n=n+("function"==typeof h?" "+y+"("+c+") ":" "+y+".test("+c+") ")+") { "}}(o=[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { format:  ")+(d?""+r:""+e.util.toQuotedString(s))+"  } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should match format \"")+(d?"' + "+r+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(n=(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+e.util.toQuotedString(s)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",p=n,n=o.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",l&&(n+=" else { ")}return n}},5926:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),h=(s="data"+(s||""),"valid"+r),d="errs__"+r,u=e.util.copy(e),p=(u.level++,"valid"+u.level),g=e.schema.then,m=e.schema.else,f=(g=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all)),m=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&0<Object.keys(m).length||!1===m:e.util.schemaHasRules(m,e.RULES.all)),u.baseId);return g||m?(u.createErrors=!1,u.schema=a,u.schemaPath=l,u.errSchemaPath=t,o+=" var "+d+" = errors; var "+h+" = true;  ",a=e.compositeRule,e.compositeRule=u.compositeRule=!0,o+="  "+e.validate(u)+" ",u.baseId=f,u.createErrors=!0,o+="  errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }  ",e.compositeRule=u.compositeRule=a,g?(o+=" if ("+p+") {  ",u.schema=e.schema.then,u.schemaPath=e.schemaPath+".then",u.errSchemaPath=e.errSchemaPath+"/then",o+="  "+e.validate(u)+" ",u.baseId=f,o+=" "+h+" = "+p+"; ",g&&m?o+=" var "+(n="ifClause"+r)+" = 'then'; ":n="'then'",o+=" } ",m&&(o+=" else { ")):o+=" if (!"+p+") { ",m&&(u.schema=e.schema.else,u.schemaPath=e.schemaPath+".else",u.errSchemaPath=e.errSchemaPath+"/else",o+="  "+e.validate(u)+" ",u.baseId=f,o+=" "+h+" = "+p+"; ",g&&m?o+=" var "+(n="ifClause"+r)+" = 'else'; ":n="'else'",o+=" } "),o+=" if (!"+h+") {   var err =   ",!1!==e.createErrors?(o+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { failingKeyword: "+n+" } ",!1!==e.opts.messages&&(o+=" , message: 'should match \"' + "+n+" + '\" schema' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+s+" "),o+=" } "):o+=" {} ",o+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; "),o+=" }   ",c&&(o+=" else { ")):c&&(o+=" if (true) { "),o}},9646:function(e,t,i){"use strict";e.exports={$ref:i(2331),allOf:i(9486),anyOf:i(5347),$comment:i(923),const:i(2617),contains:i(2119),dependencies:i(9115),enum:i(9317),format:i(8327),if:i(5926),items:i(392),maximum:i(1796),minimum:i(1796),maxItems:i(2407),minItems:i(2407),maxLength:i(1250),minLength:i(1250),maxProperties:i(2596),minProperties:i(2596),multipleOf:i(6039),not:i(7946),oneOf:i(9344),pattern:i(9737),properties:i(2537),propertyNames:i(2127),required:i(1204),uniqueItems:i(1985),validate:i(1869)}},392:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d=(t="valid"+o,r="errs__"+o,e.util.copy(e)),u="",p=(d.level++,"valid"+d.level),g=(o="i"+o,d.dataLevel=e.dataLevel+1),m="data"+g,f=e.baseId;if(n+="var "+r+" = errors;var "+t+";",Array.isArray(s)){var y,v,C=e.schema.additionalItems,I=(!1===C&&(n+=" "+t+" = "+h+".length <= "+s.length+"; ",y=l,l=e.errSchemaPath+"/additionalItems",(v=v||[]).push(n+="  if (!"+t+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+s.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+s.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",t=n,n=v.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+t+"]); ":n+=" validate.errors = ["+t+"]; return false; ":n+=" var err = "+t+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",l=y,c)&&(u+="}",n+=" else { "),s);if(I)for(var b=-1,A=I.length-1;b<A;){var w,_,x=I[b+=1];(e.opts.strictKeywords?"object"==typeof x&&0<Object.keys(x).length||!1===x:e.util.schemaHasRules(x,e.RULES.all))&&(n+=" "+p+" = true; if ("+h+".length > "+b+") { ",w=h+"["+b+"]",d.schema=x,d.schemaPath=a+"["+b+"]",d.errSchemaPath=l+"/"+b,d.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0),d.dataPathArr[g]=b,_=e.validate(d),d.baseId=f,e.util.varOccurences(_,m)<2?n+=" "+e.util.varReplace(_,m,w)+" ":n+=" var "+m+" = "+w+"; "+_+" ",n+=" }  ",c)&&(n+=" if ("+p+") { ",u+="}")}"object"==typeof C&&(e.opts.strictKeywords?"object"==typeof C&&0<Object.keys(C).length||!1===C:e.util.schemaHasRules(C,e.RULES.all))&&(d.schema=C,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+p+" = true; if ("+h+".length > "+s.length+") {  for (var "+o+" = "+s.length+"; "+o+" < "+h+".length; "+o+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,o,e.opts.jsonPointers,!0),w=h+"["+o+"]",d.dataPathArr[g]=o,_=e.validate(d),d.baseId=f,e.util.varOccurences(_,m)<2?n+=" "+e.util.varReplace(_,m,w)+" ":n+=" var "+m+" = "+w+"; "+_+" ",c&&(n+=" if (!"+p+") break; "),n+=" } }  ",c)&&(n+=" if ("+p+") { ",u+="}")}else(e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all))&&(d.schema=s,d.schemaPath=a,d.errSchemaPath=l,n+="  for (var "+o+" = 0; "+o+" < "+h+".length; "+o+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,o,e.opts.jsonPointers,!0),w=h+"["+o+"]",d.dataPathArr[g]=o,_=e.validate(d),d.baseId=f,e.util.varOccurences(_,m)<2?n+=" "+e.util.varReplace(_,m,w)+" ":n+=" var "+m+" = "+w+"; "+_+" ",c&&(n+=" if (!"+p+") break; "),n+=" }");return c&&(n+=" "+u+" if ("+r+" == errors) {"),n}},6039:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d=e.opts.$data&&s&&s.$data;if(r=d?(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ","schema"+o):s,!d&&"number"!=typeof s)throw new Error(t+" must be number");return n+="var division"+o+";if (",d&&(n+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),n+=" (division"+o+" = "+h+" / "+r+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+o+" !== parseInt(division"+o+") ",n+=" ) ",d&&(n+="  )  "),(t=[]).push(n+=" ) {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(n=n+" , message: 'should be multiple of "+(d?"' + "+r:r+"'")),e.opts.verbose&&(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+s)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",o=n,n=t.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+o+"]); ":n+=" validate.errors = ["+o+"]; return false; ":n+=" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},7946:function(e){"use strict";e.exports=function(e,t,i){var n,o,r=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),h=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),d=(a="data"+(a||""),s="errs__"+s,e.util.copy(e)),u=(d.level++,"valid"+d.level);return(e.opts.strictKeywords?"object"==typeof l&&0<Object.keys(l).length||!1===l:e.util.schemaHasRules(l,e.RULES.all))?(d.schema=l,d.schemaPath=c,d.errSchemaPath=t,r+=" var "+s+" = errors;  ",l=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(o=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,o&&(d.opts.allErrors=o),e.compositeRule=d.compositeRule=l,(n=n||[]).push(r+=" if ("+u+") {   "),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),r+=" } "):r+=" {} ",o=r,r=n.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+o+"]); ":r+=" validate.errors = ["+o+"]; return false; ":r+=" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else {  errors = "+s+"; if (vErrors !== null) { if ("+s+") vErrors.length = "+s+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")):(r+="  var err =   ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ")),r}},9344:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,r="data"+(r||""),"valid"+o),h="errs__"+o,d=e.util.copy(e),u="",p=(d.level++,"valid"+d.level),g=d.baseId,m="prevValid"+o,f="passingSchemas"+o,y=(n+="var "+h+" = errors , "+m+" = false , "+c+" = false , "+f+" = null; ",o=e.compositeRule,e.compositeRule=d.compositeRule=!0,s);if(y)for(var v,C=-1,I=y.length-1;C<I;)v=y[C+=1],(e.opts.strictKeywords?"object"==typeof v&&0<Object.keys(v).length||!1===v:e.util.schemaHasRules(v,e.RULES.all))?(d.schema=v,d.schemaPath=a+"["+C+"]",d.errSchemaPath=l+"/"+C,n+="  "+e.validate(d)+" ",d.baseId=g):n+=" var "+p+" = true; ",C&&(n+=" if ("+p+" && "+m+") { "+c+" = false; "+f+" = ["+f+", "+C+"]; } else { ",u+="}"),n+=" if ("+p+") { "+c+" = "+m+" = true; "+f+" = "+C+"; }";return e.compositeRule=d.compositeRule=o,n+=u+"if (!"+c+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+f+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+r+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else {  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},9737:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(r||""),h=e.opts.$data&&s&&s.$data,d=(r=h?(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ","schema"+o):s,o=h?"(new RegExp("+r+"))":e.usePattern(s),n+="if ( ",h&&(n+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),[]);return d.push(n+=" !"+o+".test("+c+") ) {   "),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { pattern:  ")+(h?""+r:""+e.util.toQuotedString(s))+"  } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should match pattern \"")+(h?"' + "+r+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(n=(n=(n+=" , schema:  ")+(h?"validate.schema"+a:""+e.util.toQuotedString(s)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",o=n,n=d.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+o+"]); ":n+=" validate.errors = ["+o+"]; return false; ":n+=" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",l&&(n+=" else { "),n}},2537:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=(t="errs__"+r,e.util.copy(e)),p="",g=(u.level++,"valid"+u.level),m="key"+r,f="idx"+r,y=u.dataLevel=e.dataLevel+1,v="data"+y,C="dataProperties"+r,I=(s=Object.keys(a||{}).filter(L),e.schema.patternProperties||{}),b=Object.keys(I).filter(L),A=e.schema.additionalProperties,w=s.length||b.length,_=!1===A,x="object"==typeof A&&Object.keys(A).length,S=e.opts.removeAdditional,k=_||x||S,T=e.opts.ownProperties,E=e.baseId,R=e.schema.required;function L(e){return"__proto__"!==e}if(R&&(!e.opts.$data||!R.$data)&&R.length<e.opts.loopRequired&&(n=e.util.toHash(R)),o+="var "+t+" = errors;var "+g+" = true;",T&&(o+=" var "+C+" = undefined;"),k){if(o+=T?" "+C+" = "+C+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+C+".length; "+f+"++) { var "+m+" = "+C+"["+f+"]; ":" for (var "+m+" in "+d+") { ",w){if(o+=" var isAdditional"+r+" = !(false ",s.length)if(8<s.length)o+=" || validate.schema"+l+".hasOwnProperty("+m+") ";else{var $=s;if($)for(var P=-1,M=$.length-1;P<M;)O=$[P+=1],o+=" || "+m+" == "+e.util.toQuotedString(O)+" "}if(b.length){var B=b;if(B)for(var N=-1,W=B.length-1;N<W;)Q=B[N+=1],o+=" || "+e.usePattern(Q)+".test("+m+") "}o+=" ); if (isAdditional"+r+") { "}"all"==S?o+=" delete "+d+"["+m+"]; ":(j=e.errorPath,R="' + "+m+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),_?S?o+=" delete "+d+"["+m+"]; ":(z=c,c=e.errSchemaPath+"/additionalProperties",(X=X||[]).push(o+=" "+g+" = false; "),o="",!1!==e.createErrors?(o+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+R+"' } ",!1!==e.opts.messages&&(o+=" , message: '",e.opts._errorDataPathProperty?o+="is an invalid additional property":o+="should NOT have additional properties",o+="' "),e.opts.verbose&&(o+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",Y=o,o=X.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+Y+"]); ":o+=" validate.errors = ["+Y+"]; return false; ":o+=" var err = "+Y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=z,h&&(o+=" break; ")):x&&("failing"==S?(o+=" var "+t+" = errors;  ",k=e.compositeRule,e.compositeRule=u.compositeRule=!0,u.schema=A,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),te=d+"["+m+"]",u.dataPathArr[y]=m,ie=e.validate(u),u.baseId=E,e.util.varOccurences(ie,v)<2?o+=" "+e.util.varReplace(ie,v,te)+" ":o+=" var "+v+" = "+te+"; "+ie+" ",o+=" if (!"+g+") { errors = "+t+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+m+"]; }  ",e.compositeRule=u.compositeRule=k):(u.schema=A,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),te=d+"["+m+"]",u.dataPathArr[y]=m,ie=e.validate(u),u.baseId=E,e.util.varOccurences(ie,v)<2?o+=" "+e.util.varReplace(ie,v,te)+" ":o+=" var "+v+" = "+te+"; "+ie+" ",h&&(o+=" if (!"+g+") break; "))),e.errorPath=j),w&&(o+=" } "),o+=" }  ",h&&(o+=" if ("+g+") { ",p+="}")}var Z=e.opts.useDefaults&&!e.compositeRule;if(s.length){var H=s;if(H)for(var O,F=-1,G=H.length-1;F<G;){var D,V,j,z,K,X,Y,J=a[O=H[F+=1]];(e.opts.strictKeywords?"object"==typeof J&&0<Object.keys(J).length||!1===J:e.util.schemaHasRules(J,e.RULES.all))&&(te=d+(K=e.util.getProperty(O)),D=Z&&void 0!==J.default,u.schema=J,u.schemaPath=l+K,u.errSchemaPath=c+"/"+e.util.escapeFragment(O),u.errorPath=e.util.getPath(e.errorPath,O,e.opts.jsonPointers),u.dataPathArr[y]=e.util.toQuotedString(O),ie=e.validate(u),u.baseId=E,e.util.varOccurences(ie,v)<2?(ie=e.util.varReplace(ie,v,te),V=te):o+=" var "+(V=v)+" = "+te+"; ",D?o+=" "+ie+" ":(n&&n[O]?(o+=" if ( "+V+" === undefined ",T&&(o+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(O)+"') "),o+=") { "+g+" = false; ",j=e.errorPath,z=c,K=e.util.escapeQuotes(O),e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,O,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(X=X||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+K+"' } ",!1!==e.opts.messages&&(o+=" , message: '",e.opts._errorDataPathProperty?o+="is a required property":o+="should have required property \\'"+K+"\\'",o+="' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",Y=o,o=X.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+Y+"]); ":o+=" validate.errors = ["+Y+"]; return false; ":o+=" var err = "+Y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=z,e.errorPath=j,o+=" } else { "):h?(o+=" if ( "+V+" === undefined ",T&&(o+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(O)+"') "),o+=") { "+g+" = true; } else { "):(o+=" if ("+V+" !== undefined ",T&&(o+=" &&   Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(O)+"') "),o+=" ) { "),o+=" "+ie+" } ")),h&&(o+=" if ("+g+") { ",p+="}")}}if(b.length){var U=b;if(U)for(var Q,q=-1,ee=U.length-1;q<ee;){var te,ie;J=I[Q=U[q+=1]],(e.opts.strictKeywords?"object"==typeof J&&0<Object.keys(J).length||!1===J:e.util.schemaHasRules(J,e.RULES.all))&&(u.schema=J,u.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Q),u.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Q),o=(o+=T?" "+C+" = "+C+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+C+".length; "+f+"++) { var "+m+" = "+C+"["+f+"]; ":" for (var "+m+" in "+d+") { ")+" if ("+e.usePattern(Q)+".test("+m+")) { ",u.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),te=d+"["+m+"]",u.dataPathArr[y]=m,ie=e.validate(u),u.baseId=E,e.util.varOccurences(ie,v)<2?o+=" "+e.util.varReplace(ie,v,te)+" ":o+=" var "+v+" = "+te+"; "+ie+" ",h&&(o+=" if (!"+g+") break; "),o+=" } ",h&&(o+=" else "+g+" = true; "),o+=" }  ",h)&&(o+=" if ("+g+") { ",p+="}")}}return h&&(o+=" "+p+" if ("+t+" == errors) {"),o}},2127:function(e){"use strict";e.exports=function(e,t,i){var n,o,r,s,a,l,c,h=" ",d=e.level,u=e.dataLevel,p=e.schema[t],g=e.schemaPath+e.util.getProperty(t),m=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),f=(u="data"+(u||""),"errs__"+d),y=e.util.copy(e),v=(y.level++,"valid"+y.level);return h+="var "+f+" = errors;",(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(y.schema=p,y.schemaPath=g,y.errSchemaPath=t,p="idx"+d,o="i"+d,r="' + "+(n="key"+d)+" + '",s="data"+(y.dataLevel=e.dataLevel+1),c="dataProperties"+d,l=e.opts.ownProperties,a=e.baseId,l&&(h+=" var "+c+" = undefined; "),h=h+(l?" "+c+" = "+c+" || Object.keys("+u+"); for (var "+p+"=0; "+p+"<"+c+".length; "+p+"++) { var "+n+" = "+c+"["+p+"]; ":" for (var "+n+" in "+u+") { ")+" var startErrs"+d+" = errors; ",l=n,c=e.compositeRule,e.compositeRule=y.compositeRule=!0,p=e.validate(y),y.baseId=a,e.util.varOccurences(p,s)<2?h+=" "+e.util.varReplace(p,s,l)+" ":h+=" var "+s+" = "+l+"; "+p+" ",e.compositeRule=y.compositeRule=c,h+=" if (!"+v+") { for (var "+o+"=startErrs"+d+"; "+o+"<errors; "+o+"++) { vErrors["+o+"].propertyName = "+n+"; }   var err =   ",!1!==e.createErrors?(h+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { propertyName: '"+r+"' } ",!1!==e.opts.messages&&(h+=" , message: 'property name \\'"+r+"\\' is invalid' "),e.opts.verbose&&(h+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),h+=" } "):h+=" {} ",h+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),m&&(h+=" break; "),h+=" } }"),m&&(h+="  if ("+f+" == errors) {"),h}},2331:function(e){"use strict";e.exports=function(e,t,i){var n,o,r,s=" ",a=e.level,l=e.dataLevel,c=e.schema[t],h=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),d="data"+(l||"");if(a="valid"+a,"#"==c||"#/"==c)o=e.isRoot?(n=e.async,"validate"):(n=!0===e.root.schema.$async,"root.refVal[0]");else{var u=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===u){var p=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs)e.logger.error(p),(r=r||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(s+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(s+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),s+=" } "):s+=" {} ",t=s,s=r.pop(),!e.compositeRule&&h?e.async?s+=" throw new ValidationError(["+t+"]); ":s+=" validate.errors = ["+t+"]; return false; ":s+=" var err = "+t+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(s+=" if (false) { ");else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,p);e.logger.warn(p),h&&(s+=" if (true) { ")}}else u.inline?((t=e.util.copy(e)).level++,p="valid"+t.level,t.schema=u.schema,t.schemaPath="",t.errSchemaPath=c,s+=" "+e.validate(t).replace(/validate\.schema/g,u.code)+" ",h&&(s+=" if ("+p+") { ")):(n=!0===u.$async||e.async&&!1!==u.$async,o=u.code)}if(o)if((r=r||[]).push(s),s="",e.opts.passContext?s+=" "+o+".call(this, ":s+=" "+o+"( ",s+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),t=s+=" , "+(c=l?"data"+(l-1||""):"parentData")+" , "+(l?e.dataPathArr[l]:"parentDataProperty")+", rootData)  ",s=r.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");h&&(s+=" var "+a+"; "),s+=" try { await "+t+"; ",h&&(s+=" "+a+" = true; "),s+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",h&&(s+=" "+a+" = false; "),s+=" } ",h&&(s+=" if ("+a+") { ")}else s+=" if (!"+t+") { if (vErrors === null) vErrors = "+o+".errors; else vErrors = vErrors.concat("+o+".errors); errors = vErrors.length; } ",h&&(s+=" else { ");return s}},1204:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,"data"+(r||"")),h="valid"+o,d=e.opts.$data&&s&&s.$data;if(d&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; "),r="schema"+o,!d)if(s.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var u=[],p=s;if(p)for(var g=-1,m=p.length-1;g<m;){var f=p[g+=1],y=e.schema.properties[f];y&&(e.opts.strictKeywords?"object"==typeof y&&0<Object.keys(y).length||!1===y:e.util.schemaHasRules(y,e.RULES.all))||(u[u.length]=f)}}else u=s;if(d||u.length){var v=e.errorPath,C=(s=d||u.length>=e.opts.loopRequired,e.opts.ownProperties);if(t){if(n+=" var missing"+o+"; ",s){d||(n+=" var "+r+" = validate.schema"+a+"; ");var I="' + "+(S="schema"+o+"["+(_="i"+o)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(v,S,e.opts.jsonPointers)),n+=" var "+h+" = true; ",d&&(n+=" if (schema"+o+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+o+")) "+h+" = false; else {"),n+=" for (var "+_+" = 0; "+_+" < "+r+".length; "+_+"++) { "+h+" = "+c+"["+r+"["+_+"]] !== undefined ",C&&(n+=" &&   Object.prototype.hasOwnProperty.call("+c+", "+r+"["+_+"]) "),n+="; if (!"+h+") break; } ",d&&(n+="  }  "),(A=A||[]).push(n+="  if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+I+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+I+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var b=n;n=A.pop()}else{n+=" if ( ";var A,w=u;if(w)for(var _=-1,x=w.length-1;_<x;)T=w[_+=1],_&&(n+=" || "),n+=" ( ( "+($=c+(L=e.util.getProperty(T)))+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),n+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:L)+") ) ";n+=") {  ",I="' + "+(S="missing"+o)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(v,S,!0):v+" + "+S),(A=A||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+I+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+I+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",b=n,n=A.pop()}!e.compositeRule&&t?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(s){var S;d||(n+=" var "+r+" = validate.schema"+a+"; "),I="' + "+(S="schema"+o+"["+(_="i"+o)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(v,S,e.opts.jsonPointers)),d&&(n+=" if ("+r+" && !Array.isArray("+r+")) {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+I+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+I+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+r+" !== undefined) { "),n+=" for (var "+_+" = 0; "+_+" < "+r+".length; "+_+"++) { if ("+c+"["+r+"["+_+"]] === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+r+"["+_+"]) "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+I+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+I+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(n+="  }  ")}else{var k=u;if(k)for(var T,E=-1,R=k.length-1;E<R;){T=k[E+=1];var L=e.util.getProperty(T),$=(I=e.util.escapeQuotes(T),c+L);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(v,T,e.opts.jsonPointers)),n+=" if ( "+$+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(T)+"') "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+I+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+I+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=v}else t&&(n+=" if (true) {");return n}},1985:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),h="data"+(s||""),d="valid"+r,u=e.opts.$data&&a&&a.$data;return s=u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+r):a,(a||u)&&!1!==e.opts.uniqueItems?(u&&(o+=" var "+d+"; if ("+s+" === false || "+s+" === undefined) "+d+" = true; else if (typeof "+s+" != 'boolean') "+d+" = false; else { "),o+=" var i = "+h+".length , "+d+" = true , j; if (i > 1) { ",r=e.schema.items&&e.schema.items.type,s=Array.isArray(r),!r||"object"==r||"array"==r||s&&(0<=r.indexOf("object")||0<=r.indexOf("array"))?o+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ":(o=(o+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ")+" if ("+e.util["checkDataType"+(s?"s":"")](r,"item",e.opts.strictNumbers,!0)+") continue; ",s&&(o+=" if (typeof item == 'string') item = '\"' + item; "),o+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),o+=" } ",u&&(o+="  }  "),(n=n||[]).push(o+=" if (!"+d+") {   "),o="",!1!==e.createErrors?(o+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(o=(o+=" , schema:  ")+(u?"validate.schema"+l:""+a)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ",r=o,o=n.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+r+"]); ":o+=" validate.errors = ["+r+"]; return false; ":o+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",c&&(o+=" else { ")):c&&(o+=" if (true) { "),o}},1869:function(e){"use strict";e.exports=function(e,t,i){var n="",o=!0===e.schema.$async,r=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),s=e.self._getId(e.schema);if(e.opts.strictKeywords&&(E=e.util.schemaUnknownRules(e.schema,e.RULES.keywords))){if(E="unknown keyword: "+E,"log"!==e.opts.strictKeywords)throw new Error(E);e.logger.warn(E)}if(e.isTop&&(n+=" var validate = ",o&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s)&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" /*# sourceURL="+s+" */ "),"boolean"==typeof e.schema||!r&&!e.schema.$ref)l=e.level,c=e.dataLevel,P=e.schema[t="false schema"],I=e.schemaPath+e.util.getProperty(t),b=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,h="data"+(c||""),u="valid"+l,!1===e.schema?(e.isTop?p=!0:n+=" var "+u+" = false; ",(G=G||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",T=n,n=G.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):e.isTop?n+=o?" return data; ":" validate.errors = null; return true; ":n+=" var "+u+" = true; ",e.isTop&&(n+=" }; return validate; ");else{if(e.isTop){var a=e.isTop,l=e.level=0,c=e.dataLevel=0,h="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var d="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}n=(n+=" var vErrors = null; ")+" var errors = 0;      if (rootData === undefined) rootData = data; "}else{if(l=e.level,h="data"+((c=e.dataLevel)||""),s&&(e.baseId=e.resolve.url(e.baseId,s)),o&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+l+" = errors;"}var u="valid"+l,p=!e.opts.allErrors,g="",m="",f=e.schema.type,y=Array.isArray(f);if(f&&e.opts.nullable&&!0===e.schema.nullable&&(y?-1==f.indexOf("null")&&(f=f.concat("null")):"null"!=f&&(f=[f,"null"],y=!0)),y&&1==f.length&&(f=f[0],y=!1),e.schema.$ref&&r){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(r=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),f){e.opts.coerceTypes&&(v=e.util.coerceToTypes(e.opts.coerceTypes,f));var v,C=e.RULES.types[f];if(v||y||!0===C||C&&!K(C)){var I=e.schemaPath+".type",b=e.errSchemaPath+"/type";if(I=e.schemaPath+".type",b=e.errSchemaPath+"/type",n+=" if ("+e.util[y?"checkDataTypes":"checkDataType"](f,h,e.opts.strictNumbers,!0)+") { ",v){var A="dataType"+l,w="coerced"+l,_=(n+=" var "+A+" = typeof "+h+"; var "+w+" = undefined; ","array"==e.opts.coerceTypes&&(n+=" if ("+A+" == 'object' && Array.isArray("+h+") && "+h+".length == 1) { "+h+" = "+h+"[0]; "+A+" = typeof "+h+"; if ("+e.util.checkDataType(e.schema.type,h,e.opts.strictNumbers)+") "+w+" = "+h+"; } "),n+=" if ("+w+" !== undefined) ; ",v);if(_)for(var x,S=-1,k=_.length-1;S<k;)"string"==(x=_[S+=1])?n+=" else if ("+A+" == 'number' || "+A+" == 'boolean') "+w+" = '' + "+h+"; else if ("+h+" === null) "+w+" = ''; ":"number"==x||"integer"==x?(n+=" else if ("+A+" == 'boolean' || "+h+" === null || ("+A+" == 'string' && "+h+" && "+h+" == +"+h+" ","integer"==x&&(n+=" && !("+h+" % 1)"),n+=")) "+w+" = +"+h+"; "):"boolean"==x?n+=" else if ("+h+" === 'false' || "+h+" === 0 || "+h+" === null) "+w+" = false; else if ("+h+" === 'true' || "+h+" === 1) "+w+" = true; ":"null"==x?n+=" else if ("+h+" === '' || "+h+" === 0 || "+h+" === false) "+w+" = null; ":"array"==e.opts.coerceTypes&&"array"==x&&(n+=" else if ("+A+" == 'string' || "+A+" == 'number' || "+A+" == 'boolean' || "+h+" == null) "+w+" = ["+h+"]; ");(G=G||[]).push(n+=" else {   "),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(y?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(y?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+I+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n,E=(n=G.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c?"data"+(c-1||""):"parentData");n=n+" } if ("+w+" !== undefined) {   "+h+" = "+w+"; ",c||(n+="if ("+E+" !== undefined)"),n+=" "+E+"["+(c?e.dataPathArr[c]:"parentDataProperty")+"] = "+w+"; } "}else(G=G||[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(y?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(y?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+I+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",T=n,n=G.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";n+=" } "}}if(e.schema.$ref&&!r)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",p&&(n=(n+=" } if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}");else{var R=e.RULES;if(R)for(var L=-1,$=R.length-1;L<$;)if(K(C=R[L+=1])){if(C.type&&(n+=" if ("+e.util.checkDataType(C.type,h,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==C.type&&e.schema.properties){var P=e.schema.properties,M=Object.keys(P);if(M)for(var B,N=-1,W=M.length-1;N<W;)if(void 0!==(O=P[B=M[N+=1]]).default){var Z=h+e.util.getProperty(B);if(e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+Z,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else n+=" if ("+Z+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+Z+" === null || "+Z+" === '' "),n+=" ) "+Z+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(O.default)+" ":n+=" "+JSON.stringify(O.default)+" ",n+="; "}}else if("array"==C.type&&Array.isArray(e.schema.items)){var H=e.schema.items;if(H){S=-1;for(var O,F=H.length-1;S<F;)if(void 0!==(O=H[S+=1]).default)if(Z=h+"["+S+"]",e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+Z,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else n+=" if ("+Z+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+Z+" === null || "+Z+" === '' "),n+=" ) "+Z+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(O.default)+" ":n+=" "+JSON.stringify(O.default)+" ",n+="; "}}var G,D=C.rules;if(D)for(var V,j=-1,z=D.length-1;j<z;)X(V=D[j+=1])&&(V=V.code(e,V.keyword,C.type))&&(n+=" "+V+" ",p)&&(g+="}");p&&(n+=" "+g+" ",g=""),C.type&&(n+=" } ",f)&&f===C.type&&!v&&(n+=" else { ",I=e.schemaPath+".type",b=e.errSchemaPath+"/type",(G=G||[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(y?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(y?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+I+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",T=n,n=G.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } "),p&&(n=(n+=" if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}")}}p&&(n+=" "+m+" "),a?n=n+(o?" if (errors === 0) return data;            else throw new ValidationError(vErrors); ":" validate.errors = vErrors;  return errors === 0;       ")+" }; return validate;":n+=" var "+u+" = errors === errs_"+l+";"}return n;function K(e){for(var t=e.rules,i=0;i<t.length;i++)if(X(t[i]))return 1}function X(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var i=t.implements,n=0;n<i.length;n++)if(void 0!==e.schema[i[n]])return 1}(t)}}},7931:function(e,t,i){"use strict";var n=/^[a-z_$][a-z0-9_$-]*$/i,o=i(1793),r=i(5868);function s(e,t){s.errors=null;var i=this._validateKeyword=this._validateKeyword||this.compile(r,!0);if(i(e))return!0;if(s.errors=i.errors,t)throw new Error("custom keyword definition is invalid: "+this.errorsText(i.errors));return!1}e.exports={add:function(e,t){var i=this.RULES;if(i.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!n.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var r=t.type;if(Array.isArray(r))for(var s=0;s<r.length;s++)l(e,r[s],t);else l(e,r,t);var a=t.metaSchema;a&&(t.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(a,!0))}function l(e,t,n){for(var r,s=0;s<i.length;s++){var a=i[s];if(a.type==t){r=a;break}}r||i.push(r={type:t,rules:[]}),n={keyword:e,definition:n,custom:!0,code:o,implements:n.implements},r.rules.push(n),i.custom[e]=n}return i.keywords[e]=i.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var i=0;i<t.length;i++)for(var n=t[i].rules,o=0;o<n.length;o++)if(n[o].keyword==e){n.splice(o,1);break}return this},validate:s}},2303:function(e){"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;0!=o--;)if(!e(t[o],i[o]))return!1}else{if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(i,r[o]))return!1;for(o=n;0!=o--;){var s=r[o];if(!e(t[s],i[s]))return!1}}return!0}return t!=t&&i!=i}},3508:function(e){"use strict";e.exports=function(e,t){var i,n="boolean"==typeof(t="function"==typeof(t=t||{})?{cmp:t}:t).cycles&&t.cycles,o=t.cmp&&(i=t.cmp,function(e){return function(t,n){return t={key:t,value:e[t]},n={key:n,value:e[n]},i(t,n)}}),r=[];return function e(t){if(void 0!==(t=t&&t.toJSON&&"function"==typeof t.toJSON?t.toJSON():t)){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(a="[",l=0;l<t.length;l++)l&&(a+=","),a+=e(t[l])||"null";return a+"]"}if(null===t)return"null";if(-1!==r.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}for(var i=r.push(t)-1,s=Object.keys(t).sort(o&&o(t)),a="",l=0;l<s.length;l++){var c=s[l],h=e(t[c]);h&&(a&&(a+=","),a+=JSON.stringify(c)+":"+h)}return r.splice(i,1),"{"+a+"}"}}(e)}},233:function(e){e.exports=function e(t,i){"use strict";function n(t){return e.insensitive&&(""+t).toLowerCase()||""+t}var o,r,s=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,h=/^0/,d=(t=n(t).replace(a,"")||"",i=n(i).replace(a,"")||"",t.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")),u=i.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0");if(a=parseInt(t.match(c),16)||1!==d.length&&t.match(l)&&Date.parse(t),s=parseInt(i.match(c),16)||a&&i.match(l)&&Date.parse(i)||null){if(a<s)return-1;if(s<a)return 1}for(var p=0,g=Math.max(d.length,u.length);p<g;p++){if(o=!(d[p]||"").match(h)&&parseFloat(d[p])||d[p]||0,r=!(u[p]||"").match(h)&&parseFloat(u[p])||u[p]||0,isNaN(o)!==isNaN(r))return isNaN(o)?1:-1;if(typeof o!=typeof r&&(o+="",r+=""),o<r)return-1;if(r<o)return 1}return 0}},5156:function(e,t){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,o){if(e!==o){if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(o))return!1;if(!0===t(e)){if(e.length!==o.length)return!1;for(var r=0;r<e.length;r++)if(!1===n(e[r],o[r]))return!1}else{if(!0!==i(e))return!1;var s,a,l={};for(s in e)if(hasOwnProperty.call(e,s)){if(!1===n(e[s],o[s]))return!1;l[s]=!0}for(a in o)if(hasOwnProperty.call(o,a)&&!0!==l[a])return!1}}return!0}function o(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(i(e)){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}return!1}var r="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]},s={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},a="UnquotedIdentifier",l="QuotedIdentifier",c="Rbracket",h="Rparen",d="Comma",u="Colon",p="Rbrace",g="Number",m="Current",f="Expref",y="Pipe",v="Flatten",C="Star",I="Filter",b="Lbrace",A="Lbracket",w="Lparen",_="Literal",x={".":"Dot","*":C,",":d,":":u,"{":b,"}":p,"]":c,"(":w,")":h,"@":m},S={"<":!0,">":!0,"=":!0,"!":!0},k={" ":!0,"\t":!0,"\n":!0};function T(e){return"0"<=e&&e<="9"||"-"===e}function E(){}E.prototype={tokenize:function(e){var t,i,n=[];for(this._current=0;this._current<e.length;)if("a"<=(r=e[this._current])&&r<="z"||"A"<=r&&r<="Z"||"_"===r)o=this._current,t=this._consumeUnquotedIdentifier(e),n.push({type:a,value:t,start:o});else if(void 0!==x[e[this._current]])n.push({type:x[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(T(e[this._current]))i=this._consumeNumber(e),n.push(i);else if("["===e[this._current])i=this._consumeLBracket(e),n.push(i);else if('"'===e[this._current])o=this._current,t=this._consumeQuotedIdentifier(e),n.push({type:l,value:t,start:o});else if("'"===e[this._current])o=this._current,t=this._consumeRawStringLiteral(e),n.push({type:_,value:t,start:o});else if("`"===e[this._current]){var o=this._current,r=this._consumeLiteral(e);n.push({type:_,value:r,start:o})}else if(void 0!==S[e[this._current]])n.push(this._consumeOperator(e));else if(void 0!==k[e[this._current]])this._current++;else if("&"===e[this._current])o=this._current,this._current++,"&"===e[this._current]?(this._current++,n.push({type:"And",value:"&&",start:o})):n.push({type:f,value:"&",start:o});else{if("|"!==e[this._current])throw(r=new Error("Unknown character:"+e[this._current])).name="LexerError",r;o=this._current,this._current++,"|"===e[this._current]?(this._current++,n.push({type:"Or",value:"||",start:o})):n.push({type:y,value:"|",start:o})}return n},_consumeUnquotedIdentifier:function(e){var t,i=this._current;for(this._current++;this._current<e.length&&("a"<=(t=e[this._current])&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||"_"===t);)this._current++;return e.slice(i,this._current)},_consumeQuotedIdentifier:function(e){for(var t=this._current,i=(this._current++,e.length);'"'!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&'"'!==e[n+1]?n++:n+=2,this._current=n}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){for(var t=this._current,i=(this._current++,e.length);"'"!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&"'"!==e[n+1]?n++:n+=2,this._current=n}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){for(var t=this._current,i=(this._current++,e.length);T(e[this._current])&&this._current<i;)this._current++;var n=parseInt(e.slice(t,this._current));return{type:g,value:n,start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:I,value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:v,value:"[]",start:t}):{type:A,value:"[",start:t}},_consumeOperator:function(e){var t=this._current,i=e[t];return this._current++,"!"===i?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===i?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===i?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===i&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t=this._current,i=e.length;"`"!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&"`"!==e[n+1]?n++:n+=2,this._current=n}return t=(t=r(e.slice(t,this._current))).replace("\\`","`"),t=this._looksLikeJSON(t)?JSON.parse(t):JSON.parse('"'+t+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if(0<='[{"'.indexOf(e[0]))return!0;if(0<=["true","false","null"].indexOf(e))return!0;if(!(0<="-0123456789".indexOf(e[0])))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var R={};function L(){}function $(e){this.runtime=e}function P(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[0]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[0]}]},contains:{_func:this._functionContains,_signature:[{types:[2,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[2]},{types:[2]}]},floor:{_func:this._functionFloor,_signature:[{types:[0]}]},length:{_func:this._functionLength,_signature:[{types:[2,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[2]},{types:[2]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[2]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[2,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}R.EOF=0,R[a]=0,R[l]=0,R[c]=0,R[h]=0,R[d]=0,R[p]=0,R[g]=0,R[m]=0,R[f]=0,R.Pipe=1,R.Or=2,R.And=3,R.EQ=5,R.GT=5,R.LT=5,R.GTE=5,R.LTE=5,R.NE=5,R[v]=9,R.Star=20,R[I]=21,R.Dot=40,R.Not=45,R[b]=50,R[A]=55,R[w]=60,L.prototype={parse:function(e){var t;if(this._loadTokens(e),this.index=0,e=this.expression(0),"EOF"!==this._lookahead(0))throw t=this._lookaheadToken(0),(t=new Error("Unexpected token type: "+t.type+", value: "+t.value)).name="ParserError",t;return e},_loadTokens:function(e){var t=(new E).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){for(var t=this._lookaheadToken(0),i=(this._advance(),this.nud(t)),n=this._lookahead(0);e<R[n];)this._advance(),i=this.led(n,i),n=this._lookahead(0);return i},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,i;switch(e.type){case _:return{type:"Literal",value:e.value};case a:return{type:"Field",name:e.value};case l:var n={type:"Field",name:e.value};if(this._lookahead(0)===w)throw new Error("Quoted identifier not allowed for function names.");return n;case"Not":return{type:"NotExpression",children:[t=this.expression(R.Not)]};case C:return t=null,{type:"ValueProjection",children:[{type:"Identity"},t=this._lookahead(0)===c?{type:"Identity"}:this._parseProjectionRHS(R.Star)]};case I:return this.led(e.type,{type:"Identity"});case b:return this._parseMultiselectHash();case v:return{type:"Projection",children:[{type:v,children:[{type:"Identity"}]},t=this._parseProjectionRHS(R.Flatten)]};case A:return this._lookahead(0)===g||this._lookahead(0)===u?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):this._lookahead(0)===C&&this._lookahead(1)===c?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(R.Star)]}):this._parseMultiselectList();case m:return{type:m};case f:return{type:"ExpressionReference",children:[i=this.expression(R.Expref)]};case w:for(var o=[];this._lookahead(0)!==h;)this._lookahead(0)===m?(i={type:m},this._advance()):i=this.expression(0),o.push(i);return this._match(h),o[0];default:this._errorToken(e)}},led:function(e,t){var i;switch(e){case"Dot":var n=R.Dot;return this._lookahead(0)!==C?{type:"Subexpression",children:[t,i=this._parseDotRHS(n)]}:(this._advance(),{type:"ValueProjection",children:[t,i=this._parseProjectionRHS(n)]});case y:return i=this.expression(R.Pipe),{type:y,children:[t,i]};case"Or":return{type:"OrExpression",children:[t,i=this.expression(R.Or)]};case"And":return{type:"AndExpression",children:[t,i=this.expression(R.And)]};case w:n=t.name;for(var o,r=[];this._lookahead(0)!==h;)this._lookahead(0)===m?(o={type:m},this._advance()):o=this.expression(0),this._lookahead(0)===d&&this._match(d),r.push(o);return this._match(h),{type:"Function",name:n,children:r};case I:return n=this.expression(0),this._match(c),{type:"FilterProjection",children:[t,i=this._lookahead(0)===v?{type:"Identity"}:this._parseProjectionRHS(R.Filter),n]};case v:return{type:"Projection",children:[{type:v,children:[t]},this._parseProjectionRHS(R.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case A:return(n=this._lookaheadToken(0)).type===g||n.type===u?(i=this._parseIndexExpression(),this._projectIfSlice(t,i)):(this._match(C),this._match(c),{type:"Projection",children:[t,i=this._parseProjectionRHS(R.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){var t;if(this._lookahead(0)!==e)throw t=this._lookaheadToken(0),(e=new Error("Expected "+e+", got: "+t.type)).name="ParserError",e;this._advance()},_errorToken:function(e){throw(e=new Error("Invalid token ("+e.type+'): "'+e.value+'"')).name="ParserError",e},_parseIndexExpression:function(){var e;return this._lookahead(0)===u||this._lookahead(1)===u?this._parseSliceExpression():(e={type:"Index",value:this._lookaheadToken(0).value},this._advance(),this._match(c),e)},_projectIfSlice:function(e,t){return e={type:"IndexExpression",children:[e,t]},"Slice"===t.type?{type:"Projection",children:[e,this._parseProjectionRHS(R.Star)]}:e},_parseSliceExpression:function(){for(var e,t=[null,null,null],i=0,n=this._lookahead(0);n!==c&&i<3;){if(n===u)i++;else{if(n!==g)throw e=this._lookahead(0),(e=new Error("Syntax error, unexpected token: "+e.value+"("+e.type+")")).name="Parsererror",e;t[i]=this._lookaheadToken(0).value}this._advance(),n=this._lookahead(0)}return this._match(c),{type:"Slice",children:t}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(R[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return 0<=[a,l,C].indexOf(t)?this.expression(e):t===A?(this._match(A),this._parseMultiselectList()):t===b?(this._match(b),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t,i;if(R[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===A)t=this.expression(e);else if(this._lookahead(0)===I)t=this.expression(e);else{if("Dot"!==this._lookahead(0))throw i=this._lookaheadToken(0),(i=new Error("Sytanx error, unexpected token: "+i.value+"("+i.type+")")).name="ParserError",i;this._match("Dot"),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];this._lookahead(0)!==c;){var t=this.expression(0);if(e.push(t),this._lookahead(0)===d&&(this._match(d),this._lookahead(0)===c))throw new Error("Unexpected token Rbracket")}return this._match(c),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,i=[],n=[a,l];;){if(e=this._lookaheadToken(0),n.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(e=e.value,this._advance(),this._match(u),t=this.expression(0),i.push({type:"KeyValuePair",name:e,value:t}),this._lookahead(0)===d)this._match(d);else if(this._lookahead(0)===p){this._match(p);break}}return{type:"MultiSelectHash",children:i}}},$.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,r){var s,a,l,c,h,d;switch(e.type){case"Field":return null!==r&&i(r)?void 0===(u=r[e.name])?null:u:null;case"Subexpression":for(I=this.visit(e.children[0],r),_=1;_<e.children.length;_++)if(null===(I=this.visit(e.children[1],I)))return null;return I;case"IndexExpression":return h=this.visit(e.children[0],r),this.visit(e.children[1],h);case"Index":return t(r)?void 0===(I=r[u=(u=e.value)<0?r.length+u:u])?null:I:null;case"Slice":if(!t(r))return null;var u=e.children.slice(0),p=(u=this.computeSliceParams(r.length,u))[0],g=u[1],C=u[2],I=[];if(0<C)for(_=p;_<g;_+=C)I.push(r[_]);else for(_=p;g<_;_+=C)I.push(r[_]);return I;case"Projection":var b=this.visit(e.children[0],r);if(!t(b))return null;for(A=[],_=0;_<b.length;_++)null!==(a=this.visit(e.children[1],b[_]))&&A.push(a);return A;case"ValueProjection":if(!i(b=this.visit(e.children[0],r)))return null;for(var A=[],w=function(e){for(var t=Object.keys(e),i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}(b),_=0;_<w.length;_++)null!==(a=this.visit(e.children[1],w[_]))&&A.push(a);return A;case"FilterProjection":if(!t(b=this.visit(e.children[0],r)))return null;var x=[],S=[];for(_=0;_<b.length;_++)o(s=this.visit(e.children[2],b[_]))||x.push(b[_]);for(var k=0;k<x.length;k++)null!==(a=this.visit(e.children[1],x[k]))&&S.push(a);return S;case"Comparator":switch(l=this.visit(e.children[0],r),c=this.visit(e.children[1],r),e.name){case"EQ":I=n(l,c);break;case"NE":I=!n(l,c);break;case"GT":I=c<l;break;case"GTE":I=c<=l;break;case"LT":I=l<c;break;case"LTE":I=l<=c;break;default:throw new Error("Unknown comparator: "+e.name)}return I;case v:var T=this.visit(e.children[0],r);if(!t(T))return null;var E=[];for(_=0;_<T.length;_++)t(a=T[_])?E.push.apply(E,a):E.push(a);return E;case"Identity":return r;case"MultiSelectList":if(null===r)return null;for(A=[],_=0;_<e.children.length;_++)A.push(this.visit(e.children[_],r));return A;case"MultiSelectHash":if(null===r)return null;for(A={},_=0;_<e.children.length;_++)A[(d=e.children[_]).name]=this.visit(d.value,r);return A;case"OrExpression":return o(s=this.visit(e.children[0],r))?this.visit(e.children[1],r):s;case"AndExpression":return!0===o(l=this.visit(e.children[0],r))?l:this.visit(e.children[1],r);case"NotExpression":return o(l=this.visit(e.children[0],r));case"Literal":return e.value;case y:return h=this.visit(e.children[0],r),this.visit(e.children[1],h);case m:return r;case"Function":var R=[];for(_=0;_<e.children.length;_++)R.push(this.visit(e.children[_],r));return this.runtime.callFunction(e.name,R);case"ExpressionReference":return(u=e.children[0]).jmespathType=f,u;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var i=t[0],n=t[1],o=[null,null,null];if(null===(t=t[2]))t=1;else if(0===t)throw(r=new Error("Invalid slice, step cannot be 0")).name="RuntimeError",r;var r=t<0;return i=null===i?r?e-1:0:this.capSliceRange(e,i,t),n=null===n?r?-1:e:this.capSliceRange(e,n,t),o[0]=i,o[1]=n,o[2]=t,o},capSliceRange:function(e,t,i){return t<0?(t+=e)<0&&(t=i<0?-1:0):e<=t&&(t=i<0?e-1:e),t}},P.prototype={callFunction:function(e,t){var i=this.functionTable[e];if(void 0===i)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,i._signature),i._func.call(this,t)},_validateArgs:function(e,t,i){var n;if(i[i.length-1].variadic){if(t.length<i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+i.length+n+" but received "+t.length)}else if(t.length!==i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+i.length+n+" but received "+t.length);for(var o=0;o<i.length;o++){for(var r,a=!1,l=i[o].types,c=this._getTypeName(t[o]),h=0;h<l.length;h++)if(this._typeMatches(c,l[h],t[o])){a=!0;break}if(!a)throw r=l.map((function(e){return s[e]})).join(","),new Error("TypeError: "+e+"() expected argument "+(o+1)+" to be type "+r+" but received type "+s[c]+" instead.")}},_typeMatches:function(e,t,i){if(1===t)return!0;if(9!==t&&8!==t&&3!==t)return e===t;if(3===t)return 3===e;if(3===e){var n;8===t?n=0:9===t&&(n=2);for(var o=0;o<i.length;o++)if(!this._typeMatches(this._getTypeName(i[o]),n,i[o]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return 2;case"[object Number]":return 0;case"[object Array]":return 3;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return e.jmespathType===f?6:4}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0];return e=e[1],-1!==t.indexOf(e,t.length-e.length)},_functionReverse:function(e){var t;if(2!==this._getTypeName(e[0]))return(t=e[0].slice(0)).reverse(),t;for(var i=e[0],n="",o=i.length-1;0<=o;o--)n+=i[o];return n},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t/i.length},_functionContains:function(e){return 0<=e[0].indexOf(e[1])},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return(i(e[0])?Object.keys(e[0]):e[0]).length},_functionMap:function(e){for(var t=[],i=this._interpreter,n=e[0],o=e[1],r=0;r<o.length;r++)t.push(i.visit(n,o[r]));return t},_functionMerge:function(e){for(var t={},i=0;i<e.length;i++){var n,o=e[i];for(n in o)t[n]=o[n]}return t},_functionMax:function(e){if(0<e[0].length){if(0===this._getTypeName(e[0][0]))return Math.max.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)i.localeCompare(t[n])<0&&(i=t[n]);return i}return null},_functionMin:function(e){if(0<e[0].length){if(0===this._getTypeName(e[0][0]))return Math.min.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)t[n].localeCompare(i)<0&&(i=t[n]);return i}return null},_functionSum:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case 0:return"number";case 2:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 6:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],i=Object.keys(t),n=[],o=0;o<i.length;o++)n.push(t[i[o]]);return n},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return 3===this._getTypeName(e[0])?e[0]:[e[0]]},_functionToString:function(e){return 2===this._getTypeName(e[0])?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t=this._getTypeName(e[0]);return 0===t?e[0]:2!==t||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){return(e=e[0].slice(0)).sort(),e},_functionSortBy:function(e){var t=e[0].slice(0);if(0!==t.length){var i=this._interpreter,n=e[1],o=this._getTypeName(i.visit(n,t[0]));if([0,2].indexOf(o)<0)throw new Error("TypeError");for(var r=this,s=[],a=0;a<t.length;a++)s.push([a,t[a]]);s.sort((function(e,t){var s=i.visit(n,e[1]),a=i.visit(n,t[1]);if(r._getTypeName(s)!==o)throw new Error("TypeError: expected "+o+", received "+r._getTypeName(s));if(r._getTypeName(a)!==o)throw new Error("TypeError: expected "+o+", received "+r._getTypeName(a));return a<s?1:s<a?-1:e[0]-t[0]}));for(var l=0;l<s.length;l++)t[l]=s[l][1]}return t},_functionMaxBy:function(e){for(var t,i,n=e[1],o=e[0],r=this.createKeyFunction(n,[0,2]),s=-1/0,a=0;a<o.length;a++)s<(i=r(o[a]))&&(s=i,t=o[a]);return t},_functionMinBy:function(e){for(var t,i,n=e[1],o=e[0],r=this.createKeyFunction(n,[0,2]),s=1/0,a=0;a<o.length;a++)(i=r(o[a]))<s&&(s=i,t=o[a]);return t},createKeyFunction:function(e,t){var i=this,n=this._interpreter;return function(o){var r;if(o=n.visit(e,o),t.indexOf(i._getTypeName(o))<0)throw r="TypeError: expected one of "+t+", received "+i._getTypeName(o),new Error(r);return o}}},e.tokenize=function(e){return(new E).tokenize(e)},e.compile=function(e){return(new L).parse(e)},e.search=function(e,t){var i=new L,n=new $(o=new P),o=(o._interpreter=n,i.parse(t));return n.search(o,e)},e.strictDeepEqual=n}(t)},500:function(e){"use strict";var t=e.exports=function(e,n,o){"function"==typeof n&&(o=n,n={}),function e(n,o,r,s,a,l,c,h,d,u){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var p in o(s,a,l,c,h,d,u),s){var g=s[p];if(Array.isArray(g)){if(p in t.arrayKeywords)for(var m=0;m<g.length;m++)e(n,o,r,g[m],a+"/"+p+"/"+m,l,a,p,s,m)}else if(p in t.propsKeywords){if(g&&"object"==typeof g)for(var f in g)e(n,o,r,g[f],a+"/"+p+"/"+i(f),l,a,p,s,f)}else(p in t.keywords||n.allKeys&&!(p in t.skipKeywords))&&e(n,o,r,g,a+"/"+p,l,a,p,s)}r(s,a,l,c,h,d,u)}}(n,"function"==typeof(o=n.cb||o)?o:o.pre||function(){},o.post||function(){},e,"",e)};function i(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7026:function(e,t){"use strict";var i={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},n="a".charCodeAt(),o=(t.parse=function(e,t,o){var r={},s=0,a=0,l=0,c=o&&o.bigint&&"undefined"!=typeof BigInt;return{data:h("",!0),pointers:r};function h(t,i){d(),v(t,"value");var n,o=g();switch(o){case"t":p("rue"),n=!0;break;case"f":p("alse"),n=!1;break;case"n":p("ull"),n=null;break;case'"':n=u();break;case"[":n=function(e){d();var t=[],i=0;if("]"!=g())for(f();;){t.push(h(e+"/"+i)),d();var n=g();if("]"==n)break;","!=n&&A(),d(),i++}return t}(t);break;case"{":n=function(e){d();var t={};if("}"!=g())for(f();;){var i=I(),n=('"'!=g()&&A(),u()),o=e+"/"+m(n);if("}"==(C(o,"key",i),v(o,"keyEnd"),d(),":"!=g()&&A(),d(),t[n]=h(o),d(),i=g()))break;","!=i&&A(),d()}return t}(t);break;default:f(),0<="-0123456789".indexOf(o)?n=function(){var t="",i=!0;"-"==e[l]&&(t+=g()),t+=("0"==e[l]?g:y)(),"."==e[l]&&(t+=g()+y(),i=!1),"e"!=e[l]&&"E"!=e[l]||(t+=g(),"+"!=e[l]&&"-"!=e[l]||(t+=g()),t+=y(),i=!1);var n=+t;return c&&i&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(t):n}():b()}return v(t,"valueEnd"),d(),i&&l<e.length&&b(),n}function d(){e:for(;l<e.length;){switch(e[l]){case" ":a++;break;case"\t":a+=4;break;case"\r":a=0;break;case"\n":a=0,s++;break;default:break e}l++}}function u(){for(var e,t="";'"'!=(e=g());)"\\"==e?(e=g())in i?t+=i[e]:"u"==e?t+=function(){for(var e=4,t=0;e--;){t<<=4;var i=g().toLowerCase();"a"<=i&&i<="f"?t+=i.charCodeAt()-n+10:"0"<=i&&i<="9"?t+=+i:A()}return String.fromCharCode(t)}():A():t+=e;return t}function p(e){for(var t=0;t<e.length;t++)g()!==e[t]&&A()}function g(){w();var t=e[l];return l++,a++,t}function f(){l--,a--}function y(){for(var t="";"0"<=e[l]&&e[l]<="9";)t+=g();if(t.length)return t;w(),b()}function v(e,t){C(e,t,I())}function C(e,t,i){r[e]=r[e]||{},r[e][t]=i}function I(){return{line:s,column:a,pos:l}}function b(){throw new SyntaxError("Unexpected token "+e[l]+" in JSON at position "+l)}function A(){f(),b()}function w(){if(l>=e.length)throw new SyntaxError("Unexpected end of JSON input")}},t.stringify=function(e,t,i){if(r(e)){var n=0;switch(typeof(s="object"==typeof i?i.space:i)){case"number":var o=10<s?10:s<0?0:Math.floor(s),s=o&&b(o," "),a=o,l=o;break;case"string":s=s.slice(0,10);for(var c=l=a=0;c<s.length;c++){switch(s[c]){case" ":l++;break;case"\t":l+=4;break;case"\r":l=0;break;case"\n":l=0,n++;break;default:throw new Error("whitespace characters not allowed in JSON")}a++}break;default:s=void 0}var h="",d={},p=0,g=0,f=0,y=i&&i.es6&&"function"==typeof Map;return function e(t,i,n){switch(I(n,"value"),typeof t){case"number":case"bigint":case"boolean":v(""+t);break;case"string":v(u(t));break;case"object":null===t?v("null"):"function"==typeof t.toJSON?v(u(t.toJSON())):Array.isArray(t)?o():y?t.constructor.BYTES_PER_ELEMENT?o():t instanceof Map?l():t instanceof Set?l(!0):a():a()}function o(){if(t.length){v("[");for(var o=i+1,s=0;s<t.length;s++){s&&v(","),C(o);var a=r(t[s])?t[s]:null;e(a,o,n+"/"+s)}C(i),v("]")}else v("[]")}function a(){var o=Object.keys(t);if(o.length){v("{");for(var a=i+1,l=0;l<o.length;l++){var c,h=o[l],d=t[h];r(d)&&(l&&v(","),c=n+"/"+m(h),C(a),I(c,"key"),v(u(h)),I(c,"keyEnd"),v(":"),s&&v(" "),e(d,a,c))}C(i),v("}")}else v("{}")}function l(o){if(t.size){v("{");for(var a=i+1,l=!0,c=t.entries(),h=c.next();!h.done;){var d,p,g=(p=h.value)[0];r(p=!!o||p[1])&&(l||v(","),l=!1,d=n+"/"+m(g),C(a),I(d,"key"),v(u(g)),I(d,"keyEnd"),v(":"),s&&v(" "),e(p,a,d)),h=c.next()}C(i),v("}")}else v("{}")}I(n,"valueEnd")}(e,0,""),{json:h,pointers:d}}function v(e){g+=e.length,f+=e.length,h+=e}function C(e){if(s){for(h+="\n"+b(e,s),p++,g=0;e--;)n?(p+=n,g=l):g+=l,f+=a;f+=1}}function I(e,t){d[e]=d[e]||{},d[e][t]={line:p,column:g,pos:f}}function b(e,t){return Array(e+1).join(t)}},["number","bigint","boolean","string","object"]);function r(e){return 0<=o.indexOf(typeof e)}var s=/"|\\/g,a=/[\b]/g,l=/\f/g,c=/\n/g,h=/\r/g,d=/\t/g;function u(e){return'"'+(e=e.replace(s,"\\$&").replace(l,"\\f").replace(a,"\\b").replace(c,"\\n").replace(h,"\\r").replace(d,"\\t"))+'"'}var p=/~/g,g=/\//g;function m(e){return e.replace(p,"~0").replace(g,"~1")}},483:function(e,t){var i,n;!function(){"use strict";n=[],void 0!==(n="function"==typeof(i=function(){function e(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType}function t(e){return"string"==typeof e}function i(){var e=[];return{watch:e.push.bind(e),trigger:function(t,i){for(var n=!0,o={detail:i,preventDefault:function(){n=!1}},r=0;r<e.length;r++)e[r](t,o);return n}}}function n(e){return"none"===window.getComputedStyle(e).display}function o(e){this.elem=e}function r(e,t){return o.make(e("parent")).clazz("pico-overlay").clazz(e("overlayClass","")).stylize({display:"none",position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",zIndex:1e4}).stylize(e("overlayStyles",{opacity:.5,background:"#000"})).onClick((function(){e("overlayClose",!0)&&t()}))}o.make=function(e,t){"string"==typeof e&&(e=document.querySelector(e));var i=document.createElement(t||"div");return(e||document.body).appendChild(i),new o(i)},o.prototype={child:function(e){return o.make(this.elem,e)},stylize:function(e){for(var t in void 0!==(e=e||{}).opacity&&(e.filter="alpha(opacity="+100*e.opacity+")"),e)e.hasOwnProperty(t)&&(this.elem.style[t]=e[t]);return this},clazz:function(e){return this.elem.className+=" "+e,this},html:function(t){return e(t)?this.elem.appendChild(t):this.elem.innerHTML=t,this},onClick:function(e){return this.elem.addEventListener("click",e),this},destroy:function(){this.elem.parentNode.removeChild(this.elem)},hide:function(){this.elem.style.display="none"},show:function(){this.elem.style.display="block"},attr:function(e,t){return void 0!==t&&this.elem.setAttribute(e,t),this},anyAncestor:function(e){for(var t=this.elem;t;){if(e(new o(t)))return!0;t=t.parentNode}return!1},isVisible:function(){return!n(this.elem)}};var s=1;function a(e,t){var i=e("width","auto");"number"==typeof i&&(i+="px");var n=e("modalId","pico-"+s++);return o.make(e("parent")).clazz("pico-content").clazz(e("modalClass","")).stylize({display:"none",position:"fixed",zIndex:10001,left:"50%",top:"38.1966%",maxHeight:"90%",boxSizing:"border-box",width:i,"-ms-transform":"translate(-50%,-38.1966%)","-moz-transform":"translate(-50%,-38.1966%)","-webkit-transform":"translate(-50%,-38.1966%)","-o-transform":"translate(-50%,-38.1966%)",transform:"translate(-50%,-38.1966%)"}).stylize(e("modalStyles",{overflow:"auto",backgroundColor:"white",padding:"20px",borderRadius:"5px"})).html(e("content")).attr("id",n).attr("role","dialog").attr("aria-labelledby",e("ariaLabelledBy")).attr("aria-describedby",e("ariaDescribedBy",n)).onClick((function(e){new o(e.target).anyAncestor((function(e){return/\bpico-close\b/.test(e.elem.className)}))&&t()}))}function l(e,t){if(t("closeButton",!0))return e.child("button").html(t("closeHtml","&#xD7;")).clazz("pico-close").clazz(t("closeClass","")).stylize(t("closeStyles",{borderRadius:"2px",border:0,padding:0,cursor:"pointer",height:"15px",width:"15px",position:"absolute",top:"5px",right:"5px",fontSize:"16px",textAlign:"center",lineHeight:"15px",background:"#CCC"})).attr("aria-label",t("close-label","Close"))}function c(e){return function(){return e().elem}}var h=i(),d=i();function u(e,t){function i(e,t){return(e.msMatchesSelector||e.webkitMatchesSelector||e.matches).call(e,t)}function o(e){return!(n(e)||i(e,":disabled")||e.hasAttribute("contenteditable"))&&(e.hasAttribute("tabindex")||i(e,"input,select,textarea,button,a[href],area[href],iframe"))}function r(e){for(var t=e.getElementsByTagName("*"),i=0;i<t.length;i++)if(o(t[i]))return t[i]}function s(e){for(var t=e.getElementsByTagName("*"),i=t.length;i--;)if(o(t[i]))return t[i]}var a;e.beforeShow((function(){a=document.activeElement})),e.afterShow((function(){if(t()){var i=r(e.modalElem());i&&i.focus()}})),e.afterClose((function(){t()&&a&&a.focus(),a=null})),d.watch((function(i){if(t()&&e.isVisible()){var n=r(e.modalElem()),o=s(e.modalElem());(i.shiftKey?n:o)===document.activeElement&&((i.shiftKey?o:n).focus(),i.preventDefault())}}))}function p(e,t){var i,n=new o(document.body);e.beforeShow((function(){i=n.elem.style.overflow,t()&&n.stylize({overflow:"hidden"})})),e.afterClose((function(){n.stylize({overflow:i})}))}return document.documentElement.addEventListener("keydown",(function(e){var t=e.which||e.keyCode;27===t?h.trigger():9===t&&d.trigger(e)})),function(n){(t(n)||e(n))&&(n={content:n});var o=i(),s=i(),d=i(),g=i(),m=i();function f(e,t){var i=n[e];return"function"==typeof i&&(i=i(t)),void 0===i?t:i}var y,v,C=x.bind(window,"modal"),I=x.bind(window,"overlay"),b=x.bind(window,"close");function A(e){I().hide(),C().hide(),m.trigger(y,e)}function w(e){g.trigger(y,e)&&A(e)}function _(e){return function(){return e.apply(this,arguments),y}}function x(e,t){if(!v){var i=a(f,w);v={modal:i,overlay:r(f,w),close:l(i,f)},o.trigger(y,t)}return v[e]}return y={modalElem:c(C),closeElem:c(b),overlayElem:c(I),buildDom:_(x.bind(null,null)),isVisible:function(){return!!(v&&C&&C().isVisible())},show:function(e){return s.trigger(y,e)&&(I().show(),b(),C().show(),d.trigger(y,e)),this},close:_(w),forceClose:_(A),destroy:function(){C().destroy(),I().destroy(),I=C=b=void 0},options:function(e){Object.keys(e).map((function(t){n[t]=e[t]}))},afterCreate:_(o.watch),beforeShow:_(s.watch),afterShow:_(d.watch),beforeClose:_(g.watch),afterClose:_(m.watch)},u(y,f.bind(null,"focus",!0)),p(y,f.bind(null,"bodyOverflow",!0)),h.watch((function(){f("escCloses",!0)&&y.isVisible()&&y.close()})),y}})?i.apply(t,n):i)&&(e.exports=n)}()},7533:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,o=1;o<n;++o)t[o]=t[o].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function i(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function r(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function s(e,t){var i=e;if(t)for(var n in t)i[n]=t[n];return i}function a(e){var n="[A-Za-z]",o="[0-9]",r=t(o,"[A-Fa-f]"),s=i(i("%[EFef]"+r+"%"+r+r+"%"+r+r)+"|"+i("%[89A-Fa-f]"+r+"%"+r+r)+"|"+i("%"+r+r)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",a),c=e?"[\\uE000-\\uF8FF]":"[]",h=t(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=i(n+t(n,o,"[\\+\\-\\.]")+"*"),u=i(i(s+"|"+t(h,a,"[\\:]"))+"*"),p=(i(i("25[0-5]")+"|"+i("2[0-4]"+o)+"|"+i("1"+o+o)+"|"+i("[1-9]"+o)+"|"+o),i(i("25[0-5]")+"|"+i("2[0-4]"+o)+"|"+i("1"+o+o)+"|"+i("0?[1-9]"+o)+"|0?0?"+o)),g=i(p+"\\."+p+"\\."+p+"\\."+p),m=i(r+"{1,4}"),f=i(i(m+"\\:"+m)+"|"+g),y=i(i(m+"\\:")+"{6}"+f),v=i("\\:\\:"+i(m+"\\:")+"{5}"+f),C=i(i(m)+"?\\:\\:"+i(m+"\\:")+"{4}"+f),I=i(i(i(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+i(m+"\\:")+"{3}"+f),b=i(i(i(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+i(m+"\\:")+"{2}"+f),A=i(i(i(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+f),w=i(i(i(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+f),_=i(i(i(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),x=i(i(i(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),S=i([y,v,C,I,b,A,w,_,x].join("|")),k=i(i(h+"|"+s)+"+"),T=(i(S+"\\%25"+k),i(S+i("\\%25|\\%(?!"+r+"{2})")+k)),E=i("[vV]"+r+"+\\."+t(h,a,"[\\:]")+"+"),R=i("\\["+i(T+"|"+S+"|"+E)+"\\]"),L=i(i(s+"|"+t(h,a))+"*"),$=i(R+"|"+g+"(?!"+L+")|"+L),P=i(o+"*"),M=i(i(u+"@")+"?"+$+i("\\:"+P)+"?"),B=i(s+"|"+t(h,a,"[\\:\\@]")),N=i(B+"*"),W=i(B+"+"),Z=i(i(s+"|"+t(h,a,"[\\@]"))+"+"),H=i(i("\\/"+N)+"*"),O=i("\\/"+i(W+H)+"?"),F=i(Z+H),G=i(W+H),D="(?!"+B+")",V=(i(H+"|"+O+"|"+F+"|"+G+"|"+D),i(i(B+"|"+t("[\\/\\?]",c))+"*")),j=i(i(B+"|[\\/\\?]")+"*"),z=i(i("\\/\\/"+M+H)+"|"+O+"|"+G+"|"+D),K=i(d+"\\:"+z+i("\\?"+V)+"?"+i("\\#"+j)+"?"),X=i(i("\\/\\/"+M+H)+"|"+O+"|"+F+"|"+D),Y=i(X+i("\\?"+V)+"?"+i("\\#"+j)+"?");return i(K+"|"+Y),i(d+"\\:"+z+i("\\?"+V)+"?"),i(i("\\/\\/("+i("("+u+")@")+"?("+$+")"+i("\\:("+P+")")+"?)")+"?("+H+"|"+O+"|"+G+"|"+D+")"),i("\\?("+V+")"),i("\\#("+j+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+$+")"+i("\\:("+P+")")+"?)")+"?("+H+"|"+O+"|"+F+"|"+D+")"),i("\\?("+V+")"),i("\\#("+j+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+$+")"+i("\\:("+P+")")+"?)")+"?("+H+"|"+O+"|"+G+"|"+D+")"),i("\\?("+V+")"),i("\\#("+j+")"),i("("+u+")@"),i("\\:("+P+")"),{NOT_SCHEME:new RegExp(t("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",h,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",h,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",h,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",h,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",h,a,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",h,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",h,a),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",h,l),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+g+")$"),IPV6ADDRESS:new RegExp("^\\[?("+S+")"+i(i("\\%25|\\%(?!"+r+"{2})")+"("+k+")")+"?\\]?$")}}var l=a(!1),c=a(!0),h=function(){function e(e,t){var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){o=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw r}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)},u=2147483647,p=36,g=1,m=26,f=38,y=700,v=72,C=128,I="-",b=/^xn--/,A=/[^\0-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=p-g,S=Math.floor,k=String.fromCharCode;function T(e){throw new RangeError(_[e])}function E(e,t){for(var i=[],n=e.length;n--;)i[n]=t(e[n]);return i}function R(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+E((e=e.replace(w,".")).split("."),t).join(".")}function L(e){for(var t=[],i=0,n=e.length;i<n;){var o=e.charCodeAt(i++);if(o>=55296&&o<=56319&&i<n){var r=e.charCodeAt(i++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),i--)}else t.push(o)}return t}var $=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:p},P=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},M=function(e,t,i){var n=0;for(e=i?S(e/y):e>>1,e+=S(e/t);e>x*m>>1;n+=p)e=S(e/x);return S(n+(x+1)*e/(e+f))},B=function(e){var t=[],i=e.length,n=0,o=C,r=v,s=e.lastIndexOf(I);s<0&&(s=0);for(var a=0;a<s;++a)e.charCodeAt(a)>=128&&T("not-basic"),t.push(e.charCodeAt(a));for(var l=s>0?s+1:0;l<i;){for(var c=n,h=1,d=p;;d+=p){l>=i&&T("invalid-input");var f=$(e.charCodeAt(l++));(f>=p||f>S((u-n)/h))&&T("overflow"),n+=f*h;var y=d<=r?g:d>=r+m?m:d-r;if(f<y)break;var b=p-y;h>S(u/b)&&T("overflow"),h*=b}var A=t.length+1;r=M(n-c,A,0==c),S(n/A)>u-o&&T("overflow"),o+=S(n/A),n%=A,t.splice(n++,0,o)}return String.fromCodePoint.apply(String,t)},N=function e(t){var i=[],n=(t=L(t)).length,o=C,r=0,s=v,a=!0,l=!1,c=void 0;try{for(var h,d=t[Symbol.iterator]();!(a=(h=d.next()).done);a=!0){var f=h.value;f<128&&i.push(k(f))}}catch(e){l=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(l)throw c}}var y=i.length,b=y;for(y&&i.push(I);b<n;){var A=u,w=!0,_=!1,x=void 0;try{for(var E,R=t[Symbol.iterator]();!(w=(E=R.next()).done);w=!0){var $=E.value;$>=o&&$<A&&(A=$)}}catch(e){_=!0,x=e}finally{try{!w&&R.return&&R.return()}finally{if(_)throw x}}var B=b+1;A-o>S((u-r)/B)&&T("overflow"),r+=(A-o)*B,o=A;var N=!0,W=!1,Z=void 0;try{for(var H,O=t[Symbol.iterator]();!(N=(H=O.next()).done);N=!0){var F=H.value;if(F<o&&++r>u&&T("overflow"),F==o){for(var G=r,D=p;;D+=p){var V=D<=s?g:D>=s+m?m:D-s;if(G<V)break;var j=G-V,z=p-V;i.push(k(P(V+j%z,0))),G=S(j/z)}i.push(k(P(G,0))),s=M(r,B,b==y),r=0,++b}}}catch(e){W=!0,Z=e}finally{try{!N&&O.return&&O.return()}finally{if(W)throw Z}}++r,++o}return i.join("")},W={version:"2.1.0",ucs2:{decode:L,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:B,encode:N,toASCII:function(e){return R(e,(function(e){return A.test(e)?"xn--"+N(e):e}))},toUnicode:function(e){return R(e,(function(e){return b.test(e)?B(e.slice(4).toLowerCase()):e}))}},Z={};function H(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function O(e){for(var t="",i=0,n=e.length;i<n;){var o=parseInt(e.substr(i+1,2),16);if(o<128)t+=String.fromCharCode(o),i+=3;else if(o>=194&&o<224){if(n-i>=6){var r=parseInt(e.substr(i+4,2),16);t+=String.fromCharCode((31&o)<<6|63&r)}else t+=e.substr(i,6);i+=6}else if(o>=224){if(n-i>=9){var s=parseInt(e.substr(i+4,2),16),a=parseInt(e.substr(i+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(i,9);i+=9}else t+=e.substr(i,3),i+=3}return t}function F(e,t){function i(e){var i=O(e);return i.match(t.UNRESERVED)?i:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,i).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,i).replace(t.NOT_USERINFO,H).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,i).toLowerCase().replace(t.NOT_HOST,H).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,i).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,H).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,i).replace(t.NOT_QUERY,H).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,i).replace(t.NOT_FRAGMENT,H).replace(t.PCT_ENCODED,o)),e}function G(e){return e.replace(/^0*(.*)/,"$1")||"0"}function D(e,t){var i=e.match(t.IPV4ADDRESS)||[],n=h(i,2)[1];return n?n.split(".").map(G).join("."):e}function V(e,t){var i=e.match(t.IPV6ADDRESS)||[],n=h(i,3),o=n[1],r=n[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=h(s,2),l=a[0],c=a[1],d=c?c.split(":").map(G):[],u=l.split(":").map(G),p=t.IPV4ADDRESS.test(u[u.length-1]),g=p?7:8,m=u.length-g,f=Array(g),y=0;y<g;++y)f[y]=d[y]||u[m+y]||"";p&&(f[g-1]=D(f[g-1],t));var v=f.reduce((function(e,t,i){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===i?n.length++:e.push({index:i,length:1})}return e}),[]),C=v.sort((function(e,t){return t.length-e.length}))[0],I=void 0;if(C&&C.length>1){var b=f.slice(0,C.index),A=f.slice(C.index+C.length);I=b.join(":")+"::"+A.join(":")}else I=f.join(":");return r&&(I+="%"+r),I}return e}var j=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,z=void 0==="".match(/(){0}/)[1];function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},n=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(j);if(o){z?(i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5])):(i.scheme=o[1]||void 0,i.userinfo=-1!==e.indexOf("@")?o[3]:void 0,i.host=-1!==e.indexOf("//")?o[4]:void 0,i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=-1!==e.indexOf("?")?o[7]:void 0,i.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(i.port)&&(i.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),i.host&&(i.host=V(D(i.host,n),n)),void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||i.path||void 0!==i.query?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==i.reference&&(i.error=i.error||"URI is not a "+t.reference+" reference.");var r=Z[(t.scheme||i.scheme||"").toLowerCase()];if(t.unicodeSupport||r&&r.unicodeSupport)F(i,n);else{if(i.host&&(t.domainHost||r&&r.domainHost))try{i.host=W.toASCII(i.host.replace(n.PCT_ENCODED,O).toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII via punycode: "+e}F(i,l)}r&&r.parse&&r.parse(i,t)}else i.error=i.error||"URI can not be parsed.";return i}function X(e,t){var i=!1!==t.iri?c:l,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(V(D(String(e.host),i),i).replace(i.IPV6ADDRESS,(function(e,t,i){return"["+t+(i?"%25"+i:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var Y=/^\.\.?\//,J=/^\/\.(\/|$)/,U=/^\/\.\.(\/|$)/,Q=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(Y))e=e.replace(Y,"");else if(e.match(J))e=e.replace(J,"/");else if(e.match(U))e=e.replace(U,"/"),t.pop();else if("."===e||".."===e)e="";else{var i=e.match(Q);if(!i)throw new Error("Unexpected dot segment condition");var n=i[0];e=e.slice(n.length),t.push(n)}return t.join("")}function ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.iri?c:l,n=[],o=Z[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(i.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?W.toUnicode(e.host):W.toASCII(e.host.replace(i.PCT_ENCODED,O).toLowerCase())}catch(i){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+i}F(e,i),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var r=X(e,t);if(void 0!==r&&("suffix"!==t.reference&&n.push("//"),n.push(r),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||o&&o.absolutePath||(s=q(s)),void 0===r&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function te(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=K(ee(e,i),i),t=K(ee(t,i),i)),!(i=i||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=q(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,i){var n=s({scheme:"null"},i);return ee(te(K(e,n),K(t,n),n,!0),n)}function ne(e,t){return"string"==typeof e?e=ee(K(e,t),t):"object"===n(e)&&(e=K(ee(e,t),t)),e}function oe(e,t,i){return"string"==typeof e?e=ee(K(e,i),i):"object"===n(e)&&(e=ee(e,i)),"string"==typeof t?t=ee(K(t,i),i):"object"===n(t)&&(t=ee(t,i)),e===t}function re(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,H)}function se(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,O)}var ae={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var i="https"===String(e.scheme).toLowerCase();return e.port!==(i?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ae.domainHost,parse:ae.parse,serialize:ae.serialize};function ce(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var he={scheme:"ws",domainHost:!0,parse:function(e,t){var i=e;return i.secure=ce(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i},serialize:function(e,t){if(e.port!==(ce(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var i=e.resourceName.split("?"),n=h(i,2),o=n[0],r=n[1];e.path=o&&"/"!==o?o:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},de={scheme:"wss",domainHost:he.domainHost,parse:he.parse,serialize:he.serialize},ue={},pe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",me=i(i("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+i("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+i("%"+ge+ge)),fe="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ye=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ve="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ce=new RegExp(pe,"g"),Ie=new RegExp(me,"g"),be=new RegExp(t("[^]",fe,"[\\.]",'[\\"]',ye),"g"),Ae=new RegExp(t("[^]",pe,ve),"g"),we=Ae;function _e(e){var t=O(e);return t.match(Ce)?t:e}var xe={scheme:"mailto",parse:function e(t,i){var n=t,o=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var r=!1,s={},a=n.query.split("&"),l=0,c=a.length;l<c;++l){var h=a[l].split("=");switch(h[0]){case"to":for(var d=h[1].split(","),u=0,p=d.length;u<p;++u)o.push(d[u]);break;case"subject":n.subject=se(h[1],i);break;case"body":n.body=se(h[1],i);break;default:r=!0,s[se(h[0],i)]=se(h[1],i)}}r&&(n.headers=s)}n.query=void 0;for(var g=0,m=o.length;g<m;++g){var f=o[g].split("@");if(f[0]=se(f[0]),i.unicodeSupport)f[1]=se(f[1],i).toLowerCase();else try{f[1]=W.toASCII(se(f[1],i).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}o[g]=f.join("@")}return n},serialize:function e(t,i){var n=t,s=r(t.to);if(s){for(var a=0,l=s.length;a<l;++a){var c=String(s[a]),h=c.lastIndexOf("@"),d=c.slice(0,h).replace(Ie,_e).replace(Ie,o).replace(be,H),u=c.slice(h+1);try{u=i.iri?W.toUnicode(u):W.toASCII(se(u,i).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(i.iri?"Unicode":"ASCII")+" via punycode: "+e}s[a]=d+"@"+u}n.path=s.join(",")}var p=t.headers=t.headers||{};t.subject&&(p.subject=t.subject),t.body&&(p.body=t.body);var g=[];for(var m in p)p[m]!==ue[m]&&g.push(m.replace(Ie,_e).replace(Ie,o).replace(Ae,H)+"="+p[m].replace(Ie,_e).replace(Ie,o).replace(we,H));return g.length&&(n.query=g.join("&")),n}},Se=/^([^\:]+)\:(.*)/,ke={scheme:"urn",parse:function(e,t){var i=e.path&&e.path.match(Se),n=e;if(i){var o=t.scheme||n.scheme||"urn",r=i[1].toLowerCase(),s=i[2],a=o+":"+(t.nid||r),l=Z[a];n.nid=r,n.nss=s,n.path=void 0,l&&(n=l.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var i=t.scheme||e.scheme||"urn",n=e.nid,o=i+":"+(t.nid||n),r=Z[o];r&&(e=r.serialize(e,t));var s=e,a=e.nss;return s.path=(n||t.nid)+":"+a,s}},Te=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Ee={scheme:"urn:uuid",parse:function(e,t){var i=e;return i.uuid=i.nss,i.nss=void 0,t.tolerant||i.uuid&&i.uuid.match(Te)||(i.error=i.error||"UUID is not valid."),i},serialize:function(e,t){var i=e;return i.nss=(e.uuid||"").toLowerCase(),i}};Z[ae.scheme]=ae,Z[le.scheme]=le,Z[he.scheme]=he,Z[de.scheme]=de,Z[xe.scheme]=xe,Z[ke.scheme]=ke,Z[Ee.scheme]=Ee,e.SCHEMES=Z,e.pctEncChar=H,e.pctDecChars=O,e.parse=K,e.removeDotSegments=q,e.serialize=ee,e.resolveComponents=te,e.resolve=ie,e.normalize=ne,e.equal=oe,e.escapeComponent=re,e.unescapeComponent=se,Object.defineProperty(e,"__esModule",{value:!0})}(t)},4049:function(e){e.exports=function(){"use strict";var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),i=function(){function e(e,t){var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){o=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw r}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=(String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var i=this;i.length<e;)i=t+i;return i},{cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"});function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString())||"0"}var r=function(){function r(t,n,o,s){e(this,r);var a=this;function l(e){if(e.startsWith("hsl")){var t=e.match(/([\-\d\.e]+)/g).map(Number),n=i(t,4),o=n[0],s=n[1],l=n[2],c=n[3];void 0===c&&(c=1),o/=360,s/=100,l/=100,a.hsla=[o,s,l,c]}else if(e.startsWith("rgb")){var h=e.match(/([\-\d\.e]+)/g).map(Number),d=i(h,4),u=d[0],p=d[1],g=d[2],m=d[3];void 0===m&&(m=1),a.rgba=[u,p,g,m]}else e.startsWith("#")?a.rgba=r.hexToRgb(e):a.rgba=r.nameToRgb(e)||r.hexToRgb(e)}if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===o){var c=t&&""+t;c&&l(c.toLowerCase())}else this.rgba=[t,n,o,void 0===s?1:s]}return t(r,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return o(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],i=["","%","%",""],n=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,n){return o(e*t[n],3===n?3:1)+i[n]}));return e?"hsla("+n+")":"hsl("+n+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=r.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=r.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)}));return"#"+e.map((function(e){return e.padStart(2,"0")})).join("")},set:function(e){this.rgba=r.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var i=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(e){var t=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=n[t];return void 0===i?i:r.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=i(e,4),n=t[0],o=t[1],r=t[2],s=t[3];n/=255,o/=255,r/=255;var a=Math.max(n,o,r),l=Math.min(n,o,r),c=void 0,h=void 0,d=(a+l)/2;if(a===l)c=h=0;else{var u=a-l;switch(h=d>.5?u/(2-a-l):u/(a+l),a){case n:c=(o-r)/u+(o<r?6:0);break;case o:c=(r-n)/u+2;break;case r:c=(n-o)/u+4}c/=6}return[c,h,d,s]}},{key:"hslToRgb",value:function(e){var t=i(e,4),n=t[0],o=t[1],r=t[2],s=t[3],a=void 0,l=void 0,c=void 0;if(0===o)a=l=c=r;else{var h=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},d=r<.5?r*(1+o):r+o-r*o,u=2*r-d;a=h(u,d,n+1/3),l=h(u,d,n),c=h(u,d,n-1/3)}var p=[255*a,255*l,255*c].map(Math.round);return p[3]=s,p}}]),r}(),s=function(){function i(){e(this,i),this._events=[]}return t(i,[{key:"add",value:function(e,t,i){e.addEventListener(t,i,!1),this._events.push({target:e,type:t,handler:i})}},{key:"remove",value:function(e,t,n){this._events=this._events.filter((function(o){var r=!0;return e&&e!==o.target&&(r=!1),t&&t!==o.type&&(r=!1),n&&n!==o.handler&&(r=!1),r&&i._doRemove(o.target,o.type,o.handler),!r}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return i._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,i){e.removeEventListener(t,i,!1)}}]),i}();function a(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function l(e,t,i){var n=!1;function o(e,t,i){return Math.max(t,Math.min(e,i))}function r(e,r,s){if(s&&(n=!0),n){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,h=r.clientX,d=r.clientY,u=o(h-a.left,0,l),p=o(d-a.top,0,c);i(u/l,p/c)}}function s(e,t){1===(void 0===e.buttons?e.which:e.buttons)?r(e,e,t):n=!1}function a(e,t){1===e.touches.length?r(e,e.touches[0],t):n=!1}e.add(t,"mousedown",(function(e){s(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",s),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){n=!1})),e.add(t,"touchend",(function(e){n=!1})),e.add(t,"touchcancel",(function(e){n=!1}))}var c="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n                   linear-gradient(45deg, lightgrey 25%,       white 25%,       white 75%, lightgrey 75%) 1em 1em / 2em 2em",h=360,d="keydown",u="mousedown",p="focusin";function g(e,t){return(t||document).querySelector(e)}function m(e){e.preventDefault(),e.stopPropagation()}function f(e,t,i,n,o){e.add(t,d,(function(e){i.indexOf(e.key)>=0&&(o&&m(e),n(e))}))}var y=function(){function i(t){e(this,i),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new s,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return t(i,[{key:"setOptions",value:function(e){var t=this;if(e){var i=this.settings;if(e instanceof HTMLElement)i.parent=e;else{i.parent&&e.parent&&i.parent!==e.parent&&(this._events.remove(i.parent),this._popupInited=!1),s(e,i),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var n=e.color||e.colour;n&&this._setColor(n)}var o=i.parent;if(o&&i.popup&&!this._popupInited){var r=function(e){return t.openHandler(e)};this._events.add(o,"click",r),f(this._events,o,[" ","Spacebar","Enter"],r),this._popupInited=!0}else e.parent&&!i.popup&&this.show()}function s(e,t,i){for(var n in e)i&&i.indexOf(n)>=0||(t[n]=e[n])}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===d?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,i=!1;if(e)if(t===u||t===p){var n=(this.__containedEvent||0)+100;e.timeStamp>n&&(i=!0)}else m(e),i=!0;else i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==u&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function e(t,i){if("string"==typeof t&&(t=t.trim()),t){i=i||{};var n=void 0;try{n=new r(t)}catch(e){if(i.failSilently)return;throw e}if(!this.settings.alpha){var o=n.hsla;o[3]=1,n.hsla=o}this.colour=this.color=n,this._setHSLA(null,null,null,null,i)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=a(this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>');return this.domElement=t,this._domH=g(".picker_hue",t),this._domSL=g(".picker_sl",t),this._domA=g(".picker_alpha",t),this._domEdit=g(".picker_editor input",t),this._domSample=g(".picker_sample",t),this._domOkay=g(".picker_done button",t),this._domCancel=g(".picker_cancel button",t),t.classList.add("layout_"+this.settings.layout),this.settings.alpha||t.classList.add("no_alpha"),this.settings.editor||t.classList.add("no_editor"),this.settings.cancelButton||t.classList.add("no_cancel"),this._ifPopup((function(){return t.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=this.domElement,n=this._events;function o(e,t,i){n.add(e,t,i)}o(i,"click",(function(e){return e.preventDefault()})),l(n,this._domH,(function(e,i){return t._setHSLA(e)})),l(n,this._domSL,(function(e,i){return t._setHSLA(null,e,1-i)})),this.settings.alpha&&l(n,this._domA,(function(e,i){return t._setHSLA(null,null,null,1-i)}));var r=this._domEdit;o(r,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(r,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};o(window,u,t),o(window,p,t),f(n,i,["Esc","Escape"],t);var r=function(t){e.__containedEvent=t.timeStamp};o(i,u,r),o(i,p,r),o(e._domCancel,"click",t)}));var s=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};o(this._domOkay,"click",s),f(n,i,["Enter"],s)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(i){"static"===getComputedStyle(e).position&&(e.style.position="relative");var n=!0===i?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===n?t.classList.add(e):t.classList.remove(e)})),t.classList.add(n)}))}},{key:"_setHSLA",value:function(e,t,i,n,o){o=o||{};var r=this.colour,s=r.hsla;[e,t,i,n].forEach((function(e,t){(e||0===e)&&(s[t]=e)})),r.hsla=s,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(r)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,i=t.hsla,n="hsl("+i[0]*h+", 100%, 50%)",o=t.hslString,r=t.hslaString,s=this._domH,a=this._domSL,l=this._domA,d=g(".picker_selector",s),u=g(".picker_selector",a),p=g(".picker_selector",l);b(s,d,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,b(a,u,i[1]),A(a,u,1-i[2]),a.style.color=o,A(l,p,1-i[3]);var m=o,f=m.replace("hsl","hsla").replace(")",", 0)"),y="linear-gradient("+[m,f]+")";if(this._domA.style.background=y+", "+c,!e.fromEditor){var v=this.settings.editorFormat,C=this.settings.alpha,I=void 0;switch(v){case"rgb":I=t.printRGB(C);break;case"hsl":I=t.printHSL(C);break;default:I=t.printHex(C)}this._domEdit.value=I}this._domSample.style.color=r}function b(e,t,i){t.style.left=100*i+"%"}function A(e,t,i){t.style.top=100*i+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var i=e?"":"none",n=t.style.display!==i;return n&&(t.style.display=i),n}}]),i}(),v=document.createElement("style");return v.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(v),y.StyleElement=v,y}()},1262:function(e,t,i){"use strict";function n(e){return(n="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})(e)}function o(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,function(e){return e=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);if("object"!==n(i=i.call(e,t||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string"),"symbol"===n(e)?e:String(e)}(o.key),o)}}function r(e){var t=l();return function(){var i,o=h(e);if(i=t?(i=h(this).constructor,Reflect.construct(o,arguments,i)):o.apply(this,arguments),o=this,i&&("object"===n(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");if(void 0!==o)return o;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}}function s(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return a(e,arguments,h(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,e)}(e)}function a(e,t,i){return(a=l()?Reflect.construct.bind():function(e,t,i){var n=[null];return n.push.apply(n,t),t=new(Function.bind.apply(e,n)),i&&c(t,i.prototype),t}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}i.d(t,{K:function(){return fe}});var d=function(e){var t=a;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e);var i,n,s=r(a);function a(e,t){if(this instanceof a)return(e=s.call(this,e+" at position "+t)).position=t,e;throw new TypeError("Cannot call a class as a function")}return t=a,i&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(s(Error)),u=92,p=47,g=42,m=123,f=125,y=91,v=93,C=40,I=41,b=32,A=10,w=9,_=13,x=8,S=12,k=34,T=43,E=45,R=39,L=48,$=49,P=57,M=44,B=46,N=58,W=59,Z=65,H=97,O=69,F=101,G=70,D=102,V=160,j=8192,z=8202,K=8239,X=8287,Y=12288,J=8220,U=8221,Q=8216,q=8217,ee=96,te=180;function ie(e){return L<=e&&e<=P||Z<=e&&e<=G||H<=e&&e<=D}function ne(e){return L<=e&&e<=P}var oe=/^[,:[\]{}()\n]$/;function re(e){return se.test(e)||e&&le(e.charCodeAt(0))}var se=/^[[{\w-]$/;function ae(e){return e===b||e===A||e===w||e===_}function le(e){return ce(e)||de(e)}function ce(e){return e===k||e===J||e===U}function he(e){return e===k}function de(e){return e===R||e===Q||e===q||e===ee||e===te}function ue(e,t,i){return i=2<arguments.length&&void 0!==i&&i,-1!==(t=e.lastIndexOf(t))?e.substring(0,t)+(i?"":e.substring(t+1)):e}function pe(e,t){var i=e.length;if(!ae(e.charCodeAt(i-1)))return e+t;for(;ae(e.charCodeAt(i-1));)i--;return e.substring(0,i)+t+e.substring(i)}var ge={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},me={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function fe(e){var t=0,i="";if(!s())throw new d("Unexpected end of json string",e.length);var n=c(M);if(n&&a(),re(e[t])&&/[,\n][ \t\r]*$/.test(i)){n||(i=pe(i,","));for(var o=!0,r=!0;r;)o?o=!1:c(M)||(i=pe(i,",")),r=s();r||(i=ue(i,",")),i="[\n".concat(i,"\n]")}else n&&(i=ue(i,","));if(t>=e.length)return i;throw new d("Unexpected character "+JSON.stringify(e[t]),t);function s(){a();var n=function(){if(e.charCodeAt(t)!==m)return!1;i+="{",t++,a();for(var n=!0;t<e.length&&e.charCodeAt(t)!==f;){if(n?n=!1:(c(M)||(i=pe(i,",")),a()),!b()&&!Z()){e.charCodeAt(t)===f||e.charCodeAt(t)===m||e.charCodeAt(t)===v||e.charCodeAt(t)===y||void 0===e[t]?i=ue(i,","):function(){throw new d("Object key expected",t)}();break}a();var o=c(N);o||(re(e[t])?i=pe(i,":"):D()),s()||(o?function(){throw new d("Object value expected",t)}:D)()}return e.charCodeAt(t)===f?(i+="}",t++):i=pe(i,"}"),!0}()||function(){if(e.charCodeAt(t)!==y)return!1;i+="[",t++,a();for(var n=!0;t<e.length&&e.charCodeAt(t)!==v;)if(n?n=!1:c(M)||(i=pe(i,",")),!s()){i=ue(i,",");break}return e.charCodeAt(t)===v?(i+="]",t++):i=pe(i,"]"),!0}()||b()||function(){var n=t;if(e.charCodeAt(t)===E&&(t++,G(n)))return!0;if(e.charCodeAt(t)===L)t++;else if(function(e){return $<=e&&e<=P}(e.charCodeAt(t)))for(t++;ne(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===B){if(t++,G(n))return!0;for(;ne(e.charCodeAt(t));)t++}if(e.charCodeAt(t)===F||e.charCodeAt(t)===O){if(t++,e.charCodeAt(t)!==E&&e.charCodeAt(t)!==T||t++,G(n))return!0;for(;ne(e.charCodeAt(t));)t++}return n<t&&(i+=e.slice(n,t),!0)}()||R("true","true")||R("false","false")||R("null","null")||R("True","true")||R("False","false")||R("None","null")||Z();return a(),n}function a(){for(l();function(){if(e.charCodeAt(t)===p&&e.charCodeAt(t+1)===g){for(;t<e.length&&!function(e,t){return"*"===e[t]&&"/"===e[t+1]}(e,t);)t++;t+=2}else{if(e.charCodeAt(t)!==p||e.charCodeAt(t+1)!==p)return!1;for(;t<e.length&&e.charCodeAt(t)!==A;)t++}return!0}()&&l(););}function l(){for(var n,o,r="";(n=ae(e.charCodeAt(t)))||(o=e.charCodeAt(t))===V||j<=o&&o<=z||o===K||o===X||o===Y;)r+=n?e[t]:" ",t++;return 0<r.length&&(i+=r,!0)}function c(n){return e.charCodeAt(t)===n&&(i+=e[t],t++,!0)}function h(){return i=u,e.charCodeAt(t)===i&&(t++,!0);var i}function b(){var n,o=e.charCodeAt(t)===u;if(o&&(t++,o=!0),le(e.charCodeAt(t))){var r=de(e.charCodeAt(t))?de:he(e.charCodeAt(t))?he:ce;for(i+='"',t++;t<e.length&&!r(e.charCodeAt(t));){if(e.charCodeAt(t)===u){var s=e[t+1];if(void 0!==me[s])i+=e.slice(t,t+2),t+=2;else if("u"===s){if(!(ie(e.charCodeAt(t+2))&&ie(e.charCodeAt(t+3))&&ie(e.charCodeAt(t+4))&&ie(e.charCodeAt(t+5)))){c=l=void 0;for(var l=t,c=l+2;/\w/.test(e[c]);)c++;throw l=e.slice(l,c),new d('Invalid unicode character "'.concat(l,'"'),t)}i+=e.slice(t,t+6),t+=6}else i+=s,t+=2}else{if(l=e[t],(s=e.charCodeAt(t))===k&&e.charCodeAt(t-1)!==u)i+="\\"+l;else if((n=s)===A||n===_||n===w||n===x||n===S)i+=ge[l];else{if(!(32<=(n=s)&&n<=1114111))throw new d("Invalid character "+JSON.stringify(l),t);i+=l}t++}o&&h()}for(le(e.charCodeAt(t))?(e.charCodeAt(t),i+='"',t++):i+='"',a();e.charCodeAt(t)===T;){t++,a();var p=(i=ue(i,'"',!0)).length;b(),i=function(e,t,i){return e.substring(0,t)+e.substring(t+i)}(i,p,1)}return!0}return!1}function R(n,o){return e.slice(t,t+n.length)===n&&(i+=o,t+=n.length,!0)}function Z(){for(var n,o=t;t<e.length&&(n=e[t],!(oe.test(n)||n&&le(n.charCodeAt(0))));)t++;if(o<t){if(e.charCodeAt(t)===C)t++,s(),e.charCodeAt(t)===I&&(t++,e.charCodeAt(t)===W)&&t++;else{for(;ae(e.charCodeAt(t-1))&&0<t;)t--;o=e.slice(o,t),i+=JSON.stringify(o)}return!0}}function H(i){if(!ne(e.charCodeAt(t)))throw i=e.slice(i,t),new d("Invalid number '".concat(i,"', expecting a digit ").concat(e[t]?"but got '".concat(e[t],"'"):"but reached end of input"),2)}function G(n){if(t>=e.length)return i+=e.slice(n,t)+"0",1;H(n)}function D(){throw new d("Colon expected",t)}}},894:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7171:function(e){"use strict";e.exports=JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}')},6273:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},6680:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},i={},e.amdD=function(){throw new Error("define cannot be used indirect")},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,{a:i}),i},e.d=function(t,i){for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},e(3161);function e(n){var o=i[n];return void 0!==o||(o=i[n]={id:n,loaded:!1,exports:{}},t[n].call(o.exports,o,o.exports,e),o.loaded=!0),o.exports}var t,i}()},53481:function(e,t){!function(e){"use strict";var t="1.9.4";function i(e){var t,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(t in o=arguments[i])e[t]=o[t];return e}var n=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function o(e,t){var i=Array.prototype.slice;if(e.bind)return e.bind.apply(e,i.call(arguments,1));var n=i.call(arguments,2);return function(){return e.apply(t,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(e){return"_leaflet_id"in e||(e._leaflet_id=++r),e._leaflet_id}function a(e,t,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(e.apply(i,arguments),setTimeout(s,t),n=!0)},r}function l(e,t,i){var n=t[1],o=t[0],r=n-o;return e===n&&i?e:((e-o)%r+r)%r+o}function c(){return!1}function h(e,t){if(!1===t)return e;var i=Math.pow(10,void 0===t?6:t);return Math.round(e*i)/i}function d(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function u(e){return d(e).split(/\s+/)}function p(e,t){for(var i in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?n(e.options):{}),t)e.options[i]=t[i];return e.options}function g(e,t,i){var n=[];for(var o in e)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(e[o]));return(t&&-1!==t.indexOf("?")?"&":"?")+n.join("&")}var m=/\{ *([\w_ -]+) *\}/g;function f(e,t){return e.replace(m,(function(e,i){var n=t[i];if(void 0===n)throw new Error("No value provided for variable "+e);return"function"==typeof n&&(n=n(t)),n}))}var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function v(e,t){for(var i=0;i<e.length;i++)if(e[i]===t)return i;return-1}var C="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function I(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var b=0;function A(e){var t=+new Date,i=Math.max(0,16-(t-b));return b=t+i,window.setTimeout(e,i)}var w=window.requestAnimationFrame||I("RequestAnimationFrame")||A,_=window.cancelAnimationFrame||I("CancelAnimationFrame")||I("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function x(e,t,i){if(!i||w!==A)return w.call(window,o(e,t));e.call(t)}function S(e){e&&_.call(window,e)}var k={__proto__:null,extend:i,create:n,bind:o,get lastId(){return r},stamp:s,throttle:a,wrapNum:l,falseFn:c,formatNum:h,trim:d,splitWords:u,setOptions:p,getParamString:g,template:f,isArray:y,indexOf:v,emptyImageUrl:C,requestFn:w,cancelFn:_,requestAnimFrame:x,cancelAnimFrame:S};function T(){}function E(e){if("undefined"!=typeof L&&L&&L.Mixin){e=y(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}T.extend=function(e){var t=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=t.__super__=this.prototype,r=n(o);for(var s in r.constructor=t,t.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(t[s]=this[s]);return e.statics&&i(t,e.statics),e.includes&&(E(e.includes),i.apply(null,[r].concat(e.includes))),i(r,e),delete r.statics,delete r.includes,r.options&&(r.options=o.options?n(o.options):{},i(r.options,e.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=r._initHooks.length;e<t;e++)r._initHooks[e].call(this)}},t},T.include=function(e){var t=this.prototype.options;return i(this.prototype,e),e.options&&(this.prototype.options=t,this.mergeOptions(e.options)),this},T.mergeOptions=function(e){return i(this.prototype.options,e),this},T.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),i="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var R={on:function(e,t,i){if("object"==typeof e)for(var n in e)this._on(n,e[n],t);else for(var o=0,r=(e=u(e)).length;o<r;o++)this._on(e[o],t,i);return this},off:function(e,t,i){if(arguments.length)if("object"==typeof e)for(var n in e)this._off(n,e[n],t);else{e=u(e);for(var o=1===arguments.length,r=0,s=e.length;r<s;r++)o?this._off(e[r]):this._off(e[r],t,i)}else delete this._events;return this},_on:function(e,t,i,n){if("function"==typeof t){if(!1===this._listens(e,t,i)){i===this&&(i=void 0);var o={fn:t,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(o)}}else console.warn("wrong listener type: "+typeof t)},_off:function(e,t,i){var n,o,r;if(this._events&&(n=this._events[e]))if(1!==arguments.length)if("function"==typeof t){var s=this._listens(e,t,i);if(!1!==s){var a=n[s];this._firingCount&&(a.fn=c,this._events[e]=n=n.slice()),n.splice(s,1)}}else console.warn("wrong listener type: "+typeof t);else{if(this._firingCount)for(o=0,r=n.length;o<r;o++)n[o].fn=c;delete this._events[e]}},fire:function(e,t,n){if(!this.listens(e,n))return this;var o=i({},t,{type:e,target:this,sourceTarget:t&&t.sourceTarget||this});if(this._events){var r=this._events[e];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s],c=l.fn;l.once&&this.off(e,c,l.ctx),c.call(l.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(e,t,i,n){"string"!=typeof e&&console.warn('"string" type argument expected');var o=t;"function"!=typeof t&&(n=!!t,o=void 0,i=void 0);var r=this._events&&this._events[e];if(r&&r.length&&!1!==this._listens(e,o,i))return!0;if(n)for(var s in this._eventParents)if(this._eventParents[s].listens(e,t,i,n))return!0;return!1},_listens:function(e,t,i){if(!this._events)return!1;var n=this._events[e]||[];if(!t)return!!n.length;i===this&&(i=void 0);for(var o=0,r=n.length;o<r;o++)if(n[o].fn===t&&n[o].ctx===i)return o;return!1},once:function(e,t,i){if("object"==typeof e)for(var n in e)this._on(n,e[n],t,!0);else for(var o=0,r=(e=u(e)).length;o<r;o++)this._on(e[o],t,i,!0);return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[s(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[s(e)],this},_propagateEvent:function(e){for(var t in this._eventParents)this._eventParents[t].fire(e.type,i({layer:e.target,propagatedFrom:e.target},e),!0)}};R.addEventListener=R.on,R.removeEventListener=R.clearAllEventListeners=R.off,R.addOneTimeEventListener=R.once,R.fireEvent=R.fire,R.hasEventListeners=R.listens;var $=T.extend(R);function P(e,t,i){this.x=i?Math.round(e):e,this.y=i?Math.round(t):t}var M=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function B(e,t,i){return e instanceof P?e:y(e)?new P(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new P(e.x,e.y):new P(e,t,i)}function N(e,t){if(e)for(var i=t?[e,t]:e,n=0,o=i.length;n<o;n++)this.extend(i[n])}function W(e,t){return!e||e instanceof N?e:new N(e,t)}function Z(e,t){if(e)for(var i=t?[e,t]:e,n=0,o=i.length;n<o;n++)this.extend(i[n])}function H(e,t){return e instanceof Z?e:new Z(e,t)}function O(e,t,i){if(isNaN(e)||isNaN(t))throw new Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==i&&(this.alt=+i)}function F(e,t,i){return e instanceof O?e:y(e)&&"object"!=typeof e[0]?3===e.length?new O(e[0],e[1],e[2]):2===e.length?new O(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new O(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new O(e,t,i)}P.prototype={clone:function(){return new P(this.x,this.y)},add:function(e){return this.clone()._add(B(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(B(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new P(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new P(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=M(this.x),this.y=M(this.y),this},distanceTo:function(e){var t=(e=B(e)).x-this.x,i=e.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(e){return(e=B(e)).x===this.x&&e.y===this.y},contains:function(e){return e=B(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}},N.prototype={extend:function(e){var t,i;if(!e)return this;if(e instanceof P||"number"==typeof e[0]||"x"in e)t=i=B(e);else if(t=(e=W(e)).min,i=e.max,!t||!i)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=t.clone(),this.max=i.clone()),this},getCenter:function(e){return B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return B(this.min.x,this.max.y)},getTopRight:function(){return B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,i;return(e="number"==typeof e[0]||e instanceof P?B(e):W(e))instanceof N?(t=e.min,i=e.max):t=i=e,t.x>=this.min.x&&i.x<=this.max.x&&t.y>=this.min.y&&i.y<=this.max.y},intersects:function(e){e=W(e);var t=this.min,i=this.max,n=e.min,o=e.max,r=o.x>=t.x&&n.x<=i.x,s=o.y>=t.y&&n.y<=i.y;return r&&s},overlaps:function(e){e=W(e);var t=this.min,i=this.max,n=e.min,o=e.max,r=o.x>t.x&&n.x<i.x,s=o.y>t.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(e){var t=this.min,i=this.max,n=Math.abs(t.x-i.x)*e,o=Math.abs(t.y-i.y)*e;return W(B(t.x-n,t.y-o),B(i.x+n,i.y+o))},equals:function(e){return!!e&&(e=W(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},Z.prototype={extend:function(e){var t,i,n=this._southWest,o=this._northEast;if(e instanceof O)t=e,i=e;else{if(!(e instanceof Z))return e?this.extend(F(e)||H(e)):this;if(t=e._southWest,i=e._northEast,!t||!i)return this}return n||o?(n.lat=Math.min(t.lat,n.lat),n.lng=Math.min(t.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new O(t.lat,t.lng),this._northEast=new O(i.lat,i.lng)),this},pad:function(e){var t=this._southWest,i=this._northEast,n=Math.abs(t.lat-i.lat)*e,o=Math.abs(t.lng-i.lng)*e;return new Z(new O(t.lat-n,t.lng-o),new O(i.lat+n,i.lng+o))},getCenter:function(){return new O((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new O(this.getNorth(),this.getWest())},getSouthEast:function(){return new O(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof O||"lat"in e?F(e):H(e);var t,i,n=this._southWest,o=this._northEast;return e instanceof Z?(t=e.getSouthWest(),i=e.getNorthEast()):t=i=e,t.lat>=n.lat&&i.lat<=o.lat&&t.lng>=n.lng&&i.lng<=o.lng},intersects:function(e){e=H(e);var t=this._southWest,i=this._northEast,n=e.getSouthWest(),o=e.getNorthEast(),r=o.lat>=t.lat&&n.lat<=i.lat,s=o.lng>=t.lng&&n.lng<=i.lng;return r&&s},overlaps:function(e){e=H(e);var t=this._southWest,i=this._northEast,n=e.getSouthWest(),o=e.getNorthEast(),r=o.lat>t.lat&&n.lat<i.lat,s=o.lng>t.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=H(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}},O.prototype={equals:function(e,t){return!!e&&(e=F(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+h(this.lat,e)+", "+h(this.lng,e)+")"},distanceTo:function(e){return V.distance(this,F(e))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(e){var t=180*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return H([this.lat-t,this.lng-i],[this.lat+t,this.lng+i])},clone:function(){return new O(this.lat,this.lng,this.alt)}};var G,D={latLngToPoint:function(e,t){var i=this.projection.project(e),n=this.scale(t);return this.transformation._transform(i,n)},pointToLatLng:function(e,t){var i=this.scale(t),n=this.transformation.untransform(e,i);return this.projection.unproject(n)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,i=this.scale(e);return new N(this.transformation.transform(t.min,i),this.transformation.transform(t.max,i))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?l(e.lng,this.wrapLng,!0):e.lng;return new O(this.wrapLat?l(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),i=this.wrapLatLng(t),n=t.lat-i.lat,o=t.lng-i.lng;if(0===n&&0===o)return e;var r=e.getSouthWest(),s=e.getNorthEast();return new Z(new O(r.lat-n,r.lng-o),new O(s.lat-n,s.lng-o))}},V=i({},D,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var i=Math.PI/180,n=e.lat*i,o=t.lat*i,r=Math.sin((t.lat-e.lat)*i/2),s=Math.sin((t.lng-e.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),j=6378137,z={R:j,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,e.lat),-i),o=Math.sin(n*t);return new P(this.R*e.lng*t,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(e){var t=180/Math.PI;return new O((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:(G=j*Math.PI,new N([-G,-G],[G,G]))};function K(e,t,i,n){if(y(e))return this._a=e[0],this._b=e[1],this._c=e[2],void(this._d=e[3]);this._a=e,this._b=t,this._c=i,this._d=n}function X(e,t,i,n){return new K(e,t,i,n)}K.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new P((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var Y=i({},V,{code:"EPSG:3857",projection:z,transformation:function(){var e=.5/(Math.PI*z.R);return X(e,.5,-e,.5)}()}),J=i({},Y,{code:"EPSG:900913"});function U(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Q(e,t){var i,n,o,r,s,a,l="";for(i=0,o=e.length;i<o;i++){for(n=0,r=(s=e[i]).length;n<r;n++)l+=(n?"L":"M")+(a=s[n]).x+" "+a.y;l+=t?Ze.svg?"z":"x":""}return l||"M0 0"}var q,ee=document.documentElement.style,te="ActiveXObject"in window,ie=te&&!document.addEventListener,ne="msLaunchUri"in navigator&&!("documentMode"in document),oe=We("webkit"),re=We("android"),se=We("android 2")||We("android 3"),ae=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),le=re&&We("Google")&&ae<537&&!("AudioNode"in window),ce=!!window.opera,he=!ne&&We("chrome"),de=We("gecko")&&!oe&&!ce&&!te,ue=!he&&We("safari"),pe=We("phantom"),ge="OTransition"in ee,me=0===navigator.platform.indexOf("Win"),fe=te&&"transition"in ee,ye="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!se,ve="MozPerspective"in ee,Ce=!window.L_DISABLE_3D&&(fe||ye||ve)&&!ge&&!pe,Ie="undefined"!=typeof orientation||We("mobile"),be=Ie&&oe,Ae=Ie&&ye,we=!window.PointerEvent&&window.MSPointerEvent,_e=!(!window.PointerEvent&&!we),xe="ontouchstart"in window||!!window.TouchEvent,Se=!window.L_NO_TOUCH&&(xe||_e),ke=Ie&&ce,Te=Ie&&de,Ee=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Re=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",c,t),window.removeEventListener("testPassiveEventSupport",c,t)}catch(e){}return e}(),Le=!!document.createElement("canvas").getContext,$e=!(!document.createElementNS||!U("svg").createSVGRect),Pe=!!$e&&((q=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(q.firstChild&&q.firstChild.namespaceURI)),Me=!$e&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}(),Be=0===navigator.platform.indexOf("Mac"),Ne=0===navigator.platform.indexOf("Linux");function We(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Ze={ie:te,ielt9:ie,edge:ne,webkit:oe,android:re,android23:se,androidStock:le,opera:ce,chrome:he,gecko:de,safari:ue,phantom:pe,opera12:ge,win:me,ie3d:fe,webkit3d:ye,gecko3d:ve,any3d:Ce,mobile:Ie,mobileWebkit:be,mobileWebkit3d:Ae,msPointer:we,pointer:_e,touch:Se,touchNative:xe,mobileOpera:ke,mobileGecko:Te,retina:Ee,passiveEvents:Re,canvas:Le,svg:$e,vml:Me,inlineSvg:Pe,mac:Be,linux:Ne},He=Ze.msPointer?"MSPointerDown":"pointerdown",Oe=Ze.msPointer?"MSPointerMove":"pointermove",Fe=Ze.msPointer?"MSPointerUp":"pointerup",Ge=Ze.msPointer?"MSPointerCancel":"pointercancel",De={touchstart:He,touchmove:Oe,touchend:Fe,touchcancel:Ge},Ve={touchstart:et,touchmove:qe,touchend:qe,touchcancel:qe},je={},ze=!1;function Ke(e,t,i){return"touchstart"===t&&Qe(),Ve[t]?(i=Ve[t].bind(this,i),e.addEventListener(De[t],i,!1),i):(console.warn("wrong event specified:",t),c)}function Xe(e,t,i){De[t]?e.removeEventListener(De[t],i,!1):console.warn("wrong event specified:",t)}function Ye(e){je[e.pointerId]=e}function Je(e){je[e.pointerId]&&(je[e.pointerId]=e)}function Ue(e){delete je[e.pointerId]}function Qe(){ze||(document.addEventListener(He,Ye,!0),document.addEventListener(Oe,Je,!0),document.addEventListener(Fe,Ue,!0),document.addEventListener(Ge,Ue,!0),ze=!0)}function qe(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in t.touches=[],je)t.touches.push(je[i]);t.changedTouches=[t],e(t)}}function et(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Yt(t),qe(e,t)}function tt(e){var t,i,n={};for(i in e)t=e[i],n[i]=t&&t.bind?t.bind(e):t;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var it=200;function nt(e,t){e.addEventListener("dblclick",t);var i,n=0;function o(e){if(1===e.detail){if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var o=Ut(e);if(!o.some((function(e){return e instanceof HTMLLabelElement&&e.attributes.for}))||o.some((function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var r=Date.now();r-n<=it?2==++i&&t(tt(e)):i=1,n=r}}}else i=e.detail}return e.addEventListener("click",o),{dblclick:t,simDblclick:o}}function ot(e,t){e.removeEventListener("dblclick",t.dblclick),e.removeEventListener("click",t.simDblclick)}var rt,st,at,lt,ct,ht=kt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),dt=kt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ut="webkitTransition"===dt||"OTransition"===dt?dt+"End":"transitionend";function pt(e){return"string"==typeof e?document.getElementById(e):e}function gt(e,t){var i=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(e,null);i=n?n[t]:null}return"auto"===i?null:i}function mt(e,t,i){var n=document.createElement(e);return n.className=t||"",i&&i.appendChild(n),n}function ft(e){var t=e.parentNode;t&&t.removeChild(e)}function yt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function vt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function Ct(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function It(e,t){if(void 0!==e.classList)return e.classList.contains(t);var i=_t(e);return i.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)}function bt(e,t){if(void 0!==e.classList)for(var i=u(t),n=0,o=i.length;n<o;n++)e.classList.add(i[n]);else if(!It(e,t)){var r=_t(e);wt(e,(r?r+" ":"")+t)}}function At(e,t){void 0!==e.classList?e.classList.remove(t):wt(e,d((" "+_t(e)+" ").replace(" "+t+" "," ")))}function wt(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function _t(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function xt(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&St(e,t)}function St(e,t){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=e.filters.item(n)}catch(e){if(1===t)return}t=Math.round(100*t),i?(i.Enabled=100!==t,i.Opacity=t):e.style.filter+=" progid:"+n+"(opacity="+t+")"}function kt(e){for(var t=document.documentElement.style,i=0;i<e.length;i++)if(e[i]in t)return e[i];return!1}function Tt(e,t,i){var n=t||new P(0,0);e.style[ht]=(Ze.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Et(e,t){e._leaflet_pos=t,Ze.any3d?Tt(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function Rt(e){return e._leaflet_pos||new P(0,0)}if("onselectstart"in document)rt=function(){Ht(window,"selectstart",Yt)},st=function(){Ft(window,"selectstart",Yt)};else{var Lt=kt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);rt=function(){if(Lt){var e=document.documentElement.style;at=e[Lt],e[Lt]="none"}},st=function(){Lt&&(document.documentElement.style[Lt]=at,at=void 0)}}function $t(){Ht(window,"dragstart",Yt)}function Pt(){Ft(window,"dragstart",Yt)}function Mt(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(Bt(),lt=e,ct=e.style.outlineStyle,e.style.outlineStyle="none",Ht(window,"keydown",Bt))}function Bt(){lt&&(lt.style.outlineStyle=ct,lt=void 0,ct=void 0,Ft(window,"keydown",Bt))}function Nt(e){do{e=e.parentNode}while(!(e.offsetWidth&&e.offsetHeight||e===document.body));return e}function Wt(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}var Zt={__proto__:null,TRANSFORM:ht,TRANSITION:dt,TRANSITION_END:ut,get:pt,getStyle:gt,create:mt,remove:ft,empty:yt,toFront:vt,toBack:Ct,hasClass:It,addClass:bt,removeClass:At,setClass:wt,getClass:_t,setOpacity:xt,testProp:kt,setTransform:Tt,setPosition:Et,getPosition:Rt,get disableTextSelection(){return rt},get enableTextSelection(){return st},disableImageDrag:$t,enableImageDrag:Pt,preventOutline:Mt,restoreOutline:Bt,getSizedParentNode:Nt,getScale:Wt};function Ht(e,t,i,n){if(t&&"object"==typeof t)for(var o in t)Vt(e,o,t[o],i);else for(var r=0,s=(t=u(t)).length;r<s;r++)Vt(e,t[r],i,n);return this}var Ot="_leaflet_events";function Ft(e,t,i,n){if(1===arguments.length)Gt(e),delete e[Ot];else if(t&&"object"==typeof t)for(var o in t)jt(e,o,t[o],i);else if(t=u(t),2===arguments.length)Gt(e,(function(e){return-1!==v(t,e)}));else for(var r=0,s=t.length;r<s;r++)jt(e,t[r],i,n);return this}function Gt(e,t){for(var i in e[Ot]){var n=i.split(/\d/)[0];t&&!t(n)||jt(e,n,null,null,i)}}var Dt={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Vt(e,t,i,n){var o=t+s(i)+(n?"_"+s(n):"");if(e[Ot]&&e[Ot][o])return this;var r=function(t){return i.call(n||e,t||window.event)},a=r;!Ze.touchNative&&Ze.pointer&&0===t.indexOf("touch")?r=Ke(e,t,r):Ze.touch&&"dblclick"===t?r=nt(e,r):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Dt[t]||t,r,!!Ze.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(r=function(t){t=t||window.event,ti(e,t)&&a(t)},e.addEventListener(Dt[t],r,!1)):e.addEventListener(t,a,!1):e.attachEvent("on"+t,r),e[Ot]=e[Ot]||{},e[Ot][o]=r}function jt(e,t,i,n,o){o=o||t+s(i)+(n?"_"+s(n):"");var r=e[Ot]&&e[Ot][o];if(!r)return this;!Ze.touchNative&&Ze.pointer&&0===t.indexOf("touch")?Xe(e,t,r):Ze.touch&&"dblclick"===t?ot(e,r):"removeEventListener"in e?e.removeEventListener(Dt[t]||t,r,!1):e.detachEvent("on"+t,r),e[Ot][o]=null}function zt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function Kt(e){return Vt(e,"wheel",zt),this}function Xt(e){return Ht(e,"mousedown touchstart dblclick contextmenu",zt),e._leaflet_disable_click=!0,this}function Yt(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function Jt(e){return Yt(e),zt(e),this}function Ut(e){if(e.composedPath)return e.composedPath();for(var t=[],i=e.target;i;)t.push(i),i=i.parentNode;return t}function Qt(e,t){if(!t)return new P(e.clientX,e.clientY);var i=Wt(t),n=i.boundingClientRect;return new P((e.clientX-n.left)/i.x-t.clientLeft,(e.clientY-n.top)/i.y-t.clientTop)}var qt=Ze.linux&&Ze.chrome?window.devicePixelRatio:Ze.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ei(e){return Ze.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/qt:e.deltaY&&1===e.deltaMode?20*-e.deltaY:e.deltaY&&2===e.deltaMode?60*-e.deltaY:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?20*-e.detail:e.detail?e.detail/-32765*60:0}function ti(e,t){var i=t.relatedTarget;if(!i)return!0;try{for(;i&&i!==e;)i=i.parentNode}catch(e){return!1}return i!==e}var ii={__proto__:null,on:Ht,off:Ft,stopPropagation:zt,disableScrollPropagation:Kt,disableClickPropagation:Xt,preventDefault:Yt,stop:Jt,getPropagationPath:Ut,getMousePosition:Qt,getWheelDelta:ei,isExternalTarget:ti,addListener:Ht,removeListener:Ft},ni=$.extend({run:function(e,t,i,n){this.stop(),this._el=e,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Rt(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,i=1e3*this._duration;t<i?this._runFrame(this._easeOut(t/i),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var i=this._startPos.add(this._offset.multiplyBy(e));t&&i._round(),Et(this._el,i),this.fire("step")},_complete:function(){S(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),oi=$.extend({options:{crs:Y,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=p(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(F(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=dt&&Ze.any3d&&!Ze.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ht(this._proxy,ut,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,t,n){return t=void 0===t?this._zoom:this._limitZoom(t),e=this._limitCenter(F(e),t,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,t,n.zoom):this._tryAnimatedPan(e,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,t,n.pan&&n.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(Ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(Ze.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,i){var n=this.getZoomScale(t),o=this.getSize().divideBy(2),r=(e instanceof P?e:this.latLngToContainerPoint(e)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,t,{zoom:i})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():H(e);var i=B(t.paddingTopLeft||t.padding||[0,0]),n=B(t.paddingBottomRight||t.padding||[0,0]),o=this.getBoundsZoom(e,!1,i.add(n));if((o="number"==typeof t.maxZoom?Math.min(t.maxZoom,o):o)===1/0)return{center:e.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(e.getSouthWest(),o),a=this.project(e.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(e,t){if(!(e=H(e)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(e,t);return this.setView(i.center,i.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(t=t||{},!(e=B(e).round()).x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ni,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){bt(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,i,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,i){if(!1===(i=i||{}).animate||!Ze.any3d)return this.setView(e,t,i);this._stop();var n=this.project(this.getCenter()),o=this.project(e),r=this.getSize(),s=this._zoom;e=F(e),t=void 0===t?s:t;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,t),c=o.distanceTo(n)||1,h=1.42,d=h*h;function u(e){var t=(l*l-a*a+(e?-1:1)*d*d*c*c)/(2*(e?l:a)*d*c),i=Math.sqrt(t*t+1)-t;return i<1e-9?-18:Math.log(i)}function p(e){return(Math.exp(e)-Math.exp(-e))/2}function g(e){return(Math.exp(e)+Math.exp(-e))/2}function m(e){return p(e)/g(e)}var f=u(0);function y(e){return a*(g(f)/g(f+h*e))}function v(e){return a*(g(f)*m(f+h*e)-p(f))/d}function C(e){return 1-Math.pow(1-e,1.5)}var I=Date.now(),b=(u(1)-f)/h,A=i.duration?1e3*i.duration:1e3*b*.8;function w(){var i=(Date.now()-I)/A,r=C(i)*b;i<=1?(this._flyToFrame=x(w,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/c)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),w.call(this),this},flyToBounds:function(e,t){var i=this._getBoundsCenterZoom(e,t);return this.flyTo(i.center,i.zoom,t)},setMaxBounds:function(e){return e=H(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,H(e));return i.equals(n)||this.panTo(n,t),this._enforcingBounds=!1,this},panInside:function(e,t){var i=B((t=t||{}).paddingTopLeft||t.padding||[0,0]),n=B(t.paddingBottomRight||t.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(e),s=this.getPixelBounds(),a=W([s.min.add(i),s.max.subtract(n)]),l=a.getSize();if(!a.contains(r)){this._enforcingBounds=!0;var c=r.subtract(a.getCenter()),h=a.extend(r).getSize().subtract(l);o.x+=c.x<0?-h.x:h.x,o.y+=c.y<0?-h.y:h.y,this.panTo(this.unproject(o),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=i({animate:!1,pan:!0},!0===e?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=t.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(e.animate&&e.pan?this.panBy(a):(e.pan&&this._rawPanBy(a),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:t,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=i({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,n,e):navigator.geolocation.getCurrentPosition(t,n,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,i=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new O(e.coords.latitude,e.coords.longitude),i=t.toBounds(2*e.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(t,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:t,bounds:i,timestamp:e.timestamp};for(var s in e.coords)"number"==typeof e.coords[s]&&(r[s]=e.coords[s]);this.fire("locationfound",r)}},addHandler:function(e,t){if(!t)return this;var i=this[e]=new t(this);return this._handlers.push(i),this.options[e]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var e;for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ft(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(S(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)ft(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var i=mt("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new Z(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,i){e=H(e),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=e.getNorthWest(),a=e.getSouthEast(),l=this.getSize().subtract(i),c=W(this.project(a,n),this.project(s,n)).getSize(),h=Ze.any3d?this.options.zoomSnap:1,d=l.x/c.x,u=l.y/c.y,p=t?Math.max(d,u):Math.min(d,u);return n=this.getScaleZoom(p,n),h&&(n=Math.round(n/(h/100))*(h/100),n=t?Math.ceil(n/h)*h:Math.floor(n/h)*h),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new P(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var i=this._getTopLeftPoint(e,t);return new N(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var i=this.options.crs;return t=void 0===t?this._zoom:t,i.scale(e)/i.scale(t)},getScaleZoom:function(e,t){var i=this.options.crs;t=void 0===t?this._zoom:t;var n=i.zoom(e*i.scale(t));return isNaN(n)?1/0:n},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(F(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(B(e),t)},layerPointToLatLng:function(e){var t=B(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(F(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(F(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(H(e))},distance:function(e,t){return this.options.crs.distance(F(e),F(t))},containerPointToLayerPoint:function(e){return B(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return B(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(B(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(e)))},mouseEventToContainerPoint:function(e){return Qt(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=pt(e);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");Ht(t,"scroll",this._onScroll,this),this._containerId=s(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ze.any3d,bt(e,"leaflet-container"+(Ze.touch?" leaflet-touch":"")+(Ze.retina?" leaflet-retina":"")+(Ze.ielt9?" leaflet-oldie":"")+(Ze.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=gt(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Et(this._mapPane,new P(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(bt(e.markerPane,"leaflet-zoom-hide"),bt(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,i){Et(this._mapPane,new P(0,0));var n=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var o=this._zoom!==t;this._moveStart(o,i)._move(e,t)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,i,n){void 0===t&&(t=this._zoom);var o=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return S(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Et(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[s(this._container)]=this;var t=e?Ft:Ht;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),Ze.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){S(this._resizeRequest),this._resizeRequest=x((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var i,n=[],o="mouseout"===t||"mouseover"===t,r=e.target||e.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===t||"preclick"===t)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(t,!0)){if(o&&!ti(r,e))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!this.listens(t,!0)||(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var i=e.type;"mousedown"===i&&Mt(t),this._fireDOMEvent(e,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,t,n){if("click"===e.type){var o=i({},e);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var r=this._findEventTargets(e,t);if(n){for(var s=[],a=0;a<n.length;a++)n[a].listens(t,!0)&&s.push(n[a]);r=s.concat(r)}if(r.length){"contextmenu"===t&&Yt(e);var l=r[0],c={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var h=l.getLatLng&&(!l._radius||l._radius<=10);c.containerPoint=h?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),c.layerPoint=this.containerPointToLayerPoint(c.containerPoint),c.latlng=h?l.getLatLng():this.layerPointToLatLng(c.layerPoint)}for(a=0;a<r.length;a++)if(r[a].fire(t,c,!0),c.originalEvent._stopped||!1===r[a].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,t))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return Rt(this._mapPane)||new P(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var i=this.getSize()._divideBy(2);return this.project(e,t)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,i){var n=this._getNewPixelOrigin(i,t);return this.project(e,t)._subtract(n)},_latLngBoundsToNewLayerBounds:function(e,t,i){var n=this._getNewPixelOrigin(i,t);return W([this.project(e.getSouthWest(),t)._subtract(n),this.project(e.getNorthWest(),t)._subtract(n),this.project(e.getSouthEast(),t)._subtract(n),this.project(e.getNorthEast(),t)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,i){if(!i)return e;var n=this.project(e,t),o=this.getSize().divideBy(2),r=new N(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,t);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?e:this.unproject(n.add(s),t)},_limitOffset:function(e,t){if(!t)return e;var i=this.getPixelBounds(),n=new N(i.min.add(e),i.max.add(e));return e.add(this._getBoundsOffset(n,t))},_getBoundsOffset:function(e,t,i){var n=W(this.project(t.getNorthEast(),i),this.project(t.getSouthWest(),i)),o=n.min.subtract(e.min),r=n.max.subtract(e.max);return new P(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),i=this.getMaxZoom(),n=Ze.any3d?this.options.zoomSnap:1;return n&&(e=Math.round(e/n)*n),Math.max(t,Math.min(i,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){At(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var i=this._getCenterOffset(e)._trunc();return!(!0!==(t&&t.animate)&&!this.getSize().contains(i)||(this.panBy(i,t),0))},_createAnimProxy:function(){var e=this._proxy=mt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",(function(e){var t=ht,i=this._proxy.style[t];Tt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),i===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ft(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Tt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(t),o=this._getCenterOffset(e)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(x((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(e,t,!0)}),this),0))},_animateZoom:function(e,t,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,bt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&At(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ri(e,t){return new oi(e,t)}var si=T.extend({options:{position:"topright"},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),i=this.getPosition(),n=e._controlCorners[i];return bt(t,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(t,n.firstChild):n.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ft(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),ai=function(e){return new si(e)};oi.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",i=this._controlContainer=mt("div",t+"control-container",this._container);function n(n,o){var r=t+n+" "+t+o;e[n+o]=mt("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ft(this._controlCorners[e]);ft(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=si.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,i,n){return i<n?-1:n<i?1:0}},initialize:function(e,t,i){for(var n in p(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[n],n);for(n in t)this._addLayer(t[n],n,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return si.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(s(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){bt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(bt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):At(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return At(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=mt("div",e),i=this.options.collapsed;t.setAttribute("aria-haspopup",!0),Xt(t),Kt(t);var n=this._section=mt("section",e+"-list");i&&(this._map.on("click",this.collapse,this),Ht(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var o=this._layersLink=mt("a",e+"-toggle",t);o.href="#",o.title="Layers",o.setAttribute("role","button"),Ht(o,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){Yt(e),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=mt("div",e+"-base",n),this._separator=mt("div",e+"-separator",n),this._overlaysList=mt("div",e+"-overlays",n),t.appendChild(n)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&s(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,i){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)}),this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;yt(this._baseLayersList),yt(this._overlaysList),this._layerControlInputs=[];var e,t,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),t=t||n.overlay,e=e||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(e=e&&o>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(s(e.target)),i=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;i&&this._map.fire(i,t)},_createRadioElement:function(e,t){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(e){var t,i=document.createElement("label"),n=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=n):t=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(t),t.layerId=s(e.layer),Ht(t,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+e.name;var r=document.createElement("span");return i.appendChild(r),r.appendChild(t),r.appendChild(o),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var e,t,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=i[r],t=this._getLayer(e.layerId).layer,e.checked?n.push(t):e.checked||o.push(t);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)e=i[o],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&n<t.options.minZoom||void 0!==t.options.maxZoom&&n>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ht(e,"click",Yt),this.expand();var t=this;setTimeout((function(){Ft(e,"click",Yt),t._preventClick=!1}))}}),ci=function(e,t,i){return new li(e,t,i)},hi=si.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",i=mt("div",t+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,t+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,t+"-out",i,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,i,n,o){var r=mt("a",i,n);return r.innerHTML=e,r.href="#",r.title=t,r.setAttribute("role","button"),r.setAttribute("aria-label",t),Xt(r),Ht(r,"click",Jt),Ht(r,"click",o,this),Ht(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";At(this._zoomInButton,t),At(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(bt(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(bt(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new hi,this.addControl(this.zoomControl))}));var di=function(e){return new hi(e)},ui=si.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",i=mt("div",t),n=this.options;return this._addScales(n,t+"-line",i),e.on(n.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),i},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,i){e.metric&&(this._mScale=mt("div",t,i)),e.imperial&&(this._iScale=mt("div",t,i))},_update:function(){var e=this._map,t=e.getSize().y/2,i=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(i)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),i=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,i,t/e)},_updateImperial:function(e){var t,i,n,o=3.2808399*e;o>5280?(t=o/5280,i=this._getRoundNum(t),this._updateScale(this._iScale,i+" mi",i/t)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(e,t,i){e.style.width=Math.round(this.options.maxWidth*i)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),i=e/t;return t*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(e){return new ui(e)},gi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',mi=si.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Ze.inlineSvg?gi+" ":"")+"Leaflet</a>"},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=mt("div","leaflet-control-attribution"),Xt(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",(function(){this.removeAttribution(e.layer.getAttribution())}),this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook((function(){this.options.attributionControl&&(new mi).addTo(this)}));var fi=function(e){return new mi(e)};si.Layers=li,si.Zoom=hi,si.Scale=ui,si.Attribution=mi,ai.layers=ci,ai.zoom=di,ai.scale=pi,ai.attribution=fi;var yi=T.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});yi.addTo=function(e,t){return e.addHandler(t,this),this};var vi={Events:R},Ci=Ze.touch?"touchstart mousedown":"mousedown",Ii=$.extend({options:{clickTolerance:3},initialize:function(e,t,i,n){p(this,n),this._element=e,this._dragStartTarget=t||e,this._preventOutline=i},enable:function(){this._enabled||(Ht(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ii._dragging===this&&this.finishDrag(!0),Ft(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!It(this._element,"leaflet-zoom-anim")))if(e.touches&&1!==e.touches.length)Ii._dragging===this&&this.finishDrag();else if(!(Ii._dragging||e.shiftKey||1!==e.which&&1!==e.button&&!e.touches||(Ii._dragging=this,this._preventOutline&&Mt(this._element),$t(),rt(),this._moving))){this.fire("down");var t=e.touches?e.touches[0]:e,i=Nt(this._element);this._startPoint=new P(t.clientX,t.clientY),this._startPos=Rt(this._element),this._parentScale=Wt(i);var n="mousedown"===e.type;Ht(document,n?"mousemove":"touchmove",this._onMove,this),Ht(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(e){if(this._enabled)if(e.touches&&e.touches.length>1)this._moved=!0;else{var t=e.touches&&1===e.touches.length?e.touches[0]:e,i=new P(t.clientX,t.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Yt(e),this._moved||(this.fire("dragstart"),this._moved=!0,bt(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),bt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),Et(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){At(document.body,"leaflet-dragging"),this._lastTarget&&(At(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ft(document,"mousemove touchmove",this._onMove,this),Ft(document,"mouseup touchend touchcancel",this._onUp,this),Pt(),st();var t=this._moved&&this._moving;this._moving=!1,Ii._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function bi(e,t,i){var n,o,r,s,a,l,c,h,d,u=[1,4,2,8];for(o=0,c=e.length;o<c;o++)e[o]._code=Mi(e[o],t);for(s=0;s<4;s++){for(h=u[s],n=[],o=0,r=(c=e.length)-1;o<c;r=o++)a=e[o],l=e[r],a._code&h?l._code&h||((d=Pi(l,a,h,t,i))._code=Mi(d,t),n.push(d)):(l._code&h&&((d=Pi(l,a,h,t,i))._code=Mi(d,t),n.push(d)),n.push(a));e=n}return e}function Ai(e,t){var i,n,o,r,s,a,l,c,h;if(!e||0===e.length)throw new Error("latlngs not passed");Wi(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var d=F([0,0]),u=H(e);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(d=wi(e));var p=e.length,g=[];for(i=0;i<p;i++){var m=F(e[i]);g.push(t.project(F([m.lat-d.lat,m.lng-d.lng])))}for(a=l=c=0,i=0,n=p-1;i<p;n=i++)o=g[i],r=g[n],s=o.y*r.x-r.y*o.x,l+=(o.x+r.x)*s,c+=(o.y+r.y)*s,a+=3*s;h=0===a?g[0]:[l/a,c/a];var f=t.unproject(B(h));return F([f.lat+d.lat,f.lng+d.lng])}function wi(e){for(var t=0,i=0,n=0,o=0;o<e.length;o++){var r=F(e[o]);t+=r.lat,i+=r.lng,n++}return F([t/n,i/n])}var _i,xi={__proto__:null,clipPolygon:bi,polygonCenter:Ai,centroid:wi};function Si(e,t){if(!t||!e.length)return e.slice();var i=t*t;return e=Ei(e=Li(e,i),i)}function ki(e,t,i){return Math.sqrt(Ni(e,t,i,!0))}function Ti(e,t,i){return Ni(e,t,i)}function Ei(e,t){var i=e.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Ri(e,n,t,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(e[o]);return r}function Ri(e,t,i,n,o){var r,s,a,l=0;for(s=n+1;s<=o-1;s++)(a=Ni(e[s],e[n],e[o],!0))>l&&(r=s,l=a);l>i&&(t[r]=1,Ri(e,t,i,n,r),Ri(e,t,i,r,o))}function Li(e,t){for(var i=[e[0]],n=1,o=0,r=e.length;n<r;n++)Bi(e[n],e[o])>t&&(i.push(e[n]),o=n);return o<r-1&&i.push(e[r-1]),i}function $i(e,t,i,n,o){var r,s,a,l=n?_i:Mi(e,i),c=Mi(t,i);for(_i=c;;){if(!(l|c))return[e,t];if(l&c)return!1;a=Mi(s=Pi(e,t,r=l||c,i,o),i),r===l?(e=s,l=a):(t=s,c=a)}}function Pi(e,t,i,n,o){var r,s,a=t.x-e.x,l=t.y-e.y,c=n.min,h=n.max;return 8&i?(r=e.x+a*(h.y-e.y)/l,s=h.y):4&i?(r=e.x+a*(c.y-e.y)/l,s=c.y):2&i?(r=h.x,s=e.y+l*(h.x-e.x)/a):1&i&&(r=c.x,s=e.y+l*(c.x-e.x)/a),new P(r,s,o)}function Mi(e,t){var i=0;return e.x<t.min.x?i|=1:e.x>t.max.x&&(i|=2),e.y<t.min.y?i|=4:e.y>t.max.y&&(i|=8),i}function Bi(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}function Ni(e,t,i,n){var o,r=t.x,s=t.y,a=i.x-r,l=i.y-s,c=a*a+l*l;return c>0&&((o=((e.x-r)*a+(e.y-s)*l)/c)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=l*o)),a=e.x-r,l=e.y-s,n?a*a+l*l:new P(r,s)}function Wi(e){return!y(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function Zi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Wi(e)}function Hi(e,t){var i,n,o,r,s,a,l,c;if(!e||0===e.length)throw new Error("latlngs not passed");Wi(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var h=F([0,0]),d=H(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(h=wi(e));var u=e.length,p=[];for(i=0;i<u;i++){var g=F(e[i]);p.push(t.project(F([g.lat-h.lat,g.lng-h.lng])))}for(i=0,n=0;i<u-1;i++)n+=p[i].distanceTo(p[i+1])/2;if(0===n)c=p[0];else for(i=0,r=0;i<u-1;i++)if(s=p[i],a=p[i+1],(r+=o=s.distanceTo(a))>n){l=(r-n)/o,c=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var m=t.unproject(B(c));return F([m.lat+h.lat,m.lng+h.lng])}var Oi={__proto__:null,simplify:Si,pointToSegmentDistance:ki,closestPointOnSegment:Ti,clipSegment:$i,_getEdgeIntersection:Pi,_getBitCode:Mi,_sqClosestPointOnSegment:Ni,isFlat:Wi,_flat:Zi,polylineCenter:Hi},Fi={project:function(e){return new P(e.lng,e.lat)},unproject:function(e){return new O(e.y,e.x)},bounds:new N([-180,-90],[180,90])},Gi={R:6378137,R_MINOR:6356752.314245179,bounds:new N([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,i=this.R,n=e.lat*t,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new P(e.lng*t*i,n)},unproject:function(e){for(var t,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-e.y/n),a=Math.PI/2-2*Math.atan(s),l=0,c=.1;l<15&&Math.abs(c)>1e-7;l++)t=r*Math.sin(a),t=Math.pow((1-t)/(1+t),r/2),a+=c=Math.PI/2-2*Math.atan(s*t)-a;return new O(a*i,e.x*i/n)}},Di={__proto__:null,LonLat:Fi,Mercator:Gi,SphericalMercator:z},Vi=i({},V,{code:"EPSG:3395",projection:Gi,transformation:function(){var e=.5/(Math.PI*Gi.R);return X(e,.5,-e,.5)}()}),ji=i({},V,{code:"EPSG:4326",projection:Fi,transformation:X(1/180,1,-1/180,.5)}),zi=i({},D,{projection:Fi,transformation:X(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var i=t.lng-e.lng,n=t.lat-e.lat;return Math.sqrt(i*i+n*n)},infinite:!0});D.Earth=V,D.EPSG3395=Vi,D.EPSG3857=Y,D.EPSG900913=J,D.EPSG4326=ji,D.Simple=zi;var Ki=$.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[s(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[s(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var i=this.getEvents();t.on(i,this),this.once("remove",(function(){t.off(i,this)}),this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var t=s(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=s(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return s(e)in this._layers},eachLayer:function(e,t){for(var i in this._layers)e.call(t,this._layers[i]);return this},_addLayers:function(e){for(var t=0,i=(e=e?y(e)?e:[e]:[]).length;t<i;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[s(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=s(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;e=void 0===o.minZoom?e:Math.min(e,o.minZoom),t=void 0===o.maxZoom?t:Math.max(t,o.maxZoom)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=e===1/0?void 0:e,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Xi=Ki.extend({initialize:function(e,t){var i,n;if(p(this,t),this._layers={},e)for(i=0,n=e.length;i<n;i++)this.addLayer(e[i])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,i,n=Array.prototype.slice.call(arguments,1);for(t in this._layers)(i=this._layers[t])[e]&&i[e].apply(i,n);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var i in this._layers)e.call(t,this._layers[i]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return s(e)}}),Yi=function(e,t){return new Xi(e,t)},Ji=Xi.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),Xi.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),Xi.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new Z;for(var t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),Ui=function(e,t){return new Ji(e,t)},Qi=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){p(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var i=this._getIconUrl(e);if(!i){if("icon"===e)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(n,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n},_setIconStyles:function(e,t){var i=this.options,n=i[t+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===t&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(i.className||""),r&&(e.style.marginLeft=-r.x+"px",e.style.marginTop=-r.y+"px"),o&&(e.style.width=o.x+"px",e.style.height=o.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return Ze.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function qi(e){return new Qi(e)}var en=Qi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof en.imagePath&&(en.imagePath=this._detectIconPath()),(this.options.imagePath||en.imagePath)+Qi.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,i){var n=t.exec(e);return n&&n[i]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=mt("div","leaflet-default-icon-path",document.body),t=gt(e,"background-image")||gt(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}}),tn=yi.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new Ii(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),bt(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&At(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,i=t._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Rt(t._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=W(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var c=B((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(n);i.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),Et(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=x(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(S(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,i=t._shadow,n=Rt(t._icon),o=t._map.layerPointToLatLng(n);i&&Et(i,n),t._latlng=o,e.latlng=o,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){S(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),nn=Ki.extend({options:{icon:new en,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){p(this,t),this._latlng=F(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=F(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=e.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,e.title&&(i.title=e.title),"IMG"===i.tagName&&(i.alt=e.alt||"")),bt(i,t),e.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ht(i,"focus",this._panOnFocus,this);var o=e.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(bt(o,t),o.alt=""),this._shadow=o,e.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(this._icon,"focus",this._panOnFocus,this),ft(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ft(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&Et(this._icon,e),this._shadow&&Et(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(bt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),tn)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new tn(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&xt(this._icon,e),this._shadow&&xt(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,i=t.iconSize?B(t.iconSize):B(0,0),n=t.iconAnchor?B(t.iconAnchor):B(0,0);e.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function on(e,t){return new nn(e,t)}var rn=Ki.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return p(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),sn=rn.extend({options:{fill:!0,radius:10},initialize:function(e,t){p(this,t),this._latlng=F(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=F(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return rn.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,i=this._clickTolerance(),n=[e+i,t+i];this._pxBounds=new N(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function an(e,t){return new sn(e,t)}var ln=sn.extend({initialize:function(e,t,n){if("number"==typeof t&&(t=i({},n,{radius:t})),p(this,t),this._latlng=F(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new Z(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:rn.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,r=this._mRadius/V.R/o,s=i.project([t+r,e]),a=i.project([t-r,e]),l=s.add(a).divideBy(2),c=i.unproject(l).lat,h=Math.acos((Math.cos(r*o)-Math.sin(t*o)*Math.sin(c*o))/(Math.cos(t*o)*Math.cos(c*o)))/o;(isNaN(h)||0===h)&&(h=r/Math.cos(Math.PI/180*t)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(h)?0:l.x-i.project([c,e-h]).x,this._radiusY=l.y-s.y}else{var d=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(d).x}this._updateBounds()}});function cn(e,t,i){return new ln(e,t,i)}var hn=rn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){p(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,i,n=1/0,o=null,r=Ni,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],c=1,h=l.length;c<h;c++){var d=r(e,t=l[c-1],i=l[c],!0);d<n&&(n=d,o=r(e,t,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Hi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=F(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new Z,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return Wi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],i=Wi(e),n=0,o=e.length;n<o;n++)i?(t[n]=F(e[n]),this._bounds.extend(t[n])):t[n]=this._convertLatLngs(e[n]);return t},_project:function(){var e=new N;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new P(e,e);this._rawPxBounds&&(this._pxBounds=new N([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,i){var n,o,r=e[0]instanceof O,s=e.length;if(r){for(o=[],n=0;n<s;n++)o[n]=this._map.latLngToLayerPoint(e[n]),i.extend(o[n]);t.push(o)}else for(n=0;n<s;n++)this._projectLatlngs(e[n],t,i)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else{var t,i,n,o,r,s,a,l=this._parts;for(t=0,n=0,o=this._rings.length;t<o;t++)for(i=0,r=(a=this._rings[t]).length;i<r-1;i++)(s=$i(a[i],a[i+1],e,i,!0))&&(l[n]=l[n]||[],l[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,i=0,n=e.length;i<n;i++)e[i]=Si(e[i],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var i,n,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((t||0!==n)&&ki(e,a[o],a[n])<=l)return!0;return!1}});function dn(e,t){return new hn(e,t)}hn._flat=Zi;var un=hn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ai(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=hn.prototype._convertLatLngs.call(this,e),i=t.length;return i>=2&&t[0]instanceof O&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(e){hn.prototype._setLatLngs.call(this,e),Wi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Wi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,i=new P(t,t);if(e=new N(e.min.subtract(i),e.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=bi(this._rings[o],e,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,i,n,o,r,s,a,l,c=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(t=this._parts[o]).length)-1;r<l;s=r++)i=t[r],n=t[s],i.y>e.y!=n.y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(c=!c);return c||hn.prototype._containsPoint.call(this,e,!0)}});function pn(e,t){return new un(e,t)}var gn=Ji.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,i,n,o=y(e)?e:e.features;if(o){for(t=0,i=o.length;t<i;t++)((n=o[t]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(e))return this;var s=mn(e,r);return s?(s.feature=An(e),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(e,s),this.addLayer(s)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=i({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer((function(t){this._setLayerStyle(t,e)}),this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function mn(e,t){var i,n,o,r,s="Feature"===e.type?e.geometry:e,a=s?s.coordinates:null,l=[],c=t&&t.pointToLayer,h=t&&t.coordsToLatLng||yn;if(!a&&!s)return null;switch(s.type){case"Point":return fn(c,e,i=h(a),t);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=h(a[o]),l.push(fn(c,e,i,t));return new Ji(l);case"LineString":case"MultiLineString":return n=vn(a,"LineString"===s.type?0:1,h),new hn(n,t);case"Polygon":case"MultiPolygon":return n=vn(a,"Polygon"===s.type?1:2,h),new un(n,t);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var d=mn({geometry:s.geometries[o],type:"Feature",properties:e.properties},t);d&&l.push(d)}return new Ji(l);case"FeatureCollection":for(o=0,r=s.features.length;o<r;o++){var u=mn(s.features[o],t);u&&l.push(u)}return new Ji(l);default:throw new Error("Invalid GeoJSON object.")}}function fn(e,t,i,n){return e?e(t,i):new nn(i,n&&n.markersInheritOptions&&n)}function yn(e){return new O(e[1],e[0],e[2])}function vn(e,t,i){for(var n,o=[],r=0,s=e.length;r<s;r++)n=t?vn(e[r],t-1,i):(i||yn)(e[r]),o.push(n);return o}function Cn(e,t){return void 0!==(e=F(e)).alt?[h(e.lng,t),h(e.lat,t),h(e.alt,t)]:[h(e.lng,t),h(e.lat,t)]}function In(e,t,i,n){for(var o=[],r=0,s=e.length;r<s;r++)o.push(t?In(e[r],Wi(e[r])?0:t-1,i,n):Cn(e[r],n));return!t&&i&&o.length>0&&o.push(o[0].slice()),o}function bn(e,t){return e.feature?i({},e.feature,{geometry:t}):An(t)}function An(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var wn={toGeoJSON:function(e){return bn(this,{type:"Point",coordinates:Cn(this.getLatLng(),e)})}};function _n(e,t){return new gn(e,t)}nn.include(wn),ln.include(wn),sn.include(wn),hn.include({toGeoJSON:function(e){var t=!Wi(this._latlngs);return bn(this,{type:(t?"Multi":"")+"LineString",coordinates:In(this._latlngs,t?1:0,!1,e)})}}),un.include({toGeoJSON:function(e){var t=!Wi(this._latlngs),i=t&&!Wi(this._latlngs[0]),n=In(this._latlngs,i?2:t?1:0,!0,e);return t||(n=[n]),bn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Xi.include({toMultiPoint:function(e){var t=[];return this.eachLayer((function(i){t.push(i.toGeoJSON(e).geometry.coordinates)})),bn(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var i="GeometryCollection"===t,n=[];return this.eachLayer((function(t){if(t.toGeoJSON){var o=t.toGeoJSON(e);if(i)n.push(o.geometry);else{var r=An(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?bn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var xn=_n,Sn=Ki.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,i){this._url=e,this._bounds=H(t),p(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(bt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ft(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&vt(this._image),this},bringToBack:function(){return this._map&&Ct(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=H(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:mt("img");bt(t,"leaflet-image-layer"),this._zoomAnimated&&bt(t,"leaflet-zoom-animated"),this.options.className&&bt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onload=o(this.fire,this,"load"),t.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e?this._url=t.src:(t.src=this._url,t.alt=this.options.alt)},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Tt(this._image,i,t)},_reset:function(){var e=this._image,t=new N(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=t.getSize();Et(e,t.min),e.style.width=i.x+"px",e.style.height=i.y+"px"},_updateOpacity:function(){xt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),kn=function(e,t,i){return new Sn(e,t,i)},Tn=Sn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:mt("video");if(bt(t,"leaflet-image-layer"),this._zoomAnimated&&bt(t,"leaflet-zoom-animated"),this.options.className&&bt(t,this.options.className),t.onselectstart=c,t.onmousemove=c,t.onloadeddata=o(this.fire,this,"load"),e){for(var i=t.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[t.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=mt("source");a.src=this._url[s],t.appendChild(a)}}}});function En(e,t,i){return new Tn(e,t,i)}var Rn=Sn.extend({_initImage:function(){var e=this._image=this._url;bt(e,"leaflet-image-layer"),this._zoomAnimated&&bt(e,"leaflet-zoom-animated"),this.options.className&&bt(e,this.options.className),e.onselectstart=c,e.onmousemove=c}});function Ln(e,t,i){return new Rn(e,t,i)}var $n=Ki.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof O||y(e))?(this._latlng=F(e),p(this,t)):(p(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return(e=arguments.length?e:this._source._map).hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&xt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&xt(this._container,1),this.bringToFront(),this.options.interactive&&(bt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(xt(this._container,0),this._removeTimeout=setTimeout(o(ft,void 0,this._container),200)):ft(this._container),this.options.interactive&&(At(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=F(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&vt(this._container),this},bringToBack:function(){return this._map&&Ct(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof Ji){t=null;var i=this._source._layers;for(var n in i)if(i[n]._map){t=i[n];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else{if(!t.getBounds)throw new Error("Unable to get source layer LatLng.");e=t.getBounds().getCenter()}return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Et(this._container,e.add(i)):t=t.add(e).add(i);var n=this._containerBottom=-t.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});oi.include({_initOverlay:function(e,t,i,n){var o=t;return o instanceof e||(o=new e(n).setContent(t)),i&&o.setLatLng(i),o}}),Ki.include({_initOverlay:function(e,t,i,n){var o=i;return o instanceof e?(p(o,n),o._source=this):(o=t&&!n?t:new e(n,this)).setContent(i),o}});var Pn=$n.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return!(e=arguments.length?e:this._source._map).hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,$n.prototype.openOn.call(this,e)},onAdd:function(e){$n.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof rn||this._source.on("preclick",zt))},onRemove:function(e){$n.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof rn||this._source.off("preclick",zt))},getEvents:function(){var e=$n.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=mt("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=mt("div",e+"-content-wrapper",t);if(this._contentNode=mt("div",e+"-content",i),Xt(t),Kt(this._contentNode),Ht(t,"contextmenu",zt),this._tipContainer=mt("div",e+"-tip-container",t),this._tip=mt("div",e+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=mt("a",e+"-close-button",t);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',Ht(n,"click",(function(e){Yt(e),this.close()}),this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var i=e.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),t.width=i+1+"px",t.whiteSpace="",t.height="";var n=e.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&n>o?(t.height=o+"px",bt(e,r)):At(e,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),i=this._getAnchor();Et(this._container,t.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var e=this._map,t=parseInt(gt(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+t,n=this._containerWidth,o=new P(this._containerLeft,-i-this._containerBottom);o._add(Rt(this._container));var r=e.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),l=B(this.options.autoPanPaddingBottomRight||s),c=e.getSize(),h=0,d=0;r.x+n+l.x>c.x&&(h=r.x+n-c.x+l.x),r.x-h-a.x<0&&(h=r.x-a.x),r.y+i+l.y>c.y&&(d=r.y+i-c.y+l.y),r.y-d-a.y<0&&(d=r.y-a.y),(h||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([h,d]))}},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Mn=function(e,t){return new Pn(e,t)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(e,t,i){return this._initOverlay(Pn,e,t,i).openOn(this),this},closePopup:function(e){return(e=arguments.length?e:this._popup)&&e.close(),this}}),Ki.include({bindPopup:function(e,t){return this._popup=this._initOverlay(Pn,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Ji||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){Jt(e);var t=e.layer||e.target;this._popup._source!==t||t instanceof rn?(this._popup._source=t,this.openPopup(e.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var Bn=$n.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){$n.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){$n.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=$n.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=mt("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(e),a=this.options.direction,l=o.offsetWidth,c=o.offsetHeight,h=B(this.options.offset),d=this._getAnchor();"top"===a?(t=l/2,i=c):"bottom"===a?(t=l/2,i=0):"center"===a?(t=l/2,i=c/2):"right"===a?(t=0,i=c/2):"left"===a?(t=l,i=c/2):s.x<r.x?(a="right",t=0,i=c/2):(a="left",t=l+2*(h.x+d.x),i=c/2),e=e.subtract(B(t,i,!0)).add(h).add(d),At(o,"leaflet-tooltip-right"),At(o,"leaflet-tooltip-left"),At(o,"leaflet-tooltip-top"),At(o,"leaflet-tooltip-bottom"),bt(o,"leaflet-tooltip-"+a),Et(o,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&xt(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Nn=function(e,t){return new Bn(e,t)};oi.include({openTooltip:function(e,t,i){return this._initOverlay(Bn,e,t,i).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),Ki.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Bn,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t=e?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[t](i),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Ji||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(Ht(t,"focus",(function(){this._tooltip._source=e,this.openTooltip()}),this),Ht(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",(function(){t._openOnceFlag=!1,t._openTooltip(e)}))}else this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)},_moveTooltip:function(e){var t,i,n=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),i=this._map.containerPointToLayerPoint(t),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Wn=Qi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),i=this.options;if(i.html instanceof Element?(yt(t),t.appendChild(i.html)):t.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);t.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});function Zn(e){return new Wn(e)}Qi.Default=en;var Hn=Ki.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ze.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){p(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),ft(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(vt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ct(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof P?e:new P(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,i=this.getPane().children,n=-e(-1/0,1/0),o=0,r=i.length;o<r;o++)t=i[o].style.zIndex,i[o]!==this._container&&t&&(n=e(n,+t));isFinite(n)&&(this.options.zIndex=n+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Ze.ielt9){xt(this._container,this.options.opacity);var e=+new Date,t=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(e-o.loaded)/200);xt(o.el,r),r<1?t=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),t&&(S(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=mt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===e?(this._levels[i].el.style.zIndex=t-Math.abs(e-i),this._onUpdateLevel(i)):(ft(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[e],o=this._map;return n||((n=this._levels[e]={}).el=mt("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=t,n.origin=o.project(o.unproject(o.getPixelOrigin()),e).round(),n.zoom=e,this._setZoomTransform(n,o.getCenter(),o.getZoom()),c(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var e,t,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var n=t.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)ft(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,i,n){var o=Math.floor(e/2),r=Math.floor(t/2),s=i-1,a=new P(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),c=this._tiles[l];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(e,t,i,n){for(var o=2*e;o<2*e+2;o++)for(var r=2*t;r<2*t+2;r++){var s=new P(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,i,n){var o=Math.round(t);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(e),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var i in this._levels)this._setZoomTransform(this._levels[i],e,t)},_setZoomTransform:function(e,t,i){var n=this._map.getZoomScale(i,e.zoom),o=e.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(t,i)).round();Ze.any3d?Tt(e.el,o,n):Et(e.el,o)},_resetGrid:function(){var e=this._map,t=e.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],n).x/i.x),Math.ceil(e.project([0,t.wrapLng[1]],n).x/i.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],n).y/i.x),Math.ceil(e.project([t.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,i=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),n=t.getZoomScale(i,this._tileZoom),o=t.project(e,this._tileZoom).floor(),r=t.getSize().divideBy(2*n);return new N(o.subtract(r),o.add(r))},_update:function(e){var t=this._map;if(t){var i=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(e),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new N(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var h=this._tiles[c].coords;h.z===this._tileZoom&&l.contains(new P(h.x,h.y))||(this._tiles[c].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(e,i);else{for(var d=o.min.y;d<=o.max.y;d++)for(var u=o.min.x;u<=o.max.x;u++){var p=new P(u,d);if(p.z=this._tileZoom,this._isValidTile(p)){var g=this._tiles[this._tileCoordsToKey(p)];g?g.current=!0:s.push(p)}}if(s.sort((function(e,t){return e.distanceTo(r)-t.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(u=0;u<s.length;u++)this._addTile(s[u],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var i=this._globalTileRange;if(!t.wrapLng&&(e.x<i.min.x||e.x>i.max.x)||!t.wrapLat&&(e.y<i.min.y||e.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(e);return H(this.options.bounds).overlaps(n)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,i=this.getTileSize(),n=e.scaleBy(i),o=n.add(i);return[t.unproject(n,e.z),t.unproject(o,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),i=new Z(t[0],t[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),i=new P(+t[0],+t[1]);return i.z=+t[2],i},_removeTile:function(e){var t=this._tiles[e];t&&(ft(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){bt(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=c,e.onmousemove=c,Ze.ielt9&&this.options.opacity<1&&xt(e,this.options.opacity)},_addTile:function(e,t){var i=this._getTilePos(e),n=this._tileCoordsToKey(e),r=this.createTile(this._wrapCoords(e),o(this._tileReady,this,e));this._initTile(r),this.createTile.length<2&&x(o(this._tileReady,this,e,null,r)),Et(r,i),this._tiles[n]={el:r,coords:e,current:!0},t.appendChild(r),this.fire("tileloadstart",{tile:r,coords:e})},_tileReady:function(e,t,i){t&&this.fire("tileerror",{error:t,tile:i,coords:e});var n=this._tileCoordsToKey(e);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(xt(i.el,0),S(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),t||(bt(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ze.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new P(this._wrapX?l(e.x,this._wrapX):e.x,this._wrapY?l(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new N(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function On(e){return new Hn(e)}var Fn=Hn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=p(this,t)).detectRetina&&Ze.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var i=document.createElement("img");return Ht(i,"load",o(this._tileOnLoad,this,t,i)),Ht(i,"error",o(this._tileOnError,this,t,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(e),i},getTileUrl:function(e){var t={r:Ze.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-e.y;this.options.tms&&(t.y=n),t["-y"]=n}return f(this._url,i(t,this.options))},_tileOnLoad:function(e,t){Ze.ielt9?setTimeout(o(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,i){var n=this.options.errorTileUrl;n&&t.getAttribute("src")!==n&&(t.src=n),e(i,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom;return this.options.zoomReverse&&(e=t-e),e+this.options.zoomOffset},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=c,t.onerror=c,!t.complete)){t.src=C;var i=this._tiles[e].coords;ft(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:i})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",C),Hn.prototype._removeTile.call(this,e)},_tileReady:function(e,t,i){if(this._map&&(!i||i.getAttribute("src")!==C))return Hn.prototype._tileReady.call(this,e,t,i)}});function Gn(e,t){return new Fn(e,t)}var Dn=Fn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,t){this._url=e;var n=i({},this.defaultWmsParams);for(var o in t)o in this.options||(n[o]=t[o]);var r=(t=p(this,t)).detectRetina&&Ze.retina?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,Fn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),i=this._crs,n=W(i.project(t[0]),i.project(t[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===ji?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=Fn.prototype.getTileUrl.call(this,e);return a+g(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(e,t){return i(this.wmsParams,e),t||this.redraw(),this}});function Vn(e,t){return new Dn(e,t)}Fn.WMS=Dn,Gn.wms=Vn;var jn=Ki.extend({options:{padding:.1},initialize:function(e){p(this,e),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),bt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var i=this._map.getZoomScale(t,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,t),r=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(e,t));Ze.any3d?Tt(this._container,r,i):Et(this._container,r)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),i=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new N(i,i.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),zn=jn.extend({options:{tolerance:0},getEvents:function(){var e=jn.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){jn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ht(e,"mousemove",this._onMouseMove,this),Ht(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ht(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){S(this._redrawRequest),delete this._ctx,ft(this._container),Ft(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var e=this._bounds,t=this._container,i=e.getSize(),n=Ze.retina?2:1;Et(t,e.min),t.width=n*i.x,t.height=n*i.y,t.style.width=i.x+"px",t.style.height=i.y+"px",Ze.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){jn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[s(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,i=t.next,n=t.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete e._order,delete this._layers[s(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,i,n=e.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(t=Number(n[i]),isNaN(t))return;o.push(t)}e.options._dashArray=o}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new N,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var i=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)e=n.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var i,n,o,r,s=e._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)r=s[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(this._drawing&&!e._empty()){var t=e._point,i=this._ctx,n=Math.max(Math.round(e._radius),1),o=(Math.max(Math.round(e._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(t.x,t.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,e)}},_fillStroke:function(e,t){var i=t.options;i.fill&&(e.globalAlpha=i.fillOpacity,e.fillStyle=i.fillColor||i.color,e.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=i.opacity,e.lineWidth=i.weight,e.strokeStyle=i.color,e.lineCap=i.lineCap,e.lineJoin=i.lineJoin,e.stroke())},_onClick:function(e){for(var t,i,n=this._map.mouseEventToLayerPoint(e),o=this._drawFirst;o;o=o.next)(t=o.layer).options.interactive&&t._containsPoint(n)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(i=t);this._fireEvent(!!i&&[i],e)},_onMouseMove:function(e){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(At(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(t)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(e),n&&(bt(this._container,"leaflet-interactive"),this._fireEvent([n],e,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(e,t,i){this._map._fireDOMEvent(t,i||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var i=t.next,n=t.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e))}},_bringToBack:function(e){var t=e._order;if(t){var i=t.next,n=t.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e))}}});function Kn(e){return Ze.canvas?new zn(e):null}var Xn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Yn={_initContainer:function(){this._container=mt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(jn.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=Xn("shape");bt(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=Xn("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;ft(t),e.removeInteractiveTarget(t),delete this._layers[s(e)]},_updateStyle:function(e){var t=e._stroke,i=e._fill,n=e.options,o=e._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(t||(t=e._stroke=Xn("stroke")),o.appendChild(t),t.weight=n.weight+"px",t.color=n.color,t.opacity=n.opacity,n.dashArray?t.dashStyle=y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=n.lineCap.replace("butt","flat"),t.joinstyle=n.lineJoin):t&&(o.removeChild(t),e._stroke=null),n.fill?(i||(i=e._fill=Xn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),i=Math.round(e._radius),n=Math.round(e._radiusY||i);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+i+","+n+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){vt(e._container)},_bringToBack:function(e){Ct(e._container)}},Jn=Ze.vml?Xn:U,Un=jn.extend({_initContainer:function(){this._container=Jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ft(this._container),Ft(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var e=this._bounds,t=e.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,i.setAttribute("width",t.x),i.setAttribute("height",t.y)),Et(i,e.min),i.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=Jn("path");e.options.className&&bt(t,e.options.className),e.options.interactive&&bt(t,"leaflet-interactive"),this._updateStyle(e),this._layers[s(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){ft(e._path),e.removeInteractiveTarget(e._path),delete this._layers[s(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,i=e.options;t&&(i.stroke?(t.setAttribute("stroke",i.color),t.setAttribute("stroke-opacity",i.opacity),t.setAttribute("stroke-width",i.weight),t.setAttribute("stroke-linecap",i.lineCap),t.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?t.setAttribute("stroke-dasharray",i.dashArray):t.removeAttribute("stroke-dasharray"),i.dashOffset?t.setAttribute("stroke-dashoffset",i.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity),t.setAttribute("fill-rule",i.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,Q(e._parts,t))},_updateCircle:function(e){var t=e._point,i=Math.max(Math.round(e._radius),1),n="a"+i+","+(Math.max(Math.round(e._radiusY),1)||i)+" 0 1,0 ",o=e._empty()?"M0 0":"M"+(t.x-i)+","+t.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(e,o)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){vt(e._path)},_bringToBack:function(e){Ct(e._path)}});function Qn(e){return Ze.svg||Ze.vml?new Un(e):null}Ze.vml&&Un.include(Yn),oi.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&Kn(e)||Qn(e)}});var qn=un.extend({initialize:function(e,t){un.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=H(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function eo(e,t){return new qn(e,t)}Un.create=Jn,Un.pointsToPath=Q,gn.geometryToLayer=mn,gn.coordsToLatLng=yn,gn.coordsToLatLngs=vn,gn.latLngToCoords=Cn,gn.latLngsToCoords=In,gn.getFeature=bn,gn.asFeature=An,oi.mergeOptions({boxZoom:!0});var to=yi.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ht(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ft(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),rt(),$t(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ht(document,{contextmenu:Jt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=mt("div","leaflet-zoom-box",this._container),bt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new N(this._point,this._startPoint),i=t.getSize();Et(this._box,t.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ft(this._box),At(this._container,"leaflet-crosshair")),st(),Pt(),Ft(document,{contextmenu:Jt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var t=new Z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",to),oi.mergeOptions({doubleClickZoom:!0});var io=yi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,i=t.getZoom(),n=t.options.zoomDelta,o=e.originalEvent.shiftKey?i-n:i+n;"center"===t.options.doubleClickZoom?t.setZoom(o):t.setZoomAround(e.containerPoint,o)}});oi.addInitHook("addHandler","doubleClickZoom",io),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var no=yi.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Ii(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}bt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){At(this._map._container,"leaflet-grab"),At(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=H(this._map.options.maxBounds);this._offsetLimit=W(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-t+i)%e+t-i,r=(n+t+i)%e-t-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(e){var t=this._map,i=t.options,n=!i.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),n)t.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=i.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,l),h=a.multiplyBy(c/l),d=c/(i.inertiaDeceleration*s),u=h.multiplyBy(-d/2).round();u.x||u.y?(u=t._limitOffset(u,t.options.maxBounds),x((function(){t.panBy(u,{duration:d,easeLinearity:s,noMoveStart:!0,animate:!0})}))):t.fire("moveend")}}});oi.addInitHook("addHandler","dragging",no),oi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var oo=yi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),Ht(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ft(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,i=e.scrollTop||t.scrollTop,n=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,i,n=this._panKeys={},o=this.keyCodes;for(t=0,i=o.left.length;t<i;t++)n[o.left[t]]=[-1*e,0];for(t=0,i=o.right.length;t<i;t++)n[o.right[t]]=[e,0];for(t=0,i=o.down.length;t<i;t++)n[o.down[t]]=[0,e];for(t=0,i=o.up.length;t<i;t++)n[o.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,i,n=this._zoomKeys={},o=this.keyCodes;for(t=0,i=o.zoomIn.length;t<i;t++)n[o.zoomIn[t]]=e;for(t=0,i=o.zoomOut.length;t<i;t++)n[o.zoomOut[t]]=-e},_addHooks:function(){Ht(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t,i=e.keyCode,n=this._map;if(i in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(t=this._panKeys[i],e.shiftKey&&(t=B(t).multiplyBy(3)),n.options.maxBounds&&(t=n._limitOffset(B(t),n.options.maxBounds)),n.options.worldCopyJump){var o=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(t)));n.panTo(o)}else n.panBy(t)}else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Jt(e)}}});oi.addInitHook("addHandler","keyboard",oo),oi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ro=yi.extend({addHooks:function(){Ht(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=ei(e),i=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Jt(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),i=this._map.options.zoomSnap||0;e._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,s=e._limitZoom(t+(this._delta>0?r:-r))-t;this._delta=0,this._startTime=null,s&&("center"===e.options.scrollWheelZoom?e.setZoom(t+s):e.setZoomAround(this._lastMousePos,t+s))}});oi.addInitHook("addHandler","scrollWheelZoom",ro);var so=600;oi.mergeOptions({tapHold:Ze.touchNative&&Ze.safari&&Ze.mobile,tapTolerance:15});var ao=yi.extend({addHooks:function(){Ht(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new P(t.clientX,t.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(Ht(document,"touchend",Yt),Ht(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),this),so),Ht(document,"touchend touchcancel contextmenu",this._cancel,this),Ht(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Ft(document,"touchend",Yt),Ft(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new P(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var i=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});i._simulated=!0,t.target.dispatchEvent(i)}});oi.addInitHook("addHandler","tapHold",ao),oi.mergeOptions({touchZoom:Ze.touch,bounceAtZoomLimits:!0});var lo=yi.extend({addHooks:function(){bt(this._map._container,"leaflet-touch-zoom"),Ht(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){At(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var i=t.mouseEventToContainerPoint(e.touches[0]),n=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),Ht(document,"touchmove",this._onTouchMove,this),Ht(document,"touchend touchcancel",this._onTouchEnd,this),Yt(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,i=t.mouseEventToContainerPoint(e.touches[0]),n=t.mouseEventToContainerPoint(e.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=t.getScaleZoom(r,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&r<1||this._zoom>t.getMaxZoom()&&r>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),S(this._animRequest);var a=o(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(a,this,!0),Yt(e)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,S(this._animRequest),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});oi.addInitHook("addHandler","touchZoom",lo),oi.BoxZoom=to,oi.DoubleClickZoom=io,oi.Drag=no,oi.Keyboard=oo,oi.ScrollWheelZoom=ro,oi.TapHold=ao,oi.TouchZoom=lo,e.Bounds=N,e.Browser=Ze,e.CRS=D,e.Canvas=zn,e.Circle=ln,e.CircleMarker=sn,e.Class=T,e.Control=si,e.DivIcon=Wn,e.DivOverlay=$n,e.DomEvent=ii,e.DomUtil=Zt,e.Draggable=Ii,e.Evented=$,e.FeatureGroup=Ji,e.GeoJSON=gn,e.GridLayer=Hn,e.Handler=yi,e.Icon=Qi,e.ImageOverlay=Sn,e.LatLng=O,e.LatLngBounds=Z,e.Layer=Ki,e.LayerGroup=Xi,e.LineUtil=Oi,e.Map=oi,e.Marker=nn,e.Mixin=vi,e.Path=rn,e.Point=P,e.PolyUtil=xi,e.Polygon=un,e.Polyline=hn,e.Popup=Pn,e.PosAnimation=ni,e.Projection=Di,e.Rectangle=qn,e.Renderer=jn,e.SVG=Un,e.SVGOverlay=Rn,e.TileLayer=Fn,e.Tooltip=Bn,e.Transformation=K,e.Util=k,e.VideoOverlay=Tn,e.bind=o,e.bounds=W,e.canvas=Kn,e.circle=cn,e.circleMarker=an,e.control=ai,e.divIcon=Zn,e.extend=i,e.featureGroup=Ui,e.geoJSON=_n,e.geoJson=xn,e.gridLayer=On,e.icon=qi,e.imageOverlay=kn,e.latLng=F,e.latLngBounds=H,e.layerGroup=Yi,e.map=ri,e.marker=on,e.point=B,e.polygon=pn,e.polyline=dn,e.popup=Mn,e.rectangle=eo,e.setOptions=p,e.stamp=s,e.svg=Qn,e.svgOverlay=Ln,e.tileLayer=Gn,e.tooltip=Nn,e.transformation=X,e.version=t,e.videoOverlay=En;var co=window.L;e.noConflict=function(){return window.L=co,this},window.L=e}(t)},90220:(e,t,i)=>{"use strict";if(i.r(t),i.d(t,{AttributionControl:()=>o.z,Circle:()=>r.j,CircleMarker:()=>s.p,FeatureGroup:()=>a.m,GeoJSON:()=>l.k,ImageOverlay:()=>c.a,LayerGroup:()=>h.x,LayersControl:()=>d.In,MapConsumer:()=>u.F,MapContainer:()=>p.W,Marker:()=>g.p,Pane:()=>m.Z,Polygon:()=>f.t,Polyline:()=>y.R,Popup:()=>v.z,Rectangle:()=>C.M,SVGOverlay:()=>b.pH,ScaleControl:()=>I.g,TileLayer:()=>A.e,Tooltip:()=>w.m,VideoOverlay:()=>_.O,WMSTileLayer:()=>x.h,ZoomControl:()=>S.p,useMap:()=>n.ko,useMapEvent:()=>n.gY,useMapEvents:()=>n.Po}),/^(198|986)$/.test(i.j))var n=i(5340);if(/^(198|986)$/.test(i.j))var o=i(20572);if(/^(198|986)$/.test(i.j))var r=i(71534);if(/^(198|986)$/.test(i.j))var s=i(32172);if(/^(198|986)$/.test(i.j))var a=i(59895);if(/^(198|986)$/.test(i.j))var l=i(42511);if(/^(198|986)$/.test(i.j))var c=i(69097);if(/^(198|986)$/.test(i.j))var h=i(10286);if(/^(198|986)$/.test(i.j))var d=i(56203);if(/^(198|986)$/.test(i.j))var u=i(78970);if(/^(198|986)$/.test(i.j))var p=i(96711);if(/^(198|986)$/.test(i.j))var g=i(17120);if(/^(198|986)$/.test(i.j))var m=i(69612);if(/^(198|986)$/.test(i.j))var f=i(94830);if(/^(198|986)$/.test(i.j))var y=i(62498);if(/^(198|986)$/.test(i.j))var v=i(11818);if(/^(198|986)$/.test(i.j))var C=i(1093);if(/^(198|986)$/.test(i.j))var I=i(72009);if(/^(198|986)$/.test(i.j))var b=i(96576);if(/^(198|986)$/.test(i.j))var A=i(93633);if(/^(198|986)$/.test(i.j))var w=i(51051);if(/^(198|986)$/.test(i.j))var _=i(40167);if(/^(198|986)$/.test(i.j))var x=i(63688);if(/^(198|986)$/.test(i.j))var S=i(60176)}}]);