formeo 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 4.2.5
4
+ Version: 5.0.1
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
8
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))n(p);new MutationObserver(p=>{for(const h of p)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function t(p){const h={};return p.integrity&&(h.integrity=p.integrity),p.referrerPolicy&&(h.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?h.credentials="include":p.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function n(p){if(p.ep)return;p.ep=!0;const h=t(p);fetch(p.href,h)}})();const fd={"en-US":{"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.type.and":"And","condition.type.if":"If","condition.type.or":"Or","condition.type.then":"Then","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isChecked":"is checked","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.conditions":"+ Condition","panelEditButtons.options":"+ Option",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeMessage:"Remove Element",removeType:"Remove {type}",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"}},pd=fd["en-US"];async function gd(l){try{const e=await fetch(l);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=l.endsWith(".lang")?"text":"json";return await e[t]()}catch(e){throw console.error("There has been a problem with your fetch operation:",e),e}}const fa={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Yt{constructor(e=fa){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...fa,...e},p=t.replace(/\/?$/,"/");this.config={location:p,...n};const{override:h,preloaded:g={}}=this.config,m=Object.entries(this.langs).concat(Object.entries(h||g));this.langs=m.reduce((c,[d,r])=>(c[d]=this.applyLanguage(d,r),c),{}),this.locale=this.config.locale||this.config.langs[0]}init(e){return this.processConfig({...this.config,...e}),this.setCurrent(this.locale)}addLanguage(e,t={}){t=typeof t=="string"?Yt.processFile(t):t,this.applyLanguage(e,t),this.config.langs.push("locale")}getValue(e,t=this.locale){var n;return((n=this.langs[t])==null?void 0:n[e])||this.getFallbackValue(e)}getFallbackValue(e){const t=Object.values(this.langs).find(n=>n[e]);return t?.[e]}makeSafe(e){const t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/[{}|]/g,n=>t[n]),new RegExp(e,"g")}put(e,t){return this.current[e]=t,t}get(e,t){const n=this;let p=this.getValue(e);if(!p)return;const h=p.match(/\{[^}]+?\}/g);if(t&&h)if(typeof t=="object")for(const g of h){const m=g.substring(1,g.length-1);p=p.replace(n.makeSafe(g),t[m]||"")}else p=p.replace(/\{[^}]+?\}/g,t);return p}static processFile(e){return Yt.fromFile(e.replace(/\n\n/g,`
8
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))n(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function t(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function n(d){if(d.ep)return;d.ep=!0;const h=t(d);fetch(d.href,h)}})();const pd={"en-US":{"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.type.and":"And","condition.type.if":"If","condition.type.or":"Or","condition.type.then":"Then","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isChecked":"is checked","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.conditions":"+ Condition","panelEditButtons.options":"+ Option",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeMessage:"Remove Element",removeType:"Remove {type}",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"}},gd=pd["en-US"];async function md(l){try{const e=await fetch(l);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=l.endsWith(".lang")?"text":"json";return await e[t]()}catch(e){throw console.error("There has been a problem with your fetch operation:",e),e}}const ma={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Xt{constructor(e=ma){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...ma,...e},d=t.replace(/\/?$/,"/");this.config={location:d,...n};const{override:h,preloaded:g={}}=this.config,m=Object.entries(this.langs).concat(Object.entries(h||g));this.langs=m.reduce((c,[f,r])=>(c[f]=this.applyLanguage(f,r),c),{}),this.locale=this.config.locale||this.config.langs[0]}init(e){return this.processConfig({...this.config,...e}),this.setCurrent(this.locale)}addLanguage(e,t={}){t=typeof t=="string"?Xt.processFile(t):t,this.applyLanguage(e,t),this.config.langs.push("locale")}getValue(e,t=this.locale){var n;return((n=this.langs[t])==null?void 0:n[e])||this.getFallbackValue(e)}getFallbackValue(e){const t=Object.values(this.langs).find(n=>n[e]);return t?.[e]}makeSafe(e){const t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/[{}|]/g,n=>t[n]),new RegExp(e,"g")}put(e,t){return this.current[e]=t,t}get(e,t){const n=this;let d=this.getValue(e);if(!d)return;const h=d.match(/\{[^}]+?\}/g);if(t&&h)if(typeof t=="object")for(const g of h){const m=g.substring(1,g.length-1);d=d.replace(n.makeSafe(g),t[m]||"")}else d=d.replace(/\{[^}]+?\}/g,t);return d}static processFile(e){return Xt.fromFile(e.replace(/\n\n/g,`
9
9
  `))}static fromFile(e){const t=e.split(`
10
- `),n={};for(let p,h=0;h<t.length;h++)p=/^(.+?) *?= *?([^\n]+)/.exec(t[h]),p&&(n[p[1]]=p[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(p,h){if(n.loaded.indexOf(e)!==-1&&t)return n.applyLanguage(n.langs[e]),p(n.langs[e]);{const g=[n.config.location,e,n.config.extension].join("");return gd(g).then(m=>{const c=Yt.processFile(m);return n.applyLanguage(e,c),n.loaded.push(e),p(n.langs[e])}).catch(m=>{console.error(m);const c=n.applyLanguage(e);p(c)})}})}applyLanguage(e,t={}){const n=this.config.override[e]||{},p=this.langs[e]||{};return this.langs[e]={...p,...t,...n},this.langs[e]}get getLangs(){return this.config.langs}async setCurrent(e="en-US"){return await this.loadLang(e),this.locale=e,this.current=this.langs[e],this.current}}const X=new Yt;(function(){try{if(typeof document<"u"){var l=document.createElement("style");l.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(l)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var md=Object.defineProperty,vd=(l,e,t)=>e in l?md(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Ye=(l,e,t)=>vd(l,typeof e!="symbol"?e+"":e,t);const yd="_3x4ZIcu-",bd="JIt36hCJ",Ht={tooltip:yd,visible:bd},wd={triggerName:"tooltip"};class Bu{constructor(e=wd){Ye(this,"triggerName"),Ye(this,"tooltip"),Ye(this,"activeTriggerType",null),Ye(this,"spacing",12),Ye(this,"handleClick",t=>{const n=this.triggerName,p=t.target.closest(`[${n}][${n}-type="click"]`);if(p)if(this.isVisible())this.hide();else{const h=p.getAttribute(`${n}`);this.show(p,h),this.activeTriggerType="click"}else this.hide()}),Ye(this,"handleMouseOver",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"){const h=p?.getAttribute(`${n}`);h&&(this.show(p,h),this.activeTriggerType="hover")}}),Ye(this,"handleMouseOut",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Ye(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Ye(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),this.triggerName=`data-${e.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${Ht.tooltip}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(Ht.visible)}calculatePosition(e){const t=e.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),p=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return p.find(h=>this.fitsInViewport(h,n))||p[0]}fitsInViewport(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight?[[e.x,e.y],[e.x+t.width,e.y],[e.x,e.y+t.height],[e.x+t.width,e.y+t.height],[e.x+t.width/2,e.y+t.height/2]].flatMap(([m,c])=>Array.from(document.elementsFromPoint(m,c))).filter(m=>{if(this.tooltip.contains(m)||m===this.tooltip||m.classList.contains(Ht.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Ht.visible);const n=this.calculatePosition(e);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(Ht.visible),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}window!==void 0&&(window.SmartTooltip=Bu);const Cd="formeo",Sd="4.2.5",ju={name:Cd,version:Sd};var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ot(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ii,pa;function Ad(){if(pa)return ii;pa=1;function l(){this.__data__=[],this.size=0}return ii=l,ii}var ri,ga;function sn(){if(ga)return ri;ga=1;function l(e,t){return e===t||e!==e&&t!==t}return ri=l,ri}var oi,ma;function Wn(){if(ma)return oi;ma=1;var l=sn();function e(t,n){for(var p=t.length;p--;)if(l(t[p][0],n))return p;return-1}return oi=e,oi}var si,va;function $d(){if(va)return si;va=1;var l=Wn(),e=Array.prototype,t=e.splice;function n(p){var h=this.__data__,g=l(h,p);if(g<0)return!1;var m=h.length-1;return g==m?h.pop():t.call(h,g,1),--this.size,!0}return si=n,si}var ai,ya;function xd(){if(ya)return ai;ya=1;var l=Wn();function e(t){var n=this.__data__,p=l(n,t);return p<0?void 0:n[p][1]}return ai=e,ai}var li,ba;function Md(){if(ba)return li;ba=1;var l=Wn();function e(t){return l(this.__data__,t)>-1}return li=e,li}var ci,wa;function Ed(){if(wa)return ci;wa=1;var l=Wn();function e(t,n){var p=this.__data__,h=l(p,t);return h<0?(++this.size,p.push([t,n])):p[h][1]=n,this}return ci=e,ci}var ui,Ca;function zn(){if(Ca)return ui;Ca=1;var l=Ad(),e=$d(),t=xd(),n=Md(),p=Ed();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,ui=h,ui}var hi,Sa;function _d(){if(Sa)return hi;Sa=1;var l=zn();function e(){this.__data__=new l,this.size=0}return hi=e,hi}var di,Aa;function Td(){if(Aa)return di;Aa=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return di=l,di}var fi,$a;function Ld(){if($a)return fi;$a=1;function l(e){return this.__data__.get(e)}return fi=l,fi}var pi,xa;function Rd(){if(xa)return pi;xa=1;function l(e){return this.__data__.has(e)}return pi=l,pi}var gi,Ma;function Vu(){if(Ma)return gi;Ma=1;var l=typeof un=="object"&&un&&un.Object===Object&&un;return gi=l,gi}var mi,Ea;function Ke(){if(Ea)return mi;Ea=1;var l=Vu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return mi=t,mi}var vi,_a;function Bn(){if(_a)return vi;_a=1;var l=Ke(),e=l.Symbol;return vi=e,vi}var yi,Ta;function kd(){if(Ta)return yi;Ta=1;var l=Bn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,p=l?l.toStringTag:void 0;function h(g){var m=t.call(g,p),c=g[p];try{g[p]=void 0;var d=!0}catch{}var r=n.call(g);return d&&(m?g[p]=c:delete g[p]),r}return yi=h,yi}var bi,La;function Dd(){if(La)return bi;La=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return bi=t,bi}var wi,Ra;function It(){if(Ra)return wi;Ra=1;var l=Bn(),e=kd(),t=Dd(),n="[object Null]",p="[object Undefined]",h=l?l.toStringTag:void 0;function g(m){return m==null?m===void 0?p:n:h&&h in Object(m)?e(m):t(m)}return wi=g,wi}var Ci,ka;function ut(){if(ka)return Ci;ka=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Ci=l,Ci}var Si,Da;function Rs(){if(Da)return Si;Da=1;var l=It(),e=ut(),t="[object AsyncFunction]",n="[object Function]",p="[object GeneratorFunction]",h="[object Proxy]";function g(m){if(!e(m))return!1;var c=l(m);return c==n||c==p||c==t||c==h}return Si=g,Si}var Ai,Oa;function Od(){if(Oa)return Ai;Oa=1;var l=Ke(),e=l["__core-js_shared__"];return Ai=e,Ai}var $i,Ia;function Id(){if(Ia)return $i;Ia=1;var l=Od(),e=(function(){var n=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return $i=t,$i}var xi,Na;function Uu(){if(Na)return xi;Na=1;var l=Function.prototype,e=l.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return xi=t,xi}var Mi,Fa;function Nd(){if(Fa)return Mi;Fa=1;var l=Rs(),e=Id(),t=ut(),n=Uu(),p=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,c=g.toString,d=m.hasOwnProperty,r=RegExp("^"+c.call(d).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o(a){if(!t(a)||e(a))return!1;var s=l(a)?r:h;return s.test(n(a))}return Mi=o,Mi}var Ei,Pa;function Fd(){if(Pa)return Ei;Pa=1;function l(e,t){return e?.[t]}return Ei=l,Ei}var _i,Ha;function bt(){if(Ha)return _i;Ha=1;var l=Nd(),e=Fd();function t(n,p){var h=e(n,p);return l(h)?h:void 0}return _i=t,_i}var Ti,Wa;function ks(){if(Wa)return Ti;Wa=1;var l=bt(),e=Ke(),t=l(e,"Map");return Ti=t,Ti}var Li,za;function jn(){if(za)return Li;za=1;var l=bt(),e=l(Object,"create");return Li=e,Li}var Ri,Ba;function Pd(){if(Ba)return Ri;Ba=1;var l=jn();function e(){this.__data__=l?l(null):{},this.size=0}return Ri=e,Ri}var ki,ja;function Hd(){if(ja)return ki;ja=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return ki=l,ki}var Di,Va;function Wd(){if(Va)return Di;Va=1;var l=jn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function p(h){var g=this.__data__;if(l){var m=g[h];return m===e?void 0:m}return n.call(g,h)?g[h]:void 0}return Di=p,Di}var Oi,Ua;function zd(){if(Ua)return Oi;Ua=1;var l=jn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var h=this.__data__;return l?h[p]!==void 0:t.call(h,p)}return Oi=n,Oi}var Ii,Ga;function Bd(){if(Ga)return Ii;Ga=1;var l=jn(),e="__lodash_hash_undefined__";function t(n,p){var h=this.__data__;return this.size+=this.has(n)?0:1,h[n]=l&&p===void 0?e:p,this}return Ii=t,Ii}var Ni,qa;function jd(){if(qa)return Ni;qa=1;var l=Pd(),e=Hd(),t=Wd(),n=zd(),p=Bd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,Ni=h,Ni}var Fi,Ka;function Vd(){if(Ka)return Fi;Ka=1;var l=jd(),e=zn(),t=ks();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return Fi=n,Fi}var Pi,Ya;function Ud(){if(Ya)return Pi;Ya=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Pi=l,Pi}var Hi,Za;function Vn(){if(Za)return Hi;Za=1;var l=Ud();function e(t,n){var p=t.__data__;return l(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Hi=e,Hi}var Wi,Xa;function Gd(){if(Xa)return Wi;Xa=1;var l=Vn();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return Wi=e,Wi}var zi,Qa;function qd(){if(Qa)return zi;Qa=1;var l=Vn();function e(t){return l(this,t).get(t)}return zi=e,zi}var Bi,Ja;function Kd(){if(Ja)return Bi;Ja=1;var l=Vn();function e(t){return l(this,t).has(t)}return Bi=e,Bi}var ji,el;function Yd(){if(el)return ji;el=1;var l=Vn();function e(t,n){var p=l(this,t),h=p.size;return p.set(t,n),this.size+=p.size==h?0:1,this}return ji=e,ji}var Vi,tl;function Ds(){if(tl)return Vi;tl=1;var l=Vd(),e=Gd(),t=qd(),n=Kd(),p=Yd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,Vi=h,Vi}var Ui,nl;function Zd(){if(nl)return Ui;nl=1;var l=zn(),e=ks(),t=Ds(),n=200;function p(h,g){var m=this.__data__;if(m instanceof l){var c=m.__data__;if(!e||c.length<n-1)return c.push([h,g]),this.size=++m.size,this;m=this.__data__=new t(c)}return m.set(h,g),this.size=m.size,this}return Ui=p,Ui}var Gi,il;function Gu(){if(il)return Gi;il=1;var l=zn(),e=_d(),t=Td(),n=Ld(),p=Rd(),h=Zd();function g(m){var c=this.__data__=new l(m);this.size=c.size}return g.prototype.clear=e,g.prototype.delete=t,g.prototype.get=n,g.prototype.has=p,g.prototype.set=h,Gi=g,Gi}var qi,rl;function qu(){if(rl)return qi;rl=1;var l=bt(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return qi=e,qi}var Ki,ol;function Os(){if(ol)return Ki;ol=1;var l=qu();function e(t,n,p){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:p,writable:!0}):t[n]=p}return Ki=e,Ki}var Yi,sl;function Ku(){if(sl)return Yi;sl=1;var l=Os(),e=sn();function t(n,p,h){(h!==void 0&&!e(n[p],h)||h===void 0&&!(p in n))&&l(n,p,h)}return Yi=t,Yi}var Zi,al;function Xd(){if(al)return Zi;al=1;function l(e){return function(t,n,p){for(var h=-1,g=Object(t),m=p(t),c=m.length;c--;){var d=m[e?c:++h];if(n(g[d],d,g)===!1)break}return t}}return Zi=l,Zi}var Xi,ll;function Qd(){if(ll)return Xi;ll=1;var l=Xd(),e=l();return Xi=e,Xi}var jt={exports:{}};jt.exports;var cl;function Jd(){return cl||(cl=1,(function(l,e){var t=Ke(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,h=p&&p.exports===n,g=h?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function c(d,r){if(r)return d.slice();var o=d.length,a=m?m(o):new d.constructor(o);return d.copy(a),a}l.exports=c})(jt,jt.exports)),jt.exports}var Qi,ul;function Yu(){if(ul)return Qi;ul=1;var l=Ke(),e=l.Uint8Array;return Qi=e,Qi}var Ji,hl;function ef(){if(hl)return Ji;hl=1;var l=Yu();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return Ji=e,Ji}var er,dl;function tf(){if(dl)return er;dl=1;var l=ef();function e(t,n){var p=n?l(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return er=e,er}var tr,fl;function nf(){if(fl)return tr;fl=1;function l(e,t){var n=-1,p=e.length;for(t||(t=Array(p));++n<p;)t[n]=e[n];return t}return tr=l,tr}var nr,pl;function rf(){if(pl)return nr;pl=1;var l=ut(),e=Object.create,t=(function(){function n(){}return function(p){if(!l(p))return{};if(e)return e(p);n.prototype=p;var h=new n;return n.prototype=void 0,h}})();return nr=t,nr}var ir,gl;function Zu(){if(gl)return ir;gl=1;function l(e,t){return function(n){return e(t(n))}}return ir=l,ir}var rr,ml;function Xu(){if(ml)return rr;ml=1;var l=Zu(),e=l(Object.getPrototypeOf,Object);return rr=e,rr}var or,vl;function Is(){if(vl)return or;vl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||l;return t===p}return or=e,or}var sr,yl;function of(){if(yl)return sr;yl=1;var l=rf(),e=Xu(),t=Is();function n(p){return typeof p.constructor=="function"&&!t(p)?l(e(p)):{}}return sr=n,sr}var ar,bl;function wt(){if(bl)return ar;bl=1;function l(e){return e!=null&&typeof e=="object"}return ar=l,ar}var lr,wl;function sf(){if(wl)return lr;wl=1;var l=It(),e=wt(),t="[object Arguments]";function n(p){return e(p)&&l(p)==t}return lr=n,lr}var cr,Cl;function Qu(){if(Cl)return cr;Cl=1;var l=sf(),e=wt(),t=Object.prototype,n=t.hasOwnProperty,p=t.propertyIsEnumerable,h=l((function(){return arguments})())?l:function(g){return e(g)&&n.call(g,"callee")&&!p.call(g,"callee")};return cr=h,cr}var ur,Sl;function Ct(){if(Sl)return ur;Sl=1;var l=Array.isArray;return ur=l,ur}var hr,Al;function Ju(){if(Al)return hr;Al=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return hr=e,hr}var dr,$l;function Un(){if($l)return dr;$l=1;var l=Rs(),e=Ju();function t(n){return n!=null&&e(n.length)&&!l(n)}return dr=t,dr}var fr,xl;function af(){if(xl)return fr;xl=1;var l=Un(),e=wt();function t(n){return e(n)&&l(n)}return fr=t,fr}var Vt={exports:{}},pr,Ml;function lf(){if(Ml)return pr;Ml=1;function l(){return!1}return pr=l,pr}Vt.exports;var El;function Ns(){return El||(El=1,(function(l,e){var t=Ke(),n=lf(),p=e&&!e.nodeType&&e,h=p&&!0&&l&&!l.nodeType&&l,g=h&&h.exports===p,m=g?t.Buffer:void 0,c=m?m.isBuffer:void 0,d=c||n;l.exports=d})(Vt,Vt.exports)),Vt.exports}var gr,_l;function cf(){if(_l)return gr;_l=1;var l=It(),e=Xu(),t=wt(),n="[object Object]",p=Function.prototype,h=Object.prototype,g=p.toString,m=h.hasOwnProperty,c=g.call(Object);function d(r){if(!t(r)||l(r)!=n)return!1;var o=e(r);if(o===null)return!0;var a=m.call(o,"constructor")&&o.constructor;return typeof a=="function"&&a instanceof a&&g.call(a)==c}return gr=d,gr}var mr,Tl;function uf(){if(Tl)return mr;Tl=1;var l=It(),e=Ju(),t=wt(),n="[object Arguments]",p="[object Array]",h="[object Boolean]",g="[object Date]",m="[object Error]",c="[object Function]",d="[object Map]",r="[object Number]",o="[object Object]",a="[object RegExp]",s="[object Set]",i="[object String]",u="[object WeakMap]",f="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",M="[object Float64Array]",$="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",_="[object Uint32Array]",D={};D[b]=D[M]=D[$]=D[A]=D[S]=D[E]=D[R]=D[L]=D[_]=!0,D[n]=D[p]=D[f]=D[h]=D[y]=D[g]=D[m]=D[c]=D[d]=D[r]=D[o]=D[a]=D[s]=D[i]=D[u]=!1;function w(v){return t(v)&&e(v.length)&&!!D[l(v)]}return mr=w,mr}var vr,Ll;function hf(){if(Ll)return vr;Ll=1;function l(e){return function(t){return e(t)}}return vr=l,vr}var Ut={exports:{}};Ut.exports;var Rl;function df(){return Rl||(Rl=1,(function(l,e){var t=Vu(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,h=p&&p.exports===n,g=h&&t.process,m=(function(){try{var c=p&&p.require&&p.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();l.exports=m})(Ut,Ut.exports)),Ut.exports}var yr,kl;function Fs(){if(kl)return yr;kl=1;var l=uf(),e=hf(),t=df(),n=t&&t.isTypedArray,p=n?e(n):l;return yr=p,yr}var br,Dl;function eh(){if(Dl)return br;Dl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return br=l,br}var wr,Ol;function th(){if(Ol)return wr;Ol=1;var l=Os(),e=sn(),t=Object.prototype,n=t.hasOwnProperty;function p(h,g,m){var c=h[g];(!(n.call(h,g)&&e(c,m))||m===void 0&&!(g in h))&&l(h,g,m)}return wr=p,wr}var Cr,Il;function ff(){if(Il)return Cr;Il=1;var l=th(),e=Os();function t(n,p,h,g){var m=!h;h||(h={});for(var c=-1,d=p.length;++c<d;){var r=p[c],o=g?g(h[r],n[r],r,h,n):void 0;o===void 0&&(o=n[r]),m?e(h,r,o):l(h,r,o)}return h}return Cr=t,Cr}var Sr,Nl;function pf(){if(Nl)return Sr;Nl=1;function l(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return Sr=l,Sr}var Ar,Fl;function Ps(){if(Fl)return Ar;Fl=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,p){var h=typeof n;return p=p??l,!!p&&(h=="number"||h!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<p}return Ar=t,Ar}var $r,Pl;function nh(){if(Pl)return $r;Pl=1;var l=pf(),e=Qu(),t=Ct(),n=Ns(),p=Ps(),h=Fs(),g=Object.prototype,m=g.hasOwnProperty;function c(d,r){var o=t(d),a=!o&&e(d),s=!o&&!a&&n(d),i=!o&&!a&&!s&&h(d),u=o||a||s||i,f=u?l(d.length,String):[],y=f.length;for(var b in d)(r||m.call(d,b))&&!(u&&(b=="length"||s&&(b=="offset"||b=="parent")||i&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||p(b,y)))&&f.push(b);return f}return $r=c,$r}var xr,Hl;function gf(){if(Hl)return xr;Hl=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return xr=l,xr}var Mr,Wl;function mf(){if(Wl)return Mr;Wl=1;var l=ut(),e=Is(),t=gf(),n=Object.prototype,p=n.hasOwnProperty;function h(g){if(!l(g))return t(g);var m=e(g),c=[];for(var d in g)d=="constructor"&&(m||!p.call(g,d))||c.push(d);return c}return Mr=h,Mr}var Er,zl;function ih(){if(zl)return Er;zl=1;var l=nh(),e=mf(),t=Un();function n(p){return t(p)?l(p,!0):e(p)}return Er=n,Er}var _r,Bl;function vf(){if(Bl)return _r;Bl=1;var l=ff(),e=ih();function t(n){return l(n,e(n))}return _r=t,_r}var Tr,jl;function yf(){if(jl)return Tr;jl=1;var l=Ku(),e=Jd(),t=tf(),n=nf(),p=of(),h=Qu(),g=Ct(),m=af(),c=Ns(),d=Rs(),r=ut(),o=cf(),a=Fs(),s=eh(),i=vf();function u(f,y,b,M,$,A,S){var E=s(f,b),R=s(y,b),L=S.get(R);if(L){l(f,b,L);return}var _=A?A(E,R,b+"",f,y,S):void 0,D=_===void 0;if(D){var w=g(R),v=!w&&c(R),C=!w&&!v&&a(R);_=R,w||v||C?g(E)?_=E:m(E)?_=n(E):v?(D=!1,_=e(R,!0)):C?(D=!1,_=t(R,!0)):_=[]:o(R)||h(R)?(_=E,h(E)?_=i(E):(!r(E)||d(E))&&(_=p(R))):D=!1}D&&(S.set(R,_),$(_,R,M,A,S),S.delete(R)),l(f,b,_)}return Tr=u,Tr}var Lr,Vl;function bf(){if(Vl)return Lr;Vl=1;var l=Gu(),e=Ku(),t=Qd(),n=yf(),p=ut(),h=ih(),g=eh();function m(c,d,r,o,a){c!==d&&t(d,function(s,i){if(a||(a=new l),p(s))n(c,d,i,r,m,o,a);else{var u=o?o(g(c,i),s,i+"",c,d,a):void 0;u===void 0&&(u=s),e(c,i,u)}},h)}return Lr=m,Lr}var Rr,Ul;function rh(){if(Ul)return Rr;Ul=1;function l(e){return e}return Rr=l,Rr}var kr,Gl;function wf(){if(Gl)return kr;Gl=1;function l(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return kr=l,kr}var Dr,ql;function Cf(){if(ql)return Dr;ql=1;var l=wf(),e=Math.max;function t(n,p,h){return p=e(p===void 0?n.length-1:p,0),function(){for(var g=arguments,m=-1,c=e(g.length-p,0),d=Array(c);++m<c;)d[m]=g[p+m];m=-1;for(var r=Array(p+1);++m<p;)r[m]=g[m];return r[p]=h(d),l(n,this,r)}}return Dr=t,Dr}var Or,Kl;function Sf(){if(Kl)return Or;Kl=1;function l(e){return function(){return e}}return Or=l,Or}var Ir,Yl;function Af(){if(Yl)return Ir;Yl=1;var l=Sf(),e=qu(),t=rh(),n=e?function(p,h){return e(p,"toString",{configurable:!0,enumerable:!1,value:l(h),writable:!0})}:t;return Ir=n,Ir}var Nr,Zl;function $f(){if(Zl)return Nr;Zl=1;var l=800,e=16,t=Date.now;function n(p){var h=0,g=0;return function(){var m=t(),c=e-(m-g);if(g=m,c>0){if(++h>=l)return arguments[0]}else h=0;return p.apply(void 0,arguments)}}return Nr=n,Nr}var Fr,Xl;function xf(){if(Xl)return Fr;Xl=1;var l=Af(),e=$f(),t=e(l);return Fr=t,Fr}var Pr,Ql;function Mf(){if(Ql)return Pr;Ql=1;var l=rh(),e=Cf(),t=xf();function n(p,h){return t(e(p,h,l),p+"")}return Pr=n,Pr}var Hr,Jl;function Ef(){if(Jl)return Hr;Jl=1;var l=sn(),e=Un(),t=Ps(),n=ut();function p(h,g,m){if(!n(m))return!1;var c=typeof g;return(c=="number"?e(m)&&t(g,m.length):c=="string"&&g in m)?l(m[g],h):!1}return Hr=p,Hr}var Wr,ec;function _f(){if(ec)return Wr;ec=1;var l=Mf(),e=Ef();function t(n){return l(function(p,h){var g=-1,m=h.length,c=m>1?h[m-1]:void 0,d=m>2?h[2]:void 0;for(c=n.length>3&&typeof c=="function"?(m--,c):void 0,d&&e(h[0],h[1],d)&&(c=m<3?void 0:c,m=1),p=Object(p);++g<m;){var r=h[g];r&&n(p,r,g,c)}return p})}return Wr=t,Wr}var zr,tc;function Tf(){if(tc)return zr;tc=1;var l=bf(),e=_f(),t=e(function(n,p,h,g){l(n,p,h,g)});return zr=t,zr}var Lf=Tf();const Rf=Ot(Lf),kf=()=>crypto.randomUUID().slice(0,8),Df=()=>kf().slice(0,8),nc=(l="",e)=>{if(!e)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof e=="string"?[e]:e;n=n.map(h=>h==="*"?"":h.replace(t,"\\$&"));let p=!0;return n.length&&(p=!new RegExp(n.join("|"),"i").exec(l)),p},Of=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(Yf);return e&&qf[e[0]]},mt=l=>Array.from(new Set(l)),He=l=>l?.attrs?.id||l?.id||Df(),Ve=(l,e)=>Rf({},l,e,(n,p)=>{if(Array.isArray(n))return p!=null?mt(n.concat(p)):p;if(Array.isArray(p))return n!=null?mt(p.concat(n)):p}),Je=l=>{let e;const t=l instanceof Promise;if(l===null||!(typeof l=="object")||t)return l;if(l instanceof Date)return e=new Date,e.setTime(l.getTime()),e;if(Array.isArray(l)){e=[];for(let p=0,h=l.length;p<h;p++)e[p]=Je(l[p]);return e}if(l instanceof Object){e={};for(const p in l)Object.hasOwn(l,p)&&(e[p]=Je(l[p]));return e}throw new Error("Unable to copy Object, type not supported.")},Br=(l,e)=>l/e*100,ws=l=>`${l.toString()}%`,oh=Object.create(null,{get:{value:l=>{const e=window.sessionStorage?.getItem(l);try{return JSON.parse(e)}catch{return e}}},set:{value:(l,e)=>{try{return window.sessionStorage?.setItem(l,JSON.stringify(e))}catch(t){console.error(t)}}}}),Pe=l=>/^(stage|row|column|field)s./.test(l),If=l=>jf.test(l);function Nf(l,e=Vs){let t=0;return function(...n){const p=Date.now();p-t>=e&&(t=p,l.apply(this,n))}}function _n(l,e=vt){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>l.apply(this,n),e)}}function Cs(l){return l}function Ss(){}function Gn(l=Object.create(null)){if(typeof l=="string")try{return JSON.parse(l)}catch(e){return console.error("Invalid JSON string provided:",e),Object.create(null)}return l}const Mt=l=>l?Je(Gn(l)):Tn();function sh(l,e,t,n={}){if(!e||!l[t][e])return n;const p=`${t}.${e}`;n[p]=l[t][e];const h=Qf.get(t);if(h){const g=l[t][e].data?.children||[];for(const m of g)sh(l,m,h,n)}return n}const Ff='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acprefix__rect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="acprefix__layer1"><g id="acprefix__text4203"><g id="acprefix__g4212" transform="translate(0.10112835,0.1001358)"><path id="acprefix__path4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acprefix__path4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agprefix__rect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="aiprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="aiprefix__rect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol fill="#000000" viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqprefix__g4220"><rect id="aqprefix__rect4191" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqprefix__g4220-6"><rect id="aqprefix__rect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><path d="M2 7h2v2H2zM7 7h2v2H7zM12 7h2v2h-2zM2 12h2v2H2zM7 12h2v2H7zM12 12h2v2h-2z" transform="rotate(90 9.25 9.25)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><path d="M9.5-6.5h2v2h-2zm-5 0h2v2h-2zm5-5h2v2h-2zm-5 0h2v2h-2z" transform="rotate(90)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Zm10-5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-stage" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5h2v2H2zM7 4.5h2v2H7zM12 4.5h2v2h-2zM2 9.5h2v2H2zM7 9.5h2v2H7zM12 9.5h2v2h-2zM2-.5h2v2H2zM7-.5h2v2H7zM12-.5h2v2h-2z" transform="translate(0 2.5)"/></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="arprefix__icomoon-ignore"/><path fill="#000" d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h1v-1H0Zm15-7h1V4h-1zm-1 7h1v-1h-1zm-2 0h1v-1h-1zm-2 0h1v-1h-1Zm-2 0h1v-1H8Zm-2 0h1v-1H6Zm-2 0h1v-1H4Zm-2 0h1v-1H2Zm13-1h1v-1h-1ZM0 10h1V9H0Zm15-1h1V8h-1ZM0 8h1V7H0Zm15-1h1V6h-1ZM0 6h1V5H0Zm13-1h1V4h-1zm-2 0h1V4h-1ZM9 5h1V4H9ZM7 5h1V4H7ZM5 5h1V4H5ZM3 5h1V4H3ZM1 5h1V4H1Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 32 32" id="f-i-info-circle" xmlns="http://www.w3.org/2000/svg"><path d="m17.962 24.725 1.806.096v2.531h-7.534v-2.406l1.045-.094c.568-.063.916-.254.916-1.014v-8.801c0-.699-.188-.92-.791-.92l-1.106-.062v-2.626h5.666zM15.747 4.648c1.394 0 2.405 1.047 2.405 2.374 0 1.331-1.014 2.313-2.438 2.313-1.454 0-2.404-.982-2.404-2.313 0-1.327.95-2.374 2.437-2.374M16 32C7.178 32 0 24.822 0 16S7.178 0 16 0c8.82 0 16 7.178 16 16s-7.18 16-16 16m0-29C8.832 3 3 8.832 3 16s5.832 13 13 13 13-5.832 13-13S23.168 3 16 3"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="avprefix__icomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L18 12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><metadata id="axprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="3440" inkscape:window-height="1416" id="axprefix__namedview6" showgrid="false" inkscape:zoom="1.84375" inkscape:cx="421.4312" inkscape:cy="218.56484" inkscape:window-x="0" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"/><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z" id="axprefix__path4" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:connector-curvature="0" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:nodetypes="ccccccccccc"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-plus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12H18M12 6V18" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><path d="M193.694-139.2h87.322v510.916h-87.322zM-18.103 159.92V72.597h510.915v87.322z" transform="rotate(45 77.994 208.636)"/></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="bfprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="bfprefix__g7209"><path id="bfprefix__rect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bgprefix__XMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bhprefix__icomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="biprefix__XMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bjprefix__XMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="boprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',Hs=ju.name,Ws=ju.version,qn=Hs,Pf="formeo-sprite",Hf=null,Wf=`https://cdn.jsdelivr.net/npm/formeo@${Ws}/dist/${Pf}.svg`,zf=`https://cdn.jsdelivr.net/npm/formeo@${Ws}/dist/formeo.min.css`,ic="https://draggable.github.io/formeo/assets/css/formeo.min.css",ah="f-panel",lt="control-group",Nt=`${qn}-stage`,et=`${qn}-row`,tt=`${qn}-column`,Ft=`${qn}-field`,As="custom-column-widths",lh="column-preset",jr="resizing-columns",Bf=new Map([[Nt,et],[et,tt],[tt,Ft]]),zs=["stage","row","column","field"],Bs=zs.map(l=>`${l}s`);new Map(Bs.map((l,e)=>[l,zs[e]]));const jf=new RegExp(`^${Bs.join("|")}.`),ch=[...zs],Vf=[...Bs],Uf=new Map(Vf.map((l,e)=>[l,ch[e]])),Vr=ch.reduce((l,e)=>(l[e]=e,l),{}),Gf=[{name:"controls",className:lt},{name:"stage",className:Nt},{name:"row",className:et},{name:"column",className:tt},{name:"field",className:Ft}],js={controls:lt,stage:Nt,row:et,column:tt,field:Ft},qf=Object.entries(js).reduce((l,[e,t])=>(l[t]=e,l),{}),Kf=Object.values(js),Yf=new RegExp(`${Kf.join("|")}`,"g"),{childTypeMapVals:uh,childTypeIndexMapVals:Zf}=Gf.reduce((l,{name:e},t,n)=>{const{name:p}=n[t+1]||{};return p&&(l.childTypeMapVals.push([e,p]),l.childTypeIndexMapVals.push([`${e}s`,`${p}s`])),l},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Xf=uh.slice().map(l=>l.slice().reverse()).reverse(),rc=new Map(uh),Qf=new Map(Zf),Jf=new Map(Xf.slice()),ep=[[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]],tp=new Map(ep.reduce((l,e,t)=>(l.push([t,e]),l),[])),hh=`${Hs}-formData`,oc=`${Hs}-locale`,Ze=333,vt=Math.round(Ze/2),Vs=Math.round(Ze*2),dh="formeoSaved",nn="formeoUpdated",np="formeoChanged",fh="formeoUpdatedStage",ph="formeoUpdatedRow",gh="formeoUpdatedColumn",mh="formeoUpdatedField",ip="formeoCleared",vh="formeoOnRender",rp="formeoConditionUpdated",Us="formeoAddedRow",Gs="formeoAddedColumn",qs="formeoAddedField",Ks="formeoRemovedRow",Ys="formeoRemovedColumn",Zs="formeoRemovedField",yh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},op={and:"&&",or:"||"},bh={equals:"="},sp=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],sc=["isChecked","isNotChecked"],ac=["isVisible","isNotVisible"],yn=["value"],ap={comparison:yh,assignment:bh,logical:op},wh="if",lp="then",Xs=()=>({[wh]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[lp]:[{target:"",targetProperty:"",assignment:"",value:""}]}),cp=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,$s=/\bcol-\w+-\d+/g,Ch="f-i-",Tn=()=>({id:He(),stages:{[He()]:{}},rows:{},columns:{},fields:{}}),Ln=["selected","checked"],up=Ln.toReversed(),hp=new Map([["config",new Set(["label","helpText","hideLabel","labelAfter","disableHtmlLabel","tooltip"])]]),dp="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(l=>String.raw`\s${l}\s`),fp=new RegExp(String.raw`(?!${dp.join("|")})\w\S*`,"g"),pp=/\s+/g;function Xe(l){return typeof l!="string"||l.trim().match(pp)?l:l.replace(fp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const Sh=(l,e="-")=>l.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),yt=l=>{if(Array.isArray(l))return l;const e=/[.[\]]/g,t=[];let n=0,p=e.exec(l);for(;p!==null;)t.push(l.slice(n,p.index)),n=p.index+p[0].length,p=e.exec(l);return n<l.length&&t.push(l.slice(n)),t.filter(Boolean)},lc=(l,e="-")=>yt(l).join(e),gp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},mp=(l,e,t="…")=>{if(l.length<=e)return l;const n=l.slice(0,e),p=n.lastIndexOf(" ");let h=`${p>0?n.slice(0,p):n}`;return t&&(h+=t),h},vp=/^attrs\.|^meta\.|^options\.|^config\./g;function Rn(l){return l.replaceAll(vp,"")}var Ur,cc;function Qs(){if(cc)return Ur;cc=1;var l=It(),e=wt(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&l(p)==t}return Ur=n,Ur}var Gr,uc;function yp(){if(uc)return Gr;uc=1;var l=Ct(),e=Qs(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function p(h,g){if(l(h))return!1;var m=typeof h;return m=="number"||m=="symbol"||m=="boolean"||h==null||e(h)?!0:n.test(h)||!t.test(h)||g!=null&&h in Object(g)}return Gr=p,Gr}var qr,hc;function bp(){if(hc)return qr;hc=1;var l=Ds(),e="Expected a function";function t(n,p){if(typeof n!="function"||p!=null&&typeof p!="function")throw new TypeError(e);var h=function(){var g=arguments,m=p?p.apply(this,g):g[0],c=h.cache;if(c.has(m))return c.get(m);var d=n.apply(this,g);return h.cache=c.set(m,d)||c,d};return h.cache=new(t.Cache||l),h}return t.Cache=l,qr=t,qr}var Kr,dc;function wp(){if(dc)return Kr;dc=1;var l=bp(),e=500;function t(n){var p=l(n,function(g){return h.size===e&&h.clear(),g}),h=p.cache;return p}return Kr=t,Kr}var Yr,fc;function Cp(){if(fc)return Yr;fc=1;var l=wp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=l(function(p){var h=[];return p.charCodeAt(0)===46&&h.push(""),p.replace(e,function(g,m,c,d){h.push(c?d.replace(t,"$1"):m||g)}),h});return Yr=n,Yr}var Zr,pc;function Sp(){if(pc)return Zr;pc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,h=Array(p);++n<p;)h[n]=t(e[n],n,e);return h}return Zr=l,Zr}var Xr,gc;function Ap(){if(gc)return Xr;gc=1;var l=Bn(),e=Sp(),t=Ct(),n=Qs(),p=l?l.prototype:void 0,h=p?p.toString:void 0;function g(m){if(typeof m=="string")return m;if(t(m))return e(m,g)+"";if(n(m))return h?h.call(m):"";var c=m+"";return c=="0"&&1/m==-1/0?"-0":c}return Xr=g,Xr}var Qr,mc;function Kn(){if(mc)return Qr;mc=1;var l=Ap();function e(t){return t==null?"":l(t)}return Qr=e,Qr}var Jr,vc;function Ah(){if(vc)return Jr;vc=1;var l=Ct(),e=yp(),t=Cp(),n=Kn();function p(h,g){return l(h)?h:e(h,g)?[h]:t(n(h))}return Jr=p,Jr}var eo,yc;function $h(){if(yc)return eo;yc=1;var l=Qs();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return eo=e,eo}var to,bc;function $p(){if(bc)return to;bc=1;var l=Ah(),e=$h();function t(n,p){p=l(p,n);for(var h=0,g=p.length;n!=null&&h<g;)n=n[e(p[h++])];return h&&h==g?n:void 0}return to=t,to}var no,wc;function xp(){if(wc)return no;wc=1;var l=$p();function e(t,n,p){var h=t==null?void 0:l(t,n);return h===void 0?p:h}return no=e,no}var Mp=xp();const Ep=Ot(Mp);var io,Cc;function _p(){if(Cc)return io;Cc=1;var l=th(),e=Ah(),t=Ps(),n=ut(),p=$h();function h(g,m,c,d){if(!n(g))return g;m=e(m,g);for(var r=-1,o=m.length,a=o-1,s=g;s!=null&&++r<o;){var i=p(m[r]),u=c;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=a){var f=s[i];u=d?d(f,i,s):void 0,u===void 0&&(u=n(f)?f:t(m[r+1])?[]:{})}l(s,i,u),s=s[i]}return g}return io=h,io}var ro,Sc;function Tp(){if(Sc)return ro;Sc=1;var l=_p();function e(t,n,p){return t==null?t:l(t,n,p)}return ro=e,ro}var Lp=Tp();const Rp=Ot(Lp),Re=Ep,Yn=Rp;function kp(l,e={}){const t={...l};for(const n in e)Object.hasOwn(e,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(e[n]):t[n]=[t[n],e[n]]:t[n]=e[n]);return t}function bn(...l){return l.flat().reduce((e,t)=>(e[t]=t,e),{})}var oo,Ac;function Dp(){if(Ac)return oo;Ac=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return oo=e,oo}var so,$c;function Op(){if($c)return so;$c=1;function l(e){return this.__data__.has(e)}return so=l,so}var ao,xc;function Ip(){if(xc)return ao;xc=1;var l=Ds(),e=Dp(),t=Op();function n(p){var h=-1,g=p==null?0:p.length;for(this.__data__=new l;++h<g;)this.add(p[h])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,ao=n,ao}var lo,Mc;function Np(){if(Mc)return lo;Mc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length;++n<p;)if(t(e[n],n,e))return!0;return!1}return lo=l,lo}var co,Ec;function Fp(){if(Ec)return co;Ec=1;function l(e,t){return e.has(t)}return co=l,co}var uo,_c;function xh(){if(_c)return uo;_c=1;var l=Ip(),e=Np(),t=Fp(),n=1,p=2;function h(g,m,c,d,r,o){var a=c&n,s=g.length,i=m.length;if(s!=i&&!(a&&i>s))return!1;var u=o.get(g),f=o.get(m);if(u&&f)return u==m&&f==g;var y=-1,b=!0,M=c&p?new l:void 0;for(o.set(g,m),o.set(m,g);++y<s;){var $=g[y],A=m[y];if(d)var S=a?d(A,$,y,m,g,o):d($,A,y,g,m,o);if(S!==void 0){if(S)continue;b=!1;break}if(M){if(!e(m,function(E,R){if(!t(M,R)&&($===E||r($,E,c,d,o)))return M.push(R)})){b=!1;break}}else if(!($===A||r($,A,c,d,o))){b=!1;break}}return o.delete(g),o.delete(m),b}return uo=h,uo}var ho,Tc;function Pp(){if(Tc)return ho;Tc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p,h){n[++t]=[h,p]}),n}return ho=l,ho}var fo,Lc;function Hp(){if(Lc)return fo;Lc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return fo=l,fo}var po,Rc;function Wp(){if(Rc)return po;Rc=1;var l=Bn(),e=Yu(),t=sn(),n=xh(),p=Pp(),h=Hp(),g=1,m=2,c="[object Boolean]",d="[object Date]",r="[object Error]",o="[object Map]",a="[object Number]",s="[object RegExp]",i="[object Set]",u="[object String]",f="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",M=l?l.prototype:void 0,$=M?M.valueOf:void 0;function A(S,E,R,L,_,D,w){switch(R){case b:if(S.byteLength!=E.byteLength||S.byteOffset!=E.byteOffset)return!1;S=S.buffer,E=E.buffer;case y:return!(S.byteLength!=E.byteLength||!D(new e(S),new e(E)));case c:case d:case a:return t(+S,+E);case r:return S.name==E.name&&S.message==E.message;case s:case u:return S==E+"";case o:var v=p;case i:var C=L&g;if(v||(v=h),S.size!=E.size&&!C)return!1;var x=w.get(S);if(x)return x==E;L|=m,w.set(S,E);var T=n(v(S),v(E),L,_,D,w);return w.delete(S),T;case f:if($)return $.call(S)==$.call(E)}return!1}return po=A,po}var go,kc;function zp(){if(kc)return go;kc=1;function l(e,t){for(var n=-1,p=t.length,h=e.length;++n<p;)e[h+n]=t[n];return e}return go=l,go}var mo,Dc;function Bp(){if(Dc)return mo;Dc=1;var l=zp(),e=Ct();function t(n,p,h){var g=p(n);return e(n)?g:l(g,h(n))}return mo=t,mo}var vo,Oc;function jp(){if(Oc)return vo;Oc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,h=0,g=[];++n<p;){var m=e[n];t(m,n,e)&&(g[h++]=m)}return g}return vo=l,vo}var yo,Ic;function Vp(){if(Ic)return yo;Ic=1;function l(){return[]}return yo=l,yo}var bo,Nc;function Up(){if(Nc)return bo;Nc=1;var l=jp(),e=Vp(),t=Object.prototype,n=t.propertyIsEnumerable,p=Object.getOwnPropertySymbols,h=p?function(g){return g==null?[]:(g=Object(g),l(p(g),function(m){return n.call(g,m)}))}:e;return bo=h,bo}var wo,Fc;function Gp(){if(Fc)return wo;Fc=1;var l=Zu(),e=l(Object.keys,Object);return wo=e,wo}var Co,Pc;function qp(){if(Pc)return Co;Pc=1;var l=Is(),e=Gp(),t=Object.prototype,n=t.hasOwnProperty;function p(h){if(!l(h))return e(h);var g=[];for(var m in Object(h))n.call(h,m)&&m!="constructor"&&g.push(m);return g}return Co=p,Co}var So,Hc;function Kp(){if(Hc)return So;Hc=1;var l=nh(),e=qp(),t=Un();function n(p){return t(p)?l(p):e(p)}return So=n,So}var Ao,Wc;function Yp(){if(Wc)return Ao;Wc=1;var l=Bp(),e=Up(),t=Kp();function n(p){return l(p,t,e)}return Ao=n,Ao}var $o,zc;function Zp(){if(zc)return $o;zc=1;var l=Yp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function p(h,g,m,c,d,r){var o=m&e,a=l(h),s=a.length,i=l(g),u=i.length;if(s!=u&&!o)return!1;for(var f=s;f--;){var y=a[f];if(!(o?y in g:n.call(g,y)))return!1}var b=r.get(h),M=r.get(g);if(b&&M)return b==g&&M==h;var $=!0;r.set(h,g),r.set(g,h);for(var A=o;++f<s;){y=a[f];var S=h[y],E=g[y];if(c)var R=o?c(E,S,y,g,h,r):c(S,E,y,h,g,r);if(!(R===void 0?S===E||d(S,E,m,c,r):R)){$=!1;break}A||(A=y=="constructor")}if($&&!A){var L=h.constructor,_=g.constructor;L!=_&&"constructor"in h&&"constructor"in g&&!(typeof L=="function"&&L instanceof L&&typeof _=="function"&&_ instanceof _)&&($=!1)}return r.delete(h),r.delete(g),$}return $o=p,$o}var xo,Bc;function Xp(){if(Bc)return xo;Bc=1;var l=bt(),e=Ke(),t=l(e,"DataView");return xo=t,xo}var Mo,jc;function Qp(){if(jc)return Mo;jc=1;var l=bt(),e=Ke(),t=l(e,"Promise");return Mo=t,Mo}var Eo,Vc;function Jp(){if(Vc)return Eo;Vc=1;var l=bt(),e=Ke(),t=l(e,"Set");return Eo=t,Eo}var _o,Uc;function eg(){if(Uc)return _o;Uc=1;var l=bt(),e=Ke(),t=l(e,"WeakMap");return _o=t,_o}var To,Gc;function tg(){if(Gc)return To;Gc=1;var l=Xp(),e=ks(),t=Qp(),n=Jp(),p=eg(),h=It(),g=Uu(),m="[object Map]",c="[object Object]",d="[object Promise]",r="[object Set]",o="[object WeakMap]",a="[object DataView]",s=g(l),i=g(e),u=g(t),f=g(n),y=g(p),b=h;return(l&&b(new l(new ArrayBuffer(1)))!=a||e&&b(new e)!=m||t&&b(t.resolve())!=d||n&&b(new n)!=r||p&&b(new p)!=o)&&(b=function(M){var $=h(M),A=$==c?M.constructor:void 0,S=A?g(A):"";if(S)switch(S){case s:return a;case i:return m;case u:return d;case f:return r;case y:return o}return $}),To=b,To}var Lo,qc;function ng(){if(qc)return Lo;qc=1;var l=Gu(),e=xh(),t=Wp(),n=Zp(),p=tg(),h=Ct(),g=Ns(),m=Fs(),c=1,d="[object Arguments]",r="[object Array]",o="[object Object]",a=Object.prototype,s=a.hasOwnProperty;function i(u,f,y,b,M,$){var A=h(u),S=h(f),E=A?r:p(u),R=S?r:p(f);E=E==d?o:E,R=R==d?o:R;var L=E==o,_=R==o,D=E==R;if(D&&g(u)){if(!g(f))return!1;A=!0,L=!1}if(D&&!L)return $||($=new l),A||m(u)?e(u,f,y,b,M,$):t(u,f,E,y,b,M,$);if(!(y&c)){var w=L&&s.call(u,"__wrapped__"),v=_&&s.call(f,"__wrapped__");if(w||v){var C=w?u.value():u,x=v?f.value():f;return $||($=new l),M(C,x,y,b,$)}}return D?($||($=new l),n(u,f,y,b,M,$)):!1}return Lo=i,Lo}var Ro,Kc;function ig(){if(Kc)return Ro;Kc=1;var l=ng(),e=wt();function t(n,p,h,g,m){return n===p?!0:n==null||p==null||!e(n)&&!e(p)?n!==n&&p!==p:l(n,p,h,g,t,m)}return Ro=t,Ro}var ko,Yc;function rg(){if(Yc)return ko;Yc=1;var l=ig();function e(t,n){return l(t,n)}return ko=e,ko}var og=rg();const xs=Ot(og),sg=(l,e)=>l===void 0?"added":e===void 0?"removed":xs(l,e)?"unchanged":"changed";class Js{constructor(e,t=Object.create(null)){this.name=e,this.data=t,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,t)=>JSON.stringify(e,null,t);get=e=>Re(this.data,e);set(e,t){const n=Re(this.data,e),p=Yn(this.data,e,t),h=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(h)),m={newVal:t,oldVal:n,path:e};for(const c of g)for(const d of this.setCallbacks[c])d(m);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:p,changeType:sg(n,t),src:this.dom};if(n&&(c.previousValue=n),J.formeoUpdated(c),this.name){const r={stage:fh,row:ph,column:gh,field:mh}[this.name];r&&J.formeoUpdated(c,r)}}return p}addSetCallback(e,t){this.setCallbacks[e]?this.setCallbacks[e].push(t):this.setCallbacks[e]=[t]}removeSetCallback(e,t){this.setCallbacks[e]=this.setCallbacks[e].filter(n=>n!==t)}add=(e,t=Object.create(null))=>{const{id:n}=t,p=e||n||He();return this.set(p,t)};remove=e=>{const t=yt(e),n=t.pop(),p=this.get(t);return Array.isArray(p)?p.splice(Number(n),1):p&&delete p[n],p};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[t,n])=>(e[t]=n?.data?n.getData():n,e),{});setCallbacks={};configVal=Object.create(null)}class Zn extends Js{load=e=>{const t=Gn(e);this.empty();for(const[n,p]of Object.entries(t))this.add(n,p);return this.data};get=e=>e?Re(this.data,e):this.add();add=(e,t=Object.create(null))=>{const n=e||He(),p=this.Component({...t,id:n});this.data[n]=p,this.active=p;const g={row:Us,column:Gs,field:qs}[this.name];return g&&J.formeoUpdated({entity:p,componentId:n,componentType:this.name,data:p.data},g),p};remove=e=>{if(Array.isArray(e))for(const t of e)this.get(t).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const t=Object.values(this.data).map(n=>n.empty(e));return Promise.all(t)};set config(e){this.configVal=Ve(this.configVal,Je(e))}get config(){return this.configVal}conditionMap=new Map}function Zc(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(l);e&&(n=n.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),t.push.apply(t,n)}return t}function qe(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zc(Object(t),!0).forEach(function(n){ag(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):Zc(Object(t)).forEach(function(n){Object.defineProperty(l,n,Object.getOwnPropertyDescriptor(t,n))})}return l}function wn(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wn=function(e){return typeof e}:wn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wn(l)}function ag(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function nt(){return nt=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(l[n]=t[n])}return l},nt.apply(this,arguments)}function lg(l,e){if(l==null)return{};var t={},n=Object.keys(l),p,h;for(h=0;h<n.length;h++)p=n[h],!(e.indexOf(p)>=0)&&(t[p]=l[p]);return t}function cg(l,e){if(l==null)return{};var t=lg(l,e),n,p;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);for(p=0;p<h.length;p++)n=h[p],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(l,n)&&(t[n]=l[n])}return t}var ug="1.15.3";function Qe(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var rt=Qe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),an=Qe(/Edge/i),Xc=Qe(/firefox/i),Zt=Qe(/safari/i)&&!Qe(/chrome/i)&&!Qe(/android/i),Mh=Qe(/iP(ad|od|hone)/i),Eh=Qe(/chrome/i)&&Qe(/android/i),_h={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!rt&&_h)}function oe(l,e,t){l.removeEventListener(e,t,!rt&&_h)}function kn(l,e){if(e){if(e[0]===">"&&(e=e.substring(1)),l)try{if(l.matches)return l.matches(e);if(l.msMatchesSelector)return l.msMatchesSelector(e);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(e)}catch{return!1}return!1}}function Th(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function je(l,e,t,n){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&kn(l,e):kn(l,e))||n&&l===t)return l;if(l===t)break}while(l=Th(l))}return null}var Qc=/\s+/g;function Oe(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(Qc," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(Qc," ")}}function ne(l,e,t){var n=l&&l.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(t=l.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function Tt(l,e){var t="";if(typeof l=="string")t=l;else do{var n=ne(l,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(l=l.parentNode));var p=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return p&&new p(t)}function Lh(l,e,t){if(l){var n=l.getElementsByTagName(e),p=0,h=n.length;if(t)for(;p<h;p++)t(n[p],p);return n}return[]}function Ge(){var l=document.scrollingElement;return l||document.documentElement}function we(l,e,t,n,p){if(!(!l.getBoundingClientRect&&l!==window)){var h,g,m,c,d,r,o;if(l!==window&&l.parentNode&&l!==Ge()?(h=l.getBoundingClientRect(),g=h.top,m=h.left,c=h.bottom,d=h.right,r=h.height,o=h.width):(g=0,m=0,c=window.innerHeight,d=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&l!==window&&(p=p||l.parentNode,!rt))do if(p&&p.getBoundingClientRect&&(ne(p,"transform")!=="none"||t&&ne(p,"position")!=="static")){var a=p.getBoundingClientRect();g-=a.top+parseInt(ne(p,"border-top-width")),m-=a.left+parseInt(ne(p,"border-left-width")),c=g+h.height,d=m+h.width;break}while(p=p.parentNode);if(n&&l!==window){var s=Tt(p||l),i=s&&s.a,u=s&&s.d;s&&(g/=u,m/=i,o/=i,r/=u,c=g+r,d=m+o)}return{top:g,left:m,bottom:c,right:d,width:o,height:r}}}function Jc(l,e,t){for(var n=at(l,!0),p=we(l)[e];n;){var h=we(n)[t],g=void 0;if(g=p>=h,!g)return n;if(n===Ge())break;n=at(n,!1)}return!1}function Rt(l,e,t,n){for(var p=0,h=0,g=l.children;h<g.length;){if(g[h].style.display!=="none"&&g[h]!==te.ghost&&(n||g[h]!==te.dragged)&&je(g[h],t.draggable,l,!1)){if(p===e)return g[h];p++}h++}return null}function ea(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!kn(t,e));)t=t.previousElementSibling;return t||null}function Fe(l,e){var t=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==te.clone&&(!e||kn(l,e))&&t++;return t}function eu(l){var e=0,t=0,n=Ge();if(l)do{var p=Tt(l),h=p.a,g=p.d;e+=l.scrollLeft*h,t+=l.scrollTop*g}while(l!==n&&(l=l.parentNode));return[e,t]}function hg(l,e){for(var t in l)if(l.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===l[t][n])return Number(t)}return-1}function at(l,e){if(!l||!l.getBoundingClientRect)return Ge();var t=l,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var p=ne(t);if(t.clientWidth<t.scrollWidth&&(p.overflowX=="auto"||p.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(p.overflowY=="auto"||p.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Ge();if(n||e)return t;n=!0}}while(t=t.parentNode);return Ge()}function dg(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function Do(l,e){return Math.round(l.top)===Math.round(e.top)&&Math.round(l.left)===Math.round(e.left)&&Math.round(l.height)===Math.round(e.height)&&Math.round(l.width)===Math.round(e.width)}var Xt;function Rh(l,e){return function(){if(!Xt){var t=arguments,n=this;t.length===1?l.call(n,t[0]):l.apply(n,t),Xt=setTimeout(function(){Xt=void 0},e)}}}function fg(){clearTimeout(Xt),Xt=void 0}function kh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Dh(l){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(l).cloneNode(!0):t?t(l).clone(!0)[0]:l.cloneNode(!0)}function Oh(l,e,t){var n={};return Array.from(l.children).forEach(function(p){var h,g,m,c;if(!(!je(p,e.draggable,l,!1)||p.animated||p===t)){var d=we(p);n.left=Math.min((h=n.left)!==null&&h!==void 0?h:1/0,d.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,d.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,d.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,d.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var ke="Sortable"+new Date().getTime();function pg(){var l=[],e;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(p){if(!(ne(p,"display")==="none"||p===te.ghost)){l.push({target:p,rect:we(p)});var h=qe({},l[l.length-1].rect);if(p.thisAnimationDuration){var g=Tt(p,!0);g&&(h.top-=g.f,h.left-=g.e)}p.fromRect=h}})}},addAnimationState:function(n){l.push(n)},removeAnimationState:function(n){l.splice(hg(l,{target:n}),1)},animateAll:function(n){var p=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var h=!1,g=0;l.forEach(function(m){var c=0,d=m.target,r=d.fromRect,o=we(d),a=d.prevFromRect,s=d.prevToRect,i=m.rect,u=Tt(d,!0);u&&(o.top-=u.f,o.left-=u.e),d.toRect=o,d.thisAnimationDuration&&Do(a,o)&&!Do(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=mg(i,a,s,p.options)),Do(o,r)||(d.prevFromRect=r,d.prevToRect=o,c||(c=p.options.animation),p.animate(d,i,o,c)),c&&(h=!0,g=Math.max(g,c),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},c),d.thisAnimationDuration=c)}),clearTimeout(e),h?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),l=[]},animate:function(n,p,h,g){if(g){ne(n,"transition",""),ne(n,"transform","");var m=Tt(this.el),c=m&&m.a,d=m&&m.d,r=(p.left-h.left)/(c||1),o=(p.top-h.top)/(d||1);n.animatingX=!!r,n.animatingY=!!o,ne(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=gg(n),ne(n,"transition","transform "+g+"ms"+(this.options.easing?" "+this.options.easing:"")),ne(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ne(n,"transition",""),ne(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},g)}}}}function gg(l){return l.offsetWidth}function mg(l,e,t,n){return Math.sqrt(Math.pow(e.top-l.top,2)+Math.pow(e.left-l.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var St=[],Oo={initializeByDefault:!0},ln={mount:function(e){for(var t in Oo)Oo.hasOwnProperty(t)&&!(t in e)&&(e[t]=Oo[t]);St.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),St.push(e)},pluginEvent:function(e,t,n){var p=this;this.eventCanceled=!1,n.cancel=function(){p.eventCanceled=!0};var h=e+"Global";St.forEach(function(g){t[g.pluginName]&&(t[g.pluginName][h]&&t[g.pluginName][h](qe({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](qe({sortable:t},n)))})},initializePlugins:function(e,t,n,p){St.forEach(function(m){var c=m.pluginName;if(!(!e.options[c]&&!m.initializeByDefault)){var d=new m(e,t,e.options);d.sortable=e,d.options=e.options,e[c]=d,nt(n,d.defaults)}});for(var h in e.options)if(e.options.hasOwnProperty(h)){var g=this.modifyOption(e,h,e.options[h]);typeof g<"u"&&(e.options[h]=g)}},getEventProperties:function(e,t){var n={};return St.forEach(function(p){typeof p.eventProperties=="function"&&nt(n,p.eventProperties.call(t[p.pluginName],e))}),n},modifyOption:function(e,t,n){var p;return St.forEach(function(h){e[h.pluginName]&&h.optionListeners&&typeof h.optionListeners[t]=="function"&&(p=h.optionListeners[t].call(e[h.pluginName],n))}),p}};function vg(l){var e=l.sortable,t=l.rootEl,n=l.name,p=l.targetEl,h=l.cloneEl,g=l.toEl,m=l.fromEl,c=l.oldIndex,d=l.newIndex,r=l.oldDraggableIndex,o=l.newDraggableIndex,a=l.originalEvent,s=l.putSortable,i=l.extraEventProperties;if(e=e||t&&t[ke],!!e){var u,f=e.options,y="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!rt&&!an?u=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(n,!0,!0)),u.to=g||t,u.from=m||t,u.item=p||t,u.clone=h,u.oldIndex=c,u.newIndex=d,u.oldDraggableIndex=r,u.newDraggableIndex=o,u.originalEvent=a,u.pullMode=s?s.lastPutMode:void 0;var b=qe(qe({},i),ln.getEventProperties(n,e));for(var M in b)u[M]=b[M];t&&t.dispatchEvent(u),f[y]&&f[y].call(e,u)}}var yg=["evt"],Te=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,h=cg(n,yg);ln.pluginEvent.bind(te)(e,t,qe({dragEl:q,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:gt,lastDownEl:Cn,cloneEl:pe,cloneHidden:st,dragStarted:Gt,putSortable:Se,activeSortable:te.active,originalEvent:p,oldIndex:Et,oldDraggableIndex:Qt,newIndex:Ie,newDraggableIndex:ot,hideGhostForTarget:Ph,unhideGhostForTarget:Hh,cloneNowHidden:function(){st=!0},cloneNowShown:function(){st=!1},dispatchSortableEvent:function(m){Me({sortable:t,name:m,originalEvent:p})}},h))};function Me(l){vg(qe({putSortable:Se,cloneEl:pe,targetEl:q,rootEl:fe,oldIndex:Et,oldDraggableIndex:Qt,newIndex:Ie,newDraggableIndex:ot},l))}var q,ve,ie,fe,gt,Cn,pe,st,Et,Ie,Qt,ot,hn,Se,$t=!1,Dn=!1,On=[],ft,ze,Io,No,tu,nu,Gt,At,Jt,en=!1,dn=!1,Sn,Ae,Fo=[],Ms=!1,In=[],Xn=typeof document<"u",fn=Mh,iu=an||rt?"cssFloat":"float",bg=Xn&&!Eh&&!Mh&&"draggable"in document.createElement("div"),Ih=(function(){if(Xn){if(rt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Nh=function(e,t){var n=ne(e),p=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),h=Rt(e,0,t),g=Rt(e,1,t),m=h&&ne(h),c=g&&ne(g),d=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+we(h).width,r=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+we(g).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(h&&m.float&&m.float!=="none"){var o=m.float==="left"?"left":"right";return g&&(c.clear==="both"||c.clear===o)?"vertical":"horizontal"}return h&&(m.display==="block"||m.display==="flex"||m.display==="table"||m.display==="grid"||d>=p&&n[iu]==="none"||g&&n[iu]==="none"&&d+r>p)?"vertical":"horizontal"},wg=function(e,t,n){var p=n?e.left:e.top,h=n?e.right:e.bottom,g=n?e.width:e.height,m=n?t.left:t.top,c=n?t.right:t.bottom,d=n?t.width:t.height;return p===m||h===c||p+g/2===m+d/2},Cg=function(e,t){var n;return On.some(function(p){var h=p[ke].options.emptyInsertThreshold;if(!(!h||ea(p))){var g=we(p),m=e>=g.left-h&&e<=g.right+h,c=t>=g.top-h&&t<=g.bottom+h;if(m&&c)return n=p}}),n},Fh=function(e){function t(h,g){return function(m,c,d,r){var o=m.options.group.name&&c.options.group.name&&m.options.group.name===c.options.group.name;if(h==null&&(g||o))return!0;if(h==null||h===!1)return!1;if(g&&h==="clone")return h;if(typeof h=="function")return t(h(m,c,d,r),g)(m,c,d,r);var a=(g?m:c).options.group.name;return h===!0||typeof h=="string"&&h===a||h.join&&h.indexOf(a)>-1}}var n={},p=e.group;(!p||wn(p)!="object")&&(p={name:p}),n.name=p.name,n.checkPull=t(p.pull,!0),n.checkPut=t(p.put),n.revertClone=p.revertClone,e.group=n},Ph=function(){!Ih&&ie&&ne(ie,"display","none")},Hh=function(){!Ih&&ie&&ne(ie,"display","")};Xn&&!Eh&&document.addEventListener("click",function(l){if(Dn)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),Dn=!1,!1},!0);var pt=function(e){if(q){e=e.touches?e.touches[0]:e;var t=Cg(e.clientX,e.clientY);if(t){var n={};for(var p in e)e.hasOwnProperty(p)&&(n[p]=e[p]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[ke]._onDragOver(n)}}},Sg=function(e){q&&q.parentNode[ke]._isOutsideThisEl(e.target)};function te(l,e){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=e=nt({},e),l[ke]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nh(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,m){g.setData("Text",m.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:te.supportPointer!==!1&&"PointerEvent"in window&&!Zt,emptyInsertThreshold:5};ln.initializePlugins(this,l,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Fh(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:bg,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?se(l,"pointerdown",this._onTapStart):(se(l,"mousedown",this._onTapStart),se(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(se(l,"dragover",this),se(l,"dragenter",this)),On.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),nt(this,pg())}te.prototype={constructor:te,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(At=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,q):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,p=this.options,h=p.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(m||e).target,d=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,r=p.filter;if(Lg(n),!q&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||p.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Zt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=je(c,p.draggable,n,!1),!(c&&c.animated)&&Cn!==c)){if(Et=Fe(c),Qt=Fe(c,p.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Me({sortable:t,rootEl:d,name:"filter",targetEl:c,toEl:n,fromEl:n}),Te("filter",t,{evt:e}),h&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=je(d,o.trim(),n,!1),o)return Me({sortable:t,rootEl:o,name:"filter",targetEl:c,fromEl:n,toEl:n}),Te("filter",t,{evt:e}),!0}),r)){h&&e.cancelable&&e.preventDefault();return}p.handle&&!je(d,p.handle,n,!1)||this._prepareDragStart(e,m,c)}}},_prepareDragStart:function(e,t,n){var p=this,h=p.el,g=p.options,m=h.ownerDocument,c;if(n&&!q&&n.parentNode===h){var d=we(n);if(fe=h,q=n,ve=q.parentNode,gt=q.nextSibling,Cn=n,hn=g.group,te.dragged=q,ft={target:q,clientX:(t||e).clientX,clientY:(t||e).clientY},tu=ft.clientX-d.left,nu=ft.clientY-d.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,q.style["will-change"]="all",c=function(){if(Te("delayEnded",p,{evt:e}),te.eventCanceled){p._onDrop();return}p._disableDelayedDragEvents(),!Xc&&p.nativeDraggable&&(q.draggable=!0),p._triggerDragStart(e,t),Me({sortable:p,name:"choose",originalEvent:e}),Oe(q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){Lh(q,r.trim(),Po)}),se(m,"dragover",pt),se(m,"mousemove",pt),se(m,"touchmove",pt),se(m,"mouseup",p._onDrop),se(m,"touchend",p._onDrop),se(m,"touchcancel",p._onDrop),Xc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),Te("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(an||rt))){if(te.eventCanceled){this._onDrop();return}se(m,"mouseup",p._disableDelayedDrag),se(m,"touchend",p._disableDelayedDrag),se(m,"touchcancel",p._disableDelayedDrag),se(m,"mousemove",p._delayedDragTouchMoveHandler),se(m,"touchmove",p._delayedDragTouchMoveHandler),g.supportPointer&&se(m,"pointermove",p._delayedDragTouchMoveHandler),p._dragStartTimer=setTimeout(c,g.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){q&&Po(q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._disableDelayedDrag),oe(e,"touchend",this._disableDelayedDrag),oe(e,"touchcancel",this._disableDelayedDrag),oe(e,"mousemove",this._delayedDragTouchMoveHandler),oe(e,"touchmove",this._delayedDragTouchMoveHandler),oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?se(document,"pointermove",this._onTouchMove):t?se(document,"touchmove",this._onTouchMove):se(document,"mousemove",this._onTouchMove):(se(q,"dragend",this),se(fe,"dragstart",this._onDragStart));try{document.selection?An(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if($t=!1,fe&&q){Te("dragStarted",this,{evt:t}),this.nativeDraggable&&se(document,"dragover",Sg);var n=this.options;!e&&Oe(q,n.dragClass,!1),Oe(q,n.ghostClass,!0),te.active=this,e&&this._appendGhost(),Me({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ze){this._lastX=ze.clientX,this._lastY=ze.clientY,Ph();for(var e=document.elementFromPoint(ze.clientX,ze.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ze.clientX,ze.clientY),e!==t);)t=e;if(q.parentNode[ke]._isOutsideThisEl(e),t)do{if(t[ke]){var n=void 0;if(n=t[ke]._onDragOver({clientX:ze.clientX,clientY:ze.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Th(t));Hh()}},_onTouchMove:function(e){if(ft){var t=this.options,n=t.fallbackTolerance,p=t.fallbackOffset,h=e.touches?e.touches[0]:e,g=ie&&Tt(ie,!0),m=ie&&g&&g.a,c=ie&&g&&g.d,d=fn&&Ae&&eu(Ae),r=(h.clientX-ft.clientX+p.x)/(m||1)+(d?d[0]-Fo[0]:0)/(m||1),o=(h.clientY-ft.clientY+p.y)/(c||1)+(d?d[1]-Fo[1]:0)/(c||1);if(!te.active&&!$t){if(n&&Math.max(Math.abs(h.clientX-this._lastX),Math.abs(h.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ie){g?(g.e+=r-(Io||0),g.f+=o-(No||0)):g={a:1,b:0,c:0,d:1,e:r,f:o};var a="matrix(".concat(g.a,",").concat(g.b,",").concat(g.c,",").concat(g.d,",").concat(g.e,",").concat(g.f,")");ne(ie,"webkitTransform",a),ne(ie,"mozTransform",a),ne(ie,"msTransform",a),ne(ie,"transform",a),Io=r,No=o,ze=h}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:fe,t=we(q,!0,fn,!0,e),n=this.options;if(fn){for(Ae=e;ne(Ae,"position")==="static"&&ne(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=Ge()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=Ge(),Fo=eu(Ae)}ie=q.cloneNode(!0),Oe(ie,n.ghostClass,!1),Oe(ie,n.fallbackClass,!0),Oe(ie,n.dragClass,!0),ne(ie,"transition",""),ne(ie,"transform",""),ne(ie,"box-sizing","border-box"),ne(ie,"margin",0),ne(ie,"top",t.top),ne(ie,"left",t.left),ne(ie,"width",t.width),ne(ie,"height",t.height),ne(ie,"opacity","0.8"),ne(ie,"position",fn?"absolute":"fixed"),ne(ie,"zIndex","100000"),ne(ie,"pointerEvents","none"),te.ghost=ie,e.appendChild(ie),ne(ie,"transform-origin",tu/parseInt(ie.style.width)*100+"% "+nu/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,p=e.dataTransfer,h=n.options;if(Te("dragStart",this,{evt:e}),te.eventCanceled){this._onDrop();return}Te("setupClone",this),te.eventCanceled||(pe=Dh(q),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),Oe(pe,this.options.chosenClass,!1),te.clone=pe),n.cloneId=An(function(){Te("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,q),n._hideClone(),Me({sortable:n,name:"clone"}))}),!t&&Oe(q,h.dragClass,!0),t?(Dn=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oe(document,"mouseup",n._onDrop),oe(document,"touchend",n._onDrop),oe(document,"touchcancel",n._onDrop),p&&(p.effectAllowed="move",h.setData&&h.setData.call(n,p,q)),se(document,"drop",n),ne(q,"transform","translateZ(0)")),$t=!0,n._dragStartId=An(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),Gt=!0,Zt&&ne(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,p,h,g,m=this.options,c=m.group,d=te.active,r=hn===c,o=m.sort,a=Se||d,s,i=this,u=!1;if(Ms)return;function f(O,I){Te(O,i,qe({evt:e,isOwner:r,axis:s?"vertical":"horizontal",revert:g,dragRect:p,targetRect:h,canSort:o,fromSortable:a,target:n,completed:b,onMove:function(P,B){return pn(fe,t,q,p,P,we(P),e,B)},changed:M},I))}function y(){f("dragOverAnimationCapture"),i.captureAnimationState(),i!==a&&a.captureAnimationState()}function b(O){return f("dragOverCompleted",{insertion:O}),O&&(r?d._hideClone():d._showClone(i),i!==a&&(Oe(q,Se?Se.options.ghostClass:d.options.ghostClass,!1),Oe(q,m.ghostClass,!0)),Se!==i&&i!==te.active?Se=i:i===te.active&&Se&&(Se=null),a===i&&(i._ignoreWhileAnimating=n),i.animateAll(function(){f("dragOverAnimationComplete"),i._ignoreWhileAnimating=null}),i!==a&&(a.animateAll(),a._ignoreWhileAnimating=null)),(n===q&&!q.animated||n===t&&!n.animated)&&(At=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(q.parentNode[ke]._isOutsideThisEl(e.target),!O&&pt(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function M(){Ie=Fe(q),ot=Fe(q,m.draggable),Me({sortable:i,name:"change",toEl:t,newIndex:Ie,newDraggableIndex:ot,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=je(n,m.draggable,t,!0),f("dragOver"),te.eventCanceled)return u;if(q.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return b(!1);if(Dn=!1,d&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=hn.checkPull(this,d,q,e))&&c.checkPut(this,d,q,e))){if(s=this._getDirection(e,n)==="vertical",p=we(q),f("dragOverValid"),te.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),f("revert"),te.eventCanceled||(gt?fe.insertBefore(q,gt):fe.appendChild(q)),b(!0);var $=ea(t,m.draggable);if(!$||Mg(e,s,this)&&!$.animated){if($===q)return b(!1);if($&&t===e.target&&(n=$),n&&(h=we(n)),pn(fe,t,q,p,n,h,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(q,$.nextSibling):t.appendChild(q),ve=t,M(),b(!0)}else if($&&xg(e,s,this)){var A=Rt(t,0,m,!0);if(A===q)return b(!1);if(n=A,h=we(n),pn(fe,t,q,p,n,h,e,!1)!==!1)return y(),t.insertBefore(q,A),ve=t,M(),b(!0)}else if(n.parentNode===t){h=we(n);var S=0,E,R=q.parentNode!==t,L=!wg(q.animated&&q.toRect||p,n.animated&&n.toRect||h,s),_=s?"top":"left",D=Jc(n,"top","top")||Jc(q,"top","top"),w=D?D.scrollTop:void 0;At!==n&&(E=h[_],en=!1,dn=!L&&m.invertSwap||R),S=Eg(e,n,h,s,L?1:m.swapThreshold,m.invertedSwapThreshold==null?m.swapThreshold:m.invertedSwapThreshold,dn,At===n);var v;if(S!==0){var C=Fe(q);do C-=S,v=ve.children[C];while(v&&(ne(v,"display")==="none"||v===ie))}if(S===0||v===n)return b(!1);At=n,Jt=S;var x=n.nextElementSibling,T=!1;T=S===1;var k=pn(fe,t,q,p,n,h,e,T);if(k!==!1)return(k===1||k===-1)&&(T=k===1),Ms=!0,setTimeout($g,30),y(),T&&!x?t.appendChild(q):n.parentNode.insertBefore(q,T?x:n),D&&kh(D,0,w-D.scrollTop),ve=q.parentNode,E!==void 0&&!dn&&(Sn=Math.abs(E-we(n)[_])),M(),b(!0)}if(t.contains(q))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){oe(document,"mousemove",this._onTouchMove),oe(document,"touchmove",this._onTouchMove),oe(document,"pointermove",this._onTouchMove),oe(document,"dragover",pt),oe(document,"mousemove",pt),oe(document,"touchmove",pt)},_offUpEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._onDrop),oe(e,"touchend",this._onDrop),oe(e,"pointerup",this._onDrop),oe(e,"touchcancel",this._onDrop),oe(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Ie=Fe(q),ot=Fe(q,n.draggable),Te("drop",this,{evt:e}),ve=q&&q.parentNode,Ie=Fe(q),ot=Fe(q,n.draggable),te.eventCanceled){this._nulling();return}$t=!1,dn=!1,en=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Es(this.cloneId),Es(this._dragStartId),this.nativeDraggable&&(oe(document,"drop",this),oe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Zt&&ne(document.body,"user-select",""),ne(q,"transform",""),e&&(Gt&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(fe===ve||Se&&Se.lastPutMode!=="clone")&&pe&&pe.parentNode&&pe.parentNode.removeChild(pe),q&&(this.nativeDraggable&&oe(q,"dragend",this),Po(q),q.style["will-change"]="",Gt&&!$t&&Oe(q,Se?Se.options.ghostClass:this.options.ghostClass,!1),Oe(q,this.options.chosenClass,!1),Me({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(Ie>=0&&(Me({rootEl:ve,name:"add",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"remove",toEl:ve,originalEvent:e}),Me({rootEl:ve,name:"sort",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),Se&&Se.save()):Ie!==Et&&Ie>=0&&(Me({sortable:this,name:"update",toEl:ve,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((Ie==null||Ie===-1)&&(Ie=Et,ot=Qt),Me({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Te("nulling",this),fe=q=ve=ie=gt=pe=Cn=st=ft=ze=Gt=Ie=ot=Et=Qt=At=Jt=Se=hn=te.dragged=te.ghost=te.clone=te.active=null,In.forEach(function(e){e.checked=!0}),In.length=Io=No=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":q&&(this._onDragOver(e),Ag(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,p=0,h=n.length,g=this.options;p<h;p++)t=n[p],je(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||Tg(t));return e},sort:function(e,t){var n={},p=this.el;this.toArray().forEach(function(h,g){var m=p.children[g];je(m,this.options.draggable,p,!1)&&(n[h]=m)},this),t&&this.captureAnimationState(),e.forEach(function(h){n[h]&&(p.removeChild(n[h]),p.appendChild(n[h]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return je(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var p=ln.modifyOption(this,e,t);typeof p<"u"?n[e]=p:n[e]=t,e==="group"&&Fh(n)},destroy:function(){Te("destroy",this);var e=this.el;e[ke]=null,oe(e,"mousedown",this._onTapStart),oe(e,"touchstart",this._onTapStart),oe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(oe(e,"dragover",this),oe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),On.splice(On.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!st){if(Te("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),st=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(st){if(Te("showClone",this),te.eventCanceled)return;q.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,q):gt?fe.insertBefore(pe,gt):fe.appendChild(pe),this.options.group.revertClone&&this.animate(q,pe),ne(pe,"display",""),st=!1}}};function Ag(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function pn(l,e,t,n,p,h,g,m){var c,d=l[ke],r=d.options.onMove,o;return window.CustomEvent&&!rt&&!an?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=e,c.from=l,c.dragged=t,c.draggedRect=n,c.related=p||e,c.relatedRect=h||we(e),c.willInsertAfter=m,c.originalEvent=g,l.dispatchEvent(c),r&&(o=r.call(d,c,g)),o}function Po(l){l.draggable=!1}function $g(){Ms=!1}function xg(l,e,t){var n=we(Rt(t.el,0,t.options,!0)),p=Oh(t.el,t.options,ie),h=10;return e?l.clientX<p.left-h||l.clientY<n.top&&l.clientX<n.right:l.clientY<p.top-h||l.clientY<n.bottom&&l.clientX<n.left}function Mg(l,e,t){var n=we(ea(t.el,t.options.draggable)),p=Oh(t.el,t.options,ie),h=10;return e?l.clientX>p.right+h||l.clientY>n.bottom&&l.clientX>n.left:l.clientY>p.bottom+h||l.clientX>n.right&&l.clientY>n.top}function Eg(l,e,t,n,p,h,g,m){var c=n?l.clientY:l.clientX,d=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,a=!1;if(!g){if(m&&Sn<d*p){if(!en&&(Jt===1?c>r+d*h/2:c<o-d*h/2)&&(en=!0),en)a=!0;else if(Jt===1?c<r+Sn:c>o-Sn)return-Jt}else if(c>r+d*(1-p)/2&&c<o-d*(1-p)/2)return _g(e)}return a=a||g,a&&(c<r+d*h/2||c>o-d*h/2)?c>r+d/2?1:-1:0}function _g(l){return Fe(q)<Fe(l)?1:-1}function Tg(l){for(var e=l.tagName+l.className+l.src+l.href+l.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function Lg(l){In.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&In.push(n)}}function An(l){return setTimeout(l,0)}function Es(l){return clearTimeout(l)}Xn&&se(document,"touchmove",function(l){(te.active||$t)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:Lh,is:function(e,t){return!!je(e,t,e,!1)},extend:dg,throttle:Rh,closest:je,toggleClass:Oe,clone:Dh,index:Fe,nextTick:An,cancelNextTick:Es,detectDirection:Nh,getChild:Rt,expando:ke};te.get=function(l){return l[ke]};te.mount=function(){for(var l=arguments.length,e=new Array(l),t=0;t<l;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(te.utils=qe(qe({},te.utils),n.utils)),ln.mount(n)})};te.create=function(l,e){return new te(l,e)};te.version=ug;var be=[],qt,_s,Ts=!1,Ho,Wo,Nn,Kt;function Rg(){function l(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return l.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?se(document,"pointermove",this._handleFallbackAutoScroll):n.touches?se(document,"touchmove",this._handleFallbackAutoScroll):se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?oe(document,"dragover",this._handleAutoScroll):(oe(document,"pointermove",this._handleFallbackAutoScroll),oe(document,"touchmove",this._handleFallbackAutoScroll),oe(document,"mousemove",this._handleFallbackAutoScroll)),ru(),$n(),fg()},nulling:function(){Nn=_s=qt=Ts=Kt=Ho=Wo=null,be.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var p=this,h=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(h,g);if(Nn=t,n||this.options.forceAutoScrollFallback||an||rt||Zt){zo(t,this.options,m,n);var c=at(m,!0);Ts&&(!Kt||h!==Ho||g!==Wo)&&(Kt&&ru(),Kt=setInterval(function(){var d=at(document.elementFromPoint(h,g),!0);d!==c&&(c=d,$n()),zo(t,p.options,d,n)},10),Ho=h,Wo=g)}else{if(!this.options.bubbleScroll||at(m,!0)===Ge()){$n();return}zo(t,this.options,at(m,!1),!1)}}},nt(l,{pluginName:"scroll",initializeByDefault:!0})}function $n(){be.forEach(function(l){clearInterval(l.pid)}),be=[]}function ru(){clearInterval(Kt)}var zo=Rh(function(l,e,t,n){if(e.scroll){var p=(l.touches?l.touches[0]:l).clientX,h=(l.touches?l.touches[0]:l).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,c=Ge(),d=!1,r;_s!==t&&(_s=t,$n(),qt=e.scroll,r=e.scrollFn,qt===!0&&(qt=at(t,!0)));var o=0,a=qt;do{var s=a,i=we(s),u=i.top,f=i.bottom,y=i.left,b=i.right,M=i.width,$=i.height,A=void 0,S=void 0,E=s.scrollWidth,R=s.scrollHeight,L=ne(s),_=s.scrollLeft,D=s.scrollTop;s===c?(A=M<E&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=M<E&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var w=A&&(Math.abs(b-p)<=g&&_+M<E)-(Math.abs(y-p)<=g&&!!_),v=S&&(Math.abs(f-h)<=g&&D+$<R)-(Math.abs(u-h)<=g&&!!D);if(!be[o])for(var C=0;C<=o;C++)be[C]||(be[C]={});(be[o].vx!=w||be[o].vy!=v||be[o].el!==s)&&(be[o].el=s,be[o].vx=w,be[o].vy=v,clearInterval(be[o].pid),(w!=0||v!=0)&&(d=!0,be[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Nn);var x=be[this.layer].vy?be[this.layer].vy*m:0,T=be[this.layer].vx?be[this.layer].vx*m:0;typeof r=="function"&&r.call(te.dragged.parentNode[ke],T,x,l,Nn,be[this.layer].el)!=="continue"||kh(be[this.layer].el,T,x)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&a!==c&&(a=at(a,!1)));Ts=d}},30),Wh=function(e){var t=e.originalEvent,n=e.putSortable,p=e.dragEl,h=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var d=n||h;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);c(),d&&!d.el.contains(o)&&(g("spill"),this.onSpill({dragEl:p,putSortable:n}))}};function ta(){}ta.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var p=Rt(this.sortable.el,this.startIndex,this.options);p?this.sortable.el.insertBefore(t,p):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Wh};nt(ta,{pluginName:"revertOnSpill"});function na(){}na.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,p=n||this.sortable;p.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),p.animateAll()},drop:Wh};nt(na,{pluginName:"removeOnSpill"});te.mount(new Rg);te.mount(na,ta);const xe={getStyle:(l,e=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(l,null):l.currentStyle&&(t=l.currentStyle),e?t[e]:t},fadeOut:(l,e=250)=>{const t=1/(e/60);l.style.opacity=1,(function n(){const p=Number(l.style.opacity)-t;p>0?(l.style.opacity=p,window.requestAnimationFrame(n)):l.remove()})()},slideDown:(l,e=250,t=!1)=>{l.style.display="block";const n=xe.getStyle(l),p=Number.parseInt(n.height,10),h=p/(e/60);l.style.height="0px",(function g(){const m=Number.parseFloat(l.style.height),c=m+h;m<p?(l.style.height=`${c}px`,window.requestAnimationFrame(g)):(l.style.height="auto",t&&t(l))})()},slideUp:(l,e=250,t=!1)=>{const n=xe.getStyle(l),p=Number.parseInt(n.height,10),h=n.overflow;l.style.overflow="hidden",l.style.height=`${p}px`;const g=n.minHeight;l.style.minHeight="auto";const m=parseFloat(p/(e/60)).toFixed(2);(function c(){const r=Number.parseInt(l.style.height,10)-m;r>0?(l.style.height=`${r}px`,window.requestAnimationFrame(c)):(l.style.overflow=h,l.style.display="none",l.style.minHeight=g,delete l.style.height,t&&t(l))})()},slideToggle:(l,e=250,t=xe.getStyle(l,"display")==="none")=>{t?xe.slideDown(l,e):xe.slideUp(l,e)}},zh=l=>Number.isInteger(Number(l)),ct=l=>{let e=0,t=l;for(;t?.previousElementSibling;)t=t.previousElementSibling,e++;return e},Fn=(l,e,t)=>{const n=t.split("||"),h=mt(e).map(g=>l.find(m=>{const c=n.find(d=>!!Re(m,d));return c&&Re(m,c)===g})).filter(Boolean).concat(l);return mt(h)},Qn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},ia=(l,e)=>{const t=[];return Qn(l,(n,p)=>t.push(e(n,p))),t},Bo={},Bh=l=>{const e={className:"class"};if(Bo[l])return Bo[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Bo[l]=n,n},jh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),kg=l=>window.JSON.parse(window.JSON.stringify(l)),Dg=(l,e)=>e.filter(t=>!~l.indexOf(t)),Ne={capitalize:jh,safeAttrName:Bh,forEach:Qn,copyObj:kg,map:ia,subtract:Dg,indexOfNode:ct,isInt:zh,get:Re,orderObjectsBy:Fn},We={js:new Set,css:new Set,formeoSprite:null},ou=(l,e,t=Ss)=>new Promise(n=>fetch(l).then(p=>{if(!p.ok)return n(t(p));n(e?e(p):p)}).catch(p=>t(p))),Vh=(l,e)=>{l.removeEventListener("load",Vh),e(l.src)},Uh=(l,e)=>{l.removeEventListener("load",Uh),e(l.src)},Og=l=>new Promise((e,t)=>{if(We.js.has(l))return e(l);We.js.add(l);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Uh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),Ls=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,p)=>{if(We.css.has(t))return n(t);We.css.add(t);const h=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Vh(h,n),error:()=>p(new Error(`${t} failed to load.`))}});document.head.appendChild(h)}));return Promise.all(e)},Ig=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Og(t));return Promise.all(e)},Ng=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Ls(t));return Promise.all(e)},su=l=>{const t=new DOMParser().parseFromString(l,"image/svg+xml");return We.formeoSprite=t.documentElement,We.formeoSprite},Fg=async(l=Hf)=>{if(We.formeoSprite)return We.formeoSprite;if(!l)return su(Ff);const e=async t=>su(await t.text());return ou(l,e,()=>ou(Wf,e))},Pg={js:Ig,css:Ng},Gh=l=>{const e=Object.entries(l).map(([t,n])=>Pg[t](n));return Promise.all(e)},Hg=async l=>{if(l&&!We.css.has(l)&&(await Ls(l),!We.css.has(l)&&!We.css.has(ic)))return await Ls(ic)},Wg={glyphicons:l=>`<span class="glyphicon glyphicon-${l}" aria-hidden="true"></span>`,"font-awesome":l=>{const[e,t]=l.split(" ");return`<i class="${e} fa-${t}"></i>`},fontello:l=>`<i class="${Ch}${l}">${l}</i>`},zg=new Set(["input","textarea","select"]),Bg=l=>l.replace(/^on([A-Z])/,(e,t)=>t.toLowerCase()),jg=new Set(["focus","blur"]),Vg=l=>{const e=Bg(l);return(t,n)=>t.addEventListener(e,n,jg.has(e))},qh=(l={})=>{let e=l?.attrs?.name||l?.name;if(e)return e;const t=He(l);let n=l.config?.label||l.attrs?.label||l?.label;return n&&(typeof n=="object"&&(n=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=gp(n)),e=`${t}-${Sh(mp(n,24,null))}`),e||t};class Ug{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=Ve(this.options,e)}processElemArg(e){let t=e,n;if(typeof t=="string")return n=t,t={tag:n},t;if(t.attrs){const{tag:p,...h}=t.attrs;p&&(typeof p=="string"?n=p:n=(p.find(m=>m.selected===!0)||p[0]).value),t.attrs=h}return t.tag=n||t.tag||"div",t}render=e=>(e.id=`f-${e.id||He()}`,this.create(e));create=(e,t=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const n=this,p=["children","content"],{className:h,options:g,dataset:m,...c}=this.processElemArg(e);p.push("tag");let d;const{tag:r}=c;let o;const a={attrs:{},className:[Ne.get(c,"config.inputWrap")],children:[],config:{}};let s=document.createElement(r);const i={string:f=>{s.innerHTML+=f},object:f=>f&&s.appendChild(n.create(f,t)),node:f=>s.appendChild(f),component:f=>s.appendChild(f.dom),array:f=>{for(const y of f)d=n.childType(y),i[d](y)},function:f=>{f=f(),d=n.childType(f),i[d](f)},undefined:()=>null,boolean:()=>null};if(h&&(c.attrs=Ve(c.attrs,{className:h})),g){const f=this.processOptions(g,c,t);if(this.holdsContent(s)&&r!=="button")i.array.call(this,f),c.content=void 0;else return Ne.forEach(f,y=>{a.children.push(n.create(y,t))}),c.attrs.className&&(a.className=c.attrs.className),a.id=c.id,a.config={...c.config},this.create(a,t);p.push("options")}if(c.attrs&&(n.processAttrs(c,s,t),p.push("attrs")),c.config){if(c.config.label&&(c.config.label&&r!=="button"||["radio","checkbox"].includes(Ne.get(c,"attrs.type")))&&!t){const f=n.label(c);if(!c.config.hideLabel){const y=[f,s];n.labelAfter(c)&&y.reverse(),a.children.push(y)}}p.push("config")}if(c.content||c.children){const f=c.content||c.children;d=n.childType(f),i[d]||console.error(`childType: ${d} is not supported`),i[d].call(this,f)}if(m){for(const f in m)Object.hasOwn(m,f)&&(s.dataset[f]=typeof m[f]=="function"?m[f]():m[f]);p.push("dataset")}c.action&&(this.actionHandler(s,c.action),p.push("action"));const u=Ne.subtract(p,Object.keys(c));for(o=u.length-1;o>=0;o--)s[u[o]]=c[u[o]];return a.children.length&&(s=this.create(a)),s};onRender=(e,t,n=Ze)=>{const p=Date.now(),h=()=>{!e.parentElement&&Date.now()-p<n?window.requestAnimationFrame(h):e.parentElement&&t(e)};h()};actionHandler(e,t){const n={onRender:V.onRender,render:V.onRender};return Object.entries(t).map(([p,h])=>(Array.isArray(h)?h:[h]).map(m=>(n[p]||Vg(p))(e,m)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=We.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const p=n.getAttribute("viewBox")||"0 0 24 24",h=Array.from(n.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",n.id],viewBox:p,xmlns:"http://www.w3.org/2000/svg"},children:h}};return this.iconSymbols=Array.from(e).reduce((n,p)=>{const h=p.id.replace(Ch,"");return n[h]=t(p),n},{}),this.cachedIcons={},this.iconSymbols}icon(e,t){if(!e)return;const n=`${e}?${new URLSearchParams(t).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const p=this.icons[e];if(p){if(t){const h=Ve(p,t);return this.cachedIcons[n]=V.create(h).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=V.create(p).outerHTML,this.cachedIcons[n]}return Wg[V.options.iconFont]?.(e)||e}processAttrs(e,t,n){const{attrs:p={}}=e;if(!n&&!p.name&&p.name!==null&&this.isInput(e.tag)){const h=qh(e);h&&t.setAttribute("name",h)}for(const h of Object.keys(p)){const g=Ne.safeAttrName(h),m=this.processAttrValue(p[h]);if(m!==!1)try{t.setAttribute(g,m)}catch(c){console.warn(`Could not set attribute ${g} with value ${m}`,c)}}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let t=e||"";if(Array.isArray(t))if(typeof t[0]=="object"){const n=t.filter(p=>p.selected===!0);t=n.length?n[0].value:t[0].value}else t=t.join(" ");return t}toggleElementsByStr=(e,t)=>{const n=[],p=(h,g)=>{g?(h.style.display="block",n.push(h)):h.style.display="none"};return V.elementsContainText(e,t,p),n};elementsContainText=(e,t,n)=>{const p=[];return Qn(e,h=>{const m=h.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(h,m),m&&p.push(h)}),p};generateOption=({type:e="option",label:t,value:n,i:p=0,selected:h})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${p}`,[e==="option"?"selected":"checked"]:h||!p},config:{label:t||X.get("labelCount",{label:X.get("option"),count:p})}});processOptions(e,t,n){const{action:p,attrs:h={}}=t,g=h.type||t.tag,m=h.id||t.id,c=(r,o)=>{const{label:a,value:s,...i}=r,u=()=>{const y={tag:"input",attrs:{name:m,type:g,value:s||"",id:`${m}-${o}`,...i},action:p},b={tag:"label",attrs:{for:`${m}-${o}`},children:a},M={children:[y,b],className:[`f-${g}`]};return h.className&&(t.config.inputWrap=h.className),t.config.inline&&M.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(b.attrs.contenteditable=!0),M};return{select:()=>{const y=r.attrs||r,b={attrs:y,...r,...y},{label:M,checked:$,selected:A,attrs:S}=b;return{tag:"option",attrs:{...S,selected:!!($||A)},children:M}},button:y=>{const{type:b,label:M,className:$,id:A}=y;return{...t,attrs:{type:b},className:$,id:A||He(),options:void 0,children:M,action:t.action}},checkbox:u,radio:u}[g]?.(r)};return e.map(c)}holdsContent(e){return e.outerHTML.includes("/")}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let t=e;return typeof t!="string"&&(t=t.tagName),zg.has(t)}parsedHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.textContent}labelAfter(e){const t=Ne.get(e,"attrs.type"),n=Ne.get(e,"config.labelAfter");return n===void 0?t==="checkbox"||t==="radio":n}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});tooltip=e=>({tag:"span",className:"f-tooltip",dataset:{tooltip:e},content:V.icon("info-circle")});helpText=e=>({tag:"small",className:"f-help-text",children:e});label(e,t){const n=Ne.get(e,"attrs.required");let{config:{label:p="",helpText:h="",tooltip:g=null}}=e;const{id:m,attrs:c}=e;typeof p=="function"&&(p=p());const d={tag:"label",attrs:{for:m||c?.id},className:[],children:[p,n&&this.requiredMark(),g&&this.tooltip(g),h&&this.helpText(h)],action:{}};return t&&(d.attrs.for=void 0,d.attrs.contenteditable=!0,d.fMap=t),d}childType(e){return e===void 0?e:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(t=>t[1](e))[0]}getStyle(e,t=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(e,null):e.currentStyle&&(n=e.currentStyle),t?n[t]:n}getElement(e){const t={node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)},n=this.childType(e);return t[n]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const t=e.parentElement,n=Le(e),p=t.getElementsByClassName(`formeo-${n}`);if(this.remove(e),!p.length)return this.isStage(t)?this.emptyClass(t):this.removeEmpty(t)};remove(e){const t=Le(e);return t?ce.remove(`${t}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,t){const n={string:p=>p.classList.remove(t),array:p=>{for(const h of t)p.classList.remove(h)}};n.object=n.string,Ne.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:p=>p.classList.add(t),array:p=>{for(const h of t)p.classList.add(h)}};Ne.forEach(e,n[this.childType(t)])}formGroup(e,t=""){return{className:["f-field-group",t],children:e}}coords(e){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:t.left+t.width/2,pageY:t.top-n.top-t.height/2}}clearStage(e){e.classList.add("removing-all-fields");const t=()=>{V.empty(e),e.classList.remove("removing-all-fields"),V.emptyClass(e),xe.slideDown(e,300)};xe.slideUp(e,600,t)}toggleSortable(e,t){let n=t;const p=Le(e);if(!p)return;const h=Le(e.parentElement),g=V[p].get(e.id).sortable;n||(n=!g.option("disabled")),g.option("disabled",n),h&&["rows","columns","stages"].includes(h)&&this.toggleSortable(e.parentElement,n)}emptyClass(e){const t=e.getElementsByClassName(Bf.get(e.classList.item(0)));e.classList.toggle("empty",!t.length)}btnTemplate=({title:e="",...t})=>({tag:"button",attrs:{type:"button",title:e},...t});isControls=e=>Le(e)===lt;isStage=e=>Le(e)===Nt;isRow=e=>Le(e)===et;isColumn=e=>Le(e)===tt;isField=e=>Le(e)===Ft;asComponent=e=>ce[`${Le(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}}const V=new Ug,Gg="modulepreload",qg=function(l){return"/formeo/"+l},au={},xt=function(e,t,n){let p=Promise.resolve();if(t&&t.length>0){let c=function(d){return Promise.all(d.map(r=>Promise.resolve(r).then(o=>({status:"fulfilled",value:o}),o=>({status:"rejected",reason:o}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),m=g?.nonce||g?.getAttribute("nonce");p=c(t.map(d=>{if(d=qg(d),d in au)return;au[d]=!0;const r=d.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${o}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":Gg,r||(a.as="script"),a.crossOrigin="",a.href=d,m&&a.setAttribute("nonce",m),document.head.appendChild(a),r)return new Promise((s,i)=>{a.addEventListener("load",s),a.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${d}`)))})}))}function h(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return p.then(g=>{for(const m of g||[])m.status==="rejected"&&h(m.reason);return e().catch(h)})},_t="f-autocomplete",Kg=`${_t}-display-field`,ra=`${_t}-list`,Wt="highlight-component",Pn=`${ra}-item`,Yg=(l,e)=>{const t=l.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},Kh=["config.label","config.controlId"],Zg=["config.legend","name"],Xg=[...Kh,...Zg],jo=l=>Kh.reduce((e,t)=>e||l.get(t),null),lu=l=>Xg.reduce((e,t)=>e||l.get(t),null)||Xe(l.name),Qg=new Map([["condition.source",jo],["if.condition.source",jo],["if.condition.target",jo],["then.condition.target",lu],["condition.target",lu]]),Yh=({id:l,...e},t)=>{const{name:n,label:p}=e;return n?Qg.get(t)(e):p},Jg=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Vo=l=>(l.classList.contains(Pn)||(l=l.parentElement),l),Zh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:p=0},h)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[Pn,`${Pn}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Vo(m),h.setValue(m),h.selectOption(m),h.hideList()},mouseover:({target:m})=>{m=Vo(m),h.removeHighlight(),h.highlightComponent(m)},mouseleave:({target:m})=>{m=Vo(m),h.removeHighlight()}}};return V.create(g)},em=(l,e)=>{const t=l.data.options.map((p,h)=>{const g=`${l.address}.options[${h}]`,m=p.label,c=p.label;return Zh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return V.create({tag:"ul",attrs:{className:[ra,"options-list"]},children:t})},tm=l=>{const e=l.value,t=[],n=ce.flatList();return Object.entries(n).reduce((h,[g,m])=>{const c=Yh(m,l.key);if(c){const d=m.name,r={tag:"span",content:` ${Xe(d)}`,className:"component-type"},o=`${d}.${c}`;t.push(o);const a=Yg(t,o),s={tag:"span",content:a,className:"component-label-count"},i=[`${c} `,s,r],u=[c,a].join(" ").trim();if(m.isCheckable){const y=em(m,l);i.push(y)}const f=Jg({value:g,textLabel:u,htmlLabel:i,componentType:d,selectedId:e});h.push(Zh(f,l))}return h},[])};class nm{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:p=Ss}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=p||Ss,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.dom){const n=e.dom[t];return typeof n=="function"?n.bind(e.dom):n}},set(e,t,n){return t in e?e[t]=n:e.dom[t]=n,!0}})}get isAddress(){return Pe(this.value)}get valueComponent(){return Pe(this.value)&&ce.getAddress(this.value)}build(){const e=n=>{const p=this.list,h=this.getActiveOption();let m=new Map([[38,()=>{const c=this.getPreviousOption(h);c&&this.selectOption(c)}],[40,()=>{const c=this.getNextOption(h);c&&this.selectOption(c)}],[13,()=>{h&&(this.selectOption(h),this.setValue(h),p.style.display==="none"?this.showList(h):this.hideList()),n.preventDefault()}],[27,()=>{this.hideList()}]]).get(n.keyCode);return m||(m=()=>!1),m()},t={focus:({target:n})=>{this.updateOptions(),n.parentElement.classList.add(`${_t}-focused`);const p=V.toggleElementsByStr(this.list.querySelectorAll(`.${Pn}-depth-0`),n.value);n.addEventListener("keydown",e);const h=this.list.querySelector(".active-option")||p[0];this.showList(h)},blur:({target:n})=>{n.parentElement.classList.remove(`${_t}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:p}=n.target,h=V.toggleElementsByStr(this.list.querySelectorAll("li"),p);if(p.length===0&&this.clearValue(),h.length===0)this.hideList();else{const g=this.getActiveOption()||h[0];this.showList(g)}this.setValue({dataset:{label:p,value:p}})}};return this.displayField=V.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:Kg,value:this.label||this.value,placeholder:X.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:_t,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:ra}}),this.clearButton=V.create({tag:"span",content:V.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=V.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[_t,this.className].flat(),action:{onRender:n=>{this.stage=n.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Pe(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&Yh(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>Vs*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=tm(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),p=this.displayField.getBoundingClientRect(),h={position:"absolute",top:`${p.y+e-n.y}px`,left:`${p.x+window.scrollX-n.x+2}px`,width:`${t}px`};Object.assign(this.list.style,h)}showList(e,t=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),xe.slideDown(t,vt)}hideList(e=this.list){xe.slideUp(e,vt),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const t=e.querySelector(".active-option");return t?.style.display!=="none"?t:null}getPreviousOption(e){let t=e;do t=t?t.previousSibling:null;while(t!=null&&t.style.display==="none");return t}getNextOption(e){let t=e;do t=t?t.nextSibling:null;while(t!=null&&t.style.display==="none");return t}selectOption(e,t=this.list){const n=t.querySelectorAll("li");for(const p of n){const{dataset:{value:h}}=p;p.classList.remove("active-option"),Pe(h)&&ce.getAddress(h)?.dom?.classList.remove(Wt)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Wt);for(const t of e)t.classList.remove(Wt)}highlightComponent(e){const{dataset:{value:t}}=e;if(Pe(t)){const{componentAddress:n,isOptionAddress:p,optionIndex:h}=yt(t).reduce((m,c)=>c==="options"?(m.isOptionAddress=!0,m):m.isOptionAddress?(m.optionIndex=+c,m):(m.componentAddress.push(c),m),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=ce.getAddress(n);g?.dom&&(g.dom.classList.add(Wt),p&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[h]?.classList.add(Wt))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:t,value:n}=e.dataset;this.displayField.value=t,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}const Xh=l=>X.get(`${l}.placeholder`)||Xe(Rn(l)),oa=l=>l.replaceAll(".","-"),cu=new Map([["config.helpText",(...l)=>uu(...l)],["config.tooltip",(...l)=>uu(...l)]]);function Uo({key:l,value:e,type:t="text",checked:n}){const p={tag:"input",attrs:{type:t,value:e,placeholder:Xh(l)},className:[oa(l)],config:{}};return n&&(p.attrs.checked=!0),p}function uu({key:l,value:e}){return{tag:"textarea",attrs:{placeholder:Xh(l)},className:[oa(l)],config:{},textContent:e}}function Ue(l){const e=X.get(l);if(e)return e;const t=Rn(l);return X.get(t)||Xe(t)}const kt={autocomplete:(...l)=>new nm(...l).createProxy(),string:({key:l,value:e})=>cu.has(l)?cu.get(l)({key:l,value:e}):Uo({key:l,value:e}),boolean:({key:l,value:e})=>Uo({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Uo({key:l,value:e,type:"number"}),array:({key:l,value:e})=>({tag:"select",attrs:{placeholder:Ue(`placeholder.${l}`)},className:[oa(l)],options:e}),object:l=>Object.entries(l).map(([e,t])=>kt[V.childType(t)]({key:e,value:t}))},im={boolean:(l,e)=>({click:({target:t})=>{if(t.type==="radio"){const n=e.data.options.map(p=>({...p,selected:!1}));e.set("options",n)}e.set(l,t.checked),e.updatePreview()}}),string:(l,e)=>({input:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),number:(l,e)=>({input:({target:{value:t}})=>{e.set(l,Number(t)),e.debouncedUpdatePreview()}}),array:(l,e)=>({change:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),object:()=>({})},rm=Object.freeze({title:"",content:null,confirmText:()=>Ue("save"),cancelText:()=>Ue("cancel"),onConfirm:()=>{},onCancel:()=>{},className:"",closeOnEscape:!0,position:"top",triggerElement:null,triggerCoords:null});class Lt{constructor(e){this.opts=Ve(rm,e),this.dialog=null}createDialog(){const{title:e,content:t,confirmText:n,cancelText:p,className:h,closeOnEscape:g,position:m}=this.opts,c=`dialog-position-${m}`,d=[];return e&&d.push({tag:"h3",className:"dialog-title",textContent:e}),t&&d.push({tag:"div",className:"dialog-body",children:Array.isArray(t)?t:[t]}),d.push({tag:"div",className:"dialog-actions",children:[{tag:"button",type:"button",className:"btn btn-sm btn-secondary",textContent:typeof p=="function"?p():p,action:{click:()=>this.handleCancel()}},{tag:"button",type:"submit",className:"btn btn-sm btn-primary",textContent:typeof n=="function"?n():n}]}),V.create({tag:"dialog",className:["formeo-dialog","formeo",c,h],children:[{tag:"form",className:"dialog-form",method:"dialog",children:d,action:{submit:o=>this.handleSubmit(o)}}],action:{cancel:o=>{g?this.handleCancel():o.preventDefault()}}})}handleSubmit(e){e.preventDefault();const t=new FormData(e.target);this.opts.onConfirm(t,this),this.close()}handleCancel(){this.opts.onCancel(this),this.close()}setPosition(){const{position:e,triggerElement:t,triggerCoords:n}=this.opts;if(e!=="trigger"||!this.dialog)return;let p=n;if(!p&&t){const h=t.getBoundingClientRect();p={x:h.left+h.width/2,y:h.bottom+8}}if(p){const h=this.dialog.getBoundingClientRect(),g=window.innerWidth,m=window.innerHeight;let c=p.x-h.width/2,d=p.y;const r=16;c=Math.max(r,Math.min(c,g-h.width-r)),d=Math.max(r,Math.min(d,m-h.height-r)),this.dialog.style.left=`${c}px`,this.dialog.style.top=`${d}px`,this.dialog.style.transform="none"}}open(){if(this.dialog||(this.dialog=this.createDialog()),document.body.appendChild(this.dialog),this.dialog.showModal(),this.opts.position==="trigger"){const e=setTimeout(()=>{this.setPosition(),clearTimeout(e)},0)}return this}close(){this.dialog&&(this.dialog.close(),this.dialog.remove(),this.dialog=null)}static alert(e,t=()=>{}){return new Lt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("ok")||"OK",cancelText:"",onConfirm:()=>t()})}static confirm(e,t=()=>{},n=()=>{}){return new Lt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("confirm")||"Confirm",onConfirm:()=>t(),onCancel:()=>n()})}static prompt(e,t=()=>{},n=""){return new Lt({content:[{tag:"label",className:"dialog-prompt-label",children:[{tag:"p",className:"dialog-message",textContent:e},{tag:"input",type:"text",name:"prompt-value",className:"dialog-prompt-input",value:n}]}],onConfirm:p=>{const h=p.get("prompt-value");t(h)}})}}const Qh="hidden-property",om="hidden-option",Go=/\.options\[\d+\]$/,sm={"if-sourceProperty":bn(yn,sc,ac),"if-targetProperty":bn(yn),"then-targetProperty":bn(yn,sc,ac),...Object.entries(ap).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},Jh={assignment:zt,comparison:zt,logical:zt,source:({key:l,value:e,onChange:t,conditionType:n})=>kt.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:zt,targetProperty:zt,target:l=>Jh.source(l),value:({key:l,value:e,onChange:t},n)=>{const p=kt.string({key:`condition.${l}`,value:e});return p.action={input:t},p}};function am({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,p=sm[n];return Object.entries(p||{}).map(([h,g])=>lm({fieldName:l,fieldValue:e,key:h,optionValue:g}))}function lm({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:X.get(`${l}.${t}`)||Xe(t).toLowerCase(),value:n,selected:n===e}}function zt({key:l,value:e,onChange:t,conditionType:n}){const p=am({key:l,value:e,conditionType:n}),h=kt.array({key:`condition.${l}`,value:p});return h.action={change:t},h}const cm=l=>!l?.classList.contains(Qh),um={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(Go);return du(p,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(Go);return!n||p||t.value!=="value"},assignment:l=>{const e=l.get("target"),t=l.get("targetProperty");return!!!e.value||t.value.startsWith("is")},targetProperty:l=>{const e=l.get("target"),t=l.get("targetProperty"),n=!!e.value.match(Go);return du(n,t),!If(e.value)},target:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e?.value;return t&&!n?!0:t&&t?.value!=="value"},value:l=>{const e=l.get("target"),t=l.get("targetProperty");return t===void 0?!1:e&&!e.value||!cm(l.get("comparison"))||t.value===ed?!0:t.value.startsWith("is")}},hu=l=>{for(const[e,t]of l){const n=!!um[e]?.(l)||!1;t.classList.toggle(Qh,n)}},ed="isChecked",qo=l=>l.value.endsWith("Checked"),du=(l,e)=>{if(l&&qo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const h=qo(p),g=l?!h:h;g&&n.push(p.value),p.classList.toggle(om,g)}n.includes(e.value)&&(e.value=l?ed:t.find(p=>!qo(p))?.value||e.value)};function hm(l,e=sp){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class dm{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:p},h){this.values=new Map(hm(e)),this.conditionType=t,this.parent=h,this.baseAddress=`${h.address}.${t}`,this.fields=new Map,this.conditionCount=n,this.index=p,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=ce.getAddress(this.baseAddress);e.splice(this.index,1),ce.setAddress(this.baseAddress,e),xe.slideUp(this.dom,vt,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:X.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[p,h]of this.values){const g=r=>this.onChangeCondition({key:p,target:r.target}),m={key:p,value:h,conditionType:this.conditionType,onChange:g},c=Jh[p](m,this.values),d=c.dom||V.create(c);this.fields.set(p,c.dom?c:d),e.push(d)}const n={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:p=>{this.processUiState()}}};return V.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,p=V.btnTemplate({title:X.get(`remove${this.conditionType}Condition`),className:[t,n("remove")],content:V.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(p);const h=V.btnTemplate({title:X.get(`add${this.conditionType}Condition`),className:[t,n("add")],content:V.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),m={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(m)}}});return e.push(h),e}get value(){return Array.from(this.fields).reduce((e,[t,n])=>(e[t]=n.value,e),{})}processUiState(){hu(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=_n(e=>{J.formeoUpdated(e),ce.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:t})=>{const n={changedProperty:e,dataPath:this.address,value:this.value,src:t};hu(this.fields),this.updateDataDebounced(n)}}const fm=new Map([["attrs",({itemKey:l})=>l],["options",({itemKey:l,key:e})=>`${l}.${e}`]]),td=(l,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,p]=l?Ln:up,h=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(h)}},pm=new Map([["attrs-multiple",l=>({change:({target:e})=>{l.field.controlId==="select"&&td(e.checked,l.field)}})]]);class Bt{constructor({key:e,index:t,field:n,panel:p,data:h}){this.field=n,this.itemKey=e,this.itemIndex=t,this.panel=p,this.panelName=p.name,this.isDisabled=n.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(e,this.panelName),this.address=`${n.indexName}.${n.id}.${e}`,this.itemSlug=lc(e),this.conditionTypeWrap=new Map,h!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,h);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=V.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?Fn(Object.entries(e),Ln,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let t=this.conditionTypeWrap.get(e);return t||(t=V.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,t),t)}itemInputs(){const e=V.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([t,n])=>this.panelName==="conditions"?this.generateConditionFields(t,n):this.itemInput(t,n))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,t)=>{const n=this.findOrCreateConditionTypeWrap(e);let p=t;if(!p){const[g]=Xs()[e],m=n.children.length;e===wh&&(g.logical="||"),p={conditionValues:g,conditionCount:m,index:m}}const h=new dm({conditionType:e,...p},this);return n.appendChild(h.dom),h};removeConditionType=(e,t)=>{const p=this.conditionTypeWrap.get(e).children[t];p.destroy(),p.dom.remove()};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,p)=>{const h=this.addConditionType(e,{index:p,conditionCount:t.length,conditionValues:n});this.conditions.set(p,h)}),this.findOrCreateConditionTypeWrap(e));get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{xe.slideUp(this.dom,Ze,n=>{this.field.remove(this.itemKey),n.remove(),this.panel.updateProps()})},mouseover:n=>{this.dom.classList.add("to-remove")},mouseout:n=>{this.dom.classList.remove("to-remove")}},content:V.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}getConfigAttrOptions(e){const t=e.split(".").pop(),n=this.field.config?.attrs?.[t];return Array.isArray(n)?n:null}itemInput(e,t){if(this.isDisabled)return null;let n=V.childType(t)||"string",p=t;if(this.panelName==="attrs"){const i=this.getConfigAttrOptions(e);i&&(p=i.map(u=>({...u,selected:u.value===t})),n="array")}const h=fm.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,g=h.split(".").filter(Number.isNaN).join(".")||e,m=kt[n]({key:e,value:p}),c=`${this.field.shortId}-${lc(h).replaceAll(/-\d+-(selected)/g,"-$1")}`,d={label:this.panelName!=="options"&&Ue(g),labelAfter:!1,inputWrap:["f-input-wrap",this.isLocked&&"locked-prop",this.isDisabled&&"disabled-prop"].filter(Boolean).join(" ")},r={name:m.attrs.type==="checkbox"?`${c}[]`:c};r.disabled=this.isDisabled,r.readonly=this.isLocked;const o=pm.get(this.itemSlug)?.(this),a=kp(im[n](h,this.field),o||{}),s=Ve(kt[n]({key:e,value:p}),{action:a,attrs:r,config:d});return Ln.includes(e)?{className:"f-addon",children:s}:s}}const gm={multiple:(l,e)=>{td(!!l,e)}},mm=[{label:Ue("config.label"),value:"label"},{label:Ue("config.hideLabel"),value:"hideLabel"},{label:Ue("config.helpText"),value:"helpText"},{label:Ue("config.labelAfter"),value:"labelAfter"},{label:Ue("config.disableHtmlLabel"),value:"disableHtmlLabel"},{label:Ue("config.tooltip"),value:"tooltip"}],vm={label:"New Field",hideLabel:!1,helpText:"",labelAfter:!1,disableHtmlLabel:!1,tooltip:""};class ym{constructor(e,t,n){this.type=V.childType(e),this.name=t,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:X.get(`panel.label.${this.name}`)},attrs:{className:`${ah} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,p)=>{const h=this.type==="array",g=n[0],m=h?`[${p}]`:`.${n[0]}`,c=h?n:{[n[0]]:n[1]},d=`${this.name}${m}`,r=this.component.isDisabledProp(d,this.name),o=hp.get(this.name)?.has(g)??!0;return r||!o?null:new Bt({key:d,data:c,field:this.component,index:p,panel:this})}).filter(Boolean);const t={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:this.name==="options",content:this.editPanelItems};return V.create(t)}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}createEditButtons(){const e=this.name,t={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition,config:this.addConfiguration},n=[];if(e==="conditions"){X.current&&!X.current.clearAll&&X.put("clearAll","Clear All");const m={...V.btnTemplate({content:[V.icon("bin"),X.get("clearAll")],title:X.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};n.push(m)}const p=X.get(`panelEditButtons.${e}`)||`+ Add ${Xe(e)}`,h={...V.btnTemplate({content:p,title:p}),className:`add-${e}`,action:{click:m=>{const c={btnCoords:V.coords(m.target),addAction:t[e]};e==="attrs"&&(c.isDisabled=this.component.isDisabledProp,c.isLocked=this.component.isLockedProp,c.message={attr:X.get(`action.add.${e}.attr`),value:X.get(`action.add.${e}.value`)});const d=Xe(e),r=new globalThis.CustomEvent(`onAdd${d}`,{detail:c});$e.add[e](c),document.dispatchEvent(r)}}};return n.push(h),{className:"panel-action-buttons",content:n}}addAttribute=(e,t)=>{let n=t;const p=Bh(e),h=`attrs.${p}`;X.current[h]||X.put(h,jh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),gm[p]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${p}`),m=new Bt({key:h,data:{[p]:n},field:this.component,panel:this});g?g.replaceWith(m.dom):this.props.appendChild(m.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,t=this.component.get("options"),n=e==="select"?"option":e,p=X.get("newOptionLabel",{type:n})||"New Option",h=`${this.name}[${this.data.length}]`,g=t[t.length-1],c={...t.length?g:{},label:p};e!=="button"&&(c.value=Sh(p));const d=new Bt({key:h,data:c,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(d),this.props.appendChild(d.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,p=new Bt({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(p.dom),this.component.set(n,e.template),this.component.resizePanelWrap()};addConfiguration=()=>{const e=this.component.get("config");new Lt({className:"config-item-dialog",content:[{tag:"select",config:{label:X.get("selectConfigKey")||"Select Configuration Key"},attrs:{name:"selectConfigKey",required:!0,className:"config-key-select"},options:mm.filter(n=>!(n.value in e))}],onConfirm:n=>{const p=n.get("selectConfigKey").trim(),h=`config.${p}`;if(p){const g=new Bt({key:h,data:vm[p],field:this.component,panel:this});this.editPanelItems.push(g),this.props.appendChild(g.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()}}}).open()};clearAllItems=()=>{const e=this.type==="array"?[]:{},t={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};$e.remove[this.name](t);const n=Xe(this.name),p=new globalThis.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(p)};setData(e){this.data=e,this.component.set(this.name,e),this.updateProps()}}const fu=Object.freeze({type:"field",displayType:"slider"}),gn=l=>({transform:`translateX(${l?`${l}px`:0})`});class nd{constructor(e){this.opts=Ve(fu,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const t=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver(([{contentRect:{width:h}}])=>{this.currentWidth!==h&&(this.toggleTabbedLayout(),this.currentWidth=h,this.nav.setTranslateX(this.activePanelIndex,!1))}),p=window.setTimeout(()=>{n.observe(t),window.clearTimeout(p)},Vs)}getPanelDisplay(){const e=this.panelsWrap,n=Number.parseInt(V.getStyle(e,"width"),10)>390?"tabbed":"slider",p=this.opts.displayType==="auto";return this.panelDisplay=p?n:this.opts.displayType||fu.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=V.create({className:"panels",content:this.opts.panels.map(({config:t,...n})=>n)});return this.opts.type==="field"&&this.sortableProperties(e),this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}sortableProperties(e){const t=e.getElementsByClassName("field-edit-group");return Ne.forEach(t,n=>{n.fieldId=this.opts.id,n.isSortable&&te.create(n,{animation:150,group:{name:`edit-${n.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:p=>{this.propertySave(p.to),this.resizePanels()}})})}createPanelNavLabels(){const e=this.opts.panels.map(p=>({tag:"h5",action:{click:h=>{const g=ct(h.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:p.config.label})),t={className:"panel-labels",content:{content:e}},[n]=e;return n.className="active-tab",V.create(t)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:X.get("controlGroups.nextGroup"),type:"button"},action:{click:n=>this.nav.nextGroup(n)},content:V.icon("triangle-right")},t={tag:"button",attrs:{className:"prev-group",title:X.get("controlGroups.prevGroup"),type:"button"},action:{click:n=>this.nav.prevGroup(n)},content:V.icon("triangle-left")};return V.create({tag:"nav",attrs:{className:"panel-nav"},content:[t,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},t=this.currentPanel.parentElement,n=this.labels.firstChild,p=n.children,h=this.currentPanel.parentElement.childNodes;this.activePanelIndex=ct(this.currentPanel);let g={nav:0,panel:0},m={...g};e.groupChange=r=>(this.activePanelIndex=r,this.currentPanel=h[r],V.removeClasses(h,"active-panel"),V.removeClasses(p,"active-tab"),this.currentPanel.classList.add("active-panel"),p[r].classList.add("active-tab"),this.currentPanel);const c=r=>({nav:-n.offsetWidth*r,panel:-t.offsetWidth*r}),d=({offset:r,reset:o,duration:a=vt,animate:s=!this.isTabbed})=>{const i=[gn(m.panel),gn(r.panel)],u=[gn(m.nav),gn(this.isTabbed?0:r.nav)];if(o){const[M]=i,[$]=u;i.push(M),u.push($)}const f={easing:"ease-in-out",duration:s?a:0,fill:"forwards"},y=t.animate(i,f);n.animate(u,f);const b=()=>{y.removeEventListener("finish",b),o||(m=r)};y.addEventListener("finish",b)};return e.setTranslateX=(r=this.activePanelIndex,o=!0)=>{g=c(r),d({offset:g,animate:o})},e.refresh=(r=this.activePanelIndex)=>{this.activePanelIndex!==r&&e.groupChange(r),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const r=this.activePanelIndex+1;if(r!==h.length){const o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},d({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},d({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const r=this.activePanelIndex-1,o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},d({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},d({offset:g,reset:!0})},e}}let Ko=null;const Yo=bn(yn);class Jn extends Js{constructor(e,t={}){const n={...t,id:t.id||He()};super(e,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config={...n.config,...ce[`${this.name}s`].config},this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach(([e,t])=>{this.addEventListener(e,t)})}addEventListener(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(t)}removeEventListener(e,t){if(!this.eventListeners?.has(e))return;const n=this.eventListeners.get(e),p=n.indexOf(t);p>-1&&n.splice(p,1)}dispatchComponentEvent(e,t={}){const n={component:this,target:this,type:e,timestamp:Date.now(),...t};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(p=>{try{typeof p=="function"&&p(n)}catch(h){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,h)}}),n}set(e,t){const n=this.get(e),p=super.set(e,t);return n!==t&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:n,newValue:t}),p}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const g=yt(e),m=g.pop(),c=this.get(g);return Array.isArray(c)?zh(m)?c.splice(Number(m),1):this.set(g,c.filter(d=>d!==m)):delete c[m],c}if(this.name==="stage")return null;const t=this.parent,n=this.children;this.dispatchComponentEvent("onRemove",{path:e,parent:t,children:[...n]}),Qn(n,g=>g.remove()),this.dom.remove(),Of(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const h={row:Ks,column:Ys,field:Zs}[this.name];return h&&J.formeoUpdated({componentId:this.id,componentType:this.name,parent:t},h),ce[`${this.name}s`].delete(this.id)};empty(){const e=this.children.map(t=>(t.remove(),t));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{ce.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:t})=>{this.dom.classList.remove(...e),ce.stages.active.dom.classList.remove(`active-hover-${this.name}`),t.removeAttribute("style")}},children:[{...V.btnTemplate({content:V.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>V.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[V.icon(`handle-${this.name}`),Xe(this.name)].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const t=this.dom,n="editing",p=`${n}-${this.name}`,h=this.dom.querySelector(`.${this.name}-edit`);xe.slideToggle(h,Ze,e),this.name==="field"&&(xe.slideToggle(this.preview,Ze,!e),t.parentElement.classList.toggle(`column-${p}`,e)),t.classList.toggle(n,e),t.classList.toggle(p,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(g=`handle-${this.name}`)=>({...V.btnTemplate({content:V.icon(g)}),className:["component-handle"]}),move:(g="move")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-move"],meta:{id:"move"}}),edit:(g="edit")=>({...V.btnTemplate({content:V.icon(g)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(g="remove")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{xe.slideUp(this.dom,Ze,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(g="copy")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:t,disabled:n}=this.config.actionButtons,h=t.filter(g=>!n.includes(g)).map(g=>e[g]?.()||g);return this.actionButtons=h,this.actionButtons}get index(){return ct(this.dom)}removeClasses=e=>{const t={string:()=>this.dom.classList.remove(e),array:()=>e.map(n=>this.dom.classList.remove(n))};return t.object=t.string,t[V.childType(e)](this.dom)};get parentType(){return Jf.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${js[e]}`);return t&&V.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=rc.get(this.name);return ia(e,n=>ce.getAddress(`${t}s.${n.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(t=>this.addChild({id:t}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},t=this.domChildren.length){let n=e;typeof e!="object"&&(n={id:n});const p=this.dom.querySelector(".children"),{id:h=He()}=n,g=rc.get(this.name);if(!g)return null;const m=`${g}s`,c=ce.getAddress(`${m}.${h}`)||ce[m].add(h,n);t>=p.children.length?p.appendChild(c.dom):p.children[t].before(c.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:c,child:c,index:t}),c.dispatchComponentEvent("onAdd",{parent:this,target:c,index:t,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:c});const d=c.get("children");return d?.length&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:t})=>t);return this.set("children",e),e};onAdd({from:e,to:t,item:n,newIndex:p}){e.classList.contains(lt)||(e=e.parentElement);const h=Le(e),g=Le(t.parentElement),m=()=>{this.saveChildOrder(),this.removeClasses("empty")},c=new Map([[-2,()=>{const o=this.addChild({},p).addChild();return o.addChild.bind(o)}],[-1,()=>{const o=this.addChild({},p);return o.addChild.bind(o)}],[0,()=>this.addChild.bind(this)],[1,o=>{const a=ct(this.dom);return()=>this.parent.addChild(o,a+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Ko){const{default:b}=await xt(async()=>{const{default:M}=await Promise.resolve().then(()=>Om);return{default:M}},void 0);Ko=b}const{controlData:{meta:{id:o},...a}}=Ko.get(n.id);Yn(a,"config.controlId",o);const s=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=Re({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${s}`),f=c.get(u)();return V.remove(n),f(a,p)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||Cs)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||Cs)()?.(n.id)}}[h]?.(n,p);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:p,fromType:h,toType:g,addedComponent:r,addedVia:"dragDrop"}),m(),r}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(tt)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:t}})=>{e?.classList.remove(`hovering-${Le(e)}`),t?.classList.remove(`hovering-${Le(t)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&V.onRender(this.dom,e.onRender)}set config(e){const t=Re(e,"all"),n=Re(this.data,"config.controlId"),p=n&&Re(e,n),h=Re(e,this.id),g=[t,p,h].reduce((m,c)=>c?Ve(m,c):m,this.configVal);this.configVal=g}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(n=>{const p=this.processConditions(n.if),h=this.processResults(n.then);return p.map(g=>this.evaluateConditions(g)&&this.execResults(h))}):null};getComponent(e){const[t,n]=e.split("."),p=ce[t];return n===this.id?this:p?.get(n)}value=(e,t)=>{const n=e.split("."),p=this.getComponent(e),h=p&&n.slice(2,n.length).join(".");return[!p,!h,!Yo[h]].some(Boolean)?e:t?p.set(Yo[h],t):p.get(Yo[h])};getResult=e=>({"=":(n,p,h)=>n.set(p,h)})[e];processResults=e=>e.map(({operator:t,target:n,value:p})=>{const h=this.getComponent(n),g=h&&n.split(".").slice(2,n.length).join(".");return{target:h,propertyPath:g,action:this.getResult(t),value:this.value(p)}});execResults=e=>{const t=e.map(n=>this.execResult(n));return Promise.all(t)};execResult=({target:e,action:t,value:n,_propertyPath:p})=>new Promise((h,g)=>{try{return h(t(e,n))}catch(m){return g(m)}});cloneData=()=>{const e={...Je(this.data),id:He()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const t=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(t),this.dispatchComponentEvent("onClone",{original:this,clone:t,parent:e}),t};cloneChildren(e){for(const t of this.children)t?.clone(e)}createChildWrap=e=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Vr.row}get isColumn(){return this.name===Vr.column}get isField(){return this.name===Vr.field}isDisabledProp=(e,t="attrs")=>{if(Re(this.config,e))return!1;if((this.config?.disabled||[]).includes(e))return!0;const h=Rn(e);return(this.config?.panels[t]?.disabled||[]).includes(h)};isLockedProp=(e,t="attrs")=>{if((this.config?.locked||[]).includes(e))return!0;const h=Rn(e);return!!(this.config?.panels[t]?.locked||[]).includes(h)};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},t=this.editPanels.size;return t&&(e.className.push(`panel-count-${t}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(t===0){const n=this.dom.querySelector(".edit-toggle"),p=this.dom.querySelector(`.${this.name}-actions`),h=p.getElementsByTagName("button");p.style.maxWidth=`${h.length*h[0].clientWidth}px`,V.remove(n)}else this.resizePanelWrap()}},V.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=new Set(["object","array"]),t=mt([...this.config.panels.order,...Object.keys(this.data)]),n=new Set(["children","meta","action","events",...this.config.panels.disabled]),p=t.filter(g=>!n.has(g));for(const g of p){const m=this.get(g),c=V.childType(m);if(e.has(c)){const d=new ym(m,g,this);this.editPanels.set(d.name,d)}}const h={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new nd(h),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class bm{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const t=e.querySelector(".children");if(!t)return 0;const n=t.children.length,p=V.getStyle(t,"gap")||"0px",h=parseFloat(p,10)||0;return this.totalGapWidth=h*(n-1),t.offsetWidth-this.totalGapWidth}validateResizeTarget(e,t){return e&&t&&e.offsetWidth&&t.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const t=e.target.parentElement,n=t.nextSibling||t.previousSibling,p=t.closest(`.${et}`);if(!this.validateResizeTarget(t,n)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,p.classList.add(jr),this.columnPreset=p.querySelector(`.${lh}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace($s,""),n.className=n.className.replace($s,""),this.colStartWidth=t.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(p),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=t,this.sibling=n,this.row=p;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(h){console.error("Failed to initialize resize listeners:",h),this.cleanup()}}calculateNewWidths(e){const t=this.colStartWidth+e-this.startX,n=this.sibStartWidth-e+this.startX,p=parseFloat(Br(t,this.rowWidth)),h=parseFloat(Br(n,this.rowWidth));return p<10||h<10?null:{colWidth:ws(p.toFixed(1)),siblingColWidth:ws(h.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,p=e.type==="touchmove"?e.touches[0].clientX:e.clientX,h=this.calculateNewWidths(p);if(!h)return;const{colWidth:g,siblingColWidth:m}=h;t.dataset.colWidth=g,n.dataset.colWidth=m,t.style.width=g,n.style.width=m,this.resized=!0}onStop(){const{column:e,sibling:t}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),ce.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),ce.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),this.row.classList.remove(jr),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(jr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${As}`);const n=this.row.querySelector(".children").children,p=ia(n,m=>Br(m.clientWidth,this.rowWidth).toFixed(1)),h=p.join(","),g=p.join(" | ");return t||(t=V.create({tag:"option",attrs:{className:As,value:h,selected:!0},content:g}),e.append(t)),t.value=h,t.textContent=g,h}}const wm=()=>Object.freeze({config:{width:"100%"},children:[],className:[tt]}),pu={resizeHandle:l=>({className:"resize-x-handle",action:{pointerdown:l.onStart.bind(l)},content:[V.icon("triangle-down"),V.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})};class Cm extends Jn{constructor(e){super("column",{...wm(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[tt,"empty"],dataset:{hoverTag:X.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),pu.editWindow(),pu.resizeHandle(new bm),t]}),this.processConfig(),J.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),te.create(t,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${Ft}`,handle:".item-move"})}processConfig(){const e=Ne.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))}const Sm={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let Am=class extends Zn{constructor(e){super("columns",e),this.config={all:Sm}}Component(e){return new Cm(e)}};const id=new Am,$m=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[et]});class xm extends Jn{constructor(e){super("row",{...$m(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[et,"empty"],dataset:{hoverTag:X.get("row"),editingHoverTag:X.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${tt}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:X.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:a}})=>{this.set("config.fieldset",!!a)}},config:{label:X.get("row.settings.fieldsetWrap")}},t={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:X.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:a}})=>this.set("config.inputGroup",a)},config:{label:X.get("row.makeInputGroup"),description:X.get("row.makeInputGroupDesc")}},n={tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}},h={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",n]}},action:{input:({target:{value:a}})=>this.set("config.legend",a)},className:""}},g=V.formGroup([e,h]),m={tag:"label",content:X.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=V.create(this.columnPresetControlConfig);const c={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},d=V.formGroup([m,c],"row"),r=[t,"hr",g,"hr",d];return V.create({className:`${this.name}-edit group-config`,action:{onRender:a=>{const s=r.map(i=>V.create(i));a.append(...s)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const t=Number.parseFloat((100/e.length).toFixed(1))/1;for(const n of e){n.removeClasses($s);const p=n.dom,h=ws(t);n.set("config.width",h),p.style.width=h,p.dataset.colWidth=h;const g=setTimeout(()=>{clearTimeout(g),n.refreshFieldPanels()},vt);document.dispatchEvent(J.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:t,...n})=>V.create({tag:"option",content:t,attrs:n}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((t,n)=>{t.setWidth(`${e[n]}%`),t.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,n=tp.get(e.length-1)||[],p=e.map(h=>{const g=h.get("config.width")||"";return Number(g.replace("%","")).toFixed(1)}).join(",");if(n.length){const h=n.slice();return!h.find(m=>m.value===p)&&h.push({value:p,label:p.replace(/,/g," | "),className:As}),h.map(m=>{const c={...m};return c.selected=m.value===p,c})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:X.get("defineColumnLayout"),className:lh},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const Mm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let Em=class extends Zn{constructor(e){super("rows",e),this.config={all:Mm}}Component(e){return new xm(e)}};const sa=new Em,_m=()=>({conditions:[Xs()],children:[]});class Tm extends Jn{constructor(e){super("stage",{..._m(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=_n(this.updateEditPanels),X.get("Untitled Form"),X.get("Untitled Form"),X.get("Form Title"),X.get("Form novalidate"),X.get("Tags");const t=this.createChildWrap();this.dom=V.create({attrs:{className:[Nt,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{rn.active=this},onSort:this.onSort.bind(this),draggable:`.${et}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),xe.slideUp(this.dom,Ze,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),xe.slideDown(this.dom,Ze)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const Lm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let Rm=class extends Zn{constructor(e){super("stages",e),this.config={all:Lm()}}Component(e){return new Tm(e)}};const rn=new Rm;class km{controlCache=new Set;constructor({events:e={},dependencies:t={},controlAction:n,...p}){this.events=e,this.controlData=p,this.controlAction=n,this.dependencies=t,this.id=p.id||He()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:t}=this.controlData,n=this.i18n(t.label)||t.label,p={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:V.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:h})=>{const g=h.closest(`.${lt}`);return g&&Dt.panels.nav.refresh(ct(g))},click:({target:h})=>{const g=h.closest(".field-control")?.id;g&&Dt.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:p,meta:e,action:this.controlAction})}promise(){return Gh(this.dependencies)}i18n(e,t){const n=X.locale,h=this.definition?.i18n?.[n]||{};return(h[e]?.()??h[e])||X.get(e,t)}}const Dm=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}});let rd=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${lt}`);return t&&this.panels.nav.refresh(ct(t))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,t=!1){return await this.applyOptions(e),this.buildDOM(t),this}registerControls(e){return this.controls=[],e.map(t=>{const p=typeof t=="function"?new t:new km(t);return this.add(p),this.controls.push(p.dom),p.promise()})}groupLabel=e=>X.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),t=this.controls.slice(),n=[];const p=[];return e=Fn(e,this.groupOrder,"id"),e=e.filter(h=>nc(h.id,this.options.disable.groups)),n=e.map(h=>{const g={tag:"ul",attrs:{className:[lt,ah],id:`${h.id}-${lt}`},config:{label:this.groupLabel(h.label)}};if(this.options.elementOrder[h.id]){const m=this.options.elementOrder[h.id],c=mt(m.concat(h.elementOrder));h.elementOrder=c}return t=Fn(t,h.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:c}=this.get(m.id),d=c.meta.id||"",r=[nc(d,this.options.disable.elements),c.meta.group===h.id,!p.includes(d)];let o=!0;return o=r.every(a=>a===!0),o&&p.push(d),o}),g}),n}add(e=Object.create(null)){const t=Je(e);return this.data.set(t.id,t),t.controlData.meta.id&&this.data.set(t.controlData.meta.id,t.controlData),t}get(e){return Je(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...V.btnTemplate({content:[V.icon("bin"),X.get("clear")],title:X.get("clearAll")}),className:["clear-form"],action:{click:p=>{sa.size?(J.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:X.get("confirmClearAll"),clearAllAction:()=>{rn.clearAll().then(()=>{const h={src:p.target};J.formeoCleared(h)})},btnCoords:V.coords(p.target)}}),document.dispatchEvent(J.confirmClearAll)):window.alert(X.get("cannotClearFields"))}}},t={...V.btnTemplate({content:[V.icon("floppy-disk"),X.get("save")],title:X.get("save")}),className:["save-form"],action:{click:async({target:p})=>{const{default:h}=await xt(async()=>{const{default:c}=await Promise.resolve().then(()=>zm);return{default:c}},void 0),{formData:g}=h,m={action:()=>{},coords:V.coords(p),message:"",button:p};return $e.click.btn(m),$e.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((p,[h,g])=>(this.options.disable.formActions.includes(h)||p.push(g),p),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:p}=this.options.panels;this.panels=new nd({panels:t,type:"controls",displayType:p});const h=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=V.create({className:h,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const c=V.create({className:m,content:[g,n]}),d=c.getElementsByClassName("control-group");this.dom=c,this.groups=d;const[r]=d;this.currentGroup=r,this.actions={filter:o=>{const a=o!=="",s=this.controls;let i=g.querySelector(".filtered-term");if(V.toggleElementsByStr(s,o),a){const u=X.get("controls.filteringTerm",o);c.classList.add("filtered"),i?i.textContent=u:(i=V.create({tag:"h5",className:"filtered-term",content:u}),g.insertBefore(i,g.firstChild))}else i&&(c.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:o=>console.log(o)};for(let o=d.length-1;o>=0;o--){const a=`formeo-controls-${d[o]}`;this.options.sortable||globalThis.localStorage.removeItem(a),te.create(d[o],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:s,item:i})=>{if(s.id=i.id,this.options.ghostPreview){const{controlData:u}=this.get(i.id);xt(async()=>{const{default:f}=await Promise.resolve().then(()=>Fm);return{default:f}},void 0).then(({default:f})=>{s.innerHTML="",s.appendChild(new f(u).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const s=globalThis.localStorage.getItem(a);return s?s.split("|"):[]},set:s=>{const i=s.toArray();globalThis.localStorage.setItem(a,i.join("|"))}}})}return c}layoutTypes={row:()=>rn.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:t,id:n},...p}=Re(this.get(e),"controlData");return Yn(p,"config.controlId",n),t==="layout"?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(p)};applyOptions=async(e={})=>{const{container:t,elements:n,groupOrder:p,...h}=Ve(Dm,e);this.container=t,this.groupOrder=mt(p.concat(["common","html","layout"])),this.options=h;const[g,m,c]=await Promise.all([xt(()=>import("./index.min.js"),[]),xt(()=>import("./index.min2.js"),[]),xt(()=>import("./index.min3.js"),[])]),d=[g.default,m.default,c.default].flat();return Promise.all(this.registerControls([...d,...n]))}};const Dt=new rd,Om=Object.freeze(Object.defineProperty({__proto__:null,Controls:rd,default:Dt},Symbol.toStringTag,{value:"Module"})),Im=new Set(["checkbox","radio"]),Nm=new Set(["radio","checkbox","select-one","select-multiple"]);class od extends Jn{constructor(e=Object.create(null)){super("field",e),this.debouncedUpdateEditPanels=_n(this.updateEditPanels),this.debouncedUpdatePreview=_n(this.updatePreview),this.label=V.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const t=this.getActionButtons(),n=this.actionButtons.some(h=>h.meta?.id==="edit");this.updateEditPanels();const p=V.create({tag:"li",attrs:{className:Ft},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:X.get("field")}});this.dom=p,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const{label:t,editorLabel:n,disableHtmlLabel:p,helpText:h,tooltip:g}=this.get("config"),{required:m}=this.get("attrs")||{},c=n||t,d={tag:"label",attrs:{}};return p?(d.tag="input",d.attrs.value=c):(d.attrs.contenteditable=!0,d.children=c),{className:"prev-label",children:[{...d,action:{input:({target:{innerHTML:a,value:s}})=>{const i=p?s:a;super.set("config.label",i);const u=this.dom.querySelector(".config-label");u&&(u.value=i)}}},m&&V.requiredMark(),g&&V.tooltip(g),h&&V.helpText(h)]}}setData=(e,t)=>super.set(e,t);set(e,t){return this.setData(e,t)}updateLabel(){const e=V.create(this.labelConfig);(this.label||!e)&&this.label.remove(),e&&(this.data.config?.labelAfter?this.dom.append(e):this.dom.prepend(e)),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:t}=e,{type:n}=t;if(Nm.has(n)){const p=this.preview.querySelectorAll(":checked"),h=this.get("options"),g=h?.[0]?.selected===void 0?"checked":"selected",m=h.reduce((c,d)=>(c[d.value]=d,c[d.value][g]=!1,c),{});for(const c of p)m[c.value][g]=c.value===m[c.value].value;return super.set("options",Object.values(m)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const t=e.parentElement.classList;if(t.contains("f-checkbox")||t.contains("f-radio")){const p=e.parentElement,h=ct(p);return this.setData(`options[${h}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...t}=Je(this.data);t.id=`prev-${this.id}`,t.action=Object.entries(e).reduce((p,[h,g])=>(p[h]=g.bind(this),p),{}),this.data?.config.editableContent&&(t.attrs={...t.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:V.create(t,!0),action:this.defaultPreviewActions};return V.create(n,!0)}get isCheckable(){return Im.has(this.get("config.controlId"))}}const Fm=Object.freeze(Object.defineProperty({__proto__:null,default:od},Symbol.toStringTag,{value:"Module"})),Pm=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Hm=class extends Zn{constructor(e){super("fields",e),this.config={all:Pm()}}Component(e){return new od(e)}get=e=>{let t=e&&Re(this.data,e);if(!t){const n=Dt.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:p,...h}=n?.getData()||n;if(p?.length){let g=!0;if(p.length===1){const[m]=p;g=!!m.if[0].source}g&&(h.conditions=p)}return e[t]=h,e},{});load=(e=Object.create(null))=>{const t=Gn(e);this.empty();for(const[n,p]of Object.entries(t)){const{meta:h,...g}=p;h?.id&&Yn(g,"config.controlId",h?.id),this.add(n,g)}return this.data}};const sd=new Hm,xn=rn,Mn=sa,tn=id,En=sd,Hn=Dt,Wm=(l,e=!1)=>l?Je(Gn(l)):e&&oh.get(hh)||Tn();class ad extends Js{constructor(){super("components"),this.disableEvents=!0,this.stages=xn,this.rows=Mn,this.columns=tn,this.fields=En,this.controls=Hn}load=(e,t)=>{this.empty();const n=Wm(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",xn.load(n.stages)),this.add("rows",Mn.load(n.rows)),this.add("columns",tn.load(n.columns)),this.add("fields",En.load(n.fields));for(const p of Object.values(this.get("stages")))p.loadChildren();return this.data};flatList(){const e={};for(const t of Object.keys(this.data.stages))sh(this.data,t,"stages",e);return e}getChildData=({type:e,id:t})=>{const n=this.get(e,t);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Ws}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:rn.getData(),rows:sa.getData(),columns:id.getData(),fields:sd.getData()}}set config(e){const{stages:t,rows:n,columns:p,fields:h}=e;xn.config=t,Mn.config=n,tn.config=p,En.config=h}getIndex(e){return this[e]||this[Uf.get(e)]}setAddress(e,t){if(!Pe(e))return;const[n,p,...h]=Array.isArray(e)?e:yt(e),m=this.getIndex(n).get(p);return m?.set(h,t),m}getAddress(e){if(!Pe(e))return;const[t,n,...p]=Array.isArray(e)?e:yt(e),g=this.getIndex(t).get(n);if(!(p.length&&!g))return p.length?g.get(p):g}}const ce=new ad,zm=Object.freeze(Object.defineProperty({__proto__:null,Columns:tn,Components:ad,Controls:Hn,Dialog:Lt,Fields:En,Rows:Mn,Stages:xn,default:ce},Symbol.toStringTag,{value:"Module"})),gu="no-transition",Bm={debug:!1,bubbles:!0,formeoLoaded:l=>{},onAdd:()=>{},onChange:l=>J.opts?.debug&&console.log(l),onUpdate:l=>J.opts?.debug&&console.log(l),onUpdateStage:l=>J.opts?.debug&&console.log(l),onUpdateRow:l=>J.opts?.debug&&console.log(l),onUpdateColumn:l=>J.opts?.debug&&console.log(l),onUpdateField:l=>J.opts?.debug&&console.log(l),onAddRow:l=>J.opts?.debug&&console.log(l),onAddColumn:l=>J.opts?.debug&&console.log(l),onAddField:l=>J.opts?.debug&&console.log(l),onRemoveRow:l=>J.opts?.debug&&console.log(l),onRemoveColumn:l=>J.opts?.debug&&console.log(l),onRemoveField:l=>J.opts?.debug&&console.log(l),onRender:l=>J.opts?.debug&&console.log(l),onSave:l=>{},confirmClearAll:l=>{globalThis.confirm(l.confirmationMessage)&&l.clearAllAction(l)}},Be=({src:l,...e},t=nn)=>{const n=new globalThis.CustomEvent(t,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});if(n.data=(l||document).dispatchEvent(n),t===nn){const p=new globalThis.CustomEvent(np,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(p)}return n},J={init:function(l){return this.opts={...Bm,...l},this},formeoSaved:l=>Be(l,dh),formeoUpdated:(l,e)=>Be(l,e||nn),formeoCleared:l=>Be(l,ip),formeoOnRender:l=>Be(l,vh),formeoConditionUpdated:l=>Be(l,rp),formeoAddedRow:l=>Be(l,Us),formeoAddedColumn:l=>Be(l,Gs),formeoAddedField:l=>Be(l,qs),formeoRemovedRow:l=>Be(l,Ks),formeoRemovedColumn:l=>Be(l,Ys),formeoRemovedField:l=>Be(l,Zs)},jm=Nf(()=>{const l={timeStamp:globalThis.performance.now(),type:nn,detail:ce.formData};J.opts.onUpdate(l),J.opts.onChange!==J.opts.onUpdate&&J.opts.onChange(l)},vt);document.addEventListener(nn,jm);document.addEventListener(fh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateStage(p)});document.addEventListener(ph,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateRow(p)});document.addEventListener(gh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateColumn(p)});document.addEventListener(mh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateField(p)});document.addEventListener(Us,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddRow(p)});document.addEventListener(Gs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(p)});document.addEventListener(qs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddField(p)});document.addEventListener(Ks,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(p)});document.addEventListener(Ys,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveColumn(p)});document.addEventListener(Zs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveField(p)});document.addEventListener(vh,l=>{const{timeStamp:e,type:t,detail:n}=l;J.opts.onRender({timeStamp:e,type:t,detail:n})});document.addEventListener("confirmClearAll",l=>{l={timeStamp:l.timeStamp,type:l.type,confirmationMessage:l.detail.confirmationMessage,clearAllAction:l.detail.clearAllAction,btnCoords:l.detail.btnCoords},J.opts.confirmClearAll(l)});document.addEventListener(dh,({timeStamp:l,type:e,detail:{formData:t}})=>{const n={timeStamp:l,type:e,formData:t};J.opts.onSave(n)});document.addEventListener("formeoLoaded",l=>{J.opts.formeoLoaded(l.detail.formeo)});let Zo;function Vm(){Zo=Zo||window.requestAnimationFrame(()=>{Zo=!1;for(const l of Object.values(tn.data))l.dom.classList.add(gu),Hn.dom.classList.add(gu),Hn.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Vm);const mu={add:{attr:l=>{const e=globalThis.prompt(l.message.attr);if(e&&l.isDisabled(e))return globalThis.alert(X.get("attributeNotPermitted",e)),$e.add.attrs(l);let t;e&&(t=String(globalThis.prompt(l.message.value,"")),l.addAction(e,t))},option:l=>{l.addAction()},condition:l=>{l.addAction(l)},config:l=>{l.addAction(l)}},remove:{attrs:l=>{l.removeAction()},options:l=>{l.removeAction()},conditions:l=>{l.removeAction()}},click:{btn:l=>{l.action()}},save:{form:Cs}},$e={init:function(l){const e=Object.keys(mu);return this.opts=e.reduce((t,n)=>(t[n]={...mu[n],...l[n]},t),l),this},add:{attrs:l=>$e.opts.add.attr(l),options:l=>$e.opts.add.option(l),conditions:l=>(l.template=l.template||Xs(),$e.opts.add.condition(l)),config:l=>$e.opts.add.config(l)},remove:{attrs:l=>$e.opts.remove.attrs(l),options:l=>$e.opts.remove.options(l),conditions:l=>$e.opts.remove.conditions(l)},click:{btn:l=>$e.opts.click.btn(l)},save:{form:l=>($e.opts.sessionStorage&&oh.set(hh,l),J.formeoSaved({formData:l}),$e.opts.save.form(l))}},Um={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:zf,iconFont:null,config:{},events:{},actions:{},controls:{},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let ld=class{constructor({formData:e,...t},n){const p=Ve(Um.editor,t),{actions:h,events:g,debug:m,config:c,editorContainer:d,...r}=p;d&&(this.editorContainer=typeof d=="string"?document.querySelector(d):d),this.opts=r,V.setOptions=r,ce.config=c,this.userFormData=n||e,this.Components=ce,this.dom=V,J.init({debug:m,...g}),$e.init({debug:m,sessionStorage:r.sessionStorage,...h}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){this.userFormData=Mt(e),this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){this.userFormData=Tn(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[Fg(this.opts.svgSprite),Hg(this.opts.style),X.init({preloaded:{"en-US":pd},...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(oc)})].filter(Boolean);await Promise.all(e),this.opts.allowEdit&&this.init()}init(){return Dt.init(this.opts.controls,this.opts.stickyControls).then(e=>{this.controls=e,this.load(this.userFormData,this.opts),this.formId=ce.get("id"),this.i18n={setLang:t=>{globalThis.sessionStorage?.setItem(oc,t),X.setCurrent(t).then(()=>{this.init()},console.error)}},this.opts.onLoad?.(this),this.tooltipInstance=new Bu})}load(e=this.userFormData,t=this.opts){this.Components.load(e,t),this.render()}render(){if(!this.controls)return globalThis.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(ce.get("stages")),this.opts.controlOnLeft)for(const n of this.stages)n.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:n})=>n)]};X.current.dir&&(e.attrs.dir=X.current.dir,V.dir=X.current.dir),this.editor=V.create(e),(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(V.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),J.formeoLoaded=new globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(J.formeoLoaded)}};const mn="f-",vu=l=>typeof l=="string"?document.querySelector(l):l,Gm=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const p={renderContainer:vu(e),editorContainer:vu(l),formData:Mt(t)};return{elements:{},...n,...p}},vn=l=>l.match(cp)?.[0]||l,yu=l=>{if(!l||l.hasAttribute("hidden")||l.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(l);return!(e.display==="none"||e.visibility==="hidden"||e.opacity==="0")},qm={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>yu(l),isNotVisible:l=>!yu(l)},Km=()=>V.btnTemplate({className:"remove-input-group",children:V.icon("remove"),action:{mouseover:({target:l})=>l.parentElement.classList.add("will-remove"),mouseleave:({target:l})=>l.parentElement.classList.remove("will-remove"),click:({target:l})=>l.parentElement.remove()}}),bu={equals:xs,notEquals:(l,e)=>!xs(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Ym=Object.entries(yh).reduce((l,[e,t])=>(l[t]=bu[e],l[e]=bu[e],l),{}),wu={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Zm=Object.entries(bh).reduce((l,[e,t])=>(l[t]=wu[e],l[e]=wu[e],l),{}),Xm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Zm[e]?.(l,t),p=new Event("input",{bubbles:!0});return l.dispatchEvent(p),n},isNotVisible:l=>{l?._required===void 0&&(l._required=l.required),l.parentElement.setAttribute("hidden",!0),l.required=!1},isVisible:l=>{l.parentElement.removeAttribute("hidden"),l.required=l._required}};let cd=class{constructor(e,t){const{renderContainer:n,elements:p,formData:h,config:g}=Gm(e);this.container=n,this.form=Mt(t||h),this.elements=p,this.config=g,this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=Mt(e)}get userData(){const e=this.container.querySelector(".formeo-render")||this.renderedForm;if(!e)return{};const t=new FormData(e),n={};for(const[p,h]of t.entries())n[p]?Array.isArray(n[p])?n[p].push(h):n[p]=[n[p],h]:n[p]=h;return n}get userFormData(){const e=[];for(const[t,n]of Object.entries(this.userData)){const p={key:t,value:n,label:this.components[vn(t)]?.config?.label||""};e.push(p)}return e}set userData(e={}){const t=this.container.querySelector("form");for(const n of Object.keys(e)){const p=t.elements[n];if(p.length&&p[0].type==="checkbox"){const h=Array.isArray(e[n])?e[n]:[e[n]];for(const g of p)g.checked=h.includes(g.value)}else if(p.length&&p[0].type==="radio")for(const h of p)h.checked=h.value===e[n];else p.type&&(p.value=e[n])}}render(e=this.form){this.form=Mt(e);const t=this.getRenderedForm(e),n=this.container.querySelector(".formeo-render");n?n.replaceWith(t):this.container.appendChild(t)}getRenderedForm(e=this.form){this.form=Mt(e);const t=document.getElementsByClassName("formeo-render").length,n={...this.config,tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${t}`,children:this.processedData};return this.renderedForm=V.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,t)=>t.reduce((n,p)=>(n.push(this.form[e][p]),n),[]);prefixId=e=>mn+e;processColumn=({id:e,...t})=>({...t,id:this.prefixId(e),children:this.processFields(t.children),style:`width: ${t.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((t,n)=>(n&&t.push(this.processRow(n)),t),[]);cacheComponent=e=>(this.components[vn(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:p}=e,h=[`formeo-${t}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(p)};this.cacheComponent(g);const c=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>g},{condition:n.inputGroup,result:()=>this.addButton(p)}].reduce((d,{condition:r,result:o})=>(r&&d.push(o()),d),[]);return n.inputGroup&&h.push(`${mn}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:h,children:c}};cloneComponentData=e=>{const{children:t=[],id:n,attrs:p={},...h}=this.components[e],g={...p,"data-clone-of":n};return h.tag==="input"&&(g.name=qh(this.components[e])),{...h,id:mn+He(n),children:t?.length&&t.map(({id:m})=>this.cloneComponentData(vn(m))),attrs:g}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:t=>{const n=t.target.parentElement,p=V.create(this.cloneComponentData(e));n.insertBefore(p,n.lastChild);const h=V.create(Km());p.appendChild(h)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(t=>this.cacheComponent(this.processColumn(t)));processFields=e=>this.orderChildren("fields",e).map(({id:t,...n})=>{const p=n.config?.controlId||n.meta?.id,{action:h={},dependencies:g={}}=this.elements[p]||{};g&&Gh(g);const m=Ve({action:h},n);return this.cacheComponent({...m,id:this.prefixId(t)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=Nt,this.components[vn(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const p=Jm(e);p&&e.addEventListener(p,g=>{if(this.evaluateCondition(t,g))for(const m of n)this.execResult(m,g)},!1);const h={target:e};if(this.evaluateCondition(t,h))for(const g of n)this.execResult(g,h)};applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const t of e){const{if:n,then:p}=t;for(const h of n){const{source:g,target:m}=h;if(Pe(g)){const{component:c,options:d}=this.getComponent(g),r=d||c;this.handleComponentCondition(r,h,p)}if(Pe(m)){const{component:c,options:d}=this.getComponent(m),r=d||c;this.handleComponentCondition(r,h,p)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:p,target:h})=>{const g=this.getComponentProperty(e,t);if(typeof g=="boolean")return g;const m=String(Pe(h)?this.getComponentProperty(h,n):h);return Ym[p]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:p})=>{if(Pe(e)){const{component:h,option:g}=this.getComponent(e),m=g||h;Xm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),h=p||n;return qm[t]?.(h)||h[t]};getComponent=e=>{const t={component:null};if(!Pe(e))return null;const[,n,p,h]=yt(e),g=this.renderedForm.querySelector(`#${mn}${n}`);if(!g)return t;if(t.component=g,p){const m=g.querySelectorAll("input"),c=m[h];return t.options=m,t.option=c,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const Qm=[["input",l=>["textarea","text"].includes(l.type)],["change",l=>["select"].includes(l.tagName.toLowerCase())||["checkbox","radio"].includes(l.type)]],Jm=l=>{const[e]=Qm.find(t=>t[1](l))||[!1];return e};window!==void 0&&(window.FormeoEditor=ld,window.FormeoRenderer=cd);const aa=ld,la=cd,ev={rows:{all:{events:{onAdd:l=>{if(console.log(`You just added a new row with the id "${l.target.id}"`,l.index),l.index===2){const e=l.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{l.target.addChild()}),e.appendChild(t)}}}}},fields:{all:{panels:{attrs:{}},events:{onRemove:l=>{console.log(`You just removed the field with the id "${l.target.id}"`,l)}}},"text-input":{attrs:{type:[{label:"text",value:"text"},{label:"phone",value:"phone"},{label:"email",value:"email"}]},config:{helpText:"This is a custom help text for text input fields.",hideLabel:!1}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},tv={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},nv=".build-form",iv=".render-form",on={editorContainer:nv,actions:{},controls:tv,config:ev,events:{onSave:console.log,onChange:console.log},style:null,sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},ca={renderContainer:iv,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;globalThis.tinymce.remove(e),globalThis.tinymce.init({selector:e})}}}}}};async function rv(l){l.innerHTML=`
10
+ `),n={};for(let d,h=0;h<t.length;h++)d=/^(.+?) *?= *?([^\n]+)/.exec(t[h]),d&&(n[d[1]]=d[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(d,h){if(n.loaded.indexOf(e)!==-1&&t)return n.applyLanguage(n.langs[e]),d(n.langs[e]);{const g=[n.config.location,e,n.config.extension].join("");return md(g).then(m=>{const c=Xt.processFile(m);return n.applyLanguage(e,c),n.loaded.push(e),d(n.langs[e])}).catch(m=>{console.error(m);const c=n.applyLanguage(e);d(c)})}})}applyLanguage(e,t={}){const n=this.config.override[e]||{},d=this.langs[e]||{};return this.langs[e]={...d,...t,...n},this.langs[e]}get getLangs(){return this.config.langs}async setCurrent(e="en-US"){return await this.loadLang(e),this.locale=e,this.current=this.langs[e],this.current}}const X=new Xt;(function(){try{if(typeof document<"u"){var l=document.createElement("style");l.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(l)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var vd=Object.defineProperty,yd=(l,e,t)=>e in l?vd(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Xe=(l,e,t)=>yd(l,typeof e!="symbol"?e+"":e,t);const bd="_3x4ZIcu-",wd="JIt36hCJ",zt={tooltip:bd,visible:wd},Cd={triggerName:"tooltip"};class Uu{constructor(e=Cd){Xe(this,"triggerName"),Xe(this,"tooltip"),Xe(this,"activeTriggerType",null),Xe(this,"spacing",12),Xe(this,"handleClick",t=>{const n=this.triggerName,d=t.target.closest(`[${n}][${n}-type="click"]`);if(d)if(this.isVisible())this.hide();else{const h=d.getAttribute(`${n}`);this.show(d,h),this.activeTriggerType="click"}else this.hide()}),Xe(this,"handleMouseOver",t=>{const n=this.triggerName,d=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&d?.getAttribute(`${n}-type`)!=="click"){const h=d?.getAttribute(`${n}`);h&&(this.show(d,h),this.activeTriggerType="hover")}}),Xe(this,"handleMouseOut",t=>{const n=this.triggerName,d=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&d?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Xe(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Xe(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),this.triggerName=`data-${e.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${zt.tooltip}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(zt.visible)}calculatePosition(e){const t=e.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),d=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return d.find(h=>this.fitsInViewport(h,n))||d[0]}fitsInViewport(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight?[[e.x,e.y],[e.x+t.width,e.y],[e.x,e.y+t.height],[e.x+t.width,e.y+t.height],[e.x+t.width/2,e.y+t.height/2]].flatMap(([m,c])=>Array.from(document.elementsFromPoint(m,c))).filter(m=>{if(this.tooltip.contains(m)||m===this.tooltip||m.classList.contains(zt.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(zt.visible);const n=this.calculatePosition(e);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(zt.visible),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}window!==void 0&&(window.SmartTooltip=Uu);const Sd="formeo",Ad="5.0.1",Gu={name:Sd,version:Ad};var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ri,va;function xd(){if(va)return ri;va=1;function l(){this.__data__=[],this.size=0}return ri=l,ri}var oi,ya;function ln(){if(ya)return oi;ya=1;function l(e,t){return e===t||e!==e&&t!==t}return oi=l,oi}var si,ba;function zn(){if(ba)return si;ba=1;var l=ln();function e(t,n){for(var d=t.length;d--;)if(l(t[d][0],n))return d;return-1}return si=e,si}var ai,wa;function Ed(){if(wa)return ai;wa=1;var l=zn(),e=Array.prototype,t=e.splice;function n(d){var h=this.__data__,g=l(h,d);if(g<0)return!1;var m=h.length-1;return g==m?h.pop():t.call(h,g,1),--this.size,!0}return ai=n,ai}var li,Ca;function Md(){if(Ca)return li;Ca=1;var l=zn();function e(t){var n=this.__data__,d=l(n,t);return d<0?void 0:n[d][1]}return li=e,li}var ci,Sa;function $d(){if(Sa)return ci;Sa=1;var l=zn();function e(t){return l(this.__data__,t)>-1}return ci=e,ci}var ui,Aa;function Td(){if(Aa)return ui;Aa=1;var l=zn();function e(t,n){var d=this.__data__,h=l(d,t);return h<0?(++this.size,d.push([t,n])):d[h][1]=n,this}return ui=e,ui}var hi,xa;function Bn(){if(xa)return hi;xa=1;var l=xd(),e=Ed(),t=Md(),n=$d(),d=Td();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=d,hi=h,hi}var di,Ea;function _d(){if(Ea)return di;Ea=1;var l=Bn();function e(){this.__data__=new l,this.size=0}return di=e,di}var fi,Ma;function Ld(){if(Ma)return fi;Ma=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return fi=l,fi}var pi,$a;function Rd(){if($a)return pi;$a=1;function l(e){return this.__data__.get(e)}return pi=l,pi}var gi,Ta;function kd(){if(Ta)return gi;Ta=1;function l(e){return this.__data__.has(e)}return gi=l,gi}var mi,_a;function qu(){if(_a)return mi;_a=1;var l=typeof dn=="object"&&dn&&dn.Object===Object&&dn;return mi=l,mi}var vi,La;function Ze(){if(La)return vi;La=1;var l=qu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return vi=t,vi}var yi,Ra;function jn(){if(Ra)return yi;Ra=1;var l=Ze(),e=l.Symbol;return yi=e,yi}var bi,ka;function Dd(){if(ka)return bi;ka=1;var l=jn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,d=l?l.toStringTag:void 0;function h(g){var m=t.call(g,d),c=g[d];try{g[d]=void 0;var f=!0}catch{}var r=n.call(g);return f&&(m?g[d]=c:delete g[d]),r}return bi=h,bi}var wi,Da;function Od(){if(Da)return wi;Da=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return wi=t,wi}var Ci,Oa;function Ft(){if(Oa)return Ci;Oa=1;var l=jn(),e=Dd(),t=Od(),n="[object Null]",d="[object Undefined]",h=l?l.toStringTag:void 0;function g(m){return m==null?m===void 0?d:n:h&&h in Object(m)?e(m):t(m)}return Ci=g,Ci}var Si,Ia;function ht(){if(Ia)return Si;Ia=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Si=l,Si}var Ai,Na;function ks(){if(Na)return Ai;Na=1;var l=Ft(),e=ht(),t="[object AsyncFunction]",n="[object Function]",d="[object GeneratorFunction]",h="[object Proxy]";function g(m){if(!e(m))return!1;var c=l(m);return c==n||c==d||c==t||c==h}return Ai=g,Ai}var xi,Fa;function Id(){if(Fa)return xi;Fa=1;var l=Ze(),e=l["__core-js_shared__"];return xi=e,xi}var Ei,Pa;function Nd(){if(Pa)return Ei;Pa=1;var l=Id(),e=(function(){var n=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return Ei=t,Ei}var Mi,Ha;function Ku(){if(Ha)return Mi;Ha=1;var l=Function.prototype,e=l.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Mi=t,Mi}var $i,Wa;function Fd(){if(Wa)return $i;Wa=1;var l=ks(),e=Nd(),t=ht(),n=Ku(),d=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,c=g.toString,f=m.hasOwnProperty,r=RegExp("^"+c.call(f).replace(d,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o(a){if(!t(a)||e(a))return!1;var s=l(a)?r:h;return s.test(n(a))}return $i=o,$i}var Ti,za;function Pd(){if(za)return Ti;za=1;function l(e,t){return e?.[t]}return Ti=l,Ti}var _i,Ba;function St(){if(Ba)return _i;Ba=1;var l=Fd(),e=Pd();function t(n,d){var h=e(n,d);return l(h)?h:void 0}return _i=t,_i}var Li,ja;function Ds(){if(ja)return Li;ja=1;var l=St(),e=Ze(),t=l(e,"Map");return Li=t,Li}var Ri,Va;function Vn(){if(Va)return Ri;Va=1;var l=St(),e=l(Object,"create");return Ri=e,Ri}var ki,Ua;function Hd(){if(Ua)return ki;Ua=1;var l=Vn();function e(){this.__data__=l?l(null):{},this.size=0}return ki=e,ki}var Di,Ga;function Wd(){if(Ga)return Di;Ga=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Di=l,Di}var Oi,qa;function zd(){if(qa)return Oi;qa=1;var l=Vn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function d(h){var g=this.__data__;if(l){var m=g[h];return m===e?void 0:m}return n.call(g,h)?g[h]:void 0}return Oi=d,Oi}var Ii,Ka;function Bd(){if(Ka)return Ii;Ka=1;var l=Vn(),e=Object.prototype,t=e.hasOwnProperty;function n(d){var h=this.__data__;return l?h[d]!==void 0:t.call(h,d)}return Ii=n,Ii}var Ni,Ya;function jd(){if(Ya)return Ni;Ya=1;var l=Vn(),e="__lodash_hash_undefined__";function t(n,d){var h=this.__data__;return this.size+=this.has(n)?0:1,h[n]=l&&d===void 0?e:d,this}return Ni=t,Ni}var Fi,Za;function Vd(){if(Za)return Fi;Za=1;var l=Hd(),e=Wd(),t=zd(),n=Bd(),d=jd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=d,Fi=h,Fi}var Pi,Xa;function Ud(){if(Xa)return Pi;Xa=1;var l=Vd(),e=Bn(),t=Ds();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return Pi=n,Pi}var Hi,Qa;function Gd(){if(Qa)return Hi;Qa=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Hi=l,Hi}var Wi,Ja;function Un(){if(Ja)return Wi;Ja=1;var l=Gd();function e(t,n){var d=t.__data__;return l(n)?d[typeof n=="string"?"string":"hash"]:d.map}return Wi=e,Wi}var zi,el;function qd(){if(el)return zi;el=1;var l=Un();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return zi=e,zi}var Bi,tl;function Kd(){if(tl)return Bi;tl=1;var l=Un();function e(t){return l(this,t).get(t)}return Bi=e,Bi}var ji,nl;function Yd(){if(nl)return ji;nl=1;var l=Un();function e(t){return l(this,t).has(t)}return ji=e,ji}var Vi,il;function Zd(){if(il)return Vi;il=1;var l=Un();function e(t,n){var d=l(this,t),h=d.size;return d.set(t,n),this.size+=d.size==h?0:1,this}return Vi=e,Vi}var Ui,rl;function Os(){if(rl)return Ui;rl=1;var l=Ud(),e=qd(),t=Kd(),n=Yd(),d=Zd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=d,Ui=h,Ui}var Gi,ol;function Xd(){if(ol)return Gi;ol=1;var l=Bn(),e=Ds(),t=Os(),n=200;function d(h,g){var m=this.__data__;if(m instanceof l){var c=m.__data__;if(!e||c.length<n-1)return c.push([h,g]),this.size=++m.size,this;m=this.__data__=new t(c)}return m.set(h,g),this.size=m.size,this}return Gi=d,Gi}var qi,sl;function Yu(){if(sl)return qi;sl=1;var l=Bn(),e=_d(),t=Ld(),n=Rd(),d=kd(),h=Xd();function g(m){var c=this.__data__=new l(m);this.size=c.size}return g.prototype.clear=e,g.prototype.delete=t,g.prototype.get=n,g.prototype.has=d,g.prototype.set=h,qi=g,qi}var Ki,al;function Zu(){if(al)return Ki;al=1;var l=St(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Ki=e,Ki}var Yi,ll;function Is(){if(ll)return Yi;ll=1;var l=Zu();function e(t,n,d){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:d,writable:!0}):t[n]=d}return Yi=e,Yi}var Zi,cl;function Xu(){if(cl)return Zi;cl=1;var l=Is(),e=ln();function t(n,d,h){(h!==void 0&&!e(n[d],h)||h===void 0&&!(d in n))&&l(n,d,h)}return Zi=t,Zi}var Xi,ul;function Qd(){if(ul)return Xi;ul=1;function l(e){return function(t,n,d){for(var h=-1,g=Object(t),m=d(t),c=m.length;c--;){var f=m[e?c:++h];if(n(g[f],f,g)===!1)break}return t}}return Xi=l,Xi}var Qi,hl;function Jd(){if(hl)return Qi;hl=1;var l=Qd(),e=l();return Qi=e,Qi}var Ut={exports:{}};Ut.exports;var dl;function ef(){return dl||(dl=1,(function(l,e){var t=Ze(),n=e&&!e.nodeType&&e,d=n&&!0&&l&&!l.nodeType&&l,h=d&&d.exports===n,g=h?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function c(f,r){if(r)return f.slice();var o=f.length,a=m?m(o):new f.constructor(o);return f.copy(a),a}l.exports=c})(Ut,Ut.exports)),Ut.exports}var Ji,fl;function Qu(){if(fl)return Ji;fl=1;var l=Ze(),e=l.Uint8Array;return Ji=e,Ji}var er,pl;function tf(){if(pl)return er;pl=1;var l=Qu();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return er=e,er}var tr,gl;function nf(){if(gl)return tr;gl=1;var l=tf();function e(t,n){var d=n?l(t.buffer):t.buffer;return new t.constructor(d,t.byteOffset,t.length)}return tr=e,tr}var nr,ml;function rf(){if(ml)return nr;ml=1;function l(e,t){var n=-1,d=e.length;for(t||(t=Array(d));++n<d;)t[n]=e[n];return t}return nr=l,nr}var ir,vl;function of(){if(vl)return ir;vl=1;var l=ht(),e=Object.create,t=(function(){function n(){}return function(d){if(!l(d))return{};if(e)return e(d);n.prototype=d;var h=new n;return n.prototype=void 0,h}})();return ir=t,ir}var rr,yl;function Ju(){if(yl)return rr;yl=1;function l(e,t){return function(n){return e(t(n))}}return rr=l,rr}var or,bl;function eh(){if(bl)return or;bl=1;var l=Ju(),e=l(Object.getPrototypeOf,Object);return or=e,or}var sr,wl;function Ns(){if(wl)return sr;wl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,d=typeof n=="function"&&n.prototype||l;return t===d}return sr=e,sr}var ar,Cl;function sf(){if(Cl)return ar;Cl=1;var l=of(),e=eh(),t=Ns();function n(d){return typeof d.constructor=="function"&&!t(d)?l(e(d)):{}}return ar=n,ar}var lr,Sl;function At(){if(Sl)return lr;Sl=1;function l(e){return e!=null&&typeof e=="object"}return lr=l,lr}var cr,Al;function af(){if(Al)return cr;Al=1;var l=Ft(),e=At(),t="[object Arguments]";function n(d){return e(d)&&l(d)==t}return cr=n,cr}var ur,xl;function th(){if(xl)return ur;xl=1;var l=af(),e=At(),t=Object.prototype,n=t.hasOwnProperty,d=t.propertyIsEnumerable,h=l((function(){return arguments})())?l:function(g){return e(g)&&n.call(g,"callee")&&!d.call(g,"callee")};return ur=h,ur}var hr,El;function xt(){if(El)return hr;El=1;var l=Array.isArray;return hr=l,hr}var dr,Ml;function nh(){if(Ml)return dr;Ml=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return dr=e,dr}var fr,$l;function Gn(){if($l)return fr;$l=1;var l=ks(),e=nh();function t(n){return n!=null&&e(n.length)&&!l(n)}return fr=t,fr}var pr,Tl;function lf(){if(Tl)return pr;Tl=1;var l=Gn(),e=At();function t(n){return e(n)&&l(n)}return pr=t,pr}var Gt={exports:{}},gr,_l;function cf(){if(_l)return gr;_l=1;function l(){return!1}return gr=l,gr}Gt.exports;var Ll;function Fs(){return Ll||(Ll=1,(function(l,e){var t=Ze(),n=cf(),d=e&&!e.nodeType&&e,h=d&&!0&&l&&!l.nodeType&&l,g=h&&h.exports===d,m=g?t.Buffer:void 0,c=m?m.isBuffer:void 0,f=c||n;l.exports=f})(Gt,Gt.exports)),Gt.exports}var mr,Rl;function uf(){if(Rl)return mr;Rl=1;var l=Ft(),e=eh(),t=At(),n="[object Object]",d=Function.prototype,h=Object.prototype,g=d.toString,m=h.hasOwnProperty,c=g.call(Object);function f(r){if(!t(r)||l(r)!=n)return!1;var o=e(r);if(o===null)return!0;var a=m.call(o,"constructor")&&o.constructor;return typeof a=="function"&&a instanceof a&&g.call(a)==c}return mr=f,mr}var vr,kl;function hf(){if(kl)return vr;kl=1;var l=Ft(),e=nh(),t=At(),n="[object Arguments]",d="[object Array]",h="[object Boolean]",g="[object Date]",m="[object Error]",c="[object Function]",f="[object Map]",r="[object Number]",o="[object Object]",a="[object RegExp]",s="[object Set]",i="[object String]",u="[object WeakMap]",p="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",M="[object Float64Array]",x="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",$="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",T="[object Uint32Array]",D={};D[b]=D[M]=D[x]=D[A]=D[S]=D[$]=D[R]=D[L]=D[T]=!0,D[n]=D[d]=D[p]=D[h]=D[y]=D[g]=D[m]=D[c]=D[f]=D[r]=D[o]=D[a]=D[s]=D[i]=D[u]=!1;function w(v){return t(v)&&e(v.length)&&!!D[l(v)]}return vr=w,vr}var yr,Dl;function df(){if(Dl)return yr;Dl=1;function l(e){return function(t){return e(t)}}return yr=l,yr}var qt={exports:{}};qt.exports;var Ol;function ff(){return Ol||(Ol=1,(function(l,e){var t=qu(),n=e&&!e.nodeType&&e,d=n&&!0&&l&&!l.nodeType&&l,h=d&&d.exports===n,g=h&&t.process,m=(function(){try{var c=d&&d.require&&d.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();l.exports=m})(qt,qt.exports)),qt.exports}var br,Il;function Ps(){if(Il)return br;Il=1;var l=hf(),e=df(),t=ff(),n=t&&t.isTypedArray,d=n?e(n):l;return br=d,br}var wr,Nl;function ih(){if(Nl)return wr;Nl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return wr=l,wr}var Cr,Fl;function rh(){if(Fl)return Cr;Fl=1;var l=Is(),e=ln(),t=Object.prototype,n=t.hasOwnProperty;function d(h,g,m){var c=h[g];(!(n.call(h,g)&&e(c,m))||m===void 0&&!(g in h))&&l(h,g,m)}return Cr=d,Cr}var Sr,Pl;function pf(){if(Pl)return Sr;Pl=1;var l=rh(),e=Is();function t(n,d,h,g){var m=!h;h||(h={});for(var c=-1,f=d.length;++c<f;){var r=d[c],o=g?g(h[r],n[r],r,h,n):void 0;o===void 0&&(o=n[r]),m?e(h,r,o):l(h,r,o)}return h}return Sr=t,Sr}var Ar,Hl;function gf(){if(Hl)return Ar;Hl=1;function l(e,t){for(var n=-1,d=Array(e);++n<e;)d[n]=t(n);return d}return Ar=l,Ar}var xr,Wl;function Hs(){if(Wl)return xr;Wl=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,d){var h=typeof n;return d=d??l,!!d&&(h=="number"||h!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<d}return xr=t,xr}var Er,zl;function oh(){if(zl)return Er;zl=1;var l=gf(),e=th(),t=xt(),n=Fs(),d=Hs(),h=Ps(),g=Object.prototype,m=g.hasOwnProperty;function c(f,r){var o=t(f),a=!o&&e(f),s=!o&&!a&&n(f),i=!o&&!a&&!s&&h(f),u=o||a||s||i,p=u?l(f.length,String):[],y=p.length;for(var b in f)(r||m.call(f,b))&&!(u&&(b=="length"||s&&(b=="offset"||b=="parent")||i&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||d(b,y)))&&p.push(b);return p}return Er=c,Er}var Mr,Bl;function mf(){if(Bl)return Mr;Bl=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Mr=l,Mr}var $r,jl;function vf(){if(jl)return $r;jl=1;var l=ht(),e=Ns(),t=mf(),n=Object.prototype,d=n.hasOwnProperty;function h(g){if(!l(g))return t(g);var m=e(g),c=[];for(var f in g)f=="constructor"&&(m||!d.call(g,f))||c.push(f);return c}return $r=h,$r}var Tr,Vl;function sh(){if(Vl)return Tr;Vl=1;var l=oh(),e=vf(),t=Gn();function n(d){return t(d)?l(d,!0):e(d)}return Tr=n,Tr}var _r,Ul;function yf(){if(Ul)return _r;Ul=1;var l=pf(),e=sh();function t(n){return l(n,e(n))}return _r=t,_r}var Lr,Gl;function bf(){if(Gl)return Lr;Gl=1;var l=Xu(),e=ef(),t=nf(),n=rf(),d=sf(),h=th(),g=xt(),m=lf(),c=Fs(),f=ks(),r=ht(),o=uf(),a=Ps(),s=ih(),i=yf();function u(p,y,b,M,x,A,S){var $=s(p,b),R=s(y,b),L=S.get(R);if(L){l(p,b,L);return}var T=A?A($,R,b+"",p,y,S):void 0,D=T===void 0;if(D){var w=g(R),v=!w&&c(R),C=!w&&!v&&a(R);T=R,w||v||C?g($)?T=$:m($)?T=n($):v?(D=!1,T=e(R,!0)):C?(D=!1,T=t(R,!0)):T=[]:o(R)||h(R)?(T=$,h($)?T=i($):(!r($)||f($))&&(T=d(R))):D=!1}D&&(S.set(R,T),x(T,R,M,A,S),S.delete(R)),l(p,b,T)}return Lr=u,Lr}var Rr,ql;function wf(){if(ql)return Rr;ql=1;var l=Yu(),e=Xu(),t=Jd(),n=bf(),d=ht(),h=sh(),g=ih();function m(c,f,r,o,a){c!==f&&t(f,function(s,i){if(a||(a=new l),d(s))n(c,f,i,r,m,o,a);else{var u=o?o(g(c,i),s,i+"",c,f,a):void 0;u===void 0&&(u=s),e(c,i,u)}},h)}return Rr=m,Rr}var kr,Kl;function ah(){if(Kl)return kr;Kl=1;function l(e){return e}return kr=l,kr}var Dr,Yl;function Cf(){if(Yl)return Dr;Yl=1;function l(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return Dr=l,Dr}var Or,Zl;function Sf(){if(Zl)return Or;Zl=1;var l=Cf(),e=Math.max;function t(n,d,h){return d=e(d===void 0?n.length-1:d,0),function(){for(var g=arguments,m=-1,c=e(g.length-d,0),f=Array(c);++m<c;)f[m]=g[d+m];m=-1;for(var r=Array(d+1);++m<d;)r[m]=g[m];return r[d]=h(f),l(n,this,r)}}return Or=t,Or}var Ir,Xl;function Af(){if(Xl)return Ir;Xl=1;function l(e){return function(){return e}}return Ir=l,Ir}var Nr,Ql;function xf(){if(Ql)return Nr;Ql=1;var l=Af(),e=Zu(),t=ah(),n=e?function(d,h){return e(d,"toString",{configurable:!0,enumerable:!1,value:l(h),writable:!0})}:t;return Nr=n,Nr}var Fr,Jl;function Ef(){if(Jl)return Fr;Jl=1;var l=800,e=16,t=Date.now;function n(d){var h=0,g=0;return function(){var m=t(),c=e-(m-g);if(g=m,c>0){if(++h>=l)return arguments[0]}else h=0;return d.apply(void 0,arguments)}}return Fr=n,Fr}var Pr,ec;function Mf(){if(ec)return Pr;ec=1;var l=xf(),e=Ef(),t=e(l);return Pr=t,Pr}var Hr,tc;function $f(){if(tc)return Hr;tc=1;var l=ah(),e=Sf(),t=Mf();function n(d,h){return t(e(d,h,l),d+"")}return Hr=n,Hr}var Wr,nc;function Tf(){if(nc)return Wr;nc=1;var l=ln(),e=Gn(),t=Hs(),n=ht();function d(h,g,m){if(!n(m))return!1;var c=typeof g;return(c=="number"?e(m)&&t(g,m.length):c=="string"&&g in m)?l(m[g],h):!1}return Wr=d,Wr}var zr,ic;function _f(){if(ic)return zr;ic=1;var l=$f(),e=Tf();function t(n){return l(function(d,h){var g=-1,m=h.length,c=m>1?h[m-1]:void 0,f=m>2?h[2]:void 0;for(c=n.length>3&&typeof c=="function"?(m--,c):void 0,f&&e(h[0],h[1],f)&&(c=m<3?void 0:c,m=1),d=Object(d);++g<m;){var r=h[g];r&&n(d,r,g,c)}return d})}return zr=t,zr}var Br,rc;function Lf(){if(rc)return Br;rc=1;var l=wf(),e=_f(),t=e(function(n,d,h,g){l(n,d,h,g)});return Br=t,Br}var Rf=Lf();const kf=Nt(Rf),Df=()=>crypto.randomUUID().slice(0,8),Of=()=>Df().slice(0,8),oc=(l="",e)=>{if(!e)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof e=="string"?[e]:e;n=n.map(h=>h==="*"?"":h.replace(t,"\\$&"));let d=!0;return n.length&&(d=!new RegExp(n.join("|"),"i").exec(l)),d},If=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(Zf);return e&&Kf[e[0]]},yt=l=>Array.from(new Set(l)),We=l=>l?.attrs?.id||l?.id||Of(),Ue=(l,e)=>kf({},l,e,(n,d)=>{if(Array.isArray(n))return d!=null?yt(n.concat(d)):d;if(Array.isArray(d))return n!=null?yt(d.concat(n)):d}),Ke=l=>{let e;const t=l instanceof Promise;if(l===null||!(typeof l=="object")||t)return l;if(l instanceof Date)return e=new Date,e.setTime(l.getTime()),e;if(Array.isArray(l)){e=[];for(let d=0,h=l.length;d<h;d++)e[d]=Ke(l[d]);return e}if(l instanceof Object){e={};for(const d in l)Object.hasOwn(l,d)&&(e[d]=Ke(l[d]));return e}throw new Error("Unable to copy Object, type not supported.")},jr=(l,e)=>l/e*100,Cs=l=>`${l.toString()}%`,Ws=Object.create(null,{get:{value:l=>{const e=window.sessionStorage?.getItem(l);try{return JSON.parse(e)}catch{return e}}},set:{value:(l,e)=>{try{return window.sessionStorage?.setItem(l,JSON.stringify(e))}catch(t){console.error(t)}}}}),He=l=>/^(stage|row|column|field)s./.test(l),Nf=l=>Vf.test(l);function Ff(l,e=qs){let t=0;return function(...n){const d=Date.now();d-t>=e&&(t=d,l.apply(this,n))}}function Ln(l,e=bt){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>l.apply(this,n),e)}}function Ss(l){return l}function As(){}function qn(l=Object.create(null)){if(typeof l=="string")try{return JSON.parse(l)}catch(e){return console.error("Invalid JSON string provided:",e),Object.create(null)}return l}const vt=l=>l?Ke(qn(l)):Rt();function lh(l,e,t,n={}){if(!e||!l[t][e])return n;const d=`${t}.${e}`;n[d]=l[t][e];const h=Jf.get(t);if(h){const g=l[t][e].data?.children||[];for(const m of g)lh(l,m,h,n)}return n}const Pf='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acprefix__rect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="acprefix__layer1"><g id="acprefix__text4203"><g id="acprefix__g4212" transform="translate(0.10112835,0.1001358)"><path id="acprefix__path4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acprefix__path4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agprefix__rect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="aiprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="aiprefix__rect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol fill="#000000" viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqprefix__g4220"><rect id="aqprefix__rect4191" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqprefix__g4220-6"><rect id="aqprefix__rect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><path d="M2 7h2v2H2zM7 7h2v2H7zM12 7h2v2h-2zM2 12h2v2H2zM7 12h2v2H7zM12 12h2v2h-2z" transform="rotate(90 9.25 9.25)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><path d="M9.5-6.5h2v2h-2zm-5 0h2v2h-2zm5-5h2v2h-2zm-5 0h2v2h-2z" transform="rotate(90)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Zm10-5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-stage" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5h2v2H2zM7 4.5h2v2H7zM12 4.5h2v2h-2zM2 9.5h2v2H2zM7 9.5h2v2H7zM12 9.5h2v2h-2zM2-.5h2v2H2zM7-.5h2v2H7zM12-.5h2v2h-2z" transform="translate(0 2.5)"/></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="arprefix__icomoon-ignore"/><path fill="#000" d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h1v-1H0Zm15-7h1V4h-1zm-1 7h1v-1h-1zm-2 0h1v-1h-1zm-2 0h1v-1h-1Zm-2 0h1v-1H8Zm-2 0h1v-1H6Zm-2 0h1v-1H4Zm-2 0h1v-1H2Zm13-1h1v-1h-1ZM0 10h1V9H0Zm15-1h1V8h-1ZM0 8h1V7H0Zm15-1h1V6h-1ZM0 6h1V5H0Zm13-1h1V4h-1zm-2 0h1V4h-1ZM9 5h1V4H9ZM7 5h1V4H7ZM5 5h1V4H5ZM3 5h1V4H3ZM1 5h1V4H1Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 32 32" id="f-i-info-circle" xmlns="http://www.w3.org/2000/svg"><path d="m17.962 24.725 1.806.096v2.531h-7.534v-2.406l1.045-.094c.568-.063.916-.254.916-1.014v-8.801c0-.699-.188-.92-.791-.92l-1.106-.062v-2.626h5.666zM15.747 4.648c1.394 0 2.405 1.047 2.405 2.374 0 1.331-1.014 2.313-2.438 2.313-1.454 0-2.404-.982-2.404-2.313 0-1.327.95-2.374 2.437-2.374M16 32C7.178 32 0 24.822 0 16S7.178 0 16 0c8.82 0 16 7.178 16 16s-7.18 16-16 16m0-29C8.832 3 3 8.832 3 16s5.832 13 13 13 13-5.832 13-13S23.168 3 16 3"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="avprefix__icomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L18 12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><metadata id="axprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="3440" inkscape:window-height="1416" id="axprefix__namedview6" showgrid="false" inkscape:zoom="1.84375" inkscape:cx="421.4312" inkscape:cy="218.56484" inkscape:window-x="0" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"/><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z" id="axprefix__path4" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:connector-curvature="0" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:nodetypes="ccccccccccc"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-plus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12H18M12 6V18" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><path d="M193.694-139.2h87.322v510.916h-87.322zM-18.103 159.92V72.597h510.915v87.322z" transform="rotate(45 77.994 208.636)"/></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="bfprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="bfprefix__g7209"><path id="bfprefix__rect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bgprefix__XMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bhprefix__icomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="biprefix__XMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bjprefix__XMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="boprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',zs=Gu.name,Bs=Gu.version,Kn=zs,Hf="formeo-sprite",Wf=null,zf=`https://cdn.jsdelivr.net/npm/formeo@${Bs}/dist/${Hf}.svg`,Bf=`https://cdn.jsdelivr.net/npm/formeo@${Bs}/dist/formeo.min.css`,sc="https://draggable.github.io/formeo/assets/css/formeo.min.css",ch="f-panel",ct="control-group",Pt=`${Kn}-stage`,tt=`${Kn}-row`,nt=`${Kn}-column`,Ht=`${Kn}-field`,xs="custom-column-widths",uh="column-preset",Vr="resizing-columns",jf=new Map([[Pt,tt],[tt,nt],[nt,Ht]]),js=["stage","row","column","field"],Vs=js.map(l=>`${l}s`);new Map(Vs.map((l,e)=>[l,js[e]]));const Vf=new RegExp(`^${Vs.join("|")}.`),hh=[...js],Uf=[...Vs],Gf=new Map(Uf.map((l,e)=>[l,hh[e]])),Ur=hh.reduce((l,e)=>(l[e]=e,l),{}),qf=[{name:"controls",className:ct},{name:"stage",className:Pt},{name:"row",className:tt},{name:"column",className:nt},{name:"field",className:Ht}],Us={controls:ct,stage:Pt,row:tt,column:nt,field:Ht},Kf=Object.entries(Us).reduce((l,[e,t])=>(l[t]=e,l),{}),Yf=Object.values(Us),Zf=new RegExp(`${Yf.join("|")}`,"g"),{childTypeMapVals:dh,childTypeIndexMapVals:Xf}=qf.reduce((l,{name:e},t,n)=>{const{name:d}=n[t+1]||{};return d&&(l.childTypeMapVals.push([e,d]),l.childTypeIndexMapVals.push([`${e}s`,`${d}s`])),l},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Qf=dh.slice().map(l=>l.slice().reverse()).reverse(),ac=new Map(dh),Jf=new Map(Xf),ep=new Map(Qf.slice()),tp=[[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]],np=new Map(tp.reduce((l,e,t)=>(l.push([t,e]),l),[])),Gs=`${zs}-formData`,lc=`${zs}-locale`,Qe=333,bt=Math.round(Qe/2),qs=Math.round(Qe*2),fh="formeoSaved",on="formeoUpdated",ip="formeoChanged",ph="formeoUpdatedStage",gh="formeoUpdatedRow",mh="formeoUpdatedColumn",vh="formeoUpdatedField",rp="formeoCleared",yh="formeoOnRender",op="formeoConditionUpdated",Ks="formeoAddedRow",Ys="formeoAddedColumn",Zs="formeoAddedField",Xs="formeoRemovedRow",Qs="formeoRemovedColumn",Js="formeoRemovedField",bh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},sp={and:"&&",or:"||"},wh={equals:"="},ap=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],cc=["isChecked","isNotChecked"],uc=["isVisible","isNotVisible"],wn=["value"],lp={comparison:bh,assignment:wh,logical:sp},Ch="if",cp="then",ea=()=>({[Ch]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[cp]:[{target:"",targetProperty:"",assignment:"",value:""}]}),up=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,Es=/\bcol-\w+-\d+/g,Sh="f-i-",Rt=()=>({id:We(),stages:{[We()]:{}},rows:{},columns:{},fields:{}}),Rn=["selected","checked"],hp=Rn.toReversed(),dp=new Map([["config",new Set(["label","helpText","hideLabel","labelAfter","disableHtmlLabel","tooltip"])]]),fp="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(l=>String.raw`\s${l}\s`),pp=new RegExp(String.raw`(?!${fp.join("|")})\w\S*`,"g"),gp=/\s+/g;function Je(l){return typeof l!="string"||l.trim().match(gp)?l:l.replace(pp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const Ah=(l,e="-")=>l.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),wt=l=>{if(Array.isArray(l))return l;const e=/[.[\]]/g,t=[];let n=0,d=e.exec(l);for(;d!==null;)t.push(l.slice(n,d.index)),n=d.index+d[0].length,d=e.exec(l);return n<l.length&&t.push(l.slice(n)),t.filter(Boolean)},hc=(l,e="-")=>wt(l).join(e),mp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},vp=(l,e,t="…")=>{if(l.length<=e)return l;const n=l.slice(0,e),d=n.lastIndexOf(" ");let h=`${d>0?n.slice(0,d):n}`;return t&&(h+=t),h},yp=/^attrs\.|^meta\.|^options\.|^config\./g;function kn(l){return l.replaceAll(yp,"")}var Gr,dc;function ta(){if(dc)return Gr;dc=1;var l=Ft(),e=At(),t="[object Symbol]";function n(d){return typeof d=="symbol"||e(d)&&l(d)==t}return Gr=n,Gr}var qr,fc;function bp(){if(fc)return qr;fc=1;var l=xt(),e=ta(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function d(h,g){if(l(h))return!1;var m=typeof h;return m=="number"||m=="symbol"||m=="boolean"||h==null||e(h)?!0:n.test(h)||!t.test(h)||g!=null&&h in Object(g)}return qr=d,qr}var Kr,pc;function wp(){if(pc)return Kr;pc=1;var l=Os(),e="Expected a function";function t(n,d){if(typeof n!="function"||d!=null&&typeof d!="function")throw new TypeError(e);var h=function(){var g=arguments,m=d?d.apply(this,g):g[0],c=h.cache;if(c.has(m))return c.get(m);var f=n.apply(this,g);return h.cache=c.set(m,f)||c,f};return h.cache=new(t.Cache||l),h}return t.Cache=l,Kr=t,Kr}var Yr,gc;function Cp(){if(gc)return Yr;gc=1;var l=wp(),e=500;function t(n){var d=l(n,function(g){return h.size===e&&h.clear(),g}),h=d.cache;return d}return Yr=t,Yr}var Zr,mc;function Sp(){if(mc)return Zr;mc=1;var l=Cp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=l(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace(e,function(g,m,c,f){h.push(c?f.replace(t,"$1"):m||g)}),h});return Zr=n,Zr}var Xr,vc;function Ap(){if(vc)return Xr;vc=1;function l(e,t){for(var n=-1,d=e==null?0:e.length,h=Array(d);++n<d;)h[n]=t(e[n],n,e);return h}return Xr=l,Xr}var Qr,yc;function xp(){if(yc)return Qr;yc=1;var l=jn(),e=Ap(),t=xt(),n=ta(),d=l?l.prototype:void 0,h=d?d.toString:void 0;function g(m){if(typeof m=="string")return m;if(t(m))return e(m,g)+"";if(n(m))return h?h.call(m):"";var c=m+"";return c=="0"&&1/m==-1/0?"-0":c}return Qr=g,Qr}var Jr,bc;function Yn(){if(bc)return Jr;bc=1;var l=xp();function e(t){return t==null?"":l(t)}return Jr=e,Jr}var eo,wc;function xh(){if(wc)return eo;wc=1;var l=xt(),e=bp(),t=Sp(),n=Yn();function d(h,g){return l(h)?h:e(h,g)?[h]:t(n(h))}return eo=d,eo}var to,Cc;function Eh(){if(Cc)return to;Cc=1;var l=ta();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return to=e,to}var no,Sc;function Ep(){if(Sc)return no;Sc=1;var l=xh(),e=Eh();function t(n,d){d=l(d,n);for(var h=0,g=d.length;n!=null&&h<g;)n=n[e(d[h++])];return h&&h==g?n:void 0}return no=t,no}var io,Ac;function Mp(){if(Ac)return io;Ac=1;var l=Ep();function e(t,n,d){var h=t==null?void 0:l(t,n);return h===void 0?d:h}return io=e,io}var $p=Mp();const Tp=Nt($p);var ro,xc;function _p(){if(xc)return ro;xc=1;var l=rh(),e=xh(),t=Hs(),n=ht(),d=Eh();function h(g,m,c,f){if(!n(g))return g;m=e(m,g);for(var r=-1,o=m.length,a=o-1,s=g;s!=null&&++r<o;){var i=d(m[r]),u=c;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=a){var p=s[i];u=f?f(p,i,s):void 0,u===void 0&&(u=n(p)?p:t(m[r+1])?[]:{})}l(s,i,u),s=s[i]}return g}return ro=h,ro}var oo,Ec;function Lp(){if(Ec)return oo;Ec=1;var l=_p();function e(t,n,d){return t==null?t:l(t,n,d)}return oo=e,oo}var Rp=Lp();const kp=Nt(Rp),Re=Tp,Zn=kp;function Dp(l,e={}){const t={...l};for(const n in e)Object.hasOwn(e,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(e[n]):t[n]=[t[n],e[n]]:t[n]=e[n]);return t}function Cn(...l){return l.flat().reduce((e,t)=>(e[t]=t,e),{})}var so,Mc;function Op(){if(Mc)return so;Mc=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return so=e,so}var ao,$c;function Ip(){if($c)return ao;$c=1;function l(e){return this.__data__.has(e)}return ao=l,ao}var lo,Tc;function Np(){if(Tc)return lo;Tc=1;var l=Os(),e=Op(),t=Ip();function n(d){var h=-1,g=d==null?0:d.length;for(this.__data__=new l;++h<g;)this.add(d[h])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,lo=n,lo}var co,_c;function Fp(){if(_c)return co;_c=1;function l(e,t){for(var n=-1,d=e==null?0:e.length;++n<d;)if(t(e[n],n,e))return!0;return!1}return co=l,co}var uo,Lc;function Pp(){if(Lc)return uo;Lc=1;function l(e,t){return e.has(t)}return uo=l,uo}var ho,Rc;function Mh(){if(Rc)return ho;Rc=1;var l=Np(),e=Fp(),t=Pp(),n=1,d=2;function h(g,m,c,f,r,o){var a=c&n,s=g.length,i=m.length;if(s!=i&&!(a&&i>s))return!1;var u=o.get(g),p=o.get(m);if(u&&p)return u==m&&p==g;var y=-1,b=!0,M=c&d?new l:void 0;for(o.set(g,m),o.set(m,g);++y<s;){var x=g[y],A=m[y];if(f)var S=a?f(A,x,y,m,g,o):f(x,A,y,g,m,o);if(S!==void 0){if(S)continue;b=!1;break}if(M){if(!e(m,function($,R){if(!t(M,R)&&(x===$||r(x,$,c,f,o)))return M.push(R)})){b=!1;break}}else if(!(x===A||r(x,A,c,f,o))){b=!1;break}}return o.delete(g),o.delete(m),b}return ho=h,ho}var fo,kc;function Hp(){if(kc)return fo;kc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(d,h){n[++t]=[h,d]}),n}return fo=l,fo}var po,Dc;function Wp(){if(Dc)return po;Dc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(d){n[++t]=d}),n}return po=l,po}var go,Oc;function zp(){if(Oc)return go;Oc=1;var l=jn(),e=Qu(),t=ln(),n=Mh(),d=Hp(),h=Wp(),g=1,m=2,c="[object Boolean]",f="[object Date]",r="[object Error]",o="[object Map]",a="[object Number]",s="[object RegExp]",i="[object Set]",u="[object String]",p="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",M=l?l.prototype:void 0,x=M?M.valueOf:void 0;function A(S,$,R,L,T,D,w){switch(R){case b:if(S.byteLength!=$.byteLength||S.byteOffset!=$.byteOffset)return!1;S=S.buffer,$=$.buffer;case y:return!(S.byteLength!=$.byteLength||!D(new e(S),new e($)));case c:case f:case a:return t(+S,+$);case r:return S.name==$.name&&S.message==$.message;case s:case u:return S==$+"";case o:var v=d;case i:var C=L&g;if(v||(v=h),S.size!=$.size&&!C)return!1;var E=w.get(S);if(E)return E==$;L|=m,w.set(S,$);var _=n(v(S),v($),L,T,D,w);return w.delete(S),_;case p:if(x)return x.call(S)==x.call($)}return!1}return go=A,go}var mo,Ic;function Bp(){if(Ic)return mo;Ic=1;function l(e,t){for(var n=-1,d=t.length,h=e.length;++n<d;)e[h+n]=t[n];return e}return mo=l,mo}var vo,Nc;function jp(){if(Nc)return vo;Nc=1;var l=Bp(),e=xt();function t(n,d,h){var g=d(n);return e(n)?g:l(g,h(n))}return vo=t,vo}var yo,Fc;function Vp(){if(Fc)return yo;Fc=1;function l(e,t){for(var n=-1,d=e==null?0:e.length,h=0,g=[];++n<d;){var m=e[n];t(m,n,e)&&(g[h++]=m)}return g}return yo=l,yo}var bo,Pc;function Up(){if(Pc)return bo;Pc=1;function l(){return[]}return bo=l,bo}var wo,Hc;function Gp(){if(Hc)return wo;Hc=1;var l=Vp(),e=Up(),t=Object.prototype,n=t.propertyIsEnumerable,d=Object.getOwnPropertySymbols,h=d?function(g){return g==null?[]:(g=Object(g),l(d(g),function(m){return n.call(g,m)}))}:e;return wo=h,wo}var Co,Wc;function qp(){if(Wc)return Co;Wc=1;var l=Ju(),e=l(Object.keys,Object);return Co=e,Co}var So,zc;function Kp(){if(zc)return So;zc=1;var l=Ns(),e=qp(),t=Object.prototype,n=t.hasOwnProperty;function d(h){if(!l(h))return e(h);var g=[];for(var m in Object(h))n.call(h,m)&&m!="constructor"&&g.push(m);return g}return So=d,So}var Ao,Bc;function Yp(){if(Bc)return Ao;Bc=1;var l=oh(),e=Kp(),t=Gn();function n(d){return t(d)?l(d):e(d)}return Ao=n,Ao}var xo,jc;function Zp(){if(jc)return xo;jc=1;var l=jp(),e=Gp(),t=Yp();function n(d){return l(d,t,e)}return xo=n,xo}var Eo,Vc;function Xp(){if(Vc)return Eo;Vc=1;var l=Zp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function d(h,g,m,c,f,r){var o=m&e,a=l(h),s=a.length,i=l(g),u=i.length;if(s!=u&&!o)return!1;for(var p=s;p--;){var y=a[p];if(!(o?y in g:n.call(g,y)))return!1}var b=r.get(h),M=r.get(g);if(b&&M)return b==g&&M==h;var x=!0;r.set(h,g),r.set(g,h);for(var A=o;++p<s;){y=a[p];var S=h[y],$=g[y];if(c)var R=o?c($,S,y,g,h,r):c(S,$,y,h,g,r);if(!(R===void 0?S===$||f(S,$,m,c,r):R)){x=!1;break}A||(A=y=="constructor")}if(x&&!A){var L=h.constructor,T=g.constructor;L!=T&&"constructor"in h&&"constructor"in g&&!(typeof L=="function"&&L instanceof L&&typeof T=="function"&&T instanceof T)&&(x=!1)}return r.delete(h),r.delete(g),x}return Eo=d,Eo}var Mo,Uc;function Qp(){if(Uc)return Mo;Uc=1;var l=St(),e=Ze(),t=l(e,"DataView");return Mo=t,Mo}var $o,Gc;function Jp(){if(Gc)return $o;Gc=1;var l=St(),e=Ze(),t=l(e,"Promise");return $o=t,$o}var To,qc;function eg(){if(qc)return To;qc=1;var l=St(),e=Ze(),t=l(e,"Set");return To=t,To}var _o,Kc;function tg(){if(Kc)return _o;Kc=1;var l=St(),e=Ze(),t=l(e,"WeakMap");return _o=t,_o}var Lo,Yc;function ng(){if(Yc)return Lo;Yc=1;var l=Qp(),e=Ds(),t=Jp(),n=eg(),d=tg(),h=Ft(),g=Ku(),m="[object Map]",c="[object Object]",f="[object Promise]",r="[object Set]",o="[object WeakMap]",a="[object DataView]",s=g(l),i=g(e),u=g(t),p=g(n),y=g(d),b=h;return(l&&b(new l(new ArrayBuffer(1)))!=a||e&&b(new e)!=m||t&&b(t.resolve())!=f||n&&b(new n)!=r||d&&b(new d)!=o)&&(b=function(M){var x=h(M),A=x==c?M.constructor:void 0,S=A?g(A):"";if(S)switch(S){case s:return a;case i:return m;case u:return f;case p:return r;case y:return o}return x}),Lo=b,Lo}var Ro,Zc;function ig(){if(Zc)return Ro;Zc=1;var l=Yu(),e=Mh(),t=zp(),n=Xp(),d=ng(),h=xt(),g=Fs(),m=Ps(),c=1,f="[object Arguments]",r="[object Array]",o="[object Object]",a=Object.prototype,s=a.hasOwnProperty;function i(u,p,y,b,M,x){var A=h(u),S=h(p),$=A?r:d(u),R=S?r:d(p);$=$==f?o:$,R=R==f?o:R;var L=$==o,T=R==o,D=$==R;if(D&&g(u)){if(!g(p))return!1;A=!0,L=!1}if(D&&!L)return x||(x=new l),A||m(u)?e(u,p,y,b,M,x):t(u,p,$,y,b,M,x);if(!(y&c)){var w=L&&s.call(u,"__wrapped__"),v=T&&s.call(p,"__wrapped__");if(w||v){var C=w?u.value():u,E=v?p.value():p;return x||(x=new l),M(C,E,y,b,x)}}return D?(x||(x=new l),n(u,p,y,b,M,x)):!1}return Ro=i,Ro}var ko,Xc;function rg(){if(Xc)return ko;Xc=1;var l=ig(),e=At();function t(n,d,h,g,m){return n===d?!0:n==null||d==null||!e(n)&&!e(d)?n!==n&&d!==d:l(n,d,h,g,t,m)}return ko=t,ko}var Do,Qc;function og(){if(Qc)return Do;Qc=1;var l=rg();function e(t,n){return l(t,n)}return Do=e,Do}var sg=og();const Ms=Nt(sg),ag=(l,e)=>l===void 0?"added":e===void 0?"removed":Ms(l,e)?"unchanged":"changed";class na{constructor(e,t=Object.create(null)){this.name=e,this.data=t,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,t)=>JSON.stringify(e,null,t);get=e=>Re(this.data,e);set(e,t){const n=Re(this.data,e),d=Zn(this.data,e,t),h=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(h)),m={newVal:t,oldVal:n,path:e};for(const c of g)for(const f of this.setCallbacks[c])f(m);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:d,changeType:ag(n,t),src:this.dom};if(n&&(c.previousValue=n),Q.formeoUpdated(c),this.name){const r={stage:ph,row:gh,column:mh,field:vh}[this.name];r&&Q.formeoUpdated(c,r)}}return d}addSetCallback(e,t){this.setCallbacks[e]?this.setCallbacks[e].push(t):this.setCallbacks[e]=[t]}removeSetCallback(e,t){this.setCallbacks[e]=this.setCallbacks[e].filter(n=>n!==t)}add=(e,t=Object.create(null))=>{const{id:n}=t,d=e||n||We();return this.set(d,t)};remove=e=>{const t=wt(e),n=t.pop(),d=this.get(t);return Array.isArray(d)?d.splice(Number(n),1):d&&delete d[n],d};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[t,n])=>(e[t]=n?.data?n.getData():n,e),{});setCallbacks={};configVal=Object.create(null)}class Xn extends na{load=e=>{const t=qn(e);this.empty();for(const[n,d]of Object.entries(t))this.add(n,d);return this.data};get=e=>e?Re(this.data,e):this.add();add=(e,t=Object.create(null))=>{const n=e||We(),d=this.Component({...t,id:n});this.data[n]=d,this.active=d;const g={row:Ks,column:Ys,field:Zs}[this.name];return g&&Q.formeoUpdated({entity:d,componentId:n,componentType:this.name,data:d.data},g),d};remove=e=>{if(Array.isArray(e))for(const t of e)this.get(t).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const t=Object.values(this.data).map(n=>n.empty(e));return Promise.all(t)};set config(e){this.configVal=Ue(this.configVal,Ke(e))}get config(){return this.configVal}conditionMap=new Map}function Jc(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(l);e&&(n=n.filter(function(d){return Object.getOwnPropertyDescriptor(l,d).enumerable})),t.push.apply(t,n)}return t}function Ye(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jc(Object(t),!0).forEach(function(n){lg(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):Jc(Object(t)).forEach(function(n){Object.defineProperty(l,n,Object.getOwnPropertyDescriptor(t,n))})}return l}function Sn(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sn=function(e){return typeof e}:Sn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(l)}function lg(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function it(){return it=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(l[n]=t[n])}return l},it.apply(this,arguments)}function cg(l,e){if(l==null)return{};var t={},n=Object.keys(l),d,h;for(h=0;h<n.length;h++)d=n[h],!(e.indexOf(d)>=0)&&(t[d]=l[d]);return t}function ug(l,e){if(l==null)return{};var t=cg(l,e),n,d;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);for(d=0;d<h.length;d++)n=h[d],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(l,n)&&(t[n]=l[n])}return t}var hg="1.15.3";function et(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var ot=et(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cn=et(/Edge/i),eu=et(/firefox/i),Qt=et(/safari/i)&&!et(/chrome/i)&&!et(/android/i),$h=et(/iP(ad|od|hone)/i),Th=et(/chrome/i)&&et(/android/i),_h={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!ot&&_h)}function oe(l,e,t){l.removeEventListener(e,t,!ot&&_h)}function Dn(l,e){if(e){if(e[0]===">"&&(e=e.substring(1)),l)try{if(l.matches)return l.matches(e);if(l.msMatchesSelector)return l.msMatchesSelector(e);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(e)}catch{return!1}return!1}}function Lh(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Ve(l,e,t,n){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&Dn(l,e):Dn(l,e))||n&&l===t)return l;if(l===t)break}while(l=Lh(l))}return null}var tu=/\s+/g;function Ie(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(tu," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(tu," ")}}function ne(l,e,t){var n=l&&l.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(t=l.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function kt(l,e){var t="";if(typeof l=="string")t=l;else do{var n=ne(l,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(l=l.parentNode));var d=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return d&&new d(t)}function Rh(l,e,t){if(l){var n=l.getElementsByTagName(e),d=0,h=n.length;if(t)for(;d<h;d++)t(n[d],d);return n}return[]}function qe(){var l=document.scrollingElement;return l||document.documentElement}function we(l,e,t,n,d){if(!(!l.getBoundingClientRect&&l!==window)){var h,g,m,c,f,r,o;if(l!==window&&l.parentNode&&l!==qe()?(h=l.getBoundingClientRect(),g=h.top,m=h.left,c=h.bottom,f=h.right,r=h.height,o=h.width):(g=0,m=0,c=window.innerHeight,f=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&l!==window&&(d=d||l.parentNode,!ot))do if(d&&d.getBoundingClientRect&&(ne(d,"transform")!=="none"||t&&ne(d,"position")!=="static")){var a=d.getBoundingClientRect();g-=a.top+parseInt(ne(d,"border-top-width")),m-=a.left+parseInt(ne(d,"border-left-width")),c=g+h.height,f=m+h.width;break}while(d=d.parentNode);if(n&&l!==window){var s=kt(d||l),i=s&&s.a,u=s&&s.d;s&&(g/=u,m/=i,o/=i,r/=u,c=g+r,f=m+o)}return{top:g,left:m,bottom:c,right:f,width:o,height:r}}}function nu(l,e,t){for(var n=lt(l,!0),d=we(l)[e];n;){var h=we(n)[t],g=void 0;if(g=d>=h,!g)return n;if(n===qe())break;n=lt(n,!1)}return!1}function Ot(l,e,t,n){for(var d=0,h=0,g=l.children;h<g.length;){if(g[h].style.display!=="none"&&g[h]!==te.ghost&&(n||g[h]!==te.dragged)&&Ve(g[h],t.draggable,l,!1)){if(d===e)return g[h];d++}h++}return null}function ia(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!Dn(t,e));)t=t.previousElementSibling;return t||null}function Pe(l,e){var t=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==te.clone&&(!e||Dn(l,e))&&t++;return t}function iu(l){var e=0,t=0,n=qe();if(l)do{var d=kt(l),h=d.a,g=d.d;e+=l.scrollLeft*h,t+=l.scrollTop*g}while(l!==n&&(l=l.parentNode));return[e,t]}function dg(l,e){for(var t in l)if(l.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===l[t][n])return Number(t)}return-1}function lt(l,e){if(!l||!l.getBoundingClientRect)return qe();var t=l,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var d=ne(t);if(t.clientWidth<t.scrollWidth&&(d.overflowX=="auto"||d.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(d.overflowY=="auto"||d.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return qe();if(n||e)return t;n=!0}}while(t=t.parentNode);return qe()}function fg(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function Oo(l,e){return Math.round(l.top)===Math.round(e.top)&&Math.round(l.left)===Math.round(e.left)&&Math.round(l.height)===Math.round(e.height)&&Math.round(l.width)===Math.round(e.width)}var Jt;function kh(l,e){return function(){if(!Jt){var t=arguments,n=this;t.length===1?l.call(n,t[0]):l.apply(n,t),Jt=setTimeout(function(){Jt=void 0},e)}}}function pg(){clearTimeout(Jt),Jt=void 0}function Dh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Oh(l){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(l).cloneNode(!0):t?t(l).clone(!0)[0]:l.cloneNode(!0)}function Ih(l,e,t){var n={};return Array.from(l.children).forEach(function(d){var h,g,m,c;if(!(!Ve(d,e.draggable,l,!1)||d.animated||d===t)){var f=we(d);n.left=Math.min((h=n.left)!==null&&h!==void 0?h:1/0,f.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,f.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,f.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,f.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var ke="Sortable"+new Date().getTime();function gg(){var l=[],e;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(d){if(!(ne(d,"display")==="none"||d===te.ghost)){l.push({target:d,rect:we(d)});var h=Ye({},l[l.length-1].rect);if(d.thisAnimationDuration){var g=kt(d,!0);g&&(h.top-=g.f,h.left-=g.e)}d.fromRect=h}})}},addAnimationState:function(n){l.push(n)},removeAnimationState:function(n){l.splice(dg(l,{target:n}),1)},animateAll:function(n){var d=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var h=!1,g=0;l.forEach(function(m){var c=0,f=m.target,r=f.fromRect,o=we(f),a=f.prevFromRect,s=f.prevToRect,i=m.rect,u=kt(f,!0);u&&(o.top-=u.f,o.left-=u.e),f.toRect=o,f.thisAnimationDuration&&Oo(a,o)&&!Oo(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=vg(i,a,s,d.options)),Oo(o,r)||(f.prevFromRect=r,f.prevToRect=o,c||(c=d.options.animation),d.animate(f,i,o,c)),c&&(h=!0,g=Math.max(g,c),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},c),f.thisAnimationDuration=c)}),clearTimeout(e),h?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),l=[]},animate:function(n,d,h,g){if(g){ne(n,"transition",""),ne(n,"transform","");var m=kt(this.el),c=m&&m.a,f=m&&m.d,r=(d.left-h.left)/(c||1),o=(d.top-h.top)/(f||1);n.animatingX=!!r,n.animatingY=!!o,ne(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=mg(n),ne(n,"transition","transform "+g+"ms"+(this.options.easing?" "+this.options.easing:"")),ne(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ne(n,"transition",""),ne(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},g)}}}}function mg(l){return l.offsetWidth}function vg(l,e,t,n){return Math.sqrt(Math.pow(e.top-l.top,2)+Math.pow(e.left-l.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var Et=[],Io={initializeByDefault:!0},un={mount:function(e){for(var t in Io)Io.hasOwnProperty(t)&&!(t in e)&&(e[t]=Io[t]);Et.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Et.push(e)},pluginEvent:function(e,t,n){var d=this;this.eventCanceled=!1,n.cancel=function(){d.eventCanceled=!0};var h=e+"Global";Et.forEach(function(g){t[g.pluginName]&&(t[g.pluginName][h]&&t[g.pluginName][h](Ye({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](Ye({sortable:t},n)))})},initializePlugins:function(e,t,n,d){Et.forEach(function(m){var c=m.pluginName;if(!(!e.options[c]&&!m.initializeByDefault)){var f=new m(e,t,e.options);f.sortable=e,f.options=e.options,e[c]=f,it(n,f.defaults)}});for(var h in e.options)if(e.options.hasOwnProperty(h)){var g=this.modifyOption(e,h,e.options[h]);typeof g<"u"&&(e.options[h]=g)}},getEventProperties:function(e,t){var n={};return Et.forEach(function(d){typeof d.eventProperties=="function"&&it(n,d.eventProperties.call(t[d.pluginName],e))}),n},modifyOption:function(e,t,n){var d;return Et.forEach(function(h){e[h.pluginName]&&h.optionListeners&&typeof h.optionListeners[t]=="function"&&(d=h.optionListeners[t].call(e[h.pluginName],n))}),d}};function yg(l){var e=l.sortable,t=l.rootEl,n=l.name,d=l.targetEl,h=l.cloneEl,g=l.toEl,m=l.fromEl,c=l.oldIndex,f=l.newIndex,r=l.oldDraggableIndex,o=l.newDraggableIndex,a=l.originalEvent,s=l.putSortable,i=l.extraEventProperties;if(e=e||t&&t[ke],!!e){var u,p=e.options,y="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ot&&!cn?u=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(n,!0,!0)),u.to=g||t,u.from=m||t,u.item=d||t,u.clone=h,u.oldIndex=c,u.newIndex=f,u.oldDraggableIndex=r,u.newDraggableIndex=o,u.originalEvent=a,u.pullMode=s?s.lastPutMode:void 0;var b=Ye(Ye({},i),un.getEventProperties(n,e));for(var M in b)u[M]=b[M];t&&t.dispatchEvent(u),p[y]&&p[y].call(e,u)}}var bg=["evt"],_e=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=n.evt,h=ug(n,bg);un.pluginEvent.bind(te)(e,t,Ye({dragEl:q,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:mt,lastDownEl:An,cloneEl:pe,cloneHidden:at,dragStarted:Kt,putSortable:Se,activeSortable:te.active,originalEvent:d,oldIndex:_t,oldDraggableIndex:en,newIndex:Ne,newDraggableIndex:st,hideGhostForTarget:Hh,unhideGhostForTarget:Wh,cloneNowHidden:function(){at=!0},cloneNowShown:function(){at=!1},dispatchSortableEvent:function(m){Me({sortable:t,name:m,originalEvent:d})}},h))};function Me(l){yg(Ye({putSortable:Se,cloneEl:pe,targetEl:q,rootEl:fe,oldIndex:_t,oldDraggableIndex:en,newIndex:Ne,newDraggableIndex:st},l))}var q,ve,ie,fe,mt,An,pe,at,_t,Ne,en,st,fn,Se,$t=!1,On=!1,In=[],pt,Be,No,Fo,ru,ou,Kt,Mt,tn,nn=!1,pn=!1,xn,Ae,Po=[],$s=!1,Nn=[],Qn=typeof document<"u",gn=$h,su=cn||ot?"cssFloat":"float",wg=Qn&&!Th&&!$h&&"draggable"in document.createElement("div"),Nh=(function(){if(Qn){if(ot)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Fh=function(e,t){var n=ne(e),d=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),h=Ot(e,0,t),g=Ot(e,1,t),m=h&&ne(h),c=g&&ne(g),f=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+we(h).width,r=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+we(g).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(h&&m.float&&m.float!=="none"){var o=m.float==="left"?"left":"right";return g&&(c.clear==="both"||c.clear===o)?"vertical":"horizontal"}return h&&(m.display==="block"||m.display==="flex"||m.display==="table"||m.display==="grid"||f>=d&&n[su]==="none"||g&&n[su]==="none"&&f+r>d)?"vertical":"horizontal"},Cg=function(e,t,n){var d=n?e.left:e.top,h=n?e.right:e.bottom,g=n?e.width:e.height,m=n?t.left:t.top,c=n?t.right:t.bottom,f=n?t.width:t.height;return d===m||h===c||d+g/2===m+f/2},Sg=function(e,t){var n;return In.some(function(d){var h=d[ke].options.emptyInsertThreshold;if(!(!h||ia(d))){var g=we(d),m=e>=g.left-h&&e<=g.right+h,c=t>=g.top-h&&t<=g.bottom+h;if(m&&c)return n=d}}),n},Ph=function(e){function t(h,g){return function(m,c,f,r){var o=m.options.group.name&&c.options.group.name&&m.options.group.name===c.options.group.name;if(h==null&&(g||o))return!0;if(h==null||h===!1)return!1;if(g&&h==="clone")return h;if(typeof h=="function")return t(h(m,c,f,r),g)(m,c,f,r);var a=(g?m:c).options.group.name;return h===!0||typeof h=="string"&&h===a||h.join&&h.indexOf(a)>-1}}var n={},d=e.group;(!d||Sn(d)!="object")&&(d={name:d}),n.name=d.name,n.checkPull=t(d.pull,!0),n.checkPut=t(d.put),n.revertClone=d.revertClone,e.group=n},Hh=function(){!Nh&&ie&&ne(ie,"display","none")},Wh=function(){!Nh&&ie&&ne(ie,"display","")};Qn&&!Th&&document.addEventListener("click",function(l){if(On)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),On=!1,!1},!0);var gt=function(e){if(q){e=e.touches?e.touches[0]:e;var t=Sg(e.clientX,e.clientY);if(t){var n={};for(var d in e)e.hasOwnProperty(d)&&(n[d]=e[d]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[ke]._onDragOver(n)}}},Ag=function(e){q&&q.parentNode[ke]._isOutsideThisEl(e.target)};function te(l,e){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=e=it({},e),l[ke]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Fh(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,m){g.setData("Text",m.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:te.supportPointer!==!1&&"PointerEvent"in window&&!Qt,emptyInsertThreshold:5};un.initializePlugins(this,l,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Ph(e);for(var d in this)d.charAt(0)==="_"&&typeof this[d]=="function"&&(this[d]=this[d].bind(this));this.nativeDraggable=e.forceFallback?!1:wg,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?se(l,"pointerdown",this._onTapStart):(se(l,"mousedown",this._onTapStart),se(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(se(l,"dragover",this),se(l,"dragenter",this)),In.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),it(this,gg())}te.prototype={constructor:te,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Mt=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,q):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,d=this.options,h=d.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(m||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,r=d.filter;if(Rg(n),!q&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||d.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Qt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Ve(c,d.draggable,n,!1),!(c&&c.animated)&&An!==c)){if(_t=Pe(c),en=Pe(c,d.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Me({sortable:t,rootEl:f,name:"filter",targetEl:c,toEl:n,fromEl:n}),_e("filter",t,{evt:e}),h&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=Ve(f,o.trim(),n,!1),o)return Me({sortable:t,rootEl:o,name:"filter",targetEl:c,fromEl:n,toEl:n}),_e("filter",t,{evt:e}),!0}),r)){h&&e.cancelable&&e.preventDefault();return}d.handle&&!Ve(f,d.handle,n,!1)||this._prepareDragStart(e,m,c)}}},_prepareDragStart:function(e,t,n){var d=this,h=d.el,g=d.options,m=h.ownerDocument,c;if(n&&!q&&n.parentNode===h){var f=we(n);if(fe=h,q=n,ve=q.parentNode,mt=q.nextSibling,An=n,fn=g.group,te.dragged=q,pt={target:q,clientX:(t||e).clientX,clientY:(t||e).clientY},ru=pt.clientX-f.left,ou=pt.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,q.style["will-change"]="all",c=function(){if(_e("delayEnded",d,{evt:e}),te.eventCanceled){d._onDrop();return}d._disableDelayedDragEvents(),!eu&&d.nativeDraggable&&(q.draggable=!0),d._triggerDragStart(e,t),Me({sortable:d,name:"choose",originalEvent:e}),Ie(q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){Rh(q,r.trim(),Ho)}),se(m,"dragover",gt),se(m,"mousemove",gt),se(m,"touchmove",gt),se(m,"mouseup",d._onDrop),se(m,"touchend",d._onDrop),se(m,"touchcancel",d._onDrop),eu&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),_e("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(cn||ot))){if(te.eventCanceled){this._onDrop();return}se(m,"mouseup",d._disableDelayedDrag),se(m,"touchend",d._disableDelayedDrag),se(m,"touchcancel",d._disableDelayedDrag),se(m,"mousemove",d._delayedDragTouchMoveHandler),se(m,"touchmove",d._delayedDragTouchMoveHandler),g.supportPointer&&se(m,"pointermove",d._delayedDragTouchMoveHandler),d._dragStartTimer=setTimeout(c,g.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){q&&Ho(q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._disableDelayedDrag),oe(e,"touchend",this._disableDelayedDrag),oe(e,"touchcancel",this._disableDelayedDrag),oe(e,"mousemove",this._delayedDragTouchMoveHandler),oe(e,"touchmove",this._delayedDragTouchMoveHandler),oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?se(document,"pointermove",this._onTouchMove):t?se(document,"touchmove",this._onTouchMove):se(document,"mousemove",this._onTouchMove):(se(q,"dragend",this),se(fe,"dragstart",this._onDragStart));try{document.selection?En(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if($t=!1,fe&&q){_e("dragStarted",this,{evt:t}),this.nativeDraggable&&se(document,"dragover",Ag);var n=this.options;!e&&Ie(q,n.dragClass,!1),Ie(q,n.ghostClass,!0),te.active=this,e&&this._appendGhost(),Me({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,Hh();for(var e=document.elementFromPoint(Be.clientX,Be.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),e!==t);)t=e;if(q.parentNode[ke]._isOutsideThisEl(e),t)do{if(t[ke]){var n=void 0;if(n=t[ke]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Lh(t));Wh()}},_onTouchMove:function(e){if(pt){var t=this.options,n=t.fallbackTolerance,d=t.fallbackOffset,h=e.touches?e.touches[0]:e,g=ie&&kt(ie,!0),m=ie&&g&&g.a,c=ie&&g&&g.d,f=gn&&Ae&&iu(Ae),r=(h.clientX-pt.clientX+d.x)/(m||1)+(f?f[0]-Po[0]:0)/(m||1),o=(h.clientY-pt.clientY+d.y)/(c||1)+(f?f[1]-Po[1]:0)/(c||1);if(!te.active&&!$t){if(n&&Math.max(Math.abs(h.clientX-this._lastX),Math.abs(h.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ie){g?(g.e+=r-(No||0),g.f+=o-(Fo||0)):g={a:1,b:0,c:0,d:1,e:r,f:o};var a="matrix(".concat(g.a,",").concat(g.b,",").concat(g.c,",").concat(g.d,",").concat(g.e,",").concat(g.f,")");ne(ie,"webkitTransform",a),ne(ie,"mozTransform",a),ne(ie,"msTransform",a),ne(ie,"transform",a),No=r,Fo=o,Be=h}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:fe,t=we(q,!0,gn,!0,e),n=this.options;if(gn){for(Ae=e;ne(Ae,"position")==="static"&&ne(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=qe()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=qe(),Po=iu(Ae)}ie=q.cloneNode(!0),Ie(ie,n.ghostClass,!1),Ie(ie,n.fallbackClass,!0),Ie(ie,n.dragClass,!0),ne(ie,"transition",""),ne(ie,"transform",""),ne(ie,"box-sizing","border-box"),ne(ie,"margin",0),ne(ie,"top",t.top),ne(ie,"left",t.left),ne(ie,"width",t.width),ne(ie,"height",t.height),ne(ie,"opacity","0.8"),ne(ie,"position",gn?"absolute":"fixed"),ne(ie,"zIndex","100000"),ne(ie,"pointerEvents","none"),te.ghost=ie,e.appendChild(ie),ne(ie,"transform-origin",ru/parseInt(ie.style.width)*100+"% "+ou/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,d=e.dataTransfer,h=n.options;if(_e("dragStart",this,{evt:e}),te.eventCanceled){this._onDrop();return}_e("setupClone",this),te.eventCanceled||(pe=Oh(q),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),Ie(pe,this.options.chosenClass,!1),te.clone=pe),n.cloneId=En(function(){_e("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,q),n._hideClone(),Me({sortable:n,name:"clone"}))}),!t&&Ie(q,h.dragClass,!0),t?(On=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oe(document,"mouseup",n._onDrop),oe(document,"touchend",n._onDrop),oe(document,"touchcancel",n._onDrop),d&&(d.effectAllowed="move",h.setData&&h.setData.call(n,d,q)),se(document,"drop",n),ne(q,"transform","translateZ(0)")),$t=!0,n._dragStartId=En(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),Kt=!0,Qt&&ne(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,d,h,g,m=this.options,c=m.group,f=te.active,r=fn===c,o=m.sort,a=Se||f,s,i=this,u=!1;if($s)return;function p(O,I){_e(O,i,Ye({evt:e,isOwner:r,axis:s?"vertical":"horizontal",revert:g,dragRect:d,targetRect:h,canSort:o,fromSortable:a,target:n,completed:b,onMove:function(P,B){return mn(fe,t,q,d,P,we(P),e,B)},changed:M},I))}function y(){p("dragOverAnimationCapture"),i.captureAnimationState(),i!==a&&a.captureAnimationState()}function b(O){return p("dragOverCompleted",{insertion:O}),O&&(r?f._hideClone():f._showClone(i),i!==a&&(Ie(q,Se?Se.options.ghostClass:f.options.ghostClass,!1),Ie(q,m.ghostClass,!0)),Se!==i&&i!==te.active?Se=i:i===te.active&&Se&&(Se=null),a===i&&(i._ignoreWhileAnimating=n),i.animateAll(function(){p("dragOverAnimationComplete"),i._ignoreWhileAnimating=null}),i!==a&&(a.animateAll(),a._ignoreWhileAnimating=null)),(n===q&&!q.animated||n===t&&!n.animated)&&(Mt=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(q.parentNode[ke]._isOutsideThisEl(e.target),!O&&gt(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function M(){Ne=Pe(q),st=Pe(q,m.draggable),Me({sortable:i,name:"change",toEl:t,newIndex:Ne,newDraggableIndex:st,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Ve(n,m.draggable,t,!0),p("dragOver"),te.eventCanceled)return u;if(q.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return b(!1);if(On=!1,f&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=fn.checkPull(this,f,q,e))&&c.checkPut(this,f,q,e))){if(s=this._getDirection(e,n)==="vertical",d=we(q),p("dragOverValid"),te.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),p("revert"),te.eventCanceled||(mt?fe.insertBefore(q,mt):fe.appendChild(q)),b(!0);var x=ia(t,m.draggable);if(!x||$g(e,s,this)&&!x.animated){if(x===q)return b(!1);if(x&&t===e.target&&(n=x),n&&(h=we(n)),mn(fe,t,q,d,n,h,e,!!n)!==!1)return y(),x&&x.nextSibling?t.insertBefore(q,x.nextSibling):t.appendChild(q),ve=t,M(),b(!0)}else if(x&&Mg(e,s,this)){var A=Ot(t,0,m,!0);if(A===q)return b(!1);if(n=A,h=we(n),mn(fe,t,q,d,n,h,e,!1)!==!1)return y(),t.insertBefore(q,A),ve=t,M(),b(!0)}else if(n.parentNode===t){h=we(n);var S=0,$,R=q.parentNode!==t,L=!Cg(q.animated&&q.toRect||d,n.animated&&n.toRect||h,s),T=s?"top":"left",D=nu(n,"top","top")||nu(q,"top","top"),w=D?D.scrollTop:void 0;Mt!==n&&($=h[T],nn=!1,pn=!L&&m.invertSwap||R),S=Tg(e,n,h,s,L?1:m.swapThreshold,m.invertedSwapThreshold==null?m.swapThreshold:m.invertedSwapThreshold,pn,Mt===n);var v;if(S!==0){var C=Pe(q);do C-=S,v=ve.children[C];while(v&&(ne(v,"display")==="none"||v===ie))}if(S===0||v===n)return b(!1);Mt=n,tn=S;var E=n.nextElementSibling,_=!1;_=S===1;var k=mn(fe,t,q,d,n,h,e,_);if(k!==!1)return(k===1||k===-1)&&(_=k===1),$s=!0,setTimeout(Eg,30),y(),_&&!E?t.appendChild(q):n.parentNode.insertBefore(q,_?E:n),D&&Dh(D,0,w-D.scrollTop),ve=q.parentNode,$!==void 0&&!pn&&(xn=Math.abs($-we(n)[T])),M(),b(!0)}if(t.contains(q))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){oe(document,"mousemove",this._onTouchMove),oe(document,"touchmove",this._onTouchMove),oe(document,"pointermove",this._onTouchMove),oe(document,"dragover",gt),oe(document,"mousemove",gt),oe(document,"touchmove",gt)},_offUpEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._onDrop),oe(e,"touchend",this._onDrop),oe(e,"pointerup",this._onDrop),oe(e,"touchcancel",this._onDrop),oe(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Ne=Pe(q),st=Pe(q,n.draggable),_e("drop",this,{evt:e}),ve=q&&q.parentNode,Ne=Pe(q),st=Pe(q,n.draggable),te.eventCanceled){this._nulling();return}$t=!1,pn=!1,nn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ts(this.cloneId),Ts(this._dragStartId),this.nativeDraggable&&(oe(document,"drop",this),oe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Qt&&ne(document.body,"user-select",""),ne(q,"transform",""),e&&(Kt&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(fe===ve||Se&&Se.lastPutMode!=="clone")&&pe&&pe.parentNode&&pe.parentNode.removeChild(pe),q&&(this.nativeDraggable&&oe(q,"dragend",this),Ho(q),q.style["will-change"]="",Kt&&!$t&&Ie(q,Se?Se.options.ghostClass:this.options.ghostClass,!1),Ie(q,this.options.chosenClass,!1),Me({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(Ne>=0&&(Me({rootEl:ve,name:"add",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"remove",toEl:ve,originalEvent:e}),Me({rootEl:ve,name:"sort",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),Se&&Se.save()):Ne!==_t&&Ne>=0&&(Me({sortable:this,name:"update",toEl:ve,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((Ne==null||Ne===-1)&&(Ne=_t,st=en),Me({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){_e("nulling",this),fe=q=ve=ie=mt=pe=An=at=pt=Be=Kt=Ne=st=_t=en=Mt=tn=Se=fn=te.dragged=te.ghost=te.clone=te.active=null,Nn.forEach(function(e){e.checked=!0}),Nn.length=No=Fo=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":q&&(this._onDragOver(e),xg(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,d=0,h=n.length,g=this.options;d<h;d++)t=n[d],Ve(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||Lg(t));return e},sort:function(e,t){var n={},d=this.el;this.toArray().forEach(function(h,g){var m=d.children[g];Ve(m,this.options.draggable,d,!1)&&(n[h]=m)},this),t&&this.captureAnimationState(),e.forEach(function(h){n[h]&&(d.removeChild(n[h]),d.appendChild(n[h]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ve(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var d=un.modifyOption(this,e,t);typeof d<"u"?n[e]=d:n[e]=t,e==="group"&&Ph(n)},destroy:function(){_e("destroy",this);var e=this.el;e[ke]=null,oe(e,"mousedown",this._onTapStart),oe(e,"touchstart",this._onTapStart),oe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(oe(e,"dragover",this),oe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),In.splice(In.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!at){if(_e("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),at=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(at){if(_e("showClone",this),te.eventCanceled)return;q.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,q):mt?fe.insertBefore(pe,mt):fe.appendChild(pe),this.options.group.revertClone&&this.animate(q,pe),ne(pe,"display",""),at=!1}}};function xg(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function mn(l,e,t,n,d,h,g,m){var c,f=l[ke],r=f.options.onMove,o;return window.CustomEvent&&!ot&&!cn?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=e,c.from=l,c.dragged=t,c.draggedRect=n,c.related=d||e,c.relatedRect=h||we(e),c.willInsertAfter=m,c.originalEvent=g,l.dispatchEvent(c),r&&(o=r.call(f,c,g)),o}function Ho(l){l.draggable=!1}function Eg(){$s=!1}function Mg(l,e,t){var n=we(Ot(t.el,0,t.options,!0)),d=Ih(t.el,t.options,ie),h=10;return e?l.clientX<d.left-h||l.clientY<n.top&&l.clientX<n.right:l.clientY<d.top-h||l.clientY<n.bottom&&l.clientX<n.left}function $g(l,e,t){var n=we(ia(t.el,t.options.draggable)),d=Ih(t.el,t.options,ie),h=10;return e?l.clientX>d.right+h||l.clientY>n.bottom&&l.clientX>n.left:l.clientY>d.bottom+h||l.clientX>n.right&&l.clientY>n.top}function Tg(l,e,t,n,d,h,g,m){var c=n?l.clientY:l.clientX,f=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,a=!1;if(!g){if(m&&xn<f*d){if(!nn&&(tn===1?c>r+f*h/2:c<o-f*h/2)&&(nn=!0),nn)a=!0;else if(tn===1?c<r+xn:c>o-xn)return-tn}else if(c>r+f*(1-d)/2&&c<o-f*(1-d)/2)return _g(e)}return a=a||g,a&&(c<r+f*h/2||c>o-f*h/2)?c>r+f/2?1:-1:0}function _g(l){return Pe(q)<Pe(l)?1:-1}function Lg(l){for(var e=l.tagName+l.className+l.src+l.href+l.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function Rg(l){Nn.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Nn.push(n)}}function En(l){return setTimeout(l,0)}function Ts(l){return clearTimeout(l)}Qn&&se(document,"touchmove",function(l){(te.active||$t)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:Rh,is:function(e,t){return!!Ve(e,t,e,!1)},extend:fg,throttle:kh,closest:Ve,toggleClass:Ie,clone:Oh,index:Pe,nextTick:En,cancelNextTick:Ts,detectDirection:Fh,getChild:Ot,expando:ke};te.get=function(l){return l[ke]};te.mount=function(){for(var l=arguments.length,e=new Array(l),t=0;t<l;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(te.utils=Ye(Ye({},te.utils),n.utils)),un.mount(n)})};te.create=function(l,e){return new te(l,e)};te.version=hg;var be=[],Yt,_s,Ls=!1,Wo,zo,Fn,Zt;function kg(){function l(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return l.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?se(document,"pointermove",this._handleFallbackAutoScroll):n.touches?se(document,"touchmove",this._handleFallbackAutoScroll):se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?oe(document,"dragover",this._handleAutoScroll):(oe(document,"pointermove",this._handleFallbackAutoScroll),oe(document,"touchmove",this._handleFallbackAutoScroll),oe(document,"mousemove",this._handleFallbackAutoScroll)),au(),Mn(),pg()},nulling:function(){Fn=_s=Yt=Ls=Zt=Wo=zo=null,be.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var d=this,h=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(h,g);if(Fn=t,n||this.options.forceAutoScrollFallback||cn||ot||Qt){Bo(t,this.options,m,n);var c=lt(m,!0);Ls&&(!Zt||h!==Wo||g!==zo)&&(Zt&&au(),Zt=setInterval(function(){var f=lt(document.elementFromPoint(h,g),!0);f!==c&&(c=f,Mn()),Bo(t,d.options,f,n)},10),Wo=h,zo=g)}else{if(!this.options.bubbleScroll||lt(m,!0)===qe()){Mn();return}Bo(t,this.options,lt(m,!1),!1)}}},it(l,{pluginName:"scroll",initializeByDefault:!0})}function Mn(){be.forEach(function(l){clearInterval(l.pid)}),be=[]}function au(){clearInterval(Zt)}var Bo=kh(function(l,e,t,n){if(e.scroll){var d=(l.touches?l.touches[0]:l).clientX,h=(l.touches?l.touches[0]:l).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,c=qe(),f=!1,r;_s!==t&&(_s=t,Mn(),Yt=e.scroll,r=e.scrollFn,Yt===!0&&(Yt=lt(t,!0)));var o=0,a=Yt;do{var s=a,i=we(s),u=i.top,p=i.bottom,y=i.left,b=i.right,M=i.width,x=i.height,A=void 0,S=void 0,$=s.scrollWidth,R=s.scrollHeight,L=ne(s),T=s.scrollLeft,D=s.scrollTop;s===c?(A=M<$&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=x<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=M<$&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=x<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var w=A&&(Math.abs(b-d)<=g&&T+M<$)-(Math.abs(y-d)<=g&&!!T),v=S&&(Math.abs(p-h)<=g&&D+x<R)-(Math.abs(u-h)<=g&&!!D);if(!be[o])for(var C=0;C<=o;C++)be[C]||(be[C]={});(be[o].vx!=w||be[o].vy!=v||be[o].el!==s)&&(be[o].el=s,be[o].vx=w,be[o].vy=v,clearInterval(be[o].pid),(w!=0||v!=0)&&(f=!0,be[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Fn);var E=be[this.layer].vy?be[this.layer].vy*m:0,_=be[this.layer].vx?be[this.layer].vx*m:0;typeof r=="function"&&r.call(te.dragged.parentNode[ke],_,E,l,Fn,be[this.layer].el)!=="continue"||Dh(be[this.layer].el,_,E)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&a!==c&&(a=lt(a,!1)));Ls=f}},30),zh=function(e){var t=e.originalEvent,n=e.putSortable,d=e.dragEl,h=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var f=n||h;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);c(),f&&!f.el.contains(o)&&(g("spill"),this.onSpill({dragEl:d,putSortable:n}))}};function ra(){}ra.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var d=Ot(this.sortable.el,this.startIndex,this.options);d?this.sortable.el.insertBefore(t,d):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:zh};it(ra,{pluginName:"revertOnSpill"});function oa(){}oa.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,d=n||this.sortable;d.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),d.animateAll()},drop:zh};it(oa,{pluginName:"removeOnSpill"});te.mount(new kg);te.mount(oa,ra);const Ee={getStyle:(l,e=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(l,null):l.currentStyle&&(t=l.currentStyle),e?t[e]:t},fadeOut:(l,e=250)=>{const t=1/(e/60);l.style.opacity=1,(function n(){const d=Number(l.style.opacity)-t;d>0?(l.style.opacity=d,window.requestAnimationFrame(n)):l.remove()})()},slideDown:(l,e=250,t=!1)=>{l.style.display="block";const n=Ee.getStyle(l),d=Number.parseInt(n.height,10),h=d/(e/60);l.style.height="0px",(function g(){const m=Number.parseFloat(l.style.height),c=m+h;m<d?(l.style.height=`${c}px`,window.requestAnimationFrame(g)):(l.style.height="auto",t&&t(l))})()},slideUp:(l,e=250,t=!1)=>{const n=Ee.getStyle(l),d=Number.parseInt(n.height,10),h=n.overflow;l.style.overflow="hidden",l.style.height=`${d}px`;const g=n.minHeight;l.style.minHeight="auto";const m=parseFloat(d/(e/60)).toFixed(2);(function c(){const r=Number.parseInt(l.style.height,10)-m;r>0?(l.style.height=`${r}px`,window.requestAnimationFrame(c)):(l.style.overflow=h,l.style.display="none",l.style.minHeight=g,delete l.style.height,t&&t(l))})()},slideToggle:(l,e=250,t=Ee.getStyle(l,"display")==="none")=>{t?Ee.slideDown(l,e):Ee.slideUp(l,e)}},Bh=l=>Number.isInteger(Number(l)),ut=l=>{let e=0,t=l;for(;t?.previousElementSibling;)t=t.previousElementSibling,e++;return e},Pn=(l,e,t)=>{const n=t.split("||"),h=yt(e).map(g=>l.find(m=>{const c=n.find(f=>!!Re(m,f));return c&&Re(m,c)===g})).filter(Boolean).concat(l);return yt(h)},Jn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},sa=(l,e)=>{const t=[];return Jn(l,(n,d)=>t.push(e(n,d))),t},jo={},jh=l=>{const e={className:"class"};if(jo[l])return jo[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return jo[l]=n,n},Vh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),Dg=l=>window.JSON.parse(window.JSON.stringify(l)),Og=(l,e)=>e.filter(t=>!~l.indexOf(t)),Fe={capitalize:Vh,safeAttrName:jh,forEach:Jn,copyObj:Dg,map:sa,subtract:Og,indexOfNode:ut,isInt:Bh,get:Re,orderObjectsBy:Pn},ze={js:new Set,css:new Set,formeoSprite:null},lu=(l,e,t=As)=>new Promise(n=>fetch(l).then(d=>{if(!d.ok)return n(t(d));n(e?e(d):d)}).catch(d=>t(d))),Uh=(l,e)=>{l.removeEventListener("load",Uh),e(l.src)},Gh=(l,e)=>{l.removeEventListener("load",Gh),e(l.src)},Ig=l=>new Promise((e,t)=>{if(ze.js.has(l))return e(l);ze.js.add(l);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Gh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),Rs=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,d)=>{if(ze.css.has(t))return n(t);ze.css.add(t);const h=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Uh(h,n),error:()=>d(new Error(`${t} failed to load.`))}});document.head.appendChild(h)}));return Promise.all(e)},Ng=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Ig(t));return Promise.all(e)},Fg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Rs(t));return Promise.all(e)},cu=l=>{const t=new DOMParser().parseFromString(l,"image/svg+xml");return ze.formeoSprite=t.documentElement,ze.formeoSprite},Pg=async(l=Wf)=>{if(ze.formeoSprite)return ze.formeoSprite;if(!l)return cu(Pf);const e=async t=>cu(await t.text());return lu(l,e,()=>lu(zf,e))},Hg={js:Ng,css:Fg},qh=l=>{const e=Object.entries(l).map(([t,n])=>Hg[t](n));return Promise.all(e)},Wg=async l=>{if(l&&!ze.css.has(l)&&(await Rs(l),!ze.css.has(l)&&!ze.css.has(sc)))return await Rs(sc)},zg={glyphicons:l=>`<span class="glyphicon glyphicon-${l}" aria-hidden="true"></span>`,"font-awesome":l=>{const[e,t]=l.split(" ");return`<i class="${e} fa-${t}"></i>`},fontello:l=>`<i class="${Sh}${l}">${l}</i>`},Bg=new Set(["input","textarea","select"]),jg=l=>l.replace(/^on([A-Z])/,(e,t)=>t.toLowerCase()),Vg=new Set(["focus","blur"]),Ug=l=>{const e=jg(l);return(t,n)=>t.addEventListener(e,n,Vg.has(e))},Kh=(l={})=>{let e=l?.attrs?.name||l?.name;if(e)return e;const t=We(l);let n=l.config?.label||l.attrs?.label||l?.label;return n&&(typeof n=="object"&&(n=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=mp(n)),e=`${t}-${Ah(vp(n,24,null))}`),e||t};class Gg{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=Ue(this.options,e)}processElemArg(e){let t=e,n;if(typeof t=="string")return n=t,t={tag:n},t;if(t.attrs){const{tag:d,...h}=t.attrs;d&&(typeof d=="string"?n=d:n=(d.find(m=>m.selected===!0)||d[0]).value),t.attrs=h}return t.tag=n||t.tag||"div",t}render=e=>(e.id=`f-${e.id||We()}`,this.create(e));create=(e,t=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const n=this,d=["children","content"],{className:h,options:g,dataset:m,...c}=this.processElemArg(e);d.push("tag");let f;const{tag:r}=c;let o;const a={attrs:{},className:[Fe.get(c,"config.inputWrap")],children:[],config:{}};let s=document.createElement(r);const i={string:p=>{s.innerHTML+=p},object:p=>p&&s.appendChild(n.create(p,t)),node:p=>s.appendChild(p),component:p=>s.appendChild(p.dom),array:p=>{for(const y of p)f=n.childType(y),i[f](y)},function:p=>{p=p(),f=n.childType(p),i[f](p)},undefined:()=>null,boolean:()=>null};if(h&&(c.attrs=Ue(c.attrs,{className:h})),g){const p=this.processOptions(g,c,t);if(this.holdsContent(s)&&r!=="button")i.array.call(this,p),c.content=void 0;else return Fe.forEach(p,y=>{a.children.push(n.create(y,t))}),c.attrs.className&&(a.className=c.attrs.className),a.id=c.id,a.config={...c.config},this.create(a,t);d.push("options")}if(c.attrs&&(n.processAttrs(c,s,t),d.push("attrs")),c.config){if(c.config.label&&(c.config.label&&r!=="button"||["radio","checkbox"].includes(Fe.get(c,"attrs.type")))&&!t){const p=n.label(c);if(!c.config.hideLabel){const y=[p,s];n.labelAfter(c)&&y.reverse(),a.children.push(y)}}d.push("config")}if(c.content||c.children){const p=c.content||c.children;f=n.childType(p),i[f]||console.error(`childType: ${f} is not supported`),i[f].call(this,p)}if(m){for(const p in m)Object.hasOwn(m,p)&&(s.dataset[p]=typeof m[p]=="function"?m[p]():m[p]);d.push("dataset")}c.action&&(this.actionHandler(s,c.action),d.push("action"));const u=Fe.subtract(d,Object.keys(c));for(o=u.length-1;o>=0;o--)s[u[o]]=c[u[o]];return a.children.length&&(s=this.create(a)),s};onRender=(e,t,n=Qe)=>{const d=Date.now(),h=()=>{!e.parentElement&&Date.now()-d<n?window.requestAnimationFrame(h):e.parentElement&&t(e)};h()};actionHandler(e,t){const n={onRender:V.onRender,render:V.onRender};return Object.entries(t).map(([d,h])=>(Array.isArray(h)?h:[h]).map(m=>(n[d]||Ug(d))(e,m)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=ze.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const d=n.getAttribute("viewBox")||"0 0 24 24",h=Array.from(n.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",n.id],viewBox:d,xmlns:"http://www.w3.org/2000/svg"},children:h}};return this.iconSymbols=Array.from(e).reduce((n,d)=>{const h=d.id.replace(Sh,"");return n[h]=t(d),n},{}),this.cachedIcons={},this.iconSymbols}icon(e,t){if(!e)return;const n=`${e}?${new URLSearchParams(t).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const d=this.icons[e];if(d){if(t){const h=Ue(d,t);return this.cachedIcons[n]=V.create(h).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=V.create(d).outerHTML,this.cachedIcons[n]}return zg[V.options.iconFont]?.(e)||e}processAttrs(e,t,n){const{attrs:d={}}=e;if(!n&&!d.name&&d.name!==null&&this.isInput(e.tag)){const h=Kh(e);h&&t.setAttribute("name",h)}for(const h of Object.keys(d)){const g=Fe.safeAttrName(h),m=this.processAttrValue(d[h]);if(m!==!1)try{t.setAttribute(g,m)}catch(c){console.warn(`Could not set attribute ${g} with value ${m}`,c)}}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let t=e||"";if(Array.isArray(t))if(typeof t[0]=="object"){const n=t.filter(d=>d.selected===!0);t=n.length?n[0].value:t[0].value}else t=t.join(" ");return t}toggleElementsByStr=(e,t)=>{const n=[],d=(h,g)=>{g?(h.style.display="block",n.push(h)):h.style.display="none"};return V.elementsContainText(e,t,d),n};elementsContainText=(e,t,n)=>{const d=[];return Jn(e,h=>{const m=h.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(h,m),m&&d.push(h)}),d};generateOption=({type:e="option",label:t,value:n,i:d=0,selected:h})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${d}`,[e==="option"?"selected":"checked"]:h||!d},config:{label:t||X.get("labelCount",{label:X.get("option"),count:d})}});processOptions(e,t,n){const{action:d,attrs:h={}}=t,g=h.type||t.tag,m=h.id||t.id,c=(r,o)=>{const{label:a,value:s,...i}=r,u=()=>{const y={tag:"input",attrs:{name:m,type:g,value:s||"",id:`${m}-${o}`,...i},action:d},b={tag:"label",attrs:{for:`${m}-${o}`},children:a},M={children:[y,b],className:[`f-${g}`]};return h.className&&(t.config.inputWrap=h.className),t.config.inline&&M.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(b.attrs.contenteditable=!0),M};return{select:()=>{const y=r.attrs||r,b={attrs:y,...r,...y},{label:M,checked:x,selected:A,attrs:S}=b;return{tag:"option",attrs:{...S,selected:!!(x||A)},children:M}},button:y=>{const{type:b,label:M,className:x,id:A}=y;return{...t,attrs:{type:b},className:x,id:A||We(),options:void 0,children:M,action:t.action}},checkbox:u,radio:u}[g]?.(r)};return e.map(c)}holdsContent(e){return e.outerHTML.includes("/")}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let t=e;return typeof t!="string"&&(t=t.tagName),Bg.has(t)}parsedHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.textContent}labelAfter(e){const t=Fe.get(e,"attrs.type"),n=Fe.get(e,"config.labelAfter");return n===void 0?t==="checkbox"||t==="radio":n}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});tooltip=e=>({tag:"span",className:"f-tooltip",dataset:{tooltip:e},content:V.icon("info-circle")});helpText=e=>({tag:"small",className:"f-help-text",children:e});label(e,t){const n=Fe.get(e,"attrs.required");let{config:{label:d="",helpText:h="",tooltip:g=null}}=e;const{id:m,attrs:c}=e;typeof d=="function"&&(d=d());const f={tag:"label",attrs:{for:m||c?.id},className:[],children:[d,n&&this.requiredMark(),g&&this.tooltip(g),h&&this.helpText(h)],action:{}};return t&&(f.attrs.for=void 0,f.attrs.contenteditable=!0,f.fMap=t),f}childType(e){return e===void 0?e:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(t=>t[1](e))[0]}getStyle(e,t=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(e,null):e.currentStyle&&(n=e.currentStyle),t?n[t]:n}getElement(e){const t={node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)},n=this.childType(e);return t[n]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const t=e.parentElement,n=Le(e),d=t.getElementsByClassName(`formeo-${n}`);if(this.remove(e),!d.length)return this.isStage(t)?this.emptyClass(t):this.removeEmpty(t)};remove(e){const t=Le(e);return t?ce.remove(`${t}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,t){const n={string:d=>d.classList.remove(t),array:d=>{for(const h of t)d.classList.remove(h)}};n.object=n.string,Fe.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:d=>d.classList.add(t),array:d=>{for(const h of t)d.classList.add(h)}};Fe.forEach(e,n[this.childType(t)])}formGroup(e,t=""){return{className:["f-field-group",t],children:e}}coords(e){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:t.left+t.width/2,pageY:t.top-n.top-t.height/2}}clearStage(e){e.classList.add("removing-all-fields");const t=()=>{V.empty(e),e.classList.remove("removing-all-fields"),V.emptyClass(e),Ee.slideDown(e,300)};Ee.slideUp(e,600,t)}toggleSortable(e,t){let n=t;const d=Le(e);if(!d)return;const h=Le(e.parentElement),g=V[d].get(e.id).sortable;n||(n=!g.option("disabled")),g.option("disabled",n),h&&["rows","columns","stages"].includes(h)&&this.toggleSortable(e.parentElement,n)}emptyClass(e){const t=e.getElementsByClassName(jf.get(e.classList.item(0)));e.classList.toggle("empty",!t.length)}btnTemplate=({title:e="",...t})=>({tag:"button",attrs:{type:"button",title:e},...t});isControls=e=>Le(e)===ct;isStage=e=>Le(e)===Pt;isRow=e=>Le(e)===tt;isColumn=e=>Le(e)===nt;isField=e=>Le(e)===Ht;asComponent=e=>ce[`${Le(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}}const V=new Gg,qg="modulepreload",Kg=function(l){return"/formeo/"+l},uu={},Tt=function(e,t,n){let d=Promise.resolve();if(t&&t.length>0){let c=function(f){return Promise.all(f.map(r=>Promise.resolve(r).then(o=>({status:"fulfilled",value:o}),o=>({status:"rejected",reason:o}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),m=g?.nonce||g?.getAttribute("nonce");d=c(t.map(f=>{if(f=Kg(f),f in uu)return;uu[f]=!0;const r=f.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${o}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":qg,r||(a.as="script"),a.crossOrigin="",a.href=f,m&&a.setAttribute("nonce",m),document.head.appendChild(a),r)return new Promise((s,i)=>{a.addEventListener("load",s),a.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return d.then(g=>{for(const m of g||[])m.status==="rejected"&&h(m.reason);return e().catch(h)})},Lt="f-autocomplete",Yg=`${Lt}-display-field`,aa=`${Lt}-list`,Bt="highlight-component",Hn=`${aa}-item`,Zg=(l,e)=>{const t=l.reduce((n,d)=>n+(d===e),0);return t>1?`(${t})`:""},Yh=["config.label","config.controlId"],Xg=["config.legend","name"],Qg=[...Yh,...Xg],Vo=l=>Yh.reduce((e,t)=>e||l.get(t),null),hu=l=>Qg.reduce((e,t)=>e||l.get(t),null)||Je(l.name),Jg=new Map([["condition.source",Vo],["if.condition.source",Vo],["if.condition.target",Vo],["then.condition.target",hu],["condition.target",hu]]),Zh=({id:l,...e},t)=>{const{name:n,label:d}=e;return n?Jg.get(t)(e):d},em=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Uo=l=>(l.classList.contains(Hn)||(l=l.parentElement),l),Xh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:d=0},h)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[Hn,`${Hn}-depth-${d}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Uo(m),h.setValue(m),h.selectOption(m),h.hideList()},mouseover:({target:m})=>{m=Uo(m),h.removeHighlight(),h.highlightComponent(m)},mouseleave:({target:m})=>{m=Uo(m),h.removeHighlight()}}};return V.create(g)},tm=(l,e)=>{const t=l.data.options.map((d,h)=>{const g=`${l.address}.options[${h}]`,m=d.label,c=d.label;return Xh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return V.create({tag:"ul",attrs:{className:[aa,"options-list"]},children:t})},nm=l=>{const e=l.value,t=[],n=ce.flatList();return Object.entries(n).reduce((h,[g,m])=>{const c=Zh(m,l.key);if(c){const f=m.name,r={tag:"span",content:` ${Je(f)}`,className:"component-type"},o=`${f}.${c}`;t.push(o);const a=Zg(t,o),s={tag:"span",content:a,className:"component-label-count"},i=[`${c} `,s,r],u=[c,a].join(" ").trim();if(m.isCheckable){const y=tm(m,l);i.push(y)}const p=em({value:g,textLabel:u,htmlLabel:i,componentType:f,selectedId:e});h.push(Xh(p,l))}return h},[])};class im{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:d=As}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=d||As,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.dom){const n=e.dom[t];return typeof n=="function"?n.bind(e.dom):n}},set(e,t,n){return t in e?e[t]=n:e.dom[t]=n,!0}})}get isAddress(){return He(this.value)}get valueComponent(){return He(this.value)&&ce.getAddress(this.value)}build(){const e=n=>{const d=this.list,h=this.getActiveOption();let m=new Map([[38,()=>{const c=this.getPreviousOption(h);c&&this.selectOption(c)}],[40,()=>{const c=this.getNextOption(h);c&&this.selectOption(c)}],[13,()=>{h&&(this.selectOption(h),this.setValue(h),d.style.display==="none"?this.showList(h):this.hideList()),n.preventDefault()}],[27,()=>{this.hideList()}]]).get(n.keyCode);return m||(m=()=>!1),m()},t={focus:({target:n})=>{this.updateOptions(),n.parentElement.classList.add(`${Lt}-focused`);const d=V.toggleElementsByStr(this.list.querySelectorAll(`.${Hn}-depth-0`),n.value);n.addEventListener("keydown",e);const h=this.list.querySelector(".active-option")||d[0];this.showList(h)},blur:({target:n})=>{n.parentElement.classList.remove(`${Lt}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:d}=n.target,h=V.toggleElementsByStr(this.list.querySelectorAll("li"),d);if(d.length===0&&this.clearValue(),h.length===0)this.hideList();else{const g=this.getActiveOption()||h[0];this.showList(g)}this.setValue({dataset:{label:d,value:d}})}};return this.displayField=V.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:Yg,value:this.label||this.value,placeholder:X.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:Lt,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:aa}}),this.clearButton=V.create({tag:"span",content:V.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=V.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[Lt,this.className].flat(),action:{onRender:n=>{this.stage=n.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!He(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&Zh(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>qs*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=nm(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),d=this.displayField.getBoundingClientRect(),h={position:"absolute",top:`${d.y+e-n.y}px`,left:`${d.x+window.scrollX-n.x+2}px`,width:`${t}px`};Object.assign(this.list.style,h)}showList(e,t=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),Ee.slideDown(t,bt)}hideList(e=this.list){Ee.slideUp(e,bt),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const t=e.querySelector(".active-option");return t?.style.display!=="none"?t:null}getPreviousOption(e){let t=e;do t=t?t.previousSibling:null;while(t!=null&&t.style.display==="none");return t}getNextOption(e){let t=e;do t=t?t.nextSibling:null;while(t!=null&&t.style.display==="none");return t}selectOption(e,t=this.list){const n=t.querySelectorAll("li");for(const d of n){const{dataset:{value:h}}=d;d.classList.remove("active-option"),He(h)&&ce.getAddress(h)?.dom?.classList.remove(Bt)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Bt);for(const t of e)t.classList.remove(Bt)}highlightComponent(e){const{dataset:{value:t}}=e;if(He(t)){const{componentAddress:n,isOptionAddress:d,optionIndex:h}=wt(t).reduce((m,c)=>c==="options"?(m.isOptionAddress=!0,m):m.isOptionAddress?(m.optionIndex=+c,m):(m.componentAddress.push(c),m),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=ce.getAddress(n);g?.dom&&(g.dom.classList.add(Bt),d&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[h]?.classList.add(Bt))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:t,value:n}=e.dataset;this.displayField.value=t,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}const Qh=l=>X.get(`${l}.placeholder`)||Je(kn(l)),la=l=>l.replaceAll(".","-"),du=new Map([["config.helpText",(...l)=>fu(...l)],["config.tooltip",(...l)=>fu(...l)]]);function Go({key:l,value:e,type:t="text",checked:n}){const d={tag:"input",attrs:{type:t,value:e,placeholder:Qh(l)},className:[la(l)],config:{}};return n&&(d.attrs.checked=!0),d}function fu({key:l,value:e}){return{tag:"textarea",attrs:{placeholder:Qh(l)},className:[la(l)],config:{},textContent:e}}function Ge(l){const e=X.get(l);if(e)return e;const t=kn(l);return X.get(t)||Je(t)}const It={autocomplete:(...l)=>new im(...l).createProxy(),string:({key:l,value:e})=>du.has(l)?du.get(l)({key:l,value:e}):Go({key:l,value:e}),boolean:({key:l,value:e})=>Go({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Go({key:l,value:e,type:"number"}),array:({key:l,value:e})=>({tag:"select",attrs:{placeholder:Ge(`placeholder.${l}`)},className:[la(l)],options:e}),object:l=>Object.entries(l).map(([e,t])=>It[V.childType(t)]({key:e,value:t}))},rm={boolean:(l,e)=>({click:({target:t})=>{if(t.type==="radio"){const n=e.data.options.map(d=>({...d,selected:!1}));e.set("options",n)}e.set(l,t.checked),e.updatePreview()}}),string:(l,e)=>({input:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),number:(l,e)=>({input:({target:{value:t}})=>{e.set(l,Number(t)),e.debouncedUpdatePreview()}}),array:(l,e)=>({change:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),object:()=>({})},om=Object.freeze({title:"",content:null,confirmText:()=>Ge("save"),cancelText:()=>Ge("cancel"),onConfirm:()=>{},onCancel:()=>{},className:"",closeOnEscape:!0,position:"top",triggerElement:null,triggerCoords:null});class Dt{constructor(e){this.opts=Ue(om,e),this.dialog=null}createDialog(){const{title:e,content:t,confirmText:n,cancelText:d,className:h,closeOnEscape:g,position:m}=this.opts,c=`dialog-position-${m}`,f=[];return e&&f.push({tag:"h3",className:"dialog-title",textContent:e}),t&&f.push({tag:"div",className:"dialog-body",children:Array.isArray(t)?t:[t]}),f.push({tag:"div",className:"dialog-actions",children:[{tag:"button",type:"button",className:"btn btn-sm btn-secondary",textContent:typeof d=="function"?d():d,action:{click:()=>this.handleCancel()}},{tag:"button",type:"submit",className:"btn btn-sm btn-primary",textContent:typeof n=="function"?n():n}]}),V.create({tag:"dialog",className:["formeo-dialog","formeo",c,h],children:[{tag:"form",className:"dialog-form",method:"dialog",children:f,action:{submit:o=>this.handleSubmit(o)}}],action:{cancel:o=>{g?this.handleCancel():o.preventDefault()}}})}handleSubmit(e){e.preventDefault();const t=new FormData(e.target);this.opts.onConfirm(t,this),this.close()}handleCancel(){this.opts.onCancel(this),this.close()}setPosition(){const{position:e,triggerElement:t,triggerCoords:n}=this.opts;if(e!=="trigger"||!this.dialog)return;let d=n;if(!d&&t){const h=t.getBoundingClientRect();d={x:h.left+h.width/2,y:h.bottom+8}}if(d){const h=this.dialog.getBoundingClientRect(),g=window.innerWidth,m=window.innerHeight;let c=d.x-h.width/2,f=d.y;const r=16;c=Math.max(r,Math.min(c,g-h.width-r)),f=Math.max(r,Math.min(f,m-h.height-r)),this.dialog.style.left=`${c}px`,this.dialog.style.top=`${f}px`,this.dialog.style.transform="none"}}open(){if(this.dialog||(this.dialog=this.createDialog()),document.body.appendChild(this.dialog),this.dialog.showModal(),this.opts.position==="trigger"){const e=setTimeout(()=>{this.setPosition(),clearTimeout(e)},0)}return this}close(){this.dialog&&(this.dialog.close(),this.dialog.remove(),this.dialog=null)}static alert(e,t=()=>{}){return new Dt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("ok")||"OK",cancelText:"",onConfirm:()=>t()})}static confirm(e,t=()=>{},n=()=>{}){return new Dt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("confirm")||"Confirm",onConfirm:()=>t(),onCancel:()=>n()})}static prompt(e,t=()=>{},n=""){return new Dt({content:[{tag:"label",className:"dialog-prompt-label",children:[{tag:"p",className:"dialog-message",textContent:e},{tag:"input",type:"text",name:"prompt-value",className:"dialog-prompt-input",value:n}]}],onConfirm:d=>{const h=d.get("prompt-value");t(h)}})}}const Jh="hidden-property",sm="hidden-option",qo=/\.options\[\d+\]$/,am={"if-sourceProperty":Cn(wn,cc,uc),"if-targetProperty":Cn(wn),"then-targetProperty":Cn(wn,cc,uc),...Object.entries(lp).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},ed={assignment:jt,comparison:jt,logical:jt,source:({key:l,value:e,onChange:t,conditionType:n})=>It.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:jt,targetProperty:jt,target:l=>ed.source(l),value:({key:l,value:e,onChange:t},n)=>{const d=It.string({key:`condition.${l}`,value:e});return d.action={input:t},d}};function lm({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,d=am[n];return Object.entries(d||{}).map(([h,g])=>cm({fieldName:l,fieldValue:e,key:h,optionValue:g}))}function cm({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:X.get(`${l}.${t}`)||Je(t).toLowerCase(),value:n,selected:n===e}}function jt({key:l,value:e,onChange:t,conditionType:n}){const d=lm({key:l,value:e,conditionType:n}),h=It.array({key:`condition.${l}`,value:d});return h.action={change:t},h}const um=l=>!l?.classList.contains(Jh),hm={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,d=!!e.value.match(qo);return gu(d,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,d=!!e.value.match(qo);return!n||d||t.value!=="value"},assignment:l=>{const e=l.get("target"),t=l.get("targetProperty");return!!!e.value||t.value.startsWith("is")},targetProperty:l=>{const e=l.get("target"),t=l.get("targetProperty"),n=!!e.value.match(qo);return gu(n,t),!Nf(e.value)},target:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e?.value;return t&&!n?!0:t&&t?.value!=="value"},value:l=>{const e=l.get("target"),t=l.get("targetProperty");return t===void 0?!1:e&&!e.value||!um(l.get("comparison"))||t.value===td?!0:t.value.startsWith("is")}},pu=l=>{for(const[e,t]of l){const n=!!hm[e]?.(l)||!1;t.classList.toggle(Jh,n)}},td="isChecked",Ko=l=>l.value.endsWith("Checked"),gu=(l,e)=>{if(l&&Ko(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const d of t){const h=Ko(d),g=l?!h:h;g&&n.push(d.value),d.classList.toggle(sm,g)}n.includes(e.value)&&(e.value=l?td:t.find(d=>!Ko(d))?.value||e.value)};function dm(l,e=ap){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class fm{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:d},h){this.values=new Map(dm(e)),this.conditionType=t,this.parent=h,this.baseAddress=`${h.address}.${t}`,this.fields=new Map,this.conditionCount=n,this.index=d,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=ce.getAddress(this.baseAddress);e.splice(this.index,1),ce.setAddress(this.baseAddress,e),Ee.slideUp(this.dom,bt,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:X.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[d,h]of this.values){const g=r=>this.onChangeCondition({key:d,target:r.target}),m={key:d,value:h,conditionType:this.conditionType,onChange:g},c=ed[d](m,this.values),f=c.dom||V.create(c);this.fields.set(d,c.dom?c:f),e.push(f)}const n={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:d=>{this.processUiState()}}};return V.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,d=V.btnTemplate({title:X.get(`remove${this.conditionType}Condition`),className:[t,n("remove")],content:V.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(d);const h=V.btnTemplate({title:X.get(`add${this.conditionType}Condition`),className:[t,n("add")],content:V.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),m={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(m)}}});return e.push(h),e}get value(){return Array.from(this.fields).reduce((e,[t,n])=>(e[t]=n.value,e),{})}processUiState(){pu(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Ln(e=>{Q.formeoUpdated(e),ce.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:t})=>{const n={changedProperty:e,dataPath:this.address,value:this.value,src:t};pu(this.fields),this.updateDataDebounced(n)}}const pm=new Map([["attrs",({itemKey:l})=>l],["options",({itemKey:l,key:e})=>`${l}.${e}`]]),nd=(l,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,d]=l?Rn:hp,h=t.data.map(({[n]:g,...m})=>({[d]:g,...m}));t.setData(h)}},gm=new Map([["attrs-multiple",l=>({change:({target:e})=>{l.field.controlId==="select"&&nd(e.checked,l.field)}})]]);class Vt{constructor({key:e,index:t,field:n,panel:d,data:h}){this.field=n,this.itemKey=e,this.itemIndex=t,this.panel=d,this.panelName=d.name,this.isDisabled=n.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(e,this.panelName),this.address=`${n.indexName}.${n.id}.${e}`,this.itemSlug=hc(e),this.conditionTypeWrap=new Map,h!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,h);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=V.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?Pn(Object.entries(e),Rn,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let t=this.conditionTypeWrap.get(e);return t||(t=V.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,t),t)}itemInputs(){const e=V.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([t,n])=>this.panelName==="conditions"?this.generateConditionFields(t,n):this.itemInput(t,n))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,t)=>{const n=this.findOrCreateConditionTypeWrap(e);let d=t;if(!d){const[g]=ea()[e],m=n.children.length;e===Ch&&(g.logical="||"),d={conditionValues:g,conditionCount:m,index:m}}const h=new fm({conditionType:e,...d},this);return n.appendChild(h.dom),h};removeConditionType=(e,t)=>{const d=this.conditionTypeWrap.get(e).children[t];d.destroy(),d.dom.remove()};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,d)=>{const h=this.addConditionType(e,{index:d,conditionCount:t.length,conditionValues:n});this.conditions.set(d,h)}),this.findOrCreateConditionTypeWrap(e));get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{Ee.slideUp(this.dom,Qe,n=>{this.field.remove(this.itemKey),n.remove(),this.panel.updateProps()})},mouseover:n=>{this.dom.classList.add("to-remove")},mouseout:n=>{this.dom.classList.remove("to-remove")}},content:V.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}getConfigAttrOptions(e){const t=e.split(".").pop(),n=this.field.config?.attrs?.[t];return Array.isArray(n)?n:null}itemInput(e,t){if(this.isDisabled)return null;let n=V.childType(t)||"string",d=t;if(this.panelName==="attrs"){const i=this.getConfigAttrOptions(e);i&&(d=i.map(u=>({...u,selected:u.value===t})),n="array")}const h=pm.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,g=h.split(".").filter(Number.isNaN).join(".")||e,m=It[n]({key:e,value:d}),c=`${this.field.shortId}-${hc(h).replaceAll(/-\d+-(selected)/g,"-$1")}`,f={label:this.panelName!=="options"&&Ge(g),labelAfter:!1,inputWrap:["f-input-wrap",this.isLocked&&"locked-prop",this.isDisabled&&"disabled-prop"].filter(Boolean).join(" ")},r={name:m.attrs.type==="checkbox"?`${c}[]`:c};r.disabled=this.isDisabled,r.readonly=this.isLocked;const o=gm.get(this.itemSlug)?.(this),a=Dp(rm[n](h,this.field),o||{}),s=Ue(It[n]({key:e,value:d}),{action:a,attrs:r,config:f});return Rn.includes(e)?{className:"f-addon",children:s}:s}}const mm={multiple:(l,e)=>{nd(!!l,e)}},vm=[{label:Ge("config.label"),value:"label"},{label:Ge("config.hideLabel"),value:"hideLabel"},{label:Ge("config.helpText"),value:"helpText"},{label:Ge("config.labelAfter"),value:"labelAfter"},{label:Ge("config.disableHtmlLabel"),value:"disableHtmlLabel"},{label:Ge("config.tooltip"),value:"tooltip"}],ym={label:"New Field",hideLabel:!1,helpText:"",labelAfter:!1,disableHtmlLabel:!1,tooltip:""};class bm{constructor(e,t,n){this.type=V.childType(e),this.name=t,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:X.get(`panel.label.${this.name}`)},attrs:{className:`${ch} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,d)=>{const h=this.type==="array",g=n[0],m=h?`[${d}]`:`.${n[0]}`,c=h?n:{[n[0]]:n[1]},f=`${this.name}${m}`,r=this.component.isDisabledProp(f,this.name),o=dp.get(this.name)?.has(g)??!0;return r||!o?null:new Vt({key:f,data:c,field:this.component,index:d,panel:this})}).filter(Boolean);const t={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:this.name==="options",content:this.editPanelItems};return V.create(t)}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}createEditButtons(){const e=this.name,t={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition,config:this.addConfiguration},n=[];if(e==="conditions"){X.current&&!X.current.clearAll&&X.put("clearAll","Clear All");const m={...V.btnTemplate({content:[V.icon("bin"),X.get("clearAll")],title:X.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};n.push(m)}const d=X.get(`panelEditButtons.${e}`)||`+ Add ${Je(e)}`,h={...V.btnTemplate({content:d,title:d}),className:`add-${e}`,action:{click:m=>{const c={btnCoords:V.coords(m.target),addAction:t[e]};e==="attrs"&&(c.isDisabled=this.component.isDisabledProp,c.isLocked=this.component.isLockedProp,c.message={attr:X.get(`action.add.${e}.attr`),value:X.get(`action.add.${e}.value`)});const f=Je(e),r=new globalThis.CustomEvent(`onAdd${f}`,{detail:c});xe.add[e](c),document.dispatchEvent(r)}}};return n.push(h),{className:"panel-action-buttons",content:n}}addAttribute=(e,t)=>{let n=t;const d=jh(e),h=`attrs.${d}`;X.current[h]||X.put(h,Vh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),mm[d]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${d}`),m=new Vt({key:h,data:{[d]:n},field:this.component,panel:this});g?g.replaceWith(m.dom):this.props.appendChild(m.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,t=this.component.get("options"),n=e==="select"?"option":e,d=X.get("newOptionLabel",{type:n})||"New Option",h=`${this.name}[${this.data.length}]`,g=t[t.length-1],c={...t.length?g:{},label:d};e!=="button"&&(c.value=Ah(d));const f=new Vt({key:h,data:c,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(f),this.props.appendChild(f.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,d=new Vt({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(d.dom),this.component.set(n,e.template),this.component.resizePanelWrap()};addConfiguration=()=>{const e=this.component.get("config");new Dt({className:"config-item-dialog",content:[{tag:"select",config:{label:X.get("selectConfigKey")||"Select Configuration Key"},attrs:{name:"selectConfigKey",required:!0,className:"config-key-select"},options:vm.filter(n=>!(n.value in e))}],onConfirm:n=>{const d=n.get("selectConfigKey").trim(),h=`config.${d}`;if(d){const g=new Vt({key:h,data:ym[d],field:this.component,panel:this});this.editPanelItems.push(g),this.props.appendChild(g.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()}}}).open()};clearAllItems=()=>{const e=this.type==="array"?[]:{},t={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};xe.remove[this.name](t);const n=Je(this.name),d=new globalThis.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(d)};setData(e){this.data=e,this.component.set(this.name,e),this.updateProps()}}const mu=Object.freeze({type:"field",displayType:"slider"}),vn=l=>({transform:`translateX(${l?`${l}px`:0})`});class id{constructor(e){this.opts=Ue(mu,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const t=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver(([{contentRect:{width:h}}])=>{this.currentWidth!==h&&(this.toggleTabbedLayout(),this.currentWidth=h,this.nav.setTranslateX(this.activePanelIndex,!1))}),d=window.setTimeout(()=>{n.observe(t),window.clearTimeout(d)},qs)}getPanelDisplay(){const e=this.panelsWrap,n=Number.parseInt(V.getStyle(e,"width"),10)>390?"tabbed":"slider",d=this.opts.displayType==="auto";return this.panelDisplay=d?n:this.opts.displayType||mu.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=V.create({className:"panels",content:this.opts.panels.map(({config:t,...n})=>n)});return this.opts.type==="field"&&this.sortableProperties(e),this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}sortableProperties(e){const t=e.getElementsByClassName("field-edit-group");return Fe.forEach(t,n=>{n.fieldId=this.opts.id,n.isSortable&&te.create(n,{animation:150,group:{name:`edit-${n.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:d=>{this.propertySave(d.to),this.resizePanels()}})})}createPanelNavLabels(){const e=this.opts.panels.map(d=>({tag:"h5",action:{click:h=>{const g=ut(h.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:d.config.label})),t={className:"panel-labels",content:{content:e}},[n]=e;return n.className="active-tab",V.create(t)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:X.get("controlGroups.nextGroup"),type:"button"},action:{click:n=>this.nav.nextGroup(n)},content:V.icon("triangle-right")},t={tag:"button",attrs:{className:"prev-group",title:X.get("controlGroups.prevGroup"),type:"button"},action:{click:n=>this.nav.prevGroup(n)},content:V.icon("triangle-left")};return V.create({tag:"nav",attrs:{className:"panel-nav"},content:[t,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},t=this.currentPanel.parentElement,n=this.labels.firstChild,d=n.children,h=this.currentPanel.parentElement.childNodes;this.activePanelIndex=ut(this.currentPanel);let g={nav:0,panel:0},m={...g};e.groupChange=r=>(this.activePanelIndex=r,this.currentPanel=h[r],V.removeClasses(h,"active-panel"),V.removeClasses(d,"active-tab"),this.currentPanel.classList.add("active-panel"),d[r].classList.add("active-tab"),this.currentPanel);const c=r=>({nav:-n.offsetWidth*r,panel:-t.offsetWidth*r}),f=({offset:r,reset:o,duration:a=bt,animate:s=!this.isTabbed})=>{const i=[vn(m.panel),vn(r.panel)],u=[vn(m.nav),vn(this.isTabbed?0:r.nav)];if(o){const[M]=i,[x]=u;i.push(M),u.push(x)}const p={easing:"ease-in-out",duration:s?a:0,fill:"forwards"},y=t.animate(i,p);n.animate(u,p);const b=()=>{y.removeEventListener("finish",b),o||(m=r)};y.addEventListener("finish",b)};return e.setTranslateX=(r=this.activePanelIndex,o=!0)=>{g=c(r),f({offset:g,animate:o})},e.refresh=(r=this.activePanelIndex)=>{this.activePanelIndex!==r&&e.groupChange(r),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const r=this.activePanelIndex+1;if(r!==h.length){const o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},f({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const r=this.activePanelIndex-1,o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},f({offset:g,reset:!0})},e}}let Yo=null;const Zo=Cn(wn);class ei extends na{constructor(e,t={}){const n={...t,id:t.id||We()};super(e,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config={...n.config,...ce[`${this.name}s`].config},this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach(([e,t])=>{this.addEventListener(e,t)})}addEventListener(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(t)}removeEventListener(e,t){if(!this.eventListeners?.has(e))return;const n=this.eventListeners.get(e),d=n.indexOf(t);d>-1&&n.splice(d,1)}dispatchComponentEvent(e,t={}){const n={component:this,target:this,type:e,timestamp:Date.now(),...t};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(d=>{try{typeof d=="function"&&d(n)}catch(h){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,h)}}),n}set(e,t){const n=this.get(e),d=super.set(e,t);return n!==t&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:n,newValue:t}),d}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const g=wt(e),m=g.pop(),c=this.get(g);return Array.isArray(c)?Bh(m)?c.splice(Number(m),1):this.set(g,c.filter(f=>f!==m)):delete c[m],c}if(this.name==="stage")return null;const t=this.parent,n=this.children;this.dispatchComponentEvent("onRemove",{path:e,parent:t,children:[...n]}),Jn(n,g=>g.remove()),this.dom.remove(),If(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const h={row:Xs,column:Qs,field:Js}[this.name];return h&&Q.formeoUpdated({componentId:this.id,componentType:this.name,parent:t},h),ce[`${this.name}s`].delete(this.id)};empty(){const e=this.children.map(t=>(t.remove(),t));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{ce.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:t})=>{this.dom.classList.remove(...e),ce.stages.active.dom.classList.remove(`active-hover-${this.name}`),t.removeAttribute("style")}},children:[{...V.btnTemplate({content:V.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>V.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[V.icon(`handle-${this.name}`),Je(this.name)].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const t=this.dom,n="editing",d=`${n}-${this.name}`,h=this.dom.querySelector(`.${this.name}-edit`);Ee.slideToggle(h,Qe,e),this.name==="field"&&(Ee.slideToggle(this.preview,Qe,!e),t.parentElement.classList.toggle(`column-${d}`,e)),t.classList.toggle(n,e),t.classList.toggle(d,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(g=`handle-${this.name}`)=>({...V.btnTemplate({content:V.icon(g)}),className:["component-handle"]}),move:(g="move")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-move"],meta:{id:"move"}}),edit:(g="edit")=>({...V.btnTemplate({content:V.icon(g)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(g="remove")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{Ee.slideUp(this.dom,Qe,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(g="copy")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:t,disabled:n}=this.config.actionButtons,h=t.filter(g=>!n.includes(g)).map(g=>e[g]?.()||g);return this.actionButtons=h,this.actionButtons}get index(){return ut(this.dom)}removeClasses=e=>{const t={string:()=>this.dom.classList.remove(e),array:()=>e.map(n=>this.dom.classList.remove(n))};return t.object=t.string,t[V.childType(e)](this.dom)};get parentType(){return ep.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Us[e]}`);return t&&V.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=ac.get(this.name);return sa(e,n=>ce.getAddress(`${t}s.${n.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(t=>this.addChild({id:t}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},t=this.domChildren.length){let n=e;typeof e!="object"&&(n={id:n});const d=this.dom.querySelector(".children"),{id:h=We()}=n,g=ac.get(this.name);if(!g)return null;const m=`${g}s`,c=ce.getAddress(`${m}.${h}`)||ce[m].add(h,n);t>=d.children.length?d.appendChild(c.dom):d.children[t].before(c.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:c,child:c,index:t}),c.dispatchComponentEvent("onAdd",{parent:this,target:c,index:t,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:c});const f=c.get("children");return f?.length&&c.loadChildren(f),this.removeClasses("empty"),this.saveChildOrder(),c}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:t})=>t);return this.set("children",e),e};onAdd({from:e,to:t,item:n,newIndex:d}){e.classList.contains(ct)||(e=e.parentElement);const h=Le(e),g=Le(t.parentElement),m=()=>{this.saveChildOrder(),this.removeClasses("empty")},c=new Map([[-2,()=>{const o=this.addChild({},d).addChild();return o.addChild.bind(o)}],[-1,()=>{const o=this.addChild({},d);return o.addChild.bind(o)}],[0,()=>this.addChild.bind(this)],[1,o=>{const a=ut(this.dom);return()=>this.parent.addChild(o,a+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Yo){const{default:b}=await Tt(async()=>{const{default:M}=await Promise.resolve().then(()=>Im);return{default:M}},void 0);Yo=b}const{controlData:{meta:{id:o},...a}}=Yo.get(n.id);Zn(a,"config.controlId",o);const s=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=Re({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${s}`),p=c.get(u)();return V.remove(n),p(a,d)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||Ss)()?.({id:n.id},d)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||Ss)()?.(n.id)}}[h]?.(n,d);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:d,fromType:h,toType:g,addedComponent:r,addedVia:"dragDrop"}),m(),r}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(nt)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:t}})=>{e?.classList.remove(`hovering-${Le(e)}`),t?.classList.remove(`hovering-${Le(t)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&V.onRender(this.dom,e.onRender)}set config(e){const t=Re(e,"all"),n=Re(this.data,"config.controlId"),d=n&&Re(e,n),h=Re(e,this.id),g=[t,d,h].reduce((m,c)=>c?Ue(m,c):m,this.configVal);this.configVal=g}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(n=>{const d=this.processConditions(n.if),h=this.processResults(n.then);return d.map(g=>this.evaluateConditions(g)&&this.execResults(h))}):null};getComponent(e){const[t,n]=e.split("."),d=ce[t];return n===this.id?this:d?.get(n)}value=(e,t)=>{const n=e.split("."),d=this.getComponent(e),h=d&&n.slice(2,n.length).join(".");return[!d,!h,!Zo[h]].some(Boolean)?e:t?d.set(Zo[h],t):d.get(Zo[h])};getResult=e=>({"=":(n,d,h)=>n.set(d,h)})[e];processResults=e=>e.map(({operator:t,target:n,value:d})=>{const h=this.getComponent(n),g=h&&n.split(".").slice(2,n.length).join(".");return{target:h,propertyPath:g,action:this.getResult(t),value:this.value(d)}});execResults=e=>{const t=e.map(n=>this.execResult(n));return Promise.all(t)};execResult=({target:e,action:t,value:n,_propertyPath:d})=>new Promise((h,g)=>{try{return h(t(e,n))}catch(m){return g(m)}});cloneData=()=>{const e={...Ke(this.data),id:We()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const t=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(t),this.dispatchComponentEvent("onClone",{original:this,clone:t,parent:e}),t};cloneChildren(e){for(const t of this.children)t?.clone(e)}createChildWrap=e=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Ur.row}get isColumn(){return this.name===Ur.column}get isField(){return this.name===Ur.field}isDisabledProp=(e,t="attrs")=>{if(Re(this.config,e))return!1;if((this.config?.disabled||[]).includes(e))return!0;const h=kn(e);return(this.config?.panels[t]?.disabled||[]).includes(h)};isLockedProp=(e,t="attrs")=>{if((this.config?.locked||[]).includes(e))return!0;const h=kn(e);return!!(this.config?.panels[t]?.locked||[]).includes(h)};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},t=this.editPanels.size;return t&&(e.className.push(`panel-count-${t}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(t===0){const n=this.dom.querySelector(".edit-toggle"),d=this.dom.querySelector(`.${this.name}-actions`),h=d.getElementsByTagName("button");d.style.maxWidth=`${h.length*h[0].clientWidth}px`,V.remove(n)}else this.resizePanelWrap()}},V.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=new Set(["object","array"]),t=yt([...this.config.panels.order,...Object.keys(this.data)]),n=new Set(["children","meta","action","events",...this.config.panels.disabled]),d=t.filter(g=>!n.has(g));for(const g of d){const m=this.get(g),c=V.childType(m);if(e.has(c)){const f=new bm(m,g,this);this.editPanels.set(f.name,f)}}const h={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new id(h),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class wm{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const t=e.querySelector(".children");if(!t)return 0;const n=t.children.length,d=V.getStyle(t,"gap")||"0px",h=parseFloat(d,10)||0;return this.totalGapWidth=h*(n-1),t.offsetWidth-this.totalGapWidth}validateResizeTarget(e,t){return e&&t&&e.offsetWidth&&t.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const t=e.target.parentElement,n=t.nextSibling||t.previousSibling,d=t.closest(`.${tt}`);if(!this.validateResizeTarget(t,n)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,d.classList.add(Vr),this.columnPreset=d.querySelector(`.${uh}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(Es,""),n.className=n.className.replace(Es,""),this.colStartWidth=t.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(d),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=t,this.sibling=n,this.row=d;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(h){console.error("Failed to initialize resize listeners:",h),this.cleanup()}}calculateNewWidths(e){const t=this.colStartWidth+e-this.startX,n=this.sibStartWidth-e+this.startX,d=parseFloat(jr(t,this.rowWidth)),h=parseFloat(jr(n,this.rowWidth));return d<10||h<10?null:{colWidth:Cs(d.toFixed(1)),siblingColWidth:Cs(h.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,d=e.type==="touchmove"?e.touches[0].clientX:e.clientX,h=this.calculateNewWidths(d);if(!h)return;const{colWidth:g,siblingColWidth:m}=h;t.dataset.colWidth=g,n.dataset.colWidth=m,t.style.width=g,n.style.width=m,this.resized=!0}onStop(){const{column:e,sibling:t}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),ce.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),ce.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),this.row.classList.remove(Vr),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Vr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${xs}`);const n=this.row.querySelector(".children").children,d=sa(n,m=>jr(m.clientWidth,this.rowWidth).toFixed(1)),h=d.join(","),g=d.join(" | ");return t||(t=V.create({tag:"option",attrs:{className:xs,value:h,selected:!0},content:g}),e.append(t)),t.value=h,t.textContent=g,h}}const Cm=()=>Object.freeze({config:{width:"100%"},children:[],className:[nt]}),vu={resizeHandle:l=>({className:"resize-x-handle",action:{pointerdown:l.onStart.bind(l)},content:[V.icon("triangle-down"),V.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})};class Sm extends ei{constructor(e){super("column",{...Cm(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[nt,"empty"],dataset:{hoverTag:X.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),vu.editWindow(),vu.resizeHandle(new wm),t]}),this.processConfig(),Q.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),te.create(t,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${Ht}`,handle:".item-move"})}processConfig(){const e=Fe.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))}const Am={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let xm=class extends Xn{constructor(e){super("columns",e),this.config={all:Am}}Component(e){return new Sm(e)}};const rd=new xm,Em=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[tt]});class Mm extends ei{constructor(e){super("row",{...Em(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[tt,"empty"],dataset:{hoverTag:X.get("row"),editingHoverTag:X.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${nt}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:X.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:a}})=>{this.set("config.fieldset",!!a)}},config:{label:X.get("row.settings.fieldsetWrap")}},t={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:X.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:a}})=>this.set("config.inputGroup",a)},config:{label:X.get("row.makeInputGroup"),description:X.get("row.makeInputGroupDesc")}},n={tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}},h={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",n]}},action:{input:({target:{value:a}})=>this.set("config.legend",a)},className:""}},g=V.formGroup([e,h]),m={tag:"label",content:X.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=V.create(this.columnPresetControlConfig);const c={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=V.formGroup([m,c],"row"),r=[t,"hr",g,"hr",f];return V.create({className:`${this.name}-edit group-config`,action:{onRender:a=>{const s=r.map(i=>V.create(i));a.append(...s)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const t=Number.parseFloat((100/e.length).toFixed(1))/1;for(const n of e){n.removeClasses(Es);const d=n.dom,h=Cs(t);n.set("config.width",h),d.style.width=h,d.dataset.colWidth=h;const g=setTimeout(()=>{clearTimeout(g),n.refreshFieldPanels()},bt);document.dispatchEvent(Q.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:t,...n})=>V.create({tag:"option",content:t,attrs:n}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((t,n)=>{t.setWidth(`${e[n]}%`),t.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,n=np.get(e.length-1)||[],d=e.map(h=>{const g=h.get("config.width")||"";return Number(g.replace("%","")).toFixed(1)}).join(",");if(n.length){const h=n.slice();return!h.find(m=>m.value===d)&&h.push({value:d,label:d.replace(/,/g," | "),className:xs}),h.map(m=>{const c={...m};return c.selected=m.value===d,c})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:X.get("defineColumnLayout"),className:uh},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const $m={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let Tm=class extends Xn{constructor(e){super("rows",e),this.config={all:$m}}Component(e){return new Mm(e)}};const ca=new Tm,_m=()=>({conditions:[ea()],children:[]});class Lm extends ei{constructor(e){super("stage",{..._m(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Ln(this.updateEditPanels),X.get("Untitled Form"),X.get("Untitled Form"),X.get("Form Title"),X.get("Form novalidate"),X.get("Tags");const t=this.createChildWrap();this.dom=V.create({attrs:{className:[Pt,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{sn.active=this},onSort:this.onSort.bind(this),draggable:`.${tt}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),Ee.slideUp(this.dom,Qe,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),Ee.slideDown(this.dom,Qe)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const Rm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let km=class extends Xn{constructor(e){super("stages",e),this.config={all:Rm()}}Component(e){return new Lm(e)}};const sn=new km;class Dm{controlCache=new Set;constructor({events:e={},dependencies:t={},controlAction:n,...d}){this.events=e,this.controlData=d,this.controlAction=n,this.dependencies=t,this.id=d.id||We()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:t}=this.controlData,n=this.i18n(t.label)||t.label,d={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:V.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:h})=>{const g=h.closest(`.${ct}`);return g&&Ct.panels.nav.refresh(ut(g))},click:({target:h})=>{const g=h.closest(".field-control")?.id;g&&Ct.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:d,meta:e,action:this.controlAction})}promise(){return qh(this.dependencies)}i18n(e,t){const n=X.locale,h=this.definition?.i18n?.[n]||{};return(h[e]?.()??h[e])||X.get(e,t)}}const Om=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}});let od=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${ct}`);return t&&this.panels.nav.refresh(ut(t))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,t=!1){return await this.applyOptions(e),this.buildDOM(t),this}registerControls(e){return this.controls=[],e.map(t=>{const d=typeof t=="function"?new t:new Dm(t);return this.add(d),this.controls.push(d.dom),d.promise()})}groupLabel=e=>X.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),t=this.controls.slice(),n=[];const d=[];return e=Pn(e,this.groupOrder,"id"),e=e.filter(h=>oc(h.id,this.options.disable.groups)),n=e.map(h=>{const g={tag:"ul",attrs:{className:[ct,ch],id:`${h.id}-${ct}`},config:{label:this.groupLabel(h.label)}};if(this.options.elementOrder[h.id]){const m=this.options.elementOrder[h.id],c=yt(m.concat(h.elementOrder));h.elementOrder=c}return t=Pn(t,h.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:c}=this.get(m.id),f=c.meta.id||"",r=[oc(f,this.options.disable.elements),c.meta.group===h.id,!d.includes(f)];let o=!0;return o=r.every(a=>a===!0),o&&d.push(f),o}),g}),n}add(e=Object.create(null)){const t=Ke(e);return this.data.set(t.id,t),t.controlData.meta.id&&this.data.set(t.controlData.meta.id,t.controlData),t}get(e){return Ke(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...V.btnTemplate({content:[V.icon("bin"),X.get("clear")],title:X.get("clearAll")}),className:["clear-form"],action:{click:d=>{ca.size?(Q.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:X.get("confirmClearAll"),clearAllAction:()=>{sn.clearAll().then(()=>{const h={src:d.target};Q.formeoCleared(h)})},btnCoords:V.coords(d.target)}}),document.dispatchEvent(Q.confirmClearAll)):window.alert(X.get("cannotClearFields"))}}},t={...V.btnTemplate({content:[V.icon("floppy-disk"),X.get("save")],title:X.get("save")}),className:["save-form"],action:{click:async({target:d})=>{const{default:h}=await Tt(async()=>{const{default:c}=await Promise.resolve().then(()=>Bm);return{default:c}},void 0),{formData:g}=h,m={action:()=>{},coords:V.coords(d),message:"",button:d};return xe.click.btn(m),xe.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((d,[h,g])=>(this.options.disable.formActions.includes(h)||d.push(g),d),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:d}=this.options.panels;this.panels=new id({panels:t,type:"controls",displayType:d});const h=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=V.create({className:h,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const c=V.create({className:m,content:[g,n]}),f=c.getElementsByClassName("control-group");this.dom=c,this.groups=f;const[r]=f;this.currentGroup=r,this.actions={filter:o=>{const a=o!=="",s=this.controls;let i=g.querySelector(".filtered-term");if(V.toggleElementsByStr(s,o),a){const u=X.get("controls.filteringTerm",o);c.classList.add("filtered"),i?i.textContent=u:(i=V.create({tag:"h5",className:"filtered-term",content:u}),g.insertBefore(i,g.firstChild))}else i&&(c.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:o=>console.log(o)};for(let o=f.length-1;o>=0;o--){const a=`formeo-controls-${f[o]}`;this.options.sortable||globalThis.localStorage.removeItem(a),te.create(f[o],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:s,item:i})=>{if(s.id=i.id,this.options.ghostPreview){const{controlData:u}=this.get(i.id);Tt(async()=>{const{default:p}=await Promise.resolve().then(()=>Pm);return{default:p}},void 0).then(({default:p})=>{s.innerHTML="",s.appendChild(new p(u).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const s=globalThis.localStorage.getItem(a);return s?s.split("|"):[]},set:s=>{const i=s.toArray();globalThis.localStorage.setItem(a,i.join("|"))}}})}return c}layoutTypes={row:()=>sn.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:t,id:n},...d}=Re(this.get(e),"controlData");return Zn(d,"config.controlId",n),t==="layout"?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(d)};applyOptions=async(e={})=>{const{container:t,elements:n,groupOrder:d,...h}=Ue(Om,e);this.container=t,this.groupOrder=yt(d.concat(["common","html","layout"])),this.options=h;const[g,m,c]=await Promise.all([Tt(()=>import("./index.min.js"),[]),Tt(()=>import("./index.min2.js"),[]),Tt(()=>import("./index.min3.js"),[])]),f=[g.default,m.default,c.default].flat();return Promise.all(this.registerControls([...f,...n]))}};const Ct=new od,Im=Object.freeze(Object.defineProperty({__proto__:null,Controls:od,default:Ct},Symbol.toStringTag,{value:"Module"})),Nm=new Set(["checkbox","radio"]),Fm=new Set(["radio","checkbox","select-one","select-multiple"]);class sd extends ei{constructor(e=Object.create(null)){super("field",e),this.debouncedUpdateEditPanels=Ln(this.updateEditPanels),this.debouncedUpdatePreview=Ln(this.updatePreview),this.label=V.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const t=this.getActionButtons(),n=this.actionButtons.some(h=>h.meta?.id==="edit");this.updateEditPanels();const d=V.create({tag:"li",attrs:{className:Ht},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:X.get("field")}});this.dom=d,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const{label:t,editorLabel:n,disableHtmlLabel:d,helpText:h,tooltip:g}=this.get("config"),{required:m}=this.get("attrs")||{},c=n||t,f={tag:"label",attrs:{}};return d?(f.tag="input",f.attrs.value=c):(f.attrs.contenteditable=!0,f.children=c),{className:"prev-label",children:[{...f,action:{input:({target:{innerHTML:a,value:s}})=>{const i=d?s:a;super.set("config.label",i);const u=this.dom.querySelector(".config-label");u&&(u.value=i)}}},m&&V.requiredMark(),g&&V.tooltip(g),h&&V.helpText(h)]}}setData=(e,t)=>super.set(e,t);set(e,t){return this.setData(e,t)}updateLabel(){const e=V.create(this.labelConfig);(this.label||!e)&&this.label.remove(),e&&(this.data.config?.labelAfter?this.dom.append(e):this.dom.prepend(e)),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:t}=e,{type:n}=t;if(Fm.has(n)){const d=this.preview.querySelectorAll(":checked"),h=this.get("options"),g=h?.[0]?.selected===void 0?"checked":"selected",m=h.reduce((c,f)=>(c[f.value]=f,c[f.value][g]=!1,c),{});for(const c of d)m[c.value][g]=c.value===m[c.value].value;return super.set("options",Object.values(m)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const t=e.parentElement.classList;if(t.contains("f-checkbox")||t.contains("f-radio")){const d=e.parentElement,h=ut(d);return this.setData(`options[${h}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...t}=Ke(this.data);t.id=`prev-${this.id}`,t.action=Object.entries(e).reduce((d,[h,g])=>(d[h]=g.bind(this),d),{}),this.data?.config.editableContent&&(t.attrs={...t.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:V.create(t,!0),action:this.defaultPreviewActions};return V.create(n,!0)}get isCheckable(){return Nm.has(this.get("config.controlId"))}}const Pm=Object.freeze(Object.defineProperty({__proto__:null,default:sd},Symbol.toStringTag,{value:"Module"})),Hm=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Wm=class extends Xn{constructor(e){super("fields",e),this.config={all:Hm()}}Component(e){return new sd(e)}get=e=>{let t=e&&Re(this.data,e);if(!t){const n=Ct.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:d,...h}=n?.getData()||n;if(d?.length){let g=!0;if(d.length===1){const[m]=d;g=!!m.if[0].source}g&&(h.conditions=d)}return e[t]=h,e},{});load=(e=Object.create(null))=>{const t=qn(e);this.empty();for(const[n,d]of Object.entries(t)){const{meta:h,...g}=d;h?.id&&Zn(g,"config.controlId",h?.id),this.add(n,g)}return this.data}};const ad=new Wm,$n=sn,Tn=ca,rn=rd,_n=ad,Wn=Ct,zm=(l,e=!1)=>{if(l!=null){const t=qn(l);if(t&&typeof t=="object"){const n=Ke(t);return{id:n.id||Rt().id,stages:n.stages||Rt().stages,rows:n.rows||{},columns:n.columns||{},fields:n.fields||{}}}console.warn("Formeo: Invalid formData provided, using default")}if(e){const t=Ws.get(Gs);if(t)return t}return Rt()};class ld extends na{constructor(){super("components"),this.disableEvents=!0,this.stages=$n,this.rows=Tn,this.columns=rn,this.fields=_n,this.controls=Wn}load=(e,t)=>{this.empty();const n=zm(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",$n.load(n.stages)),this.add("rows",Tn.load(n.rows)),this.add("columns",rn.load(n.columns)),this.add("fields",_n.load(n.fields));for(const d of Object.values(this.get("stages")))d.loadChildren();return this.data};flatList(){const e={};for(const t of Object.keys(this.data.stages))lh(this.data,t,"stages",e);return e}getChildData=({type:e,id:t})=>{const n=this.get(e,t);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Bs}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:sn.getData(),rows:ca.getData(),columns:rd.getData(),fields:ad.getData()}}set config(e){const{stages:t,rows:n,columns:d,fields:h}=e;$n.config=t,Tn.config=n,rn.config=d,_n.config=h}getIndex(e){return this[e]||this[Gf.get(e)]}setAddress(e,t){if(!He(e))return;const[n,d,...h]=Array.isArray(e)?e:wt(e),m=this.getIndex(n).get(d);return m?.set(h,t),m}getAddress(e){if(!He(e))return;const[t,n,...d]=Array.isArray(e)?e:wt(e),g=this.getIndex(t).get(n);if(!(d.length&&!g))return d.length?g.get(d):g}}const ce=new ld,Bm=Object.freeze(Object.defineProperty({__proto__:null,Columns:rn,Components:ld,Controls:Wn,Dialog:Dt,Fields:_n,Rows:Tn,Stages:$n,default:ce},Symbol.toStringTag,{value:"Module"})),yu="no-transition",jm={debug:!1,bubbles:!0,formeoLoaded:l=>{},onAdd:()=>{},onRemove:()=>{},onChange:l=>Q.opts?.debug&&console.log(l),onUpdate:l=>Q.opts?.debug&&console.log(l),onUpdateStage:l=>Q.opts?.debug&&console.log(l),onUpdateRow:l=>Q.opts?.debug&&console.log(l),onUpdateColumn:l=>Q.opts?.debug&&console.log(l),onUpdateField:l=>Q.opts?.debug&&console.log(l),onAddRow:l=>Q.opts?.debug&&console.log(l),onAddColumn:l=>Q.opts?.debug&&console.log(l),onAddField:l=>Q.opts?.debug&&console.log(l),onRemoveRow:l=>Q.opts?.debug&&console.log(l),onRemoveColumn:l=>Q.opts?.debug&&console.log(l),onRemoveField:l=>Q.opts?.debug&&console.log(l),onRender:l=>Q.opts?.debug&&console.log(l),onSave:l=>{},confirmClearAll:l=>{globalThis.confirm(l.confirmationMessage)&&l.clearAllAction(l)}},je=({src:l,...e},t=on)=>{const n=new globalThis.CustomEvent(t,{detail:e,bubbles:Q.opts?.debug||Q.opts?.bubbles});if(n.data=(l||document).dispatchEvent(n),t===on){const d=new globalThis.CustomEvent(ip,{detail:e,bubbles:Q.opts?.debug||Q.opts?.bubbles});(l||document).dispatchEvent(d)}return n},Q={init:function(l){return this.opts={...jm,...l},this},formeoSaved:l=>je(l,fh),formeoUpdated:(l,e)=>je(l,e||on),formeoCleared:l=>je(l,rp),formeoOnRender:l=>je(l,yh),formeoConditionUpdated:l=>je(l,op),formeoAddedRow:l=>je(l,Ks),formeoAddedColumn:l=>je(l,Ys),formeoAddedField:l=>je(l,Zs),formeoRemovedRow:l=>je(l,Xs),formeoRemovedColumn:l=>je(l,Qs),formeoRemovedField:l=>je(l,Js)},Vm=Ff(()=>{const l={timeStamp:globalThis.performance.now(),type:on,detail:ce.formData};Q.opts.onUpdate(l),Q.opts.onChange!==Q.opts.onUpdate&&Q.opts.onChange(l)},bt);document.addEventListener(on,Vm);document.addEventListener(ph,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onUpdate(d),Q.opts.onUpdateStage(d)});document.addEventListener(gh,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onUpdate(d),Q.opts.onUpdateRow(d)});document.addEventListener(mh,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onUpdate(d),Q.opts.onUpdateColumn(d)});document.addEventListener(vh,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onUpdate(d),Q.opts.onUpdateField(d)});document.addEventListener(Ks,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onAdd(d),Q.opts.onAddRow(d)});document.addEventListener(Ys,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onAdd(d),Q.opts.onAddColumn(d)});document.addEventListener(Zs,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onAdd(d),Q.opts.onAddField(d)});document.addEventListener(Xs,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onRemove(d),Q.opts.onRemoveRow(d)});document.addEventListener(Qs,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onRemove(d),Q.opts.onRemoveColumn(d)});document.addEventListener(Js,l=>{const{timeStamp:e,type:t,detail:n}=l,d={timeStamp:e,type:t,detail:n};Q.opts.onRemove(d),Q.opts.onRemoveField(d)});document.addEventListener(yh,l=>{const{timeStamp:e,type:t,detail:n}=l;Q.opts.onRender({timeStamp:e,type:t,detail:n})});document.addEventListener("confirmClearAll",l=>{l={timeStamp:l.timeStamp,type:l.type,confirmationMessage:l.detail.confirmationMessage,clearAllAction:l.detail.clearAllAction,btnCoords:l.detail.btnCoords},Q.opts.confirmClearAll(l)});document.addEventListener(fh,({timeStamp:l,type:e,detail:{formData:t}})=>{const n={timeStamp:l,type:e,formData:t};Q.opts.onSave(n)});document.addEventListener("formeoLoaded",l=>{Q.opts.formeoLoaded(l.detail.formeo)});let Xo;function Um(){Xo=Xo||window.requestAnimationFrame(()=>{Xo=!1;for(const l of Object.values(rn.data))l.dom.classList.add(yu),Wn.dom.classList.add(yu),Wn.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Um);const bu={add:{attr:l=>{const e=globalThis.prompt(l.message.attr);if(e&&l.isDisabled(e))return globalThis.alert(X.get("attributeNotPermitted",e)),xe.add.attrs(l);let t;e&&(t=String(globalThis.prompt(l.message.value,"")),l.addAction(e,t))},option:l=>{l.addAction()},condition:l=>{l.addAction(l)},config:l=>{l.addAction(l)}},remove:{attrs:l=>{l.removeAction()},options:l=>{l.removeAction()},conditions:l=>{l.removeAction()}},click:{btn:l=>{l.action()}},save:{form:Ss}},xe={init:function(l){const e=Object.keys(bu);return this.opts=e.reduce((t,n)=>(t[n]={...bu[n],...l[n]},t),l),this},add:{attrs:l=>xe.opts.add.attr(l),options:l=>xe.opts.add.option(l),conditions:l=>(l.template=l.template||ea(),xe.opts.add.condition(l)),config:l=>xe.opts.add.config(l)},remove:{attrs:l=>xe.opts.remove.attrs(l),options:l=>xe.opts.remove.options(l),conditions:l=>xe.opts.remove.conditions(l)},click:{btn:l=>xe.opts.click.btn(l)},save:{form:l=>(xe.opts.sessionStorage&&Ws.set(Gs,l),Q.formeoSaved({formData:l}),xe.opts.save.form(l))}},Gm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:Bf,iconFont:null,config:{},events:{},actions:{},controls:{},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}},Oe={CREATED:"created",LOADING_RESOURCES:"loading",INITIALIZING:"initializing",READY:"ready",ERROR:"error"};let cd=class{#e=Oe.CREATED;#n=null;#t=null;#i=!1;constructor({formData:e,...t},n){const d=Ue(Gm.editor,t),{actions:h,events:g,debug:m,config:c,editorContainer:f,...r}=d;f&&(this.editorContainer=typeof f=="string"?document.querySelector(f):f),this.opts=r,V.setOptions=r,ce.config=c;const o=n||e;this.#t=o?vt(o):null,this.userFormData=this.#t,this.Components=ce,this.dom=V,Q.init({debug:m,...g}),xe.init({debug:m,sessionStorage:r.sessionStorage,...h}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){const t=vt(e);this.#t=t,this.userFormData=t,this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){const e=Rt();this.#t=e,this.userFormData=e,this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources),this.#e=Oe.LOADING_RESOURCES;const e=[Pg(this.opts.svgSprite),Wg(this.opts.style),X.init({preloaded:{"en-US":gd},...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(lc)})].filter(Boolean);try{await Promise.all(e),this.opts.allowEdit&&this.init()}catch(t){throw this.#e=Oe.ERROR,console.error("Failed to load resources:",t),t}}init(){return this.#e===Oe.INITIALIZING?this.#n:this.#e===Oe.READY?this.#r():(this.#e=Oe.INITIALIZING,this.#n=Ct.init(this.opts.controls,this.opts.stickyControls).then(e=>(this.controls=e,this.#i||(this.#s(),this.#i=!0),this.formId=ce.get("id"),this.i18n={setLang:this.#o.bind(this)},this.render(),this.#e=Oe.READY,this.opts.onLoad?.(this),this.tooltipInstance=new Uu,this)).catch(e=>{throw this.#e=Oe.ERROR,console.error("Failed to initialize editor:",e),e}),this.#n)}async#o(e){globalThis.sessionStorage?.setItem(lc,e),await X.setCurrent(e),await this.#r()}async#r(){return this.controls=await Ct.init(this.opts.controls,this.opts.stickyControls),this.render(),this}#s(){const e=this.#a();this.Components.load(e,this.opts)}#a(){if(this.#t)return Ke(this.#t);if(this.opts.sessionStorage){const e=Ws.get(Gs);if(e)return e}return Rt()}load(e=this.userFormData,t=this.opts){this.Components.load(e,t),this.render()}get initState(){return this.#e}get isReady(){return this.#e===Oe.READY}async whenReady(){return this.#e===Oe.READY?this:this.#e===Oe.ERROR?Promise.reject(new Error("Editor initialization failed")):this.#n?this.#n:new Promise((e,t)=>{const n=()=>{this.#e===Oe.READY?e(this):this.#e===Oe.ERROR?t(new Error("Editor initialization failed")):globalThis.requestAnimationFrame(n)};n()})}render(){if(!this.controls)return globalThis.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(ce.get("stages")),this.opts.controlOnLeft)for(const n of this.stages)n.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:n})=>n)]};X.current.dir&&(e.attrs.dir=X.current.dir,V.dir=X.current.dir),this.editor=V.create(e),(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(V.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Q.formeoLoaded=new globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Q.formeoLoaded)}};const yn="f-",wu=l=>typeof l=="string"?document.querySelector(l):l,qm=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const d={renderContainer:wu(e),editorContainer:wu(l),formData:vt(t)};return{elements:{},...n,...d}},bn=l=>l.match(up)?.[0]||l,Cu=l=>{if(!l||l.hasAttribute("hidden")||l.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(l);return!(e.display==="none"||e.visibility==="hidden"||e.opacity==="0")},Km={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>Cu(l),isNotVisible:l=>!Cu(l)},Ym=()=>V.btnTemplate({className:"remove-input-group",children:V.icon("remove"),action:{mouseover:({target:l})=>l.parentElement.classList.add("will-remove"),mouseleave:({target:l})=>l.parentElement.classList.remove("will-remove"),click:({target:l})=>l.parentElement.remove()}}),Su={equals:Ms,notEquals:(l,e)=>!Ms(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Zm=Object.entries(bh).reduce((l,[e,t])=>(l[t]=Su[e],l[e]=Su[e],l),{}),Au={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Xm=Object.entries(wh).reduce((l,[e,t])=>(l[t]=Au[e],l[e]=Au[e],l),{}),Qm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Xm[e]?.(l,t),d=new Event("input",{bubbles:!0});return l.dispatchEvent(d),n},isNotVisible:l=>{l?._required===void 0&&(l._required=l.required),l.parentElement.setAttribute("hidden",!0),l.required=!1},isVisible:l=>{l.parentElement.removeAttribute("hidden"),l.required=l._required}};let ud=class{constructor(e,t){const{renderContainer:n,elements:d,formData:h,config:g}=qm(e);this.container=n,this.form=vt(t||h),this.elements=d,this.config=g,this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=vt(e)}get userData(){const e=this.container.querySelector(".formeo-render")||this.renderedForm;if(!e)return{};const t=new FormData(e),n={};for(const[d,h]of t.entries())n[d]?Array.isArray(n[d])?n[d].push(h):n[d]=[n[d],h]:n[d]=h;return n}get userFormData(){const e=[];for(const[t,n]of Object.entries(this.userData)){const d={key:t,value:n,label:this.components[bn(t)]?.config?.label||""};e.push(d)}return e}set userData(e={}){const t=this.container.querySelector("form");for(const n of Object.keys(e)){const d=t.elements[n];if(d.length&&d[0].type==="checkbox"){const h=Array.isArray(e[n])?e[n]:[e[n]];for(const g of d)g.checked=h.includes(g.value)}else if(d.length&&d[0].type==="radio")for(const h of d)h.checked=h.value===e[n];else d.type&&(d.value=e[n])}}render(e=this.form){this.form=vt(e);const t=this.getRenderedForm(e),n=this.container.querySelector(".formeo-render");n?n.replaceWith(t):this.container.appendChild(t)}getRenderedForm(e=this.form){this.form=vt(e);const t=document.getElementsByClassName("formeo-render").length,n={...this.config,tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${t}`,children:this.processedData};return this.renderedForm=V.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,t)=>t.reduce((n,d)=>(n.push(this.form[e][d]),n),[]);prefixId=e=>yn+e;processColumn=({id:e,...t})=>({...t,id:this.prefixId(e),children:this.processFields(t.children),style:`width: ${t.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((t,n)=>(n&&t.push(this.processRow(n)),t),[]);cacheComponent=e=>(this.components[bn(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:d}=e,h=[`formeo-${t}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(d)};this.cacheComponent(g);const c=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>g},{condition:n.inputGroup,result:()=>this.addButton(d)}].reduce((f,{condition:r,result:o})=>(r&&f.push(o()),f),[]);return n.inputGroup&&h.push(`${yn}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:h,children:c}};cloneComponentData=e=>{const{children:t=[],id:n,attrs:d={},...h}=this.components[e],g={...d,"data-clone-of":n};return h.tag==="input"&&(g.name=Kh(this.components[e])),{...h,id:yn+We(n),children:t?.length&&t.map(({id:m})=>this.cloneComponentData(bn(m))),attrs:g}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:t=>{const n=t.target.parentElement,d=V.create(this.cloneComponentData(e));n.insertBefore(d,n.lastChild);const h=V.create(Ym());d.appendChild(h)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(t=>this.cacheComponent(this.processColumn(t)));processFields=e=>this.orderChildren("fields",e).map(({id:t,...n})=>{const d=n.config?.controlId||n.meta?.id,{action:h={},dependencies:g={}}=this.elements[d]||{};g&&qh(g);const m=Ue({action:h},n);return this.cacheComponent({...m,id:this.prefixId(t)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=Pt,this.components[bn(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const d=ev(e);d&&e.addEventListener(d,g=>{if(this.evaluateCondition(t,g))for(const m of n)this.execResult(m,g)},!1);const h={target:e};if(this.evaluateCondition(t,h))for(const g of n)this.execResult(g,h)};applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const t of e){const{if:n,then:d}=t;for(const h of n){const{source:g,target:m}=h;if(He(g)){const{component:c,options:f}=this.getComponent(g),r=f||c;this.handleComponentCondition(r,h,d)}if(He(m)){const{component:c,options:f}=this.getComponent(m),r=f||c;this.handleComponentCondition(r,h,d)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:d,target:h})=>{const g=this.getComponentProperty(e,t);if(typeof g=="boolean")return g;const m=String(He(h)?this.getComponentProperty(h,n):h);return Zm[d]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:d})=>{if(He(e)){const{component:h,option:g}=this.getComponent(e),m=g||h;Qm[t]?.(m,{targetProperty:t,assignment:n,value:d})}};getComponentProperty=(e,t)=>{const{component:n,option:d}=this.getComponent(e),h=d||n;return Km[t]?.(h)||h[t]};getComponent=e=>{const t={component:null};if(!He(e))return null;const[,n,d,h]=wt(e),g=this.renderedForm.querySelector(`#${yn}${n}`);if(!g)return t;if(t.component=g,d){const m=g.querySelectorAll("input"),c=m[h];return t.options=m,t.option=c,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const Jm=[["input",l=>["textarea","text"].includes(l.type)],["change",l=>["select"].includes(l.tagName.toLowerCase())||["checkbox","radio"].includes(l.type)]],ev=l=>{const[e]=Jm.find(t=>t[1](l))||[!1];return e};window!==void 0&&(window.FormeoEditor=cd,window.FormeoRenderer=ud);const ua=cd,ha=ud,tv={rows:{all:{events:{onAdd:l=>{if(console.log(`You just added a new row with the id "${l.target.id}"`,l.index),l.index===2){const e=l.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{l.target.addChild()}),e.appendChild(t)}}}}},fields:{all:{panels:{attrs:{}},events:{onRemove:l=>{console.log(`You just removed the field with the id "${l.target.id}"`,l)}}},"text-input":{attrs:{type:[{label:"text",value:"text"},{label:"phone",value:"phone"},{label:"email",value:"email"}]},config:{helpText:"This is a custom help text for text input fields.",hideLabel:!1}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},nv={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},iv=".build-form",rv=".render-form",an={editorContainer:iv,actions:{},controls:nv,config:tv,events:{onSave:console.log,onChange:console.log},style:null,sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},da={renderContainer:rv,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;globalThis.tinymce.remove(e),globalThis.tinymce.init({selector:e})}}}}}};async function ov(l){l.innerHTML=`
11
11
  <div class="angular-demo">
12
12
  <h3>Angular Integration Demo</h3>
13
13
  <p>Demonstrating Formeo integration patterns for Angular applications</p>
@@ -15,7 +15,7 @@ Author: Draggable https://draggable.io
15
15
  <p>Initializing Angular-style Formeo integration demo...</p>
16
16
  </div>
17
17
  </div>
18
- `;try{await ov(),await sv()&&console.log("Highlight.js loaded successfully"),l.innerHTML=`
18
+ `;try{await sv(),await av()&&console.log("Highlight.js loaded successfully"),l.innerHTML=`
19
19
  <div class="angular-demo">
20
20
  <h3>Angular Integration Demo</h3>
21
21
  <div class="demo-description">
@@ -51,17 +51,17 @@ npm install formeo</code></pre>
51
51
 
52
52
  <div class="guide-section">
53
53
  <h4>2. Angular Component Implementation</h4>
54
- <pre><code class="language-typescript">${Qo(cv)}</code></pre>
54
+ <pre><code class="language-typescript">${Jo(uv)}</code></pre>
55
55
  </div>
56
56
 
57
57
  <div class="guide-section">
58
58
  <h4>3. Service for Formeo Management (Optional)</h4>
59
- <pre><code class="language-typescript">${Qo(uv)}</code></pre>
59
+ <pre><code class="language-typescript">${Jo(hv)}</code></pre>
60
60
  </div>
61
61
 
62
62
  <div class="guide-section">
63
63
  <h4>4. Module Configuration</h4>
64
- <pre><code class="language-typescript">${Qo(hv)}</code></pre>
64
+ <pre><code class="language-typescript">${Jo(dv)}</code></pre>
65
65
  </div>
66
66
  </div>
67
67
 
@@ -70,7 +70,7 @@ npm install formeo</code></pre>
70
70
  <div id="angular-app-root"></div>
71
71
  </div>
72
72
  </div>
73
- `;const t=await lv();Cu();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>Cu(),50)}),{angularApp:t,cleanup:()=>{t?.destroy&&t.destroy();const m=document.getElementById("angular-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load Angular demo:",e),l.innerHTML=`
73
+ `;const t=await cv();xu();const n=l.querySelector("#toggle-instructions"),d=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&d&&n.addEventListener("click",()=>{const m=d.style.display==="block";d.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>xu(),50)}),{angularApp:t,cleanup:()=>{t?.destroy&&t.destroy();const m=document.getElementById("angular-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load Angular demo:",e),l.innerHTML=`
74
74
  <div class="angular-demo">
75
75
  <h3>Angular Integration Demo</h3>
76
76
  <div class="error-message">
@@ -80,7 +80,7 @@ npm install formeo</code></pre>
80
80
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('angular')">Retry</button>
81
81
  </div>
82
82
  </div>
83
- `,{cleanup:()=>{}}}}async function ov(){await new Promise(l=>setTimeout(l,500)),console.log("Angular-style demo environment ready")}async function sv(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),av(),await Xo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Xo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Xo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function av(){const l=document.createElement("style");l.textContent=`
83
+ `,{cleanup:()=>{}}}}async function sv(){await new Promise(l=>setTimeout(l,500)),console.log("Angular-style demo environment ready")}async function av(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),lv(),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function lv(){const l=document.createElement("style");l.textContent=`
84
84
  .angular-demo .guide-section {
85
85
  margin-bottom: 24px;
86
86
  }
@@ -146,7 +146,7 @@ npm install formeo</code></pre>
146
146
  padding: 20px;
147
147
  margin-top: 16px;
148
148
  }
149
- `,document.head.appendChild(l)}function Xo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function Cu(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function lv(){const l=document.getElementById("angular-app-root");if(!l)return null;l.innerHTML=`
149
+ `,document.head.appendChild(l)}function Qo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function xu(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function cv(){const l=document.getElementById("angular-app-root");if(!l)return null;l.innerHTML=`
150
150
  <div class="angular-component">
151
151
  <div class="form-builder-container">
152
152
  <div class="editor-section">
@@ -164,7 +164,7 @@ npm install formeo</code></pre>
164
164
  </div>
165
165
  </div>
166
166
  </div>
167
- `;const e=l.querySelector(".angular-form-editor"),t=l.querySelector(".angular-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-angular-real";const p=document.createElement("div");p.className="render-form-angular-real",e.appendChild(n),t.appendChild(p);const h={...on,editorContainer:".build-form-angular-real",events:{...on.events,onSave:a=>{console.log("Angular Component - Form saved:",a)},onChange:a=>{console.log("Angular Component - Form changed:",a)}}},g={...ca,renderContainer:".render-form-angular-real"},m=new aa(h),c=new la(g),d=l.querySelector("#angular-save-btn"),r=l.querySelector("#angular-render-btn"),o=l.querySelector("#angular-clear-btn");return d&&d.addEventListener("click",()=>{const a=m.formData;console.log("Angular Component - Save clicked:",a),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const a=m.formData;a&&Object.keys(a).length>0?(p.style.display="block",c.render(a),console.log("Angular Component - Render clicked:",a)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m&&m.clear(),c&&p&&(p.innerHTML="",p.style.display="none"),console.log("Angular Component - Clear clicked")}),{editor:m,renderer:c,destroy:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function Qo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const cv=`import { Component, OnInit, OnDestroy, ElementRef, ViewChild, inject } from '@angular/core';
167
+ `;const e=l.querySelector(".angular-form-editor"),t=l.querySelector(".angular-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-angular-real";const d=document.createElement("div");d.className="render-form-angular-real",e.appendChild(n),t.appendChild(d);const h={...an,editorContainer:".build-form-angular-real",events:{...an.events,onSave:a=>{console.log("Angular Component - Form saved:",a)},onChange:a=>{console.log("Angular Component - Form changed:",a)}}},g={...da,renderContainer:".render-form-angular-real"},m=new ua(h),c=new ha(g),f=l.querySelector("#angular-save-btn"),r=l.querySelector("#angular-render-btn"),o=l.querySelector("#angular-clear-btn");return f&&f.addEventListener("click",()=>{const a=m.formData;console.log("Angular Component - Save clicked:",a),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const a=m.formData;a&&Object.keys(a).length>0?(d.style.display="block",c.render(a),console.log("Angular Component - Render clicked:",a)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m&&m.clear(),c&&d&&(d.innerHTML="",d.style.display="none"),console.log("Angular Component - Clear clicked")}),{editor:m,renderer:c,destroy:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function Jo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const uv=`import { Component, OnInit, OnDestroy, ElementRef, ViewChild, inject } from '@angular/core';
168
168
  import { FormeoEditor, FormeoRenderer } from 'formeo';
169
169
 
170
170
  @Component({
@@ -353,7 +353,7 @@ export class FormBuilderComponent implements OnInit, OnDestroy {
353
353
  this.renderer.destroy();
354
354
  }
355
355
  }
356
- }`,uv=`import { Injectable, signal } from '@angular/core';
356
+ }`,hv=`import { Injectable, signal } from '@angular/core';
357
357
  import { FormeoEditor, FormeoRenderer } from 'formeo';
358
358
 
359
359
  export interface FormeoConfig {
@@ -473,7 +473,7 @@ export class FormeoService {
473
473
  console.log('Form submitted via service:', formData);
474
474
  // Handle form submission logic here
475
475
  }
476
- }`,hv=`// app.config.ts (for standalone applications)
476
+ }`,dv=`// app.config.ts (for standalone applications)
477
477
  import { ApplicationConfig } from '@angular/core';
478
478
  import { provideRouter } from '@angular/router';
479
479
  import { routes } from './app.routes';
@@ -511,7 +511,7 @@ import { AppComponent } from './app/app.component';
511
511
  import { appConfig } from './app/app.config';
512
512
 
513
513
  bootstrapApplication(AppComponent, appConfig)
514
- .catch(err => console.error(err));`;async function dv(l){l.innerHTML=`
514
+ .catch(err => console.error(err));`;async function fv(l){l.innerHTML=`
515
515
  <div class="react-demo">
516
516
  <h3>React Integration Demo</h3>
517
517
  <p>Demonstrating Formeo integration patterns for React applications</p>
@@ -519,7 +519,7 @@ bootstrapApplication(AppComponent, appConfig)
519
519
  <p>Initializing React-style Formeo integration demo...</p>
520
520
  </div>
521
521
  </div>
522
- `;try{await fv(),await pv()&&console.log("Highlight.js loaded successfully for React demo"),l.innerHTML=`
522
+ `;try{await pv(),await gv()&&console.log("Highlight.js loaded successfully for React demo"),l.innerHTML=`
523
523
  <div class="react-demo">
524
524
  <h3>React Integration Demo</h3>
525
525
  <div class="demo-description">
@@ -553,17 +553,17 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
553
553
 
554
554
  <div class="guide-section">
555
555
  <h4>2. React Hook for Formeo</h4>
556
- <pre><code class="language-typescript">${es(vv)}</code></pre>
556
+ <pre><code class="language-typescript">${ts(yv)}</code></pre>
557
557
  </div>
558
558
 
559
559
  <div class="guide-section">
560
560
  <h4>3. React Component Implementation</h4>
561
- <pre><code class="language-typescript">${es(yv)}</code></pre>
561
+ <pre><code class="language-typescript">${ts(bv)}</code></pre>
562
562
  </div>
563
563
 
564
564
  <div class="guide-section">
565
565
  <h4>4. Context Provider (Advanced)</h4>
566
- <pre><code class="language-typescript">${es(bv)}</code></pre>
566
+ <pre><code class="language-typescript">${ts(wv)}</code></pre>
567
567
  </div>
568
568
  </div>
569
569
 
@@ -572,7 +572,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
572
572
  <div id="react-app-root"></div>
573
573
  </div>
574
574
  </div>
575
- `;const t=await mv();Su();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>Su(),50)}),{reactApp:t,cleanup:()=>{t?.cleanup&&t.cleanup();const m=document.getElementById("react-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load React demo:",e),l.innerHTML=`
575
+ `;const t=await vv();Eu();const n=l.querySelector("#toggle-instructions"),d=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&d&&n.addEventListener("click",()=>{const m=d.style.display==="block";d.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>Eu(),50)}),{reactApp:t,cleanup:()=>{t?.cleanup&&t.cleanup();const m=document.getElementById("react-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load React demo:",e),l.innerHTML=`
576
576
  <div class="react-demo">
577
577
  <h3>React Integration Demo</h3>
578
578
  <div class="error-message">
@@ -582,7 +582,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
582
582
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('react')">Retry</button>
583
583
  </div>
584
584
  </div>
585
- `,{cleanup:()=>{}}}}async function fv(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function pv(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),gv(),await Jo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Jo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Jo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function gv(){const l=document.createElement("style");l.textContent=`
585
+ `,{cleanup:()=>{}}}}async function pv(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function gv(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),mv(),await es("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await es("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await es("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function mv(){const l=document.createElement("style");l.textContent=`
586
586
  .react-demo .guide-section {
587
587
  margin-bottom: 24px;
588
588
  }
@@ -656,7 +656,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
656
656
  padding: 12px;
657
657
  margin: 12px 0;
658
658
  }
659
- `,document.head.appendChild(l)}function Jo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function Su(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function mv(){const l=document.getElementById("react-app-root");if(!l)return null;l.innerHTML=`
659
+ `,document.head.appendChild(l)}function es(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function Eu(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function vv(){const l=document.getElementById("react-app-root");if(!l)return null;l.innerHTML=`
660
660
  <div class="react-component">
661
661
  <div class="form-builder-container">
662
662
  <div class="editor-section">
@@ -675,7 +675,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
675
675
  </div>
676
676
  </div>
677
677
  </div>
678
- `;const e=l.querySelector(".react-form-editor"),t=l.querySelector(".react-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-react-real";const p=document.createElement("div");p.className="render-form-react-real",e.appendChild(n),t.appendChild(p);const h={...on,editorContainer:".build-form-react-real",events:{...on.events,onSave:s=>{console.log("React Component - Form saved:",s)},onChange:s=>{console.log("React Component - Form changed:",s)}}},g={...ca,renderContainer:".render-form-react-real"},m=new aa(h),c=new la(g),d=l.querySelector("#react-save-btn"),r=l.querySelector("#react-render-btn"),o=l.querySelector("#react-clear-btn"),a=l.querySelector("#react-export-btn");return d&&d.addEventListener("click",()=>{const s=m.formData;console.log("React Component - Save clicked:",s),localStorage.setItem("formeo-react-form",JSON.stringify(s)),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const s=m.formData;s&&Object.keys(s).length>0?(p.style.display="block",c.render(s),console.log("React Component - Render clicked:",s)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m?.clear(),p.style.display="none",localStorage.removeItem("formeo-react-form"),console.log("React Component - Clear clicked")}),a&&a.addEventListener("click",()=>{const s=m.formData;if(s&&Object.keys(s).length>0){const i=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),u=URL.createObjectURL(i),f=document.createElement("a");f.href=u,f.download="formeo-react-form.json",f.click(),URL.revokeObjectURL(u),console.log("React Component - Export clicked")}else alert("Please create a form first before exporting")}),{editor:m,renderer:c,cleanup:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function es(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const vv=`import { useEffect, useRef, useCallback } from 'react';
678
+ `;const e=l.querySelector(".react-form-editor"),t=l.querySelector(".react-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-react-real";const d=document.createElement("div");d.className="render-form-react-real",e.appendChild(n),t.appendChild(d);const h={...an,editorContainer:".build-form-react-real",events:{...an.events,onSave:s=>{console.log("React Component - Form saved:",s)},onChange:s=>{console.log("React Component - Form changed:",s)}}},g={...da,renderContainer:".render-form-react-real"},m=new ua(h),c=new ha(g),f=l.querySelector("#react-save-btn"),r=l.querySelector("#react-render-btn"),o=l.querySelector("#react-clear-btn"),a=l.querySelector("#react-export-btn");return f&&f.addEventListener("click",()=>{const s=m.formData;console.log("React Component - Save clicked:",s),localStorage.setItem("formeo-react-form",JSON.stringify(s)),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const s=m.formData;s&&Object.keys(s).length>0?(d.style.display="block",c.render(s),console.log("React Component - Render clicked:",s)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m?.clear(),d.style.display="none",localStorage.removeItem("formeo-react-form"),console.log("React Component - Clear clicked")}),a&&a.addEventListener("click",()=>{const s=m.formData;if(s&&Object.keys(s).length>0){const i=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),u=URL.createObjectURL(i),p=document.createElement("a");p.href=u,p.download="formeo-react-form.json",p.click(),URL.revokeObjectURL(u),console.log("React Component - Export clicked")}else alert("Please create a form first before exporting")}),{editor:m,renderer:c,cleanup:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function ts(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const yv=`import { useEffect, useRef, useCallback } from 'react';
679
679
  import { FormeoEditor, FormeoRenderer } from 'formeo';
680
680
 
681
681
  // Custom hook for Formeo Editor
@@ -808,7 +808,7 @@ export function useFormeoRenderer(options = {}) {
808
808
  clearRenderer,
809
809
  renderer: rendererRef.current
810
810
  };
811
- }`,yv=`import React, { useState } from 'react';
811
+ }`,bv=`import React, { useState } from 'react';
812
812
  import { useFormeoEditor, useFormeoRenderer } from './hooks/useFormeo';
813
813
 
814
814
  interface FormBuilderProps {
@@ -980,7 +980,7 @@ export default function App() {
980
980
  )}
981
981
  </div>
982
982
  );
983
- }`,bv=`import React, { createContext, useContext, useReducer, useCallback } from 'react';
983
+ }`,wv=`import React, { createContext, useContext, useReducer, useCallback } from 'react';
984
984
  import { FormeoEditor, FormeoRenderer } from 'formeo';
985
985
 
986
986
  // Types
@@ -1167,8 +1167,8 @@ export const FormManager: React.FC = () => {
1167
1167
  <p>Active Renderers: {Object.keys(state.renderers).length}</p>
1168
1168
  </div>
1169
1169
  );
1170
- };`;var ts={exports:{}},Au;function wv(){return Au||(Au=1,(function(l,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var p=function(r,o,a){if(typeof r!="string"){p.original?p.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(a=o),p.modules[r]||(p.payloads[r]=a,p.modules[r]=null)};p.modules={},p.payloads={};var h=function(r,o,a){if(typeof o=="string"){var s=c(r,o);if(s!=null)return a&&a(),s}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var i=[],u=0,f=o.length;u<f;++u){var y=c(r,o[u]);if(y==null&&g.original)return;i.push(y)}return a&&a.apply(null,i)||!0}},g=function(r,o){var a=h("",r,o);return a==null&&g.original?g.original.apply(this,arguments):a},m=function(r,o){if(o.indexOf("!")!==-1){var a=o.split("!");return m(r,a[0])+"!"+m(r,a[1])}if(o.charAt(0)=="."){var s=r.split("/").slice(0,-1).join("/");for(o=s+"/"+o;o.indexOf(".")!==-1&&i!=o;){var i=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},c=function(r,o){o=m(r,o);var a=p.modules[o];if(!a){if(a=p.payloads[o],typeof a=="function"){var s={},i={id:o,uri:"",exports:s,packaged:!0},u=function(y,b){return h(o,y,b)},f=a(u,s,i);s=f||i.exports,p.modules[o]=s,delete p.payloads[o]}a=p.modules[o]=s||a}return a};function d(r){var o=n;n[r]||(n[r]={}),o=n[r],(!o.define||!o.define.packaged)&&(p.original=o.define,o.define=p,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(g.original=o.require,o.require=g,o.require.packaged=!0)}d(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,p){function h(g,m,c){Object.defineProperty(g,m,{value:c,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||h(String.prototype,"startsWith",function(g,m){return m=m||0,this.lastIndexOf(g,m)===m}),String.prototype.endsWith||h(String.prototype,"endsWith",function(g,m){var c=this;(m===void 0||m>c.length)&&(m=c.length),m-=g.length;var d=c.indexOf(g,m);return d!==-1&&d===m}),String.prototype.repeat||h(String.prototype,"repeat",function(g){for(var m="",c=this;g>0;)g&1&&(m+=c),(g>>=1)&&(c+=c);return m}),String.prototype.includes||h(String.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Object.assign||(Object.assign=function(g){if(g==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(g),c=1;c<arguments.length;c++){var d=arguments[c];d!=null&&Object.keys(d).forEach(function(r){m[r]=d[r]})}return m}),Object.values||(Object.values=function(g){return Object.keys(g).map(function(m){return g[m]})}),Array.prototype.find||h(Array.prototype,"find",function(g){for(var m=this.length,c=arguments[1],d=0;d<m;d++){var r=this[d];if(g.call(c,r,d,this))return r}}),Array.prototype.findIndex||h(Array.prototype,"findIndex",function(g){for(var m=this.length,c=arguments[1],d=0;d<m;d++){var r=this[d];if(g.call(c,r,d,this))return d}}),Array.prototype.includes||h(Array.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Array.prototype.fill||h(Array.prototype,"fill",function(g){for(var m=this,c=m.length>>>0,d=arguments[1],r=d>>0,o=r<0?Math.max(c+r,0):Math.min(r,c),a=arguments[2],s=a===void 0?c:a>>0,i=s<0?Math.max(c+s,0):Math.min(s,c);o<i;)m[o]=g,o++;return m}),Array.of||h(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,p){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,p){n.deepCopy=function h(g){if(typeof g!="object"||!g)return g;var m;if(Array.isArray(g)){m=[];for(var c=0;c<g.length;c++)m[c]=h(g[c]);return m}if(Object.prototype.toString.call(g)!=="[object Object]")return g;m={};for(var c in g)m[c]=h(g[c]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){n.last=function(m){return m[m.length-1]},n.stringReverse=function(m){return m.split("").reverse().join("")},n.stringRepeat=function(m,c){for(var d="";c>0;)c&1&&(d+=m),(c>>=1)&&(m+=m);return d};var h=/^\s\s*/,g=/\s\s*$/;n.stringTrimLeft=function(m){return m.replace(h,"")},n.stringTrimRight=function(m){return m.replace(g,"")},n.copyObject=function(m){var c={};for(var d in m)c[d]=m[d];return c},n.copyArray=function(m){for(var c=[],d=0,r=m.length;d<r;d++)m[d]&&typeof m[d]=="object"?c[d]=this.copyObject(m[d]):c[d]=m[d];return c},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(m){for(var c={},d=0;d<m.length;d++)c[m[d]]=1;return c},n.createMap=function(m){var c=Object.create(null);for(var d in m)c[d]=m[d];return c},n.arrayRemove=function(m,c){for(var d=0;d<=m.length;d++)c===m[d]&&m.splice(d,1)},n.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(m,c){var d=[];return m.replace(c,function(r){d.push({offset:arguments[arguments.length-2],length:r.length})}),d},n.deferredCall=function(m){var c=null,d=function(){c=null,m()},r=function(o){return r.cancel(),c=setTimeout(d,o||0),r};return r.schedule=r,r.call=function(){return this.cancel(),m(),r},r.cancel=function(){return clearTimeout(c),c=null,r},r.isPending=function(){return c},r},n.delayedCall=function(m,c){var d=null,r=function(){d=null,m()},o=function(a){d==null&&(d=setTimeout(r,a||c))};return o.delay=function(a){d&&clearTimeout(d),d=setTimeout(r,a||c)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){d&&clearTimeout(d),d=null},o.isPending=function(){return d},o},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(m,c,d){return d&&m.codePointAt(c)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,p){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var h=typeof navigator=="object"?navigator:{},g=(/mac|win|linux/i.exec(h.platform)||["other"])[0].toLowerCase(),m=h.userAgent||"",c=h.appName||"";n.isWin=g=="win",n.isMac=g=="mac",n.isLinux=g=="linux",n.isIE=c=="Microsoft Internet Explorer"||c.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=m.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(m.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,n.isAIR=m.indexOf("AdobeAIR")>=0,n.isAndroid=m.indexOf("Android")>=0,n.isChromeOS=m.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,p){var h=t("./useragent"),g="http://www.w3.org/1999/xhtml";n.buildDom=function a(s,i,u){if(typeof s=="string"&&s){var f=document.createTextNode(s);return i&&i.appendChild(f),f}if(!Array.isArray(s))return s&&s.appendChild&&i&&i.appendChild(s),s;if(typeof s[0]!="string"||!s[0]){for(var y=[],b=0;b<s.length;b++){var M=a(s[b],i,u);M&&y.push(M)}return y}var $=document.createElement(s[0]),A=s[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var b=S;b<s.length;b++)a(s[b],$,u);return S==2&&Object.keys(A).forEach(function(E){var R=A[E];E==="class"?$.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||E=="value"||E[0]=="$"?$[E]=R:E==="ref"?u&&(u[R]=$):E==="style"?typeof R=="string"&&($.style.cssText=R):R!=null&&$.setAttribute(E,R)}),i&&i.appendChild($),$},n.getDocumentHead=function(a){return a||(a=document),a.head||a.getElementsByTagName("head")[0]||a.documentElement},n.createElement=function(a,s){return document.createElementNS?document.createElementNS(s||g,a):document.createElement(a)},n.removeChildren=function(a){a.innerHTML=""},n.createTextNode=function(a,s){var i=s?s.ownerDocument:document;return i.createTextNode(a)},n.createFragment=function(a){var s=a?a.ownerDocument:document;return s.createDocumentFragment()},n.hasCssClass=function(a,s){var i=(a.className+"").split(/\s+/g);return i.indexOf(s)!==-1},n.addCssClass=function(a,s){n.hasCssClass(a,s)||(a.className+=" "+s)},n.removeCssClass=function(a,s){for(var i=a.className.split(/\s+/g);;){var u=i.indexOf(s);if(u==-1)break;i.splice(u,1)}a.className=i.join(" ")},n.toggleCssClass=function(a,s){for(var i=a.className.split(/\s+/g),u=!0;;){var f=i.indexOf(s);if(f==-1)break;u=!1,i.splice(f,1)}return u&&i.push(s),a.className=i.join(" "),u},n.setCssClass=function(a,s,i){i?n.addCssClass(a,s):n.removeCssClass(a,s)},n.hasCssString=function(a,s){var i=0,u;if(s=s||document,u=s.querySelectorAll("style")){for(;i<u.length;)if(u[i++].id===a)return!0}},n.removeElementById=function(a,s){s=s||document,s.getElementById(a)&&s.getElementById(a).remove()};var m,c=[];n.useStrictCSP=function(a){m=a,a==!1?d():c||(c=[])};function d(){var a=c;c=null,a&&a.forEach(function(s){r(s[0],s[1])})}function r(a,s,i){if(!(typeof document>"u")){if(c){if(i)d();else if(i===!1)return c.push([a,s])}if(!m){var u=i;!i||!i.getRootNode?u=document:(u=i.getRootNode(),(!u||u==i)&&(u=document));var f=u.ownerDocument||u;if(s&&n.hasCssString(s,u))return null;s&&(a+=`
1171
- /*# sourceURL=ace/css/`+s+" */");var y=n.createElement("style");y.appendChild(f.createTextNode(a)),s&&(y.id=s),u==f&&(u=n.getDocumentHead(f)),u.insertBefore(y,u.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(a,s){n.buildDom(["link",{rel:"stylesheet",href:a}],n.getDocumentHead(s))},n.scrollbarWidth=function(a){var s=n.createElement("ace_inner");s.style.width="100%",s.style.minWidth="0px",s.style.height="200px",s.style.display="block";var i=n.createElement("ace_outer"),u=i.style;u.position="absolute",u.left="-10000px",u.overflow="hidden",u.width="200px",u.minWidth="0px",u.height="150px",u.display="block",i.appendChild(s);var f=a&&a.documentElement||document&&document.documentElement;if(!f)return 0;f.appendChild(i);var y=s.offsetWidth;u.overflow="scroll";var b=s.offsetWidth;return y===b&&(b=i.clientWidth),f.removeChild(i),y-b},n.computedStyle=function(a,s){return window.getComputedStyle(a,"")||{}},n.setStyle=function(a,s,i){a[s]!==i&&(a[s]=i)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=h.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,h.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");n.HI_DPI&&o.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!h.isEdge&&typeof o.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),o=null}n.HAS_CSS_TRANSFORMS?n.translate=function(a,s,i){a.style.transform="translate("+Math.round(s)+"px, "+Math.round(i)+"px)"}:n.translate=function(a,s,i){a.style.top=Math.round(i)+"px",a.style.left=Math.round(s)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("./dom");n.get=function(g,m){var c=new XMLHttpRequest;c.open("GET",g,!0),c.onreadystatechange=function(){c.readyState===4&&m(c.responseText)},c.send(null)},n.loadScript=function(g,m){var c=h.getDocumentHead(),d=document.createElement("script");d.src=g,c.appendChild(d),d.onload=d.onreadystatechange=function(r,o){(o||!d.readyState||d.readyState=="loaded"||d.readyState=="complete")&&(d=d.onload=d.onreadystatechange=null,o||m())}},n.qualifyURL=function(g){var m=document.createElement("a");return m.href=g,m.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,p){n.inherits=function(h,g){h.super_=g,h.prototype=Object.create(g.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(h,g){for(var m in g)h[m]=g[m];return h},n.implement=function(h,g){n.mixin(h,g)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,p){var h={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};h._emit=h._dispatchEvent=function(c,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[c]||[],o=this._defaultHandlers[c];if(!(!r.length&&!o)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=c),d.stopPropagation||(d.stopPropagation=g),d.preventDefault||(d.preventDefault=m),r=r.slice();for(var a=0;a<r.length&&(r[a](d,this),!d.propagationStopped);a++);if(o&&!d.defaultPrevented)return o(d,this)}},h._signal=function(c,d){var r=(this._eventRegistry||{})[c];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](d,this)}},h.once=function(c,d){var r=this;if(this.on(c,function o(){r.off(c,o),d.apply(null,arguments)}),!d)return new Promise(function(o){d=o})},h.setDefaultHandler=function(c,d){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[c]){var o=r[c],a=r._disabled_[c];a||(r._disabled_[c]=a=[]),a.push(o);var s=a.indexOf(d);s!=-1&&a.splice(s,1)}r[c]=d},h.removeDefaultHandler=function(c,d){var r=this._defaultHandlers;if(r){var o=r._disabled_[c];if(r[c]==d)o&&this.setDefaultHandler(c,o.pop());else if(o){var a=o.indexOf(d);a!=-1&&o.splice(a,1)}}},h.on=h.addEventListener=function(c,d,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[c];return o||(o=this._eventRegistry[c]=[]),o.indexOf(d)==-1&&o[r?"unshift":"push"](d),d},h.off=h.removeListener=h.removeEventListener=function(c,d){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[c];if(r){var o=r.indexOf(d);o!==-1&&r.splice(o,1)}},h.removeAllListeners=function(c){c||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[c]=void 0),this._defaultHandlers&&(this._defaultHandlers[c]=void 0)},n.EventEmitter=h}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,p){n.reportError=function(g,m){var c=new Error(g);c.data=m,typeof console=="object"&&console.error&&console.error(c),setTimeout(function(){throw c})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,p){var h={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};n.defaultEnglishMessages=h}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,p){"no use strict";var h=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,c=t("./default_english_messages").defaultEnglishMessages,d={setOptions:function(i){Object.keys(i).forEach(function(u){this.setOption(u,i[u])},this)},getOptions:function(i){var u={};if(i)Array.isArray(i)||(u=i,i=Object.keys(u));else{var f=this.$options;i=Object.keys(f).filter(function(y){return!f[y].hidden})}return i.forEach(function(y){u[y]=this.getOption(y)},this),u},setOption:function(i,u){if(this["$"+i]!==u){var f=this.$options[i];if(!f)return r('misspelled option "'+i+'"');if(f.forwardTo)return this[f.forwardTo]&&this[f.forwardTo].setOption(i,u);f.handlesSet||(this["$"+i]=u),f&&f.set&&f.set.call(this,u)}},getOption:function(i){var u=this.$options[i];return u?u.forwardTo?this[u.forwardTo]&&this[u.forwardTo].getOption(i):u&&u.get?u.get.call(this):this["$"+i]:r('misspelled option "'+i+'"')}};function r(i){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,a,s=(function(){function i(){this.$defaultOptions={},o=c,a="dollarSigns"}return i.prototype.defineOptions=function(u,f,y){return u.$options||(this.$defaultOptions[f]=u.$options={}),Object.keys(y).forEach(function(b){var M=y[b];typeof M=="string"&&(M={forwardTo:M}),M.name||(M.name=b),u.$options[M.name]=M,"initialValue"in M&&(u["$"+M.name]=M.initialValue)}),h.implement(u,d),this},i.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(f){var y=u.$options[f];"value"in y&&u.setOption(f,y.value)})},i.prototype.setDefaultValue=function(u,f,y){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][f])break;if(!this.$defaultOptions[u][f])return!1}var b=this.$defaultOptions[u]||(this.$defaultOptions[u]={});b[f]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,f,y):b[f].value=y)},i.prototype.setDefaultValues=function(u,f){Object.keys(f).forEach(function(y){this.setDefaultValue(u,y,f[y])},this)},i.prototype.setMessages=function(u,f){o=u,f&&f.placeholders&&(a=f.placeholders)},i.prototype.nls=function(u,f,y){o[u]||(r("No message found for the key '"+u+"' in the provided messages, trying to find a translation for the default string '"+f+"'."),o[f]||r("No message found for the default string '"+f+"' in the provided messages. Falling back to the default English message."));var b=o[u]||o[f]||f;return y&&(a==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(M,$){return $=="$"?"$":y[$]})),a==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(M,$){return y[$]}))),b},i})();s.prototype.warn=r,s.prototype.reportError=m,h.implement(s.prototype,g),n.AppConfig=s}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,p){p.exports=`.ace-tm .ace_gutter {
1170
+ };`;var ns={exports:{}},Mu;function Cv(){return Mu||(Mu=1,(function(l,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var d=function(r,o,a){if(typeof r!="string"){d.original?d.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(a=o),d.modules[r]||(d.payloads[r]=a,d.modules[r]=null)};d.modules={},d.payloads={};var h=function(r,o,a){if(typeof o=="string"){var s=c(r,o);if(s!=null)return a&&a(),s}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var i=[],u=0,p=o.length;u<p;++u){var y=c(r,o[u]);if(y==null&&g.original)return;i.push(y)}return a&&a.apply(null,i)||!0}},g=function(r,o){var a=h("",r,o);return a==null&&g.original?g.original.apply(this,arguments):a},m=function(r,o){if(o.indexOf("!")!==-1){var a=o.split("!");return m(r,a[0])+"!"+m(r,a[1])}if(o.charAt(0)=="."){var s=r.split("/").slice(0,-1).join("/");for(o=s+"/"+o;o.indexOf(".")!==-1&&i!=o;){var i=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},c=function(r,o){o=m(r,o);var a=d.modules[o];if(!a){if(a=d.payloads[o],typeof a=="function"){var s={},i={id:o,uri:"",exports:s,packaged:!0},u=function(y,b){return h(o,y,b)},p=a(u,s,i);s=p||i.exports,d.modules[o]=s,delete d.payloads[o]}a=d.modules[o]=s||a}return a};function f(r){var o=n;n[r]||(n[r]={}),o=n[r],(!o.define||!o.define.packaged)&&(d.original=o.define,o.define=d,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(g.original=o.require,o.require=g,o.require.packaged=!0)}f(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,d){function h(g,m,c){Object.defineProperty(g,m,{value:c,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||h(String.prototype,"startsWith",function(g,m){return m=m||0,this.lastIndexOf(g,m)===m}),String.prototype.endsWith||h(String.prototype,"endsWith",function(g,m){var c=this;(m===void 0||m>c.length)&&(m=c.length),m-=g.length;var f=c.indexOf(g,m);return f!==-1&&f===m}),String.prototype.repeat||h(String.prototype,"repeat",function(g){for(var m="",c=this;g>0;)g&1&&(m+=c),(g>>=1)&&(c+=c);return m}),String.prototype.includes||h(String.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Object.assign||(Object.assign=function(g){if(g==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(g),c=1;c<arguments.length;c++){var f=arguments[c];f!=null&&Object.keys(f).forEach(function(r){m[r]=f[r]})}return m}),Object.values||(Object.values=function(g){return Object.keys(g).map(function(m){return g[m]})}),Array.prototype.find||h(Array.prototype,"find",function(g){for(var m=this.length,c=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(c,r,f,this))return r}}),Array.prototype.findIndex||h(Array.prototype,"findIndex",function(g){for(var m=this.length,c=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(c,r,f,this))return f}}),Array.prototype.includes||h(Array.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Array.prototype.fill||h(Array.prototype,"fill",function(g){for(var m=this,c=m.length>>>0,f=arguments[1],r=f>>0,o=r<0?Math.max(c+r,0):Math.min(r,c),a=arguments[2],s=a===void 0?c:a>>0,i=s<0?Math.max(c+s,0):Math.min(s,c);o<i;)m[o]=g,o++;return m}),Array.of||h(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,d){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,d){n.deepCopy=function h(g){if(typeof g!="object"||!g)return g;var m;if(Array.isArray(g)){m=[];for(var c=0;c<g.length;c++)m[c]=h(g[c]);return m}if(Object.prototype.toString.call(g)!=="[object Object]")return g;m={};for(var c in g)m[c]=h(g[c]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,d){n.last=function(m){return m[m.length-1]},n.stringReverse=function(m){return m.split("").reverse().join("")},n.stringRepeat=function(m,c){for(var f="";c>0;)c&1&&(f+=m),(c>>=1)&&(m+=m);return f};var h=/^\s\s*/,g=/\s\s*$/;n.stringTrimLeft=function(m){return m.replace(h,"")},n.stringTrimRight=function(m){return m.replace(g,"")},n.copyObject=function(m){var c={};for(var f in m)c[f]=m[f];return c},n.copyArray=function(m){for(var c=[],f=0,r=m.length;f<r;f++)m[f]&&typeof m[f]=="object"?c[f]=this.copyObject(m[f]):c[f]=m[f];return c},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(m){for(var c={},f=0;f<m.length;f++)c[m[f]]=1;return c},n.createMap=function(m){var c=Object.create(null);for(var f in m)c[f]=m[f];return c},n.arrayRemove=function(m,c){for(var f=0;f<=m.length;f++)c===m[f]&&m.splice(f,1)},n.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(m,c){var f=[];return m.replace(c,function(r){f.push({offset:arguments[arguments.length-2],length:r.length})}),f},n.deferredCall=function(m){var c=null,f=function(){c=null,m()},r=function(o){return r.cancel(),c=setTimeout(f,o||0),r};return r.schedule=r,r.call=function(){return this.cancel(),m(),r},r.cancel=function(){return clearTimeout(c),c=null,r},r.isPending=function(){return c},r},n.delayedCall=function(m,c){var f=null,r=function(){f=null,m()},o=function(a){f==null&&(f=setTimeout(r,a||c))};return o.delay=function(a){f&&clearTimeout(f),f=setTimeout(r,a||c)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){f&&clearTimeout(f),f=null},o.isPending=function(){return f},o},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(m,c,f){return f&&m.codePointAt(c)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,d){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var h=typeof navigator=="object"?navigator:{},g=(/mac|win|linux/i.exec(h.platform)||["other"])[0].toLowerCase(),m=h.userAgent||"",c=h.appName||"";n.isWin=g=="win",n.isMac=g=="mac",n.isLinux=g=="linux",n.isIE=c=="Microsoft Internet Explorer"||c.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=m.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(m.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,n.isAIR=m.indexOf("AdobeAIR")>=0,n.isAndroid=m.indexOf("Android")>=0,n.isChromeOS=m.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,d){var h=t("./useragent"),g="http://www.w3.org/1999/xhtml";n.buildDom=function a(s,i,u){if(typeof s=="string"&&s){var p=document.createTextNode(s);return i&&i.appendChild(p),p}if(!Array.isArray(s))return s&&s.appendChild&&i&&i.appendChild(s),s;if(typeof s[0]!="string"||!s[0]){for(var y=[],b=0;b<s.length;b++){var M=a(s[b],i,u);M&&y.push(M)}return y}var x=document.createElement(s[0]),A=s[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var b=S;b<s.length;b++)a(s[b],x,u);return S==2&&Object.keys(A).forEach(function($){var R=A[$];$==="class"?x.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||$=="value"||$[0]=="$"?x[$]=R:$==="ref"?u&&(u[R]=x):$==="style"?typeof R=="string"&&(x.style.cssText=R):R!=null&&x.setAttribute($,R)}),i&&i.appendChild(x),x},n.getDocumentHead=function(a){return a||(a=document),a.head||a.getElementsByTagName("head")[0]||a.documentElement},n.createElement=function(a,s){return document.createElementNS?document.createElementNS(s||g,a):document.createElement(a)},n.removeChildren=function(a){a.innerHTML=""},n.createTextNode=function(a,s){var i=s?s.ownerDocument:document;return i.createTextNode(a)},n.createFragment=function(a){var s=a?a.ownerDocument:document;return s.createDocumentFragment()},n.hasCssClass=function(a,s){var i=(a.className+"").split(/\s+/g);return i.indexOf(s)!==-1},n.addCssClass=function(a,s){n.hasCssClass(a,s)||(a.className+=" "+s)},n.removeCssClass=function(a,s){for(var i=a.className.split(/\s+/g);;){var u=i.indexOf(s);if(u==-1)break;i.splice(u,1)}a.className=i.join(" ")},n.toggleCssClass=function(a,s){for(var i=a.className.split(/\s+/g),u=!0;;){var p=i.indexOf(s);if(p==-1)break;u=!1,i.splice(p,1)}return u&&i.push(s),a.className=i.join(" "),u},n.setCssClass=function(a,s,i){i?n.addCssClass(a,s):n.removeCssClass(a,s)},n.hasCssString=function(a,s){var i=0,u;if(s=s||document,u=s.querySelectorAll("style")){for(;i<u.length;)if(u[i++].id===a)return!0}},n.removeElementById=function(a,s){s=s||document,s.getElementById(a)&&s.getElementById(a).remove()};var m,c=[];n.useStrictCSP=function(a){m=a,a==!1?f():c||(c=[])};function f(){var a=c;c=null,a&&a.forEach(function(s){r(s[0],s[1])})}function r(a,s,i){if(!(typeof document>"u")){if(c){if(i)f();else if(i===!1)return c.push([a,s])}if(!m){var u=i;!i||!i.getRootNode?u=document:(u=i.getRootNode(),(!u||u==i)&&(u=document));var p=u.ownerDocument||u;if(s&&n.hasCssString(s,u))return null;s&&(a+=`
1171
+ /*# sourceURL=ace/css/`+s+" */");var y=n.createElement("style");y.appendChild(p.createTextNode(a)),s&&(y.id=s),u==p&&(u=n.getDocumentHead(p)),u.insertBefore(y,u.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(a,s){n.buildDom(["link",{rel:"stylesheet",href:a}],n.getDocumentHead(s))},n.scrollbarWidth=function(a){var s=n.createElement("ace_inner");s.style.width="100%",s.style.minWidth="0px",s.style.height="200px",s.style.display="block";var i=n.createElement("ace_outer"),u=i.style;u.position="absolute",u.left="-10000px",u.overflow="hidden",u.width="200px",u.minWidth="0px",u.height="150px",u.display="block",i.appendChild(s);var p=a&&a.documentElement||document&&document.documentElement;if(!p)return 0;p.appendChild(i);var y=s.offsetWidth;u.overflow="scroll";var b=s.offsetWidth;return y===b&&(b=i.clientWidth),p.removeChild(i),y-b},n.computedStyle=function(a,s){return window.getComputedStyle(a,"")||{}},n.setStyle=function(a,s,i){a[s]!==i&&(a[s]=i)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=h.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,h.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");n.HI_DPI&&o.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!h.isEdge&&typeof o.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),o=null}n.HAS_CSS_TRANSFORMS?n.translate=function(a,s,i){a.style.transform="translate("+Math.round(s)+"px, "+Math.round(i)+"px)"}:n.translate=function(a,s,i){a.style.top=Math.round(i)+"px",a.style.left=Math.round(s)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,d){var h=t("./dom");n.get=function(g,m){var c=new XMLHttpRequest;c.open("GET",g,!0),c.onreadystatechange=function(){c.readyState===4&&m(c.responseText)},c.send(null)},n.loadScript=function(g,m){var c=h.getDocumentHead(),f=document.createElement("script");f.src=g,c.appendChild(f),f.onload=f.onreadystatechange=function(r,o){(o||!f.readyState||f.readyState=="loaded"||f.readyState=="complete")&&(f=f.onload=f.onreadystatechange=null,o||m())}},n.qualifyURL=function(g){var m=document.createElement("a");return m.href=g,m.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,d){n.inherits=function(h,g){h.super_=g,h.prototype=Object.create(g.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(h,g){for(var m in g)h[m]=g[m];return h},n.implement=function(h,g){n.mixin(h,g)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,d){var h={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};h._emit=h._dispatchEvent=function(c,f){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[c]||[],o=this._defaultHandlers[c];if(!(!r.length&&!o)){(typeof f!="object"||!f)&&(f={}),f.type||(f.type=c),f.stopPropagation||(f.stopPropagation=g),f.preventDefault||(f.preventDefault=m),r=r.slice();for(var a=0;a<r.length&&(r[a](f,this),!f.propagationStopped);a++);if(o&&!f.defaultPrevented)return o(f,this)}},h._signal=function(c,f){var r=(this._eventRegistry||{})[c];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](f,this)}},h.once=function(c,f){var r=this;if(this.on(c,function o(){r.off(c,o),f.apply(null,arguments)}),!f)return new Promise(function(o){f=o})},h.setDefaultHandler=function(c,f){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[c]){var o=r[c],a=r._disabled_[c];a||(r._disabled_[c]=a=[]),a.push(o);var s=a.indexOf(f);s!=-1&&a.splice(s,1)}r[c]=f},h.removeDefaultHandler=function(c,f){var r=this._defaultHandlers;if(r){var o=r._disabled_[c];if(r[c]==f)o&&this.setDefaultHandler(c,o.pop());else if(o){var a=o.indexOf(f);a!=-1&&o.splice(a,1)}}},h.on=h.addEventListener=function(c,f,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[c];return o||(o=this._eventRegistry[c]=[]),o.indexOf(f)==-1&&o[r?"unshift":"push"](f),f},h.off=h.removeListener=h.removeEventListener=function(c,f){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[c];if(r){var o=r.indexOf(f);o!==-1&&r.splice(o,1)}},h.removeAllListeners=function(c){c||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[c]=void 0),this._defaultHandlers&&(this._defaultHandlers[c]=void 0)},n.EventEmitter=h}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,d){n.reportError=function(g,m){var c=new Error(g);c.data=m,typeof console=="object"&&console.error&&console.error(c),setTimeout(function(){throw c})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,d){var h={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};n.defaultEnglishMessages=h}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,d){"no use strict";var h=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,c=t("./default_english_messages").defaultEnglishMessages,f={setOptions:function(i){Object.keys(i).forEach(function(u){this.setOption(u,i[u])},this)},getOptions:function(i){var u={};if(i)Array.isArray(i)||(u=i,i=Object.keys(u));else{var p=this.$options;i=Object.keys(p).filter(function(y){return!p[y].hidden})}return i.forEach(function(y){u[y]=this.getOption(y)},this),u},setOption:function(i,u){if(this["$"+i]!==u){var p=this.$options[i];if(!p)return r('misspelled option "'+i+'"');if(p.forwardTo)return this[p.forwardTo]&&this[p.forwardTo].setOption(i,u);p.handlesSet||(this["$"+i]=u),p&&p.set&&p.set.call(this,u)}},getOption:function(i){var u=this.$options[i];return u?u.forwardTo?this[u.forwardTo]&&this[u.forwardTo].getOption(i):u&&u.get?u.get.call(this):this["$"+i]:r('misspelled option "'+i+'"')}};function r(i){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,a,s=(function(){function i(){this.$defaultOptions={},o=c,a="dollarSigns"}return i.prototype.defineOptions=function(u,p,y){return u.$options||(this.$defaultOptions[p]=u.$options={}),Object.keys(y).forEach(function(b){var M=y[b];typeof M=="string"&&(M={forwardTo:M}),M.name||(M.name=b),u.$options[M.name]=M,"initialValue"in M&&(u["$"+M.name]=M.initialValue)}),h.implement(u,f),this},i.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(p){var y=u.$options[p];"value"in y&&u.setOption(p,y.value)})},i.prototype.setDefaultValue=function(u,p,y){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][p])break;if(!this.$defaultOptions[u][p])return!1}var b=this.$defaultOptions[u]||(this.$defaultOptions[u]={});b[p]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,p,y):b[p].value=y)},i.prototype.setDefaultValues=function(u,p){Object.keys(p).forEach(function(y){this.setDefaultValue(u,y,p[y])},this)},i.prototype.setMessages=function(u,p){o=u,p&&p.placeholders&&(a=p.placeholders)},i.prototype.nls=function(u,p,y){o[u]||(r("No message found for the key '"+u+"' in the provided messages, trying to find a translation for the default string '"+p+"'."),o[p]||r("No message found for the default string '"+p+"' in the provided messages. Falling back to the default English message."));var b=o[u]||o[p]||p;return y&&(a==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(M,x){return x=="$"?"$":y[x]})),a==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(M,x){return y[x]}))),b},i})();s.prototype.warn=r,s.prototype.reportError=m,h.implement(s.prototype,g),n.AppConfig=s}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,d){d.exports=`.ace-tm .ace_gutter {
1172
1172
  background: #f0f0f0;
1173
1173
  color: #333;
1174
1174
  }
@@ -1326,49 +1326,49 @@ export const FormManager: React.FC = () => {
1326
1326
  .ace-tm .ace_indent-guide-active {
1327
1327
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1328
1328
  }
1329
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,p){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var h=t("../lib/dom");h.importCssString(n.cssText,n.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(t,n,p){"no use strict";var h=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),c=t("./lib/app_config").AppConfig;p.exports=n=new c;var d={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(s){if(!d.hasOwnProperty(s))throw new Error("Unknown config key: "+s);return d[s]},n.set=function(s,i){if(d.hasOwnProperty(s))d[s]=i;else if(this.setDefaultValue("",s,i)==!1)throw new Error("Unknown config key: "+s);s=="useStrictCSP"&&m.useStrictCSP(i)},n.all=function(){return h.copyObject(d)},n.$modes={},n.moduleUrl=function(s,i){if(d.$moduleUrls[s])return d.$moduleUrls[s];var u=s.split("/");i=i||u[u.length-2]||"";var f=i=="snippets"?"/":"-",y=u[u.length-1];if(i=="worker"&&f=="-"){var b=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(b,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var M=d[i+"Path"];return M==null?M=d.basePath:f=="/"&&(i=f=""),M&&M.slice(-1)!="/"&&(M+="/"),M+i+f+y+this.get("suffix")},n.setModuleUrl=function(s,i){return d.$moduleUrls[s]=i};var r=function(s,i){if(s==="ace/theme/textmate"||s==="./theme/textmate")return i(null,t("./theme/textmate"));if(o)return o(s,i);console.error("loader is not configured")},o;n.setLoader=function(s){o=s},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(s,i){var u;if(Array.isArray(s))var f=s[0],y=s[1];else if(typeof s=="string")var y=s;var b=function(M){if(M&&!n.$loading[y])return i&&i(M);if(n.$loading[y]||(n.$loading[y]=[]),n.$loading[y].push(i),!(n.$loading[y].length>1)){var $=function(){r(y,function(A,S){S&&(n.$loaded[y]=S),n._emit("load.module",{name:y,module:S});var E=n.$loading[y];n.$loading[y]=null,E.forEach(function(R){R&&R(S)})})};if(!n.get("packaged"))return $();g.loadScript(n.moduleUrl(y,f),$),a()}};if(n.dynamicModules[y])n.dynamicModules[y]().then(function(M){M.default?b(M.default):b(M)});else{try{u=this.$require(y)}catch{}b(u||n.$loaded[y])}},n.$require=function(s){if(typeof p.require=="function"){var i="require";return p[i](s)}},n.setModuleLoader=function(s,i){n.dynamicModules[s]=i};var a=function(){!d.basePath&&!d.workerPath&&!d.modePath&&!d.themePath&&!Object.keys(d.$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"),a=function(){})};n.version="1.36.5"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,p){t("./lib/fixoldbrowsers");var h=t("./config");h.setLoader(function(d,r){t([d],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();p.exports=function(d){h.init=m,h.$require=t,d.require=t},m(!0);function m(d){if(!(!g||!g.document)){h.set("packaged",d||t.packaged||p.packaged||g.define&&(void 0).packaged);var r={},o="",a=document.currentScript||document._currentScript,s=a&&a.ownerDocument||document;a&&a.src&&(o=a.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var i=s.getElementsByTagName("script"),u=0;u<i.length;u++){var f=i[u],y=f.src||f.getAttribute("src");if(y){for(var b=f.attributes,M=0,$=b.length;M<$;M++){var A=b[M];A.name.indexOf("data-ace-")===0&&(r[c(A.name.replace(/^data-ace-/,""))]=A.value)}var S=y.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);S&&(o=S[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var E in r)typeof r[E]<"u"&&h.set(E,r[E])}}function c(d){return d.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,p){var h=(function(){function g(m,c,d,r){this.start={row:m,column:c},this.end={row:d,column:r}}return g.prototype.isEqual=function(m){return this.start.row===m.start.row&&this.end.row===m.end.row&&this.start.column===m.start.column&&this.end.column===m.end.column},g.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},g.prototype.contains=function(m,c){return this.compare(m,c)==0},g.prototype.compareRange=function(m){var c,d=m.end,r=m.start;return c=this.compare(d.row,d.column),c==1?(c=this.compare(r.row,r.column),c==1?2:c==0?1:0):c==-1?-2:(c=this.compare(r.row,r.column),c==-1?-1:c==1?42:0)},g.prototype.comparePoint=function(m){return this.compare(m.row,m.column)},g.prototype.containsRange=function(m){return this.comparePoint(m.start)==0&&this.comparePoint(m.end)==0},g.prototype.intersects=function(m){var c=this.compareRange(m);return c==-1||c==0||c==1},g.prototype.isEnd=function(m,c){return this.end.row==m&&this.end.column==c},g.prototype.isStart=function(m,c){return this.start.row==m&&this.start.column==c},g.prototype.setStart=function(m,c){typeof m=="object"?(this.start.column=m.column,this.start.row=m.row):(this.start.row=m,this.start.column=c)},g.prototype.setEnd=function(m,c){typeof m=="object"?(this.end.column=m.column,this.end.row=m.row):(this.end.row=m,this.end.column=c)},g.prototype.inside=function(m,c){return this.compare(m,c)==0?!(this.isEnd(m,c)||this.isStart(m,c)):!1},g.prototype.insideStart=function(m,c){return this.compare(m,c)==0?!this.isEnd(m,c):!1},g.prototype.insideEnd=function(m,c){return this.compare(m,c)==0?!this.isStart(m,c):!1},g.prototype.compare=function(m,c){return!this.isMultiLine()&&m===this.start.row?c<this.start.column?-1:c>this.end.column?1:0:m<this.start.row?-1:m>this.end.row?1:this.start.row===m?c>=this.start.column?0:-1:this.end.row===m?c<=this.end.column?0:1:0},g.prototype.compareStart=function(m,c){return this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.compareEnd=function(m,c){return this.end.row==m&&this.end.column==c?1:this.compare(m,c)},g.prototype.compareInside=function(m,c){return this.end.row==m&&this.end.column==c?1:this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.clipRows=function(m,c){if(this.end.row>c)var d={row:c+1,column:0};else if(this.end.row<m)var d={row:m,column:0};if(this.start.row>c)var r={row:c+1,column:0};else if(this.start.row<m)var r={row:m,column:0};return g.fromPoints(r||this.start,d||this.end)},g.prototype.extend=function(m,c){var d=this.compare(m,c);if(d==0)return this;if(d==-1)var r={row:m,column:c};else var o={row:m,column:c};return g.fromPoints(r||this.start,o||this.end)},g.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},g.prototype.isMultiLine=function(){return this.start.row!==this.end.row},g.prototype.clone=function(){return g.fromPoints(this.start,this.end)},g.prototype.collapseRows=function(){return this.end.column==0?new g(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new g(this.start.row,0,this.end.row,0)},g.prototype.toScreenRange=function(m){var c=m.documentToScreenPosition(this.start),d=m.documentToScreenPosition(this.end);return new g(c.row,c.column,d.row,d.column)},g.prototype.moveBy=function(m,c){this.start.row+=m,this.start.column+=c,this.end.row+=m,this.end.column+=c},g})();h.fromPoints=function(g,m){return new h(g.row,g.column,m.row,m.column)},h.comparePoints=function(g,m){return g.row-m.row||g.column-m.column},n.Range=h}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,p){for(var h=t("./oop"),g={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},m={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},c=0;c<10;c++)m["Digit"+c]=48+c,m["Numpad"+c]=96+c,g.PRINTABLE_KEYS[48+c]=""+c,g.FUNCTION_KEYS[96+c]="Numpad"+c;for(var c=65;c<91;c++){var d=String.fromCharCode(c+32);m["Key"+d.toUpperCase()]=c,g.PRINTABLE_KEYS[c]=d}for(var c=1;c<13;c++)m["F"+c]=111+c,g.FUNCTION_KEYS[111+c]="F"+c;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)m[o]=m[o+"Left"]=m[o+"Right"]=r[o];n.$codeToKeyCode=m,g.PRINTABLE_KEYS[173]="-";for(var a in g.FUNCTION_KEYS){var s=g.FUNCTION_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}for(var a in g.PRINTABLE_KEYS){var s=g.PRINTABLE_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}h.mixin(g,g.MODIFIER_KEYS),h.mixin(g,g.PRINTABLE_KEYS),h.mixin(g,g.FUNCTION_KEYS),g.enter=g.return,g.escape=g.esc,g.del=g.delete,(function(){for(var i=["cmd","ctrl","alt","shift"],u=Math.pow(2,i.length);u--;)g.KEY_MODS[u]=i.filter(function(f){return u&g.KEY_MODS[f]}).join("-")+"-"})(),g.KEY_MODS[0]="",g.KEY_MODS[-1]="input-",h.mixin(n,g),n.default=n,n.keyCodeToString=function(i){var u=g[i];return typeof u!="string"&&(u=String.fromCharCode(i)),u.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var h=t("./keys"),g=t("./useragent"),m=null,c=0,d;function r(){d=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return d={passive:!1},!0}})}catch{}}function o(){return d==null&&r(),d}function a(M,$,A){this.elem=M,this.type=$,this.callback=A}a.prototype.destroy=function(){i(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var s=n.addListener=function(M,$,A,S){M.addEventListener($,A,o()),S&&S.$toDestroy.push(new a(M,$,A))},i=n.removeListener=function(M,$,A){M.removeEventListener($,A,o())};n.stopEvent=function(M){return n.stopPropagation(M),n.preventDefault(M),!1},n.stopPropagation=function(M){M.stopPropagation&&M.stopPropagation()},n.preventDefault=function(M){M.preventDefault&&M.preventDefault()},n.getButton=function(M){return M.type=="dblclick"?0:M.type=="contextmenu"||g.isMac&&M.ctrlKey&&!M.altKey&&!M.shiftKey?2:M.button},n.capture=function(M,$,A){var S=M&&M.ownerDocument||document;function E(R){$&&$(R),A&&A(R),i(S,"mousemove",$),i(S,"mouseup",E),i(S,"dragstart",E)}return s(S,"mousemove",$),s(S,"mouseup",E),s(S,"dragstart",E),E},n.addMouseWheelListener=function(M,$,A){s(M,"wheel",function(S){var E=.15,R=S.deltaX||0,L=S.deltaY||0;switch(S.deltaMode){case S.DOM_DELTA_PIXEL:S.wheelX=R*E,S.wheelY=L*E;break;case S.DOM_DELTA_LINE:var _=15;S.wheelX=R*_,S.wheelY=L*_;break;case S.DOM_DELTA_PAGE:var D=150;S.wheelX=R*D,S.wheelY=L*D;break}$(S)},A)},n.addMultiMouseDownListener=function(M,$,A,S,E){var R=0,L,_,D,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function v(C){if(n.getButton(C)!==0?R=0:C.detail>1?(R++,R>4&&(R=1)):R=1,g.isIE){var x=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-_)>5;(!D||x)&&(R=1),D&&clearTimeout(D),D=setTimeout(function(){D=null},$[R-1]||600),R==1&&(L=C.clientX,_=C.clientY)}if(C._clicks=R,A[S]("mousedown",C),R>4)R=0;else if(R>1)return A[S](w[R],C)}Array.isArray(M)||(M=[M]),M.forEach(function(C){s(C,"mousedown",v,E)})};function u(M){return 0|(M.ctrlKey?1:0)|(M.altKey?2:0)|(M.shiftKey?4:0)|(M.metaKey?8:0)}n.getModifierString=function(M){return h.KEY_MODS[u(M)]};function f(M,$,A){var S=u($);if(!A&&$.code&&(A=h.$codeToKeyCode[$.code]||A),!g.isMac&&m){if($.getModifierState&&($.getModifierState("OS")||$.getModifierState("Win"))&&(S|=8),m.altGr)if((3&S)!=3)m.altGr=0;else return;if(A===18||A===17){var E=$.location;if(A===17&&E===1)m[A]==1&&(c=$.timeStamp);else if(A===18&&S===3&&E===2){var R=$.timeStamp-c;R<50&&(m.altGr=!0)}}}if(A in h.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&$.location===3&&(M($,S,-A),$.defaultPrevented))){if(g.isChromeOS&&S&8){if(M($,S,A),$.defaultPrevented)return;S&=-9}return!S&&!(A in h.FUNCTION_KEYS)&&!(A in h.PRINTABLE_KEYS)?!1:M($,S,A)}}n.addCommandKeyListener=function(M,$,A){var S=null;s(M,"keydown",function(E){m[E.keyCode]=(m[E.keyCode]||0)+1;var R=f($,E,E.keyCode);return S=E.defaultPrevented,R},A),s(M,"keypress",function(E){S&&(E.ctrlKey||E.altKey||E.shiftKey||E.metaKey)&&(n.stopEvent(E),S=null)},A),s(M,"keyup",function(E){m[E.keyCode]=null},A),m||(y(),s(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var b=1;n.nextTick=function(M,$){$=$||window;var A="zero-timeout-message-"+b++,S=function(E){E.data==A&&(n.stopPropagation(E),i($,"message",S),M())};s($,"message",S),$.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(M,$){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):M()},$)},n.$idleBlockId=null,n.blockIdle=function(M){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},M||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(M){setTimeout(M,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,p){var h;p.exports={lineMode:!1,pasteCancelled:function(){return h&&h>Date.now()-50?!0:h=!1},cancel:function(){h=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(t,n,p){var h=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),c=t("../lib/dom"),d=t("../lib/lang"),r=t("../clipboard"),o=m.isChrome<18,a=m.isIE,s=m.isChrome>63,i=400,u=t("../lib/keys"),f=u.KEY_MODS,y=m.isIOS,b=y?/\s/:/\n/,M=m.isMobile,$;$=function(A,S){var E=c.createElement("textarea");E.className="ace_text-input",E.setAttribute("wrap","off"),E.setAttribute("autocorrect","off"),E.setAttribute("autocapitalize","off"),E.setAttribute("spellcheck","false"),E.style.opacity="0",A.insertBefore(E,A.firstChild);var R=!1,L=!1,_=!1,D=!1,w="";M||(E.style.fontSize="1px");var v=!1,C=!1,x="",T=0,k=0,O=0,I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var B=document.activeElement===E}catch{}this.setNumberOfExtraLines=function(j){if(I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,j<0){P=0;return}P=j},this.setAriaLabel=function(){var j="";if(S.$textInputAriaLabel&&(j+="".concat(S.$textInputAriaLabel,", ")),S.session){var Z=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[Z+1])}E.setAttribute("aria-label",j)},this.setAriaOptions=function(j){j.activeDescendant?(E.setAttribute("aria-haspopup","true"),E.setAttribute("aria-autocomplete",j.inline?"both":"list"),E.setAttribute("aria-activedescendant",j.activeDescendant)):(E.setAttribute("aria-haspopup","false"),E.setAttribute("aria-autocomplete","both"),E.removeAttribute("aria-activedescendant")),j.role&&E.setAttribute("role",j.role),j.setLabel&&(E.setAttribute("aria-roledescription",g("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),h.addListener(E,"blur",function(j){C||(S.onBlur(j),B=!1)},S),h.addListener(E,"focus",function(j){if(!C){if(B=!0,m.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(j),m.isEdge?setTimeout(H):H()}},S),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:S.renderer.enableKeyboardAccessibility}),w||s||this.$focusScroll=="browser")return E.focus({preventScroll:!0});var j=E.style.top;E.style.position="fixed",E.style.top="0px";try{var Z=E.getBoundingClientRect().top!=0}catch{return}var ee=[];if(Z)for(var re=E.parentElement;re&&re.nodeType==1;)ee.push(re),re.setAttribute("ace_nocontext","true"),!re.parentElement&&re.getRootNode?re=re.getRootNode().host:re=re.parentElement;E.focus({preventScroll:!0}),Z&&ee.forEach(function(ae){ae.removeAttribute("ace_nocontext")}),setTimeout(function(){E.style.position="",E.style.top=="0px"&&(E.style.top=j)},0)},this.blur=function(){E.blur()},this.isFocused=function(){return B},S.on("beforeEndOperation",function(){var j=S.curOp,Z=j&&j.command&&j.command.name;if(Z!="insertstring"){var ee=Z&&(j.docChanged||j.selectionChanged);_&&ee&&(x=E.value="",dt()),H()}}),S.on("changeSelection",this.setAriaLabel);var F=function(j,Z){for(var ee=Z,re=1;re<=j-I&&re<2*P+1;re++)ee+=S.session.getLine(j-re).length+1;return ee},H=y?function(j){if(!(!B||R&&!j||D)){j||(j="");var Z=`
1329
+ `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,d){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var h=t("../lib/dom");h.importCssString(n.cssText,n.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(t,n,d){"no use strict";var h=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),c=t("./lib/app_config").AppConfig;d.exports=n=new c;var f={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(s){if(!f.hasOwnProperty(s))throw new Error("Unknown config key: "+s);return f[s]},n.set=function(s,i){if(f.hasOwnProperty(s))f[s]=i;else if(this.setDefaultValue("",s,i)==!1)throw new Error("Unknown config key: "+s);s=="useStrictCSP"&&m.useStrictCSP(i)},n.all=function(){return h.copyObject(f)},n.$modes={},n.moduleUrl=function(s,i){if(f.$moduleUrls[s])return f.$moduleUrls[s];var u=s.split("/");i=i||u[u.length-2]||"";var p=i=="snippets"?"/":"-",y=u[u.length-1];if(i=="worker"&&p=="-"){var b=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(b,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var M=f[i+"Path"];return M==null?M=f.basePath:p=="/"&&(i=p=""),M&&M.slice(-1)!="/"&&(M+="/"),M+i+p+y+this.get("suffix")},n.setModuleUrl=function(s,i){return f.$moduleUrls[s]=i};var r=function(s,i){if(s==="ace/theme/textmate"||s==="./theme/textmate")return i(null,t("./theme/textmate"));if(o)return o(s,i);console.error("loader is not configured")},o;n.setLoader=function(s){o=s},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(s,i){var u;if(Array.isArray(s))var p=s[0],y=s[1];else if(typeof s=="string")var y=s;var b=function(M){if(M&&!n.$loading[y])return i&&i(M);if(n.$loading[y]||(n.$loading[y]=[]),n.$loading[y].push(i),!(n.$loading[y].length>1)){var x=function(){r(y,function(A,S){S&&(n.$loaded[y]=S),n._emit("load.module",{name:y,module:S});var $=n.$loading[y];n.$loading[y]=null,$.forEach(function(R){R&&R(S)})})};if(!n.get("packaged"))return x();g.loadScript(n.moduleUrl(y,p),x),a()}};if(n.dynamicModules[y])n.dynamicModules[y]().then(function(M){M.default?b(M.default):b(M)});else{try{u=this.$require(y)}catch{}b(u||n.$loaded[y])}},n.$require=function(s){if(typeof d.require=="function"){var i="require";return d[i](s)}},n.setModuleLoader=function(s,i){n.dynamicModules[s]=i};var a=function(){!f.basePath&&!f.workerPath&&!f.modePath&&!f.themePath&&!Object.keys(f.$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"),a=function(){})};n.version="1.36.5"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,d){t("./lib/fixoldbrowsers");var h=t("./config");h.setLoader(function(f,r){t([f],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();d.exports=function(f){h.init=m,h.$require=t,f.require=t},m(!0);function m(f){if(!(!g||!g.document)){h.set("packaged",f||t.packaged||d.packaged||g.define&&(void 0).packaged);var r={},o="",a=document.currentScript||document._currentScript,s=a&&a.ownerDocument||document;a&&a.src&&(o=a.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var i=s.getElementsByTagName("script"),u=0;u<i.length;u++){var p=i[u],y=p.src||p.getAttribute("src");if(y){for(var b=p.attributes,M=0,x=b.length;M<x;M++){var A=b[M];A.name.indexOf("data-ace-")===0&&(r[c(A.name.replace(/^data-ace-/,""))]=A.value)}var S=y.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);S&&(o=S[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var $ in r)typeof r[$]<"u"&&h.set($,r[$])}}function c(f){return f.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,d){var h=(function(){function g(m,c,f,r){this.start={row:m,column:c},this.end={row:f,column:r}}return g.prototype.isEqual=function(m){return this.start.row===m.start.row&&this.end.row===m.end.row&&this.start.column===m.start.column&&this.end.column===m.end.column},g.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},g.prototype.contains=function(m,c){return this.compare(m,c)==0},g.prototype.compareRange=function(m){var c,f=m.end,r=m.start;return c=this.compare(f.row,f.column),c==1?(c=this.compare(r.row,r.column),c==1?2:c==0?1:0):c==-1?-2:(c=this.compare(r.row,r.column),c==-1?-1:c==1?42:0)},g.prototype.comparePoint=function(m){return this.compare(m.row,m.column)},g.prototype.containsRange=function(m){return this.comparePoint(m.start)==0&&this.comparePoint(m.end)==0},g.prototype.intersects=function(m){var c=this.compareRange(m);return c==-1||c==0||c==1},g.prototype.isEnd=function(m,c){return this.end.row==m&&this.end.column==c},g.prototype.isStart=function(m,c){return this.start.row==m&&this.start.column==c},g.prototype.setStart=function(m,c){typeof m=="object"?(this.start.column=m.column,this.start.row=m.row):(this.start.row=m,this.start.column=c)},g.prototype.setEnd=function(m,c){typeof m=="object"?(this.end.column=m.column,this.end.row=m.row):(this.end.row=m,this.end.column=c)},g.prototype.inside=function(m,c){return this.compare(m,c)==0?!(this.isEnd(m,c)||this.isStart(m,c)):!1},g.prototype.insideStart=function(m,c){return this.compare(m,c)==0?!this.isEnd(m,c):!1},g.prototype.insideEnd=function(m,c){return this.compare(m,c)==0?!this.isStart(m,c):!1},g.prototype.compare=function(m,c){return!this.isMultiLine()&&m===this.start.row?c<this.start.column?-1:c>this.end.column?1:0:m<this.start.row?-1:m>this.end.row?1:this.start.row===m?c>=this.start.column?0:-1:this.end.row===m?c<=this.end.column?0:1:0},g.prototype.compareStart=function(m,c){return this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.compareEnd=function(m,c){return this.end.row==m&&this.end.column==c?1:this.compare(m,c)},g.prototype.compareInside=function(m,c){return this.end.row==m&&this.end.column==c?1:this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.clipRows=function(m,c){if(this.end.row>c)var f={row:c+1,column:0};else if(this.end.row<m)var f={row:m,column:0};if(this.start.row>c)var r={row:c+1,column:0};else if(this.start.row<m)var r={row:m,column:0};return g.fromPoints(r||this.start,f||this.end)},g.prototype.extend=function(m,c){var f=this.compare(m,c);if(f==0)return this;if(f==-1)var r={row:m,column:c};else var o={row:m,column:c};return g.fromPoints(r||this.start,o||this.end)},g.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},g.prototype.isMultiLine=function(){return this.start.row!==this.end.row},g.prototype.clone=function(){return g.fromPoints(this.start,this.end)},g.prototype.collapseRows=function(){return this.end.column==0?new g(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new g(this.start.row,0,this.end.row,0)},g.prototype.toScreenRange=function(m){var c=m.documentToScreenPosition(this.start),f=m.documentToScreenPosition(this.end);return new g(c.row,c.column,f.row,f.column)},g.prototype.moveBy=function(m,c){this.start.row+=m,this.start.column+=c,this.end.row+=m,this.end.column+=c},g})();h.fromPoints=function(g,m){return new h(g.row,g.column,m.row,m.column)},h.comparePoints=function(g,m){return g.row-m.row||g.column-m.column},n.Range=h}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,d){for(var h=t("./oop"),g={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},m={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},c=0;c<10;c++)m["Digit"+c]=48+c,m["Numpad"+c]=96+c,g.PRINTABLE_KEYS[48+c]=""+c,g.FUNCTION_KEYS[96+c]="Numpad"+c;for(var c=65;c<91;c++){var f=String.fromCharCode(c+32);m["Key"+f.toUpperCase()]=c,g.PRINTABLE_KEYS[c]=f}for(var c=1;c<13;c++)m["F"+c]=111+c,g.FUNCTION_KEYS[111+c]="F"+c;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)m[o]=m[o+"Left"]=m[o+"Right"]=r[o];n.$codeToKeyCode=m,g.PRINTABLE_KEYS[173]="-";for(var a in g.FUNCTION_KEYS){var s=g.FUNCTION_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}for(var a in g.PRINTABLE_KEYS){var s=g.PRINTABLE_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}h.mixin(g,g.MODIFIER_KEYS),h.mixin(g,g.PRINTABLE_KEYS),h.mixin(g,g.FUNCTION_KEYS),g.enter=g.return,g.escape=g.esc,g.del=g.delete,(function(){for(var i=["cmd","ctrl","alt","shift"],u=Math.pow(2,i.length);u--;)g.KEY_MODS[u]=i.filter(function(p){return u&g.KEY_MODS[p]}).join("-")+"-"})(),g.KEY_MODS[0]="",g.KEY_MODS[-1]="input-",h.mixin(n,g),n.default=n,n.keyCodeToString=function(i){var u=g[i];return typeof u!="string"&&(u=String.fromCharCode(i)),u.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,d){var h=t("./keys"),g=t("./useragent"),m=null,c=0,f;function r(){f=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return f={passive:!1},!0}})}catch{}}function o(){return f==null&&r(),f}function a(M,x,A){this.elem=M,this.type=x,this.callback=A}a.prototype.destroy=function(){i(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var s=n.addListener=function(M,x,A,S){M.addEventListener(x,A,o()),S&&S.$toDestroy.push(new a(M,x,A))},i=n.removeListener=function(M,x,A){M.removeEventListener(x,A,o())};n.stopEvent=function(M){return n.stopPropagation(M),n.preventDefault(M),!1},n.stopPropagation=function(M){M.stopPropagation&&M.stopPropagation()},n.preventDefault=function(M){M.preventDefault&&M.preventDefault()},n.getButton=function(M){return M.type=="dblclick"?0:M.type=="contextmenu"||g.isMac&&M.ctrlKey&&!M.altKey&&!M.shiftKey?2:M.button},n.capture=function(M,x,A){var S=M&&M.ownerDocument||document;function $(R){x&&x(R),A&&A(R),i(S,"mousemove",x),i(S,"mouseup",$),i(S,"dragstart",$)}return s(S,"mousemove",x),s(S,"mouseup",$),s(S,"dragstart",$),$},n.addMouseWheelListener=function(M,x,A){s(M,"wheel",function(S){var $=.15,R=S.deltaX||0,L=S.deltaY||0;switch(S.deltaMode){case S.DOM_DELTA_PIXEL:S.wheelX=R*$,S.wheelY=L*$;break;case S.DOM_DELTA_LINE:var T=15;S.wheelX=R*T,S.wheelY=L*T;break;case S.DOM_DELTA_PAGE:var D=150;S.wheelX=R*D,S.wheelY=L*D;break}x(S)},A)},n.addMultiMouseDownListener=function(M,x,A,S,$){var R=0,L,T,D,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function v(C){if(n.getButton(C)!==0?R=0:C.detail>1?(R++,R>4&&(R=1)):R=1,g.isIE){var E=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-T)>5;(!D||E)&&(R=1),D&&clearTimeout(D),D=setTimeout(function(){D=null},x[R-1]||600),R==1&&(L=C.clientX,T=C.clientY)}if(C._clicks=R,A[S]("mousedown",C),R>4)R=0;else if(R>1)return A[S](w[R],C)}Array.isArray(M)||(M=[M]),M.forEach(function(C){s(C,"mousedown",v,$)})};function u(M){return 0|(M.ctrlKey?1:0)|(M.altKey?2:0)|(M.shiftKey?4:0)|(M.metaKey?8:0)}n.getModifierString=function(M){return h.KEY_MODS[u(M)]};function p(M,x,A){var S=u(x);if(!A&&x.code&&(A=h.$codeToKeyCode[x.code]||A),!g.isMac&&m){if(x.getModifierState&&(x.getModifierState("OS")||x.getModifierState("Win"))&&(S|=8),m.altGr)if((3&S)!=3)m.altGr=0;else return;if(A===18||A===17){var $=x.location;if(A===17&&$===1)m[A]==1&&(c=x.timeStamp);else if(A===18&&S===3&&$===2){var R=x.timeStamp-c;R<50&&(m.altGr=!0)}}}if(A in h.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&x.location===3&&(M(x,S,-A),x.defaultPrevented))){if(g.isChromeOS&&S&8){if(M(x,S,A),x.defaultPrevented)return;S&=-9}return!S&&!(A in h.FUNCTION_KEYS)&&!(A in h.PRINTABLE_KEYS)?!1:M(x,S,A)}}n.addCommandKeyListener=function(M,x,A){var S=null;s(M,"keydown",function($){m[$.keyCode]=(m[$.keyCode]||0)+1;var R=p(x,$,$.keyCode);return S=$.defaultPrevented,R},A),s(M,"keypress",function($){S&&($.ctrlKey||$.altKey||$.shiftKey||$.metaKey)&&(n.stopEvent($),S=null)},A),s(M,"keyup",function($){m[$.keyCode]=null},A),m||(y(),s(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var b=1;n.nextTick=function(M,x){x=x||window;var A="zero-timeout-message-"+b++,S=function($){$.data==A&&(n.stopPropagation($),i(x,"message",S),M())};s(x,"message",S),x.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(M,x){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):M()},x)},n.$idleBlockId=null,n.blockIdle=function(M){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},M||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(M){setTimeout(M,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,d){var h;d.exports={lineMode:!1,pasteCancelled:function(){return h&&h>Date.now()-50?!0:h=!1},cancel:function(){h=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(t,n,d){var h=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),c=t("../lib/dom"),f=t("../lib/lang"),r=t("../clipboard"),o=m.isChrome<18,a=m.isIE,s=m.isChrome>63,i=400,u=t("../lib/keys"),p=u.KEY_MODS,y=m.isIOS,b=y?/\s/:/\n/,M=m.isMobile,x;x=function(A,S){var $=c.createElement("textarea");$.className="ace_text-input",$.setAttribute("wrap","off"),$.setAttribute("autocorrect","off"),$.setAttribute("autocapitalize","off"),$.setAttribute("spellcheck","false"),$.style.opacity="0",A.insertBefore($,A.firstChild);var R=!1,L=!1,T=!1,D=!1,w="";M||($.style.fontSize="1px");var v=!1,C=!1,E="",_=0,k=0,O=0,I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var B=document.activeElement===$}catch{}this.setNumberOfExtraLines=function(j){if(I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,j<0){P=0;return}P=j},this.setAriaLabel=function(){var j="";if(S.$textInputAriaLabel&&(j+="".concat(S.$textInputAriaLabel,", ")),S.session){var Z=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[Z+1])}$.setAttribute("aria-label",j)},this.setAriaOptions=function(j){j.activeDescendant?($.setAttribute("aria-haspopup","true"),$.setAttribute("aria-autocomplete",j.inline?"both":"list"),$.setAttribute("aria-activedescendant",j.activeDescendant)):($.setAttribute("aria-haspopup","false"),$.setAttribute("aria-autocomplete","both"),$.removeAttribute("aria-activedescendant")),j.role&&$.setAttribute("role",j.role),j.setLabel&&($.setAttribute("aria-roledescription",g("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),h.addListener($,"blur",function(j){C||(S.onBlur(j),B=!1)},S),h.addListener($,"focus",function(j){if(!C){if(B=!0,m.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(j),m.isEdge?setTimeout(H):H()}},S),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:S.renderer.enableKeyboardAccessibility}),w||s||this.$focusScroll=="browser")return $.focus({preventScroll:!0});var j=$.style.top;$.style.position="fixed",$.style.top="0px";try{var Z=$.getBoundingClientRect().top!=0}catch{return}var ee=[];if(Z)for(var re=$.parentElement;re&&re.nodeType==1;)ee.push(re),re.setAttribute("ace_nocontext","true"),!re.parentElement&&re.getRootNode?re=re.getRootNode().host:re=re.parentElement;$.focus({preventScroll:!0}),Z&&ee.forEach(function(ae){ae.removeAttribute("ace_nocontext")}),setTimeout(function(){$.style.position="",$.style.top=="0px"&&($.style.top=j)},0)},this.blur=function(){$.blur()},this.isFocused=function(){return B},S.on("beforeEndOperation",function(){var j=S.curOp,Z=j&&j.command&&j.command.name;if(Z!="insertstring"){var ee=Z&&(j.docChanged||j.selectionChanged);T&&ee&&(E=$.value="",ft()),H()}}),S.on("changeSelection",this.setAriaLabel);var F=function(j,Z){for(var ee=Z,re=1;re<=j-I&&re<2*P+1;re++)ee+=S.session.getLine(j-re).length+1;return ee},H=y?function(j){if(!(!B||R&&!j||D)){j||(j="");var Z=`
1330
1330
  ab`+j+`cde fg
1331
- `;Z!=E.value&&(E.value=x=Z);var ee=4,re=4+(j.length||(S.selection.isEmpty()?0:1));(T!=ee||k!=re)&&E.setSelectionRange(ee,re),T=ee,k=re}}:function(){if(!(_||D)&&!(!B&&!K)){_=!0;var j=0,Z=0,ee="";if(S.session){var re=S.selection,ae=re.getRange(),ge=re.cursor.row;ge===N+1?(I=N+1,N=I+2*P):ge===I-1?(N=I-1,I=N-2*P):(ge<I-1||ge>N+1)&&(I=ge>P?ge-P:0,N=ge>P?ge+P:2*P);for(var ye=[],me=I;me<=N;me++)ye.push(S.session.getLine(me));if(ee=ye.join(`
1331
+ `;Z!=$.value&&($.value=E=Z);var ee=4,re=4+(j.length||(S.selection.isEmpty()?0:1));(_!=ee||k!=re)&&$.setSelectionRange(ee,re),_=ee,k=re}}:function(){if(!(T||D)&&!(!B&&!K)){T=!0;var j=0,Z=0,ee="";if(S.session){var re=S.selection,ae=re.getRange(),ge=re.cursor.row;ge===N+1?(I=N+1,N=I+2*P):ge===I-1?(N=I-1,I=N-2*P):(ge<I-1||ge>N+1)&&(I=ge>P?ge-P:0,N=ge>P?ge+P:2*P);for(var ye=[],me=I;me<=N;me++)ye.push(S.session.getLine(me));if(ee=ye.join(`
1332
1332
  `),j=F(ae.start.row,ae.start.column),Z=F(ae.end.row,ae.end.column),ae.start.row<I){var de=S.session.getLine(I-1);j=ae.start.row<I-1?0:j,Z+=de.length+1,ee=de+`
1333
1333
  `+ee}else if(ae.end.row>N){var le=S.session.getLine(N+1);Z=ae.end.row>N+1?le.length:ae.end.column,Z+=ee.length+1,ee=ee+`
1334
1334
  `+le}else M&&ge>0&&(ee=`
1335
1335
  `+ee,Z+=1,j+=1);ee.length>i&&(j<i&&Z<i?ee=ee.slice(0,i):(ee=`
1336
- `,j==Z?j=Z=0:(j=0,Z=1)));var _e=ee+`
1336
+ `,j==Z?j=Z=0:(j=0,Z=1)));var Te=ee+`
1337
1337
 
1338
- `;_e!=x&&(E.value=x=_e,T=k=_e.length)}if(K&&(T=E.selectionStart,k=E.selectionEnd),k!=Z||T!=j||E.selectionEnd!=k)try{E.setSelectionRange(j,Z),T=j,k=Z}catch{}_=!1}};this.resetSelection=H,B&&S.onFocus();var z=function(j){return j.selectionStart===0&&j.selectionEnd>=x.length&&j.value===x&&x&&j.selectionEnd!==k},W=function(j){_||(R?R=!1:z(E)?(S.selectAll(),H()):M&&E.selectionStart!=T&&H())},U=null;this.setInputHandler=function(j){U=j},this.getInputHandler=function(){return U};var K=!1,Y=function(j,Z){if(K&&(K=!1),L)return H(),j&&S.onPaste(j),L=!1,"";for(var ee=E.selectionStart,re=E.selectionEnd,ae=T,ge=x.length-k,ye=j,me=j.length-ee,de=j.length-re,le=0;ae>0&&x[le]==j[le];)le++,ae--;for(ye=ye.slice(le),le=1;ge>0&&x.length-le>T-1&&x[x.length-le]==j[j.length-le];)le++,ge--;me-=le-1,de-=le-1;var _e=ye.length-le+1;if(_e<0&&(ae=-_e,_e=0),ye=ye.slice(0,_e),!Z&&!ye&&!me&&!ae&&!ge&&!de)return"";D=!0;var Pt=!1;return m.isAndroid&&ye==". "&&(ye=" ",Pt=!0),ye&&!ae&&!ge&&!me&&!de||v?S.onTextInput(ye):S.onTextInput(ye,{extendLeft:ae,extendRight:ge,restoreStart:me,restoreEnd:de}),D=!1,x=j,T=ee,k=re,O=de,Pt?`
1339
- `:ye},G=function(j){if(_)return ht();if(j&&j.inputType){if(j.inputType=="historyUndo")return S.execCommand("undo");if(j.inputType=="historyRedo")return S.execCommand("redo")}var Z=E.value,ee=Y(Z,!0);(Z.length>i+100||b.test(ee)||M&&T<1&&T==k)&&H()},Q=function(j,Z,ee){var re=j.clipboardData||window.clipboardData;if(!(!re||o)){var ae=a||ee?"Text":"text/plain";try{return Z?re.setData(ae,Z)!==!1:re.getData(ae)}catch(ge){if(!ee)return Q(ge,Z,!0)}}},ue=function(j,Z){var ee=S.getCopyText();if(!ee)return h.preventDefault(j);Q(j,ee)?(y&&(H(ee),R=ee,setTimeout(function(){R=!1},10)),Z?S.onCut():S.onCopy(),h.preventDefault(j)):(R=!0,E.value=ee,E.select(),setTimeout(function(){R=!1,H(),Z?S.onCut():S.onCopy()}))},Ee=function(j){ue(j,!0)},Ce=function(j){ue(j,!1)},he=function(j){var Z=Q(j);r.pasteCancelled()||(typeof Z=="string"?(Z&&S.onPaste(Z,j),m.isIE&&setTimeout(H),h.preventDefault(j)):(E.value="",L=!0))};h.addCommandKeyListener(E,function(j,Z,ee){if(!_)return S.onCommandKey(j,Z,ee)},S),h.addListener(E,"select",W,S),h.addListener(E,"input",G,S),h.addListener(E,"cut",Ee,S),h.addListener(E,"copy",Ce,S),h.addListener(E,"paste",he,S),(!("oncut"in E)||!("oncopy"in E)||!("onpaste"in E))&&h.addListener(A,"keydown",function(j){if(!(m.isMac&&!j.metaKey||!j.ctrlKey))switch(j.keyCode){case 67:Ce(j);break;case 86:he(j);break;case 88:Ee(j);break}},S);var De=function(j){if(!(_||!S.onCompositionStart||S.$readOnly)&&(_={},!v)){j.data&&(_.useTextareaForIME=!1),setTimeout(ht,0),S._signal("compositionStart"),S.on("mousedown",ei);var Z=S.getSelectionRange();Z.end.row=Z.start.row,Z.end.column=Z.start.column,_.markerRange=Z,_.selectionStart=T,S.onCompositionStart(_),_.useTextareaForIME?(x=E.value="",T=0,k=0):(E.msGetInputContext&&(_.context=E.msGetInputContext()),E.getInputContext&&(_.context=E.getInputContext()))}},ht=function(){if(!(!_||!S.onCompositionUpdate||S.$readOnly)){if(v)return ei();if(_.useTextareaForIME)S.onCompositionUpdate(E.value);else{var j=E.value;Y(j),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+k-_.selectionStart+O)}}},dt=function(j){!S.onCompositionEnd||S.$readOnly||(_=!1,S.onCompositionEnd(),S.off("mousedown",ei),j&&G())};function ei(){C=!0,E.blur(),E.focus(),C=!1}var ha=d.delayedCall(ht,50).schedule.bind(null,null);function hd(j){j.keyCode==27&&E.value.length<E.selectionStart&&(_||(x=E.value),T=k=-1,H()),ha()}h.addListener(E,"compositionstart",De,S),h.addListener(E,"compositionupdate",ht,S),h.addListener(E,"keyup",hd,S),h.addListener(E,"keydown",ha,S),h.addListener(E,"compositionend",dt,S),this.getElement=function(){return E},this.setCommandMode=function(j){v=j,E.readOnly=!1},this.setReadOnly=function(j){v||(E.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){K=!0,H(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,Z){w||(w=E.style.cssText),E.style.cssText=(Z?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(T+k)*S.renderer.characterWidth*.5+"px;";var ee=S.container.getBoundingClientRect(),re=c.computedStyle(S.container),ae=ee.top+(parseInt(re.borderTopWidth)||0),ge=ee.left+(parseInt(ee.borderLeftWidth)||0),ye=ee.bottom-ae-E.clientHeight-2,me=function(de){c.translate(E,de.clientX-ge-2,Math.min(de.clientY-ae-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(ti),m.isWin&&h.capture(S.container,me,cn))},this.onContextMenuClose=cn;var ti;function cn(){clearTimeout(ti),ti=setTimeout(function(){w&&(E.style.cssText=w,w=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var ni=function(j){S.textInput.onContextMenu(j),cn()};h.addListener(E,"mouseup",ni,S),h.addListener(E,"mousedown",function(j){j.preventDefault(),cn()},S),h.addListener(S.renderer.scroller,"contextmenu",ni,S),h.addListener(E,"contextmenu",ni,S),y&&dd(A,S,E);function dd(j,Z,ee){var re=null,ae=!1;ee.addEventListener("keydown",function(ye){re&&clearTimeout(re),ae=!0},!0),ee.addEventListener("keyup",function(ye){re=setTimeout(function(){ae=!1},100)},!0);var ge=function(ye){if(document.activeElement===ee&&!(ae||_||Z.$mouseHandler.isMousePressed)&&!R){var me=ee.selectionStart,de=ee.selectionEnd,le=null,_e=0;if(me==0?le=u.up:me==1?le=u.home:de>k&&x[de]==`
1340
- `?le=u.end:me<T&&x[me-1]==" "?(le=u.left,_e=f.option):me<T||me==T&&k!=T&&me==de?le=u.left:de>k&&x.slice(0,de).split(`
1341
- `).length>2?le=u.down:de>k&&x[de-1]==" "?(le=u.right,_e=f.option):(de>k||de==k&&k!=T&&me==de)&&(le=u.right),me!==de&&(_e|=f.shift),le){var Pt=Z.onCommandKey({},_e,le);if(!Pt&&Z.commands){le=u.keyCodeToString(le);var da=Z.commands.findKeyCommand(_e,le);da&&Z.execCommand(da)}T=me,k=de,H("")}}};document.addEventListener("selectionchange",ge),Z.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){E.parentElement&&E.parentElement.removeChild(E)}},n.TextInput=$,n.$setUserAgentForTests=function(A,S){M=A,y=S}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,p){var h=t("../lib/useragent"),g=0,m=550,c=(function(){function o(a){a.$clickSelection=null;var s=a.editor;s.setDefaultHandler("mousedown",this.onMouseDown.bind(a)),s.setDefaultHandler("dblclick",this.onDoubleClick.bind(a)),s.setDefaultHandler("tripleclick",this.onTripleClick.bind(a)),s.setDefaultHandler("quadclick",this.onQuadClick.bind(a)),s.setDefaultHandler("mousewheel",this.onMouseWheel.bind(a));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(u){a[u]=this[u]},this),a.selectByLines=this.extendSelectionBy.bind(a,"getLineRange"),a.selectByWords=this.extendSelectionBy.bind(a,"getWordRange")}return o.prototype.onMouseDown=function(a){var s=a.inSelection(),i=a.getDocumentPosition();this.mousedownEvent=a;var u=this.editor,f=a.getButton();if(f!==0){var y=u.getSelectionRange(),b=y.isEmpty();(b||f==1)&&u.selection.moveToPosition(i),f==2&&(u.textInput.onContextMenu(a.domEvent),h.isMozilla||a.preventDefault());return}if(this.mousedownEvent.time=Date.now(),s&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(a);return}return this.captureMouse(a),this.startSelect(i,a.domEvent._clicks>1),a.preventDefault()},o.prototype.startSelect=function(a,s){a=a||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(a):s||i.selection.moveToPosition(a),s||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var a,s=this.editor,i=s.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(i);if(u==-1)a=this.$clickSelection.end;else if(u==1)a=this.$clickSelection.start;else{var f=r(this.$clickSelection,i);i=f.cursor,a=f.anchor}s.selection.setSelectionAnchor(a.row,a.column)}s.selection.selectToPosition(i),s.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(a){var s,i=this.editor,u=i.renderer.screenToTextCoordinates(this.x,this.y),f=i.selection[a](u.row,u.column);if(this.$clickSelection){var y=this.$clickSelection.comparePoint(f.start),b=this.$clickSelection.comparePoint(f.end);if(y==-1&&b<=0)s=this.$clickSelection.end,(f.end.row!=u.row||f.end.column!=u.column)&&(u=f.start);else if(b==1&&y>=0)s=this.$clickSelection.start,(f.start.row!=u.row||f.start.column!=u.column)&&(u=f.end);else if(y==-1&&b==1)u=f.end,s=f.start;else{var M=r(this.$clickSelection,u);u=M.cursor,s=M.anchor}i.selection.setSelectionAnchor(s.row,s.column)}i.selection.selectToPosition(u),i.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var a=d(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),s=Date.now();(a>g||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(a){var s=a.getDocumentPosition(),i=this.editor,u=i.session,f=u.getBracketRange(s);f?(f.isEmpty()&&(f.start.column--,f.end.column++),this.setState("select")):(f=i.selection.getWordRange(s.row,s.column),this.setState("selectByWords")),this.$clickSelection=f,this.select()},o.prototype.onTripleClick=function(a){var s=a.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var u=i.getSelectionRange();u.isMultiLine()&&u.contains(s.row,s.column)?(this.$clickSelection=i.selection.getLineRange(u.start.row),this.$clickSelection.end=i.selection.getLineRange(u.end.row).end):this.$clickSelection=i.selection.getLineRange(s.row),this.select()},o.prototype.onQuadClick=function(a){var s=this.editor;s.selectAll(),this.$clickSelection=s.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(a){if(!a.getAccelKey()){a.getShiftKey()&&a.wheelY&&!a.wheelX&&(a.wheelX=a.wheelY,a.wheelY=0);var s=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,u=a.domEvent.timeStamp,f=u-i.t,y=f?a.wheelX/f:i.vx,b=f?a.wheelY/f:i.vy;f<m&&(y=(y+i.vx)/2,b=(b+i.vy)/2);var M=Math.abs(y/b),$=!1;if(M>=1&&s.renderer.isScrollableBy(a.wheelX*a.speed,0)&&($=!0),M<=1&&s.renderer.isScrollableBy(0,a.wheelY*a.speed)&&($=!0),$)i.allowed=u;else if(u-i.allowed<m){var A=Math.abs(y)<=1.5*Math.abs(i.vx)&&Math.abs(b)<=1.5*Math.abs(i.vy);A?($=!0,i.allowed=u):i.allowed=0}if(i.t=u,i.vx=y,i.vy=b,$)return s.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()}},o})();c.prototype.selectEnd=c.prototype.selectByLinesEnd,c.prototype.selectAllEnd=c.prototype.selectByLinesEnd,c.prototype.selectByWordsEnd=c.prototype.selectByLinesEnd,n.DefaultHandlers=c;function d(o,a,s,i){return Math.sqrt(Math.pow(s-o,2)+Math.pow(i-a,2))}function r(o,a){if(o.start.row==o.end.row)var s=2*a.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var s=a.column-4;else var s=2*a.row-o.start.row-o.end.row;return s<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,p){n.preventParentScroll=function(g){g.stopPropagation();var m=g.currentTarget,c=m.scrollHeight>m.clientHeight;c||g.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,p){var h=this&&this.__extends||(function(){var u=function(f,y){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,M){b.__proto__=M}||function(b,M){for(var $ in M)Object.prototype.hasOwnProperty.call(M,$)&&(b[$]=M[$])},u(f,y)};return function(f,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");u(f,y);function b(){this.constructor=f}f.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),g=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,y=f&&u[f],b=0;if(y)return y.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&b>=u.length&&(u=void 0),{value:u&&u[b++],done:!u}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("./lib/dom");t("./lib/event");var c=t("./range").Range,d=t("./lib/scroll").preventParentScroll,r="ace_tooltip",o=(function(){function u(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}return u.prototype.$init=function(){return this.$element=m.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},u.prototype.getElement=function(){return this.$element||this.$init()},u.prototype.setText=function(f){this.getElement().textContent=f},u.prototype.setHtml=function(f){this.getElement().innerHTML=f},u.prototype.setPosition=function(f,y){this.getElement().style.left=f+"px",this.getElement().style.top=y+"px"},u.prototype.setClassName=function(f){m.addCssClass(this.getElement(),f)},u.prototype.setTheme=function(f){this.$element.className=r+" "+(f.isDark?"ace_dark ":"")+(f.cssClass||"")},u.prototype.show=function(f,y,b){f!=null&&this.setText(f),y!=null&&b!=null&&this.setPosition(y,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(f){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},u.prototype.getHeight=function(){return this.getElement().offsetHeight},u.prototype.getWidth=function(){return this.getElement().offsetWidth},u.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},u})(),a=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},u.prototype.removePopup=function(f){var y=this.popups.indexOf(f);y!==-1&&(this.popups.splice(y,1),this.updatePopups())},u.prototype.updatePopups=function(){var f,y,b,M;this.popups.sort(function(w,v){return v.priority-w.priority});var $=[];try{for(var A=g(this.popups),S=A.next();!S.done;S=A.next()){var E=S.value,R=!0;try{for(var L=(b=void 0,g($)),_=L.next();!_.done;_=L.next()){var D=_.value;if(this.doPopupsOverlap(D,E)){R=!1;break}}}catch(w){b={error:w}}finally{try{_&&!_.done&&(M=L.return)&&M.call(L)}finally{if(b)throw b.error}}R?$.push(E):E.hide()}}catch(w){f={error:w}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(f)throw f.error}}},u.prototype.doPopupsOverlap=function(f,y){var b=f.getElement().getBoundingClientRect(),M=y.getElement().getBoundingClientRect();return b.left<M.right&&b.right>M.left&&b.top<M.bottom&&b.bottom>M.top},u})(),s=new a;n.popupManager=s,n.Tooltip=o;var i=(function(u){h(f,u);function f(y){y===void 0&&(y=document.body);var b=u.call(this,y)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var M=b.getElement();return M.style.whiteSpace="pre-wrap",M.style.pointerEvents="auto",M.addEventListener("mouseout",b.onMouseOut),M.tabIndex=-1,M.addEventListener("blur",(function(){M.contains(document.activeElement)||this.hide()}).bind(b)),M.addEventListener("wheel",d),b}return f.prototype.addToEditor=function(y){y.on("mousemove",this.onMouseMove),y.on("mousedown",this.hide),y.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},f.prototype.removeFromEditor=function(y){y.off("mousemove",this.onMouseMove),y.off("mousedown",this.hide),y.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},f.prototype.onMouseMove=function(y,b){this.lastEvent=y,this.lastT=Date.now();var M=b.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||M||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||M||(this.lastEvent=y,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var y=Date.now()-this.lastT;if(this.idleTime-y>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-y);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},f.prototype.isOutsideOfText=function(y){var b=y.editor,M=y.getDocumentPosition(),$=b.session.getLine(M.row);if(M.column==$.length){var A=b.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=b.session.documentToScreenPosition(M.row,M.column);if(S.column!=A.column||S.row!=A.row)return!0}return!1},f.prototype.setDataProvider=function(y){this.$gatherData=y},f.prototype.showForRange=function(y,b,M,$){var A=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var S=y.renderer;this.isOpen||(s.addPopup(this),this.$registerCloseEvents(),this.setTheme(S.theme)),this.isOpen=!0,this.addMarker(b,y.session),this.range=c.fromPoints(b.start,b.end);var E=S.textToScreenCoordinates(b.start.row,b.start.column),R=S.scroller.getBoundingClientRect();E.pageX<R.left&&(E.pageX=R.left);var L=this.getElement();L.innerHTML="",L.appendChild(M),L.style.maxHeight="",L.style.display="block";var _=L.clientHeight,D=L.clientWidth,w=window.innerHeight-E.pageY-S.lineHeight,v=!0;E.pageY-_<0&&E.pageY<w&&(v=!1),L.style.maxHeight=(v?E.pageY:w)-A+"px",L.style.top=v?"":E.pageY+S.lineHeight+"px",L.style.bottom=v?window.innerHeight-E.pageY+"px":"",L.style.left=Math.min(E.pageX,window.innerWidth-D-A)+"px"}},f.prototype.addMarker=function(y,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(y,"ace_highlight-marker","text")},f.prototype.hide=function(y){!y&&document.activeElement==this.getElement()||y&&y.target&&(y.type!="keydown"||y.ctrlKey||y.metaKey)&&this.$element.contains(y.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,s.removePopup(this)))},f.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},f.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},f.prototype.onMouseOut=function(y){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!y.relatedTarget||this.getElement().contains(y.relatedTarget)||y&&y.currentTarget.contains(y.relatedTarget)||y.relatedTarget.classList.contains("ace_content")||this.hide())},f})(o);n.HoverTooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(t,n,p){var h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,y){f.__proto__=y}||function(f,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(f[b]=y[b])},s(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(i,u);function f(){this.constructor=i}i.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),g=this&&this.__values||function(s){var i=typeof Symbol=="function"&&Symbol.iterator,u=i&&s[i],f=0;if(u)return u.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&f>=s.length&&(s=void 0),{value:s&&s[f++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("../lib/dom"),c=t("../lib/event"),d=t("../tooltip").Tooltip,r=t("../config").nls;t("../lib/lang");function o(s){var i=s.editor,u=i.renderer.$gutterLayer,f=new a(i);s.editor.setDefaultHandler("guttermousedown",function(S){if(!(!i.isFocused()||S.getButton()!=0)){var E=u.getRegion(S);if(E!="foldWidgets"){var R=S.getDocumentPosition().row,L=i.session.selection;if(S.getShiftKey())L.selectTo(R,0);else{if(S.domEvent.detail==2)return i.selectAll(),S.preventDefault();s.$clickSelection=i.selection.getLineRange(R)}return s.setState("selectByLines"),s.captureMouse(S),S.preventDefault()}}});var y,b;function M(){var S=b.getDocumentPosition().row,E=i.session.getLength();if(S==E){var R=i.renderer.pixelToScreenCoordinates(0,b.y).row,L=b.$pos;if(R>i.session.documentToScreenRow(L.row,L.column))return $()}if(f.showTooltip(S),!!f.isOpen)if(i.on("mousewheel",$),s.$tooltipFollowsMouse)A(b);else{var _=b.getGutterRow(),D=u.$lines.get(_);if(D){var w=D.element.querySelector(".ace_gutter_annotation"),v=w.getBoundingClientRect(),C=f.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(b)}}function $(){y&&(y=clearTimeout(y)),f.isOpen&&(f.hideTooltip(),i.off("mousewheel",$))}function A(S){f.setPosition(S.x,S.y)}s.editor.setDefaultHandler("guttermousemove",function(S){var E=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass(E,"ace_fold-widget"))return $();f.isOpen&&s.$tooltipFollowsMouse&&A(S),b=S,!y&&(y=setTimeout(function(){y=null,b&&!s.isMousePressed?M():$()},50))}),c.addListener(i.renderer.$gutter,"mouseout",function(S){b=null,!(!f.isOpen||y)&&(y=setTimeout(function(){y=null,$()},50))},i),i.on("changeSession",$),i.on("input",$)}n.GutterHandler=o;var a=(function(s){h(i,s);function i(u){var f=s.call(this,u.container)||this;return f.editor=u,f}return i.prototype.setPosition=function(u,f){var y=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,M=this.getWidth(),$=this.getHeight();u+=15,f+=15,u+M>y&&(u-=u+M-y),f+$>b&&(f-=20+$),d.prototype.setPosition.call(this,u,f)},Object.defineProperty(i,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),i.prototype.showTooltip=function(u){var f,y=this.editor.renderer.$gutterLayer,b=y.$annotations[u],M;b?M={displayText:Array.from(b.displayText),type:Array.from(b.type)}:M={displayText:[],type:[]};var $=y.session.getFoldLine(u);if($&&y.$showFoldedAnnotations){for(var A={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},E,R=u+1;R<=$.end.row;R++)if(y.$annotations[R])for(var L=0;L<y.$annotations[R].text.length;L++){var _=y.$annotations[R].type[L];A[_].push(y.$annotations[R].text[L]),(!E||S[_]<S[E])&&(E=_)}if(["error","security","warning"].includes(E)){var D="".concat(i.annotationsToSummaryString(A)," in folded code.");M.displayText.push(D),M.type.push(E+"_fold")}}if(M.displayText.length===0)return this.hide();for(var w={error:[],security:[],warning:[],info:[],hint:[]},v=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=0;R<M.displayText.length;R++){var C=m.createElement("span"),x=m.createElement("span");(f=x.classList).add.apply(f,["ace_".concat(M.type[R]),v]),x.setAttribute("aria-label","".concat(i.annotationLabels[M.type[R].replace("_fold","")].singular)),x.setAttribute("role","img"),x.appendChild(m.createTextNode(" ")),C.appendChild(x),C.appendChild(m.createTextNode(M.displayText[R])),C.appendChild(m.createElement("br")),w[M.type[R].replace("_fold","")].push(C)}var T=this.getElement();m.removeChildren(T),w.error.forEach(function(k){return T.appendChild(k)}),w.security.forEach(function(k){return T.appendChild(k)}),w.warning.forEach(function(k){return T.appendChild(k)}),w.info.forEach(function(k){return T.appendChild(k)}),w.hint.forEach(function(k){return T.appendChild(k)}),T.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},i.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},i.annotationsToSummaryString=function(u){var f,y,b=[],M=["error","security","warning","info","hint"];try{for(var $=g(M),A=$.next();!A.done;A=$.next()){var S=A.value;if(u[S].length){var E=u[S].length===1?i.annotationLabels[S].singular:i.annotationLabels[S].plural;b.push("".concat(u[S].length," ").concat(E))}}}catch(R){f={error:R}}finally{try{A&&!A.done&&(y=$.return)&&y.call($)}finally{if(f)throw f.error}}return b.join(", ")},i})(d);n.GutterTooltip=a}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var h=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function c(d,r){this.speed,this.wheelX,this.wheelY,this.domEvent=d,this.editor=r,this.x=this.clientX=d.clientX,this.y=this.clientY=d.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return c.prototype.stopPropagation=function(){h.stopPropagation(this.domEvent),this.propagationStopped=!0},c.prototype.preventDefault=function(){h.preventDefault(this.domEvent),this.defaultPrevented=!0},c.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},c.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},c.prototype.getGutterRow=function(){var d=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(d,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-o},c.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var d=this.editor,r=d.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=r.contains(o.row,o.column)}return this.$inSelection},c.prototype.getButton=function(){return h.getButton(this.domEvent)},c.prototype.getShiftKey=function(){return this.domEvent.shiftKey},c.prototype.getAccelKey=function(){return g.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},c})();n.MouseEvent=m}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,p){var h=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),c=200,d=200,r=5;function o(s){var i=s.editor,u=h.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(F){s[F]=this[F]},this),i.on("mousedown",this.onMouseDown.bind(s));var y=i.container,b,M,$,A,S,E,R=0,L,_,D,w,v;this.onDragStart=function(F){if(this.cancelDrag||!y.draggable){var H=this;return setTimeout(function(){H.startSelect(),H.captureMouse(F)},0),F.preventDefault()}S=i.getSelectionRange();var z=F.dataTransfer;z.effectAllowed=i.getReadOnly()?"copy":"copyMove",i.container.appendChild(u),z.setDragImage&&z.setDragImage(u,0,0),setTimeout(function(){i.container.removeChild(u)}),z.clearData(),z.setData("Text",i.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,_=!1,this.setState(null),!i.getReadOnly()){var H=F.dataTransfer.dropEffect;!L&&H=="move"&&i.session.remove(i.getSelectionRange()),i.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return M=F.clientX,$=F.clientY,b||k(),R++,F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return M=F.clientX,$=F.clientY,b||(k(),R++),I!==null&&(I=null),F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragLeave=function(F){if(R--,R<=0&&b)return O(),L=null,g.preventDefault(F)},this.onDrop=function(F){if(E){var H=F.dataTransfer;if(_)switch(L){case"move":S.contains(E.row,E.column)?S={start:E,end:E}:S=i.moveText(S,E);break;case"copy":S=i.moveText(S,E,!0);break}else{var z=H.getData("Text");S={start:E,end:i.session.insert(E,z)},i.focus(),L=null}return O(),g.preventDefault(F)}},g.addListener(y,"dragstart",this.onDragStart.bind(s),i),g.addListener(y,"dragend",this.onDragEnd.bind(s),i),g.addListener(y,"dragenter",this.onDragEnter.bind(s),i),g.addListener(y,"dragover",this.onDragOver.bind(s),i),g.addListener(y,"dragleave",this.onDragLeave.bind(s),i),g.addListener(y,"drop",this.onDrop.bind(s),i);function C(F,H){var z=Date.now(),W=!H||F.row!=H.row,U=!H||F.column!=H.column;if(!w||W||U)i.moveCursorToPosition(F),w=z,v={x:M,y:$};else{var K=a(v.x,v.y,M,$);K>r?w=null:z-w>=d&&(i.renderer.scrollCursorIntoView(),w=null)}}function x(F,H){var z=Date.now(),W=i.renderer.layerConfig.lineHeight,U=i.renderer.layerConfig.characterWidth,K=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:M-K.left,right:K.right-M},y:{top:$-K.top,bottom:K.bottom-$}},G=Math.min(Y.x.left,Y.x.right),Q=Math.min(Y.y.top,Y.y.bottom),ue={row:F.row,column:F.column};G/U<=2&&(ue.column+=Y.x.left<Y.x.right?-3:2),Q/W<=1&&(ue.row+=Y.y.top<Y.y.bottom?-1:1);var Ee=F.row!=ue.row,Ce=F.column!=ue.column,he=!H||F.row!=H.row;Ee||Ce&&!he?D?z-D>=c&&i.renderer.scrollCursorIntoView(ue):D=z:D=null}function T(){var F=E;E=i.renderer.screenToTextCoordinates(M,$),C(E,F),x(E,F)}function k(){S=i.selection.toOrientedRange(),b=i.session.addMarker(S,"ace_selection",i.getSelectionStyle()),i.clearSelection(),i.isFocused()&&i.renderer.$cursorLayer.setBlinking(!1),clearInterval(A),T(),A=setInterval(T,20),R=0,g.addListener(document,"mousemove",N)}function O(){clearInterval(A),i.session.removeMarker(b),b=null,i.selection.fromOrientedRange(S),i.isFocused()&&!_&&i.$resetCursorStyle(),S=null,E=null,R=0,D=null,w=null,g.removeListener(document,"mousemove",N)}var I=null;function N(){I==null&&(I=setTimeout(function(){I!=null&&b&&O()},20))}function P(F){var H=F.types;return!H||Array.prototype.some.call(H,function(z){return z=="text/plain"||z=="Text"})}function B(F){var H=["copy","copymove","all","uninitialized"],z=["move","copymove","linkmove","all","uninitialized"],W=m.isMac?F.altKey:F.ctrlKey,U="uninitialized";try{U=F.dataTransfer.effectAllowed.toLowerCase()}catch{}var K="none";return W&&H.indexOf(U)>=0?K="copy":z.indexOf(U)>=0?K="move":H.indexOf(U)>=0&&(K="copy"),K}}(function(){this.dragWait=function(){var s=Date.now()-this.mousedownEvent.time;s>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var s=this.editor.container;s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(s){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var s=this.editor,i=s.container;i.draggable=!0,s.renderer.$cursorLayer.setBlinking(!1),s.setStyle("ace_dragging");var u=m.isWin?"default":"move";s.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(s){var i=this.editor.container;if(m.isIE&&this.state=="dragReady"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&i.dragDrop()}if(this.state==="dragWait"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(s){if(this.$dragEnabled){this.mousedownEvent=s;var i=this.editor,u=s.inSelection(),f=s.getButton(),y=s.domEvent.detail||1;if(y===1&&f===0&&u){if(s.editor.inMultiSelectMode&&(s.getAccelKey()||s.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=s.domEvent.target||s.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var M=i.container;M.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(s,this.onMouseDrag.bind(this)),s.defaultPrevented=!0}}}}).call(o.prototype);function a(s,i,u,f){return Math.sqrt(Math.pow(u-s,2)+Math.pow(f-i,2))}n.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,p){var h=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(c,d){var r="scroll",o,a,s,i,u,f,y=0,b,M=0,$=0,A=0,S,E;function R(){var C=window.navigator&&window.navigator.clipboard,x=!1,T=function(){var I=d.getCopyText(),N=d.session.getUndoManager().hasUndo();E.replaceChild(m.buildDom(x?["span",!I&&k("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],I&&k("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],I&&k("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&k("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],N&&k("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],k("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],k("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),E.firstChild)},k=function(I){return d.commands.canExecute(I,d)},O=function(I){var N=I.target.getAttribute("action");if(N=="more"||!x)return x=!x,T();N=="paste"?C.readText().then(function(P){d.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(d.getCopyText()):document.execCommand("copy")),d.execCommand(N)),E.firstChild.style.display="none",x=!1,N!="openCommandPalette"&&d.focus()};E=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){r="menu",I.stopPropagation(),I.preventDefault(),d.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),O(I)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],d.container)}function L(){if(!d.getOption("enableMobileMenu")){E&&_();return}E||R();var C=d.selection.cursor,x=d.renderer.textToScreenCoordinates(C.row,C.column),T=d.renderer.textToScreenCoordinates(0,0).pageX,k=d.renderer.scrollLeft,O=d.container.getBoundingClientRect();E.style.top=x.pageY-O.top-3+"px",x.pageX-O.left<O.width-70?(E.style.left="",E.style.right="10px"):(E.style.right="",E.style.left=T+k-O.left+"px"),E.style.display="",E.firstChild.style.display="none",d.on("input",_)}function _(C){E&&(E.style.display="none"),d.off("input",_)}function D(){u=null,clearTimeout(u);var C=d.selection.getRange(),x=C.contains(b.row,b.column);(C.isEmpty()||!x)&&(d.selection.moveToPosition(b),d.selection.selectWord()),r="wait",L()}function w(){u=null,clearTimeout(u),d.selection.moveToPosition(b);var C=M>=2?d.selection.getLineRange(b.row):d.session.getBracketRange(b);C&&!C.isEmpty()?d.selection.setRange(C):d.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var x=d.textInput.getElement();x.focus()}},d),g.addListener(c,"touchstart",function(C){var x=C.touches;if(u||x.length>1){clearTimeout(u),u=null,s=-1,r="zoom";return}S=d.$mouseHandler.isMousePressed=!0;var T=d.renderer.layerConfig.lineHeight,k=d.renderer.layerConfig.lineHeight,O=C.timeStamp;i=O;var I=x[0],N=I.clientX,P=I.clientY;Math.abs(o-N)+Math.abs(a-P)>T&&(s=-1),o=C.clientX=N,a=C.clientY=P,$=A=0;var B=new h(C,d);if(b=B.getDocumentPosition(),O-s<500&&x.length==1&&!y)M++,C.preventDefault(),C.button=0,w();else{M=0;var F=d.selection.cursor,H=d.selection.isEmpty()?F:d.selection.anchor,z=d.renderer.$cursorLayer.getPixelPosition(F,!0),W=d.renderer.$cursorLayer.getPixelPosition(H,!0),U=d.renderer.scroller.getBoundingClientRect(),K=d.renderer.layerConfig.offset,Y=d.renderer.scrollLeft,G=function(Ee,Ce){return Ee=Ee/k,Ce=Ce/T-.75,Ee*Ee+Ce*Ce};if(C.clientX<U.left){r="zoom";return}var Q=G(C.clientX-U.left-z.left+Y,C.clientY-U.top-z.top+K),ue=G(C.clientX-U.left-W.left+Y,C.clientY-U.top-W.top+K);Q<3.5&&ue<3.5&&(r=Q>ue?"cursor":"anchor"),ue<3.5?r="anchor":Q<3.5?r="cursor":r="scroll",u=setTimeout(D,450)}s=O},d),g.addListener(c,"touchend",function(C){S=d.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),r=="zoom"?(r="",y=0):u?(d.selection.moveToPosition(b),y=0,L()):r=="scroll"?(v(),_()):L(),clearTimeout(u),u=null},d),g.addListener(c,"touchmove",function(C){u&&(clearTimeout(u),u=null);var x=C.touches;if(!(x.length>1||r=="zoom")){var T=x[0],k=o-T.clientX,O=a-T.clientY;if(r=="wait")if(k*k+O*O>4)r="cursor";else return C.preventDefault();o=T.clientX,a=T.clientY,C.clientX=T.clientX,C.clientY=T.clientY;var I=C.timeStamp,N=I-i;if(i=I,r=="scroll"){var P=new h(C,d);P.speed=1,P.wheelX=k,P.wheelY=O,10*Math.abs(k)<Math.abs(O)&&(k=0),10*Math.abs(O)<Math.abs(k)&&(O=0),N!=0&&($=k/N,A=O/N),d._emit("mousewheel",P),P.propagationStopped||($=A=0)}else{var B=new h(C,d),F=B.getDocumentPosition();r=="cursor"?d.selection.moveCursorToPosition(F):r=="anchor"&&d.selection.setSelectionAnchor(F.row,F.column),d.renderer.scrollCursorIntoView(F),C.preventDefault()}}},d);function v(){y+=60,f=setInterval(function(){y--<=0&&(clearInterval(f),f=null),Math.abs($)<.01&&($=0),Math.abs(A)<.01&&(A=0),y<20&&($=.9*$),y<20&&(A=.9*A);var C=d.session.getScrollTop();d.renderer.scrollBy(10*$,10*A),C==d.session.getScrollTop()&&(y=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,p){var h=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,c=t("./default_gutter_handler").GutterHandler,d=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,o=t("./touch_handler").addTouchListeners,a=t("../config"),s=(function(){function i(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var f=this;this.editor=u,new m(this),new c(this),new r(this);var y=function($){var A=!document.hasFocus||!document.hasFocus()||!u.isFocused()&&document.activeElement==(u.textInput&&u.textInput.getElement());A&&window.focus(),u.focus(),setTimeout(function(){u.isFocused()||u.focus()})},b=u.renderer.getMouseEventTarget();h.addListener(b,"click",this.onMouseEvent.bind(this,"click"),u),h.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),h.addMultiMouseDownListener([b,u.renderer.scrollBarV&&u.renderer.scrollBarV.inner,u.renderer.scrollBarH&&u.renderer.scrollBarH.inner,u.textInput&&u.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",u),h.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),o(u.container,u);var M=u.renderer.$gutter;h.addListener(M,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),h.addListener(M,"click",this.onMouseEvent.bind(this,"gutterclick"),u),h.addListener(M,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),h.addListener(M,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),h.addListener(b,"mousedown",y,u),h.addListener(M,"mousedown",y,u),g.isIE&&u.renderer.scrollBarV&&(h.addListener(u.renderer.scrollBarV.element,"mousedown",y,u),h.addListener(u.renderer.scrollBarH.element,"mousedown",y,u)),u.on("mousemove",function($){if(!(f.state||f.$dragDelay||!f.$dragEnabled)){var A=u.renderer.screenToTextCoordinates($.x,$.y),S=u.session.selection.getRange(),E=u.renderer;!S.isEmpty()&&S.insideStart(A.row,A.column)?E.setCursorStyle("default"):E.setCursorStyle("")}},u)}return i.prototype.onMouseEvent=function(u,f){this.editor.session&&this.editor._emit(u,new d(f,this.editor))},i.prototype.onMouseMove=function(u,f){var y=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!y||!y.length||this.editor._emit(u,new d(f,this.editor))},i.prototype.onMouseWheel=function(u,f){var y=new d(f,this.editor);y.speed=this.$scrollSpeed*2,y.wheelX=f.wheelX,y.wheelY=f.wheelY,this.editor._emit(u,y)},i.prototype.setState=function(u){this.state=u},i.prototype.captureMouse=function(u,f){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var y=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var M=this,$=function(L){if(L){if(g.isWebKit&&!L.which&&M.releaseMouse)return M.releaseMouse();M.x=L.clientX,M.y=L.clientY,f&&f(L),M.mouseEvent=new d(L,M.editor),M.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",E),clearInterval(R),y.session&&S(),M[M.state+"End"]&&M[M.state+"End"](L),M.state="",M.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),M.$onCaptureMouseMove=M.releaseMouse=null,L&&M.onMouseEvent("mouseup",L),y.endOperation()},S=function(){M[M.state]&&M[M.state](),M.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var E=function(L){M.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(M[M.state+"End"]&&M[M.state+"End"](),M.state="",M.releaseMouse())};y.on("beforeEndOperation",E),y.startOperation({command:{name:"mouse"}}),M.$onCaptureMouseMove=$,M.releaseMouse=h.capture(this.editor.container,$,A);var R=setInterval(S,20)},i.prototype.cancelContextMenu=function(){var u=(function(f){f&&f.domEvent&&f.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),f&&f.domEvent&&h.stopEvent(f.domEvent))}).bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},i.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},i})();s.prototype.releaseMouse=null,a.defineOptions(s.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:g.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=s}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c){c.on("click",function(d){var r=d.getDocumentPosition(),o=c.session,a=o.getFoldAt(r.row,r.column,1);a&&(d.getAccelKey()?o.removeFold(a):o.expandFold(a),d.stop());var s=d.domEvent&&d.domEvent.target;s&&h.hasCssClass(s,"ace_inline_button")&&h.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),c.renderer.scrollCursorIntoView())}),c.on("gutterclick",function(d){var r=c.renderer.$gutterLayer.getRegion(d);if(r=="foldWidgets"){var o=d.getDocumentPosition().row,a=c.session;a.foldWidgets&&a.foldWidgets[o]&&c.session.onFoldWidgetClick(o,d),c.isFocused()||c.focus(),d.stop()}}),c.on("gutterdblclick",function(d){var r=c.renderer.$gutterLayer.getRegion(d);if(r=="foldWidgets"){var o=d.getDocumentPosition().row,a=c.session,s=a.getParentFoldRangeData(o,!0),i=s.range||s.firstRange;if(i){o=i.start.row;var u=a.getFoldAt(o,a.getLine(o).length,1);u?a.removeFold(u):(a.addFold("...",i),c.renderer.scrollCursorIntoView({row:i.start.row,column:0}))}d.stop()}})}return m})();n.FoldHandler=g}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,p){var h=t("../lib/keys"),g=t("../lib/event"),m=(function(){function c(d){this.$editor=d,this.$data={editor:d},this.$handlers=[],this.setDefaultHandler(d.commands)}return c.prototype.setDefaultHandler=function(d){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=d,this.addKeyboardHandler(d,0)},c.prototype.setKeyboardHandler=function(d){var r=this.$handlers;if(r[r.length-1]!=d){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(d,1)}},c.prototype.addKeyboardHandler=function(d,r){if(d){typeof d=="function"&&!d.handleKeyboard&&(d.handleKeyboard=d);var o=this.$handlers.indexOf(d);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(d):this.$handlers.splice(r,0,d),o==-1&&d.attach&&d.attach(this.$editor)}},c.prototype.removeKeyboardHandler=function(d){var r=this.$handlers.indexOf(d);return r==-1?!1:(this.$handlers.splice(r,1),d.detach&&d.detach(this.$editor),!0)},c.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},c.prototype.getStatusText=function(){var d=this.$data,r=d.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,d)||""}).filter(Boolean).join(" ")},c.prototype.$callKeyboardHandlers=function(d,r,o,a){for(var s,i=!1,u=this.$editor.commands,f=this.$handlers.length;f--&&(s=this.$handlers[f].handleKeyboard(this.$data,d,r,o,a),!(!(!s||!s.command)&&(s.command=="null"?i=!0:i=u.exec(s.command,this.$editor,s.args,a),i&&a&&d!=-1&&s.passEvent!=!0&&s.command.passEvent!=!0&&g.stopEvent(a),i))););return!i&&d==-1&&(s={command:"insertstring"},i=u.exec("insertstring",this.$editor,r)),i&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),i},c.prototype.onCommandKey=function(d,r,o){var a=h.keyCodeToString(o);return this.$callKeyboardHandlers(r,a,o,d)},c.prototype.onTextInput=function(d){return this.$callKeyboardHandlers(-1,d)},c})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,p){var h=0,g=0,m=!1,c=!1,d=!1,r=[[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]],o=[[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]],a=0,s=1,i=0,u=1,f=2,y=3,b=4,M=5,$=6,A=7,S=8,E=9,R=10,L=11,_=12,D=13,w=14,v=15,C=16,x=17,T=18,k=[T,T,T,T,T,T,T,T,T,$,M,$,S,M,T,T,T,T,T,T,T,T,T,T,T,T,T,T,M,M,M,$,S,b,b,L,L,L,b,b,b,b,b,R,E,R,E,E,f,f,f,f,f,f,f,f,f,f,E,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,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,E,b,L,L,L,L,b,b,b,b,i,b,b,T,b,b,L,L,f,f,b,i,b,b,b,f,i,b,b,b,b,b],O=[S,S,S,S,S,S,S,S,S,S,S,T,T,T,i,u,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S,M,D,w,v,C,x,E,L,L,L,L,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,E,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S];function I(F,H,z,W){var U=h?o:r,K=null,Y=null,G=null,Q=0,ue=null,Ee=null,Ce=-1,he=null,De=null,ht=[];if(!W)for(he=0,W=[];he<z;he++)W[he]=B(F[he]);for(g=h,m=!1,c=!1,d=!1,De=0;De<z;De++){if(K=Q,ht[De]=Y=P(F,W,ht,De),Q=U[K][Y],ue=Q&240,Q&=15,H[De]=G=U[Q][5],ue>0)if(ue==16){for(he=Ce;he<De;he++)H[he]=1;Ce=-1}else Ce=-1;if(Ee=U[Q][6],Ee)Ce==-1&&(Ce=De);else if(Ce>-1){for(he=Ce;he<De;he++)H[he]=G;Ce=-1}W[De]==M&&(H[De]=0),g|=G}if(d){for(he=0;he<z;he++)if(W[he]==$){H[he]=h;for(var dt=he-1;dt>=0&&W[dt]==S;dt--)H[dt]=h}}}function N(F,H,z){if(!(g<F)){if(F==1&&h==s&&!c){z.reverse();return}for(var W=z.length,U=0,K,Y,G,Q;U<W;){if(H[U]>=F){for(K=U+1;K<W&&H[K]>=F;)K++;for(Y=U,G=K-1;Y<G;Y++,G--)Q=z[Y],z[Y]=z[G],z[G]=Q;U=K}U++}}}function P(F,H,z,W){var U=H[W],K,Y,G,Q;switch(U){case i:case u:m=!1;case b:case y:return U;case f:return m?y:f;case A:return m=!0,u;case S:return b;case E:return W<1||W+1>=H.length||(K=z[W-1])!=f&&K!=y||(Y=H[W+1])!=f&&Y!=y?b:(m&&(Y=y),Y==K?Y:b);case R:return K=W>0?z[W-1]:M,K==f&&W+1<H.length&&H[W+1]==f?f:b;case L:if(W>0&&z[W-1]==f)return f;if(m)return b;for(Q=W+1,G=H.length;Q<G&&H[Q]==L;)Q++;return Q<G&&H[Q]==f?f:b;case _:for(G=H.length,Q=W+1;Q<G&&H[Q]==_;)Q++;if(Q<G){var ue=F[W],Ee=ue>=1425&&ue<=2303||ue==64286;if(K=H[Q],Ee&&(K==u||K==A))return u}return W<1||(K=H[W-1])==M?b:z[W-1];case M:return m=!1,c=!0,h;case $:return d=!0,b;case D:case w:case C:case x:case v:m=!1;case T:return b}}function B(F){var H=F.charCodeAt(0),z=H>>8;return z==0?H>191?i:k[H]:z==5?/[\u0591-\u05f4]/.test(F)?u:i:z==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?_:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:H==1642?L:/[\u06f0-\u06f9]/.test(F)?f:A:z==32&&H<=8287?O[H&255]:z==254&&H>=65136?A:b}n.L=i,n.R=u,n.EN=f,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(F,H,z){if(F.length<2)return{};var W=F.split(""),U=new Array(W.length),K=new Array(W.length),Y=[];h=z?s:a,I(W,Y,W.length,H);for(var G=0;G<U.length;U[G]=G,G++);N(2,Y,U),N(1,Y,U);for(var G=0;G<U.length-1;G++)H[G]===y?Y[G]=n.AN:Y[G]===u&&(H[G]>A&&H[G]<D||H[G]===b||H[G]===T)?Y[G]=n.ON_R:G>0&&W[G-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(W[G])&&(Y[G-1]=Y[G]=n.R_H,G++);W[W.length-1]===n.DOT&&(Y[W.length-1]=n.B),W[0]==="‫"&&(Y[0]=n.RLE);for(var G=0;G<U.length;G++)K[G]=Y[U[G]];return{logicalFromVisual:U,bidiLevels:K}},n.hasBidiCharacters=function(F,H){for(var z=!1,W=0;W<F.length;W++)H[W]=B(F.charAt(W)),!z&&(H[W]==u||H[W]==A||H[W]==y)&&(z=!0);return z},n.getVisualFromLogicalIdx=function(F,H){for(var z=0;z<H.logicalFromVisual.length;z++)if(H.logicalFromVisual[z]==F)return z;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,p){var h=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=(function(){function d(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=h,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=m.test(r.getValue())}return d.prototype.isBidiRow=function(r,o,a){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(o,a),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},d.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
1342
- `))&&(this.seenBidi=!0,this.currentRow=null)},d.prototype.getDocumentRow=function(){var r=0,o=this.session.$screenRowCache;if(o.length){var a=this.session.$getRowCacheIndex(o,this.currentRow);a>=0&&(r=this.session.$docRowCache[a])}return r},d.prototype.getSplitIndex=function(){var r=0,o=this.session.$screenRowCache;if(o.length)for(var a,s=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-r>0&&(a=this.session.$getRowCacheIndex(o,this.currentRow-r-1),a===s);)s=a,r++;else r=this.currentRow;return r},d.prototype.updateRowLine=function(r,o){r===void 0&&(r=this.getDocumentRow());var a=r===this.session.getLength()-1,s=a?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[r];i&&(o===void 0&&(o=this.getSplitIndex()),o>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[h.L],this.line=o<i.length?this.line.substring(i[o-1],i[o]):this.line.substring(i[i.length-1])):this.line=this.line.substring(0,i[o]),o==i.length&&(this.line+=this.showInvisibles?s:h.DOT))}else this.line+=this.showInvisibles?s:h.DOT;var u=this.session,f=0,y;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,M){return b===" "||u.isFullWidth(b.charCodeAt(0))?(y=b===" "?u.getScreenTabSize(M+f):2,f+=y-1,g.stringRepeat(h.DOT,y)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==h.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},d.prototype.updateBidiMap=function(){var r=[];h.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=h.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},d.prototype.markAsDirty=function(){this.currentRow=null},d.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var o=this.characterWidth=r.$characterSize.width,a=r.$measureCharWidth("ה");this.charWidths[h.L]=this.charWidths[h.EN]=this.charWidths[h.ON_R]=o,this.charWidths[h.R]=this.charWidths[h.AN]=a,this.charWidths[h.R_H]=a*.45,this.charWidths[h.B]=this.charWidths[h.RLE]=0,this.currentRow=null}},d.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},d.prototype.setEolChar=function(r){this.EOL=r},d.prototype.setContentWidth=function(r){this.contentWidth=r},d.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},d.prototype.setRtlDirection=function(r,o){for(var a=r.getCursorPosition(),s=r.selection.getSelectionAnchor().row;s<=a.row;s++)!o&&r.session.getLine(s).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(s,0,1):o&&r.session.getLine(s).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:s},r.session.$bidiHandler.RLE)},d.prototype.getPosLeft=function(r){r-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,a=r>o?this.session.getOverwrite()?r:r-1:o,s=h.getVisualFromLogicalIdx(a,this.bidiMap),i=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&r<=o&&i[s]%2!==0&&s++;for(var f=0;f<s;f++)u+=this.charWidths[i[f]];return!this.session.getOverwrite()&&r>o&&i[s]%2===0&&(u+=this.charWidths[i[s]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},d.prototype.getSelections=function(r,o){var a=this.bidiMap,s=a.bidiLevels,i,u=[],f=0,y=Math.min(r,o)-this.wrapIndent,b=Math.max(r,o)-this.wrapIndent,M=!1,$=!1,A=0;this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,E=0;E<s.length;E++)S=a.logicalFromVisual[E],i=s[E],M=S>=y&&S<b,M&&!$?A=f:!M&&$&&u.push({left:A,width:f-A}),f+=this.charWidths[i],$=M;if(M&&E===s.length&&u.push({left:A,width:f-A}),this.isRtlDir)for(var R=0;R<u.length;R++)u[R].left+=this.rtlLineOffset;return u},d.prototype.offsetToCol=function(a){this.isRtlDir&&(a-=this.rtlLineOffset);var o=0,a=Math.max(a,0),s=0,i=0,u=this.bidiMap.bidiLevels,f=this.charWidths[u[i]];for(this.wrapIndent&&(a-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);a>s+f/2;){if(s+=f,i===u.length-1){f=0;break}f=this.charWidths[u[++i]]}return i>0&&u[i-1]%2!==0&&u[i]%2===0?(a<s&&i--,o=this.bidiMap.logicalFromVisual[i]):i>0&&u[i-1]%2===0&&u[i]%2!==0?o=1+(a>s?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===u.length-1&&f===0&&u[i-1]%2===0||!this.isRtlDir&&i===0&&u[i]%2!==0?o=1+this.bidiMap.logicalFromVisual[i]:(i>0&&u[i-1]%2!==0&&f!==0&&i--,o=this.bidiMap.logicalFromVisual[i]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},d})();n.BidiHandler=c}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,d=(function(){function r(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var a=this;this.cursor.on("change",function(s){a.$cursorChanged=!0,a.$silent||a._emit("changeCursor"),!a.$isEmpty&&!a.$silent&&a._emit("changeSelection"),!a.$keepDesiredColumnOnChange&&s.old.column!=s.value.column&&(a.$desiredColumn=null)}),this.anchor.on("change",function(){a.$anchorChanged=!0,!a.$isEmpty&&!a.$silent&&a._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(o,a){this.$isEmpty=!1,this.anchor.setPosition(o,a)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var o=this.anchor,a=this.lead;return o.row>a.row||o.row==a.row&&o.column>a.column},r.prototype.getRange=function(){var o=this.anchor,a=this.lead;return this.$isEmpty?c.fromPoints(a,a):this.isBackwards()?c.fromPoints(a,o):c.fromPoints(o,a)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(o,a){var s=a?o.end:o.start,i=a?o.start:o.end;this.$setSelection(s.row,s.column,i.row,i.column)},r.prototype.$setSelection=function(o,a,s,i){if(!this.$silent){var u=this.$isEmpty,f=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,a),this.cursor.setPosition(s,i),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||f)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(o){var a=this.lead;this.$isEmpty&&this.setSelectionAnchor(a.row,a.column),o.call(this)},r.prototype.selectTo=function(o,a){this.$moveSelection(function(){this.moveCursorTo(o,a)})},r.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},r.prototype.moveTo=function(o,a){this.clearSelection(),this.moveCursorTo(o,a)},r.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(o,a){if(typeof a>"u"){var s=o||this.lead;o=s.row,a=s.column}return this.session.getWordRange(o,a)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var o=this.getCursor(),a=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(a)},r.prototype.getLineRange=function(o,a){var s=typeof o=="number"?o:this.lead.row,i,u=this.session.getFoldLine(s);return u?(s=u.start.row,i=u.end.row):i=s,a===!0?new c(s,0,i,this.session.getLine(i).length):new c(s,0,i+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(o,a,s){var i=o.column,u=o.column+a;return s<0&&(i=o.column-a,u=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(i,u).split(" ").length-1==a},r.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(a.start.row,a.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var s=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,s,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-s):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(a.end.row,a.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var s=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,s,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,s):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var o=this.lead.row,a=this.lead.column,s=this.session.documentToScreenRow(o,a),i=this.session.screenToDocumentPosition(s,0),u=this.session.getDisplayLine(o,null,i.row,i.column),f=u.match(/^\s*/);f[0].length!=a&&!this.session.$useEmacsStyleLineStart&&(i.column+=f[0].length),this.moveCursorToPosition(i)},r.prototype.moveCursorLineEnd=function(){var o=this.lead,a=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==a.column){var s=this.session.getLine(a.row);if(a.column==s.length){var i=s.search(/\s+$/);i>0&&(a.column=i)}}this.moveCursorTo(a.row,a.column)},r.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,a=this.doc.getLine(o).length;this.moveCursorTo(o,a)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(o,a,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(i)&&(a+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=s.substring(a)),a>=s.length){this.moveCursorTo(o,s.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(i)&&(a+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1)){this.moveCursorTo(s.start.row,s.start.column);return}var i=this.session.getFoldStringAt(o,a,-1);i==null&&(i=this.doc.getLine(o).substring(0,a));var u=g.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(a-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),a<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(a-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.$shortWordEndIndex=function(o){var a=0,s,i=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(o))a=this.session.tokenRe.lastIndex;else{for(;(s=o[a])&&i.test(s);)a++;if(a<1){for(u.lastIndex=0;(s=o[a])&&!u.test(s);)if(u.lastIndex=0,a++,i.test(s))if(a>2){a--;break}else{for(;(s=o[a])&&i.test(s);)a++;if(a>2)break}}}return u.lastIndex=0,a},r.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a),u=this.session.getFoldAt(o,a,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(a==s.length){var f=this.doc.getLength();do o++,i=this.doc.getLine(o);while(o<f&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),a=0}var y=this.$shortWordEndIndex(i);this.moveCursorTo(o,a+y)},r.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1))return this.moveCursorTo(s.start.row,s.start.column);var i=this.session.getLine(o).substring(0,a);if(a===0){do o--,i=this.doc.getLine(o);while(o>0&&/^\s*$/.test(i));a=i.length,/\s+$/.test(i)||(i="")}var u=g.stringReverse(i),f=this.$shortWordEndIndex(u);return this.moveCursorTo(o,a-f)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(o,a){var s=this.session.documentToScreenPosition(this.lead.row,this.lead.column),i;if(a===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(s.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(s.column),s.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=s.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?s.column=this.$desiredColumn:this.$desiredColumn=s.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var u=this.session.lineWidgets[this.lead.row];o<0?o-=u.rowsAbove||0:o>0&&(o+=u.rowCount-(u.rowsAbove||0))}var f=this.session.screenToDocumentPosition(s.row+o,s.column,i);o!==0&&a===0&&f.row===this.lead.row&&(f.column,this.lead.column),this.moveCursorTo(f.row,f.column+a,a===0)},r.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},r.prototype.moveCursorTo=function(o,a,s){var i=this.session.getFoldAt(o,a,1);i&&(o=i.start.row,a=i.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(u.charAt(a))&&u.charAt(a-1)&&(this.lead.row==o&&this.lead.column==a+1?a=a-1:a=a+1),this.lead.setPosition(o,a),this.$keepDesiredColumnOnChange=!1,s||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(o,a,s){var i=this.session.screenToDocumentPosition(o,a);this.moveCursorTo(i.row,i.column,s)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(o){var a=this.getRange();return o?(o.start.column=a.start.column,o.start.row=a.start.row,o.end.column=a.end.column,o.end.row=a.end.row):o=a,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},r.prototype.getRangeOfMovements=function(o){var a=this.getCursor();try{o(this);var s=this.getCursor();return c.fromPoints(a,s)}catch{return c.fromPoints(a,a)}finally{this.moveCursorToPosition(a)}},r.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(a){var s=a.clone();return s.isBackwards=a.cursor==a.start,s});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},r.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var a=o.length;a--;){var s=c.fromPoints(o[a].start,o[a].end);o[a].isBackwards&&(s.cursor=s.start),this.addRange(s,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},r.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var a=this.ranges.length;a--;)if(!this.ranges[a].isEqual(o[a]))return!1;return!0},r})();d.prototype.setSelectionAnchor=d.prototype.setAnchor,d.prototype.getSelectionAnchor=d.prototype.getAnchor,d.prototype.setSelectionRange=d.prototype.setRange,h.implement(d.prototype,m),n.Selection=d}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,p){var h=t("./lib/report_error").reportError,g=2e3,m=(function(){function c(d){this.splitRegex,this.states=d,this.regExps={},this.matchMappings={};for(var r in this.states){for(var o=this.states[r],a=[],s=0,i=this.matchMappings[r]={defaultToken:"text"},u="g",f=[],y=0;y<o.length;y++){var b=o[y];if(b.defaultToken&&(i.defaultToken=b.defaultToken),b.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),b.unicode&&u.indexOf("u")===-1&&(u+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var M=b.regex,$=new RegExp("(?:("+M+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||$==1?b.token=b.token[0]:$-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:$-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&($>1?b.onMatch=this.$applyToken:b.onMatch=b.token),$>1&&(/\\\d/.test(b.regex)?M=b.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+s+1)}):($=1,M=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&f.push(b)),i[s]=y,s+=$,a.push(M),b.onMatch||(b.onMatch=null)}}a.length||(i[0]=0,a.push("$")),f.forEach(function(A){A.splitRegex=this.createSplitterRegexp(A.regex,u)},this),this.regExps[r]=new RegExp("("+a.join(")|(")+")|($)",u)}}return c.prototype.$setMaxTokenCount=function(d){g=d|0},c.prototype.$applyToken=function(d){var r=this.splitRegex.exec(d).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:d}];for(var a=[],s=0,i=o.length;s<i;s++)r[s]&&(a[a.length]={type:o[s],value:r[s]});return a},c.prototype.$arrayTokens=function(d){if(!d)return[];var r=this.splitRegex.exec(d);if(!r)return"text";for(var o=[],a=this.tokenArray,s=0,i=a.length;s<i;s++)r[s+1]&&(o[o.length]={type:a[s],value:r[s+1]});return o},c.prototype.removeCapturingGroups=function(d){var r=d.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,a){return a?"(?:":o});return r},c.prototype.createSplitterRegexp=function(d,r){if(d.indexOf("(?=")!=-1){var o=0,a=!1,s={};d.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(i,u,f,y,b,M){return a?a=b!="]":b?a=!0:y?(o==s.stack&&(s.end=M+1,s.stack=-1),o--):f&&(o++,f.length!=1&&(s.stack=o,s.start=M)),i}),s.end!=null&&/^\)*$/.test(d.substr(s.end))&&(d=d.substring(0,s.start)+d.substr(s.end))}return d.charAt(0)!="^"&&(d="^"+d),d.charAt(d.length-1)!="$"&&(d+="$"),new RegExp(d,(r||"").replace("g",""))},c.prototype.getLineTokens=function(d,r){if(r&&typeof r!="string"){var o=r.slice(0);r=o[0],r==="#tmp"&&(o.shift(),r=o.shift())}else var o=[];var a=r||"start",s=this.states[a];s||(a="start",s=this.states[a]);var i=this.matchMappings[a],u=this.regExps[a];u.lastIndex=0;for(var f,y=[],b=0,M=0,$={type:null,value:""};f=u.exec(d);){var A=i.defaultToken,S=null,E=f[0],R=u.lastIndex;if(R-E.length>b){var L=d.substring(b,R-E.length);$.type==A?$.value+=L:($.type&&y.push($),$={type:A,value:L})}for(var _=0;_<f.length-2;_++)if(f[_+1]!==void 0){S=s[i[_]],S.onMatch?A=S.onMatch(E,a,o,d):A=S.token,S.next&&(typeof S.next=="string"?a=S.next:a=S.next(a,o),s=this.states[a],s||(this.reportError("state doesn't exist",a),a="start",s=this.states[a]),i=this.matchMappings[a],b=R,u=this.regExps[a],u.lastIndex=R),S.consumeLineEnd&&(b=R);break}if(E){if(typeof A=="string")(!S||S.merge!==!1)&&$.type===A?$.value+=E:($.type&&y.push($),$={type:A,value:E});else if(A){$.type&&y.push($),$={type:null,value:""};for(var _=0;_<A.length;_++)y.push(A[_])}}if(b==d.length)break;if(b=R,M++>g){for(M>2*d.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:d});b<d.length;)$.type&&y.push($),$={value:d.substring(b,b+=500),type:"overflow"};a="start",o=[];break}}return $.type&&y.push($),o.length>1&&o[0]!==a&&o.unshift("#tmp",a),{tokens:y,state:o.length?o:a}},c})();m.prototype.reportError=h,n.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){var h=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(d,r){if(!r){for(var o in d)this.$rules[o]=d[o];return}for(var o in d){for(var a=d[o],s=0;s<a.length;s++){var i=a[s];(i.next||i.onMatch)&&(typeof i.next=="string"&&i.next.indexOf(r)!==0&&(i.next=r+i.next),i.nextState&&i.nextState.indexOf(r)!==0&&(i.nextState=r+i.nextState))}this.$rules[r+o]=a}},this.getRules=function(){return this.$rules},this.embedRules=function(d,r,o,a,s){var i=typeof d=="function"?new d().getRules():d;if(a)for(var u=0;u<a.length;u++)a[u]=r+a[u];else{a=[];for(var f in i)a.push(r+f)}if(this.addRules(i,r),o)for(var y=Array.prototype[s?"push":"unshift"],u=0;u<a.length;u++)y.apply(this.$rules[a[u]],h(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var m=function(d,r){return(d!="start"||r.length)&&r.unshift(this.nextState,d),this.nextState},c=function(d,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var d=0,r=this.$rules;function o(a){var s=r[a];s.processed=!0;for(var i=0;i<s.length;i++){var u=s[i],f=null;Array.isArray(u)&&(f=u,u={}),!u.regex&&u.start&&(u.regex=u.start,u.next||(u.next=[]),u.next.push({defaultToken:u.token},{token:u.token+".end",regex:u.end||u.start,next:"pop"}),u.token=u.token+".start",u.push=!0);var y=u.next||u.push;if(y&&Array.isArray(y)){var b=u.stateName;b||(b=u.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=d++)),r[b]=y,u.next=b,o(b)}else y=="pop"&&(u.next=c);if(u.push&&(u.nextState=u.next||u.push,u.next=m,delete u.push),u.rules)for(var M in u.rules)r[M]?r[M].push&&r[M].push.apply(r[M],u.rules[M]):r[M]=u.rules[M];var $=typeof u=="string"?u:u.include;if($&&($==="$self"&&($="start"),Array.isArray($)?f=$.map(function(S){return r[S]}):f=r[$]),f){var A=[i,1].concat(f);u.noEscape&&(A=A.filter(function(S){return!S.next})),s.splice.apply(s,A),i--}u.keywordMap&&(u.token=this.createKeywordMapper(u.keywordMap,u.defaultToken||"text",u.caseInsensitive),delete u.defaultToken)}}Object.keys(r).forEach(o,this)},this.createKeywordMapper=function(d,r,o,a){var s=Object.create(null);return this.$keywordList=[],Object.keys(d).forEach(function(i){for(var u=d[i],f=u.split(a||"|"),y=f.length;y--;){var b=f[y];this.$keywordList.push(b),o&&(b=b.toLowerCase()),s[b]=i}},this),d=null,o?function(i){return s[i.toLowerCase()]||r}:function(i){return s[i]||r}},this.getKeywords=function(){return this.$keywords}}).call(g.prototype),n.TextHighlightRules=g}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,p){var h;h=function(){this.$behaviours={}},(function(){this.add=function(g,m,c){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[g]:this.$behaviours[g]={}}this.$behaviours[g][m]=c},this.addBehaviours=function(g){for(var m in g)for(var c in g[m])this.add(m,c,g[m][c])},this.remove=function(g){this.$behaviours&&this.$behaviours[g]&&delete this.$behaviours[g]},this.inherit=function(g,m){if(typeof g=="function")var c=new g().getBehaviours(m);else var c=g.getBehaviours(m);this.addBehaviours(c)},this.getBehaviours=function(g){if(g){for(var m={},c=0;c<g.length;c++)this.$behaviours[g[c]]&&(m[g[c]]=this.$behaviours[g[c]]);return m}else return this.$behaviours}}).call(h.prototype),n.Behaviour=h}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,p){var h=t("./range").Range,g=(function(){function m(c,d,r){this.$session=c,this.$row=d,this.$rowTokens=c.getTokens(d);var o=c.getTokenAt(d,r);this.$tokenIndex=o?o.index:-1}return m.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},m.prototype.stepForward=function(){this.$tokenIndex+=1;for(var c;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,c||(c=this.$session.getLength()),this.$row>=c)return this.$row=c-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentTokenRow=function(){return this.$row},m.prototype.getCurrentTokenColumn=function(){var c=this.$rowTokens,d=this.$tokenIndex,r=c[d].start;if(r!==void 0)return r;for(r=0;d>0;)d-=1,r+=c[d].value.length;return r},m.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},m.prototype.getCurrentTokenRange=function(){var c=this.$rowTokens[this.$tokenIndex],d=this.getCurrentTokenColumn();return new h(this.$row,d,this.$row,d+c.value.length)},m})();n.TokenIterator=g}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,p){var h=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,c=t("../../lib/lang"),d=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,a={},s={'"':'"',"'":"'"},i=function(y){var b=-1;if(y.multiSelect&&(b=y.selection.index,a.rangeCount!=y.multiSelect.rangeCount&&(a={rangeCount:y.multiSelect.rangeCount})),a[b])return o=a[b];o=a[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,b,M,$){var A=y.end.row-y.start.row;return{text:M+b+$,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},f;f=function(y){y=y||{},this.add("braces","insertion",function(b,M,$,A,S){var E=$.getCursorPosition(),R=A.doc.getLine(E.row);if(S=="{"){i($);var L=$.getSelectionRange(),_=A.doc.getTextRange(L),D=A.getTokenAt(E.row,E.column);if(_!==""&&_!=="{"&&$.getWrapBehavioursEnabled())return u(L,_,"{","}");if(D&&/(?:string)\.quasi|\.xml/.test(D.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(I){return I.test(D.type)})||/(string)\.quasi/.test(D.type)&&D.value[E.column-D.start-1]!=="$"?void 0:(f.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]})}else if(f.isSaneInsertion($,A))return/[\]\}\)]/.test(R[E.column])||$.inMultiSelectMode||y.braces?(f.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]}):(f.recordMaybeInsert($,A,"{"),{text:"{",selection:[1,1]})}else if(S=="}"){i($);var v=R.substring(E.column,E.column+1);if(v=="}"){var C=A.$findOpeningBracket("}",{column:E.column+1,row:E.row});if(C!==null&&f.isAutoInsertedClosing(E,R,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
1338
+ `;Te!=E&&($.value=E=Te,_=k=Te.length)}if(K&&(_=$.selectionStart,k=$.selectionEnd),k!=Z||_!=j||$.selectionEnd!=k)try{$.setSelectionRange(j,Z),_=j,k=Z}catch{}T=!1}};this.resetSelection=H,B&&S.onFocus();var z=function(j){return j.selectionStart===0&&j.selectionEnd>=E.length&&j.value===E&&E&&j.selectionEnd!==k},W=function(j){T||(R?R=!1:z($)?(S.selectAll(),H()):M&&$.selectionStart!=_&&H())},U=null;this.setInputHandler=function(j){U=j},this.getInputHandler=function(){return U};var K=!1,Y=function(j,Z){if(K&&(K=!1),L)return H(),j&&S.onPaste(j),L=!1,"";for(var ee=$.selectionStart,re=$.selectionEnd,ae=_,ge=E.length-k,ye=j,me=j.length-ee,de=j.length-re,le=0;ae>0&&E[le]==j[le];)le++,ae--;for(ye=ye.slice(le),le=1;ge>0&&E.length-le>_-1&&E[E.length-le]==j[j.length-le];)le++,ge--;me-=le-1,de-=le-1;var Te=ye.length-le+1;if(Te<0&&(ae=-Te,Te=0),ye=ye.slice(0,Te),!Z&&!ye&&!me&&!ae&&!ge&&!de)return"";D=!0;var Wt=!1;return m.isAndroid&&ye==". "&&(ye=" ",Wt=!0),ye&&!ae&&!ge&&!me&&!de||v?S.onTextInput(ye):S.onTextInput(ye,{extendLeft:ae,extendRight:ge,restoreStart:me,restoreEnd:de}),D=!1,E=j,_=ee,k=re,O=de,Wt?`
1339
+ `:ye},G=function(j){if(T)return dt();if(j&&j.inputType){if(j.inputType=="historyUndo")return S.execCommand("undo");if(j.inputType=="historyRedo")return S.execCommand("redo")}var Z=$.value,ee=Y(Z,!0);(Z.length>i+100||b.test(ee)||M&&_<1&&_==k)&&H()},J=function(j,Z,ee){var re=j.clipboardData||window.clipboardData;if(!(!re||o)){var ae=a||ee?"Text":"text/plain";try{return Z?re.setData(ae,Z)!==!1:re.getData(ae)}catch(ge){if(!ee)return J(ge,Z,!0)}}},ue=function(j,Z){var ee=S.getCopyText();if(!ee)return h.preventDefault(j);J(j,ee)?(y&&(H(ee),R=ee,setTimeout(function(){R=!1},10)),Z?S.onCut():S.onCopy(),h.preventDefault(j)):(R=!0,$.value=ee,$.select(),setTimeout(function(){R=!1,H(),Z?S.onCut():S.onCopy()}))},$e=function(j){ue(j,!0)},Ce=function(j){ue(j,!1)},he=function(j){var Z=J(j);r.pasteCancelled()||(typeof Z=="string"?(Z&&S.onPaste(Z,j),m.isIE&&setTimeout(H),h.preventDefault(j)):($.value="",L=!0))};h.addCommandKeyListener($,function(j,Z,ee){if(!T)return S.onCommandKey(j,Z,ee)},S),h.addListener($,"select",W,S),h.addListener($,"input",G,S),h.addListener($,"cut",$e,S),h.addListener($,"copy",Ce,S),h.addListener($,"paste",he,S),(!("oncut"in $)||!("oncopy"in $)||!("onpaste"in $))&&h.addListener(A,"keydown",function(j){if(!(m.isMac&&!j.metaKey||!j.ctrlKey))switch(j.keyCode){case 67:Ce(j);break;case 86:he(j);break;case 88:$e(j);break}},S);var De=function(j){if(!(T||!S.onCompositionStart||S.$readOnly)&&(T={},!v)){j.data&&(T.useTextareaForIME=!1),setTimeout(dt,0),S._signal("compositionStart"),S.on("mousedown",ti);var Z=S.getSelectionRange();Z.end.row=Z.start.row,Z.end.column=Z.start.column,T.markerRange=Z,T.selectionStart=_,S.onCompositionStart(T),T.useTextareaForIME?(E=$.value="",_=0,k=0):($.msGetInputContext&&(T.context=$.msGetInputContext()),$.getInputContext&&(T.context=$.getInputContext()))}},dt=function(){if(!(!T||!S.onCompositionUpdate||S.$readOnly)){if(v)return ti();if(T.useTextareaForIME)S.onCompositionUpdate($.value);else{var j=$.value;Y(j),T.markerRange&&(T.context&&(T.markerRange.start.column=T.selectionStart=T.context.compositionStartOffset),T.markerRange.end.column=T.markerRange.start.column+k-T.selectionStart+O)}}},ft=function(j){!S.onCompositionEnd||S.$readOnly||(T=!1,S.onCompositionEnd(),S.off("mousedown",ti),j&&G())};function ti(){C=!0,$.blur(),$.focus(),C=!1}var pa=f.delayedCall(dt,50).schedule.bind(null,null);function dd(j){j.keyCode==27&&$.value.length<$.selectionStart&&(T||(E=$.value),_=k=-1,H()),pa()}h.addListener($,"compositionstart",De,S),h.addListener($,"compositionupdate",dt,S),h.addListener($,"keyup",dd,S),h.addListener($,"keydown",pa,S),h.addListener($,"compositionend",ft,S),this.getElement=function(){return $},this.setCommandMode=function(j){v=j,$.readOnly=!1},this.setReadOnly=function(j){v||($.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){K=!0,H(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,Z){w||(w=$.style.cssText),$.style.cssText=(Z?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(_+k)*S.renderer.characterWidth*.5+"px;";var ee=S.container.getBoundingClientRect(),re=c.computedStyle(S.container),ae=ee.top+(parseInt(re.borderTopWidth)||0),ge=ee.left+(parseInt(ee.borderLeftWidth)||0),ye=ee.bottom-ae-$.clientHeight-2,me=function(de){c.translate($,de.clientX-ge-2,Math.min(de.clientY-ae-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(ni),m.isWin&&h.capture(S.container,me,hn))},this.onContextMenuClose=hn;var ni;function hn(){clearTimeout(ni),ni=setTimeout(function(){w&&($.style.cssText=w,w=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var ii=function(j){S.textInput.onContextMenu(j),hn()};h.addListener($,"mouseup",ii,S),h.addListener($,"mousedown",function(j){j.preventDefault(),hn()},S),h.addListener(S.renderer.scroller,"contextmenu",ii,S),h.addListener($,"contextmenu",ii,S),y&&fd(A,S,$);function fd(j,Z,ee){var re=null,ae=!1;ee.addEventListener("keydown",function(ye){re&&clearTimeout(re),ae=!0},!0),ee.addEventListener("keyup",function(ye){re=setTimeout(function(){ae=!1},100)},!0);var ge=function(ye){if(document.activeElement===ee&&!(ae||T||Z.$mouseHandler.isMousePressed)&&!R){var me=ee.selectionStart,de=ee.selectionEnd,le=null,Te=0;if(me==0?le=u.up:me==1?le=u.home:de>k&&E[de]==`
1340
+ `?le=u.end:me<_&&E[me-1]==" "?(le=u.left,Te=p.option):me<_||me==_&&k!=_&&me==de?le=u.left:de>k&&E.slice(0,de).split(`
1341
+ `).length>2?le=u.down:de>k&&E[de-1]==" "?(le=u.right,Te=p.option):(de>k||de==k&&k!=_&&me==de)&&(le=u.right),me!==de&&(Te|=p.shift),le){var Wt=Z.onCommandKey({},Te,le);if(!Wt&&Z.commands){le=u.keyCodeToString(le);var ga=Z.commands.findKeyCommand(Te,le);ga&&Z.execCommand(ga)}_=me,k=de,H("")}}};document.addEventListener("selectionchange",ge),Z.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){$.parentElement&&$.parentElement.removeChild($)}},n.TextInput=x,n.$setUserAgentForTests=function(A,S){M=A,y=S}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,d){var h=t("../lib/useragent"),g=0,m=550,c=(function(){function o(a){a.$clickSelection=null;var s=a.editor;s.setDefaultHandler("mousedown",this.onMouseDown.bind(a)),s.setDefaultHandler("dblclick",this.onDoubleClick.bind(a)),s.setDefaultHandler("tripleclick",this.onTripleClick.bind(a)),s.setDefaultHandler("quadclick",this.onQuadClick.bind(a)),s.setDefaultHandler("mousewheel",this.onMouseWheel.bind(a));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(u){a[u]=this[u]},this),a.selectByLines=this.extendSelectionBy.bind(a,"getLineRange"),a.selectByWords=this.extendSelectionBy.bind(a,"getWordRange")}return o.prototype.onMouseDown=function(a){var s=a.inSelection(),i=a.getDocumentPosition();this.mousedownEvent=a;var u=this.editor,p=a.getButton();if(p!==0){var y=u.getSelectionRange(),b=y.isEmpty();(b||p==1)&&u.selection.moveToPosition(i),p==2&&(u.textInput.onContextMenu(a.domEvent),h.isMozilla||a.preventDefault());return}if(this.mousedownEvent.time=Date.now(),s&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(a);return}return this.captureMouse(a),this.startSelect(i,a.domEvent._clicks>1),a.preventDefault()},o.prototype.startSelect=function(a,s){a=a||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(a):s||i.selection.moveToPosition(a),s||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var a,s=this.editor,i=s.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(i);if(u==-1)a=this.$clickSelection.end;else if(u==1)a=this.$clickSelection.start;else{var p=r(this.$clickSelection,i);i=p.cursor,a=p.anchor}s.selection.setSelectionAnchor(a.row,a.column)}s.selection.selectToPosition(i),s.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(a){var s,i=this.editor,u=i.renderer.screenToTextCoordinates(this.x,this.y),p=i.selection[a](u.row,u.column);if(this.$clickSelection){var y=this.$clickSelection.comparePoint(p.start),b=this.$clickSelection.comparePoint(p.end);if(y==-1&&b<=0)s=this.$clickSelection.end,(p.end.row!=u.row||p.end.column!=u.column)&&(u=p.start);else if(b==1&&y>=0)s=this.$clickSelection.start,(p.start.row!=u.row||p.start.column!=u.column)&&(u=p.end);else if(y==-1&&b==1)u=p.end,s=p.start;else{var M=r(this.$clickSelection,u);u=M.cursor,s=M.anchor}i.selection.setSelectionAnchor(s.row,s.column)}i.selection.selectToPosition(u),i.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var a=f(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),s=Date.now();(a>g||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(a){var s=a.getDocumentPosition(),i=this.editor,u=i.session,p=u.getBracketRange(s);p?(p.isEmpty()&&(p.start.column--,p.end.column++),this.setState("select")):(p=i.selection.getWordRange(s.row,s.column),this.setState("selectByWords")),this.$clickSelection=p,this.select()},o.prototype.onTripleClick=function(a){var s=a.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var u=i.getSelectionRange();u.isMultiLine()&&u.contains(s.row,s.column)?(this.$clickSelection=i.selection.getLineRange(u.start.row),this.$clickSelection.end=i.selection.getLineRange(u.end.row).end):this.$clickSelection=i.selection.getLineRange(s.row),this.select()},o.prototype.onQuadClick=function(a){var s=this.editor;s.selectAll(),this.$clickSelection=s.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(a){if(!a.getAccelKey()){a.getShiftKey()&&a.wheelY&&!a.wheelX&&(a.wheelX=a.wheelY,a.wheelY=0);var s=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,u=a.domEvent.timeStamp,p=u-i.t,y=p?a.wheelX/p:i.vx,b=p?a.wheelY/p:i.vy;p<m&&(y=(y+i.vx)/2,b=(b+i.vy)/2);var M=Math.abs(y/b),x=!1;if(M>=1&&s.renderer.isScrollableBy(a.wheelX*a.speed,0)&&(x=!0),M<=1&&s.renderer.isScrollableBy(0,a.wheelY*a.speed)&&(x=!0),x)i.allowed=u;else if(u-i.allowed<m){var A=Math.abs(y)<=1.5*Math.abs(i.vx)&&Math.abs(b)<=1.5*Math.abs(i.vy);A?(x=!0,i.allowed=u):i.allowed=0}if(i.t=u,i.vx=y,i.vy=b,x)return s.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()}},o})();c.prototype.selectEnd=c.prototype.selectByLinesEnd,c.prototype.selectAllEnd=c.prototype.selectByLinesEnd,c.prototype.selectByWordsEnd=c.prototype.selectByLinesEnd,n.DefaultHandlers=c;function f(o,a,s,i){return Math.sqrt(Math.pow(s-o,2)+Math.pow(i-a,2))}function r(o,a){if(o.start.row==o.end.row)var s=2*a.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var s=a.column-4;else var s=2*a.row-o.start.row-o.end.row;return s<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,d){n.preventParentScroll=function(g){g.stopPropagation();var m=g.currentTarget,c=m.scrollHeight>m.clientHeight;c||g.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,d){var h=this&&this.__extends||(function(){var u=function(p,y){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,M){b.__proto__=M}||function(b,M){for(var x in M)Object.prototype.hasOwnProperty.call(M,x)&&(b[x]=M[x])},u(p,y)};return function(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");u(p,y);function b(){this.constructor=p}p.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),g=this&&this.__values||function(u){var p=typeof Symbol=="function"&&Symbol.iterator,y=p&&u[p],b=0;if(y)return y.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&b>=u.length&&(u=void 0),{value:u&&u[b++],done:!u}}};throw new TypeError(p?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("./lib/dom");t("./lib/event");var c=t("./range").Range,f=t("./lib/scroll").preventParentScroll,r="ace_tooltip",o=(function(){function u(p){this.isOpen=!1,this.$element=null,this.$parentNode=p}return u.prototype.$init=function(){return this.$element=m.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},u.prototype.getElement=function(){return this.$element||this.$init()},u.prototype.setText=function(p){this.getElement().textContent=p},u.prototype.setHtml=function(p){this.getElement().innerHTML=p},u.prototype.setPosition=function(p,y){this.getElement().style.left=p+"px",this.getElement().style.top=y+"px"},u.prototype.setClassName=function(p){m.addCssClass(this.getElement(),p)},u.prototype.setTheme=function(p){this.$element.className=r+" "+(p.isDark?"ace_dark ":"")+(p.cssClass||"")},u.prototype.show=function(p,y,b){p!=null&&this.setText(p),y!=null&&b!=null&&this.setPosition(y,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(p){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},u.prototype.getHeight=function(){return this.getElement().offsetHeight},u.prototype.getWidth=function(){return this.getElement().offsetWidth},u.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},u})(),a=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(p){this.popups.push(p),this.updatePopups()},u.prototype.removePopup=function(p){var y=this.popups.indexOf(p);y!==-1&&(this.popups.splice(y,1),this.updatePopups())},u.prototype.updatePopups=function(){var p,y,b,M;this.popups.sort(function(w,v){return v.priority-w.priority});var x=[];try{for(var A=g(this.popups),S=A.next();!S.done;S=A.next()){var $=S.value,R=!0;try{for(var L=(b=void 0,g(x)),T=L.next();!T.done;T=L.next()){var D=T.value;if(this.doPopupsOverlap(D,$)){R=!1;break}}}catch(w){b={error:w}}finally{try{T&&!T.done&&(M=L.return)&&M.call(L)}finally{if(b)throw b.error}}R?x.push($):$.hide()}}catch(w){p={error:w}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(p)throw p.error}}},u.prototype.doPopupsOverlap=function(p,y){var b=p.getElement().getBoundingClientRect(),M=y.getElement().getBoundingClientRect();return b.left<M.right&&b.right>M.left&&b.top<M.bottom&&b.bottom>M.top},u})(),s=new a;n.popupManager=s,n.Tooltip=o;var i=(function(u){h(p,u);function p(y){y===void 0&&(y=document.body);var b=u.call(this,y)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var M=b.getElement();return M.style.whiteSpace="pre-wrap",M.style.pointerEvents="auto",M.addEventListener("mouseout",b.onMouseOut),M.tabIndex=-1,M.addEventListener("blur",(function(){M.contains(document.activeElement)||this.hide()}).bind(b)),M.addEventListener("wheel",f),b}return p.prototype.addToEditor=function(y){y.on("mousemove",this.onMouseMove),y.on("mousedown",this.hide),y.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},p.prototype.removeFromEditor=function(y){y.off("mousemove",this.onMouseMove),y.off("mousedown",this.hide),y.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},p.prototype.onMouseMove=function(y,b){this.lastEvent=y,this.lastT=Date.now();var M=b.$mouseHandler.isMousePressed;if(this.isOpen){var x=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(x.row,x.column)||M||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||M||(this.lastEvent=y,this.timeout=setTimeout(this.waitForHover,this.idleTime))},p.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var y=Date.now()-this.lastT;if(this.idleTime-y>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-y);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},p.prototype.isOutsideOfText=function(y){var b=y.editor,M=y.getDocumentPosition(),x=b.session.getLine(M.row);if(M.column==x.length){var A=b.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=b.session.documentToScreenPosition(M.row,M.column);if(S.column!=A.column||S.row!=A.row)return!0}return!1},p.prototype.setDataProvider=function(y){this.$gatherData=y},p.prototype.showForRange=function(y,b,M,x){var A=10;if(!(x&&x!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var S=y.renderer;this.isOpen||(s.addPopup(this),this.$registerCloseEvents(),this.setTheme(S.theme)),this.isOpen=!0,this.addMarker(b,y.session),this.range=c.fromPoints(b.start,b.end);var $=S.textToScreenCoordinates(b.start.row,b.start.column),R=S.scroller.getBoundingClientRect();$.pageX<R.left&&($.pageX=R.left);var L=this.getElement();L.innerHTML="",L.appendChild(M),L.style.maxHeight="",L.style.display="block";var T=L.clientHeight,D=L.clientWidth,w=window.innerHeight-$.pageY-S.lineHeight,v=!0;$.pageY-T<0&&$.pageY<w&&(v=!1),L.style.maxHeight=(v?$.pageY:w)-A+"px",L.style.top=v?"":$.pageY+S.lineHeight+"px",L.style.bottom=v?window.innerHeight-$.pageY+"px":"",L.style.left=Math.min($.pageX,window.innerWidth-D-A)+"px"}},p.prototype.addMarker=function(y,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(y,"ace_highlight-marker","text")},p.prototype.hide=function(y){!y&&document.activeElement==this.getElement()||y&&y.target&&(y.type!="keydown"||y.ctrlKey||y.metaKey)&&this.$element.contains(y.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,s.removePopup(this)))},p.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},p.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},p.prototype.onMouseOut=function(y){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!y.relatedTarget||this.getElement().contains(y.relatedTarget)||y&&y.currentTarget.contains(y.relatedTarget)||y.relatedTarget.classList.contains("ace_content")||this.hide())},p})(o);n.HoverTooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(t,n,d){var h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(p[b]=y[b])},s(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(i,u);function p(){this.constructor=i}i.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}})(),g=this&&this.__values||function(s){var i=typeof Symbol=="function"&&Symbol.iterator,u=i&&s[i],p=0;if(u)return u.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&p>=s.length&&(s=void 0),{value:s&&s[p++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("../lib/dom"),c=t("../lib/event"),f=t("../tooltip").Tooltip,r=t("../config").nls;t("../lib/lang");function o(s){var i=s.editor,u=i.renderer.$gutterLayer,p=new a(i);s.editor.setDefaultHandler("guttermousedown",function(S){if(!(!i.isFocused()||S.getButton()!=0)){var $=u.getRegion(S);if($!="foldWidgets"){var R=S.getDocumentPosition().row,L=i.session.selection;if(S.getShiftKey())L.selectTo(R,0);else{if(S.domEvent.detail==2)return i.selectAll(),S.preventDefault();s.$clickSelection=i.selection.getLineRange(R)}return s.setState("selectByLines"),s.captureMouse(S),S.preventDefault()}}});var y,b;function M(){var S=b.getDocumentPosition().row,$=i.session.getLength();if(S==$){var R=i.renderer.pixelToScreenCoordinates(0,b.y).row,L=b.$pos;if(R>i.session.documentToScreenRow(L.row,L.column))return x()}if(p.showTooltip(S),!!p.isOpen)if(i.on("mousewheel",x),s.$tooltipFollowsMouse)A(b);else{var T=b.getGutterRow(),D=u.$lines.get(T);if(D){var w=D.element.querySelector(".ace_gutter_annotation"),v=w.getBoundingClientRect(),C=p.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(b)}}function x(){y&&(y=clearTimeout(y)),p.isOpen&&(p.hideTooltip(),i.off("mousewheel",x))}function A(S){p.setPosition(S.x,S.y)}s.editor.setDefaultHandler("guttermousemove",function(S){var $=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass($,"ace_fold-widget"))return x();p.isOpen&&s.$tooltipFollowsMouse&&A(S),b=S,!y&&(y=setTimeout(function(){y=null,b&&!s.isMousePressed?M():x()},50))}),c.addListener(i.renderer.$gutter,"mouseout",function(S){b=null,!(!p.isOpen||y)&&(y=setTimeout(function(){y=null,x()},50))},i),i.on("changeSession",x),i.on("input",x)}n.GutterHandler=o;var a=(function(s){h(i,s);function i(u){var p=s.call(this,u.container)||this;return p.editor=u,p}return i.prototype.setPosition=function(u,p){var y=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,M=this.getWidth(),x=this.getHeight();u+=15,p+=15,u+M>y&&(u-=u+M-y),p+x>b&&(p-=20+x),f.prototype.setPosition.call(this,u,p)},Object.defineProperty(i,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),i.prototype.showTooltip=function(u){var p,y=this.editor.renderer.$gutterLayer,b=y.$annotations[u],M;b?M={displayText:Array.from(b.displayText),type:Array.from(b.type)}:M={displayText:[],type:[]};var x=y.session.getFoldLine(u);if(x&&y.$showFoldedAnnotations){for(var A={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},$,R=u+1;R<=x.end.row;R++)if(y.$annotations[R])for(var L=0;L<y.$annotations[R].text.length;L++){var T=y.$annotations[R].type[L];A[T].push(y.$annotations[R].text[L]),(!$||S[T]<S[$])&&($=T)}if(["error","security","warning"].includes($)){var D="".concat(i.annotationsToSummaryString(A)," in folded code.");M.displayText.push(D),M.type.push($+"_fold")}}if(M.displayText.length===0)return this.hide();for(var w={error:[],security:[],warning:[],info:[],hint:[]},v=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=0;R<M.displayText.length;R++){var C=m.createElement("span"),E=m.createElement("span");(p=E.classList).add.apply(p,["ace_".concat(M.type[R]),v]),E.setAttribute("aria-label","".concat(i.annotationLabels[M.type[R].replace("_fold","")].singular)),E.setAttribute("role","img"),E.appendChild(m.createTextNode(" ")),C.appendChild(E),C.appendChild(m.createTextNode(M.displayText[R])),C.appendChild(m.createElement("br")),w[M.type[R].replace("_fold","")].push(C)}var _=this.getElement();m.removeChildren(_),w.error.forEach(function(k){return _.appendChild(k)}),w.security.forEach(function(k){return _.appendChild(k)}),w.warning.forEach(function(k){return _.appendChild(k)}),w.info.forEach(function(k){return _.appendChild(k)}),w.hint.forEach(function(k){return _.appendChild(k)}),_.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},i.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},i.annotationsToSummaryString=function(u){var p,y,b=[],M=["error","security","warning","info","hint"];try{for(var x=g(M),A=x.next();!A.done;A=x.next()){var S=A.value;if(u[S].length){var $=u[S].length===1?i.annotationLabels[S].singular:i.annotationLabels[S].plural;b.push("".concat(u[S].length," ").concat($))}}}catch(R){p={error:R}}finally{try{A&&!A.done&&(y=x.return)&&y.call(x)}finally{if(p)throw p.error}}return b.join(", ")},i})(f);n.GutterTooltip=a}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,d){var h=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function c(f,r){this.speed,this.wheelX,this.wheelY,this.domEvent=f,this.editor=r,this.x=this.clientX=f.clientX,this.y=this.clientY=f.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return c.prototype.stopPropagation=function(){h.stopPropagation(this.domEvent),this.propagationStopped=!0},c.prototype.preventDefault=function(){h.preventDefault(this.domEvent),this.defaultPrevented=!0},c.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},c.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},c.prototype.getGutterRow=function(){var f=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(f,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-o},c.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var f=this.editor,r=f.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=r.contains(o.row,o.column)}return this.$inSelection},c.prototype.getButton=function(){return h.getButton(this.domEvent)},c.prototype.getShiftKey=function(){return this.domEvent.shiftKey},c.prototype.getAccelKey=function(){return g.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},c})();n.MouseEvent=m}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,d){var h=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),c=200,f=200,r=5;function o(s){var i=s.editor,u=h.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var p=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];p.forEach(function(F){s[F]=this[F]},this),i.on("mousedown",this.onMouseDown.bind(s));var y=i.container,b,M,x,A,S,$,R=0,L,T,D,w,v;this.onDragStart=function(F){if(this.cancelDrag||!y.draggable){var H=this;return setTimeout(function(){H.startSelect(),H.captureMouse(F)},0),F.preventDefault()}S=i.getSelectionRange();var z=F.dataTransfer;z.effectAllowed=i.getReadOnly()?"copy":"copyMove",i.container.appendChild(u),z.setDragImage&&z.setDragImage(u,0,0),setTimeout(function(){i.container.removeChild(u)}),z.clearData(),z.setData("Text",i.session.getTextRange()),T=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,T=!1,this.setState(null),!i.getReadOnly()){var H=F.dataTransfer.dropEffect;!L&&H=="move"&&i.session.remove(i.getSelectionRange()),i.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return M=F.clientX,x=F.clientY,b||k(),R++,F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return M=F.clientX,x=F.clientY,b||(k(),R++),I!==null&&(I=null),F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragLeave=function(F){if(R--,R<=0&&b)return O(),L=null,g.preventDefault(F)},this.onDrop=function(F){if($){var H=F.dataTransfer;if(T)switch(L){case"move":S.contains($.row,$.column)?S={start:$,end:$}:S=i.moveText(S,$);break;case"copy":S=i.moveText(S,$,!0);break}else{var z=H.getData("Text");S={start:$,end:i.session.insert($,z)},i.focus(),L=null}return O(),g.preventDefault(F)}},g.addListener(y,"dragstart",this.onDragStart.bind(s),i),g.addListener(y,"dragend",this.onDragEnd.bind(s),i),g.addListener(y,"dragenter",this.onDragEnter.bind(s),i),g.addListener(y,"dragover",this.onDragOver.bind(s),i),g.addListener(y,"dragleave",this.onDragLeave.bind(s),i),g.addListener(y,"drop",this.onDrop.bind(s),i);function C(F,H){var z=Date.now(),W=!H||F.row!=H.row,U=!H||F.column!=H.column;if(!w||W||U)i.moveCursorToPosition(F),w=z,v={x:M,y:x};else{var K=a(v.x,v.y,M,x);K>r?w=null:z-w>=f&&(i.renderer.scrollCursorIntoView(),w=null)}}function E(F,H){var z=Date.now(),W=i.renderer.layerConfig.lineHeight,U=i.renderer.layerConfig.characterWidth,K=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:M-K.left,right:K.right-M},y:{top:x-K.top,bottom:K.bottom-x}},G=Math.min(Y.x.left,Y.x.right),J=Math.min(Y.y.top,Y.y.bottom),ue={row:F.row,column:F.column};G/U<=2&&(ue.column+=Y.x.left<Y.x.right?-3:2),J/W<=1&&(ue.row+=Y.y.top<Y.y.bottom?-1:1);var $e=F.row!=ue.row,Ce=F.column!=ue.column,he=!H||F.row!=H.row;$e||Ce&&!he?D?z-D>=c&&i.renderer.scrollCursorIntoView(ue):D=z:D=null}function _(){var F=$;$=i.renderer.screenToTextCoordinates(M,x),C($,F),E($,F)}function k(){S=i.selection.toOrientedRange(),b=i.session.addMarker(S,"ace_selection",i.getSelectionStyle()),i.clearSelection(),i.isFocused()&&i.renderer.$cursorLayer.setBlinking(!1),clearInterval(A),_(),A=setInterval(_,20),R=0,g.addListener(document,"mousemove",N)}function O(){clearInterval(A),i.session.removeMarker(b),b=null,i.selection.fromOrientedRange(S),i.isFocused()&&!T&&i.$resetCursorStyle(),S=null,$=null,R=0,D=null,w=null,g.removeListener(document,"mousemove",N)}var I=null;function N(){I==null&&(I=setTimeout(function(){I!=null&&b&&O()},20))}function P(F){var H=F.types;return!H||Array.prototype.some.call(H,function(z){return z=="text/plain"||z=="Text"})}function B(F){var H=["copy","copymove","all","uninitialized"],z=["move","copymove","linkmove","all","uninitialized"],W=m.isMac?F.altKey:F.ctrlKey,U="uninitialized";try{U=F.dataTransfer.effectAllowed.toLowerCase()}catch{}var K="none";return W&&H.indexOf(U)>=0?K="copy":z.indexOf(U)>=0?K="move":H.indexOf(U)>=0&&(K="copy"),K}}(function(){this.dragWait=function(){var s=Date.now()-this.mousedownEvent.time;s>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var s=this.editor.container;s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(s){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var s=this.editor,i=s.container;i.draggable=!0,s.renderer.$cursorLayer.setBlinking(!1),s.setStyle("ace_dragging");var u=m.isWin?"default":"move";s.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(s){var i=this.editor.container;if(m.isIE&&this.state=="dragReady"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&i.dragDrop()}if(this.state==="dragWait"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(s){if(this.$dragEnabled){this.mousedownEvent=s;var i=this.editor,u=s.inSelection(),p=s.getButton(),y=s.domEvent.detail||1;if(y===1&&p===0&&u){if(s.editor.inMultiSelectMode&&(s.getAccelKey()||s.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=s.domEvent.target||s.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var M=i.container;M.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(s,this.onMouseDrag.bind(this)),s.defaultPrevented=!0}}}}).call(o.prototype);function a(s,i,u,p){return Math.sqrt(Math.pow(u-s,2)+Math.pow(p-i,2))}n.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,d){var h=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(c,f){var r="scroll",o,a,s,i,u,p,y=0,b,M=0,x=0,A=0,S,$;function R(){var C=window.navigator&&window.navigator.clipboard,E=!1,_=function(){var I=f.getCopyText(),N=f.session.getUndoManager().hasUndo();$.replaceChild(m.buildDom(E?["span",!I&&k("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],I&&k("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],I&&k("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&k("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],N&&k("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],k("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],k("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),$.firstChild)},k=function(I){return f.commands.canExecute(I,f)},O=function(I){var N=I.target.getAttribute("action");if(N=="more"||!E)return E=!E,_();N=="paste"?C.readText().then(function(P){f.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(f.getCopyText()):document.execCommand("copy")),f.execCommand(N)),$.firstChild.style.display="none",E=!1,N!="openCommandPalette"&&f.focus()};$=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){r="menu",I.stopPropagation(),I.preventDefault(),f.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),O(I)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],f.container)}function L(){if(!f.getOption("enableMobileMenu")){$&&T();return}$||R();var C=f.selection.cursor,E=f.renderer.textToScreenCoordinates(C.row,C.column),_=f.renderer.textToScreenCoordinates(0,0).pageX,k=f.renderer.scrollLeft,O=f.container.getBoundingClientRect();$.style.top=E.pageY-O.top-3+"px",E.pageX-O.left<O.width-70?($.style.left="",$.style.right="10px"):($.style.right="",$.style.left=_+k-O.left+"px"),$.style.display="",$.firstChild.style.display="none",f.on("input",T)}function T(C){$&&($.style.display="none"),f.off("input",T)}function D(){u=null,clearTimeout(u);var C=f.selection.getRange(),E=C.contains(b.row,b.column);(C.isEmpty()||!E)&&(f.selection.moveToPosition(b),f.selection.selectWord()),r="wait",L()}function w(){u=null,clearTimeout(u),f.selection.moveToPosition(b);var C=M>=2?f.selection.getLineRange(b.row):f.session.getBracketRange(b);C&&!C.isEmpty()?f.selection.setRange(C):f.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var E=f.textInput.getElement();E.focus()}},f),g.addListener(c,"touchstart",function(C){var E=C.touches;if(u||E.length>1){clearTimeout(u),u=null,s=-1,r="zoom";return}S=f.$mouseHandler.isMousePressed=!0;var _=f.renderer.layerConfig.lineHeight,k=f.renderer.layerConfig.lineHeight,O=C.timeStamp;i=O;var I=E[0],N=I.clientX,P=I.clientY;Math.abs(o-N)+Math.abs(a-P)>_&&(s=-1),o=C.clientX=N,a=C.clientY=P,x=A=0;var B=new h(C,f);if(b=B.getDocumentPosition(),O-s<500&&E.length==1&&!y)M++,C.preventDefault(),C.button=0,w();else{M=0;var F=f.selection.cursor,H=f.selection.isEmpty()?F:f.selection.anchor,z=f.renderer.$cursorLayer.getPixelPosition(F,!0),W=f.renderer.$cursorLayer.getPixelPosition(H,!0),U=f.renderer.scroller.getBoundingClientRect(),K=f.renderer.layerConfig.offset,Y=f.renderer.scrollLeft,G=function($e,Ce){return $e=$e/k,Ce=Ce/_-.75,$e*$e+Ce*Ce};if(C.clientX<U.left){r="zoom";return}var J=G(C.clientX-U.left-z.left+Y,C.clientY-U.top-z.top+K),ue=G(C.clientX-U.left-W.left+Y,C.clientY-U.top-W.top+K);J<3.5&&ue<3.5&&(r=J>ue?"cursor":"anchor"),ue<3.5?r="anchor":J<3.5?r="cursor":r="scroll",u=setTimeout(D,450)}s=O},f),g.addListener(c,"touchend",function(C){S=f.$mouseHandler.isMousePressed=!1,p&&clearInterval(p),r=="zoom"?(r="",y=0):u?(f.selection.moveToPosition(b),y=0,L()):r=="scroll"?(v(),T()):L(),clearTimeout(u),u=null},f),g.addListener(c,"touchmove",function(C){u&&(clearTimeout(u),u=null);var E=C.touches;if(!(E.length>1||r=="zoom")){var _=E[0],k=o-_.clientX,O=a-_.clientY;if(r=="wait")if(k*k+O*O>4)r="cursor";else return C.preventDefault();o=_.clientX,a=_.clientY,C.clientX=_.clientX,C.clientY=_.clientY;var I=C.timeStamp,N=I-i;if(i=I,r=="scroll"){var P=new h(C,f);P.speed=1,P.wheelX=k,P.wheelY=O,10*Math.abs(k)<Math.abs(O)&&(k=0),10*Math.abs(O)<Math.abs(k)&&(O=0),N!=0&&(x=k/N,A=O/N),f._emit("mousewheel",P),P.propagationStopped||(x=A=0)}else{var B=new h(C,f),F=B.getDocumentPosition();r=="cursor"?f.selection.moveCursorToPosition(F):r=="anchor"&&f.selection.setSelectionAnchor(F.row,F.column),f.renderer.scrollCursorIntoView(F),C.preventDefault()}}},f);function v(){y+=60,p=setInterval(function(){y--<=0&&(clearInterval(p),p=null),Math.abs(x)<.01&&(x=0),Math.abs(A)<.01&&(A=0),y<20&&(x=.9*x),y<20&&(A=.9*A);var C=f.session.getScrollTop();f.renderer.scrollBy(10*x,10*A),C==f.session.getScrollTop()&&(y=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,d){var h=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,c=t("./default_gutter_handler").GutterHandler,f=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,o=t("./touch_handler").addTouchListeners,a=t("../config"),s=(function(){function i(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var p=this;this.editor=u,new m(this),new c(this),new r(this);var y=function(x){var A=!document.hasFocus||!document.hasFocus()||!u.isFocused()&&document.activeElement==(u.textInput&&u.textInput.getElement());A&&window.focus(),u.focus(),setTimeout(function(){u.isFocused()||u.focus()})},b=u.renderer.getMouseEventTarget();h.addListener(b,"click",this.onMouseEvent.bind(this,"click"),u),h.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),h.addMultiMouseDownListener([b,u.renderer.scrollBarV&&u.renderer.scrollBarV.inner,u.renderer.scrollBarH&&u.renderer.scrollBarH.inner,u.textInput&&u.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",u),h.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),o(u.container,u);var M=u.renderer.$gutter;h.addListener(M,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),h.addListener(M,"click",this.onMouseEvent.bind(this,"gutterclick"),u),h.addListener(M,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),h.addListener(M,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),h.addListener(b,"mousedown",y,u),h.addListener(M,"mousedown",y,u),g.isIE&&u.renderer.scrollBarV&&(h.addListener(u.renderer.scrollBarV.element,"mousedown",y,u),h.addListener(u.renderer.scrollBarH.element,"mousedown",y,u)),u.on("mousemove",function(x){if(!(p.state||p.$dragDelay||!p.$dragEnabled)){var A=u.renderer.screenToTextCoordinates(x.x,x.y),S=u.session.selection.getRange(),$=u.renderer;!S.isEmpty()&&S.insideStart(A.row,A.column)?$.setCursorStyle("default"):$.setCursorStyle("")}},u)}return i.prototype.onMouseEvent=function(u,p){this.editor.session&&this.editor._emit(u,new f(p,this.editor))},i.prototype.onMouseMove=function(u,p){var y=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!y||!y.length||this.editor._emit(u,new f(p,this.editor))},i.prototype.onMouseWheel=function(u,p){var y=new f(p,this.editor);y.speed=this.$scrollSpeed*2,y.wheelX=p.wheelX,y.wheelY=p.wheelY,this.editor._emit(u,y)},i.prototype.setState=function(u){this.state=u},i.prototype.captureMouse=function(u,p){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var y=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var M=this,x=function(L){if(L){if(g.isWebKit&&!L.which&&M.releaseMouse)return M.releaseMouse();M.x=L.clientX,M.y=L.clientY,p&&p(L),M.mouseEvent=new f(L,M.editor),M.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",$),clearInterval(R),y.session&&S(),M[M.state+"End"]&&M[M.state+"End"](L),M.state="",M.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),M.$onCaptureMouseMove=M.releaseMouse=null,L&&M.onMouseEvent("mouseup",L),y.endOperation()},S=function(){M[M.state]&&M[M.state](),M.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var $=function(L){M.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(M[M.state+"End"]&&M[M.state+"End"](),M.state="",M.releaseMouse())};y.on("beforeEndOperation",$),y.startOperation({command:{name:"mouse"}}),M.$onCaptureMouseMove=x,M.releaseMouse=h.capture(this.editor.container,x,A);var R=setInterval(S,20)},i.prototype.cancelContextMenu=function(){var u=(function(p){p&&p.domEvent&&p.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),p&&p.domEvent&&h.stopEvent(p.domEvent))}).bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},i.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},i})();s.prototype.releaseMouse=null,a.defineOptions(s.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:g.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=s}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,d){var h=t("../lib/dom"),g=(function(){function m(c){c.on("click",function(f){var r=f.getDocumentPosition(),o=c.session,a=o.getFoldAt(r.row,r.column,1);a&&(f.getAccelKey()?o.removeFold(a):o.expandFold(a),f.stop());var s=f.domEvent&&f.domEvent.target;s&&h.hasCssClass(s,"ace_inline_button")&&h.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),c.renderer.scrollCursorIntoView())}),c.on("gutterclick",function(f){var r=c.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,a=c.session;a.foldWidgets&&a.foldWidgets[o]&&c.session.onFoldWidgetClick(o,f),c.isFocused()||c.focus(),f.stop()}}),c.on("gutterdblclick",function(f){var r=c.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,a=c.session,s=a.getParentFoldRangeData(o,!0),i=s.range||s.firstRange;if(i){o=i.start.row;var u=a.getFoldAt(o,a.getLine(o).length,1);u?a.removeFold(u):(a.addFold("...",i),c.renderer.scrollCursorIntoView({row:i.start.row,column:0}))}f.stop()}})}return m})();n.FoldHandler=g}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,d){var h=t("../lib/keys"),g=t("../lib/event"),m=(function(){function c(f){this.$editor=f,this.$data={editor:f},this.$handlers=[],this.setDefaultHandler(f.commands)}return c.prototype.setDefaultHandler=function(f){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=f,this.addKeyboardHandler(f,0)},c.prototype.setKeyboardHandler=function(f){var r=this.$handlers;if(r[r.length-1]!=f){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(f,1)}},c.prototype.addKeyboardHandler=function(f,r){if(f){typeof f=="function"&&!f.handleKeyboard&&(f.handleKeyboard=f);var o=this.$handlers.indexOf(f);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(f):this.$handlers.splice(r,0,f),o==-1&&f.attach&&f.attach(this.$editor)}},c.prototype.removeKeyboardHandler=function(f){var r=this.$handlers.indexOf(f);return r==-1?!1:(this.$handlers.splice(r,1),f.detach&&f.detach(this.$editor),!0)},c.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},c.prototype.getStatusText=function(){var f=this.$data,r=f.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,f)||""}).filter(Boolean).join(" ")},c.prototype.$callKeyboardHandlers=function(f,r,o,a){for(var s,i=!1,u=this.$editor.commands,p=this.$handlers.length;p--&&(s=this.$handlers[p].handleKeyboard(this.$data,f,r,o,a),!(!(!s||!s.command)&&(s.command=="null"?i=!0:i=u.exec(s.command,this.$editor,s.args,a),i&&a&&f!=-1&&s.passEvent!=!0&&s.command.passEvent!=!0&&g.stopEvent(a),i))););return!i&&f==-1&&(s={command:"insertstring"},i=u.exec("insertstring",this.$editor,r)),i&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),i},c.prototype.onCommandKey=function(f,r,o){var a=h.keyCodeToString(o);return this.$callKeyboardHandlers(r,a,o,f)},c.prototype.onTextInput=function(f){return this.$callKeyboardHandlers(-1,f)},c})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,d){var h=0,g=0,m=!1,c=!1,f=!1,r=[[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]],o=[[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]],a=0,s=1,i=0,u=1,p=2,y=3,b=4,M=5,x=6,A=7,S=8,$=9,R=10,L=11,T=12,D=13,w=14,v=15,C=16,E=17,_=18,k=[_,_,_,_,_,_,_,_,_,x,M,x,S,M,_,_,_,_,_,_,_,_,_,_,_,_,_,_,M,M,M,x,S,b,b,L,L,L,b,b,b,b,b,R,$,R,$,$,p,p,p,p,p,p,p,p,p,p,$,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,_,_,_,_,_,_,M,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,$,b,L,L,L,L,b,b,b,b,i,b,b,_,b,b,L,L,p,p,b,i,b,b,b,p,i,b,b,b,b,b],O=[S,S,S,S,S,S,S,S,S,S,S,_,_,_,i,u,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S,M,D,w,v,C,E,$,L,L,L,L,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,$,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S];function I(F,H,z,W){var U=h?o:r,K=null,Y=null,G=null,J=0,ue=null,$e=null,Ce=-1,he=null,De=null,dt=[];if(!W)for(he=0,W=[];he<z;he++)W[he]=B(F[he]);for(g=h,m=!1,c=!1,f=!1,De=0;De<z;De++){if(K=J,dt[De]=Y=P(F,W,dt,De),J=U[K][Y],ue=J&240,J&=15,H[De]=G=U[J][5],ue>0)if(ue==16){for(he=Ce;he<De;he++)H[he]=1;Ce=-1}else Ce=-1;if($e=U[J][6],$e)Ce==-1&&(Ce=De);else if(Ce>-1){for(he=Ce;he<De;he++)H[he]=G;Ce=-1}W[De]==M&&(H[De]=0),g|=G}if(f){for(he=0;he<z;he++)if(W[he]==x){H[he]=h;for(var ft=he-1;ft>=0&&W[ft]==S;ft--)H[ft]=h}}}function N(F,H,z){if(!(g<F)){if(F==1&&h==s&&!c){z.reverse();return}for(var W=z.length,U=0,K,Y,G,J;U<W;){if(H[U]>=F){for(K=U+1;K<W&&H[K]>=F;)K++;for(Y=U,G=K-1;Y<G;Y++,G--)J=z[Y],z[Y]=z[G],z[G]=J;U=K}U++}}}function P(F,H,z,W){var U=H[W],K,Y,G,J;switch(U){case i:case u:m=!1;case b:case y:return U;case p:return m?y:p;case A:return m=!0,u;case S:return b;case $:return W<1||W+1>=H.length||(K=z[W-1])!=p&&K!=y||(Y=H[W+1])!=p&&Y!=y?b:(m&&(Y=y),Y==K?Y:b);case R:return K=W>0?z[W-1]:M,K==p&&W+1<H.length&&H[W+1]==p?p:b;case L:if(W>0&&z[W-1]==p)return p;if(m)return b;for(J=W+1,G=H.length;J<G&&H[J]==L;)J++;return J<G&&H[J]==p?p:b;case T:for(G=H.length,J=W+1;J<G&&H[J]==T;)J++;if(J<G){var ue=F[W],$e=ue>=1425&&ue<=2303||ue==64286;if(K=H[J],$e&&(K==u||K==A))return u}return W<1||(K=H[W-1])==M?b:z[W-1];case M:return m=!1,c=!0,h;case x:return f=!0,b;case D:case w:case C:case E:case v:m=!1;case _:return b}}function B(F){var H=F.charCodeAt(0),z=H>>8;return z==0?H>191?i:k[H]:z==5?/[\u0591-\u05f4]/.test(F)?u:i:z==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?T:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:H==1642?L:/[\u06f0-\u06f9]/.test(F)?p:A:z==32&&H<=8287?O[H&255]:z==254&&H>=65136?A:b}n.L=i,n.R=u,n.EN=p,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(F,H,z){if(F.length<2)return{};var W=F.split(""),U=new Array(W.length),K=new Array(W.length),Y=[];h=z?s:a,I(W,Y,W.length,H);for(var G=0;G<U.length;U[G]=G,G++);N(2,Y,U),N(1,Y,U);for(var G=0;G<U.length-1;G++)H[G]===y?Y[G]=n.AN:Y[G]===u&&(H[G]>A&&H[G]<D||H[G]===b||H[G]===_)?Y[G]=n.ON_R:G>0&&W[G-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(W[G])&&(Y[G-1]=Y[G]=n.R_H,G++);W[W.length-1]===n.DOT&&(Y[W.length-1]=n.B),W[0]==="‫"&&(Y[0]=n.RLE);for(var G=0;G<U.length;G++)K[G]=Y[U[G]];return{logicalFromVisual:U,bidiLevels:K}},n.hasBidiCharacters=function(F,H){for(var z=!1,W=0;W<F.length;W++)H[W]=B(F.charAt(W)),!z&&(H[W]==u||H[W]==A||H[W]==y)&&(z=!0);return z},n.getVisualFromLogicalIdx=function(F,H){for(var z=0;z<H.logicalFromVisual.length;z++)if(H.logicalFromVisual[z]==F)return z;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,d){var h=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=(function(){function f(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=h,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=m.test(r.getValue())}return f.prototype.isBidiRow=function(r,o,a){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(o,a),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},f.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
1342
+ `))&&(this.seenBidi=!0,this.currentRow=null)},f.prototype.getDocumentRow=function(){var r=0,o=this.session.$screenRowCache;if(o.length){var a=this.session.$getRowCacheIndex(o,this.currentRow);a>=0&&(r=this.session.$docRowCache[a])}return r},f.prototype.getSplitIndex=function(){var r=0,o=this.session.$screenRowCache;if(o.length)for(var a,s=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-r>0&&(a=this.session.$getRowCacheIndex(o,this.currentRow-r-1),a===s);)s=a,r++;else r=this.currentRow;return r},f.prototype.updateRowLine=function(r,o){r===void 0&&(r=this.getDocumentRow());var a=r===this.session.getLength()-1,s=a?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[r];i&&(o===void 0&&(o=this.getSplitIndex()),o>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[h.L],this.line=o<i.length?this.line.substring(i[o-1],i[o]):this.line.substring(i[i.length-1])):this.line=this.line.substring(0,i[o]),o==i.length&&(this.line+=this.showInvisibles?s:h.DOT))}else this.line+=this.showInvisibles?s:h.DOT;var u=this.session,p=0,y;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,M){return b===" "||u.isFullWidth(b.charCodeAt(0))?(y=b===" "?u.getScreenTabSize(M+p):2,p+=y-1,g.stringRepeat(h.DOT,y)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==h.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},f.prototype.updateBidiMap=function(){var r=[];h.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=h.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},f.prototype.markAsDirty=function(){this.currentRow=null},f.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var o=this.characterWidth=r.$characterSize.width,a=r.$measureCharWidth("ה");this.charWidths[h.L]=this.charWidths[h.EN]=this.charWidths[h.ON_R]=o,this.charWidths[h.R]=this.charWidths[h.AN]=a,this.charWidths[h.R_H]=a*.45,this.charWidths[h.B]=this.charWidths[h.RLE]=0,this.currentRow=null}},f.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},f.prototype.setEolChar=function(r){this.EOL=r},f.prototype.setContentWidth=function(r){this.contentWidth=r},f.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},f.prototype.setRtlDirection=function(r,o){for(var a=r.getCursorPosition(),s=r.selection.getSelectionAnchor().row;s<=a.row;s++)!o&&r.session.getLine(s).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(s,0,1):o&&r.session.getLine(s).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:s},r.session.$bidiHandler.RLE)},f.prototype.getPosLeft=function(r){r-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,a=r>o?this.session.getOverwrite()?r:r-1:o,s=h.getVisualFromLogicalIdx(a,this.bidiMap),i=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&r<=o&&i[s]%2!==0&&s++;for(var p=0;p<s;p++)u+=this.charWidths[i[p]];return!this.session.getOverwrite()&&r>o&&i[s]%2===0&&(u+=this.charWidths[i[s]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},f.prototype.getSelections=function(r,o){var a=this.bidiMap,s=a.bidiLevels,i,u=[],p=0,y=Math.min(r,o)-this.wrapIndent,b=Math.max(r,o)-this.wrapIndent,M=!1,x=!1,A=0;this.wrapIndent&&(p+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,$=0;$<s.length;$++)S=a.logicalFromVisual[$],i=s[$],M=S>=y&&S<b,M&&!x?A=p:!M&&x&&u.push({left:A,width:p-A}),p+=this.charWidths[i],x=M;if(M&&$===s.length&&u.push({left:A,width:p-A}),this.isRtlDir)for(var R=0;R<u.length;R++)u[R].left+=this.rtlLineOffset;return u},f.prototype.offsetToCol=function(a){this.isRtlDir&&(a-=this.rtlLineOffset);var o=0,a=Math.max(a,0),s=0,i=0,u=this.bidiMap.bidiLevels,p=this.charWidths[u[i]];for(this.wrapIndent&&(a-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);a>s+p/2;){if(s+=p,i===u.length-1){p=0;break}p=this.charWidths[u[++i]]}return i>0&&u[i-1]%2!==0&&u[i]%2===0?(a<s&&i--,o=this.bidiMap.logicalFromVisual[i]):i>0&&u[i-1]%2===0&&u[i]%2!==0?o=1+(a>s?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===u.length-1&&p===0&&u[i-1]%2===0||!this.isRtlDir&&i===0&&u[i]%2!==0?o=1+this.bidiMap.logicalFromVisual[i]:(i>0&&u[i-1]%2!==0&&p!==0&&i--,o=this.bidiMap.logicalFromVisual[i]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},f})();n.BidiHandler=c}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,d){var h=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,f=(function(){function r(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var a=this;this.cursor.on("change",function(s){a.$cursorChanged=!0,a.$silent||a._emit("changeCursor"),!a.$isEmpty&&!a.$silent&&a._emit("changeSelection"),!a.$keepDesiredColumnOnChange&&s.old.column!=s.value.column&&(a.$desiredColumn=null)}),this.anchor.on("change",function(){a.$anchorChanged=!0,!a.$isEmpty&&!a.$silent&&a._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(o,a){this.$isEmpty=!1,this.anchor.setPosition(o,a)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var o=this.anchor,a=this.lead;return o.row>a.row||o.row==a.row&&o.column>a.column},r.prototype.getRange=function(){var o=this.anchor,a=this.lead;return this.$isEmpty?c.fromPoints(a,a):this.isBackwards()?c.fromPoints(a,o):c.fromPoints(o,a)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(o,a){var s=a?o.end:o.start,i=a?o.start:o.end;this.$setSelection(s.row,s.column,i.row,i.column)},r.prototype.$setSelection=function(o,a,s,i){if(!this.$silent){var u=this.$isEmpty,p=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,a),this.cursor.setPosition(s,i),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||p)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(o){var a=this.lead;this.$isEmpty&&this.setSelectionAnchor(a.row,a.column),o.call(this)},r.prototype.selectTo=function(o,a){this.$moveSelection(function(){this.moveCursorTo(o,a)})},r.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},r.prototype.moveTo=function(o,a){this.clearSelection(),this.moveCursorTo(o,a)},r.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(o,a){if(typeof a>"u"){var s=o||this.lead;o=s.row,a=s.column}return this.session.getWordRange(o,a)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var o=this.getCursor(),a=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(a)},r.prototype.getLineRange=function(o,a){var s=typeof o=="number"?o:this.lead.row,i,u=this.session.getFoldLine(s);return u?(s=u.start.row,i=u.end.row):i=s,a===!0?new c(s,0,i,this.session.getLine(i).length):new c(s,0,i+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(o,a,s){var i=o.column,u=o.column+a;return s<0&&(i=o.column-a,u=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(i,u).split(" ").length-1==a},r.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(a.start.row,a.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var s=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,s,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-s):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(a.end.row,a.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var s=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,s,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,s):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var o=this.lead.row,a=this.lead.column,s=this.session.documentToScreenRow(o,a),i=this.session.screenToDocumentPosition(s,0),u=this.session.getDisplayLine(o,null,i.row,i.column),p=u.match(/^\s*/);p[0].length!=a&&!this.session.$useEmacsStyleLineStart&&(i.column+=p[0].length),this.moveCursorToPosition(i)},r.prototype.moveCursorLineEnd=function(){var o=this.lead,a=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==a.column){var s=this.session.getLine(a.row);if(a.column==s.length){var i=s.search(/\s+$/);i>0&&(a.column=i)}}this.moveCursorTo(a.row,a.column)},r.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,a=this.doc.getLine(o).length;this.moveCursorTo(o,a)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(o,a,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(i)&&(a+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=s.substring(a)),a>=s.length){this.moveCursorTo(o,s.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(i)&&(a+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1)){this.moveCursorTo(s.start.row,s.start.column);return}var i=this.session.getFoldStringAt(o,a,-1);i==null&&(i=this.doc.getLine(o).substring(0,a));var u=g.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(a-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),a<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(a-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.$shortWordEndIndex=function(o){var a=0,s,i=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(o))a=this.session.tokenRe.lastIndex;else{for(;(s=o[a])&&i.test(s);)a++;if(a<1){for(u.lastIndex=0;(s=o[a])&&!u.test(s);)if(u.lastIndex=0,a++,i.test(s))if(a>2){a--;break}else{for(;(s=o[a])&&i.test(s);)a++;if(a>2)break}}}return u.lastIndex=0,a},r.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a),u=this.session.getFoldAt(o,a,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(a==s.length){var p=this.doc.getLength();do o++,i=this.doc.getLine(o);while(o<p&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),a=0}var y=this.$shortWordEndIndex(i);this.moveCursorTo(o,a+y)},r.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1))return this.moveCursorTo(s.start.row,s.start.column);var i=this.session.getLine(o).substring(0,a);if(a===0){do o--,i=this.doc.getLine(o);while(o>0&&/^\s*$/.test(i));a=i.length,/\s+$/.test(i)||(i="")}var u=g.stringReverse(i),p=this.$shortWordEndIndex(u);return this.moveCursorTo(o,a-p)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(o,a){var s=this.session.documentToScreenPosition(this.lead.row,this.lead.column),i;if(a===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(s.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(s.column),s.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=s.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?s.column=this.$desiredColumn:this.$desiredColumn=s.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var u=this.session.lineWidgets[this.lead.row];o<0?o-=u.rowsAbove||0:o>0&&(o+=u.rowCount-(u.rowsAbove||0))}var p=this.session.screenToDocumentPosition(s.row+o,s.column,i);o!==0&&a===0&&p.row===this.lead.row&&(p.column,this.lead.column),this.moveCursorTo(p.row,p.column+a,a===0)},r.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},r.prototype.moveCursorTo=function(o,a,s){var i=this.session.getFoldAt(o,a,1);i&&(o=i.start.row,a=i.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(u.charAt(a))&&u.charAt(a-1)&&(this.lead.row==o&&this.lead.column==a+1?a=a-1:a=a+1),this.lead.setPosition(o,a),this.$keepDesiredColumnOnChange=!1,s||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(o,a,s){var i=this.session.screenToDocumentPosition(o,a);this.moveCursorTo(i.row,i.column,s)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(o){var a=this.getRange();return o?(o.start.column=a.start.column,o.start.row=a.start.row,o.end.column=a.end.column,o.end.row=a.end.row):o=a,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},r.prototype.getRangeOfMovements=function(o){var a=this.getCursor();try{o(this);var s=this.getCursor();return c.fromPoints(a,s)}catch{return c.fromPoints(a,a)}finally{this.moveCursorToPosition(a)}},r.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(a){var s=a.clone();return s.isBackwards=a.cursor==a.start,s});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},r.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var a=o.length;a--;){var s=c.fromPoints(o[a].start,o[a].end);o[a].isBackwards&&(s.cursor=s.start),this.addRange(s,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},r.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var a=this.ranges.length;a--;)if(!this.ranges[a].isEqual(o[a]))return!1;return!0},r})();f.prototype.setSelectionAnchor=f.prototype.setAnchor,f.prototype.getSelectionAnchor=f.prototype.getAnchor,f.prototype.setSelectionRange=f.prototype.setRange,h.implement(f.prototype,m),n.Selection=f}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,d){var h=t("./lib/report_error").reportError,g=2e3,m=(function(){function c(f){this.splitRegex,this.states=f,this.regExps={},this.matchMappings={};for(var r in this.states){for(var o=this.states[r],a=[],s=0,i=this.matchMappings[r]={defaultToken:"text"},u="g",p=[],y=0;y<o.length;y++){var b=o[y];if(b.defaultToken&&(i.defaultToken=b.defaultToken),b.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),b.unicode&&u.indexOf("u")===-1&&(u+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var M=b.regex,x=new RegExp("(?:("+M+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||x==1?b.token=b.token[0]:x-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:x-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&(x>1?b.onMatch=this.$applyToken:b.onMatch=b.token),x>1&&(/\\\d/.test(b.regex)?M=b.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+s+1)}):(x=1,M=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&p.push(b)),i[s]=y,s+=x,a.push(M),b.onMatch||(b.onMatch=null)}}a.length||(i[0]=0,a.push("$")),p.forEach(function(A){A.splitRegex=this.createSplitterRegexp(A.regex,u)},this),this.regExps[r]=new RegExp("("+a.join(")|(")+")|($)",u)}}return c.prototype.$setMaxTokenCount=function(f){g=f|0},c.prototype.$applyToken=function(f){var r=this.splitRegex.exec(f).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:f}];for(var a=[],s=0,i=o.length;s<i;s++)r[s]&&(a[a.length]={type:o[s],value:r[s]});return a},c.prototype.$arrayTokens=function(f){if(!f)return[];var r=this.splitRegex.exec(f);if(!r)return"text";for(var o=[],a=this.tokenArray,s=0,i=a.length;s<i;s++)r[s+1]&&(o[o.length]={type:a[s],value:r[s+1]});return o},c.prototype.removeCapturingGroups=function(f){var r=f.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,a){return a?"(?:":o});return r},c.prototype.createSplitterRegexp=function(f,r){if(f.indexOf("(?=")!=-1){var o=0,a=!1,s={};f.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(i,u,p,y,b,M){return a?a=b!="]":b?a=!0:y?(o==s.stack&&(s.end=M+1,s.stack=-1),o--):p&&(o++,p.length!=1&&(s.stack=o,s.start=M)),i}),s.end!=null&&/^\)*$/.test(f.substr(s.end))&&(f=f.substring(0,s.start)+f.substr(s.end))}return f.charAt(0)!="^"&&(f="^"+f),f.charAt(f.length-1)!="$"&&(f+="$"),new RegExp(f,(r||"").replace("g",""))},c.prototype.getLineTokens=function(f,r){if(r&&typeof r!="string"){var o=r.slice(0);r=o[0],r==="#tmp"&&(o.shift(),r=o.shift())}else var o=[];var a=r||"start",s=this.states[a];s||(a="start",s=this.states[a]);var i=this.matchMappings[a],u=this.regExps[a];u.lastIndex=0;for(var p,y=[],b=0,M=0,x={type:null,value:""};p=u.exec(f);){var A=i.defaultToken,S=null,$=p[0],R=u.lastIndex;if(R-$.length>b){var L=f.substring(b,R-$.length);x.type==A?x.value+=L:(x.type&&y.push(x),x={type:A,value:L})}for(var T=0;T<p.length-2;T++)if(p[T+1]!==void 0){S=s[i[T]],S.onMatch?A=S.onMatch($,a,o,f):A=S.token,S.next&&(typeof S.next=="string"?a=S.next:a=S.next(a,o),s=this.states[a],s||(this.reportError("state doesn't exist",a),a="start",s=this.states[a]),i=this.matchMappings[a],b=R,u=this.regExps[a],u.lastIndex=R),S.consumeLineEnd&&(b=R);break}if($){if(typeof A=="string")(!S||S.merge!==!1)&&x.type===A?x.value+=$:(x.type&&y.push(x),x={type:A,value:$});else if(A){x.type&&y.push(x),x={type:null,value:""};for(var T=0;T<A.length;T++)y.push(A[T])}}if(b==f.length)break;if(b=R,M++>g){for(M>2*f.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:f});b<f.length;)x.type&&y.push(x),x={value:f.substring(b,b+=500),type:"overflow"};a="start",o=[];break}}return x.type&&y.push(x),o.length>1&&o[0]!==a&&o.unshift("#tmp",a),{tokens:y,state:o.length?o:a}},c})();m.prototype.reportError=h,n.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,d){var h=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(f,r){if(!r){for(var o in f)this.$rules[o]=f[o];return}for(var o in f){for(var a=f[o],s=0;s<a.length;s++){var i=a[s];(i.next||i.onMatch)&&(typeof i.next=="string"&&i.next.indexOf(r)!==0&&(i.next=r+i.next),i.nextState&&i.nextState.indexOf(r)!==0&&(i.nextState=r+i.nextState))}this.$rules[r+o]=a}},this.getRules=function(){return this.$rules},this.embedRules=function(f,r,o,a,s){var i=typeof f=="function"?new f().getRules():f;if(a)for(var u=0;u<a.length;u++)a[u]=r+a[u];else{a=[];for(var p in i)a.push(r+p)}if(this.addRules(i,r),o)for(var y=Array.prototype[s?"push":"unshift"],u=0;u<a.length;u++)y.apply(this.$rules[a[u]],h(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var m=function(f,r){return(f!="start"||r.length)&&r.unshift(this.nextState,f),this.nextState},c=function(f,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var f=0,r=this.$rules;function o(a){var s=r[a];s.processed=!0;for(var i=0;i<s.length;i++){var u=s[i],p=null;Array.isArray(u)&&(p=u,u={}),!u.regex&&u.start&&(u.regex=u.start,u.next||(u.next=[]),u.next.push({defaultToken:u.token},{token:u.token+".end",regex:u.end||u.start,next:"pop"}),u.token=u.token+".start",u.push=!0);var y=u.next||u.push;if(y&&Array.isArray(y)){var b=u.stateName;b||(b=u.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=f++)),r[b]=y,u.next=b,o(b)}else y=="pop"&&(u.next=c);if(u.push&&(u.nextState=u.next||u.push,u.next=m,delete u.push),u.rules)for(var M in u.rules)r[M]?r[M].push&&r[M].push.apply(r[M],u.rules[M]):r[M]=u.rules[M];var x=typeof u=="string"?u:u.include;if(x&&(x==="$self"&&(x="start"),Array.isArray(x)?p=x.map(function(S){return r[S]}):p=r[x]),p){var A=[i,1].concat(p);u.noEscape&&(A=A.filter(function(S){return!S.next})),s.splice.apply(s,A),i--}u.keywordMap&&(u.token=this.createKeywordMapper(u.keywordMap,u.defaultToken||"text",u.caseInsensitive),delete u.defaultToken)}}Object.keys(r).forEach(o,this)},this.createKeywordMapper=function(f,r,o,a){var s=Object.create(null);return this.$keywordList=[],Object.keys(f).forEach(function(i){for(var u=f[i],p=u.split(a||"|"),y=p.length;y--;){var b=p[y];this.$keywordList.push(b),o&&(b=b.toLowerCase()),s[b]=i}},this),f=null,o?function(i){return s[i.toLowerCase()]||r}:function(i){return s[i]||r}},this.getKeywords=function(){return this.$keywords}}).call(g.prototype),n.TextHighlightRules=g}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,d){var h;h=function(){this.$behaviours={}},(function(){this.add=function(g,m,c){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[g]:this.$behaviours[g]={}}this.$behaviours[g][m]=c},this.addBehaviours=function(g){for(var m in g)for(var c in g[m])this.add(m,c,g[m][c])},this.remove=function(g){this.$behaviours&&this.$behaviours[g]&&delete this.$behaviours[g]},this.inherit=function(g,m){if(typeof g=="function")var c=new g().getBehaviours(m);else var c=g.getBehaviours(m);this.addBehaviours(c)},this.getBehaviours=function(g){if(g){for(var m={},c=0;c<g.length;c++)this.$behaviours[g[c]]&&(m[g[c]]=this.$behaviours[g[c]]);return m}else return this.$behaviours}}).call(h.prototype),n.Behaviour=h}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,d){var h=t("./range").Range,g=(function(){function m(c,f,r){this.$session=c,this.$row=f,this.$rowTokens=c.getTokens(f);var o=c.getTokenAt(f,r);this.$tokenIndex=o?o.index:-1}return m.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},m.prototype.stepForward=function(){this.$tokenIndex+=1;for(var c;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,c||(c=this.$session.getLength()),this.$row>=c)return this.$row=c-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentTokenRow=function(){return this.$row},m.prototype.getCurrentTokenColumn=function(){var c=this.$rowTokens,f=this.$tokenIndex,r=c[f].start;if(r!==void 0)return r;for(r=0;f>0;)f-=1,r+=c[f].value.length;return r},m.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},m.prototype.getCurrentTokenRange=function(){var c=this.$rowTokens[this.$tokenIndex],f=this.getCurrentTokenColumn();return new h(this.$row,f,this.$row,f+c.value.length)},m})();n.TokenIterator=g}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,d){var h=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,c=t("../../lib/lang"),f=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,a={},s={'"':'"',"'":"'"},i=function(y){var b=-1;if(y.multiSelect&&(b=y.selection.index,a.rangeCount!=y.multiSelect.rangeCount&&(a={rangeCount:y.multiSelect.rangeCount})),a[b])return o=a[b];o=a[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,b,M,x){var A=y.end.row-y.start.row;return{text:M+b+x,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},p;p=function(y){y=y||{},this.add("braces","insertion",function(b,M,x,A,S){var $=x.getCursorPosition(),R=A.doc.getLine($.row);if(S=="{"){i(x);var L=x.getSelectionRange(),T=A.doc.getTextRange(L),D=A.getTokenAt($.row,$.column);if(T!==""&&T!=="{"&&x.getWrapBehavioursEnabled())return u(L,T,"{","}");if(D&&/(?:string)\.quasi|\.xml/.test(D.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(I){return I.test(D.type)})||/(string)\.quasi/.test(D.type)&&D.value[$.column-D.start-1]!=="$"?void 0:(p.recordAutoInsert(x,A,"}"),{text:"{}",selection:[1,1]})}else if(p.isSaneInsertion(x,A))return/[\]\}\)]/.test(R[$.column])||x.inMultiSelectMode||y.braces?(p.recordAutoInsert(x,A,"}"),{text:"{}",selection:[1,1]}):(p.recordMaybeInsert(x,A,"{"),{text:"{",selection:[1,1]})}else if(S=="}"){i(x);var v=R.substring($.column,$.column+1);if(v=="}"){var C=A.$findOpeningBracket("}",{column:$.column+1,row:$.row});if(C!==null&&p.isAutoInsertedClosing($,R,S))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
1343
1343
  `||S==`\r
1344
- `){i($);var x="";f.isMaybeInsertedClosing(E,R)&&(x=c.stringRepeat("}",o.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var v=R.substring(E.column,E.column+1);if(v==="}"){var T=A.findMatchingBracket({row:E.row,column:E.column+1},"}");if(!T)return null;var k=this.$getIndent(A.getLine(T.row))}else if(x)var k=this.$getIndent(R);else{f.clearMaybeInsertedClosing();return}var O=k+A.getTabString();return{text:`
1344
+ `){i(x);var E="";p.isMaybeInsertedClosing($,R)&&(E=c.stringRepeat("}",o.maybeInsertedBrackets),p.clearMaybeInsertedClosing());var v=R.substring($.column,$.column+1);if(v==="}"){var _=A.findMatchingBracket({row:$.row,column:$.column+1},"}");if(!_)return null;var k=this.$getIndent(A.getLine(_.row))}else if(E)var k=this.$getIndent(R);else{p.clearMaybeInsertedClosing();return}var O=k+A.getTabString();return{text:`
1345
1345
  `+O+`
1346
- `+k+x,selection:[1,O.length,1,O.length]}}else f.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,M,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="{"){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.end.column,S.end.column+1);if(L=="}")return S.end.column++,S;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,M,$,A,S){if(S=="("){i($);var E=$.getSelectionRange(),R=A.doc.getTextRange(E);if(R!==""&&$.getWrapBehavioursEnabled())return u(E,R,"(",")");if(f.isSaneInsertion($,A))return f.recordAutoInsert($,A,")"),{text:"()",selection:[1,1]}}else if(S==")"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),D=_.substring(L.column,L.column+1);if(D==")"){var w=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(w!==null&&f.isAutoInsertedClosing(L,_,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,M,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="("){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L==")")return S.end.column++,S}}),this.add("brackets","insertion",function(b,M,$,A,S){if(S=="["){i($);var E=$.getSelectionRange(),R=A.doc.getTextRange(E);if(R!==""&&$.getWrapBehavioursEnabled())return u(E,R,"[","]");if(f.isSaneInsertion($,A))return f.recordAutoInsert($,A,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),D=_.substring(L.column,L.column+1);if(D=="]"){var w=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(w!==null&&f.isAutoInsertedClosing(L,_,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,M,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="["){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(b,M,$,A,S){var E=A.$mode.$quotes||s;if(S.length==1&&E[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i($);var R=S,L=$.getSelectionRange(),_=A.doc.getTextRange(L);if(_!==""&&(_.length!=1||!E[_])&&$.getWrapBehavioursEnabled())return u(L,_,R,R);if(!_){var D=$.getCursorPosition(),w=A.doc.getLine(D.row),v=w.substring(D.column-1,D.column),C=w.substring(D.column,D.column+1),x=A.getTokenAt(D.row,D.column),T=A.getTokenAt(D.row,D.column+1);if(v=="\\"&&x&&/escape/.test(x.type))return null;var k=x&&/string|escape/.test(x.type),O=!T||/string|escape/.test(T.type),I;if(C==R)I=k!==O,I&&/string\.end/.test(T.type)&&(I=!1);else{if(k&&!O||k&&O)return null;var N=A.$mode.tokenRe;N.lastIndex=0;var P=N.test(v);N.lastIndex=0;var B=N.test(C),F=A.$mode.$pairQuotesAfter,H=F&&F[R]&&F[R].test(v);if(!H&&P||B||C&&!/[\s;,.})\]\\]/.test(C))return null;var z=w[D.column-2];if(v==R&&(z==R||N.test(z)))return null;I=!0}return{text:I?R+R:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,M,$,A,S){var E=A.$mode.$quotes||s,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&E.hasOwnProperty(R)){i($);var L=A.doc.getLine(S.start.row),_=L.substring(S.start.column+1,S.start.column+2);if(_==R)return S.end.column++,S}}),y.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,M,$,A,S){if(b==="doc-start"&&(S===`
1346
+ `+k+E,selection:[1,O.length,1,O.length]}}else p.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,M,x,A,S){var $=A.doc.getTextRange(S);if(!S.isMultiLine()&&$=="{"){i(x);var R=A.doc.getLine(S.start.row),L=R.substring(S.end.column,S.end.column+1);if(L=="}")return S.end.column++,S;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,M,x,A,S){if(S=="("){i(x);var $=x.getSelectionRange(),R=A.doc.getTextRange($);if(R!==""&&x.getWrapBehavioursEnabled())return u($,R,"(",")");if(p.isSaneInsertion(x,A))return p.recordAutoInsert(x,A,")"),{text:"()",selection:[1,1]}}else if(S==")"){i(x);var L=x.getCursorPosition(),T=A.doc.getLine(L.row),D=T.substring(L.column,L.column+1);if(D==")"){var w=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(w!==null&&p.isAutoInsertedClosing(L,T,S))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,M,x,A,S){var $=A.doc.getTextRange(S);if(!S.isMultiLine()&&$=="("){i(x);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L==")")return S.end.column++,S}}),this.add("brackets","insertion",function(b,M,x,A,S){if(S=="["){i(x);var $=x.getSelectionRange(),R=A.doc.getTextRange($);if(R!==""&&x.getWrapBehavioursEnabled())return u($,R,"[","]");if(p.isSaneInsertion(x,A))return p.recordAutoInsert(x,A,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){i(x);var L=x.getCursorPosition(),T=A.doc.getLine(L.row),D=T.substring(L.column,L.column+1);if(D=="]"){var w=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(w!==null&&p.isAutoInsertedClosing(L,T,S))return p.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,M,x,A,S){var $=A.doc.getTextRange(S);if(!S.isMultiLine()&&$=="["){i(x);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(b,M,x,A,S){var $=A.$mode.$quotes||s;if(S.length==1&&$[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i(x);var R=S,L=x.getSelectionRange(),T=A.doc.getTextRange(L);if(T!==""&&(T.length!=1||!$[T])&&x.getWrapBehavioursEnabled())return u(L,T,R,R);if(!T){var D=x.getCursorPosition(),w=A.doc.getLine(D.row),v=w.substring(D.column-1,D.column),C=w.substring(D.column,D.column+1),E=A.getTokenAt(D.row,D.column),_=A.getTokenAt(D.row,D.column+1);if(v=="\\"&&E&&/escape/.test(E.type))return null;var k=E&&/string|escape/.test(E.type),O=!_||/string|escape/.test(_.type),I;if(C==R)I=k!==O,I&&/string\.end/.test(_.type)&&(I=!1);else{if(k&&!O||k&&O)return null;var N=A.$mode.tokenRe;N.lastIndex=0;var P=N.test(v);N.lastIndex=0;var B=N.test(C),F=A.$mode.$pairQuotesAfter,H=F&&F[R]&&F[R].test(v);if(!H&&P||B||C&&!/[\s;,.})\]\\]/.test(C))return null;var z=w[D.column-2];if(v==R&&(z==R||N.test(z)))return null;I=!0}return{text:I?R+R:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,M,x,A,S){var $=A.$mode.$quotes||s,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&$.hasOwnProperty(R)){i(x);var L=A.doc.getLine(S.start.row),T=L.substring(S.start.column+1,S.start.column+2);if(T==R)return S.end.column++,S}}),y.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,M,x,A,S){if(b==="doc-start"&&(S===`
1347
1347
  `||S===`\r
1348
- `)&&$.selection.isEmpty()){var E=$.getCursorPosition();if(E.column===0)return;for(var R=A.doc.getLine(E.row),L=A.doc.getLine(E.row+1),_=A.getTokens(E.row),D=0,w=0;w<_.length;w++){D+=_[w].value.length;var v=_[w];if(D>=E.column){if(D===E.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=_[w+1];if(!C||!/\.doc/.test(C.type))return}}var x=E.column-(D-v.value.length),T=v.value.indexOf("*/"),k=v.value.indexOf("/**",T>-1?T+2:0);if(k!==-1&&x>k&&x<k+3||T!==-1&&k!==-1&&x>=T&&x<=k||!/\.doc/.test(v.type))return;break}}var O=this.$getIndent(R);if(/\s*\*/.test(L))return/^\s*\*/.test(R)?{text:S+O+"* ",selection:[1,2+O.length,1,2+O.length]}:{text:S+O+" * ",selection:[1,3+O.length,1,3+O.length]};if(/\/\*\*/.test(R.substring(0,E.column)))return{text:S+O+" * "+S+" "+O+"*/",selection:[1,4+O.length,1,4+O.length]}}})},f.isSaneInsertion=function(y,b){var M=y.getCursorPosition(),$=new m(b,M.row,M.column);if(!this.$matchTokenType($.getCurrentToken()||"text",d)){if(/[)}\]]/.test(y.session.getLine(M.row)[M.column]))return!0;var A=new m(b,M.row,M.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",d))return!1}return $.stepForward(),$.getCurrentTokenRow()!==M.row||this.$matchTokenType($.getCurrentToken()||"text",r)},f.$matchTokenType=function(y,b){return b.indexOf(y.type||y)>-1},f.recordAutoInsert=function(y,b,M){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isAutoInsertedClosing($,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=$.row,o.autoInsertedLineEnd=M+A.substr($.column),o.autoInsertedBrackets++},f.recordMaybeInsert=function(y,b,M){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isMaybeInsertedClosing($,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=$.row,o.maybeInsertedLineStart=A.substr(0,$.column)+M,o.maybeInsertedLineEnd=A.substr($.column),o.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(y,b,M){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&M===o.autoInsertedLineEnd[0]&&b.substr(y.column)===o.autoInsertedLineEnd},f.isMaybeInsertedClosing=function(y,b){return o.maybeInsertedBrackets>0&&y.row===o.maybeInsertedRow&&b.substr(y.column)===o.maybeInsertedLineEnd&&b.substr(0,y.column)==o.maybeInsertedLineStart},f.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},h.inherits(f,g),n.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,n,p){for(var h=[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],g=0,m=[],c=0;c<h.length;c+=2)m.push(g+=h[c]),h[c+1]&&m.push(45,g+=h[c+1]);n.wordChars=String.fromCharCode.apply(null,m)}),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(t,n,p){var h=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,c=t("./behaviour/cstyle").CstyleBehaviour,d=t("../unicode"),r=t("../lib/lang"),o=t("../token_iterator").TokenIterator,a=t("../range").Range,s;s=function(){this.HighlightRules=m},(function(){this.$defaultBehaviour=new c,this.tokenRe=new RegExp("^["+d.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+d.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new g(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(i,u,f,y){var b=u.doc,M=!0,$=!0,A=1/0,S=u.getTabSize(),E=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(r.escapeRegExp).join("|"),R=this.lineCommentStart[0];else var _=r.escapeRegExp(this.lineCommentStart),R=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),E=u.getUseSoftTabs();var v=function(B,F){var H=B.match(_);if(H){var z=H[1].length,W=H[0].length;!T(B,z,W)&&H[0][W-1]==" "&&W--,b.removeInLine(F,z,W)}},x=R+" ",w=function(B,F){(!M||/\S/.test(B))&&(T(B,A,A)?b.insertInLine({row:F,column:A},x):b.insertInLine({row:F,column:A},R))},C=function(B,F){return _.test(B)},T=function(B,F,H){for(var z=0;F--&&B.charAt(F)==" ";)z++;if(z%S!=0)return!1;for(var z=0;B.charAt(H++)==" ";)z++;return S>2?z%S!=S-1:z%S==0}}else{if(!this.blockComment)return!1;var R=this.blockComment.start,L=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),D=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),w=function(I,N){C(I,N)||(!M||/\S/.test(I))&&(b.insertInLine({row:N,column:I.length},L),b.insertInLine({row:N,column:A},R))},v=function(I,N){var P;(P=I.match(D))&&b.removeInLine(N,I.length-P[0].length,I.length),(P=I.match(_))&&b.removeInLine(N,P[1].length,P[0].length)},C=function(I,N){if(_.test(I))return!0;for(var P=u.getTokens(N),B=0;B<P.length;B++)if(P[B].type==="comment")return!0}}function k(I){for(var N=f;N<=y;N++)I(b.getLine(N),N)}var O=1/0;k(function(I,N){var P=I.search(/\S/);P!==-1?(P<A&&(A=P),$&&!C(I,N)&&($=!1)):O>I.length&&(O=I.length)}),A==1/0&&(A=O,M=!1,$=!1),E&&A%S!=0&&(A=Math.floor(A/S)*S),k($?v:w)},this.toggleBlockComment=function(i,u,f,y){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var M=new o(u,y.row,y.column),$=M.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,E;if($&&/comment/.test($.type)){for(var R,L;$&&/comment/.test($.type);){var _=$.value.indexOf(b.start);if(_!=-1){var D=M.getCurrentTokenRow(),w=M.getCurrentTokenColumn()+_;R=new a(D,w,D,w+b.start.length);break}$=M.stepBackward()}for(var M=new o(u,y.row,y.column),$=M.getCurrentToken();$&&/comment/.test($.type);){var _=$.value.indexOf(b.end);if(_!=-1){var D=M.getCurrentTokenRow(),w=M.getCurrentTokenColumn()+_;L=new a(D,w,D,w+b.end.length);break}$=M.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,E=-b.start.length)}else E=b.start.length,S=f.start.row,u.insert(f.end,b.end),u.insert(f.start,b.start);A.start.row==S&&(A.start.column+=E),A.end.row==S&&(A.end.column+=E),u.selection.fromOrientedRange(A)}},this.getNextLineIndent=function(i,u,f){return this.$getIndent(u)},this.checkOutdent=function(i,u,f){return!1},this.autoOutdent=function(i,u,f){},this.$getIndent=function(i){return i.match(/^\s*/)[0]},this.createWorker=function(i){return null},this.createModeDelegates=function(i){this.$embeds=[],this.$modes={};for(var u in i)if(i[u]){var f=i[u],y=f.prototype.$id,b=h.$modes[y];b||(h.$modes[y]=b=new f),h.$modes[u]||(h.$modes[u]=b),this.$embeds.push(u),this.$modes[u]=b}for(var M=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],$=function(S){(function(E){var R=M[S],L=E[R];E[M[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<M.length;u++)$(u)},this.$delegator=function(i,u,f){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var b=y[2][y[2].length-1],M=this.$modes[b];if(M)return M[i].apply(M,[y[1]].concat([].slice.call(u,1)))}y=y[0]||"start"}for(var $=0;$<this.$embeds.length;$++)if(this.$modes[this.$embeds[$]]){var A=y.split(this.$embeds[$]);if(!A[0]&&A[1]){u[0]=A[1];var M=this.$modes[this.$embeds[$]];return M[i].apply(M,u)}}var S=f.apply(this,u);return f?S:void 0},this.transformAction=function(i,u,f,y,b){if(this.$behaviour){var M=this.$behaviour.getBehaviours();for(var $ in M)if(M[$][u]){var A=M[$][u].apply(this,arguments);if(A)return A}}},this.getKeywords=function(i){if(!this.completionKeywords){var u=this.$tokenizer.rules,f=[];for(var y in u)for(var b=u[y],M=0,$=b.length;M<$;M++)if(typeof b[M].token=="string")/keyword|support|storage/.test(b[M].token)&&f.push(b[M].regex);else if(typeof b[M].token=="object"){for(var A=0,S=b[M].token.length;A<S;A++)if(/keyword|support|storage/.test(b[M].token[A])){var y=b[M].regex.match(/\(.+?\)/g)[A];f.push(y.substr(1,y.length-2))}}this.completionKeywords=f}return i?f.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(i,u,f,y){var b=this.$keywordList||this.$createKeywordList();return b.map(function(M){return{name:M,value:M,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(s.prototype),n.Mode=s}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("./lib/dom"),g=(function(){function m(c){this.session=c,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return m.prototype.getRowLength=function(c){var d;return this.lineWidgets?d=this.lineWidgets[c]&&this.lineWidgets[c].rowCount||0:d=0,!this.$useWrapMode||!this.$wrapData[c]?1+d:this.$wrapData[c].length+1+d},m.prototype.$getWidgetScreenLength=function(){var c=0;return this.lineWidgets.forEach(function(d){d&&d.rowCount&&!d.hidden&&(c+=d.rowCount)}),c},m.prototype.$onChangeEditor=function(c){this.attach(c.editor)},m.prototype.attach=function(c){c&&c.widgetManager&&c.widgetManager!=this&&c.widgetManager.detach(),this.editor!=c&&(this.detach(),this.editor=c,c&&(c.widgetManager=this,c.renderer.on("beforeRender",this.measureWidgets),c.renderer.on("afterRender",this.renderWidgets)))},m.prototype.detach=function(c){var d=this.editor;if(d){this.editor=null,d.widgetManager=null,d.renderer.off("beforeRender",this.measureWidgets),d.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},m.prototype.updateOnFold=function(c,d){var r=d.lineWidgets;if(!(!r||!c.action)){for(var o=c.data,a=o.start.row,s=o.end.row,i=c.action=="add",u=a+1;u<s;u++)r[u]&&(r[u].hidden=i);r[s]&&(i?r[a]?r[s].hidden=i:r[a]=r[s]:(r[a]==r[s]&&(r[a]=void 0),r[s].hidden=i))}},m.prototype.updateOnChange=function(c){var d=this.session.lineWidgets;if(d){var r=c.start.row,o=c.end.row-r;if(o!==0)if(c.action=="remove"){var a=d.splice(r+1,o);!d[r]&&a[a.length-1]&&(d[r]=a.pop()),a.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var s=new Array(o);d[r]&&d[r].column!=null&&c.start.column>d[r].column&&r++,s.unshift(r,0),d.splice.apply(d,s),this.$updateRows()}}},m.prototype.$updateRows=function(){var c=this.session.lineWidgets;if(c){var d=!0;c.forEach(function(r,o){if(r)for(d=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),d&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(c){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var d=this.session.lineWidgets[c.row];return d&&(c.$oldWidget=d,d.el&&d.el.parentNode&&(d.el.parentNode.removeChild(d.el),d._inDocument=!1)),this.session.lineWidgets[c.row]=c,c},m.prototype.addLineWidget=function(c){if(this.$registerLineWidget(c),c.session=this.session,!this.editor)return c;var d=this.editor.renderer;c.html&&!c.el&&(c.el=h.createElement("div"),c.el.innerHTML=c.html),c.text&&!c.el&&(c.el=h.createElement("div"),c.el.textContent=c.text),c.el&&(h.addCssClass(c.el,"ace_lineWidgetContainer"),c.className&&h.addCssClass(c.el,c.className),c.el.style.position="absolute",c.el.style.zIndex="5",d.container.appendChild(c.el),c._inDocument=!0,c.coverGutter||(c.el.style.zIndex="3"),c.pixelHeight==null&&(c.pixelHeight=c.el.offsetHeight)),c.rowCount==null&&(c.rowCount=c.pixelHeight/d.layerConfig.lineHeight);var r=this.session.getFoldAt(c.row,0);if(c.$fold=r,r){var o=this.session.lineWidgets;c.row==r.end.row&&!o[r.start.row]?o[r.start.row]=c:c.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows(),this.renderWidgets(null,d),this.onWidgetChanged(c),c},m.prototype.removeLineWidget=function(c){if(c._inDocument=!1,c.session=null,c.el&&c.el.parentNode&&c.el.parentNode.removeChild(c.el),c.editor&&c.editor.destroy)try{c.editor.destroy()}catch{}if(this.session.lineWidgets){var d=this.session.lineWidgets[c.row];if(d==c)this.session.lineWidgets[c.row]=c.$oldWidget,c.$oldWidget&&this.onWidgetChanged(c.$oldWidget);else for(;d;){if(d.$oldWidget==c){d.$oldWidget=c.$oldWidget;break}d=d.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(c){for(var d=this.session.lineWidgets,r=d&&d[c],o=[];r;)o.push(r),r=r.$oldWidget;return o},m.prototype.onWidgetChanged=function(c){this.session._changedWidgets.push(c),this.editor&&this.editor.renderer.updateFull()},m.prototype.measureWidgets=function(c,d){var r=this.session._changedWidgets,o=d.layerConfig;if(!(!r||!r.length)){for(var a=1/0,s=0;s<r.length;s++){var i=r[s];if(!(!i||!i.el)&&i.session==this.session){if(!i._inDocument){if(this.session.lineWidgets[i.row]!=i)continue;i._inDocument=!0,d.container.appendChild(i.el)}i.h=i.el.offsetHeight,i.fixedWidth||(i.w=i.el.offsetWidth,i.screenWidth=Math.ceil(i.w/o.characterWidth));var u=i.h/o.lineHeight;i.coverLine&&(u-=this.session.getRowLineCount(i.row),u<0&&(u=0)),i.rowCount!=u&&(i.rowCount=u,i.row<a&&(a=i.row))}}a!=1/0&&(this.session._emit("changeFold",{data:{start:{row:a}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},m.prototype.renderWidgets=function(c,d){var r=d.layerConfig,o=this.session.lineWidgets;if(o){for(var a=Math.min(this.firstRow,r.firstRow),s=Math.max(this.lastRow,r.lastRow,o.length);a>0&&!o[a];)a--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,d.$cursorLayer.config=r;for(var i=a;i<=s;i++){var u=o[i];if(!(!u||!u.el)){if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,d.container.appendChild(u.el));var f=d.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;u.coverLine||(f+=r.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=f-r.offset+"px";var y=u.coverGutter?0:d.gutterWidth;u.fixedWidth||(y-=d.scrollLeft),u.el.style.left=y+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=r.width+2*r.padding+"px"),u.fixedWidth?u.el.style.right=d.scrollBar.getWidth()+"px":u.el.style.right=""}}}},m})();n.LineWidgets=g}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,p){n.applyDelta=function(h,g,m){var c=g.start.row,d=g.start.column,r=h[c]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)h[c]=r.substring(0,d)+g.lines[0]+r.substring(d);else{var a=[c,1].concat(g.lines);h.splice.apply(h,a),h[c]=r.substring(0,d)+h[c],h[c+g.lines.length-1]+=r.substring(d)}break;case"remove":var s=g.end.column,i=g.end.row;c===i?h[c]=r.substring(0,d)+r.substring(s):h.splice(c,i-c+1,r.substring(0,d)+h[i].substring(s));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function r(o,a,s){this.$onChange=this.onChange.bind(this),this.attach(o),typeof a!="number"?this.setPosition(a.row,a.column):this.setPosition(a,s)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var a=d(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(a.row,a.column,!0)}},r.prototype.setPosition=function(o,a,s){var i;if(s?i={row:o,column:a}:i=this.$clipPositionToDocument(o,a),!(this.row==i.row&&this.column==i.column)){var u={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:u,value:i})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(o,a){var s={};return o>=this.document.getLength()?(s.row=Math.max(0,this.document.getLength()-1),s.column=this.document.getLine(s.row).length):o<0?(s.row=0,s.column=0):(s.row=o,s.column=Math.min(this.document.getLine(s.row).length,Math.max(0,a))),a<0&&(s.column=0),s},r})();m.prototype.$insertRight=!1,h.implement(m.prototype,g);function c(r,o,a){var s=a?r.column<=o.column:r.column<o.column;return r.row<o.row||r.row==o.row&&s}function d(r,o,a){var s=r.action=="insert",i=(s?1:-1)*(r.end.row-r.start.row),u=(s?1:-1)*(r.end.column-r.start.column),f=r.start,y=s?f:r.end;return c(o,f,a)?{row:o.row,column:o.column}:c(y,o,!a)?{row:o.row+i,column:o.column+(o.row==y.row?u:0)}:{row:f.row,column:f.column}}n.Anchor=m}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,p){var h=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,d=t("./anchor").Anchor,r=(function(){function o(a){this.$lines=[""],a.length===0?this.$lines=[""]:Array.isArray(a)?this.insertMergedLines({row:0,column:0},a):this.insert({row:0,column:0},a)}return o.prototype.setValue=function(a){var s=this.getLength()-1;this.remove(new c(0,0,s,this.getLine(s).length)),this.insert({row:0,column:0},a||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(a,s){return new d(this,a,s)},o.prototype.$detectNewLine=function(a){var s=a.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=s?s[1]:`
1348
+ `)&&x.selection.isEmpty()){var $=x.getCursorPosition();if($.column===0)return;for(var R=A.doc.getLine($.row),L=A.doc.getLine($.row+1),T=A.getTokens($.row),D=0,w=0;w<T.length;w++){D+=T[w].value.length;var v=T[w];if(D>=$.column){if(D===$.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=T[w+1];if(!C||!/\.doc/.test(C.type))return}}var E=$.column-(D-v.value.length),_=v.value.indexOf("*/"),k=v.value.indexOf("/**",_>-1?_+2:0);if(k!==-1&&E>k&&E<k+3||_!==-1&&k!==-1&&E>=_&&E<=k||!/\.doc/.test(v.type))return;break}}var O=this.$getIndent(R);if(/\s*\*/.test(L))return/^\s*\*/.test(R)?{text:S+O+"* ",selection:[1,2+O.length,1,2+O.length]}:{text:S+O+" * ",selection:[1,3+O.length,1,3+O.length]};if(/\/\*\*/.test(R.substring(0,$.column)))return{text:S+O+" * "+S+" "+O+"*/",selection:[1,4+O.length,1,4+O.length]}}})},p.isSaneInsertion=function(y,b){var M=y.getCursorPosition(),x=new m(b,M.row,M.column);if(!this.$matchTokenType(x.getCurrentToken()||"text",f)){if(/[)}\]]/.test(y.session.getLine(M.row)[M.column]))return!0;var A=new m(b,M.row,M.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",f))return!1}return x.stepForward(),x.getCurrentTokenRow()!==M.row||this.$matchTokenType(x.getCurrentToken()||"text",r)},p.$matchTokenType=function(y,b){return b.indexOf(y.type||y)>-1},p.recordAutoInsert=function(y,b,M){var x=y.getCursorPosition(),A=b.doc.getLine(x.row);this.isAutoInsertedClosing(x,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=x.row,o.autoInsertedLineEnd=M+A.substr(x.column),o.autoInsertedBrackets++},p.recordMaybeInsert=function(y,b,M){var x=y.getCursorPosition(),A=b.doc.getLine(x.row);this.isMaybeInsertedClosing(x,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=x.row,o.maybeInsertedLineStart=A.substr(0,x.column)+M,o.maybeInsertedLineEnd=A.substr(x.column),o.maybeInsertedBrackets++},p.isAutoInsertedClosing=function(y,b,M){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&M===o.autoInsertedLineEnd[0]&&b.substr(y.column)===o.autoInsertedLineEnd},p.isMaybeInsertedClosing=function(y,b){return o.maybeInsertedBrackets>0&&y.row===o.maybeInsertedRow&&b.substr(y.column)===o.maybeInsertedLineEnd&&b.substr(0,y.column)==o.maybeInsertedLineStart},p.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},p.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},h.inherits(p,g),n.CstyleBehaviour=p}),ace.define("ace/unicode",["require","exports","module"],function(t,n,d){for(var h=[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],g=0,m=[],c=0;c<h.length;c+=2)m.push(g+=h[c]),h[c+1]&&m.push(45,g+=h[c+1]);n.wordChars=String.fromCharCode.apply(null,m)}),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(t,n,d){var h=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,c=t("./behaviour/cstyle").CstyleBehaviour,f=t("../unicode"),r=t("../lib/lang"),o=t("../token_iterator").TokenIterator,a=t("../range").Range,s;s=function(){this.HighlightRules=m},(function(){this.$defaultBehaviour=new c,this.tokenRe=new RegExp("^["+f.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+f.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new g(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(i,u,p,y){var b=u.doc,M=!0,x=!0,A=1/0,S=u.getTabSize(),$=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var T=this.lineCommentStart.map(r.escapeRegExp).join("|"),R=this.lineCommentStart[0];else var T=r.escapeRegExp(this.lineCommentStart),R=this.lineCommentStart;T=new RegExp("^(\\s*)(?:"+T+") ?"),$=u.getUseSoftTabs();var v=function(B,F){var H=B.match(T);if(H){var z=H[1].length,W=H[0].length;!_(B,z,W)&&H[0][W-1]==" "&&W--,b.removeInLine(F,z,W)}},E=R+" ",w=function(B,F){(!M||/\S/.test(B))&&(_(B,A,A)?b.insertInLine({row:F,column:A},E):b.insertInLine({row:F,column:A},R))},C=function(B,F){return T.test(B)},_=function(B,F,H){for(var z=0;F--&&B.charAt(F)==" ";)z++;if(z%S!=0)return!1;for(var z=0;B.charAt(H++)==" ";)z++;return S>2?z%S!=S-1:z%S==0}}else{if(!this.blockComment)return!1;var R=this.blockComment.start,L=this.blockComment.end,T=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),D=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),w=function(I,N){C(I,N)||(!M||/\S/.test(I))&&(b.insertInLine({row:N,column:I.length},L),b.insertInLine({row:N,column:A},R))},v=function(I,N){var P;(P=I.match(D))&&b.removeInLine(N,I.length-P[0].length,I.length),(P=I.match(T))&&b.removeInLine(N,P[1].length,P[0].length)},C=function(I,N){if(T.test(I))return!0;for(var P=u.getTokens(N),B=0;B<P.length;B++)if(P[B].type==="comment")return!0}}function k(I){for(var N=p;N<=y;N++)I(b.getLine(N),N)}var O=1/0;k(function(I,N){var P=I.search(/\S/);P!==-1?(P<A&&(A=P),x&&!C(I,N)&&(x=!1)):O>I.length&&(O=I.length)}),A==1/0&&(A=O,M=!1,x=!1),$&&A%S!=0&&(A=Math.floor(A/S)*S),k(x?v:w)},this.toggleBlockComment=function(i,u,p,y){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var M=new o(u,y.row,y.column),x=M.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,$;if(x&&/comment/.test(x.type)){for(var R,L;x&&/comment/.test(x.type);){var T=x.value.indexOf(b.start);if(T!=-1){var D=M.getCurrentTokenRow(),w=M.getCurrentTokenColumn()+T;R=new a(D,w,D,w+b.start.length);break}x=M.stepBackward()}for(var M=new o(u,y.row,y.column),x=M.getCurrentToken();x&&/comment/.test(x.type);){var T=x.value.indexOf(b.end);if(T!=-1){var D=M.getCurrentTokenRow(),w=M.getCurrentTokenColumn()+T;L=new a(D,w,D,w+b.end.length);break}x=M.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,$=-b.start.length)}else $=b.start.length,S=p.start.row,u.insert(p.end,b.end),u.insert(p.start,b.start);A.start.row==S&&(A.start.column+=$),A.end.row==S&&(A.end.column+=$),u.selection.fromOrientedRange(A)}},this.getNextLineIndent=function(i,u,p){return this.$getIndent(u)},this.checkOutdent=function(i,u,p){return!1},this.autoOutdent=function(i,u,p){},this.$getIndent=function(i){return i.match(/^\s*/)[0]},this.createWorker=function(i){return null},this.createModeDelegates=function(i){this.$embeds=[],this.$modes={};for(var u in i)if(i[u]){var p=i[u],y=p.prototype.$id,b=h.$modes[y];b||(h.$modes[y]=b=new p),h.$modes[u]||(h.$modes[u]=b),this.$embeds.push(u),this.$modes[u]=b}for(var M=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],x=function(S){(function($){var R=M[S],L=$[R];$[M[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<M.length;u++)x(u)},this.$delegator=function(i,u,p){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var b=y[2][y[2].length-1],M=this.$modes[b];if(M)return M[i].apply(M,[y[1]].concat([].slice.call(u,1)))}y=y[0]||"start"}for(var x=0;x<this.$embeds.length;x++)if(this.$modes[this.$embeds[x]]){var A=y.split(this.$embeds[x]);if(!A[0]&&A[1]){u[0]=A[1];var M=this.$modes[this.$embeds[x]];return M[i].apply(M,u)}}var S=p.apply(this,u);return p?S:void 0},this.transformAction=function(i,u,p,y,b){if(this.$behaviour){var M=this.$behaviour.getBehaviours();for(var x in M)if(M[x][u]){var A=M[x][u].apply(this,arguments);if(A)return A}}},this.getKeywords=function(i){if(!this.completionKeywords){var u=this.$tokenizer.rules,p=[];for(var y in u)for(var b=u[y],M=0,x=b.length;M<x;M++)if(typeof b[M].token=="string")/keyword|support|storage/.test(b[M].token)&&p.push(b[M].regex);else if(typeof b[M].token=="object"){for(var A=0,S=b[M].token.length;A<S;A++)if(/keyword|support|storage/.test(b[M].token[A])){var y=b[M].regex.match(/\(.+?\)/g)[A];p.push(y.substr(1,y.length-2))}}this.completionKeywords=p}return i?p.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(i,u,p,y){var b=this.$keywordList||this.$createKeywordList();return b.map(function(M){return{name:M,value:M,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(s.prototype),n.Mode=s}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,d){var h=t("./lib/dom"),g=(function(){function m(c){this.session=c,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return m.prototype.getRowLength=function(c){var f;return this.lineWidgets?f=this.lineWidgets[c]&&this.lineWidgets[c].rowCount||0:f=0,!this.$useWrapMode||!this.$wrapData[c]?1+f:this.$wrapData[c].length+1+f},m.prototype.$getWidgetScreenLength=function(){var c=0;return this.lineWidgets.forEach(function(f){f&&f.rowCount&&!f.hidden&&(c+=f.rowCount)}),c},m.prototype.$onChangeEditor=function(c){this.attach(c.editor)},m.prototype.attach=function(c){c&&c.widgetManager&&c.widgetManager!=this&&c.widgetManager.detach(),this.editor!=c&&(this.detach(),this.editor=c,c&&(c.widgetManager=this,c.renderer.on("beforeRender",this.measureWidgets),c.renderer.on("afterRender",this.renderWidgets)))},m.prototype.detach=function(c){var f=this.editor;if(f){this.editor=null,f.widgetManager=null,f.renderer.off("beforeRender",this.measureWidgets),f.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},m.prototype.updateOnFold=function(c,f){var r=f.lineWidgets;if(!(!r||!c.action)){for(var o=c.data,a=o.start.row,s=o.end.row,i=c.action=="add",u=a+1;u<s;u++)r[u]&&(r[u].hidden=i);r[s]&&(i?r[a]?r[s].hidden=i:r[a]=r[s]:(r[a]==r[s]&&(r[a]=void 0),r[s].hidden=i))}},m.prototype.updateOnChange=function(c){var f=this.session.lineWidgets;if(f){var r=c.start.row,o=c.end.row-r;if(o!==0)if(c.action=="remove"){var a=f.splice(r+1,o);!f[r]&&a[a.length-1]&&(f[r]=a.pop()),a.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var s=new Array(o);f[r]&&f[r].column!=null&&c.start.column>f[r].column&&r++,s.unshift(r,0),f.splice.apply(f,s),this.$updateRows()}}},m.prototype.$updateRows=function(){var c=this.session.lineWidgets;if(c){var f=!0;c.forEach(function(r,o){if(r)for(f=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),f&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(c){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var f=this.session.lineWidgets[c.row];return f&&(c.$oldWidget=f,f.el&&f.el.parentNode&&(f.el.parentNode.removeChild(f.el),f._inDocument=!1)),this.session.lineWidgets[c.row]=c,c},m.prototype.addLineWidget=function(c){if(this.$registerLineWidget(c),c.session=this.session,!this.editor)return c;var f=this.editor.renderer;c.html&&!c.el&&(c.el=h.createElement("div"),c.el.innerHTML=c.html),c.text&&!c.el&&(c.el=h.createElement("div"),c.el.textContent=c.text),c.el&&(h.addCssClass(c.el,"ace_lineWidgetContainer"),c.className&&h.addCssClass(c.el,c.className),c.el.style.position="absolute",c.el.style.zIndex="5",f.container.appendChild(c.el),c._inDocument=!0,c.coverGutter||(c.el.style.zIndex="3"),c.pixelHeight==null&&(c.pixelHeight=c.el.offsetHeight)),c.rowCount==null&&(c.rowCount=c.pixelHeight/f.layerConfig.lineHeight);var r=this.session.getFoldAt(c.row,0);if(c.$fold=r,r){var o=this.session.lineWidgets;c.row==r.end.row&&!o[r.start.row]?o[r.start.row]=c:c.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows(),this.renderWidgets(null,f),this.onWidgetChanged(c),c},m.prototype.removeLineWidget=function(c){if(c._inDocument=!1,c.session=null,c.el&&c.el.parentNode&&c.el.parentNode.removeChild(c.el),c.editor&&c.editor.destroy)try{c.editor.destroy()}catch{}if(this.session.lineWidgets){var f=this.session.lineWidgets[c.row];if(f==c)this.session.lineWidgets[c.row]=c.$oldWidget,c.$oldWidget&&this.onWidgetChanged(c.$oldWidget);else for(;f;){if(f.$oldWidget==c){f.$oldWidget=c.$oldWidget;break}f=f.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(c){for(var f=this.session.lineWidgets,r=f&&f[c],o=[];r;)o.push(r),r=r.$oldWidget;return o},m.prototype.onWidgetChanged=function(c){this.session._changedWidgets.push(c),this.editor&&this.editor.renderer.updateFull()},m.prototype.measureWidgets=function(c,f){var r=this.session._changedWidgets,o=f.layerConfig;if(!(!r||!r.length)){for(var a=1/0,s=0;s<r.length;s++){var i=r[s];if(!(!i||!i.el)&&i.session==this.session){if(!i._inDocument){if(this.session.lineWidgets[i.row]!=i)continue;i._inDocument=!0,f.container.appendChild(i.el)}i.h=i.el.offsetHeight,i.fixedWidth||(i.w=i.el.offsetWidth,i.screenWidth=Math.ceil(i.w/o.characterWidth));var u=i.h/o.lineHeight;i.coverLine&&(u-=this.session.getRowLineCount(i.row),u<0&&(u=0)),i.rowCount!=u&&(i.rowCount=u,i.row<a&&(a=i.row))}}a!=1/0&&(this.session._emit("changeFold",{data:{start:{row:a}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},m.prototype.renderWidgets=function(c,f){var r=f.layerConfig,o=this.session.lineWidgets;if(o){for(var a=Math.min(this.firstRow,r.firstRow),s=Math.max(this.lastRow,r.lastRow,o.length);a>0&&!o[a];)a--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,f.$cursorLayer.config=r;for(var i=a;i<=s;i++){var u=o[i];if(!(!u||!u.el)){if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,f.container.appendChild(u.el));var p=f.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;u.coverLine||(p+=r.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=p-r.offset+"px";var y=u.coverGutter?0:f.gutterWidth;u.fixedWidth||(y-=f.scrollLeft),u.el.style.left=y+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=r.width+2*r.padding+"px"),u.fixedWidth?u.el.style.right=f.scrollBar.getWidth()+"px":u.el.style.right=""}}}},m})();n.LineWidgets=g}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,d){n.applyDelta=function(h,g,m){var c=g.start.row,f=g.start.column,r=h[c]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)h[c]=r.substring(0,f)+g.lines[0]+r.substring(f);else{var a=[c,1].concat(g.lines);h.splice.apply(h,a),h[c]=r.substring(0,f)+h[c],h[c+g.lines.length-1]+=r.substring(f)}break;case"remove":var s=g.end.column,i=g.end.row;c===i?h[c]=r.substring(0,f)+r.substring(s):h.splice(c,i-c+1,r.substring(0,f)+h[i].substring(s));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,d){var h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function r(o,a,s){this.$onChange=this.onChange.bind(this),this.attach(o),typeof a!="number"?this.setPosition(a.row,a.column):this.setPosition(a,s)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var a=f(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(a.row,a.column,!0)}},r.prototype.setPosition=function(o,a,s){var i;if(s?i={row:o,column:a}:i=this.$clipPositionToDocument(o,a),!(this.row==i.row&&this.column==i.column)){var u={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:u,value:i})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(o,a){var s={};return o>=this.document.getLength()?(s.row=Math.max(0,this.document.getLength()-1),s.column=this.document.getLine(s.row).length):o<0?(s.row=0,s.column=0):(s.row=o,s.column=Math.min(this.document.getLine(s.row).length,Math.max(0,a))),a<0&&(s.column=0),s},r})();m.prototype.$insertRight=!1,h.implement(m.prototype,g);function c(r,o,a){var s=a?r.column<=o.column:r.column<o.column;return r.row<o.row||r.row==o.row&&s}function f(r,o,a){var s=r.action=="insert",i=(s?1:-1)*(r.end.row-r.start.row),u=(s?1:-1)*(r.end.column-r.start.column),p=r.start,y=s?p:r.end;return c(o,p,a)?{row:o.row,column:o.column}:c(y,o,!a)?{row:o.row+i,column:o.column+(o.row==y.row?u:0)}:{row:p.row,column:p.column}}n.Anchor=m}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,d){var h=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,f=t("./anchor").Anchor,r=(function(){function o(a){this.$lines=[""],a.length===0?this.$lines=[""]:Array.isArray(a)?this.insertMergedLines({row:0,column:0},a):this.insert({row:0,column:0},a)}return o.prototype.setValue=function(a){var s=this.getLength()-1;this.remove(new c(0,0,s,this.getLine(s).length)),this.insert({row:0,column:0},a||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(a,s){return new f(this,a,s)},o.prototype.$detectNewLine=function(a){var s=a.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=s?s[1]:`
1349
1349
  `,this._signal("changeNewLineMode")},o.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
1350
1350
  `;case"unix":return`
1351
1351
  `;default:return this.$autoNewLine||`
1352
1352
  `}},o.prototype.setNewLineMode=function(a){this.$newLineMode!==a&&(this.$newLineMode=a,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(a){return a==`\r
1353
1353
  `||a=="\r"||a==`
1354
- `},o.prototype.getLine=function(a){return this.$lines[a]||""},o.prototype.getLines=function(a,s){return this.$lines.slice(a,s+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(a){return this.getLinesForRange(a).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(a){var s;if(a.start.row===a.end.row)s=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{s=this.getLines(a.start.row,a.end.row),s[0]=(s[0]||"").substring(a.start.column);var i=s.length-1;a.end.row-a.start.row==i&&(s[i]=s[i].substring(0,a.end.column))}return s},o.prototype.insertLines=function(a,s){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(a,s)},o.prototype.removeLines=function(a,s){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(a,s)},o.prototype.insertNewLine=function(a){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(a,["",""])},o.prototype.insert=function(a,s){return this.getLength()<=1&&this.$detectNewLine(s),this.insertMergedLines(a,this.$split(s))},o.prototype.insertInLine=function(a,s){var i=this.clippedPos(a.row,a.column),u=this.pos(a.row,a.column+s.length);return this.applyDelta({start:i,end:u,action:"insert",lines:[s]},!0),this.clonePos(u)},o.prototype.clippedPos=function(a,s){var i=this.getLength();a===void 0?a=i:a<0?a=0:a>=i&&(a=i-1,s=void 0);var u=this.getLine(a);return s==null&&(s=u.length),s=Math.min(Math.max(s,0),u.length),{row:a,column:s}},o.prototype.clonePos=function(a){return{row:a.row,column:a.column}},o.prototype.pos=function(a,s){return{row:a,column:s}},o.prototype.$clipPosition=function(a){var s=this.getLength();return a.row>=s?(a.row=Math.max(0,s-1),a.column=this.getLine(s-1).length):(a.row=Math.max(0,a.row),a.column=Math.min(Math.max(a.column,0),this.getLine(a.row).length)),a},o.prototype.insertFullLines=function(a,s){a=Math.min(Math.max(a,0),this.getLength());var i=0;a<this.getLength()?(s=s.concat([""]),i=0):(s=[""].concat(s),a--,i=this.$lines[a].length),this.insertMergedLines({row:a,column:i},s)},o.prototype.insertMergedLines=function(a,s){var i=this.clippedPos(a.row,a.column),u={row:i.row+s.length-1,column:(s.length==1?i.column:0)+s[s.length-1].length};return this.applyDelta({start:i,end:u,action:"insert",lines:s}),this.clonePos(u)},o.prototype.remove=function(a){var s=this.clippedPos(a.start.row,a.start.column),i=this.clippedPos(a.end.row,a.end.column);return this.applyDelta({start:s,end:i,action:"remove",lines:this.getLinesForRange({start:s,end:i})}),this.clonePos(s)},o.prototype.removeInLine=function(a,s,i){var u=this.clippedPos(a,s),f=this.clippedPos(a,i);return this.applyDelta({start:u,end:f,action:"remove",lines:this.getLinesForRange({start:u,end:f})},!0),this.clonePos(u)},o.prototype.removeFullLines=function(a,s){a=Math.min(Math.max(0,a),this.getLength()-1),s=Math.min(Math.max(0,s),this.getLength()-1);var i=s==this.getLength()-1&&a>0,u=s<this.getLength()-1,f=i?a-1:a,y=i?this.getLine(f).length:0,b=u?s+1:s,M=u?0:this.getLine(b).length,$=new c(f,y,b,M),A=this.$lines.slice(a,s+1);return this.applyDelta({start:$.start,end:$.end,action:"remove",lines:this.getLinesForRange($)}),A},o.prototype.removeNewLine=function(a){a<this.getLength()-1&&a>=0&&this.applyDelta({start:this.pos(a,this.getLine(a).length),end:this.pos(a+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(a,s){if(a instanceof c||(a=c.fromPoints(a.start,a.end)),s.length===0&&a.isEmpty())return a.start;if(s==this.getTextRange(a))return a.end;this.remove(a);var i;return s?i=this.insert(a.start,s):i=a.start,i},o.prototype.applyDeltas=function(a){for(var s=0;s<a.length;s++)this.applyDelta(a[s])},o.prototype.revertDeltas=function(a){for(var s=a.length-1;s>=0;s--)this.revertDelta(a[s])},o.prototype.applyDelta=function(a,s){var i=a.action=="insert";(i?a.lines.length<=1&&!a.lines[0]:!c.comparePoints(a.start,a.end))||(i&&a.lines.length>2e4?this.$splitAndapplyLargeDelta(a,2e4):(g(this.$lines,a,s),this._signal("change",a)))},o.prototype.$safeApplyDelta=function(a){var s=this.$lines.length;(a.action=="remove"&&a.start.row<s&&a.end.row<s||a.action=="insert"&&a.start.row<=s)&&this.applyDelta(a)},o.prototype.$splitAndapplyLargeDelta=function(a,s){for(var i=a.lines,u=i.length-s+1,f=a.start.row,y=a.start.column,b=0,M=0;b<u;b=M){M+=s-1;var $=i.slice(b,M);$.push(""),this.applyDelta({start:this.pos(f+b,y),end:this.pos(f+M,y=0),action:a.action,lines:$},!0)}a.lines=i.slice(b),a.start.row=f+b,a.start.column=y,this.applyDelta(a,!0)},o.prototype.revertDelta=function(a){this.$safeApplyDelta({start:this.clonePos(a.start),end:this.clonePos(a.end),action:a.action=="insert"?"remove":"insert",lines:a.lines.slice()})},o.prototype.indexToPosition=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=s||0,y=i.length;f<y;f++)if(a-=i[f].length+u,a<0)return{row:f,column:a+i[f].length+u};return{row:y-1,column:a+i[y-1].length+u}},o.prototype.positionToIndex=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=0,y=Math.min(a.row,i.length),b=s||0;b<y;++b)f+=i[b].length+u;return f+a.column},o.prototype.$split=function(a){return a.split(/\r\n|\r|\n/)},o})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",h.implement(r.prototype,m),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function c(d,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=d;var o=this;this.$worker=function(){if(o.running){for(var a=new Date,s=o.currentLine,i=-1,u=o.doc,f=s;o.lines[s];)s++;var y=u.getLength(),b=0;for(o.running=!1;s<y;){o.$tokenizeRow(s),i=s;do s++;while(o.lines[s]);if(b++,b%5===0&&new Date-a>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=s,i==-1&&(i=s),f<=i&&o.fireUpdateEvent(f,i)}}}return c.prototype.setTokenizer=function(d){this.tokenizer=d,this.lines=[],this.states=[],this.start(0)},c.prototype.setDocument=function(d){this.doc=d,this.lines=[],this.states=[],this.stop()},c.prototype.fireUpdateEvent=function(d,r){var o={first:d,last:r};this._signal("update",{data:o})},c.prototype.start=function(d){this.currentLine=Math.min(d||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)},c.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},c.prototype.$updateOnChange=function(d){var r=d.start.row,o=d.end.row-r;if(o===0)this.lines[r]=null;else if(d.action=="remove")this.lines.splice(r,o+1,null),this.states.splice(r,o+1,null);else{var a=Array(o+1);a.unshift(r,1),this.lines.splice.apply(this.lines,a),this.states.splice.apply(this.states,a)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},c.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},c.prototype.getTokens=function(d){return this.lines[d]||this.$tokenizeRow(d)},c.prototype.getState=function(d){return this.currentLine==d&&this.$tokenizeRow(d),this.states[d]||"start"},c.prototype.$tokenizeRow=function(d){var r=this.doc.getLine(d),o=this.states[d-1],a=this.tokenizer.getLineTokens(r,o,d);return this.states[d]+""!=a.state+""?(this.states[d]=a.state,this.lines[d+1]=null,this.currentLine>d+1&&(this.currentLine=d+1)):this.currentLine==d&&(this.currentLine=d+1),this.lines[d]=a.tokens},c.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},c})();h.implement(m.prototype,g),n.BackgroundTokenizer=m}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,p){var h=t("./lib/lang"),g=t("./range").Range,m=(function(){function c(d,r,o){o===void 0&&(o="text"),this.setRegexp(d),this.clazz=r,this.type=o}return c.prototype.setRegexp=function(d){this.regExp+""!=d+""&&(this.regExp=d,this.cache=[])},c.prototype.update=function(d,r,o,a){if(this.regExp)for(var s=a.firstRow,i=a.lastRow,u={},f=s;f<=i;f++){var y=this.cache[f];y==null&&(y=h.getMatchOffsets(o.getLine(f),this.regExp),y.length>this.MAX_RANGES&&(y=y.slice(0,this.MAX_RANGES)),y=y.map(function(A){return new g(f,A.offset,f,A.offset+A.length)}),this.cache[f]=y.length?y:"");for(var b=y.length;b--;){var M=y[b].toScreenRange(o),$=M.toString();u[$]||(u[$]=!0,r.drawSingleLineMarker(d,M,this.clazz,a))}}},c})();m.prototype.MAX_RANGES=500,n.SearchHighlight=m}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,p){var h=(function(){function A(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return A.prototype.addSession=function(S){this.$session=S},A.prototype.add=function(S,E,R){if(!this.$fromUndo&&S!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),E===!1||!this.lastDeltas){this.lastDeltas=[];var L=this.$undoStack.length;L>this.$undoDepth-1&&this.$undoStack.splice(0,L-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),S.id=this.$rev=++this.$maxRev}(S.action=="remove"||S.action=="insert")&&(this.$lastDelta=S),this.lastDeltas.push(S)}},A.prototype.addSelection=function(S,E){this.selections.push({value:S,rev:E||this.$rev})},A.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},A.prototype.markIgnored=function(S,E){E==null&&(E=this.$rev+1);for(var R=this.$undoStack,L=R.length;L--;){var _=R[L][0];if(_.id<=S)break;_.id<E&&(_.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,E){for(var R=this.selections,L=R.length;L--;){var _=R[L];if(_.rev<S)return E&&(_=R[L+1]),_}},A.prototype.getRevision=function(){return this.$rev},A.prototype.getDeltas=function(S,E){E==null&&(E=this.$rev+1);for(var R=this.$undoStack,L=null,_=0,D=R.length;D--;){var w=R[D][0];if(w.id<E&&!L&&(L=D+1),w.id<=S){_=D+1;break}}return R.slice(_,L)},A.prototype.getChangedRanges=function(S,E){E==null&&(E=this.$rev+1)},A.prototype.getChangedLines=function(S,E){E==null&&(E=this.$rev+1)},A.prototype.undo=function(S,E){this.lastDeltas=null;var R=this.$undoStack;if(g(R,R.length)){S||(S=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var L=R.pop(),_=null;return L&&(_=S.undoChanges(L,E),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_}},A.prototype.redo=function(S,E){if(this.lastDeltas=null,S||(S=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var R=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);$(this.$redoStack,R),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(D){D[0].id=++this.$maxRev},this)}var L=this.$redoStack.pop(),_=null;return L&&(_=S.redoChanges(L,E),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_},A.prototype.$syncRev=function(){var S=this.$undoStack,E=S[S.length-1],R=E&&E[0].id||0;this.$redoStackBaseRev=R,this.$rev=R},A.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=[]},A.prototype.canUndo=function(){return this.$undoStack.length>0},A.prototype.canRedo=function(){return this.$redoStack.length>0},A.prototype.bookmark=function(S){S==null&&(S=this.$rev),this.mark=S},A.prototype.isAtBookmark=function(){return this.$rev===this.mark},A.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},A.prototype.fromJSON=function(S){this.reset(),this.$undoStack=S.$undoStack,this.$redoStack=S.$redoStack},A.prototype.$prettyPrint=function(S){return S?o(S):o(this.$undoStack)+`
1354
+ `},o.prototype.getLine=function(a){return this.$lines[a]||""},o.prototype.getLines=function(a,s){return this.$lines.slice(a,s+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(a){return this.getLinesForRange(a).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(a){var s;if(a.start.row===a.end.row)s=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{s=this.getLines(a.start.row,a.end.row),s[0]=(s[0]||"").substring(a.start.column);var i=s.length-1;a.end.row-a.start.row==i&&(s[i]=s[i].substring(0,a.end.column))}return s},o.prototype.insertLines=function(a,s){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(a,s)},o.prototype.removeLines=function(a,s){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(a,s)},o.prototype.insertNewLine=function(a){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(a,["",""])},o.prototype.insert=function(a,s){return this.getLength()<=1&&this.$detectNewLine(s),this.insertMergedLines(a,this.$split(s))},o.prototype.insertInLine=function(a,s){var i=this.clippedPos(a.row,a.column),u=this.pos(a.row,a.column+s.length);return this.applyDelta({start:i,end:u,action:"insert",lines:[s]},!0),this.clonePos(u)},o.prototype.clippedPos=function(a,s){var i=this.getLength();a===void 0?a=i:a<0?a=0:a>=i&&(a=i-1,s=void 0);var u=this.getLine(a);return s==null&&(s=u.length),s=Math.min(Math.max(s,0),u.length),{row:a,column:s}},o.prototype.clonePos=function(a){return{row:a.row,column:a.column}},o.prototype.pos=function(a,s){return{row:a,column:s}},o.prototype.$clipPosition=function(a){var s=this.getLength();return a.row>=s?(a.row=Math.max(0,s-1),a.column=this.getLine(s-1).length):(a.row=Math.max(0,a.row),a.column=Math.min(Math.max(a.column,0),this.getLine(a.row).length)),a},o.prototype.insertFullLines=function(a,s){a=Math.min(Math.max(a,0),this.getLength());var i=0;a<this.getLength()?(s=s.concat([""]),i=0):(s=[""].concat(s),a--,i=this.$lines[a].length),this.insertMergedLines({row:a,column:i},s)},o.prototype.insertMergedLines=function(a,s){var i=this.clippedPos(a.row,a.column),u={row:i.row+s.length-1,column:(s.length==1?i.column:0)+s[s.length-1].length};return this.applyDelta({start:i,end:u,action:"insert",lines:s}),this.clonePos(u)},o.prototype.remove=function(a){var s=this.clippedPos(a.start.row,a.start.column),i=this.clippedPos(a.end.row,a.end.column);return this.applyDelta({start:s,end:i,action:"remove",lines:this.getLinesForRange({start:s,end:i})}),this.clonePos(s)},o.prototype.removeInLine=function(a,s,i){var u=this.clippedPos(a,s),p=this.clippedPos(a,i);return this.applyDelta({start:u,end:p,action:"remove",lines:this.getLinesForRange({start:u,end:p})},!0),this.clonePos(u)},o.prototype.removeFullLines=function(a,s){a=Math.min(Math.max(0,a),this.getLength()-1),s=Math.min(Math.max(0,s),this.getLength()-1);var i=s==this.getLength()-1&&a>0,u=s<this.getLength()-1,p=i?a-1:a,y=i?this.getLine(p).length:0,b=u?s+1:s,M=u?0:this.getLine(b).length,x=new c(p,y,b,M),A=this.$lines.slice(a,s+1);return this.applyDelta({start:x.start,end:x.end,action:"remove",lines:this.getLinesForRange(x)}),A},o.prototype.removeNewLine=function(a){a<this.getLength()-1&&a>=0&&this.applyDelta({start:this.pos(a,this.getLine(a).length),end:this.pos(a+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(a,s){if(a instanceof c||(a=c.fromPoints(a.start,a.end)),s.length===0&&a.isEmpty())return a.start;if(s==this.getTextRange(a))return a.end;this.remove(a);var i;return s?i=this.insert(a.start,s):i=a.start,i},o.prototype.applyDeltas=function(a){for(var s=0;s<a.length;s++)this.applyDelta(a[s])},o.prototype.revertDeltas=function(a){for(var s=a.length-1;s>=0;s--)this.revertDelta(a[s])},o.prototype.applyDelta=function(a,s){var i=a.action=="insert";(i?a.lines.length<=1&&!a.lines[0]:!c.comparePoints(a.start,a.end))||(i&&a.lines.length>2e4?this.$splitAndapplyLargeDelta(a,2e4):(g(this.$lines,a,s),this._signal("change",a)))},o.prototype.$safeApplyDelta=function(a){var s=this.$lines.length;(a.action=="remove"&&a.start.row<s&&a.end.row<s||a.action=="insert"&&a.start.row<=s)&&this.applyDelta(a)},o.prototype.$splitAndapplyLargeDelta=function(a,s){for(var i=a.lines,u=i.length-s+1,p=a.start.row,y=a.start.column,b=0,M=0;b<u;b=M){M+=s-1;var x=i.slice(b,M);x.push(""),this.applyDelta({start:this.pos(p+b,y),end:this.pos(p+M,y=0),action:a.action,lines:x},!0)}a.lines=i.slice(b),a.start.row=p+b,a.start.column=y,this.applyDelta(a,!0)},o.prototype.revertDelta=function(a){this.$safeApplyDelta({start:this.clonePos(a.start),end:this.clonePos(a.end),action:a.action=="insert"?"remove":"insert",lines:a.lines.slice()})},o.prototype.indexToPosition=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,p=s||0,y=i.length;p<y;p++)if(a-=i[p].length+u,a<0)return{row:p,column:a+i[p].length+u};return{row:y-1,column:a+i[y-1].length+u}},o.prototype.positionToIndex=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,p=0,y=Math.min(a.row,i.length),b=s||0;b<y;++b)p+=i[b].length+u;return p+a.column},o.prototype.$split=function(a){return a.split(/\r\n|\r|\n/)},o})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",h.implement(r.prototype,m),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,d){var h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function c(f,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=f;var o=this;this.$worker=function(){if(o.running){for(var a=new Date,s=o.currentLine,i=-1,u=o.doc,p=s;o.lines[s];)s++;var y=u.getLength(),b=0;for(o.running=!1;s<y;){o.$tokenizeRow(s),i=s;do s++;while(o.lines[s]);if(b++,b%5===0&&new Date-a>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=s,i==-1&&(i=s),p<=i&&o.fireUpdateEvent(p,i)}}}return c.prototype.setTokenizer=function(f){this.tokenizer=f,this.lines=[],this.states=[],this.start(0)},c.prototype.setDocument=function(f){this.doc=f,this.lines=[],this.states=[],this.stop()},c.prototype.fireUpdateEvent=function(f,r){var o={first:f,last:r};this._signal("update",{data:o})},c.prototype.start=function(f){this.currentLine=Math.min(f||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)},c.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},c.prototype.$updateOnChange=function(f){var r=f.start.row,o=f.end.row-r;if(o===0)this.lines[r]=null;else if(f.action=="remove")this.lines.splice(r,o+1,null),this.states.splice(r,o+1,null);else{var a=Array(o+1);a.unshift(r,1),this.lines.splice.apply(this.lines,a),this.states.splice.apply(this.states,a)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},c.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},c.prototype.getTokens=function(f){return this.lines[f]||this.$tokenizeRow(f)},c.prototype.getState=function(f){return this.currentLine==f&&this.$tokenizeRow(f),this.states[f]||"start"},c.prototype.$tokenizeRow=function(f){var r=this.doc.getLine(f),o=this.states[f-1],a=this.tokenizer.getLineTokens(r,o,f);return this.states[f]+""!=a.state+""?(this.states[f]=a.state,this.lines[f+1]=null,this.currentLine>f+1&&(this.currentLine=f+1)):this.currentLine==f&&(this.currentLine=f+1),this.lines[f]=a.tokens},c.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},c})();h.implement(m.prototype,g),n.BackgroundTokenizer=m}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,d){var h=t("./lib/lang"),g=t("./range").Range,m=(function(){function c(f,r,o){o===void 0&&(o="text"),this.setRegexp(f),this.clazz=r,this.type=o}return c.prototype.setRegexp=function(f){this.regExp+""!=f+""&&(this.regExp=f,this.cache=[])},c.prototype.update=function(f,r,o,a){if(this.regExp)for(var s=a.firstRow,i=a.lastRow,u={},p=s;p<=i;p++){var y=this.cache[p];y==null&&(y=h.getMatchOffsets(o.getLine(p),this.regExp),y.length>this.MAX_RANGES&&(y=y.slice(0,this.MAX_RANGES)),y=y.map(function(A){return new g(p,A.offset,p,A.offset+A.length)}),this.cache[p]=y.length?y:"");for(var b=y.length;b--;){var M=y[b].toScreenRange(o),x=M.toString();u[x]||(u[x]=!0,r.drawSingleLineMarker(f,M,this.clazz,a))}}},c})();m.prototype.MAX_RANGES=500,n.SearchHighlight=m}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,d){var h=(function(){function A(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return A.prototype.addSession=function(S){this.$session=S},A.prototype.add=function(S,$,R){if(!this.$fromUndo&&S!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),$===!1||!this.lastDeltas){this.lastDeltas=[];var L=this.$undoStack.length;L>this.$undoDepth-1&&this.$undoStack.splice(0,L-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),S.id=this.$rev=++this.$maxRev}(S.action=="remove"||S.action=="insert")&&(this.$lastDelta=S),this.lastDeltas.push(S)}},A.prototype.addSelection=function(S,$){this.selections.push({value:S,rev:$||this.$rev})},A.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},A.prototype.markIgnored=function(S,$){$==null&&($=this.$rev+1);for(var R=this.$undoStack,L=R.length;L--;){var T=R[L][0];if(T.id<=S)break;T.id<$&&(T.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,$){for(var R=this.selections,L=R.length;L--;){var T=R[L];if(T.rev<S)return $&&(T=R[L+1]),T}},A.prototype.getRevision=function(){return this.$rev},A.prototype.getDeltas=function(S,$){$==null&&($=this.$rev+1);for(var R=this.$undoStack,L=null,T=0,D=R.length;D--;){var w=R[D][0];if(w.id<$&&!L&&(L=D+1),w.id<=S){T=D+1;break}}return R.slice(T,L)},A.prototype.getChangedRanges=function(S,$){$==null&&($=this.$rev+1)},A.prototype.getChangedLines=function(S,$){$==null&&($=this.$rev+1)},A.prototype.undo=function(S,$){this.lastDeltas=null;var R=this.$undoStack;if(g(R,R.length)){S||(S=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var L=R.pop(),T=null;return L&&(T=S.undoChanges(L,$),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,T}},A.prototype.redo=function(S,$){if(this.lastDeltas=null,S||(S=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var R=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);x(this.$redoStack,R),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(D){D[0].id=++this.$maxRev},this)}var L=this.$redoStack.pop(),T=null;return L&&(T=S.redoChanges(L,$),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,T},A.prototype.$syncRev=function(){var S=this.$undoStack,$=S[S.length-1],R=$&&$[0].id||0;this.$redoStackBaseRev=R,this.$rev=R},A.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=[]},A.prototype.canUndo=function(){return this.$undoStack.length>0},A.prototype.canRedo=function(){return this.$redoStack.length>0},A.prototype.bookmark=function(S){S==null&&(S=this.$rev),this.mark=S},A.prototype.isAtBookmark=function(){return this.$rev===this.mark},A.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},A.prototype.fromJSON=function(S){this.reset(),this.$undoStack=S.$undoStack,this.$redoStack=S.$redoStack},A.prototype.$prettyPrint=function(S){return S?o(S):o(this.$undoStack)+`
1355
1355
  ---
1356
- `+o(this.$redoStack)},A})();h.prototype.hasUndo=h.prototype.canUndo,h.prototype.hasRedo=h.prototype.canRedo,h.prototype.isClean=h.prototype.isAtBookmark,h.prototype.markClean=h.prototype.bookmark;function g(A,S){for(var E=S;E--;){var R=A[E];if(R&&!R[0].ignore){for(;E<S-1;){var L=i(A[E],A[E+1]);A[E]=L[0],A[E+1]=L[1],E++}return!0}}}var m=t("./range").Range,c=m.comparePoints;m.comparePoints;function d(A){return{row:A.row,column:A.column}}function r(A){return{start:d(A.start),end:d(A.end),action:A.action,lines:A.lines.slice()}}function o(A){if(A=A||this,Array.isArray(A))return A.map(o).join(`
1356
+ `+o(this.$redoStack)},A})();h.prototype.hasUndo=h.prototype.canUndo,h.prototype.hasRedo=h.prototype.canRedo,h.prototype.isClean=h.prototype.isAtBookmark,h.prototype.markClean=h.prototype.bookmark;function g(A,S){for(var $=S;$--;){var R=A[$];if(R&&!R[0].ignore){for(;$<S-1;){var L=i(A[$],A[$+1]);A[$]=L[0],A[$+1]=L[1],$++}return!0}}}var m=t("./range").Range,c=m.comparePoints;m.comparePoints;function f(A){return{row:A.row,column:A.column}}function r(A){return{start:f(A.start),end:f(A.end),action:A.action,lines:A.lines.slice()}}function o(A){if(A=A||this,Array.isArray(A))return A.map(o).join(`
1357
1357
  `);var S="";return A.action?(S=A.action=="insert"?"+":"-",S+="["+A.lines+"]"):A.value&&(Array.isArray(A.value)?S=A.value.map(a).join(`
1358
- `):S=a(A.value)),A.start&&(S+=a(A)),(A.id||A.rev)&&(S+=" ("+(A.id||A.rev)+")"),S}function a(A){return A.start.row+":"+A.start.column+"=>"+A.end.row+":"+A.end.column}function s(A,S){var E=A.action=="insert",R=S.action=="insert";if(E&&R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.start,A.start)<=0)f(A,S,1);else return null;else if(E&&!R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.end,A.start)<=0)f(A,S,-1);else return null;else if(!E&&R)if(c(S.start,A.start)>=0)f(S,A,1);else if(c(S.start,A.start)<=0)f(A,S,1);else return null;else if(!E&&!R)if(c(S.start,A.start)>=0)f(S,A,1);else if(c(S.end,A.start)<=0)f(A,S,-1);else return null;return[S,A]}function i(A,S){for(var E=A.length;E--;)for(var R=0;R<S.length;R++)if(!s(A[E],S[R])){for(;E<A.length;){for(;R--;)s(S[R],A[E]);R=S.length,E++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var E=A.action=="insert",R=S.action=="insert";if(E&&R)c(A.start,S.start)<0?f(S,A,1):f(A,S,1);else if(E&&!R)c(A.start,S.end)>=0?f(A,S,-1):(c(A.start,S.start)<=0||f(A,m.fromPoints(S.start,A.start),-1),f(S,A,1));else if(!E&&R)c(S.start,A.end)>=0?f(S,A,-1):(c(S.start,A.start)<=0||f(S,m.fromPoints(A.start,S.start),-1),f(A,S,1));else if(!E&&!R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.end,A.start)<=0)f(A,S,-1);else{var L,_;return c(A.start,S.start)<0&&(L=A,A=b(A,S.start)),c(A.end,S.end)>0&&(_=b(A,S.end)),y(S.end,A.start,A.end,-1),_&&!L&&(A.lines=_.lines,A.start=_.start,A.end=_.end,_=A),[S,L,_].filter(Boolean)}return[S,A]}function f(A,S,E){y(A.start,S.start,S.end,E),y(A.end,S.start,S.end,E)}function y(A,S,E,R){A.row==(R==1?S:E).row&&(A.column+=R*(E.column-S.column)),A.row+=R*(E.row-S.row)}function b(A,S){var E=A.lines,R=A.end;A.end=d(S);var L=A.end.row-A.start.row,_=E.splice(L,E.length),D=L?S.column:S.column-A.start.column;E.push(_[0].substring(0,D)),_[0]=_[0].substr(D);var w={start:d(S),end:R,lines:_,action:A.action};return w}function M(A,S){S=r(S);for(var E=A.length;E--;){for(var R=A[E],L=0;L<R.length;L++){var _=R[L],D=u(_,S);S=D[0],D.length!=2&&(D[2]?(R.splice(L+1,1,D[1],D[2]),L++):D[1]||(R.splice(L,1),L--))}R.length||A.splice(E,1)}return A}function $(A,S){for(var E=0;E<S.length;E++)for(var R=S[E],L=0;L<R.length;L++)M(A,R[L])}n.UndoManager=h}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,p){var h=t("../range").Range,g=(function(){function m(c,d){this.foldData=c,Array.isArray(d)?this.folds=d:d=this.folds=[d];var r=d[d.length-1];this.range=new h(d[0].start.row,d[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return m.prototype.shiftRow=function(c){this.start.row+=c,this.end.row+=c,this.folds.forEach(function(d){d.start.row+=c,d.end.row+=c})},m.prototype.addFold=function(c){if(c.sameRow){if(c.start.row<this.startRow||c.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(c),this.folds.sort(function(d,r){return-d.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(c.start.row,c.start.column)>0?(this.end.row=c.end.row,this.end.column=c.end.column):this.range.compareStart(c.end.row,c.end.column)<0&&(this.start.row=c.start.row,this.start.column=c.start.column)}else if(c.start.row==this.end.row)this.folds.push(c),this.end.row=c.end.row,this.end.column=c.end.column;else if(c.end.row==this.start.row)this.folds.unshift(c),this.start.row=c.start.row,this.start.column=c.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");c.foldLine=this},m.prototype.containsRow=function(c){return c>=this.start.row&&c<=this.end.row},m.prototype.walk=function(c,d,r){var o=0,a=this.folds,s,i,u,f=!0;d==null&&(d=this.end.row,r=this.end.column);for(var y=0;y<a.length;y++){if(s=a[y],i=s.range.compareStart(d,r),i==-1){c(null,d,r,o,f);return}if(u=c(null,s.start.row,s.start.column,o,f),u=!u&&c(s.placeholder,s.start.row,s.start.column,o),u||i===0)return;f=!s.sameRow,o=s.end.column}c(null,d,r,o,f)},m.prototype.getNextFoldTo=function(c,d){for(var r,o,a=0;a<this.folds.length;a++){if(r=this.folds[a],o=r.range.compareEnd(c,d),o==-1)return{fold:r,kind:"after"};if(o===0)return{fold:r,kind:"inside"}}return null},m.prototype.addRemoveChars=function(c,d,r){var o=this.getNextFoldTo(c,d),a,s;if(o){if(a=o.fold,o.kind=="inside"&&a.start.column!=d&&a.start.row!=c)window.console&&window.console.log(c,d,a);else if(a.start.row==c){s=this.folds;var i=s.indexOf(a);for(i===0&&(this.start.column+=r),i;i<s.length;i++){if(a=s[i],a.start.column+=r,!a.sameRow)return;a.end.column+=r}this.end.column+=r}}},m.prototype.split=function(c,d){var r=this.getNextFoldTo(c,d);if(!r||r.kind=="inside")return null;var o=r.fold,a=this.folds,s=this.foldData,i=a.indexOf(o),u=a[i-1];this.end.row=u.end.row,this.end.column=u.end.column,a=a.splice(i,a.length-i);var f=new m(s,a);return s.splice(s.indexOf(this)+1,0,f),f},m.prototype.merge=function(c){for(var d=c.folds,r=0;r<d.length;r++)this.addFold(d[r]);var o=this.foldData;o.splice(o.indexOf(c),1)},m.prototype.toString=function(){var c=[this.range.toString()+": ["];return this.folds.forEach(function(d){c.push(" "+d.toString())}),c.push("]"),c.join(`
1359
- `)},m.prototype.idxToPosition=function(c){for(var d=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(c-=o.start.column-d,c<0)return{row:o.start.row,column:o.start.column+c};if(c-=o.placeholder.length,c<0)return o.start;d=o.end.column}return{row:this.end.row,column:this.end.column+c}},m})();n.FoldLine=g}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,p){var h=t("./range").Range,g=h.comparePoints,m=(function(){function c(){this.ranges=[],this.$bias=1}return c.prototype.pointIndex=function(d,r,o){for(var a=this.ranges,s=o||0;s<a.length;s++){var i=a[s],u=g(d,i.end);if(!(u>0)){var f=g(d,i.start);return u===0?r&&f!==0?-s-2:s:f>0||f===0&&!r?s:-s-1}}return-s-1},c.prototype.add=function(d){var r=!d.isEmpty(),o=this.pointIndex(d.start,r);o<0&&(o=-o-1);var a=this.pointIndex(d.end,r,o);return a<0?a=-a-1:a++,this.ranges.splice(o,a-o,d)},c.prototype.addList=function(d){for(var r=[],o=d.length;o--;)r.push.apply(r,this.add(d[o]));return r},c.prototype.substractPoint=function(d){var r=this.pointIndex(d);if(r>=0)return this.ranges.splice(r,1)},c.prototype.merge=function(){var d=[],r=this.ranges;r=r.sort(function(u,f){return g(u.start,f.start)});for(var o=r[0],a,s=1;s<r.length;s++){a=o,o=r[s];var i=g(a.end,o.start);i<0||i==0&&!a.isEmpty()&&!o.isEmpty()||(g(a.end,o.end)<0&&(a.end.row=o.end.row,a.end.column=o.end.column),r.splice(s,1),d.push(o),o=a,s--)}return this.ranges=r,d},c.prototype.contains=function(d,r){return this.pointIndex({row:d,column:r})>=0},c.prototype.containsPoint=function(d){return this.pointIndex(d)>=0},c.prototype.rangeAtPoint=function(d){var r=this.pointIndex(d);if(r>=0)return this.ranges[r]},c.prototype.clipRows=function(d,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<d)return[];var a=this.pointIndex({row:d,column:0});a<0&&(a=-a-1);var s=this.pointIndex({row:r,column:0},a);s<0&&(s=-s-1);for(var i=[],u=a;u<s;u++)i.push(o[u]);return i},c.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},c.prototype.attach=function(d){this.session&&this.detach(),this.session=d,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},c.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},c.prototype.$onChange=function(d){for(var r=d.start,o=d.end,a=r.row,s=o.row,i=this.ranges,u=0,f=i.length;u<f;u++){var y=i[u];if(y.end.row>=a)break}if(d.action=="insert")for(var b=s-a,M=-r.column+o.column;u<f;u++){var y=i[u];if(y.start.row>a)break;if(y.start.row==a&&y.start.column>=r.column&&(y.start.column==r.column&&this.$bias<=0||(y.start.column+=M,y.start.row+=b)),y.end.row==a&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&M>0&&u<f-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=M),y.end.column+=M,y.end.row+=b}}else for(var b=a-s,M=r.column-o.column;u<f;u++){var y=i[u];if(y.start.row>s)break;y.end.row<s&&(a<y.end.row||a==y.end.row&&r.column<y.end.column)?(y.end.row=a,y.end.column=r.column):y.end.row==s?y.end.column<=o.column?(b||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=M,y.end.row+=b):y.end.row>s&&(y.end.row+=b),y.start.row<s&&(a<y.start.row||a==y.start.row&&r.column<y.start.column)?(y.start.row=a,y.start.column=r.column):y.start.row==s?y.start.column<=o.column?(b||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=M,y.start.row+=b):y.start.row>s&&(y.start.row+=b)}if(b!=0&&u<f)for(;u<f;u++){var y=i[u];y.start.row+=b,y.end.row+=b}},c})();m.prototype.comparePoints=g,n.RangeList=m}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,p){var h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(u[y]=f[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../range_list").RangeList,m=(function(a){h(s,a);function s(i,u){var f=a.call(this)||this;return f.foldLine=null,f.placeholder=u,f.range=i,f.start=i.start,f.end=i.end,f.sameRow=i.start.row==i.end.row,f.subFolds=f.ranges=[],f}return s.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},s.prototype.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(u){u.setFoldLine(i)})},s.prototype.clone=function(){var i=this.range.clone(),u=new s(i,this.placeholder);return this.subFolds.forEach(function(f){u.subFolds.push(f.clone())}),u.collapseChildren=this.collapseChildren,u},s.prototype.addSubFold=function(i){if(!this.range.isEqual(i)){d(i,this.start);for(var M=i.start.row,$=i.start.column,u=0,f=-1;u<this.subFolds.length&&(f=this.subFolds[u].range.compare(M,$),f==1);u++);var y=this.subFolds[u],b=0;if(f==0){if(y.range.containsRange(i))return y.addSubFold(i);b=1}for(var M=i.range.end.row,$=i.range.end.column,A=u,f=-1;A<this.subFolds.length&&(f=this.subFolds[A].range.compare(M,$),f==1);A++);f==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),E=f==0?S.length-1:S.length,R=b;R<E;R++)i.addSubFold(S[R]);return i.setFoldLine(this.foldLine),i}},s.prototype.restoreRange=function(i){return o(i,this.start)},s})(g);function c(a,s){a.row-=s.row,a.row==0&&(a.column-=s.column)}function d(a,s){c(a.start,s),c(a.end,s)}function r(a,s){a.row==0&&(a.column+=s.column),a.row+=s.row}function o(a,s){r(a.start,s),r(a.end,s)}n.Fold=m}),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(t,n,p){var h=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,c=t("../token_iterator").TokenIterator,d=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(o,a,s){var i=this.getFoldLine(o);if(!i)return null;for(var u=i.folds,f=0;f<u.length;f++){var y=u[f].range;if(y.contains(o,a)){if(s==1&&y.isEnd(o,a)&&!y.isEmpty())continue;if(s==-1&&y.isStart(o,a)&&!y.isEmpty())continue;return u[f]}}},this.getFoldsInRange=function(o){var a=o.start,s=o.end,i=this.$foldData,u=[];a.column+=1,s.column-=1;for(var f=0;f<i.length;f++){var y=i[f].range.compareRange(o);if(y!=2){if(y==-2)break;for(var b=i[f].folds,M=0;M<b.length;M++){var $=b[M];if(y=$.range.compareRange(o),y==-2)break;if(y==2)continue;if(y==42)break;u.push($)}}}return a.column-=1,s.column+=1,u},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var a=[];o.forEach(function(s){a=a.concat(this.getFoldsInRange(s))},this)}else var a=this.getFoldsInRange(o);return a},this.getAllFolds=function(){for(var o=[],a=this.$foldData,s=0;s<a.length;s++)for(var i=0;i<a[s].folds.length;i++)o.push(a[s].folds[i]);return o},this.getFoldStringAt=function(o,a,s,i){if(i=i||this.getFoldLine(o),!i)return null;for(var u={end:{column:0}},f,y,b=0;b<i.folds.length;b++){y=i.folds[b];var M=y.range.compareEnd(o,a);if(M==-1){f=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(M===0)return null;u=y}return f||(f=this.getLine(y.start.row).substring(u.end.column)),s==-1?f.substring(0,a-u.end.column):s==1?f.substring(a-u.end.column):f},this.getFoldLine=function(o,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[i];if(u.start.row<=o&&u.end.row>=o)return u;if(u.end.row>o)return null}return null},this.getNextFoldLine=function(o,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[i];if(u.end.row>=o)return u}return null},this.getFoldedRowCount=function(o,a){for(var s=this.$foldData,i=a-o+1,u=0;u<s.length;u++){var f=s[u],y=f.end.row,b=f.start.row;if(y>=a){b<a&&(b>=o?i-=a-b:i=0);break}else y>=o&&(b>=o?i-=y-b:i-=y-o+1)}return i},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(a,s){return a.start.row-s.start.row}),o},this.addFold=function(o,a){var s=this.$foldData,i=!1,u;o instanceof m?u=o:(u=new m(a,o),u.collapseChildren=a.collapseChildren),this.$clipRangeToDocument(u.range);var f=u.start.row,y=u.start.column,b=u.end.row,M=u.end.column,$=this.getFoldAt(f,y,1),A=this.getFoldAt(b,M,-1);if($&&A==$)return $.addSubFold(u);$&&!$.range.isStart(f,y)&&this.removeFold($),A&&!A.range.isEnd(b,M)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(_){u.addSubFold(_)}));for(var E=0;E<s.length;E++){var R=s[E];if(b==R.start.row){R.addFold(u),i=!0;break}else if(f==R.end.row){if(R.addFold(u),i=!0,!u.sameRow){var L=s[E+1];if(L&&L.start.row==b){R.merge(L);break}}break}else if(b<=R.start.row)break}return i||(R=this.$addFoldLine(new g(this.$foldData,u))),this.$useWrapMode?this.$updateWrapData(R.start.row,R.start.row):this.$updateRowLengthCache(R.start.row,R.start.row),this.$modified=!0,this._signal("changeFold",{data:u,action:"add"}),u},this.addFolds=function(o){o.forEach(function(a){this.addFold(a)},this)},this.removeFold=function(o){var a=o.foldLine,s=a.start.row,i=a.end.row,u=this.$foldData,f=a.folds;if(f.length==1)u.splice(u.indexOf(a),1);else if(a.range.isEnd(o.end.row,o.end.column))f.pop(),a.end.row=f[f.length-1].end.row,a.end.column=f[f.length-1].end.column;else if(a.range.isStart(o.start.row,o.start.column))f.shift(),a.start.row=f[0].start.row,a.start.column=f[0].start.column;else if(o.sameRow)f.splice(f.indexOf(o),1);else{var y=a.split(o.start.row,o.start.column);f=y.folds,f.shift(),y.start.row=f[0].start.row,y.start.column=f[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(s,i):this.$updateRowLengthCache(s,i)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var a=[],s=0;s<o.length;s++)a.push(o[s]);a.forEach(function(i){this.removeFold(i)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(a){o.restoreRange(a),this.addFold(a)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(a){this.expandFold(a)},this)},this.unfold=function(o,a){var s,i;if(o==null)s=new h(0,0,this.getLength(),0),a==null&&(a=!0);else if(typeof o=="number")s=new h(o,0,o,this.getLine(o).length);else if("row"in o)s=h.fromPoints(o,o);else{if(Array.isArray(o))return i=[],o.forEach(function(f){i=i.concat(this.unfold(f))},this),i;s=o}i=this.getFoldsInRangeList(s);for(var u=i;i.length==1&&h.comparePoints(i[0].start,s.start)<0&&h.comparePoints(i[0].end,s.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(s);if(a!=!1?this.removeFolds(i):this.expandFolds(i),u.length)return u},this.isRowFolded=function(o,a){return!!this.getFoldLine(o,a)},this.getRowFoldEnd=function(o,a){var s=this.getFoldLine(o,a);return s?s.end.row:o},this.getRowFoldStart=function(o,a){var s=this.getFoldLine(o,a);return s?s.start.row:o},this.getFoldDisplayLine=function(o,a,s,i,u){i==null&&(i=o.start.row),u==null&&(u=0),a==null&&(a=o.end.row),s==null&&(s=this.getLine(a).length);var f=this.doc,y="";return o.walk(function(b,M,$,A){if(!(M<i)){if(M==i){if($<u)return;A=Math.max(u,A)}b!=null?y+=b:y+=f.getLine(M).substring(A,$)}},a,s),y},this.getDisplayLine=function(o,a,s,i){var u=this.getFoldLine(o);if(u)return this.getFoldDisplayLine(u,o,a,s,i);var f;return f=this.doc.getLine(o),f.substring(i||0,a||f.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(a){var s=a.folds.map(function(i){return i.clone()});return new g(o,s)}),o},this.toggleFold=function(o){var a=this.selection,s=a.getRange(),i,u;if(s.isEmpty()){var f=s.start;if(i=this.getFoldAt(f.row,f.column),i){this.expandFold(i);return}else(u=this.findMatchingBracket(f))?s.comparePoint(u)==1?s.end=u:(s.start=u,s.start.column++,s.end.column--):(u=this.findMatchingBracket({row:f.row,column:f.column+1}))?(s.comparePoint(u)==1?s.end=u:s.start=u,s.start.column++):s=this.getCommentFoldRange(f.row,f.column)||s}else{var y=this.getFoldsInRange(s);if(o&&y.length){this.expandFolds(y);return}else y.length==1&&(i=y[0])}if(i||(i=this.getFoldAt(s.start.row,s.start.column)),i&&i.range.toString()==s.toString()){this.expandFold(i);return}var b="...";if(!s.isMultiLine()){if(b=this.getTextRange(s),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,s)},this.getCommentFoldRange=function(o,a,s){var i=new c(this,o,a),u=i.getCurrentToken(),f=u&&u.type;if(u&&/^comment|string/.test(f)){f=f.match(/comment|string/)[0],f=="comment"&&(f+="|doc-start|\\.doc");var y=new RegExp(f),b=new h;if(s!=1){do u=i.stepBackward();while(u&&y.test(u.type));u=i.stepForward()}b.start.row=i.getCurrentTokenRow(),b.start.column=i.getCurrentTokenColumn()+u.value.length,i=new c(this,o,a);var M=this.getState(i.$row);if(s!=-1){var $=-1;do if(u=i.stepForward(),$==-1){var A=this.getState(i.$row);M.toString()!==A.toString()&&($=i.$row)}else if(i.$row>$)break;while(u&&y.test(u.type));u=i.stepBackward()}else u=i.getCurrentToken();return b.end.row=i.getCurrentTokenRow(),b.end.column=i.getCurrentTokenColumn(),b}},this.foldAll=function(o,a,s,i){s==null&&(s=1e5);var u=this.foldWidgets;if(u){a=a||this.getLength(),o=o||0;for(var f=o;f<a;f++)if(u[f]==null&&(u[f]=this.getFoldWidget(f)),u[f]=="start"&&!(i&&!i(f))){var y=this.getFoldWidgetRange(f);y&&y.isMultiLine()&&y.end.row<=a&&y.start.row>=o&&(f=y.end.row,y.collapseChildren=s,this.addFold("...",y))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(a){for(var s=o.getTokens(a),i=0;i<s.length;i++){var u=s[i];if(!(u.type=="text"&&/^\s+$/.test(u.value)))return!!/comment/.test(u.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var a=this.$foldMode;this.$setFolding(null),this.$setFolding(a)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(o,a){var s=this.foldWidgets;if(!s||a&&s[o])return{};for(var i=o-1,u;i>=0;){var f=s[i];if(f==null&&(f=s[i]=this.getFoldWidget(i)),f=="start"){var y=this.getFoldWidgetRange(i);if(u||(u=y),y&&y.end.row>=o)break}i--}return{range:i!==-1&&y,firstRange:u}},this.onFoldWidgetClick=function(o,a){a instanceof d&&(a=a.domEvent);var s={children:a.shiftKey,all:a.ctrlKey||a.metaKey,siblings:a.altKey},i=this.$toggleFoldWidget(o,s);if(!i){var u=a.target||a.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,a){if(this.getFoldWidget){var s=this.getFoldWidget(o),i=this.getLine(o),u=s==="end"?-1:1,f=this.getFoldAt(o,u===-1?0:i.length,u);if(f)return a.children||a.all?this.removeFold(f):this.expandFold(f),f;var y=this.getFoldWidgetRange(o,!0);if(y&&!y.isMultiLine()&&(f=this.getFoldAt(y.start.row,y.start.column,1),f&&y.isEqual(f.range)))return this.removeFold(f),f;if(a.siblings){var b=this.getParentFoldRangeData(o);if(b.range)var M=b.range.start.row+1,$=b.range.end.row;this.foldAll(M,$,a.all?1e4:0)}else a.children?($=y?y.end.row:this.getLength(),this.foldAll(o+1,$,a.all?1e4:0)):y&&(a.all&&(y.collapseChildren=1e4),this.addFold("...",y));return y}},this.toggleFoldWidget=function(o){var a=this.selection.getCursor().row;a=this.getRowFoldStart(a);var s=this.$toggleFoldWidget(a,{});if(!s){var i=this.getParentFoldRangeData(a,!0);if(s=i.range||i.firstRange,s){a=s.start.row;var u=this.getFoldAt(a,this.getLine(a).length,1);u?this.removeFold(u):this.addFold("...",s)}}},this.updateFoldWidgets=function(o){var a=o.start.row,s=o.end.row-a;if(s===0)this.foldWidgets[a]=null;else if(o.action=="remove")this.foldWidgets.splice(a,s+1,null);else{var i=Array(s+1);i.unshift(a,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(o){var a=o.data;a.first!=a.last&&this.foldWidgets.length>a.first&&this.foldWidgets.splice(a.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,p){var h=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(c,d){if(c.column==0)return null;var r=d||this.getLine(c.row).charAt(c.column-1);if(r=="")return null;var o=r.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],c):this.$findOpeningBracket(o[2],c):null},this.getBracketRange=function(c){var d=this.getLine(c.row),r=!0,o,a=d.charAt(c.column-1),s=a&&a.match(/([\(\[\{])|([\)\]\}])/);if(s||(a=d.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(/([\(\[\{])|([\)\]\}])/),r=!1),!s)return null;if(s[1]){var i=this.$findClosingBracket(s[1],c);if(!i)return null;o=g.fromPoints(c,i),r||(o.end.column++,o.start.column--),o.cursor=o.end}else{var i=this.$findOpeningBracket(s[2],c);if(!i)return null;o=g.fromPoints(i,c),r||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(c,d){var r=this.getLine(c.row),o=/([\(\[\{])|([\)\]\}])/,a=!d&&r.charAt(c.column-1),s=a&&a.match(o);if(s||(a=(d===void 0||d)&&r.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(o)),!s)return null;var i=new g(c.row,c.column-1,c.row,c.column),u=s[1]?this.$findClosingBracket(s[1],c):this.$findOpeningBracket(s[2],c);if(!u)return[i];var f=new g(u.row,u.column,u.row,u.column+1);return[i,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,d,r){var o=this.$brackets[c],a=1,s=new h(this,d.row,d.column),i=s.getCurrentToken();if(i||(i=s.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var u=d.column-s.getCurrentTokenColumn()-2,f=i.value;;){for(;u>=0;){var y=f.charAt(u);if(y==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else y==c&&(a+=1);u-=1}do i=s.stepBackward();while(i&&!r.test(i.type));if(i==null)break;f=i.value,u=f.length-1}return null}},this.$findClosingBracket=function(c,d,r){var o=this.$brackets[c],a=1,s=new h(this,d.row,d.column),i=s.getCurrentToken();if(i||(i=s.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var u=d.column-s.getCurrentTokenColumn();;){for(var f=i.value,y=f.length;u<y;){var b=f.charAt(u);if(b==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else b==c&&(a+=1);u+=1}do i=s.stepForward();while(i&&!r.test(i.type));if(i==null)break;u=0}return null}},this.getMatchingTags=function(c){var d=new h(this,c.row,c.column),r=this.$findTagName(d);if(r){var o=d.stepBackward();return o.value==="<"?this.$findClosingTag(d,r):this.$findOpeningTag(d,r)}},this.$findTagName=function(c){var d=c.getCurrentToken(),r=!1,o=!1;if(d&&d.type.indexOf("tag-name")===-1)do o?d=c.stepBackward():d=c.stepForward(),d&&(d.value==="/>"?o=!0:d.type.indexOf("tag-name")!==-1&&(r=!0));while(d&&!r);return d},this.$findClosingTag=function(c,d){var r,o=d.value,a=d.value,s=0,i=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);d=c.stepForward();var u=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length),f=!1;do{if(r=d,r.type.indexOf("tag-close")!==-1&&!f){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=!0}if(d=c.stepForward(),d){if(d.value===">"&&!f){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=!0}if(d.type.indexOf("tag-name")!==-1){if(o=d.value,a===o){if(r.value==="<")s++;else if(r.value==="</"&&(s--,s<0)){c.stepBackward();var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2);d=c.stepForward();var M=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length);if(d.type.indexOf("tag-close")===-1&&(d=c.stepForward()),d&&d.value===">")var $=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);else return}}}else if(a===o&&d.value==="/>"&&(s--,s<0))var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2),M=b,$=M,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(d&&s>=0);if(i&&y&&b&&$&&u&&M)return{openTag:new g(i.start.row,i.start.column,y.end.row,y.end.column),closeTag:new g(b.start.row,b.start.column,$.end.row,$.end.column),openTagName:u,closeTagName:M}},this.$findOpeningTag=function(c,d){var r=c.getCurrentToken(),o=d.value,a=0,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+2,f=new g(s,i,s,u);c.stepForward();var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length);if(d.type.indexOf("tag-close")===-1&&(d=c.stepForward()),!(!d||d.value!==">")){var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);c.stepBackward(),c.stepBackward();do if(d=r,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+d.value.length,r=c.stepBackward(),d){if(d.type.indexOf("tag-name")!==-1){if(o===d.value)if(r.value==="<"){if(a++,a>0){var M=new g(s,i,s,u),$=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);do d=c.stepForward();while(d&&d.value!==">");var A=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1)}}else r.value==="</"&&a--}else if(d.value==="/>"){for(var S=0,E=r;E;){if(E.type.indexOf("tag-name")!==-1&&E.value===o){a--;break}else if(E.value==="<")break;E=c.stepBackward(),S++}for(var R=0;R<S;R++)c.stepForward()}}while(r&&a<=0);if($&&A&&f&&b&&M&&y)return{openTag:new g($.start.row,$.start.column,A.end.row,A.end.column),closeTag:new g(f.start.row,f.start.column,b.end.row,b.end.column),openTagName:M,closeTagName:y}}}}n.BracketMatch=m}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,c=t("./config"),d=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,o=t("./mode/text").Mode,a=t("./range").Range,s=t("./line_widgets").LineWidgets,i=t("./document").Document,u=t("./background_tokenizer").BackgroundTokenizer,f=t("./search_highlight").SearchHighlight,y=t("./undomanager").UndoManager,b=(function(){function w(v,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
1360
- `)},this.bgTokenizer=new u(new o().getTokenizer(),this);var x=this;this.bgTokenizer.on("update",function(T){x._signal("tokenizerUpdate",T)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new i(v)),this.setDocument(v),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new m(this),c.resetOptions(this),this.setMode(C),c._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var v=this;this.curOp=null,this.on("change",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.docChanged=!0},!0),this.on("changeSelection",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.selectionChanged=!0},!0),this.$operationResetTimer=g.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(v){if(this.curOp){if(!v||this.curOp.command)return;this.prevOp=this.curOp}v||(v={}),this.$operationResetTimer.schedule(),this.curOp={command:v.command||{},args:v.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",v)},w.prototype.endOperation=function(v){if(this.curOp){if(v&&v.returnValue===!1){this.curOp=null,this._signal("endOperation",v);return}if(v==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",v)}},w.prototype.setDocument=function(v){this.doc&&this.doc.off("change",this.$onChange),this.doc=v,v.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var v=new s(this);return this.widgetManager=v,this.$editor&&v.attach(this.$editor),v},set:function(v){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:v})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,x=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>x&&(this.$docRowCache.splice(x,C),this.$screenRowCache.splice(x,C))},w.prototype.$getRowCacheIndex=function(v,C){for(var x=0,T=v.length-1;x<=T;){var k=x+T>>1,O=v[k];if(C>O)x=k+1;else if(C<O)T=k-1;else return k}return x-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},w.prototype.onChange=function(v){this.$modified=!0,this.$bidiHandler.onChange(v),this.$resetRowCache(v.start.row);var C=this.$updateInternalDataOnChange(v);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(v,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(v),this._signal("change",v)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(v){typeof v=="string"&&(v=JSON.parse(v));var C=new y;C.$undoStack=v.history.undo,C.$redoStack=v.history.redo,C.mark=v.history.mark,C.$rev=v.history.rev;var x=new w(v.value);return v.folds.forEach(function(T){x.addFold("...",a.fromPoints(T.start,T.end))}),x.setAnnotations(v.annotations),x.setBreakpoints(v.breakpoints),x.setMode(v.mode),x.setScrollLeft(v.scrollLeft),x.setScrollTop(v.scrollTop),x.setUndoManager(C),x.selection.fromJSON(v.selection),x},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(v){return v.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(v){return this.bgTokenizer.getState(v)},w.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},w.prototype.getTokenAt=function(v,C){var x=this.bgTokenizer.getTokens(v),T,k=0;if(C==null){var O=x.length-1;k=this.getLine(v).length}else for(var O=0;O<x.length&&(k+=x[O].value.length,!(k>=C));O++);return T=x[O],T?(T.index=O,T.start=k-T.value.length,T):null},w.prototype.setUndoManager=function(v){if(this.$undoManager=v,this.$informUndoManager&&this.$informUndoManager.cancel(),v){var C=this;v.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=g.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(v){this.setOption("tabSize",v)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},w.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(v,C,x,T){var k=this.$markerId++,O={range:v,type:x||"line",renderer:typeof x=="function"?x:null,clazz:C,inFront:!!T,id:k};return T?(this.$frontMarkers[k]=O,this._signal("changeFrontMarker")):(this.$backMarkers[k]=O,this._signal("changeBackMarker")),k},w.prototype.addDynamicMarker=function(v,C){if(v.update){var x=this.$markerId++;return v.id=x,v.inFront=!!C,C?(this.$frontMarkers[x]=v,this._signal("changeFrontMarker")):(this.$backMarkers[x]=v,this._signal("changeBackMarker")),v}},w.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var x=C.inFront?this.$frontMarkers:this.$backMarkers;delete x[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(v){if(!this.$searchHighlight){var C=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(v)},w.prototype.highlightLines=function(v,C,x,T){typeof C!="number"&&(x=C,C=v),x||(x="ace_step");var k=new a(v,0,C,1/0);return k.id=this.addMarker(k,x,"fullLine",T),k},w.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
1361
- `},w.prototype.getWordRange=function(v,C){var x=this.getLine(v),T=!1;if(C>0&&(T=!!x.charAt(C-1).match(this.tokenRe)),T||(T=!!x.charAt(C).match(this.tokenRe)),T)var k=this.tokenRe;else if(/^\s+$/.test(x.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&x.charAt(O).match(k));O++}for(var I=C;I<x.length&&x.charAt(I).match(k);)I++;return new a(v,O,v,I)},w.prototype.getAWordRange=function(v,C){for(var x=this.getWordRange(v,C),T=this.getLine(x.end.row);T.charAt(x.end.column).match(/[ \t]/);)x.end.column+=1;return x},w.prototype.setNewLineMode=function(v){this.doc.setNewLineMode(v)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(v){this.setOption("useWorker",v)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(v){var C=v.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",v)},w.prototype.setMode=function(v,C){if(v&&typeof v=="object"){if(v.getTokenizer)return this.$onChangeMode(v);var x=v,T=x.path}else T=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[T]&&!x){this.$onChangeMode(this.$modes[T]),C&&C();return}this.$modeId=T,c.loadModule(["mode",T],(function(k){if(this.$modeId!==T)return C&&C();this.$modes[T]&&!x?this.$onChangeMode(this.$modes[T]):k&&k.Mode&&(k=new k.Mode(x),x||(this.$modes[T]=k,k.$id=T),this.$onChangeMode(k)),C&&C()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(v,C){if(C||(this.$modeId=v.$id),this.$mode!==v){var x=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var T=v.getTokenizer();if(T.on!==void 0){var k=this.onReloadTokenizer.bind(this);T.on("update",k)}this.bgTokenizer.setTokenizer(T),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=v.tokenRe,this.nonTokenRe=v.nonTokenRe,C||(v.attachToSession&&v.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(v.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:x,mode:v}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(v){c.warn("Could not load worker",v),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(v){this.$scrollTop===v||isNaN(v)||(this.$scrollTop=v,this._signal("changeScrollTop",v))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(v){this.$scrollLeft===v||isNaN(v)||(this.$scrollLeft=v,this._signal("changeScrollLeft",v))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var v=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>v&&(v=C.screenWidth)}),this.lineWidgetWidth=v},w.prototype.$computeWidth=function(v){if(this.$modified||v){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),x=this.$rowLengthCache,T=0,k=0,O=this.$foldData[k],I=O?O.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>I){if(P=O.end.row+1,P>=N)break;O=this.$foldData[k++],I=O?O.start.row:1/0}x[P]==null&&(x[P]=this.$getStringScreenWidth(C[P])[0]),x[P]>T&&(T=x[P])}this.screenWidth=T}},w.prototype.getLine=function(v){return this.doc.getLine(v)},w.prototype.getLines=function(v,C){return this.doc.getLines(v,C)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(v){return this.doc.getTextRange(v||this.selection.getRange())},w.prototype.insert=function(v,C){return this.doc.insert(v,C)},w.prototype.remove=function(v){return this.doc.remove(v)},w.prototype.removeFullLines=function(v,C){return this.doc.removeFullLines(v,C)},w.prototype.undoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var x=v.length-1;x!=-1;x--){var T=v[x];T.action=="insert"||T.action=="remove"?this.doc.revertDelta(T):T.folds&&this.addFolds(T.folds)}!C&&this.$undoSelect&&(v.selectionBefore?this.selection.fromJSON(v.selectionBefore):this.selection.setRange(this.$getUndoSelection(v,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var x=0;x<v.length;x++){var T=v[x];(T.action=="insert"||T.action=="remove")&&this.doc.$safeApplyDelta(T)}!C&&this.$undoSelect&&(v.selectionAfter?this.selection.fromJSON(v.selectionAfter):this.selection.setRange(this.$getUndoSelection(v,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(v){this.$undoSelect=v},w.prototype.$getUndoSelection=function(v,C){function x(N){return C?N.action!=="insert":N.action==="insert"}for(var T,k,O=0;O<v.length;O++){var I=v[O];if(I.start){if(!T){x(I)?T=a.fromPoints(I.start,I.end):T=a.fromPoints(I.start,I.start);continue}x(I)?(k=I.start,T.compare(k.row,k.column)==-1&&T.setStart(k),k=I.end,T.compare(k.row,k.column)==1&&T.setEnd(k)):(k=I.start,T.compare(k.row,k.column)==-1&&(T=a.fromPoints(I.start,I.start)))}}return T},w.prototype.replace=function(v,C){return this.doc.replace(v,C)},w.prototype.moveText=function(v,C,x){var T=this.getTextRange(v),k=this.getFoldsInRange(v),O=a.fromPoints(C,C);if(!x){this.remove(v);var I=v.start.row-v.end.row,N=I?-v.end.column:v.start.column-v.end.column;N&&(O.start.row==v.end.row&&O.start.column>v.end.column&&(O.start.column+=N),O.end.row==v.end.row&&O.end.column>v.end.column&&(O.end.column+=N)),I&&O.start.row>=v.end.row&&(O.start.row+=I,O.end.row+=I)}if(O.end=this.insert(O.start,T),k.length){var P=v.start,B=O.start,I=B.row-P.row,N=B.column-P.column;this.addFolds(k.map(function(z){return z=z.clone(),z.start.row==P.row&&(z.start.column+=N),z.end.row==P.row&&(z.end.column+=N),z.start.row+=I,z.end.row+=I,z}))}return O},w.prototype.indentRows=function(v,C,x){x=x.replace(/\t/g,this.getTabString());for(var T=v;T<=C;T++)this.doc.insertInLine({row:T,column:0},x)},w.prototype.outdentRows=function(v){for(var C=v.collapseRows(),x=new a(0,0,0,0),T=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var O=this.getLine(k);x.start.row=k,x.end.row=k;for(var I=0;I<T&&O.charAt(I)==" ";++I);I<T&&O.charAt(I)==" "?(x.start.column=I,x.end.column=I+1):(x.start.column=0,x.end.column=I),this.remove(x)}},w.prototype.$moveLines=function(v,C,x){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),x<0){var T=this.getRowFoldStart(v+x);if(T<0)return 0;var k=T-v}else if(x>0){var T=this.getRowFoldEnd(C+x);if(T>this.doc.getLength()-1)return 0;var k=T-C}else{v=this.$clipRowToDocument(v),C=this.$clipRowToDocument(C);var k=C-v+1}var O=new a(v,0,C,Number.MAX_VALUE),I=this.getFoldsInRange(O).map(function(P){return P=P.clone(),P.start.row+=k,P.end.row+=k,P}),N=x==0?this.doc.getLines(v,C):this.doc.removeFullLines(v,C);return this.doc.insertFullLines(v+k,N),I.length&&this.addFolds(I),k},w.prototype.moveLinesUp=function(v,C){return this.$moveLines(v,C,-1)},w.prototype.moveLinesDown=function(v,C){return this.$moveLines(v,C,1)},w.prototype.duplicateLines=function(v,C){return this.$moveLines(v,C,0)},w.prototype.$clipRowToDocument=function(v){return Math.max(0,Math.min(v,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(v,C){return C<0?0:Math.min(this.doc.getLine(v).length,C)},w.prototype.$clipPositionToDocument=function(v,C){if(C=Math.max(0,C),v<0)v=0,C=0;else{var x=this.doc.getLength();v>=x?(v=x-1,C=this.doc.getLine(x-1).length):C=Math.min(this.doc.getLine(v).length,C)}return{row:v,column:C}},w.prototype.$clipRangeToDocument=function(v){v.start.row<0?(v.start.row=0,v.start.column=0):v.start.column=this.$clipColumnToRow(v.start.row,v.start.column);var C=this.doc.getLength()-1;return v.end.row>C?(v.end.row=C,v.end.column=this.doc.getLine(C).length):v.end.column=this.$clipColumnToRow(v.end.row,v.end.column),v},w.prototype.setUseWrapMode=function(v){if(v!=this.$useWrapMode){if(this.$useWrapMode=v,this.$modified=!0,this.$resetRowCache(0),v){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(v,C){(this.$wrapLimitRange.min!==v||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:v,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(v,C){var x=this.$wrapLimitRange;x.max<0&&(x={min:C,max:C});var T=this.$constrainWrapLimit(v,x.min,x.max);return T!=this.$wrapLimit&&T>1?(this.$wrapLimit=T,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(v,C,x){return C&&(v=Math.max(C,v)),x&&(v=Math.min(x,v)),v},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(v){this.setWrapLimitRange(v,v)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(v){var C=this.$useWrapMode,x=v.action,T=v.start,k=v.end,O=T.row,I=k.row,N=I-O,P=null;if(this.$updating=!0,N!=0)if(x==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(O,N);var B=this.$foldData;P=this.getFoldsInRange(v),this.removeFolds(P);var F=this.getFoldLine(k.row),H=0;if(F){F.addRemoveChars(k.row,k.column,T.column-k.column),F.shiftRow(-N);var z=this.getFoldLine(O);z&&z!==F&&(z.merge(F),F=z),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=k.row&&F.shiftRow(-N)}I=O}else{var W=Array(N);W.unshift(O,0);var U=C?this.$wrapData:this.$rowLengthCache;U.splice.apply(U,W);var B=this.$foldData,F=this.getFoldLine(O),H=0;if(F){var K=F.range.compareInside(T.row,T.column);K==0?(F=F.split(T.row,T.column),F&&(F.shiftRow(N),F.addRemoveChars(I,0,k.column-T.column))):K==-1&&(F.addRemoveChars(O,0,k.column-T.column),F.shiftRow(N)),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=O&&F.shiftRow(N)}}else{N=Math.abs(v.start.column-v.end.column),x==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(O);F&&F.addRemoveChars(O,T.column,N)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(O,I):this.$updateRowLengthCache(O,I),P},w.prototype.$updateRowLengthCache=function(v,C){this.$rowLengthCache[v]=null,this.$rowLengthCache[C]=null},w.prototype.$updateWrapData=function(v,C){var x=this.doc.getAllLines(),T=this.getTabSize(),k=this.$wrapData,O=this.$wrapLimit,I,N,P=v;for(C=Math.min(C,x.length-1);P<=C;)N=this.getFoldLine(P,N),N?(I=[],N.walk((function(B,F,H,z){var W;if(B!=null){W=this.$getDisplayTokens(B,I.length),W[0]=A;for(var U=1;U<W.length;U++)W[U]=S}else W=this.$getDisplayTokens(x[F].substring(z,H),I.length);I=I.concat(W)}).bind(this),N.end.row,x[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(I,O,T),P=N.end.row+1):(I=this.$getDisplayTokens(x[P]),k[P]=this.$computeWrapSplits(I,O,T),P++)},w.prototype.$computeWrapSplits=function(v,C,x){if(v.length==0)return[];var T=[],k=v.length,O=0,I=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,B=C<=Math.max(2*x,8)||P===!1?0:Math.floor(C/2);function F(){var K=0;if(B===0)return K;if(P)for(var Y=0;Y<v.length;Y++){var G=v[Y];if(G==R)K+=1;else if(G==L)K+=x;else{if(G==_)continue;break}}return N&&P!==!1&&(K+=x),Math.min(K,B)}function H(K){for(var Y=K-O,G=O;G<K;G++){var Q=v[G];(Q===12||Q===2)&&(Y-=1)}T.length||(z=F(),T.indent=z),I+=Y,T.push(I),O=K}for(var z=0;k-O>C-z;){var W=O+C-z;if(v[W-1]>=R&&v[W]>=R){H(W);continue}if(v[W]==A||v[W]==S){for(W;W!=O-1&&v[W]!=A;W--);if(W>O){H(W);continue}for(W=O+C,W;W<v.length&&v[W]==S;W++);if(W==v.length)break;H(W);continue}for(var U=Math.max(W-(C-(C>>2)),O-1);W>U&&v[W]<A;)W--;if(N){for(;W>U&&v[W]<A;)W--;for(;W>U&&v[W]==E;)W--}else for(;W>U&&v[W]<R;)W--;if(W>U){H(++W);continue}W=O+C,v[W]==$&&W--,H(W-z)}return T},w.prototype.$getDisplayTokens=function(v,C){var x=[],T;C=C||0;for(var k=0;k<v.length;k++){var O=v.charCodeAt(k);if(O==9){T=this.getScreenTabSize(x.length+C),x.push(L);for(var I=1;I<T;I++)x.push(_)}else O==32?x.push(R):O>39&&O<48||O>57&&O<64?x.push(E):O>=4352&&D(O)?x.push(M,$):x.push(M)}return x},w.prototype.$getStringScreenWidth=function(v,C,x){if(C==0)return[0,0];C==null&&(C=1/0),x=x||0;var T,k;for(k=0;k<v.length&&(T=v.charCodeAt(k),T==9?x+=this.getScreenTabSize(x):T>=4352&&D(T)?x+=2:x+=1,!(x>C));k++);return[x,k]},w.prototype.getRowLength=function(v){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[v]&&this.lineWidgets[v].rowCount||0),!this.$useWrapMode||!this.$wrapData[v]?C:this.$wrapData[v].length+C},w.prototype.getRowLineCount=function(v){return!this.$useWrapMode||!this.$wrapData[v]?1:this.$wrapData[v].length+1},w.prototype.getRowWrapIndent=function(v){if(this.$useWrapMode){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE),x=this.$wrapData[C.row];return x.length&&x[0]<C.column?x.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(v){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},w.prototype.getDocumentLastRowColumn=function(v,C){var x=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(x)},w.prototype.getDocumentLastRowColumnPosition=function(v,C){var x=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(x,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(v){if(this.$useWrapMode)return this.$wrapData[v]},w.prototype.getScreenTabSize=function(v){return this.$tabSize-(v%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(v,C){return this.screenToDocumentPosition(v,C).row},w.prototype.screenToDocumentColumn=function(v,C){return this.screenToDocumentPosition(v,C).column},w.prototype.screenToDocumentPosition=function(v,C,x){if(v<0)return{row:0,column:0};var T,k=0,O=0,I,N=0,P=0,B=this.$screenRowCache,F=this.$getRowCacheIndex(B,v),H=B.length;if(H&&F>=0)var N=B[F],k=this.$docRowCache[F],z=v>B[H-1];else var z=!H;for(var W=this.getLength()-1,U=this.getNextFoldLine(k),K=U?U.start.row:1/0;N<=v&&(P=this.getRowLength(k),!(N+P>v||k>=W));)N+=P,k++,k>K&&(k=U.end.row+1,U=this.getNextFoldLine(k,U),K=U?U.start.row:1/0),z&&(this.$docRowCache.push(k),this.$screenRowCache.push(N));if(U&&U.start.row<=k)T=this.getFoldDisplayLine(U),k=U.start.row;else{if(N+P<=v||k>W)return{row:W,column:this.getLine(W).length};T=this.getLine(k),U=null}var Y=0,G=Math.floor(v-N);if(this.$useWrapMode){var Q=this.$wrapData[k];Q&&(I=Q[G],G>0&&Q.length&&(Y=Q.indent,O=Q[G-1]||Q[Q.length-1],T=T.substring(O)))}return x!==void 0&&this.$bidiHandler.isBidiRow(N+G,k,G)&&(C=this.$bidiHandler.offsetToCol(x)),O+=this.$getStringScreenWidth(T,C-Y)[1],this.$useWrapMode&&O>=I&&(O=I-1),U?U.idxToPosition(O):{row:k,column:O}},w.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var x=this.$clipPositionToDocument(v.row,v.column);else x=this.$clipPositionToDocument(v,C);v=x.row,C=x.column;var T=0,k=null,O=null;O=this.getFoldAt(v,C,1),O&&(v=O.start.row,C=O.start.column);var I,N=0,P=this.$docRowCache,B=this.$getRowCacheIndex(P,v),F=P.length;if(F&&B>=0)var N=P[B],T=this.$screenRowCache[B],H=v>P[F-1];else var H=!F;for(var z=this.getNextFoldLine(N),W=z?z.start.row:1/0;N<v;){if(N>=W){if(I=z.end.row+1,I>v)break;z=this.getNextFoldLine(I,z),W=z?z.start.row:1/0}else I=N+1;T+=this.getRowLength(N),N=I,H&&(this.$docRowCache.push(N),this.$screenRowCache.push(T))}var U="";z&&N>=W?(U=this.getFoldDisplayLine(z,v,C),k=z.start.row):(U=this.getLine(v).substring(0,C),k=v);var K=0;if(this.$useWrapMode){var Y=this.$wrapData[k];if(Y){for(var G=0;U.length>=Y[G];)T++,G++;U=U.substring(Y[G-1]||0,U.length),K=G>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[N]&&this.lineWidgets[N].rowsAbove&&(T+=this.lineWidgets[N].rowsAbove),{row:T,column:K+this.$getStringScreenWidth(U)[0]}},w.prototype.documentToScreenColumn=function(v,C){return this.documentToScreenPosition(v,C).column},w.prototype.documentToScreenRow=function(v,C){return this.documentToScreenPosition(v,C).row},w.prototype.getScreenLength=function(){var v=0,C=null;if(this.$useWrapMode)for(var k=this.$wrapData.length,O=0,T=0,C=this.$foldData[T++],I=C?C.start.row:1/0;O<k;){var N=this.$wrapData[O];v+=N?N.length+1:1,O++,O>I&&(O=C.end.row+1,C=this.$foldData[T++],I=C?C.start.row:1/0)}else{v=this.getLength();for(var x=this.$foldData,T=0;T<x.length;T++)C=x[T],v-=C.end.row-C.start.row}return this.lineWidgets&&(v+=this.$getWidgetScreenLength()),v},w.prototype.$setFontMetrics=function(v){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,x,T){if(x===0)return[0,0];x||(x=1/0),T=T||0;var k,O;for(O=0;O<C.length&&(k=C.charAt(O),k===" "?T+=this.getScreenTabSize(T):T+=v.getCharacterWidth(k),!(T>x));O++);return[T,O]})},w.prototype.getPrecedingCharacter=function(){var v=this.selection.getCursor();if(v.column===0)return v.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine(v.row);return C[v.column-1]},w.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},w})();b.$uid=0,b.prototype.$modes=c.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=D,h.implement(b.prototype,d);var M=1,$=2,A=3,S=4,E=9,R=10,L=11,_=12;function D(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),c.defineOptions(b.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var v=typeof w=="number"?w:null;this.setWrapLimitRange(v,v),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,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(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,p){var h=t("./lib/lang"),g=t("./lib/oop"),m=t("./range").Range,c=(function(){function r(){this.$options={}}return r.prototype.set=function(o){return g.mixin(this.$options,o),this},r.prototype.getOptions=function(){return h.copyObject(this.$options)},r.prototype.setOptions=function(o){this.$options=o},r.prototype.find=function(o){var a=this.$options,s=this.$matchIterator(o,a);if(!s)return!1;var i=null;return s.forEach(function(u,f,y,b){return i=new m(u,f,y,b),f==b&&a.start&&a.start.start&&a.skipCurrent!=!1&&i.isEqual(a.start)?(i=null,!1):!0}),i},r.prototype.findAll=function(o){var a=this.$options;if(!a.needle)return[];this.$assembleRegExp(a);var s=a.range,i=s?o.getLines(s.start.row,s.end.row):o.doc.getAllLines(),u=[],f=a.re;if(a.$isMultiLine){var y=f.length,b=i.length-y,M;e:for(var $=f.offset||0;$<=b;$++){for(var A=0;A<y;A++)if(i[$+A].search(f[A])==-1)continue e;var S=i[$],E=i[$+y-1],R=S.length-S.match(f[0])[0].length,L=E.match(f[y-1])[0].length;M&&M.end.row===$&&M.end.column>R||(u.push(M=new m($,R,$+y-1,L)),y>2&&($=$+y-2))}}else for(var _=0;_<i.length;_++)for(var D=h.getMatchOffsets(i[_],f),A=0;A<D.length;A++){var w=D[A];u.push(new m(_,w.offset,_,w.offset+w.length))}if(s){for(var v=s.start.column,C=s.end.column,_=0,A=u.length-1;_<A&&u[_].start.column<v&&u[_].start.row==0;)_++;for(var x=s.end.row-s.start.row;_<A&&u[A].end.column>C&&u[A].end.row==x;)A--;for(u=u.slice(_,A+1),_=0,A=u.length;_<A;_++)u[_].start.row+=s.start.row,u[_].end.row+=s.start.row}return u},r.prototype.replace=function(o,a){var s=this.$options,i=this.$assembleRegExp(s);if(s.$isMultiLine)return a;if(i){var u=i.exec(o);if(!u||u[0].length!=o.length)return null;if(s.regExp||(a=a.replace(/\$/g,"$$$$")),a=o.replace(i,a),s.preserveCase){a=a.split("");for(var f=Math.min(o.length,o.length);f--;){var y=o[f];y&&y.toLowerCase()!=y?a[f]=a[f].toUpperCase():a[f]=a[f].toLowerCase()}a=a.join("")}return a}},r.prototype.$assembleRegExp=function(o,a){if(o.needle instanceof RegExp)return o.re=o.needle;var s=o.needle;if(!o.needle)return o.re=!1;o.regExp||(s=h.escapeRegExp(s));var i=o.caseSensitive?"gm":"gmi";try{new RegExp(s,"u"),o.$supportsUnicodeFlag=!0,i+="u"}catch{o.$supportsUnicodeFlag=!1}if(o.wholeWord&&(s=d(s,o)),o.$isMultiLine=!a&&/[\n\r]/.test(s),o.$isMultiLine)return o.re=this.$assembleMultilineRegExp(s,i);try{var u=new RegExp(s,i)}catch{u=!1}return o.re=u},r.prototype.$assembleMultilineRegExp=function(o,a){for(var s=o.replace(/\r\n|\r|\n/g,`$
1358
+ `):S=a(A.value)),A.start&&(S+=a(A)),(A.id||A.rev)&&(S+=" ("+(A.id||A.rev)+")"),S}function a(A){return A.start.row+":"+A.start.column+"=>"+A.end.row+":"+A.end.column}function s(A,S){var $=A.action=="insert",R=S.action=="insert";if($&&R)if(c(S.start,A.end)>=0)p(S,A,-1);else if(c(S.start,A.start)<=0)p(A,S,1);else return null;else if($&&!R)if(c(S.start,A.end)>=0)p(S,A,-1);else if(c(S.end,A.start)<=0)p(A,S,-1);else return null;else if(!$&&R)if(c(S.start,A.start)>=0)p(S,A,1);else if(c(S.start,A.start)<=0)p(A,S,1);else return null;else if(!$&&!R)if(c(S.start,A.start)>=0)p(S,A,1);else if(c(S.end,A.start)<=0)p(A,S,-1);else return null;return[S,A]}function i(A,S){for(var $=A.length;$--;)for(var R=0;R<S.length;R++)if(!s(A[$],S[R])){for(;$<A.length;){for(;R--;)s(S[R],A[$]);R=S.length,$++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var $=A.action=="insert",R=S.action=="insert";if($&&R)c(A.start,S.start)<0?p(S,A,1):p(A,S,1);else if($&&!R)c(A.start,S.end)>=0?p(A,S,-1):(c(A.start,S.start)<=0||p(A,m.fromPoints(S.start,A.start),-1),p(S,A,1));else if(!$&&R)c(S.start,A.end)>=0?p(S,A,-1):(c(S.start,A.start)<=0||p(S,m.fromPoints(A.start,S.start),-1),p(A,S,1));else if(!$&&!R)if(c(S.start,A.end)>=0)p(S,A,-1);else if(c(S.end,A.start)<=0)p(A,S,-1);else{var L,T;return c(A.start,S.start)<0&&(L=A,A=b(A,S.start)),c(A.end,S.end)>0&&(T=b(A,S.end)),y(S.end,A.start,A.end,-1),T&&!L&&(A.lines=T.lines,A.start=T.start,A.end=T.end,T=A),[S,L,T].filter(Boolean)}return[S,A]}function p(A,S,$){y(A.start,S.start,S.end,$),y(A.end,S.start,S.end,$)}function y(A,S,$,R){A.row==(R==1?S:$).row&&(A.column+=R*($.column-S.column)),A.row+=R*($.row-S.row)}function b(A,S){var $=A.lines,R=A.end;A.end=f(S);var L=A.end.row-A.start.row,T=$.splice(L,$.length),D=L?S.column:S.column-A.start.column;$.push(T[0].substring(0,D)),T[0]=T[0].substr(D);var w={start:f(S),end:R,lines:T,action:A.action};return w}function M(A,S){S=r(S);for(var $=A.length;$--;){for(var R=A[$],L=0;L<R.length;L++){var T=R[L],D=u(T,S);S=D[0],D.length!=2&&(D[2]?(R.splice(L+1,1,D[1],D[2]),L++):D[1]||(R.splice(L,1),L--))}R.length||A.splice($,1)}return A}function x(A,S){for(var $=0;$<S.length;$++)for(var R=S[$],L=0;L<R.length;L++)M(A,R[L])}n.UndoManager=h}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,d){var h=t("../range").Range,g=(function(){function m(c,f){this.foldData=c,Array.isArray(f)?this.folds=f:f=this.folds=[f];var r=f[f.length-1];this.range=new h(f[0].start.row,f[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return m.prototype.shiftRow=function(c){this.start.row+=c,this.end.row+=c,this.folds.forEach(function(f){f.start.row+=c,f.end.row+=c})},m.prototype.addFold=function(c){if(c.sameRow){if(c.start.row<this.startRow||c.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(c),this.folds.sort(function(f,r){return-f.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(c.start.row,c.start.column)>0?(this.end.row=c.end.row,this.end.column=c.end.column):this.range.compareStart(c.end.row,c.end.column)<0&&(this.start.row=c.start.row,this.start.column=c.start.column)}else if(c.start.row==this.end.row)this.folds.push(c),this.end.row=c.end.row,this.end.column=c.end.column;else if(c.end.row==this.start.row)this.folds.unshift(c),this.start.row=c.start.row,this.start.column=c.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");c.foldLine=this},m.prototype.containsRow=function(c){return c>=this.start.row&&c<=this.end.row},m.prototype.walk=function(c,f,r){var o=0,a=this.folds,s,i,u,p=!0;f==null&&(f=this.end.row,r=this.end.column);for(var y=0;y<a.length;y++){if(s=a[y],i=s.range.compareStart(f,r),i==-1){c(null,f,r,o,p);return}if(u=c(null,s.start.row,s.start.column,o,p),u=!u&&c(s.placeholder,s.start.row,s.start.column,o),u||i===0)return;p=!s.sameRow,o=s.end.column}c(null,f,r,o,p)},m.prototype.getNextFoldTo=function(c,f){for(var r,o,a=0;a<this.folds.length;a++){if(r=this.folds[a],o=r.range.compareEnd(c,f),o==-1)return{fold:r,kind:"after"};if(o===0)return{fold:r,kind:"inside"}}return null},m.prototype.addRemoveChars=function(c,f,r){var o=this.getNextFoldTo(c,f),a,s;if(o){if(a=o.fold,o.kind=="inside"&&a.start.column!=f&&a.start.row!=c)window.console&&window.console.log(c,f,a);else if(a.start.row==c){s=this.folds;var i=s.indexOf(a);for(i===0&&(this.start.column+=r),i;i<s.length;i++){if(a=s[i],a.start.column+=r,!a.sameRow)return;a.end.column+=r}this.end.column+=r}}},m.prototype.split=function(c,f){var r=this.getNextFoldTo(c,f);if(!r||r.kind=="inside")return null;var o=r.fold,a=this.folds,s=this.foldData,i=a.indexOf(o),u=a[i-1];this.end.row=u.end.row,this.end.column=u.end.column,a=a.splice(i,a.length-i);var p=new m(s,a);return s.splice(s.indexOf(this)+1,0,p),p},m.prototype.merge=function(c){for(var f=c.folds,r=0;r<f.length;r++)this.addFold(f[r]);var o=this.foldData;o.splice(o.indexOf(c),1)},m.prototype.toString=function(){var c=[this.range.toString()+": ["];return this.folds.forEach(function(f){c.push(" "+f.toString())}),c.push("]"),c.join(`
1359
+ `)},m.prototype.idxToPosition=function(c){for(var f=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(c-=o.start.column-f,c<0)return{row:o.start.row,column:o.start.column+c};if(c-=o.placeholder.length,c<0)return o.start;f=o.end.column}return{row:this.end.row,column:this.end.column+c}},m})();n.FoldLine=g}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,d){var h=t("./range").Range,g=h.comparePoints,m=(function(){function c(){this.ranges=[],this.$bias=1}return c.prototype.pointIndex=function(f,r,o){for(var a=this.ranges,s=o||0;s<a.length;s++){var i=a[s],u=g(f,i.end);if(!(u>0)){var p=g(f,i.start);return u===0?r&&p!==0?-s-2:s:p>0||p===0&&!r?s:-s-1}}return-s-1},c.prototype.add=function(f){var r=!f.isEmpty(),o=this.pointIndex(f.start,r);o<0&&(o=-o-1);var a=this.pointIndex(f.end,r,o);return a<0?a=-a-1:a++,this.ranges.splice(o,a-o,f)},c.prototype.addList=function(f){for(var r=[],o=f.length;o--;)r.push.apply(r,this.add(f[o]));return r},c.prototype.substractPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges.splice(r,1)},c.prototype.merge=function(){var f=[],r=this.ranges;r=r.sort(function(u,p){return g(u.start,p.start)});for(var o=r[0],a,s=1;s<r.length;s++){a=o,o=r[s];var i=g(a.end,o.start);i<0||i==0&&!a.isEmpty()&&!o.isEmpty()||(g(a.end,o.end)<0&&(a.end.row=o.end.row,a.end.column=o.end.column),r.splice(s,1),f.push(o),o=a,s--)}return this.ranges=r,f},c.prototype.contains=function(f,r){return this.pointIndex({row:f,column:r})>=0},c.prototype.containsPoint=function(f){return this.pointIndex(f)>=0},c.prototype.rangeAtPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges[r]},c.prototype.clipRows=function(f,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<f)return[];var a=this.pointIndex({row:f,column:0});a<0&&(a=-a-1);var s=this.pointIndex({row:r,column:0},a);s<0&&(s=-s-1);for(var i=[],u=a;u<s;u++)i.push(o[u]);return i},c.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},c.prototype.attach=function(f){this.session&&this.detach(),this.session=f,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},c.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},c.prototype.$onChange=function(f){for(var r=f.start,o=f.end,a=r.row,s=o.row,i=this.ranges,u=0,p=i.length;u<p;u++){var y=i[u];if(y.end.row>=a)break}if(f.action=="insert")for(var b=s-a,M=-r.column+o.column;u<p;u++){var y=i[u];if(y.start.row>a)break;if(y.start.row==a&&y.start.column>=r.column&&(y.start.column==r.column&&this.$bias<=0||(y.start.column+=M,y.start.row+=b)),y.end.row==a&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&M>0&&u<p-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=M),y.end.column+=M,y.end.row+=b}}else for(var b=a-s,M=r.column-o.column;u<p;u++){var y=i[u];if(y.start.row>s)break;y.end.row<s&&(a<y.end.row||a==y.end.row&&r.column<y.end.column)?(y.end.row=a,y.end.column=r.column):y.end.row==s?y.end.column<=o.column?(b||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=M,y.end.row+=b):y.end.row>s&&(y.end.row+=b),y.start.row<s&&(a<y.start.row||a==y.start.row&&r.column<y.start.column)?(y.start.row=a,y.start.column=r.column):y.start.row==s?y.start.column<=o.column?(b||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=M,y.start.row+=b):y.start.row>s&&(y.start.row+=b)}if(b!=0&&u<p)for(;u<p;u++){var y=i[u];y.start.row+=b,y.end.row+=b}},c})();m.prototype.comparePoints=g,n.RangeList=m}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,d){var h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var y in p)Object.prototype.hasOwnProperty.call(p,y)&&(u[y]=p[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../range_list").RangeList,m=(function(a){h(s,a);function s(i,u){var p=a.call(this)||this;return p.foldLine=null,p.placeholder=u,p.range=i,p.start=i.start,p.end=i.end,p.sameRow=i.start.row==i.end.row,p.subFolds=p.ranges=[],p}return s.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},s.prototype.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(u){u.setFoldLine(i)})},s.prototype.clone=function(){var i=this.range.clone(),u=new s(i,this.placeholder);return this.subFolds.forEach(function(p){u.subFolds.push(p.clone())}),u.collapseChildren=this.collapseChildren,u},s.prototype.addSubFold=function(i){if(!this.range.isEqual(i)){f(i,this.start);for(var M=i.start.row,x=i.start.column,u=0,p=-1;u<this.subFolds.length&&(p=this.subFolds[u].range.compare(M,x),p==1);u++);var y=this.subFolds[u],b=0;if(p==0){if(y.range.containsRange(i))return y.addSubFold(i);b=1}for(var M=i.range.end.row,x=i.range.end.column,A=u,p=-1;A<this.subFolds.length&&(p=this.subFolds[A].range.compare(M,x),p==1);A++);p==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),$=p==0?S.length-1:S.length,R=b;R<$;R++)i.addSubFold(S[R]);return i.setFoldLine(this.foldLine),i}},s.prototype.restoreRange=function(i){return o(i,this.start)},s})(g);function c(a,s){a.row-=s.row,a.row==0&&(a.column-=s.column)}function f(a,s){c(a.start,s),c(a.end,s)}function r(a,s){a.row==0&&(a.column+=s.column),a.row+=s.row}function o(a,s){r(a.start,s),r(a.end,s)}n.Fold=m}),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(t,n,d){var h=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,c=t("../token_iterator").TokenIterator,f=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(o,a,s){var i=this.getFoldLine(o);if(!i)return null;for(var u=i.folds,p=0;p<u.length;p++){var y=u[p].range;if(y.contains(o,a)){if(s==1&&y.isEnd(o,a)&&!y.isEmpty())continue;if(s==-1&&y.isStart(o,a)&&!y.isEmpty())continue;return u[p]}}},this.getFoldsInRange=function(o){var a=o.start,s=o.end,i=this.$foldData,u=[];a.column+=1,s.column-=1;for(var p=0;p<i.length;p++){var y=i[p].range.compareRange(o);if(y!=2){if(y==-2)break;for(var b=i[p].folds,M=0;M<b.length;M++){var x=b[M];if(y=x.range.compareRange(o),y==-2)break;if(y==2)continue;if(y==42)break;u.push(x)}}}return a.column-=1,s.column+=1,u},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var a=[];o.forEach(function(s){a=a.concat(this.getFoldsInRange(s))},this)}else var a=this.getFoldsInRange(o);return a},this.getAllFolds=function(){for(var o=[],a=this.$foldData,s=0;s<a.length;s++)for(var i=0;i<a[s].folds.length;i++)o.push(a[s].folds[i]);return o},this.getFoldStringAt=function(o,a,s,i){if(i=i||this.getFoldLine(o),!i)return null;for(var u={end:{column:0}},p,y,b=0;b<i.folds.length;b++){y=i.folds[b];var M=y.range.compareEnd(o,a);if(M==-1){p=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(M===0)return null;u=y}return p||(p=this.getLine(y.start.row).substring(u.end.column)),s==-1?p.substring(0,a-u.end.column):s==1?p.substring(a-u.end.column):p},this.getFoldLine=function(o,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[i];if(u.start.row<=o&&u.end.row>=o)return u;if(u.end.row>o)return null}return null},this.getNextFoldLine=function(o,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[i];if(u.end.row>=o)return u}return null},this.getFoldedRowCount=function(o,a){for(var s=this.$foldData,i=a-o+1,u=0;u<s.length;u++){var p=s[u],y=p.end.row,b=p.start.row;if(y>=a){b<a&&(b>=o?i-=a-b:i=0);break}else y>=o&&(b>=o?i-=y-b:i-=y-o+1)}return i},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(a,s){return a.start.row-s.start.row}),o},this.addFold=function(o,a){var s=this.$foldData,i=!1,u;o instanceof m?u=o:(u=new m(a,o),u.collapseChildren=a.collapseChildren),this.$clipRangeToDocument(u.range);var p=u.start.row,y=u.start.column,b=u.end.row,M=u.end.column,x=this.getFoldAt(p,y,1),A=this.getFoldAt(b,M,-1);if(x&&A==x)return x.addSubFold(u);x&&!x.range.isStart(p,y)&&this.removeFold(x),A&&!A.range.isEnd(b,M)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(T){u.addSubFold(T)}));for(var $=0;$<s.length;$++){var R=s[$];if(b==R.start.row){R.addFold(u),i=!0;break}else if(p==R.end.row){if(R.addFold(u),i=!0,!u.sameRow){var L=s[$+1];if(L&&L.start.row==b){R.merge(L);break}}break}else if(b<=R.start.row)break}return i||(R=this.$addFoldLine(new g(this.$foldData,u))),this.$useWrapMode?this.$updateWrapData(R.start.row,R.start.row):this.$updateRowLengthCache(R.start.row,R.start.row),this.$modified=!0,this._signal("changeFold",{data:u,action:"add"}),u},this.addFolds=function(o){o.forEach(function(a){this.addFold(a)},this)},this.removeFold=function(o){var a=o.foldLine,s=a.start.row,i=a.end.row,u=this.$foldData,p=a.folds;if(p.length==1)u.splice(u.indexOf(a),1);else if(a.range.isEnd(o.end.row,o.end.column))p.pop(),a.end.row=p[p.length-1].end.row,a.end.column=p[p.length-1].end.column;else if(a.range.isStart(o.start.row,o.start.column))p.shift(),a.start.row=p[0].start.row,a.start.column=p[0].start.column;else if(o.sameRow)p.splice(p.indexOf(o),1);else{var y=a.split(o.start.row,o.start.column);p=y.folds,p.shift(),y.start.row=p[0].start.row,y.start.column=p[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(s,i):this.$updateRowLengthCache(s,i)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var a=[],s=0;s<o.length;s++)a.push(o[s]);a.forEach(function(i){this.removeFold(i)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(a){o.restoreRange(a),this.addFold(a)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(a){this.expandFold(a)},this)},this.unfold=function(o,a){var s,i;if(o==null)s=new h(0,0,this.getLength(),0),a==null&&(a=!0);else if(typeof o=="number")s=new h(o,0,o,this.getLine(o).length);else if("row"in o)s=h.fromPoints(o,o);else{if(Array.isArray(o))return i=[],o.forEach(function(p){i=i.concat(this.unfold(p))},this),i;s=o}i=this.getFoldsInRangeList(s);for(var u=i;i.length==1&&h.comparePoints(i[0].start,s.start)<0&&h.comparePoints(i[0].end,s.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(s);if(a!=!1?this.removeFolds(i):this.expandFolds(i),u.length)return u},this.isRowFolded=function(o,a){return!!this.getFoldLine(o,a)},this.getRowFoldEnd=function(o,a){var s=this.getFoldLine(o,a);return s?s.end.row:o},this.getRowFoldStart=function(o,a){var s=this.getFoldLine(o,a);return s?s.start.row:o},this.getFoldDisplayLine=function(o,a,s,i,u){i==null&&(i=o.start.row),u==null&&(u=0),a==null&&(a=o.end.row),s==null&&(s=this.getLine(a).length);var p=this.doc,y="";return o.walk(function(b,M,x,A){if(!(M<i)){if(M==i){if(x<u)return;A=Math.max(u,A)}b!=null?y+=b:y+=p.getLine(M).substring(A,x)}},a,s),y},this.getDisplayLine=function(o,a,s,i){var u=this.getFoldLine(o);if(u)return this.getFoldDisplayLine(u,o,a,s,i);var p;return p=this.doc.getLine(o),p.substring(i||0,a||p.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(a){var s=a.folds.map(function(i){return i.clone()});return new g(o,s)}),o},this.toggleFold=function(o){var a=this.selection,s=a.getRange(),i,u;if(s.isEmpty()){var p=s.start;if(i=this.getFoldAt(p.row,p.column),i){this.expandFold(i);return}else(u=this.findMatchingBracket(p))?s.comparePoint(u)==1?s.end=u:(s.start=u,s.start.column++,s.end.column--):(u=this.findMatchingBracket({row:p.row,column:p.column+1}))?(s.comparePoint(u)==1?s.end=u:s.start=u,s.start.column++):s=this.getCommentFoldRange(p.row,p.column)||s}else{var y=this.getFoldsInRange(s);if(o&&y.length){this.expandFolds(y);return}else y.length==1&&(i=y[0])}if(i||(i=this.getFoldAt(s.start.row,s.start.column)),i&&i.range.toString()==s.toString()){this.expandFold(i);return}var b="...";if(!s.isMultiLine()){if(b=this.getTextRange(s),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,s)},this.getCommentFoldRange=function(o,a,s){var i=new c(this,o,a),u=i.getCurrentToken(),p=u&&u.type;if(u&&/^comment|string/.test(p)){p=p.match(/comment|string/)[0],p=="comment"&&(p+="|doc-start|\\.doc");var y=new RegExp(p),b=new h;if(s!=1){do u=i.stepBackward();while(u&&y.test(u.type));u=i.stepForward()}b.start.row=i.getCurrentTokenRow(),b.start.column=i.getCurrentTokenColumn()+u.value.length,i=new c(this,o,a);var M=this.getState(i.$row);if(s!=-1){var x=-1;do if(u=i.stepForward(),x==-1){var A=this.getState(i.$row);M.toString()!==A.toString()&&(x=i.$row)}else if(i.$row>x)break;while(u&&y.test(u.type));u=i.stepBackward()}else u=i.getCurrentToken();return b.end.row=i.getCurrentTokenRow(),b.end.column=i.getCurrentTokenColumn(),b}},this.foldAll=function(o,a,s,i){s==null&&(s=1e5);var u=this.foldWidgets;if(u){a=a||this.getLength(),o=o||0;for(var p=o;p<a;p++)if(u[p]==null&&(u[p]=this.getFoldWidget(p)),u[p]=="start"&&!(i&&!i(p))){var y=this.getFoldWidgetRange(p);y&&y.isMultiLine()&&y.end.row<=a&&y.start.row>=o&&(p=y.end.row,y.collapseChildren=s,this.addFold("...",y))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(a){for(var s=o.getTokens(a),i=0;i<s.length;i++){var u=s[i];if(!(u.type=="text"&&/^\s+$/.test(u.value)))return!!/comment/.test(u.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var a=this.$foldMode;this.$setFolding(null),this.$setFolding(a)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(o,a){var s=this.foldWidgets;if(!s||a&&s[o])return{};for(var i=o-1,u;i>=0;){var p=s[i];if(p==null&&(p=s[i]=this.getFoldWidget(i)),p=="start"){var y=this.getFoldWidgetRange(i);if(u||(u=y),y&&y.end.row>=o)break}i--}return{range:i!==-1&&y,firstRange:u}},this.onFoldWidgetClick=function(o,a){a instanceof f&&(a=a.domEvent);var s={children:a.shiftKey,all:a.ctrlKey||a.metaKey,siblings:a.altKey},i=this.$toggleFoldWidget(o,s);if(!i){var u=a.target||a.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,a){if(this.getFoldWidget){var s=this.getFoldWidget(o),i=this.getLine(o),u=s==="end"?-1:1,p=this.getFoldAt(o,u===-1?0:i.length,u);if(p)return a.children||a.all?this.removeFold(p):this.expandFold(p),p;var y=this.getFoldWidgetRange(o,!0);if(y&&!y.isMultiLine()&&(p=this.getFoldAt(y.start.row,y.start.column,1),p&&y.isEqual(p.range)))return this.removeFold(p),p;if(a.siblings){var b=this.getParentFoldRangeData(o);if(b.range)var M=b.range.start.row+1,x=b.range.end.row;this.foldAll(M,x,a.all?1e4:0)}else a.children?(x=y?y.end.row:this.getLength(),this.foldAll(o+1,x,a.all?1e4:0)):y&&(a.all&&(y.collapseChildren=1e4),this.addFold("...",y));return y}},this.toggleFoldWidget=function(o){var a=this.selection.getCursor().row;a=this.getRowFoldStart(a);var s=this.$toggleFoldWidget(a,{});if(!s){var i=this.getParentFoldRangeData(a,!0);if(s=i.range||i.firstRange,s){a=s.start.row;var u=this.getFoldAt(a,this.getLine(a).length,1);u?this.removeFold(u):this.addFold("...",s)}}},this.updateFoldWidgets=function(o){var a=o.start.row,s=o.end.row-a;if(s===0)this.foldWidgets[a]=null;else if(o.action=="remove")this.foldWidgets.splice(a,s+1,null);else{var i=Array(s+1);i.unshift(a,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(o){var a=o.data;a.first!=a.last&&this.foldWidgets.length>a.first&&this.foldWidgets.splice(a.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,d){var h=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(c,f){if(c.column==0)return null;var r=f||this.getLine(c.row).charAt(c.column-1);if(r=="")return null;var o=r.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],c):this.$findOpeningBracket(o[2],c):null},this.getBracketRange=function(c){var f=this.getLine(c.row),r=!0,o,a=f.charAt(c.column-1),s=a&&a.match(/([\(\[\{])|([\)\]\}])/);if(s||(a=f.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(/([\(\[\{])|([\)\]\}])/),r=!1),!s)return null;if(s[1]){var i=this.$findClosingBracket(s[1],c);if(!i)return null;o=g.fromPoints(c,i),r||(o.end.column++,o.start.column--),o.cursor=o.end}else{var i=this.$findOpeningBracket(s[2],c);if(!i)return null;o=g.fromPoints(i,c),r||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(c,f){var r=this.getLine(c.row),o=/([\(\[\{])|([\)\]\}])/,a=!f&&r.charAt(c.column-1),s=a&&a.match(o);if(s||(a=(f===void 0||f)&&r.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(o)),!s)return null;var i=new g(c.row,c.column-1,c.row,c.column),u=s[1]?this.$findClosingBracket(s[1],c):this.$findOpeningBracket(s[2],c);if(!u)return[i];var p=new g(u.row,u.column,u.row,u.column+1);return[i,p]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,f,r){var o=this.$brackets[c],a=1,s=new h(this,f.row,f.column),i=s.getCurrentToken();if(i||(i=s.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var u=f.column-s.getCurrentTokenColumn()-2,p=i.value;;){for(;u>=0;){var y=p.charAt(u);if(y==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else y==c&&(a+=1);u-=1}do i=s.stepBackward();while(i&&!r.test(i.type));if(i==null)break;p=i.value,u=p.length-1}return null}},this.$findClosingBracket=function(c,f,r){var o=this.$brackets[c],a=1,s=new h(this,f.row,f.column),i=s.getCurrentToken();if(i||(i=s.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var u=f.column-s.getCurrentTokenColumn();;){for(var p=i.value,y=p.length;u<y;){var b=p.charAt(u);if(b==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else b==c&&(a+=1);u+=1}do i=s.stepForward();while(i&&!r.test(i.type));if(i==null)break;u=0}return null}},this.getMatchingTags=function(c){var f=new h(this,c.row,c.column),r=this.$findTagName(f);if(r){var o=f.stepBackward();return o.value==="<"?this.$findClosingTag(f,r):this.$findOpeningTag(f,r)}},this.$findTagName=function(c){var f=c.getCurrentToken(),r=!1,o=!1;if(f&&f.type.indexOf("tag-name")===-1)do o?f=c.stepBackward():f=c.stepForward(),f&&(f.value==="/>"?o=!0:f.type.indexOf("tag-name")!==-1&&(r=!0));while(f&&!r);return f},this.$findClosingTag=function(c,f){var r,o=f.value,a=f.value,s=0,i=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=c.stepForward();var u=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length),p=!1;do{if(r=f,r.type.indexOf("tag-close")!==-1&&!p){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);p=!0}if(f=c.stepForward(),f){if(f.value===">"&&!p){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);p=!0}if(f.type.indexOf("tag-name")!==-1){if(o=f.value,a===o){if(r.value==="<")s++;else if(r.value==="</"&&(s--,s<0)){c.stepBackward();var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2);f=c.stepForward();var M=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=c.stepForward()),f&&f.value===">")var x=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);else return}}}else if(a===o&&f.value==="/>"&&(s--,s<0))var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2),M=b,x=M,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(f&&s>=0);if(i&&y&&b&&x&&u&&M)return{openTag:new g(i.start.row,i.start.column,y.end.row,y.end.column),closeTag:new g(b.start.row,b.start.column,x.end.row,x.end.column),openTagName:u,closeTagName:M}},this.$findOpeningTag=function(c,f){var r=c.getCurrentToken(),o=f.value,a=0,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+2,p=new g(s,i,s,u);c.stepForward();var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=c.stepForward()),!(!f||f.value!==">")){var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);c.stepBackward(),c.stepBackward();do if(f=r,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+f.value.length,r=c.stepBackward(),f){if(f.type.indexOf("tag-name")!==-1){if(o===f.value)if(r.value==="<"){if(a++,a>0){var M=new g(s,i,s,u),x=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);do f=c.stepForward();while(f&&f.value!==">");var A=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1)}}else r.value==="</"&&a--}else if(f.value==="/>"){for(var S=0,$=r;$;){if($.type.indexOf("tag-name")!==-1&&$.value===o){a--;break}else if($.value==="<")break;$=c.stepBackward(),S++}for(var R=0;R<S;R++)c.stepForward()}}while(r&&a<=0);if(x&&A&&p&&b&&M&&y)return{openTag:new g(x.start.row,x.start.column,A.end.row,A.end.column),closeTag:new g(p.start.row,p.start.column,b.end.row,b.end.column),openTagName:M,closeTagName:y}}}}n.BracketMatch=m}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,d){var h=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,c=t("./config"),f=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,o=t("./mode/text").Mode,a=t("./range").Range,s=t("./line_widgets").LineWidgets,i=t("./document").Document,u=t("./background_tokenizer").BackgroundTokenizer,p=t("./search_highlight").SearchHighlight,y=t("./undomanager").UndoManager,b=(function(){function w(v,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
1360
+ `)},this.bgTokenizer=new u(new o().getTokenizer(),this);var E=this;this.bgTokenizer.on("update",function(_){E._signal("tokenizerUpdate",_)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new i(v)),this.setDocument(v),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new m(this),c.resetOptions(this),this.setMode(C),c._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var v=this;this.curOp=null,this.on("change",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.docChanged=!0},!0),this.on("changeSelection",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.selectionChanged=!0},!0),this.$operationResetTimer=g.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(v){if(this.curOp){if(!v||this.curOp.command)return;this.prevOp=this.curOp}v||(v={}),this.$operationResetTimer.schedule(),this.curOp={command:v.command||{},args:v.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",v)},w.prototype.endOperation=function(v){if(this.curOp){if(v&&v.returnValue===!1){this.curOp=null,this._signal("endOperation",v);return}if(v==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",v)}},w.prototype.setDocument=function(v){this.doc&&this.doc.off("change",this.$onChange),this.doc=v,v.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var v=new s(this);return this.widgetManager=v,this.$editor&&v.attach(this.$editor),v},set:function(v){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:v})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,E=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>E&&(this.$docRowCache.splice(E,C),this.$screenRowCache.splice(E,C))},w.prototype.$getRowCacheIndex=function(v,C){for(var E=0,_=v.length-1;E<=_;){var k=E+_>>1,O=v[k];if(C>O)E=k+1;else if(C<O)_=k-1;else return k}return E-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},w.prototype.onChange=function(v){this.$modified=!0,this.$bidiHandler.onChange(v),this.$resetRowCache(v.start.row);var C=this.$updateInternalDataOnChange(v);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(v,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(v),this._signal("change",v)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(v){typeof v=="string"&&(v=JSON.parse(v));var C=new y;C.$undoStack=v.history.undo,C.$redoStack=v.history.redo,C.mark=v.history.mark,C.$rev=v.history.rev;var E=new w(v.value);return v.folds.forEach(function(_){E.addFold("...",a.fromPoints(_.start,_.end))}),E.setAnnotations(v.annotations),E.setBreakpoints(v.breakpoints),E.setMode(v.mode),E.setScrollLeft(v.scrollLeft),E.setScrollTop(v.scrollTop),E.setUndoManager(C),E.selection.fromJSON(v.selection),E},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(v){return v.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(v){return this.bgTokenizer.getState(v)},w.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},w.prototype.getTokenAt=function(v,C){var E=this.bgTokenizer.getTokens(v),_,k=0;if(C==null){var O=E.length-1;k=this.getLine(v).length}else for(var O=0;O<E.length&&(k+=E[O].value.length,!(k>=C));O++);return _=E[O],_?(_.index=O,_.start=k-_.value.length,_):null},w.prototype.setUndoManager=function(v){if(this.$undoManager=v,this.$informUndoManager&&this.$informUndoManager.cancel(),v){var C=this;v.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=g.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(v){this.setOption("tabSize",v)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},w.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(v,C,E,_){var k=this.$markerId++,O={range:v,type:E||"line",renderer:typeof E=="function"?E:null,clazz:C,inFront:!!_,id:k};return _?(this.$frontMarkers[k]=O,this._signal("changeFrontMarker")):(this.$backMarkers[k]=O,this._signal("changeBackMarker")),k},w.prototype.addDynamicMarker=function(v,C){if(v.update){var E=this.$markerId++;return v.id=E,v.inFront=!!C,C?(this.$frontMarkers[E]=v,this._signal("changeFrontMarker")):(this.$backMarkers[E]=v,this._signal("changeBackMarker")),v}},w.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var E=C.inFront?this.$frontMarkers:this.$backMarkers;delete E[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(v){if(!this.$searchHighlight){var C=new p(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(v)},w.prototype.highlightLines=function(v,C,E,_){typeof C!="number"&&(E=C,C=v),E||(E="ace_step");var k=new a(v,0,C,1/0);return k.id=this.addMarker(k,E,"fullLine",_),k},w.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
1361
+ `},w.prototype.getWordRange=function(v,C){var E=this.getLine(v),_=!1;if(C>0&&(_=!!E.charAt(C-1).match(this.tokenRe)),_||(_=!!E.charAt(C).match(this.tokenRe)),_)var k=this.tokenRe;else if(/^\s+$/.test(E.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&E.charAt(O).match(k));O++}for(var I=C;I<E.length&&E.charAt(I).match(k);)I++;return new a(v,O,v,I)},w.prototype.getAWordRange=function(v,C){for(var E=this.getWordRange(v,C),_=this.getLine(E.end.row);_.charAt(E.end.column).match(/[ \t]/);)E.end.column+=1;return E},w.prototype.setNewLineMode=function(v){this.doc.setNewLineMode(v)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(v){this.setOption("useWorker",v)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(v){var C=v.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",v)},w.prototype.setMode=function(v,C){if(v&&typeof v=="object"){if(v.getTokenizer)return this.$onChangeMode(v);var E=v,_=E.path}else _=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[_]&&!E){this.$onChangeMode(this.$modes[_]),C&&C();return}this.$modeId=_,c.loadModule(["mode",_],(function(k){if(this.$modeId!==_)return C&&C();this.$modes[_]&&!E?this.$onChangeMode(this.$modes[_]):k&&k.Mode&&(k=new k.Mode(E),E||(this.$modes[_]=k,k.$id=_),this.$onChangeMode(k)),C&&C()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(v,C){if(C||(this.$modeId=v.$id),this.$mode!==v){var E=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var _=v.getTokenizer();if(_.on!==void 0){var k=this.onReloadTokenizer.bind(this);_.on("update",k)}this.bgTokenizer.setTokenizer(_),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=v.tokenRe,this.nonTokenRe=v.nonTokenRe,C||(v.attachToSession&&v.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(v.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:E,mode:v}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(v){c.warn("Could not load worker",v),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(v){this.$scrollTop===v||isNaN(v)||(this.$scrollTop=v,this._signal("changeScrollTop",v))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(v){this.$scrollLeft===v||isNaN(v)||(this.$scrollLeft=v,this._signal("changeScrollLeft",v))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var v=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>v&&(v=C.screenWidth)}),this.lineWidgetWidth=v},w.prototype.$computeWidth=function(v){if(this.$modified||v){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),E=this.$rowLengthCache,_=0,k=0,O=this.$foldData[k],I=O?O.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>I){if(P=O.end.row+1,P>=N)break;O=this.$foldData[k++],I=O?O.start.row:1/0}E[P]==null&&(E[P]=this.$getStringScreenWidth(C[P])[0]),E[P]>_&&(_=E[P])}this.screenWidth=_}},w.prototype.getLine=function(v){return this.doc.getLine(v)},w.prototype.getLines=function(v,C){return this.doc.getLines(v,C)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(v){return this.doc.getTextRange(v||this.selection.getRange())},w.prototype.insert=function(v,C){return this.doc.insert(v,C)},w.prototype.remove=function(v){return this.doc.remove(v)},w.prototype.removeFullLines=function(v,C){return this.doc.removeFullLines(v,C)},w.prototype.undoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=v.length-1;E!=-1;E--){var _=v[E];_.action=="insert"||_.action=="remove"?this.doc.revertDelta(_):_.folds&&this.addFolds(_.folds)}!C&&this.$undoSelect&&(v.selectionBefore?this.selection.fromJSON(v.selectionBefore):this.selection.setRange(this.$getUndoSelection(v,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=0;E<v.length;E++){var _=v[E];(_.action=="insert"||_.action=="remove")&&this.doc.$safeApplyDelta(_)}!C&&this.$undoSelect&&(v.selectionAfter?this.selection.fromJSON(v.selectionAfter):this.selection.setRange(this.$getUndoSelection(v,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(v){this.$undoSelect=v},w.prototype.$getUndoSelection=function(v,C){function E(N){return C?N.action!=="insert":N.action==="insert"}for(var _,k,O=0;O<v.length;O++){var I=v[O];if(I.start){if(!_){E(I)?_=a.fromPoints(I.start,I.end):_=a.fromPoints(I.start,I.start);continue}E(I)?(k=I.start,_.compare(k.row,k.column)==-1&&_.setStart(k),k=I.end,_.compare(k.row,k.column)==1&&_.setEnd(k)):(k=I.start,_.compare(k.row,k.column)==-1&&(_=a.fromPoints(I.start,I.start)))}}return _},w.prototype.replace=function(v,C){return this.doc.replace(v,C)},w.prototype.moveText=function(v,C,E){var _=this.getTextRange(v),k=this.getFoldsInRange(v),O=a.fromPoints(C,C);if(!E){this.remove(v);var I=v.start.row-v.end.row,N=I?-v.end.column:v.start.column-v.end.column;N&&(O.start.row==v.end.row&&O.start.column>v.end.column&&(O.start.column+=N),O.end.row==v.end.row&&O.end.column>v.end.column&&(O.end.column+=N)),I&&O.start.row>=v.end.row&&(O.start.row+=I,O.end.row+=I)}if(O.end=this.insert(O.start,_),k.length){var P=v.start,B=O.start,I=B.row-P.row,N=B.column-P.column;this.addFolds(k.map(function(z){return z=z.clone(),z.start.row==P.row&&(z.start.column+=N),z.end.row==P.row&&(z.end.column+=N),z.start.row+=I,z.end.row+=I,z}))}return O},w.prototype.indentRows=function(v,C,E){E=E.replace(/\t/g,this.getTabString());for(var _=v;_<=C;_++)this.doc.insertInLine({row:_,column:0},E)},w.prototype.outdentRows=function(v){for(var C=v.collapseRows(),E=new a(0,0,0,0),_=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var O=this.getLine(k);E.start.row=k,E.end.row=k;for(var I=0;I<_&&O.charAt(I)==" ";++I);I<_&&O.charAt(I)==" "?(E.start.column=I,E.end.column=I+1):(E.start.column=0,E.end.column=I),this.remove(E)}},w.prototype.$moveLines=function(v,C,E){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),E<0){var _=this.getRowFoldStart(v+E);if(_<0)return 0;var k=_-v}else if(E>0){var _=this.getRowFoldEnd(C+E);if(_>this.doc.getLength()-1)return 0;var k=_-C}else{v=this.$clipRowToDocument(v),C=this.$clipRowToDocument(C);var k=C-v+1}var O=new a(v,0,C,Number.MAX_VALUE),I=this.getFoldsInRange(O).map(function(P){return P=P.clone(),P.start.row+=k,P.end.row+=k,P}),N=E==0?this.doc.getLines(v,C):this.doc.removeFullLines(v,C);return this.doc.insertFullLines(v+k,N),I.length&&this.addFolds(I),k},w.prototype.moveLinesUp=function(v,C){return this.$moveLines(v,C,-1)},w.prototype.moveLinesDown=function(v,C){return this.$moveLines(v,C,1)},w.prototype.duplicateLines=function(v,C){return this.$moveLines(v,C,0)},w.prototype.$clipRowToDocument=function(v){return Math.max(0,Math.min(v,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(v,C){return C<0?0:Math.min(this.doc.getLine(v).length,C)},w.prototype.$clipPositionToDocument=function(v,C){if(C=Math.max(0,C),v<0)v=0,C=0;else{var E=this.doc.getLength();v>=E?(v=E-1,C=this.doc.getLine(E-1).length):C=Math.min(this.doc.getLine(v).length,C)}return{row:v,column:C}},w.prototype.$clipRangeToDocument=function(v){v.start.row<0?(v.start.row=0,v.start.column=0):v.start.column=this.$clipColumnToRow(v.start.row,v.start.column);var C=this.doc.getLength()-1;return v.end.row>C?(v.end.row=C,v.end.column=this.doc.getLine(C).length):v.end.column=this.$clipColumnToRow(v.end.row,v.end.column),v},w.prototype.setUseWrapMode=function(v){if(v!=this.$useWrapMode){if(this.$useWrapMode=v,this.$modified=!0,this.$resetRowCache(0),v){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(v,C){(this.$wrapLimitRange.min!==v||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:v,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(v,C){var E=this.$wrapLimitRange;E.max<0&&(E={min:C,max:C});var _=this.$constrainWrapLimit(v,E.min,E.max);return _!=this.$wrapLimit&&_>1?(this.$wrapLimit=_,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(v,C,E){return C&&(v=Math.max(C,v)),E&&(v=Math.min(E,v)),v},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(v){this.setWrapLimitRange(v,v)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(v){var C=this.$useWrapMode,E=v.action,_=v.start,k=v.end,O=_.row,I=k.row,N=I-O,P=null;if(this.$updating=!0,N!=0)if(E==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(O,N);var B=this.$foldData;P=this.getFoldsInRange(v),this.removeFolds(P);var F=this.getFoldLine(k.row),H=0;if(F){F.addRemoveChars(k.row,k.column,_.column-k.column),F.shiftRow(-N);var z=this.getFoldLine(O);z&&z!==F&&(z.merge(F),F=z),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=k.row&&F.shiftRow(-N)}I=O}else{var W=Array(N);W.unshift(O,0);var U=C?this.$wrapData:this.$rowLengthCache;U.splice.apply(U,W);var B=this.$foldData,F=this.getFoldLine(O),H=0;if(F){var K=F.range.compareInside(_.row,_.column);K==0?(F=F.split(_.row,_.column),F&&(F.shiftRow(N),F.addRemoveChars(I,0,k.column-_.column))):K==-1&&(F.addRemoveChars(O,0,k.column-_.column),F.shiftRow(N)),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=O&&F.shiftRow(N)}}else{N=Math.abs(v.start.column-v.end.column),E==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(O);F&&F.addRemoveChars(O,_.column,N)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(O,I):this.$updateRowLengthCache(O,I),P},w.prototype.$updateRowLengthCache=function(v,C){this.$rowLengthCache[v]=null,this.$rowLengthCache[C]=null},w.prototype.$updateWrapData=function(v,C){var E=this.doc.getAllLines(),_=this.getTabSize(),k=this.$wrapData,O=this.$wrapLimit,I,N,P=v;for(C=Math.min(C,E.length-1);P<=C;)N=this.getFoldLine(P,N),N?(I=[],N.walk((function(B,F,H,z){var W;if(B!=null){W=this.$getDisplayTokens(B,I.length),W[0]=A;for(var U=1;U<W.length;U++)W[U]=S}else W=this.$getDisplayTokens(E[F].substring(z,H),I.length);I=I.concat(W)}).bind(this),N.end.row,E[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(I,O,_),P=N.end.row+1):(I=this.$getDisplayTokens(E[P]),k[P]=this.$computeWrapSplits(I,O,_),P++)},w.prototype.$computeWrapSplits=function(v,C,E){if(v.length==0)return[];var _=[],k=v.length,O=0,I=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,B=C<=Math.max(2*E,8)||P===!1?0:Math.floor(C/2);function F(){var K=0;if(B===0)return K;if(P)for(var Y=0;Y<v.length;Y++){var G=v[Y];if(G==R)K+=1;else if(G==L)K+=E;else{if(G==T)continue;break}}return N&&P!==!1&&(K+=E),Math.min(K,B)}function H(K){for(var Y=K-O,G=O;G<K;G++){var J=v[G];(J===12||J===2)&&(Y-=1)}_.length||(z=F(),_.indent=z),I+=Y,_.push(I),O=K}for(var z=0;k-O>C-z;){var W=O+C-z;if(v[W-1]>=R&&v[W]>=R){H(W);continue}if(v[W]==A||v[W]==S){for(W;W!=O-1&&v[W]!=A;W--);if(W>O){H(W);continue}for(W=O+C,W;W<v.length&&v[W]==S;W++);if(W==v.length)break;H(W);continue}for(var U=Math.max(W-(C-(C>>2)),O-1);W>U&&v[W]<A;)W--;if(N){for(;W>U&&v[W]<A;)W--;for(;W>U&&v[W]==$;)W--}else for(;W>U&&v[W]<R;)W--;if(W>U){H(++W);continue}W=O+C,v[W]==x&&W--,H(W-z)}return _},w.prototype.$getDisplayTokens=function(v,C){var E=[],_;C=C||0;for(var k=0;k<v.length;k++){var O=v.charCodeAt(k);if(O==9){_=this.getScreenTabSize(E.length+C),E.push(L);for(var I=1;I<_;I++)E.push(T)}else O==32?E.push(R):O>39&&O<48||O>57&&O<64?E.push($):O>=4352&&D(O)?E.push(M,x):E.push(M)}return E},w.prototype.$getStringScreenWidth=function(v,C,E){if(C==0)return[0,0];C==null&&(C=1/0),E=E||0;var _,k;for(k=0;k<v.length&&(_=v.charCodeAt(k),_==9?E+=this.getScreenTabSize(E):_>=4352&&D(_)?E+=2:E+=1,!(E>C));k++);return[E,k]},w.prototype.getRowLength=function(v){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[v]&&this.lineWidgets[v].rowCount||0),!this.$useWrapMode||!this.$wrapData[v]?C:this.$wrapData[v].length+C},w.prototype.getRowLineCount=function(v){return!this.$useWrapMode||!this.$wrapData[v]?1:this.$wrapData[v].length+1},w.prototype.getRowWrapIndent=function(v){if(this.$useWrapMode){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE),E=this.$wrapData[C.row];return E.length&&E[0]<C.column?E.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(v){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},w.prototype.getDocumentLastRowColumn=function(v,C){var E=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(E)},w.prototype.getDocumentLastRowColumnPosition=function(v,C){var E=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(E,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(v){if(this.$useWrapMode)return this.$wrapData[v]},w.prototype.getScreenTabSize=function(v){return this.$tabSize-(v%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(v,C){return this.screenToDocumentPosition(v,C).row},w.prototype.screenToDocumentColumn=function(v,C){return this.screenToDocumentPosition(v,C).column},w.prototype.screenToDocumentPosition=function(v,C,E){if(v<0)return{row:0,column:0};var _,k=0,O=0,I,N=0,P=0,B=this.$screenRowCache,F=this.$getRowCacheIndex(B,v),H=B.length;if(H&&F>=0)var N=B[F],k=this.$docRowCache[F],z=v>B[H-1];else var z=!H;for(var W=this.getLength()-1,U=this.getNextFoldLine(k),K=U?U.start.row:1/0;N<=v&&(P=this.getRowLength(k),!(N+P>v||k>=W));)N+=P,k++,k>K&&(k=U.end.row+1,U=this.getNextFoldLine(k,U),K=U?U.start.row:1/0),z&&(this.$docRowCache.push(k),this.$screenRowCache.push(N));if(U&&U.start.row<=k)_=this.getFoldDisplayLine(U),k=U.start.row;else{if(N+P<=v||k>W)return{row:W,column:this.getLine(W).length};_=this.getLine(k),U=null}var Y=0,G=Math.floor(v-N);if(this.$useWrapMode){var J=this.$wrapData[k];J&&(I=J[G],G>0&&J.length&&(Y=J.indent,O=J[G-1]||J[J.length-1],_=_.substring(O)))}return E!==void 0&&this.$bidiHandler.isBidiRow(N+G,k,G)&&(C=this.$bidiHandler.offsetToCol(E)),O+=this.$getStringScreenWidth(_,C-Y)[1],this.$useWrapMode&&O>=I&&(O=I-1),U?U.idxToPosition(O):{row:k,column:O}},w.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var E=this.$clipPositionToDocument(v.row,v.column);else E=this.$clipPositionToDocument(v,C);v=E.row,C=E.column;var _=0,k=null,O=null;O=this.getFoldAt(v,C,1),O&&(v=O.start.row,C=O.start.column);var I,N=0,P=this.$docRowCache,B=this.$getRowCacheIndex(P,v),F=P.length;if(F&&B>=0)var N=P[B],_=this.$screenRowCache[B],H=v>P[F-1];else var H=!F;for(var z=this.getNextFoldLine(N),W=z?z.start.row:1/0;N<v;){if(N>=W){if(I=z.end.row+1,I>v)break;z=this.getNextFoldLine(I,z),W=z?z.start.row:1/0}else I=N+1;_+=this.getRowLength(N),N=I,H&&(this.$docRowCache.push(N),this.$screenRowCache.push(_))}var U="";z&&N>=W?(U=this.getFoldDisplayLine(z,v,C),k=z.start.row):(U=this.getLine(v).substring(0,C),k=v);var K=0;if(this.$useWrapMode){var Y=this.$wrapData[k];if(Y){for(var G=0;U.length>=Y[G];)_++,G++;U=U.substring(Y[G-1]||0,U.length),K=G>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[N]&&this.lineWidgets[N].rowsAbove&&(_+=this.lineWidgets[N].rowsAbove),{row:_,column:K+this.$getStringScreenWidth(U)[0]}},w.prototype.documentToScreenColumn=function(v,C){return this.documentToScreenPosition(v,C).column},w.prototype.documentToScreenRow=function(v,C){return this.documentToScreenPosition(v,C).row},w.prototype.getScreenLength=function(){var v=0,C=null;if(this.$useWrapMode)for(var k=this.$wrapData.length,O=0,_=0,C=this.$foldData[_++],I=C?C.start.row:1/0;O<k;){var N=this.$wrapData[O];v+=N?N.length+1:1,O++,O>I&&(O=C.end.row+1,C=this.$foldData[_++],I=C?C.start.row:1/0)}else{v=this.getLength();for(var E=this.$foldData,_=0;_<E.length;_++)C=E[_],v-=C.end.row-C.start.row}return this.lineWidgets&&(v+=this.$getWidgetScreenLength()),v},w.prototype.$setFontMetrics=function(v){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,E,_){if(E===0)return[0,0];E||(E=1/0),_=_||0;var k,O;for(O=0;O<C.length&&(k=C.charAt(O),k===" "?_+=this.getScreenTabSize(_):_+=v.getCharacterWidth(k),!(_>E));O++);return[_,O]})},w.prototype.getPrecedingCharacter=function(){var v=this.selection.getCursor();if(v.column===0)return v.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine(v.row);return C[v.column-1]},w.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},w})();b.$uid=0,b.prototype.$modes=c.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=D,h.implement(b.prototype,f);var M=1,x=2,A=3,S=4,$=9,R=10,L=11,T=12;function D(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),c.defineOptions(b.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var v=typeof w=="number"?w:null;this.setWrapLimitRange(v,v),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,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(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,d){var h=t("./lib/lang"),g=t("./lib/oop"),m=t("./range").Range,c=(function(){function r(){this.$options={}}return r.prototype.set=function(o){return g.mixin(this.$options,o),this},r.prototype.getOptions=function(){return h.copyObject(this.$options)},r.prototype.setOptions=function(o){this.$options=o},r.prototype.find=function(o){var a=this.$options,s=this.$matchIterator(o,a);if(!s)return!1;var i=null;return s.forEach(function(u,p,y,b){return i=new m(u,p,y,b),p==b&&a.start&&a.start.start&&a.skipCurrent!=!1&&i.isEqual(a.start)?(i=null,!1):!0}),i},r.prototype.findAll=function(o){var a=this.$options;if(!a.needle)return[];this.$assembleRegExp(a);var s=a.range,i=s?o.getLines(s.start.row,s.end.row):o.doc.getAllLines(),u=[],p=a.re;if(a.$isMultiLine){var y=p.length,b=i.length-y,M;e:for(var x=p.offset||0;x<=b;x++){for(var A=0;A<y;A++)if(i[x+A].search(p[A])==-1)continue e;var S=i[x],$=i[x+y-1],R=S.length-S.match(p[0])[0].length,L=$.match(p[y-1])[0].length;M&&M.end.row===x&&M.end.column>R||(u.push(M=new m(x,R,x+y-1,L)),y>2&&(x=x+y-2))}}else for(var T=0;T<i.length;T++)for(var D=h.getMatchOffsets(i[T],p),A=0;A<D.length;A++){var w=D[A];u.push(new m(T,w.offset,T,w.offset+w.length))}if(s){for(var v=s.start.column,C=s.end.column,T=0,A=u.length-1;T<A&&u[T].start.column<v&&u[T].start.row==0;)T++;for(var E=s.end.row-s.start.row;T<A&&u[A].end.column>C&&u[A].end.row==E;)A--;for(u=u.slice(T,A+1),T=0,A=u.length;T<A;T++)u[T].start.row+=s.start.row,u[T].end.row+=s.start.row}return u},r.prototype.replace=function(o,a){var s=this.$options,i=this.$assembleRegExp(s);if(s.$isMultiLine)return a;if(i){var u=i.exec(o);if(!u||u[0].length!=o.length)return null;if(s.regExp||(a=a.replace(/\$/g,"$$$$")),a=o.replace(i,a),s.preserveCase){a=a.split("");for(var p=Math.min(o.length,o.length);p--;){var y=o[p];y&&y.toLowerCase()!=y?a[p]=a[p].toUpperCase():a[p]=a[p].toLowerCase()}a=a.join("")}return a}},r.prototype.$assembleRegExp=function(o,a){if(o.needle instanceof RegExp)return o.re=o.needle;var s=o.needle;if(!o.needle)return o.re=!1;o.regExp||(s=h.escapeRegExp(s));var i=o.caseSensitive?"gm":"gmi";try{new RegExp(s,"u"),o.$supportsUnicodeFlag=!0,i+="u"}catch{o.$supportsUnicodeFlag=!1}if(o.wholeWord&&(s=f(s,o)),o.$isMultiLine=!a&&/[\n\r]/.test(s),o.$isMultiLine)return o.re=this.$assembleMultilineRegExp(s,i);try{var u=new RegExp(s,i)}catch{u=!1}return o.re=u},r.prototype.$assembleMultilineRegExp=function(o,a){for(var s=o.replace(/\r\n|\r|\n/g,`$
1362
1362
  ^`).split(`
1363
- `),i=[],u=0;u<s.length;u++)try{i.push(new RegExp(s[u],a))}catch{return!1}return i},r.prototype.$matchIterator=function(o,a){var s=this.$assembleRegExp(a);if(!s)return!1;var i=a.backwards==!0,u=a.skipCurrent!=!1,f=s.unicode,y=a.range,b=a.start;b||(b=y?y[i?"end":"start"]:o.selection.getRange()),b.start&&(b=b[u!=i?"end":"start"]);var M=y?y.start.row:0,$=y?y.end.row:o.getLength()-1;if(i)var A=function(R){var L=b.row;if(!E(L,b.column,R)){for(L--;L>=M;L--)if(E(L,Number.MAX_VALUE,R))return;if(a.wrap!=!1){for(L=$,M=b.row;L>=M;L--)if(E(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var _=b.row;if(!E(_,b.column,L)){for(_=_+1;_<=$;_++)if(E(_,0,L))return;if(a.wrap!=!1){for(_=M,$=b.row;_<=$;_++)if(E(_,0,L))return}}};if(a.$isMultiLine)var S=s.length,E=function(R,L,_){var D=i?R-S+1:R;if(!(D<0||D+S>o.getLength())){var w=o.getLine(D),v=w.search(s[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(D+C),w.search(s[C])==-1)return;var x=w.match(s[S-1])[0].length;if(!(i&&x>L)&&_(D,v,D+S-1,x))return!0}}};else if(i)var E=function(L,_,D){var w=o.getLine(L),v=[],C,x=0;for(s.lastIndex=0;C=s.exec(w);){var T=C[0].length;if(x=C.index,!T){if(x>=w.length)break;s.lastIndex=x+=h.skipEmptyMatch(w,x,f)}if(C.index+T>_)break;v.push(C.index,T)}for(var k=v.length-1;k>=0;k-=2){var O=v[k-1],T=v[k];if(D(L,O,L,O+T))return!0}};else var E=function(L,_,D){var w=o.getLine(L),v,C;for(s.lastIndex=_;C=s.exec(w);){var x=C[0].length;if(v=C.index,D(L,v,L,v+x))return!0;if(!x&&(s.lastIndex=v+=h.skipEmptyMatch(w,v,f),v>=w.length))return!1}};return{forEach:A}},r})();function d(r,o){var a=h.supportsLookbehind();function s(y,b){b===void 0&&(b=!0);var M=a&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return M.test(y)||o.regExp?a&&o.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var i=Array.from(r),u=i[0],f=i[i.length-1];return s(u)+r+s(f,!1)}n.Search=c}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(u[y]=f[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../lib/keys"),m=t("../lib/useragent"),c=g.KEY_MODS,d=(function(){function a(s,i){this.$init(s,i,!1)}return a.prototype.$init=function(s,i,u){this.platform=i||(m.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(s),this.$singleCommand=u},a.prototype.addCommand=function(s){this.commands[s.name]&&this.removeCommand(s),this.commands[s.name]=s,s.bindKey&&this._buildKeyHash(s)},a.prototype.removeCommand=function(s,i){var u=s&&(typeof s=="string"?s:s.name);s=this.commands[u],i||delete this.commands[u];var f=this.commandKeyBinding;for(var y in f){var b=f[y];if(b==s)delete f[y];else if(Array.isArray(b)){var M=b.indexOf(s);M!=-1&&(b.splice(M,1),b.length==1&&(f[y]=b[0]))}}},a.prototype.bindKey=function(s,i,u){if(typeof s=="object"&&s&&(u==null&&(u=s.position),s=s[this.platform]),!!s){if(typeof i=="function")return this.addCommand({exec:i,bindKey:s,name:i.name||s});s.split("|").forEach(function(f){var y="";if(f.indexOf(" ")!=-1){var b=f.split(/\s+/);f=b.pop(),b.forEach(function(A){var S=this.parseKeys(A),E=c[S.hashId]+S.key;y+=(y?" ":"")+E,this._addCommandToBinding(y,"chainKeys")},this),y+=" "}var M=this.parseKeys(f),$=c[M.hashId]+M.key;this._addCommandToBinding(y+$,i,u)},this)}},a.prototype._addCommandToBinding=function(s,i,u){var f=this.commandKeyBinding,y;if(!i)delete f[s];else if(!f[s]||this.$singleCommand)f[s]=i;else{Array.isArray(f[s])?(y=f[s].indexOf(i))!=-1&&f[s].splice(y,1):f[s]=[f[s]],typeof u!="number"&&(u=r(i));var b=f[s];for(y=0;y<b.length;y++){var M=b[y],$=r(M);if($>u)break}b.splice(y,0,i)}},a.prototype.addCommands=function(s){s&&Object.keys(s).forEach(function(i){var u=s[i];if(u){if(typeof u=="string")return this.bindKey(u,i);typeof u=="function"&&(u={exec:u}),typeof u=="object"&&(u.name||(u.name=i),this.addCommand(u))}},this)},a.prototype.removeCommands=function(s){Object.keys(s).forEach(function(i){this.removeCommand(s[i])},this)},a.prototype.bindKeys=function(s){Object.keys(s).forEach(function(i){this.bindKey(i,s[i])},this)},a.prototype._buildKeyHash=function(s){this.bindKey(s.bindKey,s)},a.prototype.parseKeys=function(s){var i=s.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),u=i.pop(),f=g[u];if(g.FUNCTION_KEYS[f])u=g.FUNCTION_KEYS[f].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:u.toUpperCase(),hashId:-1}}else return{key:u,hashId:-1};for(var y=0,b=i.length;b--;){var M=g.KEY_MODS[i[b]];if(M==null)return typeof console<"u"&&console.error("invalid modifier "+i[b]+" in "+s),!1;y|=M}return{key:u,hashId:y}},a.prototype.findKeyCommand=function(s,i){var u=c[s]+i;return this.commandKeyBinding[u]},a.prototype.handleKeyboard=function(s,i,u,f){if(!(f<0)){var y=c[i]+u,b=this.commandKeyBinding[y];return s.$keyChain&&(s.$keyChain+=" "+y,b=this.commandKeyBinding[s.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(s.$keyChain=s.$keyChain||y,{command:"null"}):(s.$keyChain&&((!i||i==4)&&u.length==1?s.$keyChain=s.$keyChain.slice(0,-y.length-1):(i==-1||f>0)&&(s.$keyChain="")),{command:b})}},a.prototype.getStatusText=function(s,i){return i.$keyChain||""},a})();function r(a){return typeof a=="object"&&a.bindKey&&a.bindKey.position||(a.isDefault?-100:0)}var o=(function(a){h(s,a);function s(i,u){var f=a.call(this,i,u)||this;return f.$singleCommand=!0,f}return s})(d);o.call=function(a,s,i){d.prototype.$init.call(a,s,i,!0)},d.call=function(a,s,i){d.prototype.$init.call(a,s,i,!1)},n.HashHandler=o,n.MultiHashHandler=d}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,p){var h=this&&this.__extends||(function(){var r=function(o,a){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(s[u]=i[u])},r(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(o,a);function s(){this.constructor=o}o.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),g=t("../lib/oop"),m=t("../keyboard/hash_handler").MultiHashHandler,c=t("../lib/event_emitter").EventEmitter,d=(function(r){h(o,r);function o(a,s){var i=r.call(this,s,a)||this;return i.byName=i.commands,i.setDefaultHandler("exec",function(u){return u.args?u.command.exec(u.editor,u.args,u.event,!1):u.command.exec(u.editor,{},u.event,!0)}),i}return o.prototype.exec=function(a,s,i){if(Array.isArray(a)){for(var u=a.length;u--;)if(this.exec(a[u],s,i))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!this.canExecute(a,s))return!1;var f={editor:s,command:a,args:i};return f.returnValue=this._emit("exec",f),this._signal("afterExec",f),f.returnValue!==!1},o.prototype.canExecute=function(a,s){return typeof a=="string"&&(a=this.commands[a]),!(!a||s&&s.$readOnly&&!a.readOnly||this.$checkCommandState!=!1&&a.isAvailable&&!a.isAvailable(s))},o.prototype.toggleRecording=function(a){if(!this.$inReplay)return a&&a._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(s){this.macro.push([s.command,s.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(s){typeof s=="string"?this.exec(s,a):this.exec(s[0],a,s[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(a){return a.map(function(s){return typeof s[0]!="string"&&(s[0]=s[0].name),s[1]||(s=s[0]),s})},o})(m);g.implement(d.prototype,c),n.CommandManager=d}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,p){var h=t("../lib/lang"),g=t("../config"),m=t("../range").Range;function c(r,o){return{win:r,mac:o}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:c("Ctrl-,","Command-,"),exec:function(r){g.loadModule("ace/ext/settings_menu",function(o){o.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:c("Alt-E","F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:c("Alt-Shift-E","Shift-F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:c("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:c(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:c("Ctrl-L","Command-L"),exec:function(r,o){typeof o=="number"&&!isNaN(o)&&r.gotoLine(o),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:c("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:c("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:c("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:c("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:c("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:c("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:c("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:c("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:c("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:c("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:c("Ctrl-F","Command-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:c("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:c("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:c("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:c("Up","Up|Ctrl-P"),exec:function(r,o){r.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:c("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:c("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:c("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:c("Down","Down|Ctrl-N"),exec:function(r,o){r.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:c("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:c("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:c("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:c("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:c("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:c("Left","Left|Ctrl-B"),exec:function(r,o){r.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:c("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:c("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:c("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:c("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:c("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:c("Right","Right|Ctrl-F"),exec:function(r,o){r.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:c(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:c("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:c(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:c("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:c("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:c("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:c("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:c("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:c("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:c("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:c(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var o=r.$copyWithEmptySelection&&r.selection.isEmpty(),a=o?r.selection.getLineRange():r.selection.getRange();r._emit("cut",a),a.isEmpty()||r.session.remove(a),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,o){r.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:c("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:c("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:c("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:c("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:c("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:c("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:c("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:c("Ctrl-H","Command-Option-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:c("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:c("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:c("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:c("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:c("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:c("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:c("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:c("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:c("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:c("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:c("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:c("Ctrl-Shift-Backspace",null),exec:function(r){var o=r.selection.getRange();o.start.column=0,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:c("Ctrl-Shift-Delete",null),exec:function(r){var o=r.selection.getRange();o.end.column=Number.MAX_VALUE,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:c("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:c("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:c("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:c("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:c("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:c("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,o){r.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,o){r.insert(h.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:c(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:c("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:c("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:c("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:c(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:c("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var o=r.selection.getRange();o.start.column=o.end.column=0,o.end.row++,r.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:c("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:c(null,null),exec:function(r){for(var o=r.selection.isBackwards(),a=o?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),s=o?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),i=r.session.doc.getLine(a.row).length,u=r.session.doc.getTextRange(r.selection.getRange()),f=u.replace(/\n\s*/," ").length,y=r.session.doc.getLine(a.row),b=a.row+1;b<=s.row+1;b++){var M=h.stringTrimLeft(h.stringTrimRight(r.session.doc.getLine(b)));M.length!==0&&(M=" "+M),y+=M}s.row+1<r.session.doc.getLength()-1&&(y+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new m(a.row,0,s.row+2,0),y),f>0?(r.selection.moveCursorTo(a.row,a.column),r.selection.selectTo(a.row,a.column+f)):(i=r.session.doc.getLine(a.row).length>i?i+1:i,r.selection.moveCursorTo(a.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:c(null,null),exec:function(r){var o=r.session.doc.getLength()-1,a=r.session.doc.getLine(o).length,s=r.selection.rangeList.ranges,i=[];s.length<1&&(s=[r.selection.getRange()]);for(var u=0;u<s.length;u++)u==s.length-1&&(s[u].end.row===o&&s[u].end.column===a||i.push(new m(s[u].end.row,s[u].end.column,o,a))),u===0?s[u].start.row===0&&s[u].start.column===0||i.push(new m(0,0,s[u].start.row,s[u].start.column)):i.push(new m(s[u-1].end.row,s[u-1].end.column,s[u].start.row,s[u].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var u=0;u<i.length;u++)r.selection.addRange(i[u],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
1363
+ `),i=[],u=0;u<s.length;u++)try{i.push(new RegExp(s[u],a))}catch{return!1}return i},r.prototype.$matchIterator=function(o,a){var s=this.$assembleRegExp(a);if(!s)return!1;var i=a.backwards==!0,u=a.skipCurrent!=!1,p=s.unicode,y=a.range,b=a.start;b||(b=y?y[i?"end":"start"]:o.selection.getRange()),b.start&&(b=b[u!=i?"end":"start"]);var M=y?y.start.row:0,x=y?y.end.row:o.getLength()-1;if(i)var A=function(R){var L=b.row;if(!$(L,b.column,R)){for(L--;L>=M;L--)if($(L,Number.MAX_VALUE,R))return;if(a.wrap!=!1){for(L=x,M=b.row;L>=M;L--)if($(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var T=b.row;if(!$(T,b.column,L)){for(T=T+1;T<=x;T++)if($(T,0,L))return;if(a.wrap!=!1){for(T=M,x=b.row;T<=x;T++)if($(T,0,L))return}}};if(a.$isMultiLine)var S=s.length,$=function(R,L,T){var D=i?R-S+1:R;if(!(D<0||D+S>o.getLength())){var w=o.getLine(D),v=w.search(s[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(D+C),w.search(s[C])==-1)return;var E=w.match(s[S-1])[0].length;if(!(i&&E>L)&&T(D,v,D+S-1,E))return!0}}};else if(i)var $=function(L,T,D){var w=o.getLine(L),v=[],C,E=0;for(s.lastIndex=0;C=s.exec(w);){var _=C[0].length;if(E=C.index,!_){if(E>=w.length)break;s.lastIndex=E+=h.skipEmptyMatch(w,E,p)}if(C.index+_>T)break;v.push(C.index,_)}for(var k=v.length-1;k>=0;k-=2){var O=v[k-1],_=v[k];if(D(L,O,L,O+_))return!0}};else var $=function(L,T,D){var w=o.getLine(L),v,C;for(s.lastIndex=T;C=s.exec(w);){var E=C[0].length;if(v=C.index,D(L,v,L,v+E))return!0;if(!E&&(s.lastIndex=v+=h.skipEmptyMatch(w,v,p),v>=w.length))return!1}};return{forEach:A}},r})();function f(r,o){var a=h.supportsLookbehind();function s(y,b){b===void 0&&(b=!0);var M=a&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return M.test(y)||o.regExp?a&&o.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var i=Array.from(r),u=i[0],p=i[i.length-1];return s(u)+r+s(p,!1)}n.Search=c}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,d){var h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var y in p)Object.prototype.hasOwnProperty.call(p,y)&&(u[y]=p[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../lib/keys"),m=t("../lib/useragent"),c=g.KEY_MODS,f=(function(){function a(s,i){this.$init(s,i,!1)}return a.prototype.$init=function(s,i,u){this.platform=i||(m.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(s),this.$singleCommand=u},a.prototype.addCommand=function(s){this.commands[s.name]&&this.removeCommand(s),this.commands[s.name]=s,s.bindKey&&this._buildKeyHash(s)},a.prototype.removeCommand=function(s,i){var u=s&&(typeof s=="string"?s:s.name);s=this.commands[u],i||delete this.commands[u];var p=this.commandKeyBinding;for(var y in p){var b=p[y];if(b==s)delete p[y];else if(Array.isArray(b)){var M=b.indexOf(s);M!=-1&&(b.splice(M,1),b.length==1&&(p[y]=b[0]))}}},a.prototype.bindKey=function(s,i,u){if(typeof s=="object"&&s&&(u==null&&(u=s.position),s=s[this.platform]),!!s){if(typeof i=="function")return this.addCommand({exec:i,bindKey:s,name:i.name||s});s.split("|").forEach(function(p){var y="";if(p.indexOf(" ")!=-1){var b=p.split(/\s+/);p=b.pop(),b.forEach(function(A){var S=this.parseKeys(A),$=c[S.hashId]+S.key;y+=(y?" ":"")+$,this._addCommandToBinding(y,"chainKeys")},this),y+=" "}var M=this.parseKeys(p),x=c[M.hashId]+M.key;this._addCommandToBinding(y+x,i,u)},this)}},a.prototype._addCommandToBinding=function(s,i,u){var p=this.commandKeyBinding,y;if(!i)delete p[s];else if(!p[s]||this.$singleCommand)p[s]=i;else{Array.isArray(p[s])?(y=p[s].indexOf(i))!=-1&&p[s].splice(y,1):p[s]=[p[s]],typeof u!="number"&&(u=r(i));var b=p[s];for(y=0;y<b.length;y++){var M=b[y],x=r(M);if(x>u)break}b.splice(y,0,i)}},a.prototype.addCommands=function(s){s&&Object.keys(s).forEach(function(i){var u=s[i];if(u){if(typeof u=="string")return this.bindKey(u,i);typeof u=="function"&&(u={exec:u}),typeof u=="object"&&(u.name||(u.name=i),this.addCommand(u))}},this)},a.prototype.removeCommands=function(s){Object.keys(s).forEach(function(i){this.removeCommand(s[i])},this)},a.prototype.bindKeys=function(s){Object.keys(s).forEach(function(i){this.bindKey(i,s[i])},this)},a.prototype._buildKeyHash=function(s){this.bindKey(s.bindKey,s)},a.prototype.parseKeys=function(s){var i=s.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}),u=i.pop(),p=g[u];if(g.FUNCTION_KEYS[p])u=g.FUNCTION_KEYS[p].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:u.toUpperCase(),hashId:-1}}else return{key:u,hashId:-1};for(var y=0,b=i.length;b--;){var M=g.KEY_MODS[i[b]];if(M==null)return typeof console<"u"&&console.error("invalid modifier "+i[b]+" in "+s),!1;y|=M}return{key:u,hashId:y}},a.prototype.findKeyCommand=function(s,i){var u=c[s]+i;return this.commandKeyBinding[u]},a.prototype.handleKeyboard=function(s,i,u,p){if(!(p<0)){var y=c[i]+u,b=this.commandKeyBinding[y];return s.$keyChain&&(s.$keyChain+=" "+y,b=this.commandKeyBinding[s.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(s.$keyChain=s.$keyChain||y,{command:"null"}):(s.$keyChain&&((!i||i==4)&&u.length==1?s.$keyChain=s.$keyChain.slice(0,-y.length-1):(i==-1||p>0)&&(s.$keyChain="")),{command:b})}},a.prototype.getStatusText=function(s,i){return i.$keyChain||""},a})();function r(a){return typeof a=="object"&&a.bindKey&&a.bindKey.position||(a.isDefault?-100:0)}var o=(function(a){h(s,a);function s(i,u){var p=a.call(this,i,u)||this;return p.$singleCommand=!0,p}return s})(f);o.call=function(a,s,i){f.prototype.$init.call(a,s,i,!0)},f.call=function(a,s,i){f.prototype.$init.call(a,s,i,!1)},n.HashHandler=o,n.MultiHashHandler=f}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,d){var h=this&&this.__extends||(function(){var r=function(o,a){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(s[u]=i[u])},r(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(o,a);function s(){this.constructor=o}o.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),g=t("../lib/oop"),m=t("../keyboard/hash_handler").MultiHashHandler,c=t("../lib/event_emitter").EventEmitter,f=(function(r){h(o,r);function o(a,s){var i=r.call(this,s,a)||this;return i.byName=i.commands,i.setDefaultHandler("exec",function(u){return u.args?u.command.exec(u.editor,u.args,u.event,!1):u.command.exec(u.editor,{},u.event,!0)}),i}return o.prototype.exec=function(a,s,i){if(Array.isArray(a)){for(var u=a.length;u--;)if(this.exec(a[u],s,i))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!this.canExecute(a,s))return!1;var p={editor:s,command:a,args:i};return p.returnValue=this._emit("exec",p),this._signal("afterExec",p),p.returnValue!==!1},o.prototype.canExecute=function(a,s){return typeof a=="string"&&(a=this.commands[a]),!(!a||s&&s.$readOnly&&!a.readOnly||this.$checkCommandState!=!1&&a.isAvailable&&!a.isAvailable(s))},o.prototype.toggleRecording=function(a){if(!this.$inReplay)return a&&a._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(s){this.macro.push([s.command,s.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(s){typeof s=="string"?this.exec(s,a):this.exec(s[0],a,s[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(a){return a.map(function(s){return typeof s[0]!="string"&&(s[0]=s[0].name),s[1]||(s=s[0]),s})},o})(m);g.implement(f.prototype,c),n.CommandManager=f}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,d){var h=t("../lib/lang"),g=t("../config"),m=t("../range").Range;function c(r,o){return{win:r,mac:o}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:c("Ctrl-,","Command-,"),exec:function(r){g.loadModule("ace/ext/settings_menu",function(o){o.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:c("Alt-E","F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:c("Alt-Shift-E","Shift-F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:c("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:c(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:c("Ctrl-L","Command-L"),exec:function(r,o){typeof o=="number"&&!isNaN(o)&&r.gotoLine(o),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:c("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:c("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:c("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:c("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:c("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:c("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:c("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:c("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:c("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:c("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:c("Ctrl-F","Command-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:c("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:c("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:c("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:c("Up","Up|Ctrl-P"),exec:function(r,o){r.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:c("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:c("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:c("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:c("Down","Down|Ctrl-N"),exec:function(r,o){r.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:c("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:c("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:c("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:c("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:c("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:c("Left","Left|Ctrl-B"),exec:function(r,o){r.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:c("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:c("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:c("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:c("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:c("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:c("Right","Right|Ctrl-F"),exec:function(r,o){r.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:c(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:c("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:c(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:c("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:c("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:c("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:c("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:c("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:c("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:c("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:c(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var o=r.$copyWithEmptySelection&&r.selection.isEmpty(),a=o?r.selection.getLineRange():r.selection.getRange();r._emit("cut",a),a.isEmpty()||r.session.remove(a),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,o){r.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:c("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:c("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:c("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:c("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:c("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:c("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:c("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:c("Ctrl-H","Command-Option-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:c("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:c("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:c("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:c("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:c("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:c("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:c("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:c("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:c("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:c("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:c("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:c("Ctrl-Shift-Backspace",null),exec:function(r){var o=r.selection.getRange();o.start.column=0,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:c("Ctrl-Shift-Delete",null),exec:function(r){var o=r.selection.getRange();o.end.column=Number.MAX_VALUE,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:c("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:c("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:c("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:c("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:c("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:c("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,o){r.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,o){r.insert(h.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:c(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:c("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:c("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:c("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:c(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:c("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var o=r.selection.getRange();o.start.column=o.end.column=0,o.end.row++,r.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:c("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:c(null,null),exec:function(r){for(var o=r.selection.isBackwards(),a=o?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),s=o?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),i=r.session.doc.getLine(a.row).length,u=r.session.doc.getTextRange(r.selection.getRange()),p=u.replace(/\n\s*/," ").length,y=r.session.doc.getLine(a.row),b=a.row+1;b<=s.row+1;b++){var M=h.stringTrimLeft(h.stringTrimRight(r.session.doc.getLine(b)));M.length!==0&&(M=" "+M),y+=M}s.row+1<r.session.doc.getLength()-1&&(y+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new m(a.row,0,s.row+2,0),y),p>0?(r.selection.moveCursorTo(a.row,a.column),r.selection.selectTo(a.row,a.column+p)):(i=r.session.doc.getLine(a.row).length>i?i+1:i,r.selection.moveCursorTo(a.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:c(null,null),exec:function(r){var o=r.session.doc.getLength()-1,a=r.session.doc.getLine(o).length,s=r.selection.rangeList.ranges,i=[];s.length<1&&(s=[r.selection.getRange()]);for(var u=0;u<s.length;u++)u==s.length-1&&(s[u].end.row===o&&s[u].end.column===a||i.push(new m(s[u].end.row,s[u].end.column,o,a))),u===0?s[u].start.row===0&&s[u].start.column===0||i.push(new m(0,0,s[u].start.row,s[u].start.column)):i.push(new m(s[u-1].end.row,s[u-1].end.column,s[u].start.row,s[u].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var u=0;u<i.length;u++)r.selection.addRange(i[u],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
1364
1364
  `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var o=r.getCursorPosition();r.selection.moveTo(o.row-1,Number.MAX_VALUE),r.insert(`
1365
- `),o.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:c("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:c(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var d=1;d<9;d++)n.commands.push({name:"foldToLevel"+d,description:"Fold To Level "+d,level:d,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,n,p){var h=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function d(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new g(this.editor)}return d.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))},d.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))},d.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===h.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=h.enter)return;r.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var a=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),s=this.$findNearestFoldWidget(a),i=this.$findNearestAnnotation(a);if(!(s===null&&i===null)){if(s===null&&i!==null){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(s!==null&&i===null){this.activeRowIndex=s,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-a)<Math.abs(s-a)){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=s,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout((function(){this.editor._signal("gutterkeydown",new c(r,this))}).bind(this),10)},d.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===h.tab){r.preventDefault();return}if(r.keyCode===h.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===h.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===h.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===h.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===h.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===h.enter||r.keyCode===h.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var o=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var a=this.lines.cells[this.activeRowIndex].element.childNodes[2],s=a.getBoundingClientRect(),i=this.annotationTooltip.getElement().style;i.left=s.right+"px",i.top=s.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},d.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},d.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getFoldWidget(r).style.display!=="none";return o&&a},d.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getAnnotation(r).style.display!=="none";return o&&a},d.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[1]},d.prototype.$getAnnotation=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[2]},d.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isFoldWidgetVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+o))return r+o}return null},d.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isAnnotationVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+o))return r+o}return null},d.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},d.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},d.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},d.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},d.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},d.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},d.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},d.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},d.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var a=this.$findNearestFoldWidget(this.activeRowIndex);if(a==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=a,this.$focusFoldWidget(this.activeRowIndex);break}},d.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},d.prototype.$rowToRowIndex=function(r){for(var o=0;o<this.lines.getLength();o++){var a=this.lines.get(o);if(a.row==r)return o}return null},d})();n.GutterKeyboardHandler=m;var c=(function(){function d(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return d.prototype.getKey=function(){return h.keyCodeToString(this.domEvent.keyCode)},d.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},d.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},d.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},d})();n.GutterKeyboardEvent=c}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(t,n,p){var h=this&&this.__values||function(w){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&w[v],x=0;if(C)return C.call(w);if(w&&typeof w.length=="number")return{next:function(){return w&&x>=w.length&&(w=void 0),{value:w&&w[x++],done:!w}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/lang"),d=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,o=t("./mouse/mouse_handler").MouseHandler,a=t("./mouse/fold_handler").FoldHandler,s=t("./keyboard/keybinding").KeyBinding,i=t("./edit_session").EditSession,u=t("./search").Search,f=t("./range").Range,y=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,M=t("./commands/default_commands").commands,$=t("./config"),A=t("./token_iterator").TokenIterator,S=t("./keyboard/gutter_handler").GutterKeyboardHandler,E=t("./config").nls,R=t("./clipboard"),L=t("./lib/keys"),_=(function(){function w(v,C,x){this.session,this.$toDestroy=[];var T=v.getContainerElement();this.container=T,this.renderer=v,this.id="editor"+ ++w.$uid,this.commands=new b(d.isMac?"mac":"win",M),typeof document=="object"&&(this.textInput=new r(v.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new a(this)),this.keyBinding=new s(this),this.$search=new u().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=c.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(k,O){O._$emitInputEvent.schedule(31)}),this.setSession(C||x&&x.session||new i("")),$.resetOptions(this),x&&this.setOptions(x),$._signal("editor",this)}return w.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},w.prototype.startOperation=function(v){this.session.startOperation(v)},w.prototype.endOperation=function(v){this.session.endOperation(v)},w.prototype.onStartOperation=function(v){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,v||(this.previousCommand=null)},w.prototype.onEndOperation=function(v){if(this.curOp&&this.session){if(v&&v.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var C=this.curOp.command,x=C&&C.scrollIntoView;if(x){switch(x){case"center-animate":x="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),k=this.renderer.layerConfig;(T.start.row>=k.lastRow||T.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}x=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},w.prototype.$historyTracker=function(v){if(this.$mergeUndoDeltas){var C=this.prevOp,x=this.$mergeableCommands,T=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else T=T&&x.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:x.indexOf(v.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},w.prototype.setKeyboardHandler=function(v,C){if(v&&typeof v=="string"&&v!="ace"){this.$keybindingId=v;var x=this;$.loadModule(["keybinding",v],function(T){x.$keybindingId==v&&x.keyBinding.setKeyboardHandler(T&&T.handler),C&&C()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(v),C&&C()},w.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},w.prototype.setSession=function(v){if(this.session!=v){this.curOp&&this.endOperation(),this.curOp={};var C=this.session;if(C){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var x=this.session.getSelection();x.off("changeCursor",this.$onCursorChange),x.off("changeSelection",this.$onSelectionChange)}this.session=v,v?(this.$onDocumentChange=this.onDocumentChange.bind(this),v.on("change",this.$onDocumentChange),this.renderer.setSession(v),this.$onChangeMode=this.onChangeMode.bind(this),v.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),v.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),v.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),v.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),v.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),v.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=v.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(v)),this._signal("changeSession",{session:v,oldSession:C}),this.curOp=null,C&&C._signal("changeEditor",{oldEditor:this}),C&&(C.$editor=null),v&&v._signal("changeEditor",{editor:this}),v&&(v.$editor=this),v&&!v.destroyed&&v.bgTokenizer.scheduleStart()}},w.prototype.getSession=function(){return this.session},w.prototype.setValue=function(v,C){return this.session.doc.setValue(v),C?C==1?this.navigateFileEnd():C==-1&&this.navigateFileStart():this.selectAll(),v},w.prototype.getValue=function(){return this.session.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.resize=function(v){this.renderer.onResize(v)},w.prototype.setTheme=function(v,C){this.renderer.setTheme(v,C)},w.prototype.getTheme=function(){return this.renderer.getTheme()},w.prototype.setStyle=function(v){this.renderer.setStyle(v)},w.prototype.unsetStyle=function(v){this.renderer.unsetStyle(v)},w.prototype.getFontSize=function(){return this.getOption("fontSize")||m.computedStyle(this.container).fontSize},w.prototype.setFontSize=function(v){this.setOption("fontSize",v)},w.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var v=this;this.$highlightPending=!0,setTimeout(function(){v.$highlightPending=!1;var C=v.session;if(!(!C||C.destroyed)){C.$bracketHighlight&&(C.$bracketHighlight.markerIds.forEach(function(F){C.removeMarker(F)}),C.$bracketHighlight=null);var x=v.getCursorPosition(),T=v.getKeyboardHandler(),k=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(v),O=C.getMatchingBracketRanges(x,k);if(!O){var I=new A(C,x.row,x.column),N=I.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(x);P&&(O=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.closeTagName])}}if(!O&&C.$mode.getMatching&&(O=C.$mode.getMatching(v.session)),!O){v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide();return}var B="ace_bracket";Array.isArray(O)?O.length==1&&(B="ace_error_bracket"):O=[O],O.length==2&&(f.comparePoints(O[0].end,O[1].start)==0?O=[f.fromPoints(O[0].start,O[1].end)]:f.comparePoints(O[0].start,O[1].end)==0&&(O=[f.fromPoints(O[1].start,O[0].end)])),C.$bracketHighlight={ranges:O,markerIds:O.map(function(F){return C.addMarker(F,B,"text")})},v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide()}},50)}},w.prototype.focus=function(){this.textInput.focus()},w.prototype.isFocused=function(){return this.textInput.isFocused()},w.prototype.blur=function(){this.textInput.blur()},w.prototype.onFocus=function(v){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",v))},w.prototype.onBlur=function(v){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",v))},w.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},w.prototype.onDocumentChange=function(v){var C=this.session.$useWrapMode,x=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,x,C),this._signal("change",v),this.$cursorChange()},w.prototype.onTokenizerUpdate=function(v){var C=v.data;this.renderer.updateLines(C.first,C.last)},w.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},w.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},w.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},w.prototype.$updateHighlightActiveLine=function(){var v=this.getSession(),C;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(C=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(C=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(C=!1)),v.$highlightLineMarker&&!C)v.removeMarker(v.$highlightLineMarker.id),v.$highlightLineMarker=null;else if(!v.$highlightLineMarker&&C){var x=new f(C.row,C.column,C.row,1/0);x.id=v.addMarker(x,"ace_active-line","screenLine"),v.$highlightLineMarker=x}else C&&(v.$highlightLineMarker.start.row=C.row,v.$highlightLineMarker.end.row=C.row,v.$highlightLineMarker.start.column=C.column,v._signal("changeBackMarker"))},w.prototype.onSelectionChange=function(v){var C=this.session;if(C.$selectionMarker&&C.removeMarker(C.$selectionMarker),C.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var x=this.selection.getRange(),T=this.getSelectionStyle();C.$selectionMarker=C.addMarker(x,"ace_selection",T)}var k=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(k),this._signal("changeSelection")},w.prototype.$getSelectionHighLightRegexp=function(){var v=this.session,C=this.getSelectionRange();if(!(C.isEmpty()||C.isMultiLine())){var x=C.start.column,T=C.end.column,k=v.getLine(C.start.row),O=k.substring(x,T);if(!(O.length>5e3||!/[\w\d]/.test(O))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),N=k.substring(x-1,T+1);if(I.test(N))return I}}},w.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},w.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},w.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},w.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},w.prototype.onChangeMode=function(v){this.renderer.updateText(),this._emit("changeMode",v)},w.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},w.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},w.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},w.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},w.prototype.getCopyText=function(){var v=this.getSelectedText(),C=this.session.doc.getNewLineCharacter(),x=!1;if(!v&&this.$copyWithEmptySelection){x=!0;for(var T=this.selection.getAllRanges(),k=0;k<T.length;k++){var O=T[k];k&&T[k-1].start.row==O.start.row||(v+=this.session.getLine(O.start.row)+C)}}var I={text:v};return this._signal("copy",I),R.lineMode=x?I.text:!1,I.text},w.prototype.onCopy=function(){this.commands.exec("copy",this)},w.prototype.onCut=function(){this.commands.exec("cut",this)},w.prototype.onPaste=function(v,C){var x={text:v,event:C};this.commands.exec("paste",this,x)},w.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,x=C===R.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)x?T.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(x)this.selection.rangeList.ranges.forEach(function(B){T.insert({row:B.start.row,column:0},C)});else{var k=C.split(/\r\n|\r|\n/),O=this.selection.rangeList.ranges,I=k.length==2&&(!k[0]||!k[1]);if(k.length!=O.length||I)return this.commands.exec("insertstring",this,C);for(var N=O.length;N--;){var P=O[N];P.isEmpty()||T.remove(P),T.insert(P.start,k[N])}}},w.prototype.execCommand=function(v,C){return this.commands.exec(v,this,C)},w.prototype.insert=function(v,C){var x=this.session,T=x.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var O=T.transformAction(x.getState(k.row),"insertion",this,x,v);O&&(v!==O.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),v=O.text)}if(v==" "&&(v=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&v.indexOf(`
1366
- `)==-1){var I=f.fromPoints(k,k);I.end.column+=v.length,this.session.remove(I)}}else{var I=this.getSelectionRange();k=this.session.remove(I),this.clearSelection()}if(v==`
1365
+ `),o.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:c("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:c(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var f=1;f<9;f++)n.commands.push({name:"foldToLevel"+f,description:"Fold To Level "+f,level:f,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,n,d){var h=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function f(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new g(this.editor)}return f.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))},f.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))},f.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===h.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=h.enter)return;r.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var a=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),s=this.$findNearestFoldWidget(a),i=this.$findNearestAnnotation(a);if(!(s===null&&i===null)){if(s===null&&i!==null){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(s!==null&&i===null){this.activeRowIndex=s,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-a)<Math.abs(s-a)){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=s,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout((function(){this.editor._signal("gutterkeydown",new c(r,this))}).bind(this),10)},f.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===h.tab){r.preventDefault();return}if(r.keyCode===h.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===h.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===h.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===h.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===h.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===h.enter||r.keyCode===h.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var o=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var a=this.lines.cells[this.activeRowIndex].element.childNodes[2],s=a.getBoundingClientRect(),i=this.annotationTooltip.getElement().style;i.left=s.right+"px",i.top=s.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},f.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},f.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getFoldWidget(r).style.display!=="none";return o&&a},f.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getAnnotation(r).style.display!=="none";return o&&a},f.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[1]},f.prototype.$getAnnotation=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[2]},f.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isFoldWidgetVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+o))return r+o}return null},f.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isAnnotationVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+o))return r+o}return null},f.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var a=this.$findNearestFoldWidget(this.activeRowIndex);if(a==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=a,this.$focusFoldWidget(this.activeRowIndex);break}},f.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},f.prototype.$rowToRowIndex=function(r){for(var o=0;o<this.lines.getLength();o++){var a=this.lines.get(o);if(a.row==r)return o}return null},f})();n.GutterKeyboardHandler=m;var c=(function(){function f(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return f.prototype.getKey=function(){return h.keyCodeToString(this.domEvent.keyCode)},f.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},f.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},f.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},f})();n.GutterKeyboardEvent=c}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(t,n,d){var h=this&&this.__values||function(w){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&w[v],E=0;if(C)return C.call(w);if(w&&typeof w.length=="number")return{next:function(){return w&&E>=w.length&&(w=void 0),{value:w&&w[E++],done:!w}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/lang"),f=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,o=t("./mouse/mouse_handler").MouseHandler,a=t("./mouse/fold_handler").FoldHandler,s=t("./keyboard/keybinding").KeyBinding,i=t("./edit_session").EditSession,u=t("./search").Search,p=t("./range").Range,y=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,M=t("./commands/default_commands").commands,x=t("./config"),A=t("./token_iterator").TokenIterator,S=t("./keyboard/gutter_handler").GutterKeyboardHandler,$=t("./config").nls,R=t("./clipboard"),L=t("./lib/keys"),T=(function(){function w(v,C,E){this.session,this.$toDestroy=[];var _=v.getContainerElement();this.container=_,this.renderer=v,this.id="editor"+ ++w.$uid,this.commands=new b(f.isMac?"mac":"win",M),typeof document=="object"&&(this.textInput=new r(v.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new a(this)),this.keyBinding=new s(this),this.$search=new u().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=c.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(k,O){O._$emitInputEvent.schedule(31)}),this.setSession(C||E&&E.session||new i("")),x.resetOptions(this),E&&this.setOptions(E),x._signal("editor",this)}return w.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},w.prototype.startOperation=function(v){this.session.startOperation(v)},w.prototype.endOperation=function(v){this.session.endOperation(v)},w.prototype.onStartOperation=function(v){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,v||(this.previousCommand=null)},w.prototype.onEndOperation=function(v){if(this.curOp&&this.session){if(v&&v.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var C=this.curOp.command,E=C&&C.scrollIntoView;if(E){switch(E){case"center-animate":E="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var _=this.selection.getRange(),k=this.renderer.layerConfig;(_.start.row>=k.lastRow||_.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}E=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},w.prototype.$historyTracker=function(v){if(this.$mergeUndoDeltas){var C=this.prevOp,E=this.$mergeableCommands,_=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),_=_&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else _=_&&E.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(_=!1),_?this.session.mergeUndoDeltas=!0:E.indexOf(v.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},w.prototype.setKeyboardHandler=function(v,C){if(v&&typeof v=="string"&&v!="ace"){this.$keybindingId=v;var E=this;x.loadModule(["keybinding",v],function(_){E.$keybindingId==v&&E.keyBinding.setKeyboardHandler(_&&_.handler),C&&C()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(v),C&&C()},w.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},w.prototype.setSession=function(v){if(this.session!=v){this.curOp&&this.endOperation(),this.curOp={};var C=this.session;if(C){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var E=this.session.getSelection();E.off("changeCursor",this.$onCursorChange),E.off("changeSelection",this.$onSelectionChange)}this.session=v,v?(this.$onDocumentChange=this.onDocumentChange.bind(this),v.on("change",this.$onDocumentChange),this.renderer.setSession(v),this.$onChangeMode=this.onChangeMode.bind(this),v.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),v.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),v.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),v.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),v.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),v.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=v.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(v)),this._signal("changeSession",{session:v,oldSession:C}),this.curOp=null,C&&C._signal("changeEditor",{oldEditor:this}),C&&(C.$editor=null),v&&v._signal("changeEditor",{editor:this}),v&&(v.$editor=this),v&&!v.destroyed&&v.bgTokenizer.scheduleStart()}},w.prototype.getSession=function(){return this.session},w.prototype.setValue=function(v,C){return this.session.doc.setValue(v),C?C==1?this.navigateFileEnd():C==-1&&this.navigateFileStart():this.selectAll(),v},w.prototype.getValue=function(){return this.session.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.resize=function(v){this.renderer.onResize(v)},w.prototype.setTheme=function(v,C){this.renderer.setTheme(v,C)},w.prototype.getTheme=function(){return this.renderer.getTheme()},w.prototype.setStyle=function(v){this.renderer.setStyle(v)},w.prototype.unsetStyle=function(v){this.renderer.unsetStyle(v)},w.prototype.getFontSize=function(){return this.getOption("fontSize")||m.computedStyle(this.container).fontSize},w.prototype.setFontSize=function(v){this.setOption("fontSize",v)},w.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var v=this;this.$highlightPending=!0,setTimeout(function(){v.$highlightPending=!1;var C=v.session;if(!(!C||C.destroyed)){C.$bracketHighlight&&(C.$bracketHighlight.markerIds.forEach(function(F){C.removeMarker(F)}),C.$bracketHighlight=null);var E=v.getCursorPosition(),_=v.getKeyboardHandler(),k=_&&_.$getDirectionForHighlight&&_.$getDirectionForHighlight(v),O=C.getMatchingBracketRanges(E,k);if(!O){var I=new A(C,E.row,E.column),N=I.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(E);P&&(O=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.closeTagName])}}if(!O&&C.$mode.getMatching&&(O=C.$mode.getMatching(v.session)),!O){v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide();return}var B="ace_bracket";Array.isArray(O)?O.length==1&&(B="ace_error_bracket"):O=[O],O.length==2&&(p.comparePoints(O[0].end,O[1].start)==0?O=[p.fromPoints(O[0].start,O[1].end)]:p.comparePoints(O[0].start,O[1].end)==0&&(O=[p.fromPoints(O[1].start,O[0].end)])),C.$bracketHighlight={ranges:O,markerIds:O.map(function(F){return C.addMarker(F,B,"text")})},v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide()}},50)}},w.prototype.focus=function(){this.textInput.focus()},w.prototype.isFocused=function(){return this.textInput.isFocused()},w.prototype.blur=function(){this.textInput.blur()},w.prototype.onFocus=function(v){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",v))},w.prototype.onBlur=function(v){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",v))},w.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},w.prototype.onDocumentChange=function(v){var C=this.session.$useWrapMode,E=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,E,C),this._signal("change",v),this.$cursorChange()},w.prototype.onTokenizerUpdate=function(v){var C=v.data;this.renderer.updateLines(C.first,C.last)},w.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},w.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},w.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},w.prototype.$updateHighlightActiveLine=function(){var v=this.getSession(),C;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(C=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(C=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(C=!1)),v.$highlightLineMarker&&!C)v.removeMarker(v.$highlightLineMarker.id),v.$highlightLineMarker=null;else if(!v.$highlightLineMarker&&C){var E=new p(C.row,C.column,C.row,1/0);E.id=v.addMarker(E,"ace_active-line","screenLine"),v.$highlightLineMarker=E}else C&&(v.$highlightLineMarker.start.row=C.row,v.$highlightLineMarker.end.row=C.row,v.$highlightLineMarker.start.column=C.column,v._signal("changeBackMarker"))},w.prototype.onSelectionChange=function(v){var C=this.session;if(C.$selectionMarker&&C.removeMarker(C.$selectionMarker),C.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var E=this.selection.getRange(),_=this.getSelectionStyle();C.$selectionMarker=C.addMarker(E,"ace_selection",_)}var k=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(k),this._signal("changeSelection")},w.prototype.$getSelectionHighLightRegexp=function(){var v=this.session,C=this.getSelectionRange();if(!(C.isEmpty()||C.isMultiLine())){var E=C.start.column,_=C.end.column,k=v.getLine(C.start.row),O=k.substring(E,_);if(!(O.length>5e3||!/[\w\d]/.test(O))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),N=k.substring(E-1,_+1);if(I.test(N))return I}}},w.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},w.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},w.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},w.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},w.prototype.onChangeMode=function(v){this.renderer.updateText(),this._emit("changeMode",v)},w.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},w.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},w.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},w.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},w.prototype.getCopyText=function(){var v=this.getSelectedText(),C=this.session.doc.getNewLineCharacter(),E=!1;if(!v&&this.$copyWithEmptySelection){E=!0;for(var _=this.selection.getAllRanges(),k=0;k<_.length;k++){var O=_[k];k&&_[k-1].start.row==O.start.row||(v+=this.session.getLine(O.start.row)+C)}}var I={text:v};return this._signal("copy",I),R.lineMode=E?I.text:!1,I.text},w.prototype.onCopy=function(){this.commands.exec("copy",this)},w.prototype.onCut=function(){this.commands.exec("cut",this)},w.prototype.onPaste=function(v,C){var E={text:v,event:C};this.commands.exec("paste",this,E)},w.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,E=C===R.lineMode,_=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)E?_.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(E)this.selection.rangeList.ranges.forEach(function(B){_.insert({row:B.start.row,column:0},C)});else{var k=C.split(/\r\n|\r|\n/),O=this.selection.rangeList.ranges,I=k.length==2&&(!k[0]||!k[1]);if(k.length!=O.length||I)return this.commands.exec("insertstring",this,C);for(var N=O.length;N--;){var P=O[N];P.isEmpty()||_.remove(P),_.insert(P.start,k[N])}}},w.prototype.execCommand=function(v,C){return this.commands.exec(v,this,C)},w.prototype.insert=function(v,C){var E=this.session,_=E.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var O=_.transformAction(E.getState(k.row),"insertion",this,E,v);O&&(v!==O.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),v=O.text)}if(v==" "&&(v=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&v.indexOf(`
1366
+ `)==-1){var I=p.fromPoints(k,k);I.end.column+=v.length,this.session.remove(I)}}else{var I=this.getSelectionRange();k=this.session.remove(I),this.clearSelection()}if(v==`
1367
1367
  `||v==`\r
1368
- `){var F=x.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);x.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,B=x.getState(k.row),F=x.getLine(k.row),H=T.checkOutdent(B,F,v);if(x.insert(k,v),O&&O.selection&&(O.selection.length==2?this.selection.setSelectionRange(new f(k.row,P+O.selection[0],k.row,P+O.selection[1])):this.selection.setSelectionRange(new f(k.row+O.selection[0],O.selection[1],k.row+O.selection[2],O.selection[3]))),this.$enableAutoIndent){if(x.getDocument().isNewLine(v)){var z=T.getNextLineIndent(B,F.slice(0,k.column),x.getTabString());x.insert({row:k.row+1,column:0},z)}H&&T.autoOutdent(B,x,k.row)}},w.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),x=this.selection.isEmpty()?[new f(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",k="",O="",I=v.getTabString(),N=0;N<x.length;N++)for(var P=x[N].start.row,B=x[N].end.row,F=P;F<=B;F++){F>0&&(T=v.getState(F-1),k=v.getLine(F-1),O=C.getNextLineIndent(T,k,I));var H=v.getLine(F),z=C.$getIndent(H);if(O!==z){if(z.length>0){var W=new f(F,0,F,z.length);v.remove(W)}O.length>0&&v.insert({row:F,column:0},O)}C.autoOutdent(T,v,F)}},w.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var x=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(x):x(),this.endOperation()},w.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var x=this.selection.getRange();x.start.column-=C.extendLeft,x.end.column+=C.extendRight,x.start.column<0&&(x.start.row--,x.start.column+=this.session.getLine(x.start.row).length+1),this.selection.setRange(x),!v&&!x.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var x=this.selection.getRange();x.start.column-=C.restoreStart,x.end.column-=C.restoreEnd,this.selection.setRange(x)}},w.prototype.onCommandKey=function(v,C,x){return this.keyBinding.onCommandKey(v,C,x)},w.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},w.prototype.getOverwrite=function(){return this.session.getOverwrite()},w.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},w.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},w.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},w.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},w.prototype.getDragDelay=function(){return this.getOption("dragDelay")},w.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},w.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},w.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},w.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},w.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},w.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},w.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},w.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},w.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},w.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},w.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},w.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},w.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},w.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},w.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},w.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},w.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},w.prototype.getReadOnly=function(){return this.getOption("readOnly")},w.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},w.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},w.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},w.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},w.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},w.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var x=this.session,T=x.getState(C.start.row),k=x.getMode().transformAction(T,"deletion",this,x,C);if(C.end.column===0){var O=x.getTextRange(C);if(O[O.length-1]==`
1369
- `){var I=x.getLine(C.end.row);/^\s+$/.test(I)&&(C.end.column=I.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},w.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var v=this.getSelectionRange();v.start.column==v.end.column&&v.start.row==v.end.row&&(v.end.column=0,v.end.row++),this.session.remove(v),this.clearSelection()},w.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
1370
- `),this.moveCursorToPosition(v)},w.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},w.prototype.removeGhostText=function(){this.renderer.removeGhostText()},w.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var x=this.session.getLine(v.row),T,k;C<x.length?(T=x.charAt(C)+x.charAt(C-1),k=new f(v.row,C-1,v.row,C+1)):(T=x.charAt(C-1)+x.charAt(C-2),k=new f(v.row,C-2,v.row,C)),this.session.replace(k,T),this.session.selection.moveToPosition(k.end)}}},w.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),x=this.session.getTextRange(C);this.session.replace(C,x.toLowerCase()),this.selection.setSelectionRange(v)},w.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),x=this.session.getTextRange(C);this.session.replace(C,x.toUpperCase()),this.selection.setSelectionRange(v)},w.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var x=this.$getSelectedRows();v.indentRows(x.first,x.last," ");return}else if(C.start.column<C.end.column){var T=v.getTextRange(C);if(!/^\s+$/.test(T)){var x=this.$getSelectedRows();v.indentRows(x.first,x.last," ");return}}var k=v.getLine(C.start.row),O=C.start,I=v.getTabSize(),N=v.documentToScreenColumn(O.row,O.column);if(this.session.getUseSoftTabs())var P=I-N%I,B=c.stringRepeat(" ",P);else{for(var P=N%I;k[C.start.column-1]==" "&&P;)C.start.column--,P--;this.selection.setSelectionRange(C),B=" "}return this.insert(B)},w.prototype.blockIndent=function(){var v=this.$getSelectedRows();this.session.indentRows(v.first,v.last," ")},w.prototype.blockOutdent=function(){var v=this.session.getSelection();this.session.outdentRows(v.getRange())},w.prototype.sortLines=function(){for(var v=this.$getSelectedRows(),C=this.session,x=[],T=v.first;T<=v.last;T++)x.push(C.getLine(T));x.sort(function(I,N){return I.toLowerCase()<N.toLowerCase()?-1:I.toLowerCase()>N.toLowerCase()?1:0});for(var k=new f(0,0,0,0),T=v.first;T<=v.last;T++){var O=C.getLine(T);k.start.row=T,k.end.row=T,k.end.column=O.length,C.replace(k,x[T-v.first])}},w.prototype.toggleCommentLines=function(){var v=this.session.getState(this.getCursorPosition().row),C=this.$getSelectedRows();this.session.getMode().toggleCommentLines(v,this.session,C.first,C.last)},w.prototype.toggleBlockComment=function(){var v=this.getCursorPosition(),C=this.session.getState(v.row),x=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,x,v)},w.prototype.getNumberAt=function(v,C){var x=/[\-]?[0-9]+(?:\.[0-9]+)?/g;x.lastIndex=0;for(var T=this.session.getLine(v);x.lastIndex<C;){var k=x.exec(T);if(k.index<=C&&k.index+k[0].length>=C){var O={value:k[0],start:k.index,end:k.index+k[0].length};return O}}return null},w.prototype.modifyNumber=function(v){var C=this.selection.getCursor().row,x=this.selection.getCursor().column,T=new f(C,x-1,C,x),k=this.session.getTextRange(T);if(!isNaN(parseFloat(k))&&isFinite(k)){var O=this.getNumberAt(C,x);if(O){var I=O.value.indexOf(".")>=0?O.start+O.value.indexOf(".")+1:O.end,N=O.start+O.value.length-I,P=parseFloat(O.value);P*=Math.pow(10,N),I!==O.end&&x<I?v*=Math.pow(10,O.end-x-1):v*=Math.pow(10,O.end-x),P+=v,P/=Math.pow(10,N);var B=P.toFixed(N),F=new f(C,O.start,C,O.end);this.session.replace(F,B),this.moveCursorTo(C,Math.max(O.start+1,x+B.length-O.value.length))}}else this.toggleWord()},w.prototype.toggleWord=function(){var v=this.selection.getCursor().row,C=this.selection.getCursor().column;this.selection.selectWord();var x=this.getSelectedText(),T=this.selection.getWordRange().start.column,k=x.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),O=C-T-1;O<0&&(O=0);var I=0,N=0,P=this;x.match(/[A-Za-z0-9_]+/)&&k.forEach(function(G,Q){N=I+G.length,O>=I&&O<=N&&(x=G,P.selection.clearSelection(),P.moveCursorTo(v,I+T),P.selection.selectTo(v,N+T)),I=N});for(var B=this.$toggleWordPairs,F,H=0;H<B.length;H++)for(var z=B[H],W=0;W<=1;W++){var U=+!W,K=x.match(new RegExp("^\\s?_?("+c.escapeRegExp(z[W])+")\\s?$","i"));if(K){var Y=x.match(new RegExp("([_]|^|\\s)("+c.escapeRegExp(K[1])+")($|\\s)","g"));Y&&(F=x.replace(new RegExp(c.escapeRegExp(z[W]),"i"),function(G){var Q=z[U];return G.toUpperCase()==G?Q=Q.toUpperCase():G.charAt(0).toUpperCase()==G.charAt(0)&&(Q=Q.substr(0,0)+z[U].charAt(0).toUpperCase()+Q.substr(1)),Q}),this.insert(F),F="")}}},w.prototype.findLinkAt=function(v,C){var x,T,k=this.session.getLine(v),O=k.split(/((?:https?|ftp):\/\/[\S]+)/),I=C;I<0&&(I=0);var N=0,P=0,B;try{for(var F=h(O),H=F.next();!H.done;H=F.next()){var z=H.value;if(P=N+z.length,I>=N&&I<=P&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){B=z.replace(/[\s:.,'";}\]]+$/,"");break}N=P}}catch(W){x={error:W}}finally{try{H&&!H.done&&(T=F.return)&&T.call(F)}finally{if(x)throw x.error}}return B},w.prototype.openLink=function(){var v=this.selection.getCursor(),C=this.findLinkAt(v.row,v.column);return C&&window.open(C,"_blank"),C!=null},w.prototype.removeLines=function(){var v=this.$getSelectedRows();this.session.removeFullLines(v.first,v.last),this.clearSelection()},w.prototype.duplicateSelection=function(){var v=this.selection,C=this.session,x=v.getRange(),T=v.isBackwards();if(x.isEmpty()){var k=x.start.row;C.duplicateLines(k,k)}else{var O=T?x.start:x.end,I=C.insert(O,C.getTextRange(x));x.start=O,x.end=I,v.setSelectionRange(x,T)}},w.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},w.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},w.prototype.moveText=function(v,C,x){return this.session.moveText(v,C,x)},w.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},w.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},w.prototype.$moveLines=function(v,C){var x,T,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var O=k.toOrientedRange();x=this.$getSelectedRows(O),T=this.session.$moveLines(x.first,x.last,C?0:v),C&&v==-1&&(T=0),O.moveBy(T,0),k.fromOrientedRange(O)}else{var I=k.rangeList.ranges;k.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var N=0,P=0,B=I.length,F=0;F<B;F++){var H=F;I[F].moveBy(N,0),x=this.$getSelectedRows(I[F]);for(var z=x.first,W=x.last;++F<B;){P&&I[F].moveBy(P,0);var U=this.$getSelectedRows(I[F]);if(C&&U.first!=W)break;if(!C&&U.first>W+1)break;W=U.last}for(F--,N=this.session.$moveLines(z,W,C?0:v),C&&v==-1&&(H=F+1);H<=F;)I[H].moveBy(N,0),H++;C||(N=0),P+=N}k.fromOrientedRange(k.ranges[0]),k.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},w.prototype.$getSelectedRows=function(v){return v=(v||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(v.start.row),last:this.session.getRowFoldEnd(v.end.row)}},w.prototype.onCompositionStart=function(v){this.renderer.showComposition(v)},w.prototype.onCompositionUpdate=function(v){this.renderer.setCompositionText(v)},w.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},w.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},w.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},w.prototype.isRowVisible=function(v){return v>=this.getFirstVisibleRow()&&v<=this.getLastVisibleRow()},w.prototype.isRowFullyVisible=function(v){return v>=this.renderer.getFirstFullyVisibleRow()&&v<=this.renderer.getLastFullyVisibleRow()},w.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},w.prototype.$moveByPage=function(v,C){var x=this.renderer,T=this.renderer.layerConfig,k=v*Math.floor(T.height/T.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var O=x.scrollTop;x.scrollBy(0,k*T.lineHeight),C!=null&&x.scrollCursorIntoView(null,.5),x.animateScrolling(O)},w.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},w.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},w.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},w.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},w.prototype.scrollPageDown=function(){this.$moveByPage(1)},w.prototype.scrollPageUp=function(){this.$moveByPage(-1)},w.prototype.scrollToRow=function(v){this.renderer.scrollToRow(v)},w.prototype.scrollToLine=function(v,C,x,T){this.renderer.scrollToLine(v,C,x,T)},w.prototype.centerSelection=function(){var v=this.getSelectionRange(),C={row:Math.floor(v.start.row+(v.end.row-v.start.row)/2),column:Math.floor(v.start.column+(v.end.column-v.start.column)/2)};this.renderer.alignCursor(C,.5)},w.prototype.getCursorPosition=function(){return this.selection.getCursor()},w.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},w.prototype.getSelectionRange=function(){return this.selection.getRange()},w.prototype.selectAll=function(){this.selection.selectAll()},w.prototype.clearSelection=function(){this.selection.clearSelection()},w.prototype.moveCursorTo=function(v,C){this.selection.moveCursorTo(v,C)},w.prototype.moveCursorToPosition=function(v){this.selection.moveCursorToPosition(v)},w.prototype.jumpToMatching=function(v,C){var x=this.getCursorPosition(),T=new A(this.session,x.row,x.column),k=T.getCurrentToken(),O=0;k&&k.type.indexOf("tag-name")!==-1&&(k=T.stepBackward());var I=k||T.stepForward();if(I){var N,P=!1,B={},F=x.column-I.start,H,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(I.value.match(/[{}()\[\]]/g)){for(;F<I.value.length&&!P;F++)if(z[I.value[F]])switch(H=z[I.value[F]]+"."+I.type.replace("rparen","lparen"),isNaN(B[H])&&(B[H]=0),I.value[F]){case"(":case"[":case"{":B[H]++;break;case")":case"]":case"}":B[H]--,B[H]===-1&&(N="bracket",P=!0);break}}else I.type.indexOf("tag-name")!==-1&&(isNaN(B[I.value])&&(B[I.value]=0),k.value==="<"&&O>1?B[I.value]++:k.value==="</"&&B[I.value]--,B[I.value]===-1&&(N="tag",P=!0));P||(k=I,O++,I=T.stepForward(),F=0)}while(I&&!P);if(N){var W,U;if(N==="bracket")W=this.session.getBracketRange(x),W||(W=new f(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),U=W.start,(C||U.row===x.row&&Math.abs(U.column-x.column)<2)&&(W=this.session.getBracketRange(U)));else if(N==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(W=new f(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),W.compare(x.row,x.column)===0){var K=this.session.getMatchingTags(x);K&&(K.openTag.contains(x.row,x.column)?(W=K.closeTag,U=W.start):(W=K.openTag,K.closeTag.start.row===x.row&&K.closeTag.start.column===x.column?U=W.end:U=W.start))}U=U||W.start}U=W&&W.cursor||U,U&&(v?W&&C?this.selection.setRange(W):W&&W.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(U.row,U.column):this.selection.moveTo(U.row,U.column))}}},w.prototype.gotoLine=function(v,C,x){this.selection.clearSelection(),this.session.unfold({row:v-1,column:C||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(v-1,C||0),this.isRowFullyVisible(v-1)||this.scrollToLine(v-1,!0,x)},w.prototype.navigateTo=function(v,C){this.selection.moveTo(v,C)},w.prototype.navigateUp=function(v){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(-v||-1,0)},w.prototype.navigateDown=function(v){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(v||1,0)},w.prototype.navigateLeft=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorLeft();else{var C=this.getSelectionRange().start;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateRight=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorRight();else{var C=this.getSelectionRange().end;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},w.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},w.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},w.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},w.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},w.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},w.prototype.replace=function(v,C){C&&this.$search.set(C);var x=this.$search.find(this.session),T=0;return x&&(this.$tryReplace(x,v)&&(T=1),this.selection.setSelectionRange(x),this.renderer.scrollSelectionIntoView(x.start,x.end)),T},w.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var x=this.$search.findAll(this.session),T=0;if(!x.length)return T;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var O=x.length-1;O>=0;--O)this.$tryReplace(x[O],v)&&T++;return this.selection.setSelectionRange(k),T},w.prototype.$tryReplace=function(v,C){var x=this.session.getTextRange(v);return C=this.$search.replace(x,C),C!==null?(v.end=this.session.replace(v,C),v):null},w.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},w.prototype.find=function(v,C,x){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var T=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(T)||this.$search.$options.needle,v||(T=this.session.getWordRange(T.start.row,T.start.column),v=this.session.getTextRange(T)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:T});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,x),k;C.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},w.prototype.findNext=function(v,C){this.find({skipCurrent:!0,backwards:!1},v,C)},w.prototype.findPrevious=function(v,C){this.find(v,{skipCurrent:!0,backwards:!0},C)},w.prototype.revealRange=function(v,C){this.session.unfold(v),this.selection.setSelectionRange(v);var x=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(x)},w.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(v){v.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()},w.prototype.setAutoScrollEditorIntoView=function(v){if(v){var C,x=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var k=this.$scrollAnchor;k.style.cssText="position:absolute",this.container.insertBefore(k,this.container.firstChild);var O=this.on("changeSelection",function(){T=!0}),I=this.renderer.on("beforeRender",function(){T&&(C=x.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(T&&C&&(x.isFocused()||x.searchBox&&x.searchBox.isFocused())){var P=x.renderer,B=P.$cursorLayer.$pixelPos,F=P.layerConfig,H=B.top-F.offset;B.top>=0&&H+C.top<0?T=!0:B.top<F.height&&B.top+C.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(k.style.top=H+"px",k.style.left=B.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(T)),T=C=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",O),this.renderer.off("afterRender",N),this.renderer.off("beforeRender",I))}}},w.prototype.$resetCursorStyle=function(){var v=this.$cursorStyle||"ace",C=this.renderer.$cursorLayer;C&&(C.setSmoothBlinking(/smooth/.test(v)),C.isBlinking=!this.$readOnly&&v!="wide",m.setCssClass(C.element,"ace_slim-cursors",/slim/.test(v)))},w.prototype.prompt=function(v,C,x){var T=this;$.loadModule("ace/ext/prompt",function(k){k.prompt(T,v,C,x)})},w})();_.$uid=0,_.prototype.curOp=null,_.prototype.prevOp={},_.prototype.$mergeableCommands=["backspace","del","insertstring"],_.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"],["&&","||"],["==","!="]],g.implement(_.prototype,y),$.defineOptions(_.prototype,"editor",{selectionStyle:{set:function(w){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:w})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(w){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(w){this.textInput.setReadOnly(w),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(w){this.textInput.setCopyWithEmptySelection(w)},initialValue:!1},cursorStyle:{set:function(w){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(w){this.setAutoScrollEditorIntoView(w)}},keyboardHandler:{set:function(w){this.setKeyboardHandler(w)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(w){this.session.setValue(w)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(w){this.setSession(w)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(w){this.renderer.$gutterLayer.setShowLineNumbers(w),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),w&&this.$relativeLineNumbers?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(w){this.$showLineNumbers&&w?D.attach(this):D.detach(this)}},placeholder:{set:function(w){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var v=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(v&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),m.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!v&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),m.addCssClass(this.container,"ace_hasPlaceholder");var C=m.createElement("div");C.className="ace_placeholder",C.textContent=this.$placeholder||"",this.renderer.placeholderNode=C,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!v&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(w){var v={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},C=function(T){if(T.target==this.renderer.scroller&&T.keyCode===L.enter){T.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},x;w?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(d.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",E("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",E("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",C.bind(this)),this.commands.addCommand(v),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",E("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",E("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),x||(x=new S(this)),x.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",C.bind(this)),this.commands.removeCommand(v),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),x&&x.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(w){this.$textInputAriaLabel=w},initialValue:""},enableMobileMenu:{set:function(w){this.$enableMobileMenu=w},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var D={getText:function(w,v){return(Math.abs(w.selection.lead.row-v)||v+1+(v<9?"·":""))+""},getWidth:function(w,v,C){return Math.max(v.toString().length,(C.lastRow+1).toString().length,2)*C.characterWidth},update:function(w,v){v.renderer.$loop.schedule(v.renderer.CHANGE_GUTTER)},attach:function(w){w.renderer.$gutterLayer.$renderer=this,w.on("changeSelection",this.update),this.update(null,w)},detach:function(w){w.renderer.$gutterLayer.$renderer==this&&(w.renderer.$gutterLayer.$renderer=null),w.off("changeSelection",this.update),this.update(null,w)}};n.Editor=_}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c,d){this.element=c,this.canvasHeight=d||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return m.prototype.moveContainer=function(c){h.translate(this.element,0,-(c.firstRowScreen*c.lineHeight%this.canvasHeight)-c.offset*this.$offsetCoefficient)},m.prototype.pageChanged=function(c,d){return Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)!==Math.floor(d.firstRowScreen*d.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(c,d,r){var o=d.firstRowScreen*d.lineHeight,a=Math.floor(o/this.canvasHeight),s=r.documentToScreenRow(c,0)*d.lineHeight;return s-a*this.canvasHeight},m.prototype.computeLineHeight=function(c,d,r){return d.lineHeight*r.getRowLineCount(c)},m.prototype.getLength=function(){return this.cells.length},m.prototype.get=function(c){return this.cells[c]},m.prototype.shift=function(){this.$cacheCell(this.cells.shift())},m.prototype.pop=function(){this.$cacheCell(this.cells.pop())},m.prototype.push=function(c){if(Array.isArray(c)){this.cells.push.apply(this.cells,c);for(var d=h.createFragment(this.element),r=0;r<c.length;r++)d.appendChild(c[r].element);this.element.appendChild(d)}else this.cells.push(c),this.element.appendChild(c.element)},m.prototype.unshift=function(c){if(Array.isArray(c)){this.cells.unshift.apply(this.cells,c);for(var d=h.createFragment(this.element),r=0;r<c.length;r++)d.appendChild(c[r].element);this.element.firstChild?this.element.insertBefore(d,this.element.firstChild):this.element.appendChild(d)}else this.cells.unshift(c),this.element.insertAdjacentElement("afterbegin",c.element)},m.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},m.prototype.$cacheCell=function(c){c&&(c.element.remove(),this.cellCache.push(c))},m.prototype.createCell=function(c,d,r,o){var a=this.cellCache.pop();if(!a){var s=h.createElement("div");o&&o(s),this.element.appendChild(s),a={element:s,text:"",row:c}}return a.row=c,a},m})();n.Lines=g}),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(t,n,p){var h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),c=t("../lib/event_emitter").EventEmitter,d=t("./lines").Lines,r=t("../config").nls,o=(function(){function s(i){this.element=h.createElement("div"),this.element.className="ace_layer ace_gutter-layer",i.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new d(this.element),this.$lines.$offsetCoefficient=1}return s.prototype.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},s.prototype.addGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(i,u)},s.prototype.removeGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(i,u)},s.prototype.setAnnotations=function(i){this.$annotations=[];for(var u=0;u<i.length;u++){var f=i[u],y=f.row,b=this.$annotations[y];b||(b=this.$annotations[y]={text:[],type:[],displayText:[]});var M=f.text,$=f.text,A=f.type;M=M?m.escapeHTML(M):f.html||"",$=$||f.html||"",b.text.indexOf(M)===-1&&(b.text.push(M),b.type.push(A),b.displayText.push($));var S=f.className;S?b.className=S:A==="error"?b.className=" ace_error":A==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":A==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":A==="info"&&!b.className?b.className=" ace_info":A==="hint"&&!b.className&&(b.className=" ace_hint")}},s.prototype.$updateAnnotations=function(i){if(this.$annotations.length){var u=i.start.row,f=i.end.row-u;if(f!==0)if(i.action=="remove")this.$annotations.splice(u,f+1,null);else{var y=new Array(f+1);y.unshift(u,1),this.$annotations.splice.apply(this.$annotations,y)}}},s.prototype.update=function(i){this.config=i;var u=this.session,f=i.firstRow,y=Math.min(i.lastRow+i.gutterOffset,u.getLength()-1);this.oldLastRow=y,this.config=i,this.$lines.moveContainer(i),this.$updateCursorRow();for(var b=u.getNextFoldLine(f),M=b?b.start.row:1/0,$=null,A=-1,S=f;;){if(S>M&&(S=b.end.row+1,b=u.getNextFoldLine(S,b),M=b?b.start.row:1/0),S>y){for(;this.$lines.getLength()>A+1;)this.$lines.pop();break}$=this.$lines.get(++A),$?$.row=S:($=this.$lines.createCell(S,i,this.session,a),this.$lines.push($)),this.$renderCell($,i,b,S),S++}this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$updateGutterWidth=function(i){var u=this.session,f=u.gutterRenderer||this.$renderer,y=u.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(b=u.getLength()+y-1);var M=f?f.getWidth(u,b,i):b.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();M+=$.left+$.right,M!==this.gutterWidth&&!isNaN(M)&&(this.gutterWidth=M,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",M))},s.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},s.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var u=this.$lines.cells;this.$cursorCell=null;for(var f=0;f<u.length;f++){var y=u[f];if(y.row>=this.$cursorRow){if(y.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(f>0&&b&&b.start.row==u[f-1].row)y=u[f-1];else break}y.element.className="ace_gutter-active-line "+y.element.className,this.$cursorCell=y;break}}}}},s.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var f=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),y=this.oldLastRow;if(this.oldLastRow=f,!u||y<i.firstRow)return this.update(i);if(f<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(y>f)for(var b=this.session.getFoldedRowCount(f+1,y);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,u.firstRow-1)),f>y&&this.$lines.push(this.$renderLines(i,y+1,f)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$renderLines=function(i,u,f){for(var y=[],b=u,M=this.session.getNextFoldLine(b),$=M?M.start.row:1/0;b>$&&(b=M.end.row+1,M=this.session.getNextFoldLine(b,M),$=M?M.start.row:1/0),!(b>f);){var A=this.$lines.createCell(b,i,this.session,a);this.$renderCell(A,i,M,b),y.push(A),b++}return y},s.prototype.$renderCell=function(i,u,f,y){var b=i.element,M=this.session,$=b.childNodes[0],A=b.childNodes[1],S=b.childNodes[2],E=S.firstChild,R=M.$firstLineNumber,L=M.$breakpoints,_=M.$decorations,D=M.gutterRenderer||this.$renderer,w=this.$showFoldWidgets&&M.foldWidgets,v=f?f.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",x=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",T=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(D?D.getText(M,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||f&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=f.end.row)&&(x+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),L[y]&&(x+=L[y]),_[y]&&(x+=_[y]),this.$annotations[y]&&y!==v&&(x+=this.$annotations[y].className),w){var O=w[y];O==null&&(O=w[y]=M.getFoldWidget(y))}if(O){var I="ace_fold-widget ace_"+O,N=O=="start"&&y==v&&y<f.end.row;if(N){I+=" ace_closed";for(var P="",B=!1,F=y+1;F<=f.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){B=!0,P=" ace_error_fold";break}this.$annotations[F].className===" ace_security"?(B=!0,P=" ace_security_fold"):this.$annotations[F].className===" ace_warning"&&P!==" ace_security_fold"&&(B=!0,P=" ace_warning_fold")}x+=P}else I+=" ace_open";A.className!=I&&(A.className=I),h.setStyle(A.style,"height",C),h.setStyle(A.style,"display","inline-block"),A.setAttribute("role","button"),A.setAttribute("tabindex","-1");var H=M.getFoldWidgetRange(y);H?A.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[H.start.row+1,H.end.row+1])):f?A.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[f.start.row+1,f.end.row+1])):A.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[y+1])),N?(A.setAttribute("aria-expanded","false"),A.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(A.setAttribute("aria-expanded","true"),A.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else A&&(h.setStyle(A.style,"display","none"),A.setAttribute("tabindex","0"),A.removeAttribute("role"),A.removeAttribute("aria-label"));if(B&&this.$showFoldedAnnotations){S.className="ace_gutter_annotation",E.className=T,E.className+=P,h.setStyle(E.style,"height",C),h.setStyle(S.style,"display","block"),h.setStyle(S.style,"height",C);var z;switch(P){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else if(this.$annotations[y]){S.className="ace_gutter_annotation",E.className=T,this.$useSvgGutterIcons?E.className+=this.$annotations[y].className:b.classList.add(this.$annotations[y].className.replace(" ","")),h.setStyle(E.style,"height",C),h.setStyle(S.style,"display","block"),h.setStyle(S.style,"height",C);var z;switch(this.$annotations[y].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[k]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else h.setStyle(S.style,"display","none"),S.removeAttribute("aria-label"),S.removeAttribute("role"),S.setAttribute("tabindex","0");return k!==$.data&&($.data=k),b.className!=x&&(b.className=x),h.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,M)+"px"),h.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,M)+"px"),i.text=k,S.style.display==="none"&&A.style.display==="none"?i.element.setAttribute("aria-hidden",!0):i.element.setAttribute("aria-hidden",!1),i},s.prototype.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},s.prototype.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},s.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},s.prototype.setShowFoldWidgets=function(i){i?h.addCssClass(this.element,"ace_folding-enabled"):h.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},s.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},s.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=h.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(i.borderLeftWidth)||0)+(parseInt(i.paddingLeft)||0)+1,this.$padding.right=(parseInt(i.borderRightWidth)||0)+(parseInt(i.paddingRight)||0),this.$padding},s.prototype.getRegion=function(i){var u=this.$padding||this.$computePadding(),f=this.element.getBoundingClientRect();if(i.x<u.left+f.left)return"markers";if(this.$showFoldWidgets&&i.x>f.right-u.right)return"foldWidgets"},s})();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,g.implement(o.prototype,c);function a(s){var i=document.createTextNode("");s.appendChild(i);var u=h.createElement("span");s.appendChild(u);var f=h.createElement("span");s.appendChild(f);var y=h.createElement("span");return f.appendChild(y),s}n.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,p){var h=t("../range").Range,g=t("../lib/dom"),m=(function(){function d(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return d.prototype.setPadding=function(r){this.$padding=r},d.prototype.setSession=function(r){this.session=r},d.prototype.setMarkers=function(r){this.markers=r},d.prototype.elt=function(r,o){var a=this.i!=-1&&this.element.childNodes[this.i];a?this.i++:(a=document.createElement("div"),this.element.appendChild(a),this.i=-1),a.style.cssText=o,a.className=r},d.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var a in this.markers){var s=this.markers[a];if(!s.range){s.update(o,this,this.session,r);continue}var i=s.range.clipRows(r.firstRow,r.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),s.renderer){var u=this.$getTop(i.start.row,r),f=this.$padding+i.start.column*r.characterWidth;s.renderer(o,i,f,u,r)}else s.type=="fullLine"?this.drawFullLineMarker(o,i,s.clazz,r):s.type=="screenLine"?this.drawScreenLineMarker(o,i,s.clazz,r):i.isMultiLine()?s.type=="text"?this.drawTextMarker(o,i,s.clazz,r):this.drawMultiLineMarker(o,i,s.clazz,r):this.drawSingleLineMarker(o,i,s.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},d.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},d.prototype.drawTextMarker=function(r,o,a,s,i){for(var u=this.session,f=o.start.row,y=o.end.row,b=f,M=0,$=0,A=u.getScreenLastRowColumn(b),S=new h(b,o.start.column,b,$);b<=y;b++)S.start.row=S.end.row=b,S.start.column=b==f?o.start.column:u.getRowWrapIndent(b),S.end.column=A,M=$,$=A,A=b+1<y?u.getScreenLastRowColumn(b+1):b==y?0:o.end.column,this.drawSingleLineMarker(r,S,a+(b==f?" ace_start":"")+" ace_br"+c(b==f||b==f+1&&o.start.column,M<$,$>A,b==y),s,b==y?0:1,i)},d.prototype.drawMultiLineMarker=function(r,o,a,s,i){var u=this.$padding,f=s.lineHeight,y=this.$getTop(o.start.row,s),b=u+o.start.column*s.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var M=o.clone();M.end.row=M.start.row,M.end.column=this.session.getLine(M.start.row).length,this.drawBidiSingleLineMarker(r,M,a+" ace_br1 ace_start",s,null,i)}else this.elt(a+" ace_br1 ace_start","height:"+f+"px;right:"+u+"px;top:"+y+"px;left:"+b+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var M=o.clone();M.start.row=M.end.row,M.start.column=0,this.drawBidiSingleLineMarker(r,M,a+" ace_br12",s,null,i)}else{y=this.$getTop(o.end.row,s);var $=o.end.column*s.characterWidth;this.elt(a+" ace_br12","height:"+f+"px;width:"+$+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}if(f=(o.end.row-o.start.row-1)*s.lineHeight,!(f<=0)){y=this.$getTop(o.start.row+1,s);var A=(o.start.column?1:0)|(o.end.column?0:8);this.elt(a+(A?" ace_br"+A:""),"height:"+f+"px;right:"+u+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}},d.prototype.drawSingleLineMarker=function(r,o,a,s,i,u){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,a,s,i,u);var f=s.lineHeight,y=(o.end.column+(i||0)-o.start.column)*s.characterWidth,b=this.$getTop(o.start.row,s),M=this.$padding+o.start.column*s.characterWidth;this.elt(a,"height:"+f+"px;width:"+y+"px;top:"+b+"px;left:"+M+"px;"+(u||""))},d.prototype.drawBidiSingleLineMarker=function(r,o,a,s,i,u){var f=s.lineHeight,y=this.$getTop(o.start.row,s),b=this.$padding,M=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);M.forEach(function($){this.elt(a,"height:"+f+"px;width:"+($.width+(i||0))+"px;top:"+y+"px;left:"+(b+$.left)+"px;"+(u||""))},this)},d.prototype.drawFullLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),f=s.lineHeight;o.start.row!=o.end.row&&(f+=this.$getTop(o.end.row,s)-u),this.elt(a,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(i||""))},d.prototype.drawScreenLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),f=s.lineHeight;this.elt(a,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(i||""))},d})();m.prototype.$padding=0;function c(d,r,o,a){return(d?1:0)|(r?2:0)|(o?4:0)|(a?8:0)}n.Marker=m}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,p){var h=new Set(["text","rparen","lparen"]);n.isTextToken=function(g){return h.has(g)}}),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(t,n,p){var h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("./lines").Lines,d=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,o=t("./text_util").isTextToken,a=(function(){function s(i){this.dom=g,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",i.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new c(this.element)}return s.prototype.$updateEolChar=function(){var i=this.session.doc,u=i.getNewLineCharacter()==`
1371
- `&&i.getNewLineMode()!="windows",f=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=f)return this.EOL_CHAR=f,!0},s.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},s.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},s.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},s.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",(function(u){this._signal("changeCharacterSize",u)}).bind(this)),this.$pollSizeChanges()},s.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},s.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},s.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},s.prototype.setShowInvisibles=function(i){return this.showInvisibles==i?!1:(this.showInvisibles=i,typeof i=="string"?(this.showSpaces=/tab/i.test(i),this.showTabs=/space/i.test(i),this.showEOL=/eol/i.test(i)):this.showSpaces=this.showTabs=this.showEOL=i,this.$computeTabString(),!0)},s.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},s.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},s.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var u=this.$tabStrings=[0],f=1;f<i+1;f++)if(this.showTabs){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_tab",y.textContent=m.stringRepeat(this.TAB_CHAR,f),u.push(y)}else u.push(this.dom.createTextNode(m.stringRepeat(" ",f),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",M=this.showSpaces?" ace_invisible ace_invisible_space":"",$=this.showSpaces?m.stringRepeat(this.SPACE_CHAR,this.tabSize):m.stringRepeat(" ",this.tabSize),A=this.showTabs?" ace_invisible ace_invisible_tab":"",S=this.showTabs?m.stringRepeat(this.TAB_CHAR,this.tabSize):$,y=this.dom.createElement("span");y.className=b+M,y.textContent=$,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=b+A,y.textContent=S,this.$tabStrings[" "]=y}},s.prototype.updateLines=function(i,u,f){if(this.config.lastRow!=i.lastRow||this.config.firstRow!=i.firstRow)return this.update(i);this.config=i;for(var y=Math.max(u,i.firstRow),b=Math.min(f,i.lastRow),M=this.element.childNodes,$=0,S=i.firstRow;S<y;S++){var E=this.session.getFoldLine(S);if(E)if(E.containsRow(y)){y=E.start.row;break}else S=E.end.row;$++}for(var A=!1,S=y,E=this.session.getNextFoldLine(S),R=E?E.start.row:1/0;S>R&&(S=E.end.row+1,E=this.session.getNextFoldLine(S,E),R=E?E.start.row:1/0),!(S>b);){var L=M[$++];if(L){this.dom.removeChildren(L),this.$renderLine(L,S,S==R?E:!1),A&&(L.style.top=this.$lines.computeLineTop(S,i,this.session)+"px");var _=i.lineHeight*this.session.getRowLength(S)+"px";L.style.height!=_&&(A=!0,L.style.height=_)}S++}if(A)for(;$<this.$lines.cells.length;){var D=this.$lines.cells[$++];D.element.style.top=this.$lines.computeLineTop(D.row,i,this.session)+"px"}},s.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var f=i.lastRow,y=u?u.lastRow:-1;if(!u||y<i.firstRow)return this.update(i);if(f<u.firstRow)return this.update(i);if(!u||u.lastRow<i.firstRow)return this.update(i);if(i.lastRow<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(u.lastRow>i.lastRow)for(var b=this.session.getFoldedRowCount(i.lastRow+1,u.lastRow);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLinesFragment(i,i.firstRow,u.firstRow-1)),i.lastRow>u.lastRow&&this.$lines.push(this.$renderLinesFragment(i,u.lastRow+1,i.lastRow)),this.$highlightIndentGuide()},s.prototype.$renderLinesFragment=function(i,u,f){for(var y=[],b=u,M=this.session.getNextFoldLine(b),$=M?M.start.row:1/0;b>$&&(b=M.end.row+1,M=this.session.getNextFoldLine(b,M),$=M?M.start.row:1/0),!(b>f);){var A=this.$lines.createCell(b,i,this.session),S=A.element;this.dom.removeChildren(S),g.setStyle(S.style,"height",this.$lines.computeLineHeight(b,i,this.session)+"px"),g.setStyle(S.style,"top",this.$lines.computeLineTop(b,i,this.session)+"px"),this.$renderLine(S,b,b==$?M:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),b++}return y},s.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var u=i.firstRow,f=i.lastRow,y=this.$lines;y.getLength();)y.pop();y.push(this.$renderLinesFragment(i,u,f))},s.prototype.$renderToken=function(i,u,f,y){for(var b=this,M=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,$=this.dom.createFragment(this.element),A,S=0;A=M.exec(y);){var E=A[1],R=A[2],L=A[3],_=A[4],D=A[5];if(!(!b.showSpaces&&R)){var w=S!=A.index?y.slice(S,A.index):"";if(S=A.index+A[0].length,w&&$.appendChild(this.dom.createTextNode(w,this.element)),E){var v=b.session.getScreenTabSize(u+A.index);$.appendChild(b.$tabStrings[v].cloneNode(!0)),u+=v-1}else if(R)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=m.stringRepeat(b.SPACE_CHAR,R.length),$.appendChild(C)}else $.appendChild(this.dom.createTextNode(R,this.element));else if(L){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=m.stringRepeat(b.SPACE_CHAR,L.length),$.appendChild(C)}else if(_){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=b.showSpaces?b.SPACE_CHAR:_,$.appendChild(C)}else if(D){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=D,$.appendChild(C)}}}if($.appendChild(this.dom.createTextNode(S?y.slice(S):y,this.element)),o(f.type))i.appendChild($);else{var x="ace_"+f.type.replace(/\./g," ace_"),C=this.dom.createElement("span");f.type=="fold"&&(C.style.width=f.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=x,C.appendChild($),i.appendChild(C)}return u+y.length},s.prototype.renderIndentGuide=function(i,u,f){var y=u.search(this.$indentGuideRe);if(y<=0||y>=f)return u;if(u[0]==" "){y-=y%this.tabSize;for(var b=y/this.tabSize,M=0;M<b;M++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var M=0;M<y;M++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}return this.$highlightIndentGuide(),u},s.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var i=this.session.doc.$lines;if(i){var u=this.session.selection.getCursor(),f=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,y=Math.floor(f/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:y,start:u.row};var b=this.session.$bracketHighlight;if(b){for(var M=this.session.$bracketHighlight.ranges,$=0;$<M.length;$++)if(u.row!==M[$].start.row){this.$highlightIndentGuideMarker.end=M[$].start.row,u.row>M[$].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&i[u.row]!==""&&u.column===i[u.row].length){this.$highlightIndentGuideMarker.dir=1;for(var $=u.row+1;$<i.length;$++){var A=i[$],S=/^\s*/.exec(A)[0].length;if(A!==""&&(this.$highlightIndentGuideMarker.end=$,S<=f))break}}this.$renderHighlightIndentGuide()}}},s.prototype.$clearActiveIndentGuide=function(){for(var i=this.$lines.cells,u=0;u<i.length;u++){var f=i[u],y=f.element.childNodes;if(y.length>0){for(var b=0;b<y.length;b++)if(y[b].classList&&y[b].classList.contains("ace_indent-guide-active")){y[b].classList.remove("ace_indent-guide-active");break}}}},s.prototype.$setIndentGuideActive=function(i,u){var f=this.session.doc.getLine(i.row);if(f!==""){var y=i.element.childNodes;if(y){var b=y[u-1];b&&b.classList&&b.classList.contains("ace_indent-guide")&&b.classList.add("ace_indent-guide-active")}}},s.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var i=this.$lines.cells;this.$clearActiveIndentGuide();var u=this.$highlightIndentGuideMarker.indentLevel;if(u!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var f=0;f<i.length;f++){var y=i[f];if(this.$highlightIndentGuideMarker.end&&y.row>=this.$highlightIndentGuideMarker.start+1){if(y.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}else for(var f=i.length-1;f>=0;f--){var y=i[f];if(this.$highlightIndentGuideMarker.end&&y.row<this.$highlightIndentGuideMarker.start){if(y.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}}},s.prototype.$createLineElement=function(i){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},s.prototype.$renderWrappedLine=function(i,u,f){var y=0,b=0,M=f[0],$=0,A=this.$createLineElement();i.appendChild(A);for(var S=0;S<u.length;S++){var E=u[S],R=E.value;if(S==0&&this.displayIndentGuides){if(y=R.length,R=this.renderIndentGuide(A,R,M),!R)continue;y-=R.length}if(y+R.length<M)$=this.$renderToken(A,$,E,R),y+=R.length;else{for(;y+R.length>=M;)$=this.$renderToken(A,$,E,R.substring(0,M-y)),R=R.substring(M-y),y=M,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",f.indent),this.element)),b++,$=0,M=f[b]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,$=this.$renderToken(A,$,E,R))}}f[f.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(A,$,null,"",!0)},s.prototype.$renderSimpleLine=function(i,u){for(var f=0,y=0;y<u.length;y++){var b=u[y],M=b.value;if(!(y==0&&this.displayIndentGuides&&(M=this.renderIndentGuide(i,M),!M))){if(f+M.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,f,b,M);f=this.$renderToken(i,f,b,M)}}},s.prototype.$renderOverflowMessage=function(i,u,f,y,b){f&&this.$renderToken(i,u,f,y.slice(0,this.MAX_LINE_LENGTH-u));var M=this.dom.createElement("span");M.className="ace_inline_button ace_keyword ace_toggle_wrap",M.textContent=b?"<hide>":"<click to see more...>",i.appendChild(M)},s.prototype.$renderLine=function(i,u,f){if(!f&&f!=!1&&(f=this.session.getFoldLine(u)),f)var y=this.$getFoldLineTokens(u,f);else var y=this.session.getTokens(u);var b=i;if(y.length){var M=this.session.getRowSplitData(u);if(M&&M.length){this.$renderWrappedLine(i,y,M);var b=i.lastChild}else{var b=i;this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b)),this.$renderSimpleLine(b,y)}}else this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b));if(this.showEOL&&b){f&&(u=f.end.row);var $=this.dom.createElement("span");$.className="ace_invisible ace_invisible_eol",$.textContent=u==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild($)}},s.prototype.$getFoldLineTokens=function(i,u){var f=this.session,y=[];function b($,A,S){for(var E=0,R=0;R+$[E].value.length<A;)if(R+=$[E].value.length,E++,E==$.length)return;if(R!=A){var L=$[E].value.substring(A-R);L.length>S-A&&(L=L.substring(0,S-A)),y.push({type:$[E].type,value:L}),R=A+L.length,E+=1}for(;R<S&&E<$.length;){var L=$[E].value;L.length+R>S?y.push({type:$[E].type,value:L.substring(0,S-R)}):y.push($[E]),R+=L.length,E+=1}}var M=f.getTokens(i);return u.walk(function($,A,S,E,R){$!=null?y.push({type:"fold",value:$}):(R&&(M=f.getTokens(A)),M.length&&b(M,E,S))},u.end.row,this.session.getLine(u.end.row).length),y},s.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},s})();a.prototype.EOF_CHAR="¶",a.prototype.EOL_CHAR_LF="¬",a.prototype.EOL_CHAR_CRLF="¤",a.prototype.EOL_CHAR=a.prototype.EOL_CHAR_LF,a.prototype.TAB_CHAR="—",a.prototype.SPACE_CHAR="·",a.prototype.$padding=0,a.prototype.MAX_LINE_LENGTH=1e4,a.prototype.showInvisibles=!1,a.prototype.showSpaces=!1,a.prototype.showTabs=!1,a.prototype.showEOL=!1,a.prototype.displayIndentGuides=!0,a.prototype.$highlightIndentGuides=!0,a.prototype.$tabStrings=[],a.prototype.destroy={},a.prototype.onChangeTabSize=a.prototype.$computeTabString,h.implement(a.prototype,d),n.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c){this.element=h.createElement("div"),this.element.className="ace_layer ace_cursor-layer",c.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),h.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return m.prototype.$updateOpacity=function(c){for(var d=this.cursors,r=d.length;r--;)h.setStyle(d[r].style,"opacity",c?"":"0")},m.prototype.$startCssAnimation=function(){for(var c=this.cursors,d=c.length;d--;)c[d].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&h.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},m.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,h.removeCssClass(this.element,"ace_animate-blinking")},m.prototype.setPadding=function(c){this.$padding=c},m.prototype.setSession=function(c){this.session=c},m.prototype.setBlinking=function(c){c!=this.isBlinking&&(this.isBlinking=c,this.restartTimer())},m.prototype.setBlinkInterval=function(c){c!=this.blinkInterval&&(this.blinkInterval=c,this.restartTimer())},m.prototype.setSmoothBlinking=function(c){c!=this.smoothBlinking&&(this.smoothBlinking=c,h.setCssClass(this.element,"ace_smooth-blinking",c),this.$updateCursors(!0),this.restartTimer())},m.prototype.addCursor=function(){var c=h.createElement("div");return c.className="ace_cursor",this.element.appendChild(c),this.cursors.push(c),c},m.prototype.removeCursor=function(){if(this.cursors.length>1){var c=this.cursors.pop();return c.parentNode.removeChild(c),c}},m.prototype.hideCursor=function(){this.isVisible=!1,h.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.showCursor=function(){this.isVisible=!0,h.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.restartTimer=function(){var c=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,h.removeCssClass(this.element,"ace_smooth-blinking")),c(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&h.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),h.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var d=(function(){this.timeoutId=setTimeout(function(){c(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){c(!0),d()},this.blinkInterval),d()}},m.prototype.getPixelPosition=function(c,d){if(!this.config||!this.session)return{left:0,top:0};c||(c=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(c),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,c.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),a=(r.row-(d?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:a}},m.prototype.isCursorInView=function(c,d){return c.top>=0&&c.top<d.maxHeight},m.prototype.update=function(c){this.config=c;var d=this.session.$selectionMarkers,r=0,o=0;(d===void 0||d.length===0)&&(d=[{cursor:null}]);for(var r=0,a=d.length;r<a;r++){var s=this.getPixelPosition(d[r].cursor,!0);if(!((s.top>c.height+c.offset||s.top<0)&&r>1)){var i=this.cursors[o++]||this.addCursor(),u=i.style;this.drawCursor?this.drawCursor(i,s,c,d[r],this.session):this.isCursorInView(s,c)?(h.setStyle(u,"display","block"),h.translate(i,s.left,s.top),h.setStyle(u,"width",Math.round(c.characterWidth)+"px"),h.setStyle(u,"height",c.lineHeight+"px")):h.setStyle(u,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=s,this.restartTimer()},m.prototype.$setOverwrite=function(c){c!=this.overwrite&&(this.overwrite=c,c?h.addCssClass(this.element,"ace_overwrite-cursors"):h.removeCssClass(this.element,"ace_overwrite-cursors"))},m.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},m})();g.prototype.$padding=0,g.prototype.drawCursor=null,n.Cursor=g}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var h=this&&this.__extends||(function(){var i=function(u,f){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var M in b)Object.prototype.hasOwnProperty.call(b,M)&&(y[M]=b[M])},i(u,f)};return function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");i(u,f);function y(){this.constructor=u}u.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),d=t("./lib/event_emitter").EventEmitter,r=32768,o=(function(){function i(u,f){this.element=m.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+f,this.inner=m.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),u.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)}return i.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},i})();g.implement(o.prototype,d);var a=(function(i){h(u,i);function u(f,y){var b=i.call(this,f,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,y.$scrollbarWidth=b.width=m.scrollbarWidth(f.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return u.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var f=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-f)/(this.coeff-f)}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(f){this.element.style.height=f+"px"},u.prototype.setScrollHeight=function(f){this.scrollHeight=f,f>r?(this.coeff=r/f,f=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=f+"px"},u.prototype.setScrollTop=function(f){this.scrollTop!=f&&(this.skipEvent=!0,this.scrollTop=f,this.element.scrollTop=f*this.coeff)},u})(o);a.prototype.setInnerHeight=a.prototype.setScrollHeight;var s=(function(i){h(u,i);function u(f,y){var b=i.call(this,f,"-h")||this;return b.scrollLeft=0,b.height=y.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return u.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.setWidth=function(f){this.element.style.width=f+"px"},u.prototype.setInnerWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollLeft=function(f){this.scrollLeft!=f&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=f)},u})(o);n.ScrollBar=a,n.ScrollBarV=a,n.ScrollBarH=s,n.VScrollBar=a,n.HScrollBar=s}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,y){f.__proto__=y}||function(f,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(f[b]=y[b])},s(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(i,u);function f(){this.constructor=i}i.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),d=t("./lib/event_emitter").EventEmitter;m.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
1368
+ `){var F=E.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);E.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,B=E.getState(k.row),F=E.getLine(k.row),H=_.checkOutdent(B,F,v);if(E.insert(k,v),O&&O.selection&&(O.selection.length==2?this.selection.setSelectionRange(new p(k.row,P+O.selection[0],k.row,P+O.selection[1])):this.selection.setSelectionRange(new p(k.row+O.selection[0],O.selection[1],k.row+O.selection[2],O.selection[3]))),this.$enableAutoIndent){if(E.getDocument().isNewLine(v)){var z=_.getNextLineIndent(B,F.slice(0,k.column),E.getTabString());E.insert({row:k.row+1,column:0},z)}H&&_.autoOutdent(B,E,k.row)}},w.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),E=this.selection.isEmpty()?[new p(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),_="",k="",O="",I=v.getTabString(),N=0;N<E.length;N++)for(var P=E[N].start.row,B=E[N].end.row,F=P;F<=B;F++){F>0&&(_=v.getState(F-1),k=v.getLine(F-1),O=C.getNextLineIndent(_,k,I));var H=v.getLine(F),z=C.$getIndent(H);if(O!==z){if(z.length>0){var W=new p(F,0,F,z.length);v.remove(W)}O.length>0&&v.insert({row:F,column:0},O)}C.autoOutdent(_,v,F)}},w.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var E=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(E):E(),this.endOperation()},w.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var E=this.selection.getRange();E.start.column-=C.extendLeft,E.end.column+=C.extendRight,E.start.column<0&&(E.start.row--,E.start.column+=this.session.getLine(E.start.row).length+1),this.selection.setRange(E),!v&&!E.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var E=this.selection.getRange();E.start.column-=C.restoreStart,E.end.column-=C.restoreEnd,this.selection.setRange(E)}},w.prototype.onCommandKey=function(v,C,E){return this.keyBinding.onCommandKey(v,C,E)},w.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},w.prototype.getOverwrite=function(){return this.session.getOverwrite()},w.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},w.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},w.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},w.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},w.prototype.getDragDelay=function(){return this.getOption("dragDelay")},w.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},w.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},w.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},w.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},w.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},w.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},w.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},w.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},w.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},w.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},w.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},w.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},w.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},w.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},w.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},w.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},w.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},w.prototype.getReadOnly=function(){return this.getOption("readOnly")},w.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},w.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},w.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},w.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},w.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},w.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var E=this.session,_=E.getState(C.start.row),k=E.getMode().transformAction(_,"deletion",this,E,C);if(C.end.column===0){var O=E.getTextRange(C);if(O[O.length-1]==`
1369
+ `){var I=E.getLine(C.end.row);/^\s+$/.test(I)&&(C.end.column=I.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},w.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var v=this.getSelectionRange();v.start.column==v.end.column&&v.start.row==v.end.row&&(v.end.column=0,v.end.row++),this.session.remove(v),this.clearSelection()},w.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
1370
+ `),this.moveCursorToPosition(v)},w.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},w.prototype.removeGhostText=function(){this.renderer.removeGhostText()},w.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var E=this.session.getLine(v.row),_,k;C<E.length?(_=E.charAt(C)+E.charAt(C-1),k=new p(v.row,C-1,v.row,C+1)):(_=E.charAt(C-1)+E.charAt(C-2),k=new p(v.row,C-2,v.row,C)),this.session.replace(k,_),this.session.selection.moveToPosition(k.end)}}},w.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toLowerCase()),this.selection.setSelectionRange(v)},w.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toUpperCase()),this.selection.setSelectionRange(v)},w.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}else if(C.start.column<C.end.column){var _=v.getTextRange(C);if(!/^\s+$/.test(_)){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}}var k=v.getLine(C.start.row),O=C.start,I=v.getTabSize(),N=v.documentToScreenColumn(O.row,O.column);if(this.session.getUseSoftTabs())var P=I-N%I,B=c.stringRepeat(" ",P);else{for(var P=N%I;k[C.start.column-1]==" "&&P;)C.start.column--,P--;this.selection.setSelectionRange(C),B=" "}return this.insert(B)},w.prototype.blockIndent=function(){var v=this.$getSelectedRows();this.session.indentRows(v.first,v.last," ")},w.prototype.blockOutdent=function(){var v=this.session.getSelection();this.session.outdentRows(v.getRange())},w.prototype.sortLines=function(){for(var v=this.$getSelectedRows(),C=this.session,E=[],_=v.first;_<=v.last;_++)E.push(C.getLine(_));E.sort(function(I,N){return I.toLowerCase()<N.toLowerCase()?-1:I.toLowerCase()>N.toLowerCase()?1:0});for(var k=new p(0,0,0,0),_=v.first;_<=v.last;_++){var O=C.getLine(_);k.start.row=_,k.end.row=_,k.end.column=O.length,C.replace(k,E[_-v.first])}},w.prototype.toggleCommentLines=function(){var v=this.session.getState(this.getCursorPosition().row),C=this.$getSelectedRows();this.session.getMode().toggleCommentLines(v,this.session,C.first,C.last)},w.prototype.toggleBlockComment=function(){var v=this.getCursorPosition(),C=this.session.getState(v.row),E=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,E,v)},w.prototype.getNumberAt=function(v,C){var E=/[\-]?[0-9]+(?:\.[0-9]+)?/g;E.lastIndex=0;for(var _=this.session.getLine(v);E.lastIndex<C;){var k=E.exec(_);if(k.index<=C&&k.index+k[0].length>=C){var O={value:k[0],start:k.index,end:k.index+k[0].length};return O}}return null},w.prototype.modifyNumber=function(v){var C=this.selection.getCursor().row,E=this.selection.getCursor().column,_=new p(C,E-1,C,E),k=this.session.getTextRange(_);if(!isNaN(parseFloat(k))&&isFinite(k)){var O=this.getNumberAt(C,E);if(O){var I=O.value.indexOf(".")>=0?O.start+O.value.indexOf(".")+1:O.end,N=O.start+O.value.length-I,P=parseFloat(O.value);P*=Math.pow(10,N),I!==O.end&&E<I?v*=Math.pow(10,O.end-E-1):v*=Math.pow(10,O.end-E),P+=v,P/=Math.pow(10,N);var B=P.toFixed(N),F=new p(C,O.start,C,O.end);this.session.replace(F,B),this.moveCursorTo(C,Math.max(O.start+1,E+B.length-O.value.length))}}else this.toggleWord()},w.prototype.toggleWord=function(){var v=this.selection.getCursor().row,C=this.selection.getCursor().column;this.selection.selectWord();var E=this.getSelectedText(),_=this.selection.getWordRange().start.column,k=E.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),O=C-_-1;O<0&&(O=0);var I=0,N=0,P=this;E.match(/[A-Za-z0-9_]+/)&&k.forEach(function(G,J){N=I+G.length,O>=I&&O<=N&&(E=G,P.selection.clearSelection(),P.moveCursorTo(v,I+_),P.selection.selectTo(v,N+_)),I=N});for(var B=this.$toggleWordPairs,F,H=0;H<B.length;H++)for(var z=B[H],W=0;W<=1;W++){var U=+!W,K=E.match(new RegExp("^\\s?_?("+c.escapeRegExp(z[W])+")\\s?$","i"));if(K){var Y=E.match(new RegExp("([_]|^|\\s)("+c.escapeRegExp(K[1])+")($|\\s)","g"));Y&&(F=E.replace(new RegExp(c.escapeRegExp(z[W]),"i"),function(G){var J=z[U];return G.toUpperCase()==G?J=J.toUpperCase():G.charAt(0).toUpperCase()==G.charAt(0)&&(J=J.substr(0,0)+z[U].charAt(0).toUpperCase()+J.substr(1)),J}),this.insert(F),F="")}}},w.prototype.findLinkAt=function(v,C){var E,_,k=this.session.getLine(v),O=k.split(/((?:https?|ftp):\/\/[\S]+)/),I=C;I<0&&(I=0);var N=0,P=0,B;try{for(var F=h(O),H=F.next();!H.done;H=F.next()){var z=H.value;if(P=N+z.length,I>=N&&I<=P&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){B=z.replace(/[\s:.,'";}\]]+$/,"");break}N=P}}catch(W){E={error:W}}finally{try{H&&!H.done&&(_=F.return)&&_.call(F)}finally{if(E)throw E.error}}return B},w.prototype.openLink=function(){var v=this.selection.getCursor(),C=this.findLinkAt(v.row,v.column);return C&&window.open(C,"_blank"),C!=null},w.prototype.removeLines=function(){var v=this.$getSelectedRows();this.session.removeFullLines(v.first,v.last),this.clearSelection()},w.prototype.duplicateSelection=function(){var v=this.selection,C=this.session,E=v.getRange(),_=v.isBackwards();if(E.isEmpty()){var k=E.start.row;C.duplicateLines(k,k)}else{var O=_?E.start:E.end,I=C.insert(O,C.getTextRange(E));E.start=O,E.end=I,v.setSelectionRange(E,_)}},w.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},w.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},w.prototype.moveText=function(v,C,E){return this.session.moveText(v,C,E)},w.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},w.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},w.prototype.$moveLines=function(v,C){var E,_,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var O=k.toOrientedRange();E=this.$getSelectedRows(O),_=this.session.$moveLines(E.first,E.last,C?0:v),C&&v==-1&&(_=0),O.moveBy(_,0),k.fromOrientedRange(O)}else{var I=k.rangeList.ranges;k.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var N=0,P=0,B=I.length,F=0;F<B;F++){var H=F;I[F].moveBy(N,0),E=this.$getSelectedRows(I[F]);for(var z=E.first,W=E.last;++F<B;){P&&I[F].moveBy(P,0);var U=this.$getSelectedRows(I[F]);if(C&&U.first!=W)break;if(!C&&U.first>W+1)break;W=U.last}for(F--,N=this.session.$moveLines(z,W,C?0:v),C&&v==-1&&(H=F+1);H<=F;)I[H].moveBy(N,0),H++;C||(N=0),P+=N}k.fromOrientedRange(k.ranges[0]),k.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},w.prototype.$getSelectedRows=function(v){return v=(v||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(v.start.row),last:this.session.getRowFoldEnd(v.end.row)}},w.prototype.onCompositionStart=function(v){this.renderer.showComposition(v)},w.prototype.onCompositionUpdate=function(v){this.renderer.setCompositionText(v)},w.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},w.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},w.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},w.prototype.isRowVisible=function(v){return v>=this.getFirstVisibleRow()&&v<=this.getLastVisibleRow()},w.prototype.isRowFullyVisible=function(v){return v>=this.renderer.getFirstFullyVisibleRow()&&v<=this.renderer.getLastFullyVisibleRow()},w.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},w.prototype.$moveByPage=function(v,C){var E=this.renderer,_=this.renderer.layerConfig,k=v*Math.floor(_.height/_.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var O=E.scrollTop;E.scrollBy(0,k*_.lineHeight),C!=null&&E.scrollCursorIntoView(null,.5),E.animateScrolling(O)},w.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},w.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},w.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},w.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},w.prototype.scrollPageDown=function(){this.$moveByPage(1)},w.prototype.scrollPageUp=function(){this.$moveByPage(-1)},w.prototype.scrollToRow=function(v){this.renderer.scrollToRow(v)},w.prototype.scrollToLine=function(v,C,E,_){this.renderer.scrollToLine(v,C,E,_)},w.prototype.centerSelection=function(){var v=this.getSelectionRange(),C={row:Math.floor(v.start.row+(v.end.row-v.start.row)/2),column:Math.floor(v.start.column+(v.end.column-v.start.column)/2)};this.renderer.alignCursor(C,.5)},w.prototype.getCursorPosition=function(){return this.selection.getCursor()},w.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},w.prototype.getSelectionRange=function(){return this.selection.getRange()},w.prototype.selectAll=function(){this.selection.selectAll()},w.prototype.clearSelection=function(){this.selection.clearSelection()},w.prototype.moveCursorTo=function(v,C){this.selection.moveCursorTo(v,C)},w.prototype.moveCursorToPosition=function(v){this.selection.moveCursorToPosition(v)},w.prototype.jumpToMatching=function(v,C){var E=this.getCursorPosition(),_=new A(this.session,E.row,E.column),k=_.getCurrentToken(),O=0;k&&k.type.indexOf("tag-name")!==-1&&(k=_.stepBackward());var I=k||_.stepForward();if(I){var N,P=!1,B={},F=E.column-I.start,H,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(I.value.match(/[{}()\[\]]/g)){for(;F<I.value.length&&!P;F++)if(z[I.value[F]])switch(H=z[I.value[F]]+"."+I.type.replace("rparen","lparen"),isNaN(B[H])&&(B[H]=0),I.value[F]){case"(":case"[":case"{":B[H]++;break;case")":case"]":case"}":B[H]--,B[H]===-1&&(N="bracket",P=!0);break}}else I.type.indexOf("tag-name")!==-1&&(isNaN(B[I.value])&&(B[I.value]=0),k.value==="<"&&O>1?B[I.value]++:k.value==="</"&&B[I.value]--,B[I.value]===-1&&(N="tag",P=!0));P||(k=I,O++,I=_.stepForward(),F=0)}while(I&&!P);if(N){var W,U;if(N==="bracket")W=this.session.getBracketRange(E),W||(W=new p(_.getCurrentTokenRow(),_.getCurrentTokenColumn()+F-1,_.getCurrentTokenRow(),_.getCurrentTokenColumn()+F-1),U=W.start,(C||U.row===E.row&&Math.abs(U.column-E.column)<2)&&(W=this.session.getBracketRange(U)));else if(N==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(W=new p(_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2,_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2),W.compare(E.row,E.column)===0){var K=this.session.getMatchingTags(E);K&&(K.openTag.contains(E.row,E.column)?(W=K.closeTag,U=W.start):(W=K.openTag,K.closeTag.start.row===E.row&&K.closeTag.start.column===E.column?U=W.end:U=W.start))}U=U||W.start}U=W&&W.cursor||U,U&&(v?W&&C?this.selection.setRange(W):W&&W.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(U.row,U.column):this.selection.moveTo(U.row,U.column))}}},w.prototype.gotoLine=function(v,C,E){this.selection.clearSelection(),this.session.unfold({row:v-1,column:C||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(v-1,C||0),this.isRowFullyVisible(v-1)||this.scrollToLine(v-1,!0,E)},w.prototype.navigateTo=function(v,C){this.selection.moveTo(v,C)},w.prototype.navigateUp=function(v){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(-v||-1,0)},w.prototype.navigateDown=function(v){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(v||1,0)},w.prototype.navigateLeft=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorLeft();else{var C=this.getSelectionRange().start;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateRight=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorRight();else{var C=this.getSelectionRange().end;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},w.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},w.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},w.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},w.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},w.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},w.prototype.replace=function(v,C){C&&this.$search.set(C);var E=this.$search.find(this.session),_=0;return E&&(this.$tryReplace(E,v)&&(_=1),this.selection.setSelectionRange(E),this.renderer.scrollSelectionIntoView(E.start,E.end)),_},w.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var E=this.$search.findAll(this.session),_=0;if(!E.length)return _;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var O=E.length-1;O>=0;--O)this.$tryReplace(E[O],v)&&_++;return this.selection.setSelectionRange(k),_},w.prototype.$tryReplace=function(v,C){var E=this.session.getTextRange(v);return C=this.$search.replace(E,C),C!==null?(v.end=this.session.replace(v,C),v):null},w.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},w.prototype.find=function(v,C,E){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var _=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(_)||this.$search.$options.needle,v||(_=this.session.getWordRange(_.start.row,_.start.column),v=this.session.getTextRange(_)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:_});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,E),k;C.backwards?_.start=_.end:_.end=_.start,this.selection.setRange(_)},w.prototype.findNext=function(v,C){this.find({skipCurrent:!0,backwards:!1},v,C)},w.prototype.findPrevious=function(v,C){this.find(v,{skipCurrent:!0,backwards:!0},C)},w.prototype.revealRange=function(v,C){this.session.unfold(v),this.selection.setSelectionRange(v);var E=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(E)},w.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(v){v.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()},w.prototype.setAutoScrollEditorIntoView=function(v){if(v){var C,E=this,_=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var k=this.$scrollAnchor;k.style.cssText="position:absolute",this.container.insertBefore(k,this.container.firstChild);var O=this.on("changeSelection",function(){_=!0}),I=this.renderer.on("beforeRender",function(){_&&(C=E.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(_&&C&&(E.isFocused()||E.searchBox&&E.searchBox.isFocused())){var P=E.renderer,B=P.$cursorLayer.$pixelPos,F=P.layerConfig,H=B.top-F.offset;B.top>=0&&H+C.top<0?_=!0:B.top<F.height&&B.top+C.top+F.lineHeight>window.innerHeight?_=!1:_=null,_!=null&&(k.style.top=H+"px",k.style.left=B.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(_)),_=C=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",O),this.renderer.off("afterRender",N),this.renderer.off("beforeRender",I))}}},w.prototype.$resetCursorStyle=function(){var v=this.$cursorStyle||"ace",C=this.renderer.$cursorLayer;C&&(C.setSmoothBlinking(/smooth/.test(v)),C.isBlinking=!this.$readOnly&&v!="wide",m.setCssClass(C.element,"ace_slim-cursors",/slim/.test(v)))},w.prototype.prompt=function(v,C,E){var _=this;x.loadModule("ace/ext/prompt",function(k){k.prompt(_,v,C,E)})},w})();T.$uid=0,T.prototype.curOp=null,T.prototype.prevOp={},T.prototype.$mergeableCommands=["backspace","del","insertstring"],T.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"],["&&","||"],["==","!="]],g.implement(T.prototype,y),x.defineOptions(T.prototype,"editor",{selectionStyle:{set:function(w){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:w})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(w){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(w){this.textInput.setReadOnly(w),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(w){this.textInput.setCopyWithEmptySelection(w)},initialValue:!1},cursorStyle:{set:function(w){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(w){this.setAutoScrollEditorIntoView(w)}},keyboardHandler:{set:function(w){this.setKeyboardHandler(w)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(w){this.session.setValue(w)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(w){this.setSession(w)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(w){this.renderer.$gutterLayer.setShowLineNumbers(w),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),w&&this.$relativeLineNumbers?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(w){this.$showLineNumbers&&w?D.attach(this):D.detach(this)}},placeholder:{set:function(w){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var v=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(v&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),m.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!v&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),m.addCssClass(this.container,"ace_hasPlaceholder");var C=m.createElement("div");C.className="ace_placeholder",C.textContent=this.$placeholder||"",this.renderer.placeholderNode=C,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!v&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(w){var v={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(_){_.blur(),_.renderer.scroller.focus()},readOnly:!0},C=function(_){if(_.target==this.renderer.scroller&&_.keyCode===L.enter){_.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},E;w?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(f.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",$("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",$("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",C.bind(this)),this.commands.addCommand(v),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",$("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",$("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),E||(E=new S(this)),E.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",C.bind(this)),this.commands.removeCommand(v),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),E&&E.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(w){this.$textInputAriaLabel=w},initialValue:""},enableMobileMenu:{set:function(w){this.$enableMobileMenu=w},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var D={getText:function(w,v){return(Math.abs(w.selection.lead.row-v)||v+1+(v<9?"·":""))+""},getWidth:function(w,v,C){return Math.max(v.toString().length,(C.lastRow+1).toString().length,2)*C.characterWidth},update:function(w,v){v.renderer.$loop.schedule(v.renderer.CHANGE_GUTTER)},attach:function(w){w.renderer.$gutterLayer.$renderer=this,w.on("changeSelection",this.update),this.update(null,w)},detach:function(w){w.renderer.$gutterLayer.$renderer==this&&(w.renderer.$gutterLayer.$renderer=null),w.off("changeSelection",this.update),this.update(null,w)}};n.Editor=T}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,d){var h=t("../lib/dom"),g=(function(){function m(c,f){this.element=c,this.canvasHeight=f||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return m.prototype.moveContainer=function(c){h.translate(this.element,0,-(c.firstRowScreen*c.lineHeight%this.canvasHeight)-c.offset*this.$offsetCoefficient)},m.prototype.pageChanged=function(c,f){return Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)!==Math.floor(f.firstRowScreen*f.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(c,f,r){var o=f.firstRowScreen*f.lineHeight,a=Math.floor(o/this.canvasHeight),s=r.documentToScreenRow(c,0)*f.lineHeight;return s-a*this.canvasHeight},m.prototype.computeLineHeight=function(c,f,r){return f.lineHeight*r.getRowLineCount(c)},m.prototype.getLength=function(){return this.cells.length},m.prototype.get=function(c){return this.cells[c]},m.prototype.shift=function(){this.$cacheCell(this.cells.shift())},m.prototype.pop=function(){this.$cacheCell(this.cells.pop())},m.prototype.push=function(c){if(Array.isArray(c)){this.cells.push.apply(this.cells,c);for(var f=h.createFragment(this.element),r=0;r<c.length;r++)f.appendChild(c[r].element);this.element.appendChild(f)}else this.cells.push(c),this.element.appendChild(c.element)},m.prototype.unshift=function(c){if(Array.isArray(c)){this.cells.unshift.apply(this.cells,c);for(var f=h.createFragment(this.element),r=0;r<c.length;r++)f.appendChild(c[r].element);this.element.firstChild?this.element.insertBefore(f,this.element.firstChild):this.element.appendChild(f)}else this.cells.unshift(c),this.element.insertAdjacentElement("afterbegin",c.element)},m.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},m.prototype.$cacheCell=function(c){c&&(c.element.remove(),this.cellCache.push(c))},m.prototype.createCell=function(c,f,r,o){var a=this.cellCache.pop();if(!a){var s=h.createElement("div");o&&o(s),this.element.appendChild(s),a={element:s,text:"",row:c}}return a.row=c,a},m})();n.Lines=g}),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(t,n,d){var h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),c=t("../lib/event_emitter").EventEmitter,f=t("./lines").Lines,r=t("../config").nls,o=(function(){function s(i){this.element=h.createElement("div"),this.element.className="ace_layer ace_gutter-layer",i.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new f(this.element),this.$lines.$offsetCoefficient=1}return s.prototype.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},s.prototype.addGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(i,u)},s.prototype.removeGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(i,u)},s.prototype.setAnnotations=function(i){this.$annotations=[];for(var u=0;u<i.length;u++){var p=i[u],y=p.row,b=this.$annotations[y];b||(b=this.$annotations[y]={text:[],type:[],displayText:[]});var M=p.text,x=p.text,A=p.type;M=M?m.escapeHTML(M):p.html||"",x=x||p.html||"",b.text.indexOf(M)===-1&&(b.text.push(M),b.type.push(A),b.displayText.push(x));var S=p.className;S?b.className=S:A==="error"?b.className=" ace_error":A==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":A==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":A==="info"&&!b.className?b.className=" ace_info":A==="hint"&&!b.className&&(b.className=" ace_hint")}},s.prototype.$updateAnnotations=function(i){if(this.$annotations.length){var u=i.start.row,p=i.end.row-u;if(p!==0)if(i.action=="remove")this.$annotations.splice(u,p+1,null);else{var y=new Array(p+1);y.unshift(u,1),this.$annotations.splice.apply(this.$annotations,y)}}},s.prototype.update=function(i){this.config=i;var u=this.session,p=i.firstRow,y=Math.min(i.lastRow+i.gutterOffset,u.getLength()-1);this.oldLastRow=y,this.config=i,this.$lines.moveContainer(i),this.$updateCursorRow();for(var b=u.getNextFoldLine(p),M=b?b.start.row:1/0,x=null,A=-1,S=p;;){if(S>M&&(S=b.end.row+1,b=u.getNextFoldLine(S,b),M=b?b.start.row:1/0),S>y){for(;this.$lines.getLength()>A+1;)this.$lines.pop();break}x=this.$lines.get(++A),x?x.row=S:(x=this.$lines.createCell(S,i,this.session,a),this.$lines.push(x)),this.$renderCell(x,i,b,S),S++}this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$updateGutterWidth=function(i){var u=this.session,p=u.gutterRenderer||this.$renderer,y=u.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(b=u.getLength()+y-1);var M=p?p.getWidth(u,b,i):b.toString().length*i.characterWidth,x=this.$padding||this.$computePadding();M+=x.left+x.right,M!==this.gutterWidth&&!isNaN(M)&&(this.gutterWidth=M,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",M))},s.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},s.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var u=this.$lines.cells;this.$cursorCell=null;for(var p=0;p<u.length;p++){var y=u[p];if(y.row>=this.$cursorRow){if(y.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(p>0&&b&&b.start.row==u[p-1].row)y=u[p-1];else break}y.element.className="ace_gutter-active-line "+y.element.className,this.$cursorCell=y;break}}}}},s.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var p=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),y=this.oldLastRow;if(this.oldLastRow=p,!u||y<i.firstRow)return this.update(i);if(p<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(y>p)for(var b=this.session.getFoldedRowCount(p+1,y);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,u.firstRow-1)),p>y&&this.$lines.push(this.$renderLines(i,y+1,p)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$renderLines=function(i,u,p){for(var y=[],b=u,M=this.session.getNextFoldLine(b),x=M?M.start.row:1/0;b>x&&(b=M.end.row+1,M=this.session.getNextFoldLine(b,M),x=M?M.start.row:1/0),!(b>p);){var A=this.$lines.createCell(b,i,this.session,a);this.$renderCell(A,i,M,b),y.push(A),b++}return y},s.prototype.$renderCell=function(i,u,p,y){var b=i.element,M=this.session,x=b.childNodes[0],A=b.childNodes[1],S=b.childNodes[2],$=S.firstChild,R=M.$firstLineNumber,L=M.$breakpoints,T=M.$decorations,D=M.gutterRenderer||this.$renderer,w=this.$showFoldWidgets&&M.foldWidgets,v=p?p.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",E=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",_=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(D?D.getText(M,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||p&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=p.end.row)&&(E+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),L[y]&&(E+=L[y]),T[y]&&(E+=T[y]),this.$annotations[y]&&y!==v&&(E+=this.$annotations[y].className),w){var O=w[y];O==null&&(O=w[y]=M.getFoldWidget(y))}if(O){var I="ace_fold-widget ace_"+O,N=O=="start"&&y==v&&y<p.end.row;if(N){I+=" ace_closed";for(var P="",B=!1,F=y+1;F<=p.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){B=!0,P=" ace_error_fold";break}this.$annotations[F].className===" ace_security"?(B=!0,P=" ace_security_fold"):this.$annotations[F].className===" ace_warning"&&P!==" ace_security_fold"&&(B=!0,P=" ace_warning_fold")}E+=P}else I+=" ace_open";A.className!=I&&(A.className=I),h.setStyle(A.style,"height",C),h.setStyle(A.style,"display","inline-block"),A.setAttribute("role","button"),A.setAttribute("tabindex","-1");var H=M.getFoldWidgetRange(y);H?A.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[H.start.row+1,H.end.row+1])):p?A.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[p.start.row+1,p.end.row+1])):A.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[y+1])),N?(A.setAttribute("aria-expanded","false"),A.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(A.setAttribute("aria-expanded","true"),A.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else A&&(h.setStyle(A.style,"display","none"),A.setAttribute("tabindex","0"),A.removeAttribute("role"),A.removeAttribute("aria-label"));if(B&&this.$showFoldedAnnotations){S.className="ace_gutter_annotation",$.className=_,$.className+=P,h.setStyle($.style,"height",C),h.setStyle(S.style,"display","block"),h.setStyle(S.style,"height",C);var z;switch(P){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else if(this.$annotations[y]){S.className="ace_gutter_annotation",$.className=_,this.$useSvgGutterIcons?$.className+=this.$annotations[y].className:b.classList.add(this.$annotations[y].className.replace(" ","")),h.setStyle($.style,"height",C),h.setStyle(S.style,"display","block"),h.setStyle(S.style,"height",C);var z;switch(this.$annotations[y].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[k]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else h.setStyle(S.style,"display","none"),S.removeAttribute("aria-label"),S.removeAttribute("role"),S.setAttribute("tabindex","0");return k!==x.data&&(x.data=k),b.className!=E&&(b.className=E),h.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,M)+"px"),h.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,M)+"px"),i.text=k,S.style.display==="none"&&A.style.display==="none"?i.element.setAttribute("aria-hidden",!0):i.element.setAttribute("aria-hidden",!1),i},s.prototype.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},s.prototype.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},s.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},s.prototype.setShowFoldWidgets=function(i){i?h.addCssClass(this.element,"ace_folding-enabled"):h.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},s.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},s.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=h.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(i.borderLeftWidth)||0)+(parseInt(i.paddingLeft)||0)+1,this.$padding.right=(parseInt(i.borderRightWidth)||0)+(parseInt(i.paddingRight)||0),this.$padding},s.prototype.getRegion=function(i){var u=this.$padding||this.$computePadding(),p=this.element.getBoundingClientRect();if(i.x<u.left+p.left)return"markers";if(this.$showFoldWidgets&&i.x>p.right-u.right)return"foldWidgets"},s})();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,g.implement(o.prototype,c);function a(s){var i=document.createTextNode("");s.appendChild(i);var u=h.createElement("span");s.appendChild(u);var p=h.createElement("span");s.appendChild(p);var y=h.createElement("span");return p.appendChild(y),s}n.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,d){var h=t("../range").Range,g=t("../lib/dom"),m=(function(){function f(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return f.prototype.setPadding=function(r){this.$padding=r},f.prototype.setSession=function(r){this.session=r},f.prototype.setMarkers=function(r){this.markers=r},f.prototype.elt=function(r,o){var a=this.i!=-1&&this.element.childNodes[this.i];a?this.i++:(a=document.createElement("div"),this.element.appendChild(a),this.i=-1),a.style.cssText=o,a.className=r},f.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var a in this.markers){var s=this.markers[a];if(!s.range){s.update(o,this,this.session,r);continue}var i=s.range.clipRows(r.firstRow,r.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),s.renderer){var u=this.$getTop(i.start.row,r),p=this.$padding+i.start.column*r.characterWidth;s.renderer(o,i,p,u,r)}else s.type=="fullLine"?this.drawFullLineMarker(o,i,s.clazz,r):s.type=="screenLine"?this.drawScreenLineMarker(o,i,s.clazz,r):i.isMultiLine()?s.type=="text"?this.drawTextMarker(o,i,s.clazz,r):this.drawMultiLineMarker(o,i,s.clazz,r):this.drawSingleLineMarker(o,i,s.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},f.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},f.prototype.drawTextMarker=function(r,o,a,s,i){for(var u=this.session,p=o.start.row,y=o.end.row,b=p,M=0,x=0,A=u.getScreenLastRowColumn(b),S=new h(b,o.start.column,b,x);b<=y;b++)S.start.row=S.end.row=b,S.start.column=b==p?o.start.column:u.getRowWrapIndent(b),S.end.column=A,M=x,x=A,A=b+1<y?u.getScreenLastRowColumn(b+1):b==y?0:o.end.column,this.drawSingleLineMarker(r,S,a+(b==p?" ace_start":"")+" ace_br"+c(b==p||b==p+1&&o.start.column,M<x,x>A,b==y),s,b==y?0:1,i)},f.prototype.drawMultiLineMarker=function(r,o,a,s,i){var u=this.$padding,p=s.lineHeight,y=this.$getTop(o.start.row,s),b=u+o.start.column*s.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var M=o.clone();M.end.row=M.start.row,M.end.column=this.session.getLine(M.start.row).length,this.drawBidiSingleLineMarker(r,M,a+" ace_br1 ace_start",s,null,i)}else this.elt(a+" ace_br1 ace_start","height:"+p+"px;right:"+u+"px;top:"+y+"px;left:"+b+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var M=o.clone();M.start.row=M.end.row,M.start.column=0,this.drawBidiSingleLineMarker(r,M,a+" ace_br12",s,null,i)}else{y=this.$getTop(o.end.row,s);var x=o.end.column*s.characterWidth;this.elt(a+" ace_br12","height:"+p+"px;width:"+x+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}if(p=(o.end.row-o.start.row-1)*s.lineHeight,!(p<=0)){y=this.$getTop(o.start.row+1,s);var A=(o.start.column?1:0)|(o.end.column?0:8);this.elt(a+(A?" ace_br"+A:""),"height:"+p+"px;right:"+u+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}},f.prototype.drawSingleLineMarker=function(r,o,a,s,i,u){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,a,s,i,u);var p=s.lineHeight,y=(o.end.column+(i||0)-o.start.column)*s.characterWidth,b=this.$getTop(o.start.row,s),M=this.$padding+o.start.column*s.characterWidth;this.elt(a,"height:"+p+"px;width:"+y+"px;top:"+b+"px;left:"+M+"px;"+(u||""))},f.prototype.drawBidiSingleLineMarker=function(r,o,a,s,i,u){var p=s.lineHeight,y=this.$getTop(o.start.row,s),b=this.$padding,M=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);M.forEach(function(x){this.elt(a,"height:"+p+"px;width:"+(x.width+(i||0))+"px;top:"+y+"px;left:"+(b+x.left)+"px;"+(u||""))},this)},f.prototype.drawFullLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),p=s.lineHeight;o.start.row!=o.end.row&&(p+=this.$getTop(o.end.row,s)-u),this.elt(a,"height:"+p+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f.prototype.drawScreenLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),p=s.lineHeight;this.elt(a,"height:"+p+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f})();m.prototype.$padding=0;function c(f,r,o,a){return(f?1:0)|(r?2:0)|(o?4:0)|(a?8:0)}n.Marker=m}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,d){var h=new Set(["text","rparen","lparen"]);n.isTextToken=function(g){return h.has(g)}}),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(t,n,d){var h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("./lines").Lines,f=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,o=t("./text_util").isTextToken,a=(function(){function s(i){this.dom=g,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",i.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new c(this.element)}return s.prototype.$updateEolChar=function(){var i=this.session.doc,u=i.getNewLineCharacter()==`
1371
+ `&&i.getNewLineMode()!="windows",p=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=p)return this.EOL_CHAR=p,!0},s.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},s.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},s.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},s.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",(function(u){this._signal("changeCharacterSize",u)}).bind(this)),this.$pollSizeChanges()},s.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},s.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},s.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},s.prototype.setShowInvisibles=function(i){return this.showInvisibles==i?!1:(this.showInvisibles=i,typeof i=="string"?(this.showSpaces=/tab/i.test(i),this.showTabs=/space/i.test(i),this.showEOL=/eol/i.test(i)):this.showSpaces=this.showTabs=this.showEOL=i,this.$computeTabString(),!0)},s.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},s.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},s.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var u=this.$tabStrings=[0],p=1;p<i+1;p++)if(this.showTabs){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_tab",y.textContent=m.stringRepeat(this.TAB_CHAR,p),u.push(y)}else u.push(this.dom.createTextNode(m.stringRepeat(" ",p),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",M=this.showSpaces?" ace_invisible ace_invisible_space":"",x=this.showSpaces?m.stringRepeat(this.SPACE_CHAR,this.tabSize):m.stringRepeat(" ",this.tabSize),A=this.showTabs?" ace_invisible ace_invisible_tab":"",S=this.showTabs?m.stringRepeat(this.TAB_CHAR,this.tabSize):x,y=this.dom.createElement("span");y.className=b+M,y.textContent=x,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=b+A,y.textContent=S,this.$tabStrings[" "]=y}},s.prototype.updateLines=function(i,u,p){if(this.config.lastRow!=i.lastRow||this.config.firstRow!=i.firstRow)return this.update(i);this.config=i;for(var y=Math.max(u,i.firstRow),b=Math.min(p,i.lastRow),M=this.element.childNodes,x=0,S=i.firstRow;S<y;S++){var $=this.session.getFoldLine(S);if($)if($.containsRow(y)){y=$.start.row;break}else S=$.end.row;x++}for(var A=!1,S=y,$=this.session.getNextFoldLine(S),R=$?$.start.row:1/0;S>R&&(S=$.end.row+1,$=this.session.getNextFoldLine(S,$),R=$?$.start.row:1/0),!(S>b);){var L=M[x++];if(L){this.dom.removeChildren(L),this.$renderLine(L,S,S==R?$:!1),A&&(L.style.top=this.$lines.computeLineTop(S,i,this.session)+"px");var T=i.lineHeight*this.session.getRowLength(S)+"px";L.style.height!=T&&(A=!0,L.style.height=T)}S++}if(A)for(;x<this.$lines.cells.length;){var D=this.$lines.cells[x++];D.element.style.top=this.$lines.computeLineTop(D.row,i,this.session)+"px"}},s.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var p=i.lastRow,y=u?u.lastRow:-1;if(!u||y<i.firstRow)return this.update(i);if(p<u.firstRow)return this.update(i);if(!u||u.lastRow<i.firstRow)return this.update(i);if(i.lastRow<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(u.lastRow>i.lastRow)for(var b=this.session.getFoldedRowCount(i.lastRow+1,u.lastRow);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLinesFragment(i,i.firstRow,u.firstRow-1)),i.lastRow>u.lastRow&&this.$lines.push(this.$renderLinesFragment(i,u.lastRow+1,i.lastRow)),this.$highlightIndentGuide()},s.prototype.$renderLinesFragment=function(i,u,p){for(var y=[],b=u,M=this.session.getNextFoldLine(b),x=M?M.start.row:1/0;b>x&&(b=M.end.row+1,M=this.session.getNextFoldLine(b,M),x=M?M.start.row:1/0),!(b>p);){var A=this.$lines.createCell(b,i,this.session),S=A.element;this.dom.removeChildren(S),g.setStyle(S.style,"height",this.$lines.computeLineHeight(b,i,this.session)+"px"),g.setStyle(S.style,"top",this.$lines.computeLineTop(b,i,this.session)+"px"),this.$renderLine(S,b,b==x?M:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),b++}return y},s.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var u=i.firstRow,p=i.lastRow,y=this.$lines;y.getLength();)y.pop();y.push(this.$renderLinesFragment(i,u,p))},s.prototype.$renderToken=function(i,u,p,y){for(var b=this,M=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,x=this.dom.createFragment(this.element),A,S=0;A=M.exec(y);){var $=A[1],R=A[2],L=A[3],T=A[4],D=A[5];if(!(!b.showSpaces&&R)){var w=S!=A.index?y.slice(S,A.index):"";if(S=A.index+A[0].length,w&&x.appendChild(this.dom.createTextNode(w,this.element)),$){var v=b.session.getScreenTabSize(u+A.index);x.appendChild(b.$tabStrings[v].cloneNode(!0)),u+=v-1}else if(R)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=m.stringRepeat(b.SPACE_CHAR,R.length),x.appendChild(C)}else x.appendChild(this.dom.createTextNode(R,this.element));else if(L){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=m.stringRepeat(b.SPACE_CHAR,L.length),x.appendChild(C)}else if(T){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=b.showSpaces?b.SPACE_CHAR:T,x.appendChild(C)}else if(D){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=D,x.appendChild(C)}}}if(x.appendChild(this.dom.createTextNode(S?y.slice(S):y,this.element)),o(p.type))i.appendChild(x);else{var E="ace_"+p.type.replace(/\./g," ace_"),C=this.dom.createElement("span");p.type=="fold"&&(C.style.width=p.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=E,C.appendChild(x),i.appendChild(C)}return u+y.length},s.prototype.renderIndentGuide=function(i,u,p){var y=u.search(this.$indentGuideRe);if(y<=0||y>=p)return u;if(u[0]==" "){y-=y%this.tabSize;for(var b=y/this.tabSize,M=0;M<b;M++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var M=0;M<y;M++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}return this.$highlightIndentGuide(),u},s.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var i=this.session.doc.$lines;if(i){var u=this.session.selection.getCursor(),p=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,y=Math.floor(p/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:y,start:u.row};var b=this.session.$bracketHighlight;if(b){for(var M=this.session.$bracketHighlight.ranges,x=0;x<M.length;x++)if(u.row!==M[x].start.row){this.$highlightIndentGuideMarker.end=M[x].start.row,u.row>M[x].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&i[u.row]!==""&&u.column===i[u.row].length){this.$highlightIndentGuideMarker.dir=1;for(var x=u.row+1;x<i.length;x++){var A=i[x],S=/^\s*/.exec(A)[0].length;if(A!==""&&(this.$highlightIndentGuideMarker.end=x,S<=p))break}}this.$renderHighlightIndentGuide()}}},s.prototype.$clearActiveIndentGuide=function(){for(var i=this.$lines.cells,u=0;u<i.length;u++){var p=i[u],y=p.element.childNodes;if(y.length>0){for(var b=0;b<y.length;b++)if(y[b].classList&&y[b].classList.contains("ace_indent-guide-active")){y[b].classList.remove("ace_indent-guide-active");break}}}},s.prototype.$setIndentGuideActive=function(i,u){var p=this.session.doc.getLine(i.row);if(p!==""){var y=i.element.childNodes;if(y){var b=y[u-1];b&&b.classList&&b.classList.contains("ace_indent-guide")&&b.classList.add("ace_indent-guide-active")}}},s.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var i=this.$lines.cells;this.$clearActiveIndentGuide();var u=this.$highlightIndentGuideMarker.indentLevel;if(u!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var p=0;p<i.length;p++){var y=i[p];if(this.$highlightIndentGuideMarker.end&&y.row>=this.$highlightIndentGuideMarker.start+1){if(y.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}else for(var p=i.length-1;p>=0;p--){var y=i[p];if(this.$highlightIndentGuideMarker.end&&y.row<this.$highlightIndentGuideMarker.start){if(y.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}}},s.prototype.$createLineElement=function(i){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},s.prototype.$renderWrappedLine=function(i,u,p){var y=0,b=0,M=p[0],x=0,A=this.$createLineElement();i.appendChild(A);for(var S=0;S<u.length;S++){var $=u[S],R=$.value;if(S==0&&this.displayIndentGuides){if(y=R.length,R=this.renderIndentGuide(A,R,M),!R)continue;y-=R.length}if(y+R.length<M)x=this.$renderToken(A,x,$,R),y+=R.length;else{for(;y+R.length>=M;)x=this.$renderToken(A,x,$,R.substring(0,M-y)),R=R.substring(M-y),y=M,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",p.indent),this.element)),b++,x=0,M=p[b]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,x=this.$renderToken(A,x,$,R))}}p[p.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(A,x,null,"",!0)},s.prototype.$renderSimpleLine=function(i,u){for(var p=0,y=0;y<u.length;y++){var b=u[y],M=b.value;if(!(y==0&&this.displayIndentGuides&&(M=this.renderIndentGuide(i,M),!M))){if(p+M.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,p,b,M);p=this.$renderToken(i,p,b,M)}}},s.prototype.$renderOverflowMessage=function(i,u,p,y,b){p&&this.$renderToken(i,u,p,y.slice(0,this.MAX_LINE_LENGTH-u));var M=this.dom.createElement("span");M.className="ace_inline_button ace_keyword ace_toggle_wrap",M.textContent=b?"<hide>":"<click to see more...>",i.appendChild(M)},s.prototype.$renderLine=function(i,u,p){if(!p&&p!=!1&&(p=this.session.getFoldLine(u)),p)var y=this.$getFoldLineTokens(u,p);else var y=this.session.getTokens(u);var b=i;if(y.length){var M=this.session.getRowSplitData(u);if(M&&M.length){this.$renderWrappedLine(i,y,M);var b=i.lastChild}else{var b=i;this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b)),this.$renderSimpleLine(b,y)}}else this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b));if(this.showEOL&&b){p&&(u=p.end.row);var x=this.dom.createElement("span");x.className="ace_invisible ace_invisible_eol",x.textContent=u==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild(x)}},s.prototype.$getFoldLineTokens=function(i,u){var p=this.session,y=[];function b(x,A,S){for(var $=0,R=0;R+x[$].value.length<A;)if(R+=x[$].value.length,$++,$==x.length)return;if(R!=A){var L=x[$].value.substring(A-R);L.length>S-A&&(L=L.substring(0,S-A)),y.push({type:x[$].type,value:L}),R=A+L.length,$+=1}for(;R<S&&$<x.length;){var L=x[$].value;L.length+R>S?y.push({type:x[$].type,value:L.substring(0,S-R)}):y.push(x[$]),R+=L.length,$+=1}}var M=p.getTokens(i);return u.walk(function(x,A,S,$,R){x!=null?y.push({type:"fold",value:x}):(R&&(M=p.getTokens(A)),M.length&&b(M,$,S))},u.end.row,this.session.getLine(u.end.row).length),y},s.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},s})();a.prototype.EOF_CHAR="¶",a.prototype.EOL_CHAR_LF="¬",a.prototype.EOL_CHAR_CRLF="¤",a.prototype.EOL_CHAR=a.prototype.EOL_CHAR_LF,a.prototype.TAB_CHAR="—",a.prototype.SPACE_CHAR="·",a.prototype.$padding=0,a.prototype.MAX_LINE_LENGTH=1e4,a.prototype.showInvisibles=!1,a.prototype.showSpaces=!1,a.prototype.showTabs=!1,a.prototype.showEOL=!1,a.prototype.displayIndentGuides=!0,a.prototype.$highlightIndentGuides=!0,a.prototype.$tabStrings=[],a.prototype.destroy={},a.prototype.onChangeTabSize=a.prototype.$computeTabString,h.implement(a.prototype,f),n.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,d){var h=t("../lib/dom"),g=(function(){function m(c){this.element=h.createElement("div"),this.element.className="ace_layer ace_cursor-layer",c.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),h.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return m.prototype.$updateOpacity=function(c){for(var f=this.cursors,r=f.length;r--;)h.setStyle(f[r].style,"opacity",c?"":"0")},m.prototype.$startCssAnimation=function(){for(var c=this.cursors,f=c.length;f--;)c[f].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&h.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},m.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,h.removeCssClass(this.element,"ace_animate-blinking")},m.prototype.setPadding=function(c){this.$padding=c},m.prototype.setSession=function(c){this.session=c},m.prototype.setBlinking=function(c){c!=this.isBlinking&&(this.isBlinking=c,this.restartTimer())},m.prototype.setBlinkInterval=function(c){c!=this.blinkInterval&&(this.blinkInterval=c,this.restartTimer())},m.prototype.setSmoothBlinking=function(c){c!=this.smoothBlinking&&(this.smoothBlinking=c,h.setCssClass(this.element,"ace_smooth-blinking",c),this.$updateCursors(!0),this.restartTimer())},m.prototype.addCursor=function(){var c=h.createElement("div");return c.className="ace_cursor",this.element.appendChild(c),this.cursors.push(c),c},m.prototype.removeCursor=function(){if(this.cursors.length>1){var c=this.cursors.pop();return c.parentNode.removeChild(c),c}},m.prototype.hideCursor=function(){this.isVisible=!1,h.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.showCursor=function(){this.isVisible=!0,h.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.restartTimer=function(){var c=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,h.removeCssClass(this.element,"ace_smooth-blinking")),c(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&h.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),h.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var f=(function(){this.timeoutId=setTimeout(function(){c(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){c(!0),f()},this.blinkInterval),f()}},m.prototype.getPixelPosition=function(c,f){if(!this.config||!this.session)return{left:0,top:0};c||(c=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(c),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,c.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),a=(r.row-(f?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:a}},m.prototype.isCursorInView=function(c,f){return c.top>=0&&c.top<f.maxHeight},m.prototype.update=function(c){this.config=c;var f=this.session.$selectionMarkers,r=0,o=0;(f===void 0||f.length===0)&&(f=[{cursor:null}]);for(var r=0,a=f.length;r<a;r++){var s=this.getPixelPosition(f[r].cursor,!0);if(!((s.top>c.height+c.offset||s.top<0)&&r>1)){var i=this.cursors[o++]||this.addCursor(),u=i.style;this.drawCursor?this.drawCursor(i,s,c,f[r],this.session):this.isCursorInView(s,c)?(h.setStyle(u,"display","block"),h.translate(i,s.left,s.top),h.setStyle(u,"width",Math.round(c.characterWidth)+"px"),h.setStyle(u,"height",c.lineHeight+"px")):h.setStyle(u,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var p=this.session.getOverwrite();this.$setOverwrite(p),this.$pixelPos=s,this.restartTimer()},m.prototype.$setOverwrite=function(c){c!=this.overwrite&&(this.overwrite=c,c?h.addCssClass(this.element,"ace_overwrite-cursors"):h.removeCssClass(this.element,"ace_overwrite-cursors"))},m.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},m})();g.prototype.$padding=0,g.prototype.drawCursor=null,n.Cursor=g}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,d){var h=this&&this.__extends||(function(){var i=function(u,p){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var M in b)Object.prototype.hasOwnProperty.call(b,M)&&(y[M]=b[M])},i(u,p)};return function(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");i(u,p);function y(){this.constructor=u}u.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter,r=32768,o=(function(){function i(u,p){this.element=m.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+p,this.inner=m.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),u.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)}return i.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},i})();g.implement(o.prototype,f);var a=(function(i){h(u,i);function u(p,y){var b=i.call(this,p,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,y.$scrollbarWidth=b.width=m.scrollbarWidth(p.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return u.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var p=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-p)/(this.coeff-p)}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(p){this.element.style.height=p+"px"},u.prototype.setScrollHeight=function(p){this.scrollHeight=p,p>r?(this.coeff=r/p,p=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=p+"px"},u.prototype.setScrollTop=function(p){this.scrollTop!=p&&(this.skipEvent=!0,this.scrollTop=p,this.element.scrollTop=p*this.coeff)},u})(o);a.prototype.setInnerHeight=a.prototype.setScrollHeight;var s=(function(i){h(u,i);function u(p,y){var b=i.call(this,p,"-h")||this;return b.scrollLeft=0,b.height=y.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return u.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.setWidth=function(p){this.element.style.width=p+"px"},u.prototype.setInnerWidth=function(p){this.inner.style.width=p+"px"},u.prototype.setScrollWidth=function(p){this.inner.style.width=p+"px"},u.prototype.setScrollLeft=function(p){this.scrollLeft!=p&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=p)},u})(o);n.ScrollBar=a,n.ScrollBarV=a,n.ScrollBarH=s,n.VScrollBar=a,n.HScrollBar=s}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,d){var h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(p[b]=y[b])},s(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(i,u);function p(){this.constructor=i}i.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter;m.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
1372
1372
  position: absolute;
1373
1373
  background: rgba(128, 128, 128, 0.6);
1374
1374
  -moz-box-sizing: border-box;
@@ -1406,7 +1406,7 @@ export const FormManager: React.FC = () => {
1406
1406
  .ace_editor>.ace_sb_grabbed {
1407
1407
  z-index: 8;
1408
1408
  background: #000;
1409
- }`,"ace_scrollbar.css",!1);var r=(function(){function s(i,u){this.element=m.createElement("div"),this.element.className="ace_sb"+u,this.inner=m.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return s.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},s})();g.implement(r.prototype,d);var o=(function(s){h(i,s);function i(u,f){var y=s.call(this,u,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,y.parent=u,y.width=y.VScrollWidth,y.renderer=f,y.inner.style.width=y.element.style.width=(y.width||15)+"px",y.$minWidth=0,y}return i.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(c.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var y=this,b=f.clientY,M=function(_){b=_.clientY},$=function(){clearInterval(R)},A=f.clientY,S=this.thumbTop,E=function(){if(b!==void 0){var _=y.scrollTopFromThumbTop(S+b-A);_!==y.scrollTop&&y._emit("scroll",{data:_})}};c.capture(this.inner,M,$);var R=setInterval(E,20);return c.preventDefault(f)}var L=f.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),c.preventDefault(f)}},i.prototype.getHeight=function(){return this.height},i.prototype.scrollTopFromThumbTop=function(u){var f=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return f=f>>0,f<0?f=0:f>this.pageHeight-this.viewHeight&&(f=this.pageHeight-this.viewHeight),f},i.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},i.prototype.setHeight=function(u){this.height=Math.max(0,u),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},i.prototype.setScrollHeight=function(u,f){this.pageHeight===u&&!f||(this.pageHeight=u,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})))},i.prototype.setScrollTop=function(u){this.scrollTop=u,u<0&&(u=0),this.thumbTop=u*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},i})(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var a=(function(s){h(i,s);function i(u,f){var y=s.call(this,u,"-h")||this;return y.scrollLeft=0,y.scrollWidth=0,y.height=y.HScrollHeight,y.inner.style.height=y.element.style.height=(y.height||12)+"px",y.renderer=f,y}return i.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(c.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var y=this,b=f.clientX,M=function(_){b=_.clientX},$=function(){clearInterval(R)},A=f.clientX,S=this.thumbLeft,E=function(){if(b!==void 0){var _=y.scrollLeftFromThumbLeft(S+b-A);_!==y.scrollLeft&&y._emit("scroll",{data:_})}};c.capture(this.inner,M,$);var R=setInterval(E,20);return c.preventDefault(f)}var L=f.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),c.preventDefault(f)}},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.scrollLeftFromThumbLeft=function(u){var f=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return f=f>>0,f<0?f=0:f>this.pageWidth-this.viewWidth&&(f=this.pageWidth-this.viewWidth),f},i.prototype.setWidth=function(u){this.width=Math.max(0,u),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},i.prototype.setScrollWidth=function(u,f){this.pageWidth===u&&!f||(this.pageWidth=u,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})))},i.prototype.setScrollLeft=function(u){this.scrollLeft=u,u<0&&(u=0),this.thumbLeft=u*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},i})(r);a.prototype.setInnerWidth=a.prototype.setScrollWidth,n.ScrollBar=o,n.ScrollBarV=o,n.ScrollBarH=a,n.VScrollBar=o,n.HScrollBar=a}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,p){var h=t("./lib/event"),g=(function(){function m(c,d){this.onRender=c,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=d||window;var r=this;this._flush=function(o){r.pending=!1;var a=r.changes;if(a&&(h.blockIdle(100),r.changes=0,r.onRender(a)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return m.prototype.schedule=function(c){this.changes=this.changes|c,this.changes&&!this.pending&&(h.nextFrame(this._flush),this.pending=!0)},m.prototype.clear=function(c){var d=this.changes;return this.changes=0,d},m})();n.RenderLoop=g}),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(t,n,p){var h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("../lib/event"),d=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,o=512,a=typeof ResizeObserver=="function",s=200,i=(function(){function u(f){this.el=g.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=g.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=g.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),f.appendChild(this.el),this.$measureNode.textContent=m.stringRepeat("X",o),this.$characterSize={width:0,height:0},a?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(f,y){f.width=f.height="auto",f.left=f.top="0px",f.visibility="hidden",f.position="absolute",f.whiteSpace="pre",d.isIE<8?f["font-family"]="inherit":f.font="inherit",f.overflow=y?"hidden":"visible"},u.prototype.checkForSizeChanges=function(f){if(f===void 0&&(f=this.$measureSizes()),f&&(this.$characterSize.width!==f.width||this.$characterSize.height!==f.height)){this.$measureNode.style.fontWeight="bold";var y=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=f,this.charSizes=Object.create(null),this.allowBoldFonts=y&&y.width===f.width&&y.height===f.height,this._emit("changeCharacterSize",{data:f})}},u.prototype.$addObserver=function(){var f=this;this.$observer=new window.ResizeObserver(function(y){f.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var f=this;return this.$pollSizeChangesTimer=c.onIdle(function y(){f.checkForSizeChanges(),c.onIdle(y,500)},500)},u.prototype.setPolling=function(f){f?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(f){var y={height:(f||this.$measureNode).clientHeight,width:(f||this.$measureNode).clientWidth/o};return y.width===0||y.height===0?null:y},u.prototype.$measureCharWidth=function(f){this.$main.textContent=m.stringRepeat(f,o);var y=this.$main.getBoundingClientRect();return y.width/o},u.prototype.getCharacterWidth=function(f){var y=this.charSizes[f];return y===void 0&&(y=this.charSizes[f]=this.$measureCharWidth(f)/this.$characterSize.width),y},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(f){return!f||!f.parentElement?1:(Number(window.getComputedStyle(f).zoom)||1)*this.$getZoom(f.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var f=function(y,b){return["div",{style:"position: absolute;top:"+y+"px;left:"+b+"px;"}]};this.els=g.buildDom([f(0,0),f(s,0),f(0,s),f(s,s)],this.el)},u.prototype.transformCoordinates=function(f,y){if(f){var b=this.$getZoom(this.el);f=S(1/b,f)}function M(N,P,B){var F=N[1]*P[0]-N[0]*P[1];return[(-P[1]*B[0]+P[0]*B[1])/F,(+N[1]*B[0]-N[0]*B[1])/F]}function $(N,P){return[N[0]-P[0],N[1]-P[1]]}function A(N,P){return[N[0]+P[0],N[1]+P[1]]}function S(N,P){return[N*P[0],N*P[1]]}this.els||this.$initTransformMeasureNodes();function E(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=E(this.els[0]),L=E(this.els[1]),_=E(this.els[2]),D=E(this.els[3]),w=M($(D,L),$(D,_),$(A(L,_),A(D,R))),v=S(1+w[0],$(L,R)),C=S(1+w[1],$(_,R));if(y){var x=y,T=w[0]*x[0]/s+w[1]*x[1]/s+1,k=A(S(x[0],v),S(x[1],C));return A(S(1/T/s,k),R)}var O=$(f,R),I=M($(v,S(w[0],O)),$(C,S(w[1],O)),O);return S(s,I)},u})();i.prototype.$characterSize={width:0,height:0},h.implement(i.prototype,r),n.FontMetrics=i}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,p){p.exports=`
1409
+ }`,"ace_scrollbar.css",!1);var r=(function(){function s(i,u){this.element=m.createElement("div"),this.element.className="ace_sb"+u,this.inner=m.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return s.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},s})();g.implement(r.prototype,f);var o=(function(s){h(i,s);function i(u,p){var y=s.call(this,u,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,y.parent=u,y.width=y.VScrollWidth,y.renderer=p,y.inner.style.width=y.element.style.width=(y.width||15)+"px",y.$minWidth=0,y}return i.prototype.onMouseDown=function(u,p){if(u==="mousedown"&&!(c.getButton(p)!==0||p.detail===2)){if(p.target===this.inner){var y=this,b=p.clientY,M=function(T){b=T.clientY},x=function(){clearInterval(R)},A=p.clientY,S=this.thumbTop,$=function(){if(b!==void 0){var T=y.scrollTopFromThumbTop(S+b-A);T!==y.scrollTop&&y._emit("scroll",{data:T})}};c.capture(this.inner,M,x);var R=setInterval($,20);return c.preventDefault(p)}var L=p.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),c.preventDefault(p)}},i.prototype.getHeight=function(){return this.height},i.prototype.scrollTopFromThumbTop=function(u){var p=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return p=p>>0,p<0?p=0:p>this.pageHeight-this.viewHeight&&(p=this.pageHeight-this.viewHeight),p},i.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},i.prototype.setHeight=function(u){this.height=Math.max(0,u),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},i.prototype.setScrollHeight=function(u,p){this.pageHeight===u&&!p||(this.pageHeight=u,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})))},i.prototype.setScrollTop=function(u){this.scrollTop=u,u<0&&(u=0),this.thumbTop=u*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},i})(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var a=(function(s){h(i,s);function i(u,p){var y=s.call(this,u,"-h")||this;return y.scrollLeft=0,y.scrollWidth=0,y.height=y.HScrollHeight,y.inner.style.height=y.element.style.height=(y.height||12)+"px",y.renderer=p,y}return i.prototype.onMouseDown=function(u,p){if(u==="mousedown"&&!(c.getButton(p)!==0||p.detail===2)){if(p.target===this.inner){var y=this,b=p.clientX,M=function(T){b=T.clientX},x=function(){clearInterval(R)},A=p.clientX,S=this.thumbLeft,$=function(){if(b!==void 0){var T=y.scrollLeftFromThumbLeft(S+b-A);T!==y.scrollLeft&&y._emit("scroll",{data:T})}};c.capture(this.inner,M,x);var R=setInterval($,20);return c.preventDefault(p)}var L=p.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),c.preventDefault(p)}},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.scrollLeftFromThumbLeft=function(u){var p=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return p=p>>0,p<0?p=0:p>this.pageWidth-this.viewWidth&&(p=this.pageWidth-this.viewWidth),p},i.prototype.setWidth=function(u){this.width=Math.max(0,u),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},i.prototype.setScrollWidth=function(u,p){this.pageWidth===u&&!p||(this.pageWidth=u,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})))},i.prototype.setScrollLeft=function(u){this.scrollLeft=u,u<0&&(u=0),this.thumbLeft=u*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},i})(r);a.prototype.setInnerWidth=a.prototype.setScrollWidth,n.ScrollBar=o,n.ScrollBarV=o,n.ScrollBarH=a,n.VScrollBar=o,n.HScrollBar=a}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,d){var h=t("./lib/event"),g=(function(){function m(c,f){this.onRender=c,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=f||window;var r=this;this._flush=function(o){r.pending=!1;var a=r.changes;if(a&&(h.blockIdle(100),r.changes=0,r.onRender(a)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return m.prototype.schedule=function(c){this.changes=this.changes|c,this.changes&&!this.pending&&(h.nextFrame(this._flush),this.pending=!0)},m.prototype.clear=function(c){var f=this.changes;return this.changes=0,f},m})();n.RenderLoop=g}),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(t,n,d){var h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("../lib/event"),f=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,o=512,a=typeof ResizeObserver=="function",s=200,i=(function(){function u(p){this.el=g.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=g.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=g.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),p.appendChild(this.el),this.$measureNode.textContent=m.stringRepeat("X",o),this.$characterSize={width:0,height:0},a?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(p,y){p.width=p.height="auto",p.left=p.top="0px",p.visibility="hidden",p.position="absolute",p.whiteSpace="pre",f.isIE<8?p["font-family"]="inherit":p.font="inherit",p.overflow=y?"hidden":"visible"},u.prototype.checkForSizeChanges=function(p){if(p===void 0&&(p=this.$measureSizes()),p&&(this.$characterSize.width!==p.width||this.$characterSize.height!==p.height)){this.$measureNode.style.fontWeight="bold";var y=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=p,this.charSizes=Object.create(null),this.allowBoldFonts=y&&y.width===p.width&&y.height===p.height,this._emit("changeCharacterSize",{data:p})}},u.prototype.$addObserver=function(){var p=this;this.$observer=new window.ResizeObserver(function(y){p.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var p=this;return this.$pollSizeChangesTimer=c.onIdle(function y(){p.checkForSizeChanges(),c.onIdle(y,500)},500)},u.prototype.setPolling=function(p){p?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(p){var y={height:(p||this.$measureNode).clientHeight,width:(p||this.$measureNode).clientWidth/o};return y.width===0||y.height===0?null:y},u.prototype.$measureCharWidth=function(p){this.$main.textContent=m.stringRepeat(p,o);var y=this.$main.getBoundingClientRect();return y.width/o},u.prototype.getCharacterWidth=function(p){var y=this.charSizes[p];return y===void 0&&(y=this.charSizes[p]=this.$measureCharWidth(p)/this.$characterSize.width),y},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(p){return!p||!p.parentElement?1:(Number(window.getComputedStyle(p).zoom)||1)*this.$getZoom(p.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var p=function(y,b){return["div",{style:"position: absolute;top:"+y+"px;left:"+b+"px;"}]};this.els=g.buildDom([p(0,0),p(s,0),p(0,s),p(s,s)],this.el)},u.prototype.transformCoordinates=function(p,y){if(p){var b=this.$getZoom(this.el);p=S(1/b,p)}function M(N,P,B){var F=N[1]*P[0]-N[0]*P[1];return[(-P[1]*B[0]+P[0]*B[1])/F,(+N[1]*B[0]-N[0]*B[1])/F]}function x(N,P){return[N[0]-P[0],N[1]-P[1]]}function A(N,P){return[N[0]+P[0],N[1]+P[1]]}function S(N,P){return[N*P[0],N*P[1]]}this.els||this.$initTransformMeasureNodes();function $(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=$(this.els[0]),L=$(this.els[1]),T=$(this.els[2]),D=$(this.els[3]),w=M(x(D,L),x(D,T),x(A(L,T),A(D,R))),v=S(1+w[0],x(L,R)),C=S(1+w[1],x(T,R));if(y){var E=y,_=w[0]*E[0]/s+w[1]*E[1]/s+1,k=A(S(E[0],v),S(E[1],C));return A(S(1/_/s,k),R)}var O=x(p,R),I=M(x(v,S(w[0],O)),x(C,S(w[1],O)),O);return S(s,I)},u})();i.prototype.$characterSize={width:0,height:0},h.implement(i.prototype,r),n.FontMetrics=i}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,d){d.exports=`
1410
1410
  .ace_br1 {border-top-left-radius : 3px;}
1411
1411
  .ace_br2 {border-top-right-radius : 3px;}
1412
1412
  .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
@@ -2095,9 +2095,9 @@ export const FormManager: React.FC = () => {
2095
2095
 
2096
2096
  .ace_hidden_token {
2097
2097
  display: none;
2098
- }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,c=(function(){function d(r,o){this.canvas=h.createElement("canvas"),this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return d.prototype.$updateDecorators=function(r){var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var a=(r.lastRow+1)*this.lineHeight;a<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var s=this.canvas.getContext("2d");function i(D,w){return D.priority<w.priority?-1:D.priority>w.priority?1:0}var u=this.renderer.session.$annotations;if(s.clearRect(0,0,this.canvas.width,this.canvas.height),u){var f={info:1,warning:2,error:3};u.forEach(function(D){D.priority=f[D.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,b=0;b<u.length;b++){var M=u[b].row,$=this.compensateFoldRows(M,y),A=Math.round((M-$)*this.lineHeight*this.heightRatio),S=Math.round((M-$)*this.lineHeight*this.heightRatio),E=Math.round(((M-$)*this.lineHeight+this.lineHeight)*this.heightRatio),R=E-S;if(R<this.minDecorationHeight){var L=(S+E)/2|0;L<this.halfMinDecorationHeight?L=this.halfMinDecorationHeight:L+this.halfMinDecorationHeight>this.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),S=Math.round(L-this.halfMinDecorationHeight),E=Math.round(L+this.halfMinDecorationHeight)}s.fillStyle=o[u[b].type]||null,s.fillRect(0,A,this.canvasWidth,E-S)}}var _=this.renderer.session.selection.getCursor();if(_){var $=this.compensateFoldRows(_.row,y),A=Math.round((_.row-$)*this.lineHeight*this.heightRatio);s.fillStyle="rgba(0, 0, 0, 0.5)",s.fillRect(0,A,this.canvasWidth,2)}},d.prototype.compensateFoldRows=function(r,o){var a=0;if(o&&o.length>0)for(var s=0;s<o.length;s++)r>o[s].start.row&&r<o[s].end.row?a+=r-o[s].start.row:r>=o[s].end.row&&(a+=o[s].end.row-o[s].start.row);return a},d})();g.implement(c.prototype,m),n.Decorator=c}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),c=t("./config"),d=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,o=t("./layer/text").Text,a=t("./layer/cursor").Cursor,s=t("./scrollbar").HScrollBar,i=t("./scrollbar").VScrollBar,u=t("./scrollbar_custom").HScrollBar,f=t("./scrollbar_custom").VScrollBar,y=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,M=t("./lib/event_emitter").EventEmitter,$=t("./css/editor-css"),A=t("./layer/decorators").Decorator,S=t("./lib/useragent"),E=t("./layer/text_util").isTextToken;g.importCssString($,"ace_editor.css",!1);var R=(function(){function L(_,D){var w=this;this.container=_||g.createElement("div"),g.addCssClass(this.container,"ace_editor"),g.HI_DPI&&g.addCssClass(this.container,"ace_hidpi"),this.setTheme(D),c.get("useStrictCSP")==null&&c.set("useStrictCSP",!1),this.$gutter=g.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=g.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=g.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new d(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var v=this.$textLayer=new o(this.content);this.canvas=v.element,this.$markerFront=new r(this.content),this.$cursorLayer=new a(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new i(this.container,this),this.scrollBarH=new s(this.container,this),this.scrollBarV.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollTop(C.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollLeft(C.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!S.isIOS,this.$loop=new y(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),c.resetOptions(this),c._signal("renderer",this)}return L.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(),g.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},L.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(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))},L.prototype.updateLines=function(_,D,w){if(D===void 0&&(D=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<D&&(this.$changedLines.lastRow=D)):this.$changedLines={firstRow:_,lastRow:D},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},L.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},L.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},L.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},L.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},L.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},L.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},L.prototype.onResize=function(_,D,w,v){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;v||(v=C.clientHeight||C.scrollHeight),!v&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",v=C.clientHeight||C.scrollHeight),w||(w=C.clientWidth||C.scrollWidth);var x=this.$updateCachedSize(_,D,w,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!v)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(x|this.$changes,!0):this.$loop.schedule(x|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(_,D,w,v){v-=this.$extraHeight||0;var C=0,x=this.$size,T={width:x.width,height:x.height,scrollerHeight:x.scrollerHeight,scrollerWidth:x.scrollerWidth};if(v&&(_||x.height!=v)&&(x.height=v,C|=this.CHANGE_SIZE,x.scrollerHeight=x.height,this.$horizScroll&&(x.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(x.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),w&&(_||x.width!=w)){C|=this.CHANGE_SIZE,x.width=w,D==null&&(D=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=D,g.setStyle(this.scrollBarH.element.style,"left",D+"px"),g.setStyle(this.scroller.style,"left",D+this.margin.left+"px"),x.scrollerWidth=Math.max(0,w-D-this.scrollBarV.getWidth()-this.margin.h),g.setStyle(this.$gutter.style,"left",this.margin.left+"px");var k=this.scrollBarV.getWidth()+"px";g.setStyle(this.scrollBarH.element.style,"right",k),g.setStyle(this.scroller.style,"right",k),g.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(x.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return x.$dirty=!w||!v,C&&this._signal("resize",T),C},L.prototype.onGutterResize=function(_){var D=this.$showGutter?_:0;D!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,D,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},L.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,D=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(D,this.$showPrintMargin&&this.$printMarginColumn)},L.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},L.prototype.getAnimatedScroll=function(){return this.$animatedScroll},L.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},L.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},L.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},L.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},L.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},L.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},L.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},L.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},L.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},L.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},L.prototype.getShowGutter=function(){return this.getOption("showGutter")},L.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},L.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},L.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},L.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},L.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},L.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=g.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=g.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var D=this.$printMarginEl.style;D.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",D.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},L.prototype.getContainerElement=function(){return this.container},L.prototype.getMouseEventTarget=function(){return this.scroller},L.prototype.getTextAreaContainer=function(){return this.container},L.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,D=this.$composition;if(!this.$keepTextAreaAtCursor&&!D){g.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){D&&D.markerRange&&(w=this.$cursorLayer.getPixelPosition(D.markerRange.start,!0));var v=this.layerConfig,C=w.top,x=w.left;C-=v.offset;var T=D&&D.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-T){g.translate(this.textarea,0,0);return}var k=1,O=this.$size.height-T;if(!D)C+=this.lineHeight;else if(D.useTextareaForIME){var I=this.textarea.value;k=this.characterWidth*this.session.$getStringScreenWidth(I)[0]}else C+=this.lineHeight+2;x-=this.scrollLeft,x>this.$size.scrollerWidth-k&&(x=this.$size.scrollerWidth-k),x+=this.gutterWidth+this.margin.left,g.setStyle(_,"height",T+"px"),g.setStyle(_,"width",k+"px"),g.translate(this.textarea,Math.min(x,this.$size.scrollerWidth-k),Math.min(C,O))}}},L.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},L.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},L.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,D=_.lastRow,w=this.session.documentToScreenRow(D,0)*_.lineHeight;return w-this.session.getScrollTop()>_.height-_.lineHeight?D-1:D},L.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},L.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},L.prototype.setScrollMargin=function(_,D,w,v){var C=this.scrollMargin;C.top=_|0,C.bottom=D|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},L.prototype.setMargin=function(_,D,w,v){var C=this.margin;C.top=_|0,C.bottom=D|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},L.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},L.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},L.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},L.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},L.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,D=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(D-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-D&&(_=this.scrollTop+D,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},L.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},L.prototype.freeze=function(){this.$frozen=!0},L.prototype.unfreeze=function(){this.$frozen=!1},L.prototype.$renderChanges=function(_,D){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!D){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var v=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;v>0&&(this.scrollTop=v,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-w.offset);var C=w.width+2*this.$padding+"px",x=w.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",x)}if(_&this.CHANGE_H_SCROLL&&(g.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",_)},L.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,D=this.$maxLines*this.lineHeight,w=Math.min(D,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var v=w<=2*this.lineHeight,C=!v&&_>D;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var x=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,x,w),this.desiredHeight=w,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var _=this.session,D=this.$size,w=D.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,x=this.$getLongestLine(),T=!w&&(this.$hScrollBarAlwaysVisible||D.scrollerWidth-x-2*this.$padding<0),k=this.$horizScroll!==T;k&&(this.$horizScroll=T,this.scrollBarH.setVisible(T));var O=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var I=D.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(D.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-D.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,x+2*this.$padding-D.scrollerWidth+P.right)));var B=!w&&(this.$vScrollBarAlwaysVisible||D.scrollerHeight-C+N<0||this.scrollTop>P.top),F=O!==B;F&&(this.$vScroll=B,this.scrollBarV.setVisible(B));var H=this.scrollTop%this.lineHeight,z=Math.ceil(I/this.lineHeight)-1,W=Math.max(0,Math.round((this.scrollTop-H)/this.lineHeight)),U=W+z,K,Y,G=this.lineHeight;W=_.screenToDocumentRow(W,0);var Q=_.getFoldLine(W);Q&&(W=Q.start.row),K=_.documentToScreenRow(W,0),Y=_.getRowLength(W)*G,U=Math.min(_.screenToDocumentRow(U,0),_.getLength()-1),I=D.scrollerHeight+_.getRowLength(U)*G+Y,H=this.scrollTop-K*G;var ue=0;return(this.layerConfig.width!=x||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,D.width,D.height),this._signal("scrollbarVisibilityChanged"),F&&(x=this.$getLongestLine())),this.layerConfig={width:x,padding:this.$padding,firstRow:W,firstRowScreen:K,lastRow:U,lineHeight:G,characterWidth:this.characterWidth,minHeight:I,maxHeight:C,offset:H,gutterOffset:G?Math.max(0,Math.ceil((H+D.height-D.scrollerHeight)/G)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(x-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,D=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(_>w.lastRow+1)&&!(D<w.firstRow)){if(D===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,_,D),!0}}},L.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},L.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},L.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},L.prototype.addGutterDecoration=function(_,D){this.$gutterLayer.addGutterDecoration(_,D)},L.prototype.removeGutterDecoration=function(_,D){this.$gutterLayer.removeGutterDecoration(_,D)},L.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},L.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},L.prototype.showCursor=function(){this.$cursorLayer.showCursor()},L.prototype.scrollSelectionIntoView=function(_,D,w){this.scrollCursorIntoView(_,w),this.scrollCursorIntoView(D,w)},L.prototype.scrollCursorIntoView=function(_,D,w){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(_),C=v.left,x=v.top,T=w&&w.top||0,k=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var O=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;O+T>x?(D&&O+T>x+this.lineHeight&&(x-=D*this.$size.scrollerHeight),x===0&&(x=-this.scrollMargin.top),this.session.setScrollTop(x)):O+this.$size.scrollerHeight-k<x+this.lineHeight&&(D&&O+this.$size.scrollerHeight-k<x-this.lineHeight&&(x+=D*this.$size.scrollerHeight),this.session.setScrollTop(x+this.lineHeight+k-this.$size.scrollerHeight));var I=this.scrollLeft,N=2*this.layerConfig.characterWidth;C-N<I?(C-=N,C<this.$padding+N&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=N,I+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):I<=this.$padding&&C-I<this.characterWidth&&this.session.setScrollLeft(0))}},L.prototype.getScrollTop=function(){return this.session.getScrollTop()},L.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},L.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},L.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},L.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},L.prototype.alignCursor=function(_,D){typeof _=="number"&&(_={row:_,column:0});var w=this.$cursorLayer.getPixelPosition(_),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(D||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(_,D){var w=0,v=this.STEPS,C=[],x=function(T,k,O){return O*(Math.pow(T-1,3)+1)+k};for(w=0;w<v;++w)C.push(x(w/this.STEPS,_,D-_));return C},L.prototype.scrollToLine=function(_,D,w,v){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),x=C.top;D&&(x-=this.$size.scrollerHeight/2);var T=this.scrollTop;this.session.setScrollTop(x),w!==!1&&this.animateScrolling(T,v)},L.prototype.animateScrolling=function(_,D){var w=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(_==w)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==w))return}var x=v.$calcSteps(_,w);this.$scrollAnimation={from:_,to:w,steps:x},clearInterval(this.$timer),v.session.setScrollTop(x.shift()),v.session.$scrollTop=w;function T(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,D&&D()}this.$timer=setInterval(function(){if(v.$stopAnimation){T();return}if(!v.session)return clearInterval(v.$timer);x.length?(v.session.setScrollTop(x.shift()),v.session.$scrollTop=w):w!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(w),w=null):T()},10)},L.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},L.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},L.prototype.scrollTo=function(_,D){this.session.setScrollTop(D),this.session.setScrollLeft(_)},L.prototype.scrollBy=function(_,D){D&&this.session.setScrollTop(this.session.getScrollTop()+D),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},L.prototype.isScrollableBy=function(_,D){if(D<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||D>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},L.prototype.pixelToScreenCoordinates=function(_,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,x=C/this.characterWidth,T=Math.floor((D+this.scrollTop-w.top)/this.lineHeight),k=this.$blockCursor?Math.floor(x):Math.round(x);return{row:T,column:k,side:x-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(_,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,x=C/this.characterWidth,T=this.$blockCursor?Math.floor(x):Math.round(x),k=Math.floor((D+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(T,0),C)},L.prototype.textToScreenCoordinates=function(_,D){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(_,D),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,_)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),x=v.row*this.lineHeight;return{pageX:w.left+C-this.scrollLeft,pageY:w.top+x-this.scrollTop}},L.prototype.visualizeFocus=function(){g.addCssClass(this.container,"ace_focus")},L.prototype.visualizeBlur=function(){g.removeCssClass(this.container,"ace_focus")},L.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(g.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},L.prototype.setCompositionText=function(_){var D=this.session.selection.cursor;this.addToken(_,"composition_placeholder",D.row,D.column),this.$moveTextAreaToCursor()},L.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),g.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},L.prototype.setGhostText=function(_,D){var w=this.session.selection.cursor,v=D||{row:w.row,column:w.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,v);this.addToken(C[0].text,"ghost_text",v.row,v.column),this.$ghostText={text:_,position:{row:v.row,column:v.column}};var x=g.createElement("div");if(C.length>1){var T=this.hideTokensAfterPosition(v.row,v.column),k;C.slice(1).forEach(function(F){var H=g.createElement("div"),z=g.createElement("span");z.className="ace_ghost_text",F.wrapped&&(H.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),z.appendChild(g.createTextNode(F.text)),H.appendChild(z),x.appendChild(H),k=H}),T.forEach(function(F){var H=g.createElement("span");E(F.type)||(H.className="ace_"+F.type.replace(/\./g," ace_")),H.appendChild(g.createTextNode(F.value)),k.appendChild(H)}),this.$ghostTextWidget={el:x,row:v.row,column:v.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var O=this.$cursorLayer.getPixelPosition(v,!0),I=this.container,N=I.getBoundingClientRect().height,P=C.length*this.lineHeight,B=P<N-O.top;if(B)return;P<N?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(v.row)}},L.prototype.$calculateWrappedTextChunks=function(_,D){var w=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(w/this.characterWidth)-2;v=v<=0?60:v;for(var C=_.split(/\r?\n/),x=[],T=0;T<C.length;T++){var k=this.session.$getDisplayTokens(C[T],D.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var I=0;O.push(C[T].length);for(var N=0;N<O.length;N++){var P=C[T].slice(I,O[N]);x.push({text:P,wrapped:!0}),I=O[N]}}else x.push({text:C[T],wrapped:!1})}return x},L.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},L.prototype.addToken=function(_,D,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var x={type:D,value:_},T=C.getTokens(w);if(v==null||!T.length)T.push(x);else for(var k=0,O=0;O<T.length;O++){var I=T[O];if(k+=I.value.length,v<=k){var N=I.value.length-(k-v),P=I.value.slice(0,N),B=I.value.slice(N);T.splice(O,1,{type:I.type,value:P},x,{type:I.type,value:B});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(_,D){for(var w=this.session.getTokens(_),v=0,C=!1,x=[],T=0;T<w.length;T++){var k=w[T];if(v+=k.value.length,k.type!=="ghost_text"){if(C){x.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===D&&(C=!0)}}return this.updateLines(_,_),x},L.prototype.removeExtraToken=function(_,D){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},L.prototype.setTheme=function(_,D){var w=this;if(this.$themeId=_,w._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var v=_||this.$options.theme.initialValue;c.loadModule(["theme",v],C)}else C(_);function C(x){if(w.$themeId!=_)return D&&D();if(!x||!x.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");x.$id&&(w.$themeId=x.$id),g.importCssString(x.cssText,x.cssClass,w.container),w.theme&&g.removeCssClass(w.container,w.theme.cssClass);var T="padding"in x?x.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&T!=w.$padding&&w.setPadding(T),w.$theme=x.cssClass,w.theme=x,g.addCssClass(w.container,x.cssClass),g.setCssClass(w.container,"ace_dark",x.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:x}),D&&D(),S.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(_,D){g.setCssClass(this.container,_,D!==!1)},L.prototype.unsetStyle=function(_){g.removeCssClass(this.container,_)},L.prototype.setCursorStyle=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.setMouseCursor=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.attachToShadowRoot=function(){g.importCssString($,"ace_editor.css",this.container)},L.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},L.prototype.$updateCustomScrollbar=function(_){var D=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,_===!0?(this.scrollBarV=new f(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.scrollMargin.left)}),this.$scrollDecorator=new A(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new i(this.container,this),this.scrollBarH=new s(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.scrollMargin.left)}))},L.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=m.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(D){var w=D[0].contentRect.width,v=D[0].contentRect.height;Math.abs(_.$size.width-w)>1||Math.abs(_.$size.height-v)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},L})();R.prototype.CHANGE_CURSOR=1,R.prototype.CHANGE_MARKER=2,R.prototype.CHANGE_GUTTER=4,R.prototype.CHANGE_SCROLL=8,R.prototype.CHANGE_LINES=16,R.prototype.CHANGE_TEXT=32,R.prototype.CHANGE_SIZE=64,R.prototype.CHANGE_MARKER_BACK=128,R.prototype.CHANGE_MARKER_FRONT=256,R.prototype.CHANGE_FULL=512,R.prototype.CHANGE_H_SCROLL=1024,R.prototype.$changes=0,R.prototype.$padding=null,R.prototype.$frozen=!1,R.prototype.STEPS=8,h.implement(R.prototype,M),c.defineOptions(R.prototype,"renderer",{useResizeObserver:{set:function(L){!L&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):L&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(L){this.$textLayer.setShowInvisibles(L)&&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(L){typeof L=="number"&&(this.$printMarginColumn=L),this.$showPrintMargin=!!L,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(L){this.$gutter.style.display=L?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(L){this.$gutterLayer.$useSvgGutterIcons=L},initialValue:!1},showFoldedAnnotations:{set:function(L){this.$gutterLayer.$showFoldedAnnotations=L},initialValue:!1},fadeFoldWidgets:{set:function(L){g.setCssClass(this.$gutter,"ace_fade-fold-widgets",L)},initialValue:!1},showFoldWidgets:{set:function(L){this.$gutterLayer.setShowFoldWidgets(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(L){this.$textLayer.setDisplayIndentGuides(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(L){this.$textLayer.setHighlightIndentGuides(L)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(L){this.$gutterLayer.setHighlightGutterLine(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(L){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(L){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(L){typeof L=="number"&&(L=L+"px"),this.container.style.fontSize=L,this.updateFontSize()},initialValue:12},fontFamily:{set:function(L){this.container.style.fontFamily=L,this.updateFontSize()}},maxLines:{set:function(L){this.updateFull()}},minLines:{set:function(L){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(L){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(L){L=+L||0,this.$scrollPastEnd!=L&&(this.$scrollPastEnd=L,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(L){this.$gutterLayer.$fixedWidth=!!L,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(L){this.$updateCustomScrollbar(L)},initialValue:!1},theme:{set:function(L){this.setTheme(L)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!S.isMobile&&!S.isIE}}),n.VirtualRenderer=R}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,p){var h=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,c=t("../config");function d(s){var i="importScripts('"+g.qualifyURL(s)+"');";try{return new Blob([i],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,f=new u;return f.append(i),f.getBlob("application/javascript")}}function r(s){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(c.get("loadWorkerFromBlob")){var i=d(s),u=window.URL||window.webkitURL,f=u.createObjectURL(i);return new Worker(f)}return new Worker(s)}var o=function(s){s.postMessage||(s=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=s,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(){h.implement(this,m),this.$createWorkerFromOldConfig=function(s,i,u,f,y){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),c.get("packaged")||!t.toUrl)f=f||c.moduleUrl(i,"worker");else{var b=this.$normalizePath;f=f||b(t.toUrl("ace/worker/worker.js",null,"_"));var M={};s.forEach(function($){M[$]=b(t.toUrl($,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(f),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:M,module:i,classname:u}),this.$worker},this.onMessage=function(s){var i=s.data;switch(i.type){case"event":this._signal(i.name,{data:i.data});break;case"call":var u=this.callbacks[i.id];u&&(u(i.data),delete this.callbacks[i.id]);break;case"error":this.reportError(i.data);break;case"log":window.console&&console.log&&console.log.apply(console,i.data);break}},this.reportError=function(s){window.console&&console.error&&console.error(s)},this.$normalizePath=function(s){return g.qualifyURL(s)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(s){s.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(s,i){this.$worker.postMessage({command:s,args:i})},this.call=function(s,i,u){if(u){var f=this.callbackId++;this.callbacks[f]=u,i.push(f)}this.send(s,i)},this.emit=function(s,i){try{i.data&&i.data.err&&(i.data.err={message:i.data.err.message,stack:i.data.err.stack,code:i.data.err.code}),this.$worker&&this.$worker.postMessage({event:s,data:{data:i.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(s){this.$doc&&this.terminate(),this.$doc=s,this.call("setValue",[s.getValue()]),s.on("change",this.changeListener,!0)},this.changeListener=function(s){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),s.action=="insert"?this.deltaQueue.push(s.start,s.lines):this.deltaQueue.push(s.start,s.end)},this.$sendDeltaQueue=function(){var s=this.deltaQueue;s&&(this.deltaQueue=null,s.length>50&&s.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:s}))}}).call(o.prototype);var a=function(s,i,u){var f=null,y=!1,b=Object.create(m),M=[],$=new o({messageBuffer:M,terminate:function(){},postMessage:function(S){M.push(S),f&&(y?setTimeout(A):A())}});$.setEmitSync=function(S){y=S};var A=function(){var S=M.shift();S.command?f[S.command].apply(f,S.args):S.event&&b._signal(S.event,S.data)};return b.postMessage=function(S){$.onMessage({data:S})},b.callback=function(S,E){this.postMessage({type:"call",id:E,data:S})},b.emit=function(S,E){this.postMessage({type:"event",name:S,data:E})},c.loadModule(["worker",i],function(S){for(f=new S[u](b);M.length;)A()}),$};n.UIWorkerClient=a,n.WorkerClient=o,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,p){var h=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),c=(function(){function d(r,o,a,s,i,u){var f=this;this.length=o,this.session=r,this.doc=r.getDocument(),this.mainClass=i,this.othersClass=u,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=s,this.$onCursorChange=function(){setTimeout(function(){f.onCursorChange()})},this.$pos=a;var y=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=y.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return d.prototype.setup=function(){var r=this,o=this.doc,a=this.session;this.selectionBefore=a.selection.toJSON(),a.selection.inMultiSelectMode&&a.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=a.addMarker(new h(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var u=o.createAnchor(i.row,i.column);u.$insertRight=!0,u.detach(),r.others.push(u)}),a.setUndoSelect(!1)},d.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,o=this;this.othersActive=!0,this.others.forEach(function(a){a.markerId=r.addMarker(new h(a.row,a.column,a.row,a.column+o.length),o.othersClass,null,!1)})}},d.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},d.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var o=r;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var a=r.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,s=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,i=o.start.column-this.pos.column;if(this.updateAnchors(r),s&&(this.length+=a),s&&!this.session.$fromUndo){if(r.action==="insert")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],y={row:f.row,column:f.column+i};this.doc.insertMergedLines(y,r.lines)}else if(r.action==="remove")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],y={row:f.row,column:f.column+i};this.doc.remove(new h(y.row,y.column,y.row,y.column-a))}}this.$updating=!1,this.updateMarkers()}},d.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},d.prototype.updateMarkers=function(){if(!this.$updating){var r=this,o=this.session,a=function(i,u){o.removeMarker(i.markerId),i.markerId=o.addMarker(new h(i.row,i.column,i.row,i.column+r.length),u,null,!1)};a(this.pos,this.mainClass);for(var s=this.others.length;s--;)a(this.others[s],this.othersClass)}},d.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},d.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},d.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),o=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,a=0;a<o;a++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},d})();m.implement(c.prototype,g),n.PlaceHolder=c}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var h=t("../lib/event"),g=t("../lib/useragent");function m(d,r){return d.row==r.row&&d.column==r.column}function c(d){var r=d.domEvent,o=r.altKey,a=r.shiftKey,s=r.ctrlKey,i=d.getAccelKey(),u=d.getButton();if(s&&g.isMac&&(u=r.button),d.editor.inMultiSelectMode&&u==2){d.editor.textInput.onContextMenu(d.domEvent);return}if(!s&&!o&&!i){u===0&&d.editor.inMultiSelectMode&&d.editor.exitMultiSelectMode();return}if(u===0){var f=d.editor,y=f.selection,b=f.inMultiSelectMode,M=d.getDocumentPosition(),$=y.getCursor(),A=d.inSelection()||y.isEmpty()&&m(M,$),S=d.x,E=d.y,R=function(P){S=P.clientX,E=P.clientY},L=f.session,_=f.renderer.pixelToScreenCoordinates(S,E),D=_,w;if(f.$mouseHandler.$enableJumpToDef)s&&o||i&&o?w=a?"block":"add":o&&f.$blockSelectEnabled&&(w="block");else if(i&&!o){if(w="add",!b&&a)return}else o&&f.$blockSelectEnabled&&(w="block");if(w&&g.isMac&&r.ctrlKey&&f.$mouseHandler.cancelContextMenu(),w=="add"){if(!b&&A)return;if(!b){var v=y.toOrientedRange();f.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(M);f.inVirtualSelectionMode=!0,a&&(C=null,v=y.ranges[0]||v,f.removeSelectionMarker(v)),f.once("mouseup",function(){var P=y.toOrientedRange();C&&P.isEmpty()&&m(C.cursor,P.cursor)?y.substractPoint(P.cursor):(a?y.substractPoint(v.cursor):v&&(f.removeSelectionMarker(v),y.addRange(v)),y.addRange(P)),f.inVirtualSelectionMode=!1})}else if(w=="block"){d.stop(),f.inVirtualSelectionMode=!0;var x,T=[],k=function(){var P=f.renderer.pixelToScreenCoordinates(S,E),B=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(D,P)&&m(B,y.lead)||(D=P,f.selection.moveToPosition(B),f.renderer.scrollCursorIntoView(),f.removeSelectionMarkers(T),T=y.rectangularRangeBlock(D,_),f.$mouseHandler.$clickSelection&&T.length==1&&T[0].isEmpty()&&(T[0]=f.$mouseHandler.$clickSelection.clone()),T.forEach(f.addSelectionMarker,f),f.updateSelectionMarkers())};b&&!i?y.toSingleRange():!b&&i&&(x=y.toOrientedRange(),f.addSelectionMarker(x)),a?_=L.documentToScreenPosition(y.lead):y.moveToPosition(M),D={row:-1,column:-1};var O=function(P){k(),clearInterval(N),f.removeSelectionMarkers(T),T.length||(T=[y.toOrientedRange()]),x&&(f.removeSelectionMarker(x),y.toSingleRange(x));for(var B=0;B<T.length;B++)y.addRange(T[B]);f.inVirtualSelectionMode=!1,f.$mouseHandler.$clickSelection=null},I=k;h.capture(f.container,R,O);var N=setInterval(function(){I()},20);return d.preventDefault()}}}n.onMouseDown=c}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,p){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(g){g.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(g){g.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(g){g.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(g){g.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(g){g.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(g){g.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(g){g.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(g){g.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(g){g.multiSelect.rangeCount>1?g.multiSelect.joinSelections():g.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(g){g.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(g){g.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(g){g.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(g){g.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(g){return g&&g.inMultiSelectMode}}];var h=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new h(n.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(t,n,p){var h=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,c=t("./mouse/multi_select_handler").onMouseDown,d=t("./lib/event"),r=t("./lib/lang"),o=t("./commands/multi_select_commands");n.commands=o.defaultCommands.concat(o.multiSelectCommands);var a=t("./search").Search,s=new a;function i($,A,S){return s.$options.wrap=!0,s.$options.needle=A,s.$options.backwards=S==-1,s.find($)}var u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function($,A){if($){if(!this.inMultiSelectMode&&this.rangeCount===0){var S=this.toOrientedRange();if(this.rangeList.add(S),this.rangeList.add($),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),A||this.fromOrientedRange($);this.rangeList.removeAll(),this.rangeList.add(S),this.$onAddRange(S)}$.cursor||($.cursor=$.end);var E=this.rangeList.add($);return this.$onAddRange($),E.length&&this.$onRemoveRange(E),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),A||this.fromOrientedRange($)}},this.toSingleRange=function($){$=$||this.ranges[0];var A=this.rangeList.removeAll();A.length&&this.$onRemoveRange(A),$&&this.fromOrientedRange($)},this.substractPoint=function($){var A=this.rangeList.substractPoint($);if(A)return this.$onRemoveRange(A),A[0]},this.mergeOverlappingRanges=function(){var $=this.rangeList.merge();$.length&&this.$onRemoveRange($)},this.$onAddRange=function($){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift($),this._signal("addRange",{range:$})},this.$onRemoveRange=function($){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var A=this.rangeList.ranges.pop();$.push(A),this.rangeCount=0}for(var S=$.length;S--;){var E=this.ranges.indexOf($[S]);this.ranges.splice(E,1)}this._signal("removeRange",{ranges:$}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),A=A||this.ranges[0],A&&!A.isEqual(this.getRange())&&this.fromOrientedRange(A)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new h,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var $=this.ranges.length?this.ranges:[this.getRange()],A=[],S=0;S<$.length;S++){var E=$[S],R=E.start.row,L=E.end.row;if(R===L)A.push(E.clone());else{for(A.push(new g(R,E.start.column,R,this.session.getLine(R).length));++R<L;)A.push(this.getLineRange(R,!0));A.push(new g(L,0,L,E.end.column))}S==0&&!this.isBackwards()&&(A=A.reverse())}this.toSingleRange();for(var S=A.length;S--;)this.addRange(A[S])},this.joinSelections=function(){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)}else{var E=this.session.documentToScreenPosition(this.cursor),R=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock(E,R);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function($,A,S){var E=[],R=$.column<A.column;if(R)var L=$.column,_=A.column,D=$.offsetX,w=A.offsetX;else var L=A.column,_=$.column,D=A.offsetX,w=$.offsetX;var v=$.row<A.row;if(v)var C=$.row,x=A.row;else var C=A.row,x=$.row;L<0&&(L=0),C<0&&(C=0),C==x&&(S=!0);for(var T,k=C;k<=x;k++){var O=g.fromPoints(this.session.screenToDocumentPosition(k,L,D),this.session.screenToDocumentPosition(k,_,w));if(O.isEmpty()){if(T&&y(O.end,T))break;T=O.end}O.cursor=R?O.start:O.end,E.push(O)}if(v&&E.reverse(),!S){for(var I=E.length-1;E[I].isEmpty()&&I>0;)I--;if(I>0)for(var N=0;E[N].isEmpty();)N++;for(var P=I;P>=N;P--)E[P].isEmpty()&&E.splice(P,1)}return E}}).call(m.prototype);var f=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function($){$.cursor||($.cursor=$.end);var A=this.getSelectionStyle();return $.marker=this.session.addMarker($,"ace_selection",A),this.session.$selectionMarkers.push($),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,$},this.removeSelectionMarker=function($){if($.marker){this.session.removeMarker($.marker);var A=this.session.$selectionMarkers.indexOf($);A!=-1&&this.session.$selectionMarkers.splice(A,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function($){for(var A=this.session.$selectionMarkers,S=$.length;S--;){var E=$[S];if(E.marker){this.session.removeMarker(E.marker);var R=A.indexOf(E);R!=-1&&A.splice(R,1)}}this.session.selectionMarkerCount=A.length},this.$onAddRange=function($){this.addSelectionMarker($.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function($){this.removeSelectionMarkers($.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function($){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function($){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function($){var A=$.command,S=$.editor;if(S.multiSelect){if(A.multiSelectAction)A.multiSelectAction=="forEach"?E=S.forEachSelection(A,$.args):A.multiSelectAction=="forEachLine"?E=S.forEachSelection(A,$.args,!0):A.multiSelectAction=="single"?(S.exitMultiSelectMode(),E=A.exec(S,$.args||{})):E=A.multiSelectAction(S,$.args||{});else{var E=A.exec(S,$.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return E}},this.forEachSelection=function($,A,S){if(!this.inVirtualSelectionMode){var E=S&&S.keepOrder,R=S==!0||S&&S.$byLines,L=this.session,_=this.selection,D=_.rangeList,w=(E?_:D).ranges,v;if(!w.length)return $.exec?$.exec(this,A||{}):$(this,A||{});var C=_._eventRegistry;_._eventRegistry={};var x=new m(L);this.inVirtualSelectionMode=!0;for(var T=w.length;T--;){if(R)for(;T>0&&w[T].start.row==w[T-1].end.row;)T--;x.fromOrientedRange(w[T]),x.index=T,this.selection=L.selection=x;var k=$.exec?$.exec(this,A||{}):$(this,A||{});!v&&k!==void 0&&(v=k),x.toOrientedRange(w[T])}x.detach(),this.selection=L.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var O=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),O&&O.from==O.to&&this.renderer.animateScrolling(O.from),v}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var $="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var A=this.multiSelect.rangeList.ranges,S=[],E=0;E<A.length;E++)S.push(this.session.getTextRange(A[E]));var R=this.session.getDocument().getNewLineCharacter();$=S.join(R),$.length==(S.length-1)*R.length&&($="")}else this.selection.isEmpty()||($=this.session.getTextRange(this.getSelectionRange()));return $},this.$checkMultiselectChange=function($,A){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var S=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&A==this.multiSelect.anchor)return;var E=A==this.multiSelect.anchor?S.cursor==S.start?S.end:S.start:S.cursor;E.row!=A.row||this.session.$clipPositionToDocument(E.row,E.column).column!=A.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function($,A,S){if(A=A||{},A.needle=$||A.needle,A.needle==null){var E=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();A.needle=this.session.getTextRange(E)}this.$search.set(A);var R=this.$search.findAll(this.session);if(!R.length)return 0;var L=this.multiSelect;S||L.toSingleRange(R[0]);for(var _=R.length;_--;)L.addRange(R[_],!0);return E&&L.rangeList.rangeAtPoint(E.start)&&L.addRange(E,!0),R.length},this.selectMoreLines=function($,A){var S=this.selection.toOrientedRange(),E=S.cursor==S.end,R=this.session.documentToScreenPosition(S.cursor);this.selection.$desiredColumn&&(R.column=this.selection.$desiredColumn);var L=this.session.screenToDocumentPosition(R.row+$,R.column);if(S.isEmpty())var D=L;else var _=this.session.documentToScreenPosition(E?S.end:S.start),D=this.session.screenToDocumentPosition(_.row+$,_.column);if(E){var w=g.fromPoints(L,D);w.cursor=w.start}else{var w=g.fromPoints(D,L);w.cursor=w.end}if(w.desiredColumn=R.column,!this.selection.inMultiSelectMode)this.selection.addRange(S);else if(A)var v=S.cursor;this.selection.addRange(w),v&&this.selection.substractPoint(v)},this.transposeSelections=function($){for(var A=this.session,S=A.multiSelect,E=S.ranges,R=E.length;R--;){var L=E[R];if(L.isEmpty()){var _=A.getWordRange(L.start.row,L.start.column);L.start.row=_.start.row,L.start.column=_.start.column,L.end.row=_.end.row,L.end.column=_.end.column}}S.mergeOverlappingRanges();for(var D=[],R=E.length;R--;){var L=E[R];D.unshift(A.getTextRange(L))}$<0?D.unshift(D.pop()):D.push(D.shift());for(var R=E.length;R--;){var L=E[R],w=L.clone();A.replace(L,D[R]),L.start.row=w.start.row,L.start.column=w.start.column}S.fromOrientedRange(S.ranges[0])},this.selectMore=function($,A,S){var E=this.session,R=E.multiSelect,L=R.toOrientedRange();if(!(L.isEmpty()&&(L=E.getWordRange(L.start.row,L.start.column),L.cursor=$==-1?L.start:L.end,this.multiSelect.addRange(L),S))){var _=E.getTextRange(L),D=i(E,_,$);D&&(D.cursor=$==-1?D.start:D.end,this.session.unfold(D),this.multiSelect.addRange(D),this.renderer.scrollCursorIntoView(null,.5)),A&&this.multiSelect.substractPoint(L.cursor)}},this.alignCursors=function(){var $=this.session,A=$.multiSelect,S=A.ranges,E=-1,R=S.filter(function(I){if(I.cursor.row==E)return!0;E=I.cursor.row});if(!S.length||R.length==S.length-1){var L=this.selection.getRange(),_=L.start.row,D=L.end.row,w=_==D;if(w){var v=this.session.getLength(),C;do C=this.session.getLine(D);while(/[=:]/.test(C)&&++D<v);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),D>=v&&(D=v-1)}var x=this.session.removeFullLines(_,D);x=this.$reAlignText(x,w),this.session.insert({row:_,column:0},x.join(`
2098
+ }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,d){var h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,c=(function(){function f(r,o){this.canvas=h.createElement("canvas"),this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return f.prototype.$updateDecorators=function(r){var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var a=(r.lastRow+1)*this.lineHeight;a<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var s=this.canvas.getContext("2d");function i(D,w){return D.priority<w.priority?-1:D.priority>w.priority?1:0}var u=this.renderer.session.$annotations;if(s.clearRect(0,0,this.canvas.width,this.canvas.height),u){var p={info:1,warning:2,error:3};u.forEach(function(D){D.priority=p[D.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,b=0;b<u.length;b++){var M=u[b].row,x=this.compensateFoldRows(M,y),A=Math.round((M-x)*this.lineHeight*this.heightRatio),S=Math.round((M-x)*this.lineHeight*this.heightRatio),$=Math.round(((M-x)*this.lineHeight+this.lineHeight)*this.heightRatio),R=$-S;if(R<this.minDecorationHeight){var L=(S+$)/2|0;L<this.halfMinDecorationHeight?L=this.halfMinDecorationHeight:L+this.halfMinDecorationHeight>this.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),S=Math.round(L-this.halfMinDecorationHeight),$=Math.round(L+this.halfMinDecorationHeight)}s.fillStyle=o[u[b].type]||null,s.fillRect(0,A,this.canvasWidth,$-S)}}var T=this.renderer.session.selection.getCursor();if(T){var x=this.compensateFoldRows(T.row,y),A=Math.round((T.row-x)*this.lineHeight*this.heightRatio);s.fillStyle="rgba(0, 0, 0, 0.5)",s.fillRect(0,A,this.canvasWidth,2)}},f.prototype.compensateFoldRows=function(r,o){var a=0;if(o&&o.length>0)for(var s=0;s<o.length;s++)r>o[s].start.row&&r<o[s].end.row?a+=r-o[s].start.row:r>=o[s].end.row&&(a+=o[s].end.row-o[s].start.row);return a},f})();g.implement(c.prototype,m),n.Decorator=c}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,d){var h=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),c=t("./config"),f=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,o=t("./layer/text").Text,a=t("./layer/cursor").Cursor,s=t("./scrollbar").HScrollBar,i=t("./scrollbar").VScrollBar,u=t("./scrollbar_custom").HScrollBar,p=t("./scrollbar_custom").VScrollBar,y=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,M=t("./lib/event_emitter").EventEmitter,x=t("./css/editor-css"),A=t("./layer/decorators").Decorator,S=t("./lib/useragent"),$=t("./layer/text_util").isTextToken;g.importCssString(x,"ace_editor.css",!1);var R=(function(){function L(T,D){var w=this;this.container=T||g.createElement("div"),g.addCssClass(this.container,"ace_editor"),g.HI_DPI&&g.addCssClass(this.container,"ace_hidpi"),this.setTheme(D),c.get("useStrictCSP")==null&&c.set("useStrictCSP",!1),this.$gutter=g.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=g.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=g.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new f(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var v=this.$textLayer=new o(this.content);this.canvas=v.element,this.$markerFront=new r(this.content),this.$cursorLayer=new a(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new i(this.container,this),this.scrollBarH=new s(this.container,this),this.scrollBarV.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollTop(C.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollLeft(C.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!S.isIOS,this.$loop=new y(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),c.resetOptions(this),c._signal("renderer",this)}return L.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(),g.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},L.prototype.setSession=function(T){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=T,T&&this.scrollMargin.top&&T.getScrollTop()<=0&&T.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(T),this.$markerBack.setSession(T),this.$markerFront.setSession(T),this.$gutterLayer.setSession(T),this.$textLayer.setSession(T),T&&(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))},L.prototype.updateLines=function(T,D,w){if(D===void 0&&(D=1/0),this.$changedLines?(this.$changedLines.firstRow>T&&(this.$changedLines.firstRow=T),this.$changedLines.lastRow<D&&(this.$changedLines.lastRow=D)):this.$changedLines={firstRow:T,lastRow:D},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},L.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},L.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},L.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},L.prototype.updateFull=function(T){T?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},L.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},L.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},L.prototype.onResize=function(T,D,w,v){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=T?1:0;var C=this.container;v||(v=C.clientHeight||C.scrollHeight),!v&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",v=C.clientHeight||C.scrollHeight),w||(w=C.clientWidth||C.scrollWidth);var E=this.$updateCachedSize(T,D,w,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!v)return this.resizing=0;T&&(this.$gutterLayer.$padding=null),T?this.$renderChanges(E|this.$changes,!0):this.$loop.schedule(E|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(T,D,w,v){v-=this.$extraHeight||0;var C=0,E=this.$size,_={width:E.width,height:E.height,scrollerHeight:E.scrollerHeight,scrollerWidth:E.scrollerWidth};if(v&&(T||E.height!=v)&&(E.height=v,C|=this.CHANGE_SIZE,E.scrollerHeight=E.height,this.$horizScroll&&(E.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(E.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),w&&(T||E.width!=w)){C|=this.CHANGE_SIZE,E.width=w,D==null&&(D=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=D,g.setStyle(this.scrollBarH.element.style,"left",D+"px"),g.setStyle(this.scroller.style,"left",D+this.margin.left+"px"),E.scrollerWidth=Math.max(0,w-D-this.scrollBarV.getWidth()-this.margin.h),g.setStyle(this.$gutter.style,"left",this.margin.left+"px");var k=this.scrollBarV.getWidth()+"px";g.setStyle(this.scrollBarH.element.style,"right",k),g.setStyle(this.scroller.style,"right",k),g.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(E.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||T)&&(C|=this.CHANGE_FULL)}return E.$dirty=!w||!v,C&&this._signal("resize",_),C},L.prototype.onGutterResize=function(T){var D=this.$showGutter?T:0;D!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,D,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},L.prototype.adjustWrapLimit=function(){var T=this.$size.scrollerWidth-this.$padding*2,D=Math.floor(T/this.characterWidth);return this.session.adjustWrapLimit(D,this.$showPrintMargin&&this.$printMarginColumn)},L.prototype.setAnimatedScroll=function(T){this.setOption("animatedScroll",T)},L.prototype.getAnimatedScroll=function(){return this.$animatedScroll},L.prototype.setShowInvisibles=function(T){this.setOption("showInvisibles",T),this.session.$bidiHandler.setShowInvisibles(T)},L.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},L.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},L.prototype.setDisplayIndentGuides=function(T){this.setOption("displayIndentGuides",T)},L.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},L.prototype.setHighlightIndentGuides=function(T){this.setOption("highlightIndentGuides",T)},L.prototype.setShowPrintMargin=function(T){this.setOption("showPrintMargin",T)},L.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},L.prototype.setPrintMarginColumn=function(T){this.setOption("printMarginColumn",T)},L.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},L.prototype.getShowGutter=function(){return this.getOption("showGutter")},L.prototype.setShowGutter=function(T){return this.setOption("showGutter",T)},L.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},L.prototype.setFadeFoldWidgets=function(T){this.setOption("fadeFoldWidgets",T)},L.prototype.setHighlightGutterLine=function(T){this.setOption("highlightGutterLine",T)},L.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},L.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var T=g.createElement("div");T.className="ace_layer ace_print-margin-layer",this.$printMarginEl=g.createElement("div"),this.$printMarginEl.className="ace_print-margin",T.appendChild(this.$printMarginEl),this.content.insertBefore(T,this.content.firstChild)}var D=this.$printMarginEl.style;D.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",D.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},L.prototype.getContainerElement=function(){return this.container},L.prototype.getMouseEventTarget=function(){return this.scroller},L.prototype.getTextAreaContainer=function(){return this.container},L.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var T=this.textarea.style,D=this.$composition;if(!this.$keepTextAreaAtCursor&&!D){g.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){D&&D.markerRange&&(w=this.$cursorLayer.getPixelPosition(D.markerRange.start,!0));var v=this.layerConfig,C=w.top,E=w.left;C-=v.offset;var _=D&&D.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-_){g.translate(this.textarea,0,0);return}var k=1,O=this.$size.height-_;if(!D)C+=this.lineHeight;else if(D.useTextareaForIME){var I=this.textarea.value;k=this.characterWidth*this.session.$getStringScreenWidth(I)[0]}else C+=this.lineHeight+2;E-=this.scrollLeft,E>this.$size.scrollerWidth-k&&(E=this.$size.scrollerWidth-k),E+=this.gutterWidth+this.margin.left,g.setStyle(T,"height",_+"px"),g.setStyle(T,"width",k+"px"),g.translate(this.textarea,Math.min(E,this.$size.scrollerWidth-k),Math.min(C,O))}}},L.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},L.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},L.prototype.getLastFullyVisibleRow=function(){var T=this.layerConfig,D=T.lastRow,w=this.session.documentToScreenRow(D,0)*T.lineHeight;return w-this.session.getScrollTop()>T.height-T.lineHeight?D-1:D},L.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},L.prototype.setPadding=function(T){this.$padding=T,this.$textLayer.setPadding(T),this.$cursorLayer.setPadding(T),this.$markerFront.setPadding(T),this.$markerBack.setPadding(T),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},L.prototype.setScrollMargin=function(T,D,w,v){var C=this.scrollMargin;C.top=T|0,C.bottom=D|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},L.prototype.setMargin=function(T,D,w,v){var C=this.margin;C.top=T|0,C.bottom=D|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},L.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},L.prototype.setHScrollBarAlwaysVisible=function(T){this.setOption("hScrollBarAlwaysVisible",T)},L.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},L.prototype.setVScrollBarAlwaysVisible=function(T){this.setOption("vScrollBarAlwaysVisible",T)},L.prototype.$updateScrollBarV=function(){var T=this.layerConfig.maxHeight,D=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(T-=(D-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>T-D&&(T=this.scrollTop+D,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(T+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},L.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},L.prototype.freeze=function(){this.$frozen=!0},L.prototype.unfreeze=function(){this.$frozen=!1},L.prototype.$renderChanges=function(T,D){if(this.$changes&&(T|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!T&&!D){this.$changes|=T;return}if(this.$size.$dirty)return this.$changes|=T,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",T),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(T&this.CHANGE_FULL||T&this.CHANGE_SIZE||T&this.CHANGE_TEXT||T&this.CHANGE_LINES||T&this.CHANGE_SCROLL||T&this.CHANGE_H_SCROLL){if(T|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var v=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;v>0&&(this.scrollTop=v,T=T|this.CHANGE_SCROLL,T|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),T&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-w.offset);var C=w.width+2*this.$padding+"px",E=w.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",E)}if(T&this.CHANGE_H_SCROLL&&(g.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),T&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",T);return}if(T&this.CHANGE_SCROLL){this.$changedLines=null,T&this.CHANGE_TEXT||T&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(T&this.CHANGE_GUTTER||T&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",T);return}T&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_LINES?((this.$updateLines()||T&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_TEXT||T&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),T&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),T&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),T&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",T)},L.prototype.$autosize=function(){var T=this.session.getScreenLength()*this.lineHeight,D=this.$maxLines*this.lineHeight,w=Math.min(D,Math.max((this.$minLines||1)*this.lineHeight,T))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var v=w<=2*this.lineHeight,C=!v&&T>D;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var E=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,E,w),this.desiredHeight=w,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var T=this.session,D=this.$size,w=D.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,E=this.$getLongestLine(),_=!w&&(this.$hScrollBarAlwaysVisible||D.scrollerWidth-E-2*this.$padding<0),k=this.$horizScroll!==_;k&&(this.$horizScroll=_,this.scrollBarH.setVisible(_));var O=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var I=D.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(D.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-D.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,E+2*this.$padding-D.scrollerWidth+P.right)));var B=!w&&(this.$vScrollBarAlwaysVisible||D.scrollerHeight-C+N<0||this.scrollTop>P.top),F=O!==B;F&&(this.$vScroll=B,this.scrollBarV.setVisible(B));var H=this.scrollTop%this.lineHeight,z=Math.ceil(I/this.lineHeight)-1,W=Math.max(0,Math.round((this.scrollTop-H)/this.lineHeight)),U=W+z,K,Y,G=this.lineHeight;W=T.screenToDocumentRow(W,0);var J=T.getFoldLine(W);J&&(W=J.start.row),K=T.documentToScreenRow(W,0),Y=T.getRowLength(W)*G,U=Math.min(T.screenToDocumentRow(U,0),T.getLength()-1),I=D.scrollerHeight+T.getRowLength(U)*G+Y,H=this.scrollTop-K*G;var ue=0;return(this.layerConfig.width!=E||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,D.width,D.height),this._signal("scrollbarVisibilityChanged"),F&&(E=this.$getLongestLine())),this.layerConfig={width:E,padding:this.$padding,firstRow:W,firstRowScreen:K,lastRow:U,lineHeight:G,characterWidth:this.characterWidth,minHeight:I,maxHeight:C,offset:H,gutterOffset:G?Math.max(0,Math.ceil((H+D.height-D.scrollerHeight)/G)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(E-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var T=this.$changedLines.firstRow,D=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(T>w.lastRow+1)&&!(D<w.firstRow)){if(D===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,T,D),!0}}},L.prototype.$getLongestLine=function(){var T=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(T+=1),this.$textLayer&&T>this.$textLayer.MAX_LINE_LENGTH&&(T=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(T*this.characterWidth))},L.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},L.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},L.prototype.addGutterDecoration=function(T,D){this.$gutterLayer.addGutterDecoration(T,D)},L.prototype.removeGutterDecoration=function(T,D){this.$gutterLayer.removeGutterDecoration(T,D)},L.prototype.updateBreakpoints=function(T){this._rows=T,this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.setAnnotations=function(T){this.$gutterLayer.setAnnotations(T),this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},L.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},L.prototype.showCursor=function(){this.$cursorLayer.showCursor()},L.prototype.scrollSelectionIntoView=function(T,D,w){this.scrollCursorIntoView(T,w),this.scrollCursorIntoView(D,w)},L.prototype.scrollCursorIntoView=function(T,D,w){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(T),C=v.left,E=v.top,_=w&&w.top||0,k=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var O=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;O+_>E?(D&&O+_>E+this.lineHeight&&(E-=D*this.$size.scrollerHeight),E===0&&(E=-this.scrollMargin.top),this.session.setScrollTop(E)):O+this.$size.scrollerHeight-k<E+this.lineHeight&&(D&&O+this.$size.scrollerHeight-k<E-this.lineHeight&&(E+=D*this.$size.scrollerHeight),this.session.setScrollTop(E+this.lineHeight+k-this.$size.scrollerHeight));var I=this.scrollLeft,N=2*this.layerConfig.characterWidth;C-N<I?(C-=N,C<this.$padding+N&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=N,I+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):I<=this.$padding&&C-I<this.characterWidth&&this.session.setScrollLeft(0))}},L.prototype.getScrollTop=function(){return this.session.getScrollTop()},L.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},L.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},L.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},L.prototype.scrollToRow=function(T){this.session.setScrollTop(T*this.lineHeight)},L.prototype.alignCursor=function(T,D){typeof T=="number"&&(T={row:T,column:0});var w=this.$cursorLayer.getPixelPosition(T),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(D||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(T,D){var w=0,v=this.STEPS,C=[],E=function(_,k,O){return O*(Math.pow(_-1,3)+1)+k};for(w=0;w<v;++w)C.push(E(w/this.STEPS,T,D-T));return C},L.prototype.scrollToLine=function(T,D,w,v){var C=this.$cursorLayer.getPixelPosition({row:T,column:0}),E=C.top;D&&(E-=this.$size.scrollerHeight/2);var _=this.scrollTop;this.session.setScrollTop(E),w!==!1&&this.animateScrolling(_,v)},L.prototype.animateScrolling=function(T,D){var w=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(T==w)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(T=C[0],T==w))return}var E=v.$calcSteps(T,w);this.$scrollAnimation={from:T,to:w,steps:E},clearInterval(this.$timer),v.session.setScrollTop(E.shift()),v.session.$scrollTop=w;function _(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,D&&D()}this.$timer=setInterval(function(){if(v.$stopAnimation){_();return}if(!v.session)return clearInterval(v.$timer);E.length?(v.session.setScrollTop(E.shift()),v.session.$scrollTop=w):w!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(w),w=null):_()},10)},L.prototype.scrollToY=function(T){this.scrollTop!==T&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=T)},L.prototype.scrollToX=function(T){this.scrollLeft!==T&&(this.scrollLeft=T),this.$loop.schedule(this.CHANGE_H_SCROLL)},L.prototype.scrollTo=function(T,D){this.session.setScrollTop(D),this.session.setScrollLeft(T)},L.prototype.scrollBy=function(T,D){D&&this.session.setScrollTop(this.session.getScrollTop()+D),T&&this.session.setScrollLeft(this.session.getScrollLeft()+T)},L.prototype.isScrollableBy=function(T,D){if(D<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||D>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||T<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||T>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},L.prototype.pixelToScreenCoordinates=function(T,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([T,D]);T=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=T+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,_=Math.floor((D+this.scrollTop-w.top)/this.lineHeight),k=this.$blockCursor?Math.floor(E):Math.round(E);return{row:_,column:k,side:E-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(T,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([T,D]);T=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=T+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,_=this.$blockCursor?Math.floor(E):Math.round(E),k=Math.floor((D+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(_,0),C)},L.prototype.textToScreenCoordinates=function(T,D){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(T,D),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,T)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),E=v.row*this.lineHeight;return{pageX:w.left+C-this.scrollLeft,pageY:w.top+E-this.scrollTop}},L.prototype.visualizeFocus=function(){g.addCssClass(this.container,"ace_focus")},L.prototype.visualizeBlur=function(){g.removeCssClass(this.container,"ace_focus")},L.prototype.showComposition=function(T){this.$composition=T,T.cssText||(T.cssText=this.textarea.style.cssText),T.useTextareaForIME==null&&(T.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(g.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):T.markerId=this.session.addMarker(T.markerRange,"ace_composition_marker","text")},L.prototype.setCompositionText=function(T){var D=this.session.selection.cursor;this.addToken(T,"composition_placeholder",D.row,D.column),this.$moveTextAreaToCursor()},L.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),g.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var T=this.session.selection.cursor;this.removeExtraToken(T.row,T.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},L.prototype.setGhostText=function(T,D){var w=this.session.selection.cursor,v=D||{row:w.row,column:w.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(T,v);this.addToken(C[0].text,"ghost_text",v.row,v.column),this.$ghostText={text:T,position:{row:v.row,column:v.column}};var E=g.createElement("div");if(C.length>1){var _=this.hideTokensAfterPosition(v.row,v.column),k;C.slice(1).forEach(function(F){var H=g.createElement("div"),z=g.createElement("span");z.className="ace_ghost_text",F.wrapped&&(H.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),z.appendChild(g.createTextNode(F.text)),H.appendChild(z),E.appendChild(H),k=H}),_.forEach(function(F){var H=g.createElement("span");$(F.type)||(H.className="ace_"+F.type.replace(/\./g," ace_")),H.appendChild(g.createTextNode(F.value)),k.appendChild(H)}),this.$ghostTextWidget={el:E,row:v.row,column:v.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var O=this.$cursorLayer.getPixelPosition(v,!0),I=this.container,N=I.getBoundingClientRect().height,P=C.length*this.lineHeight,B=P<N-O.top;if(B)return;P<N?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(v.row)}},L.prototype.$calculateWrappedTextChunks=function(T,D){var w=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(w/this.characterWidth)-2;v=v<=0?60:v;for(var C=T.split(/\r?\n/),E=[],_=0;_<C.length;_++){var k=this.session.$getDisplayTokens(C[_],D.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var I=0;O.push(C[_].length);for(var N=0;N<O.length;N++){var P=C[_].slice(I,O[N]);E.push({text:P,wrapped:!0}),I=O[N]}}else E.push({text:C[_],wrapped:!1})}return E},L.prototype.removeGhostText=function(){if(this.$ghostText){var T=this.$ghostText.position;this.removeExtraToken(T.row,T.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},L.prototype.addToken=function(T,D,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var E={type:D,value:T},_=C.getTokens(w);if(v==null||!_.length)_.push(E);else for(var k=0,O=0;O<_.length;O++){var I=_[O];if(k+=I.value.length,v<=k){var N=I.value.length-(k-v),P=I.value.slice(0,N),B=I.value.slice(N);_.splice(O,1,{type:I.type,value:P},E,{type:I.type,value:B});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(T,D){for(var w=this.session.getTokens(T),v=0,C=!1,E=[],_=0;_<w.length;_++){var k=w[_];if(v+=k.value.length,k.type!=="ghost_text"){if(C){E.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===D&&(C=!0)}}return this.updateLines(T,T),E},L.prototype.removeExtraToken=function(T,D){this.session.bgTokenizer.lines[T]=null,this.updateLines(T,T)},L.prototype.setTheme=function(T,D){var w=this;if(this.$themeId=T,w._dispatchEvent("themeChange",{theme:T}),!T||typeof T=="string"){var v=T||this.$options.theme.initialValue;c.loadModule(["theme",v],C)}else C(T);function C(E){if(w.$themeId!=T)return D&&D();if(!E||!E.cssClass)throw new Error("couldn't load module "+T+" or it didn't call define");E.$id&&(w.$themeId=E.$id),g.importCssString(E.cssText,E.cssClass,w.container),w.theme&&g.removeCssClass(w.container,w.theme.cssClass);var _="padding"in E?E.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&_!=w.$padding&&w.setPadding(_),w.$theme=E.cssClass,w.theme=E,g.addCssClass(w.container,E.cssClass),g.setCssClass(w.container,"ace_dark",E.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:E}),D&&D(),S.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(T,D){g.setCssClass(this.container,T,D!==!1)},L.prototype.unsetStyle=function(T){g.removeCssClass(this.container,T)},L.prototype.setCursorStyle=function(T){g.setStyle(this.scroller.style,"cursor",T)},L.prototype.setMouseCursor=function(T){g.setStyle(this.scroller.style,"cursor",T)},L.prototype.attachToShadowRoot=function(){g.importCssString(x,"ace_editor.css",this.container)},L.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},L.prototype.$updateCustomScrollbar=function(T){var D=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,T===!0?(this.scrollBarV=new p(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.scrollMargin.left)}),this.$scrollDecorator=new A(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new i(this.container,this),this.scrollBarH=new s(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.scrollMargin.left)}))},L.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var T=this;this.$resizeTimer=m.delayedCall(function(){T.destroyed||T.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(D){var w=D[0].contentRect.width,v=D[0].contentRect.height;Math.abs(T.$size.width-w)>1||Math.abs(T.$size.height-v)>1?T.$resizeTimer.delay():T.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},L})();R.prototype.CHANGE_CURSOR=1,R.prototype.CHANGE_MARKER=2,R.prototype.CHANGE_GUTTER=4,R.prototype.CHANGE_SCROLL=8,R.prototype.CHANGE_LINES=16,R.prototype.CHANGE_TEXT=32,R.prototype.CHANGE_SIZE=64,R.prototype.CHANGE_MARKER_BACK=128,R.prototype.CHANGE_MARKER_FRONT=256,R.prototype.CHANGE_FULL=512,R.prototype.CHANGE_H_SCROLL=1024,R.prototype.$changes=0,R.prototype.$padding=null,R.prototype.$frozen=!1,R.prototype.STEPS=8,h.implement(R.prototype,M),c.defineOptions(R.prototype,"renderer",{useResizeObserver:{set:function(L){!L&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):L&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(L){this.$textLayer.setShowInvisibles(L)&&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(L){typeof L=="number"&&(this.$printMarginColumn=L),this.$showPrintMargin=!!L,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(L){this.$gutter.style.display=L?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(L){this.$gutterLayer.$useSvgGutterIcons=L},initialValue:!1},showFoldedAnnotations:{set:function(L){this.$gutterLayer.$showFoldedAnnotations=L},initialValue:!1},fadeFoldWidgets:{set:function(L){g.setCssClass(this.$gutter,"ace_fade-fold-widgets",L)},initialValue:!1},showFoldWidgets:{set:function(L){this.$gutterLayer.setShowFoldWidgets(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(L){this.$textLayer.setDisplayIndentGuides(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(L){this.$textLayer.setHighlightIndentGuides(L)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(L){this.$gutterLayer.setHighlightGutterLine(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(L){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(L){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(L){typeof L=="number"&&(L=L+"px"),this.container.style.fontSize=L,this.updateFontSize()},initialValue:12},fontFamily:{set:function(L){this.container.style.fontFamily=L,this.updateFontSize()}},maxLines:{set:function(L){this.updateFull()}},minLines:{set:function(L){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(L){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(L){L=+L||0,this.$scrollPastEnd!=L&&(this.$scrollPastEnd=L,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(L){this.$gutterLayer.$fixedWidth=!!L,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(L){this.$updateCustomScrollbar(L)},initialValue:!1},theme:{set:function(L){this.setTheme(L)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!S.isMobile&&!S.isIE}}),n.VirtualRenderer=R}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,d){var h=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,c=t("../config");function f(s){var i="importScripts('"+g.qualifyURL(s)+"');";try{return new Blob([i],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,p=new u;return p.append(i),p.getBlob("application/javascript")}}function r(s){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(c.get("loadWorkerFromBlob")){var i=f(s),u=window.URL||window.webkitURL,p=u.createObjectURL(i);return new Worker(p)}return new Worker(s)}var o=function(s){s.postMessage||(s=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=s,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(){h.implement(this,m),this.$createWorkerFromOldConfig=function(s,i,u,p,y){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),c.get("packaged")||!t.toUrl)p=p||c.moduleUrl(i,"worker");else{var b=this.$normalizePath;p=p||b(t.toUrl("ace/worker/worker.js",null,"_"));var M={};s.forEach(function(x){M[x]=b(t.toUrl(x,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(p),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:M,module:i,classname:u}),this.$worker},this.onMessage=function(s){var i=s.data;switch(i.type){case"event":this._signal(i.name,{data:i.data});break;case"call":var u=this.callbacks[i.id];u&&(u(i.data),delete this.callbacks[i.id]);break;case"error":this.reportError(i.data);break;case"log":window.console&&console.log&&console.log.apply(console,i.data);break}},this.reportError=function(s){window.console&&console.error&&console.error(s)},this.$normalizePath=function(s){return g.qualifyURL(s)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(s){s.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(s,i){this.$worker.postMessage({command:s,args:i})},this.call=function(s,i,u){if(u){var p=this.callbackId++;this.callbacks[p]=u,i.push(p)}this.send(s,i)},this.emit=function(s,i){try{i.data&&i.data.err&&(i.data.err={message:i.data.err.message,stack:i.data.err.stack,code:i.data.err.code}),this.$worker&&this.$worker.postMessage({event:s,data:{data:i.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(s){this.$doc&&this.terminate(),this.$doc=s,this.call("setValue",[s.getValue()]),s.on("change",this.changeListener,!0)},this.changeListener=function(s){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),s.action=="insert"?this.deltaQueue.push(s.start,s.lines):this.deltaQueue.push(s.start,s.end)},this.$sendDeltaQueue=function(){var s=this.deltaQueue;s&&(this.deltaQueue=null,s.length>50&&s.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:s}))}}).call(o.prototype);var a=function(s,i,u){var p=null,y=!1,b=Object.create(m),M=[],x=new o({messageBuffer:M,terminate:function(){},postMessage:function(S){M.push(S),p&&(y?setTimeout(A):A())}});x.setEmitSync=function(S){y=S};var A=function(){var S=M.shift();S.command?p[S.command].apply(p,S.args):S.event&&b._signal(S.event,S.data)};return b.postMessage=function(S){x.onMessage({data:S})},b.callback=function(S,$){this.postMessage({type:"call",id:$,data:S})},b.emit=function(S,$){this.postMessage({type:"event",name:S,data:$})},c.loadModule(["worker",i],function(S){for(p=new S[u](b);M.length;)A()}),x};n.UIWorkerClient=a,n.WorkerClient=o,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,d){var h=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),c=(function(){function f(r,o,a,s,i,u){var p=this;this.length=o,this.session=r,this.doc=r.getDocument(),this.mainClass=i,this.othersClass=u,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=s,this.$onCursorChange=function(){setTimeout(function(){p.onCursorChange()})},this.$pos=a;var y=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=y.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return f.prototype.setup=function(){var r=this,o=this.doc,a=this.session;this.selectionBefore=a.selection.toJSON(),a.selection.inMultiSelectMode&&a.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=a.addMarker(new h(s.row,s.column,s.row,s.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var u=o.createAnchor(i.row,i.column);u.$insertRight=!0,u.detach(),r.others.push(u)}),a.setUndoSelect(!1)},f.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,o=this;this.othersActive=!0,this.others.forEach(function(a){a.markerId=r.addMarker(new h(a.row,a.column,a.row,a.column+o.length),o.othersClass,null,!1)})}},f.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},f.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var o=r;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var a=r.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,s=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,i=o.start.column-this.pos.column;if(this.updateAnchors(r),s&&(this.length+=a),s&&!this.session.$fromUndo){if(r.action==="insert")for(var u=this.others.length-1;u>=0;u--){var p=this.others[u],y={row:p.row,column:p.column+i};this.doc.insertMergedLines(y,r.lines)}else if(r.action==="remove")for(var u=this.others.length-1;u>=0;u--){var p=this.others[u],y={row:p.row,column:p.column+i};this.doc.remove(new h(y.row,y.column,y.row,y.column-a))}}this.$updating=!1,this.updateMarkers()}},f.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},f.prototype.updateMarkers=function(){if(!this.$updating){var r=this,o=this.session,a=function(i,u){o.removeMarker(i.markerId),i.markerId=o.addMarker(new h(i.row,i.column,i.row,i.column+r.length),u,null,!1)};a(this.pos,this.mainClass);for(var s=this.others.length;s--;)a(this.others[s],this.othersClass)}},f.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},f.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},f.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),o=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,a=0;a<o;a++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},f})();m.implement(c.prototype,g),n.PlaceHolder=c}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,d){var h=t("../lib/event"),g=t("../lib/useragent");function m(f,r){return f.row==r.row&&f.column==r.column}function c(f){var r=f.domEvent,o=r.altKey,a=r.shiftKey,s=r.ctrlKey,i=f.getAccelKey(),u=f.getButton();if(s&&g.isMac&&(u=r.button),f.editor.inMultiSelectMode&&u==2){f.editor.textInput.onContextMenu(f.domEvent);return}if(!s&&!o&&!i){u===0&&f.editor.inMultiSelectMode&&f.editor.exitMultiSelectMode();return}if(u===0){var p=f.editor,y=p.selection,b=p.inMultiSelectMode,M=f.getDocumentPosition(),x=y.getCursor(),A=f.inSelection()||y.isEmpty()&&m(M,x),S=f.x,$=f.y,R=function(P){S=P.clientX,$=P.clientY},L=p.session,T=p.renderer.pixelToScreenCoordinates(S,$),D=T,w;if(p.$mouseHandler.$enableJumpToDef)s&&o||i&&o?w=a?"block":"add":o&&p.$blockSelectEnabled&&(w="block");else if(i&&!o){if(w="add",!b&&a)return}else o&&p.$blockSelectEnabled&&(w="block");if(w&&g.isMac&&r.ctrlKey&&p.$mouseHandler.cancelContextMenu(),w=="add"){if(!b&&A)return;if(!b){var v=y.toOrientedRange();p.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(M);p.inVirtualSelectionMode=!0,a&&(C=null,v=y.ranges[0]||v,p.removeSelectionMarker(v)),p.once("mouseup",function(){var P=y.toOrientedRange();C&&P.isEmpty()&&m(C.cursor,P.cursor)?y.substractPoint(P.cursor):(a?y.substractPoint(v.cursor):v&&(p.removeSelectionMarker(v),y.addRange(v)),y.addRange(P)),p.inVirtualSelectionMode=!1})}else if(w=="block"){f.stop(),p.inVirtualSelectionMode=!0;var E,_=[],k=function(){var P=p.renderer.pixelToScreenCoordinates(S,$),B=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(D,P)&&m(B,y.lead)||(D=P,p.selection.moveToPosition(B),p.renderer.scrollCursorIntoView(),p.removeSelectionMarkers(_),_=y.rectangularRangeBlock(D,T),p.$mouseHandler.$clickSelection&&_.length==1&&_[0].isEmpty()&&(_[0]=p.$mouseHandler.$clickSelection.clone()),_.forEach(p.addSelectionMarker,p),p.updateSelectionMarkers())};b&&!i?y.toSingleRange():!b&&i&&(E=y.toOrientedRange(),p.addSelectionMarker(E)),a?T=L.documentToScreenPosition(y.lead):y.moveToPosition(M),D={row:-1,column:-1};var O=function(P){k(),clearInterval(N),p.removeSelectionMarkers(_),_.length||(_=[y.toOrientedRange()]),E&&(p.removeSelectionMarker(E),y.toSingleRange(E));for(var B=0;B<_.length;B++)y.addRange(_[B]);p.inVirtualSelectionMode=!1,p.$mouseHandler.$clickSelection=null},I=k;h.capture(p.container,R,O);var N=setInterval(function(){I()},20);return f.preventDefault()}}}n.onMouseDown=c}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,d){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(g){g.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(g){g.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(g){g.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(g){g.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(g){g.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(g){g.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(g){g.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(g){g.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(g){g.multiSelect.rangeCount>1?g.multiSelect.joinSelections():g.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(g){g.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(g){g.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(g){g.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(g){g.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(g){return g&&g.inMultiSelectMode}}];var h=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new h(n.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(t,n,d){var h=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,c=t("./mouse/multi_select_handler").onMouseDown,f=t("./lib/event"),r=t("./lib/lang"),o=t("./commands/multi_select_commands");n.commands=o.defaultCommands.concat(o.multiSelectCommands);var a=t("./search").Search,s=new a;function i(x,A,S){return s.$options.wrap=!0,s.$options.needle=A,s.$options.backwards=S==-1,s.find(x)}var u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(x,A){if(x){if(!this.inMultiSelectMode&&this.rangeCount===0){var S=this.toOrientedRange();if(this.rangeList.add(S),this.rangeList.add(x),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),A||this.fromOrientedRange(x);this.rangeList.removeAll(),this.rangeList.add(S),this.$onAddRange(S)}x.cursor||(x.cursor=x.end);var $=this.rangeList.add(x);return this.$onAddRange(x),$.length&&this.$onRemoveRange($),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),A||this.fromOrientedRange(x)}},this.toSingleRange=function(x){x=x||this.ranges[0];var A=this.rangeList.removeAll();A.length&&this.$onRemoveRange(A),x&&this.fromOrientedRange(x)},this.substractPoint=function(x){var A=this.rangeList.substractPoint(x);if(A)return this.$onRemoveRange(A),A[0]},this.mergeOverlappingRanges=function(){var x=this.rangeList.merge();x.length&&this.$onRemoveRange(x)},this.$onAddRange=function(x){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(x),this._signal("addRange",{range:x})},this.$onRemoveRange=function(x){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var A=this.rangeList.ranges.pop();x.push(A),this.rangeCount=0}for(var S=x.length;S--;){var $=this.ranges.indexOf(x[S]);this.ranges.splice($,1)}this._signal("removeRange",{ranges:x}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),A=A||this.ranges[0],A&&!A.isEqual(this.getRange())&&this.fromOrientedRange(A)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new h,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var x=this.ranges.length?this.ranges:[this.getRange()],A=[],S=0;S<x.length;S++){var $=x[S],R=$.start.row,L=$.end.row;if(R===L)A.push($.clone());else{for(A.push(new g(R,$.start.column,R,this.session.getLine(R).length));++R<L;)A.push(this.getLineRange(R,!0));A.push(new g(L,0,L,$.end.column))}S==0&&!this.isBackwards()&&(A=A.reverse())}this.toSingleRange();for(var S=A.length;S--;)this.addRange(A[S])},this.joinSelections=function(){var x=this.rangeList.ranges,A=x[x.length-1],S=g.fromPoints(x[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var x=this.rangeList.ranges,A=x[x.length-1],S=g.fromPoints(x[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)}else{var $=this.session.documentToScreenPosition(this.cursor),R=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock($,R);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(x,A,S){var $=[],R=x.column<A.column;if(R)var L=x.column,T=A.column,D=x.offsetX,w=A.offsetX;else var L=A.column,T=x.column,D=A.offsetX,w=x.offsetX;var v=x.row<A.row;if(v)var C=x.row,E=A.row;else var C=A.row,E=x.row;L<0&&(L=0),C<0&&(C=0),C==E&&(S=!0);for(var _,k=C;k<=E;k++){var O=g.fromPoints(this.session.screenToDocumentPosition(k,L,D),this.session.screenToDocumentPosition(k,T,w));if(O.isEmpty()){if(_&&y(O.end,_))break;_=O.end}O.cursor=R?O.start:O.end,$.push(O)}if(v&&$.reverse(),!S){for(var I=$.length-1;$[I].isEmpty()&&I>0;)I--;if(I>0)for(var N=0;$[N].isEmpty();)N++;for(var P=I;P>=N;P--)$[P].isEmpty()&&$.splice(P,1)}return $}}).call(m.prototype);var p=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(x){x.cursor||(x.cursor=x.end);var A=this.getSelectionStyle();return x.marker=this.session.addMarker(x,"ace_selection",A),this.session.$selectionMarkers.push(x),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,x},this.removeSelectionMarker=function(x){if(x.marker){this.session.removeMarker(x.marker);var A=this.session.$selectionMarkers.indexOf(x);A!=-1&&this.session.$selectionMarkers.splice(A,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(x){for(var A=this.session.$selectionMarkers,S=x.length;S--;){var $=x[S];if($.marker){this.session.removeMarker($.marker);var R=A.indexOf($);R!=-1&&A.splice(R,1)}}this.session.selectionMarkerCount=A.length},this.$onAddRange=function(x){this.addSelectionMarker(x.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(x){this.removeSelectionMarkers(x.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(x){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(x){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(x){var A=x.command,S=x.editor;if(S.multiSelect){if(A.multiSelectAction)A.multiSelectAction=="forEach"?$=S.forEachSelection(A,x.args):A.multiSelectAction=="forEachLine"?$=S.forEachSelection(A,x.args,!0):A.multiSelectAction=="single"?(S.exitMultiSelectMode(),$=A.exec(S,x.args||{})):$=A.multiSelectAction(S,x.args||{});else{var $=A.exec(S,x.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return $}},this.forEachSelection=function(x,A,S){if(!this.inVirtualSelectionMode){var $=S&&S.keepOrder,R=S==!0||S&&S.$byLines,L=this.session,T=this.selection,D=T.rangeList,w=($?T:D).ranges,v;if(!w.length)return x.exec?x.exec(this,A||{}):x(this,A||{});var C=T._eventRegistry;T._eventRegistry={};var E=new m(L);this.inVirtualSelectionMode=!0;for(var _=w.length;_--;){if(R)for(;_>0&&w[_].start.row==w[_-1].end.row;)_--;E.fromOrientedRange(w[_]),E.index=_,this.selection=L.selection=E;var k=x.exec?x.exec(this,A||{}):x(this,A||{});!v&&k!==void 0&&(v=k),E.toOrientedRange(w[_])}E.detach(),this.selection=L.selection=T,this.inVirtualSelectionMode=!1,T._eventRegistry=C,T.mergeOverlappingRanges(),T.ranges[0]&&T.fromOrientedRange(T.ranges[0]);var O=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),O&&O.from==O.to&&this.renderer.animateScrolling(O.from),v}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var x="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var A=this.multiSelect.rangeList.ranges,S=[],$=0;$<A.length;$++)S.push(this.session.getTextRange(A[$]));var R=this.session.getDocument().getNewLineCharacter();x=S.join(R),x.length==(S.length-1)*R.length&&(x="")}else this.selection.isEmpty()||(x=this.session.getTextRange(this.getSelectionRange()));return x},this.$checkMultiselectChange=function(x,A){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var S=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&A==this.multiSelect.anchor)return;var $=A==this.multiSelect.anchor?S.cursor==S.start?S.end:S.start:S.cursor;$.row!=A.row||this.session.$clipPositionToDocument($.row,$.column).column!=A.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(x,A,S){if(A=A||{},A.needle=x||A.needle,A.needle==null){var $=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();A.needle=this.session.getTextRange($)}this.$search.set(A);var R=this.$search.findAll(this.session);if(!R.length)return 0;var L=this.multiSelect;S||L.toSingleRange(R[0]);for(var T=R.length;T--;)L.addRange(R[T],!0);return $&&L.rangeList.rangeAtPoint($.start)&&L.addRange($,!0),R.length},this.selectMoreLines=function(x,A){var S=this.selection.toOrientedRange(),$=S.cursor==S.end,R=this.session.documentToScreenPosition(S.cursor);this.selection.$desiredColumn&&(R.column=this.selection.$desiredColumn);var L=this.session.screenToDocumentPosition(R.row+x,R.column);if(S.isEmpty())var D=L;else var T=this.session.documentToScreenPosition($?S.end:S.start),D=this.session.screenToDocumentPosition(T.row+x,T.column);if($){var w=g.fromPoints(L,D);w.cursor=w.start}else{var w=g.fromPoints(D,L);w.cursor=w.end}if(w.desiredColumn=R.column,!this.selection.inMultiSelectMode)this.selection.addRange(S);else if(A)var v=S.cursor;this.selection.addRange(w),v&&this.selection.substractPoint(v)},this.transposeSelections=function(x){for(var A=this.session,S=A.multiSelect,$=S.ranges,R=$.length;R--;){var L=$[R];if(L.isEmpty()){var T=A.getWordRange(L.start.row,L.start.column);L.start.row=T.start.row,L.start.column=T.start.column,L.end.row=T.end.row,L.end.column=T.end.column}}S.mergeOverlappingRanges();for(var D=[],R=$.length;R--;){var L=$[R];D.unshift(A.getTextRange(L))}x<0?D.unshift(D.pop()):D.push(D.shift());for(var R=$.length;R--;){var L=$[R],w=L.clone();A.replace(L,D[R]),L.start.row=w.start.row,L.start.column=w.start.column}S.fromOrientedRange(S.ranges[0])},this.selectMore=function(x,A,S){var $=this.session,R=$.multiSelect,L=R.toOrientedRange();if(!(L.isEmpty()&&(L=$.getWordRange(L.start.row,L.start.column),L.cursor=x==-1?L.start:L.end,this.multiSelect.addRange(L),S))){var T=$.getTextRange(L),D=i($,T,x);D&&(D.cursor=x==-1?D.start:D.end,this.session.unfold(D),this.multiSelect.addRange(D),this.renderer.scrollCursorIntoView(null,.5)),A&&this.multiSelect.substractPoint(L.cursor)}},this.alignCursors=function(){var x=this.session,A=x.multiSelect,S=A.ranges,$=-1,R=S.filter(function(I){if(I.cursor.row==$)return!0;$=I.cursor.row});if(!S.length||R.length==S.length-1){var L=this.selection.getRange(),T=L.start.row,D=L.end.row,w=T==D;if(w){var v=this.session.getLength(),C;do C=this.session.getLine(D);while(/[=:]/.test(C)&&++D<v);do C=this.session.getLine(T);while(/[=:]/.test(C)&&--T>0);T<0&&(T=0),D>=v&&(D=v-1)}var E=this.session.removeFullLines(T,D);E=this.$reAlignText(E,w),this.session.insert({row:T,column:0},E.join(`
2099
2099
  `)+`
2100
- `),w||(L.start.column=0,L.end.column=x[x.length-1].length),this.selection.setRange(L)}else{R.forEach(function(I){A.substractPoint(I.cursor)});var T=0,k=1/0,O=S.map(function(I){var N=I.cursor,P=$.getLine(N.row),B=P.substr(N.column).search(/\S/g);return B==-1&&(B=0),N.column>T&&(T=N.column),B<k&&(k=B),B});S.forEach(function(I,N){var P=I.cursor,B=T-P.column,F=O[N]-k;B>F?$.insert(P,r.stringRepeat(" ",B-F)):$.remove(new g(P.row,P.column,P.row,P.column-B+F)),I.start.column=I.end.column=T,I.start.row=I.end.row=P.row,I.cursor=I.end}),A.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function($,A){var S=!0,E=!0,R,L,_;return $.map(function(x){var T=x.match(/(\s*)(.*?)(\s*)([=:].*)/);return T?R==null?(R=T[1].length,L=T[2].length,_=T[3].length,T):(R+L+_!=T[1].length+T[2].length+T[3].length&&(E=!1),R!=T[1].length&&(S=!1),R>T[1].length&&(R=T[1].length),L<T[2].length&&(L=T[2].length),_>T[3].length&&(_=T[3].length),T):[x]}).map(A?w:S?E?v:w:C);function D(x){return r.stringRepeat(" ",x)}function w(x){return x[2]?D(R)+x[2]+D(L-x[2].length+_)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}function v(x){return x[2]?D(R+L-x[2].length)+x[2]+D(_)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}function C(x){return x[2]?D(R)+x[2]+D(_)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}}}).call(f.prototype);function y($,A){return $.row==A.row&&$.column==A.column}n.onSessionChange=function($){var A=$.session;A&&!A.multiSelect&&(A.$selectionMarkers=[],A.selection.$initRangeList(),A.multiSelect=A.selection),this.multiSelect=A&&A.multiSelect;var S=$.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),A&&(A.multiSelect.on("addRange",this.$onAddRange),A.multiSelect.on("removeRange",this.$onRemoveRange),A.multiSelect.on("multiSelect",this.$onMultiSelect),A.multiSelect.on("singleSelect",this.$onSingleSelect),A.multiSelect.lead.on("change",this.$checkMultiselectChange),A.multiSelect.anchor.on("change",this.$checkMultiselectChange)),A&&this.inMultiSelectMode!=A.selection.inMultiSelectMode&&(A.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b($){$.$multiselectOnSessionChange||($.$onAddRange=$.$onAddRange.bind($),$.$onRemoveRange=$.$onRemoveRange.bind($),$.$onMultiSelect=$.$onMultiSelect.bind($),$.$onSingleSelect=$.$onSingleSelect.bind($),$.$multiselectOnSessionChange=n.onSessionChange.bind($),$.$checkMultiselectChange=$.$checkMultiselectChange.bind($),$.$multiselectOnSessionChange($),$.on("changeSession",$.$multiselectOnSessionChange),$.on("mousedown",c),$.commands.addCommands(o.defaultCommands),M($))}function M($){if(!$.textInput)return;var A=$.textInput.getElement(),S=!1;d.addListener(A,"keydown",function(R){var L=R.keyCode==18&&!(R.ctrlKey||R.shiftKey||R.metaKey);$.$blockSelectEnabled&&L?S||($.renderer.setMouseCursor("crosshair"),S=!0):S&&E()},$),d.addListener(A,"keyup",E,$),d.addListener(A,"blur",E,$);function E(R){S&&($.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=b,t("./config").defineOptions(f.prototype,"editor",{enableMultiselect:{set:function($){b(this),$?this.on("mousedown",c):this.off("mousedown",c)},value:!0},enableBlockSelect:{set:function($){this.$blockSelectEnabled=$},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,p){var h=t("../../range").Range,g=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,c,d){var r=m.getLine(d);return this.foldingStartMarker.test(r)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(m,c,d){return null},this.indentationBlock=function(m,c,d){var r=/\S/,o=m.getLine(c),a=o.search(r);if(a!=-1){for(var s=d||o.length,i=m.getLength(),u=c,f=c;++c<i;){var y=m.getLine(c).search(r);if(y!=-1){if(y<=a){var b=m.getTokenAt(c,0);if(!b||b.type!=="string")break}f=c}}if(f>u){var M=m.getLine(f).length;return new h(u,s,f,M)}}},this.openingBracketBlock=function(m,c,d,r,o){var a={row:d,column:r+1},s=m.$findClosingBracket(c,a,o);if(s){var i=m.foldWidgets[s.row];return i==null&&(i=m.getFoldWidget(s.row)),i=="start"&&s.row>a.row&&(s.row--,s.column=m.getLine(s.row).length),h.fromPoints(a,s)}},this.closingBracketBlock=function(m,c,d,r,o){var a={row:d,column:r},s=m.$findOpeningBracket(c,a);if(s)return s.column++,a.column--,h.fromPoints(s,a)}}).call(g.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,p){var h=t("../lib/dom"),g=t("../range").Range,m=t("../config").nls;function c(r,o,a){for(var s=0,i=r.length-1;s<=i;){var u=s+i>>1,f=a(o,r[u]);if(f>0)s=u+1;else if(f<0)i=u-1;else return u}return-(s+1)}function d(r,o,a){var s=r.getAnnotations().sort(g.comparePoints);if(s.length){var i=c(s,{row:o,column:-1},g.comparePoints);i<0&&(i=-i-1),i>=s.length?i=a>0?0:s.length-1:i===0&&a<0&&(i=s.length-1);var u=s[i];if(!(!u||!a)){if(u.row===o){do u=s[i+=a];while(u&&u.row===o);if(!u)return s.slice()}var f=[];o=u.row;do f[a<0?"unshift":"push"](u),u=s[i+=a];while(u&&u.row==o);return f.length&&f}}}n.showErrorMarker=function(r,o){var a=r.session,s=r.getCursorPosition(),i=s.row,u=a.widgetManager.getWidgetsAtRow(i).filter(function(R){return R.type=="errorMarker"})[0];u?u.destroy():i-=o;var f=d(a,i,o),y;if(f){var b=f[0];s.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,s.row=b.row,y=r.renderer.$gutterLayer.$annotations[s.row]}else{if(u)return;y={displayText:[m("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(s.row),r.selection.moveToPosition(s);var M={row:s.row,fixedWidth:!0,coverGutter:!0,el:h.createElement("div"),type:"errorMarker"},$=M.el.appendChild(h.createElement("div")),A=M.el.appendChild(h.createElement("div"));A.className="error_widget_arrow "+y.className;var S=r.renderer.$cursorLayer.getPixelPosition(s).left;A.style.left=S+r.renderer.gutterWidth-5+"px",M.el.className="error_widget_wrapper",$.className="error_widget "+y.className,y.displayText.forEach(function(R,L){$.appendChild(h.createTextNode(R)),L<y.displayText.length-1&&$.appendChild(h.createElement("br"))}),$.appendChild(h.createElement("div"));var E=function(R,L,_){if(L===0&&(_==="esc"||_==="return"))return M.destroy(),{command:"null"}};M.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(E),a.widgetManager.removeLineWidget(M),r.off("changeSelection",M.destroy),r.off("changeSession",M.destroy),r.off("mouseup",M.destroy),r.off("change",M.destroy))},r.keyBinding.addKeyboardHandler(E),r.on("changeSelection",M.destroy),r.on("changeSession",M.destroy),r.on("mouseup",M.destroy),r.on("change",M.destroy),r.session.widgetManager.addLineWidget(M),M.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:M.el.offsetHeight})},h.importCssString(`
2100
+ `),w||(L.start.column=0,L.end.column=E[E.length-1].length),this.selection.setRange(L)}else{R.forEach(function(I){A.substractPoint(I.cursor)});var _=0,k=1/0,O=S.map(function(I){var N=I.cursor,P=x.getLine(N.row),B=P.substr(N.column).search(/\S/g);return B==-1&&(B=0),N.column>_&&(_=N.column),B<k&&(k=B),B});S.forEach(function(I,N){var P=I.cursor,B=_-P.column,F=O[N]-k;B>F?x.insert(P,r.stringRepeat(" ",B-F)):x.remove(new g(P.row,P.column,P.row,P.column-B+F)),I.start.column=I.end.column=_,I.start.row=I.end.row=P.row,I.cursor=I.end}),A.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(x,A){var S=!0,$=!0,R,L,T;return x.map(function(E){var _=E.match(/(\s*)(.*?)(\s*)([=:].*)/);return _?R==null?(R=_[1].length,L=_[2].length,T=_[3].length,_):(R+L+T!=_[1].length+_[2].length+_[3].length&&($=!1),R!=_[1].length&&(S=!1),R>_[1].length&&(R=_[1].length),L<_[2].length&&(L=_[2].length),T>_[3].length&&(T=_[3].length),_):[E]}).map(A?w:S?$?v:w:C);function D(E){return r.stringRepeat(" ",E)}function w(E){return E[2]?D(R)+E[2]+D(L-E[2].length+T)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function v(E){return E[2]?D(R+L-E[2].length)+E[2]+D(T)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function C(E){return E[2]?D(R)+E[2]+D(T)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}}}).call(p.prototype);function y(x,A){return x.row==A.row&&x.column==A.column}n.onSessionChange=function(x){var A=x.session;A&&!A.multiSelect&&(A.$selectionMarkers=[],A.selection.$initRangeList(),A.multiSelect=A.selection),this.multiSelect=A&&A.multiSelect;var S=x.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),A&&(A.multiSelect.on("addRange",this.$onAddRange),A.multiSelect.on("removeRange",this.$onRemoveRange),A.multiSelect.on("multiSelect",this.$onMultiSelect),A.multiSelect.on("singleSelect",this.$onSingleSelect),A.multiSelect.lead.on("change",this.$checkMultiselectChange),A.multiSelect.anchor.on("change",this.$checkMultiselectChange)),A&&this.inMultiSelectMode!=A.selection.inMultiSelectMode&&(A.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b(x){x.$multiselectOnSessionChange||(x.$onAddRange=x.$onAddRange.bind(x),x.$onRemoveRange=x.$onRemoveRange.bind(x),x.$onMultiSelect=x.$onMultiSelect.bind(x),x.$onSingleSelect=x.$onSingleSelect.bind(x),x.$multiselectOnSessionChange=n.onSessionChange.bind(x),x.$checkMultiselectChange=x.$checkMultiselectChange.bind(x),x.$multiselectOnSessionChange(x),x.on("changeSession",x.$multiselectOnSessionChange),x.on("mousedown",c),x.commands.addCommands(o.defaultCommands),M(x))}function M(x){if(!x.textInput)return;var A=x.textInput.getElement(),S=!1;f.addListener(A,"keydown",function(R){var L=R.keyCode==18&&!(R.ctrlKey||R.shiftKey||R.metaKey);x.$blockSelectEnabled&&L?S||(x.renderer.setMouseCursor("crosshair"),S=!0):S&&$()},x),f.addListener(A,"keyup",$,x),f.addListener(A,"blur",$,x);function $(R){S&&(x.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=b,t("./config").defineOptions(p.prototype,"editor",{enableMultiselect:{set:function(x){b(this),x?this.on("mousedown",c):this.off("mousedown",c)},value:!0},enableBlockSelect:{set:function(x){this.$blockSelectEnabled=x},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,d){var h=t("../../range").Range,g=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,c,f){var r=m.getLine(f);return this.foldingStartMarker.test(r)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(m,c,f){return null},this.indentationBlock=function(m,c,f){var r=/\S/,o=m.getLine(c),a=o.search(r);if(a!=-1){for(var s=f||o.length,i=m.getLength(),u=c,p=c;++c<i;){var y=m.getLine(c).search(r);if(y!=-1){if(y<=a){var b=m.getTokenAt(c,0);if(!b||b.type!=="string")break}p=c}}if(p>u){var M=m.getLine(p).length;return new h(u,s,p,M)}}},this.openingBracketBlock=function(m,c,f,r,o){var a={row:f,column:r+1},s=m.$findClosingBracket(c,a,o);if(s){var i=m.foldWidgets[s.row];return i==null&&(i=m.getFoldWidget(s.row)),i=="start"&&s.row>a.row&&(s.row--,s.column=m.getLine(s.row).length),h.fromPoints(a,s)}},this.closingBracketBlock=function(m,c,f,r,o){var a={row:f,column:r},s=m.$findOpeningBracket(c,a);if(s)return s.column++,a.column--,h.fromPoints(s,a)}}).call(g.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,d){var h=t("../lib/dom"),g=t("../range").Range,m=t("../config").nls;function c(r,o,a){for(var s=0,i=r.length-1;s<=i;){var u=s+i>>1,p=a(o,r[u]);if(p>0)s=u+1;else if(p<0)i=u-1;else return u}return-(s+1)}function f(r,o,a){var s=r.getAnnotations().sort(g.comparePoints);if(s.length){var i=c(s,{row:o,column:-1},g.comparePoints);i<0&&(i=-i-1),i>=s.length?i=a>0?0:s.length-1:i===0&&a<0&&(i=s.length-1);var u=s[i];if(!(!u||!a)){if(u.row===o){do u=s[i+=a];while(u&&u.row===o);if(!u)return s.slice()}var p=[];o=u.row;do p[a<0?"unshift":"push"](u),u=s[i+=a];while(u&&u.row==o);return p.length&&p}}}n.showErrorMarker=function(r,o){var a=r.session,s=r.getCursorPosition(),i=s.row,u=a.widgetManager.getWidgetsAtRow(i).filter(function(R){return R.type=="errorMarker"})[0];u?u.destroy():i-=o;var p=f(a,i,o),y;if(p){var b=p[0];s.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,s.row=b.row,y=r.renderer.$gutterLayer.$annotations[s.row]}else{if(u)return;y={displayText:[m("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(s.row),r.selection.moveToPosition(s);var M={row:s.row,fixedWidth:!0,coverGutter:!0,el:h.createElement("div"),type:"errorMarker"},x=M.el.appendChild(h.createElement("div")),A=M.el.appendChild(h.createElement("div"));A.className="error_widget_arrow "+y.className;var S=r.renderer.$cursorLayer.getPixelPosition(s).left;A.style.left=S+r.renderer.gutterWidth-5+"px",M.el.className="error_widget_wrapper",x.className="error_widget "+y.className,y.displayText.forEach(function(R,L){x.appendChild(h.createTextNode(R)),L<y.displayText.length-1&&x.appendChild(h.createElement("br"))}),x.appendChild(h.createElement("div"));var $=function(R,L,T){if(L===0&&(T==="esc"||T==="return"))return M.destroy(),{command:"null"}};M.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler($),a.widgetManager.removeLineWidget(M),r.off("changeSelection",M.destroy),r.off("changeSession",M.destroy),r.off("mouseup",M.destroy),r.off("change",M.destroy))},r.keyBinding.addKeyboardHandler($),r.on("changeSelection",M.destroy),r.on("changeSession",M.destroy),r.on("mouseup",M.destroy),r.on("change",M.destroy),r.session.widgetManager.addLineWidget(M),M.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:M.el.offsetHeight})},h.importCssString(`
2101
2101
  .error_widget_wrapper {
2102
2102
  background: inherit;
2103
2103
  color: inherit;
@@ -2130,10 +2130,10 @@ export const FormManager: React.FC = () => {
2130
2130
  border-left-color: transparent!important;
2131
2131
  top: -5px;
2132
2132
  }
2133
- `,"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(t,n,p){t("./loader_build")(n);var h=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,c=t("./edit_session").EditSession,d=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(a,s){if(typeof a=="string"){var i=a;if(a=document.getElementById(i),!a)throw new Error("ace.edit can't find div #"+i)}if(a&&a.env&&a.env.editor instanceof m)return a.env.editor;var u="";if(a&&/input|textarea/i.test(a.tagName)){var f=a;u=f.value,a=h.createElement("pre"),f.parentNode.replaceChild(a,f)}else a&&(u=a.textContent,a.innerHTML="");var y=n.createEditSession(u),b=new m(new r(a),y,s),M={document:y,editor:b,onResize:b.resize.bind(b,null)};return f&&(M.textarea=f),b.on("destroy",function(){M.editor.container.env=null}),b.container.env=b.env=M,b},n.createEditSession=function(a,s){var i=new c(a,s);return i.setUndoManager(new d),i},n.Range=g,n.Editor=m,n.EditSession=c,n.UndoManager=d,n.VirtualRenderer=r;var o=n.config.version;n.version=o}),(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=(function(){return this})();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var p in t)t.hasOwnProperty(p)&&(n.ace[p]=t[p]);n.ace.default=n.ace,l&&(l.exports=n.ace)})})()})(ts)),ts.exports}var ua=wv();const Cv=Ot(ua),Sv="/formeo/assets/js/mode-json.min.js",Av="/formeo/assets/js/theme-github_light_default.min.js";var ns,$u;function $v(){if($u)return ns;$u=1;function l(e,t,n,p){var h=-1,g=e==null?0:e.length;for(p&&g&&(n=e[++h]);++h<g;)n=t(n,e[h],h,e);return n}return ns=l,ns}var is,xu;function xv(){if(xu)return is;xu=1;function l(e){return function(t){return e?.[t]}}return is=l,is}var rs,Mu;function Mv(){if(Mu)return rs;Mu=1;var l=xv(),e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},t=l(e);return rs=t,rs}var os,Eu;function Ev(){if(Eu)return os;Eu=1;var l=Mv(),e=Kn(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",h="\\u20d0-\\u20ff",g=n+p+h,m="["+g+"]",c=RegExp(m,"g");function d(r){return r=e(r),r&&r.replace(t,l).replace(c,"")}return os=d,os}var ss,_u;function _v(){if(_u)return ss;_u=1;var l=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(l)||[]}return ss=e,ss}var as,Tu;function Tv(){if(Tu)return as;Tu=1;var l=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function e(t){return l.test(t)}return as=e,as}var ls,Lu;function Lv(){if(Lu)return ls;Lu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\u2700-\\u27bf",g="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",c="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",d="\\u2000-\\u206f",r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\ufe0e\\ufe0f",s=m+c+d+r,i="['’]",u="["+s+"]",f="["+p+"]",y="\\d+",b="["+h+"]",M="["+g+"]",$="[^"+l+s+y+h+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+f+"|"+A+")",E="[^"+l+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+o+"]",D="\\u200d",w="(?:"+M+"|"+$+")",v="(?:"+_+"|"+$+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",x="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",T=S+"?",k="["+a+"]?",O="(?:"+D+"(?:"+[E,R,L].join("|")+")"+k+T+")*",I="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+T+O,B="(?:"+[b,R,L].join("|")+")"+P,F=RegExp([_+"?"+M+"+"+C+"(?="+[u,_,"$"].join("|")+")",v+"+"+x+"(?="+[u,_+w,"$"].join("|")+")",_+"?"+w+"+"+C,_+"+"+x,N,I,y,B].join("|"),"g");function H(z){return z.match(F)||[]}return ls=H,ls}var cs,Ru;function Rv(){if(Ru)return cs;Ru=1;var l=_v(),e=Tv(),t=Kn(),n=Lv();function p(h,g,m){return h=t(h),g=m?void 0:g,g===void 0?e(h)?n(h):l(h):h.match(g)||[]}return cs=p,cs}var us,ku;function kv(){if(ku)return us;ku=1;var l=$v(),e=Ev(),t=Rv(),n="['’]",p=RegExp(n,"g");function h(g){return function(m){return l(t(e(m).replace(p,"")),g,"")}}return us=h,us}var hs,Du;function Dv(){if(Du)return hs;Du=1;function l(e,t,n){var p=-1,h=e.length;t<0&&(t=-t>h?0:h+t),n=n>h?h:n,n<0&&(n+=h),h=t>n?0:n-t>>>0,t>>>=0;for(var g=Array(h);++p<h;)g[p]=e[p+t];return g}return hs=l,hs}var ds,Ou;function Ov(){if(Ou)return ds;Ou=1;var l=Dv();function e(t,n,p){var h=t.length;return p=p===void 0?h:p,!n&&p>=h?t:l(t,n,p)}return ds=e,ds}var fs,Iu;function ud(){if(Iu)return fs;Iu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+l+p+h+"]");function c(d){return m.test(d)}return fs=c,fs}var ps,Nu;function Iv(){if(Nu)return ps;Nu=1;function l(e){return e.split("")}return ps=l,ps}var gs,Fu;function Nv(){if(Fu)return gs;Fu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\ufe0e\\ufe0f",g="["+l+"]",m="["+p+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+m+"|"+c+")",r="[^"+l+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="\\u200d",i=d+"?",u="["+h+"]?",f="(?:"+s+"(?:"+[r,o,a].join("|")+")"+u+i+")*",y=u+i+f,b="(?:"+[r+m+"?",m,o,a,g].join("|")+")",M=RegExp(c+"(?="+c+")|"+b+y,"g");function $(A){return A.match(M)||[]}return gs=$,gs}var ms,Pu;function Fv(){if(Pu)return ms;Pu=1;var l=Iv(),e=ud(),t=Nv();function n(p){return e(p)?t(p):l(p)}return ms=n,ms}var vs,Hu;function Pv(){if(Hu)return vs;Hu=1;var l=Ov(),e=ud(),t=Fv(),n=Kn();function p(h){return function(g){g=n(g);var m=e(g)?t(g):void 0,c=m?m[0]:g.charAt(0),d=m?l(m,1).join(""):g.slice(1);return c[h]()+d}}return vs=p,vs}var ys,Wu;function Hv(){if(Wu)return ys;Wu=1;var l=Pv(),e=l("toUpperCase");return ys=e,ys}var bs,zu;function Wv(){if(zu)return bs;zu=1;var l=kv(),e=Hv(),t=l(function(n,p,h){return n+(h?" ":"")+e(p)});return bs=t,bs}var zv=Wv();const Bv=Ot(zv);ua.config.setModuleUrl("ace/mode/json",Sv);ua.config.setModuleUrl("ace/theme/github_light_default",Av);const it=Cv.edit("formData-editor");it.session.setOption("useWorker",!1);it.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const jv=document.getElementById("submit-formData"),Vv=document.getElementById("formData-popover"),Uv=document.getElementById("editor-action-buttons"),Gv=(l,e)=>({renderForm:()=>{const t=document.querySelector(".render-form");t.style.display="block",e.render(l.formData)},getHtml:()=>{e.formData=l.formData;const t=e.html,n=window.open("","_blank");n.document.body.innerHTML=t},getUserData:()=>{console.log(e.userData),console.log("User Form Data:",e.userFormData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{it.setValue(JSON.stringify(l.formData,null,2),1)}}),qv={editData:{popovertarget:"formData-popover"}},Kv=l=>{const e=qv[l]||{};return{id:l,type:"button",...e}},Yv=(l,e)=>{jv.addEventListener("click",()=>{l.formData=it.session.getValue(),Vv.hidePopover()});const t=Gv(l,e);return Object.entries(t).map(([p,h])=>{const g=Kv(p),m=Object.assign(document.createElement("button"),g);for(const[d,r]of Object.entries(g))m.setAttribute(d,r);const c=document.createTextNode(Bv(p));return m.appendChild(c),m.addEventListener("click",h,!1),Uv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Zv);document.getElementById("collapse-json").addEventListener("click",Xv);document.getElementById("copy-json").addEventListener("click",Qv);function Zv(){const l=it.session.getValue(),e=JSON.parse(l);it.setValue(JSON.stringify(e,null,2),1)}function Xv(){const l=it.session.getValue(),e=JSON.parse(l);it.setValue(JSON.stringify(e,null,0),1)}async function Qv({target:l}){const e=l.textContent;l.textContent="Copied!";const t=setTimeout(()=>{l.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(it.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const Jv=l=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=globalThis.sessionStorage.getItem("formeo-locale"),p=({target:{value:g}})=>l.controls.actions.filter(g),h=({target:{value:g}})=>{globalThis.sessionStorage.setItem("formeo-locale",g),l.i18n.setLang(g)};e.addEventListener("input",p),t.value=n||"en-US",t.addEventListener("change",h,!1)};async function ey(l){l.innerHTML=`
2133
+ `,"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(t,n,d){t("./loader_build")(n);var h=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,c=t("./edit_session").EditSession,f=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(a,s){if(typeof a=="string"){var i=a;if(a=document.getElementById(i),!a)throw new Error("ace.edit can't find div #"+i)}if(a&&a.env&&a.env.editor instanceof m)return a.env.editor;var u="";if(a&&/input|textarea/i.test(a.tagName)){var p=a;u=p.value,a=h.createElement("pre"),p.parentNode.replaceChild(a,p)}else a&&(u=a.textContent,a.innerHTML="");var y=n.createEditSession(u),b=new m(new r(a),y,s),M={document:y,editor:b,onResize:b.resize.bind(b,null)};return p&&(M.textarea=p),b.on("destroy",function(){M.editor.container.env=null}),b.container.env=b.env=M,b},n.createEditSession=function(a,s){var i=new c(a,s);return i.setUndoManager(new f),i},n.Range=g,n.Editor=m,n.EditSession=c,n.UndoManager=f,n.VirtualRenderer=r;var o=n.config.version;n.version=o}),(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=(function(){return this})();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var d in t)t.hasOwnProperty(d)&&(n.ace[d]=t[d]);n.ace.default=n.ace,l&&(l.exports=n.ace)})})()})(ns)),ns.exports}var fa=Cv();const Sv=Nt(fa),Av="/formeo/assets/js/mode-json.min.js",xv="/formeo/assets/js/theme-github_light_default.min.js";var is,$u;function Ev(){if($u)return is;$u=1;function l(e,t,n,d){var h=-1,g=e==null?0:e.length;for(d&&g&&(n=e[++h]);++h<g;)n=t(n,e[h],h,e);return n}return is=l,is}var rs,Tu;function Mv(){if(Tu)return rs;Tu=1;function l(e){return function(t){return e?.[t]}}return rs=l,rs}var os,_u;function $v(){if(_u)return os;_u=1;var l=Mv(),e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},t=l(e);return os=t,os}var ss,Lu;function Tv(){if(Lu)return ss;Lu=1;var l=$v(),e=Yn(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",d="\\ufe20-\\ufe2f",h="\\u20d0-\\u20ff",g=n+d+h,m="["+g+"]",c=RegExp(m,"g");function f(r){return r=e(r),r&&r.replace(t,l).replace(c,"")}return ss=f,ss}var as,Ru;function _v(){if(Ru)return as;Ru=1;var l=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(l)||[]}return as=e,as}var ls,ku;function Lv(){if(ku)return ls;ku=1;var l=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function e(t){return l.test(t)}return ls=e,ls}var cs,Du;function Rv(){if(Du)return cs;Du=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",d=e+t+n,h="\\u2700-\\u27bf",g="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",c="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",f="\\u2000-\\u206f",r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="A-Z\\xc0-\\xd6\\xd8-\\xde",a="\\ufe0e\\ufe0f",s=m+c+f+r,i="['’]",u="["+s+"]",p="["+d+"]",y="\\d+",b="["+h+"]",M="["+g+"]",x="[^"+l+s+y+h+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+p+"|"+A+")",$="[^"+l+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",T="["+o+"]",D="\\u200d",w="(?:"+M+"|"+x+")",v="(?:"+T+"|"+x+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",E="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",_=S+"?",k="["+a+"]?",O="(?:"+D+"(?:"+[$,R,L].join("|")+")"+k+_+")*",I="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+_+O,B="(?:"+[b,R,L].join("|")+")"+P,F=RegExp([T+"?"+M+"+"+C+"(?="+[u,T,"$"].join("|")+")",v+"+"+E+"(?="+[u,T+w,"$"].join("|")+")",T+"?"+w+"+"+C,T+"+"+E,N,I,y,B].join("|"),"g");function H(z){return z.match(F)||[]}return cs=H,cs}var us,Ou;function kv(){if(Ou)return us;Ou=1;var l=_v(),e=Lv(),t=Yn(),n=Rv();function d(h,g,m){return h=t(h),g=m?void 0:g,g===void 0?e(h)?n(h):l(h):h.match(g)||[]}return us=d,us}var hs,Iu;function Dv(){if(Iu)return hs;Iu=1;var l=Ev(),e=Tv(),t=kv(),n="['’]",d=RegExp(n,"g");function h(g){return function(m){return l(t(e(m).replace(d,"")),g,"")}}return hs=h,hs}var ds,Nu;function Ov(){if(Nu)return ds;Nu=1;function l(e,t,n){var d=-1,h=e.length;t<0&&(t=-t>h?0:h+t),n=n>h?h:n,n<0&&(n+=h),h=t>n?0:n-t>>>0,t>>>=0;for(var g=Array(h);++d<h;)g[d]=e[d+t];return g}return ds=l,ds}var fs,Fu;function Iv(){if(Fu)return fs;Fu=1;var l=Ov();function e(t,n,d){var h=t.length;return d=d===void 0?h:d,!n&&d>=h?t:l(t,n,d)}return fs=e,fs}var ps,Pu;function hd(){if(Pu)return ps;Pu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",d=e+t+n,h="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+l+d+h+"]");function c(f){return m.test(f)}return ps=c,ps}var gs,Hu;function Nv(){if(Hu)return gs;Hu=1;function l(e){return e.split("")}return gs=l,gs}var ms,Wu;function Fv(){if(Wu)return ms;Wu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",d=e+t+n,h="\\ufe0e\\ufe0f",g="["+l+"]",m="["+d+"]",c="\\ud83c[\\udffb-\\udfff]",f="(?:"+m+"|"+c+")",r="[^"+l+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="\\u200d",i=f+"?",u="["+h+"]?",p="(?:"+s+"(?:"+[r,o,a].join("|")+")"+u+i+")*",y=u+i+p,b="(?:"+[r+m+"?",m,o,a,g].join("|")+")",M=RegExp(c+"(?="+c+")|"+b+y,"g");function x(A){return A.match(M)||[]}return ms=x,ms}var vs,zu;function Pv(){if(zu)return vs;zu=1;var l=Nv(),e=hd(),t=Fv();function n(d){return e(d)?t(d):l(d)}return vs=n,vs}var ys,Bu;function Hv(){if(Bu)return ys;Bu=1;var l=Iv(),e=hd(),t=Pv(),n=Yn();function d(h){return function(g){g=n(g);var m=e(g)?t(g):void 0,c=m?m[0]:g.charAt(0),f=m?l(m,1).join(""):g.slice(1);return c[h]()+f}}return ys=d,ys}var bs,ju;function Wv(){if(ju)return bs;ju=1;var l=Hv(),e=l("toUpperCase");return bs=e,bs}var ws,Vu;function zv(){if(Vu)return ws;Vu=1;var l=Dv(),e=Wv(),t=l(function(n,d,h){return n+(h?" ":"")+e(d)});return ws=t,ws}var Bv=zv();const jv=Nt(Bv);fa.config.setModuleUrl("ace/mode/json",Av);fa.config.setModuleUrl("ace/theme/github_light_default",xv);const rt=Sv.edit("formData-editor");rt.session.setOption("useWorker",!1);rt.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Vv=document.getElementById("submit-formData"),Uv=document.getElementById("formData-popover"),Gv=document.getElementById("editor-action-buttons"),qv=(l,e)=>({renderForm:()=>{const t=document.querySelector(".render-form");t.style.display="block",e.render(l.formData)},getHtml:()=>{e.formData=l.formData;const t=e.html,n=window.open("","_blank");n.document.body.innerHTML=t},getUserData:()=>{console.log(e.userData),console.log("User Form Data:",e.userFormData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{rt.setValue(JSON.stringify(l.formData,null,2),1)}}),Kv={editData:{popovertarget:"formData-popover"}},Yv=l=>{const e=Kv[l]||{};return{id:l,type:"button",...e}},Zv=(l,e)=>{Vv.addEventListener("click",()=>{l.formData=rt.session.getValue(),Uv.hidePopover()});const t=qv(l,e);return Object.entries(t).map(([d,h])=>{const g=Yv(d),m=Object.assign(document.createElement("button"),g);for(const[f,r]of Object.entries(g))m.setAttribute(f,r);const c=document.createTextNode(jv(d));return m.appendChild(c),m.addEventListener("click",h,!1),Gv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Xv);document.getElementById("collapse-json").addEventListener("click",Qv);document.getElementById("copy-json").addEventListener("click",Jv);function Xv(){const l=rt.session.getValue(),e=JSON.parse(l);rt.setValue(JSON.stringify(e,null,2),1)}function Qv(){const l=rt.session.getValue(),e=JSON.parse(l);rt.setValue(JSON.stringify(e,null,0),1)}async function Jv({target:l}){const e=l.textContent;l.textContent="Copied!";const t=setTimeout(()=>{l.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(rt.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const ey=l=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=globalThis.sessionStorage.getItem("formeo-locale"),d=({target:{value:g}})=>l.controls.actions.filter(g),h=({target:{value:g}})=>{globalThis.sessionStorage.setItem("formeo-locale",g),l.i18n.setLang(g)};e.addEventListener("input",d),t.value=n||"en-US",t.addEventListener("change",h,!1)};async function ty(l){l.innerHTML=`
2134
2134
  <form class="build-form"></form>
2135
2135
  <div class="render-form"></div>
2136
- `;const e=new aa(on),t=new la(ca);return Yv(e,t),Jv(e),{editor:e,renderer:t,cleanup:()=>{e?.destroy&&e.destroy(),t?.destroy&&t.destroy();const n=document.getElementById("editor-action-buttons");n&&(n.innerHTML="")}}}class ty{constructor(){if(this.currentFramework=null,this.frameworkContainer=document.getElementById("framework-container"),this.frameworkSelect=document.getElementById("framework-select"),this.currentDemo=null,this.isLoading=!1,this.validFrameworks=["vanilla","angular","react"],!this.frameworkContainer){console.error("Framework container not found");return}if(!this.frameworkSelect){console.error("Framework selector not found");return}this.init()}init(){this.frameworkSelect.addEventListener("change",t=>{this.switchFramework(t.target.value)}),window.addEventListener("popstate",()=>{const t=this.getFrameworkFromURL();this.switchFramework(t,{updateURL:!1})});const e=this.getFrameworkFromURL();this.switchFramework(e)}async switchFramework(e,t={}){const{updateURL:n=!0}=t;if(this.isLoading){console.warn("Framework switch already in progress");return}if(!(this.currentFramework===e&&this.currentDemo!==null)){this.isLoading=!0,this.showLoadingState();try{switch(await this.cleanupCurrentDemo(),this.frameworkContainer.innerHTML="",e){case"vanilla":this.currentDemo=await ey(this.frameworkContainer);break;case"angular":this.currentDemo=await rv(this.frameworkContainer);break;case"react":this.currentDemo=await dv(this.frameworkContainer);break;default:throw new Error(`Unknown framework: ${e}`)}this.currentFramework=e,this.syncFrameworkSelector(e),n&&this.updateURL(e),console.log(`Loaded ${e} demo successfully`)}catch(p){console.error(`Failed to load ${e} demo:`,p),this.showErrorState(e,p)}finally{this.isLoading=!1}}}async cleanupCurrentDemo(){if(this.currentDemo?.cleanup)try{await Promise.resolve(this.currentDemo.cleanup())}catch(e){console.warn("Error during demo cleanup:",e)}this.currentDemo=null}syncFrameworkSelector(e){this.frameworkSelect.value!==e&&(this.frameworkSelect.value=e)}getFrameworkFromURL(){const t=new URLSearchParams(window.location.search).get("framework");return t&&this.validFrameworks.includes(t)?t:"vanilla"}updateURL(e){const t=new URL(window.location);e==="vanilla"?t.searchParams.delete("framework"):t.searchParams.set("framework",e),window.history.pushState({framework:e},"",t.toString())}showLoadingState(){this.frameworkContainer.innerHTML=`
2136
+ `;const e=new ua(an),t=new ha(da);return Zv(e,t),ey(e),{editor:e,renderer:t,cleanup:()=>{e?.destroy&&e.destroy(),t?.destroy&&t.destroy();const n=document.getElementById("editor-action-buttons");n&&(n.innerHTML="")}}}class ny{constructor(){if(this.currentFramework=null,this.frameworkContainer=document.getElementById("framework-container"),this.frameworkSelect=document.getElementById("framework-select"),this.currentDemo=null,this.isLoading=!1,this.validFrameworks=["vanilla","angular","react"],!this.frameworkContainer){console.error("Framework container not found");return}if(!this.frameworkSelect){console.error("Framework selector not found");return}this.init()}init(){this.frameworkSelect.addEventListener("change",t=>{this.switchFramework(t.target.value)}),window.addEventListener("popstate",()=>{const t=this.getFrameworkFromURL();this.switchFramework(t,{updateURL:!1})});const e=this.getFrameworkFromURL();this.switchFramework(e)}async switchFramework(e,t={}){const{updateURL:n=!0}=t;if(this.isLoading){console.warn("Framework switch already in progress");return}if(!(this.currentFramework===e&&this.currentDemo!==null)){this.isLoading=!0,this.showLoadingState();try{switch(await this.cleanupCurrentDemo(),this.frameworkContainer.innerHTML="",e){case"vanilla":this.currentDemo=await ty(this.frameworkContainer);break;case"angular":this.currentDemo=await ov(this.frameworkContainer);break;case"react":this.currentDemo=await fv(this.frameworkContainer);break;default:throw new Error(`Unknown framework: ${e}`)}this.currentFramework=e,this.syncFrameworkSelector(e),n&&this.updateURL(e),console.log(`Loaded ${e} demo successfully`)}catch(d){console.error(`Failed to load ${e} demo:`,d),this.showErrorState(e,d)}finally{this.isLoading=!1}}}async cleanupCurrentDemo(){if(this.currentDemo?.cleanup)try{await Promise.resolve(this.currentDemo.cleanup())}catch(e){console.warn("Error during demo cleanup:",e)}this.currentDemo=null}syncFrameworkSelector(e){this.frameworkSelect.value!==e&&(this.frameworkSelect.value=e)}getFrameworkFromURL(){const t=new URLSearchParams(window.location.search).get("framework");return t&&this.validFrameworks.includes(t)?t:"vanilla"}updateURL(e){const t=new URL(window.location);e==="vanilla"?t.searchParams.delete("framework"):t.searchParams.set("framework",e),window.history.pushState({framework:e},"",t.toString())}showLoadingState(){this.frameworkContainer.innerHTML=`
2137
2137
  <div class="loading-message">
2138
2138
  <p>Loading ${this.frameworkSelect.options[this.frameworkSelect.selectedIndex]?.text||"framework"} demo...</p>
2139
2139
  </div>
@@ -2143,4 +2143,4 @@ export const FormManager: React.FC = () => {
2143
2143
  <p>${t.message}</p>
2144
2144
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('${e}')">Retry</button>
2145
2145
  </div>
2146
- `}}document.addEventListener("DOMContentLoaded",()=>{window.frameworkLoader=new ty});export{km as C,Ve as a,X as m,Xe as t};
2146
+ `}}document.addEventListener("DOMContentLoaded",()=>{window.frameworkLoader=new ny});export{Dm as C,Ue as a,X as m,Je as t};