openc3-cosmos-tool-cmdsender 6.4.1 → 6.4.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.
- checksums.yaml +4 -4
- data/tools/cmdsender/{ArrayWidget-CeyoPOhk-bf9b0dd88328eccbdac8.js → ArrayWidget-D0fKsdTb-860e3ed5c86f5460796c.js} +2 -2
- data/tools/cmdsender/{ArrayplotWidget-BEw4fJPY-79ee9986047064094365.js → ArrayplotWidget-BmRSuGhA-354f295ec32169df21b4.js} +1 -1
- data/tools/cmdsender/{BarColumn-CIWppEH6-86b16400d28b5cf12eeb.js → BarColumn-DtYw6Gmq-8908b58619d24a0583ff.js} +1 -1
- data/tools/cmdsender/{BlockWidget-DRtBkPat-d7a74e01d909b428d1c7.js → BlockWidget-Dpxbw455-b49190e336bbd4b7ba45.js} +2 -2
- data/tools/cmdsender/{ButtonWidget-4GORf9BG-ce69c62c06d52e264388.js → ButtonWidget-8iOpXmpp-6698c9961dbfb680d595.js} +2 -2
- data/tools/cmdsender/CanvasWidget-B0iU38rA-a05a4b31394109c92495.js +1 -0
- data/tools/cmdsender/{CanvasdotWidget-unc83V9l-664dbf51ecb340629f6d.js → CanvasdotWidget-C9viSVBs-194b785c3c1b4c4ed291.js} +1 -1
- data/tools/cmdsender/{CanvasimageWidget-CNPV5Ale-e097e8b62a185f418d79.js → CanvasimageWidget-CFiCpITu-93a11a8b334ffe7c5153.js} +1 -1
- data/tools/cmdsender/{CanvasimagevalueWidget-DsQbSZt_-d1bbb306b7401750ef6b.js → CanvasimagevalueWidget-fu6vbAY0-a94dbd0de06c41ea8e32.js} +1 -1
- data/tools/cmdsender/CanvaslabelWidget-BVqHq3Vp-dcfcf43149749abd604e.js +1 -0
- data/tools/cmdsender/{CanvaslabelvalueWidget-DX-b_55r-d7fb8d8b89880cca5d15.js → CanvaslabelvalueWidget-BOFa8-NU-e805ce15bc1d6b52f78a.js} +1 -1
- data/tools/cmdsender/{CanvaslineWidget-DiNWzbpu-fa31b231c7ee8c60d7aa.js → CanvaslineWidget-l3ko0QXk-86d360a170885fd89eab.js} +1 -1
- data/tools/cmdsender/{CanvaslinevalueWidget-Du9pwAN7-1d6b3f95a25ca02e8e1c.js → CanvaslinevalueWidget-BCZoO-Z6-1bfc0430e4426dafd5eb.js} +1 -1
- data/tools/cmdsender/CheckbuttonWidget-BN7e1d5b-93dfd8ed0c7c33c3522b.js +1 -0
- data/tools/cmdsender/ComboboxWidget-Bb5RGXDB-439c70cac954449044a1.js +1 -0
- data/tools/cmdsender/{CommandSender-558dffc490ddc1afd4c9.js → CommandSender-bbdea757e0bf041e4d7f.js} +39 -39
- data/tools/cmdsender/{CriticalCmdDialog-D4-eoA3P-74e2b7e8a0609626c1db.js → CriticalCmdDialog-BUHsxfpO-6745a41319d426072602.js} +1 -1
- data/tools/cmdsender/{DateWidget-BCmQNavZ-16a599572e6d9494a548.js → DateWidget-Dggqab-F-e3907b805482196ebe4c.js} +1 -1
- data/tools/cmdsender/{DetailsDialog-OMd7LWdZ-a8be692010271e46f3e3.js → DetailsDialog-BhSAQDSK-3424d51e17a01e6eeb99.js} +1 -1
- data/tools/cmdsender/{DynamicWidget-CfMtj7H8-a6d97f331347d76c2891.js → DynamicWidget-CfMtj7H8-dc1d38370ac4b15d76da.js} +1 -1
- data/tools/cmdsender/{FormatvalueWidget-CPn5mDHY-1f9074ade1e81724e27c.js → FormatvalueWidget-B9_PbzY2-4d0e6ab2ea3be7b8f135.js} +1 -1
- data/tools/cmdsender/{Graph-vUcIyyTp-c0193bfd663efcef8936.js → Graph-B29y4d5A-d25c05c9ed88d0cd5e1c.js} +1 -1
- data/tools/cmdsender/{GraphWidget-Cl97QQYm-cbd9cbdf78de5d0f3eee.js → GraphWidget-oBxPa3EB-327673cc6d263b940f5a.js} +1 -1
- data/tools/cmdsender/{HorizontalWidget-CtTkQHl--7f6286a291dfde56c9f6.js → HorizontalWidget-BWgZL_Oz-42a127adf75449df0b7c.js} +1 -1
- data/tools/cmdsender/HorizontalboxWidget-yMYUnNB8-be7a05a56b20bb4d1b83.js +1 -0
- data/tools/cmdsender/HorizontallineWidget-C4zMx7z2-96e9b322bf564211a4bd.js +1 -0
- data/tools/cmdsender/{IframeWidget-BmZOip3U-22d09e58ab5b31e544b8.js → IframeWidget-DA4P_mJT-5c6fefe54eb95a46df6d.js} +1 -1
- data/tools/cmdsender/{ImageLoader-wYNaGuuz-8f548a04834b32cec8e5.js → ImageLoader-rvd9t-mk-f267788299156ef5efbc.js} +1 -1
- data/tools/cmdsender/{ImageviewerWidget-ByuTqBHq-f67b7c9b195d7e58c7c7.js → ImageviewerWidget-B1wK0hK4-b485332d9e6a324c255b.js} +1 -1
- data/tools/cmdsender/{LabelWidget-Dmb5F5j--e753708c2ec6d563c364.js → LabelWidget-CY0saBoK-ebf54b966bd216fb43d4.js} +1 -1
- data/tools/cmdsender/LabelledWidget-B3ZOYaGy-5413e7a07cca59017430.js +1 -0
- data/tools/cmdsender/LabelprogressbarWidget-CmXcESTg-44cb900e2dd857b1fc52.js +1 -0
- data/tools/cmdsender/{LabelsparklineWidget-BaoIdd7s-68f94c64f3c77ce499cd.js → LabelsparklineWidget-D_yrQrn6-e7bbfab1dda92b3d3064.js} +1 -1
- data/tools/cmdsender/LabelvalueWidget-dNaNfsBE-cff370c45ed8e3a01aac.js +1 -0
- data/tools/cmdsender/{LabelvaluedescWidget-BBHwqvj4-c9c13c2c44a1c1d9da56.js → LabelvaluedescWidget-3vNoH6Mc-6b1c14327d11b22c7115.js} +1 -1
- data/tools/cmdsender/LabelvaluelimitsbarWidget-7VppYVIN-37ba858afb67fdc0f792.js +1 -0
- data/tools/cmdsender/LabelvaluelimitscolumnWidget-BZ6nwifg-1e8e8dd6fff878086a60.js +1 -0
- data/tools/cmdsender/{LabelvaluerangebarWidget-B83Jj5Q1-7fd4452f7327c6cbeac0.js → LabelvaluerangebarWidget-IyuXLNsw-2b5c09183aff43189d5b.js} +1 -1
- data/tools/cmdsender/Layout-BqMhhhws-7b4db6d4bd9f3af7ee70.js +1 -0
- data/tools/cmdsender/{LedWidget-Cccb8YTk-e916aa32192d63686a88.js → LedWidget-DSxpmIOK-1cc09b38abad29ca3cbd.js} +1 -1
- data/tools/cmdsender/{LimitsbarWidget-D1EBBwX1-9517915b8dfebd92c067.js → LimitsbarWidget-BoPTdVV5-6c34a7d8bb3376d6b18b.js} +1 -1
- data/tools/cmdsender/{LimitscolorWidget--1aPSNVB-53ef695265764cb9533b.js → LimitscolorWidget-Bt3qOvrv-269e91c17e5498e0788f.js} +1 -1
- data/tools/cmdsender/{LimitscolumnWidget-swnMNApm-99ec4239e5c2c67470f4.js → LimitscolumnWidget-Ce6YnUBz-5ae032d46ec3b0a20155.js} +1 -1
- data/tools/cmdsender/{LinegraphWidget-BbI-wOnq-625d0a67813311079f4b.js → LinegraphWidget-XAbg0jj2-17c6fa9203aad781fe6d.js} +1 -1
- data/tools/cmdsender/MatrixbycolumnsWidget-5MgJFZtz-160b2613bd4af454ccb2.js +1 -0
- data/tools/cmdsender/{ProgressbarWidget-7rJeuX6H-3a953930740e7dea1a1a.js → ProgressbarWidget-CDwDOFIy-3b99e030ad6cee6b1122.js} +1 -1
- data/tools/cmdsender/{RadiobuttonWidget-DsEw3JiU-7ccba1f22b63b555d006.js → RadiobuttonWidget-cQ8V8LaD-144329e63a425c5b293e.js} +1 -1
- data/tools/cmdsender/RadiogroupWidget-BvRnuGA2-8309440492b54da9cdcb.js +1 -0
- data/tools/cmdsender/{RangebarWidget-BEGvSL_K-b2f64181a0435cfd04d0.js → RangebarWidget-aHmgV0qs-23e3b6a113ed0ed71c67.js} +1 -1
- data/tools/cmdsender/{RollupWidget-BZhspgWd-ae7f774bf95a218e1bbb.js → RollupWidget-D1jUPrUQ-5c71dcbbca38febc3650.js} +1 -1
- data/tools/cmdsender/{ScrollwindowWidget-qZ3nhhVU-891aada8aea47585589e.js → ScrollwindowWidget-Cn0o3b4E-746d23b0fad1a0a46cf4.js} +1 -1
- data/tools/cmdsender/{SignalWidget-Bh14Zrch-b4d906a368f583b7717c.js → SignalWidget-BQBzqdU--89528964fba3585f8c42.js} +1 -1
- data/tools/cmdsender/{SpacerWidget-D_NE46jZ-c5d025d73351dc0ecc36.js → SpacerWidget-C0RmQY3t-a68c94227c2c06290fe0.js} +1 -1
- data/tools/cmdsender/{SparklineWidget-CJEEJdZ--32c41c68df8280fd69b3.js → SparklineWidget-BTH9rvcX-9e98a11dfd16d252c08a.js} +1 -1
- data/tools/cmdsender/TabbookWidget-C-aDdEoD-5794e71c3b2d7a79b79d.js +1 -0
- data/tools/cmdsender/TextboxWidget-Dd2ccpUQ-6af7af083b0d25119784.js +1 -0
- data/tools/cmdsender/TextfieldWidget-DY3aFTnP-4cf5a29161e465f16079.js +1 -0
- data/tools/cmdsender/{TimeWidget-AFOTVB4w-75165645af9e9b3d72b6.js → TimeWidget-C_site21-734b43972a3c1d371db6.js} +1 -1
- data/tools/cmdsender/{TitleWidget-CbS_wrQw-ff6a12a4df9daaccc7d7.js → TitleWidget-Bx81VfQD-33e2f20d3d8a5fb8c7a0.js} +1 -1
- data/tools/cmdsender/{VWidget-BlF_o-7Z-7b9e33ee5a0896c4b20b.js → VWidget-DuUens7G-af61cac7327bc4ec55a2.js} +1 -1
- data/tools/cmdsender/ValueWidget-cbjxVV3B-faca9f64422b9360d059.js +1 -0
- data/tools/cmdsender/ValuelimitsbarWidget-cQb2o_xH-a8157cfdee4165a02bc8.js +1 -0
- data/tools/cmdsender/{ValuelimitscolumnWidget-Bs91VFLz-61578a06db7e42ee2de0.js → ValuelimitscolumnWidget-BBTuSCK9-ea8cd3cd3e7912c87919.js} +1 -1
- data/tools/cmdsender/{ValuerangebarWidget-C7WHyR2h-8940b5b3addeea132129.js → ValuerangebarWidget-Ct7iGtu0-477f537c84af2877525b.js} +1 -1
- data/tools/cmdsender/{VerticalWidget-COP5oVCK-4f72878cb3791f8f4185.js → VerticalWidget-DJn02myf-9185e1d52a85c9bb1641.js} +1 -1
- data/tools/cmdsender/VerticalboxWidget-DHQMxtF3-657db9f65c1c1c5dda7b.js +1 -0
- data/tools/cmdsender/{Widget-cmJ76_g1-c0b8f1d2fd80a5bd8d1e.js → Widget-CP2CtyUr-d173f31bab26b6f950b0.js} +1 -1
- data/tools/cmdsender/{main-3c9571b980a0517d1332.js → main-94417d14e198415d3456.js} +46 -46
- data/tools/cmdsender/main.js +1 -1
- metadata +69 -69
- data/tools/cmdsender/CanvasWidget-VW1uHIU0-b0629675c22e70e0578c.js +0 -1
- data/tools/cmdsender/CanvaslabelWidget-B-5KAkZr-d707833faaa6e2caad37.js +0 -1
- data/tools/cmdsender/CheckbuttonWidget--QM-segm-28a0e881bf1c435d44b5.js +0 -1
- data/tools/cmdsender/ComboboxWidget-BDpHIcCo-3c8a64b8ee2f10586e6a.js +0 -1
- data/tools/cmdsender/HorizontalboxWidget-Dn9zVn4r-f71cd9cebec5c105c9ae.js +0 -1
- data/tools/cmdsender/HorizontallineWidget-BBvYWaP7-4fec9a79e8bfdd8de98a.js +0 -1
- data/tools/cmdsender/LabelledWidget-DV1IbbPS-e79cb7834731864d994a.js +0 -1
- data/tools/cmdsender/LabelprogressbarWidget-BHBDYVZp-3483f4e22fff689fb690.js +0 -1
- data/tools/cmdsender/LabelvalueWidget-wuW55zQP-1c85ba3400f15273a4e3.js +0 -1
- data/tools/cmdsender/LabelvaluelimitsbarWidget-77Rc3lCf-dc30352a30a075537f3b.js +0 -1
- data/tools/cmdsender/LabelvaluelimitscolumnWidget-nounrACl-af788b8cb01a8560ba2a.js +0 -1
- data/tools/cmdsender/Layout-ByQC7nQ3-81a8278bafc64c77cabf.js +0 -1
- data/tools/cmdsender/MatrixbycolumnsWidget-Bx2qMr8P-a8727244e3d1660689ec.js +0 -1
- data/tools/cmdsender/RadiogroupWidget-DhfbTvQ8-93dd7b7983554cd9db4b.js +0 -1
- data/tools/cmdsender/TabbookWidget-C-SU65IF-1b01148338ce683536f5.js +0 -1
- data/tools/cmdsender/TextboxWidget-Dn1Ds-b0-4e4c40f37b064d38bfeb.js +0 -1
- data/tools/cmdsender/TextfieldWidget-C0C7NL53-43e6cd15df70ba359da1.js +0 -1
- data/tools/cmdsender/ValueWidget-DFUfM5tw-da4f51d71cc8faaffe32.js +0 -1
- data/tools/cmdsender/ValuelimitsbarWidget-CALgABsT-10a3ca1f247bbea3461a.js +0 -1
- data/tools/cmdsender/VerticalboxWidget-CDPoOx4C-48f445f5788517c883a7.js +0 -1
data/tools/cmdsender/{CommandSender-558dffc490ddc1afd4c9.js → CommandSender-bbdea757e0bf041e4d7f.js}
RENAMED
@@ -1,13 +1,13 @@
|
|
1
|
-
System.register(["./main-
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(__vite_style__);const I="openc3-ace-vim-mode-enabled",M="ace/keyboard/vim",X$1={isVimModeEnabled(){return localStorage.getItem(I)==="true"},setVimMode(c){localStorage.setItem(I,JSON.stringify(!!c))},toggleVimMode(c){this.isVimModeEnabled()?(c.setKeyboardHandler(null),this.setVimMode(!1)):(c.setKeyboardHandler(M),this.setVimMode(!0)),c.focus()},applyVimModeIfEnabled(c,{saveFn:u}={}){this.isVimModeEnabled()?(c.setKeyboardHandler(M),ace.config.loadModule(M,g=>{g.CodeMirror.Vim.defineEx("write","w",p=>{typeof u=="function"?u():p.ace.execCommand("save")})})):c.setKeyboardHandler(null)}},Y$1={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(c){return c.replaceAll(" ","-").toLowerCase()},subMenuClick(c){c.command(c),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},z$1={class:"app-title mr-2"};function J(c,u,g,p,Se,D){const _=resolveComponent("v-col"),x=resolveComponent("v-row"),a=resolveComponent("v-icon"),h=resolveComponent("v-btn"),i=resolveComponent("v-divider"),r=resolveComponent("v-list-item-title"),o=resolveComponent("v-list-item"),t=resolveComponent("v-list"),e=resolveComponent("v-menu"),n=resolveComponent("v-radio"),s=resolveComponent("v-list-item-action"),f=resolveComponent("v-radio-group"),m=resolveComponent("v-checkbox");return openBlock(),createBlock(Teleport,{to:"#openc3-menu"},[createVNode(x,{"no-gutters":""},{default:withCtx(()=>[createVNode(_,{"align-self":"end"},{default:withCtx(()=>[createElementVNode("span",z$1,toDisplayString(g.title),1)]),_:1})]),_:1}),createVNode(x,{dense:"",class:"flex-nowrap"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(g.menus,(A,E)=>(openBlock(),createBlock(e,{ref_for:!0,ref:"topmenu",key:E},{activator:withCtx(({props:S})=>[createVNode(h,mergeProps({ref_for:!0},S,{variant:"outlined",class:"mx-1 menu-button",text:A.label,"data-test":D.formatDT(`${g.title} ${A.label}`)}),{append:withCtx(()=>[createVNode(a,{class:"menu-button-icon"},{default:withCtx(()=>u[0]||(u[0]=[createTextVNode(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(A.items,(S,C)=>(openBlock(),createElementBlock(Fragment,null,[S.divider?(openBlock(),createBlock(i,{key:C+"-divider"})):S.subMenu&&S.subMenu.length>0?(openBlock(),createElementBlock("div",{key:C+"-submenu"},[(openBlock(),createBlock(e,{"open-on-hover":"",location:"right",key:C},{activator:withCtx(({props:q})=>[(openBlock(),createBlock(o,mergeProps({ref_for:!0},q,{disabled:S.disabled,key:C}),createSlots({append:withCtx(()=>[createVNode(a,null,{default:withCtx(()=>u[1]||(u[1]=[createTextVNode(" mdi-chevron-right ")])),_:1})]),default:withCtx(()=>[!S.radio&&!S.checkbox?(openBlock(),createBlock(r,{key:0,style:normalizeStyle("cursor: pointer;"+(S.disabled?"opacity: 0.2":""))},{default:withCtx(()=>[createTextVNode(toDisplayString(S.label),1)]),_:2},1032,["style"])):createCommentVNode("",!0)]),_:2},[S.icon?{name:"prepend",fn:withCtx(()=>[createVNode(a,{disabled:S.disabled},{default:withCtx(()=>[createTextVNode(toDisplayString(S.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S.subMenu,(q,Be)=>(openBlock(),createBlock(o,{key:Be,"prepend-icon":q.icon,onClick:se=>D.subMenuClick(q)},{default:withCtx(()=>[createVNode(r,null,{default:withCtx(()=>[createTextVNode(toDisplayString(q.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):S.radioGroup?(openBlock(),createBlock(f,{"model-value":S.value,"onUpdate:modelValue":S.command,key:C+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S.choices,(q,Be)=>(openBlock(),createBlock(o,{key:Be+"-choice"},{default:withCtx(()=>[createVNode(s,{class:"list-action"},{default:withCtx(()=>[createVNode(n,{color:"secondary",label:q.label,value:q.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(openBlock(),createBlock(o,{onClick:q=>S.command(S),disabled:S.disabled,"data-test":D.formatDT(`${g.title} ${A.label} ${S.label}`),key:C+"-list"},createSlots({default:withCtx(()=>[S.checkbox?(openBlock(),createBlock(s,{key:0,class:"list-action"},{default:withCtx(()=>[createVNode(m,{modelValue:S.checked,"onUpdate:modelValue":q=>S.checked=q,label:S.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):createCommentVNode("",!0),!S.radio&&!S.checkbox?(openBlock(),createBlock(r,{key:1,style:normalizeStyle("cursor: pointer;"+(S.disabled?"opacity: 0.2":""))},{default:withCtx(()=>[createTextVNode(toDisplayString(S.label),1)]),_:2},1032,["style"])):createCommentVNode("",!0)]),_:2},[S.icon?{name:"prepend",fn:withCtx(()=>[createVNode(a,{icon:S.icon,disabled:S.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Z$1=d(Y$1,[["render",J],["__scopeId","data-v-4d454b93"]]);let Q$1=class{constructor(){FA.get("/openc3-api/autocomplete/data/screen").then(u=>{this.autocompleteData=u.data}),this.api=new BA}async getCompletions(u,g,p,Se,D){let _=g.getLine(p.row).slice(0,p.column).trimStart().split(/ (?![^<]*>)/),x=this.autocompleteData;_.length>1&&(x=x.find(i=>i.caption===_[0]));let a={},h=!0;if(x&&x.params){x.params.length==_.length-1&&(h=!1);let i=x.params[_.length-2];if(i["Target name"])x=(await this.api.get_target_names()).reduce((r,o)=>(r[o]=1,r),{});else if(i["Packet name"]){let r=_[_.length-2];x=(await this.api.get_all_tlm(r)).reduce((o,t)=>(o[t.packet_name]=t.description,o),{})}else if(i["Item name"]){let r=_[_.length-3],o=_[_.length-2];x=(await this.api.get_tlm(r,o)).items.reduce((t,e)=>(t[e.name]=e.description,t),{})}else x=i;a=Object.keys(x||{}).map(r=>{let o={value:r+(h?" ":""),command:h&&"startAutocomplete"};return typeof x[r]=="string"&&(o.meta=x[r]),o})}else a=x;D(null,a)}};const ee$1={props:{modelValue:Boolean,target:{type:String,default:""},screen:{type:String,default:""},definition:{type:String,default:""},keywords:{type:Array,default:()=>[]},errors:{type:Array,default:()=>[]}},data(){return{file:null,docsKeyword:"",contextMenu:!1,menuX:0,menuY:0}},computed:{editErrors:function(){if(this.definition===""&&!this.file)return["Input can not be blank."];if(this.errors.length!==0){let c=new Set,u=[];const g=this.errors.toSorted((p,Se)=>p.lineNumber-Se.lineNumber);for(const p of g){let Se=`At ${p.lineNumber}: (${p.line}) ${p.message}.`;p.usage&&(Se+=` Usage: ${p.usage}`),u.push(Se),c.add(p.message)}return u}return[]},show:{get(){return this.modelValue},set(c){this.$emit("update:modelValue",c)}}},mounted:function(){this.editor=bA.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight");const c=this.buildScreenMode();this.editor.session.setMode(new c),this.editor.session.setTabSize(2),this.editor.session.setUseWrapMode(!0),this.editor.$blockScrolling=1/0,this.editor.setOption("enableBasicAutocompletion",!0),this.editor.setOption("enableLiveAutocompletion",!0),this.editor.completers=[new Q$1],this.editor.setHighlightActiveLine(!1),this.editor.setValue(this.definition),this.editor.clearSelection(),X$1.applyVimModeIfEnabled(this.editor),this.editor.focus()},beforeUnmount(){this.editor.destroy(),this.editor.container.remove()},methods:{toggleVimMode:function(){X$1.toggleVimMode(this.editor)},showContextMenu:function(c){this.menuX=c.pageX,this.menuY=c.pageY;let u=this.editor.getCursorPosition(),g=this.editor.session.getTokenAt(u.row,u.column);if(g){let p=g.value.trim();p.includes(" ")?this.docsKeyword=p.split(" ")[0]:this.docsKeyword=p,this.contextMenu=!0}},openDocumentation(){window.open(`${window.location.origin}/tools/staticdocs/docs/configuration/telemetry-screens#${this.docsKeyword.toLowerCase()}`,"_blank")},buildScreenMode(){let c=bA.require("ace/lib/oop"),u=bA.require("ace/mode/text_highlight_rules").TextHighlightRules,g=this.keywords.join("|"),p=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"\\b\\d+(?:\\.\\d+)?\\b"},{token:"keyword",regex:new RegExp(`^\\s*(${g})\\b`)}]},this.normalizeRules()};c.inherits(p,u);let Se=function(){this.HighlightRules=p},D=bA.require("ace/mode/text").Mode;return c.inherits(Se,D),(function(){this.$id="ace/mode/openc3"}).call(Se.prototype),Se},downloadScreen:function(){const c=new Blob([this.editor.getValue()],{type:"text/plain"}),u=document.createElement("a");u.href=URL.createObjectURL(c),u.setAttribute("download",`${this.screen.toLowerCase()}.txt`),u.click()},loadFile:function(){const c=new FileReader;c.readAsText(this.file);const u=this;c.onload=function(){u.editor.setValue(c.result),u.file=null}},deleteScreen:function(){this.$dialog.confirm("Are you sure you want to delete this screen?!",{okText:"Delete",cancelText:"Cancel"}).then(c=>{this.$emit("delete")})}}},te$1=["textContent"];function ne$1(c,u,g,p,Se,D){const _=resolveComponent("v-btn"),x=resolveComponent("v-spacer"),a=resolveComponent("v-toolbar"),h=resolveComponent("v-row"),i=resolveComponent("v-file-input"),r=resolveComponent("v-list-item-title"),o=resolveComponent("v-list-item"),t=resolveComponent("v-divider"),e=resolveComponent("v-list"),n=resolveComponent("v-menu"),s=resolveComponent("v-card-text"),f=resolveComponent("v-card"),m=resolveComponent("v-dialog");return openBlock(),createBlock(m,{modelValue:D.show,"onUpdate:modelValue":u[5]||(u[5]=A=>D.show=A),persistent:"",width:"75vw"},{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[createVNode(a,{height:"24"},{default:withCtx(()=>[createVNode(_,{class:"mx-2",icon:"mdi-delete",variant:"text",density:"compact","data-test":"delete-screen-icon",onClick:D.deleteScreen},null,8,["onClick"]),createVNode(x),createElementVNode("span",null," Edit Screen: "+toDisplayString(g.target)+" "+toDisplayString(g.screen),1),createVNode(x),createVNode(_,{class:"mx-2",icon:"mdi-download",variant:"text",density:"compact","data-test":"download-screen-icon",onClick:D.downloadScreen},null,8,["onClick"])]),_:1}),createVNode(s,{style:{"max-height":"90vh"}},{default:withCtx(()=>[createVNode(h,{class:"mt-3"},{default:withCtx(()=>u[6]||(u[6]=[createTextVNode(" Upload a screen file. ")])),_:1}),createVNode(h,{"no-gutters":"",align:"center"},{default:withCtx(()=>[createVNode(_,{disabled:!Se.file,color:"primary",class:"mr-3","data-test":"edit-screen-load",onClick:D.loadFile},{default:withCtx(()=>u[7]||(u[7]=[createTextVNode(" Load ")])),_:1},8,["disabled","onClick"]),createVNode(i,{modelValue:Se.file,"onUpdate:modelValue":u[0]||(u[0]=A=>Se.file=A),"truncate-length":"15",accept:".txt",label:"Click to select .txt screen file."},null,8,["modelValue"])]),_:1}),createVNode(h,{class:"mb-2"},{default:withCtx(()=>u[8]||(u[8]=[createTextVNode(" Edit the screen definition. ")])),_:1}),createVNode(h,{class:"mb-2"},{default:withCtx(()=>[createElementVNode("pre",{ref:"editor",class:"editor",onContextmenu:u[1]||(u[1]=withModifiers((...A)=>D.showContextMenu&&D.showContextMenu(...A),["prevent"]))},null,544),createVNode(n,{modelValue:Se.contextMenu,"onUpdate:modelValue":u[2]||(u[2]=A=>Se.contextMenu=A),target:[Se.menuX,Se.menuY]},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>[createVNode(o,{link:""},{default:withCtx(()=>[createVNode(r,{onClick:D.openDocumentation},{default:withCtx(()=>[createTextVNode(toDisplayString(Se.docsKeyword)+" documentation ",1)]),_:1},8,["onClick"])]),_:1}),createVNode(t),createVNode(o,{title:"Toggle Vim mode","prepend-icon":"extras:vim",onClick:D.toggleVimMode},null,8,["onClick"])]),_:1})]),_:1},8,["modelValue","target"])]),_:1}),createVNode(h,{style:{"max-height":"120px","overflow-y":"auto"}},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(D.editErrors,(A,E)=>(openBlock(),createElementBlock("div",{key:E},[createElementVNode("span",{class:"text-red",textContent:toDisplayString(A)},null,8,te$1)]))),128))]),_:1}),createVNode(h,{class:"mt-5"},{default:withCtx(()=>[u[11]||(u[11]=createElementVNode("span",null,"Ctrl-space brings up autocomplete. Right click keywords for documentation.",-1)),createVNode(x),createVNode(_,{class:"mx-2",variant:"outlined","data-test":"edit-screen-cancel",onClick:u[3]||(u[3]=A=>c.$emit("cancel"))},{default:withCtx(()=>u[9]||(u[9]=[createTextVNode(" Cancel ")])),_:1}),createVNode(_,{class:"mx-2",color:"primary","data-test":"edit-screen-save",onClick:u[4]||(u[4]=A=>c.$emit("save",c.editor.getValue()))},{default:withCtx(()=>u[10]||(u[10]=[createTextVNode(" Save ")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const ie$1=d(ee$1,[["render",ne$1],["__scopeId","data-v-0caab967"]]),L=20,ye$1={components:{EditScreenDialog:ie$1},mixins:[UA],props:{target:{type:String,default:""},screen:{type:String,default:""},definition:{type:String,default:""},keywords:{type:Array,default:()=>[]},initialFloated:{type:Boolean,default:!1},initialTop:{type:Number,default:0},initialLeft:{type:Number,default:0},initialZ:{type:Number,default:0},minZ:{type:Number,default:0},fixFloated:{type:Boolean,default:!1},count:{type:Number,default:0},showClose:{type:Boolean,default:!0},timeZone:{type:String,default:"local"},inline:{type:Boolean,default:!1}},data(){return{api:null,backup:"",currentDefinition:this.definition,editDialog:!1,expand:!0,configParser:null,configError:!1,currentLayout:null,layoutStack:[],namedWidgets:{},dynamicWidgets:[],width:null,height:null,staleTime:30,cacheTimeout:.1,globalSettings:[],substitute:!1,original_target_name:null,force_substitute:!1,pollingPeriod:1,errors:[],errorDialog:!1,screenKey:null,dragX:0,dragY:0,floated:this.initialFloated,top:this.initialTop,left:this.initialLeft,zIndex:this.initialZ,changeCounter:0,screenItems:[],screenValues:{},updateCounter:0,screenId:IS.uniqueId("openc3-screen_")}},computed:{error:function(){if(this.errorDialog&&this.errors.length>0){let c=new Set,u="";for(const g of this.errors){if(c.has(g.message))continue;let p=`${g.time}: (${g.type}) ${g.message}
|
3
|
-
`;u+=p,c.add(g.message)}return u}return null},computedStyle(){var c;let u={};const g=this.width||((c=this.$refs.bar)==null?void 0:c.clientWidth);return this.floated&&(u.position="absolute",u.top=this.top+"px",u.left=this.left+"px",u.width=g+"px"),u}},watch:{count:{handler(c,u){this.currentDefinition=this.definition,this.rerender()}}},errorCaptured(c,u,g){return this.errors.length<L&&(c.usage?this.errors.push({type:"usage",message:c.message,usage:c.usage,line:c.line,lineNumber:c.lineNumber,time:new Date().getTime()}):this.errors.push({type:"error",message:c,time:new Date().getTime()}),console.log(this.errors),this.configError=!0),!1},created(){this.api=new BA,this.configParser=new WA,this.parseDefinition(),this.screenKey=Math.floor(Math.random()*1e6)},mounted(){this.updateRefreshInterval(),this.floated&&(this.$refs.bar.onmousedown=this.dragMouseDown,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex)},unmounted(){this.updater!=null&&(clearInterval(this.updater),this.updater=null)},methods:{open(c,u){this.$parent.showScreen(c,u)},close(c,u){this.$parent.closeScreenByName(c,u)},closeAll(){this.$parent.closeAll()},clearErrors:function(){this.errors=[],this.configError=!1},updateRefreshInterval:function(){let c=this.pollingPeriod*1e3;this.updater&&clearInterval(this.updater),this.updater=setInterval(()=>{this.update()},c)},parseDefinition:function(){if(this.clearErrors(),this.namedWidgets={},this.layoutStack=[],this.dynamicWidgets=[],this.layoutStack.push({type:"VerticalWidget",parameters:[],widgets:[]}),this.currentLayout=this.layoutStack[this.layoutStack.length-1],this.configParser.parse_string(this.currentDefinition,"",!1,!0,(c,u,g,p)=>{if(c)switch(c){case"SCREEN":this.configParser.verify_num_parameters(3,4,`${c} <Width or AUTO> <Height or AUTO> <Polling Period>`),this.width=parseInt(u[0]),this.height=parseInt(u[1]),this.pollingPeriod=parseFloat(u[2]);break;case"END":this.configParser.verify_num_parameters(0,0,`${c}`),this.layoutStack.pop(),this.currentLayout=this.layoutStack[this.layoutStack.length-1];break;case"STALE_TIME":this.configParser.verify_num_parameters(1,1,`${c} <Time (s)>`),this.staleTime=parseInt(u[0]);break;case"SETTING":case"SUBSETTING":(this.currentLayout.widgets[this.currentLayout.widgets.length-1]??this.currentLayout).settings.push(u);break;case"GLOBAL_SETTING":case"GLOBAL_SUBSETTING":this.globalSettings.push(u);break;default:this.processWidget(c,u,g,p);break}}),typeof this.layoutStack[0]>"u"){let c=[],u=[];for(const g of this.dynamicWidgets)c.push(g.name),u.push(g.lineNumber);this.errors.length<L&&(this.errors.push({type:"usage",message:`Unknown widget! Are these widgets: ${c.join(",")}?`,lineNumber:u.join(","),time:new Date().getTime()}),this.configError=!0),this.layoutStack[0]={type:"VerticalWidget",parameters:[],widgets:[]}}else this.applyGlobalSettings(this.layoutStack[0].widgets)},openEdit:function(){this.backup=this.currentDefinition.repeat(1),this.editDialog=!0},upScreen:function(){this.zIndex+=1,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex])},downScreen:function(){this.zIndex>this.minZ&&(this.zIndex-=1,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex]))},floatScreen:function(){if(this.floated)this.$refs.bar.onmousedown=null,this.$refs.bar.parentElement.parentElement.style="z-index: 0",this.floated=!1,this.$emit("unfloat-screen",[this.floated,this.top,this.left,this.zIndex]);else{let c=this.$refs.bar.parentElement.parentElement.parentElement.getBoundingClientRect(),u=this.$refs.bar.getBoundingClientRect();this.top=u.top-c.top-5,this.left=u.left-c.left-5,this.$refs.bar.onmousedown=this.dragMouseDown,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.floated=!0,this.$emit("float-screen",[this.floated,this.top,this.left,this.zIndex])}},dragMouseDown:function(c){c=c||window.event,c.preventDefault(),this.dragX=c.clientX,this.dragY=c.clientY,document.onmouseup=this.closeDragElement,document.onmousemove=this.elementDrag},elementDrag:function(c){c=c||window.event,c.preventDefault();let u=this.dragX-c.clientX,g=this.dragY-c.clientY;this.dragX=c.clientX,this.dragY=c.clientY,this.top=this.$refs.bar.offsetTop-g,this.left=this.$refs.bar.offsetLeft-u,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex])},closeDragElement:function(){document.onmouseup=null,document.onmousemove=null},rerender:function(){this.parseDefinition(),this.updateRefreshInterval(),this.screenKey=Math.floor(Math.random()*1e6),this.$nextTick(function(){this.clearErrors(),this.$emit("edit-screen")})},cancelEdit:function(){this.file=null,this.editDialog=!1,this.currentDefinition=this.backup,this.rerender()},saveEdit:function(c){this.editDialog=!1,this.currentDefinition=c,this.rerender(),this.$nextTick(function(){FA.post("/openc3-api/screen/",{data:{scope:window.openc3Scope,target:this.target,screen:this.screen,text:this.currentDefinition}},0)})},deleteScreen:function(){this.editDialog=!1,FA.delete(`/openc3-api/screen/${this.target}/${this.screen}`).then(c=>{this.$emit("delete-screen")})},minMaxTransition:function(){this.expand=!this.expand,this.$emit("min-max-screen")},processWidget:function(c,u,g,p){let Se=null;c==="NAMED_WIDGET"&&(this.configParser.verify_num_parameters(2,null,`${c} <Widget Name> <Widget Type> <Widget Settings... (optional)>`),Se=u[0].toUpperCase(),c=u[1].toUpperCase(),u=u.slice(2,u.length));const D=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase()+"Widget";let _=[];if(_.push(["__SCREEN_ID__",this.screenId]),Se!==null&&_.push(["NAMED_WIDGET",Se]),c==="VERTICAL"||c==="VERTICALBOX"||c==="HORIZONTAL"||c==="HORIZONTALBOX"||c==="MATRIXBYCOLUMNS"||c==="TABBOOK"||c==="TABITEM"||c==="CANVAS"||c==="RADIOGROUP"||c==="SCROLLWINDOW"){const x={type:D,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,widgets:[]};this.layoutStack.push(x),this.currentLayout.widgets.push(x),this.currentLayout=x}else if(this.$options.components[D])this.currentLayout.widgets.push({type:D,target:this.target,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,line:g,lineNumber:p});else{let x={type:"DynamicWidget",target:this.target,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,name:D,line:g,lineNumber:p};this.currentLayout.widgets.push(x),this.dynamicWidgets.push(x)}},applyGlobalSettings:function(c){c.forEach(u=>{this.globalSettings.forEach(g=>{u.type.toLowerCase()===g[0].toLowerCase()+"widget"&&(u.settings.find(p=>p[0]===g[1])||u.settings.push(g.slice(1)))}),u.widgets&&this.applyGlobalSettings(u.widgets)})},update:function(){this.screenItems.length!==0&&this.configError===!1&&this.api.get_tlm_values(this.screenItems,this.staleTime,this.cacheTimeout).then(c=>{this.clearErrors(),this.updateValues(c)}).catch(c=>{let u=JSON.stringify(c,null,2);u.includes("no response received")||(this.configError=!0),this.errors.find(g=>g.message===u)||this.errors.length<L&&this.errors.push({type:"error",message:u,time:new Date().getTime()})})},updateValues:function(c){this.updateCounter+=1;for(let u=0;u<c.length;u++)c[u].push(this.updateCounter),this.screenValues[this.screenItems[u]]=c[u]},addItem:function(c){this.screenItems.push(c),this.screenValues[c]=[null,null,0]},deleteItem:function(c){let u=this.screenItems.indexOf(c);this.screenItems.splice(u,1)}}},_e={ref:"screen",class:"pa-1",style:{position:"relative"}},be$1={key:1,class:"pa-1",style:{position:"relative"}};function xe(c,u,g,p,Se,D){const _=resolveComponent("v-btn"),x=resolveComponent("v-tooltip"),a=resolveComponent("v-spacer"),h=resolveComponent("v-toolbar"),i=resolveComponent("v-overlay"),r=resolveComponent("vertical-widget"),o=resolveComponent("v-expand-transition"),t=resolveComponent("v-card"),e=resolveComponent("edit-screen-dialog"),n=resolveComponent("v-textarea"),s=resolveComponent("v-dialog");return openBlock(),createElementBlock("div",{ref:"bar",style:normalizeStyle(D.computedStyle)},[g.inline?createCommentVNode("",!0):(openBlock(),createBlock(t,{key:0,"min-height":Se.height,"min-width":Se.width,style:{cursor:"default"}},{default:withCtx(()=>[createVNode(h,{height:"24"},{default:withCtx(()=>[withDirectives(createVNode(_,{icon:"mdi-alert",variant:"text",density:"compact","data-test":"error-graph-icon","aria-label":"Show Errors",onClick:u[0]||(u[0]=()=>{Se.errorDialog=!0})},null,512),[[vShow,Se.errors.length!==0]]),createVNode(_,{icon:"mdi-pencil",variant:"text",density:"compact","data-test":"edit-screen-icon","aria-label":"Edit Screen",onClick:D.openEdit},null,8,["onClick"]),g.fixFloated?createCommentVNode("",!0):(openBlock(),createBlock(x,{key:0,"open-delay":600,location:"top"},{activator:withCtx(({props:f})=>[createElementVNode("div",normalizeProps(guardReactiveProps(f)),[createVNode(_,{icon:Se.floated?"mdi-balloon":"mdi-view-grid-outline",variant:"text","data-test":"float-screen-icon","aria-label":Se.floated?"Unfloat Screen":"Float Screen",onClick:D.floatScreen},null,8,["icon","aria-label","onClick"])],16)]),default:withCtx(()=>[createElementVNode("span",null,toDisplayString(Se.floated?"Unfloat Screen":"Float Screen"),1)]),_:1})),Se.floated?(openBlock(),createBlock(x,{key:1,"open-delay":600,location:"top"},{activator:withCtx(({props:f})=>[createElementVNode("div",normalizeProps(guardReactiveProps(f)),[createVNode(_,{icon:"mdi-arrow-up",variant:"text","data-test":"up-screen-icon","aria-label":"Move Screen Up",onClick:D.upScreen},null,8,["onClick"])],16)]),default:withCtx(()=>[u[8]||(u[8]=createElementVNode("span",null," Move Screen Up ",-1))]),_:1})):createCommentVNode("",!0),Se.floated&&Se.zIndex>g.minZ?(openBlock(),createBlock(x,{key:2,"open-delay":600,location:"top"},{activator:withCtx(({props:f})=>[createElementVNode("div",normalizeProps(guardReactiveProps(f)),[createVNode(_,{icon:"mdi-arrow-down",variant:"text","data-test":"down-screen-icon","aria-label":"Move Screen Down",onClick:D.downScreen},null,8,["onClick"])],16)]),default:withCtx(()=>[u[9]||(u[9]=createElementVNode("span",null," Move Screen Down ",-1))]),_:1})):createCommentVNode("",!0),createVNode(a),createElementVNode("span",null,toDisplayString(g.target)+" "+toDisplayString(g.screen),1),createVNode(a),Se.expand?(openBlock(),createBlock(_,{key:3,icon:"mdi-window-minimize",variant:"text",density:"compact","data-test":"minimize-screen-icon","aria-label":"Minimize Screen",onClick:D.minMaxTransition},null,8,["onClick"])):(openBlock(),createBlock(_,{key:4,icon:"mdi-window-maximize",variant:"text","data-test":"maximize-screen-icon","aria-label":"Maximize Screen",onClick:D.minMaxTransition},null,8,["onClick"])),g.showClose?(openBlock(),createBlock(_,{key:5,icon:"mdi-close-box",variant:"text",density:"compact","data-test":"close-screen-icon","aria-label":"Close Screen",onClick:u[1]||(u[1]=f=>c.$emit("close-screen"))})):createCommentVNode("",!0)]),_:1}),Se.editDialog?createCommentVNode("",!0):(openBlock(),createBlock(o,{key:0},{default:withCtx(()=>[withDirectives(createElementVNode("div",_e,[createVNode(i,{style:{"pointer-events":"none"},"model-value":Se.errors.length!==0,opacity:"0.8",absolute:"",attach:"","scroll-strategy":"none"},null,8,["model-value"]),(openBlock(),createBlock(r,{key:Se.screenKey,widgets:Se.layoutStack[0].widgets,"screen-values":Se.screenValues,"screen-time-zone":g.timeZone,onAddItem:D.addItem,onDeleteItem:D.deleteItem,onOpen:D.open,onClose:D.close,onCloseAll:D.closeAll},null,8,["widgets","screen-values","screen-time-zone","onAddItem","onDeleteItem","onOpen","onClose","onCloseAll"]))],512),[[vShow,Se.expand]])]),_:1}))]),_:1},8,["min-height","min-width"])),g.inline?(openBlock(),createElementBlock("div",be$1,[createVNode(i,{style:{"pointer-events":"none"},"model-value":Se.errors.length!==0,opacity:"0.8",absolute:"",attach:"","scroll-strategy":"none"},null,8,["model-value"]),withDirectives(createVNode(_,{icon:"mdi-alert",variant:"text",density:"compact","data-test":"error-graph-icon","aria-label":"Show Errors",onClick:u[2]||(u[2]=()=>{Se.errorDialog=!0})},null,512),[[vShow,Se.errors.length!==0]]),(openBlock(),createBlock(r,{key:Se.screenKey,widgets:Se.layoutStack[0].widgets,"screen-values":Se.screenValues,"screen-time-zone":g.timeZone,onAddItem:D.addItem,onDeleteItem:D.deleteItem,onOpen:D.open,onClose:D.close,onCloseAll:D.closeAll},null,8,["widgets","screen-values","screen-time-zone","onAddItem","onDeleteItem","onOpen","onClose","onCloseAll"]))])):createCommentVNode("",!0),Se.editDialog?(openBlock(),createBlock(e,{key:2,modelValue:Se.editDialog,"onUpdate:modelValue":u[3]||(u[3]=f=>Se.editDialog=f),target:g.target,screen:g.screen,definition:Se.currentDefinition,keywords:g.keywords,errors:Se.errors,onSave:u[4]||(u[4]=f=>D.saveEdit(f)),onCancel:u[5]||(u[5]=f=>D.cancelEdit()),onDelete:u[6]||(u[6]=f=>D.deleteScreen())},null,8,["modelValue","target","screen","definition","keywords","errors"])):createCommentVNode("",!0),createVNode(s,{modelValue:Se.errorDialog,"onUpdate:modelValue":u[7]||(u[7]=f=>Se.errorDialog=f),width:"60vw"},{default:withCtx(()=>[createVNode(h,{height:"24"},{default:withCtx(()=>[createVNode(a),createElementVNode("span",null," Screen: "+toDisplayString(g.target)+" "+toDisplayString(g.screen)+" Errors ",1),createVNode(a)]),_:1}),createVNode(t,null,{default:withCtx(()=>[createVNode(n,{class:"errors",readonly:"",rows:"13","model-value":D.error},null,8,["model-value"])]),_:1})]),_:1},8,["modelValue"])],4)}const Ie$1=d(ye$1,[["render",xe],["__scopeId","data-v-b9a096c9"]]);var sprintf$1={},hasRequiredSprintf;function requireSprintf(){return hasRequiredSprintf||(hasRequiredSprintf=1,function(c){(function(){var u={not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function g(x){return Se(_(x),arguments)}function p(x,a){return g.apply(null,[x].concat(a||[]))}function Se(x,a){var h=1,i=x.length,r,o="",t,e,n,s,f,m,A,E;for(t=0;t<i;t++)if(typeof x[t]=="string")o+=x[t];else if(typeof x[t]=="object"){if(n=x[t],n.keys)for(r=a[h],e=0;e<n.keys.length;e++){if(r==null)throw new Error(g('[sprintf] Cannot access property "%s" of undefined value "%s"',n.keys[e],n.keys[e-1]));r=r[n.keys[e]]}else n.param_no?r=a[n.param_no]:r=a[h++];if(u.not_type.test(n.type)&&u.not_primitive.test(n.type)&&r instanceof Function&&(r=r()),u.numeric_arg.test(n.type)&&typeof r!="number"&&isNaN(r))throw new TypeError(g("[sprintf] expecting number but found %T",r));switch(u.number.test(n.type)&&(A=r>=0),n.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,n.width?parseInt(n.width):0);break;case"e":r=n.precision?parseFloat(r).toExponential(n.precision):parseFloat(r).toExponential();break;case"f":r=n.precision?parseFloat(r).toFixed(n.precision):parseFloat(r);break;case"g":r=n.precision?String(Number(r.toPrecision(n.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=n.precision?r.substring(0,n.precision):r;break;case"t":r=String(!!r),r=n.precision?r.substring(0,n.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=n.precision?r.substring(0,n.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=n.precision?r.substring(0,n.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase();break}u.json.test(n.type)?o+=r:(u.number.test(n.type)&&(!A||n.sign)?(E=A?"+":"-",r=r.toString().replace(u.sign,"")):E="",f=n.pad_char?n.pad_char==="0"?"0":n.pad_char.charAt(1):" ",m=n.width-(E+r).length,s=n.width&&m>0?f.repeat(m):"",o+=n.align?E+r+s:f==="0"?E+s+r:s+E+r)}return o}var D=Object.create(null);function _(x){if(D[x])return D[x];for(var a=x,h,i=[],r=0;a;){if((h=u.text.exec(a))!==null)i.push(h[0]);else if((h=u.modulo.exec(a))!==null)i.push("%");else if((h=u.placeholder.exec(a))!==null){if(h[2]){r|=1;var o=[],t=h[2],e=[];if((e=u.key.exec(t))!==null)for(o.push(e[1]);(t=t.substring(e[0].length))!=="";)if((e=u.key_access.exec(t))!==null)o.push(e[1]);else if((e=u.index_access.exec(t))!==null)o.push(e[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");h[2]=o}else r|=2;if(r===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:h[0],param_no:h[1],keys:h[2],sign:h[3],pad_char:h[4],align:h[5],width:h[6],precision:h[7],type:h[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(h[0].length)}return D[x]=i}c.sprintf=g,c.vsprintf=p,typeof window<"u"&&(window.sprintf=g,window.vsprintf=p)})()}(sprintf$1)),sprintf$1}requireSprintf();var ace$1={exports:{}},hasRequiredAce;function requireAce(){return hasRequiredAce||(hasRequiredAce=1,function(c,u){(function(){var g="ace",p=function(){return this}();!p&&typeof window<"u"&&(p=window);var Se=function(i,r,o){if(typeof i!="string"){Se.original?Se.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(o=r),Se.modules[i]||(Se.payloads[i]=o,Se.modules[i]=null)};Se.modules={},Se.payloads={};var D=function(i,r,o){if(typeof r=="string"){var t=a(i,r);if(t!=null)return o&&o(),t}else if(Object.prototype.toString.call(r)==="[object Array]"){for(var e=[],n=0,s=r.length;n<s;++n){var f=a(i,r[n]);if(f==null&&_.original)return;e.push(f)}return o&&o.apply(null,e)||!0}},_=function(i,r){var o=D("",i,r);return o==null&&_.original?_.original.apply(this,arguments):o},x=function(i,r){if(r.indexOf("!")!==-1){var o=r.split("!");return x(i,o[0])+"!"+x(i,o[1])}if(r.charAt(0)=="."){var t=i.split("/").slice(0,-1).join("/");for(r=t+"/"+r;r.indexOf(".")!==-1&&e!=r;){var e=r;r=r.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return r},a=function(i,r){r=x(i,r);var o=Se.modules[r];if(!o){if(o=Se.payloads[r],typeof o=="function"){var t={},e={id:r,uri:"",exports:t,packaged:!0},n=function(f,m){return D(r,f,m)},s=o(n,t,e);t=s||e.exports,Se.modules[r]=t,delete Se.payloads[r]}o=Se.modules[r]=t||o}return o};function h(i){var r=p;p[i]||(p[i]={}),r=p[i],(!r.define||!r.define.packaged)&&(Se.original=r.define,r.define=Se,r.define.packaged=!0),(!r.require||!r.require.packaged)&&(_.original=r.require,r.require=_,r.require.packaged=!0)}h(g)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(g,p,Se){function D(_,x,a){Object.defineProperty(_,x,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||D(String.prototype,"startsWith",function(_,x){return x=x||0,this.lastIndexOf(_,x)===x}),String.prototype.endsWith||D(String.prototype,"endsWith",function(_,x){var a=this;(x===void 0||x>a.length)&&(x=a.length),x-=_.length;var h=a.indexOf(_,x);return h!==-1&&h===x}),String.prototype.repeat||D(String.prototype,"repeat",function(_){for(var x="",a=this;_>0;)_&1&&(x+=a),(_>>=1)&&(a+=a);return x}),String.prototype.includes||D(String.prototype,"includes",function(_,x){return this.indexOf(_,x)!=-1}),Object.assign||(Object.assign=function(_){if(_==null)throw new TypeError("Cannot convert undefined or null to object");for(var x=Object(_),a=1;a<arguments.length;a++){var h=arguments[a];h!=null&&Object.keys(h).forEach(function(i){x[i]=h[i]})}return x}),Object.values||(Object.values=function(_){return Object.keys(_).map(function(x){return _[x]})}),Array.prototype.find||D(Array.prototype,"find",function(_){for(var x=this.length,a=arguments[1],h=0;h<x;h++){var i=this[h];if(_.call(a,i,h,this))return i}}),Array.prototype.findIndex||D(Array.prototype,"findIndex",function(_){for(var x=this.length,a=arguments[1],h=0;h<x;h++){var i=this[h];if(_.call(a,i,h,this))return h}}),Array.prototype.includes||D(Array.prototype,"includes",function(_,x){return this.indexOf(_,x)!=-1}),Array.prototype.fill||D(Array.prototype,"fill",function(_){for(var x=this,a=x.length>>>0,h=arguments[1],i=h>>0,r=i<0?Math.max(a+i,0):Math.min(i,a),o=arguments[2],t=o===void 0?a:o>>0,e=t<0?Math.max(a+t,0):Math.min(t,a);r<e;)x[r]=_,r++;return x}),Array.of||D(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(g,p,Se){g("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(g,p,Se){p.deepCopy=function D(_){if(typeof _!="object"||!_)return _;var x;if(Array.isArray(_)){x=[];for(var a=0;a<_.length;a++)x[a]=D(_[a]);return x}if(Object.prototype.toString.call(_)!=="[object Object]")return _;x={};for(var a in _)x[a]=D(_[a]);return x}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(g,p,Se){p.last=function(x){return x[x.length-1]},p.stringReverse=function(x){return x.split("").reverse().join("")},p.stringRepeat=function(x,a){for(var h="";a>0;)a&1&&(h+=x),(a>>=1)&&(x+=x);return h};var D=/^\s\s*/,_=/\s\s*$/;p.stringTrimLeft=function(x){return x.replace(D,"")},p.stringTrimRight=function(x){return x.replace(_,"")},p.copyObject=function(x){var a={};for(var h in x)a[h]=x[h];return a},p.copyArray=function(x){for(var a=[],h=0,i=x.length;h<i;h++)x[h]&&typeof x[h]=="object"?a[h]=this.copyObject(x[h]):a[h]=x[h];return a},p.deepCopy=g("./deep_copy").deepCopy,p.arrayToMap=function(x){for(var a={},h=0;h<x.length;h++)a[x[h]]=1;return a},p.createMap=function(x){var a=Object.create(null);for(var h in x)a[h]=x[h];return a},p.arrayRemove=function(x,a){for(var h=0;h<=x.length;h++)a===x[h]&&x.splice(h,1)},p.escapeRegExp=function(x){return x.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},p.escapeHTML=function(x){return(""+x).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},p.getMatchOffsets=function(x,a){var h=[];return x.replace(a,function(i){h.push({offset:arguments[arguments.length-2],length:i.length})}),h},p.deferredCall=function(x){var a=null,h=function(){a=null,x()},i=function(r){return i.cancel(),a=setTimeout(h,r||0),i};return i.schedule=i,i.call=function(){return this.cancel(),x(),i},i.cancel=function(){return clearTimeout(a),a=null,i},i.isPending=function(){return a},i},p.delayedCall=function(x,a){var h=null,i=function(){h=null,x()},r=function(o){h==null&&(h=setTimeout(i,o||a))};return r.delay=function(o){h&&clearTimeout(h),h=setTimeout(i,o||a)},r.schedule=r,r.call=function(){this.cancel(),x()},r.cancel=function(){h&&clearTimeout(h),h=null},r.isPending=function(){return h},r},p.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},p.skipEmptyMatch=function(x,a,h){return h&&x.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(g,p,Se){p.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},p.getOS=function(){return p.isMac?p.OS.MAC:p.isLinux?p.OS.LINUX:p.OS.WINDOWS};var D=typeof navigator=="object"?navigator:{},_=(/mac|win|linux/i.exec(D.platform)||["other"])[0].toLowerCase(),x=D.userAgent||"",a=D.appName||"";p.isWin=_=="win",p.isMac=_=="mac",p.isLinux=_=="linux",p.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((x.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((x.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),p.isOldIE=p.isIE&&p.isIE<9,p.isGecko=p.isMozilla=x.match(/ Gecko\/\d+/),p.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",p.isWebKit=parseFloat(x.split("WebKit/")[1])||void 0,p.isChrome=parseFloat(x.split(" Chrome/")[1])||void 0,p.isSafari=parseFloat(x.split(" Safari/")[1])&&!p.isChrome||void 0,p.isEdge=parseFloat(x.split(" Edge/")[1])||void 0,p.isAIR=x.indexOf("AdobeAIR")>=0,p.isAndroid=x.indexOf("Android")>=0,p.isChromeOS=x.indexOf(" CrOS ")>=0,p.isIOS=/iPad|iPhone|iPod/.test(x)&&!window.MSStream,p.isIOS&&(p.isMac=!0),p.isMobile=p.isIOS||p.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(g,p,Se){var D=g("./useragent"),_="http://www.w3.org/1999/xhtml";p.buildDom=function o(t,e,n){if(typeof t=="string"&&t){var s=document.createTextNode(t);return e&&e.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&e&&e.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var f=[],m=0;m<t.length;m++){var A=o(t[m],e,n);A&&f.push(A)}return f}var E=document.createElement(t[0]),S=t[1],C=1;S&&typeof S=="object"&&!Array.isArray(S)&&(C=2);for(var m=C;m<t.length;m++)o(t[m],E,n);return C==2&&Object.keys(S).forEach(function(q){var Be=S[q];q==="class"?E.className=Array.isArray(Be)?Be.join(" "):Be:typeof Be=="function"||q=="value"||q[0]=="$"?E[q]=Be:q==="ref"?n&&(n[Be]=E):q==="style"?typeof Be=="string"&&(E.style.cssText=Be):Be!=null&&E.setAttribute(q,Be)}),e&&e.appendChild(E),E},p.getDocumentHead=function(o){return o||(o=document),o.head||o.getElementsByTagName("head")[0]||o.documentElement},p.createElement=function(o,t){return document.createElementNS?document.createElementNS(t||_,o):document.createElement(o)},p.removeChildren=function(o){o.innerHTML=""},p.createTextNode=function(o,t){var e=t?t.ownerDocument:document;return e.createTextNode(o)},p.createFragment=function(o){var t=o?o.ownerDocument:document;return t.createDocumentFragment()},p.hasCssClass=function(o,t){var e=(o.className+"").split(/\s+/g);return e.indexOf(t)!==-1},p.addCssClass=function(o,t){p.hasCssClass(o,t)||(o.className+=" "+t)},p.removeCssClass=function(o,t){for(var e=o.className.split(/\s+/g);;){var n=e.indexOf(t);if(n==-1)break;e.splice(n,1)}o.className=e.join(" ")},p.toggleCssClass=function(o,t){for(var e=o.className.split(/\s+/g),n=!0;;){var s=e.indexOf(t);if(s==-1)break;n=!1,e.splice(s,1)}return n&&e.push(t),o.className=e.join(" "),n},p.setCssClass=function(o,t,e){e?p.addCssClass(o,t):p.removeCssClass(o,t)},p.hasCssString=function(o,t){var e=0,n;if(t=t||document,n=t.querySelectorAll("style")){for(;e<n.length;)if(n[e++].id===o)return!0}},p.removeElementById=function(o,t){t=t||document,t.getElementById(o)&&t.getElementById(o).remove()};var x,a=[];p.useStrictCSP=function(o){x=o,o==!1?h():a||(a=[])};function h(){var o=a;a=null,o&&o.forEach(function(t){i(t[0],t[1])})}function i(o,t,e){if(!(typeof document>"u")){if(a){if(e)h();else if(e===!1)return a.push([o,t])}if(!x){var n=e;!e||!e.getRootNode?n=document:(n=e.getRootNode(),(!n||n==e)&&(n=document));var s=n.ownerDocument||n;if(t&&p.hasCssString(t,n))return null;t&&(o+=`
|
4
|
-
/*# sourceURL=ace/css/`+t+" */");var
|
1
|
+
System.register(["./main-94417d14e198415d3456.js","vue","./CriticalCmdDialog-BUHsxfpO-6745a41319d426072602.js","./DetailsDialog-BhSAQDSK-3424d51e17a01e6eeb99.js","vue-router","single-spa","vuex","vuetify"],function(exports,module){"use strict";var d,UA,FA,BA,WA,IS,bA,_export_sfc,we$1,resolveComponent,createBlock,openBlock,Teleport,createVNode,withCtx,createElementVNode,toDisplayString,createElementBlock,Fragment,renderList,createTextVNode,mergeProps,createSlots,createCommentVNode,normalizeStyle,withDirectives,vShow,normalizeProps,guardReactiveProps,withModifiers,normalizeClass,N,P;return{setters:[c=>{d=c.d,UA=c.U,FA=c.F,BA=c.B,WA=c.W,IS=c.I,bA=c.b,_export_sfc=c._,we$1=c.w},c=>{resolveComponent=c.resolveComponent,createBlock=c.createBlock,openBlock=c.openBlock,Teleport=c.Teleport,createVNode=c.createVNode,withCtx=c.withCtx,createElementVNode=c.createElementVNode,toDisplayString=c.toDisplayString,createElementBlock=c.createElementBlock,Fragment=c.Fragment,renderList=c.renderList,createTextVNode=c.createTextVNode,mergeProps=c.mergeProps,createSlots=c.createSlots,createCommentVNode=c.createCommentVNode,normalizeStyle=c.normalizeStyle,withDirectives=c.withDirectives,vShow=c.vShow,normalizeProps=c.normalizeProps,guardReactiveProps=c.guardReactiveProps,withModifiers=c.withModifiers,normalizeClass=c.normalizeClass},c=>{N=c.N},c=>{P=c.P},null,null,null,null],execute:function(){var __vite_style__=document.createElement("style");__vite_style__.textContent=`.container[data-v-b19a55d5] .v-select__selections{width:auto}.v-overflow-btn[data-v-b19a55d5]{margin-top:0}.container[data-v-b19a55d5]{padding:0}.hazardous[data-v-b19a55d5] .v-select__selection-text{color:#ffdc00!important}.editor[data-v-80865e28]{margin-left:30px;height:50px;width:95%;position:relative;font-size:16px}
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(__vite_style__);const I="openc3-ace-vim-mode-enabled",M="ace/keyboard/vim",X$1={isVimModeEnabled(){return localStorage.getItem(I)==="true"},setVimMode(c){localStorage.setItem(I,JSON.stringify(!!c))},toggleVimMode(c){this.isVimModeEnabled()?(c.setKeyboardHandler(null),this.setVimMode(!1)):(c.setKeyboardHandler(M),this.setVimMode(!0)),c.focus()},applyVimModeIfEnabled(c,{saveFn:u}={}){this.isVimModeEnabled()?(c.setKeyboardHandler(M),ace.config.loadModule(M,f=>{f.CodeMirror.Vim.defineEx("write","w",p=>{typeof u=="function"?u():p.ace.execCommand("save")})})):c.setKeyboardHandler(null)}},Y$1={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(c){return c.replaceAll(" ","-").toLowerCase()},subMenuClick(c){c.command(c),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},z$1={class:"app-title mr-2"};function J(c,u,f,p,Se,D){const _=resolveComponent("v-col"),x=resolveComponent("v-row"),a=resolveComponent("v-icon"),h=resolveComponent("v-btn"),i=resolveComponent("v-divider"),r=resolveComponent("v-list-item-title"),o=resolveComponent("v-list-item"),t=resolveComponent("v-list"),e=resolveComponent("v-menu"),n=resolveComponent("v-radio"),s=resolveComponent("v-list-item-action"),g=resolveComponent("v-radio-group"),m=resolveComponent("v-checkbox");return openBlock(),createBlock(Teleport,{to:"#openc3-menu"},[createVNode(x,{"no-gutters":""},{default:withCtx(()=>[createVNode(_,{"align-self":"end"},{default:withCtx(()=>[createElementVNode("span",z$1,toDisplayString(f.title),1)]),_:1})]),_:1}),createVNode(x,{dense:"",class:"flex-nowrap"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(f.menus,(A,E)=>(openBlock(),createBlock(e,{ref_for:!0,ref:"topmenu",key:E},{activator:withCtx(({props:S})=>[createVNode(h,mergeProps({ref_for:!0},S,{variant:"outlined",class:"mx-1 menu-button",text:A.label,"data-test":D.formatDT(`${f.title} ${A.label}`)}),{append:withCtx(()=>[createVNode(a,{class:"menu-button-icon"},{default:withCtx(()=>u[0]||(u[0]=[createTextVNode(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(A.items,(S,C)=>(openBlock(),createElementBlock(Fragment,null,[S.divider?(openBlock(),createBlock(i,{key:C+"-divider"})):S.subMenu&&S.subMenu.length>0?(openBlock(),createElementBlock("div",{key:C+"-submenu"},[(openBlock(),createBlock(e,{"open-on-hover":"",location:"right",key:C},{activator:withCtx(({props:q})=>[(openBlock(),createBlock(o,mergeProps({ref_for:!0},q,{disabled:S.disabled,key:C}),createSlots({append:withCtx(()=>[createVNode(a,null,{default:withCtx(()=>u[1]||(u[1]=[createTextVNode(" mdi-chevron-right ")])),_:1})]),default:withCtx(()=>[!S.radio&&!S.checkbox?(openBlock(),createBlock(r,{key:0,style:normalizeStyle("cursor: pointer;"+(S.disabled?"opacity: 0.2":""))},{default:withCtx(()=>[createTextVNode(toDisplayString(S.label),1)]),_:2},1032,["style"])):createCommentVNode("",!0)]),_:2},[S.icon?{name:"prepend",fn:withCtx(()=>[createVNode(a,{disabled:S.disabled},{default:withCtx(()=>[createTextVNode(toDisplayString(S.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S.subMenu,(q,Be)=>(openBlock(),createBlock(o,{key:Be,"prepend-icon":q.icon,onClick:se=>D.subMenuClick(q)},{default:withCtx(()=>[createVNode(r,null,{default:withCtx(()=>[createTextVNode(toDisplayString(q.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):S.radioGroup?(openBlock(),createBlock(g,{"model-value":S.value,"onUpdate:modelValue":S.command,key:C+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(S.choices,(q,Be)=>(openBlock(),createBlock(o,{key:Be+"-choice"},{default:withCtx(()=>[createVNode(s,{class:"list-action"},{default:withCtx(()=>[createVNode(n,{color:"secondary",label:q.label,value:q.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(openBlock(),createBlock(o,{onClick:q=>S.command(S),disabled:S.disabled,"data-test":D.formatDT(`${f.title} ${A.label} ${S.label}`),key:C+"-list"},createSlots({default:withCtx(()=>[S.checkbox?(openBlock(),createBlock(s,{key:0,class:"list-action"},{default:withCtx(()=>[createVNode(m,{modelValue:S.checked,"onUpdate:modelValue":q=>S.checked=q,label:S.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):createCommentVNode("",!0),!S.radio&&!S.checkbox?(openBlock(),createBlock(r,{key:1,style:normalizeStyle("cursor: pointer;"+(S.disabled?"opacity: 0.2":""))},{default:withCtx(()=>[createTextVNode(toDisplayString(S.label),1)]),_:2},1032,["style"])):createCommentVNode("",!0)]),_:2},[S.icon?{name:"prepend",fn:withCtx(()=>[createVNode(a,{icon:S.icon,disabled:S.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Z$1=d(Y$1,[["render",J],["__scopeId","data-v-4d454b93"]]);let Q$1=class{constructor(){FA.get("/openc3-api/autocomplete/data/screen").then(u=>{this.autocompleteData=u.data}),this.api=new BA}async getCompletions(u,f,p,Se,D){let _=f.getLine(p.row).slice(0,p.column).trimStart().split(/ (?![^<]*>)/),x=this.autocompleteData;_.length>1&&(x=x.find(i=>i.caption===_[0]));let a={},h=!0;if(x&&x.params){x.params.length==_.length-1&&(h=!1);let i=x.params[_.length-2];if(i["Target name"])x=(await this.api.get_target_names()).reduce((r,o)=>(r[o]=1,r),{});else if(i["Packet name"]){let r=_[_.length-2];x=(await this.api.get_all_tlm(r)).reduce((o,t)=>(o[t.packet_name]=t.description,o),{})}else if(i["Item name"]){let r=_[_.length-3],o=_[_.length-2];x=(await this.api.get_tlm(r,o)).items.reduce((t,e)=>(t[e.name]=e.description,t),{})}else x=i;a=Object.keys(x||{}).map(r=>{let o={value:r+(h?" ":""),command:h&&"startAutocomplete"};return typeof x[r]=="string"&&(o.meta=x[r]),o})}else a=x;D(null,a)}};const ee$1={props:{modelValue:Boolean,target:{type:String,default:""},screen:{type:String,default:""},definition:{type:String,default:""},keywords:{type:Array,default:()=>[]},errors:{type:Array,default:()=>[]}},emits:["cancel","delete","save","update:modelValue"],data(){return{file:null,docsKeyword:"",contextMenu:!1,menuX:0,menuY:0}},computed:{editErrors:function(){if(this.definition===""&&!this.file)return["Input can not be blank."];if(this.errors.length!==0){let c=new Set,u=[];const f=this.errors.toSorted((p,Se)=>p.lineNumber-Se.lineNumber);for(const p of f){let Se=`At ${p.lineNumber}: (${p.line}) ${p.message}.`;p.usage&&(Se+=` Usage: ${p.usage}`),u.push(Se),c.add(p.message)}return u}return[]},show:{get(){return this.modelValue},set(c){this.$emit("update:modelValue",c)}}},mounted:function(){this.editor=bA.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight");const c=this.buildScreenMode();this.editor.session.setMode(new c),this.editor.session.setTabSize(2),this.editor.session.setUseWrapMode(!0),this.editor.$blockScrolling=1/0,this.editor.setOption("enableBasicAutocompletion",!0),this.editor.setOption("enableLiveAutocompletion",!0),this.editor.completers=[new Q$1],this.editor.setHighlightActiveLine(!1),this.editor.setValue(this.definition),this.editor.clearSelection(),X$1.applyVimModeIfEnabled(this.editor),this.editor.focus()},beforeUnmount(){this.editor.destroy(),this.editor.container.remove()},methods:{toggleVimMode:function(){X$1.toggleVimMode(this.editor)},showContextMenu:function(c){this.menuX=c.pageX,this.menuY=c.pageY;let u=this.editor.getCursorPosition(),f=this.editor.session.getTokenAt(u.row,u.column);if(f){let p=f.value.trim();p.includes(" ")?this.docsKeyword=p.split(" ")[0]:this.docsKeyword=p,this.contextMenu=!0}},openDocumentation(){window.open(`${window.location.origin}/tools/staticdocs/docs/configuration/telemetry-screens#${this.docsKeyword.toLowerCase()}`,"_blank")},buildScreenMode(){let c=bA.require("ace/lib/oop"),u=bA.require("ace/mode/text_highlight_rules").TextHighlightRules,f=this.keywords.join("|"),p=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"\\b\\d+(?:\\.\\d+)?\\b"},{token:"keyword",regex:new RegExp(`^\\s*(${f})\\b`)}]},this.normalizeRules()};c.inherits(p,u);let Se=function(){this.HighlightRules=p},D=bA.require("ace/mode/text").Mode;return c.inherits(Se,D),(function(){this.$id="ace/mode/openc3"}).call(Se.prototype),Se},downloadScreen:function(){const c=new Blob([this.editor.getValue()],{type:"text/plain"}),u=document.createElement("a");u.href=URL.createObjectURL(c),u.setAttribute("download",`${this.screen.toLowerCase()}.txt`),u.click()},loadFile:function(){const c=new FileReader;c.readAsText(this.file);const u=this;c.onload=function(){u.editor.setValue(c.result),u.file=null}},deleteScreen:function(){this.$dialog.confirm("Are you sure you want to delete this screen?!",{okText:"Delete",cancelText:"Cancel"}).then(c=>{this.$emit("delete")})}}},te$1=["textContent"];function ne$1(c,u,f,p,Se,D){const _=resolveComponent("v-btn"),x=resolveComponent("v-spacer"),a=resolveComponent("v-toolbar"),h=resolveComponent("v-row"),i=resolveComponent("v-file-input"),r=resolveComponent("v-list-item-title"),o=resolveComponent("v-list-item"),t=resolveComponent("v-divider"),e=resolveComponent("v-list"),n=resolveComponent("v-menu"),s=resolveComponent("v-card-text"),g=resolveComponent("v-card"),m=resolveComponent("v-dialog");return openBlock(),createBlock(m,{modelValue:D.show,"onUpdate:modelValue":u[5]||(u[5]=A=>D.show=A),persistent:"",width:"75vw"},{default:withCtx(()=>[createVNode(g,null,{default:withCtx(()=>[createVNode(a,{height:"24"},{default:withCtx(()=>[createVNode(_,{class:"mx-2",icon:"mdi-delete",variant:"text",density:"compact","data-test":"delete-screen-icon",onClick:D.deleteScreen},null,8,["onClick"]),createVNode(x),createElementVNode("span",null," Edit Screen: "+toDisplayString(f.target)+" "+toDisplayString(f.screen),1),createVNode(x),createVNode(_,{class:"mx-2",icon:"mdi-download",variant:"text",density:"compact","data-test":"download-screen-icon",onClick:D.downloadScreen},null,8,["onClick"])]),_:1}),createVNode(s,{style:{"max-height":"90vh"}},{default:withCtx(()=>[createVNode(h,{class:"mt-3"},{default:withCtx(()=>u[6]||(u[6]=[createTextVNode(" Upload a screen file. ")])),_:1}),createVNode(h,{"no-gutters":"",align:"center"},{default:withCtx(()=>[createVNode(_,{disabled:!Se.file,color:"primary",class:"mr-3","data-test":"edit-screen-load",onClick:D.loadFile},{default:withCtx(()=>u[7]||(u[7]=[createTextVNode(" Load ")])),_:1},8,["disabled","onClick"]),createVNode(i,{modelValue:Se.file,"onUpdate:modelValue":u[0]||(u[0]=A=>Se.file=A),"truncate-length":"15",accept:".txt",label:"Click to select .txt screen file."},null,8,["modelValue"])]),_:1}),createVNode(h,{class:"mb-2"},{default:withCtx(()=>u[8]||(u[8]=[createTextVNode(" Edit the screen definition. ")])),_:1}),createVNode(h,{class:"mb-2"},{default:withCtx(()=>[createElementVNode("pre",{ref:"editor",class:"editor",onContextmenu:u[1]||(u[1]=withModifiers((...A)=>D.showContextMenu&&D.showContextMenu(...A),["prevent"]))},null,544),createVNode(n,{modelValue:Se.contextMenu,"onUpdate:modelValue":u[2]||(u[2]=A=>Se.contextMenu=A),target:[Se.menuX,Se.menuY]},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>[createVNode(o,{link:""},{default:withCtx(()=>[createVNode(r,{onClick:D.openDocumentation},{default:withCtx(()=>[createTextVNode(toDisplayString(Se.docsKeyword)+" documentation ",1)]),_:1},8,["onClick"])]),_:1}),createVNode(t),createVNode(o,{title:"Toggle Vim mode","prepend-icon":"extras:vim",onClick:D.toggleVimMode},null,8,["onClick"])]),_:1})]),_:1},8,["modelValue","target"])]),_:1}),createVNode(h,{style:{"max-height":"120px","overflow-y":"auto"}},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(D.editErrors,(A,E)=>(openBlock(),createElementBlock("div",{key:E},[createElementVNode("span",{class:"text-red",textContent:toDisplayString(A)},null,8,te$1)]))),128))]),_:1}),createVNode(h,{class:"mt-5"},{default:withCtx(()=>[u[11]||(u[11]=createElementVNode("span",null," Ctrl-space brings up autocomplete. Right click keywords for documentation. ",-1)),createVNode(x),createVNode(_,{class:"mx-2",variant:"outlined","data-test":"edit-screen-cancel",onClick:u[3]||(u[3]=A=>c.$emit("cancel"))},{default:withCtx(()=>u[9]||(u[9]=[createTextVNode(" Cancel ")])),_:1}),createVNode(_,{class:"mx-2",color:"primary","data-test":"edit-screen-save",onClick:u[4]||(u[4]=A=>c.$emit("save",c.editor.getValue()))},{default:withCtx(()=>u[10]||(u[10]=[createTextVNode(" Save ")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const ie$1=d(ee$1,[["render",ne$1],["__scopeId","data-v-65b25a74"]]),L=20,ye$1={components:{EditScreenDialog:ie$1},mixins:[UA],props:{target:{type:String,default:""},screen:{type:String,default:""},definition:{type:String,default:""},keywords:{type:Array,default:()=>[]},initialFloated:{type:Boolean,default:!1},initialTop:{type:Number,default:0},initialLeft:{type:Number,default:0},initialZ:{type:Number,default:0},minZ:{type:Number,default:0},fixFloated:{type:Boolean,default:!1},count:{type:Number,default:0},showClose:{type:Boolean,default:!0},timeZone:{type:String,default:"local"},inline:{type:Boolean,default:!1}},emits:["close-screen","delete-screen","drag-screen","edit-screen","float-screen","min-max-screen","unfloat-screen"],data(){return{api:null,backup:"",currentDefinition:this.definition,editDialog:!1,expand:!0,configParser:null,configError:!1,currentLayout:null,layoutStack:[],namedWidgets:{},dynamicWidgets:[],width:null,height:null,staleTime:30,cacheTimeout:.1,globalSettings:[],substitute:!1,original_target_name:null,force_substitute:!1,pollingPeriod:1,errors:[],errorDialog:!1,screenKey:null,dragX:0,dragY:0,floated:this.initialFloated,top:this.initialTop,left:this.initialLeft,zIndex:this.initialZ,changeCounter:0,screenItems:[],screenValues:{},updateCounter:0,screenId:IS.uniqueId("openc3-screen_")}},computed:{error:function(){if(this.errorDialog&&this.errors.length>0){let c=new Set,u="";for(const f of this.errors){if(c.has(f.message))continue;let p=`${f.time}: (${f.type}) ${f.message}
|
3
|
+
`;u+=p,c.add(f.message)}return u}return null},computedStyle(){var c;let u={};const f=this.width||((c=this.$refs.bar)==null?void 0:c.clientWidth);return this.floated&&(u.position="absolute",u.top=this.top+"px",u.left=this.left+"px",u.width=f+"px"),u}},watch:{count:{handler(c,u){this.currentDefinition=this.definition,this.rerender()}}},errorCaptured(c,u,f){return this.errors.length<L&&(c.usage?this.errors.push({type:"usage",message:c.message,usage:c.usage,line:c.line,lineNumber:c.lineNumber,time:new Date().getTime()}):this.errors.push({type:"error",message:c,time:new Date().getTime()}),console.log(this.errors),this.configError=!0),!1},created(){this.api=new BA,this.configParser=new WA,this.parseDefinition(),this.screenKey=Math.floor(Math.random()*1e6)},mounted(){this.updateRefreshInterval(),this.floated&&(this.$refs.bar.onmousedown=this.dragMouseDown,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex)},unmounted(){this.updater!=null&&(clearInterval(this.updater),this.updater=null)},methods:{open(c,u){this.$parent.showScreen(c,u)},close(c,u){this.$parent.closeScreenByName(c,u)},closeAll(){this.$parent.closeAll()},clearErrors:function(){this.errors=[],this.configError=!1},updateRefreshInterval:function(){let c=this.pollingPeriod*1e3;this.updater&&clearInterval(this.updater),this.updater=setInterval(()=>{this.update()},c)},parseDefinition:function(){if(this.clearErrors(),this.screenItems=[],this.namedWidgets={},this.layoutStack=[],this.dynamicWidgets=[],this.layoutStack.push({type:"VerticalWidget",parameters:[],widgets:[]}),this.currentLayout=this.layoutStack[this.layoutStack.length-1],this.configParser.parse_string(this.currentDefinition,"",!1,!0,(c,u,f,p)=>{if(c)switch(c){case"SCREEN":this.configParser.verify_num_parameters(3,4,`${c} <Width or AUTO> <Height or AUTO> <Polling Period>`),this.width=parseInt(u[0]),this.height=parseInt(u[1]),this.pollingPeriod=parseFloat(u[2]);break;case"END":this.configParser.verify_num_parameters(0,0,`${c}`),this.layoutStack.pop(),this.currentLayout=this.layoutStack[this.layoutStack.length-1];break;case"STALE_TIME":this.configParser.verify_num_parameters(1,1,`${c} <Time (s)>`),this.staleTime=parseInt(u[0]);break;case"SETTING":case"SUBSETTING":(this.currentLayout.widgets[this.currentLayout.widgets.length-1]??this.currentLayout).settings.push(u);break;case"GLOBAL_SETTING":case"GLOBAL_SUBSETTING":this.globalSettings.push(u);break;default:this.processWidget(c,u,f,p);break}}),typeof this.layoutStack[0]>"u"){let c=[],u=[];for(const f of this.dynamicWidgets)c.push(f.name),u.push(f.lineNumber);this.errors.length<L&&(this.errors.push({type:"usage",message:`Unknown widget! Are these widgets: ${c.join(",")}?`,lineNumber:u.join(","),time:new Date().getTime()}),this.configError=!0),this.layoutStack[0]={type:"VerticalWidget",parameters:[],widgets:[]}}else this.applyGlobalSettings(this.layoutStack[0].widgets)},openEdit:function(){this.backup=this.currentDefinition.repeat(1),this.editDialog=!0},upScreen:function(){this.zIndex+=1,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex])},downScreen:function(){this.zIndex>this.minZ&&(this.zIndex-=1,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex]))},floatScreen:function(){if(this.floated)this.$refs.bar.onmousedown=null,this.$refs.bar.parentElement.parentElement.style="z-index: 0",this.floated=!1,this.$emit("unfloat-screen",[this.floated,this.top,this.left,this.zIndex]);else{let c=this.$refs.bar.parentElement.parentElement.parentElement.getBoundingClientRect(),u=this.$refs.bar.getBoundingClientRect();this.top=u.top-c.top-5,this.left=u.left-c.left-5,this.$refs.bar.onmousedown=this.dragMouseDown,this.$refs.bar.parentElement.parentElement.style="z-index: "+this.zIndex,this.floated=!0,this.$emit("float-screen",[this.floated,this.top,this.left,this.zIndex])}},dragMouseDown:function(c){c=c||window.event,c.preventDefault(),this.dragX=c.clientX,this.dragY=c.clientY,document.onmouseup=this.closeDragElement,document.onmousemove=this.elementDrag},elementDrag:function(c){c=c||window.event,c.preventDefault();let u=this.dragX-c.clientX,f=this.dragY-c.clientY;this.dragX=c.clientX,this.dragY=c.clientY,this.top=this.$refs.bar.offsetTop-f,this.left=this.$refs.bar.offsetLeft-u,this.$emit("drag-screen",[this.floated,this.top,this.left,this.zIndex])},closeDragElement:function(){document.onmouseup=null,document.onmousemove=null},rerender:function(){this.parseDefinition(),this.updateRefreshInterval(),this.screenKey=Math.floor(Math.random()*1e6),this.$nextTick(function(){this.clearErrors(),this.$emit("edit-screen")})},cancelEdit:function(){this.file=null,this.editDialog=!1,this.currentDefinition=this.backup,this.rerender()},saveEdit:function(c){this.editDialog=!1,this.currentDefinition=c,this.rerender(),this.$nextTick(function(){FA.post("/openc3-api/screen/",{data:{scope:window.openc3Scope,target:this.target,screen:this.screen,text:this.currentDefinition}},0)})},deleteScreen:function(){this.editDialog=!1,FA.delete(`/openc3-api/screen/${this.target}/${this.screen}`).then(c=>{this.$emit("delete-screen")})},minMaxTransition:function(){this.expand=!this.expand,this.$emit("min-max-screen")},processWidget:function(c,u,f,p){let Se=null;c==="NAMED_WIDGET"&&(this.configParser.verify_num_parameters(2,null,`${c} <Widget Name> <Widget Type> <Widget Settings... (optional)>`),Se=u[0].toUpperCase(),c=u[1].toUpperCase(),u=u.slice(2,u.length));const D=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase()+"Widget";let _=[];if(_.push(["__SCREEN_ID__",this.screenId]),Se!==null&&_.push(["NAMED_WIDGET",Se]),c==="VERTICAL"||c==="VERTICALBOX"||c==="HORIZONTAL"||c==="HORIZONTALBOX"||c==="MATRIXBYCOLUMNS"||c==="TABBOOK"||c==="TABITEM"||c==="CANVAS"||c==="RADIOGROUP"||c==="SCROLLWINDOW"){const x={type:D,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,widgets:[]};this.layoutStack.push(x),this.currentLayout.widgets.push(x),this.currentLayout=x}else if(this.$options.components[D])this.currentLayout.widgets.push({type:D,target:this.target,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,line:f,lineNumber:p});else{let x={type:"DynamicWidget",target:this.target,parameters:u,settings:_,screenValues:this.screenValues,screenTimeZone:this.timeZone,name:D,line:f,lineNumber:p};this.currentLayout.widgets.push(x),this.dynamicWidgets.push(x)}},applyGlobalSettings:function(c){c.forEach(u=>{this.globalSettings.forEach(f=>{u.type.toLowerCase()===f[0].toLowerCase()+"widget"&&(u.settings.find(p=>p[0]===f[1])||u.settings.push(f.slice(1)))}),u.widgets&&this.applyGlobalSettings(u.widgets)})},update:function(){this.screenItems.length!==0&&this.configError===!1&&this.api.get_tlm_values(this.screenItems,this.staleTime,this.cacheTimeout).then(c=>{this.clearErrors(),this.updateValues(c)}).catch(c=>{let u=JSON.stringify(c,null,2);u.includes("no response received")||(this.configError=!0),this.errors.find(f=>f.message===u)||this.errors.length<L&&this.errors.push({type:"error",message:u,time:new Date().getTime()})})},updateValues:function(c){this.updateCounter+=1;for(let u=0;u<c.length;u++)c[u].push(this.updateCounter),this.screenValues[this.screenItems[u]]=c[u]},addItem:function(c){this.screenItems.push(c),this.screenValues[c]=[null,null,0]},deleteItem:function(c){let u=this.screenItems.indexOf(c);this.screenItems.splice(u,1)}}},_e={ref:"screen",class:"pa-1",style:{position:"relative"}},be$1={key:1,class:"pa-1",style:{position:"relative"}};function xe(c,u,f,p,Se,D){const _=resolveComponent("v-btn"),x=resolveComponent("v-tooltip"),a=resolveComponent("v-spacer"),h=resolveComponent("v-toolbar"),i=resolveComponent("v-overlay"),r=resolveComponent("vertical-widget"),o=resolveComponent("v-expand-transition"),t=resolveComponent("v-card"),e=resolveComponent("edit-screen-dialog"),n=resolveComponent("v-textarea"),s=resolveComponent("v-dialog");return openBlock(),createElementBlock("div",{ref:"bar",style:normalizeStyle(D.computedStyle)},[f.inline?createCommentVNode("",!0):(openBlock(),createBlock(t,{key:0,"min-height":Se.height,"min-width":Se.width,style:{cursor:"default"}},{default:withCtx(()=>[createVNode(h,{height:"24"},{default:withCtx(()=>[withDirectives(createVNode(_,{icon:"mdi-alert",variant:"text",density:"compact","data-test":"error-graph-icon","aria-label":"Show Errors",onClick:u[0]||(u[0]=()=>{Se.errorDialog=!0})},null,512),[[vShow,Se.errors.length!==0]]),createVNode(_,{icon:"mdi-pencil",variant:"text",density:"compact","data-test":"edit-screen-icon","aria-label":"Edit Screen",onClick:D.openEdit},null,8,["onClick"]),f.fixFloated?createCommentVNode("",!0):(openBlock(),createBlock(x,{key:0,"open-delay":600,location:"top"},{activator:withCtx(({props:g})=>[createElementVNode("div",normalizeProps(guardReactiveProps(g)),[createVNode(_,{icon:Se.floated?"mdi-balloon":"mdi-view-grid-outline",variant:"text","data-test":"float-screen-icon","aria-label":Se.floated?"Unfloat Screen":"Float Screen",onClick:D.floatScreen},null,8,["icon","aria-label","onClick"])],16)]),default:withCtx(()=>[createElementVNode("span",null,toDisplayString(Se.floated?"Unfloat Screen":"Float Screen"),1)]),_:1})),Se.floated?(openBlock(),createBlock(x,{key:1,"open-delay":600,location:"top"},{activator:withCtx(({props:g})=>[createElementVNode("div",normalizeProps(guardReactiveProps(g)),[createVNode(_,{icon:"mdi-arrow-up",variant:"text","data-test":"up-screen-icon","aria-label":"Move Screen Up",onClick:D.upScreen},null,8,["onClick"])],16)]),default:withCtx(()=>[u[5]||(u[5]=createElementVNode("span",null," Move Screen Up ",-1))]),_:1})):createCommentVNode("",!0),Se.floated&&Se.zIndex>f.minZ?(openBlock(),createBlock(x,{key:2,"open-delay":600,location:"top"},{activator:withCtx(({props:g})=>[createElementVNode("div",normalizeProps(guardReactiveProps(g)),[createVNode(_,{icon:"mdi-arrow-down",variant:"text","data-test":"down-screen-icon","aria-label":"Move Screen Down",onClick:D.downScreen},null,8,["onClick"])],16)]),default:withCtx(()=>[u[6]||(u[6]=createElementVNode("span",null," Move Screen Down ",-1))]),_:1})):createCommentVNode("",!0),createVNode(a),createElementVNode("span",null,toDisplayString(f.target)+" "+toDisplayString(f.screen),1),createVNode(a),Se.expand?(openBlock(),createBlock(_,{key:3,icon:"mdi-window-minimize",variant:"text",density:"compact","data-test":"minimize-screen-icon","aria-label":"Minimize Screen",onClick:D.minMaxTransition},null,8,["onClick"])):(openBlock(),createBlock(_,{key:4,icon:"mdi-window-maximize",variant:"text","data-test":"maximize-screen-icon","aria-label":"Maximize Screen",onClick:D.minMaxTransition},null,8,["onClick"])),f.showClose?(openBlock(),createBlock(_,{key:5,icon:"mdi-close-box",variant:"text",density:"compact","data-test":"close-screen-icon","aria-label":"Close Screen",onClick:u[1]||(u[1]=g=>c.$emit("close-screen"))})):createCommentVNode("",!0)]),_:1}),Se.editDialog?createCommentVNode("",!0):(openBlock(),createBlock(o,{key:0},{default:withCtx(()=>[withDirectives(createElementVNode("div",_e,[createVNode(i,{style:{"pointer-events":"none"},"model-value":Se.errors.length!==0,opacity:"0.8",absolute:"",attach:"","scroll-strategy":"none"},null,8,["model-value"]),(openBlock(),createBlock(r,{key:Se.screenKey,widgets:Se.layoutStack[0].widgets,"screen-values":Se.screenValues,"screen-time-zone":f.timeZone,onAddItem:D.addItem,onDeleteItem:D.deleteItem,onOpen:D.open,onClose:D.close,onCloseAll:D.closeAll},null,8,["widgets","screen-values","screen-time-zone","onAddItem","onDeleteItem","onOpen","onClose","onCloseAll"]))],512),[[vShow,Se.expand]])]),_:1}))]),_:1},8,["min-height","min-width"])),f.inline?(openBlock(),createElementBlock("div",be$1,[createVNode(i,{style:{"pointer-events":"none"},"model-value":Se.errors.length!==0,opacity:"0.8",absolute:"",attach:"","scroll-strategy":"none"},null,8,["model-value"]),withDirectives(createVNode(_,{icon:"mdi-alert",variant:"text",density:"compact","data-test":"error-graph-icon","aria-label":"Show Errors",onClick:u[2]||(u[2]=()=>{Se.errorDialog=!0})},null,512),[[vShow,Se.errors.length!==0]]),(openBlock(),createBlock(r,{key:Se.screenKey,widgets:Se.layoutStack[0].widgets,"screen-values":Se.screenValues,"screen-time-zone":f.timeZone,onAddItem:D.addItem,onDeleteItem:D.deleteItem,onOpen:D.open,onClose:D.close,onCloseAll:D.closeAll},null,8,["widgets","screen-values","screen-time-zone","onAddItem","onDeleteItem","onOpen","onClose","onCloseAll"]))])):createCommentVNode("",!0),Se.editDialog?(openBlock(),createBlock(e,{key:2,modelValue:Se.editDialog,"onUpdate:modelValue":u[3]||(u[3]=g=>Se.editDialog=g),target:f.target,screen:f.screen,definition:Se.currentDefinition,keywords:f.keywords,errors:Se.errors,onSave:D.saveEdit,onCancel:D.cancelEdit,onDelete:D.deleteScreen},null,8,["modelValue","target","screen","definition","keywords","errors","onSave","onCancel","onDelete"])):createCommentVNode("",!0),createVNode(s,{modelValue:Se.errorDialog,"onUpdate:modelValue":u[4]||(u[4]=g=>Se.errorDialog=g),width:"60vw"},{default:withCtx(()=>[createVNode(h,{height:"24"},{default:withCtx(()=>[createVNode(a),createElementVNode("span",null," Screen: "+toDisplayString(f.target)+" "+toDisplayString(f.screen)+" Errors ",1),createVNode(a)]),_:1}),createVNode(t,null,{default:withCtx(()=>[createVNode(n,{class:"errors",readonly:"",rows:"13","model-value":D.error},null,8,["model-value"])]),_:1})]),_:1},8,["modelValue"])],4)}const Ie$1=d(ye$1,[["render",xe],["__scopeId","data-v-889152bf"]]);var sprintf$1={},hasRequiredSprintf;function requireSprintf(){return hasRequiredSprintf||(hasRequiredSprintf=1,function(c){(function(){var u={not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function f(x){return Se(_(x),arguments)}function p(x,a){return f.apply(null,[x].concat(a||[]))}function Se(x,a){var h=1,i=x.length,r,o="",t,e,n,s,g,m,A,E;for(t=0;t<i;t++)if(typeof x[t]=="string")o+=x[t];else if(typeof x[t]=="object"){if(n=x[t],n.keys)for(r=a[h],e=0;e<n.keys.length;e++){if(r==null)throw new Error(f('[sprintf] Cannot access property "%s" of undefined value "%s"',n.keys[e],n.keys[e-1]));r=r[n.keys[e]]}else n.param_no?r=a[n.param_no]:r=a[h++];if(u.not_type.test(n.type)&&u.not_primitive.test(n.type)&&r instanceof Function&&(r=r()),u.numeric_arg.test(n.type)&&typeof r!="number"&&isNaN(r))throw new TypeError(f("[sprintf] expecting number but found %T",r));switch(u.number.test(n.type)&&(A=r>=0),n.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,n.width?parseInt(n.width):0);break;case"e":r=n.precision?parseFloat(r).toExponential(n.precision):parseFloat(r).toExponential();break;case"f":r=n.precision?parseFloat(r).toFixed(n.precision):parseFloat(r);break;case"g":r=n.precision?String(Number(r.toPrecision(n.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=n.precision?r.substring(0,n.precision):r;break;case"t":r=String(!!r),r=n.precision?r.substring(0,n.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=n.precision?r.substring(0,n.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=n.precision?r.substring(0,n.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase();break}u.json.test(n.type)?o+=r:(u.number.test(n.type)&&(!A||n.sign)?(E=A?"+":"-",r=r.toString().replace(u.sign,"")):E="",g=n.pad_char?n.pad_char==="0"?"0":n.pad_char.charAt(1):" ",m=n.width-(E+r).length,s=n.width&&m>0?g.repeat(m):"",o+=n.align?E+r+s:g==="0"?E+s+r:s+E+r)}return o}var D=Object.create(null);function _(x){if(D[x])return D[x];for(var a=x,h,i=[],r=0;a;){if((h=u.text.exec(a))!==null)i.push(h[0]);else if((h=u.modulo.exec(a))!==null)i.push("%");else if((h=u.placeholder.exec(a))!==null){if(h[2]){r|=1;var o=[],t=h[2],e=[];if((e=u.key.exec(t))!==null)for(o.push(e[1]);(t=t.substring(e[0].length))!=="";)if((e=u.key_access.exec(t))!==null)o.push(e[1]);else if((e=u.index_access.exec(t))!==null)o.push(e[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");h[2]=o}else r|=2;if(r===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:h[0],param_no:h[1],keys:h[2],sign:h[3],pad_char:h[4],align:h[5],width:h[6],precision:h[7],type:h[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(h[0].length)}return D[x]=i}c.sprintf=f,c.vsprintf=p,typeof window<"u"&&(window.sprintf=f,window.vsprintf=p)})()}(sprintf$1)),sprintf$1}requireSprintf();var ace$1={exports:{}},hasRequiredAce;function requireAce(){return hasRequiredAce||(hasRequiredAce=1,function(c,u){(function(){var f="ace",p=function(){return this}();!p&&typeof window<"u"&&(p=window);var Se=function(i,r,o){if(typeof i!="string"){Se.original?Se.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(o=r),Se.modules[i]||(Se.payloads[i]=o,Se.modules[i]=null)};Se.modules={},Se.payloads={};var D=function(i,r,o){if(typeof r=="string"){var t=a(i,r);if(t!=null)return o&&o(),t}else if(Object.prototype.toString.call(r)==="[object Array]"){for(var e=[],n=0,s=r.length;n<s;++n){var g=a(i,r[n]);if(g==null&&_.original)return;e.push(g)}return o&&o.apply(null,e)||!0}},_=function(i,r){var o=D("",i,r);return o==null&&_.original?_.original.apply(this,arguments):o},x=function(i,r){if(r.indexOf("!")!==-1){var o=r.split("!");return x(i,o[0])+"!"+x(i,o[1])}if(r.charAt(0)=="."){var t=i.split("/").slice(0,-1).join("/");for(r=t+"/"+r;r.indexOf(".")!==-1&&e!=r;){var e=r;r=r.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return r},a=function(i,r){r=x(i,r);var o=Se.modules[r];if(!o){if(o=Se.payloads[r],typeof o=="function"){var t={},e={id:r,uri:"",exports:t,packaged:!0},n=function(g,m){return D(r,g,m)},s=o(n,t,e);t=s||e.exports,Se.modules[r]=t,delete Se.payloads[r]}o=Se.modules[r]=t||o}return o};function h(i){var r=p;p[i]||(p[i]={}),r=p[i],(!r.define||!r.define.packaged)&&(Se.original=r.define,r.define=Se,r.define.packaged=!0),(!r.require||!r.require.packaged)&&(_.original=r.require,r.require=_,r.require.packaged=!0)}h(f)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(f,p,Se){function D(_,x,a){Object.defineProperty(_,x,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||D(String.prototype,"startsWith",function(_,x){return x=x||0,this.lastIndexOf(_,x)===x}),String.prototype.endsWith||D(String.prototype,"endsWith",function(_,x){var a=this;(x===void 0||x>a.length)&&(x=a.length),x-=_.length;var h=a.indexOf(_,x);return h!==-1&&h===x}),String.prototype.repeat||D(String.prototype,"repeat",function(_){for(var x="",a=this;_>0;)_&1&&(x+=a),(_>>=1)&&(a+=a);return x}),String.prototype.includes||D(String.prototype,"includes",function(_,x){return this.indexOf(_,x)!=-1}),Object.assign||(Object.assign=function(_){if(_==null)throw new TypeError("Cannot convert undefined or null to object");for(var x=Object(_),a=1;a<arguments.length;a++){var h=arguments[a];h!=null&&Object.keys(h).forEach(function(i){x[i]=h[i]})}return x}),Object.values||(Object.values=function(_){return Object.keys(_).map(function(x){return _[x]})}),Array.prototype.find||D(Array.prototype,"find",function(_){for(var x=this.length,a=arguments[1],h=0;h<x;h++){var i=this[h];if(_.call(a,i,h,this))return i}}),Array.prototype.findIndex||D(Array.prototype,"findIndex",function(_){for(var x=this.length,a=arguments[1],h=0;h<x;h++){var i=this[h];if(_.call(a,i,h,this))return h}}),Array.prototype.includes||D(Array.prototype,"includes",function(_,x){return this.indexOf(_,x)!=-1}),Array.prototype.fill||D(Array.prototype,"fill",function(_){for(var x=this,a=x.length>>>0,h=arguments[1],i=h>>0,r=i<0?Math.max(a+i,0):Math.min(i,a),o=arguments[2],t=o===void 0?a:o>>0,e=t<0?Math.max(a+t,0):Math.min(t,a);r<e;)x[r]=_,r++;return x}),Array.of||D(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(f,p,Se){f("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(f,p,Se){p.deepCopy=function D(_){if(typeof _!="object"||!_)return _;var x;if(Array.isArray(_)){x=[];for(var a=0;a<_.length;a++)x[a]=D(_[a]);return x}if(Object.prototype.toString.call(_)!=="[object Object]")return _;x={};for(var a in _)x[a]=D(_[a]);return x}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(f,p,Se){p.last=function(x){return x[x.length-1]},p.stringReverse=function(x){return x.split("").reverse().join("")},p.stringRepeat=function(x,a){for(var h="";a>0;)a&1&&(h+=x),(a>>=1)&&(x+=x);return h};var D=/^\s\s*/,_=/\s\s*$/;p.stringTrimLeft=function(x){return x.replace(D,"")},p.stringTrimRight=function(x){return x.replace(_,"")},p.copyObject=function(x){var a={};for(var h in x)a[h]=x[h];return a},p.copyArray=function(x){for(var a=[],h=0,i=x.length;h<i;h++)x[h]&&typeof x[h]=="object"?a[h]=this.copyObject(x[h]):a[h]=x[h];return a},p.deepCopy=f("./deep_copy").deepCopy,p.arrayToMap=function(x){for(var a={},h=0;h<x.length;h++)a[x[h]]=1;return a},p.createMap=function(x){var a=Object.create(null);for(var h in x)a[h]=x[h];return a},p.arrayRemove=function(x,a){for(var h=0;h<=x.length;h++)a===x[h]&&x.splice(h,1)},p.escapeRegExp=function(x){return x.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},p.escapeHTML=function(x){return(""+x).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},p.getMatchOffsets=function(x,a){var h=[];return x.replace(a,function(i){h.push({offset:arguments[arguments.length-2],length:i.length})}),h},p.deferredCall=function(x){var a=null,h=function(){a=null,x()},i=function(r){return i.cancel(),a=setTimeout(h,r||0),i};return i.schedule=i,i.call=function(){return this.cancel(),x(),i},i.cancel=function(){return clearTimeout(a),a=null,i},i.isPending=function(){return a},i},p.delayedCall=function(x,a){var h=null,i=function(){h=null,x()},r=function(o){h==null&&(h=setTimeout(i,o||a))};return r.delay=function(o){h&&clearTimeout(h),h=setTimeout(i,o||a)},r.schedule=r,r.call=function(){this.cancel(),x()},r.cancel=function(){h&&clearTimeout(h),h=null},r.isPending=function(){return h},r},p.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},p.skipEmptyMatch=function(x,a,h){return h&&x.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(f,p,Se){p.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},p.getOS=function(){return p.isMac?p.OS.MAC:p.isLinux?p.OS.LINUX:p.OS.WINDOWS};var D=typeof navigator=="object"?navigator:{},_=(/mac|win|linux/i.exec(D.platform)||["other"])[0].toLowerCase(),x=D.userAgent||"",a=D.appName||"";p.isWin=_=="win",p.isMac=_=="mac",p.isLinux=_=="linux",p.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((x.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((x.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),p.isOldIE=p.isIE&&p.isIE<9,p.isGecko=p.isMozilla=x.match(/ Gecko\/\d+/),p.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",p.isWebKit=parseFloat(x.split("WebKit/")[1])||void 0,p.isChrome=parseFloat(x.split(" Chrome/")[1])||void 0,p.isSafari=parseFloat(x.split(" Safari/")[1])&&!p.isChrome||void 0,p.isEdge=parseFloat(x.split(" Edge/")[1])||void 0,p.isAIR=x.indexOf("AdobeAIR")>=0,p.isAndroid=x.indexOf("Android")>=0,p.isChromeOS=x.indexOf(" CrOS ")>=0,p.isIOS=/iPad|iPhone|iPod/.test(x)&&!window.MSStream,p.isIOS&&(p.isMac=!0),p.isMobile=p.isIOS||p.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(f,p,Se){var D=f("./useragent"),_="http://www.w3.org/1999/xhtml";p.buildDom=function o(t,e,n){if(typeof t=="string"&&t){var s=document.createTextNode(t);return e&&e.appendChild(s),s}if(!Array.isArray(t))return t&&t.appendChild&&e&&e.appendChild(t),t;if(typeof t[0]!="string"||!t[0]){for(var g=[],m=0;m<t.length;m++){var A=o(t[m],e,n);A&&g.push(A)}return g}var E=document.createElement(t[0]),S=t[1],C=1;S&&typeof S=="object"&&!Array.isArray(S)&&(C=2);for(var m=C;m<t.length;m++)o(t[m],E,n);return C==2&&Object.keys(S).forEach(function(q){var Be=S[q];q==="class"?E.className=Array.isArray(Be)?Be.join(" "):Be:typeof Be=="function"||q=="value"||q[0]=="$"?E[q]=Be:q==="ref"?n&&(n[Be]=E):q==="style"?typeof Be=="string"&&(E.style.cssText=Be):Be!=null&&E.setAttribute(q,Be)}),e&&e.appendChild(E),E},p.getDocumentHead=function(o){return o||(o=document),o.head||o.getElementsByTagName("head")[0]||o.documentElement},p.createElement=function(o,t){return document.createElementNS?document.createElementNS(t||_,o):document.createElement(o)},p.removeChildren=function(o){o.innerHTML=""},p.createTextNode=function(o,t){var e=t?t.ownerDocument:document;return e.createTextNode(o)},p.createFragment=function(o){var t=o?o.ownerDocument:document;return t.createDocumentFragment()},p.hasCssClass=function(o,t){var e=(o.className+"").split(/\s+/g);return e.indexOf(t)!==-1},p.addCssClass=function(o,t){p.hasCssClass(o,t)||(o.className+=" "+t)},p.removeCssClass=function(o,t){for(var e=o.className.split(/\s+/g);;){var n=e.indexOf(t);if(n==-1)break;e.splice(n,1)}o.className=e.join(" ")},p.toggleCssClass=function(o,t){for(var e=o.className.split(/\s+/g),n=!0;;){var s=e.indexOf(t);if(s==-1)break;n=!1,e.splice(s,1)}return n&&e.push(t),o.className=e.join(" "),n},p.setCssClass=function(o,t,e){e?p.addCssClass(o,t):p.removeCssClass(o,t)},p.hasCssString=function(o,t){var e=0,n;if(t=t||document,n=t.querySelectorAll("style")){for(;e<n.length;)if(n[e++].id===o)return!0}},p.removeElementById=function(o,t){t=t||document,t.getElementById(o)&&t.getElementById(o).remove()};var x,a=[];p.useStrictCSP=function(o){x=o,o==!1?h():a||(a=[])};function h(){var o=a;a=null,o&&o.forEach(function(t){i(t[0],t[1])})}function i(o,t,e){if(!(typeof document>"u")){if(a){if(e)h();else if(e===!1)return a.push([o,t])}if(!x){var n=e;!e||!e.getRootNode?n=document:(n=e.getRootNode(),(!n||n==e)&&(n=document));var s=n.ownerDocument||n;if(t&&p.hasCssString(t,n))return null;t&&(o+=`
|
4
|
+
/*# sourceURL=ace/css/`+t+" */");var g=p.createElement("style");g.appendChild(s.createTextNode(o)),t&&(g.id=t),n==s&&(n=p.getDocumentHead(s)),n.insertBefore(g,n.firstChild)}}}if(p.importCssString=i,p.importCssStylsheet=function(o,t){p.buildDom(["link",{rel:"stylesheet",href:o}],p.getDocumentHead(t))},p.scrollbarWidth=function(o){var t=p.createElement("ace_inner");t.style.width="100%",t.style.minWidth="0px",t.style.height="200px",t.style.display="block";var e=p.createElement("ace_outer"),n=e.style;n.position="absolute",n.left="-10000px",n.overflow="hidden",n.width="200px",n.minWidth="0px",n.height="150px",n.display="block",e.appendChild(t);var s=o&&o.documentElement||document&&document.documentElement;if(!s)return 0;s.appendChild(e);var g=t.offsetWidth;n.overflow="scroll";var m=t.offsetWidth;return g===m&&(m=e.clientWidth),s.removeChild(e),g-m},p.computedStyle=function(o,t){return window.getComputedStyle(o,"")||{}},p.setStyle=function(o,t,e){o[t]!==e&&(o[t]=e)},p.HAS_CSS_ANIMATION=!1,p.HAS_CSS_TRANSFORMS=!1,p.HI_DPI=D.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,D.isChromeOS&&(p.HI_DPI=!1),typeof document<"u"){var r=document.createElement("div");p.HI_DPI&&r.style.transform!==void 0&&(p.HAS_CSS_TRANSFORMS=!0),!D.isEdge&&typeof r.style.animationName<"u"&&(p.HAS_CSS_ANIMATION=!0),r=null}p.HAS_CSS_TRANSFORMS?p.translate=function(o,t,e){o.style.transform="translate("+Math.round(t)+"px, "+Math.round(e)+"px)"}:p.translate=function(o,t,e){o.style.top=Math.round(e)+"px",o.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(f,p,Se){/*
|
5
5
|
* based on code from:
|
6
6
|
*
|
7
7
|
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
|
8
8
|
* Available via the MIT or new BSD license.
|
9
9
|
* see: http://github.com/jrburke/requirejs for details
|
10
|
-
*/var D=
|
10
|
+
*/var D=f("./dom");p.get=function(_,x){var a=new XMLHttpRequest;a.open("GET",_,!0),a.onreadystatechange=function(){a.readyState===4&&x(a.responseText)},a.send(null)},p.loadScript=function(_,x){var a=D.getDocumentHead(),h=document.createElement("script");h.src=_,a.appendChild(h),h.onload=h.onreadystatechange=function(i,r){(r||!h.readyState||h.readyState=="loaded"||h.readyState=="complete")&&(h=h.onload=h.onreadystatechange=null,r||x())}},p.qualifyURL=function(_){var x=document.createElement("a");return x.href=_,x.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(f,p,Se){p.inherits=function(D,_){D.super_=_,D.prototype=Object.create(_.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}})},p.mixin=function(D,_){for(var x in _)D[x]=_[x];return D},p.implement=function(D,_){p.mixin(D,_)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(f,p,Se){var D={},_=function(){this.propagationStopped=!0},x=function(){this.defaultPrevented=!0};D._emit=D._dispatchEvent=function(a,h){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[a]||[],r=this._defaultHandlers[a];if(!(!i.length&&!r)){(typeof h!="object"||!h)&&(h={}),h.type||(h.type=a),h.stopPropagation||(h.stopPropagation=_),h.preventDefault||(h.preventDefault=x),i=i.slice();for(var o=0;o<i.length&&(i[o](h,this),!h.propagationStopped);o++);if(r&&!h.defaultPrevented)return r(h,this)}},D._signal=function(a,h){var i=(this._eventRegistry||{})[a];if(i){i=i.slice();for(var r=0;r<i.length;r++)i[r](h,this)}},D.once=function(a,h){var i=this;if(this.on(a,function r(){i.off(a,r),h.apply(null,arguments)}),!h)return new Promise(function(r){h=r})},D.setDefaultHandler=function(a,h){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[a]){var r=i[a],o=i._disabled_[a];o||(i._disabled_[a]=o=[]),o.push(r);var t=o.indexOf(h);t!=-1&&o.splice(t,1)}i[a]=h},D.removeDefaultHandler=function(a,h){var i=this._defaultHandlers;if(i){var r=i._disabled_[a];if(i[a]==h)r&&this.setDefaultHandler(a,r.pop());else if(r){var o=r.indexOf(h);o!=-1&&r.splice(o,1)}}},D.on=D.addEventListener=function(a,h,i){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[a];return r||(r=this._eventRegistry[a]=[]),r.indexOf(h)==-1&&r[i?"unshift":"push"](h),h},D.off=D.removeListener=D.removeEventListener=function(a,h){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[a];if(i){var r=i.indexOf(h);r!==-1&&i.splice(r,1)}},D.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},p.EventEmitter=D}),ace.define("ace/lib/report_error",["require","exports","module"],function(f,p,Se){p.reportError=function(_,x){var a=new Error(_);a.data=x,typeof console=="object"&&console.error&&console.error(a),setTimeout(function(){throw a})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(f,p,Se){var D={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};p.defaultEnglishMessages=D}),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(f,p,Se){"no use strict";var D=f("./oop"),_=f("./event_emitter").EventEmitter,x=f("./report_error").reportError,a=f("./default_english_messages").defaultEnglishMessages,h={setOptions:function(e){Object.keys(e).forEach(function(n){this.setOption(n,e[n])},this)},getOptions:function(e){var n={};if(e)Array.isArray(e)||(n=e,e=Object.keys(n));else{var s=this.$options;e=Object.keys(s).filter(function(g){return!s[g].hidden})}return e.forEach(function(g){n[g]=this.getOption(g)},this),n},setOption:function(e,n){if(this["$"+e]!==n){var s=this.$options[e];if(!s)return i('misspelled option "'+e+'"');if(s.forwardTo)return this[s.forwardTo]&&this[s.forwardTo].setOption(e,n);s.handlesSet||(this["$"+e]=n),s&&s.set&&s.set.call(this,n)}},getOption:function(e){var n=this.$options[e];return n?n.forwardTo?this[n.forwardTo]&&this[n.forwardTo].getOption(e):n&&n.get?n.get.call(this):this["$"+e]:i('misspelled option "'+e+'"')}};function i(e){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var r,o,t=function(){function e(){this.$defaultOptions={},r=a,o="dollarSigns"}return e.prototype.defineOptions=function(n,s,g){return n.$options||(this.$defaultOptions[s]=n.$options={}),Object.keys(g).forEach(function(m){var A=g[m];typeof A=="string"&&(A={forwardTo:A}),A.name||(A.name=m),n.$options[A.name]=A,"initialValue"in A&&(n["$"+A.name]=A.initialValue)}),D.implement(n,h),this},e.prototype.resetOptions=function(n){Object.keys(n.$options).forEach(function(s){var g=n.$options[s];"value"in g&&n.setOption(s,g.value)})},e.prototype.setDefaultValue=function(n,s,g){if(!n){for(n in this.$defaultOptions)if(this.$defaultOptions[n][s])break;if(!this.$defaultOptions[n][s])return!1}var m=this.$defaultOptions[n]||(this.$defaultOptions[n]={});m[s]&&(m.forwardTo?this.setDefaultValue(m.forwardTo,s,g):m[s].value=g)},e.prototype.setDefaultValues=function(n,s){Object.keys(s).forEach(function(g){this.setDefaultValue(n,g,s[g])},this)},e.prototype.setMessages=function(n,s){r=n,s&&s.placeholders&&(o=s.placeholders)},e.prototype.nls=function(n,s,g){r[n]||(i("No message found for the key '"+n+"' in messages with id "+r.$id+", trying to find a translation for the default string '"+s+"'."),r[s]||i("No message found for the default string '"+s+"' in the provided messages. Falling back to the default English message."));var m=r[n]||r[s]||s;return g&&(o==="dollarSigns"&&(m=m.replace(/\$(\$|[\d]+)/g,function(A,E){return E=="$"?"$":g[E]})),o==="curlyBrackets"&&(m=m.replace(/\{([^\}]+)\}/g,function(A,E){return g[E]}))),m},e}();t.prototype.warn=i,t.prototype.reportError=x,D.implement(t.prototype,_),p.AppConfig=t}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(f,p,Se){Se.exports=`.ace-tm .ace_gutter {
|
11
11
|
background: #f0f0f0;
|
12
12
|
color: #333;
|
13
13
|
}
|
@@ -165,7 +165,7 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
165
165
|
.ace-tm .ace_indent-guide-active {
|
166
166
|
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
|
167
167
|
}
|
168
|
-
`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(g,p,Se){p.isDark=!1,p.cssClass="ace-tm",p.cssText=g("./textmate-css"),p.$id="ace/theme/textmate";var D=g("../lib/dom");D.importCssString(p.cssText,p.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(g,p,Se){"no use strict";var D=g("./lib/lang"),_=g("./lib/net"),x=g("./lib/dom"),a=g("./lib/app_config").AppConfig;Se.exports=p=new a;var h={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};p.get=function(t){if(!h.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return h[t]},p.set=function(t,e){if(h.hasOwnProperty(t))h[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&x.useStrictCSP(e)},p.all=function(){return D.copyObject(h)},p.$modes={},p.moduleUrl=function(t,e){if(h.$moduleUrls[t])return h.$moduleUrls[t];var n=t.split("/");e=e||n[n.length-2]||"";var s=e=="snippets"?"/":"-",f=n[n.length-1];if(e=="worker"&&s=="-"){var m=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");f=f.replace(m,"")}(!f||f==e)&&n.length>1&&(f=n[n.length-2]);var A=h[e+"Path"];return A==null?A=h.basePath:s=="/"&&(e=s=""),A&&A.slice(-1)!="/"&&(A+="/"),A+e+s+f+this.get("suffix")},p.setModuleUrl=function(t,e){return h.$moduleUrls[t]=e};var i=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,g("./theme/textmate"));if(r)return r(t,e);console.error("loader is not configured")},r;p.setLoader=function(t){r=t},p.dynamicModules=Object.create(null),p.$loading={},p.$loaded={},p.loadModule=function(t,e){var n;if(Array.isArray(t))var s=t[0],f=t[1];else if(typeof t=="string")var f=t;var m=function(A){if(A&&!p.$loading[f])return e&&e(A);if(p.$loading[f]||(p.$loading[f]=[]),p.$loading[f].push(e),!(p.$loading[f].length>1)){var E=function(){i(f,function(S,C){C&&(p.$loaded[f]=C),p._emit("load.module",{name:f,module:C});var q=p.$loading[f];p.$loading[f]=null,q.forEach(function(Be){Be&&Be(C)})})};if(!p.get("packaged"))return E();_.loadScript(p.moduleUrl(f,s),E),o()}};if(p.dynamicModules[f])p.dynamicModules[f]().then(function(A){A.default?m(A.default):m(A)});else{try{n=this.$require(f)}catch{}m(n||p.$loaded[f])}},p.$require=function(t){if(typeof Se.require=="function"){var e="require";return Se[e](t)}},p.setModuleLoader=function(t,e){p.dynamicModules[t]=e};var o=function(){!h.basePath&&!h.workerPath&&!h.modePath&&!h.themePath&&!Object.keys(h.$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"),o=function(){})};p.version="1.40.1"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(g,p,Se){g("./lib/fixoldbrowsers");var D=g("./config");D.setLoader(function(h,i){g([h],function(r){i(null,r)})});var _=function(){return this||typeof window<"u"&&window}();Se.exports=function(h){D.init=x,D.$require=g,h.require=g},x(!0);function x(h){if(!(!_||!_.document)){D.set("packaged",h||g.packaged||Se.packaged||_.define&&(void 0).packaged);var i={},r="",o=document.currentScript||document._currentScript,t=o&&o.ownerDocument||document;o&&o.src&&(r=o.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),n=0;n<e.length;n++){var s=e[n],f=s.src||s.getAttribute("src");if(f){for(var m=s.attributes,A=0,E=m.length;A<E;A++){var S=m[A];S.name.indexOf("data-ace-")===0&&(i[a(S.name.replace(/^data-ace-/,""))]=S.value)}var C=f.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);C&&(r=C[1])}}r&&(i.base=i.base||r,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var q in i)typeof i[q]<"u"&&D.set(q,i[q])}}function a(h){return h.replace(/-(.)/g,function(i,r){return r.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(g,p,Se){var D=function(){function _(x,a,h,i){this.start={row:x,column:a},this.end={row:h,column:i}}return _.prototype.isEqual=function(x){return this.start.row===x.start.row&&this.end.row===x.end.row&&this.start.column===x.start.column&&this.end.column===x.end.column},_.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},_.prototype.contains=function(x,a){return this.compare(x,a)==0},_.prototype.compareRange=function(x){var a,h=x.end,i=x.start;return a=this.compare(h.row,h.column),a==1?(a=this.compare(i.row,i.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(i.row,i.column),a==-1?-1:a==1?42:0)},_.prototype.comparePoint=function(x){return this.compare(x.row,x.column)},_.prototype.containsRange=function(x){return this.comparePoint(x.start)==0&&this.comparePoint(x.end)==0},_.prototype.intersects=function(x){var a=this.compareRange(x);return a==-1||a==0||a==1},_.prototype.isEnd=function(x,a){return this.end.row==x&&this.end.column==a},_.prototype.isStart=function(x,a){return this.start.row==x&&this.start.column==a},_.prototype.setStart=function(x,a){typeof x=="object"?(this.start.column=x.column,this.start.row=x.row):(this.start.row=x,this.start.column=a)},_.prototype.setEnd=function(x,a){typeof x=="object"?(this.end.column=x.column,this.end.row=x.row):(this.end.row=x,this.end.column=a)},_.prototype.inside=function(x,a){return this.compare(x,a)==0?!(this.isEnd(x,a)||this.isStart(x,a)):!1},_.prototype.insideStart=function(x,a){return this.compare(x,a)==0?!this.isEnd(x,a):!1},_.prototype.insideEnd=function(x,a){return this.compare(x,a)==0?!this.isStart(x,a):!1},_.prototype.compare=function(x,a){return!this.isMultiLine()&&x===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:x<this.start.row?-1:x>this.end.row?1:this.start.row===x?a>=this.start.column?0:-1:this.end.row===x?a<=this.end.column?0:1:0},_.prototype.compareStart=function(x,a){return this.start.row==x&&this.start.column==a?-1:this.compare(x,a)},_.prototype.compareEnd=function(x,a){return this.end.row==x&&this.end.column==a?1:this.compare(x,a)},_.prototype.compareInside=function(x,a){return this.end.row==x&&this.end.column==a?1:this.start.row==x&&this.start.column==a?-1:this.compare(x,a)},_.prototype.clipRows=function(x,a){if(this.end.row>a)var h={row:a+1,column:0};else if(this.end.row<x)var h={row:x,column:0};if(this.start.row>a)var i={row:a+1,column:0};else if(this.start.row<x)var i={row:x,column:0};return _.fromPoints(i||this.start,h||this.end)},_.prototype.extend=function(x,a){var h=this.compare(x,a);if(h==0)return this;if(h==-1)var i={row:x,column:a};else var r={row:x,column:a};return _.fromPoints(i||this.start,r||this.end)},_.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},_.prototype.isMultiLine=function(){return this.start.row!==this.end.row},_.prototype.clone=function(){return _.fromPoints(this.start,this.end)},_.prototype.collapseRows=function(){return this.end.column==0?new _(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new _(this.start.row,0,this.end.row,0)},_.prototype.toScreenRange=function(x){var a=x.documentToScreenPosition(this.start),h=x.documentToScreenPosition(this.end);return new _(a.row,a.column,h.row,h.column)},_.prototype.moveBy=function(x,a){this.start.row+=x,this.start.column+=a,this.end.row+=x,this.end.column+=a},_}();D.fromPoints=function(_,x){return new D(_.row,_.column,x.row,x.column)},D.comparePoints=function(_,x){return _.row-x.row||_.column-x.column},p.Range=D}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(g,p,Se){for(var D=g("./oop"),_={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:"*"}},x={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},a=0;a<10;a++)x["Digit"+a]=48+a,x["Numpad"+a]=96+a,_.PRINTABLE_KEYS[48+a]=""+a,_.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var h=String.fromCharCode(a+32);x["Key"+h.toUpperCase()]=a,_.PRINTABLE_KEYS[a]=h}for(var a=1;a<13;a++)x["F"+a]=111+a,_.FUNCTION_KEYS[111+a]="F"+a;var i={Shift:16,Control:17,Alt:18,Meta:224};for(var r in i)x[r]=x[r+"Left"]=x[r+"Right"]=i[r];p.$codeToKeyCode=x,_.PRINTABLE_KEYS[173]="-";for(var o in _.FUNCTION_KEYS){var t=_.FUNCTION_KEYS[o].toLowerCase();_[t]=parseInt(o,10)}for(var o in _.PRINTABLE_KEYS){var t=_.PRINTABLE_KEYS[o].toLowerCase();_[t]=parseInt(o,10)}D.mixin(_,_.MODIFIER_KEYS),D.mixin(_,_.PRINTABLE_KEYS),D.mixin(_,_.FUNCTION_KEYS),_.enter=_.return,_.escape=_.esc,_.del=_.delete,function(){for(var e=["cmd","ctrl","alt","shift"],n=Math.pow(2,e.length);n--;)_.KEY_MODS[n]=e.filter(function(s){return n&_.KEY_MODS[s]}).join("-")+"-"}(),_.KEY_MODS[0]="",_.KEY_MODS[-1]="input-",D.mixin(p,_),p.default=p,p.keyCodeToString=function(e){var n=_[e];return typeof n!="string"&&(n=String.fromCharCode(e)),n.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(g,p,Se){var D=g("./keys"),_=g("./useragent"),x=null,a=0,h;function i(){h=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return h={passive:!1},!0}})}catch{}}function r(){return h==null&&i(),h}function o(A,E,S){this.elem=A,this.type=E,this.callback=S}o.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=p.addListener=function(A,E,S,C){A.addEventListener(E,S,r()),C&&C.$toDestroy.push(new o(A,E,S))},e=p.removeListener=function(A,E,S){A.removeEventListener(E,S,r())};p.stopEvent=function(A){return p.stopPropagation(A),p.preventDefault(A),!1},p.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},p.preventDefault=function(A){A.preventDefault&&A.preventDefault()},p.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||_.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},p.capture=function(A,E,S){var C=A&&A.ownerDocument||document;function q(Be){E&&E(Be),S&&S(Be),e(C,"mousemove",E),e(C,"mouseup",q),e(C,"dragstart",q)}return t(C,"mousemove",E),t(C,"mouseup",q),t(C,"dragstart",q),q},p.addMouseWheelListener=function(A,E,S){t(A,"wheel",function(C){var q=.15,Be=C.deltaX||0,se=C.deltaY||0;switch(C.deltaMode){case C.DOM_DELTA_PIXEL:C.wheelX=Be*q,C.wheelY=se*q;break;case C.DOM_DELTA_LINE:var j=15;C.wheelX=Be*j,C.wheelY=se*j;break;case C.DOM_DELTA_PAGE:var ct=150;C.wheelX=Be*ct,C.wheelY=se*ct;break}E(C)},S)},p.addMultiMouseDownListener=function(A,E,S,C,q){var Be=0,se,j,ct,G={2:"dblclick",3:"tripleclick",4:"quadclick"};function U(b){if(p.getButton(b)!==0?Be=0:b.detail>1?(Be++,Be>4&&(Be=1)):Be=1,_.isIE){var w=Math.abs(b.clientX-se)>5||Math.abs(b.clientY-j)>5;(!ct||w)&&(Be=1),ct&&clearTimeout(ct),ct=setTimeout(function(){ct=null},E[Be-1]||600),Be==1&&(se=b.clientX,j=b.clientY)}if(b._clicks=Be,S[C]("mousedown",b),Be>4)Be=0;else if(Be>1)return S[C](G[Be],b)}Array.isArray(A)||(A=[A]),A.forEach(function(b){t(b,"mousedown",U,q)})};function n(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}p.getModifierString=function(A){return D.KEY_MODS[n(A)]};function s(A,E,S){var C=n(E);if(!S&&E.code&&(S=D.$codeToKeyCode[E.code]||S),!_.isMac&&x){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(C|=8),x.altGr)if((3&C)!=3)x.altGr=0;else return;if(S===18||S===17){var q=E.location;if(S===17&&q===1)x[S]==1&&(a=E.timeStamp);else if(S===18&&C===3&&q===2){var Be=E.timeStamp-a;Be<50&&(x.altGr=!0)}}}if(S in D.MODIFIER_KEYS&&(S=-1),!(!C&&S===13&&E.location===3&&(A(E,C,-S),E.defaultPrevented))){if(_.isChromeOS&&C&8){if(A(E,C,S),E.defaultPrevented)return;C&=-9}return!C&&!(S in D.FUNCTION_KEYS)&&!(S in D.PRINTABLE_KEYS)?!1:A(E,C,S)}}p.addCommandKeyListener=function(A,E,S){var C=null;t(A,"keydown",function(q){x[q.keyCode]=(x[q.keyCode]||0)+1;var Be=s(E,q,q.keyCode);return C=q.defaultPrevented,Be},S),t(A,"keypress",function(q){C&&(q.ctrlKey||q.altKey||q.shiftKey||q.metaKey)&&(p.stopEvent(q),C=null)},S),t(A,"keyup",function(q){x[q.keyCode]=null},S),x||(f(),t(window,"focus",f))};function f(){x=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!_.isOldIE){var m=1;p.nextTick=function(A,E){E=E||window;var S="zero-timeout-message-"+m++,C=function(q){q.data==S&&(p.stopPropagation(q),e(E,"message",C),A())};t(E,"message",C),E.postMessage(S,"*")}}p.$idleBlocked=!1,p.onIdle=function(A,E){return setTimeout(function S(){p.$idleBlocked?setTimeout(S,100):A()},E)},p.$idleBlockId=null,p.blockIdle=function(A){p.$idleBlockId&&clearTimeout(p.$idleBlockId),p.$idleBlocked=!0,p.$idleBlockId=setTimeout(function(){p.$idleBlocked=!1},A||100)},p.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),p.nextFrame?p.nextFrame=p.nextFrame.bind(window):p.nextFrame=function(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(g,p,Se){var D;Se.exports={lineMode:!1,pasteCancelled:function(){return D&&D>Date.now()-50?!0:D=!1},cancel:function(){D=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(g,p,Se){var D=g("../lib/event"),_=g("../config").nls,x=g("../lib/useragent"),a=g("../lib/dom"),h=g("../lib/lang"),i=g("../clipboard"),r=x.isChrome<18,o=x.isIE,t=x.isChrome>63,e=400,n=g("../lib/keys"),s=n.KEY_MODS,f=x.isIOS,m=f?/\s/:/\n/,A=x.isMobile,E;E=function(S,C){var q=a.createElement("textarea");q.className="ace_text-input",q.setAttribute("wrap","off"),q.setAttribute("autocorrect","off"),q.setAttribute("autocapitalize","off"),q.setAttribute("spellcheck","false"),q.style.opacity="0",S.insertBefore(q,S.firstChild);var Be=!1,se=!1,j=!1,ct=!1,G="";A||(q.style.fontSize="1px");var U=!1,b=!1,w="",W=0,ot=0,at=0,lt=Number.MAX_SAFE_INTEGER,Mt=Number.MIN_SAFE_INTEGER,zt=0;try{var hi=document.activeElement===q}catch{}this.setNumberOfExtraLines=function(ui){if(lt=Number.MAX_SAFE_INTEGER,Mt=Number.MIN_SAFE_INTEGER,ui<0){zt=0;return}zt=ui},this.setAriaLabel=function(){var ui="";if(C.$textInputAriaLabel&&(ui+="".concat(C.$textInputAriaLabel,", ")),C.session){var vi=C.session.selection.cursor.row;ui+=_("text-input.aria-label","Cursor at row $0",[vi+1])}q.setAttribute("aria-label",ui)},this.setAriaOptions=function(ui){ui.activeDescendant?(q.setAttribute("aria-haspopup","true"),q.setAttribute("aria-autocomplete",ui.inline?"both":"list"),q.setAttribute("aria-activedescendant",ui.activeDescendant)):(q.setAttribute("aria-haspopup","false"),q.setAttribute("aria-autocomplete","both"),q.removeAttribute("aria-activedescendant")),ui.role&&q.setAttribute("role",ui.role),ui.setLabel&&(q.setAttribute("aria-roledescription",_("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),D.addListener(q,"blur",function(ui){b||(C.onBlur(ui),hi=!1)},C),D.addListener(q,"focus",function(ui){if(!b){if(hi=!0,x.isEdge)try{if(!document.hasFocus())return}catch{}C.onFocus(ui),x.isEdge?setTimeout(Vt):Vt()}},C),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:C.renderer.enableKeyboardAccessibility}),G||t||this.$focusScroll=="browser")return q.focus({preventScroll:!0});var ui=q.style.top;q.style.position="fixed",q.style.top="0px";try{var vi=q.getBoundingClientRect().top!=0}catch{return}var yi=[];if(vi)for(var bi=q.parentElement;bi&&bi.nodeType==1;)yi.push(bi),bi.setAttribute("ace_nocontext","true"),!bi.parentElement&&bi.getRootNode?bi=bi.getRootNode().host:bi=bi.parentElement;q.focus({preventScroll:!0}),vi&&yi.forEach(function($i){$i.removeAttribute("ace_nocontext")}),setTimeout(function(){q.style.position="",q.style.top=="0px"&&(q.style.top=ui)},0)},this.blur=function(){q.blur()},this.isFocused=function(){return hi},C.on("beforeEndOperation",function(){var ui=C.curOp,vi=ui&&ui.command&&ui.command.name;if(vi!="insertstring"){var yi=vi&&(ui.docChanged||ui.selectionChanged);j&&yi&&(w=q.value="",Ni()),Vt()}}),C.on("changeSelection",this.setAriaLabel);var Ht=function(ui,vi){for(var yi=vi,bi=1;bi<=ui-lt&&bi<2*zt+1;bi++)yi+=C.session.getLine(ui-bi).length+1;return yi},Vt=f?function(ui){if(!(!hi||Be&&!ui||ct)){ui||(ui="");var vi=`
|
168
|
+
`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(f,p,Se){p.isDark=!1,p.cssClass="ace-tm",p.cssText=f("./textmate-css"),p.$id="ace/theme/textmate";var D=f("../lib/dom");D.importCssString(p.cssText,p.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(f,p,Se){"no use strict";var D=f("./lib/lang"),_=f("./lib/net"),x=f("./lib/dom"),a=f("./lib/app_config").AppConfig;Se.exports=p=new a;var h={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};p.get=function(t){if(!h.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return h[t]},p.set=function(t,e){if(h.hasOwnProperty(t))h[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&x.useStrictCSP(e)},p.all=function(){return D.copyObject(h)},p.$modes={},p.moduleUrl=function(t,e){if(h.$moduleUrls[t])return h.$moduleUrls[t];var n=t.split("/");e=e||n[n.length-2]||"";var s=e=="snippets"?"/":"-",g=n[n.length-1];if(e=="worker"&&s=="-"){var m=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");g=g.replace(m,"")}(!g||g==e)&&n.length>1&&(g=n[n.length-2]);var A=h[e+"Path"];return A==null?A=h.basePath:s=="/"&&(e=s=""),A&&A.slice(-1)!="/"&&(A+="/"),A+e+s+g+this.get("suffix")},p.setModuleUrl=function(t,e){return h.$moduleUrls[t]=e};var i=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,f("./theme/textmate"));if(r)return r(t,e);console.error("loader is not configured")},r;p.setLoader=function(t){r=t},p.dynamicModules=Object.create(null),p.$loading={},p.$loaded={},p.loadModule=function(t,e){var n;if(Array.isArray(t))var s=t[0],g=t[1];else if(typeof t=="string")var g=t;var m=function(A){if(A&&!p.$loading[g])return e&&e(A);if(p.$loading[g]||(p.$loading[g]=[]),p.$loading[g].push(e),!(p.$loading[g].length>1)){var E=function(){i(g,function(S,C){C&&(p.$loaded[g]=C),p._emit("load.module",{name:g,module:C});var q=p.$loading[g];p.$loading[g]=null,q.forEach(function(Be){Be&&Be(C)})})};if(!p.get("packaged"))return E();_.loadScript(p.moduleUrl(g,s),E),o()}};if(p.dynamicModules[g])p.dynamicModules[g]().then(function(A){A.default?m(A.default):m(A)});else{try{n=this.$require(g)}catch{}m(n||p.$loaded[g])}},p.$require=function(t){if(typeof Se.require=="function"){var e="require";return Se[e](t)}},p.setModuleLoader=function(t,e){p.dynamicModules[t]=e};var o=function(){!h.basePath&&!h.workerPath&&!h.modePath&&!h.themePath&&!Object.keys(h.$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"),o=function(){})};p.version="1.40.1"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(f,p,Se){f("./lib/fixoldbrowsers");var D=f("./config");D.setLoader(function(h,i){f([h],function(r){i(null,r)})});var _=function(){return this||typeof window<"u"&&window}();Se.exports=function(h){D.init=x,D.$require=f,h.require=f},x(!0);function x(h){if(!(!_||!_.document)){D.set("packaged",h||f.packaged||Se.packaged||_.define&&(void 0).packaged);var i={},r="",o=document.currentScript||document._currentScript,t=o&&o.ownerDocument||document;o&&o.src&&(r=o.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),n=0;n<e.length;n++){var s=e[n],g=s.src||s.getAttribute("src");if(g){for(var m=s.attributes,A=0,E=m.length;A<E;A++){var S=m[A];S.name.indexOf("data-ace-")===0&&(i[a(S.name.replace(/^data-ace-/,""))]=S.value)}var C=g.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);C&&(r=C[1])}}r&&(i.base=i.base||r,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var q in i)typeof i[q]<"u"&&D.set(q,i[q])}}function a(h){return h.replace(/-(.)/g,function(i,r){return r.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(f,p,Se){var D=function(){function _(x,a,h,i){this.start={row:x,column:a},this.end={row:h,column:i}}return _.prototype.isEqual=function(x){return this.start.row===x.start.row&&this.end.row===x.end.row&&this.start.column===x.start.column&&this.end.column===x.end.column},_.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},_.prototype.contains=function(x,a){return this.compare(x,a)==0},_.prototype.compareRange=function(x){var a,h=x.end,i=x.start;return a=this.compare(h.row,h.column),a==1?(a=this.compare(i.row,i.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(i.row,i.column),a==-1?-1:a==1?42:0)},_.prototype.comparePoint=function(x){return this.compare(x.row,x.column)},_.prototype.containsRange=function(x){return this.comparePoint(x.start)==0&&this.comparePoint(x.end)==0},_.prototype.intersects=function(x){var a=this.compareRange(x);return a==-1||a==0||a==1},_.prototype.isEnd=function(x,a){return this.end.row==x&&this.end.column==a},_.prototype.isStart=function(x,a){return this.start.row==x&&this.start.column==a},_.prototype.setStart=function(x,a){typeof x=="object"?(this.start.column=x.column,this.start.row=x.row):(this.start.row=x,this.start.column=a)},_.prototype.setEnd=function(x,a){typeof x=="object"?(this.end.column=x.column,this.end.row=x.row):(this.end.row=x,this.end.column=a)},_.prototype.inside=function(x,a){return this.compare(x,a)==0?!(this.isEnd(x,a)||this.isStart(x,a)):!1},_.prototype.insideStart=function(x,a){return this.compare(x,a)==0?!this.isEnd(x,a):!1},_.prototype.insideEnd=function(x,a){return this.compare(x,a)==0?!this.isStart(x,a):!1},_.prototype.compare=function(x,a){return!this.isMultiLine()&&x===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:x<this.start.row?-1:x>this.end.row?1:this.start.row===x?a>=this.start.column?0:-1:this.end.row===x?a<=this.end.column?0:1:0},_.prototype.compareStart=function(x,a){return this.start.row==x&&this.start.column==a?-1:this.compare(x,a)},_.prototype.compareEnd=function(x,a){return this.end.row==x&&this.end.column==a?1:this.compare(x,a)},_.prototype.compareInside=function(x,a){return this.end.row==x&&this.end.column==a?1:this.start.row==x&&this.start.column==a?-1:this.compare(x,a)},_.prototype.clipRows=function(x,a){if(this.end.row>a)var h={row:a+1,column:0};else if(this.end.row<x)var h={row:x,column:0};if(this.start.row>a)var i={row:a+1,column:0};else if(this.start.row<x)var i={row:x,column:0};return _.fromPoints(i||this.start,h||this.end)},_.prototype.extend=function(x,a){var h=this.compare(x,a);if(h==0)return this;if(h==-1)var i={row:x,column:a};else var r={row:x,column:a};return _.fromPoints(i||this.start,r||this.end)},_.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},_.prototype.isMultiLine=function(){return this.start.row!==this.end.row},_.prototype.clone=function(){return _.fromPoints(this.start,this.end)},_.prototype.collapseRows=function(){return this.end.column==0?new _(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new _(this.start.row,0,this.end.row,0)},_.prototype.toScreenRange=function(x){var a=x.documentToScreenPosition(this.start),h=x.documentToScreenPosition(this.end);return new _(a.row,a.column,h.row,h.column)},_.prototype.moveBy=function(x,a){this.start.row+=x,this.start.column+=a,this.end.row+=x,this.end.column+=a},_}();D.fromPoints=function(_,x){return new D(_.row,_.column,x.row,x.column)},D.comparePoints=function(_,x){return _.row-x.row||_.column-x.column},p.Range=D}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(f,p,Se){for(var D=f("./oop"),_={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:"*"}},x={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},a=0;a<10;a++)x["Digit"+a]=48+a,x["Numpad"+a]=96+a,_.PRINTABLE_KEYS[48+a]=""+a,_.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var h=String.fromCharCode(a+32);x["Key"+h.toUpperCase()]=a,_.PRINTABLE_KEYS[a]=h}for(var a=1;a<13;a++)x["F"+a]=111+a,_.FUNCTION_KEYS[111+a]="F"+a;var i={Shift:16,Control:17,Alt:18,Meta:224};for(var r in i)x[r]=x[r+"Left"]=x[r+"Right"]=i[r];p.$codeToKeyCode=x,_.PRINTABLE_KEYS[173]="-";for(var o in _.FUNCTION_KEYS){var t=_.FUNCTION_KEYS[o].toLowerCase();_[t]=parseInt(o,10)}for(var o in _.PRINTABLE_KEYS){var t=_.PRINTABLE_KEYS[o].toLowerCase();_[t]=parseInt(o,10)}D.mixin(_,_.MODIFIER_KEYS),D.mixin(_,_.PRINTABLE_KEYS),D.mixin(_,_.FUNCTION_KEYS),_.enter=_.return,_.escape=_.esc,_.del=_.delete,function(){for(var e=["cmd","ctrl","alt","shift"],n=Math.pow(2,e.length);n--;)_.KEY_MODS[n]=e.filter(function(s){return n&_.KEY_MODS[s]}).join("-")+"-"}(),_.KEY_MODS[0]="",_.KEY_MODS[-1]="input-",D.mixin(p,_),p.default=p,p.keyCodeToString=function(e){var n=_[e];return typeof n!="string"&&(n=String.fromCharCode(e)),n.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(f,p,Se){var D=f("./keys"),_=f("./useragent"),x=null,a=0,h;function i(){h=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return h={passive:!1},!0}})}catch{}}function r(){return h==null&&i(),h}function o(A,E,S){this.elem=A,this.type=E,this.callback=S}o.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=p.addListener=function(A,E,S,C){A.addEventListener(E,S,r()),C&&C.$toDestroy.push(new o(A,E,S))},e=p.removeListener=function(A,E,S){A.removeEventListener(E,S,r())};p.stopEvent=function(A){return p.stopPropagation(A),p.preventDefault(A),!1},p.stopPropagation=function(A){A.stopPropagation&&A.stopPropagation()},p.preventDefault=function(A){A.preventDefault&&A.preventDefault()},p.getButton=function(A){return A.type=="dblclick"?0:A.type=="contextmenu"||_.isMac&&A.ctrlKey&&!A.altKey&&!A.shiftKey?2:A.button},p.capture=function(A,E,S){var C=A&&A.ownerDocument||document;function q(Be){E&&E(Be),S&&S(Be),e(C,"mousemove",E),e(C,"mouseup",q),e(C,"dragstart",q)}return t(C,"mousemove",E),t(C,"mouseup",q),t(C,"dragstart",q),q},p.addMouseWheelListener=function(A,E,S){t(A,"wheel",function(C){var q=.15,Be=C.deltaX||0,se=C.deltaY||0;switch(C.deltaMode){case C.DOM_DELTA_PIXEL:C.wheelX=Be*q,C.wheelY=se*q;break;case C.DOM_DELTA_LINE:var j=15;C.wheelX=Be*j,C.wheelY=se*j;break;case C.DOM_DELTA_PAGE:var ct=150;C.wheelX=Be*ct,C.wheelY=se*ct;break}E(C)},S)},p.addMultiMouseDownListener=function(A,E,S,C,q){var Be=0,se,j,ct,G={2:"dblclick",3:"tripleclick",4:"quadclick"};function U(b){if(p.getButton(b)!==0?Be=0:b.detail>1?(Be++,Be>4&&(Be=1)):Be=1,_.isIE){var w=Math.abs(b.clientX-se)>5||Math.abs(b.clientY-j)>5;(!ct||w)&&(Be=1),ct&&clearTimeout(ct),ct=setTimeout(function(){ct=null},E[Be-1]||600),Be==1&&(se=b.clientX,j=b.clientY)}if(b._clicks=Be,S[C]("mousedown",b),Be>4)Be=0;else if(Be>1)return S[C](G[Be],b)}Array.isArray(A)||(A=[A]),A.forEach(function(b){t(b,"mousedown",U,q)})};function n(A){return 0|(A.ctrlKey?1:0)|(A.altKey?2:0)|(A.shiftKey?4:0)|(A.metaKey?8:0)}p.getModifierString=function(A){return D.KEY_MODS[n(A)]};function s(A,E,S){var C=n(E);if(!S&&E.code&&(S=D.$codeToKeyCode[E.code]||S),!_.isMac&&x){if(E.getModifierState&&(E.getModifierState("OS")||E.getModifierState("Win"))&&(C|=8),x.altGr)if((3&C)!=3)x.altGr=0;else return;if(S===18||S===17){var q=E.location;if(S===17&&q===1)x[S]==1&&(a=E.timeStamp);else if(S===18&&C===3&&q===2){var Be=E.timeStamp-a;Be<50&&(x.altGr=!0)}}}if(S in D.MODIFIER_KEYS&&(S=-1),!(!C&&S===13&&E.location===3&&(A(E,C,-S),E.defaultPrevented))){if(_.isChromeOS&&C&8){if(A(E,C,S),E.defaultPrevented)return;C&=-9}return!C&&!(S in D.FUNCTION_KEYS)&&!(S in D.PRINTABLE_KEYS)?!1:A(E,C,S)}}p.addCommandKeyListener=function(A,E,S){var C=null;t(A,"keydown",function(q){x[q.keyCode]=(x[q.keyCode]||0)+1;var Be=s(E,q,q.keyCode);return C=q.defaultPrevented,Be},S),t(A,"keypress",function(q){C&&(q.ctrlKey||q.altKey||q.shiftKey||q.metaKey)&&(p.stopEvent(q),C=null)},S),t(A,"keyup",function(q){x[q.keyCode]=null},S),x||(g(),t(window,"focus",g))};function g(){x=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!_.isOldIE){var m=1;p.nextTick=function(A,E){E=E||window;var S="zero-timeout-message-"+m++,C=function(q){q.data==S&&(p.stopPropagation(q),e(E,"message",C),A())};t(E,"message",C),E.postMessage(S,"*")}}p.$idleBlocked=!1,p.onIdle=function(A,E){return setTimeout(function S(){p.$idleBlocked?setTimeout(S,100):A()},E)},p.$idleBlockId=null,p.blockIdle=function(A){p.$idleBlockId&&clearTimeout(p.$idleBlockId),p.$idleBlocked=!0,p.$idleBlockId=setTimeout(function(){p.$idleBlocked=!1},A||100)},p.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),p.nextFrame?p.nextFrame=p.nextFrame.bind(window):p.nextFrame=function(A){setTimeout(A,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(f,p,Se){var D;Se.exports={lineMode:!1,pasteCancelled:function(){return D&&D>Date.now()-50?!0:D=!1},cancel:function(){D=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(f,p,Se){var D=f("../lib/event"),_=f("../config").nls,x=f("../lib/useragent"),a=f("../lib/dom"),h=f("../lib/lang"),i=f("../clipboard"),r=x.isChrome<18,o=x.isIE,t=x.isChrome>63,e=400,n=f("../lib/keys"),s=n.KEY_MODS,g=x.isIOS,m=g?/\s/:/\n/,A=x.isMobile,E;E=function(S,C){var q=a.createElement("textarea");q.className="ace_text-input",q.setAttribute("wrap","off"),q.setAttribute("autocorrect","off"),q.setAttribute("autocapitalize","off"),q.setAttribute("spellcheck","false"),q.style.opacity="0",S.insertBefore(q,S.firstChild);var Be=!1,se=!1,j=!1,ct=!1,G="";A||(q.style.fontSize="1px");var U=!1,b=!1,w="",W=0,ot=0,at=0,lt=Number.MAX_SAFE_INTEGER,Mt=Number.MIN_SAFE_INTEGER,zt=0;try{var hi=document.activeElement===q}catch{}this.setNumberOfExtraLines=function(ui){if(lt=Number.MAX_SAFE_INTEGER,Mt=Number.MIN_SAFE_INTEGER,ui<0){zt=0;return}zt=ui},this.setAriaLabel=function(){var ui="";if(C.$textInputAriaLabel&&(ui+="".concat(C.$textInputAriaLabel,", ")),C.session){var vi=C.session.selection.cursor.row;ui+=_("text-input.aria-label","Cursor at row $0",[vi+1])}q.setAttribute("aria-label",ui)},this.setAriaOptions=function(ui){ui.activeDescendant?(q.setAttribute("aria-haspopup","true"),q.setAttribute("aria-autocomplete",ui.inline?"both":"list"),q.setAttribute("aria-activedescendant",ui.activeDescendant)):(q.setAttribute("aria-haspopup","false"),q.setAttribute("aria-autocomplete","both"),q.removeAttribute("aria-activedescendant")),ui.role&&q.setAttribute("role",ui.role),ui.setLabel&&(q.setAttribute("aria-roledescription",_("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),D.addListener(q,"blur",function(ui){b||(C.onBlur(ui),hi=!1)},C),D.addListener(q,"focus",function(ui){if(!b){if(hi=!0,x.isEdge)try{if(!document.hasFocus())return}catch{}C.onFocus(ui),x.isEdge?setTimeout(Vt):Vt()}},C),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:C.renderer.enableKeyboardAccessibility}),G||t||this.$focusScroll=="browser")return q.focus({preventScroll:!0});var ui=q.style.top;q.style.position="fixed",q.style.top="0px";try{var vi=q.getBoundingClientRect().top!=0}catch{return}var yi=[];if(vi)for(var bi=q.parentElement;bi&&bi.nodeType==1;)yi.push(bi),bi.setAttribute("ace_nocontext","true"),!bi.parentElement&&bi.getRootNode?bi=bi.getRootNode().host:bi=bi.parentElement;q.focus({preventScroll:!0}),vi&&yi.forEach(function($i){$i.removeAttribute("ace_nocontext")}),setTimeout(function(){q.style.position="",q.style.top=="0px"&&(q.style.top=ui)},0)},this.blur=function(){q.blur()},this.isFocused=function(){return hi},C.on("beforeEndOperation",function(){var ui=C.curOp,vi=ui&&ui.command&&ui.command.name;if(vi!="insertstring"){var yi=vi&&(ui.docChanged||ui.selectionChanged);j&&yi&&(w=q.value="",Ni()),Vt()}}),C.on("changeSelection",this.setAriaLabel);var Ht=function(ui,vi){for(var yi=vi,bi=1;bi<=ui-lt&&bi<2*zt+1;bi++)yi+=C.session.getLine(ui-bi).length+1;return yi},Vt=g?function(ui){if(!(!hi||Be&&!ui||ct)){ui||(ui="");var vi=`
|
169
169
|
ab`+ui+`cde fg
|
170
170
|
`;vi!=q.value&&(q.value=w=vi);var yi=4,bi=4+(ui.length||(C.selection.isEmpty()?0:1));(W!=yi||ot!=bi)&&q.setSelectionRange(yi,bi),W=yi,ot=bi}}:function(){if(!(j||ct)&&!(!hi&&!fi)){j=!0;var ui=0,vi=0,yi="";if(C.session){var bi=C.selection,$i=bi.getRange(),ki=bi.cursor.row;ki===Mt+1?(lt=Mt+1,Mt=lt+2*zt):ki===lt-1?(Mt=lt-1,lt=Mt-2*zt):(ki<lt-1||ki>Mt+1)&&(lt=ki>zt?ki-zt:0,Mt=ki>zt?ki+zt:2*zt);for(var Ei=[],Mi=lt;Mi<=Mt;Mi++)Ei.push(C.session.getLine(Mi));if(yi=Ei.join(`
|
171
171
|
`),ui=Ht($i.start.row,$i.start.column),vi=Ht($i.end.row,$i.end.column),$i.start.row<lt){var xi=C.session.getLine(lt-1);ui=$i.start.row<lt-1?0:ui,vi+=xi.length+1,yi=xi+`
|
@@ -175,47 +175,47 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
175
175
|
`,ui==vi?ui=vi=0:(ui=0,vi=1)));var Li=yi+`
|
176
176
|
|
177
177
|
`;Li!=w&&(q.value=w=Li,W=ot=Li.length)}if(fi&&(W=q.selectionStart,ot=q.selectionEnd),ot!=vi||W!=ui||q.selectionEnd!=ot)try{q.setSelectionRange(ui,vi),W=ui,ot=vi}catch{}j=!1}};this.resetSelection=Vt,hi&&C.onFocus();var Ut=function(ui){return ui.selectionStart===0&&ui.selectionEnd>=w.length&&ui.value===w&&w&&ui.selectionEnd!==ot},Jt=function(ui){j||(Be?Be=!1:Ut(q)?(C.selectAll(),Vt()):A&&q.selectionStart!=W&&Vt())},di=null;this.setInputHandler=function(ui){di=ui},this.getInputHandler=function(){return di};var fi=!1,mi=function(ui,vi){if(fi&&(fi=!1),se)return Vt(),ui&&C.onPaste(ui),se=!1,"";for(var yi=q.selectionStart,bi=q.selectionEnd,$i=W,ki=w.length-ot,Ei=ui,Mi=ui.length-yi,xi=ui.length-bi,Si=0;$i>0&&w[Si]==ui[Si];)Si++,$i--;for(Ei=Ei.slice(Si),Si=1;ki>0&&w.length-Si>W-1&&w[w.length-Si]==ui[ui.length-Si];)Si++,ki--;Mi-=Si-1,xi-=Si-1;var Li=Ei.length-Si+1;if(Li<0&&($i=-Li,Li=0),Ei=Ei.slice(0,Li),!vi&&!Ei&&!Mi&&!$i&&!ki&&!xi)return"";ct=!0;var Oi=!1;return x.isAndroid&&Ei==". "&&(Ei=" ",Oi=!0),Ei&&!$i&&!ki&&!Mi&&!xi||U?C.onTextInput(Ei):C.onTextInput(Ei,{extendLeft:$i,extendRight:ki,restoreStart:Mi,restoreEnd:xi}),ct=!1,w=ui,W=yi,ot=bi,at=xi,Oi?`
|
178
|
-
`:Ei},gi=function(ui){if(j)return Ii();if(ui&&ui.inputType){if(ui.inputType=="historyUndo")return C.execCommand("undo");if(ui.inputType=="historyRedo")return C.execCommand("redo")}var vi=q.value,yi=mi(vi,!0);(vi.length>e+100||m.test(yi)||A&&W<1&&W==ot)&&Vt()},wi=function(ui,vi,yi){var bi=ui.clipboardData||window.clipboardData;if(!(!bi||r)){var $i=o||yi?"Text":"text/plain";try{return vi?bi.setData($i,vi)!==!1:bi.getData($i)}catch(ki){if(!yi)return wi(ki,vi,!0)}}},Ci=function(ui,vi){var yi=C.getCopyText();if(!yi)return D.preventDefault(ui);wi(ui,yi)?(
|
178
|
+
`:Ei},gi=function(ui){if(j)return Ii();if(ui&&ui.inputType){if(ui.inputType=="historyUndo")return C.execCommand("undo");if(ui.inputType=="historyRedo")return C.execCommand("redo")}var vi=q.value,yi=mi(vi,!0);(vi.length>e+100||m.test(yi)||A&&W<1&&W==ot)&&Vt()},wi=function(ui,vi,yi){var bi=ui.clipboardData||window.clipboardData;if(!(!bi||r)){var $i=o||yi?"Text":"text/plain";try{return vi?bi.setData($i,vi)!==!1:bi.getData($i)}catch(ki){if(!yi)return wi(ki,vi,!0)}}},Ci=function(ui,vi){var yi=C.getCopyText();if(!yi)return D.preventDefault(ui);wi(ui,yi)?(g&&(Vt(yi),Be=yi,setTimeout(function(){Be=!1},10)),vi?C.onCut():C.onCopy(),D.preventDefault(ui)):(Be=!0,q.value=yi,q.select(),setTimeout(function(){Be=!1,Vt(),vi?C.onCut():C.onCopy()}))},Ai=function(ui){Ci(ui,!0)},Ti=function(ui){Ci(ui,!1)},_i=function(ui){var vi=wi(ui);i.pasteCancelled()||(typeof vi=="string"?(vi&&C.onPaste(vi,ui),x.isIE&&setTimeout(Vt),D.preventDefault(ui)):(q.value="",se=!0))};D.addCommandKeyListener(q,function(ui,vi,yi){if(!j)return C.onCommandKey(ui,vi,yi)},C),D.addListener(q,"select",Jt,C),D.addListener(q,"input",gi,C),D.addListener(q,"cut",Ai,C),D.addListener(q,"copy",Ti,C),D.addListener(q,"paste",_i,C),(!("oncut"in q)||!("oncopy"in q)||!("onpaste"in q))&&D.addListener(S,"keydown",function(ui){if(!(x.isMac&&!ui.metaKey||!ui.ctrlKey))switch(ui.keyCode){case 67:Ti(ui);break;case 86:_i(ui);break;case 88:Ai(ui);break}},C);var Ri=function(ui){if(!(j||!C.onCompositionStart||C.$readOnly)&&(j={},!U)){ui.data&&(j.useTextareaForIME=!1),setTimeout(Ii,0),C._signal("compositionStart"),C.on("mousedown",Fi);var vi=C.getSelectionRange();vi.end.row=vi.start.row,vi.end.column=vi.start.column,j.markerRange=vi,j.selectionStart=W,C.onCompositionStart(j),j.useTextareaForIME?(w=q.value="",W=0,ot=0):(q.msGetInputContext&&(j.context=q.msGetInputContext()),q.getInputContext&&(j.context=q.getInputContext()))}},Ii=function(){if(!(!j||!C.onCompositionUpdate||C.$readOnly)){if(U)return Fi();if(j.useTextareaForIME)C.onCompositionUpdate(q.value);else{var ui=q.value;mi(ui),j.markerRange&&(j.context&&(j.markerRange.start.column=j.selectionStart=j.context.compositionStartOffset),j.markerRange.end.column=j.markerRange.start.column+ot-j.selectionStart+at)}}},Ni=function(ui){!C.onCompositionEnd||C.$readOnly||(j=!1,C.onCompositionEnd(),C.off("mousedown",Fi),ui&&gi())};function Fi(){b=!0,q.blur(),q.focus(),b=!1}var zi=h.delayedCall(Ii,50).schedule.bind(null,null);function Vi(ui){ui.keyCode==27&&q.value.length<q.selectionStart&&(j||(w=q.value),W=ot=-1,Vt()),zi()}D.addListener(q,"compositionstart",Ri,C),D.addListener(q,"compositionupdate",Ii,C),D.addListener(q,"keyup",Vi,C),D.addListener(q,"keydown",zi,C),D.addListener(q,"compositionend",Ni,C),this.getElement=function(){return q},this.setCommandMode=function(ui){U=ui,q.readOnly=!1},this.setReadOnly=function(ui){U||(q.readOnly=ui)},this.setCopyWithEmptySelection=function(ui){},this.onContextMenu=function(ui){fi=!0,Vt(),C._emit("nativecontextmenu",{target:C,domEvent:ui}),this.moveToMouse(ui,!0)},this.moveToMouse=function(ui,vi){G||(G=q.style.cssText),q.style.cssText=(vi?"z-index:100000;":"")+(x.isIE?"opacity:0.1;":"")+"text-indent: -"+(W+ot)*C.renderer.characterWidth*.5+"px;";var yi=C.container.getBoundingClientRect(),bi=a.computedStyle(C.container),$i=yi.top+(parseInt(bi.borderTopWidth)||0),ki=yi.left+(parseInt(bi.borderLeftWidth)||0),Ei=yi.bottom-$i-q.clientHeight-2,Mi=function(xi){a.translate(q,xi.clientX-ki-2,Math.min(xi.clientY-$i-2,Ei))};Mi(ui),ui.type=="mousedown"&&(C.renderer.$isMousePressed=!0,clearTimeout(Bi),x.isWin&&D.capture(C.container,Mi,Di))},this.onContextMenuClose=Di;var Bi;function Di(){clearTimeout(Bi),Bi=setTimeout(function(){G&&(q.style.cssText=G,G=""),C.renderer.$isMousePressed=!1,C.renderer.$keepTextAreaAtCursor&&C.renderer.$moveTextAreaToCursor()},0)}var Wi=function(ui){C.textInput.onContextMenu(ui),Di()};D.addListener(q,"mouseup",Wi,C),D.addListener(q,"mousedown",function(ui){ui.preventDefault(),Di()},C),D.addListener(C.renderer.scroller,"contextmenu",Wi,C),D.addListener(q,"contextmenu",Wi,C),g&&Ui(S,C,q);function Ui(ui,vi,yi){var bi=null,$i=!1;yi.addEventListener("keydown",function(Ei){bi&&clearTimeout(bi),$i=!0},!0),yi.addEventListener("keyup",function(Ei){bi=setTimeout(function(){$i=!1},100)},!0);var ki=function(Ei){if(document.activeElement===yi&&!($i||j||vi.$mouseHandler.isMousePressed)&&!Be){var Mi=yi.selectionStart,xi=yi.selectionEnd,Si=null,Li=0;if(Mi==0?Si=n.up:Mi==1?Si=n.home:xi>ot&&w[xi]==`
|
179
179
|
`?Si=n.end:Mi<W&&w[Mi-1]==" "?(Si=n.left,Li=s.option):Mi<W||Mi==W&&ot!=W&&Mi==xi?Si=n.left:xi>ot&&w.slice(0,xi).split(`
|
180
|
-
`).length>2?Si=n.down:xi>ot&&w[xi-1]==" "?(Si=n.right,Li=s.option):(xi>ot||xi==ot&&ot!=W&&Mi==xi)&&(Si=n.right),Mi!==xi&&(Li|=s.shift),Si){var Oi=vi.onCommandKey({},Li,Si);if(!Oi&&vi.commands){Si=n.keyCodeToString(Si);var Pi=vi.commands.findKeyCommand(Li,Si);Pi&&vi.execCommand(Pi)}W=Mi,ot=xi,Vt("")}}};document.addEventListener("selectionchange",ki),vi.on("destroy",function(){document.removeEventListener("selectionchange",ki)})}this.destroy=function(){q.parentElement&&q.parentElement.removeChild(q)}},p.TextInput=E,p.$setUserAgentForTests=function(S,C){A=S,f=C}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(g,p,Se){var D=g("../lib/useragent"),_=0,x=550,a=function(){function r(o){o.$clickSelection=null;var t=o.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(o)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(o)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(o)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(o)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(o));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(n){o[n]=this[n]},this),o.selectByLines=this.extendSelectionBy.bind(o,"getLineRange"),o.selectByWords=this.extendSelectionBy.bind(o,"getWordRange")}return r.prototype.onMouseDown=function(o){var t=o.inSelection(),e=o.getDocumentPosition();this.mousedownEvent=o;var n=this.editor,s=o.getButton();if(s!==0){var f=n.getSelectionRange(),m=f.isEmpty();(m||s==1)&&n.selection.moveToPosition(e),s==2&&(n.textInput.onContextMenu(o.domEvent),D.isMozilla||o.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!n.isFocused()&&(n.focus(),this.$focusTimeout&&!this.$clickSelection&&!n.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(o);return}return this.captureMouse(o),this.startSelect(e,o.domEvent._clicks>1),o.preventDefault()},r.prototype.startSelect=function(o,t){o=o||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(o):t||e.selection.moveToPosition(o),t||this.select(),e.setStyle("ace_selecting"),this.setState("select"))},r.prototype.select=function(){var o,t=this.editor,e=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(e);if(n==-1)o=this.$clickSelection.end;else if(n==1)o=this.$clickSelection.start;else{var s=i(this.$clickSelection,e);e=s.cursor,o=s.anchor}t.selection.setSelectionAnchor(o.row,o.column)}t.selection.selectToPosition(e),t.renderer.scrollCursorIntoView()},r.prototype.extendSelectionBy=function(o){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y),s=e.selection[o](n.row,n.column);if(this.$clickSelection){var f=this.$clickSelection.comparePoint(s.start),m=this.$clickSelection.comparePoint(s.end);if(f==-1&&m<=0)t=this.$clickSelection.end,(s.end.row!=n.row||s.end.column!=n.column)&&(n=s.start);else if(m==1&&f>=0)t=this.$clickSelection.start,(s.start.row!=n.row||s.start.column!=n.column)&&(n=s.end);else if(f==-1&&m==1)n=s.end,t=s.start;else{var A=i(this.$clickSelection,n);n=A.cursor,t=A.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},r.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},r.prototype.focusWait=function(){var o=h(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(o>_||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},r.prototype.onDoubleClick=function(o){var t=o.getDocumentPosition(),e=this.editor,n=e.session,s=n.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=e.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},r.prototype.onTripleClick=function(o){var t=o.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var n=e.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=e.selection.getLineRange(n.start.row),this.$clickSelection.end=e.selection.getLineRange(n.end.row).end):this.$clickSelection=e.selection.getLineRange(t.row),this.select()},r.prototype.onQuadClick=function(o){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},r.prototype.onMouseWheel=function(o){if(!o.getAccelKey()){o.getShiftKey()&&o.wheelY&&!o.wheelX&&(o.wheelX=o.wheelY,o.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,n=o.domEvent.timeStamp,s=n-e.t,f=s?o.wheelX/s:e.vx,m=s?o.wheelY/s:e.vy;s<x&&(f=(f+e.vx)/2,m=(m+e.vy)/2);var A=Math.abs(f/m),E=!1;if(A>=1&&t.renderer.isScrollableBy(o.wheelX*o.speed,0)&&(E=!0),A<=1&&t.renderer.isScrollableBy(0,o.wheelY*o.speed)&&(E=!0),E)e.allowed=n;else if(n-e.allowed<x){var S=Math.abs(f)<=1.5*Math.abs(e.vx)&&Math.abs(m)<=1.5*Math.abs(e.vy);S?(E=!0,e.allowed=n):e.allowed=0}if(e.t=n,e.vx=f,e.vy=m,E)return t.renderer.scrollBy(o.wheelX*o.speed,o.wheelY*o.speed),o.stop()}},r}();a.prototype.selectEnd=a.prototype.selectByLinesEnd,a.prototype.selectAllEnd=a.prototype.selectByLinesEnd,a.prototype.selectByWordsEnd=a.prototype.selectByLinesEnd,p.DefaultHandlers=a;function h(r,o,t,e){return Math.sqrt(Math.pow(t-r,2)+Math.pow(e-o,2))}function i(r,o){if(r.start.row==r.end.row)var t=2*o.column-r.start.column-r.end.column;else if(r.start.row==r.end.row-1&&!r.start.column&&!r.end.column)var t=o.column-4;else var t=2*o.row-r.start.row-r.end.row;return t<0?{cursor:r.start,anchor:r.end}:{cursor:r.end,anchor:r.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(g,p,Se){p.preventParentScroll=function(_){_.stopPropagation();var x=_.currentTarget,a=x.scrollHeight>x.clientHeight;a||_.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(g,p,Se){var D=this&&this.__extends||function(){var n=function(s,f){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,A){m.__proto__=A}||function(m,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(m[E]=A[E])},n(s,f)};return function(s,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");n(s,f);function m(){this.constructor=s}s.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}}(),_=this&&this.__values||function(n){var s=typeof Symbol=="function"&&Symbol.iterator,f=s&&n[s],m=0;if(f)return f.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&m>=n.length&&(n=void 0),{value:n&&n[m++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},x=g("./lib/dom");g("./lib/event");var a=g("./range").Range,h=g("./lib/scroll").preventParentScroll,i="ace_tooltip",r=function(){function n(s){this.isOpen=!1,this.$element=null,this.$parentNode=s}return n.prototype.$init=function(){return this.$element=x.createElement("div"),this.$element.className=i,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},n.prototype.getElement=function(){return this.$element||this.$init()},n.prototype.setText=function(s){this.getElement().textContent=s},n.prototype.setHtml=function(s){this.getElement().innerHTML=s},n.prototype.setPosition=function(s,f){this.getElement().style.left=s+"px",this.getElement().style.top=f+"px"},n.prototype.setClassName=function(s){x.addCssClass(this.getElement(),s)},n.prototype.setTheme=function(s){this.$element.className=i+" "+(s.isDark?"ace_dark ":"")+(s.cssClass||"")},n.prototype.show=function(s,f,m){s!=null&&this.setText(s),f!=null&&m!=null&&this.setPosition(f,m),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},n.prototype.hide=function(s){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=i,this.isOpen=!1)},n.prototype.getHeight=function(){return this.getElement().offsetHeight},n.prototype.getWidth=function(){return this.getElement().offsetWidth},n.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},n}(),o=function(){function n(){this.popups=[]}return n.prototype.addPopup=function(s){this.popups.push(s),this.updatePopups()},n.prototype.removePopup=function(s){var f=this.popups.indexOf(s);f!==-1&&(this.popups.splice(f,1),this.updatePopups())},n.prototype.updatePopups=function(){var s,f,m,A;this.popups.sort(function(G,U){return U.priority-G.priority});var E=[];try{for(var S=_(this.popups),C=S.next();!C.done;C=S.next()){var q=C.value,Be=!0;try{for(var se=(m=void 0,_(E)),j=se.next();!j.done;j=se.next()){var ct=j.value;if(this.doPopupsOverlap(ct,q)){Be=!1;break}}}catch(G){m={error:G}}finally{try{j&&!j.done&&(A=se.return)&&A.call(se)}finally{if(m)throw m.error}}Be?E.push(q):q.hide()}}catch(G){s={error:G}}finally{try{C&&!C.done&&(f=S.return)&&f.call(S)}finally{if(s)throw s.error}}},n.prototype.doPopupsOverlap=function(s,f){var m=s.getElement().getBoundingClientRect(),A=f.getElement().getBoundingClientRect();return m.left<A.right&&m.right>A.left&&m.top<A.bottom&&m.bottom>A.top},n}(),t=new o;p.popupManager=t,p.Tooltip=r;var e=function(n){D(s,n);function s(f){f===void 0&&(f=document.body);var m=n.call(this,f)||this;m.timeout=void 0,m.lastT=0,m.idleTime=350,m.lastEvent=void 0,m.onMouseOut=m.onMouseOut.bind(m),m.onMouseMove=m.onMouseMove.bind(m),m.waitForHover=m.waitForHover.bind(m),m.hide=m.hide.bind(m);var A=m.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",m.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",(function(){A.contains(document.activeElement)||this.hide()}).bind(m)),A.addEventListener("wheel",h),m}return s.prototype.addToEditor=function(f){f.on("mousemove",this.onMouseMove),f.on("mousedown",this.hide),f.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},s.prototype.removeFromEditor=function(f){f.off("mousemove",this.onMouseMove),f.off("mousedown",this.hide),f.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.onMouseMove=function(f,m){this.lastEvent=f,this.lastT=Date.now();var A=m.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(this.lastEvent=f,this.timeout=setTimeout(this.waitForHover,this.idleTime))},s.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var f=Date.now()-this.lastT;if(this.idleTime-f>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-f);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},s.prototype.isOutsideOfText=function(f){var m=f.editor,A=f.getDocumentPosition(),E=m.session.getLine(A.row);if(A.column==E.length){var S=m.renderer.pixelToScreenCoordinates(f.clientX,f.clientY),C=m.session.documentToScreenPosition(A.row,A.column);if(C.column!=S.column||C.row!=S.row)return!0}return!1},s.prototype.setDataProvider=function(f){this.$gatherData=f},s.prototype.showForRange=function(f,m,A,E){var S=10;if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var C=f.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(C.theme)),this.isOpen=!0,this.addMarker(m,f.session),this.range=a.fromPoints(m.start,m.end);var q=C.textToScreenCoordinates(m.start.row,m.start.column),Be=C.scroller.getBoundingClientRect();q.pageX<Be.left&&(q.pageX=Be.left);var se=this.getElement();se.innerHTML="",se.appendChild(A),se.style.maxHeight="",se.style.display="block";var j=se.clientHeight,ct=se.clientWidth,G=window.innerHeight-q.pageY-C.lineHeight,U=!0;q.pageY-j<0&&q.pageY<G&&(U=!1),se.style.maxHeight=(U?q.pageY:G)-S+"px",se.style.top=U?"":q.pageY+C.lineHeight+"px",se.style.bottom=U?window.innerHeight-q.pageY+"px":"",se.style.left=Math.min(q.pageX,window.innerWidth-ct-S)+"px"}},s.prototype.addMarker=function(f,m){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=m,this.marker=m&&m.addMarker(f,"ace_highlight-marker","text")},s.prototype.hide=function(f){!f&&document.activeElement==this.getElement()||f&&f.target&&(f.type!="keydown"||f.ctrlKey||f.metaKey)&&this.$element.contains(f.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,t.removePopup(this)))},s.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},s.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},s.prototype.onMouseOut=function(f){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!f.relatedTarget||this.getElement().contains(f.relatedTarget)||f&&f.currentTarget.contains(f.relatedTarget)||f.relatedTarget.classList.contains("ace_content")||this.hide())},s}(r);p.HoverTooltip=e}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(g,p,Se){var D=this&&this.__extends||function(){var n=function(s,f){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,A){m.__proto__=A}||function(m,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(m[E]=A[E])},n(s,f)};return function(s,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");n(s,f);function m(){this.constructor=s}s.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}}(),_=this&&this.__values||function(n){var s=typeof Symbol=="function"&&Symbol.iterator,f=s&&n[s],m=0;if(f)return f.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&m>=n.length&&(n=void 0),{value:n&&n[m++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},x=g("../lib/dom"),a=g("../lib/event"),h=g("../tooltip").Tooltip,i=g("../config").nls,r=5,o=3;p.GUTTER_TOOLTIP_LEFT_OFFSET=r,p.GUTTER_TOOLTIP_TOP_OFFSET=o;function t(n){var s=n.editor,f=s.renderer.$gutterLayer,m=new e(s,!0);n.editor.setDefaultHandler("guttermousedown",function(Be){if(!(!s.isFocused()||Be.getButton()!=0)){var se=f.getRegion(Be);if(se!="foldWidgets"){var j=Be.getDocumentPosition().row,ct=s.session.selection;if(Be.getShiftKey())ct.selectTo(j,0);else{if(Be.domEvent.detail==2)return s.selectAll(),Be.preventDefault();n.$clickSelection=s.selection.getLineRange(j)}return n.setState("selectByLines"),n.captureMouse(Be),Be.preventDefault()}}});var A,E;function S(){var Be=E.getDocumentPosition().row,se=s.session.getLength();if(Be==se){var j=s.renderer.pixelToScreenCoordinates(0,E.y).row,ct=E.$pos;if(j>s.session.documentToScreenRow(ct.row,ct.column))return C()}if(m.showTooltip(Be),!!m.isOpen)if(s.on("mousewheel",C),s.on("changeSession",C),window.addEventListener("keydown",C,!0),n.$tooltipFollowsMouse)q(E);else{var G=E.getGutterRow(),U=f.$lines.get(G);if(U){var b=U.element.querySelector(".ace_gutter_annotation"),w=b.getBoundingClientRect(),W=m.getElement().style;W.left=w.right-r+"px",W.top=w.bottom-o+"px"}else q(E)}}function C(Be){Be&&Be.type==="keydown"&&(Be.ctrlKey||Be.metaKey)||Be&&Be.type==="mouseout"&&(!Be.relatedTarget||m.getElement().contains(Be.relatedTarget))||(A&&(A=clearTimeout(A)),m.isOpen&&(m.hideTooltip(),s.off("mousewheel",C),s.off("changeSession",C),window.removeEventListener("keydown",C,!0)))}function q(Be){m.setPosition(Be.x,Be.y)}n.editor.setDefaultHandler("guttermousemove",function(Be){var se=Be.domEvent.target||Be.domEvent.srcElement;if(x.hasCssClass(se,"ace_fold-widget")||x.hasCssClass(se,"ace_custom-widget"))return C();m.isOpen&&n.$tooltipFollowsMouse&&q(Be),E=Be,!A&&(A=setTimeout(function(){A=null,E&&!n.isMousePressed&&S()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(Be){E=null,m.isOpen&&(A=setTimeout(function(){A=null,C(Be)},50))},s)}p.GutterHandler=t;var e=function(n){D(s,n);function s(f,m){m===void 0&&(m=!1);var A=n.call(this,f.container)||this;A.editor=f,A.visibleTooltipRow;var E=A.getElement();return E.setAttribute("role","tooltip"),E.style.pointerEvents="auto",m&&(A.onMouseOut=A.onMouseOut.bind(A),E.addEventListener("mouseout",A.onMouseOut)),A}return s.prototype.onMouseOut=function(f){this.isOpen&&(!f.relatedTarget||this.getElement().contains(f.relatedTarget)||f&&f.currentTarget.contains(f.relatedTarget)||this.hideTooltip())},s.prototype.setPosition=function(f,m){var A=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight,S=this.getWidth(),C=this.getHeight();f+=15,m+=15,f+S>A&&(f-=f+S-A),m+C>E&&(m-=20+C),h.prototype.setPosition.call(this,f,m)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:i("gutter-tooltip.aria-label.error.singular","error"),plural:i("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:i("gutter-tooltip.aria-label.security.singular","security finding"),plural:i("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:i("gutter-tooltip.aria-label.warning.singular","warning"),plural:i("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:i("gutter-tooltip.aria-label.info.singular","information message"),plural:i("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:i("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:i("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(f){var m,A=this.editor.renderer.$gutterLayer,E=A.$annotations[f],S;E?S={displayText:Array.from(E.displayText),type:Array.from(E.type)}:S={displayText:[],type:[]};var C=A.session.getFoldLine(f);if(C&&A.$showFoldedAnnotations){for(var q={error:[],security:[],warning:[],info:[],hint:[]},Be={error:1,security:2,warning:3,info:4,hint:5},se,j=f+1;j<=C.end.row;j++)if(A.$annotations[j])for(var ct=0;ct<A.$annotations[j].text.length;ct++){var G=A.$annotations[j].type[ct];q[G].push(A.$annotations[j].text[ct]),(!se||Be[G]<Be[se])&&(se=G)}if(["error","security","warning"].includes(se)){var U="".concat(s.annotationsToSummaryString(q)," in folded code.");S.displayText.push(U),S.type.push(se+"_fold")}}if(S.displayText.length===0)return this.hideTooltip();for(var b={error:[],security:[],warning:[],info:[],hint:[]},w=A.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",j=0;j<S.displayText.length;j++){var W=x.createElement("span"),ot=x.createElement("span");(m=ot.classList).add.apply(m,["ace_".concat(S.type[j]),w]),ot.setAttribute("aria-label","".concat(s.annotationLabels[S.type[j].replace("_fold","")].singular)),ot.setAttribute("role","img"),ot.appendChild(x.createTextNode(" ")),W.appendChild(ot),W.appendChild(x.createTextNode(S.displayText[j])),W.appendChild(x.createElement("br")),b[S.type[j].replace("_fold","")].push(W)}var at=this.getElement();x.removeChildren(at),b.error.forEach(function(lt){return at.appendChild(lt)}),b.security.forEach(function(lt){return at.appendChild(lt)}),b.warning.forEach(function(lt){return at.appendChild(lt)}),b.info.forEach(function(lt){return at.appendChild(lt)}),b.hint.forEach(function(lt){return at.appendChild(lt)}),at.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.visibleTooltipRow=f,this.editor._signal("showGutterTooltip",this)},s.prototype.hideTooltip=function(){this.isOpen&&(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this))},s.annotationsToSummaryString=function(f){var m,A,E=[],S=["error","security","warning","info","hint"];try{for(var C=_(S),q=C.next();!q.done;q=C.next()){var Be=q.value;if(f[Be].length){var se=f[Be].length===1?s.annotationLabels[Be].singular:s.annotationLabels[Be].plural;E.push("".concat(f[Be].length," ").concat(se))}}}catch(j){m={error:j}}finally{try{q&&!q.done&&(A=C.return)&&A.call(C)}finally{if(m)throw m.error}}return E.join(", ")},s}(h);p.GutterTooltip=e}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(g,p,Se){var D=g("../lib/event"),_=g("../lib/useragent"),x=function(){function a(h,i){this.speed,this.wheelX,this.wheelY,this.domEvent=h,this.editor=i,this.x=this.clientX=h.clientX,this.y=this.clientY=h.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){D.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){D.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var h=this.getDocumentPosition().row,i=this.editor.session.documentToScreenRow(h,0),r=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return i-r},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var h=this.editor,i=h.getSelectionRange();if(i.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=i.contains(r.row,r.column)}return this.$inSelection},a.prototype.getButton=function(){return D.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return _.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();p.MouseEvent=x}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(g,p,Se){var D=g("../lib/dom"),_=g("../lib/event"),x=g("../lib/useragent"),a=200,h=200,i=5;function r(t){var e=t.editor,n=D.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ";var s=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];s.forEach(function(Ht){t[Ht]=this[Ht]},this),e.on("mousedown",this.onMouseDown.bind(t));var f=e.container,m,A,E,S,C,q,Be=0,se,j,ct,G,U;this.onDragStart=function(Ht){if(this.cancelDrag||!f.draggable){var Vt=this;return setTimeout(function(){Vt.startSelect(),Vt.captureMouse(Ht)},0),Ht.preventDefault()}C=e.getSelectionRange();var Ut=Ht.dataTransfer;Ut.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(n),Ut.setDragImage&&Ut.setDragImage(n,0,0),setTimeout(function(){e.container.removeChild(n)}),Ut.clearData(),Ut.setData("Text",e.session.getTextRange()),j=!0,this.setState("drag")},this.onDragEnd=function(Ht){if(f.draggable=!1,j=!1,this.setState(null),!e.getReadOnly()){var Vt=Ht.dataTransfer.dropEffect;!se&&Vt=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(Ht){if(!(e.getReadOnly()||!zt(Ht.dataTransfer)))return A=Ht.clientX,E=Ht.clientY,m||ot(),Be++,Ht.dataTransfer.dropEffect=se=hi(Ht),_.preventDefault(Ht)},this.onDragOver=function(Ht){if(!(e.getReadOnly()||!zt(Ht.dataTransfer)))return A=Ht.clientX,E=Ht.clientY,m||(ot(),Be++),lt!==null&&(lt=null),Ht.dataTransfer.dropEffect=se=hi(Ht),_.preventDefault(Ht)},this.onDragLeave=function(Ht){if(Be--,Be<=0&&m)return at(),se=null,_.preventDefault(Ht)},this.onDrop=function(Ht){if(q){var Vt=Ht.dataTransfer;if(j)switch(se){case"move":C.contains(q.row,q.column)?C={start:q,end:q}:C=e.moveText(C,q);break;case"copy":C=e.moveText(C,q,!0);break}else{var Ut=Vt.getData("Text");C={start:q,end:e.session.insert(q,Ut)},e.focus(),se=null}return at(),_.preventDefault(Ht)}},_.addListener(f,"dragstart",this.onDragStart.bind(t),e),_.addListener(f,"dragend",this.onDragEnd.bind(t),e),_.addListener(f,"dragenter",this.onDragEnter.bind(t),e),_.addListener(f,"dragover",this.onDragOver.bind(t),e),_.addListener(f,"dragleave",this.onDragLeave.bind(t),e),_.addListener(f,"drop",this.onDrop.bind(t),e);function b(Ht,Vt){var Ut=Date.now(),Jt=!Vt||Ht.row!=Vt.row,di=!Vt||Ht.column!=Vt.column;if(!G||Jt||di)e.moveCursorToPosition(Ht),G=Ut,U={x:A,y:E};else{var fi=o(U.x,U.y,A,E);fi>i?G=null:Ut-G>=h&&(e.renderer.scrollCursorIntoView(),G=null)}}function w(Ht,Vt){var Ut=Date.now(),Jt=e.renderer.layerConfig.lineHeight,di=e.renderer.layerConfig.characterWidth,fi=e.renderer.scroller.getBoundingClientRect(),mi={x:{left:A-fi.left,right:fi.right-A},y:{top:E-fi.top,bottom:fi.bottom-E}},gi=Math.min(mi.x.left,mi.x.right),wi=Math.min(mi.y.top,mi.y.bottom),Ci={row:Ht.row,column:Ht.column};gi/di<=2&&(Ci.column+=mi.x.left<mi.x.right?-3:2),wi/Jt<=1&&(Ci.row+=mi.y.top<mi.y.bottom?-1:1);var Ai=Ht.row!=Ci.row,Ti=Ht.column!=Ci.column,_i=!Vt||Ht.row!=Vt.row;Ai||Ti&&!_i?ct?Ut-ct>=a&&e.renderer.scrollCursorIntoView(Ci):ct=Ut:ct=null}function W(){var Ht=q;q=e.renderer.screenToTextCoordinates(A,E),b(q,Ht),w(q,Ht)}function ot(){C=e.selection.toOrientedRange(),m=e.session.addMarker(C,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(S),W(),S=setInterval(W,20),Be=0,_.addListener(document,"mousemove",Mt)}function at(){clearInterval(S),e.session.removeMarker(m),m=null,e.selection.fromOrientedRange(C),e.isFocused()&&!j&&e.$resetCursorStyle(),C=null,q=null,Be=0,ct=null,G=null,_.removeListener(document,"mousemove",Mt)}var lt=null;function Mt(){lt==null&&(lt=setTimeout(function(){lt!=null&&m&&at()},20))}function zt(Ht){var Vt=Ht.types;return!Vt||Array.prototype.some.call(Vt,function(Ut){return Ut=="text/plain"||Ut=="Text"})}function hi(Ht){var Vt=["copy","copymove","all","uninitialized"],Ut=["move","copymove","linkmove","all","uninitialized"],Jt=x.isMac?Ht.altKey:Ht.ctrlKey,di="uninitialized";try{di=Ht.dataTransfer.effectAllowed.toLowerCase()}catch{}var fi="none";return Jt&&Vt.indexOf(di)>=0?fi="copy":Ut.indexOf(di)>=0?fi="move":Vt.indexOf(di)>=0&&(fi="copy"),fi}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,e=t.container;e.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var n=x.isWin?"default":"move";t.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;if(x.isIE&&this.state=="dragReady"){var n=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&e.dragDrop()}if(this.state==="dragWait"){var n=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),s=t.getButton(),f=t.domEvent.detail||1;if(f===1&&s===0&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var m=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in m&&(m.unselectable="on"),e.getDragDelay()){if(x.isWebKit){this.cancelDrag=!0;var A=e.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(r.prototype);function o(t,e,n,s){return Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2))}p.DragdropHandler=r}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(g,p,Se){var D=g("./mouse_event").MouseEvent,_=g("../lib/event"),x=g("../lib/dom");p.addTouchListeners=function(a,h){var i="scroll",r,o,t,e,n,s,f=0,m,A=0,E=0,S=0,C,q;function Be(){var b=window.navigator&&window.navigator.clipboard,w=!1,W=function(){var lt=h.getCopyText(),Mt=h.session.getUndoManager().hasUndo();q.replaceChild(x.buildDom(w?["span",!lt&&ot("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],lt&&ot("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],lt&&ot("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],b&&ot("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],Mt&&ot("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],ot("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],ot("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),q.firstChild)},ot=function(lt){return h.commands.canExecute(lt,h)},at=function(lt){var Mt=lt.target.getAttribute("action");if(Mt=="more"||!w)return w=!w,W();Mt=="paste"?b.readText().then(function(zt){h.execCommand(Mt,zt)}):Mt&&((Mt=="cut"||Mt=="copy")&&(b?b.writeText(h.getCopyText()):document.execCommand("copy")),h.execCommand(Mt)),q.firstChild.style.display="none",w=!1,Mt!="openCommandPalette"&&h.focus()};q=x.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(lt){i="menu",lt.stopPropagation(),lt.preventDefault(),h.textInput.focus()},ontouchend:function(lt){lt.stopPropagation(),lt.preventDefault(),at(lt)},onclick:at},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],h.container)}function se(){if(!h.getOption("enableMobileMenu")){q&&j();return}q||Be();var b=h.selection.cursor,w=h.renderer.textToScreenCoordinates(b.row,b.column),W=h.renderer.textToScreenCoordinates(0,0).pageX,ot=h.renderer.scrollLeft,at=h.container.getBoundingClientRect();q.style.top=w.pageY-at.top-3+"px",w.pageX-at.left<at.width-70?(q.style.left="",q.style.right="10px"):(q.style.right="",q.style.left=W+ot-at.left+"px"),q.style.display="",q.firstChild.style.display="none",h.on("input",j)}function j(b){q&&(q.style.display="none"),h.off("input",j)}function ct(){n=null,clearTimeout(n);var b=h.selection.getRange(),w=b.contains(m.row,m.column);(b.isEmpty()||!w)&&(h.selection.moveToPosition(m),h.selection.selectWord()),i="wait",se()}function G(){n=null,clearTimeout(n),h.selection.moveToPosition(m);var b=A>=2?h.selection.getLineRange(m.row):h.session.getBracketRange(m);b&&!b.isEmpty()?h.selection.setRange(b):h.selection.selectWord(),i="wait"}_.addListener(a,"contextmenu",function(b){if(C){var w=h.textInput.getElement();w.focus()}},h),_.addListener(a,"touchstart",function(b){var w=b.touches;if(n||w.length>1){clearTimeout(n),n=null,t=-1,i="zoom";return}C=h.$mouseHandler.isMousePressed=!0;var W=h.renderer.layerConfig.lineHeight,ot=h.renderer.layerConfig.lineHeight,at=b.timeStamp;e=at;var lt=w[0],Mt=lt.clientX,zt=lt.clientY;Math.abs(r-Mt)+Math.abs(o-zt)>W&&(t=-1),r=b.clientX=Mt,o=b.clientY=zt,E=S=0;var hi=new D(b,h);if(m=hi.getDocumentPosition(),at-t<500&&w.length==1&&!f)A++,b.preventDefault(),b.button=0,G();else{A=0;var Ht=h.selection.cursor,Vt=h.selection.isEmpty()?Ht:h.selection.anchor,Ut=h.renderer.$cursorLayer.getPixelPosition(Ht,!0),Jt=h.renderer.$cursorLayer.getPixelPosition(Vt,!0),di=h.renderer.scroller.getBoundingClientRect(),fi=h.renderer.layerConfig.offset,mi=h.renderer.scrollLeft,gi=function(Ai,Ti){return Ai=Ai/ot,Ti=Ti/W-.75,Ai*Ai+Ti*Ti};if(b.clientX<di.left){i="zoom";return}var wi=gi(b.clientX-di.left-Ut.left+mi,b.clientY-di.top-Ut.top+fi),Ci=gi(b.clientX-di.left-Jt.left+mi,b.clientY-di.top-Jt.top+fi);wi<3.5&&Ci<3.5&&(i=wi>Ci?"cursor":"anchor"),Ci<3.5?i="anchor":wi<3.5?i="cursor":i="scroll",n=setTimeout(ct,450)}t=at},h),_.addListener(a,"touchend",function(b){C=h.$mouseHandler.isMousePressed=!1,s&&clearInterval(s),i=="zoom"?(i="",f=0):n?(h.selection.moveToPosition(m),f=0,se()):i=="scroll"?(U(),j()):se(),clearTimeout(n),n=null},h),_.addListener(a,"touchmove",function(b){n&&(clearTimeout(n),n=null);var w=b.touches;if(!(w.length>1||i=="zoom")){var W=w[0],ot=r-W.clientX,at=o-W.clientY;if(i=="wait")if(ot*ot+at*at>4)i="cursor";else return b.preventDefault();r=W.clientX,o=W.clientY,b.clientX=W.clientX,b.clientY=W.clientY;var lt=b.timeStamp,Mt=lt-e;if(e=lt,i=="scroll"){var zt=new D(b,h);zt.speed=1,zt.wheelX=ot,zt.wheelY=at,10*Math.abs(ot)<Math.abs(at)&&(ot=0),10*Math.abs(at)<Math.abs(ot)&&(at=0),Mt!=0&&(E=ot/Mt,S=at/Mt),h._emit("mousewheel",zt),zt.propagationStopped||(E=S=0)}else{var hi=new D(b,h),Ht=hi.getDocumentPosition();i=="cursor"?h.selection.moveCursorToPosition(Ht):i=="anchor"&&h.selection.setSelectionAnchor(Ht.row,Ht.column),h.renderer.scrollCursorIntoView(Ht),b.preventDefault()}}},h);function U(){f+=60,s=setInterval(function(){f--<=0&&(clearInterval(s),s=null),Math.abs(E)<.01&&(E=0),Math.abs(S)<.01&&(S=0),f<20&&(E=.9*E),f<20&&(S=.9*S);var b=h.session.getScrollTop();h.renderer.scrollBy(10*E,10*S),b==h.session.getScrollTop()&&(f=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(g,p,Se){var D=g("../lib/event"),_=g("../lib/useragent"),x=g("./default_handlers").DefaultHandlers,a=g("./default_gutter_handler").GutterHandler,h=g("./mouse_event").MouseEvent,i=g("./dragdrop_handler").DragdropHandler,r=g("./touch_handler").addTouchListeners,o=g("../config"),t=function(){function e(n){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var s=this;this.editor=n,new x(this),new a(this),new i(this);var f=function(E){var S=!document.hasFocus||!document.hasFocus()||!n.isFocused()&&document.activeElement==(n.textInput&&n.textInput.getElement());S&&window.focus(),n.focus(),setTimeout(function(){n.isFocused()||n.focus()})},m=n.renderer.getMouseEventTarget();D.addListener(m,"click",this.onMouseEvent.bind(this,"click"),n),D.addListener(m,"mousemove",this.onMouseMove.bind(this,"mousemove"),n),D.addMultiMouseDownListener([m,n.renderer.scrollBarV&&n.renderer.scrollBarV.inner,n.renderer.scrollBarH&&n.renderer.scrollBarH.inner,n.textInput&&n.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",n),D.addMouseWheelListener(n.container,this.onMouseWheel.bind(this,"mousewheel"),n),r(n.container,n);var A=n.renderer.$gutter;D.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),n),D.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),n),D.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),n),D.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),n),D.addListener(m,"mousedown",f,n),D.addListener(A,"mousedown",f,n),_.isIE&&n.renderer.scrollBarV&&(D.addListener(n.renderer.scrollBarV.element,"mousedown",f,n),D.addListener(n.renderer.scrollBarH.element,"mousedown",f,n)),n.on("mousemove",function(E){if(!(s.state||s.$dragDelay||!s.$dragEnabled)){var S=n.renderer.screenToTextCoordinates(E.x,E.y),C=n.session.selection.getRange(),q=n.renderer;!C.isEmpty()&&C.insideStart(S.row,S.column)?q.setCursorStyle("default"):q.setCursorStyle("")}},n)}return e.prototype.onMouseEvent=function(n,s){this.editor.session&&this.editor._emit(n,new h(s,this.editor))},e.prototype.onMouseMove=function(n,s){var f=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!f||!f.length||this.editor._emit(n,new h(s,this.editor))},e.prototype.onMouseWheel=function(n,s){var f=new h(s,this.editor);f.speed=this.$scrollSpeed*2,f.wheelX=s.wheelX,f.wheelY=s.wheelY,this.editor._emit(n,f)},e.prototype.setState=function(n){this.state=n},e.prototype.captureMouse=function(n,s){this.x=n.x,this.y=n.y,this.isMousePressed=!0;var f=this.editor,m=this.editor.renderer;m.$isMousePressed=!0;var A=this,E=function(se){if(se){if(_.isWebKit&&!se.which&&A.releaseMouse)return A.releaseMouse();A.x=se.clientX,A.y=se.clientY,s&&s(se),A.mouseEvent=new h(se,A.editor),A.$mouseMoved=!0}},S=function(se){f.off("beforeEndOperation",q),clearInterval(Be),f.session&&C(),A[A.state+"End"]&&A[A.state+"End"](se),A.state="",A.isMousePressed=m.$isMousePressed=!1,m.$keepTextAreaAtCursor&&m.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,se&&A.onMouseEvent("mouseup",se),f.endOperation()},C=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1};if(_.isOldIE&&n.domEvent.type=="dblclick")return setTimeout(function(){S(n)});var q=function(se){A.releaseMouse&&f.curOp.command.name&&f.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};f.on("beforeEndOperation",q),f.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=E,A.releaseMouse=D.capture(this.editor.container,E,S);var Be=setInterval(C,20)},e.prototype.cancelContextMenu=function(){var n=(function(s){s&&s.domEvent&&s.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",n),s&&s.domEvent&&D.stopEvent(s.domEvent))}).bind(this);setTimeout(n,10),this.editor.on("nativecontextmenu",n)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();t.prototype.releaseMouse=null,o.defineOptions(t.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:_.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),p.MouseHandler=t}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(g,p,Se){var D=g("../lib/dom"),_=function(){function x(a){a.on("click",function(h){var i=h.getDocumentPosition(),r=a.session,o=r.getFoldAt(i.row,i.column,1);o&&(h.getAccelKey()?r.removeFold(o):r.expandFold(o),h.stop());var t=h.domEvent&&h.domEvent.target;t&&D.hasCssClass(t,"ace_inline_button")&&D.hasCssClass(t,"ace_toggle_wrap")&&(r.setOption("wrap",!r.getUseWrapMode()),a.renderer.scrollCursorIntoView())}),a.on("gutterclick",function(h){var i=a.renderer.$gutterLayer.getRegion(h);if(i=="foldWidgets"){var r=h.getDocumentPosition().row,o=a.session;o.foldWidgets&&o.foldWidgets[r]&&a.session.onFoldWidgetClick(r,h),a.isFocused()||a.focus(),h.stop()}}),a.on("gutterdblclick",function(h){var i=a.renderer.$gutterLayer.getRegion(h);if(i=="foldWidgets"){var r=h.getDocumentPosition().row,o=a.session,t=o.getParentFoldRangeData(r,!0),e=t.range||t.firstRange;if(e){r=e.start.row;var n=o.getFoldAt(r,o.getLine(r).length,1);n?o.removeFold(n):(o.addFold("...",e),a.renderer.scrollCursorIntoView({row:e.start.row,column:0}))}h.stop()}})}return x}();p.FoldHandler=_}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(g,p,Se){var D=g("../lib/keys"),_=g("../lib/event"),x=function(){function a(h){this.$editor=h,this.$data={editor:h},this.$handlers=[],this.setDefaultHandler(h.commands)}return a.prototype.setDefaultHandler=function(h){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=h,this.addKeyboardHandler(h,0)},a.prototype.setKeyboardHandler=function(h){var i=this.$handlers;if(i[i.length-1]!=h){for(;i[i.length-1]&&i[i.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(i[i.length-1]);this.addKeyboardHandler(h,1)}},a.prototype.addKeyboardHandler=function(h,i){if(h){typeof h=="function"&&!h.handleKeyboard&&(h.handleKeyboard=h);var r=this.$handlers.indexOf(h);r!=-1&&this.$handlers.splice(r,1),i==null?this.$handlers.push(h):this.$handlers.splice(i,0,h),r==-1&&h.attach&&h.attach(this.$editor)}},a.prototype.removeKeyboardHandler=function(h){var i=this.$handlers.indexOf(h);return i==-1?!1:(this.$handlers.splice(i,1),h.detach&&h.detach(this.$editor),!0)},a.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},a.prototype.getStatusText=function(){var h=this.$data,i=h.editor;return this.$handlers.map(function(r){return r.getStatusText&&r.getStatusText(i,h)||""}).filter(Boolean).join(" ")},a.prototype.$callKeyboardHandlers=function(h,i,r,o){for(var t,e=!1,n=this.$editor.commands,s=this.$handlers.length;s--&&(t=this.$handlers[s].handleKeyboard(this.$data,h,i,r,o),!(!(!t||!t.command)&&(t.command=="null"?e=!0:e=n.exec(t.command,this.$editor,t.args,o),e&&o&&h!=-1&&t.passEvent!=!0&&t.command.passEvent!=!0&&_.stopEvent(o),e))););return!e&&h==-1&&(t={command:"insertstring"},e=n.exec("insertstring",this.$editor,i)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",t),e},a.prototype.onCommandKey=function(h,i,r){var o=D.keyCodeToString(r);return this.$callKeyboardHandlers(i,o,r,h)},a.prototype.onTextInput=function(h){return this.$callKeyboardHandlers(-1,h)},a}();p.KeyBinding=x}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(g,p,Se){var D=0,_=0,x=!1,a=!1,h=!1,i=[[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]],r=[[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]],o=0,t=1,e=0,n=1,s=2,f=3,m=4,A=5,E=6,S=7,C=8,q=9,Be=10,se=11,j=12,ct=13,G=14,U=15,b=16,w=17,W=18,ot=[W,W,W,W,W,W,W,W,W,E,A,E,C,A,W,W,W,W,W,W,W,W,W,W,W,W,W,W,A,A,A,E,C,m,m,se,se,se,m,m,m,m,m,Be,q,Be,q,q,s,s,s,s,s,s,s,s,s,s,q,m,m,m,m,m,m,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,m,m,m,m,m,m,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,m,m,m,m,W,W,W,W,W,W,A,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,q,m,se,se,se,se,m,m,m,m,e,m,m,W,m,m,se,se,s,s,m,e,m,m,m,s,e,m,m,m,m,m],at=[C,C,C,C,C,C,C,C,C,C,C,W,W,W,e,n,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,C,A,ct,G,U,b,w,q,se,se,se,se,se,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,q,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,C];function lt(Ht,Vt,Ut,Jt){var di=D?r:i,fi=null,mi=null,gi=null,wi=0,Ci=null,Ai=null,Ti=-1,_i=null,Ri=null,Ii=[];if(!Jt)for(_i=0,Jt=[];_i<Ut;_i++)Jt[_i]=hi(Ht[_i]);for(_=D,x=!1,a=!1,h=!1,Ri=0;Ri<Ut;Ri++){if(fi=wi,Ii[Ri]=mi=zt(Ht,Jt,Ii,Ri),wi=di[fi][mi],Ci=wi&240,wi&=15,Vt[Ri]=gi=di[wi][5],Ci>0)if(Ci==16){for(_i=Ti;_i<Ri;_i++)Vt[_i]=1;Ti=-1}else Ti=-1;if(Ai=di[wi][6],Ai)Ti==-1&&(Ti=Ri);else if(Ti>-1){for(_i=Ti;_i<Ri;_i++)Vt[_i]=gi;Ti=-1}Jt[Ri]==A&&(Vt[Ri]=0),_|=gi}if(h){for(_i=0;_i<Ut;_i++)if(Jt[_i]==E){Vt[_i]=D;for(var Ni=_i-1;Ni>=0&&Jt[Ni]==C;Ni--)Vt[Ni]=D}}}function Mt(Ht,Vt,Ut){if(!(_<Ht)){if(Ht==1&&D==t&&!a){Ut.reverse();return}for(var Jt=Ut.length,di=0,fi,mi,gi,wi;di<Jt;){if(Vt[di]>=Ht){for(fi=di+1;fi<Jt&&Vt[fi]>=Ht;)fi++;for(mi=di,gi=fi-1;mi<gi;mi++,gi--)wi=Ut[mi],Ut[mi]=Ut[gi],Ut[gi]=wi;di=fi}di++}}}function zt(Ht,Vt,Ut,Jt){var di=Vt[Jt],fi,mi,gi,wi;switch(di){case e:case n:x=!1;case m:case f:return di;case s:return x?f:s;case S:return x=!0,n;case C:return m;case q:return Jt<1||Jt+1>=Vt.length||(fi=Ut[Jt-1])!=s&&fi!=f||(mi=Vt[Jt+1])!=s&&mi!=f?m:(x&&(mi=f),mi==fi?mi:m);case Be:return fi=Jt>0?Ut[Jt-1]:A,fi==s&&Jt+1<Vt.length&&Vt[Jt+1]==s?s:m;case se:if(Jt>0&&Ut[Jt-1]==s)return s;if(x)return m;for(wi=Jt+1,gi=Vt.length;wi<gi&&Vt[wi]==se;)wi++;return wi<gi&&Vt[wi]==s?s:m;case j:for(gi=Vt.length,wi=Jt+1;wi<gi&&Vt[wi]==j;)wi++;if(wi<gi){var Ci=Ht[Jt],Ai=Ci>=1425&&Ci<=2303||Ci==64286;if(fi=Vt[wi],Ai&&(fi==n||fi==S))return n}return Jt<1||(fi=Vt[Jt-1])==A?m:Ut[Jt-1];case A:return x=!1,a=!0,D;case E:return h=!0,m;case ct:case G:case b:case w:case U:x=!1;case W:return m}}function hi(Ht){var Vt=Ht.charCodeAt(0),Ut=Vt>>8;return Ut==0?Vt>191?e:ot[Vt]:Ut==5?/[\u0591-\u05f4]/.test(Ht)?n:e:Ut==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(Ht)?j:/[\u0660-\u0669\u066b-\u066c]/.test(Ht)?f:Vt==1642?se:/[\u06f0-\u06f9]/.test(Ht)?s:S:Ut==32&&Vt<=8287?at[Vt&255]:Ut==254&&Vt>=65136?S:m}p.L=e,p.R=n,p.EN=s,p.ON_R=3,p.AN=4,p.R_H=5,p.B=6,p.RLE=7,p.DOT="·",p.doBidiReorder=function(Ht,Vt,Ut){if(Ht.length<2)return{};var Jt=Ht.split(""),di=new Array(Jt.length),fi=new Array(Jt.length),mi=[];D=Ut?t:o,lt(Jt,mi,Jt.length,Vt);for(var gi=0;gi<di.length;di[gi]=gi,gi++);Mt(2,mi,di),Mt(1,mi,di);for(var gi=0;gi<di.length-1;gi++)Vt[gi]===f?mi[gi]=p.AN:mi[gi]===n&&(Vt[gi]>S&&Vt[gi]<ct||Vt[gi]===m||Vt[gi]===W)?mi[gi]=p.ON_R:gi>0&&Jt[gi-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(Jt[gi])&&(mi[gi-1]=mi[gi]=p.R_H,gi++);Jt[Jt.length-1]===p.DOT&&(mi[Jt.length-1]=p.B),Jt[0]===""&&(mi[0]=p.RLE);for(var gi=0;gi<di.length;gi++)fi[gi]=mi[di[gi]];return{logicalFromVisual:di,bidiLevels:fi}},p.hasBidiCharacters=function(Ht,Vt){for(var Ut=!1,Jt=0;Jt<Ht.length;Jt++)Vt[Jt]=hi(Ht.charAt(Jt)),!Ut&&(Vt[Jt]==n||Vt[Jt]==S||Vt[Jt]==f)&&(Ut=!0);return Ut},p.getVisualFromLogicalIdx=function(Ht,Vt){for(var Ut=0;Ut<Vt.logicalFromVisual.length;Ut++)if(Vt.logicalFromVisual[Ut]==Ht)return Ut;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(g,p,Se){var D=g("./lib/bidiutil"),_=g("./lib/lang"),x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,a=function(){function h(i){this.session=i,this.bidiMap={},this.currentRow=null,this.bidiUtil=D,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=x.test(i.getValue())}return h.prototype.isBidiRow=function(i,r,o){return this.seenBidi?(i!==this.currentRow&&(this.currentRow=i,this.updateRowLine(r,o),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},h.prototype.onChange=function(i){this.seenBidi?this.currentRow=null:i.action=="insert"&&x.test(i.lines.join(`
|
181
|
-
`))&&(this.seenBidi=!0,this.currentRow=null)},h.prototype.getDocumentRow=function(){var i=0,r=this.session.$screenRowCache;if(r.length){var o=this.session.$getRowCacheIndex(r,this.currentRow);o>=0&&(i=this.session.$docRowCache[o])}return i},h.prototype.getSplitIndex=function(){var i=0,r=this.session.$screenRowCache;if(r.length)for(var o,t=this.session.$getRowCacheIndex(r,this.currentRow);this.currentRow-i>0&&(o=this.session.$getRowCacheIndex(r,this.currentRow-i-1),o===t);)t=o,i++;else i=this.currentRow;return i},h.prototype.updateRowLine=function(i,r){i===void 0&&(i=this.getDocumentRow());var o=i===this.session.getLength()-1,t=o?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(i),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[i];e&&(r===void 0&&(r=this.getSplitIndex()),r>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[D.L],this.line=r<e.length?this.line.substring(e[r-1],e[r]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[r]),r==e.length&&(this.line+=this.showInvisibles?t:D.DOT))}else this.line+=this.showInvisibles?t:D.DOT;var n=this.session,s=0,f;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(m,A){return m===" "||n.isFullWidth(m.charCodeAt(0))?(f=m===" "?n.getScreenTabSize(A+s):2,s+=f-1,_.stringRepeat(D.DOT,f)):m}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==D.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},h.prototype.updateBidiMap=function(){var i=[];D.hasBidiCharacters(this.line,i)||this.isRtlDir?this.bidiMap=D.doBidiReorder(this.line,i,this.isRtlDir):this.bidiMap={}},h.prototype.markAsDirty=function(){this.currentRow=null},h.prototype.updateCharacterWidths=function(i){if(this.characterWidth!==i.$characterSize.width){this.fontMetrics=i;var r=this.characterWidth=i.$characterSize.width,o=i.$measureCharWidth("ה");this.charWidths[D.L]=this.charWidths[D.EN]=this.charWidths[D.ON_R]=r,this.charWidths[D.R]=this.charWidths[D.AN]=o,this.charWidths[D.R_H]=o*.45,this.charWidths[D.B]=this.charWidths[D.RLE]=0,this.currentRow=null}},h.prototype.setShowInvisibles=function(i){this.showInvisibles=i,this.currentRow=null},h.prototype.setEolChar=function(i){this.EOL=i},h.prototype.setContentWidth=function(i){this.contentWidth=i},h.prototype.isRtlLine=function(i){return this.$isRtl?!0:i!=null?this.session.getLine(i).charAt(0)==this.RLE:this.isRtlDir},h.prototype.setRtlDirection=function(i,r){for(var o=i.getCursorPosition(),t=i.selection.getSelectionAnchor().row;t<=o.row;t++)!r&&i.session.getLine(t).charAt(0)===i.session.$bidiHandler.RLE?i.session.doc.removeInLine(t,0,1):r&&i.session.getLine(t).charAt(0)!==i.session.$bidiHandler.RLE&&i.session.doc.insert({column:0,row:t},i.session.$bidiHandler.RLE)},h.prototype.getPosLeft=function(i){i-=this.wrapIndent;var r=this.line.charAt(0)===this.RLE?1:0,o=i>r?this.session.getOverwrite()?i:i-1:r,t=D.getVisualFromLogicalIdx(o,this.bidiMap),e=this.bidiMap.bidiLevels,n=0;!this.session.getOverwrite()&&i<=r&&e[t]%2!==0&&t++;for(var s=0;s<t;s++)n+=this.charWidths[e[s]];return!this.session.getOverwrite()&&i>r&&e[t]%2===0&&(n+=this.charWidths[e[t]]),this.wrapIndent&&(n+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(n+=this.rtlLineOffset),n},h.prototype.getSelections=function(i,r){var o=this.bidiMap,t=o.bidiLevels,e,n=[],s=0,f=Math.min(i,r)-this.wrapIndent,m=Math.max(i,r)-this.wrapIndent,A=!1,E=!1,S=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var C,q=0;q<t.length;q++)C=o.logicalFromVisual[q],e=t[q],A=C>=f&&C<m,A&&!E?S=s:!A&&E&&n.push({left:S,width:s-S}),s+=this.charWidths[e],E=A;if(A&&q===t.length&&n.push({left:S,width:s-S}),this.isRtlDir)for(var Be=0;Be<n.length;Be++)n[Be].left+=this.rtlLineOffset;return n},h.prototype.offsetToCol=function(o){this.isRtlDir&&(o-=this.rtlLineOffset);var r=0,o=Math.max(o,0),t=0,e=0,n=this.bidiMap.bidiLevels,s=this.charWidths[n[e]];for(this.wrapIndent&&(o-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);o>t+s/2;){if(t+=s,e===n.length-1){s=0;break}s=this.charWidths[n[++e]]}return e>0&&n[e-1]%2!==0&&n[e]%2===0?(o<t&&e--,r=this.bidiMap.logicalFromVisual[e]):e>0&&n[e-1]%2===0&&n[e]%2!==0?r=1+(o>t?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===n.length-1&&s===0&&n[e-1]%2===0||!this.isRtlDir&&e===0&&n[e]%2!==0?r=1+this.bidiMap.logicalFromVisual[e]:(e>0&&n[e-1]%2!==0&&s!==0&&e--,r=this.bidiMap.logicalFromVisual[e]),r===0&&this.isRtlDir&&r++,r+this.wrapIndent},h}();p.BidiHandler=a}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(g,p,Se){var D=g("./lib/oop"),_=g("./lib/lang"),x=g("./lib/event_emitter").EventEmitter,a=g("./range").Range,h=function(){function i(r){this.session=r,this.doc=r.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var o=this;this.cursor.on("change",function(t){o.$cursorChanged=!0,o.$silent||o._emit("changeCursor"),!o.$isEmpty&&!o.$silent&&o._emit("changeSelection"),!o.$keepDesiredColumnOnChange&&t.old.column!=t.value.column&&(o.$desiredColumn=null)}),this.anchor.on("change",function(){o.$anchorChanged=!0,!o.$isEmpty&&!o.$silent&&o._emit("changeSelection")})}return i.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},i.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},i.prototype.getCursor=function(){return this.lead.getPosition()},i.prototype.setAnchor=function(r,o){this.$isEmpty=!1,this.anchor.setPosition(r,o)},i.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},i.prototype.getSelectionLead=function(){return this.lead.getPosition()},i.prototype.isBackwards=function(){var r=this.anchor,o=this.lead;return r.row>o.row||r.row==o.row&&r.column>o.column},i.prototype.getRange=function(){var r=this.anchor,o=this.lead;return this.$isEmpty?a.fromPoints(o,o):this.isBackwards()?a.fromPoints(o,r):a.fromPoints(r,o)},i.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},i.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},i.prototype.setRange=function(r,o){var t=o?r.end:r.start,e=o?r.start:r.end;this.$setSelection(t.row,t.column,e.row,e.column)},i.prototype.$setSelection=function(r,o,t,e){if(!this.$silent){var n=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(r,o),this.cursor.setPosition(t,e),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||n!=this.$isEmpty||s)&&this._emit("changeSelection")}},i.prototype.$moveSelection=function(r){var o=this.lead;this.$isEmpty&&this.setSelectionAnchor(o.row,o.column),r.call(this)},i.prototype.selectTo=function(r,o){this.$moveSelection(function(){this.moveCursorTo(r,o)})},i.prototype.selectToPosition=function(r){this.$moveSelection(function(){this.moveCursorToPosition(r)})},i.prototype.moveTo=function(r,o){this.clearSelection(),this.moveCursorTo(r,o)},i.prototype.moveToPosition=function(r){this.clearSelection(),this.moveCursorToPosition(r)},i.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},i.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},i.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},i.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},i.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},i.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},i.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},i.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},i.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},i.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},i.prototype.getWordRange=function(r,o){if(typeof o>"u"){var t=r||this.lead;r=t.row,o=t.column}return this.session.getWordRange(r,o)},i.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},i.prototype.selectAWord=function(){var r=this.getCursor(),o=this.session.getAWordRange(r.row,r.column);this.setSelectionRange(o)},i.prototype.getLineRange=function(r,o){var t=typeof r=="number"?r:this.lead.row,e,n=this.session.getFoldLine(t);return n?(t=n.start.row,e=n.end.row):e=t,o===!0?new a(t,0,e,this.session.getLine(e).length):new a(t,0,e+1,0)},i.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},i.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},i.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},i.prototype.wouldMoveIntoSoftTab=function(r,o,t){var e=r.column,n=r.column+o;return t<0&&(e=r.column-o,n=r.column),this.session.isTabStop(r)&&this.doc.getLine(r.row).slice(e,n).split(" ").length-1==o},i.prototype.moveCursorLeft=function(){var r=this.lead.getPosition(),o;if(o=this.session.getFoldAt(r.row,r.column,-1))this.moveCursorTo(o.start.row,o.start.column);else if(r.column===0)r.row>0&&this.moveCursorTo(r.row-1,this.doc.getLine(r.row-1).length);else{var t=this.session.getTabSize();this.wouldMoveIntoSoftTab(r,t,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-t):this.moveCursorBy(0,-1)}},i.prototype.moveCursorRight=function(){var r=this.lead.getPosition(),o;if(o=this.session.getFoldAt(r.row,r.column,1))this.moveCursorTo(o.end.row,o.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 t=this.session.getTabSize(),r=this.lead;this.wouldMoveIntoSoftTab(r,t,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,t):this.moveCursorBy(0,1)}},i.prototype.moveCursorLineStart=function(){var r=this.lead.row,o=this.lead.column,t=this.session.documentToScreenRow(r,o),e=this.session.screenToDocumentPosition(t,0),n=this.session.getDisplayLine(r,null,e.row,e.column),s=n.match(/^\s*/);s[0].length!=o&&!this.session.$useEmacsStyleLineStart&&(e.column+=s[0].length),this.moveCursorToPosition(e)},i.prototype.moveCursorLineEnd=function(){var r=this.lead,o=this.session.getDocumentLastRowColumnPosition(r.row,r.column);if(this.lead.column==o.column){var t=this.session.getLine(o.row);if(o.column==t.length){var e=t.search(/\s+$/);e>0&&(o.column=e)}}this.moveCursorTo(o.row,o.column)},i.prototype.moveCursorFileEnd=function(){var r=this.doc.getLength()-1,o=this.doc.getLine(r).length;this.moveCursorTo(r,o)},i.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},i.prototype.moveCursorLongWordRight=function(){var r=this.lead.row,o=this.lead.column,t=this.doc.getLine(r),e=t.substring(o);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var n=this.session.getFoldAt(r,o,1);if(n){this.moveCursorTo(n.end.row,n.end.column);return}if(this.session.nonTokenRe.exec(e)&&(o+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=t.substring(o)),o>=t.length){this.moveCursorTo(r,t.length),this.moveCursorRight(),r<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(o+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,o)},i.prototype.moveCursorLongWordLeft=function(){var r=this.lead.row,o=this.lead.column,t;if(t=this.session.getFoldAt(r,o,-1)){this.moveCursorTo(t.start.row,t.start.column);return}var e=this.session.getFoldStringAt(r,o,-1);e==null&&(e=this.doc.getLine(r).substring(0,o));var n=_.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(n)&&(o-=this.session.nonTokenRe.lastIndex,n=n.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),o<=0){this.moveCursorTo(r,0),this.moveCursorLeft(),r>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(n)&&(o-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,o)},i.prototype.$shortWordEndIndex=function(r){var o=0,t,e=/\s/,n=this.session.tokenRe;if(n.lastIndex=0,this.session.tokenRe.exec(r))o=this.session.tokenRe.lastIndex;else{for(;(t=r[o])&&e.test(t);)o++;if(o<1){for(n.lastIndex=0;(t=r[o])&&!n.test(t);)if(n.lastIndex=0,o++,e.test(t))if(o>2){o--;break}else{for(;(t=r[o])&&e.test(t);)o++;if(o>2)break}}}return n.lastIndex=0,o},i.prototype.moveCursorShortWordRight=function(){var r=this.lead.row,o=this.lead.column,t=this.doc.getLine(r),e=t.substring(o),n=this.session.getFoldAt(r,o,1);if(n)return this.moveCursorTo(n.end.row,n.end.column);if(o==t.length){var s=this.doc.getLength();do r++,e=this.doc.getLine(r);while(r<s&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),o=0}var f=this.$shortWordEndIndex(e);this.moveCursorTo(r,o+f)},i.prototype.moveCursorShortWordLeft=function(){var r=this.lead.row,o=this.lead.column,t;if(t=this.session.getFoldAt(r,o,-1))return this.moveCursorTo(t.start.row,t.start.column);var e=this.session.getLine(r).substring(0,o);if(o===0){do r--,e=this.doc.getLine(r);while(r>0&&/^\s*$/.test(e));o=e.length,/\s+$/.test(e)||(e="")}var n=_.stringReverse(e),s=this.$shortWordEndIndex(n);return this.moveCursorTo(r,o-s)},i.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},i.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},i.prototype.moveCursorBy=function(r,o){var t=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(o===0&&(r!==0&&(this.session.$bidiHandler.isBidiRow(t.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(t.column),t.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=t.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?t.column=this.$desiredColumn:this.$desiredColumn=t.column),r!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var n=this.session.lineWidgets[this.lead.row];r<0?r-=n.rowsAbove||0:r>0&&(r+=n.rowCount-(n.rowsAbove||0))}var s=this.session.screenToDocumentPosition(t.row+r,t.column,e);r!==0&&o===0&&s.row===this.lead.row&&(s.column,this.lead.column),this.moveCursorTo(s.row,s.column+o,o===0)},i.prototype.moveCursorToPosition=function(r){this.moveCursorTo(r.row,r.column)},i.prototype.moveCursorTo=function(r,o,t){var e=this.session.getFoldAt(r,o,1);e&&(r=e.start.row,o=e.start.column),this.$keepDesiredColumnOnChange=!0;var n=this.session.getLine(r);/[\uDC00-\uDFFF]/.test(n.charAt(o))&&n.charAt(o-1)&&(this.lead.row==r&&this.lead.column==o+1?o=o-1:o=o+1),this.lead.setPosition(r,o),this.$keepDesiredColumnOnChange=!1,t||(this.$desiredColumn=null)},i.prototype.moveCursorToScreen=function(r,o,t){var e=this.session.screenToDocumentPosition(r,o);this.moveCursorTo(e.row,e.column,t)},i.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},i.prototype.fromOrientedRange=function(r){this.setSelectionRange(r,r.cursor==r.start),this.$desiredColumn=r.desiredColumn||this.$desiredColumn},i.prototype.toOrientedRange=function(r){var o=this.getRange();return r?(r.start.column=o.start.column,r.start.row=o.start.row,r.end.column=o.end.column,r.end.row=o.end.row):r=o,r.cursor=this.isBackwards()?r.start:r.end,r.desiredColumn=this.$desiredColumn,r},i.prototype.getRangeOfMovements=function(r){var o=this.getCursor();try{r(this);var t=this.getCursor();return a.fromPoints(o,t)}catch{return a.fromPoints(o,o)}finally{this.moveCursorToPosition(o)}},i.prototype.toJSON=function(){if(this.rangeCount)var r=this.ranges.map(function(o){var t=o.clone();return t.isBackwards=o.cursor==o.start,t});else{var r=this.getRange();r.isBackwards=this.isBackwards()}return r},i.prototype.fromJSON=function(r){if(r.start==null)if(this.rangeList&&r.length>1){this.toSingleRange(r[0]);for(var o=r.length;o--;){var t=a.fromPoints(r[o].start,r[o].end);r[o].isBackwards&&(t.cursor=t.start),this.addRange(t,!0)}return}else r=r[0];this.rangeList&&this.toSingleRange(r),this.setSelectionRange(r,r.isBackwards)},i.prototype.isEqual=function(r){if((r.length||this.rangeCount)&&r.length!=this.rangeCount)return!1;if(!r.length||!this.ranges)return this.getRange().isEqual(r);for(var o=this.ranges.length;o--;)if(!this.ranges[o].isEqual(r[o]))return!1;return!0},i}();h.prototype.setSelectionAnchor=h.prototype.setAnchor,h.prototype.getSelectionAnchor=h.prototype.getAnchor,h.prototype.setSelectionRange=h.prototype.setRange,D.implement(h.prototype,x),p.Selection=h}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(g,p,Se){var D=g("./lib/report_error").reportError,_=2e3,x=function(){function a(h){this.splitRegex,this.states=h,this.regExps={},this.matchMappings={};for(var i in this.states){for(var r=this.states[i],o=[],t=0,e=this.matchMappings[i]={defaultToken:"text"},n="g",s=[],f=0;f<r.length;f++){var m=r[f];if(m.defaultToken&&(e.defaultToken=m.defaultToken),m.caseInsensitive&&n.indexOf("i")===-1&&(n+="i"),m.unicode&&n.indexOf("u")===-1&&(n+="u"),m.regex!=null){m.regex instanceof RegExp&&(m.regex=m.regex.toString().slice(1,-1));var A=m.regex,E=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(m.token)?m.token.length==1||E==1?m.token=m.token[0]:E-1!=m.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:m,groupCount:E-1}),m.token=m.token[0]):(m.tokenArray=m.token,m.token=null,m.onMatch=this.$arrayTokens):typeof m.token=="function"&&!m.onMatch&&(E>1?m.onMatch=this.$applyToken:m.onMatch=m.token),E>1&&(/\\\d/.test(m.regex)?A=m.regex.replace(/\\([0-9]+)/g,function(S,C){return"\\"+(parseInt(C,10)+t+1)}):(E=1,A=this.removeCapturingGroups(m.regex)),!m.splitRegex&&typeof m.token!="string"&&s.push(m)),e[t]=f,t+=E,o.push(A),m.onMatch||(m.onMatch=null)}}o.length||(e[0]=0,o.push("$")),s.forEach(function(S){S.splitRegex=this.createSplitterRegexp(S.regex,n)},this),this.regExps[i]=new RegExp("("+o.join(")|(")+")|($)",n)}}return a.prototype.$setMaxTokenCount=function(h){_=h|0},a.prototype.$applyToken=function(h){var i=this.splitRegex.exec(h).slice(1),r=this.token.apply(this,i);if(typeof r=="string")return[{type:r,value:h}];for(var o=[],t=0,e=r.length;t<e;t++)i[t]&&(o[o.length]={type:r[t],value:i[t]});return o},a.prototype.$arrayTokens=function(h){if(!h)return[];var i=this.splitRegex.exec(h);if(!i)return"text";for(var r=[],o=this.tokenArray,t=0,e=o.length;t<e;t++)i[t+1]&&(r[r.length]={type:o[t],value:i[t+1]});return r},a.prototype.removeCapturingGroups=function(h){var i=h.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(r,o){return o?"(?:":r});return i},a.prototype.createSplitterRegexp=function(h,i){if(h.indexOf("(?=")!=-1){var r=0,o=!1,t={};h.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,n,s,f,m,A){return o?o=m!="]":m?o=!0:f?(r==t.stack&&(t.end=A+1,t.stack=-1),r--):s&&(r++,s.length!=1&&(t.stack=r,t.start=A)),e}),t.end!=null&&/^\)*$/.test(h.substr(t.end))&&(h=h.substring(0,t.start)+h.substr(t.end))}return h.charAt(0)!="^"&&(h="^"+h),h.charAt(h.length-1)!="$"&&(h+="$"),new RegExp(h,(i||"").replace("g",""))},a.prototype.getLineTokens=function(h,i){if(i&&typeof i!="string"){var r=i.slice(0);i=r[0],i==="#tmp"&&(r.shift(),i=r.shift())}else var r=[];var o=i||"start",t=this.states[o];t||(o="start",t=this.states[o]);var e=this.matchMappings[o],n=this.regExps[o];n.lastIndex=0;for(var s,f=[],m=0,A=0,E={type:null,value:""};s=n.exec(h);){var S=e.defaultToken,C=null,q=s[0],Be=n.lastIndex;if(Be-q.length>m){var se=h.substring(m,Be-q.length);E.type==S?E.value+=se:(E.type&&f.push(E),E={type:S,value:se})}for(var j=0;j<s.length-2;j++)if(s[j+1]!==void 0){C=t[e[j]],C.onMatch?S=C.onMatch(q,o,r,h):S=C.token,C.next&&(typeof C.next=="string"?o=C.next:o=C.next(o,r),t=this.states[o],t||(this.reportError("state doesn't exist",o),o="start",t=this.states[o]),e=this.matchMappings[o],m=Be,n=this.regExps[o],n.lastIndex=Be),C.consumeLineEnd&&(m=Be);break}if(q){if(typeof S=="string")(!C||C.merge!==!1)&&E.type===S?E.value+=q:(E.type&&f.push(E),E={type:S,value:q});else if(S){E.type&&f.push(E),E={type:null,value:""};for(var j=0;j<S.length;j++)f.push(S[j])}}if(m==h.length)break;if(m=Be,A++>_){for(A>2*h.length&&this.reportError("infinite loop with in ace tokenizer",{startState:i,line:h});m<h.length;)E.type&&f.push(E),E={value:h.substring(m,m+=500),type:"overflow"};o="start",r=[];break}}return E.type&&f.push(E),r.length>1&&r[0]!==o&&r.unshift("#tmp",o),{tokens:f,state:r.length?r:o}},a}();x.prototype.reportError=D,p.Tokenizer=x}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(g,p,Se){var D=g("../lib/deep_copy").deepCopy,_;_=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(h,i){if(!i){for(var r in h)this.$rules[r]=h[r];return}for(var r in h){for(var o=h[r],t=0;t<o.length;t++){var e=o[t];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(i)!==0&&(e.next=i+e.next),e.nextState&&e.nextState.indexOf(i)!==0&&(e.nextState=i+e.nextState))}this.$rules[i+r]=o}},this.getRules=function(){return this.$rules},this.embedRules=function(h,i,r,o,t){var e=typeof h=="function"?new h().getRules():h;if(o)for(var n=0;n<o.length;n++)o[n]=i+o[n];else{o=[];for(var s in e)o.push(i+s)}if(this.addRules(e,i),r)for(var f=Array.prototype[t?"push":"unshift"],n=0;n<o.length;n++)f.apply(this.$rules[o[n]],D(r));this.$embeds||(this.$embeds=[]),this.$embeds.push(i)},this.getEmbeds=function(){return this.$embeds};var x=function(h,i){return(h!="start"||i.length)&&i.unshift(this.nextState,h),this.nextState},a=function(h,i){return i.shift(),i.shift()||"start"};this.normalizeRules=function(){var h=0,i=this.$rules;function r(o){var t=i[o];t.processed=!0;for(var e=0;e<t.length;e++){var n=t[e],s=null;Array.isArray(n)&&(s=n,n={}),!n.regex&&n.start&&(n.regex=n.start,n.next||(n.next=[]),n.next.push({defaultToken:n.token},{token:n.token+".end",regex:n.end||n.start,next:"pop"}),n.token=n.token+".start",n.push=!0);var f=n.next||n.push;if(f&&Array.isArray(f)){var m=n.stateName;m||(m=n.token,typeof m!="string"&&(m=m[0]||""),i[m]&&(m+=h++)),i[m]=f,n.next=m,r(m)}else f=="pop"&&(n.next=a);if(n.push&&(n.nextState=n.next||n.push,n.next=x,delete n.push),n.rules)for(var A in n.rules)i[A]?i[A].push&&i[A].push.apply(i[A],n.rules[A]):i[A]=n.rules[A];var E=typeof n=="string"?n:n.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?s=E.map(function(C){return i[C]}):s=i[E]),s){var S=[e,1].concat(s);n.noEscape&&(S=S.filter(function(C){return!C.next})),t.splice.apply(t,S),e--}n.keywordMap&&(n.token=this.createKeywordMapper(n.keywordMap,n.defaultToken||"text",n.caseInsensitive),delete n.defaultToken)}}Object.keys(i).forEach(r,this)},this.createKeywordMapper=function(h,i,r,o){var t=Object.create(null);return this.$keywordList=[],Object.keys(h).forEach(function(e){for(var n=h[e],s=n.split(o||"|"),f=s.length;f--;){var m=s[f];this.$keywordList.push(m),r&&(m=m.toLowerCase()),t[m]=e}},this),h=null,r?function(e){return t[e.toLowerCase()]||i}:function(e){return t[e]||i}},this.getKeywords=function(){return this.$keywords}}).call(_.prototype),p.TextHighlightRules=_}),ace.define("ace/mode/behaviour",["require","exports","module"],function(g,p,Se){var D;D=function(){this.$behaviours={}},(function(){this.add=function(_,x,a){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[_]:this.$behaviours[_]={}}this.$behaviours[_][x]=a},this.addBehaviours=function(_){for(var x in _)for(var a in _[x])this.add(x,a,_[x][a])},this.remove=function(_){this.$behaviours&&this.$behaviours[_]&&delete this.$behaviours[_]},this.inherit=function(_,x){if(typeof _=="function")var a=new _().getBehaviours(x);else var a=_.getBehaviours(x);this.addBehaviours(a)},this.getBehaviours=function(_){if(_){for(var x={},a=0;a<_.length;a++)this.$behaviours[_[a]]&&(x[_[a]]=this.$behaviours[_[a]]);return x}else return this.$behaviours}}).call(D.prototype),p.Behaviour=D}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(g,p,Se){var D=g("./range").Range,_=function(){function x(a,h,i){this.$session=a,this.$row=h,this.$rowTokens=a.getTokens(h);var r=a.getTokenAt(h,i);this.$tokenIndex=r?r.index:-1}return x.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]},x.prototype.stepForward=function(){this.$tokenIndex+=1;for(var a;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentTokenRow=function(){return this.$row},x.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,h=this.$tokenIndex,i=a[h].start;if(i!==void 0)return i;for(i=0;h>0;)h-=1,i+=a[h].value.length;return i},x.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},x.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],h=this.getCurrentTokenColumn();return new D(this.$row,h,this.$row,h+a.value.length)},x}();p.TokenIterator=_}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(g,p,Se){var D=g("../../lib/oop"),_=g("../behaviour").Behaviour,x=g("../../token_iterator").TokenIterator,a=g("../../lib/lang"),h=["text","paren.rparen","rparen","paren","punctuation.operator"],i=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],r,o={},t={'"':'"',"'":"'"},e=function(f){var m=-1;if(f.multiSelect&&(m=f.selection.index,o.rangeCount!=f.multiSelect.rangeCount&&(o={rangeCount:f.multiSelect.rangeCount})),o[m])return r=o[m];r=o[m]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},n=function(f,m,A,E){var S=f.end.row-f.start.row;return{text:A+m+E,selection:[0,f.start.column+1,S,f.end.column+(S?0:1)]}},s;s=function(f){f=f||{},this.add("braces","insertion",function(m,A,E,S,C){var q=E.getCursorPosition(),Be=S.doc.getLine(q.row);if(C=="{"){e(E);var se=E.getSelectionRange(),j=S.doc.getTextRange(se),ct=S.getTokenAt(q.row,q.column);if(j!==""&&j!=="{"&&E.getWrapBehavioursEnabled())return n(se,j,"{","}");if(ct&&/(?:string)\.quasi|\.xml/.test(ct.type)){var G=[/tag\-(?:open|name)/,/attribute\-name/];return G.some(function(lt){return lt.test(ct.type)})||/(string)\.quasi/.test(ct.type)&&ct.value[q.column-ct.start-1]!=="$"?void 0:(s.recordAutoInsert(E,S,"}"),{text:"{}",selection:[1,1]})}else if(s.isSaneInsertion(E,S))return/[\]\}\)]/.test(Be[q.column])||E.inMultiSelectMode||f.braces?(s.recordAutoInsert(E,S,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(E,S,"{"),{text:"{",selection:[1,1]})}else if(C=="}"){e(E);var U=Be.substring(q.column,q.column+1);if(U=="}"){var b=S.$findOpeningBracket("}",{column:q.column+1,row:q.row});if(b!==null&&s.isAutoInsertedClosing(q,Be,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(C==`
|
180
|
+
`).length>2?Si=n.down:xi>ot&&w[xi-1]==" "?(Si=n.right,Li=s.option):(xi>ot||xi==ot&&ot!=W&&Mi==xi)&&(Si=n.right),Mi!==xi&&(Li|=s.shift),Si){var Oi=vi.onCommandKey({},Li,Si);if(!Oi&&vi.commands){Si=n.keyCodeToString(Si);var Pi=vi.commands.findKeyCommand(Li,Si);Pi&&vi.execCommand(Pi)}W=Mi,ot=xi,Vt("")}}};document.addEventListener("selectionchange",ki),vi.on("destroy",function(){document.removeEventListener("selectionchange",ki)})}this.destroy=function(){q.parentElement&&q.parentElement.removeChild(q)}},p.TextInput=E,p.$setUserAgentForTests=function(S,C){A=S,g=C}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(f,p,Se){var D=f("../lib/useragent"),_=0,x=550,a=function(){function r(o){o.$clickSelection=null;var t=o.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(o)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(o)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(o)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(o)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(o));var e=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];e.forEach(function(n){o[n]=this[n]},this),o.selectByLines=this.extendSelectionBy.bind(o,"getLineRange"),o.selectByWords=this.extendSelectionBy.bind(o,"getWordRange")}return r.prototype.onMouseDown=function(o){var t=o.inSelection(),e=o.getDocumentPosition();this.mousedownEvent=o;var n=this.editor,s=o.getButton();if(s!==0){var g=n.getSelectionRange(),m=g.isEmpty();(m||s==1)&&n.selection.moveToPosition(e),s==2&&(n.textInput.onContextMenu(o.domEvent),D.isMozilla||o.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!n.isFocused()&&(n.focus(),this.$focusTimeout&&!this.$clickSelection&&!n.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(o);return}return this.captureMouse(o),this.startSelect(e,o.domEvent._clicks>1),o.preventDefault()},r.prototype.startSelect=function(o,t){o=o||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var e=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?e.selection.selectToPosition(o):t||e.selection.moveToPosition(o),t||this.select(),e.setStyle("ace_selecting"),this.setState("select"))},r.prototype.select=function(){var o,t=this.editor,e=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(e);if(n==-1)o=this.$clickSelection.end;else if(n==1)o=this.$clickSelection.start;else{var s=i(this.$clickSelection,e);e=s.cursor,o=s.anchor}t.selection.setSelectionAnchor(o.row,o.column)}t.selection.selectToPosition(e),t.renderer.scrollCursorIntoView()},r.prototype.extendSelectionBy=function(o){var t,e=this.editor,n=e.renderer.screenToTextCoordinates(this.x,this.y),s=e.selection[o](n.row,n.column);if(this.$clickSelection){var g=this.$clickSelection.comparePoint(s.start),m=this.$clickSelection.comparePoint(s.end);if(g==-1&&m<=0)t=this.$clickSelection.end,(s.end.row!=n.row||s.end.column!=n.column)&&(n=s.start);else if(m==1&&g>=0)t=this.$clickSelection.start,(s.start.row!=n.row||s.start.column!=n.column)&&(n=s.end);else if(g==-1&&m==1)n=s.end,t=s.start;else{var A=i(this.$clickSelection,n);n=A.cursor,t=A.anchor}e.selection.setSelectionAnchor(t.row,t.column)}e.selection.selectToPosition(n),e.renderer.scrollCursorIntoView()},r.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},r.prototype.focusWait=function(){var o=h(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(o>_||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},r.prototype.onDoubleClick=function(o){var t=o.getDocumentPosition(),e=this.editor,n=e.session,s=n.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=e.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},r.prototype.onTripleClick=function(o){var t=o.getDocumentPosition(),e=this.editor;this.setState("selectByLines");var n=e.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=e.selection.getLineRange(n.start.row),this.$clickSelection.end=e.selection.getLineRange(n.end.row).end):this.$clickSelection=e.selection.getLineRange(t.row),this.select()},r.prototype.onQuadClick=function(o){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},r.prototype.onMouseWheel=function(o){if(!o.getAccelKey()){o.getShiftKey()&&o.wheelY&&!o.wheelX&&(o.wheelX=o.wheelY,o.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var e=this.$lastScroll,n=o.domEvent.timeStamp,s=n-e.t,g=s?o.wheelX/s:e.vx,m=s?o.wheelY/s:e.vy;s<x&&(g=(g+e.vx)/2,m=(m+e.vy)/2);var A=Math.abs(g/m),E=!1;if(A>=1&&t.renderer.isScrollableBy(o.wheelX*o.speed,0)&&(E=!0),A<=1&&t.renderer.isScrollableBy(0,o.wheelY*o.speed)&&(E=!0),E)e.allowed=n;else if(n-e.allowed<x){var S=Math.abs(g)<=1.5*Math.abs(e.vx)&&Math.abs(m)<=1.5*Math.abs(e.vy);S?(E=!0,e.allowed=n):e.allowed=0}if(e.t=n,e.vx=g,e.vy=m,E)return t.renderer.scrollBy(o.wheelX*o.speed,o.wheelY*o.speed),o.stop()}},r}();a.prototype.selectEnd=a.prototype.selectByLinesEnd,a.prototype.selectAllEnd=a.prototype.selectByLinesEnd,a.prototype.selectByWordsEnd=a.prototype.selectByLinesEnd,p.DefaultHandlers=a;function h(r,o,t,e){return Math.sqrt(Math.pow(t-r,2)+Math.pow(e-o,2))}function i(r,o){if(r.start.row==r.end.row)var t=2*o.column-r.start.column-r.end.column;else if(r.start.row==r.end.row-1&&!r.start.column&&!r.end.column)var t=o.column-4;else var t=2*o.row-r.start.row-r.end.row;return t<0?{cursor:r.start,anchor:r.end}:{cursor:r.end,anchor:r.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(f,p,Se){p.preventParentScroll=function(_){_.stopPropagation();var x=_.currentTarget,a=x.scrollHeight>x.clientHeight;a||_.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(f,p,Se){var D=this&&this.__extends||function(){var n=function(s,g){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,A){m.__proto__=A}||function(m,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(m[E]=A[E])},n(s,g)};return function(s,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");n(s,g);function m(){this.constructor=s}s.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}}(),_=this&&this.__values||function(n){var s=typeof Symbol=="function"&&Symbol.iterator,g=s&&n[s],m=0;if(g)return g.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&m>=n.length&&(n=void 0),{value:n&&n[m++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},x=f("./lib/dom");f("./lib/event");var a=f("./range").Range,h=f("./lib/scroll").preventParentScroll,i="ace_tooltip",r=function(){function n(s){this.isOpen=!1,this.$element=null,this.$parentNode=s}return n.prototype.$init=function(){return this.$element=x.createElement("div"),this.$element.className=i,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},n.prototype.getElement=function(){return this.$element||this.$init()},n.prototype.setText=function(s){this.getElement().textContent=s},n.prototype.setHtml=function(s){this.getElement().innerHTML=s},n.prototype.setPosition=function(s,g){this.getElement().style.left=s+"px",this.getElement().style.top=g+"px"},n.prototype.setClassName=function(s){x.addCssClass(this.getElement(),s)},n.prototype.setTheme=function(s){this.$element.className=i+" "+(s.isDark?"ace_dark ":"")+(s.cssClass||"")},n.prototype.show=function(s,g,m){s!=null&&this.setText(s),g!=null&&m!=null&&this.setPosition(g,m),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},n.prototype.hide=function(s){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=i,this.isOpen=!1)},n.prototype.getHeight=function(){return this.getElement().offsetHeight},n.prototype.getWidth=function(){return this.getElement().offsetWidth},n.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},n}(),o=function(){function n(){this.popups=[]}return n.prototype.addPopup=function(s){this.popups.push(s),this.updatePopups()},n.prototype.removePopup=function(s){var g=this.popups.indexOf(s);g!==-1&&(this.popups.splice(g,1),this.updatePopups())},n.prototype.updatePopups=function(){var s,g,m,A;this.popups.sort(function(G,U){return U.priority-G.priority});var E=[];try{for(var S=_(this.popups),C=S.next();!C.done;C=S.next()){var q=C.value,Be=!0;try{for(var se=(m=void 0,_(E)),j=se.next();!j.done;j=se.next()){var ct=j.value;if(this.doPopupsOverlap(ct,q)){Be=!1;break}}}catch(G){m={error:G}}finally{try{j&&!j.done&&(A=se.return)&&A.call(se)}finally{if(m)throw m.error}}Be?E.push(q):q.hide()}}catch(G){s={error:G}}finally{try{C&&!C.done&&(g=S.return)&&g.call(S)}finally{if(s)throw s.error}}},n.prototype.doPopupsOverlap=function(s,g){var m=s.getElement().getBoundingClientRect(),A=g.getElement().getBoundingClientRect();return m.left<A.right&&m.right>A.left&&m.top<A.bottom&&m.bottom>A.top},n}(),t=new o;p.popupManager=t,p.Tooltip=r;var e=function(n){D(s,n);function s(g){g===void 0&&(g=document.body);var m=n.call(this,g)||this;m.timeout=void 0,m.lastT=0,m.idleTime=350,m.lastEvent=void 0,m.onMouseOut=m.onMouseOut.bind(m),m.onMouseMove=m.onMouseMove.bind(m),m.waitForHover=m.waitForHover.bind(m),m.hide=m.hide.bind(m);var A=m.getElement();return A.style.whiteSpace="pre-wrap",A.style.pointerEvents="auto",A.addEventListener("mouseout",m.onMouseOut),A.tabIndex=-1,A.addEventListener("blur",(function(){A.contains(document.activeElement)||this.hide()}).bind(m)),A.addEventListener("wheel",h),m}return s.prototype.addToEditor=function(g){g.on("mousemove",this.onMouseMove),g.on("mousedown",this.hide),g.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},s.prototype.removeFromEditor=function(g){g.off("mousemove",this.onMouseMove),g.off("mousedown",this.hide),g.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.onMouseMove=function(g,m){this.lastEvent=g,this.lastT=Date.now();var A=m.$mouseHandler.isMousePressed;if(this.isOpen){var E=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(E.row,E.column)||A||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||A||(this.lastEvent=g,this.timeout=setTimeout(this.waitForHover,this.idleTime))},s.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var g=Date.now()-this.lastT;if(this.idleTime-g>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-g);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},s.prototype.isOutsideOfText=function(g){var m=g.editor,A=g.getDocumentPosition(),E=m.session.getLine(A.row);if(A.column==E.length){var S=m.renderer.pixelToScreenCoordinates(g.clientX,g.clientY),C=m.session.documentToScreenPosition(A.row,A.column);if(C.column!=S.column||C.row!=S.row)return!0}return!1},s.prototype.setDataProvider=function(g){this.$gatherData=g},s.prototype.showForRange=function(g,m,A,E){var S=10;if(!(E&&E!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var C=g.renderer;this.isOpen||(t.addPopup(this),this.$registerCloseEvents(),this.setTheme(C.theme)),this.isOpen=!0,this.addMarker(m,g.session),this.range=a.fromPoints(m.start,m.end);var q=C.textToScreenCoordinates(m.start.row,m.start.column),Be=C.scroller.getBoundingClientRect();q.pageX<Be.left&&(q.pageX=Be.left);var se=this.getElement();se.innerHTML="",se.appendChild(A),se.style.maxHeight="",se.style.display="block";var j=se.clientHeight,ct=se.clientWidth,G=window.innerHeight-q.pageY-C.lineHeight,U=!0;q.pageY-j<0&&q.pageY<G&&(U=!1),se.style.maxHeight=(U?q.pageY:G)-S+"px",se.style.top=U?"":q.pageY+C.lineHeight+"px",se.style.bottom=U?window.innerHeight-q.pageY+"px":"",se.style.left=Math.min(q.pageX,window.innerWidth-ct-S)+"px"}},s.prototype.addMarker=function(g,m){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=m,this.marker=m&&m.addMarker(g,"ace_highlight-marker","text")},s.prototype.hide=function(g){!g&&document.activeElement==this.getElement()||g&&g.target&&(g.type!="keydown"||g.ctrlKey||g.metaKey)&&this.$element.contains(g.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,t.removePopup(this)))},s.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},s.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},s.prototype.onMouseOut=function(g){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!g.relatedTarget||this.getElement().contains(g.relatedTarget)||g&&g.currentTarget.contains(g.relatedTarget)||g.relatedTarget.classList.contains("ace_content")||this.hide())},s}(r);p.HoverTooltip=e}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],function(f,p,Se){var D=this&&this.__extends||function(){var n=function(s,g){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,A){m.__proto__=A}||function(m,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(m[E]=A[E])},n(s,g)};return function(s,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");n(s,g);function m(){this.constructor=s}s.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}}(),_=this&&this.__values||function(n){var s=typeof Symbol=="function"&&Symbol.iterator,g=s&&n[s],m=0;if(g)return g.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&m>=n.length&&(n=void 0),{value:n&&n[m++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},x=f("../lib/dom"),a=f("../lib/event"),h=f("../tooltip").Tooltip,i=f("../config").nls,r=5,o=3;p.GUTTER_TOOLTIP_LEFT_OFFSET=r,p.GUTTER_TOOLTIP_TOP_OFFSET=o;function t(n){var s=n.editor,g=s.renderer.$gutterLayer,m=new e(s,!0);n.editor.setDefaultHandler("guttermousedown",function(Be){if(!(!s.isFocused()||Be.getButton()!=0)){var se=g.getRegion(Be);if(se!="foldWidgets"){var j=Be.getDocumentPosition().row,ct=s.session.selection;if(Be.getShiftKey())ct.selectTo(j,0);else{if(Be.domEvent.detail==2)return s.selectAll(),Be.preventDefault();n.$clickSelection=s.selection.getLineRange(j)}return n.setState("selectByLines"),n.captureMouse(Be),Be.preventDefault()}}});var A,E;function S(){var Be=E.getDocumentPosition().row,se=s.session.getLength();if(Be==se){var j=s.renderer.pixelToScreenCoordinates(0,E.y).row,ct=E.$pos;if(j>s.session.documentToScreenRow(ct.row,ct.column))return C()}if(m.showTooltip(Be),!!m.isOpen)if(s.on("mousewheel",C),s.on("changeSession",C),window.addEventListener("keydown",C,!0),n.$tooltipFollowsMouse)q(E);else{var G=E.getGutterRow(),U=g.$lines.get(G);if(U){var b=U.element.querySelector(".ace_gutter_annotation"),w=b.getBoundingClientRect(),W=m.getElement().style;W.left=w.right-r+"px",W.top=w.bottom-o+"px"}else q(E)}}function C(Be){Be&&Be.type==="keydown"&&(Be.ctrlKey||Be.metaKey)||Be&&Be.type==="mouseout"&&(!Be.relatedTarget||m.getElement().contains(Be.relatedTarget))||(A&&(A=clearTimeout(A)),m.isOpen&&(m.hideTooltip(),s.off("mousewheel",C),s.off("changeSession",C),window.removeEventListener("keydown",C,!0)))}function q(Be){m.setPosition(Be.x,Be.y)}n.editor.setDefaultHandler("guttermousemove",function(Be){var se=Be.domEvent.target||Be.domEvent.srcElement;if(x.hasCssClass(se,"ace_fold-widget")||x.hasCssClass(se,"ace_custom-widget"))return C();m.isOpen&&n.$tooltipFollowsMouse&&q(Be),E=Be,!A&&(A=setTimeout(function(){A=null,E&&!n.isMousePressed&&S()},50))}),a.addListener(s.renderer.$gutter,"mouseout",function(Be){E=null,m.isOpen&&(A=setTimeout(function(){A=null,C(Be)},50))},s)}p.GutterHandler=t;var e=function(n){D(s,n);function s(g,m){m===void 0&&(m=!1);var A=n.call(this,g.container)||this;A.editor=g,A.visibleTooltipRow;var E=A.getElement();return E.setAttribute("role","tooltip"),E.style.pointerEvents="auto",m&&(A.onMouseOut=A.onMouseOut.bind(A),E.addEventListener("mouseout",A.onMouseOut)),A}return s.prototype.onMouseOut=function(g){this.isOpen&&(!g.relatedTarget||this.getElement().contains(g.relatedTarget)||g&&g.currentTarget.contains(g.relatedTarget)||this.hideTooltip())},s.prototype.setPosition=function(g,m){var A=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight,S=this.getWidth(),C=this.getHeight();g+=15,m+=15,g+S>A&&(g-=g+S-A),m+C>E&&(m-=20+C),h.prototype.setPosition.call(this,g,m)},Object.defineProperty(s,"annotationLabels",{get:function(){return{error:{singular:i("gutter-tooltip.aria-label.error.singular","error"),plural:i("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:i("gutter-tooltip.aria-label.security.singular","security finding"),plural:i("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:i("gutter-tooltip.aria-label.warning.singular","warning"),plural:i("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:i("gutter-tooltip.aria-label.info.singular","information message"),plural:i("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:i("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:i("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),s.prototype.showTooltip=function(g){var m,A=this.editor.renderer.$gutterLayer,E=A.$annotations[g],S;E?S={displayText:Array.from(E.displayText),type:Array.from(E.type)}:S={displayText:[],type:[]};var C=A.session.getFoldLine(g);if(C&&A.$showFoldedAnnotations){for(var q={error:[],security:[],warning:[],info:[],hint:[]},Be={error:1,security:2,warning:3,info:4,hint:5},se,j=g+1;j<=C.end.row;j++)if(A.$annotations[j])for(var ct=0;ct<A.$annotations[j].text.length;ct++){var G=A.$annotations[j].type[ct];q[G].push(A.$annotations[j].text[ct]),(!se||Be[G]<Be[se])&&(se=G)}if(["error","security","warning"].includes(se)){var U="".concat(s.annotationsToSummaryString(q)," in folded code.");S.displayText.push(U),S.type.push(se+"_fold")}}if(S.displayText.length===0)return this.hideTooltip();for(var b={error:[],security:[],warning:[],info:[],hint:[]},w=A.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",j=0;j<S.displayText.length;j++){var W=x.createElement("span"),ot=x.createElement("span");(m=ot.classList).add.apply(m,["ace_".concat(S.type[j]),w]),ot.setAttribute("aria-label","".concat(s.annotationLabels[S.type[j].replace("_fold","")].singular)),ot.setAttribute("role","img"),ot.appendChild(x.createTextNode(" ")),W.appendChild(ot),W.appendChild(x.createTextNode(S.displayText[j])),W.appendChild(x.createElement("br")),b[S.type[j].replace("_fold","")].push(W)}var at=this.getElement();x.removeChildren(at),b.error.forEach(function(lt){return at.appendChild(lt)}),b.security.forEach(function(lt){return at.appendChild(lt)}),b.warning.forEach(function(lt){return at.appendChild(lt)}),b.info.forEach(function(lt){return at.appendChild(lt)}),b.hint.forEach(function(lt){return at.appendChild(lt)}),at.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.visibleTooltipRow=g,this.editor._signal("showGutterTooltip",this)},s.prototype.hideTooltip=function(){this.isOpen&&(this.$element.removeAttribute("aria-live"),this.hide(),this.visibleTooltipRow=void 0,this.editor._signal("hideGutterTooltip",this))},s.annotationsToSummaryString=function(g){var m,A,E=[],S=["error","security","warning","info","hint"];try{for(var C=_(S),q=C.next();!q.done;q=C.next()){var Be=q.value;if(g[Be].length){var se=g[Be].length===1?s.annotationLabels[Be].singular:s.annotationLabels[Be].plural;E.push("".concat(g[Be].length," ").concat(se))}}}catch(j){m={error:j}}finally{try{q&&!q.done&&(A=C.return)&&A.call(C)}finally{if(m)throw m.error}}return E.join(", ")},s}(h);p.GutterTooltip=e}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(f,p,Se){var D=f("../lib/event"),_=f("../lib/useragent"),x=function(){function a(h,i){this.speed,this.wheelX,this.wheelY,this.domEvent=h,this.editor=i,this.x=this.clientX=h.clientX,this.y=this.clientY=h.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return a.prototype.stopPropagation=function(){D.stopPropagation(this.domEvent),this.propagationStopped=!0},a.prototype.preventDefault=function(){D.preventDefault(this.domEvent),this.defaultPrevented=!0},a.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},a.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},a.prototype.getGutterRow=function(){var h=this.getDocumentPosition().row,i=this.editor.session.documentToScreenRow(h,0),r=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return i-r},a.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var h=this.editor,i=h.getSelectionRange();if(i.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=i.contains(r.row,r.column)}return this.$inSelection},a.prototype.getButton=function(){return D.getButton(this.domEvent)},a.prototype.getShiftKey=function(){return this.domEvent.shiftKey},a.prototype.getAccelKey=function(){return _.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},a}();p.MouseEvent=x}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(f,p,Se){var D=f("../lib/dom"),_=f("../lib/event"),x=f("../lib/useragent"),a=200,h=200,i=5;function r(t){var e=t.editor,n=D.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ";var s=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];s.forEach(function(Ht){t[Ht]=this[Ht]},this),e.on("mousedown",this.onMouseDown.bind(t));var g=e.container,m,A,E,S,C,q,Be=0,se,j,ct,G,U;this.onDragStart=function(Ht){if(this.cancelDrag||!g.draggable){var Vt=this;return setTimeout(function(){Vt.startSelect(),Vt.captureMouse(Ht)},0),Ht.preventDefault()}C=e.getSelectionRange();var Ut=Ht.dataTransfer;Ut.effectAllowed=e.getReadOnly()?"copy":"copyMove",e.container.appendChild(n),Ut.setDragImage&&Ut.setDragImage(n,0,0),setTimeout(function(){e.container.removeChild(n)}),Ut.clearData(),Ut.setData("Text",e.session.getTextRange()),j=!0,this.setState("drag")},this.onDragEnd=function(Ht){if(g.draggable=!1,j=!1,this.setState(null),!e.getReadOnly()){var Vt=Ht.dataTransfer.dropEffect;!se&&Vt=="move"&&e.session.remove(e.getSelectionRange()),e.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(Ht){if(!(e.getReadOnly()||!zt(Ht.dataTransfer)))return A=Ht.clientX,E=Ht.clientY,m||ot(),Be++,Ht.dataTransfer.dropEffect=se=hi(Ht),_.preventDefault(Ht)},this.onDragOver=function(Ht){if(!(e.getReadOnly()||!zt(Ht.dataTransfer)))return A=Ht.clientX,E=Ht.clientY,m||(ot(),Be++),lt!==null&&(lt=null),Ht.dataTransfer.dropEffect=se=hi(Ht),_.preventDefault(Ht)},this.onDragLeave=function(Ht){if(Be--,Be<=0&&m)return at(),se=null,_.preventDefault(Ht)},this.onDrop=function(Ht){if(q){var Vt=Ht.dataTransfer;if(j)switch(se){case"move":C.contains(q.row,q.column)?C={start:q,end:q}:C=e.moveText(C,q);break;case"copy":C=e.moveText(C,q,!0);break}else{var Ut=Vt.getData("Text");C={start:q,end:e.session.insert(q,Ut)},e.focus(),se=null}return at(),_.preventDefault(Ht)}},_.addListener(g,"dragstart",this.onDragStart.bind(t),e),_.addListener(g,"dragend",this.onDragEnd.bind(t),e),_.addListener(g,"dragenter",this.onDragEnter.bind(t),e),_.addListener(g,"dragover",this.onDragOver.bind(t),e),_.addListener(g,"dragleave",this.onDragLeave.bind(t),e),_.addListener(g,"drop",this.onDrop.bind(t),e);function b(Ht,Vt){var Ut=Date.now(),Jt=!Vt||Ht.row!=Vt.row,di=!Vt||Ht.column!=Vt.column;if(!G||Jt||di)e.moveCursorToPosition(Ht),G=Ut,U={x:A,y:E};else{var fi=o(U.x,U.y,A,E);fi>i?G=null:Ut-G>=h&&(e.renderer.scrollCursorIntoView(),G=null)}}function w(Ht,Vt){var Ut=Date.now(),Jt=e.renderer.layerConfig.lineHeight,di=e.renderer.layerConfig.characterWidth,fi=e.renderer.scroller.getBoundingClientRect(),mi={x:{left:A-fi.left,right:fi.right-A},y:{top:E-fi.top,bottom:fi.bottom-E}},gi=Math.min(mi.x.left,mi.x.right),wi=Math.min(mi.y.top,mi.y.bottom),Ci={row:Ht.row,column:Ht.column};gi/di<=2&&(Ci.column+=mi.x.left<mi.x.right?-3:2),wi/Jt<=1&&(Ci.row+=mi.y.top<mi.y.bottom?-1:1);var Ai=Ht.row!=Ci.row,Ti=Ht.column!=Ci.column,_i=!Vt||Ht.row!=Vt.row;Ai||Ti&&!_i?ct?Ut-ct>=a&&e.renderer.scrollCursorIntoView(Ci):ct=Ut:ct=null}function W(){var Ht=q;q=e.renderer.screenToTextCoordinates(A,E),b(q,Ht),w(q,Ht)}function ot(){C=e.selection.toOrientedRange(),m=e.session.addMarker(C,"ace_selection",e.getSelectionStyle()),e.clearSelection(),e.isFocused()&&e.renderer.$cursorLayer.setBlinking(!1),clearInterval(S),W(),S=setInterval(W,20),Be=0,_.addListener(document,"mousemove",Mt)}function at(){clearInterval(S),e.session.removeMarker(m),m=null,e.selection.fromOrientedRange(C),e.isFocused()&&!j&&e.$resetCursorStyle(),C=null,q=null,Be=0,ct=null,G=null,_.removeListener(document,"mousemove",Mt)}var lt=null;function Mt(){lt==null&&(lt=setTimeout(function(){lt!=null&&m&&at()},20))}function zt(Ht){var Vt=Ht.types;return!Vt||Array.prototype.some.call(Vt,function(Ut){return Ut=="text/plain"||Ut=="Text"})}function hi(Ht){var Vt=["copy","copymove","all","uninitialized"],Ut=["move","copymove","linkmove","all","uninitialized"],Jt=x.isMac?Ht.altKey:Ht.ctrlKey,di="uninitialized";try{di=Ht.dataTransfer.effectAllowed.toLowerCase()}catch{}var fi="none";return Jt&&Vt.indexOf(di)>=0?fi="copy":Ut.indexOf(di)>=0?fi="move":Vt.indexOf(di)>=0&&(fi="copy"),fi}}(function(){this.dragWait=function(){var t=Date.now()-this.mousedownEvent.time;t>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var t=this.editor.container;t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(t){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var t=this.editor,e=t.container;e.draggable=!0,t.renderer.$cursorLayer.setBlinking(!1),t.setStyle("ace_dragging");var n=x.isWin?"default":"move";t.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(t){var e=this.editor.container;if(x.isIE&&this.state=="dragReady"){var n=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&e.dragDrop()}if(this.state==="dragWait"){var n=o(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(t){if(this.$dragEnabled){this.mousedownEvent=t;var e=this.editor,n=t.inSelection(),s=t.getButton(),g=t.domEvent.detail||1;if(g===1&&s===0&&n){if(t.editor.inMultiSelectMode&&(t.getAccelKey()||t.getShiftKey()))return;this.mousedownEvent.time=Date.now();var m=t.domEvent.target||t.domEvent.srcElement;if("unselectable"in m&&(m.unselectable="on"),e.getDragDelay()){if(x.isWebKit){this.cancelDrag=!0;var A=e.container;A.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(t,this.onMouseDrag.bind(this)),t.defaultPrevented=!0}}}}).call(r.prototype);function o(t,e,n,s){return Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2))}p.DragdropHandler=r}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(f,p,Se){var D=f("./mouse_event").MouseEvent,_=f("../lib/event"),x=f("../lib/dom");p.addTouchListeners=function(a,h){var i="scroll",r,o,t,e,n,s,g=0,m,A=0,E=0,S=0,C,q;function Be(){var b=window.navigator&&window.navigator.clipboard,w=!1,W=function(){var lt=h.getCopyText(),Mt=h.session.getUndoManager().hasUndo();q.replaceChild(x.buildDom(w?["span",!lt&&ot("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],lt&&ot("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],lt&&ot("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],b&&ot("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],Mt&&ot("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],ot("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],ot("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),q.firstChild)},ot=function(lt){return h.commands.canExecute(lt,h)},at=function(lt){var Mt=lt.target.getAttribute("action");if(Mt=="more"||!w)return w=!w,W();Mt=="paste"?b.readText().then(function(zt){h.execCommand(Mt,zt)}):Mt&&((Mt=="cut"||Mt=="copy")&&(b?b.writeText(h.getCopyText()):document.execCommand("copy")),h.execCommand(Mt)),q.firstChild.style.display="none",w=!1,Mt!="openCommandPalette"&&h.focus()};q=x.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(lt){i="menu",lt.stopPropagation(),lt.preventDefault(),h.textInput.focus()},ontouchend:function(lt){lt.stopPropagation(),lt.preventDefault(),at(lt)},onclick:at},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],h.container)}function se(){if(!h.getOption("enableMobileMenu")){q&&j();return}q||Be();var b=h.selection.cursor,w=h.renderer.textToScreenCoordinates(b.row,b.column),W=h.renderer.textToScreenCoordinates(0,0).pageX,ot=h.renderer.scrollLeft,at=h.container.getBoundingClientRect();q.style.top=w.pageY-at.top-3+"px",w.pageX-at.left<at.width-70?(q.style.left="",q.style.right="10px"):(q.style.right="",q.style.left=W+ot-at.left+"px"),q.style.display="",q.firstChild.style.display="none",h.on("input",j)}function j(b){q&&(q.style.display="none"),h.off("input",j)}function ct(){n=null,clearTimeout(n);var b=h.selection.getRange(),w=b.contains(m.row,m.column);(b.isEmpty()||!w)&&(h.selection.moveToPosition(m),h.selection.selectWord()),i="wait",se()}function G(){n=null,clearTimeout(n),h.selection.moveToPosition(m);var b=A>=2?h.selection.getLineRange(m.row):h.session.getBracketRange(m);b&&!b.isEmpty()?h.selection.setRange(b):h.selection.selectWord(),i="wait"}_.addListener(a,"contextmenu",function(b){if(C){var w=h.textInput.getElement();w.focus()}},h),_.addListener(a,"touchstart",function(b){var w=b.touches;if(n||w.length>1){clearTimeout(n),n=null,t=-1,i="zoom";return}C=h.$mouseHandler.isMousePressed=!0;var W=h.renderer.layerConfig.lineHeight,ot=h.renderer.layerConfig.lineHeight,at=b.timeStamp;e=at;var lt=w[0],Mt=lt.clientX,zt=lt.clientY;Math.abs(r-Mt)+Math.abs(o-zt)>W&&(t=-1),r=b.clientX=Mt,o=b.clientY=zt,E=S=0;var hi=new D(b,h);if(m=hi.getDocumentPosition(),at-t<500&&w.length==1&&!g)A++,b.preventDefault(),b.button=0,G();else{A=0;var Ht=h.selection.cursor,Vt=h.selection.isEmpty()?Ht:h.selection.anchor,Ut=h.renderer.$cursorLayer.getPixelPosition(Ht,!0),Jt=h.renderer.$cursorLayer.getPixelPosition(Vt,!0),di=h.renderer.scroller.getBoundingClientRect(),fi=h.renderer.layerConfig.offset,mi=h.renderer.scrollLeft,gi=function(Ai,Ti){return Ai=Ai/ot,Ti=Ti/W-.75,Ai*Ai+Ti*Ti};if(b.clientX<di.left){i="zoom";return}var wi=gi(b.clientX-di.left-Ut.left+mi,b.clientY-di.top-Ut.top+fi),Ci=gi(b.clientX-di.left-Jt.left+mi,b.clientY-di.top-Jt.top+fi);wi<3.5&&Ci<3.5&&(i=wi>Ci?"cursor":"anchor"),Ci<3.5?i="anchor":wi<3.5?i="cursor":i="scroll",n=setTimeout(ct,450)}t=at},h),_.addListener(a,"touchend",function(b){C=h.$mouseHandler.isMousePressed=!1,s&&clearInterval(s),i=="zoom"?(i="",g=0):n?(h.selection.moveToPosition(m),g=0,se()):i=="scroll"?(U(),j()):se(),clearTimeout(n),n=null},h),_.addListener(a,"touchmove",function(b){n&&(clearTimeout(n),n=null);var w=b.touches;if(!(w.length>1||i=="zoom")){var W=w[0],ot=r-W.clientX,at=o-W.clientY;if(i=="wait")if(ot*ot+at*at>4)i="cursor";else return b.preventDefault();r=W.clientX,o=W.clientY,b.clientX=W.clientX,b.clientY=W.clientY;var lt=b.timeStamp,Mt=lt-e;if(e=lt,i=="scroll"){var zt=new D(b,h);zt.speed=1,zt.wheelX=ot,zt.wheelY=at,10*Math.abs(ot)<Math.abs(at)&&(ot=0),10*Math.abs(at)<Math.abs(ot)&&(at=0),Mt!=0&&(E=ot/Mt,S=at/Mt),h._emit("mousewheel",zt),zt.propagationStopped||(E=S=0)}else{var hi=new D(b,h),Ht=hi.getDocumentPosition();i=="cursor"?h.selection.moveCursorToPosition(Ht):i=="anchor"&&h.selection.setSelectionAnchor(Ht.row,Ht.column),h.renderer.scrollCursorIntoView(Ht),b.preventDefault()}}},h);function U(){g+=60,s=setInterval(function(){g--<=0&&(clearInterval(s),s=null),Math.abs(E)<.01&&(E=0),Math.abs(S)<.01&&(S=0),g<20&&(E=.9*E),g<20&&(S=.9*S);var b=h.session.getScrollTop();h.renderer.scrollBy(10*E,10*S),b==h.session.getScrollTop()&&(g=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(f,p,Se){var D=f("../lib/event"),_=f("../lib/useragent"),x=f("./default_handlers").DefaultHandlers,a=f("./default_gutter_handler").GutterHandler,h=f("./mouse_event").MouseEvent,i=f("./dragdrop_handler").DragdropHandler,r=f("./touch_handler").addTouchListeners,o=f("../config"),t=function(){function e(n){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var s=this;this.editor=n,new x(this),new a(this),new i(this);var g=function(E){var S=!document.hasFocus||!document.hasFocus()||!n.isFocused()&&document.activeElement==(n.textInput&&n.textInput.getElement());S&&window.focus(),n.focus(),setTimeout(function(){n.isFocused()||n.focus()})},m=n.renderer.getMouseEventTarget();D.addListener(m,"click",this.onMouseEvent.bind(this,"click"),n),D.addListener(m,"mousemove",this.onMouseMove.bind(this,"mousemove"),n),D.addMultiMouseDownListener([m,n.renderer.scrollBarV&&n.renderer.scrollBarV.inner,n.renderer.scrollBarH&&n.renderer.scrollBarH.inner,n.textInput&&n.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",n),D.addMouseWheelListener(n.container,this.onMouseWheel.bind(this,"mousewheel"),n),r(n.container,n);var A=n.renderer.$gutter;D.addListener(A,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),n),D.addListener(A,"click",this.onMouseEvent.bind(this,"gutterclick"),n),D.addListener(A,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),n),D.addListener(A,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),n),D.addListener(m,"mousedown",g,n),D.addListener(A,"mousedown",g,n),_.isIE&&n.renderer.scrollBarV&&(D.addListener(n.renderer.scrollBarV.element,"mousedown",g,n),D.addListener(n.renderer.scrollBarH.element,"mousedown",g,n)),n.on("mousemove",function(E){if(!(s.state||s.$dragDelay||!s.$dragEnabled)){var S=n.renderer.screenToTextCoordinates(E.x,E.y),C=n.session.selection.getRange(),q=n.renderer;!C.isEmpty()&&C.insideStart(S.row,S.column)?q.setCursorStyle("default"):q.setCursorStyle("")}},n)}return e.prototype.onMouseEvent=function(n,s){this.editor.session&&this.editor._emit(n,new h(s,this.editor))},e.prototype.onMouseMove=function(n,s){var g=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!g||!g.length||this.editor._emit(n,new h(s,this.editor))},e.prototype.onMouseWheel=function(n,s){var g=new h(s,this.editor);g.speed=this.$scrollSpeed*2,g.wheelX=s.wheelX,g.wheelY=s.wheelY,this.editor._emit(n,g)},e.prototype.setState=function(n){this.state=n},e.prototype.captureMouse=function(n,s){this.x=n.x,this.y=n.y,this.isMousePressed=!0;var g=this.editor,m=this.editor.renderer;m.$isMousePressed=!0;var A=this,E=function(se){if(se){if(_.isWebKit&&!se.which&&A.releaseMouse)return A.releaseMouse();A.x=se.clientX,A.y=se.clientY,s&&s(se),A.mouseEvent=new h(se,A.editor),A.$mouseMoved=!0}},S=function(se){g.off("beforeEndOperation",q),clearInterval(Be),g.session&&C(),A[A.state+"End"]&&A[A.state+"End"](se),A.state="",A.isMousePressed=m.$isMousePressed=!1,m.$keepTextAreaAtCursor&&m.$moveTextAreaToCursor(),A.$onCaptureMouseMove=A.releaseMouse=null,se&&A.onMouseEvent("mouseup",se),g.endOperation()},C=function(){A[A.state]&&A[A.state](),A.$mouseMoved=!1};if(_.isOldIE&&n.domEvent.type=="dblclick")return setTimeout(function(){S(n)});var q=function(se){A.releaseMouse&&g.curOp.command.name&&g.curOp.selectionChanged&&(A[A.state+"End"]&&A[A.state+"End"](),A.state="",A.releaseMouse())};g.on("beforeEndOperation",q),g.startOperation({command:{name:"mouse"}}),A.$onCaptureMouseMove=E,A.releaseMouse=D.capture(this.editor.container,E,S);var Be=setInterval(C,20)},e.prototype.cancelContextMenu=function(){var n=(function(s){s&&s.domEvent&&s.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",n),s&&s.domEvent&&D.stopEvent(s.domEvent))}).bind(this);setTimeout(n,10),this.editor.on("nativecontextmenu",n)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();t.prototype.releaseMouse=null,o.defineOptions(t.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:_.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),p.MouseHandler=t}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(f,p,Se){var D=f("../lib/dom"),_=function(){function x(a){a.on("click",function(h){var i=h.getDocumentPosition(),r=a.session,o=r.getFoldAt(i.row,i.column,1);o&&(h.getAccelKey()?r.removeFold(o):r.expandFold(o),h.stop());var t=h.domEvent&&h.domEvent.target;t&&D.hasCssClass(t,"ace_inline_button")&&D.hasCssClass(t,"ace_toggle_wrap")&&(r.setOption("wrap",!r.getUseWrapMode()),a.renderer.scrollCursorIntoView())}),a.on("gutterclick",function(h){var i=a.renderer.$gutterLayer.getRegion(h);if(i=="foldWidgets"){var r=h.getDocumentPosition().row,o=a.session;o.foldWidgets&&o.foldWidgets[r]&&a.session.onFoldWidgetClick(r,h),a.isFocused()||a.focus(),h.stop()}}),a.on("gutterdblclick",function(h){var i=a.renderer.$gutterLayer.getRegion(h);if(i=="foldWidgets"){var r=h.getDocumentPosition().row,o=a.session,t=o.getParentFoldRangeData(r,!0),e=t.range||t.firstRange;if(e){r=e.start.row;var n=o.getFoldAt(r,o.getLine(r).length,1);n?o.removeFold(n):(o.addFold("...",e),a.renderer.scrollCursorIntoView({row:e.start.row,column:0}))}h.stop()}})}return x}();p.FoldHandler=_}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(f,p,Se){var D=f("../lib/keys"),_=f("../lib/event"),x=function(){function a(h){this.$editor=h,this.$data={editor:h},this.$handlers=[],this.setDefaultHandler(h.commands)}return a.prototype.setDefaultHandler=function(h){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=h,this.addKeyboardHandler(h,0)},a.prototype.setKeyboardHandler=function(h){var i=this.$handlers;if(i[i.length-1]!=h){for(;i[i.length-1]&&i[i.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(i[i.length-1]);this.addKeyboardHandler(h,1)}},a.prototype.addKeyboardHandler=function(h,i){if(h){typeof h=="function"&&!h.handleKeyboard&&(h.handleKeyboard=h);var r=this.$handlers.indexOf(h);r!=-1&&this.$handlers.splice(r,1),i==null?this.$handlers.push(h):this.$handlers.splice(i,0,h),r==-1&&h.attach&&h.attach(this.$editor)}},a.prototype.removeKeyboardHandler=function(h){var i=this.$handlers.indexOf(h);return i==-1?!1:(this.$handlers.splice(i,1),h.detach&&h.detach(this.$editor),!0)},a.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},a.prototype.getStatusText=function(){var h=this.$data,i=h.editor;return this.$handlers.map(function(r){return r.getStatusText&&r.getStatusText(i,h)||""}).filter(Boolean).join(" ")},a.prototype.$callKeyboardHandlers=function(h,i,r,o){for(var t,e=!1,n=this.$editor.commands,s=this.$handlers.length;s--&&(t=this.$handlers[s].handleKeyboard(this.$data,h,i,r,o),!(!(!t||!t.command)&&(t.command=="null"?e=!0:e=n.exec(t.command,this.$editor,t.args,o),e&&o&&h!=-1&&t.passEvent!=!0&&t.command.passEvent!=!0&&_.stopEvent(o),e))););return!e&&h==-1&&(t={command:"insertstring"},e=n.exec("insertstring",this.$editor,i)),e&&this.$editor._signal&&this.$editor._signal("keyboardActivity",t),e},a.prototype.onCommandKey=function(h,i,r){var o=D.keyCodeToString(r);return this.$callKeyboardHandlers(i,o,r,h)},a.prototype.onTextInput=function(h){return this.$callKeyboardHandlers(-1,h)},a}();p.KeyBinding=x}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(f,p,Se){var D=0,_=0,x=!1,a=!1,h=!1,i=[[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]],r=[[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]],o=0,t=1,e=0,n=1,s=2,g=3,m=4,A=5,E=6,S=7,C=8,q=9,Be=10,se=11,j=12,ct=13,G=14,U=15,b=16,w=17,W=18,ot=[W,W,W,W,W,W,W,W,W,E,A,E,C,A,W,W,W,W,W,W,W,W,W,W,W,W,W,W,A,A,A,E,C,m,m,se,se,se,m,m,m,m,m,Be,q,Be,q,q,s,s,s,s,s,s,s,s,s,s,q,m,m,m,m,m,m,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,m,m,m,m,m,m,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,m,m,m,m,W,W,W,W,W,W,A,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,q,m,se,se,se,se,m,m,m,m,e,m,m,W,m,m,se,se,s,s,m,e,m,m,m,s,e,m,m,m,m,m],at=[C,C,C,C,C,C,C,C,C,C,C,W,W,W,e,n,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,C,A,ct,G,U,b,w,q,se,se,se,se,se,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,q,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,C];function lt(Ht,Vt,Ut,Jt){var di=D?r:i,fi=null,mi=null,gi=null,wi=0,Ci=null,Ai=null,Ti=-1,_i=null,Ri=null,Ii=[];if(!Jt)for(_i=0,Jt=[];_i<Ut;_i++)Jt[_i]=hi(Ht[_i]);for(_=D,x=!1,a=!1,h=!1,Ri=0;Ri<Ut;Ri++){if(fi=wi,Ii[Ri]=mi=zt(Ht,Jt,Ii,Ri),wi=di[fi][mi],Ci=wi&240,wi&=15,Vt[Ri]=gi=di[wi][5],Ci>0)if(Ci==16){for(_i=Ti;_i<Ri;_i++)Vt[_i]=1;Ti=-1}else Ti=-1;if(Ai=di[wi][6],Ai)Ti==-1&&(Ti=Ri);else if(Ti>-1){for(_i=Ti;_i<Ri;_i++)Vt[_i]=gi;Ti=-1}Jt[Ri]==A&&(Vt[Ri]=0),_|=gi}if(h){for(_i=0;_i<Ut;_i++)if(Jt[_i]==E){Vt[_i]=D;for(var Ni=_i-1;Ni>=0&&Jt[Ni]==C;Ni--)Vt[Ni]=D}}}function Mt(Ht,Vt,Ut){if(!(_<Ht)){if(Ht==1&&D==t&&!a){Ut.reverse();return}for(var Jt=Ut.length,di=0,fi,mi,gi,wi;di<Jt;){if(Vt[di]>=Ht){for(fi=di+1;fi<Jt&&Vt[fi]>=Ht;)fi++;for(mi=di,gi=fi-1;mi<gi;mi++,gi--)wi=Ut[mi],Ut[mi]=Ut[gi],Ut[gi]=wi;di=fi}di++}}}function zt(Ht,Vt,Ut,Jt){var di=Vt[Jt],fi,mi,gi,wi;switch(di){case e:case n:x=!1;case m:case g:return di;case s:return x?g:s;case S:return x=!0,n;case C:return m;case q:return Jt<1||Jt+1>=Vt.length||(fi=Ut[Jt-1])!=s&&fi!=g||(mi=Vt[Jt+1])!=s&&mi!=g?m:(x&&(mi=g),mi==fi?mi:m);case Be:return fi=Jt>0?Ut[Jt-1]:A,fi==s&&Jt+1<Vt.length&&Vt[Jt+1]==s?s:m;case se:if(Jt>0&&Ut[Jt-1]==s)return s;if(x)return m;for(wi=Jt+1,gi=Vt.length;wi<gi&&Vt[wi]==se;)wi++;return wi<gi&&Vt[wi]==s?s:m;case j:for(gi=Vt.length,wi=Jt+1;wi<gi&&Vt[wi]==j;)wi++;if(wi<gi){var Ci=Ht[Jt],Ai=Ci>=1425&&Ci<=2303||Ci==64286;if(fi=Vt[wi],Ai&&(fi==n||fi==S))return n}return Jt<1||(fi=Vt[Jt-1])==A?m:Ut[Jt-1];case A:return x=!1,a=!0,D;case E:return h=!0,m;case ct:case G:case b:case w:case U:x=!1;case W:return m}}function hi(Ht){var Vt=Ht.charCodeAt(0),Ut=Vt>>8;return Ut==0?Vt>191?e:ot[Vt]:Ut==5?/[\u0591-\u05f4]/.test(Ht)?n:e:Ut==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(Ht)?j:/[\u0660-\u0669\u066b-\u066c]/.test(Ht)?g:Vt==1642?se:/[\u06f0-\u06f9]/.test(Ht)?s:S:Ut==32&&Vt<=8287?at[Vt&255]:Ut==254&&Vt>=65136?S:m}p.L=e,p.R=n,p.EN=s,p.ON_R=3,p.AN=4,p.R_H=5,p.B=6,p.RLE=7,p.DOT="·",p.doBidiReorder=function(Ht,Vt,Ut){if(Ht.length<2)return{};var Jt=Ht.split(""),di=new Array(Jt.length),fi=new Array(Jt.length),mi=[];D=Ut?t:o,lt(Jt,mi,Jt.length,Vt);for(var gi=0;gi<di.length;di[gi]=gi,gi++);Mt(2,mi,di),Mt(1,mi,di);for(var gi=0;gi<di.length-1;gi++)Vt[gi]===g?mi[gi]=p.AN:mi[gi]===n&&(Vt[gi]>S&&Vt[gi]<ct||Vt[gi]===m||Vt[gi]===W)?mi[gi]=p.ON_R:gi>0&&Jt[gi-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(Jt[gi])&&(mi[gi-1]=mi[gi]=p.R_H,gi++);Jt[Jt.length-1]===p.DOT&&(mi[Jt.length-1]=p.B),Jt[0]===""&&(mi[0]=p.RLE);for(var gi=0;gi<di.length;gi++)fi[gi]=mi[di[gi]];return{logicalFromVisual:di,bidiLevels:fi}},p.hasBidiCharacters=function(Ht,Vt){for(var Ut=!1,Jt=0;Jt<Ht.length;Jt++)Vt[Jt]=hi(Ht.charAt(Jt)),!Ut&&(Vt[Jt]==n||Vt[Jt]==S||Vt[Jt]==g)&&(Ut=!0);return Ut},p.getVisualFromLogicalIdx=function(Ht,Vt){for(var Ut=0;Ut<Vt.logicalFromVisual.length;Ut++)if(Vt.logicalFromVisual[Ut]==Ht)return Ut;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(f,p,Se){var D=f("./lib/bidiutil"),_=f("./lib/lang"),x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,a=function(){function h(i){this.session=i,this.bidiMap={},this.currentRow=null,this.bidiUtil=D,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=x.test(i.getValue())}return h.prototype.isBidiRow=function(i,r,o){return this.seenBidi?(i!==this.currentRow&&(this.currentRow=i,this.updateRowLine(r,o),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},h.prototype.onChange=function(i){this.seenBidi?this.currentRow=null:i.action=="insert"&&x.test(i.lines.join(`
|
181
|
+
`))&&(this.seenBidi=!0,this.currentRow=null)},h.prototype.getDocumentRow=function(){var i=0,r=this.session.$screenRowCache;if(r.length){var o=this.session.$getRowCacheIndex(r,this.currentRow);o>=0&&(i=this.session.$docRowCache[o])}return i},h.prototype.getSplitIndex=function(){var i=0,r=this.session.$screenRowCache;if(r.length)for(var o,t=this.session.$getRowCacheIndex(r,this.currentRow);this.currentRow-i>0&&(o=this.session.$getRowCacheIndex(r,this.currentRow-i-1),o===t);)t=o,i++;else i=this.currentRow;return i},h.prototype.updateRowLine=function(i,r){i===void 0&&(i=this.getDocumentRow());var o=i===this.session.getLength()-1,t=o?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(i),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var e=this.session.$wrapData[i];e&&(r===void 0&&(r=this.getSplitIndex()),r>0&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[D.L],this.line=r<e.length?this.line.substring(e[r-1],e[r]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[r]),r==e.length&&(this.line+=this.showInvisibles?t:D.DOT))}else this.line+=this.showInvisibles?t:D.DOT;var n=this.session,s=0,g;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(m,A){return m===" "||n.isFullWidth(m.charCodeAt(0))?(g=m===" "?n.getScreenTabSize(A+s):2,s+=g-1,_.stringRepeat(D.DOT,g)):m}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==D.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},h.prototype.updateBidiMap=function(){var i=[];D.hasBidiCharacters(this.line,i)||this.isRtlDir?this.bidiMap=D.doBidiReorder(this.line,i,this.isRtlDir):this.bidiMap={}},h.prototype.markAsDirty=function(){this.currentRow=null},h.prototype.updateCharacterWidths=function(i){if(this.characterWidth!==i.$characterSize.width){this.fontMetrics=i;var r=this.characterWidth=i.$characterSize.width,o=i.$measureCharWidth("ה");this.charWidths[D.L]=this.charWidths[D.EN]=this.charWidths[D.ON_R]=r,this.charWidths[D.R]=this.charWidths[D.AN]=o,this.charWidths[D.R_H]=o*.45,this.charWidths[D.B]=this.charWidths[D.RLE]=0,this.currentRow=null}},h.prototype.setShowInvisibles=function(i){this.showInvisibles=i,this.currentRow=null},h.prototype.setEolChar=function(i){this.EOL=i},h.prototype.setContentWidth=function(i){this.contentWidth=i},h.prototype.isRtlLine=function(i){return this.$isRtl?!0:i!=null?this.session.getLine(i).charAt(0)==this.RLE:this.isRtlDir},h.prototype.setRtlDirection=function(i,r){for(var o=i.getCursorPosition(),t=i.selection.getSelectionAnchor().row;t<=o.row;t++)!r&&i.session.getLine(t).charAt(0)===i.session.$bidiHandler.RLE?i.session.doc.removeInLine(t,0,1):r&&i.session.getLine(t).charAt(0)!==i.session.$bidiHandler.RLE&&i.session.doc.insert({column:0,row:t},i.session.$bidiHandler.RLE)},h.prototype.getPosLeft=function(i){i-=this.wrapIndent;var r=this.line.charAt(0)===this.RLE?1:0,o=i>r?this.session.getOverwrite()?i:i-1:r,t=D.getVisualFromLogicalIdx(o,this.bidiMap),e=this.bidiMap.bidiLevels,n=0;!this.session.getOverwrite()&&i<=r&&e[t]%2!==0&&t++;for(var s=0;s<t;s++)n+=this.charWidths[e[s]];return!this.session.getOverwrite()&&i>r&&e[t]%2===0&&(n+=this.charWidths[e[t]]),this.wrapIndent&&(n+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(n+=this.rtlLineOffset),n},h.prototype.getSelections=function(i,r){var o=this.bidiMap,t=o.bidiLevels,e,n=[],s=0,g=Math.min(i,r)-this.wrapIndent,m=Math.max(i,r)-this.wrapIndent,A=!1,E=!1,S=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var C,q=0;q<t.length;q++)C=o.logicalFromVisual[q],e=t[q],A=C>=g&&C<m,A&&!E?S=s:!A&&E&&n.push({left:S,width:s-S}),s+=this.charWidths[e],E=A;if(A&&q===t.length&&n.push({left:S,width:s-S}),this.isRtlDir)for(var Be=0;Be<n.length;Be++)n[Be].left+=this.rtlLineOffset;return n},h.prototype.offsetToCol=function(o){this.isRtlDir&&(o-=this.rtlLineOffset);var r=0,o=Math.max(o,0),t=0,e=0,n=this.bidiMap.bidiLevels,s=this.charWidths[n[e]];for(this.wrapIndent&&(o-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);o>t+s/2;){if(t+=s,e===n.length-1){s=0;break}s=this.charWidths[n[++e]]}return e>0&&n[e-1]%2!==0&&n[e]%2===0?(o<t&&e--,r=this.bidiMap.logicalFromVisual[e]):e>0&&n[e-1]%2===0&&n[e]%2!==0?r=1+(o>t?this.bidiMap.logicalFromVisual[e]:this.bidiMap.logicalFromVisual[e-1]):this.isRtlDir&&e===n.length-1&&s===0&&n[e-1]%2===0||!this.isRtlDir&&e===0&&n[e]%2!==0?r=1+this.bidiMap.logicalFromVisual[e]:(e>0&&n[e-1]%2!==0&&s!==0&&e--,r=this.bidiMap.logicalFromVisual[e]),r===0&&this.isRtlDir&&r++,r+this.wrapIndent},h}();p.BidiHandler=a}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(f,p,Se){var D=f("./lib/oop"),_=f("./lib/lang"),x=f("./lib/event_emitter").EventEmitter,a=f("./range").Range,h=function(){function i(r){this.session=r,this.doc=r.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var o=this;this.cursor.on("change",function(t){o.$cursorChanged=!0,o.$silent||o._emit("changeCursor"),!o.$isEmpty&&!o.$silent&&o._emit("changeSelection"),!o.$keepDesiredColumnOnChange&&t.old.column!=t.value.column&&(o.$desiredColumn=null)}),this.anchor.on("change",function(){o.$anchorChanged=!0,!o.$isEmpty&&!o.$silent&&o._emit("changeSelection")})}return i.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},i.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},i.prototype.getCursor=function(){return this.lead.getPosition()},i.prototype.setAnchor=function(r,o){this.$isEmpty=!1,this.anchor.setPosition(r,o)},i.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},i.prototype.getSelectionLead=function(){return this.lead.getPosition()},i.prototype.isBackwards=function(){var r=this.anchor,o=this.lead;return r.row>o.row||r.row==o.row&&r.column>o.column},i.prototype.getRange=function(){var r=this.anchor,o=this.lead;return this.$isEmpty?a.fromPoints(o,o):this.isBackwards()?a.fromPoints(o,r):a.fromPoints(r,o)},i.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},i.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},i.prototype.setRange=function(r,o){var t=o?r.end:r.start,e=o?r.start:r.end;this.$setSelection(t.row,t.column,e.row,e.column)},i.prototype.$setSelection=function(r,o,t,e){if(!this.$silent){var n=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(r,o),this.cursor.setPosition(t,e),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||n!=this.$isEmpty||s)&&this._emit("changeSelection")}},i.prototype.$moveSelection=function(r){var o=this.lead;this.$isEmpty&&this.setSelectionAnchor(o.row,o.column),r.call(this)},i.prototype.selectTo=function(r,o){this.$moveSelection(function(){this.moveCursorTo(r,o)})},i.prototype.selectToPosition=function(r){this.$moveSelection(function(){this.moveCursorToPosition(r)})},i.prototype.moveTo=function(r,o){this.clearSelection(),this.moveCursorTo(r,o)},i.prototype.moveToPosition=function(r){this.clearSelection(),this.moveCursorToPosition(r)},i.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},i.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},i.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},i.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},i.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},i.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},i.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},i.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},i.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},i.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},i.prototype.getWordRange=function(r,o){if(typeof o>"u"){var t=r||this.lead;r=t.row,o=t.column}return this.session.getWordRange(r,o)},i.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},i.prototype.selectAWord=function(){var r=this.getCursor(),o=this.session.getAWordRange(r.row,r.column);this.setSelectionRange(o)},i.prototype.getLineRange=function(r,o){var t=typeof r=="number"?r:this.lead.row,e,n=this.session.getFoldLine(t);return n?(t=n.start.row,e=n.end.row):e=t,o===!0?new a(t,0,e,this.session.getLine(e).length):new a(t,0,e+1,0)},i.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},i.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},i.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},i.prototype.wouldMoveIntoSoftTab=function(r,o,t){var e=r.column,n=r.column+o;return t<0&&(e=r.column-o,n=r.column),this.session.isTabStop(r)&&this.doc.getLine(r.row).slice(e,n).split(" ").length-1==o},i.prototype.moveCursorLeft=function(){var r=this.lead.getPosition(),o;if(o=this.session.getFoldAt(r.row,r.column,-1))this.moveCursorTo(o.start.row,o.start.column);else if(r.column===0)r.row>0&&this.moveCursorTo(r.row-1,this.doc.getLine(r.row-1).length);else{var t=this.session.getTabSize();this.wouldMoveIntoSoftTab(r,t,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-t):this.moveCursorBy(0,-1)}},i.prototype.moveCursorRight=function(){var r=this.lead.getPosition(),o;if(o=this.session.getFoldAt(r.row,r.column,1))this.moveCursorTo(o.end.row,o.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 t=this.session.getTabSize(),r=this.lead;this.wouldMoveIntoSoftTab(r,t,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,t):this.moveCursorBy(0,1)}},i.prototype.moveCursorLineStart=function(){var r=this.lead.row,o=this.lead.column,t=this.session.documentToScreenRow(r,o),e=this.session.screenToDocumentPosition(t,0),n=this.session.getDisplayLine(r,null,e.row,e.column),s=n.match(/^\s*/);s[0].length!=o&&!this.session.$useEmacsStyleLineStart&&(e.column+=s[0].length),this.moveCursorToPosition(e)},i.prototype.moveCursorLineEnd=function(){var r=this.lead,o=this.session.getDocumentLastRowColumnPosition(r.row,r.column);if(this.lead.column==o.column){var t=this.session.getLine(o.row);if(o.column==t.length){var e=t.search(/\s+$/);e>0&&(o.column=e)}}this.moveCursorTo(o.row,o.column)},i.prototype.moveCursorFileEnd=function(){var r=this.doc.getLength()-1,o=this.doc.getLine(r).length;this.moveCursorTo(r,o)},i.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},i.prototype.moveCursorLongWordRight=function(){var r=this.lead.row,o=this.lead.column,t=this.doc.getLine(r),e=t.substring(o);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var n=this.session.getFoldAt(r,o,1);if(n){this.moveCursorTo(n.end.row,n.end.column);return}if(this.session.nonTokenRe.exec(e)&&(o+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,e=t.substring(o)),o>=t.length){this.moveCursorTo(r,t.length),this.moveCursorRight(),r<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(e)&&(o+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,o)},i.prototype.moveCursorLongWordLeft=function(){var r=this.lead.row,o=this.lead.column,t;if(t=this.session.getFoldAt(r,o,-1)){this.moveCursorTo(t.start.row,t.start.column);return}var e=this.session.getFoldStringAt(r,o,-1);e==null&&(e=this.doc.getLine(r).substring(0,o));var n=_.stringReverse(e);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(n)&&(o-=this.session.nonTokenRe.lastIndex,n=n.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),o<=0){this.moveCursorTo(r,0),this.moveCursorLeft(),r>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(n)&&(o-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(r,o)},i.prototype.$shortWordEndIndex=function(r){var o=0,t,e=/\s/,n=this.session.tokenRe;if(n.lastIndex=0,this.session.tokenRe.exec(r))o=this.session.tokenRe.lastIndex;else{for(;(t=r[o])&&e.test(t);)o++;if(o<1){for(n.lastIndex=0;(t=r[o])&&!n.test(t);)if(n.lastIndex=0,o++,e.test(t))if(o>2){o--;break}else{for(;(t=r[o])&&e.test(t);)o++;if(o>2)break}}}return n.lastIndex=0,o},i.prototype.moveCursorShortWordRight=function(){var r=this.lead.row,o=this.lead.column,t=this.doc.getLine(r),e=t.substring(o),n=this.session.getFoldAt(r,o,1);if(n)return this.moveCursorTo(n.end.row,n.end.column);if(o==t.length){var s=this.doc.getLength();do r++,e=this.doc.getLine(r);while(r<s&&/^\s*$/.test(e));/^\s+/.test(e)||(e=""),o=0}var g=this.$shortWordEndIndex(e);this.moveCursorTo(r,o+g)},i.prototype.moveCursorShortWordLeft=function(){var r=this.lead.row,o=this.lead.column,t;if(t=this.session.getFoldAt(r,o,-1))return this.moveCursorTo(t.start.row,t.start.column);var e=this.session.getLine(r).substring(0,o);if(o===0){do r--,e=this.doc.getLine(r);while(r>0&&/^\s*$/.test(e));o=e.length,/\s+$/.test(e)||(e="")}var n=_.stringReverse(e),s=this.$shortWordEndIndex(n);return this.moveCursorTo(r,o-s)},i.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},i.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},i.prototype.moveCursorBy=function(r,o){var t=this.session.documentToScreenPosition(this.lead.row,this.lead.column),e;if(o===0&&(r!==0&&(this.session.$bidiHandler.isBidiRow(t.row,this.lead.row)?(e=this.session.$bidiHandler.getPosLeft(t.column),t.column=Math.round(e/this.session.$bidiHandler.charWidths[0])):e=t.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?t.column=this.$desiredColumn:this.$desiredColumn=t.column),r!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var n=this.session.lineWidgets[this.lead.row];r<0?r-=n.rowsAbove||0:r>0&&(r+=n.rowCount-(n.rowsAbove||0))}var s=this.session.screenToDocumentPosition(t.row+r,t.column,e);r!==0&&o===0&&s.row===this.lead.row&&(s.column,this.lead.column),this.moveCursorTo(s.row,s.column+o,o===0)},i.prototype.moveCursorToPosition=function(r){this.moveCursorTo(r.row,r.column)},i.prototype.moveCursorTo=function(r,o,t){var e=this.session.getFoldAt(r,o,1);e&&(r=e.start.row,o=e.start.column),this.$keepDesiredColumnOnChange=!0;var n=this.session.getLine(r);/[\uDC00-\uDFFF]/.test(n.charAt(o))&&n.charAt(o-1)&&(this.lead.row==r&&this.lead.column==o+1?o=o-1:o=o+1),this.lead.setPosition(r,o),this.$keepDesiredColumnOnChange=!1,t||(this.$desiredColumn=null)},i.prototype.moveCursorToScreen=function(r,o,t){var e=this.session.screenToDocumentPosition(r,o);this.moveCursorTo(e.row,e.column,t)},i.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},i.prototype.fromOrientedRange=function(r){this.setSelectionRange(r,r.cursor==r.start),this.$desiredColumn=r.desiredColumn||this.$desiredColumn},i.prototype.toOrientedRange=function(r){var o=this.getRange();return r?(r.start.column=o.start.column,r.start.row=o.start.row,r.end.column=o.end.column,r.end.row=o.end.row):r=o,r.cursor=this.isBackwards()?r.start:r.end,r.desiredColumn=this.$desiredColumn,r},i.prototype.getRangeOfMovements=function(r){var o=this.getCursor();try{r(this);var t=this.getCursor();return a.fromPoints(o,t)}catch{return a.fromPoints(o,o)}finally{this.moveCursorToPosition(o)}},i.prototype.toJSON=function(){if(this.rangeCount)var r=this.ranges.map(function(o){var t=o.clone();return t.isBackwards=o.cursor==o.start,t});else{var r=this.getRange();r.isBackwards=this.isBackwards()}return r},i.prototype.fromJSON=function(r){if(r.start==null)if(this.rangeList&&r.length>1){this.toSingleRange(r[0]);for(var o=r.length;o--;){var t=a.fromPoints(r[o].start,r[o].end);r[o].isBackwards&&(t.cursor=t.start),this.addRange(t,!0)}return}else r=r[0];this.rangeList&&this.toSingleRange(r),this.setSelectionRange(r,r.isBackwards)},i.prototype.isEqual=function(r){if((r.length||this.rangeCount)&&r.length!=this.rangeCount)return!1;if(!r.length||!this.ranges)return this.getRange().isEqual(r);for(var o=this.ranges.length;o--;)if(!this.ranges[o].isEqual(r[o]))return!1;return!0},i}();h.prototype.setSelectionAnchor=h.prototype.setAnchor,h.prototype.getSelectionAnchor=h.prototype.getAnchor,h.prototype.setSelectionRange=h.prototype.setRange,D.implement(h.prototype,x),p.Selection=h}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(f,p,Se){var D=f("./lib/report_error").reportError,_=2e3,x=function(){function a(h){this.splitRegex,this.states=h,this.regExps={},this.matchMappings={};for(var i in this.states){for(var r=this.states[i],o=[],t=0,e=this.matchMappings[i]={defaultToken:"text"},n="g",s=[],g=0;g<r.length;g++){var m=r[g];if(m.defaultToken&&(e.defaultToken=m.defaultToken),m.caseInsensitive&&n.indexOf("i")===-1&&(n+="i"),m.unicode&&n.indexOf("u")===-1&&(n+="u"),m.regex!=null){m.regex instanceof RegExp&&(m.regex=m.regex.toString().slice(1,-1));var A=m.regex,E=new RegExp("(?:("+A+")|(.))").exec("a").length-2;Array.isArray(m.token)?m.token.length==1||E==1?m.token=m.token[0]:E-1!=m.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:m,groupCount:E-1}),m.token=m.token[0]):(m.tokenArray=m.token,m.token=null,m.onMatch=this.$arrayTokens):typeof m.token=="function"&&!m.onMatch&&(E>1?m.onMatch=this.$applyToken:m.onMatch=m.token),E>1&&(/\\\d/.test(m.regex)?A=m.regex.replace(/\\([0-9]+)/g,function(S,C){return"\\"+(parseInt(C,10)+t+1)}):(E=1,A=this.removeCapturingGroups(m.regex)),!m.splitRegex&&typeof m.token!="string"&&s.push(m)),e[t]=g,t+=E,o.push(A),m.onMatch||(m.onMatch=null)}}o.length||(e[0]=0,o.push("$")),s.forEach(function(S){S.splitRegex=this.createSplitterRegexp(S.regex,n)},this),this.regExps[i]=new RegExp("("+o.join(")|(")+")|($)",n)}}return a.prototype.$setMaxTokenCount=function(h){_=h|0},a.prototype.$applyToken=function(h){var i=this.splitRegex.exec(h).slice(1),r=this.token.apply(this,i);if(typeof r=="string")return[{type:r,value:h}];for(var o=[],t=0,e=r.length;t<e;t++)i[t]&&(o[o.length]={type:r[t],value:i[t]});return o},a.prototype.$arrayTokens=function(h){if(!h)return[];var i=this.splitRegex.exec(h);if(!i)return"text";for(var r=[],o=this.tokenArray,t=0,e=o.length;t<e;t++)i[t+1]&&(r[r.length]={type:o[t],value:i[t+1]});return r},a.prototype.removeCapturingGroups=function(h){var i=h.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(r,o){return o?"(?:":r});return i},a.prototype.createSplitterRegexp=function(h,i){if(h.indexOf("(?=")!=-1){var r=0,o=!1,t={};h.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,n,s,g,m,A){return o?o=m!="]":m?o=!0:g?(r==t.stack&&(t.end=A+1,t.stack=-1),r--):s&&(r++,s.length!=1&&(t.stack=r,t.start=A)),e}),t.end!=null&&/^\)*$/.test(h.substr(t.end))&&(h=h.substring(0,t.start)+h.substr(t.end))}return h.charAt(0)!="^"&&(h="^"+h),h.charAt(h.length-1)!="$"&&(h+="$"),new RegExp(h,(i||"").replace("g",""))},a.prototype.getLineTokens=function(h,i){if(i&&typeof i!="string"){var r=i.slice(0);i=r[0],i==="#tmp"&&(r.shift(),i=r.shift())}else var r=[];var o=i||"start",t=this.states[o];t||(o="start",t=this.states[o]);var e=this.matchMappings[o],n=this.regExps[o];n.lastIndex=0;for(var s,g=[],m=0,A=0,E={type:null,value:""};s=n.exec(h);){var S=e.defaultToken,C=null,q=s[0],Be=n.lastIndex;if(Be-q.length>m){var se=h.substring(m,Be-q.length);E.type==S?E.value+=se:(E.type&&g.push(E),E={type:S,value:se})}for(var j=0;j<s.length-2;j++)if(s[j+1]!==void 0){C=t[e[j]],C.onMatch?S=C.onMatch(q,o,r,h):S=C.token,C.next&&(typeof C.next=="string"?o=C.next:o=C.next(o,r),t=this.states[o],t||(this.reportError("state doesn't exist",o),o="start",t=this.states[o]),e=this.matchMappings[o],m=Be,n=this.regExps[o],n.lastIndex=Be),C.consumeLineEnd&&(m=Be);break}if(q){if(typeof S=="string")(!C||C.merge!==!1)&&E.type===S?E.value+=q:(E.type&&g.push(E),E={type:S,value:q});else if(S){E.type&&g.push(E),E={type:null,value:""};for(var j=0;j<S.length;j++)g.push(S[j])}}if(m==h.length)break;if(m=Be,A++>_){for(A>2*h.length&&this.reportError("infinite loop with in ace tokenizer",{startState:i,line:h});m<h.length;)E.type&&g.push(E),E={value:h.substring(m,m+=500),type:"overflow"};o="start",r=[];break}}return E.type&&g.push(E),r.length>1&&r[0]!==o&&r.unshift("#tmp",o),{tokens:g,state:r.length?r:o}},a}();x.prototype.reportError=D,p.Tokenizer=x}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(f,p,Se){var D=f("../lib/deep_copy").deepCopy,_;_=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(h,i){if(!i){for(var r in h)this.$rules[r]=h[r];return}for(var r in h){for(var o=h[r],t=0;t<o.length;t++){var e=o[t];(e.next||e.onMatch)&&(typeof e.next=="string"&&e.next.indexOf(i)!==0&&(e.next=i+e.next),e.nextState&&e.nextState.indexOf(i)!==0&&(e.nextState=i+e.nextState))}this.$rules[i+r]=o}},this.getRules=function(){return this.$rules},this.embedRules=function(h,i,r,o,t){var e=typeof h=="function"?new h().getRules():h;if(o)for(var n=0;n<o.length;n++)o[n]=i+o[n];else{o=[];for(var s in e)o.push(i+s)}if(this.addRules(e,i),r)for(var g=Array.prototype[t?"push":"unshift"],n=0;n<o.length;n++)g.apply(this.$rules[o[n]],D(r));this.$embeds||(this.$embeds=[]),this.$embeds.push(i)},this.getEmbeds=function(){return this.$embeds};var x=function(h,i){return(h!="start"||i.length)&&i.unshift(this.nextState,h),this.nextState},a=function(h,i){return i.shift(),i.shift()||"start"};this.normalizeRules=function(){var h=0,i=this.$rules;function r(o){var t=i[o];t.processed=!0;for(var e=0;e<t.length;e++){var n=t[e],s=null;Array.isArray(n)&&(s=n,n={}),!n.regex&&n.start&&(n.regex=n.start,n.next||(n.next=[]),n.next.push({defaultToken:n.token},{token:n.token+".end",regex:n.end||n.start,next:"pop"}),n.token=n.token+".start",n.push=!0);var g=n.next||n.push;if(g&&Array.isArray(g)){var m=n.stateName;m||(m=n.token,typeof m!="string"&&(m=m[0]||""),i[m]&&(m+=h++)),i[m]=g,n.next=m,r(m)}else g=="pop"&&(n.next=a);if(n.push&&(n.nextState=n.next||n.push,n.next=x,delete n.push),n.rules)for(var A in n.rules)i[A]?i[A].push&&i[A].push.apply(i[A],n.rules[A]):i[A]=n.rules[A];var E=typeof n=="string"?n:n.include;if(E&&(E==="$self"&&(E="start"),Array.isArray(E)?s=E.map(function(C){return i[C]}):s=i[E]),s){var S=[e,1].concat(s);n.noEscape&&(S=S.filter(function(C){return!C.next})),t.splice.apply(t,S),e--}n.keywordMap&&(n.token=this.createKeywordMapper(n.keywordMap,n.defaultToken||"text",n.caseInsensitive),delete n.defaultToken)}}Object.keys(i).forEach(r,this)},this.createKeywordMapper=function(h,i,r,o){var t=Object.create(null);return this.$keywordList=[],Object.keys(h).forEach(function(e){for(var n=h[e],s=n.split(o||"|"),g=s.length;g--;){var m=s[g];this.$keywordList.push(m),r&&(m=m.toLowerCase()),t[m]=e}},this),h=null,r?function(e){return t[e.toLowerCase()]||i}:function(e){return t[e]||i}},this.getKeywords=function(){return this.$keywords}}).call(_.prototype),p.TextHighlightRules=_}),ace.define("ace/mode/behaviour",["require","exports","module"],function(f,p,Se){var D;D=function(){this.$behaviours={}},(function(){this.add=function(_,x,a){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[_]:this.$behaviours[_]={}}this.$behaviours[_][x]=a},this.addBehaviours=function(_){for(var x in _)for(var a in _[x])this.add(x,a,_[x][a])},this.remove=function(_){this.$behaviours&&this.$behaviours[_]&&delete this.$behaviours[_]},this.inherit=function(_,x){if(typeof _=="function")var a=new _().getBehaviours(x);else var a=_.getBehaviours(x);this.addBehaviours(a)},this.getBehaviours=function(_){if(_){for(var x={},a=0;a<_.length;a++)this.$behaviours[_[a]]&&(x[_[a]]=this.$behaviours[_[a]]);return x}else return this.$behaviours}}).call(D.prototype),p.Behaviour=D}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(f,p,Se){var D=f("./range").Range,_=function(){function x(a,h,i){this.$session=a,this.$row=h,this.$rowTokens=a.getTokens(h);var r=a.getTokenAt(h,i);this.$tokenIndex=r?r.index:-1}return x.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]},x.prototype.stepForward=function(){this.$tokenIndex+=1;for(var a;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,a||(a=this.$session.getLength()),this.$row>=a)return this.$row=a-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},x.prototype.getCurrentTokenRow=function(){return this.$row},x.prototype.getCurrentTokenColumn=function(){var a=this.$rowTokens,h=this.$tokenIndex,i=a[h].start;if(i!==void 0)return i;for(i=0;h>0;)h-=1,i+=a[h].value.length;return i},x.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},x.prototype.getCurrentTokenRange=function(){var a=this.$rowTokens[this.$tokenIndex],h=this.getCurrentTokenColumn();return new D(this.$row,h,this.$row,h+a.value.length)},x}();p.TokenIterator=_}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(f,p,Se){var D=f("../../lib/oop"),_=f("../behaviour").Behaviour,x=f("../../token_iterator").TokenIterator,a=f("../../lib/lang"),h=["text","paren.rparen","rparen","paren","punctuation.operator"],i=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],r,o={},t={'"':'"',"'":"'"},e=function(g){var m=-1;if(g.multiSelect&&(m=g.selection.index,o.rangeCount!=g.multiSelect.rangeCount&&(o={rangeCount:g.multiSelect.rangeCount})),o[m])return r=o[m];r=o[m]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},n=function(g,m,A,E){var S=g.end.row-g.start.row;return{text:A+m+E,selection:[0,g.start.column+1,S,g.end.column+(S?0:1)]}},s;s=function(g){g=g||{},this.add("braces","insertion",function(m,A,E,S,C){var q=E.getCursorPosition(),Be=S.doc.getLine(q.row);if(C=="{"){e(E);var se=E.getSelectionRange(),j=S.doc.getTextRange(se),ct=S.getTokenAt(q.row,q.column);if(j!==""&&j!=="{"&&E.getWrapBehavioursEnabled())return n(se,j,"{","}");if(ct&&/(?:string)\.quasi|\.xml/.test(ct.type)){var G=[/tag\-(?:open|name)/,/attribute\-name/];return G.some(function(lt){return lt.test(ct.type)})||/(string)\.quasi/.test(ct.type)&&ct.value[q.column-ct.start-1]!=="$"?void 0:(s.recordAutoInsert(E,S,"}"),{text:"{}",selection:[1,1]})}else if(s.isSaneInsertion(E,S))return/[\]\}\)]/.test(Be[q.column])||E.inMultiSelectMode||g.braces?(s.recordAutoInsert(E,S,"}"),{text:"{}",selection:[1,1]}):(s.recordMaybeInsert(E,S,"{"),{text:"{",selection:[1,1]})}else if(C=="}"){e(E);var U=Be.substring(q.column,q.column+1);if(U=="}"){var b=S.$findOpeningBracket("}",{column:q.column+1,row:q.row});if(b!==null&&s.isAutoInsertedClosing(q,Be,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(C==`
|
182
182
|
`||C==`\r
|
183
183
|
`){e(E);var w="";s.isMaybeInsertedClosing(q,Be)&&(w=a.stringRepeat("}",r.maybeInsertedBrackets),s.clearMaybeInsertedClosing());var U=Be.substring(q.column,q.column+1);if(U==="}"){var W=S.findMatchingBracket({row:q.row,column:q.column+1},"}");if(!W)return null;var ot=this.$getIndent(S.getLine(W.row))}else if(w)var ot=this.$getIndent(Be);else{s.clearMaybeInsertedClosing();return}var at=ot+S.getTabString();return{text:`
|
184
184
|
`+at+`
|
185
|
-
`+ot+w,selection:[1,at.length,1,at.length]}}else s.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="{"){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.end.column,C.end.column+1);if(se=="}")return C.end.column++,C;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(m,A,E,S,C){if(C=="("){e(E);var q=E.getSelectionRange(),Be=S.doc.getTextRange(q);if(Be!==""&&E.getWrapBehavioursEnabled())return n(q,Be,"(",")");if(s.isSaneInsertion(E,S))return s.recordAutoInsert(E,S,")"),{text:"()",selection:[1,1]}}else if(C==")"){e(E);var se=E.getCursorPosition(),j=S.doc.getLine(se.row),ct=j.substring(se.column,se.column+1);if(ct==")"){var G=S.$findOpeningBracket(")",{column:se.column+1,row:se.row});if(G!==null&&s.isAutoInsertedClosing(se,j,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="("){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.start.column+1,C.start.column+2);if(se==")")return C.end.column++,C}}),this.add("brackets","insertion",function(m,A,E,S,C){if(C=="["){e(E);var q=E.getSelectionRange(),Be=S.doc.getTextRange(q);if(Be!==""&&E.getWrapBehavioursEnabled())return n(q,Be,"[","]");if(s.isSaneInsertion(E,S))return s.recordAutoInsert(E,S,"]"),{text:"[]",selection:[1,1]}}else if(C=="]"){e(E);var se=E.getCursorPosition(),j=S.doc.getLine(se.row),ct=j.substring(se.column,se.column+1);if(ct=="]"){var G=S.$findOpeningBracket("]",{column:se.column+1,row:se.row});if(G!==null&&s.isAutoInsertedClosing(se,j,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="["){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.start.column+1,C.start.column+2);if(se=="]")return C.end.column++,C}}),this.add("string_dquotes","insertion",function(m,A,E,S,C){var q=S.$mode.$quotes||t;if(C.length==1&&q[C]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(C)!=-1)return;e(E);var Be=C,se=E.getSelectionRange(),j=S.doc.getTextRange(se);if(j!==""&&(j.length!=1||!q[j])&&E.getWrapBehavioursEnabled())return n(se,j,Be,Be);if(!j){var ct=E.getCursorPosition(),G=S.doc.getLine(ct.row),U=G.substring(ct.column-1,ct.column),b=G.substring(ct.column,ct.column+1),w=S.getTokenAt(ct.row,ct.column),W=S.getTokenAt(ct.row,ct.column+1);if(U=="\\"&&w&&/escape/.test(w.type))return null;var ot=w&&/string|escape/.test(w.type),at=!W||/string|escape/.test(W.type),lt;if(b==Be)lt=ot!==at,lt&&/string\.end/.test(W.type)&&(lt=!1);else{if(ot&&!at||ot&&at)return null;var Mt=S.$mode.tokenRe;Mt.lastIndex=0;var zt=Mt.test(U);Mt.lastIndex=0;var hi=Mt.test(b),Ht=S.$mode.$pairQuotesAfter,Vt=Ht&&Ht[Be]&&Ht[Be].test(U);if(!Vt&&zt||hi||b&&!/[\s;,.})\]\\]/.test(b))return null;var Ut=G[ct.column-2];if(U==Be&&(Ut==Be||Mt.test(Ut)))return null;lt=!0}return{text:lt?Be+Be:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(m,A,E,S,C){var q=S.$mode.$quotes||t,Be=S.doc.getTextRange(C);if(!C.isMultiLine()&&q.hasOwnProperty(Be)){e(E);var se=S.doc.getLine(C.start.row),j=se.substring(C.start.column+1,C.start.column+2);if(j==Be)return C.end.column++,C}}),
|
185
|
+
`+ot+w,selection:[1,at.length,1,at.length]}}else s.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="{"){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.end.column,C.end.column+1);if(se=="}")return C.end.column++,C;r.maybeInsertedBrackets--}}),this.add("parens","insertion",function(m,A,E,S,C){if(C=="("){e(E);var q=E.getSelectionRange(),Be=S.doc.getTextRange(q);if(Be!==""&&E.getWrapBehavioursEnabled())return n(q,Be,"(",")");if(s.isSaneInsertion(E,S))return s.recordAutoInsert(E,S,")"),{text:"()",selection:[1,1]}}else if(C==")"){e(E);var se=E.getCursorPosition(),j=S.doc.getLine(se.row),ct=j.substring(se.column,se.column+1);if(ct==")"){var G=S.$findOpeningBracket(")",{column:se.column+1,row:se.row});if(G!==null&&s.isAutoInsertedClosing(se,j,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="("){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.start.column+1,C.start.column+2);if(se==")")return C.end.column++,C}}),this.add("brackets","insertion",function(m,A,E,S,C){if(C=="["){e(E);var q=E.getSelectionRange(),Be=S.doc.getTextRange(q);if(Be!==""&&E.getWrapBehavioursEnabled())return n(q,Be,"[","]");if(s.isSaneInsertion(E,S))return s.recordAutoInsert(E,S,"]"),{text:"[]",selection:[1,1]}}else if(C=="]"){e(E);var se=E.getCursorPosition(),j=S.doc.getLine(se.row),ct=j.substring(se.column,se.column+1);if(ct=="]"){var G=S.$findOpeningBracket("]",{column:se.column+1,row:se.row});if(G!==null&&s.isAutoInsertedClosing(se,j,C))return s.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(m,A,E,S,C){var q=S.doc.getTextRange(C);if(!C.isMultiLine()&&q=="["){e(E);var Be=S.doc.getLine(C.start.row),se=Be.substring(C.start.column+1,C.start.column+2);if(se=="]")return C.end.column++,C}}),this.add("string_dquotes","insertion",function(m,A,E,S,C){var q=S.$mode.$quotes||t;if(C.length==1&&q[C]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(C)!=-1)return;e(E);var Be=C,se=E.getSelectionRange(),j=S.doc.getTextRange(se);if(j!==""&&(j.length!=1||!q[j])&&E.getWrapBehavioursEnabled())return n(se,j,Be,Be);if(!j){var ct=E.getCursorPosition(),G=S.doc.getLine(ct.row),U=G.substring(ct.column-1,ct.column),b=G.substring(ct.column,ct.column+1),w=S.getTokenAt(ct.row,ct.column),W=S.getTokenAt(ct.row,ct.column+1);if(U=="\\"&&w&&/escape/.test(w.type))return null;var ot=w&&/string|escape/.test(w.type),at=!W||/string|escape/.test(W.type),lt;if(b==Be)lt=ot!==at,lt&&/string\.end/.test(W.type)&&(lt=!1);else{if(ot&&!at||ot&&at)return null;var Mt=S.$mode.tokenRe;Mt.lastIndex=0;var zt=Mt.test(U);Mt.lastIndex=0;var hi=Mt.test(b),Ht=S.$mode.$pairQuotesAfter,Vt=Ht&&Ht[Be]&&Ht[Be].test(U);if(!Vt&&zt||hi||b&&!/[\s;,.})\]\\]/.test(b))return null;var Ut=G[ct.column-2];if(U==Be&&(Ut==Be||Mt.test(Ut)))return null;lt=!0}return{text:lt?Be+Be:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(m,A,E,S,C){var q=S.$mode.$quotes||t,Be=S.doc.getTextRange(C);if(!C.isMultiLine()&&q.hasOwnProperty(Be)){e(E);var se=S.doc.getLine(C.start.row),j=se.substring(C.start.column+1,C.start.column+2);if(j==Be)return C.end.column++,C}}),g.closeDocComment!==!1&&this.add("doc comment end","insertion",function(m,A,E,S,C){if(m==="doc-start"&&(C===`
|
186
186
|
`||C===`\r
|
187
|
-
`)&&E.selection.isEmpty()){var q=E.getCursorPosition();if(q.column===0)return;for(var Be=S.doc.getLine(q.row),se=S.doc.getLine(q.row+1),j=S.getTokens(q.row),ct=0,G=0;G<j.length;G++){ct+=j[G].value.length;var U=j[G];if(ct>=q.column){if(ct===q.column){if(!/\.doc/.test(U.type))return;if(/\*\//.test(U.value)){var b=j[G+1];if(!b||!/\.doc/.test(b.type))return}}var w=q.column-(ct-U.value.length),W=U.value.indexOf("*/"),ot=U.value.indexOf("/**",W>-1?W+2:0);if(ot!==-1&&w>ot&&w<ot+3||W!==-1&&ot!==-1&&w>=W&&w<=ot||!/\.doc/.test(U.type))return;break}}var at=this.$getIndent(Be);if(/\s*\*/.test(se))return/^\s*\*/.test(Be)?{text:C+at+"* ",selection:[1,2+at.length,1,2+at.length]}:{text:C+at+" * ",selection:[1,3+at.length,1,3+at.length]};if(/\/\*\*/.test(Be.substring(0,q.column)))return{text:C+at+" * "+C+" "+at+"*/",selection:[1,4+at.length,1,4+at.length]}}})},s.isSaneInsertion=function(f,m){var A=f.getCursorPosition(),E=new x(m,A.row,A.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",h)){if(/[)}\]]/.test(f.session.getLine(A.row)[A.column]))return!0;var S=new x(m,A.row,A.column+1);if(!this.$matchTokenType(S.getCurrentToken()||"text",h))return!1}return E.stepForward(),E.getCurrentTokenRow()!==A.row||this.$matchTokenType(E.getCurrentToken()||"text",i)},s.$matchTokenType=function(f,m){return m.indexOf(f.type||f)>-1},s.recordAutoInsert=function(f,m,A){var E=f.getCursorPosition(),S=m.doc.getLine(E.row);this.isAutoInsertedClosing(E,S,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=E.row,r.autoInsertedLineEnd=A+S.substr(E.column),r.autoInsertedBrackets++},s.recordMaybeInsert=function(f,m,A){var E=f.getCursorPosition(),S=m.doc.getLine(E.row);this.isMaybeInsertedClosing(E,S)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=E.row,r.maybeInsertedLineStart=S.substr(0,E.column)+A,r.maybeInsertedLineEnd=S.substr(E.column),r.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(f,m,A){return r.autoInsertedBrackets>0&&f.row===r.autoInsertedRow&&A===r.autoInsertedLineEnd[0]&&m.substr(f.column)===r.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(f,m){return r.maybeInsertedBrackets>0&&f.row===r.maybeInsertedRow&&m.substr(f.column)===r.maybeInsertedLineEnd&&m.substr(0,f.column)==r.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},D.inherits(s,_),p.CstyleBehaviour=s}),ace.define("ace/unicode",["require","exports","module"],function(g,p,Se){for(var D=[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],_=0,x=[],a=0;a<D.length;a+=2)x.push(_+=D[a]),D[a+1]&&x.push(45,_+=D[a+1]);p.wordChars=String.fromCharCode.apply(null,x)}),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(g,p,Se){var D=g("../config"),_=g("../tokenizer").Tokenizer,x=g("./text_highlight_rules").TextHighlightRules,a=g("./behaviour/cstyle").CstyleBehaviour,h=g("../unicode"),i=g("../lib/lang"),r=g("../token_iterator").TokenIterator,o=g("../range").Range,t;t=function(){this.HighlightRules=x},(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+h.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+h.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new _(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,n,s,f){var m=n.doc,A=!0,E=!0,S=1/0,C=n.getTabSize(),q=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var j=this.lineCommentStart.map(i.escapeRegExp).join("|"),Be=this.lineCommentStart[0];else var j=i.escapeRegExp(this.lineCommentStart),Be=this.lineCommentStart;j=new RegExp("^(\\s*)(?:"+j+") ?"),q=n.getUseSoftTabs();var U=function(hi,Ht){var Vt=hi.match(j);if(Vt){var Ut=Vt[1].length,Jt=Vt[0].length;!W(hi,Ut,Jt)&&Vt[0][Jt-1]==" "&&Jt--,m.removeInLine(Ht,Ut,Jt)}},w=Be+" ",G=function(hi,Ht){(!A||/\S/.test(hi))&&(W(hi,S,S)?m.insertInLine({row:Ht,column:S},w):m.insertInLine({row:Ht,column:S},Be))},b=function(hi,Ht){return j.test(hi)},W=function(hi,Ht,Vt){for(var Ut=0;Ht--&&hi.charAt(Ht)==" ";)Ut++;if(Ut%C!=0)return!1;for(var Ut=0;hi.charAt(Vt++)==" ";)Ut++;return C>2?Ut%C!=C-1:Ut%C==0}}else{if(!this.blockComment)return!1;var Be=this.blockComment.start,se=this.blockComment.end,j=new RegExp("^(\\s*)(?:"+i.escapeRegExp(Be)+")"),ct=new RegExp("(?:"+i.escapeRegExp(se)+")\\s*$"),G=function(lt,Mt){b(lt,Mt)||(!A||/\S/.test(lt))&&(m.insertInLine({row:Mt,column:lt.length},se),m.insertInLine({row:Mt,column:S},Be))},U=function(lt,Mt){var zt;(zt=lt.match(ct))&&m.removeInLine(Mt,lt.length-zt[0].length,lt.length),(zt=lt.match(j))&&m.removeInLine(Mt,zt[1].length,zt[0].length)},b=function(lt,Mt){if(j.test(lt))return!0;for(var zt=n.getTokens(Mt),hi=0;hi<zt.length;hi++)if(zt[hi].type==="comment")return!0}}function ot(lt){for(var Mt=s;Mt<=f;Mt++)lt(m.getLine(Mt),Mt)}var at=1/0;ot(function(lt,Mt){var zt=lt.search(/\S/);zt!==-1?(zt<S&&(S=zt),E&&!b(lt,Mt)&&(E=!1)):at>lt.length&&(at=lt.length)}),S==1/0&&(S=at,A=!1,E=!1),q&&S%C!=0&&(S=Math.floor(S/C)*C),ot(E?U:G)},this.toggleBlockComment=function(e,n,s,f){var m=this.blockComment;if(m){!m.start&&m[0]&&(m=m[0]);var A=new r(n,f.row,f.column),E=A.getCurrentToken();n.selection;var S=n.selection.toOrientedRange(),C,q;if(E&&/comment/.test(E.type)){for(var Be,se;E&&/comment/.test(E.type);){var j=E.value.indexOf(m.start);if(j!=-1){var ct=A.getCurrentTokenRow(),G=A.getCurrentTokenColumn()+j;Be=new o(ct,G,ct,G+m.start.length);break}E=A.stepBackward()}for(var A=new r(n,f.row,f.column),E=A.getCurrentToken();E&&/comment/.test(E.type);){var j=E.value.indexOf(m.end);if(j!=-1){var ct=A.getCurrentTokenRow(),G=A.getCurrentTokenColumn()+j;se=new o(ct,G,ct,G+m.end.length);break}E=A.stepForward()}se&&n.remove(se),Be&&(n.remove(Be),C=Be.start.row,q=-m.start.length)}else q=m.start.length,C=s.start.row,n.insert(s.end,m.end),n.insert(s.start,m.start);S.start.row==C&&(S.start.column+=q),S.end.row==C&&(S.end.column+=q),n.selection.fromOrientedRange(S)}},this.getNextLineIndent=function(e,n,s){return this.$getIndent(n)},this.checkOutdent=function(e,n,s){return!1},this.autoOutdent=function(e,n,s){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var n in e)if(e[n]){var s=e[n],f=s.prototype.$id,m=D.$modes[f];m||(D.$modes[f]=m=new s),D.$modes[n]||(D.$modes[n]=m),this.$embeds.push(n),this.$modes[n]=m}for(var A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(C){(function(q){var Be=A[C],se=q[Be];q[A[C]]=function(){return this.$delegator(Be,arguments,se)}})(S)},S=this,n=0;n<A.length;n++)E(n)},this.$delegator=function(e,n,s){var f=n[0]||"start";if(typeof f!="string"){if(Array.isArray(f[2])){var m=f[2][f[2].length-1],A=this.$modes[m];if(A)return A[e].apply(A,[f[1]].concat([].slice.call(n,1)))}f=f[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var S=f.split(this.$embeds[E]);if(!S[0]&&S[1]){n[0]=S[1];var A=this.$modes[this.$embeds[E]];return A[e].apply(A,n)}}var C=s.apply(this,n);return s?C:void 0},this.transformAction=function(e,n,s,f,m){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var E in A)if(A[E][n]){var S=A[E][n].apply(this,arguments);if(S)return S}}},this.getKeywords=function(e){if(!this.completionKeywords){var n=this.$tokenizer.rules,s=[];for(var f in n)for(var m=n[f],A=0,E=m.length;A<E;A++)if(typeof m[A].token=="string")/keyword|support|storage/.test(m[A].token)&&s.push(m[A].regex);else if(typeof m[A].token=="object"){for(var S=0,C=m[A].token.length;S<C;S++)if(/keyword|support|storage/.test(m[A].token[S])){var f=m[A].regex.match(/\(.+?\)/g)[S];s.push(f.substr(1,f.length-2))}}this.completionKeywords=s}return e?s.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,n,s,f){var m=this.$keywordList||this.$createKeywordList();return m.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(t.prototype),p.Mode=t}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(g,p,Se){var D=g("./lib/dom"),_=function(){function x(a){this.session=a,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 x.prototype.getRowLength=function(a){var h;return this.lineWidgets?h=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0:h=0,!this.$useWrapMode||!this.$wrapData[a]?1+h:this.$wrapData[a].length+1+h},x.prototype.$getWidgetScreenLength=function(){var a=0;return this.lineWidgets.forEach(function(h){h&&h.rowCount&&!h.hidden&&(a+=h.rowCount)}),a},x.prototype.$onChangeEditor=function(a){this.attach(a.editor)},x.prototype.attach=function(a){a&&a.widgetManager&&a.widgetManager!=this&&a.widgetManager.detach(),this.editor!=a&&(this.detach(),this.editor=a,a&&(a.widgetManager=this,a.renderer.on("beforeRender",this.measureWidgets),a.renderer.on("afterRender",this.renderWidgets)))},x.prototype.detach=function(a){var h=this.editor;if(h){this.editor=null,h.widgetManager=null,h.renderer.off("beforeRender",this.measureWidgets),h.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(r){r&&r.el&&r.el.parentNode&&(r._inDocument=!1,r.el.parentNode.removeChild(r.el))})}},x.prototype.updateOnFold=function(a,h){var i=h.lineWidgets;if(!(!i||!a.action)){for(var r=a.data,o=r.start.row,t=r.end.row,e=a.action=="add",n=o+1;n<t;n++)i[n]&&(i[n].hidden=e);i[t]&&(e?i[o]?i[t].hidden=e:i[o]=i[t]:(i[o]==i[t]&&(i[o]=void 0),i[t].hidden=e))}},x.prototype.updateOnChange=function(a){var h=this.session.lineWidgets;if(h){var i=a.start.row,r=a.end.row-i;if(r!==0)if(a.action=="remove"){var o=h.splice(i+1,r);!h[i]&&o[o.length-1]&&(h[i]=o.pop()),o.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var t=new Array(r);h[i]&&h[i].column!=null&&a.start.column>h[i].column&&i++,t.unshift(i,0),h.splice.apply(h,t),this.$updateRows()}}},x.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var h=!0;a.forEach(function(i,r){if(i)for(h=!1,i.row=r;i.$oldWidget;)i.$oldWidget.row=r,i=i.$oldWidget}),h&&(this.session.lineWidgets=null)}},x.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var h=this.session.lineWidgets[a.row];return h&&(a.$oldWidget=h,h.el&&h.el.parentNode&&(h.el.parentNode.removeChild(h.el),h._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},x.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var h=this.editor.renderer;a.html&&!a.el&&(a.el=D.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=D.createElement("div"),a.el.textContent=a.text),a.el&&(D.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&D.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",h.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/h.layerConfig.lineHeight);var i=this.session.getFoldAt(a.row,0);if(a.$fold=i,i){var r=this.session.lineWidgets;a.row==i.end.row&&!r[i.start.row]?r[i.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,h),this.onWidgetChanged(a),a},x.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var h=this.session.lineWidgets[a.row];if(h==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;h;){if(h.$oldWidget==a){h.$oldWidget=a.$oldWidget;break}h=h.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},x.prototype.getWidgetsAtRow=function(a){for(var h=this.session.lineWidgets,i=h&&h[a],r=[];i;)r.push(i),i=i.$oldWidget;return r},x.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},x.prototype.measureWidgets=function(a,h){var i=this.session._changedWidgets,r=h.layerConfig;if(!(!i||!i.length)){for(var o=1/0,t=0;t<i.length;t++){var e=i[t];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,h.container.appendChild(e.el)}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/r.characterWidth));var n=e.h/r.lineHeight;e.coverLine&&(n-=this.session.getRowLineCount(e.row),n<0&&(n=0)),e.rowCount!=n&&(e.rowCount=n,e.row<o&&(o=e.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},x.prototype.renderWidgets=function(a,h){var i=h.layerConfig,r=this.session.lineWidgets;if(r){for(var o=Math.min(this.firstRow,i.firstRow),t=Math.max(this.lastRow,i.lastRow,r.length);o>0&&!r[o];)o--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,h.$cursorLayer.config=i;for(var e=o;e<=t;e++){var n=r[e];if(!(!n||!n.el)){if(n.hidden){n.el.style.top=-100-(n.pixelHeight||0)+"px";continue}n._inDocument||(n._inDocument=!0,h.container.appendChild(n.el));var s=h.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;n.coverLine||(s+=i.lineHeight*this.session.getRowLineCount(n.row)),n.el.style.top=s-i.offset+"px";var f=n.coverGutter?0:h.gutterWidth;n.fixedWidth||(f-=h.scrollLeft),n.el.style.left=f+"px",n.fullWidth&&n.screenWidth&&(n.el.style.minWidth=i.width+2*i.padding+"px"),n.fixedWidth?n.el.style.right=h.scrollBar.getWidth()+"px":n.el.style.right=""}}}},x}();p.LineWidgets=_}),ace.define("ace/apply_delta",["require","exports","module"],function(g,p,Se){p.applyDelta=function(D,_,x){var a=_.start.row,h=_.start.column,i=D[a]||"";switch(_.action){case"insert":var r=_.lines;if(r.length===1)D[a]=i.substring(0,h)+_.lines[0]+i.substring(h);else{var o=[a,1].concat(_.lines);D.splice.apply(D,o),D[a]=i.substring(0,h)+D[a],D[a+_.lines.length-1]+=i.substring(h)}break;case"remove":var t=_.end.column,e=_.end.row;a===e?D[a]=i.substring(0,h)+i.substring(t):D.splice(a,e-a+1,i.substring(0,h)+D[e].substring(t));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(g,p,Se){var D=g("./lib/oop"),_=g("./lib/event_emitter").EventEmitter,x=function(){function i(r,o,t){this.$onChange=this.onChange.bind(this),this.attach(r),typeof o!="number"?this.setPosition(o.row,o.column):this.setPosition(o,t)}return i.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},i.prototype.getDocument=function(){return this.document},i.prototype.onChange=function(r){if(!(r.start.row==r.end.row&&r.start.row!=this.row)&&!(r.start.row>this.row)){var o=h(r,{row:this.row,column:this.column},this.$insertRight);this.setPosition(o.row,o.column,!0)}},i.prototype.setPosition=function(r,o,t){var e;if(t?e={row:r,column:o}:e=this.$clipPositionToDocument(r,o),!(this.row==e.row&&this.column==e.column)){var n={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:n,value:e})}},i.prototype.detach=function(){this.document.off("change",this.$onChange)},i.prototype.attach=function(r){this.document=r||this.document,this.document.on("change",this.$onChange)},i.prototype.$clipPositionToDocument=function(r,o){var t={};return r>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):r<0?(t.row=0,t.column=0):(t.row=r,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,o))),o<0&&(t.column=0),t},i}();x.prototype.$insertRight=!1,D.implement(x.prototype,_);function a(i,r,o){var t=o?i.column<=r.column:i.column<r.column;return i.row<r.row||i.row==r.row&&t}function h(i,r,o){var t=i.action=="insert",e=(t?1:-1)*(i.end.row-i.start.row),n=(t?1:-1)*(i.end.column-i.start.column),s=i.start,f=t?s:i.end;return a(r,s,o)?{row:r.row,column:r.column}:a(f,r,!o)?{row:r.row+e,column:r.column+(r.row==f.row?n:0)}:{row:s.row,column:s.column}}p.Anchor=x}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(g,p,Se){var D=g("./lib/oop"),_=g("./apply_delta").applyDelta,x=g("./lib/event_emitter").EventEmitter,a=g("./range").Range,h=g("./anchor").Anchor,i=function(){function r(o){this.$lines=[""],o.length===0?this.$lines=[""]:Array.isArray(o)?this.insertMergedLines({row:0,column:0},o):this.insert({row:0,column:0},o)}return r.prototype.setValue=function(o){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},o||"")},r.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},r.prototype.createAnchor=function(o,t){return new h(this,o,t)},r.prototype.$detectNewLine=function(o){var t=o.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
|
187
|
+
`)&&E.selection.isEmpty()){var q=E.getCursorPosition();if(q.column===0)return;for(var Be=S.doc.getLine(q.row),se=S.doc.getLine(q.row+1),j=S.getTokens(q.row),ct=0,G=0;G<j.length;G++){ct+=j[G].value.length;var U=j[G];if(ct>=q.column){if(ct===q.column){if(!/\.doc/.test(U.type))return;if(/\*\//.test(U.value)){var b=j[G+1];if(!b||!/\.doc/.test(b.type))return}}var w=q.column-(ct-U.value.length),W=U.value.indexOf("*/"),ot=U.value.indexOf("/**",W>-1?W+2:0);if(ot!==-1&&w>ot&&w<ot+3||W!==-1&&ot!==-1&&w>=W&&w<=ot||!/\.doc/.test(U.type))return;break}}var at=this.$getIndent(Be);if(/\s*\*/.test(se))return/^\s*\*/.test(Be)?{text:C+at+"* ",selection:[1,2+at.length,1,2+at.length]}:{text:C+at+" * ",selection:[1,3+at.length,1,3+at.length]};if(/\/\*\*/.test(Be.substring(0,q.column)))return{text:C+at+" * "+C+" "+at+"*/",selection:[1,4+at.length,1,4+at.length]}}})},s.isSaneInsertion=function(g,m){var A=g.getCursorPosition(),E=new x(m,A.row,A.column);if(!this.$matchTokenType(E.getCurrentToken()||"text",h)){if(/[)}\]]/.test(g.session.getLine(A.row)[A.column]))return!0;var S=new x(m,A.row,A.column+1);if(!this.$matchTokenType(S.getCurrentToken()||"text",h))return!1}return E.stepForward(),E.getCurrentTokenRow()!==A.row||this.$matchTokenType(E.getCurrentToken()||"text",i)},s.$matchTokenType=function(g,m){return m.indexOf(g.type||g)>-1},s.recordAutoInsert=function(g,m,A){var E=g.getCursorPosition(),S=m.doc.getLine(E.row);this.isAutoInsertedClosing(E,S,r.autoInsertedLineEnd[0])||(r.autoInsertedBrackets=0),r.autoInsertedRow=E.row,r.autoInsertedLineEnd=A+S.substr(E.column),r.autoInsertedBrackets++},s.recordMaybeInsert=function(g,m,A){var E=g.getCursorPosition(),S=m.doc.getLine(E.row);this.isMaybeInsertedClosing(E,S)||(r.maybeInsertedBrackets=0),r.maybeInsertedRow=E.row,r.maybeInsertedLineStart=S.substr(0,E.column)+A,r.maybeInsertedLineEnd=S.substr(E.column),r.maybeInsertedBrackets++},s.isAutoInsertedClosing=function(g,m,A){return r.autoInsertedBrackets>0&&g.row===r.autoInsertedRow&&A===r.autoInsertedLineEnd[0]&&m.substr(g.column)===r.autoInsertedLineEnd},s.isMaybeInsertedClosing=function(g,m){return r.maybeInsertedBrackets>0&&g.row===r.maybeInsertedRow&&m.substr(g.column)===r.maybeInsertedLineEnd&&m.substr(0,g.column)==r.maybeInsertedLineStart},s.popAutoInsertedClosing=function(){r.autoInsertedLineEnd=r.autoInsertedLineEnd.substr(1),r.autoInsertedBrackets--},s.clearMaybeInsertedClosing=function(){r&&(r.maybeInsertedBrackets=0,r.maybeInsertedRow=-1)},D.inherits(s,_),p.CstyleBehaviour=s}),ace.define("ace/unicode",["require","exports","module"],function(f,p,Se){for(var D=[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],_=0,x=[],a=0;a<D.length;a+=2)x.push(_+=D[a]),D[a+1]&&x.push(45,_+=D[a+1]);p.wordChars=String.fromCharCode.apply(null,x)}),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(f,p,Se){var D=f("../config"),_=f("../tokenizer").Tokenizer,x=f("./text_highlight_rules").TextHighlightRules,a=f("./behaviour/cstyle").CstyleBehaviour,h=f("../unicode"),i=f("../lib/lang"),r=f("../token_iterator").TokenIterator,o=f("../range").Range,t;t=function(){this.HighlightRules=x},(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+h.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+h.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new _(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,n,s,g){var m=n.doc,A=!0,E=!0,S=1/0,C=n.getTabSize(),q=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var j=this.lineCommentStart.map(i.escapeRegExp).join("|"),Be=this.lineCommentStart[0];else var j=i.escapeRegExp(this.lineCommentStart),Be=this.lineCommentStart;j=new RegExp("^(\\s*)(?:"+j+") ?"),q=n.getUseSoftTabs();var U=function(hi,Ht){var Vt=hi.match(j);if(Vt){var Ut=Vt[1].length,Jt=Vt[0].length;!W(hi,Ut,Jt)&&Vt[0][Jt-1]==" "&&Jt--,m.removeInLine(Ht,Ut,Jt)}},w=Be+" ",G=function(hi,Ht){(!A||/\S/.test(hi))&&(W(hi,S,S)?m.insertInLine({row:Ht,column:S},w):m.insertInLine({row:Ht,column:S},Be))},b=function(hi,Ht){return j.test(hi)},W=function(hi,Ht,Vt){for(var Ut=0;Ht--&&hi.charAt(Ht)==" ";)Ut++;if(Ut%C!=0)return!1;for(var Ut=0;hi.charAt(Vt++)==" ";)Ut++;return C>2?Ut%C!=C-1:Ut%C==0}}else{if(!this.blockComment)return!1;var Be=this.blockComment.start,se=this.blockComment.end,j=new RegExp("^(\\s*)(?:"+i.escapeRegExp(Be)+")"),ct=new RegExp("(?:"+i.escapeRegExp(se)+")\\s*$"),G=function(lt,Mt){b(lt,Mt)||(!A||/\S/.test(lt))&&(m.insertInLine({row:Mt,column:lt.length},se),m.insertInLine({row:Mt,column:S},Be))},U=function(lt,Mt){var zt;(zt=lt.match(ct))&&m.removeInLine(Mt,lt.length-zt[0].length,lt.length),(zt=lt.match(j))&&m.removeInLine(Mt,zt[1].length,zt[0].length)},b=function(lt,Mt){if(j.test(lt))return!0;for(var zt=n.getTokens(Mt),hi=0;hi<zt.length;hi++)if(zt[hi].type==="comment")return!0}}function ot(lt){for(var Mt=s;Mt<=g;Mt++)lt(m.getLine(Mt),Mt)}var at=1/0;ot(function(lt,Mt){var zt=lt.search(/\S/);zt!==-1?(zt<S&&(S=zt),E&&!b(lt,Mt)&&(E=!1)):at>lt.length&&(at=lt.length)}),S==1/0&&(S=at,A=!1,E=!1),q&&S%C!=0&&(S=Math.floor(S/C)*C),ot(E?U:G)},this.toggleBlockComment=function(e,n,s,g){var m=this.blockComment;if(m){!m.start&&m[0]&&(m=m[0]);var A=new r(n,g.row,g.column),E=A.getCurrentToken();n.selection;var S=n.selection.toOrientedRange(),C,q;if(E&&/comment/.test(E.type)){for(var Be,se;E&&/comment/.test(E.type);){var j=E.value.indexOf(m.start);if(j!=-1){var ct=A.getCurrentTokenRow(),G=A.getCurrentTokenColumn()+j;Be=new o(ct,G,ct,G+m.start.length);break}E=A.stepBackward()}for(var A=new r(n,g.row,g.column),E=A.getCurrentToken();E&&/comment/.test(E.type);){var j=E.value.indexOf(m.end);if(j!=-1){var ct=A.getCurrentTokenRow(),G=A.getCurrentTokenColumn()+j;se=new o(ct,G,ct,G+m.end.length);break}E=A.stepForward()}se&&n.remove(se),Be&&(n.remove(Be),C=Be.start.row,q=-m.start.length)}else q=m.start.length,C=s.start.row,n.insert(s.end,m.end),n.insert(s.start,m.start);S.start.row==C&&(S.start.column+=q),S.end.row==C&&(S.end.column+=q),n.selection.fromOrientedRange(S)}},this.getNextLineIndent=function(e,n,s){return this.$getIndent(n)},this.checkOutdent=function(e,n,s){return!1},this.autoOutdent=function(e,n,s){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var n in e)if(e[n]){var s=e[n],g=s.prototype.$id,m=D.$modes[g];m||(D.$modes[g]=m=new s),D.$modes[n]||(D.$modes[n]=m),this.$embeds.push(n),this.$modes[n]=m}for(var A=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],E=function(C){(function(q){var Be=A[C],se=q[Be];q[A[C]]=function(){return this.$delegator(Be,arguments,se)}})(S)},S=this,n=0;n<A.length;n++)E(n)},this.$delegator=function(e,n,s){var g=n[0]||"start";if(typeof g!="string"){if(Array.isArray(g[2])){var m=g[2][g[2].length-1],A=this.$modes[m];if(A)return A[e].apply(A,[g[1]].concat([].slice.call(n,1)))}g=g[0]||"start"}for(var E=0;E<this.$embeds.length;E++)if(this.$modes[this.$embeds[E]]){var S=g.split(this.$embeds[E]);if(!S[0]&&S[1]){n[0]=S[1];var A=this.$modes[this.$embeds[E]];return A[e].apply(A,n)}}var C=s.apply(this,n);return s?C:void 0},this.transformAction=function(e,n,s,g,m){if(this.$behaviour){var A=this.$behaviour.getBehaviours();for(var E in A)if(A[E][n]){var S=A[E][n].apply(this,arguments);if(S)return S}}},this.getKeywords=function(e){if(!this.completionKeywords){var n=this.$tokenizer.rules,s=[];for(var g in n)for(var m=n[g],A=0,E=m.length;A<E;A++)if(typeof m[A].token=="string")/keyword|support|storage/.test(m[A].token)&&s.push(m[A].regex);else if(typeof m[A].token=="object"){for(var S=0,C=m[A].token.length;S<C;S++)if(/keyword|support|storage/.test(m[A].token[S])){var g=m[A].regex.match(/\(.+?\)/g)[S];s.push(g.substr(1,g.length-2))}}this.completionKeywords=s}return e?s.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,n,s,g){var m=this.$keywordList||this.$createKeywordList();return m.map(function(A){return{name:A,value:A,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(t.prototype),p.Mode=t}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(f,p,Se){var D=f("./lib/dom"),_=function(){function x(a){this.session=a,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 x.prototype.getRowLength=function(a){var h;return this.lineWidgets?h=this.lineWidgets[a]&&this.lineWidgets[a].rowCount||0:h=0,!this.$useWrapMode||!this.$wrapData[a]?1+h:this.$wrapData[a].length+1+h},x.prototype.$getWidgetScreenLength=function(){var a=0;return this.lineWidgets.forEach(function(h){h&&h.rowCount&&!h.hidden&&(a+=h.rowCount)}),a},x.prototype.$onChangeEditor=function(a){this.attach(a.editor)},x.prototype.attach=function(a){a&&a.widgetManager&&a.widgetManager!=this&&a.widgetManager.detach(),this.editor!=a&&(this.detach(),this.editor=a,a&&(a.widgetManager=this,a.renderer.on("beforeRender",this.measureWidgets),a.renderer.on("afterRender",this.renderWidgets)))},x.prototype.detach=function(a){var h=this.editor;if(h){this.editor=null,h.widgetManager=null,h.renderer.off("beforeRender",this.measureWidgets),h.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach(function(r){r&&r.el&&r.el.parentNode&&(r._inDocument=!1,r.el.parentNode.removeChild(r.el))})}},x.prototype.updateOnFold=function(a,h){var i=h.lineWidgets;if(!(!i||!a.action)){for(var r=a.data,o=r.start.row,t=r.end.row,e=a.action=="add",n=o+1;n<t;n++)i[n]&&(i[n].hidden=e);i[t]&&(e?i[o]?i[t].hidden=e:i[o]=i[t]:(i[o]==i[t]&&(i[o]=void 0),i[t].hidden=e))}},x.prototype.updateOnChange=function(a){var h=this.session.lineWidgets;if(h){var i=a.start.row,r=a.end.row-i;if(r!==0)if(a.action=="remove"){var o=h.splice(i+1,r);!h[i]&&o[o.length-1]&&(h[i]=o.pop()),o.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var t=new Array(r);h[i]&&h[i].column!=null&&a.start.column>h[i].column&&i++,t.unshift(i,0),h.splice.apply(h,t),this.$updateRows()}}},x.prototype.$updateRows=function(){var a=this.session.lineWidgets;if(a){var h=!0;a.forEach(function(i,r){if(i)for(h=!1,i.row=r;i.$oldWidget;)i.$oldWidget.row=r,i=i.$oldWidget}),h&&(this.session.lineWidgets=null)}},x.prototype.$registerLineWidget=function(a){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var h=this.session.lineWidgets[a.row];return h&&(a.$oldWidget=h,h.el&&h.el.parentNode&&(h.el.parentNode.removeChild(h.el),h._inDocument=!1)),this.session.lineWidgets[a.row]=a,a},x.prototype.addLineWidget=function(a){if(this.$registerLineWidget(a),a.session=this.session,!this.editor)return a;var h=this.editor.renderer;a.html&&!a.el&&(a.el=D.createElement("div"),a.el.innerHTML=a.html),a.text&&!a.el&&(a.el=D.createElement("div"),a.el.textContent=a.text),a.el&&(D.addCssClass(a.el,"ace_lineWidgetContainer"),a.className&&D.addCssClass(a.el,a.className),a.el.style.position="absolute",a.el.style.zIndex="5",h.container.appendChild(a.el),a._inDocument=!0,a.coverGutter||(a.el.style.zIndex="3"),a.pixelHeight==null&&(a.pixelHeight=a.el.offsetHeight)),a.rowCount==null&&(a.rowCount=a.pixelHeight/h.layerConfig.lineHeight);var i=this.session.getFoldAt(a.row,0);if(a.$fold=i,i){var r=this.session.lineWidgets;a.row==i.end.row&&!r[i.start.row]?r[i.start.row]=a:a.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows(),this.renderWidgets(null,h),this.onWidgetChanged(a),a},x.prototype.removeLineWidget=function(a){if(a._inDocument=!1,a.session=null,a.el&&a.el.parentNode&&a.el.parentNode.removeChild(a.el),a.editor&&a.editor.destroy)try{a.editor.destroy()}catch{}if(this.session.lineWidgets){var h=this.session.lineWidgets[a.row];if(h==a)this.session.lineWidgets[a.row]=a.$oldWidget,a.$oldWidget&&this.onWidgetChanged(a.$oldWidget);else for(;h;){if(h.$oldWidget==a){h.$oldWidget=a.$oldWidget;break}h=h.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:a.row}}}),this.$updateRows()},x.prototype.getWidgetsAtRow=function(a){for(var h=this.session.lineWidgets,i=h&&h[a],r=[];i;)r.push(i),i=i.$oldWidget;return r},x.prototype.onWidgetChanged=function(a){this.session._changedWidgets.push(a),this.editor&&this.editor.renderer.updateFull()},x.prototype.measureWidgets=function(a,h){var i=this.session._changedWidgets,r=h.layerConfig;if(!(!i||!i.length)){for(var o=1/0,t=0;t<i.length;t++){var e=i[t];if(!(!e||!e.el)&&e.session==this.session){if(!e._inDocument){if(this.session.lineWidgets[e.row]!=e)continue;e._inDocument=!0,h.container.appendChild(e.el)}e.h=e.el.offsetHeight,e.fixedWidth||(e.w=e.el.offsetWidth,e.screenWidth=Math.ceil(e.w/r.characterWidth));var n=e.h/r.lineHeight;e.coverLine&&(n-=this.session.getRowLineCount(e.row),n<0&&(n=0)),e.rowCount!=n&&(e.rowCount=n,e.row<o&&(o=e.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},x.prototype.renderWidgets=function(a,h){var i=h.layerConfig,r=this.session.lineWidgets;if(r){for(var o=Math.min(this.firstRow,i.firstRow),t=Math.max(this.lastRow,i.lastRow,r.length);o>0&&!r[o];)o--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,h.$cursorLayer.config=i;for(var e=o;e<=t;e++){var n=r[e];if(!(!n||!n.el)){if(n.hidden){n.el.style.top=-100-(n.pixelHeight||0)+"px";continue}n._inDocument||(n._inDocument=!0,h.container.appendChild(n.el));var s=h.$cursorLayer.getPixelPosition({row:e,column:0},!0).top;n.coverLine||(s+=i.lineHeight*this.session.getRowLineCount(n.row)),n.el.style.top=s-i.offset+"px";var g=n.coverGutter?0:h.gutterWidth;n.fixedWidth||(g-=h.scrollLeft),n.el.style.left=g+"px",n.fullWidth&&n.screenWidth&&(n.el.style.minWidth=i.width+2*i.padding+"px"),n.fixedWidth?n.el.style.right=h.scrollBar.getWidth()+"px":n.el.style.right=""}}}},x}();p.LineWidgets=_}),ace.define("ace/apply_delta",["require","exports","module"],function(f,p,Se){p.applyDelta=function(D,_,x){var a=_.start.row,h=_.start.column,i=D[a]||"";switch(_.action){case"insert":var r=_.lines;if(r.length===1)D[a]=i.substring(0,h)+_.lines[0]+i.substring(h);else{var o=[a,1].concat(_.lines);D.splice.apply(D,o),D[a]=i.substring(0,h)+D[a],D[a+_.lines.length-1]+=i.substring(h)}break;case"remove":var t=_.end.column,e=_.end.row;a===e?D[a]=i.substring(0,h)+i.substring(t):D.splice(a,e-a+1,i.substring(0,h)+D[e].substring(t));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(f,p,Se){var D=f("./lib/oop"),_=f("./lib/event_emitter").EventEmitter,x=function(){function i(r,o,t){this.$onChange=this.onChange.bind(this),this.attach(r),typeof o!="number"?this.setPosition(o.row,o.column):this.setPosition(o,t)}return i.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},i.prototype.getDocument=function(){return this.document},i.prototype.onChange=function(r){if(!(r.start.row==r.end.row&&r.start.row!=this.row)&&!(r.start.row>this.row)){var o=h(r,{row:this.row,column:this.column},this.$insertRight);this.setPosition(o.row,o.column,!0)}},i.prototype.setPosition=function(r,o,t){var e;if(t?e={row:r,column:o}:e=this.$clipPositionToDocument(r,o),!(this.row==e.row&&this.column==e.column)){var n={row:this.row,column:this.column};this.row=e.row,this.column=e.column,this._signal("change",{old:n,value:e})}},i.prototype.detach=function(){this.document.off("change",this.$onChange)},i.prototype.attach=function(r){this.document=r||this.document,this.document.on("change",this.$onChange)},i.prototype.$clipPositionToDocument=function(r,o){var t={};return r>=this.document.getLength()?(t.row=Math.max(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):r<0?(t.row=0,t.column=0):(t.row=r,t.column=Math.min(this.document.getLine(t.row).length,Math.max(0,o))),o<0&&(t.column=0),t},i}();x.prototype.$insertRight=!1,D.implement(x.prototype,_);function a(i,r,o){var t=o?i.column<=r.column:i.column<r.column;return i.row<r.row||i.row==r.row&&t}function h(i,r,o){var t=i.action=="insert",e=(t?1:-1)*(i.end.row-i.start.row),n=(t?1:-1)*(i.end.column-i.start.column),s=i.start,g=t?s:i.end;return a(r,s,o)?{row:r.row,column:r.column}:a(g,r,!o)?{row:r.row+e,column:r.column+(r.row==g.row?n:0)}:{row:s.row,column:s.column}}p.Anchor=x}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(f,p,Se){var D=f("./lib/oop"),_=f("./apply_delta").applyDelta,x=f("./lib/event_emitter").EventEmitter,a=f("./range").Range,h=f("./anchor").Anchor,i=function(){function r(o){this.$lines=[""],o.length===0?this.$lines=[""]:Array.isArray(o)?this.insertMergedLines({row:0,column:0},o):this.insert({row:0,column:0},o)}return r.prototype.setValue=function(o){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},o||"")},r.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},r.prototype.createAnchor=function(o,t){return new h(this,o,t)},r.prototype.$detectNewLine=function(o){var t=o.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:`
|
188
188
|
`,this._signal("changeNewLineMode")},r.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
|
189
189
|
`;case"unix":return`
|
190
190
|
`;default:return this.$autoNewLine||`
|
191
191
|
`}},r.prototype.setNewLineMode=function(o){this.$newLineMode!==o&&(this.$newLineMode=o,this._signal("changeNewLineMode"))},r.prototype.getNewLineMode=function(){return this.$newLineMode},r.prototype.isNewLine=function(o){return o==`\r
|
192
192
|
`||o=="\r"||o==`
|
193
|
-
`},r.prototype.getLine=function(o){return this.$lines[o]||""},r.prototype.getLines=function(o,t){return this.$lines.slice(o,t+1)},r.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},r.prototype.getLength=function(){return this.$lines.length},r.prototype.getTextRange=function(o){return this.getLinesForRange(o).join(this.getNewLineCharacter())},r.prototype.getLinesForRange=function(o){var t;if(o.start.row===o.end.row)t=[this.getLine(o.start.row).substring(o.start.column,o.end.column)];else{t=this.getLines(o.start.row,o.end.row),t[0]=(t[0]||"").substring(o.start.column);var e=t.length-1;o.end.row-o.start.row==e&&(t[e]=t[e].substring(0,o.end.column))}return t},r.prototype.insertLines=function(o,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(o,t)},r.prototype.removeLines=function(o,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(o,t)},r.prototype.insertNewLine=function(o){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(o,["",""])},r.prototype.insert=function(o,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(o,this.$split(t))},r.prototype.insertInLine=function(o,t){var e=this.clippedPos(o.row,o.column),n=this.pos(o.row,o.column+t.length);return this.applyDelta({start:e,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},r.prototype.clippedPos=function(o,t){var e=this.getLength();o===void 0?o=e:o<0?o=0:o>=e&&(o=e-1,t=void 0);var n=this.getLine(o);return t==null&&(t=n.length),t=Math.min(Math.max(t,0),n.length),{row:o,column:t}},r.prototype.clonePos=function(o){return{row:o.row,column:o.column}},r.prototype.pos=function(o,t){return{row:o,column:t}},r.prototype.$clipPosition=function(o){var t=this.getLength();return o.row>=t?(o.row=Math.max(0,t-1),o.column=this.getLine(t-1).length):(o.row=Math.max(0,o.row),o.column=Math.min(Math.max(o.column,0),this.getLine(o.row).length)),o},r.prototype.insertFullLines=function(o,t){o=Math.min(Math.max(o,0),this.getLength());var e=0;o<this.getLength()?(t=t.concat([""]),e=0):(t=[""].concat(t),o--,e=this.$lines[o].length),this.insertMergedLines({row:o,column:e},t)},r.prototype.insertMergedLines=function(o,t){var e=this.clippedPos(o.row,o.column),n={row:e.row+t.length-1,column:(t.length==1?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:n,action:"insert",lines:t}),this.clonePos(n)},r.prototype.remove=function(o){var t=this.clippedPos(o.start.row,o.start.column),e=this.clippedPos(o.end.row,o.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},r.prototype.removeInLine=function(o,t,e){var n=this.clippedPos(o,t),s=this.clippedPos(o,e);return this.applyDelta({start:n,end:s,action:"remove",lines:this.getLinesForRange({start:n,end:s})},!0),this.clonePos(n)},r.prototype.removeFullLines=function(o,t){o=Math.min(Math.max(0,o),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var e=t==this.getLength()-1&&o>0,n=t<this.getLength()-1,s=e?o-1:o,f=e?this.getLine(s).length:0,m=n?t+1:t,A=n?0:this.getLine(m).length,E=new a(s,f,m,A),S=this.$lines.slice(o,t+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),S},r.prototype.removeNewLine=function(o){o<this.getLength()-1&&o>=0&&this.applyDelta({start:this.pos(o,this.getLine(o).length),end:this.pos(o+1,0),action:"remove",lines:["",""]})},r.prototype.replace=function(o,t){if(o instanceof a||(o=a.fromPoints(o.start,o.end)),t.length===0&&o.isEmpty())return o.start;if(t==this.getTextRange(o))return o.end;this.remove(o);var e;return t?e=this.insert(o.start,t):e=o.start,e},r.prototype.applyDeltas=function(o){for(var t=0;t<o.length;t++)this.applyDelta(o[t])},r.prototype.revertDeltas=function(o){for(var t=o.length-1;t>=0;t--)this.revertDelta(o[t])},r.prototype.applyDelta=function(o,t){var e=o.action=="insert";(e?o.lines.length<=1&&!o.lines[0]:!a.comparePoints(o.start,o.end))||(e&&o.lines.length>2e4?this.$splitAndapplyLargeDelta(o,2e4):(_(this.$lines,o,t),this._signal("change",o)))},r.prototype.$safeApplyDelta=function(o){var t=this.$lines.length;(o.action=="remove"&&o.start.row<t&&o.end.row<t||o.action=="insert"&&o.start.row<=t)&&this.applyDelta(o)},r.prototype.$splitAndapplyLargeDelta=function(o,t){for(var e=o.lines,n=e.length-t+1,s=o.start.row,f=o.start.column,m=0,A=0;m<n;m=A){A+=t-1;var E=e.slice(m,A);E.push(""),this.applyDelta({start:this.pos(s+m,f),end:this.pos(s+A,f=0),action:o.action,lines:E},!0)}o.lines=e.slice(m),o.start.row=s+m,o.start.column=f,this.applyDelta(o,!0)},r.prototype.revertDelta=function(o){this.$safeApplyDelta({start:this.clonePos(o.start),end:this.clonePos(o.end),action:o.action=="insert"?"remove":"insert",lines:o.lines.slice()})},r.prototype.indexToPosition=function(o,t){for(var e=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=t||0,f=e.length;s<f;s++)if(o-=e[s].length+n,o<0)return{row:s,column:o+e[s].length+n};return{row:f-1,column:o+e[f-1].length+n}},r.prototype.positionToIndex=function(o,t){for(var e=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=0,f=Math.min(o.row,e.length),m=t||0;m<f;++m)s+=e[m].length+n;return s+o.column},r.prototype.$split=function(o){return o.split(/\r\n|\r|\n/)},r}();i.prototype.$autoNewLine="",i.prototype.$newLineMode="auto",D.implement(i.prototype,x),p.Document=i}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(g,p,Se){var D=g("./lib/oop"),_=g("./lib/event_emitter").EventEmitter,x=function(){function a(h,i){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=h;var r=this;this.$worker=function(){if(r.running){for(var o=new Date,t=r.currentLine,e=-1,n=r.doc,s=t;r.lines[t];)t++;var f=n.getLength(),m=0;for(r.running=!1;t<f;){r.$tokenizeRow(t),e=t;do t++;while(r.lines[t]);if(m++,m%5===0&&new Date-o>20){r.running=setTimeout(r.$worker,20);break}}r.currentLine=t,e==-1&&(e=t),s<=e&&r.fireUpdateEvent(s,e)}}}return a.prototype.setTokenizer=function(h){this.tokenizer=h,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(h){this.doc=h,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(h,i){var r={first:h,last:i};this._signal("update",{data:r})},a.prototype.start=function(h){this.currentLine=Math.min(h||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)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(h){var i=h.start.row,r=h.end.row-i;if(r===0)this.lines[i]=null;else if(h.action=="remove")this.lines.splice(i,r+1,null),this.states.splice(i,r+1,null);else{var o=Array(r+1);o.unshift(i,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(i,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(h){return this.lines[h]||this.$tokenizeRow(h)},a.prototype.getState=function(h){return this.currentLine==h&&this.$tokenizeRow(h),this.states[h]||"start"},a.prototype.$tokenizeRow=function(h){var i=this.doc.getLine(h),r=this.states[h-1],o=this.tokenizer.getLineTokens(i,r,h);return this.states[h]+""!=o.state+""?(this.states[h]=o.state,this.lines[h+1]=null,this.currentLine>h+1&&(this.currentLine=h+1)):this.currentLine==h&&(this.currentLine=h+1),this.lines[h]=o.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();D.implement(x.prototype,_),p.BackgroundTokenizer=x}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(g,p,Se){var D=g("./lib/lang"),_=g("./range").Range,x=function(){function a(h,i,r){r===void 0&&(r="text"),this.setRegexp(h),this.clazz=i,this.type=r,this.docLen=0}return a.prototype.setRegexp=function(h){this.regExp+""!=h+""&&(this.regExp=h,this.cache=[])},a.prototype.update=function(h,i,r,o){if(this.regExp){for(var t=o.firstRow,e=o.lastRow,n={},s=r.$editor.$search,f=s.$isMultilineSearch(r.$editor.getLastSearchOptions()),m=t;m<=e;m++){var A=this.cache[m];if(A==null||r.getValue().length!=this.docLen){if(f){A=[];var E=s.$multiLineForward(r,this.regExp,m,e);if(E){var S=E.endRow<=e?E.endRow-1:e;S>m&&(m=S),A.push(new _(E.startRow,E.startCol,E.endRow,E.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=D.getMatchOffsets(r.getLine(m),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function(se){return new _(m,se.offset,m,se.offset+se.length)});this.cache[m]=A.length?A:""}if(A.length!==0)for(var C=A.length;C--;){var q=A[C].toScreenRange(r),Be=q.toString();n[Be]||(n[Be]=!0,i.drawSingleLineMarker(h,q,this.clazz,o))}}this.docLen=r.getValue().length}},a}();x.prototype.MAX_RANGES=500,p.SearchHighlight=x}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(g,p,Se){var D=function(){function S(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return S.prototype.addSession=function(C){this.$session=C},S.prototype.add=function(C,q,Be){if(!this.$fromUndo&&C!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),q===!1||!this.lastDeltas){this.lastDeltas=[];var se=this.$undoStack.length;se>this.$undoDepth-1&&this.$undoStack.splice(0,se-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),C.id=this.$rev=++this.$maxRev}(C.action=="remove"||C.action=="insert")&&(this.$lastDelta=C),this.lastDeltas.push(C)}},S.prototype.addSelection=function(C,q){this.selections.push({value:C,rev:q||this.$rev})},S.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},S.prototype.markIgnored=function(C,q){q==null&&(q=this.$rev+1);for(var Be=this.$undoStack,se=Be.length;se--;){var j=Be[se][0];if(j.id<=C)break;j.id<q&&(j.ignore=!0)}this.lastDeltas=null},S.prototype.getSelection=function(C,q){for(var Be=this.selections,se=Be.length;se--;){var j=Be[se];if(j.rev<C)return q&&(j=Be[se+1]),j}},S.prototype.getRevision=function(){return this.$rev},S.prototype.getDeltas=function(C,q){q==null&&(q=this.$rev+1);for(var Be=this.$undoStack,se=null,j=0,ct=Be.length;ct--;){var G=Be[ct][0];if(G.id<q&&!se&&(se=ct+1),G.id<=C){j=ct+1;break}}return Be.slice(j,se)},S.prototype.getChangedRanges=function(C,q){q==null&&(q=this.$rev+1)},S.prototype.getChangedLines=function(C,q){q==null&&(q=this.$rev+1)},S.prototype.undo=function(C,q){this.lastDeltas=null;var Be=this.$undoStack;if(_(Be,Be.length)){C||(C=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var se=Be.pop(),j=null;return se&&(j=C.undoChanges(se,q),this.$redoStack.push(se),this.$syncRev()),this.$fromUndo=!1,j}},S.prototype.redo=function(C,q){if(this.lastDeltas=null,C||(C=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var Be=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,Be),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(ct){ct[0].id=++this.$maxRev},this)}var se=this.$redoStack.pop(),j=null;return se&&(j=C.redoChanges(se,q),this.$undoStack.push(se),this.$syncRev()),this.$fromUndo=!1,j},S.prototype.$syncRev=function(){var C=this.$undoStack,q=C[C.length-1],Be=q&&q[0].id||0;this.$redoStackBaseRev=Be,this.$rev=Be},S.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=[]},S.prototype.canUndo=function(){return this.$undoStack.length>0},S.prototype.canRedo=function(){return this.$redoStack.length>0},S.prototype.bookmark=function(C){C==null&&(C=this.$rev),this.mark=C},S.prototype.isAtBookmark=function(){return this.$rev===this.mark},S.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},S.prototype.fromJSON=function(C){this.reset(),this.$undoStack=C.$undoStack,this.$redoStack=C.$redoStack},S.prototype.$prettyPrint=function(C){return C?r(C):r(this.$undoStack)+`
|
193
|
+
`},r.prototype.getLine=function(o){return this.$lines[o]||""},r.prototype.getLines=function(o,t){return this.$lines.slice(o,t+1)},r.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},r.prototype.getLength=function(){return this.$lines.length},r.prototype.getTextRange=function(o){return this.getLinesForRange(o).join(this.getNewLineCharacter())},r.prototype.getLinesForRange=function(o){var t;if(o.start.row===o.end.row)t=[this.getLine(o.start.row).substring(o.start.column,o.end.column)];else{t=this.getLines(o.start.row,o.end.row),t[0]=(t[0]||"").substring(o.start.column);var e=t.length-1;o.end.row-o.start.row==e&&(t[e]=t[e].substring(0,o.end.column))}return t},r.prototype.insertLines=function(o,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(o,t)},r.prototype.removeLines=function(o,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(o,t)},r.prototype.insertNewLine=function(o){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(o,["",""])},r.prototype.insert=function(o,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(o,this.$split(t))},r.prototype.insertInLine=function(o,t){var e=this.clippedPos(o.row,o.column),n=this.pos(o.row,o.column+t.length);return this.applyDelta({start:e,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},r.prototype.clippedPos=function(o,t){var e=this.getLength();o===void 0?o=e:o<0?o=0:o>=e&&(o=e-1,t=void 0);var n=this.getLine(o);return t==null&&(t=n.length),t=Math.min(Math.max(t,0),n.length),{row:o,column:t}},r.prototype.clonePos=function(o){return{row:o.row,column:o.column}},r.prototype.pos=function(o,t){return{row:o,column:t}},r.prototype.$clipPosition=function(o){var t=this.getLength();return o.row>=t?(o.row=Math.max(0,t-1),o.column=this.getLine(t-1).length):(o.row=Math.max(0,o.row),o.column=Math.min(Math.max(o.column,0),this.getLine(o.row).length)),o},r.prototype.insertFullLines=function(o,t){o=Math.min(Math.max(o,0),this.getLength());var e=0;o<this.getLength()?(t=t.concat([""]),e=0):(t=[""].concat(t),o--,e=this.$lines[o].length),this.insertMergedLines({row:o,column:e},t)},r.prototype.insertMergedLines=function(o,t){var e=this.clippedPos(o.row,o.column),n={row:e.row+t.length-1,column:(t.length==1?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:n,action:"insert",lines:t}),this.clonePos(n)},r.prototype.remove=function(o){var t=this.clippedPos(o.start.row,o.start.column),e=this.clippedPos(o.end.row,o.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},r.prototype.removeInLine=function(o,t,e){var n=this.clippedPos(o,t),s=this.clippedPos(o,e);return this.applyDelta({start:n,end:s,action:"remove",lines:this.getLinesForRange({start:n,end:s})},!0),this.clonePos(n)},r.prototype.removeFullLines=function(o,t){o=Math.min(Math.max(0,o),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var e=t==this.getLength()-1&&o>0,n=t<this.getLength()-1,s=e?o-1:o,g=e?this.getLine(s).length:0,m=n?t+1:t,A=n?0:this.getLine(m).length,E=new a(s,g,m,A),S=this.$lines.slice(o,t+1);return this.applyDelta({start:E.start,end:E.end,action:"remove",lines:this.getLinesForRange(E)}),S},r.prototype.removeNewLine=function(o){o<this.getLength()-1&&o>=0&&this.applyDelta({start:this.pos(o,this.getLine(o).length),end:this.pos(o+1,0),action:"remove",lines:["",""]})},r.prototype.replace=function(o,t){if(o instanceof a||(o=a.fromPoints(o.start,o.end)),t.length===0&&o.isEmpty())return o.start;if(t==this.getTextRange(o))return o.end;this.remove(o);var e;return t?e=this.insert(o.start,t):e=o.start,e},r.prototype.applyDeltas=function(o){for(var t=0;t<o.length;t++)this.applyDelta(o[t])},r.prototype.revertDeltas=function(o){for(var t=o.length-1;t>=0;t--)this.revertDelta(o[t])},r.prototype.applyDelta=function(o,t){var e=o.action=="insert";(e?o.lines.length<=1&&!o.lines[0]:!a.comparePoints(o.start,o.end))||(e&&o.lines.length>2e4?this.$splitAndapplyLargeDelta(o,2e4):(_(this.$lines,o,t),this._signal("change",o)))},r.prototype.$safeApplyDelta=function(o){var t=this.$lines.length;(o.action=="remove"&&o.start.row<t&&o.end.row<t||o.action=="insert"&&o.start.row<=t)&&this.applyDelta(o)},r.prototype.$splitAndapplyLargeDelta=function(o,t){for(var e=o.lines,n=e.length-t+1,s=o.start.row,g=o.start.column,m=0,A=0;m<n;m=A){A+=t-1;var E=e.slice(m,A);E.push(""),this.applyDelta({start:this.pos(s+m,g),end:this.pos(s+A,g=0),action:o.action,lines:E},!0)}o.lines=e.slice(m),o.start.row=s+m,o.start.column=g,this.applyDelta(o,!0)},r.prototype.revertDelta=function(o){this.$safeApplyDelta({start:this.clonePos(o.start),end:this.clonePos(o.end),action:o.action=="insert"?"remove":"insert",lines:o.lines.slice()})},r.prototype.indexToPosition=function(o,t){for(var e=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=t||0,g=e.length;s<g;s++)if(o-=e[s].length+n,o<0)return{row:s,column:o+e[s].length+n};return{row:g-1,column:o+e[g-1].length+n}},r.prototype.positionToIndex=function(o,t){for(var e=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,s=0,g=Math.min(o.row,e.length),m=t||0;m<g;++m)s+=e[m].length+n;return s+o.column},r.prototype.$split=function(o){return o.split(/\r\n|\r|\n/)},r}();i.prototype.$autoNewLine="",i.prototype.$newLineMode="auto",D.implement(i.prototype,x),p.Document=i}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(f,p,Se){var D=f("./lib/oop"),_=f("./lib/event_emitter").EventEmitter,x=function(){function a(h,i){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=h;var r=this;this.$worker=function(){if(r.running){for(var o=new Date,t=r.currentLine,e=-1,n=r.doc,s=t;r.lines[t];)t++;var g=n.getLength(),m=0;for(r.running=!1;t<g;){r.$tokenizeRow(t),e=t;do t++;while(r.lines[t]);if(m++,m%5===0&&new Date-o>20){r.running=setTimeout(r.$worker,20);break}}r.currentLine=t,e==-1&&(e=t),s<=e&&r.fireUpdateEvent(s,e)}}}return a.prototype.setTokenizer=function(h){this.tokenizer=h,this.lines=[],this.states=[],this.start(0)},a.prototype.setDocument=function(h){this.doc=h,this.lines=[],this.states=[],this.stop()},a.prototype.fireUpdateEvent=function(h,i){var r={first:h,last:i};this._signal("update",{data:r})},a.prototype.start=function(h){this.currentLine=Math.min(h||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)},a.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},a.prototype.$updateOnChange=function(h){var i=h.start.row,r=h.end.row-i;if(r===0)this.lines[i]=null;else if(h.action=="remove")this.lines.splice(i,r+1,null),this.states.splice(i,r+1,null);else{var o=Array(r+1);o.unshift(i,1),this.lines.splice.apply(this.lines,o),this.states.splice.apply(this.states,o)}this.currentLine=Math.min(i,this.currentLine,this.doc.getLength()),this.stop()},a.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},a.prototype.getTokens=function(h){return this.lines[h]||this.$tokenizeRow(h)},a.prototype.getState=function(h){return this.currentLine==h&&this.$tokenizeRow(h),this.states[h]||"start"},a.prototype.$tokenizeRow=function(h){var i=this.doc.getLine(h),r=this.states[h-1],o=this.tokenizer.getLineTokens(i,r,h);return this.states[h]+""!=o.state+""?(this.states[h]=o.state,this.lines[h+1]=null,this.currentLine>h+1&&(this.currentLine=h+1)):this.currentLine==h&&(this.currentLine=h+1),this.lines[h]=o.tokens},a.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},a}();D.implement(x.prototype,_),p.BackgroundTokenizer=x}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(f,p,Se){var D=f("./lib/lang"),_=f("./range").Range,x=function(){function a(h,i,r){r===void 0&&(r="text"),this.setRegexp(h),this.clazz=i,this.type=r,this.docLen=0}return a.prototype.setRegexp=function(h){this.regExp+""!=h+""&&(this.regExp=h,this.cache=[])},a.prototype.update=function(h,i,r,o){if(this.regExp){for(var t=o.firstRow,e=o.lastRow,n={},s=r.$editor.$search,g=s.$isMultilineSearch(r.$editor.getLastSearchOptions()),m=t;m<=e;m++){var A=this.cache[m];if(A==null||r.getValue().length!=this.docLen){if(g){A=[];var E=s.$multiLineForward(r,this.regExp,m,e);if(E){var S=E.endRow<=e?E.endRow-1:e;S>m&&(m=S),A.push(new _(E.startRow,E.startCol,E.endRow,E.endCol))}A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES))}else A=D.getMatchOffsets(r.getLine(m),this.regExp),A.length>this.MAX_RANGES&&(A=A.slice(0,this.MAX_RANGES)),A=A.map(function(se){return new _(m,se.offset,m,se.offset+se.length)});this.cache[m]=A.length?A:""}if(A.length!==0)for(var C=A.length;C--;){var q=A[C].toScreenRange(r),Be=q.toString();n[Be]||(n[Be]=!0,i.drawSingleLineMarker(h,q,this.clazz,o))}}this.docLen=r.getValue().length}},a}();x.prototype.MAX_RANGES=500,p.SearchHighlight=x}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(f,p,Se){var D=function(){function S(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return S.prototype.addSession=function(C){this.$session=C},S.prototype.add=function(C,q,Be){if(!this.$fromUndo&&C!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),q===!1||!this.lastDeltas){this.lastDeltas=[];var se=this.$undoStack.length;se>this.$undoDepth-1&&this.$undoStack.splice(0,se-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),C.id=this.$rev=++this.$maxRev}(C.action=="remove"||C.action=="insert")&&(this.$lastDelta=C),this.lastDeltas.push(C)}},S.prototype.addSelection=function(C,q){this.selections.push({value:C,rev:q||this.$rev})},S.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},S.prototype.markIgnored=function(C,q){q==null&&(q=this.$rev+1);for(var Be=this.$undoStack,se=Be.length;se--;){var j=Be[se][0];if(j.id<=C)break;j.id<q&&(j.ignore=!0)}this.lastDeltas=null},S.prototype.getSelection=function(C,q){for(var Be=this.selections,se=Be.length;se--;){var j=Be[se];if(j.rev<C)return q&&(j=Be[se+1]),j}},S.prototype.getRevision=function(){return this.$rev},S.prototype.getDeltas=function(C,q){q==null&&(q=this.$rev+1);for(var Be=this.$undoStack,se=null,j=0,ct=Be.length;ct--;){var G=Be[ct][0];if(G.id<q&&!se&&(se=ct+1),G.id<=C){j=ct+1;break}}return Be.slice(j,se)},S.prototype.getChangedRanges=function(C,q){q==null&&(q=this.$rev+1)},S.prototype.getChangedLines=function(C,q){q==null&&(q=this.$rev+1)},S.prototype.undo=function(C,q){this.lastDeltas=null;var Be=this.$undoStack;if(_(Be,Be.length)){C||(C=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var se=Be.pop(),j=null;return se&&(j=C.undoChanges(se,q),this.$redoStack.push(se),this.$syncRev()),this.$fromUndo=!1,j}},S.prototype.redo=function(C,q){if(this.lastDeltas=null,C||(C=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var Be=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);E(this.$redoStack,Be),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(ct){ct[0].id=++this.$maxRev},this)}var se=this.$redoStack.pop(),j=null;return se&&(j=C.redoChanges(se,q),this.$undoStack.push(se),this.$syncRev()),this.$fromUndo=!1,j},S.prototype.$syncRev=function(){var C=this.$undoStack,q=C[C.length-1],Be=q&&q[0].id||0;this.$redoStackBaseRev=Be,this.$rev=Be},S.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=[]},S.prototype.canUndo=function(){return this.$undoStack.length>0},S.prototype.canRedo=function(){return this.$redoStack.length>0},S.prototype.bookmark=function(C){C==null&&(C=this.$rev),this.mark=C},S.prototype.isAtBookmark=function(){return this.$rev===this.mark},S.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},S.prototype.fromJSON=function(C){this.reset(),this.$undoStack=C.$undoStack,this.$redoStack=C.$redoStack},S.prototype.$prettyPrint=function(C){return C?r(C):r(this.$undoStack)+`
|
194
194
|
---
|
195
|
-
`+r(this.$redoStack)},S}();D.prototype.hasUndo=D.prototype.canUndo,D.prototype.hasRedo=D.prototype.canRedo,D.prototype.isClean=D.prototype.isAtBookmark,D.prototype.markClean=D.prototype.bookmark;function _(S,C){for(var q=C;q--;){var Be=S[q];if(Be&&!Be[0].ignore){for(;q<C-1;){var se=e(S[q],S[q+1]);S[q]=se[0],S[q+1]=se[1],q++}return!0}}}var x=
|
195
|
+
`+r(this.$redoStack)},S}();D.prototype.hasUndo=D.prototype.canUndo,D.prototype.hasRedo=D.prototype.canRedo,D.prototype.isClean=D.prototype.isAtBookmark,D.prototype.markClean=D.prototype.bookmark;function _(S,C){for(var q=C;q--;){var Be=S[q];if(Be&&!Be[0].ignore){for(;q<C-1;){var se=e(S[q],S[q+1]);S[q]=se[0],S[q+1]=se[1],q++}return!0}}}var x=f("./range").Range,a=x.comparePoints;x.comparePoints;function h(S){return{row:S.row,column:S.column}}function i(S){return{start:h(S.start),end:h(S.end),action:S.action,lines:S.lines.slice()}}function r(S){if(S=S||this,Array.isArray(S))return S.map(r).join(`
|
196
196
|
`);var C="";return S.action?(C=S.action=="insert"?"+":"-",C+="["+S.lines+"]"):S.value&&(Array.isArray(S.value)?C=S.value.map(o).join(`
|
197
|
-
`):C=o(S.value)),S.start&&(C+=o(S)),(S.id||S.rev)&&(C+=" ("+(S.id||S.rev)+")"),C}function o(S){return S.start.row+":"+S.start.column+"=>"+S.end.row+":"+S.end.column}function t(S,C){var q=S.action=="insert",Be=C.action=="insert";if(q&&Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.start,S.start)<=0)s(S,C,1);else return null;else if(q&&!Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.end,S.start)<=0)s(S,C,-1);else return null;else if(!q&&Be)if(a(C.start,S.start)>=0)s(C,S,1);else if(a(C.start,S.start)<=0)s(S,C,1);else return null;else if(!q&&!Be)if(a(C.start,S.start)>=0)s(C,S,1);else if(a(C.end,S.start)<=0)s(S,C,-1);else return null;return[C,S]}function e(S,C){for(var q=S.length;q--;)for(var Be=0;Be<C.length;Be++)if(!t(S[q],C[Be])){for(;q<S.length;){for(;Be--;)t(C[Be],S[q]);Be=C.length,q++}return[S,C]}return S.selectionBefore=C.selectionBefore=S.selectionAfter=C.selectionAfter=null,[C,S]}function n(S,C){var q=S.action=="insert",Be=C.action=="insert";if(q&&Be)a(S.start,C.start)<0?s(C,S,1):s(S,C,1);else if(q&&!Be)a(S.start,C.end)>=0?s(S,C,-1):(a(S.start,C.start)<=0||s(S,x.fromPoints(C.start,S.start),-1),s(C,S,1));else if(!q&&Be)a(C.start,S.end)>=0?s(C,S,-1):(a(C.start,S.start)<=0||s(C,x.fromPoints(S.start,C.start),-1),s(S,C,1));else if(!q&&!Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.end,S.start)<=0)s(S,C,-1);else{var se,j;return a(S.start,C.start)<0&&(se=S,S=m(S,C.start)),a(S.end,C.end)>0&&(j=m(S,C.end)),
|
198
|
-
`)},x.prototype.idxToPosition=function(a){for(var h=0,i=0;i<this.folds.length;i++){var r=this.folds[i];if(a-=r.start.column-h,a<0)return{row:r.start.row,column:r.start.column+a};if(a-=r.placeholder.length,a<0)return r.start;h=r.end.column}return{row:this.end.row,column:this.end.column+a}},x}();p.FoldLine=_}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(g,p,Se){var D=g("./range").Range,_=D.comparePoints,x=function(){function a(){this.ranges=[],this.$bias=1}return a.prototype.pointIndex=function(h,i,r){for(var o=this.ranges,t=r||0;t<o.length;t++){var e=o[t],n=_(h,e.end);if(!(n>0)){var s=_(h,e.start);return n===0?i&&s!==0?-t-2:t:s>0||s===0&&!i?t:-t-1}}return-t-1},a.prototype.add=function(h){var i=!h.isEmpty(),r=this.pointIndex(h.start,i);r<0&&(r=-r-1);var o=this.pointIndex(h.end,i,r);return o<0?o=-o-1:o++,this.ranges.splice(r,o-r,h)},a.prototype.addList=function(h){for(var i=[],r=h.length;r--;)i.push.apply(i,this.add(h[r]));return i},a.prototype.substractPoint=function(h){var i=this.pointIndex(h);if(i>=0)return this.ranges.splice(i,1)},a.prototype.merge=function(){var h=[],i=this.ranges;i=i.sort(function(n,s){return _(n.start,s.start)});for(var r=i[0],o,t=1;t<i.length;t++){o=r,r=i[t];var e=_(o.end,r.start);e<0||e==0&&!o.isEmpty()&&!r.isEmpty()||(_(o.end,r.end)<0&&(o.end.row=r.end.row,o.end.column=r.end.column),i.splice(t,1),h.push(r),r=o,t--)}return this.ranges=i,h},a.prototype.contains=function(h,i){return this.pointIndex({row:h,column:i})>=0},a.prototype.containsPoint=function(h){return this.pointIndex(h)>=0},a.prototype.rangeAtPoint=function(h){var i=this.pointIndex(h);if(i>=0)return this.ranges[i]},a.prototype.clipRows=function(h,i){var r=this.ranges;if(r[0].start.row>i||r[r.length-1].start.row<h)return[];var o=this.pointIndex({row:h,column:0});o<0&&(o=-o-1);var t=this.pointIndex({row:i,column:0},o);t<0&&(t=-t-1);for(var e=[],n=o;n<t;n++)e.push(r[n]);return e},a.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},a.prototype.attach=function(h){this.session&&this.detach(),this.session=h,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},a.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},a.prototype.$onChange=function(h){for(var i=h.start,r=h.end,o=i.row,t=r.row,e=this.ranges,n=0,s=e.length;n<s;n++){var f=e[n];if(f.end.row>=o)break}if(h.action=="insert")for(var m=t-o,A=-i.column+r.column;n<s;n++){var f=e[n];if(f.start.row>o)break;if(f.start.row==o&&f.start.column>=i.column&&(f.start.column==i.column&&this.$bias<=0||(f.start.column+=A,f.start.row+=m)),f.end.row==o&&f.end.column>=i.column){if(f.end.column==i.column&&this.$bias<0)continue;f.end.column==i.column&&A>0&&n<s-1&&f.end.column>f.start.column&&f.end.column==e[n+1].start.column&&(f.end.column-=A),f.end.column+=A,f.end.row+=m}}else for(var m=o-t,A=i.column-r.column;n<s;n++){var f=e[n];if(f.start.row>t)break;f.end.row<t&&(o<f.end.row||o==f.end.row&&i.column<f.end.column)?(f.end.row=o,f.end.column=i.column):f.end.row==t?f.end.column<=r.column?(m||f.end.column>i.column)&&(f.end.column=i.column,f.end.row=i.row):(f.end.column+=A,f.end.row+=m):f.end.row>t&&(f.end.row+=m),f.start.row<t&&(o<f.start.row||o==f.start.row&&i.column<f.start.column)?(f.start.row=o,f.start.column=i.column):f.start.row==t?f.start.column<=r.column?(m||f.start.column>i.column)&&(f.start.column=i.column,f.start.row=i.row):(f.start.column+=A,f.start.row+=m):f.start.row>t&&(f.start.row+=m)}if(m!=0&&n<s)for(;n<s;n++){var f=e[n];f.start.row+=m,f.end.row+=m}},a}();x.prototype.comparePoints=_,p.RangeList=x}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(g,p,Se){var D=this&&this.__extends||function(){var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(n[f]=s[f])},o(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");o(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_=g("../range_list").RangeList,x=function(o){D(t,o);function t(e,n){var s=o.call(this)||this;return s.foldLine=null,s.placeholder=n,s.range=e,s.start=e.start,s.end=e.end,s.sameRow=e.start.row==e.end.row,s.subFolds=s.ranges=[],s}return t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(n){n.setFoldLine(e)})},t.prototype.clone=function(){var e=this.range.clone(),n=new t(e,this.placeholder);return this.subFolds.forEach(function(s){n.subFolds.push(s.clone())}),n.collapseChildren=this.collapseChildren,n},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){h(e,this.start);for(var A=e.start.row,E=e.start.column,n=0,s=-1;n<this.subFolds.length&&(s=this.subFolds[n].range.compare(A,E),s==1);n++);var f=this.subFolds[n],m=0;if(s==0){if(f.range.containsRange(e))return f.addSubFold(e);m=1}for(var A=e.range.end.row,E=e.range.end.column,S=n,s=-1;S<this.subFolds.length&&(s=this.subFolds[S].range.compare(A,E),s==1);S++);s==0&&S++;for(var C=this.subFolds.splice(n,S-n,e),q=s==0?C.length-1:C.length,Be=m;Be<q;Be++)e.addSubFold(C[Be]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return r(e,this.start)},t}(_);function a(o,t){o.row-=t.row,o.row==0&&(o.column-=t.column)}function h(o,t){a(o.start,t),a(o.end,t)}function i(o,t){o.row==0&&(o.column+=t.column),o.row+=t.row}function r(o,t){i(o.start,t),i(o.end,t)}p.Fold=x}),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(g,p,Se){var D=g("../range").Range,_=g("./fold_line").FoldLine,x=g("./fold").Fold,a=g("../token_iterator").TokenIterator,h=g("../mouse/mouse_event").MouseEvent;function i(){this.getFoldAt=function(r,o,t){var e=this.getFoldLine(r);if(!e)return null;for(var n=e.folds,s=0;s<n.length;s++){var f=n[s].range;if(f.contains(r,o)){if(t==1&&f.isEnd(r,o)&&!f.isEmpty())continue;if(t==-1&&f.isStart(r,o)&&!f.isEmpty())continue;return n[s]}}},this.getFoldsInRange=function(r){var o=r.start,t=r.end,e=this.$foldData,n=[];o.column+=1,t.column-=1;for(var s=0;s<e.length;s++){var f=e[s].range.compareRange(r);if(f!=2){if(f==-2)break;for(var m=e[s].folds,A=0;A<m.length;A++){var E=m[A];if(f=E.range.compareRange(r),f==-2)break;if(f==2)continue;if(f==42)break;n.push(E)}}}return o.column-=1,t.column+=1,n},this.getFoldsInRangeList=function(r){if(Array.isArray(r)){var o=[];r.forEach(function(t){o=o.concat(this.getFoldsInRange(t))},this)}else var o=this.getFoldsInRange(r);return o},this.getAllFolds=function(){for(var r=[],o=this.$foldData,t=0;t<o.length;t++)for(var e=0;e<o[t].folds.length;e++)r.push(o[t].folds[e]);return r},this.getFoldStringAt=function(r,o,t,e){if(e=e||this.getFoldLine(r),!e)return null;for(var n={end:{column:0}},s,f,m=0;m<e.folds.length;m++){f=e.folds[m];var A=f.range.compareEnd(r,o);if(A==-1){s=this.getLine(f.start.row).substring(n.end.column,f.start.column);break}else if(A===0)return null;n=f}return s||(s=this.getLine(f.start.row).substring(n.end.column)),t==-1?s.substring(0,o-n.end.column):t==1?s.substring(o-n.end.column):s},this.getFoldLine=function(r,o){var t=this.$foldData,e=0;for(o&&(e=t.indexOf(o)),e==-1&&(e=0),e;e<t.length;e++){var n=t[e];if(n.start.row<=r&&n.end.row>=r)return n;if(n.end.row>r)return null}return null},this.getNextFoldLine=function(r,o){var t=this.$foldData,e=0;for(o&&(e=t.indexOf(o)),e==-1&&(e=0),e;e<t.length;e++){var n=t[e];if(n.end.row>=r)return n}return null},this.getFoldedRowCount=function(r,o){for(var t=this.$foldData,e=o-r+1,n=0;n<t.length;n++){var s=t[n],f=s.end.row,m=s.start.row;if(f>=o){m<o&&(m>=r?e-=o-m:e=0);break}else f>=r&&(m>=r?e-=f-m:e-=f-r+1)}return e},this.$addFoldLine=function(r){return this.$foldData.push(r),this.$foldData.sort(function(o,t){return o.start.row-t.start.row}),r},this.addFold=function(r,o){var t=this.$foldData,e=!1,n;r instanceof x?n=r:(n=new x(o,r),n.collapseChildren=o.collapseChildren),this.$clipRangeToDocument(n.range);var s=n.start.row,f=n.start.column,m=n.end.row,A=n.end.column,E=this.getFoldAt(s,f,1),S=this.getFoldAt(m,A,-1);if(E&&S==E)return E.addSubFold(n);E&&!E.range.isStart(s,f)&&this.removeFold(E),S&&!S.range.isEnd(m,A)&&this.removeFold(S);var C=this.getFoldsInRange(n.range);C.length>0&&(this.removeFolds(C),n.collapseChildren||C.forEach(function(j){n.addSubFold(j)}));for(var q=0;q<t.length;q++){var Be=t[q];if(m==Be.start.row){Be.addFold(n),e=!0;break}else if(s==Be.end.row){if(Be.addFold(n),e=!0,!n.sameRow){var se=t[q+1];if(se&&se.start.row==m){Be.merge(se);break}}break}else if(m<=Be.start.row)break}return e||(Be=this.$addFoldLine(new _(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(Be.start.row,Be.start.row):this.$updateRowLengthCache(Be.start.row,Be.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(r){r.forEach(function(o){this.addFold(o)},this)},this.removeFold=function(r){var o=r.foldLine,t=o.start.row,e=o.end.row,n=this.$foldData,s=o.folds;if(s.length==1)n.splice(n.indexOf(o),1);else if(o.range.isEnd(r.end.row,r.end.column))s.pop(),o.end.row=s[s.length-1].end.row,o.end.column=s[s.length-1].end.column;else if(o.range.isStart(r.start.row,r.start.column))s.shift(),o.start.row=s[0].start.row,o.start.column=s[0].start.column;else if(r.sameRow)s.splice(s.indexOf(r),1);else{var f=o.split(r.start.row,r.start.column);s=f.folds,s.shift(),f.start.row=s[0].start.row,f.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(t,e):this.$updateRowLengthCache(t,e)),this.$modified=!0,this._signal("changeFold",{data:r,action:"remove"})},this.removeFolds=function(r){for(var o=[],t=0;t<r.length;t++)o.push(r[t]);o.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(r){this.removeFold(r),r.subFolds.forEach(function(o){r.restoreRange(o),this.addFold(o)},this),r.collapseChildren>0&&this.foldAll(r.start.row+1,r.end.row,r.collapseChildren-1),r.subFolds=[]},this.expandFolds=function(r){r.forEach(function(o){this.expandFold(o)},this)},this.unfold=function(r,o){var t,e;if(r==null)t=new D(0,0,this.getLength(),0),o==null&&(o=!0);else if(typeof r=="number")t=new D(r,0,r,this.getLine(r).length);else if("row"in r)t=D.fromPoints(r,r);else{if(Array.isArray(r))return e=[],r.forEach(function(s){e=e.concat(this.unfold(s))},this),e;t=r}e=this.getFoldsInRangeList(t);for(var n=e;e.length==1&&D.comparePoints(e[0].start,t.start)<0&&D.comparePoints(e[0].end,t.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(t);if(o!=!1?this.removeFolds(e):this.expandFolds(e),n.length)return n},this.isRowFolded=function(r,o){return!!this.getFoldLine(r,o)},this.getRowFoldEnd=function(r,o){var t=this.getFoldLine(r,o);return t?t.end.row:r},this.getRowFoldStart=function(r,o){var t=this.getFoldLine(r,o);return t?t.start.row:r},this.getFoldDisplayLine=function(r,o,t,e,n){e==null&&(e=r.start.row),n==null&&(n=0),o==null&&(o=r.end.row),t==null&&(t=this.getLine(o).length);var s=this.doc,f="";return r.walk(function(m,A,E,S){if(!(A<e)){if(A==e){if(E<n)return;S=Math.max(n,S)}m!=null?f+=m:f+=s.getLine(A).substring(S,E)}},o,t),f},this.getDisplayLine=function(r,o,t,e){var n=this.getFoldLine(r);if(n)return this.getFoldDisplayLine(n,r,o,t,e);var s;return s=this.doc.getLine(r),s.substring(e||0,o||s.length)},this.$cloneFoldData=function(){var r=[];return r=this.$foldData.map(function(o){var t=o.folds.map(function(e){return e.clone()});return new _(r,t)}),r},this.toggleFold=function(r){var o=this.selection,t=o.getRange(),e,n;if(t.isEmpty()){var s=t.start;if(e=this.getFoldAt(s.row,s.column),e){this.expandFold(e);return}else if(r){var f=this.getFoldLine(s.row);f&&this.expandFolds(f.folds);return}else(n=this.findMatchingBracket(s))?t.comparePoint(n)==1?t.end=n:(t.start=n,t.start.column++,t.end.column--):(n=this.findMatchingBracket({row:s.row,column:s.column+1}))?(t.comparePoint(n)==1?t.end=n:t.start=n,t.start.column++):t=this.getCommentFoldRange(s.row,s.column)||t}else{var m=this.getFoldsInRange(t);if(r&&m.length){this.expandFolds(m);return}else m.length==1&&(e=m[0])}if(e||(e=this.getFoldAt(t.start.row,t.start.column)),e&&e.range.toString()==t.toString()){this.expandFold(e);return}var A="...";if(!t.isMultiLine()){if(A=this.getTextRange(t),A.length<4)return;A=A.trim().substring(0,2)+".."}this.addFold(A,t)},this.getCommentFoldRange=function(r,o,t){var e=new a(this,r,o),n=e.getCurrentToken(),s=n&&n.type;if(n&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s=="comment"&&(s+="|doc-start|\\.doc");var f=new RegExp(s),m=new D;if(t!=1){do n=e.stepBackward();while(n&&f.test(n.type));n=e.stepForward()}m.start.row=e.getCurrentTokenRow(),m.start.column=e.getCurrentTokenColumn()+n.value.length,e=new a(this,r,o);var A=this.getState(e.$row);if(t!=-1){var E=-1;do if(n=e.stepForward(),E==-1){var S=this.getState(e.$row);A.toString()!==S.toString()&&(E=e.$row)}else if(e.$row>E)break;while(n&&f.test(n.type));n=e.stepBackward()}else n=e.getCurrentToken();return m.end.row=e.getCurrentTokenRow(),m.end.column=e.getCurrentTokenColumn(),m.start.row==m.end.row&&m.start.column>m.end.column?void 0:m}},this.foldAll=function(r,o,t,e){t==null&&(t=1e5);var n=this.foldWidgets;if(n){o=o||this.getLength(),r=r||0;for(var s=r;s<o;s++)if(n[s]==null&&(n[s]=this.getFoldWidget(s)),n[s]=="start"&&!(e&&!e(s))){var f=this.getFoldWidgetRange(s);f&&f.isMultiLine()&&f.end.row<=o&&f.start.row>=r&&(s=f.end.row,f.collapseChildren=t,this.addFold("...",f))}}},this.foldToLevel=function(r){for(this.foldAll();r-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(o){for(var t=r.getTokens(o),e=0;e<t.length;e++){var n=t[e];if(!(n.type=="text"&&/^\s+$/.test(n.value)))return!!/comment/.test(n.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(r){if(!this.$foldStyles[r])throw new Error("invalid fold style: "+r+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=r){this.$foldStyle=r,r=="manual"&&this.unfold();var o=this.$foldMode;this.$setFolding(null),this.$setFolding(o)}},this.$setFolding=function(r){if(this.$foldMode!=r){if(this.$foldMode=r,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!r||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=r.getFoldWidget.bind(r,this,this.$foldStyle),this.getFoldWidgetRange=r.getFoldWidgetRange.bind(r,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(r,o){var t=this.foldWidgets;if(!t||o&&t[r])return{};for(var e=r-1,n;e>=0;){var s=t[e];if(s==null&&(s=t[e]=this.getFoldWidget(e)),s=="start"){var f=this.getFoldWidgetRange(e);if(n||(n=f),f&&f.end.row>=r)break}e--}return{range:e!==-1&&f,firstRange:n}},this.onFoldWidgetClick=function(r,o){o instanceof h&&(o=o.domEvent);var t={children:o.shiftKey,all:o.ctrlKey||o.metaKey,siblings:o.altKey},e=this.$toggleFoldWidget(r,t);if(!e){var n=o.target||o.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(r,o){if(this.getFoldWidget){var t=this.getFoldWidget(r),e=this.getLine(r),n=t==="end"?-1:1,s=this.getFoldAt(r,n===-1?0:e.length,n);if(s)return o.children||o.all?this.removeFold(s):this.expandFold(s),s;var f=this.getFoldWidgetRange(r,!0);if(f&&!f.isMultiLine()&&(s=this.getFoldAt(f.start.row,f.start.column,1),s&&f.isEqual(s.range)))return this.removeFold(s),s;if(o.siblings){var m=this.getParentFoldRangeData(r);if(m.range)var A=m.range.start.row+1,E=m.range.end.row;this.foldAll(A,E,o.all?1e4:0)}else o.children?(E=f?f.end.row:this.getLength(),this.foldAll(r+1,E,o.all?1e4:0)):f&&(o.all&&(f.collapseChildren=1e4),this.addFold("...",f));return f}},this.toggleFoldWidget=function(r){var o=this.selection.getCursor().row;o=this.getRowFoldStart(o);var t=this.$toggleFoldWidget(o,{});if(!t){var e=this.getParentFoldRangeData(o,!0);if(t=e.range||e.firstRange,t){o=t.start.row;var n=this.getFoldAt(o,this.getLine(o).length,1);n?this.removeFold(n):this.addFold("...",t)}}},this.updateFoldWidgets=function(r){var o=r.start.row,t=r.end.row-o;if(t===0)this.foldWidgets[o]=null;else if(r.action=="remove")this.foldWidgets.splice(o,t+1,null);else{var e=Array(t+1);e.unshift(o,1),this.foldWidgets.splice.apply(this.foldWidgets,e)}},this.tokenizerUpdateFoldWidgets=function(r){var o=r.data;o.first!=o.last&&this.foldWidgets.length>o.first&&this.foldWidgets.splice(o.first,this.foldWidgets.length)}}p.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(g,p,Se){var D=g("../token_iterator").TokenIterator,_=g("../range").Range;function x(){this.findMatchingBracket=function(a,h){if(a.column==0)return null;var i=h||this.getLine(a.row).charAt(a.column-1);if(i=="")return null;var r=i.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],a):this.$findOpeningBracket(r[2],a):null},this.getBracketRange=function(a){var h=this.getLine(a.row),i=!0,r,o=h.charAt(a.column-1),t=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(t||(o=h.charAt(a.column),a={row:a.row,column:a.column+1},t=o&&o.match(/([\(\[\{])|([\)\]\}])/),i=!1),!t)return null;if(t[1]){var e=this.$findClosingBracket(t[1],a);if(!e)return null;r=_.fromPoints(a,e),i||(r.end.column++,r.start.column--),r.cursor=r.end}else{var e=this.$findOpeningBracket(t[2],a);if(!e)return null;r=_.fromPoints(e,a),i||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(a,h){var i=this.getLine(a.row),r=/([\(\[\{])|([\)\]\}])/,o=!h&&i.charAt(a.column-1),t=o&&o.match(r);if(t||(o=(h===void 0||h)&&i.charAt(a.column),a={row:a.row,column:a.column+1},t=o&&o.match(r)),!t)return null;var e=new _(a.row,a.column-1,a.row,a.column),n=t[1]?this.$findClosingBracket(t[1],a):this.$findOpeningBracket(t[2],a);if(!n)return[e];var s=new _(n.row,n.column,n.row,n.column+1);return[e,s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,h,i){var r=this.$brackets[a],o=1,t=new D(this,h.row,h.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var n=h.column-t.getCurrentTokenColumn()-2,s=e.value;;){for(;n>=0;){var f=s.charAt(n);if(f==r){if(o-=1,o==0)return{row:t.getCurrentTokenRow(),column:n+t.getCurrentTokenColumn()}}else f==a&&(o+=1);n-=1}do e=t.stepBackward();while(e&&!i.test(e.type));if(e==null)break;s=e.value,n=s.length-1}return null}},this.$findClosingBracket=function(a,h,i){var r=this.$brackets[a],o=1,t=new D(this,h.row,h.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var n=h.column-t.getCurrentTokenColumn();;){for(var s=e.value,f=s.length;n<f;){var m=s.charAt(n);if(m==r){if(o-=1,o==0)return{row:t.getCurrentTokenRow(),column:n+t.getCurrentTokenColumn()}}else m==a&&(o+=1);n+=1}do e=t.stepForward();while(e&&!i.test(e.type));if(e==null)break;n=0}return null}},this.getMatchingTags=function(a){var h=new D(this,a.row,a.column),i=this.$findTagName(h);if(i){var r=h.stepBackward();return r.value==="<"?this.$findClosingTag(h,i):this.$findOpeningTag(h,i)}},this.$findTagName=function(a){var h=a.getCurrentToken(),i=!1,r=!1;if(h&&h.type.indexOf("tag-name")===-1)do r?h=a.stepBackward():h=a.stepForward(),h&&(h.value==="/>"?r=!0:h.type.indexOf("tag-name")!==-1&&(i=!0));while(h&&!i);return h},this.$findClosingTag=function(a,h){var i,r=h.value,o=h.value,t=0,e=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);h=a.stepForward();var n=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length),s=!1;do{if(i=h,i.type.indexOf("tag-close")!==-1&&!s){var f=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(h=a.stepForward(),h){if(h.value===">"&&!s){var f=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(h.type.indexOf("tag-name")!==-1){if(r=h.value,o===r){if(i.value==="<")t++;else if(i.value==="</"&&(t--,t<0)){a.stepBackward();var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2);h=a.stepForward();var A=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=a.stepForward()),h&&h.value===">")var E=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(o===r&&h.value==="/>"&&(t--,t<0))var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),A=m,E=A,f=new _(n.end.row,n.end.column,n.end.row,n.end.column+1)}}while(h&&t>=0);if(e&&f&&m&&E&&n&&A)return{openTag:new _(e.start.row,e.start.column,f.end.row,f.end.column),closeTag:new _(m.start.row,m.start.column,E.end.row,E.end.column),openTagName:n,closeTagName:A}},this.$findOpeningTag=function(a,h){var i=a.getCurrentToken(),r=h.value,o=0,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),n=e+2,s=new _(t,e,t,n);a.stepForward();var f=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=a.stepForward()),!(!h||h.value!==">")){var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(h=i,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),n=e+h.value.length,i=a.stepBackward(),h){if(h.type.indexOf("tag-name")!==-1){if(r===h.value)if(i.value==="<"){if(o++,o>0){var A=new _(t,e,t,n),E=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do h=a.stepForward();while(h&&h.value!==">");var S=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else i.value==="</"&&o--}else if(h.value==="/>"){for(var C=0,q=i;q;){if(q.type.indexOf("tag-name")!==-1&&q.value===r){o--;break}else if(q.value==="<")break;q=a.stepBackward(),C++}for(var Be=0;Be<C;Be++)a.stepForward()}}while(i&&o<=0);if(E&&S&&s&&m&&A&&f)return{openTag:new _(E.start.row,E.start.column,S.end.row,S.end.column),closeTag:new _(s.start.row,s.start.column,m.end.row,m.end.column),openTagName:A,closeTagName:f}}}}p.BracketMatch=x}),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(g,p,Se){var D=g("./lib/oop"),_=g("./lib/lang"),x=g("./bidihandler").BidiHandler,a=g("./config"),h=g("./lib/event_emitter").EventEmitter,i=g("./selection").Selection,r=g("./mode/text").Mode,o=g("./range").Range,t=g("./line_widgets").LineWidgets,e=g("./document").Document,n=g("./background_tokenizer").BackgroundTokenizer,s=g("./search_highlight").SearchHighlight,f=g("./undomanager").UndoManager,m=function(){function G(U,b){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"+ ++G.$uid,this.$foldData.toString=function(){return this.join(`
|
199
|
-
`)},this.$gutterCustomWidgets={},this.bgTokenizer=new n(new r().getTokenizer(),this);var w=this;this.bgTokenizer.on("update",function(W){w._signal("tokenizerUpdate",W)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof U!="object"||!U.getLine)&&(U=new e(U)),this.setDocument(U),this.selection=new i(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new x(this),a.resetOptions(this),this.setMode(b),a._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return G.prototype.$initOperationListeners=function(){var U=this;this.curOp=null,this.on("change",function(){U.curOp||(U.startOperation(),U.curOp.selectionBefore=U.$lastSel),U.curOp.docChanged=!0},!0),this.on("changeSelection",function(){U.curOp||(U.startOperation(),U.curOp.selectionBefore=U.$lastSel),U.curOp.selectionChanged=!0},!0),this.$operationResetTimer=_.delayedCall(this.endOperation.bind(this,!0))},G.prototype.startOperation=function(U){if(this.curOp){if(!U||this.curOp.command)return;this.prevOp=this.curOp}U||(U={}),this.$operationResetTimer.schedule(),this.curOp={command:U.command||{},args:U.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",U)},G.prototype.endOperation=function(U){if(this.curOp){if(U&&U.returnValue===!1){this.curOp=null,this._signal("endOperation",U);return}if(U==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var b=this.selection.toJSON();this.curOp.selectionAfter=b,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(b),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",U)}},G.prototype.setDocument=function(U){this.doc&&this.doc.off("change",this.$onChange),this.doc=U,U.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},G.prototype.getDocument=function(){return this.doc},Object.defineProperty(G.prototype,"widgetManager",{get:function(){var U=new t(this);return this.widgetManager=U,this.$editor&&U.attach(this.$editor),U},set:function(U){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:U})},enumerable:!1,configurable:!0}),G.prototype.$resetRowCache=function(U){if(!U){this.$docRowCache=[],this.$screenRowCache=[];return}var b=this.$docRowCache.length,w=this.$getRowCacheIndex(this.$docRowCache,U)+1;b>w&&(this.$docRowCache.splice(w,b),this.$screenRowCache.splice(w,b))},G.prototype.$getRowCacheIndex=function(U,b){for(var w=0,W=U.length-1;w<=W;){var ot=w+W>>1,at=U[ot];if(b>at)w=ot+1;else if(b<at)W=ot-1;else return ot}return w-1},G.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},G.prototype.onChangeFold=function(U){var b=U.data;this.$resetRowCache(b.start.row)},G.prototype.onChange=function(U){this.$modified=!0,this.$bidiHandler.onChange(U),this.$resetRowCache(U.start.row);var b=this.$updateInternalDataOnChange(U);!this.$fromUndo&&this.$undoManager&&(b&&b.length&&(this.$undoManager.add({action:"removeFolds",folds:b},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(U,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(U),this._signal("change",U)},G.prototype.onSelectionChange=function(){this._signal("changeSelection")},G.prototype.setValue=function(U){this.doc.setValue(U),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},G.fromJSON=function(U){typeof U=="string"&&(U=JSON.parse(U));var b=new
|
200
|
-
`},G.prototype.getWordRange=function(U,b){var w=this.getLine(U),W=!1;if(b>0&&(W=!!w.charAt(b-1).match(this.tokenRe)),W||(W=!!w.charAt(b).match(this.tokenRe)),W)var ot=this.tokenRe;else if(/^\s+$/.test(w.slice(b-1,b+1)))var ot=/\s/;else var ot=this.nonTokenRe;var at=b;if(at>0){do at--;while(at>=0&&w.charAt(at).match(ot));at++}for(var lt=b;lt<w.length&&w.charAt(lt).match(ot);)lt++;return new o(U,at,U,lt)},G.prototype.getAWordRange=function(U,b){for(var w=this.getWordRange(U,b),W=this.getLine(w.end.row);W.charAt(w.end.column).match(/[ \t]/);)w.end.column+=1;return w},G.prototype.setNewLineMode=function(U){this.doc.setNewLineMode(U)},G.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},G.prototype.setUseWorker=function(U){this.setOption("useWorker",U)},G.prototype.getUseWorker=function(){return this.$useWorker},G.prototype.onReloadTokenizer=function(U){var b=U.data;this.bgTokenizer.start(b.first),this._signal("tokenizerUpdate",U)},G.prototype.setMode=function(U,b){if(U&&typeof U=="object"){if(U.getTokenizer)return this.$onChangeMode(U);var w=U,W=w.path}else W=U||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new r),this.$modes[W]&&!w){this.$onChangeMode(this.$modes[W]),b&&b();return}this.$modeId=W,a.loadModule(["mode",W],(function(ot){if(!this.destroyed){if(this.$modeId!==W)return b&&b();this.$modes[W]&&!w?this.$onChangeMode(this.$modes[W]):ot&&ot.Mode&&(ot=new ot.Mode(w),w||(this.$modes[W]=ot,ot.$id=W),this.$onChangeMode(ot)),b&&b()}}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},G.prototype.$onChangeMode=function(U,b){if(b||(this.$modeId=U.$id),this.$mode!==U){var w=this.$mode;this.$mode=U,this.$stopWorker(),this.$useWorker&&this.$startWorker();var W=U.getTokenizer();if(W.on!==void 0){var ot=this.onReloadTokenizer.bind(this);W.on("update",ot)}this.bgTokenizer.setTokenizer(W),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=U.tokenRe,this.nonTokenRe=U.nonTokenRe,b||(U.attachToSession&&U.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(U.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:w,mode:U}))}},G.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},G.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(U){a.warn("Could not load worker",U),this.$worker=null}},G.prototype.getMode=function(){return this.$mode},G.prototype.setScrollTop=function(U){this.$scrollTop===U||isNaN(U)||(this.$scrollTop=U,this._signal("changeScrollTop",U))},G.prototype.getScrollTop=function(){return this.$scrollTop},G.prototype.setScrollLeft=function(U){this.$scrollLeft===U||isNaN(U)||(this.$scrollLeft=U,this._signal("changeScrollLeft",U))},G.prototype.getScrollLeft=function(){return this.$scrollLeft},G.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},G.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var U=0;return this.lineWidgets.forEach(function(b){b&&b.screenWidth>U&&(U=b.screenWidth)}),this.lineWidgetWidth=U},G.prototype.$computeWidth=function(U){if(this.$modified||U){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var b=this.doc.getAllLines(),w=this.$rowLengthCache,W=0,ot=0,at=this.$foldData[ot],lt=at?at.start.row:1/0,Mt=b.length,zt=0;zt<Mt;zt++){if(zt>lt){if(zt=at.end.row+1,zt>=Mt)break;at=this.$foldData[ot++],lt=at?at.start.row:1/0}w[zt]==null&&(w[zt]=this.$getStringScreenWidth(b[zt])[0]),w[zt]>W&&(W=w[zt])}this.screenWidth=W}},G.prototype.getLine=function(U){return this.doc.getLine(U)},G.prototype.getLines=function(U,b){return this.doc.getLines(U,b)},G.prototype.getLength=function(){return this.doc.getLength()},G.prototype.getTextRange=function(U){return this.doc.getTextRange(U||this.selection.getRange())},G.prototype.insert=function(U,b){return this.doc.insert(U,b)},G.prototype.remove=function(U){return this.doc.remove(U)},G.prototype.removeFullLines=function(U,b){return this.doc.removeFullLines(U,b)},G.prototype.undoChanges=function(U,b){if(U.length){this.$fromUndo=!0;for(var w=U.length-1;w!=-1;w--){var W=U[w];W.action=="insert"||W.action=="remove"?this.doc.revertDelta(W):W.folds&&this.addFolds(W.folds)}!b&&this.$undoSelect&&(U.selectionBefore?this.selection.fromJSON(U.selectionBefore):this.selection.setRange(this.$getUndoSelection(U,!0))),this.$fromUndo=!1}},G.prototype.redoChanges=function(U,b){if(U.length){this.$fromUndo=!0;for(var w=0;w<U.length;w++){var W=U[w];(W.action=="insert"||W.action=="remove")&&this.doc.$safeApplyDelta(W)}!b&&this.$undoSelect&&(U.selectionAfter?this.selection.fromJSON(U.selectionAfter):this.selection.setRange(this.$getUndoSelection(U,!1))),this.$fromUndo=!1}},G.prototype.setUndoSelect=function(U){this.$undoSelect=U},G.prototype.$getUndoSelection=function(U,b){function w(Mt){return b?Mt.action!=="insert":Mt.action==="insert"}for(var W,ot,at=0;at<U.length;at++){var lt=U[at];if(lt.start){if(!W){w(lt)?W=o.fromPoints(lt.start,lt.end):W=o.fromPoints(lt.start,lt.start);continue}w(lt)?(ot=lt.start,W.compare(ot.row,ot.column)==-1&&W.setStart(ot),ot=lt.end,W.compare(ot.row,ot.column)==1&&W.setEnd(ot)):(ot=lt.start,W.compare(ot.row,ot.column)==-1&&(W=o.fromPoints(lt.start,lt.start)))}}return W},G.prototype.replace=function(U,b){return this.doc.replace(U,b)},G.prototype.moveText=function(U,b,w){var W=this.getTextRange(U),ot=this.getFoldsInRange(U),at=o.fromPoints(b,b);if(!w){this.remove(U);var lt=U.start.row-U.end.row,Mt=lt?-U.end.column:U.start.column-U.end.column;Mt&&(at.start.row==U.end.row&&at.start.column>U.end.column&&(at.start.column+=Mt),at.end.row==U.end.row&&at.end.column>U.end.column&&(at.end.column+=Mt)),lt&&at.start.row>=U.end.row&&(at.start.row+=lt,at.end.row+=lt)}if(at.end=this.insert(at.start,W),ot.length){var zt=U.start,hi=at.start,lt=hi.row-zt.row,Mt=hi.column-zt.column;this.addFolds(ot.map(function(Ut){return Ut=Ut.clone(),Ut.start.row==zt.row&&(Ut.start.column+=Mt),Ut.end.row==zt.row&&(Ut.end.column+=Mt),Ut.start.row+=lt,Ut.end.row+=lt,Ut}))}return at},G.prototype.indentRows=function(U,b,w){w=w.replace(/\t/g,this.getTabString());for(var W=U;W<=b;W++)this.doc.insertInLine({row:W,column:0},w)},G.prototype.outdentRows=function(U){for(var b=U.collapseRows(),w=new o(0,0,0,0),W=this.getTabSize(),ot=b.start.row;ot<=b.end.row;++ot){var at=this.getLine(ot);w.start.row=ot,w.end.row=ot;for(var lt=0;lt<W&&at.charAt(lt)==" ";++lt);lt<W&&at.charAt(lt)==" "?(w.start.column=lt,w.end.column=lt+1):(w.start.column=0,w.end.column=lt),this.remove(w)}},G.prototype.$moveLines=function(U,b,w){if(U=this.getRowFoldStart(U),b=this.getRowFoldEnd(b),w<0){var W=this.getRowFoldStart(U+w);if(W<0)return 0;var ot=W-U}else if(w>0){var W=this.getRowFoldEnd(b+w);if(W>this.doc.getLength()-1)return 0;var ot=W-b}else{U=this.$clipRowToDocument(U),b=this.$clipRowToDocument(b);var ot=b-U+1}var at=new o(U,0,b,Number.MAX_VALUE),lt=this.getFoldsInRange(at).map(function(zt){return zt=zt.clone(),zt.start.row+=ot,zt.end.row+=ot,zt}),Mt=w==0?this.doc.getLines(U,b):this.doc.removeFullLines(U,b);return this.doc.insertFullLines(U+ot,Mt),lt.length&&this.addFolds(lt),ot},G.prototype.moveLinesUp=function(U,b){return this.$moveLines(U,b,-1)},G.prototype.moveLinesDown=function(U,b){return this.$moveLines(U,b,1)},G.prototype.duplicateLines=function(U,b){return this.$moveLines(U,b,0)},G.prototype.$clipRowToDocument=function(U){return Math.max(0,Math.min(U,this.doc.getLength()-1))},G.prototype.$clipColumnToRow=function(U,b){return b<0?0:Math.min(this.doc.getLine(U).length,b)},G.prototype.$clipPositionToDocument=function(U,b){if(b=Math.max(0,b),U<0)U=0,b=0;else{var w=this.doc.getLength();U>=w?(U=w-1,b=this.doc.getLine(w-1).length):b=Math.min(this.doc.getLine(U).length,b)}return{row:U,column:b}},G.prototype.$clipRangeToDocument=function(U){U.start.row<0?(U.start.row=0,U.start.column=0):U.start.column=this.$clipColumnToRow(U.start.row,U.start.column);var b=this.doc.getLength()-1;return U.end.row>b?(U.end.row=b,U.end.column=this.doc.getLine(b).length):U.end.column=this.$clipColumnToRow(U.end.row,U.end.column),U},G.prototype.setUseWrapMode=function(U){if(U!=this.$useWrapMode){if(this.$useWrapMode=U,this.$modified=!0,this.$resetRowCache(0),U){var b=this.getLength();this.$wrapData=Array(b),this.$updateWrapData(0,b-1)}this._signal("changeWrapMode")}},G.prototype.getUseWrapMode=function(){return this.$useWrapMode},G.prototype.setWrapLimitRange=function(U,b){(this.$wrapLimitRange.min!==U||this.$wrapLimitRange.max!==b)&&(this.$wrapLimitRange={min:U,max:b},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},G.prototype.adjustWrapLimit=function(U,b){var w=this.$wrapLimitRange;w.max<0&&(w={min:b,max:b});var W=this.$constrainWrapLimit(U,w.min,w.max);return W!=this.$wrapLimit&&W>1?(this.$wrapLimit=W,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},G.prototype.$constrainWrapLimit=function(U,b,w){return b&&(U=Math.max(b,U)),w&&(U=Math.min(w,U)),U},G.prototype.getWrapLimit=function(){return this.$wrapLimit},G.prototype.setWrapLimit=function(U){this.setWrapLimitRange(U,U)},G.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},G.prototype.$updateInternalDataOnChange=function(U){var b=this.$useWrapMode,w=U.action,W=U.start,ot=U.end,at=W.row,lt=ot.row,Mt=lt-at,zt=null;if(this.$updating=!0,Mt!=0)if(w==="remove"){this[b?"$wrapData":"$rowLengthCache"].splice(at,Mt);var hi=this.$foldData;zt=this.getFoldsInRange(U),this.removeFolds(zt);var Ht=this.getFoldLine(ot.row),Vt=0;if(Ht){Ht.addRemoveChars(ot.row,ot.column,W.column-ot.column),Ht.shiftRow(-Mt);var Ut=this.getFoldLine(at);Ut&&Ut!==Ht&&(Ut.merge(Ht),Ht=Ut),Vt=hi.indexOf(Ht)+1}for(Vt;Vt<hi.length;Vt++){var Ht=hi[Vt];Ht.start.row>=ot.row&&Ht.shiftRow(-Mt)}lt=at}else{var Jt=Array(Mt);Jt.unshift(at,0);var di=b?this.$wrapData:this.$rowLengthCache;di.splice.apply(di,Jt);var hi=this.$foldData,Ht=this.getFoldLine(at),Vt=0;if(Ht){var fi=Ht.range.compareInside(W.row,W.column);fi==0?(Ht=Ht.split(W.row,W.column),Ht&&(Ht.shiftRow(Mt),Ht.addRemoveChars(lt,0,ot.column-W.column))):fi==-1&&(Ht.addRemoveChars(at,0,ot.column-W.column),Ht.shiftRow(Mt)),Vt=hi.indexOf(Ht)+1}for(Vt;Vt<hi.length;Vt++){var Ht=hi[Vt];Ht.start.row>=at&&Ht.shiftRow(Mt)}}else{Mt=Math.abs(U.start.column-U.end.column),w==="remove"&&(zt=this.getFoldsInRange(U),this.removeFolds(zt),Mt=-Mt);var Ht=this.getFoldLine(at);Ht&&Ht.addRemoveChars(at,W.column,Mt)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,b?this.$updateWrapData(at,lt):this.$updateRowLengthCache(at,lt),zt},G.prototype.$updateRowLengthCache=function(U,b){this.$rowLengthCache[U]=null,this.$rowLengthCache[b]=null},G.prototype.$updateWrapData=function(U,b){var w=this.doc.getAllLines(),W=this.getTabSize(),ot=this.$wrapData,at=this.$wrapLimit,lt,Mt,zt=U;for(b=Math.min(b,w.length-1);zt<=b;)Mt=this.getFoldLine(zt,Mt),Mt?(lt=[],Mt.walk((function(hi,Ht,Vt,Ut){var Jt;if(hi!=null){Jt=this.$getDisplayTokens(hi,lt.length),Jt[0]=S;for(var di=1;di<Jt.length;di++)Jt[di]=C}else Jt=this.$getDisplayTokens(w[Ht].substring(Ut,Vt),lt.length);lt=lt.concat(Jt)}).bind(this),Mt.end.row,w[Mt.end.row].length+1),ot[Mt.start.row]=this.$computeWrapSplits(lt,at,W),zt=Mt.end.row+1):(lt=this.$getDisplayTokens(w[zt]),ot[zt]=this.$computeWrapSplits(lt,at,W),zt++)},G.prototype.$computeWrapSplits=function(U,b,w){if(U.length==0)return[];var W=[],ot=U.length,at=0,lt=0,Mt=this.$wrapAsCode,zt=this.$indentedSoftWrap,hi=b<=Math.max(2*w,8)||zt===!1?0:Math.floor(b/2);function Ht(){var fi=0;if(hi===0)return fi;if(zt)for(var mi=0;mi<U.length;mi++){var gi=U[mi];if(gi==Be)fi+=1;else if(gi==se)fi+=w;else{if(gi==j)continue;break}}return Mt&&zt!==!1&&(fi+=w),Math.min(fi,hi)}function Vt(fi){for(var mi=fi-at,gi=at;gi<fi;gi++){var wi=U[gi];(wi===12||wi===2)&&(mi-=1)}W.length||(Ut=Ht(),W.indent=Ut),lt+=mi,W.push(lt),at=fi}for(var Ut=0;ot-at>b-Ut;){var Jt=at+b-Ut;if(U[Jt-1]>=Be&&U[Jt]>=Be){Vt(Jt);continue}if(U[Jt]==S||U[Jt]==C){for(Jt;Jt!=at-1&&U[Jt]!=S;Jt--);if(Jt>at){Vt(Jt);continue}for(Jt=at+b,Jt;Jt<U.length&&U[Jt]==C;Jt++);if(Jt==U.length)break;Vt(Jt);continue}for(var di=Math.max(Jt-(b-(b>>2)),at-1);Jt>di&&U[Jt]<S;)Jt--;if(Mt){for(;Jt>di&&U[Jt]<S;)Jt--;for(;Jt>di&&U[Jt]==q;)Jt--}else for(;Jt>di&&U[Jt]<Be;)Jt--;if(Jt>di){Vt(++Jt);continue}Jt=at+b,U[Jt]==E&&Jt--,Vt(Jt-Ut)}return W},G.prototype.$getDisplayTokens=function(U,b){var w=[],W;b=b||0;for(var ot=0;ot<U.length;ot++){var at=U.charCodeAt(ot);if(at==9){W=this.getScreenTabSize(w.length+b),w.push(se);for(var lt=1;lt<W;lt++)w.push(j)}else at==32?w.push(Be):at>39&&at<48||at>57&&at<64?w.push(q):at>=4352&&ct(at)?w.push(A,E):w.push(A)}return w},G.prototype.$getStringScreenWidth=function(U,b,w){if(b==0)return[0,0];b==null&&(b=1/0),w=w||0;var W,ot;for(ot=0;ot<U.length&&(W=U.charCodeAt(ot),W==9?w+=this.getScreenTabSize(w):W>=4352&&ct(W)?w+=2:w+=1,!(w>b));ot++);return[w,ot]},G.prototype.getRowLength=function(U){var b=1;return this.lineWidgets&&(b+=this.lineWidgets[U]&&this.lineWidgets[U].rowCount||0),!this.$useWrapMode||!this.$wrapData[U]?b:this.$wrapData[U].length+b},G.prototype.getRowLineCount=function(U){return!this.$useWrapMode||!this.$wrapData[U]?1:this.$wrapData[U].length+1},G.prototype.getRowWrapIndent=function(U){if(this.$useWrapMode){var b=this.screenToDocumentPosition(U,Number.MAX_VALUE),w=this.$wrapData[b.row];return w.length&&w[0]<b.column?w.indent:0}else return 0},G.prototype.getScreenLastRowColumn=function(U){var b=this.screenToDocumentPosition(U,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},G.prototype.getDocumentLastRowColumn=function(U,b){var w=this.documentToScreenRow(U,b);return this.getScreenLastRowColumn(w)},G.prototype.getDocumentLastRowColumnPosition=function(U,b){var w=this.documentToScreenRow(U,b);return this.screenToDocumentPosition(w,Number.MAX_VALUE/10)},G.prototype.getRowSplitData=function(U){if(this.$useWrapMode)return this.$wrapData[U]},G.prototype.getScreenTabSize=function(U){return this.$tabSize-(U%this.$tabSize|0)},G.prototype.screenToDocumentRow=function(U,b){return this.screenToDocumentPosition(U,b).row},G.prototype.screenToDocumentColumn=function(U,b){return this.screenToDocumentPosition(U,b).column},G.prototype.screenToDocumentPosition=function(U,b,w){if(U<0)return{row:0,column:0};var W,ot=0,at=0,lt,Mt=0,zt=0,hi=this.$screenRowCache,Ht=this.$getRowCacheIndex(hi,U),Vt=hi.length;if(Vt&&Ht>=0)var Mt=hi[Ht],ot=this.$docRowCache[Ht],Ut=U>hi[Vt-1];else var Ut=!Vt;for(var Jt=this.getLength()-1,di=this.getNextFoldLine(ot),fi=di?di.start.row:1/0;Mt<=U&&(zt=this.getRowLength(ot),!(Mt+zt>U||ot>=Jt));)Mt+=zt,ot++,ot>fi&&(ot=di.end.row+1,di=this.getNextFoldLine(ot,di),fi=di?di.start.row:1/0),Ut&&(this.$docRowCache.push(ot),this.$screenRowCache.push(Mt));if(di&&di.start.row<=ot)W=this.getFoldDisplayLine(di),ot=di.start.row;else{if(Mt+zt<=U||ot>Jt)return{row:Jt,column:this.getLine(Jt).length};W=this.getLine(ot),di=null}var mi=0,gi=Math.floor(U-Mt);if(this.$useWrapMode){var wi=this.$wrapData[ot];wi&&(lt=wi[gi],gi>0&&wi.length&&(mi=wi.indent,at=wi[gi-1]||wi[wi.length-1],W=W.substring(at)))}return w!==void 0&&this.$bidiHandler.isBidiRow(Mt+gi,ot,gi)&&(b=this.$bidiHandler.offsetToCol(w)),at+=this.$getStringScreenWidth(W,b-mi)[1],this.$useWrapMode&&at>=lt&&(at=lt-1),di?di.idxToPosition(at):{row:ot,column:at}},G.prototype.documentToScreenPosition=function(U,b){if(typeof b>"u")var w=this.$clipPositionToDocument(U.row,U.column);else w=this.$clipPositionToDocument(U,b);U=w.row,b=w.column;var W=0,ot=null,at=null;at=this.getFoldAt(U,b,1),at&&(U=at.start.row,b=at.start.column);var lt,Mt=0,zt=this.$docRowCache,hi=this.$getRowCacheIndex(zt,U),Ht=zt.length;if(Ht&&hi>=0)var Mt=zt[hi],W=this.$screenRowCache[hi],Vt=U>zt[Ht-1];else var Vt=!Ht;for(var Ut=this.getNextFoldLine(Mt),Jt=Ut?Ut.start.row:1/0;Mt<U;){if(Mt>=Jt){if(lt=Ut.end.row+1,lt>U)break;Ut=this.getNextFoldLine(lt,Ut),Jt=Ut?Ut.start.row:1/0}else lt=Mt+1;W+=this.getRowLength(Mt),Mt=lt,Vt&&(this.$docRowCache.push(Mt),this.$screenRowCache.push(W))}var di="";Ut&&Mt>=Jt?(di=this.getFoldDisplayLine(Ut,U,b),ot=Ut.start.row):(di=this.getLine(U).substring(0,b),ot=U);var fi=0;if(this.$useWrapMode){var mi=this.$wrapData[ot];if(mi){for(var gi=0;di.length>=mi[gi];)W++,gi++;di=di.substring(mi[gi-1]||0,di.length),fi=gi>0?mi.indent:0}}return this.lineWidgets&&this.lineWidgets[Mt]&&this.lineWidgets[Mt].rowsAbove&&(W+=this.lineWidgets[Mt].rowsAbove),{row:W,column:fi+this.$getStringScreenWidth(di)[0]}},G.prototype.documentToScreenColumn=function(U,b){return this.documentToScreenPosition(U,b).column},G.prototype.documentToScreenRow=function(U,b){return this.documentToScreenPosition(U,b).row},G.prototype.getScreenLength=function(){var U=0,b=null;if(this.$useWrapMode)for(var ot=this.$wrapData.length,at=0,W=0,b=this.$foldData[W++],lt=b?b.start.row:1/0;at<ot;){var Mt=this.$wrapData[at];U+=Mt?Mt.length+1:1,at++,at>lt&&(at=b.end.row+1,b=this.$foldData[W++],lt=b?b.start.row:1/0)}else{U=this.getLength();for(var w=this.$foldData,W=0;W<w.length;W++)b=w[W],U-=b.end.row-b.start.row}return this.lineWidgets&&(U+=this.$getWidgetScreenLength()),U},G.prototype.$setFontMetrics=function(U){this.$enableVarChar&&(this.$getStringScreenWidth=function(b,w,W){if(w===0)return[0,0];w||(w=1/0),W=W||0;var ot,at;for(at=0;at<b.length&&(ot=b.charAt(at),ot===" "?W+=this.getScreenTabSize(W):W+=U.getCharacterWidth(ot),!(W>w));at++);return[W,at]})},G.prototype.getPrecedingCharacter=function(){var U=this.selection.getCursor();if(U.column===0)return U.row===0?"":this.doc.getNewLineCharacter();var b=this.getLine(U.row);return b[U.column-1]},G.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()},G}();m.$uid=0,m.prototype.$modes=a.$modes,m.prototype.getValue=m.prototype.toString,m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},m.prototype.$overwrite=!1,m.prototype.$mode=null,m.prototype.$modeId=null,m.prototype.$scrollTop=0,m.prototype.$scrollLeft=0,m.prototype.$wrapLimit=80,m.prototype.$useWrapMode=!1,m.prototype.$wrapLimitRange={min:null,max:null},m.prototype.lineWidgets=null,m.prototype.isFullWidth=ct,D.implement(m.prototype,h);var A=1,E=2,S=3,C=4,q=9,Be=10,se=11,j=12;function ct(G){return G<4352?!1:G>=4352&&G<=4447||G>=4515&&G<=4519||G>=4602&&G<=4607||G>=9001&&G<=9002||G>=11904&&G<=11929||G>=11931&&G<=12019||G>=12032&&G<=12245||G>=12272&&G<=12283||G>=12288&&G<=12350||G>=12353&&G<=12438||G>=12441&&G<=12543||G>=12549&&G<=12589||G>=12593&&G<=12686||G>=12688&&G<=12730||G>=12736&&G<=12771||G>=12784&&G<=12830||G>=12832&&G<=12871||G>=12880&&G<=13054||G>=13056&&G<=19903||G>=19968&&G<=42124||G>=42128&&G<=42182||G>=43360&&G<=43388||G>=44032&&G<=55203||G>=55216&&G<=55238||G>=55243&&G<=55291||G>=63744&&G<=64255||G>=65040&&G<=65049||G>=65072&&G<=65106||G>=65108&&G<=65126||G>=65128&&G<=65131||G>=65281&&G<=65376||G>=65504&&G<=65510}g("./edit_session/folding").Folding.call(m.prototype),g("./edit_session/bracket_match").BracketMatch.call(m.prototype),a.defineOptions(m.prototype,"session",{wrap:{set:function(G){if(!G||G=="off"?G=!1:G=="free"?G=!0:G=="printMargin"?G=-1:typeof G=="string"&&(G=parseInt(G,10)||!1),this.$wrap!=G)if(this.$wrap=G,!G)this.setUseWrapMode(!1);else{var U=typeof G=="number"?G:null;this.setWrapLimitRange(U,U),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(G){G=G=="auto"?this.$mode.type!="text":G!="text",G!=this.$wrapAsCode&&(this.$wrapAsCode=G,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(G){this.$useWorker=G,this.$stopWorker(),G&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(G){G=parseInt(G),G>0&&this.$tabSize!==G&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=G,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(G){this.setFoldStyle(G)},handlesSet:!0},overwrite:{set:function(G){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(G){this.doc.setNewLineMode(G)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(G){this.setMode(G)},get:function(){return this.$modeId},handlesSet:!0}}),p.EditSession=m}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(g,p,Se){var D=g("./lib/lang"),_=g("./lib/oop"),x=g("./range").Range,a=function(){function o(){this.$options={}}return o.prototype.set=function(t){return _.mixin(this.$options,t),this},o.prototype.getOptions=function(){return D.copyObject(this.$options)},o.prototype.setOptions=function(t){this.$options=t},o.prototype.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var s=null;return n.forEach(function(f,m,A,E){return s=new x(f,m,A,E),m==E&&e.start&&e.start.start&&e.skipCurrent!=!1&&s.isEqual(e.start)?(s=null,!1):!0}),s},o.prototype.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,s=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),f=[],m=e.re;if(e.$isMultiLine){var A=m.length,E=s.length-A,S;e:for(var C=m.offset||0;C<=E;C++){for(var q=0;q<A;q++)if(s[C+q].search(m[q])==-1)continue e;var Be=s[C],se=s[C+A-1],j=Be.length-Be.match(m[0])[0].length,ct=se.match(m[A-1])[0].length;S&&S.end.row===C&&S.end.column>j||(f.push(S=new x(C,j,C+A-1,ct)),A>2&&(C=C+A-2))}}else for(var G,U=0;U<s.length;U++)if(this.$isMultilineSearch(e)){var b=s.length-1;if(G=this.$multiLineForward(t,m,U,b),G){var w=G.endRow<=b?G.endRow-1:b;w>U&&(U=w),f.push(new x(G.startRow,G.startCol,G.endRow,G.endCol))}}else{G=D.getMatchOffsets(s[U],m);for(var q=0;q<G.length;q++){var W=G[q];f.push(new x(U,W.offset,U,W.offset+W.length))}}if(n){for(var ot=n.start.column,at=n.end.column,U=0,q=f.length-1;U<q&&f[U].start.column<ot&&f[U].start.row==0;)U++;for(var lt=n.end.row-n.start.row;U<q&&f[q].end.column>at&&f[q].end.row==lt;)q--;for(f=f.slice(U,q+1),U=0,q=f.length;U<q;U++)f[U].start.row+=n.start.row,f[U].end.row+=n.start.row}return f},o.prototype.parseReplaceString=function(t){for(var e={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},n="",s=0,f=t.length;s<f;s++){var m=t.charCodeAt(s);if(m===e.Backslash){if(s++,s>=f){n+="\\";break}var A=t.charCodeAt(s);switch(A){case e.Backslash:n+="\\";break;case e.n:n+=`
|
201
|
-
`;break;case e.t:n+=" ";break}continue}if(m===e.DollarSign){if(s++,s>=
|
202
|
-
`));var m=s.exec(t);if(!m||!
|
197
|
+
`):C=o(S.value)),S.start&&(C+=o(S)),(S.id||S.rev)&&(C+=" ("+(S.id||S.rev)+")"),C}function o(S){return S.start.row+":"+S.start.column+"=>"+S.end.row+":"+S.end.column}function t(S,C){var q=S.action=="insert",Be=C.action=="insert";if(q&&Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.start,S.start)<=0)s(S,C,1);else return null;else if(q&&!Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.end,S.start)<=0)s(S,C,-1);else return null;else if(!q&&Be)if(a(C.start,S.start)>=0)s(C,S,1);else if(a(C.start,S.start)<=0)s(S,C,1);else return null;else if(!q&&!Be)if(a(C.start,S.start)>=0)s(C,S,1);else if(a(C.end,S.start)<=0)s(S,C,-1);else return null;return[C,S]}function e(S,C){for(var q=S.length;q--;)for(var Be=0;Be<C.length;Be++)if(!t(S[q],C[Be])){for(;q<S.length;){for(;Be--;)t(C[Be],S[q]);Be=C.length,q++}return[S,C]}return S.selectionBefore=C.selectionBefore=S.selectionAfter=C.selectionAfter=null,[C,S]}function n(S,C){var q=S.action=="insert",Be=C.action=="insert";if(q&&Be)a(S.start,C.start)<0?s(C,S,1):s(S,C,1);else if(q&&!Be)a(S.start,C.end)>=0?s(S,C,-1):(a(S.start,C.start)<=0||s(S,x.fromPoints(C.start,S.start),-1),s(C,S,1));else if(!q&&Be)a(C.start,S.end)>=0?s(C,S,-1):(a(C.start,S.start)<=0||s(C,x.fromPoints(S.start,C.start),-1),s(S,C,1));else if(!q&&!Be)if(a(C.start,S.end)>=0)s(C,S,-1);else if(a(C.end,S.start)<=0)s(S,C,-1);else{var se,j;return a(S.start,C.start)<0&&(se=S,S=m(S,C.start)),a(S.end,C.end)>0&&(j=m(S,C.end)),g(C.end,S.start,S.end,-1),j&&!se&&(S.lines=j.lines,S.start=j.start,S.end=j.end,j=S),[C,se,j].filter(Boolean)}return[C,S]}function s(S,C,q){g(S.start,C.start,C.end,q),g(S.end,C.start,C.end,q)}function g(S,C,q,Be){S.row==(Be==1?C:q).row&&(S.column+=Be*(q.column-C.column)),S.row+=Be*(q.row-C.row)}function m(S,C){var q=S.lines,Be=S.end;S.end=h(C);var se=S.end.row-S.start.row,j=q.splice(se,q.length),ct=se?C.column:C.column-S.start.column;q.push(j[0].substring(0,ct)),j[0]=j[0].substr(ct);var G={start:h(C),end:Be,lines:j,action:S.action};return G}function A(S,C){C=i(C);for(var q=S.length;q--;){for(var Be=S[q],se=0;se<Be.length;se++){var j=Be[se],ct=n(j,C);C=ct[0],ct.length!=2&&(ct[2]?(Be.splice(se+1,1,ct[1],ct[2]),se++):ct[1]||(Be.splice(se,1),se--))}Be.length||S.splice(q,1)}return S}function E(S,C){for(var q=0;q<C.length;q++)for(var Be=C[q],se=0;se<Be.length;se++)A(S,Be[se])}p.UndoManager=D}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(f,p,Se){var D=f("../range").Range,_=function(){function x(a,h){this.foldData=a,Array.isArray(h)?this.folds=h:h=this.folds=[h];var i=h[h.length-1];this.range=new D(h[0].start.row,h[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(r){r.setFoldLine(this)},this)}return x.prototype.shiftRow=function(a){this.start.row+=a,this.end.row+=a,this.folds.forEach(function(h){h.start.row+=a,h.end.row+=a})},x.prototype.addFold=function(a){if(a.sameRow){if(a.start.row<this.startRow||a.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(a),this.folds.sort(function(h,i){return-h.range.compareEnd(i.start.row,i.start.column)}),this.range.compareEnd(a.start.row,a.start.column)>0?(this.end.row=a.end.row,this.end.column=a.end.column):this.range.compareStart(a.end.row,a.end.column)<0&&(this.start.row=a.start.row,this.start.column=a.start.column)}else if(a.start.row==this.end.row)this.folds.push(a),this.end.row=a.end.row,this.end.column=a.end.column;else if(a.end.row==this.start.row)this.folds.unshift(a),this.start.row=a.start.row,this.start.column=a.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");a.foldLine=this},x.prototype.containsRow=function(a){return a>=this.start.row&&a<=this.end.row},x.prototype.walk=function(a,h,i){var r=0,o=this.folds,t,e,n,s=!0;h==null&&(h=this.end.row,i=this.end.column);for(var g=0;g<o.length;g++){if(t=o[g],e=t.range.compareStart(h,i),e==-1){a(null,h,i,r,s);return}if(n=a(null,t.start.row,t.start.column,r,s),n=!n&&a(t.placeholder,t.start.row,t.start.column,r),n||e===0)return;s=!t.sameRow,r=t.end.column}a(null,h,i,r,s)},x.prototype.getNextFoldTo=function(a,h){for(var i,r,o=0;o<this.folds.length;o++){if(i=this.folds[o],r=i.range.compareEnd(a,h),r==-1)return{fold:i,kind:"after"};if(r===0)return{fold:i,kind:"inside"}}return null},x.prototype.addRemoveChars=function(a,h,i){var r=this.getNextFoldTo(a,h),o,t;if(r){if(o=r.fold,r.kind=="inside"&&o.start.column!=h&&o.start.row!=a)window.console&&window.console.log(a,h,o);else if(o.start.row==a){t=this.folds;var e=t.indexOf(o);for(e===0&&(this.start.column+=i),e;e<t.length;e++){if(o=t[e],o.start.column+=i,!o.sameRow)return;o.end.column+=i}this.end.column+=i}}},x.prototype.split=function(a,h){var i=this.getNextFoldTo(a,h);if(!i||i.kind=="inside")return null;var r=i.fold,o=this.folds,t=this.foldData,e=o.indexOf(r),n=o[e-1];this.end.row=n.end.row,this.end.column=n.end.column,o=o.splice(e,o.length-e);var s=new x(t,o);return t.splice(t.indexOf(this)+1,0,s),s},x.prototype.merge=function(a){for(var h=a.folds,i=0;i<h.length;i++)this.addFold(h[i]);var r=this.foldData;r.splice(r.indexOf(a),1)},x.prototype.toString=function(){var a=[this.range.toString()+": ["];return this.folds.forEach(function(h){a.push(" "+h.toString())}),a.push("]"),a.join(`
|
198
|
+
`)},x.prototype.idxToPosition=function(a){for(var h=0,i=0;i<this.folds.length;i++){var r=this.folds[i];if(a-=r.start.column-h,a<0)return{row:r.start.row,column:r.start.column+a};if(a-=r.placeholder.length,a<0)return r.start;h=r.end.column}return{row:this.end.row,column:this.end.column+a}},x}();p.FoldLine=_}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(f,p,Se){var D=f("./range").Range,_=D.comparePoints,x=function(){function a(){this.ranges=[],this.$bias=1}return a.prototype.pointIndex=function(h,i,r){for(var o=this.ranges,t=r||0;t<o.length;t++){var e=o[t],n=_(h,e.end);if(!(n>0)){var s=_(h,e.start);return n===0?i&&s!==0?-t-2:t:s>0||s===0&&!i?t:-t-1}}return-t-1},a.prototype.add=function(h){var i=!h.isEmpty(),r=this.pointIndex(h.start,i);r<0&&(r=-r-1);var o=this.pointIndex(h.end,i,r);return o<0?o=-o-1:o++,this.ranges.splice(r,o-r,h)},a.prototype.addList=function(h){for(var i=[],r=h.length;r--;)i.push.apply(i,this.add(h[r]));return i},a.prototype.substractPoint=function(h){var i=this.pointIndex(h);if(i>=0)return this.ranges.splice(i,1)},a.prototype.merge=function(){var h=[],i=this.ranges;i=i.sort(function(n,s){return _(n.start,s.start)});for(var r=i[0],o,t=1;t<i.length;t++){o=r,r=i[t];var e=_(o.end,r.start);e<0||e==0&&!o.isEmpty()&&!r.isEmpty()||(_(o.end,r.end)<0&&(o.end.row=r.end.row,o.end.column=r.end.column),i.splice(t,1),h.push(r),r=o,t--)}return this.ranges=i,h},a.prototype.contains=function(h,i){return this.pointIndex({row:h,column:i})>=0},a.prototype.containsPoint=function(h){return this.pointIndex(h)>=0},a.prototype.rangeAtPoint=function(h){var i=this.pointIndex(h);if(i>=0)return this.ranges[i]},a.prototype.clipRows=function(h,i){var r=this.ranges;if(r[0].start.row>i||r[r.length-1].start.row<h)return[];var o=this.pointIndex({row:h,column:0});o<0&&(o=-o-1);var t=this.pointIndex({row:i,column:0},o);t<0&&(t=-t-1);for(var e=[],n=o;n<t;n++)e.push(r[n]);return e},a.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},a.prototype.attach=function(h){this.session&&this.detach(),this.session=h,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},a.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},a.prototype.$onChange=function(h){for(var i=h.start,r=h.end,o=i.row,t=r.row,e=this.ranges,n=0,s=e.length;n<s;n++){var g=e[n];if(g.end.row>=o)break}if(h.action=="insert")for(var m=t-o,A=-i.column+r.column;n<s;n++){var g=e[n];if(g.start.row>o)break;if(g.start.row==o&&g.start.column>=i.column&&(g.start.column==i.column&&this.$bias<=0||(g.start.column+=A,g.start.row+=m)),g.end.row==o&&g.end.column>=i.column){if(g.end.column==i.column&&this.$bias<0)continue;g.end.column==i.column&&A>0&&n<s-1&&g.end.column>g.start.column&&g.end.column==e[n+1].start.column&&(g.end.column-=A),g.end.column+=A,g.end.row+=m}}else for(var m=o-t,A=i.column-r.column;n<s;n++){var g=e[n];if(g.start.row>t)break;g.end.row<t&&(o<g.end.row||o==g.end.row&&i.column<g.end.column)?(g.end.row=o,g.end.column=i.column):g.end.row==t?g.end.column<=r.column?(m||g.end.column>i.column)&&(g.end.column=i.column,g.end.row=i.row):(g.end.column+=A,g.end.row+=m):g.end.row>t&&(g.end.row+=m),g.start.row<t&&(o<g.start.row||o==g.start.row&&i.column<g.start.column)?(g.start.row=o,g.start.column=i.column):g.start.row==t?g.start.column<=r.column?(m||g.start.column>i.column)&&(g.start.column=i.column,g.start.row=i.row):(g.start.column+=A,g.start.row+=m):g.start.row>t&&(g.start.row+=m)}if(m!=0&&n<s)for(;n<s;n++){var g=e[n];g.start.row+=m,g.end.row+=m}},a}();x.prototype.comparePoints=_,p.RangeList=x}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(f,p,Se){var D=this&&this.__extends||function(){var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var g in s)Object.prototype.hasOwnProperty.call(s,g)&&(n[g]=s[g])},o(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");o(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_=f("../range_list").RangeList,x=function(o){D(t,o);function t(e,n){var s=o.call(this)||this;return s.foldLine=null,s.placeholder=n,s.range=e,s.start=e.start,s.end=e.end,s.sameRow=e.start.row==e.end.row,s.subFolds=s.ranges=[],s}return t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(n){n.setFoldLine(e)})},t.prototype.clone=function(){var e=this.range.clone(),n=new t(e,this.placeholder);return this.subFolds.forEach(function(s){n.subFolds.push(s.clone())}),n.collapseChildren=this.collapseChildren,n},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){h(e,this.start);for(var A=e.start.row,E=e.start.column,n=0,s=-1;n<this.subFolds.length&&(s=this.subFolds[n].range.compare(A,E),s==1);n++);var g=this.subFolds[n],m=0;if(s==0){if(g.range.containsRange(e))return g.addSubFold(e);m=1}for(var A=e.range.end.row,E=e.range.end.column,S=n,s=-1;S<this.subFolds.length&&(s=this.subFolds[S].range.compare(A,E),s==1);S++);s==0&&S++;for(var C=this.subFolds.splice(n,S-n,e),q=s==0?C.length-1:C.length,Be=m;Be<q;Be++)e.addSubFold(C[Be]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return r(e,this.start)},t}(_);function a(o,t){o.row-=t.row,o.row==0&&(o.column-=t.column)}function h(o,t){a(o.start,t),a(o.end,t)}function i(o,t){o.row==0&&(o.column+=t.column),o.row+=t.row}function r(o,t){i(o.start,t),i(o.end,t)}p.Fold=x}),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(f,p,Se){var D=f("../range").Range,_=f("./fold_line").FoldLine,x=f("./fold").Fold,a=f("../token_iterator").TokenIterator,h=f("../mouse/mouse_event").MouseEvent;function i(){this.getFoldAt=function(r,o,t){var e=this.getFoldLine(r);if(!e)return null;for(var n=e.folds,s=0;s<n.length;s++){var g=n[s].range;if(g.contains(r,o)){if(t==1&&g.isEnd(r,o)&&!g.isEmpty())continue;if(t==-1&&g.isStart(r,o)&&!g.isEmpty())continue;return n[s]}}},this.getFoldsInRange=function(r){var o=r.start,t=r.end,e=this.$foldData,n=[];o.column+=1,t.column-=1;for(var s=0;s<e.length;s++){var g=e[s].range.compareRange(r);if(g!=2){if(g==-2)break;for(var m=e[s].folds,A=0;A<m.length;A++){var E=m[A];if(g=E.range.compareRange(r),g==-2)break;if(g==2)continue;if(g==42)break;n.push(E)}}}return o.column-=1,t.column+=1,n},this.getFoldsInRangeList=function(r){if(Array.isArray(r)){var o=[];r.forEach(function(t){o=o.concat(this.getFoldsInRange(t))},this)}else var o=this.getFoldsInRange(r);return o},this.getAllFolds=function(){for(var r=[],o=this.$foldData,t=0;t<o.length;t++)for(var e=0;e<o[t].folds.length;e++)r.push(o[t].folds[e]);return r},this.getFoldStringAt=function(r,o,t,e){if(e=e||this.getFoldLine(r),!e)return null;for(var n={end:{column:0}},s,g,m=0;m<e.folds.length;m++){g=e.folds[m];var A=g.range.compareEnd(r,o);if(A==-1){s=this.getLine(g.start.row).substring(n.end.column,g.start.column);break}else if(A===0)return null;n=g}return s||(s=this.getLine(g.start.row).substring(n.end.column)),t==-1?s.substring(0,o-n.end.column):t==1?s.substring(o-n.end.column):s},this.getFoldLine=function(r,o){var t=this.$foldData,e=0;for(o&&(e=t.indexOf(o)),e==-1&&(e=0),e;e<t.length;e++){var n=t[e];if(n.start.row<=r&&n.end.row>=r)return n;if(n.end.row>r)return null}return null},this.getNextFoldLine=function(r,o){var t=this.$foldData,e=0;for(o&&(e=t.indexOf(o)),e==-1&&(e=0),e;e<t.length;e++){var n=t[e];if(n.end.row>=r)return n}return null},this.getFoldedRowCount=function(r,o){for(var t=this.$foldData,e=o-r+1,n=0;n<t.length;n++){var s=t[n],g=s.end.row,m=s.start.row;if(g>=o){m<o&&(m>=r?e-=o-m:e=0);break}else g>=r&&(m>=r?e-=g-m:e-=g-r+1)}return e},this.$addFoldLine=function(r){return this.$foldData.push(r),this.$foldData.sort(function(o,t){return o.start.row-t.start.row}),r},this.addFold=function(r,o){var t=this.$foldData,e=!1,n;r instanceof x?n=r:(n=new x(o,r),n.collapseChildren=o.collapseChildren),this.$clipRangeToDocument(n.range);var s=n.start.row,g=n.start.column,m=n.end.row,A=n.end.column,E=this.getFoldAt(s,g,1),S=this.getFoldAt(m,A,-1);if(E&&S==E)return E.addSubFold(n);E&&!E.range.isStart(s,g)&&this.removeFold(E),S&&!S.range.isEnd(m,A)&&this.removeFold(S);var C=this.getFoldsInRange(n.range);C.length>0&&(this.removeFolds(C),n.collapseChildren||C.forEach(function(j){n.addSubFold(j)}));for(var q=0;q<t.length;q++){var Be=t[q];if(m==Be.start.row){Be.addFold(n),e=!0;break}else if(s==Be.end.row){if(Be.addFold(n),e=!0,!n.sameRow){var se=t[q+1];if(se&&se.start.row==m){Be.merge(se);break}}break}else if(m<=Be.start.row)break}return e||(Be=this.$addFoldLine(new _(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(Be.start.row,Be.start.row):this.$updateRowLengthCache(Be.start.row,Be.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(r){r.forEach(function(o){this.addFold(o)},this)},this.removeFold=function(r){var o=r.foldLine,t=o.start.row,e=o.end.row,n=this.$foldData,s=o.folds;if(s.length==1)n.splice(n.indexOf(o),1);else if(o.range.isEnd(r.end.row,r.end.column))s.pop(),o.end.row=s[s.length-1].end.row,o.end.column=s[s.length-1].end.column;else if(o.range.isStart(r.start.row,r.start.column))s.shift(),o.start.row=s[0].start.row,o.start.column=s[0].start.column;else if(r.sameRow)s.splice(s.indexOf(r),1);else{var g=o.split(r.start.row,r.start.column);s=g.folds,s.shift(),g.start.row=s[0].start.row,g.start.column=s[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(t,e):this.$updateRowLengthCache(t,e)),this.$modified=!0,this._signal("changeFold",{data:r,action:"remove"})},this.removeFolds=function(r){for(var o=[],t=0;t<r.length;t++)o.push(r[t]);o.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(r){this.removeFold(r),r.subFolds.forEach(function(o){r.restoreRange(o),this.addFold(o)},this),r.collapseChildren>0&&this.foldAll(r.start.row+1,r.end.row,r.collapseChildren-1),r.subFolds=[]},this.expandFolds=function(r){r.forEach(function(o){this.expandFold(o)},this)},this.unfold=function(r,o){var t,e;if(r==null)t=new D(0,0,this.getLength(),0),o==null&&(o=!0);else if(typeof r=="number")t=new D(r,0,r,this.getLine(r).length);else if("row"in r)t=D.fromPoints(r,r);else{if(Array.isArray(r))return e=[],r.forEach(function(s){e=e.concat(this.unfold(s))},this),e;t=r}e=this.getFoldsInRangeList(t);for(var n=e;e.length==1&&D.comparePoints(e[0].start,t.start)<0&&D.comparePoints(e[0].end,t.end)>0;)this.expandFolds(e),e=this.getFoldsInRangeList(t);if(o!=!1?this.removeFolds(e):this.expandFolds(e),n.length)return n},this.isRowFolded=function(r,o){return!!this.getFoldLine(r,o)},this.getRowFoldEnd=function(r,o){var t=this.getFoldLine(r,o);return t?t.end.row:r},this.getRowFoldStart=function(r,o){var t=this.getFoldLine(r,o);return t?t.start.row:r},this.getFoldDisplayLine=function(r,o,t,e,n){e==null&&(e=r.start.row),n==null&&(n=0),o==null&&(o=r.end.row),t==null&&(t=this.getLine(o).length);var s=this.doc,g="";return r.walk(function(m,A,E,S){if(!(A<e)){if(A==e){if(E<n)return;S=Math.max(n,S)}m!=null?g+=m:g+=s.getLine(A).substring(S,E)}},o,t),g},this.getDisplayLine=function(r,o,t,e){var n=this.getFoldLine(r);if(n)return this.getFoldDisplayLine(n,r,o,t,e);var s;return s=this.doc.getLine(r),s.substring(e||0,o||s.length)},this.$cloneFoldData=function(){var r=[];return r=this.$foldData.map(function(o){var t=o.folds.map(function(e){return e.clone()});return new _(r,t)}),r},this.toggleFold=function(r){var o=this.selection,t=o.getRange(),e,n;if(t.isEmpty()){var s=t.start;if(e=this.getFoldAt(s.row,s.column),e){this.expandFold(e);return}else if(r){var g=this.getFoldLine(s.row);g&&this.expandFolds(g.folds);return}else(n=this.findMatchingBracket(s))?t.comparePoint(n)==1?t.end=n:(t.start=n,t.start.column++,t.end.column--):(n=this.findMatchingBracket({row:s.row,column:s.column+1}))?(t.comparePoint(n)==1?t.end=n:t.start=n,t.start.column++):t=this.getCommentFoldRange(s.row,s.column)||t}else{var m=this.getFoldsInRange(t);if(r&&m.length){this.expandFolds(m);return}else m.length==1&&(e=m[0])}if(e||(e=this.getFoldAt(t.start.row,t.start.column)),e&&e.range.toString()==t.toString()){this.expandFold(e);return}var A="...";if(!t.isMultiLine()){if(A=this.getTextRange(t),A.length<4)return;A=A.trim().substring(0,2)+".."}this.addFold(A,t)},this.getCommentFoldRange=function(r,o,t){var e=new a(this,r,o),n=e.getCurrentToken(),s=n&&n.type;if(n&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s=="comment"&&(s+="|doc-start|\\.doc");var g=new RegExp(s),m=new D;if(t!=1){do n=e.stepBackward();while(n&&g.test(n.type));n=e.stepForward()}m.start.row=e.getCurrentTokenRow(),m.start.column=e.getCurrentTokenColumn()+n.value.length,e=new a(this,r,o);var A=this.getState(e.$row);if(t!=-1){var E=-1;do if(n=e.stepForward(),E==-1){var S=this.getState(e.$row);A.toString()!==S.toString()&&(E=e.$row)}else if(e.$row>E)break;while(n&&g.test(n.type));n=e.stepBackward()}else n=e.getCurrentToken();return m.end.row=e.getCurrentTokenRow(),m.end.column=e.getCurrentTokenColumn(),m.start.row==m.end.row&&m.start.column>m.end.column?void 0:m}},this.foldAll=function(r,o,t,e){t==null&&(t=1e5);var n=this.foldWidgets;if(n){o=o||this.getLength(),r=r||0;for(var s=r;s<o;s++)if(n[s]==null&&(n[s]=this.getFoldWidget(s)),n[s]=="start"&&!(e&&!e(s))){var g=this.getFoldWidgetRange(s);g&&g.isMultiLine()&&g.end.row<=o&&g.start.row>=r&&(s=g.end.row,g.collapseChildren=t,this.addFold("...",g))}}},this.foldToLevel=function(r){for(this.foldAll();r-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var r=this;this.foldAll(null,null,null,function(o){for(var t=r.getTokens(o),e=0;e<t.length;e++){var n=t[e];if(!(n.type=="text"&&/^\s+$/.test(n.value)))return!!/comment/.test(n.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(r){if(!this.$foldStyles[r])throw new Error("invalid fold style: "+r+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=r){this.$foldStyle=r,r=="manual"&&this.unfold();var o=this.$foldMode;this.$setFolding(null),this.$setFolding(o)}},this.$setFolding=function(r){if(this.$foldMode!=r){if(this.$foldMode=r,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!r||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=r.getFoldWidget.bind(r,this,this.$foldStyle),this.getFoldWidgetRange=r.getFoldWidgetRange.bind(r,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(r,o){var t=this.foldWidgets;if(!t||o&&t[r])return{};for(var e=r-1,n;e>=0;){var s=t[e];if(s==null&&(s=t[e]=this.getFoldWidget(e)),s=="start"){var g=this.getFoldWidgetRange(e);if(n||(n=g),g&&g.end.row>=r)break}e--}return{range:e!==-1&&g,firstRange:n}},this.onFoldWidgetClick=function(r,o){o instanceof h&&(o=o.domEvent);var t={children:o.shiftKey,all:o.ctrlKey||o.metaKey,siblings:o.altKey},e=this.$toggleFoldWidget(r,t);if(!e){var n=o.target||o.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(r,o){if(this.getFoldWidget){var t=this.getFoldWidget(r),e=this.getLine(r),n=t==="end"?-1:1,s=this.getFoldAt(r,n===-1?0:e.length,n);if(s)return o.children||o.all?this.removeFold(s):this.expandFold(s),s;var g=this.getFoldWidgetRange(r,!0);if(g&&!g.isMultiLine()&&(s=this.getFoldAt(g.start.row,g.start.column,1),s&&g.isEqual(s.range)))return this.removeFold(s),s;if(o.siblings){var m=this.getParentFoldRangeData(r);if(m.range)var A=m.range.start.row+1,E=m.range.end.row;this.foldAll(A,E,o.all?1e4:0)}else o.children?(E=g?g.end.row:this.getLength(),this.foldAll(r+1,E,o.all?1e4:0)):g&&(o.all&&(g.collapseChildren=1e4),this.addFold("...",g));return g}},this.toggleFoldWidget=function(r){var o=this.selection.getCursor().row;o=this.getRowFoldStart(o);var t=this.$toggleFoldWidget(o,{});if(!t){var e=this.getParentFoldRangeData(o,!0);if(t=e.range||e.firstRange,t){o=t.start.row;var n=this.getFoldAt(o,this.getLine(o).length,1);n?this.removeFold(n):this.addFold("...",t)}}},this.updateFoldWidgets=function(r){var o=r.start.row,t=r.end.row-o;if(t===0)this.foldWidgets[o]=null;else if(r.action=="remove")this.foldWidgets.splice(o,t+1,null);else{var e=Array(t+1);e.unshift(o,1),this.foldWidgets.splice.apply(this.foldWidgets,e)}},this.tokenizerUpdateFoldWidgets=function(r){var o=r.data;o.first!=o.last&&this.foldWidgets.length>o.first&&this.foldWidgets.splice(o.first,this.foldWidgets.length)}}p.Folding=i}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(f,p,Se){var D=f("../token_iterator").TokenIterator,_=f("../range").Range;function x(){this.findMatchingBracket=function(a,h){if(a.column==0)return null;var i=h||this.getLine(a.row).charAt(a.column-1);if(i=="")return null;var r=i.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],a):this.$findOpeningBracket(r[2],a):null},this.getBracketRange=function(a){var h=this.getLine(a.row),i=!0,r,o=h.charAt(a.column-1),t=o&&o.match(/([\(\[\{])|([\)\]\}])/);if(t||(o=h.charAt(a.column),a={row:a.row,column:a.column+1},t=o&&o.match(/([\(\[\{])|([\)\]\}])/),i=!1),!t)return null;if(t[1]){var e=this.$findClosingBracket(t[1],a);if(!e)return null;r=_.fromPoints(a,e),i||(r.end.column++,r.start.column--),r.cursor=r.end}else{var e=this.$findOpeningBracket(t[2],a);if(!e)return null;r=_.fromPoints(e,a),i||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(a,h){var i=this.getLine(a.row),r=/([\(\[\{])|([\)\]\}])/,o=!h&&i.charAt(a.column-1),t=o&&o.match(r);if(t||(o=(h===void 0||h)&&i.charAt(a.column),a={row:a.row,column:a.column+1},t=o&&o.match(r)),!t)return null;var e=new _(a.row,a.column-1,a.row,a.column),n=t[1]?this.$findClosingBracket(t[1],a):this.$findOpeningBracket(t[2],a);if(!n)return[e];var s=new _(n.row,n.column,n.row,n.column+1);return[e,s]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(a,h,i){var r=this.$brackets[a],o=1,t=new D(this,h.row,h.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var n=h.column-t.getCurrentTokenColumn()-2,s=e.value;;){for(;n>=0;){var g=s.charAt(n);if(g==r){if(o-=1,o==0)return{row:t.getCurrentTokenRow(),column:n+t.getCurrentTokenColumn()}}else g==a&&(o+=1);n-=1}do e=t.stepBackward();while(e&&!i.test(e.type));if(e==null)break;s=e.value,n=s.length-1}return null}},this.$findClosingBracket=function(a,h,i){var r=this.$brackets[a],o=1,t=new D(this,h.row,h.column),e=t.getCurrentToken();if(e||(e=t.stepForward()),!!e){i||(i=new RegExp("(\\.?"+e.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var n=h.column-t.getCurrentTokenColumn();;){for(var s=e.value,g=s.length;n<g;){var m=s.charAt(n);if(m==r){if(o-=1,o==0)return{row:t.getCurrentTokenRow(),column:n+t.getCurrentTokenColumn()}}else m==a&&(o+=1);n+=1}do e=t.stepForward();while(e&&!i.test(e.type));if(e==null)break;n=0}return null}},this.getMatchingTags=function(a){var h=new D(this,a.row,a.column),i=this.$findTagName(h);if(i){var r=h.stepBackward();return r.value==="<"?this.$findClosingTag(h,i):this.$findOpeningTag(h,i)}},this.$findTagName=function(a){var h=a.getCurrentToken(),i=!1,r=!1;if(h&&h.type.indexOf("tag-name")===-1)do r?h=a.stepBackward():h=a.stepForward(),h&&(h.value==="/>"?r=!0:h.type.indexOf("tag-name")!==-1&&(i=!0));while(h&&!i);return h},this.$findClosingTag=function(a,h){var i,r=h.value,o=h.value,t=0,e=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);h=a.stepForward();var n=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length),s=!1;do{if(i=h,i.type.indexOf("tag-close")!==-1&&!s){var g=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(h=a.stepForward(),h){if(h.value===">"&&!s){var g=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);s=!0}if(h.type.indexOf("tag-name")!==-1){if(r=h.value,o===r){if(i.value==="<")t++;else if(i.value==="</"&&(t--,t<0)){a.stepBackward();var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2);h=a.stepForward();var A=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=a.stepForward()),h&&h.value===">")var E=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);else return}}}else if(o===r&&h.value==="/>"&&(t--,t<0))var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+2),A=m,E=A,g=new _(n.end.row,n.end.column,n.end.row,n.end.column+1)}}while(h&&t>=0);if(e&&g&&m&&E&&n&&A)return{openTag:new _(e.start.row,e.start.column,g.end.row,g.end.column),closeTag:new _(m.start.row,m.start.column,E.end.row,E.end.column),openTagName:n,closeTagName:A}},this.$findOpeningTag=function(a,h){var i=a.getCurrentToken(),r=h.value,o=0,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),n=e+2,s=new _(t,e,t,n);a.stepForward();var g=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+h.value.length);if(h.type.indexOf("tag-close")===-1&&(h=a.stepForward()),!(!h||h.value!==">")){var m=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);a.stepBackward(),a.stepBackward();do if(h=i,t=a.getCurrentTokenRow(),e=a.getCurrentTokenColumn(),n=e+h.value.length,i=a.stepBackward(),h){if(h.type.indexOf("tag-name")!==-1){if(r===h.value)if(i.value==="<"){if(o++,o>0){var A=new _(t,e,t,n),E=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1);do h=a.stepForward();while(h&&h.value!==">");var S=new _(a.getCurrentTokenRow(),a.getCurrentTokenColumn(),a.getCurrentTokenRow(),a.getCurrentTokenColumn()+1)}}else i.value==="</"&&o--}else if(h.value==="/>"){for(var C=0,q=i;q;){if(q.type.indexOf("tag-name")!==-1&&q.value===r){o--;break}else if(q.value==="<")break;q=a.stepBackward(),C++}for(var Be=0;Be<C;Be++)a.stepForward()}}while(i&&o<=0);if(E&&S&&s&&m&&A&&g)return{openTag:new _(E.start.row,E.start.column,S.end.row,S.end.column),closeTag:new _(s.start.row,s.start.column,m.end.row,m.end.column),openTagName:A,closeTagName:g}}}}p.BracketMatch=x}),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(f,p,Se){var D=f("./lib/oop"),_=f("./lib/lang"),x=f("./bidihandler").BidiHandler,a=f("./config"),h=f("./lib/event_emitter").EventEmitter,i=f("./selection").Selection,r=f("./mode/text").Mode,o=f("./range").Range,t=f("./line_widgets").LineWidgets,e=f("./document").Document,n=f("./background_tokenizer").BackgroundTokenizer,s=f("./search_highlight").SearchHighlight,g=f("./undomanager").UndoManager,m=function(){function G(U,b){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"+ ++G.$uid,this.$foldData.toString=function(){return this.join(`
|
199
|
+
`)},this.$gutterCustomWidgets={},this.bgTokenizer=new n(new r().getTokenizer(),this);var w=this;this.bgTokenizer.on("update",function(W){w._signal("tokenizerUpdate",W)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof U!="object"||!U.getLine)&&(U=new e(U)),this.setDocument(U),this.selection=new i(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new x(this),a.resetOptions(this),this.setMode(b),a._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return G.prototype.$initOperationListeners=function(){var U=this;this.curOp=null,this.on("change",function(){U.curOp||(U.startOperation(),U.curOp.selectionBefore=U.$lastSel),U.curOp.docChanged=!0},!0),this.on("changeSelection",function(){U.curOp||(U.startOperation(),U.curOp.selectionBefore=U.$lastSel),U.curOp.selectionChanged=!0},!0),this.$operationResetTimer=_.delayedCall(this.endOperation.bind(this,!0))},G.prototype.startOperation=function(U){if(this.curOp){if(!U||this.curOp.command)return;this.prevOp=this.curOp}U||(U={}),this.$operationResetTimer.schedule(),this.curOp={command:U.command||{},args:U.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",U)},G.prototype.endOperation=function(U){if(this.curOp){if(U&&U.returnValue===!1){this.curOp=null,this._signal("endOperation",U);return}if(U==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var b=this.selection.toJSON();this.curOp.selectionAfter=b,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(b),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",U)}},G.prototype.setDocument=function(U){this.doc&&this.doc.off("change",this.$onChange),this.doc=U,U.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},G.prototype.getDocument=function(){return this.doc},Object.defineProperty(G.prototype,"widgetManager",{get:function(){var U=new t(this);return this.widgetManager=U,this.$editor&&U.attach(this.$editor),U},set:function(U){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:U})},enumerable:!1,configurable:!0}),G.prototype.$resetRowCache=function(U){if(!U){this.$docRowCache=[],this.$screenRowCache=[];return}var b=this.$docRowCache.length,w=this.$getRowCacheIndex(this.$docRowCache,U)+1;b>w&&(this.$docRowCache.splice(w,b),this.$screenRowCache.splice(w,b))},G.prototype.$getRowCacheIndex=function(U,b){for(var w=0,W=U.length-1;w<=W;){var ot=w+W>>1,at=U[ot];if(b>at)w=ot+1;else if(b<at)W=ot-1;else return ot}return w-1},G.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},G.prototype.onChangeFold=function(U){var b=U.data;this.$resetRowCache(b.start.row)},G.prototype.onChange=function(U){this.$modified=!0,this.$bidiHandler.onChange(U),this.$resetRowCache(U.start.row);var b=this.$updateInternalDataOnChange(U);!this.$fromUndo&&this.$undoManager&&(b&&b.length&&(this.$undoManager.add({action:"removeFolds",folds:b},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(U,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(U),this._signal("change",U)},G.prototype.onSelectionChange=function(){this._signal("changeSelection")},G.prototype.setValue=function(U){this.doc.setValue(U),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},G.fromJSON=function(U){typeof U=="string"&&(U=JSON.parse(U));var b=new g;b.$undoStack=U.history.undo,b.$redoStack=U.history.redo,b.mark=U.history.mark,b.$rev=U.history.rev;var w=new G(U.value);return U.folds.forEach(function(W){w.addFold("...",o.fromPoints(W.start,W.end))}),w.setAnnotations(U.annotations),w.setBreakpoints(U.breakpoints),w.setMode(U.mode),w.setScrollLeft(U.scrollLeft),w.setScrollTop(U.scrollTop),w.setUndoManager(b),w.selection.fromJSON(U.selection),w},G.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(U){return U.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},G.prototype.toString=function(){return this.doc.getValue()},G.prototype.getSelection=function(){return this.selection},G.prototype.getState=function(U){return this.bgTokenizer.getState(U)},G.prototype.getTokens=function(U){return this.bgTokenizer.getTokens(U)},G.prototype.getTokenAt=function(U,b){var w=this.bgTokenizer.getTokens(U),W,ot=0;if(b==null){var at=w.length-1;ot=this.getLine(U).length}else for(var at=0;at<w.length&&(ot+=w[at].value.length,!(ot>=b));at++);return W=w[at],W?(W.index=at,W.start=ot-W.value.length,W):null},G.prototype.setUndoManager=function(U){if(this.$undoManager=U,this.$informUndoManager&&this.$informUndoManager.cancel(),U){var b=this;U.addSession(this),this.$syncInformUndoManager=function(){b.$informUndoManager.cancel(),b.mergeUndoDeltas=!1},this.$informUndoManager=_.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},G.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},G.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},G.prototype.getTabString=function(){return this.getUseSoftTabs()?_.stringRepeat(" ",this.getTabSize()):" "},G.prototype.setUseSoftTabs=function(U){this.setOption("useSoftTabs",U)},G.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},G.prototype.setTabSize=function(U){this.setOption("tabSize",U)},G.prototype.getTabSize=function(){return this.$tabSize},G.prototype.isTabStop=function(U){return this.$useSoftTabs&&U.column%this.$tabSize===0},G.prototype.setNavigateWithinSoftTabs=function(U){this.setOption("navigateWithinSoftTabs",U)},G.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},G.prototype.setOverwrite=function(U){this.setOption("overwrite",U)},G.prototype.getOverwrite=function(){return this.$overwrite},G.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},G.prototype.addGutterDecoration=function(U,b){this.$decorations[U]||(this.$decorations[U]=""),this.$decorations[U]+=" "+b,this._signal("changeBreakpoint",{})},G.prototype.removeGutterCustomWidget=function(U){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(U)},G.prototype.addGutterCustomWidget=function(U,b){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(U,b)},G.prototype.removeGutterDecoration=function(U,b){this.$decorations[U]=(this.$decorations[U]||"").replace(" "+b,""),this._signal("changeBreakpoint",{})},G.prototype.getBreakpoints=function(){return this.$breakpoints},G.prototype.setBreakpoints=function(U){this.$breakpoints=[];for(var b=0;b<U.length;b++)this.$breakpoints[U[b]]="ace_breakpoint";this._signal("changeBreakpoint",{})},G.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},G.prototype.setBreakpoint=function(U,b){b===void 0&&(b="ace_breakpoint"),b?this.$breakpoints[U]=b:delete this.$breakpoints[U],this._signal("changeBreakpoint",{})},G.prototype.clearBreakpoint=function(U){delete this.$breakpoints[U],this._signal("changeBreakpoint",{})},G.prototype.addMarker=function(U,b,w,W){var ot=this.$markerId++,at={range:U,type:w||"line",renderer:typeof w=="function"?w:null,clazz:b,inFront:!!W,id:ot};return W?(this.$frontMarkers[ot]=at,this._signal("changeFrontMarker")):(this.$backMarkers[ot]=at,this._signal("changeBackMarker")),ot},G.prototype.addDynamicMarker=function(U,b){if(U.update){var w=this.$markerId++;return U.id=w,U.inFront=!!b,b?(this.$frontMarkers[w]=U,this._signal("changeFrontMarker")):(this.$backMarkers[w]=U,this._signal("changeBackMarker")),U}},G.prototype.removeMarker=function(U){var b=this.$frontMarkers[U]||this.$backMarkers[U];if(b){var w=b.inFront?this.$frontMarkers:this.$backMarkers;delete w[U],this._signal(b.inFront?"changeFrontMarker":"changeBackMarker")}},G.prototype.getMarkers=function(U){return U?this.$frontMarkers:this.$backMarkers},G.prototype.highlight=function(U){if(!this.$searchHighlight){var b=new s(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(b)}this.$searchHighlight.setRegexp(U)},G.prototype.highlightLines=function(U,b,w,W){typeof b!="number"&&(w=b,b=U),w||(w="ace_step");var ot=new o(U,0,b,1/0);return ot.id=this.addMarker(ot,w,"fullLine",W),ot},G.prototype.setAnnotations=function(U){this.$annotations=U,this._signal("changeAnnotation",{})},G.prototype.getAnnotations=function(){return this.$annotations||[]},G.prototype.clearAnnotations=function(){this.setAnnotations([])},G.prototype.$detectNewLine=function(U){var b=U.match(/^.*?(\r?\n)/m);b?this.$autoNewLine=b[1]:this.$autoNewLine=`
|
200
|
+
`},G.prototype.getWordRange=function(U,b){var w=this.getLine(U),W=!1;if(b>0&&(W=!!w.charAt(b-1).match(this.tokenRe)),W||(W=!!w.charAt(b).match(this.tokenRe)),W)var ot=this.tokenRe;else if(/^\s+$/.test(w.slice(b-1,b+1)))var ot=/\s/;else var ot=this.nonTokenRe;var at=b;if(at>0){do at--;while(at>=0&&w.charAt(at).match(ot));at++}for(var lt=b;lt<w.length&&w.charAt(lt).match(ot);)lt++;return new o(U,at,U,lt)},G.prototype.getAWordRange=function(U,b){for(var w=this.getWordRange(U,b),W=this.getLine(w.end.row);W.charAt(w.end.column).match(/[ \t]/);)w.end.column+=1;return w},G.prototype.setNewLineMode=function(U){this.doc.setNewLineMode(U)},G.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},G.prototype.setUseWorker=function(U){this.setOption("useWorker",U)},G.prototype.getUseWorker=function(){return this.$useWorker},G.prototype.onReloadTokenizer=function(U){var b=U.data;this.bgTokenizer.start(b.first),this._signal("tokenizerUpdate",U)},G.prototype.setMode=function(U,b){if(U&&typeof U=="object"){if(U.getTokenizer)return this.$onChangeMode(U);var w=U,W=w.path}else W=U||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new r),this.$modes[W]&&!w){this.$onChangeMode(this.$modes[W]),b&&b();return}this.$modeId=W,a.loadModule(["mode",W],(function(ot){if(!this.destroyed){if(this.$modeId!==W)return b&&b();this.$modes[W]&&!w?this.$onChangeMode(this.$modes[W]):ot&&ot.Mode&&(ot=new ot.Mode(w),w||(this.$modes[W]=ot,ot.$id=W),this.$onChangeMode(ot)),b&&b()}}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},G.prototype.$onChangeMode=function(U,b){if(b||(this.$modeId=U.$id),this.$mode!==U){var w=this.$mode;this.$mode=U,this.$stopWorker(),this.$useWorker&&this.$startWorker();var W=U.getTokenizer();if(W.on!==void 0){var ot=this.onReloadTokenizer.bind(this);W.on("update",ot)}this.bgTokenizer.setTokenizer(W),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=U.tokenRe,this.nonTokenRe=U.nonTokenRe,b||(U.attachToSession&&U.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(U.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:w,mode:U}))}},G.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},G.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(U){a.warn("Could not load worker",U),this.$worker=null}},G.prototype.getMode=function(){return this.$mode},G.prototype.setScrollTop=function(U){this.$scrollTop===U||isNaN(U)||(this.$scrollTop=U,this._signal("changeScrollTop",U))},G.prototype.getScrollTop=function(){return this.$scrollTop},G.prototype.setScrollLeft=function(U){this.$scrollLeft===U||isNaN(U)||(this.$scrollLeft=U,this._signal("changeScrollLeft",U))},G.prototype.getScrollLeft=function(){return this.$scrollLeft},G.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},G.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var U=0;return this.lineWidgets.forEach(function(b){b&&b.screenWidth>U&&(U=b.screenWidth)}),this.lineWidgetWidth=U},G.prototype.$computeWidth=function(U){if(this.$modified||U){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var b=this.doc.getAllLines(),w=this.$rowLengthCache,W=0,ot=0,at=this.$foldData[ot],lt=at?at.start.row:1/0,Mt=b.length,zt=0;zt<Mt;zt++){if(zt>lt){if(zt=at.end.row+1,zt>=Mt)break;at=this.$foldData[ot++],lt=at?at.start.row:1/0}w[zt]==null&&(w[zt]=this.$getStringScreenWidth(b[zt])[0]),w[zt]>W&&(W=w[zt])}this.screenWidth=W}},G.prototype.getLine=function(U){return this.doc.getLine(U)},G.prototype.getLines=function(U,b){return this.doc.getLines(U,b)},G.prototype.getLength=function(){return this.doc.getLength()},G.prototype.getTextRange=function(U){return this.doc.getTextRange(U||this.selection.getRange())},G.prototype.insert=function(U,b){return this.doc.insert(U,b)},G.prototype.remove=function(U){return this.doc.remove(U)},G.prototype.removeFullLines=function(U,b){return this.doc.removeFullLines(U,b)},G.prototype.undoChanges=function(U,b){if(U.length){this.$fromUndo=!0;for(var w=U.length-1;w!=-1;w--){var W=U[w];W.action=="insert"||W.action=="remove"?this.doc.revertDelta(W):W.folds&&this.addFolds(W.folds)}!b&&this.$undoSelect&&(U.selectionBefore?this.selection.fromJSON(U.selectionBefore):this.selection.setRange(this.$getUndoSelection(U,!0))),this.$fromUndo=!1}},G.prototype.redoChanges=function(U,b){if(U.length){this.$fromUndo=!0;for(var w=0;w<U.length;w++){var W=U[w];(W.action=="insert"||W.action=="remove")&&this.doc.$safeApplyDelta(W)}!b&&this.$undoSelect&&(U.selectionAfter?this.selection.fromJSON(U.selectionAfter):this.selection.setRange(this.$getUndoSelection(U,!1))),this.$fromUndo=!1}},G.prototype.setUndoSelect=function(U){this.$undoSelect=U},G.prototype.$getUndoSelection=function(U,b){function w(Mt){return b?Mt.action!=="insert":Mt.action==="insert"}for(var W,ot,at=0;at<U.length;at++){var lt=U[at];if(lt.start){if(!W){w(lt)?W=o.fromPoints(lt.start,lt.end):W=o.fromPoints(lt.start,lt.start);continue}w(lt)?(ot=lt.start,W.compare(ot.row,ot.column)==-1&&W.setStart(ot),ot=lt.end,W.compare(ot.row,ot.column)==1&&W.setEnd(ot)):(ot=lt.start,W.compare(ot.row,ot.column)==-1&&(W=o.fromPoints(lt.start,lt.start)))}}return W},G.prototype.replace=function(U,b){return this.doc.replace(U,b)},G.prototype.moveText=function(U,b,w){var W=this.getTextRange(U),ot=this.getFoldsInRange(U),at=o.fromPoints(b,b);if(!w){this.remove(U);var lt=U.start.row-U.end.row,Mt=lt?-U.end.column:U.start.column-U.end.column;Mt&&(at.start.row==U.end.row&&at.start.column>U.end.column&&(at.start.column+=Mt),at.end.row==U.end.row&&at.end.column>U.end.column&&(at.end.column+=Mt)),lt&&at.start.row>=U.end.row&&(at.start.row+=lt,at.end.row+=lt)}if(at.end=this.insert(at.start,W),ot.length){var zt=U.start,hi=at.start,lt=hi.row-zt.row,Mt=hi.column-zt.column;this.addFolds(ot.map(function(Ut){return Ut=Ut.clone(),Ut.start.row==zt.row&&(Ut.start.column+=Mt),Ut.end.row==zt.row&&(Ut.end.column+=Mt),Ut.start.row+=lt,Ut.end.row+=lt,Ut}))}return at},G.prototype.indentRows=function(U,b,w){w=w.replace(/\t/g,this.getTabString());for(var W=U;W<=b;W++)this.doc.insertInLine({row:W,column:0},w)},G.prototype.outdentRows=function(U){for(var b=U.collapseRows(),w=new o(0,0,0,0),W=this.getTabSize(),ot=b.start.row;ot<=b.end.row;++ot){var at=this.getLine(ot);w.start.row=ot,w.end.row=ot;for(var lt=0;lt<W&&at.charAt(lt)==" ";++lt);lt<W&&at.charAt(lt)==" "?(w.start.column=lt,w.end.column=lt+1):(w.start.column=0,w.end.column=lt),this.remove(w)}},G.prototype.$moveLines=function(U,b,w){if(U=this.getRowFoldStart(U),b=this.getRowFoldEnd(b),w<0){var W=this.getRowFoldStart(U+w);if(W<0)return 0;var ot=W-U}else if(w>0){var W=this.getRowFoldEnd(b+w);if(W>this.doc.getLength()-1)return 0;var ot=W-b}else{U=this.$clipRowToDocument(U),b=this.$clipRowToDocument(b);var ot=b-U+1}var at=new o(U,0,b,Number.MAX_VALUE),lt=this.getFoldsInRange(at).map(function(zt){return zt=zt.clone(),zt.start.row+=ot,zt.end.row+=ot,zt}),Mt=w==0?this.doc.getLines(U,b):this.doc.removeFullLines(U,b);return this.doc.insertFullLines(U+ot,Mt),lt.length&&this.addFolds(lt),ot},G.prototype.moveLinesUp=function(U,b){return this.$moveLines(U,b,-1)},G.prototype.moveLinesDown=function(U,b){return this.$moveLines(U,b,1)},G.prototype.duplicateLines=function(U,b){return this.$moveLines(U,b,0)},G.prototype.$clipRowToDocument=function(U){return Math.max(0,Math.min(U,this.doc.getLength()-1))},G.prototype.$clipColumnToRow=function(U,b){return b<0?0:Math.min(this.doc.getLine(U).length,b)},G.prototype.$clipPositionToDocument=function(U,b){if(b=Math.max(0,b),U<0)U=0,b=0;else{var w=this.doc.getLength();U>=w?(U=w-1,b=this.doc.getLine(w-1).length):b=Math.min(this.doc.getLine(U).length,b)}return{row:U,column:b}},G.prototype.$clipRangeToDocument=function(U){U.start.row<0?(U.start.row=0,U.start.column=0):U.start.column=this.$clipColumnToRow(U.start.row,U.start.column);var b=this.doc.getLength()-1;return U.end.row>b?(U.end.row=b,U.end.column=this.doc.getLine(b).length):U.end.column=this.$clipColumnToRow(U.end.row,U.end.column),U},G.prototype.setUseWrapMode=function(U){if(U!=this.$useWrapMode){if(this.$useWrapMode=U,this.$modified=!0,this.$resetRowCache(0),U){var b=this.getLength();this.$wrapData=Array(b),this.$updateWrapData(0,b-1)}this._signal("changeWrapMode")}},G.prototype.getUseWrapMode=function(){return this.$useWrapMode},G.prototype.setWrapLimitRange=function(U,b){(this.$wrapLimitRange.min!==U||this.$wrapLimitRange.max!==b)&&(this.$wrapLimitRange={min:U,max:b},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},G.prototype.adjustWrapLimit=function(U,b){var w=this.$wrapLimitRange;w.max<0&&(w={min:b,max:b});var W=this.$constrainWrapLimit(U,w.min,w.max);return W!=this.$wrapLimit&&W>1?(this.$wrapLimit=W,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},G.prototype.$constrainWrapLimit=function(U,b,w){return b&&(U=Math.max(b,U)),w&&(U=Math.min(w,U)),U},G.prototype.getWrapLimit=function(){return this.$wrapLimit},G.prototype.setWrapLimit=function(U){this.setWrapLimitRange(U,U)},G.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},G.prototype.$updateInternalDataOnChange=function(U){var b=this.$useWrapMode,w=U.action,W=U.start,ot=U.end,at=W.row,lt=ot.row,Mt=lt-at,zt=null;if(this.$updating=!0,Mt!=0)if(w==="remove"){this[b?"$wrapData":"$rowLengthCache"].splice(at,Mt);var hi=this.$foldData;zt=this.getFoldsInRange(U),this.removeFolds(zt);var Ht=this.getFoldLine(ot.row),Vt=0;if(Ht){Ht.addRemoveChars(ot.row,ot.column,W.column-ot.column),Ht.shiftRow(-Mt);var Ut=this.getFoldLine(at);Ut&&Ut!==Ht&&(Ut.merge(Ht),Ht=Ut),Vt=hi.indexOf(Ht)+1}for(Vt;Vt<hi.length;Vt++){var Ht=hi[Vt];Ht.start.row>=ot.row&&Ht.shiftRow(-Mt)}lt=at}else{var Jt=Array(Mt);Jt.unshift(at,0);var di=b?this.$wrapData:this.$rowLengthCache;di.splice.apply(di,Jt);var hi=this.$foldData,Ht=this.getFoldLine(at),Vt=0;if(Ht){var fi=Ht.range.compareInside(W.row,W.column);fi==0?(Ht=Ht.split(W.row,W.column),Ht&&(Ht.shiftRow(Mt),Ht.addRemoveChars(lt,0,ot.column-W.column))):fi==-1&&(Ht.addRemoveChars(at,0,ot.column-W.column),Ht.shiftRow(Mt)),Vt=hi.indexOf(Ht)+1}for(Vt;Vt<hi.length;Vt++){var Ht=hi[Vt];Ht.start.row>=at&&Ht.shiftRow(Mt)}}else{Mt=Math.abs(U.start.column-U.end.column),w==="remove"&&(zt=this.getFoldsInRange(U),this.removeFolds(zt),Mt=-Mt);var Ht=this.getFoldLine(at);Ht&&Ht.addRemoveChars(at,W.column,Mt)}return b&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,b?this.$updateWrapData(at,lt):this.$updateRowLengthCache(at,lt),zt},G.prototype.$updateRowLengthCache=function(U,b){this.$rowLengthCache[U]=null,this.$rowLengthCache[b]=null},G.prototype.$updateWrapData=function(U,b){var w=this.doc.getAllLines(),W=this.getTabSize(),ot=this.$wrapData,at=this.$wrapLimit,lt,Mt,zt=U;for(b=Math.min(b,w.length-1);zt<=b;)Mt=this.getFoldLine(zt,Mt),Mt?(lt=[],Mt.walk((function(hi,Ht,Vt,Ut){var Jt;if(hi!=null){Jt=this.$getDisplayTokens(hi,lt.length),Jt[0]=S;for(var di=1;di<Jt.length;di++)Jt[di]=C}else Jt=this.$getDisplayTokens(w[Ht].substring(Ut,Vt),lt.length);lt=lt.concat(Jt)}).bind(this),Mt.end.row,w[Mt.end.row].length+1),ot[Mt.start.row]=this.$computeWrapSplits(lt,at,W),zt=Mt.end.row+1):(lt=this.$getDisplayTokens(w[zt]),ot[zt]=this.$computeWrapSplits(lt,at,W),zt++)},G.prototype.$computeWrapSplits=function(U,b,w){if(U.length==0)return[];var W=[],ot=U.length,at=0,lt=0,Mt=this.$wrapAsCode,zt=this.$indentedSoftWrap,hi=b<=Math.max(2*w,8)||zt===!1?0:Math.floor(b/2);function Ht(){var fi=0;if(hi===0)return fi;if(zt)for(var mi=0;mi<U.length;mi++){var gi=U[mi];if(gi==Be)fi+=1;else if(gi==se)fi+=w;else{if(gi==j)continue;break}}return Mt&&zt!==!1&&(fi+=w),Math.min(fi,hi)}function Vt(fi){for(var mi=fi-at,gi=at;gi<fi;gi++){var wi=U[gi];(wi===12||wi===2)&&(mi-=1)}W.length||(Ut=Ht(),W.indent=Ut),lt+=mi,W.push(lt),at=fi}for(var Ut=0;ot-at>b-Ut;){var Jt=at+b-Ut;if(U[Jt-1]>=Be&&U[Jt]>=Be){Vt(Jt);continue}if(U[Jt]==S||U[Jt]==C){for(Jt;Jt!=at-1&&U[Jt]!=S;Jt--);if(Jt>at){Vt(Jt);continue}for(Jt=at+b,Jt;Jt<U.length&&U[Jt]==C;Jt++);if(Jt==U.length)break;Vt(Jt);continue}for(var di=Math.max(Jt-(b-(b>>2)),at-1);Jt>di&&U[Jt]<S;)Jt--;if(Mt){for(;Jt>di&&U[Jt]<S;)Jt--;for(;Jt>di&&U[Jt]==q;)Jt--}else for(;Jt>di&&U[Jt]<Be;)Jt--;if(Jt>di){Vt(++Jt);continue}Jt=at+b,U[Jt]==E&&Jt--,Vt(Jt-Ut)}return W},G.prototype.$getDisplayTokens=function(U,b){var w=[],W;b=b||0;for(var ot=0;ot<U.length;ot++){var at=U.charCodeAt(ot);if(at==9){W=this.getScreenTabSize(w.length+b),w.push(se);for(var lt=1;lt<W;lt++)w.push(j)}else at==32?w.push(Be):at>39&&at<48||at>57&&at<64?w.push(q):at>=4352&&ct(at)?w.push(A,E):w.push(A)}return w},G.prototype.$getStringScreenWidth=function(U,b,w){if(b==0)return[0,0];b==null&&(b=1/0),w=w||0;var W,ot;for(ot=0;ot<U.length&&(W=U.charCodeAt(ot),W==9?w+=this.getScreenTabSize(w):W>=4352&&ct(W)?w+=2:w+=1,!(w>b));ot++);return[w,ot]},G.prototype.getRowLength=function(U){var b=1;return this.lineWidgets&&(b+=this.lineWidgets[U]&&this.lineWidgets[U].rowCount||0),!this.$useWrapMode||!this.$wrapData[U]?b:this.$wrapData[U].length+b},G.prototype.getRowLineCount=function(U){return!this.$useWrapMode||!this.$wrapData[U]?1:this.$wrapData[U].length+1},G.prototype.getRowWrapIndent=function(U){if(this.$useWrapMode){var b=this.screenToDocumentPosition(U,Number.MAX_VALUE),w=this.$wrapData[b.row];return w.length&&w[0]<b.column?w.indent:0}else return 0},G.prototype.getScreenLastRowColumn=function(U){var b=this.screenToDocumentPosition(U,Number.MAX_VALUE);return this.documentToScreenColumn(b.row,b.column)},G.prototype.getDocumentLastRowColumn=function(U,b){var w=this.documentToScreenRow(U,b);return this.getScreenLastRowColumn(w)},G.prototype.getDocumentLastRowColumnPosition=function(U,b){var w=this.documentToScreenRow(U,b);return this.screenToDocumentPosition(w,Number.MAX_VALUE/10)},G.prototype.getRowSplitData=function(U){if(this.$useWrapMode)return this.$wrapData[U]},G.prototype.getScreenTabSize=function(U){return this.$tabSize-(U%this.$tabSize|0)},G.prototype.screenToDocumentRow=function(U,b){return this.screenToDocumentPosition(U,b).row},G.prototype.screenToDocumentColumn=function(U,b){return this.screenToDocumentPosition(U,b).column},G.prototype.screenToDocumentPosition=function(U,b,w){if(U<0)return{row:0,column:0};var W,ot=0,at=0,lt,Mt=0,zt=0,hi=this.$screenRowCache,Ht=this.$getRowCacheIndex(hi,U),Vt=hi.length;if(Vt&&Ht>=0)var Mt=hi[Ht],ot=this.$docRowCache[Ht],Ut=U>hi[Vt-1];else var Ut=!Vt;for(var Jt=this.getLength()-1,di=this.getNextFoldLine(ot),fi=di?di.start.row:1/0;Mt<=U&&(zt=this.getRowLength(ot),!(Mt+zt>U||ot>=Jt));)Mt+=zt,ot++,ot>fi&&(ot=di.end.row+1,di=this.getNextFoldLine(ot,di),fi=di?di.start.row:1/0),Ut&&(this.$docRowCache.push(ot),this.$screenRowCache.push(Mt));if(di&&di.start.row<=ot)W=this.getFoldDisplayLine(di),ot=di.start.row;else{if(Mt+zt<=U||ot>Jt)return{row:Jt,column:this.getLine(Jt).length};W=this.getLine(ot),di=null}var mi=0,gi=Math.floor(U-Mt);if(this.$useWrapMode){var wi=this.$wrapData[ot];wi&&(lt=wi[gi],gi>0&&wi.length&&(mi=wi.indent,at=wi[gi-1]||wi[wi.length-1],W=W.substring(at)))}return w!==void 0&&this.$bidiHandler.isBidiRow(Mt+gi,ot,gi)&&(b=this.$bidiHandler.offsetToCol(w)),at+=this.$getStringScreenWidth(W,b-mi)[1],this.$useWrapMode&&at>=lt&&(at=lt-1),di?di.idxToPosition(at):{row:ot,column:at}},G.prototype.documentToScreenPosition=function(U,b){if(typeof b>"u")var w=this.$clipPositionToDocument(U.row,U.column);else w=this.$clipPositionToDocument(U,b);U=w.row,b=w.column;var W=0,ot=null,at=null;at=this.getFoldAt(U,b,1),at&&(U=at.start.row,b=at.start.column);var lt,Mt=0,zt=this.$docRowCache,hi=this.$getRowCacheIndex(zt,U),Ht=zt.length;if(Ht&&hi>=0)var Mt=zt[hi],W=this.$screenRowCache[hi],Vt=U>zt[Ht-1];else var Vt=!Ht;for(var Ut=this.getNextFoldLine(Mt),Jt=Ut?Ut.start.row:1/0;Mt<U;){if(Mt>=Jt){if(lt=Ut.end.row+1,lt>U)break;Ut=this.getNextFoldLine(lt,Ut),Jt=Ut?Ut.start.row:1/0}else lt=Mt+1;W+=this.getRowLength(Mt),Mt=lt,Vt&&(this.$docRowCache.push(Mt),this.$screenRowCache.push(W))}var di="";Ut&&Mt>=Jt?(di=this.getFoldDisplayLine(Ut,U,b),ot=Ut.start.row):(di=this.getLine(U).substring(0,b),ot=U);var fi=0;if(this.$useWrapMode){var mi=this.$wrapData[ot];if(mi){for(var gi=0;di.length>=mi[gi];)W++,gi++;di=di.substring(mi[gi-1]||0,di.length),fi=gi>0?mi.indent:0}}return this.lineWidgets&&this.lineWidgets[Mt]&&this.lineWidgets[Mt].rowsAbove&&(W+=this.lineWidgets[Mt].rowsAbove),{row:W,column:fi+this.$getStringScreenWidth(di)[0]}},G.prototype.documentToScreenColumn=function(U,b){return this.documentToScreenPosition(U,b).column},G.prototype.documentToScreenRow=function(U,b){return this.documentToScreenPosition(U,b).row},G.prototype.getScreenLength=function(){var U=0,b=null;if(this.$useWrapMode)for(var ot=this.$wrapData.length,at=0,W=0,b=this.$foldData[W++],lt=b?b.start.row:1/0;at<ot;){var Mt=this.$wrapData[at];U+=Mt?Mt.length+1:1,at++,at>lt&&(at=b.end.row+1,b=this.$foldData[W++],lt=b?b.start.row:1/0)}else{U=this.getLength();for(var w=this.$foldData,W=0;W<w.length;W++)b=w[W],U-=b.end.row-b.start.row}return this.lineWidgets&&(U+=this.$getWidgetScreenLength()),U},G.prototype.$setFontMetrics=function(U){this.$enableVarChar&&(this.$getStringScreenWidth=function(b,w,W){if(w===0)return[0,0];w||(w=1/0),W=W||0;var ot,at;for(at=0;at<b.length&&(ot=b.charAt(at),ot===" "?W+=this.getScreenTabSize(W):W+=U.getCharacterWidth(ot),!(W>w));at++);return[W,at]})},G.prototype.getPrecedingCharacter=function(){var U=this.selection.getCursor();if(U.column===0)return U.row===0?"":this.doc.getNewLineCharacter();var b=this.getLine(U.row);return b[U.column-1]},G.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()},G}();m.$uid=0,m.prototype.$modes=a.$modes,m.prototype.getValue=m.prototype.toString,m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},m.prototype.$overwrite=!1,m.prototype.$mode=null,m.prototype.$modeId=null,m.prototype.$scrollTop=0,m.prototype.$scrollLeft=0,m.prototype.$wrapLimit=80,m.prototype.$useWrapMode=!1,m.prototype.$wrapLimitRange={min:null,max:null},m.prototype.lineWidgets=null,m.prototype.isFullWidth=ct,D.implement(m.prototype,h);var A=1,E=2,S=3,C=4,q=9,Be=10,se=11,j=12;function ct(G){return G<4352?!1:G>=4352&&G<=4447||G>=4515&&G<=4519||G>=4602&&G<=4607||G>=9001&&G<=9002||G>=11904&&G<=11929||G>=11931&&G<=12019||G>=12032&&G<=12245||G>=12272&&G<=12283||G>=12288&&G<=12350||G>=12353&&G<=12438||G>=12441&&G<=12543||G>=12549&&G<=12589||G>=12593&&G<=12686||G>=12688&&G<=12730||G>=12736&&G<=12771||G>=12784&&G<=12830||G>=12832&&G<=12871||G>=12880&&G<=13054||G>=13056&&G<=19903||G>=19968&&G<=42124||G>=42128&&G<=42182||G>=43360&&G<=43388||G>=44032&&G<=55203||G>=55216&&G<=55238||G>=55243&&G<=55291||G>=63744&&G<=64255||G>=65040&&G<=65049||G>=65072&&G<=65106||G>=65108&&G<=65126||G>=65128&&G<=65131||G>=65281&&G<=65376||G>=65504&&G<=65510}f("./edit_session/folding").Folding.call(m.prototype),f("./edit_session/bracket_match").BracketMatch.call(m.prototype),a.defineOptions(m.prototype,"session",{wrap:{set:function(G){if(!G||G=="off"?G=!1:G=="free"?G=!0:G=="printMargin"?G=-1:typeof G=="string"&&(G=parseInt(G,10)||!1),this.$wrap!=G)if(this.$wrap=G,!G)this.setUseWrapMode(!1);else{var U=typeof G=="number"?G:null;this.setWrapLimitRange(U,U),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(G){G=G=="auto"?this.$mode.type!="text":G!="text",G!=this.$wrapAsCode&&(this.$wrapAsCode=G,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(G){this.$useWorker=G,this.$stopWorker(),G&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(G){G=parseInt(G),G>0&&this.$tabSize!==G&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=G,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(G){this.setFoldStyle(G)},handlesSet:!0},overwrite:{set:function(G){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(G){this.doc.setNewLineMode(G)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(G){this.setMode(G)},get:function(){return this.$modeId},handlesSet:!0}}),p.EditSession=m}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(f,p,Se){var D=f("./lib/lang"),_=f("./lib/oop"),x=f("./range").Range,a=function(){function o(){this.$options={}}return o.prototype.set=function(t){return _.mixin(this.$options,t),this},o.prototype.getOptions=function(){return D.copyObject(this.$options)},o.prototype.setOptions=function(t){this.$options=t},o.prototype.find=function(t){var e=this.$options,n=this.$matchIterator(t,e);if(!n)return!1;var s=null;return n.forEach(function(g,m,A,E){return s=new x(g,m,A,E),m==E&&e.start&&e.start.start&&e.skipCurrent!=!1&&s.isEqual(e.start)?(s=null,!1):!0}),s},o.prototype.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var n=e.range,s=n?t.getLines(n.start.row,n.end.row):t.doc.getAllLines(),g=[],m=e.re;if(e.$isMultiLine){var A=m.length,E=s.length-A,S;e:for(var C=m.offset||0;C<=E;C++){for(var q=0;q<A;q++)if(s[C+q].search(m[q])==-1)continue e;var Be=s[C],se=s[C+A-1],j=Be.length-Be.match(m[0])[0].length,ct=se.match(m[A-1])[0].length;S&&S.end.row===C&&S.end.column>j||(g.push(S=new x(C,j,C+A-1,ct)),A>2&&(C=C+A-2))}}else for(var G,U=0;U<s.length;U++)if(this.$isMultilineSearch(e)){var b=s.length-1;if(G=this.$multiLineForward(t,m,U,b),G){var w=G.endRow<=b?G.endRow-1:b;w>U&&(U=w),g.push(new x(G.startRow,G.startCol,G.endRow,G.endCol))}}else{G=D.getMatchOffsets(s[U],m);for(var q=0;q<G.length;q++){var W=G[q];g.push(new x(U,W.offset,U,W.offset+W.length))}}if(n){for(var ot=n.start.column,at=n.end.column,U=0,q=g.length-1;U<q&&g[U].start.column<ot&&g[U].start.row==0;)U++;for(var lt=n.end.row-n.start.row;U<q&&g[q].end.column>at&&g[q].end.row==lt;)q--;for(g=g.slice(U,q+1),U=0,q=g.length;U<q;U++)g[U].start.row+=n.start.row,g[U].end.row+=n.start.row}return g},o.prototype.parseReplaceString=function(t){for(var e={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},n="",s=0,g=t.length;s<g;s++){var m=t.charCodeAt(s);if(m===e.Backslash){if(s++,s>=g){n+="\\";break}var A=t.charCodeAt(s);switch(A){case e.Backslash:n+="\\";break;case e.n:n+=`
|
201
|
+
`;break;case e.t:n+=" ";break}continue}if(m===e.DollarSign){if(s++,s>=g){n+="$";break}var E=t.charCodeAt(s);if(E===e.DollarSign){n+="$$";continue}if(E===e.Digit0||E===e.Ampersand){n+="$&";continue}if(e.Digit1<=E&&E<=e.Digit9){n+="$"+t[s];continue}}n+=t[s]}return n||t},o.prototype.replace=function(t,e){var n=this.$options,s=this.$assembleRegExp(n);if(n.$isMultiLine)return e;if(s){var g=this.$isMultilineSearch(n);g&&(t=t.replace(/\r\n|\r|\n/g,`
|
202
|
+
`));var m=s.exec(t);if(!m||!g&&m[0].length!=t.length)return null;if(e=n.regExp?this.parseReplaceString(e):e.replace(/\$/g,"$$$$"),e=t.replace(s,e),n.preserveCase){e=e.split("");for(var A=Math.min(t.length,t.length);A--;){var E=t[A];E&&E.toLowerCase()!=E?e[A]=e[A].toUpperCase():e[A]=e[A].toLowerCase()}e=e.join("")}return e}},o.prototype.$assembleRegExp=function(t,e){if(t.needle instanceof RegExp)return t.re=t.needle;var n=t.needle;if(!t.needle)return t.re=!1;t.regExp||(n=D.escapeRegExp(n));var s=t.caseSensitive?"gm":"gmi";try{new RegExp(n,"u"),t.$supportsUnicodeFlag=!0,s+="u"}catch{t.$supportsUnicodeFlag=!1}if(t.wholeWord&&(n=h(n,t)),t.$isMultiLine=!e&&/[\n\r]/.test(n),t.$isMultiLine)return t.re=this.$assembleMultilineRegExp(n,s);try{var g=new RegExp(n,s)}catch{g=!1}return t.re=g},o.prototype.$assembleMultilineRegExp=function(t,e){for(var n=t.replace(/\r\n|\r|\n/g,`$
|
203
203
|
^`).split(`
|
204
|
-
`),s=[],
|
205
|
-
`+S}var C=e.exec(
|
204
|
+
`),s=[],g=0;g<n.length;g++)try{s.push(new RegExp(n[g],e))}catch{return!1}return s},o.prototype.$isMultilineSearch=function(t){return t.re&&/\\r\\n|\\r|\\n/.test(t.re.source)&&t.regExp&&!t.$isMultiLine},o.prototype.$multiLineForward=function(t,e,n,s){for(var g,m=r(t,n),A=n;A<=s;){for(var E=0;E<m&&!(A>s);E++){var S=t.getLine(A++);g=g==null?S:g+`
|
205
|
+
`+S}var C=e.exec(g);if(e.lastIndex=0,C){var q=g.slice(0,C.index).split(`
|
206
206
|
`),Be=C[0].split(`
|
207
|
-
`),se=n+q.length-1,j=q[q.length-1].length,ct=se+Be.length-1,G=Be.length==1?j+Be[0].length:Be[Be.length-1].length;return{startRow:se,startCol:j,endRow:ct,endCol:G}}}return null},o.prototype.$multiLineBackward=function(t,e,n,s,
|
207
|
+
`),se=n+q.length-1,j=q[q.length-1].length,ct=se+Be.length-1,G=Be.length==1?j+Be[0].length:Be[Be.length-1].length;return{startRow:se,startCol:j,endRow:ct,endCol:G}}}return null},o.prototype.$multiLineBackward=function(t,e,n,s,g){for(var m,A=r(t,s),E=t.getLine(s).length-n,S=s;S>=g;){for(var C=0;C<A&&S>=g;C++){var q=t.getLine(S--);m=m==null?q:q+`
|
208
208
|
`+m}var Be=i(m,e,E);if(Be){var se=m.slice(0,Be.index).split(`
|
209
209
|
`),j=Be[0].split(`
|
210
|
-
`),ct=S+se.length,G=se[se.length-1].length,U=ct+j.length-1,b=j.length==1?G+j[0].length:j[j.length-1].length;return{startRow:ct,startCol:G,endRow:U,endCol:b}}}return null},o.prototype.$matchIterator=function(t,e){var n=this.$assembleRegExp(e);if(!n)return!1;var s=this.$isMultilineSearch(e),f=this.$multiLineForward,m=this.$multiLineBackward,A=e.backwards==!0,E=e.skipCurrent!=!1,S=n.unicode,C=e.range,q=e.start;q||(q=C?C[A?"end":"start"]:t.selection.getRange()),q.start&&(q=q[E!=A?"end":"start"]);var Be=C?C.start.row:0,se=C?C.end.row:t.getLength()-1;if(A)var j=function(U){var b=q.row;if(!G(b,q.column,U)){for(b--;b>=Be;b--)if(G(b,Number.MAX_VALUE,U))return;if(e.wrap!=!1){for(b=se,Be=q.row;b>=Be;b--)if(G(b,Number.MAX_VALUE,U))return}}};else var j=function(b){var w=q.row;if(!G(w,q.column,b)){for(w=w+1;w<=se;w++)if(G(w,0,b))return;if(e.wrap!=!1){for(w=Be,se=q.row;w<=se;w++)if(G(w,0,b))return}}};if(e.$isMultiLine)var ct=n.length,G=function(U,b,w){var W=A?U-ct+1:U;if(!(W<0||W+ct>t.getLength())){var ot=t.getLine(W),at=ot.search(n[0]);if(!(!A&&at<b||at===-1)){for(var lt=1;lt<ct;lt++)if(ot=t.getLine(W+lt),ot.search(n[lt])==-1)return;var Mt=ot.match(n[ct-1])[0].length;if(!(A&&Mt>b)&&w(W,at,W+ct-1,Mt))return!0}}};else if(A)var G=function(b,w,W){if(s){var ot=m(t,n,w,b,Be);if(!ot)return!1;if(W(ot.startRow,ot.startCol,ot.endRow,ot.endCol))return!0}else{var at=t.getLine(b),lt=[],Mt,zt=0;for(n.lastIndex=0;Mt=n.exec(at);){var hi=Mt[0].length;if(zt=Mt.index,!hi){if(zt>=at.length)break;n.lastIndex=zt+=D.skipEmptyMatch(at,zt,S)}if(Mt.index+hi>w)break;lt.push(Mt.index,hi)}for(var Ht=lt.length-1;Ht>=0;Ht-=2){var Vt=lt[Ht-1],hi=lt[Ht];if(W(b,Vt,b,Vt+hi))return!0}}};else var G=function(b,w,W){if(n.lastIndex=w,s){var ot=f(t,n,b,se);if(ot){var at=ot.endRow<=se?ot.endRow-1:se;at>b&&(b=at)}if(!ot)return!1;if(W(ot.startRow,ot.startCol,ot.endRow,ot.endCol))return!0}else for(var lt=t.getLine(b),Mt,zt;zt=n.exec(lt);){var hi=zt[0].length;if(Mt=zt.index,W(b,Mt,b,Mt+hi))return!0;if(!hi&&(n.lastIndex=Mt+=D.skipEmptyMatch(lt,Mt,S),Mt>=lt.length))return!1}};return{forEach:j}},o}();function h(o,t){var e=D.supportsLookbehind();function n(A,E){E===void 0&&(E=!0);var S=e&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return S.test(A)||t.regExp?e&&t.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(o),f=s[0],m=s[s.length-1];return n(f)+o+n(m,!1)}function i(o,t,e){for(var n=null,s=0;s<=o.length;){t.lastIndex=s;var f=t.exec(o);if(!f)break;var m=f.index+f[0].length;if(m>o.length-e)break;(!n||m>n.index+n[0].length)&&(n=f),s=f.index+1}return n}function r(o,t){var e=5e3,n={row:t,column:0},s=o.doc.positionToIndex(n),f=s+e,m=o.doc.indexToPosition(f),A=m.row;return A+1}p.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(g,p,Se){var D=this&&this.__extends||function(){var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(n[f]=s[f])},o(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");o(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_=g("../lib/keys"),x=g("../lib/useragent"),a=_.KEY_MODS,h=function(){function o(t,e){this.$init(t,e,!1)}return o.prototype.$init=function(t,e,n){this.platform=e||(x.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=n},o.prototype.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},o.prototype.removeCommand=function(t,e){var n=t&&(typeof t=="string"?t:t.name);t=this.commands[n],e||delete this.commands[n];var s=this.commandKeyBinding;for(var f in s){var m=s[f];if(m==t)delete s[f];else if(Array.isArray(m)){var A=m.indexOf(t);A!=-1&&(m.splice(A,1),m.length==1&&(s[f]=m[0]))}}},o.prototype.bindKey=function(t,e,n){if(typeof t=="object"&&t&&(n==null&&(n=t.position),t=t[this.platform]),!!t){if(typeof e=="function")return this.addCommand({exec:e,bindKey:t,name:e.name||t});t.split("|").forEach(function(s){var f="";if(s.indexOf(" ")!=-1){var m=s.split(/\s+/);s=m.pop(),m.forEach(function(S){var C=this.parseKeys(S),q=a[C.hashId]+C.key;f+=(f?" ":"")+q,this._addCommandToBinding(f,"chainKeys")},this),f+=" "}var A=this.parseKeys(s),E=a[A.hashId]+A.key;this._addCommandToBinding(f+E,e,n)},this)}},o.prototype._addCommandToBinding=function(t,e,n){var s=this.commandKeyBinding,f;if(!e)delete s[t];else if(!s[t]||this.$singleCommand)s[t]=e;else{Array.isArray(s[t])?(f=s[t].indexOf(e))!=-1&&s[t].splice(f,1):s[t]=[s[t]],typeof n!="number"&&(n=i(e));var m=s[t];for(f=0;f<m.length;f++){var A=m[f],E=i(A);if(E>n)break}m.splice(f,0,e)}},o.prototype.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if(typeof n=="string")return this.bindKey(n,e);typeof n=="function"&&(n={exec:n}),typeof n=="object"&&(n.name||(n.name=e),this.addCommand(n))}},this)},o.prototype.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},o.prototype.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},o.prototype._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},o.prototype.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),n=e.pop(),s=_[n];if(_.FUNCTION_KEYS[s])n=_.FUNCTION_KEYS[s].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}else return{key:n,hashId:-1};for(var f=0,m=e.length;m--;){var A=_.KEY_MODS[e[m]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+e[m]+" in "+t),!1;f|=A}return{key:n,hashId:f}},o.prototype.findKeyCommand=function(t,e){var n=a[t]+e;return this.commandKeyBinding[n]},o.prototype.handleKeyboard=function(t,e,n,s){if(!(s<0)){var f=a[e]+n,m=this.commandKeyBinding[f];return t.$keyChain&&(t.$keyChain+=" "+f,m=this.commandKeyBinding[t.$keyChain]||m),m&&(m=="chainKeys"||m[m.length-1]=="chainKeys")?(t.$keyChain=t.$keyChain||f,{command:"null"}):(t.$keyChain&&((!e||e==4)&&n.length==1?t.$keyChain=t.$keyChain.slice(0,-f.length-1):(e==-1||s>0)&&(t.$keyChain="")),{command:m})}},o.prototype.getStatusText=function(t,e){return e.$keyChain||""},o}();function i(o){return typeof o=="object"&&o.bindKey&&o.bindKey.position||(o.isDefault?-100:0)}var r=function(o){D(t,o);function t(e,n){var s=o.call(this,e,n)||this;return s.$singleCommand=!0,s}return t}(h);r.call=function(o,t,e){h.prototype.$init.call(o,t,e,!0)},h.call=function(o,t,e){h.prototype.$init.call(o,t,e,!1)},p.HashHandler=r,p.MultiHashHandler=h}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(g,p,Se){var D=this&&this.__extends||function(){var i=function(r,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");i(r,o);function t(){this.constructor=r}r.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}(),_=g("../lib/oop"),x=g("../keyboard/hash_handler").MultiHashHandler,a=g("../lib/event_emitter").EventEmitter,h=function(i){D(r,i);function r(o,t){var e=i.call(this,t,o)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(n){return n.args?n.command.exec(n.editor,n.args,n.event,!1):n.command.exec(n.editor,{},n.event,!0)}),e}return r.prototype.exec=function(o,t,e){if(Array.isArray(o)){for(var n=o.length;n--;)if(this.exec(o[n],t,e))return!0;return!1}typeof o=="string"&&(o=this.commands[o]);var s={editor:t,command:o,args:e};return this.canExecute(o,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),s.returnValue!==!1):(this._signal("commandUnavailable",s),!1)},r.prototype.canExecute=function(o,t){return typeof o=="string"&&(o=this.commands[o]),!(!o||t&&t.$readOnly&&!o.readOnly||this.$checkCommandState!=!1&&o.isAvailable&&!o.isAvailable(t))},r.prototype.toggleRecording=function(o){if(!this.$inReplay)return o&&o._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(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},r.prototype.replay=function(o){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(o);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,o):this.exec(t[0],o,t[1])},this)}finally{this.$inReplay=!1}}},r.prototype.trimMacro=function(o){return o.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},r}(x);_.implement(h.prototype,a),p.CommandManager=h}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(g,p,Se){var D=g("../lib/lang"),_=g("../config"),x=g("../range").Range;function a(i,r){return{win:i,mac:r}}p.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(i){_.loadModule("ace/ext/settings_menu",function(r){r.init(i),i.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(i){_.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(i,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(i){_.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(i,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(i){i.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(i){i.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(i,r){typeof r=="number"&&!isNaN(r)&&i.gotoLine(r),i.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(i){i.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(i){i.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(i){i.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(i){i.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(i){i.session.foldAll(),i.session.unfold(i.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(i){i.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(i){i.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(i){i.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(i){_.loadModule("ace/ext/searchbox",function(r){r.Search(i)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(i){i.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(i){i.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(i){i.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(i){i.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(i,r){i.navigateUp(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(i){i.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(i){i.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(i){i.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(i,r){i.navigateDown(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(i){i.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(i){i.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(i){i.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(i){i.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(i,r){i.navigateLeft(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(i){i.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(i){i.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(i){i.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(i){i.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(i,r){i.navigateRight(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(i){i.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(i){i.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(i){i.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(i){i.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(i){i.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(i){i.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(i){i.renderer.scrollBy(0,-2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(i){i.renderer.scrollBy(0,2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(i){i.commands.toggleRecording(i)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(i){i.commands.replay(i)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(i){i.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(i){i.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(i){i.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(i){},readOnly:!0},{name:"cut",description:"Cut",exec:function(i){var r=i.$copyWithEmptySelection&&i.selection.isEmpty(),o=r?i.selection.getLineRange():i.selection.getRange();i._emit("cut",o),o.isEmpty()||i.session.remove(o),i.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(i,r){i.$handlePaste(r)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(i){i.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(i){i.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(i){i.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(i){i.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(i){i.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(i){i.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(i){i.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(i){_.loadModule("ace/ext/searchbox",function(r){r.Search(i,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(i){i.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(i){i.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(i){i.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(i){i.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(i){i.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(i){i.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(i){i.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(i){i.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(i){if(i.selection.isEmpty())i.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(i){i.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(i){i.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(i){var r=i.selection.getRange();r.start.column=0,i.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(i){var r=i.selection.getRange();r.end.column=Number.MAX_VALUE,i.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(i){i.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(i){i.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(i){i.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(i){i.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(i){i.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(i){i.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(i,r){i.insert(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(i,r){i.insert(D.stringRepeat(r.text||"",r.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(i){i.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(i){i.transposeLetters()},multiSelectAction:function(i){i.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(i){i.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(i){i.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(i){i.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(i){var r=i.selection.getRange();r.start.column=r.end.column=0,r.end.row++,i.selection.setRange(r,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(i){i.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(i){for(var r=i.selection.isBackwards(),o=r?i.selection.getSelectionLead():i.selection.getSelectionAnchor(),t=r?i.selection.getSelectionAnchor():i.selection.getSelectionLead(),e=i.session.doc.getLine(o.row).length,n=i.session.doc.getTextRange(i.selection.getRange()),s=n.replace(/\n\s*/," ").length,f=i.session.doc.getLine(o.row),m=o.row+1;m<=t.row+1;m++){var A=D.stringTrimLeft(D.stringTrimRight(i.session.doc.getLine(m)));A.length!==0&&(A=" "+A),f+=A}t.row+1<i.session.doc.getLength()-1&&(f+=i.session.doc.getNewLineCharacter()),i.clearSelection(),i.session.doc.replace(new x(o.row,0,t.row+2,0),f),s>0?(i.selection.moveCursorTo(o.row,o.column),i.selection.selectTo(o.row,o.column+s)):(e=i.session.doc.getLine(o.row).length>e?e+1:e,i.selection.moveCursorTo(o.row,e))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(i){var r=i.session.doc.getLength()-1,o=i.session.doc.getLine(r).length,t=i.selection.rangeList.ranges,e=[];t.length<1&&(t=[i.selection.getRange()]);for(var n=0;n<t.length;n++)n==t.length-1&&(t[n].end.row===r&&t[n].end.column===o||e.push(new x(t[n].end.row,t[n].end.column,r,o))),n===0?t[n].start.row===0&&t[n].start.column===0||e.push(new x(0,0,t[n].start.row,t[n].start.column)):e.push(new x(t[n-1].end.row,t[n-1].end.column,t[n].start.row,t[n].start.column));i.exitMultiSelectMode(),i.clearSelection();for(var n=0;n<e.length;n++)i.selection.addRange(e[n],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(i){i.selection.clearSelection(),i.navigateLineEnd(),i.insert(`
|
210
|
+
`),ct=S+se.length,G=se[se.length-1].length,U=ct+j.length-1,b=j.length==1?G+j[0].length:j[j.length-1].length;return{startRow:ct,startCol:G,endRow:U,endCol:b}}}return null},o.prototype.$matchIterator=function(t,e){var n=this.$assembleRegExp(e);if(!n)return!1;var s=this.$isMultilineSearch(e),g=this.$multiLineForward,m=this.$multiLineBackward,A=e.backwards==!0,E=e.skipCurrent!=!1,S=n.unicode,C=e.range,q=e.start;q||(q=C?C[A?"end":"start"]:t.selection.getRange()),q.start&&(q=q[E!=A?"end":"start"]);var Be=C?C.start.row:0,se=C?C.end.row:t.getLength()-1;if(A)var j=function(U){var b=q.row;if(!G(b,q.column,U)){for(b--;b>=Be;b--)if(G(b,Number.MAX_VALUE,U))return;if(e.wrap!=!1){for(b=se,Be=q.row;b>=Be;b--)if(G(b,Number.MAX_VALUE,U))return}}};else var j=function(b){var w=q.row;if(!G(w,q.column,b)){for(w=w+1;w<=se;w++)if(G(w,0,b))return;if(e.wrap!=!1){for(w=Be,se=q.row;w<=se;w++)if(G(w,0,b))return}}};if(e.$isMultiLine)var ct=n.length,G=function(U,b,w){var W=A?U-ct+1:U;if(!(W<0||W+ct>t.getLength())){var ot=t.getLine(W),at=ot.search(n[0]);if(!(!A&&at<b||at===-1)){for(var lt=1;lt<ct;lt++)if(ot=t.getLine(W+lt),ot.search(n[lt])==-1)return;var Mt=ot.match(n[ct-1])[0].length;if(!(A&&Mt>b)&&w(W,at,W+ct-1,Mt))return!0}}};else if(A)var G=function(b,w,W){if(s){var ot=m(t,n,w,b,Be);if(!ot)return!1;if(W(ot.startRow,ot.startCol,ot.endRow,ot.endCol))return!0}else{var at=t.getLine(b),lt=[],Mt,zt=0;for(n.lastIndex=0;Mt=n.exec(at);){var hi=Mt[0].length;if(zt=Mt.index,!hi){if(zt>=at.length)break;n.lastIndex=zt+=D.skipEmptyMatch(at,zt,S)}if(Mt.index+hi>w)break;lt.push(Mt.index,hi)}for(var Ht=lt.length-1;Ht>=0;Ht-=2){var Vt=lt[Ht-1],hi=lt[Ht];if(W(b,Vt,b,Vt+hi))return!0}}};else var G=function(b,w,W){if(n.lastIndex=w,s){var ot=g(t,n,b,se);if(ot){var at=ot.endRow<=se?ot.endRow-1:se;at>b&&(b=at)}if(!ot)return!1;if(W(ot.startRow,ot.startCol,ot.endRow,ot.endCol))return!0}else for(var lt=t.getLine(b),Mt,zt;zt=n.exec(lt);){var hi=zt[0].length;if(Mt=zt.index,W(b,Mt,b,Mt+hi))return!0;if(!hi&&(n.lastIndex=Mt+=D.skipEmptyMatch(lt,Mt,S),Mt>=lt.length))return!1}};return{forEach:j}},o}();function h(o,t){var e=D.supportsLookbehind();function n(A,E){E===void 0&&(E=!0);var S=e&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return S.test(A)||t.regExp?e&&t.$supportsUnicodeFlag?E?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var s=Array.from(o),g=s[0],m=s[s.length-1];return n(g)+o+n(m,!1)}function i(o,t,e){for(var n=null,s=0;s<=o.length;){t.lastIndex=s;var g=t.exec(o);if(!g)break;var m=g.index+g[0].length;if(m>o.length-e)break;(!n||m>n.index+n[0].length)&&(n=g),s=g.index+1}return n}function r(o,t){var e=5e3,n={row:t,column:0},s=o.doc.positionToIndex(n),g=s+e,m=o.doc.indexToPosition(g),A=m.row;return A+1}p.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(f,p,Se){var D=this&&this.__extends||function(){var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var g in s)Object.prototype.hasOwnProperty.call(s,g)&&(n[g]=s[g])},o(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");o(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),_=f("../lib/keys"),x=f("../lib/useragent"),a=_.KEY_MODS,h=function(){function o(t,e){this.$init(t,e,!1)}return o.prototype.$init=function(t,e,n){this.platform=e||(x.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=n},o.prototype.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},o.prototype.removeCommand=function(t,e){var n=t&&(typeof t=="string"?t:t.name);t=this.commands[n],e||delete this.commands[n];var s=this.commandKeyBinding;for(var g in s){var m=s[g];if(m==t)delete s[g];else if(Array.isArray(m)){var A=m.indexOf(t);A!=-1&&(m.splice(A,1),m.length==1&&(s[g]=m[0]))}}},o.prototype.bindKey=function(t,e,n){if(typeof t=="object"&&t&&(n==null&&(n=t.position),t=t[this.platform]),!!t){if(typeof e=="function")return this.addCommand({exec:e,bindKey:t,name:e.name||t});t.split("|").forEach(function(s){var g="";if(s.indexOf(" ")!=-1){var m=s.split(/\s+/);s=m.pop(),m.forEach(function(S){var C=this.parseKeys(S),q=a[C.hashId]+C.key;g+=(g?" ":"")+q,this._addCommandToBinding(g,"chainKeys")},this),g+=" "}var A=this.parseKeys(s),E=a[A.hashId]+A.key;this._addCommandToBinding(g+E,e,n)},this)}},o.prototype._addCommandToBinding=function(t,e,n){var s=this.commandKeyBinding,g;if(!e)delete s[t];else if(!s[t]||this.$singleCommand)s[t]=e;else{Array.isArray(s[t])?(g=s[t].indexOf(e))!=-1&&s[t].splice(g,1):s[t]=[s[t]],typeof n!="number"&&(n=i(e));var m=s[t];for(g=0;g<m.length;g++){var A=m[g],E=i(A);if(E>n)break}m.splice(g,0,e)}},o.prototype.addCommands=function(t){t&&Object.keys(t).forEach(function(e){var n=t[e];if(n){if(typeof n=="string")return this.bindKey(n,e);typeof n=="function"&&(n={exec:n}),typeof n=="object"&&(n.name||(n.name=e),this.addCommand(n))}},this)},o.prototype.removeCommands=function(t){Object.keys(t).forEach(function(e){this.removeCommand(t[e])},this)},o.prototype.bindKeys=function(t){Object.keys(t).forEach(function(e){this.bindKey(e,t[e])},this)},o.prototype._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},o.prototype.parseKeys=function(t){var e=t.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(E){return E}),n=e.pop(),s=_[n];if(_.FUNCTION_KEYS[s])n=_.FUNCTION_KEYS[s].toLowerCase();else if(e.length){if(e.length==1&&e[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}else return{key:n,hashId:-1};for(var g=0,m=e.length;m--;){var A=_.KEY_MODS[e[m]];if(A==null)return typeof console<"u"&&console.error("invalid modifier "+e[m]+" in "+t),!1;g|=A}return{key:n,hashId:g}},o.prototype.findKeyCommand=function(t,e){var n=a[t]+e;return this.commandKeyBinding[n]},o.prototype.handleKeyboard=function(t,e,n,s){if(!(s<0)){var g=a[e]+n,m=this.commandKeyBinding[g];return t.$keyChain&&(t.$keyChain+=" "+g,m=this.commandKeyBinding[t.$keyChain]||m),m&&(m=="chainKeys"||m[m.length-1]=="chainKeys")?(t.$keyChain=t.$keyChain||g,{command:"null"}):(t.$keyChain&&((!e||e==4)&&n.length==1?t.$keyChain=t.$keyChain.slice(0,-g.length-1):(e==-1||s>0)&&(t.$keyChain="")),{command:m})}},o.prototype.getStatusText=function(t,e){return e.$keyChain||""},o}();function i(o){return typeof o=="object"&&o.bindKey&&o.bindKey.position||(o.isDefault?-100:0)}var r=function(o){D(t,o);function t(e,n){var s=o.call(this,e,n)||this;return s.$singleCommand=!0,s}return t}(h);r.call=function(o,t,e){h.prototype.$init.call(o,t,e,!0)},h.call=function(o,t,e){h.prototype.$init.call(o,t,e,!1)},p.HashHandler=r,p.MultiHashHandler=h}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(f,p,Se){var D=this&&this.__extends||function(){var i=function(r,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");i(r,o);function t(){this.constructor=r}r.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}}(),_=f("../lib/oop"),x=f("../keyboard/hash_handler").MultiHashHandler,a=f("../lib/event_emitter").EventEmitter,h=function(i){D(r,i);function r(o,t){var e=i.call(this,t,o)||this;return e.byName=e.commands,e.setDefaultHandler("exec",function(n){return n.args?n.command.exec(n.editor,n.args,n.event,!1):n.command.exec(n.editor,{},n.event,!0)}),e}return r.prototype.exec=function(o,t,e){if(Array.isArray(o)){for(var n=o.length;n--;)if(this.exec(o[n],t,e))return!0;return!1}typeof o=="string"&&(o=this.commands[o]);var s={editor:t,command:o,args:e};return this.canExecute(o,t)?(s.returnValue=this._emit("exec",s),this._signal("afterExec",s),s.returnValue!==!1):(this._signal("commandUnavailable",s),!1)},r.prototype.canExecute=function(o,t){return typeof o=="string"&&(o=this.commands[o]),!(!o||t&&t.$readOnly&&!o.readOnly||this.$checkCommandState!=!1&&o.isAvailable&&!o.isAvailable(t))},r.prototype.toggleRecording=function(o){if(!this.$inReplay)return o&&o._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(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},r.prototype.replay=function(o){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(o);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,o):this.exec(t[0],o,t[1])},this)}finally{this.$inReplay=!1}}},r.prototype.trimMacro=function(o){return o.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})},r}(x);_.implement(h.prototype,a),p.CommandManager=h}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(f,p,Se){var D=f("../lib/lang"),_=f("../config"),x=f("../range").Range;function a(i,r){return{win:i,mac:r}}p.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:a("Ctrl-,","Command-,"),exec:function(i){_.loadModule("ace/ext/settings_menu",function(r){r.init(i),i.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:a("Alt-E","F4"),exec:function(i){_.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(i,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:a("Alt-Shift-E","Shift-F4"),exec:function(i){_.loadModule("ace/ext/error_marker",function(r){r.showErrorMarker(i,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:a("Ctrl-A","Command-A"),exec:function(i){i.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:a(null,"Ctrl-L"),exec:function(i){i.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:a("Ctrl-L","Command-L"),exec:function(i,r){typeof r=="number"&&!isNaN(r)&&i.gotoLine(r),i.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:a("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(i){i.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:a("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(i){i.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:a("F2","F2"),exec:function(i){i.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:a("Alt-F2","Alt-F2"),exec:function(i){i.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:a(null,"Ctrl-Command-Option-0"),exec:function(i){i.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:a("Alt-0","Command-Option-0"),exec:function(i){i.session.foldAll(),i.session.unfold(i.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:a("Alt-Shift-0","Command-Option-Shift-0"),exec:function(i){i.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:a("Ctrl-K","Command-G"),exec:function(i){i.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:a("Ctrl-Shift-K","Command-Shift-G"),exec:function(i){i.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:a("Alt-K","Ctrl-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:a("Alt-Shift-K","Ctrl-Shift-G"),exec:function(i){i.selection.isEmpty()?i.selection.selectWord():i.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:a("Ctrl-F","Command-F"),exec:function(i){_.loadModule("ace/ext/searchbox",function(r){r.Search(i)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(i){i.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:a("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(i){i.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:a("Ctrl-Home","Command-Home|Command-Up"),exec:function(i){i.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:a("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(i){i.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:a("Up","Up|Ctrl-P"),exec:function(i,r){i.navigateUp(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:a("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(i){i.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:a("Ctrl-End","Command-End|Command-Down"),exec:function(i){i.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:a("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(i){i.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:a("Down","Down|Ctrl-N"),exec:function(i,r){i.navigateDown(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:a("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(i){i.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:a("Ctrl-Left","Option-Left"),exec:function(i){i.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:a("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:a("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(i){i.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:a("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(i){i.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:a("Left","Left|Ctrl-B"),exec:function(i,r){i.navigateLeft(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:a("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(i){i.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:a("Ctrl-Right","Option-Right"),exec:function(i){i.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:a("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:a("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(i){i.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:a("Shift-Right","Shift-Right"),exec:function(i){i.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:a("Right","Right|Ctrl-F"),exec:function(i,r){i.navigateRight(r.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(i){i.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:a(null,"Option-PageDown"),exec:function(i){i.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:a("PageDown","PageDown|Ctrl-V"),exec:function(i){i.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(i){i.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:a(null,"Option-PageUp"),exec:function(i){i.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(i){i.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:a("Ctrl-Up",null),exec:function(i){i.renderer.scrollBy(0,-2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:a("Ctrl-Down",null),exec:function(i){i.renderer.scrollBy(0,2*i.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(i){i.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(i){i.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:a("Ctrl-Alt-E","Command-Option-E"),exec:function(i){i.commands.toggleRecording(i)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:a("Ctrl-Shift-E","Command-Shift-E"),exec:function(i){i.commands.replay(i)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:a("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(i){i.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:a("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(i){i.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:a("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(i){i.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:a(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(i){},readOnly:!0},{name:"cut",description:"Cut",exec:function(i){var r=i.$copyWithEmptySelection&&i.selection.isEmpty(),o=r?i.selection.getLineRange():i.selection.getRange();i._emit("cut",o),o.isEmpty()||i.session.remove(o),i.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(i,r){i.$handlePaste(r)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:a("Ctrl-D","Command-D"),exec:function(i){i.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:a("Ctrl-Shift-D","Command-Shift-D"),exec:function(i){i.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:a("Ctrl-Alt-S","Command-Alt-S"),exec:function(i){i.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:a("Ctrl-/","Command-/"),exec:function(i){i.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:a("Ctrl-Shift-/","Command-Shift-/"),exec:function(i){i.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:a("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(i){i.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:a("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(i){i.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:a("Ctrl-H","Command-Option-F"),exec:function(i){_.loadModule("ace/ext/searchbox",function(r){r.Search(i,!0)})}},{name:"undo",description:"Undo",bindKey:a("Ctrl-Z","Command-Z"),exec:function(i){i.undo()}},{name:"redo",description:"Redo",bindKey:a("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(i){i.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:a("Alt-Shift-Up","Command-Option-Up"),exec:function(i){i.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:a("Alt-Up","Option-Up"),exec:function(i){i.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:a("Alt-Shift-Down","Command-Option-Down"),exec:function(i){i.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:a("Alt-Down","Option-Down"),exec:function(i){i.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:a("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(i){i.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:a("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(i){i.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:a("Shift-Delete",null),exec:function(i){if(i.selection.isEmpty())i.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:a("Alt-Backspace","Command-Backspace"),exec:function(i){i.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:a("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(i){i.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:a("Ctrl-Shift-Backspace",null),exec:function(i){var r=i.selection.getRange();r.start.column=0,i.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:a("Ctrl-Shift-Delete",null),exec:function(i){var r=i.selection.getRange();r.end.column=Number.MAX_VALUE,i.session.remove(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:a("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(i){i.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:a("Ctrl-Delete","Alt-Delete"),exec:function(i){i.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:a("Shift-Tab","Shift-Tab"),exec:function(i){i.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:a("Tab","Tab"),exec:function(i){i.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:a("Ctrl-[","Ctrl-["),exec:function(i){i.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:a("Ctrl-]","Ctrl-]"),exec:function(i){i.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(i,r){i.insert(r)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(i,r){i.insert(D.stringRepeat(r.text||"",r.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:a(null,"Ctrl-O"),exec:function(i){i.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:a("Alt-Shift-X","Ctrl-T"),exec:function(i){i.transposeLetters()},multiSelectAction:function(i){i.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:a("Ctrl-U","Ctrl-U"),exec:function(i){i.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:a("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(i){i.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:a(null,null),exec:function(i){i.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:a("Ctrl-Shift-L","Command-Shift-L"),exec:function(i){var r=i.selection.getRange();r.start.column=r.end.column=0,r.end.row++,i.selection.setRange(r,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:a("Ctrl+F3","F3"),exec:function(i){i.openLink()}},{name:"joinlines",description:"Join lines",bindKey:a(null,null),exec:function(i){for(var r=i.selection.isBackwards(),o=r?i.selection.getSelectionLead():i.selection.getSelectionAnchor(),t=r?i.selection.getSelectionAnchor():i.selection.getSelectionLead(),e=i.session.doc.getLine(o.row).length,n=i.session.doc.getTextRange(i.selection.getRange()),s=n.replace(/\n\s*/," ").length,g=i.session.doc.getLine(o.row),m=o.row+1;m<=t.row+1;m++){var A=D.stringTrimLeft(D.stringTrimRight(i.session.doc.getLine(m)));A.length!==0&&(A=" "+A),g+=A}t.row+1<i.session.doc.getLength()-1&&(g+=i.session.doc.getNewLineCharacter()),i.clearSelection(),i.session.doc.replace(new x(o.row,0,t.row+2,0),g),s>0?(i.selection.moveCursorTo(o.row,o.column),i.selection.selectTo(o.row,o.column+s)):(e=i.session.doc.getLine(o.row).length>e?e+1:e,i.selection.moveCursorTo(o.row,e))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:a(null,null),exec:function(i){var r=i.session.doc.getLength()-1,o=i.session.doc.getLine(r).length,t=i.selection.rangeList.ranges,e=[];t.length<1&&(t=[i.selection.getRange()]);for(var n=0;n<t.length;n++)n==t.length-1&&(t[n].end.row===r&&t[n].end.column===o||e.push(new x(t[n].end.row,t[n].end.column,r,o))),n===0?t[n].start.row===0&&t[n].start.column===0||e.push(new x(0,0,t[n].start.row,t[n].start.column)):e.push(new x(t[n-1].end.row,t[n-1].end.column,t[n].start.row,t[n].start.column));i.exitMultiSelectMode(),i.clearSelection();for(var n=0;n<e.length;n++)i.selection.addRange(e[n],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(i){i.selection.clearSelection(),i.navigateLineEnd(),i.insert(`
|
211
211
|
`)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(i){i.selection.clearSelection();var r=i.getCursorPosition();i.selection.moveTo(r.row-1,Number.MAX_VALUE),i.insert(`
|
212
|
-
`),r.row===0&&i.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(i){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),i.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:a("F1","F1"),exec:function(i){i.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:a(null,null),exec:function(i){i.prompt({$type:"modes"})},readOnly:!0}];for(var h=1;h<9;h++)p.commands.push({name:"foldToLevel"+h,description:"Fold To Level "+h,level:h,exec:function(i){i.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(g,p,Se){var D=g("../lib/keys"),_=g("../mouse/default_gutter_handler").GutterTooltip,x=function(){function h(i){this.editor=i,this.gutterLayer=i.renderer.$gutterLayer,this.element=i.renderer.$gutter,this.lines=i.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new _(this.editor)}return h.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))},h.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))},h.prototype.$onGutterKeyDown=function(i){if(this.annotationTooltip.isOpen){i.preventDefault(),i.keyCode===D.escape&&this.annotationTooltip.hideTooltip();return}if(i.target===this.element){if(i.keyCode!=D.enter)return;i.preventDefault();var r=this.editor.getCursorPosition().row;this.editor.isRowVisible(r)||this.editor.scrollToLine(r,!0,!0),setTimeout((function(){var o=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldLaneWidget(o),e=this.$findNearestAnnotation(o);if(!(t===null&&e===null)){var n=this.$findClosestNumber(t,e,o);if(n===t)if(this.activeLane="fold",this.activeRowIndex=t,this.$isCustomWidgetVisible(t)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(i),setTimeout((function(){this.editor._signal("gutterkeydown",new a(i,this))}).bind(this),10)},h.prototype.$handleGutterKeyboardInteraction=function(i){if(i.keyCode===D.tab){i.preventDefault();return}if(i.keyCode===D.escape){i.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(i.keyCode===D.up){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(i.keyCode===D.down){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(i.keyCode===D.left){i.preventDefault(),this.$switchLane("annotation");return}if(i.keyCode===D.right){i.preventDefault(),this.$switchLane("fold");return}if(i.keyCode===D.enter||i.keyCode===D.space){switch(i.preventDefault(),this.activeLane){case"fold":var r=this.$rowIndexToRow(this.activeRowIndex),o=this.editor.session.$gutterCustomWidgets[r];if(o)o.callbacks&&o.callbacks.onClick&&o.callbacks.onClick(i,r);else if(this.gutterLayer.session.foldWidgets[r]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),i),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==r&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(r),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var t=this.lines.cells[this.activeRowIndex].element.childNodes[2],e=t.getBoundingClientRect(),n=this.annotationTooltip.getElement().style;n.left=e.right+"px",n.top=e.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},h.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},h.prototype.$isFoldWidgetVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=this.$getFoldWidget(i).style.display!=="none";return r&&o},h.prototype.$isCustomWidgetVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=!!this.$getCustomWidget(i);return r&&o},h.prototype.$isAnnotationVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=this.$getAnnotation(i).style.display!=="none";return r&&o},h.prototype.$getFoldWidget=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[1]},h.prototype.$getCustomWidget=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[3]},h.prototype.$getAnnotation=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[2]},h.prototype.$findNearestFoldLaneWidget=function(i){if(this.$isCustomWidgetVisible(i)||this.$isFoldWidgetVisible(i))return i;for(var r=0;i-r>0||i+r<this.lines.getLength()-1;){if(r++,i-r>=0&&this.$isCustomWidgetVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(i+r))return i+r;if(i-r>=0&&this.$isFoldWidgetVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(i+r))return i+r}return null},h.prototype.$findNearestAnnotation=function(i){if(this.$isAnnotationVisible(i))return i;for(var r=0;i-r>0||i+r<this.lines.getLength()-1;){if(r++,i-r>=0&&this.$isAnnotationVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isAnnotationVisible(i+r))return i+r}return null},h.prototype.$focusFoldWidget=function(i){if(i!=null){var r=this.$getFoldWidget(i);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},h.prototype.$focusCustomWidget=function(i){if(i!=null){var r=this.$getCustomWidget(i);r&&(r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus())}},h.prototype.$focusAnnotation=function(i){if(i!=null){var r=this.$getAnnotation(i);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},h.prototype.$blurFoldWidget=function(i){var r=this.$getFoldWidget(i);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},h.prototype.$blurCustomWidget=function(i){var r=this.$getCustomWidget(i);r&&(r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur())},h.prototype.$blurAnnotation=function(i){var r=this.$getAnnotation(i);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},h.prototype.$moveFoldWidgetUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},h.prototype.$moveFoldWidgetDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},h.prototype.$moveAnnotationUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$moveAnnotationDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$findClosestNumber=function(i,r,o){return i===null?r:r===null||Math.abs(o-i)<=Math.abs(o-r)?i:r},h.prototype.$switchLane=function(i){switch(i){case"annotation":if(this.activeLane==="annotation")break;var r=this.$findNearestAnnotation(this.activeRowIndex);if(r==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var o=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(o===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=o,this.$isCustomWidgetVisible(o)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},h.prototype.$rowIndexToRow=function(i){var r=this.lines.get(i);return r?r.row:null},h.prototype.$rowToRowIndex=function(i){for(var r=0;r<this.lines.getLength();r++){var o=this.lines.get(r);if(o.row==i)return r}return null},h}();p.GutterKeyboardHandler=x;var a=function(){function h(i,r){this.gutterKeyboardHandler=r,this.domEvent=i}return h.prototype.getKey=function(){return D.keyCodeToString(this.domEvent.keyCode)},h.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},h.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},h.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},h}();p.GutterKeyboardEvent=a}),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","ace/lib/event","ace/tooltip"],function(g,p,Se){var D=this&&this.__values||function(b){var w=typeof Symbol=="function"&&Symbol.iterator,W=w&&b[w],ot=0;if(W)return W.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&ot>=b.length&&(b=void 0),{value:b&&b[ot++],done:!b}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},_=g("./lib/oop"),x=g("./lib/dom"),a=g("./lib/lang"),h=g("./lib/useragent"),i=g("./keyboard/textinput").TextInput,r=g("./mouse/mouse_handler").MouseHandler,o=g("./mouse/fold_handler").FoldHandler,t=g("./keyboard/keybinding").KeyBinding,e=g("./edit_session").EditSession,n=g("./search").Search,s=g("./range").Range,f=g("./lib/event_emitter").EventEmitter,m=g("./commands/command_manager").CommandManager,A=g("./commands/default_commands").commands,E=g("./config"),S=g("./token_iterator").TokenIterator,C=g("./keyboard/gutter_handler").GutterKeyboardHandler,q=g("./config").nls,Be=g("./clipboard"),se=g("./lib/keys"),j=g("./lib/event"),ct=g("./tooltip").HoverTooltip,G=function(){function b(w,W,ot){this.session,this.$toDestroy=[];var at=w.getContainerElement();this.container=at,this.renderer=w,this.id="editor"+ ++b.$uid,this.commands=new m(h.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new i(w.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new r(this),new o(this)),this.keyBinding=new t(this),this.$search=new n().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(lt,Mt){Mt._$emitInputEvent.schedule(31)}),this.setSession(W||ot&&ot.session||new e("")),E.resetOptions(this),ot&&this.setOptions(ot),E._signal("editor",this)}return b.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},b.prototype.startOperation=function(w){this.session.startOperation(w)},b.prototype.endOperation=function(w){this.session.endOperation(w)},b.prototype.onStartOperation=function(w){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,w||(this.previousCommand=null)},b.prototype.onEndOperation=function(w){if(this.curOp&&this.session){if(w&&w.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var W=this.curOp.command,ot=W&&W.scrollIntoView;if(ot){switch(ot){case"center-animate":ot="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var at=this.selection.getRange(),lt=this.renderer.layerConfig;(at.start.row>=lt.lastRow||at.end.row<=lt.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}ot=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},b.prototype.$historyTracker=function(w){if(this.$mergeUndoDeltas){var W=this.prevOp,ot=this.$mergeableCommands,at=W.command&&w.command.name==W.command.name;if(w.command.name=="insertstring"){var lt=w.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),at=at&&this.mergeNextCommand&&(!/\s/.test(lt)||/\s/.test(W.args)),this.mergeNextCommand=!0}else at=at&&ot.indexOf(w.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(at=!1),at?this.session.mergeUndoDeltas=!0:ot.indexOf(w.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},b.prototype.setKeyboardHandler=function(w,W){if(w&&typeof w=="string"&&w!="ace"){this.$keybindingId=w;var ot=this;E.loadModule(["keybinding",w],function(at){ot.$keybindingId==w&&ot.keyBinding.setKeyboardHandler(at&&at.handler),W&&W()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(w),W&&W()},b.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},b.prototype.setSession=function(w){if(this.session!=w){this.curOp&&this.endOperation(),this.curOp={};var W=this.session;if(W){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 ot=this.session.getSelection();ot.off("changeCursor",this.$onCursorChange),ot.off("changeSelection",this.$onSelectionChange)}this.session=w,w?(this.$onDocumentChange=this.onDocumentChange.bind(this),w.on("change",this.$onDocumentChange),this.renderer.setSession(w),this.$onChangeMode=this.onChangeMode.bind(this),w.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),w.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),w.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),w.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),w.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),w.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=w.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(w)),this._signal("changeSession",{session:w,oldSession:W}),this.curOp=null,W&&W._signal("changeEditor",{oldEditor:this}),W&&(W.$editor=null),w&&w._signal("changeEditor",{editor:this}),w&&(w.$editor=this),w&&!w.destroyed&&w.bgTokenizer.scheduleStart()}},b.prototype.getSession=function(){return this.session},b.prototype.setValue=function(w,W){return this.session.doc.setValue(w),W?W==1?this.navigateFileEnd():W==-1&&this.navigateFileStart():this.selectAll(),w},b.prototype.getValue=function(){return this.session.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.resize=function(w){this.renderer.onResize(w)},b.prototype.setTheme=function(w,W){this.renderer.setTheme(w,W)},b.prototype.getTheme=function(){return this.renderer.getTheme()},b.prototype.setStyle=function(w){this.renderer.setStyle(w)},b.prototype.unsetStyle=function(w){this.renderer.unsetStyle(w)},b.prototype.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},b.prototype.setFontSize=function(w){this.setOption("fontSize",w)},b.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var w=this;this.$highlightPending=!0,setTimeout(function(){w.$highlightPending=!1;var W=w.session;if(!(!W||W.destroyed)){W.$bracketHighlight&&(W.$bracketHighlight.markerIds.forEach(function(Ut){W.removeMarker(Ut)}),W.$bracketHighlight=null);var ot=w.getCursorPosition(),at=w.getKeyboardHandler(),lt=at&&at.$getDirectionForHighlight&&at.$getDirectionForHighlight(w),Mt=W.getMatchingBracketRanges(ot,lt);if(!Mt){var zt=new S(W,ot.row,ot.column),hi=zt.getCurrentToken();if(hi&&/\b(?:tag-open|tag-name)/.test(hi.type)){var Ht=W.getMatchingTags(ot);Ht&&(Mt=[Ht.openTagName.isEmpty()?Ht.openTag:Ht.openTagName,Ht.closeTagName.isEmpty()?Ht.closeTag:Ht.closeTagName])}}if(!Mt&&W.$mode.getMatching&&(Mt=W.$mode.getMatching(w.session)),!Mt){w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide();return}var Vt="ace_bracket";Array.isArray(Mt)?Mt.length==1&&(Vt="ace_error_bracket"):Mt=[Mt],Mt.length==2&&(s.comparePoints(Mt[0].end,Mt[1].start)==0?Mt=[s.fromPoints(Mt[0].start,Mt[1].end)]:s.comparePoints(Mt[0].start,Mt[1].end)==0&&(Mt=[s.fromPoints(Mt[1].start,Mt[0].end)])),W.$bracketHighlight={ranges:Mt,markerIds:Mt.map(function(Ut){return W.addMarker(Ut,Vt,"text")})},w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide()}},50)}},b.prototype.focus=function(){this.textInput.focus()},b.prototype.isFocused=function(){return this.textInput.isFocused()},b.prototype.blur=function(){this.textInput.blur()},b.prototype.onFocus=function(w){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",w))},b.prototype.onBlur=function(w){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",w))},b.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},b.prototype.onDocumentChange=function(w){var W=this.session.$useWrapMode,ot=w.start.row==w.end.row?w.end.row:1/0;this.renderer.updateLines(w.start.row,ot,W),this._signal("change",w),this.$cursorChange()},b.prototype.onTokenizerUpdate=function(w){var W=w.data;this.renderer.updateLines(W.first,W.last)},b.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},b.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},b.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},b.prototype.$updateHighlightActiveLine=function(){var w=this.getSession(),W;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(W=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(W=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(W=!1)),w.$highlightLineMarker&&!W)w.removeMarker(w.$highlightLineMarker.id),w.$highlightLineMarker=null;else if(!w.$highlightLineMarker&&W){var ot=new s(W.row,W.column,W.row,1/0);ot.id=w.addMarker(ot,"ace_active-line","screenLine"),w.$highlightLineMarker=ot}else W&&(w.$highlightLineMarker.start.row=W.row,w.$highlightLineMarker.end.row=W.row,w.$highlightLineMarker.start.column=W.column,w._signal("changeBackMarker"))},b.prototype.onSelectionChange=function(w){var W=this.session;if(W.$selectionMarker&&W.removeMarker(W.$selectionMarker),W.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var ot=this.selection.getRange(),at=this.getSelectionStyle();W.$selectionMarker=W.addMarker(ot,"ace_selection",at)}var lt=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(lt),this._signal("changeSelection")},b.prototype.$getSelectionHighLightRegexp=function(){var w=this.session,W=this.getSelectionRange();if(!(W.isEmpty()||W.isMultiLine())){var ot=W.start.column,at=W.end.column,lt=w.getLine(W.start.row),Mt=lt.substring(ot,at);if(!(Mt.length>5e3||!/[\w\d]/.test(Mt))){var zt=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:Mt}),hi=lt.substring(ot-1,at+1);if(zt.test(hi))return zt}}},b.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},b.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},b.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},b.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},b.prototype.onChangeMode=function(w){this.renderer.updateText(),this._emit("changeMode",w)},b.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},b.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},b.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},b.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},b.prototype.getCopyText=function(){var w=this.getSelectedText(),W=this.session.doc.getNewLineCharacter(),ot=!1;if(!w&&this.$copyWithEmptySelection){ot=!0;for(var at=this.selection.getAllRanges(),lt=0;lt<at.length;lt++){var Mt=at[lt];lt&&at[lt-1].start.row==Mt.start.row||(w+=this.session.getLine(Mt.start.row)+W)}}var zt={text:w};return this._signal("copy",zt),Be.lineMode=ot?zt.text:!1,zt.text},b.prototype.onCopy=function(){this.commands.exec("copy",this)},b.prototype.onCut=function(){this.commands.exec("cut",this)},b.prototype.onPaste=function(w,W){var ot={text:w,event:W};this.commands.exec("paste",this,ot)},b.prototype.$handlePaste=function(w){typeof w=="string"&&(w={text:w}),this._signal("paste",w);var W=w.text,ot=W===Be.lineMode,at=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)ot?at.insert({row:this.selection.lead.row,column:0},W):this.insert(W);else if(ot)this.selection.rangeList.ranges.forEach(function(Vt){at.insert({row:Vt.start.row,column:0},W)});else{var lt=W.split(/\r\n|\r|\n/),Mt=this.selection.rangeList.ranges,zt=lt.length==2&&(!lt[0]||!lt[1]);if(lt.length!=Mt.length||zt)return this.commands.exec("insertstring",this,W);for(var hi=Mt.length;hi--;){var Ht=Mt[hi];Ht.isEmpty()||at.remove(Ht),at.insert(Ht.start,lt[hi])}}},b.prototype.execCommand=function(w,W){return this.commands.exec(w,this,W)},b.prototype.insert=function(w,W){var ot=this.session,at=ot.getMode(),lt=this.getCursorPosition();if(this.getBehavioursEnabled()&&!W){var Mt=at.transformAction(ot.getState(lt.row),"insertion",this,ot,w);Mt&&(w!==Mt.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),w=Mt.text)}if(w==" "&&(w=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&w.indexOf(`
|
212
|
+
`),r.row===0&&i.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(i){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),i.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:a("F1","F1"),exec:function(i){i.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:a(null,null),exec:function(i){i.prompt({$type:"modes"})},readOnly:!0}];for(var h=1;h<9;h++)p.commands.push({name:"foldToLevel"+h,description:"Fold To Level "+h,level:h,exec:function(i){i.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(f,p,Se){var D=f("../lib/keys"),_=f("../mouse/default_gutter_handler").GutterTooltip,x=function(){function h(i){this.editor=i,this.gutterLayer=i.renderer.$gutterLayer,this.element=i.renderer.$gutter,this.lines=i.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new _(this.editor)}return h.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))},h.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))},h.prototype.$onGutterKeyDown=function(i){if(this.annotationTooltip.isOpen){i.preventDefault(),i.keyCode===D.escape&&this.annotationTooltip.hideTooltip();return}if(i.target===this.element){if(i.keyCode!=D.enter)return;i.preventDefault();var r=this.editor.getCursorPosition().row;this.editor.isRowVisible(r)||this.editor.scrollToLine(r,!0,!0),setTimeout((function(){var o=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldLaneWidget(o),e=this.$findNearestAnnotation(o);if(!(t===null&&e===null)){var n=this.$findClosestNumber(t,e,o);if(n===t)if(this.activeLane="fold",this.activeRowIndex=t,this.$isCustomWidgetVisible(t)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=e,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(i),setTimeout((function(){this.editor._signal("gutterkeydown",new a(i,this))}).bind(this),10)},h.prototype.$handleGutterKeyboardInteraction=function(i){if(i.keyCode===D.tab){i.preventDefault();return}if(i.keyCode===D.escape){i.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(i.keyCode===D.up){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(i.keyCode===D.down){switch(i.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(i.keyCode===D.left){i.preventDefault(),this.$switchLane("annotation");return}if(i.keyCode===D.right){i.preventDefault(),this.$switchLane("fold");return}if(i.keyCode===D.enter||i.keyCode===D.space){switch(i.preventDefault(),this.activeLane){case"fold":var r=this.$rowIndexToRow(this.activeRowIndex),o=this.editor.session.$gutterCustomWidgets[r];if(o)o.callbacks&&o.callbacks.onClick&&o.callbacks.onClick(i,r);else if(this.gutterLayer.session.foldWidgets[r]==="start"){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),i),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==r&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(r),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var t=this.lines.cells[this.activeRowIndex].element.childNodes[2],e=t.getBoundingClientRect(),n=this.annotationTooltip.getElement().style;n.left=e.right+"px",n.top=e.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},h.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},h.prototype.$isFoldWidgetVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=this.$getFoldWidget(i).style.display!=="none";return r&&o},h.prototype.$isCustomWidgetVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=!!this.$getCustomWidget(i);return r&&o},h.prototype.$isAnnotationVisible=function(i){var r=this.editor.isRowFullyVisible(this.$rowIndexToRow(i)),o=this.$getAnnotation(i).style.display!=="none";return r&&o},h.prototype.$getFoldWidget=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[1]},h.prototype.$getCustomWidget=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[3]},h.prototype.$getAnnotation=function(i){var r=this.lines.get(i),o=r.element;return o.childNodes[2]},h.prototype.$findNearestFoldLaneWidget=function(i){if(this.$isCustomWidgetVisible(i)||this.$isFoldWidgetVisible(i))return i;for(var r=0;i-r>0||i+r<this.lines.getLength()-1;){if(r++,i-r>=0&&this.$isCustomWidgetVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(i+r))return i+r;if(i-r>=0&&this.$isFoldWidgetVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(i+r))return i+r}return null},h.prototype.$findNearestAnnotation=function(i){if(this.$isAnnotationVisible(i))return i;for(var r=0;i-r>0||i+r<this.lines.getLength()-1;){if(r++,i-r>=0&&this.$isAnnotationVisible(i-r))return i-r;if(i+r<=this.lines.getLength()-1&&this.$isAnnotationVisible(i+r))return i+r}return null},h.prototype.$focusFoldWidget=function(i){if(i!=null){var r=this.$getFoldWidget(i);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},h.prototype.$focusCustomWidget=function(i){if(i!=null){var r=this.$getCustomWidget(i);r&&(r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus())}},h.prototype.$focusAnnotation=function(i){if(i!=null){var r=this.$getAnnotation(i);r.classList.add(this.editor.renderer.keyboardFocusClassName),r.focus()}},h.prototype.$blurFoldWidget=function(i){var r=this.$getFoldWidget(i);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},h.prototype.$blurCustomWidget=function(i){var r=this.$getCustomWidget(i);r&&(r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur())},h.prototype.$blurAnnotation=function(i){var r=this.$getAnnotation(i);r.classList.remove(this.editor.renderer.keyboardFocusClassName),r.blur()},h.prototype.$moveFoldWidgetUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},h.prototype.$moveFoldWidgetDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isFoldWidgetVisible(i)||this.$isCustomWidgetVisible(i)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=i,this.$isFoldWidgetVisible(i)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},h.prototype.$moveAnnotationUp=function(){for(var i=this.activeRowIndex;i>0;)if(i--,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$moveAnnotationDown=function(){for(var i=this.activeRowIndex;i<this.lines.getLength()-1;)if(i++,this.$isAnnotationVisible(i)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusAnnotation(this.activeRowIndex);return}},h.prototype.$findClosestNumber=function(i,r,o){return i===null?r:r===null||Math.abs(o-i)<=Math.abs(o-r)?i:r},h.prototype.$switchLane=function(i){switch(i){case"annotation":if(this.activeLane==="annotation")break;var r=this.$findNearestAnnotation(this.activeRowIndex);if(r==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var o=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(o===null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=o,this.$isCustomWidgetVisible(o)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},h.prototype.$rowIndexToRow=function(i){var r=this.lines.get(i);return r?r.row:null},h.prototype.$rowToRowIndex=function(i){for(var r=0;r<this.lines.getLength();r++){var o=this.lines.get(r);if(o.row==i)return r}return null},h}();p.GutterKeyboardHandler=x;var a=function(){function h(i,r){this.gutterKeyboardHandler=r,this.domEvent=i}return h.prototype.getKey=function(){return D.keyCodeToString(this.domEvent.keyCode)},h.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},h.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},h.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},h}();p.GutterKeyboardEvent=a}),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","ace/lib/event","ace/tooltip"],function(f,p,Se){var D=this&&this.__values||function(b){var w=typeof Symbol=="function"&&Symbol.iterator,W=w&&b[w],ot=0;if(W)return W.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&ot>=b.length&&(b=void 0),{value:b&&b[ot++],done:!b}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},_=f("./lib/oop"),x=f("./lib/dom"),a=f("./lib/lang"),h=f("./lib/useragent"),i=f("./keyboard/textinput").TextInput,r=f("./mouse/mouse_handler").MouseHandler,o=f("./mouse/fold_handler").FoldHandler,t=f("./keyboard/keybinding").KeyBinding,e=f("./edit_session").EditSession,n=f("./search").Search,s=f("./range").Range,g=f("./lib/event_emitter").EventEmitter,m=f("./commands/command_manager").CommandManager,A=f("./commands/default_commands").commands,E=f("./config"),S=f("./token_iterator").TokenIterator,C=f("./keyboard/gutter_handler").GutterKeyboardHandler,q=f("./config").nls,Be=f("./clipboard"),se=f("./lib/keys"),j=f("./lib/event"),ct=f("./tooltip").HoverTooltip,G=function(){function b(w,W,ot){this.session,this.$toDestroy=[];var at=w.getContainerElement();this.container=at,this.renderer=w,this.id="editor"+ ++b.$uid,this.commands=new m(h.isMac?"mac":"win",A),typeof document=="object"&&(this.textInput=new i(w.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new r(this),new o(this)),this.keyBinding=new t(this),this.$search=new n().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=a.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(lt,Mt){Mt._$emitInputEvent.schedule(31)}),this.setSession(W||ot&&ot.session||new e("")),E.resetOptions(this),ot&&this.setOptions(ot),E._signal("editor",this)}return b.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},b.prototype.startOperation=function(w){this.session.startOperation(w)},b.prototype.endOperation=function(w){this.session.endOperation(w)},b.prototype.onStartOperation=function(w){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,w||(this.previousCommand=null)},b.prototype.onEndOperation=function(w){if(this.curOp&&this.session){if(w&&w.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var W=this.curOp.command,ot=W&&W.scrollIntoView;if(ot){switch(ot){case"center-animate":ot="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var at=this.selection.getRange(),lt=this.renderer.layerConfig;(at.start.row>=lt.lastRow||at.end.row<=lt.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}ot=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},b.prototype.$historyTracker=function(w){if(this.$mergeUndoDeltas){var W=this.prevOp,ot=this.$mergeableCommands,at=W.command&&w.command.name==W.command.name;if(w.command.name=="insertstring"){var lt=w.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),at=at&&this.mergeNextCommand&&(!/\s/.test(lt)||/\s/.test(W.args)),this.mergeNextCommand=!0}else at=at&&ot.indexOf(w.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(at=!1),at?this.session.mergeUndoDeltas=!0:ot.indexOf(w.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},b.prototype.setKeyboardHandler=function(w,W){if(w&&typeof w=="string"&&w!="ace"){this.$keybindingId=w;var ot=this;E.loadModule(["keybinding",w],function(at){ot.$keybindingId==w&&ot.keyBinding.setKeyboardHandler(at&&at.handler),W&&W()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(w),W&&W()},b.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},b.prototype.setSession=function(w){if(this.session!=w){this.curOp&&this.endOperation(),this.curOp={};var W=this.session;if(W){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 ot=this.session.getSelection();ot.off("changeCursor",this.$onCursorChange),ot.off("changeSelection",this.$onSelectionChange)}this.session=w,w?(this.$onDocumentChange=this.onDocumentChange.bind(this),w.on("change",this.$onDocumentChange),this.renderer.setSession(w),this.$onChangeMode=this.onChangeMode.bind(this),w.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),w.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),w.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),w.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),w.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),w.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=w.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(w)),this._signal("changeSession",{session:w,oldSession:W}),this.curOp=null,W&&W._signal("changeEditor",{oldEditor:this}),W&&(W.$editor=null),w&&w._signal("changeEditor",{editor:this}),w&&(w.$editor=this),w&&!w.destroyed&&w.bgTokenizer.scheduleStart()}},b.prototype.getSession=function(){return this.session},b.prototype.setValue=function(w,W){return this.session.doc.setValue(w),W?W==1?this.navigateFileEnd():W==-1&&this.navigateFileStart():this.selectAll(),w},b.prototype.getValue=function(){return this.session.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.resize=function(w){this.renderer.onResize(w)},b.prototype.setTheme=function(w,W){this.renderer.setTheme(w,W)},b.prototype.getTheme=function(){return this.renderer.getTheme()},b.prototype.setStyle=function(w){this.renderer.setStyle(w)},b.prototype.unsetStyle=function(w){this.renderer.unsetStyle(w)},b.prototype.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},b.prototype.setFontSize=function(w){this.setOption("fontSize",w)},b.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var w=this;this.$highlightPending=!0,setTimeout(function(){w.$highlightPending=!1;var W=w.session;if(!(!W||W.destroyed)){W.$bracketHighlight&&(W.$bracketHighlight.markerIds.forEach(function(Ut){W.removeMarker(Ut)}),W.$bracketHighlight=null);var ot=w.getCursorPosition(),at=w.getKeyboardHandler(),lt=at&&at.$getDirectionForHighlight&&at.$getDirectionForHighlight(w),Mt=W.getMatchingBracketRanges(ot,lt);if(!Mt){var zt=new S(W,ot.row,ot.column),hi=zt.getCurrentToken();if(hi&&/\b(?:tag-open|tag-name)/.test(hi.type)){var Ht=W.getMatchingTags(ot);Ht&&(Mt=[Ht.openTagName.isEmpty()?Ht.openTag:Ht.openTagName,Ht.closeTagName.isEmpty()?Ht.closeTag:Ht.closeTagName])}}if(!Mt&&W.$mode.getMatching&&(Mt=W.$mode.getMatching(w.session)),!Mt){w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide();return}var Vt="ace_bracket";Array.isArray(Mt)?Mt.length==1&&(Vt="ace_error_bracket"):Mt=[Mt],Mt.length==2&&(s.comparePoints(Mt[0].end,Mt[1].start)==0?Mt=[s.fromPoints(Mt[0].start,Mt[1].end)]:s.comparePoints(Mt[0].start,Mt[1].end)==0&&(Mt=[s.fromPoints(Mt[1].start,Mt[0].end)])),W.$bracketHighlight={ranges:Mt,markerIds:Mt.map(function(Ut){return W.addMarker(Ut,Vt,"text")})},w.getHighlightIndentGuides()&&w.renderer.$textLayer.$highlightIndentGuide()}},50)}},b.prototype.focus=function(){this.textInput.focus()},b.prototype.isFocused=function(){return this.textInput.isFocused()},b.prototype.blur=function(){this.textInput.blur()},b.prototype.onFocus=function(w){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",w))},b.prototype.onBlur=function(w){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",w))},b.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},b.prototype.onDocumentChange=function(w){var W=this.session.$useWrapMode,ot=w.start.row==w.end.row?w.end.row:1/0;this.renderer.updateLines(w.start.row,ot,W),this._signal("change",w),this.$cursorChange()},b.prototype.onTokenizerUpdate=function(w){var W=w.data;this.renderer.updateLines(W.first,W.last)},b.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},b.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},b.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},b.prototype.$updateHighlightActiveLine=function(){var w=this.getSession(),W;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(W=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(W=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(W=!1)),w.$highlightLineMarker&&!W)w.removeMarker(w.$highlightLineMarker.id),w.$highlightLineMarker=null;else if(!w.$highlightLineMarker&&W){var ot=new s(W.row,W.column,W.row,1/0);ot.id=w.addMarker(ot,"ace_active-line","screenLine"),w.$highlightLineMarker=ot}else W&&(w.$highlightLineMarker.start.row=W.row,w.$highlightLineMarker.end.row=W.row,w.$highlightLineMarker.start.column=W.column,w._signal("changeBackMarker"))},b.prototype.onSelectionChange=function(w){var W=this.session;if(W.$selectionMarker&&W.removeMarker(W.$selectionMarker),W.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var ot=this.selection.getRange(),at=this.getSelectionStyle();W.$selectionMarker=W.addMarker(ot,"ace_selection",at)}var lt=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(lt),this._signal("changeSelection")},b.prototype.$getSelectionHighLightRegexp=function(){var w=this.session,W=this.getSelectionRange();if(!(W.isEmpty()||W.isMultiLine())){var ot=W.start.column,at=W.end.column,lt=w.getLine(W.start.row),Mt=lt.substring(ot,at);if(!(Mt.length>5e3||!/[\w\d]/.test(Mt))){var zt=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:Mt}),hi=lt.substring(ot-1,at+1);if(zt.test(hi))return zt}}},b.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},b.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},b.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},b.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},b.prototype.onChangeMode=function(w){this.renderer.updateText(),this._emit("changeMode",w)},b.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},b.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},b.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},b.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},b.prototype.getCopyText=function(){var w=this.getSelectedText(),W=this.session.doc.getNewLineCharacter(),ot=!1;if(!w&&this.$copyWithEmptySelection){ot=!0;for(var at=this.selection.getAllRanges(),lt=0;lt<at.length;lt++){var Mt=at[lt];lt&&at[lt-1].start.row==Mt.start.row||(w+=this.session.getLine(Mt.start.row)+W)}}var zt={text:w};return this._signal("copy",zt),Be.lineMode=ot?zt.text:!1,zt.text},b.prototype.onCopy=function(){this.commands.exec("copy",this)},b.prototype.onCut=function(){this.commands.exec("cut",this)},b.prototype.onPaste=function(w,W){var ot={text:w,event:W};this.commands.exec("paste",this,ot)},b.prototype.$handlePaste=function(w){typeof w=="string"&&(w={text:w}),this._signal("paste",w);var W=w.text,ot=W===Be.lineMode,at=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)ot?at.insert({row:this.selection.lead.row,column:0},W):this.insert(W);else if(ot)this.selection.rangeList.ranges.forEach(function(Vt){at.insert({row:Vt.start.row,column:0},W)});else{var lt=W.split(/\r\n|\r|\n/),Mt=this.selection.rangeList.ranges,zt=lt.length==2&&(!lt[0]||!lt[1]);if(lt.length!=Mt.length||zt)return this.commands.exec("insertstring",this,W);for(var hi=Mt.length;hi--;){var Ht=Mt[hi];Ht.isEmpty()||at.remove(Ht),at.insert(Ht.start,lt[hi])}}},b.prototype.execCommand=function(w,W){return this.commands.exec(w,this,W)},b.prototype.insert=function(w,W){var ot=this.session,at=ot.getMode(),lt=this.getCursorPosition();if(this.getBehavioursEnabled()&&!W){var Mt=at.transformAction(ot.getState(lt.row),"insertion",this,ot,w);Mt&&(w!==Mt.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),w=Mt.text)}if(w==" "&&(w=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&w.indexOf(`
|
213
213
|
`)==-1){var zt=s.fromPoints(lt,lt);zt.end.column+=w.length,this.session.remove(zt)}}else{var zt=this.getSelectionRange();lt=this.session.remove(zt),this.clearSelection()}if(w==`
|
214
214
|
`||w==`\r
|
215
215
|
`){var Ut=ot.getLine(lt.row);if(lt.column>Ut.search(/\S|$/)){var hi=Ut.substr(lt.column).search(/\S|$/);ot.doc.removeInLine(lt.row,lt.column,lt.column+hi)}}this.clearSelection();var Ht=lt.column,Vt=ot.getState(lt.row),Ut=ot.getLine(lt.row),Jt=at.checkOutdent(Vt,Ut,w);if(ot.insert(lt,w),Mt&&Mt.selection&&(Mt.selection.length==2?this.selection.setSelectionRange(new s(lt.row,Ht+Mt.selection[0],lt.row,Ht+Mt.selection[1])):this.selection.setSelectionRange(new s(lt.row+Mt.selection[0],Mt.selection[1],lt.row+Mt.selection[2],Mt.selection[3]))),this.$enableAutoIndent){if(ot.getDocument().isNewLine(w)){var di=at.getNextLineIndent(Vt,Ut.slice(0,lt.column),ot.getTabString());ot.insert({row:lt.row+1,column:0},di)}Jt&&at.autoOutdent(Vt,ot,lt.row)}},b.prototype.autoIndent=function(){for(var w=this.session,W=w.getMode(),ot=this.selection.isEmpty()?[new s(0,0,w.doc.getLength()-1,0)]:this.selection.getAllRanges(),at="",lt="",Mt="",zt=w.getTabString(),hi=0;hi<ot.length;hi++)for(var Ht=ot[hi].start.row,Vt=ot[hi].end.row,Ut=Ht;Ut<=Vt;Ut++){Ut>0&&(at=w.getState(Ut-1),lt=w.getLine(Ut-1),Mt=W.getNextLineIndent(at,lt,zt));var Jt=w.getLine(Ut),di=W.$getIndent(Jt);if(Mt!==di){if(di.length>0){var fi=new s(Ut,0,Ut,di.length);w.remove(fi)}Mt.length>0&&w.insert({row:Ut,column:0},Mt)}W.autoOutdent(at,w,Ut)}},b.prototype.onTextInput=function(w,W){if(!W)return this.keyBinding.onTextInput(w);this.startOperation({command:{name:"insertstring"}});var ot=this.applyComposition.bind(this,w,W);this.selection.rangeCount?this.forEachSelection(ot):ot(),this.endOperation()},b.prototype.applyComposition=function(w,W){if(W.extendLeft||W.extendRight){var ot=this.selection.getRange();ot.start.column-=W.extendLeft,ot.end.column+=W.extendRight,ot.start.column<0&&(ot.start.row--,ot.start.column+=this.session.getLine(ot.start.row).length+1),this.selection.setRange(ot),!w&&!ot.isEmpty()&&this.remove()}if((w||!this.selection.isEmpty())&&this.insert(w,!0),W.restoreStart||W.restoreEnd){var ot=this.selection.getRange();ot.start.column-=W.restoreStart,ot.end.column-=W.restoreEnd,this.selection.setRange(ot)}},b.prototype.onCommandKey=function(w,W,ot){return this.keyBinding.onCommandKey(w,W,ot)},b.prototype.setOverwrite=function(w){this.session.setOverwrite(w)},b.prototype.getOverwrite=function(){return this.session.getOverwrite()},b.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},b.prototype.setScrollSpeed=function(w){this.setOption("scrollSpeed",w)},b.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},b.prototype.setDragDelay=function(w){this.setOption("dragDelay",w)},b.prototype.getDragDelay=function(){return this.getOption("dragDelay")},b.prototype.setSelectionStyle=function(w){this.setOption("selectionStyle",w)},b.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},b.prototype.setHighlightActiveLine=function(w){this.setOption("highlightActiveLine",w)},b.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},b.prototype.setHighlightGutterLine=function(w){this.setOption("highlightGutterLine",w)},b.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},b.prototype.setHighlightSelectedWord=function(w){this.setOption("highlightSelectedWord",w)},b.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},b.prototype.setAnimatedScroll=function(w){this.renderer.setAnimatedScroll(w)},b.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},b.prototype.setShowInvisibles=function(w){this.renderer.setShowInvisibles(w)},b.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},b.prototype.setDisplayIndentGuides=function(w){this.renderer.setDisplayIndentGuides(w)},b.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},b.prototype.setHighlightIndentGuides=function(w){this.renderer.setHighlightIndentGuides(w)},b.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},b.prototype.setShowPrintMargin=function(w){this.renderer.setShowPrintMargin(w)},b.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},b.prototype.setPrintMarginColumn=function(w){this.renderer.setPrintMarginColumn(w)},b.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},b.prototype.setReadOnly=function(w){this.setOption("readOnly",w)},b.prototype.getReadOnly=function(){return this.getOption("readOnly")},b.prototype.setBehavioursEnabled=function(w){this.setOption("behavioursEnabled",w)},b.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},b.prototype.setWrapBehavioursEnabled=function(w){this.setOption("wrapBehavioursEnabled",w)},b.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},b.prototype.setShowFoldWidgets=function(w){this.setOption("showFoldWidgets",w)},b.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},b.prototype.setFadeFoldWidgets=function(w){this.setOption("fadeFoldWidgets",w)},b.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},b.prototype.remove=function(w){this.selection.isEmpty()&&(w=="left"?this.selection.selectLeft():this.selection.selectRight());var W=this.getSelectionRange();if(this.getBehavioursEnabled()){var ot=this.session,at=ot.getState(W.start.row),lt=ot.getMode().transformAction(at,"deletion",this,ot,W);if(W.end.column===0){var Mt=ot.getTextRange(W);if(Mt[Mt.length-1]==`
|
216
216
|
`){var zt=ot.getLine(W.end.row);/^\s+$/.test(zt)&&(W.end.column=zt.length)}}lt&&(W=lt)}this.session.remove(W),this.clearSelection()},b.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var w=this.getSelectionRange();w.start.column==w.end.column&&w.start.row==w.end.row&&(w.end.column=0,w.end.row++),this.session.remove(w),this.clearSelection()},b.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var w=this.getCursorPosition();this.insert(`
|
217
|
-
`),this.moveCursorToPosition(w)},b.prototype.setGhostText=function(w,W){this.renderer.setGhostText(w,W)},b.prototype.removeGhostText=function(){this.renderer.removeGhostText()},b.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var w=this.getCursorPosition(),W=w.column;if(W!==0){var ot=this.session.getLine(w.row),at,lt;W<ot.length?(at=ot.charAt(W)+ot.charAt(W-1),lt=new s(w.row,W-1,w.row,W+1)):(at=ot.charAt(W-1)+ot.charAt(W-2),lt=new s(w.row,W-2,w.row,W)),this.session.replace(lt,at),this.session.selection.moveToPosition(lt.end)}}},b.prototype.toLowerCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var W=this.getSelectionRange(),ot=this.session.getTextRange(W);this.session.replace(W,ot.toLowerCase()),this.selection.setSelectionRange(w)},b.prototype.toUpperCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var W=this.getSelectionRange(),ot=this.session.getTextRange(W);this.session.replace(W,ot.toUpperCase()),this.selection.setSelectionRange(w)},b.prototype.indent=function(){var w=this.session,W=this.getSelectionRange();if(W.start.row<W.end.row){var ot=this.$getSelectedRows();w.indentRows(ot.first,ot.last," ");return}else if(W.start.column<W.end.column){var at=w.getTextRange(W);if(!/^\s+$/.test(at)){var ot=this.$getSelectedRows();w.indentRows(ot.first,ot.last," ");return}}var lt=w.getLine(W.start.row),Mt=W.start,zt=w.getTabSize(),hi=w.documentToScreenColumn(Mt.row,Mt.column);if(this.session.getUseSoftTabs())var Ht=zt-hi%zt,Vt=a.stringRepeat(" ",Ht);else{for(var Ht=hi%zt;lt[W.start.column-1]==" "&&Ht;)W.start.column--,Ht--;this.selection.setSelectionRange(W),Vt=" "}return this.insert(Vt)},b.prototype.blockIndent=function(){var w=this.$getSelectedRows();this.session.indentRows(w.first,w.last," ")},b.prototype.blockOutdent=function(){var w=this.session.getSelection();this.session.outdentRows(w.getRange())},b.prototype.sortLines=function(){for(var w=this.$getSelectedRows(),W=this.session,ot=[],at=w.first;at<=w.last;at++)ot.push(W.getLine(at));ot.sort(function(zt,hi){return zt.toLowerCase()<hi.toLowerCase()?-1:zt.toLowerCase()>hi.toLowerCase()?1:0});for(var lt=new s(0,0,0,0),at=w.first;at<=w.last;at++){var Mt=W.getLine(at);lt.start.row=at,lt.end.row=at,lt.end.column=Mt.length,W.replace(lt,ot[at-w.first])}},b.prototype.toggleCommentLines=function(){var w=this.session.getState(this.getCursorPosition().row),W=this.$getSelectedRows();this.session.getMode().toggleCommentLines(w,this.session,W.first,W.last)},b.prototype.toggleBlockComment=function(){var w=this.getCursorPosition(),W=this.session.getState(w.row),ot=this.getSelectionRange();this.session.getMode().toggleBlockComment(W,this.session,ot,w)},b.prototype.getNumberAt=function(w,W){var ot=/[\-]?[0-9]+(?:\.[0-9]+)?/g;ot.lastIndex=0;for(var at=this.session.getLine(w);ot.lastIndex<W;){var lt=ot.exec(at);if(lt.index<=W&<.index+lt[0].length>=W){var Mt={value:lt[0],start:lt.index,end:lt.index+lt[0].length};return Mt}}return null},b.prototype.modifyNumber=function(w){var W=this.selection.getCursor().row,ot=this.selection.getCursor().column,at=new s(W,ot-1,W,ot),lt=this.session.getTextRange(at);if(!isNaN(parseFloat(lt))&&isFinite(lt)){var Mt=this.getNumberAt(W,ot);if(Mt){var zt=Mt.value.indexOf(".")>=0?Mt.start+Mt.value.indexOf(".")+1:Mt.end,hi=Mt.start+Mt.value.length-zt,Ht=parseFloat(Mt.value);Ht*=Math.pow(10,hi),zt!==Mt.end&&ot<zt?w*=Math.pow(10,Mt.end-ot-1):w*=Math.pow(10,Mt.end-ot),Ht+=w,Ht/=Math.pow(10,hi);var Vt=Ht.toFixed(hi),Ut=new s(W,Mt.start,W,Mt.end);this.session.replace(Ut,Vt),this.moveCursorTo(W,Math.max(Mt.start+1,ot+Vt.length-Mt.value.length))}}else this.toggleWord()},b.prototype.toggleWord=function(){var w=this.selection.getCursor().row,W=this.selection.getCursor().column;this.selection.selectWord();var ot=this.getSelectedText(),at=this.selection.getWordRange().start.column,lt=ot.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),Mt=W-at-1;Mt<0&&(Mt=0);var zt=0,hi=0,Ht=this;ot.match(/[A-Za-z0-9_]+/)&<.forEach(function(Ci,Ai){hi=zt+Ci.length,Mt>=zt&&Mt<=hi&&(ot=Ci,Ht.selection.clearSelection(),Ht.moveCursorTo(w,zt+at),Ht.selection.selectTo(w,hi+at)),zt=hi});for(var Vt=this.$toggleWordPairs,Ut,Jt=0;Jt<Vt.length;Jt++)for(var di=Vt[Jt],fi=0;fi<=1;fi++){var mi=+!fi,gi=ot.match(new RegExp("^\\s?_?("+a.escapeRegExp(di[fi])+")\\s?$","i"));if(gi){var wi=ot.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(gi[1])+")($|\\s)","g"));wi&&(Ut=ot.replace(new RegExp(a.escapeRegExp(di[fi]),"i"),function(Ci){var Ai=di[mi];return Ci.toUpperCase()==Ci?Ai=Ai.toUpperCase():Ci.charAt(0).toUpperCase()==Ci.charAt(0)&&(Ai=Ai.substr(0,0)+di[mi].charAt(0).toUpperCase()+Ai.substr(1)),Ai}),this.insert(Ut),Ut="")}}},b.prototype.findLinkAt=function(w,W){var ot,at,lt=this.session.getLine(w),Mt=lt.split(/((?:https?|ftp):\/\/[\S]+)/),zt=W;zt<0&&(zt=0);var hi=0,Ht=0,Vt;try{for(var Ut=D(Mt),Jt=Ut.next();!Jt.done;Jt=Ut.next()){var di=Jt.value;if(Ht=hi+di.length,zt>=hi&&zt<=Ht&&di.match(/((?:https?|ftp):\/\/[\S]+)/)){Vt=di.replace(/[\s:.,'";}\]]+$/,"");break}hi=Ht}}catch(fi){ot={error:fi}}finally{try{Jt&&!Jt.done&&(at=Ut.return)&&at.call(Ut)}finally{if(ot)throw ot.error}}return Vt},b.prototype.openLink=function(){var w=this.selection.getCursor(),W=this.findLinkAt(w.row,w.column);return W&&window.open(W,"_blank"),W!=null},b.prototype.removeLines=function(){var w=this.$getSelectedRows();this.session.removeFullLines(w.first,w.last),this.clearSelection()},b.prototype.duplicateSelection=function(){var w=this.selection,W=this.session,ot=w.getRange(),at=w.isBackwards();if(ot.isEmpty()){var lt=ot.start.row;W.duplicateLines(lt,lt)}else{var Mt=at?ot.start:ot.end,zt=W.insert(Mt,W.getTextRange(ot));ot.start=Mt,ot.end=zt,w.setSelectionRange(ot,at)}},b.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},b.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},b.prototype.moveText=function(w,W,ot){return this.session.moveText(w,W,ot)},b.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},b.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},b.prototype.$moveLines=function(w,W){var ot,at,lt=this.selection;if(!lt.inMultiSelectMode||this.inVirtualSelectionMode){var Mt=lt.toOrientedRange();ot=this.$getSelectedRows(Mt),at=this.session.$moveLines(ot.first,ot.last,W?0:w),W&&w==-1&&(at=0),Mt.moveBy(at,0),lt.fromOrientedRange(Mt)}else{var zt=lt.rangeList.ranges;lt.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var hi=0,Ht=0,Vt=zt.length,Ut=0;Ut<Vt;Ut++){var Jt=Ut;zt[Ut].moveBy(hi,0),ot=this.$getSelectedRows(zt[Ut]);for(var di=ot.first,fi=ot.last;++Ut<Vt;){Ht&&zt[Ut].moveBy(Ht,0);var mi=this.$getSelectedRows(zt[Ut]);if(W&&mi.first!=fi)break;if(!W&&mi.first>fi+1)break;fi=mi.last}for(Ut--,hi=this.session.$moveLines(di,fi,W?0:w),W&&w==-1&&(Jt=Ut+1);Jt<=Ut;)zt[Jt].moveBy(hi,0),Jt++;W||(hi=0),Ht+=hi}lt.fromOrientedRange(lt.ranges[0]),lt.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},b.prototype.$getSelectedRows=function(w){return w=(w||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(w.start.row),last:this.session.getRowFoldEnd(w.end.row)}},b.prototype.onCompositionStart=function(w){this.renderer.showComposition(w)},b.prototype.onCompositionUpdate=function(w){this.renderer.setCompositionText(w)},b.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},b.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},b.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},b.prototype.isRowVisible=function(w){return w>=this.getFirstVisibleRow()&&w<=this.getLastVisibleRow()},b.prototype.isRowFullyVisible=function(w){return w>=this.renderer.getFirstFullyVisibleRow()&&w<=this.renderer.getLastFullyVisibleRow()},b.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},b.prototype.$moveByPage=function(w,W){var ot=this.renderer,at=this.renderer.layerConfig,lt=w*Math.floor(at.height/at.lineHeight);W===!0?this.selection.$moveSelection(function(){this.moveCursorBy(lt,0)}):W===!1&&(this.selection.moveCursorBy(lt,0),this.selection.clearSelection());var Mt=ot.scrollTop;ot.scrollBy(0,lt*at.lineHeight),W!=null&&ot.scrollCursorIntoView(null,.5),ot.animateScrolling(Mt)},b.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},b.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},b.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},b.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},b.prototype.scrollPageDown=function(){this.$moveByPage(1)},b.prototype.scrollPageUp=function(){this.$moveByPage(-1)},b.prototype.scrollToRow=function(w){this.renderer.scrollToRow(w)},b.prototype.scrollToLine=function(w,W,ot,at){this.renderer.scrollToLine(w,W,ot,at)},b.prototype.centerSelection=function(){var w=this.getSelectionRange(),W={row:Math.floor(w.start.row+(w.end.row-w.start.row)/2),column:Math.floor(w.start.column+(w.end.column-w.start.column)/2)};this.renderer.alignCursor(W,.5)},b.prototype.getCursorPosition=function(){return this.selection.getCursor()},b.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},b.prototype.getSelectionRange=function(){return this.selection.getRange()},b.prototype.selectAll=function(){this.selection.selectAll()},b.prototype.clearSelection=function(){this.selection.clearSelection()},b.prototype.moveCursorTo=function(w,W){this.selection.moveCursorTo(w,W)},b.prototype.moveCursorToPosition=function(w){this.selection.moveCursorToPosition(w)},b.prototype.jumpToMatching=function(w,W){var ot=this.getCursorPosition(),at=new S(this.session,ot.row,ot.column),lt=at.getCurrentToken(),Mt=0;lt&<.type.indexOf("tag-name")!==-1&&(lt=at.stepBackward());var zt=lt||at.stepForward();if(zt){var hi,Ht=!1,Vt={},Ut=ot.column-zt.start,Jt,di={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(zt.value.match(/[{}()\[\]]/g)){for(;Ut<zt.value.length&&!Ht;Ut++)if(di[zt.value[Ut]])switch(Jt=di[zt.value[Ut]]+"."+zt.type.replace("rparen","lparen"),isNaN(Vt[Jt])&&(Vt[Jt]=0),zt.value[Ut]){case"(":case"[":case"{":Vt[Jt]++;break;case")":case"]":case"}":Vt[Jt]--,Vt[Jt]===-1&&(hi="bracket",Ht=!0);break}}else zt.type.indexOf("tag-name")!==-1&&(isNaN(Vt[zt.value])&&(Vt[zt.value]=0),lt.value==="<"&&Mt>1?Vt[zt.value]++:lt.value==="</"&&Vt[zt.value]--,Vt[zt.value]===-1&&(hi="tag",Ht=!0));Ht||(lt=zt,Mt++,zt=at.stepForward(),Ut=0)}while(zt&&!Ht);if(hi){var fi,mi;if(hi==="bracket")fi=this.session.getBracketRange(ot),fi||(fi=new s(at.getCurrentTokenRow(),at.getCurrentTokenColumn()+Ut-1,at.getCurrentTokenRow(),at.getCurrentTokenColumn()+Ut-1),mi=fi.start,(W||mi.row===ot.row&&Math.abs(mi.column-ot.column)<2)&&(fi=this.session.getBracketRange(mi)));else if(hi==="tag"){if(!zt||zt.type.indexOf("tag-name")===-1)return;if(fi=new s(at.getCurrentTokenRow(),at.getCurrentTokenColumn()-2,at.getCurrentTokenRow(),at.getCurrentTokenColumn()-2),fi.compare(ot.row,ot.column)===0){var gi=this.session.getMatchingTags(ot);gi&&(gi.openTag.contains(ot.row,ot.column)?(fi=gi.closeTag,mi=fi.start):(fi=gi.openTag,gi.closeTag.start.row===ot.row&&gi.closeTag.start.column===ot.column?mi=fi.end:mi=fi.start))}mi=mi||fi.start}mi=fi&&fi.cursor||mi,mi&&(w?fi&&W?this.selection.setRange(fi):fi&&fi.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(mi.row,mi.column):this.selection.moveTo(mi.row,mi.column))}}},b.prototype.gotoLine=function(w,W,ot){this.selection.clearSelection(),this.session.unfold({row:w-1,column:W||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(w-1,W||0),this.isRowFullyVisible(w-1)||this.scrollToLine(w-1,!0,ot)},b.prototype.navigateTo=function(w,W){this.selection.moveTo(w,W)},b.prototype.navigateUp=function(w){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var W=this.selection.anchor.getPosition();return this.moveCursorToPosition(W)}this.selection.clearSelection(),this.selection.moveCursorBy(-w||-1,0)},b.prototype.navigateDown=function(w){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var W=this.selection.anchor.getPosition();return this.moveCursorToPosition(W)}this.selection.clearSelection(),this.selection.moveCursorBy(w||1,0)},b.prototype.navigateLeft=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorLeft();else{var W=this.getSelectionRange().start;this.moveCursorToPosition(W)}this.clearSelection()},b.prototype.navigateRight=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorRight();else{var W=this.getSelectionRange().end;this.moveCursorToPosition(W)}this.clearSelection()},b.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},b.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},b.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},b.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},b.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},b.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},b.prototype.replace=function(w,W){W&&this.$search.set(W);var ot=this.$search.find(this.session),at=0;return ot&&(this.$tryReplace(ot,w)&&(at=1),this.selection.setSelectionRange(ot),this.renderer.scrollSelectionIntoView(ot.start,ot.end)),at},b.prototype.replaceAll=function(w,W){W&&this.$search.set(W);var ot=this.$search.findAll(this.session),at=0;if(!ot.length)return at;var lt=this.getSelectionRange();this.selection.moveTo(0,0);for(var Mt=ot.length-1;Mt>=0;--Mt)this.$tryReplace(ot[Mt],w)&&at++;return this.selection.setSelectionRange(lt),at},b.prototype.$tryReplace=function(w,W){var ot=this.session.getTextRange(w);return W=this.$search.replace(ot,W),W!==null?(w.end=this.session.replace(w,W),w):null},b.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},b.prototype.find=function(w,W,ot){W||(W={}),typeof w=="string"||w instanceof RegExp?W.needle=w:typeof w=="object"&&_.mixin(W,w);var at=this.selection.getRange();W.needle==null&&(w=this.session.getTextRange(at)||this.$search.$options.needle,w||(at=this.session.getWordRange(at.start.row,at.start.column),w=this.session.getTextRange(at)),this.$search.set({needle:w})),this.$search.set(W),W.start||this.$search.set({start:at});var lt=this.$search.find(this.session);if(W.preventScroll)return lt;if(lt)return this.revealRange(lt,ot),lt;W.backwards?at.start=at.end:at.end=at.start,this.selection.setRange(at)},b.prototype.findNext=function(w,W){this.find({skipCurrent:!0,backwards:!1},w,W)},b.prototype.findPrevious=function(w,W){this.find(w,{skipCurrent:!0,backwards:!0},W)},b.prototype.revealRange=function(w,W){this.session.unfold(w),this.selection.setSelectionRange(w);var ot=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(w.start,w.end,.5),W!==!1&&this.renderer.animateScrolling(ot)},b.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(w){w.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()},b.prototype.setAutoScrollEditorIntoView=function(w){if(w){var W,ot=this,at=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var lt=this.$scrollAnchor;lt.style.cssText="position:absolute",this.container.insertBefore(lt,this.container.firstChild);var Mt=this.on("changeSelection",function(){at=!0}),zt=this.renderer.on("beforeRender",function(){at&&(W=ot.renderer.container.getBoundingClientRect())}),hi=this.renderer.on("afterRender",function(){if(at&&W&&(ot.isFocused()||ot.searchBox&&ot.searchBox.isFocused())){var Ht=ot.renderer,Vt=Ht.$cursorLayer.$pixelPos,Ut=Ht.layerConfig,Jt=Vt.top-Ut.offset;Vt.top>=0&&Jt+W.top<0?at=!0:Vt.top<Ut.height&&Vt.top+W.top+Ut.lineHeight>window.innerHeight?at=!1:at=null,at!=null&&(lt.style.top=Jt+"px",lt.style.left=Vt.left+"px",lt.style.height=Ut.lineHeight+"px",lt.scrollIntoView(at)),at=W=null}});this.setAutoScrollEditorIntoView=function(Ht){Ht||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",Mt),this.renderer.off("afterRender",hi),this.renderer.off("beforeRender",zt))}}},b.prototype.$resetCursorStyle=function(){var w=this.$cursorStyle||"ace",W=this.renderer.$cursorLayer;W&&(W.setSmoothBlinking(/smooth/.test(w)),W.isBlinking=!this.$readOnly&&w!="wide",x.setCssClass(W.element,"ace_slim-cursors",/slim/.test(w)))},b.prototype.prompt=function(w,W,ot){var at=this;E.loadModule("ace/ext/prompt",function(lt){lt.prompt(at,w,W,ot)})},b}();G.$uid=0,G.prototype.curOp=null,G.prototype.prevOp={},G.prototype.$mergeableCommands=["backspace","del","insertstring"],G.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"],["&&","||"],["==","!="]],_.implement(G.prototype,f),E.defineOptions(G.prototype,"editor",{selectionStyle:{set:function(b){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:b})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(b){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(b){var w=this;this.textInput.setReadOnly(b),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(ot){var at=!1;if(ot&&ot.type=="keydown"){if(at=ot&&ot.key&&ot.key.length==1&&!ot.ctrlKey&&!ot.metaKey,!at)return}else ot&&ot.type!=="exec"&&(at=!0);if(at){w.hoverTooltip||(w.hoverTooltip=new ct);var lt=x.createElement("div");lt.textContent=q("editor.tooltip.disable-editing","Editing is disabled"),w.hoverTooltip.isOpen||w.hoverTooltip.showForRange(w,w.getSelectionRange(),lt)}else w.hoverTooltip&&w.hoverTooltip.isOpen&&w.hoverTooltip.hide()});var W=this.textInput.getElement();b?(j.addListener(W,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(j.removeListener(W,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(b){this.textInput.setCopyWithEmptySelection(b)},initialValue:!1},cursorStyle:{set:function(b){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(b){this.setAutoScrollEditorIntoView(b)}},keyboardHandler:{set:function(b){this.setKeyboardHandler(b)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(b){this.session.setValue(b)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(b){this.setSession(b)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(b){this.renderer.$gutterLayer.setShowLineNumbers(b),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),b&&this.$relativeLineNumbers?U.attach(this):U.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(b){this.$showLineNumbers&&b?U.attach(this):U.detach(this)}},placeholder:{set:function(b){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var w=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(w&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),x.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!w&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var W=x.createElement("div");W.className="ace_placeholder",W.textContent=this.$placeholder||"",this.renderer.placeholderNode=W,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!w&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(b){var w={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(at){at.blur(),at.renderer.scroller.focus()},readOnly:!0},W=function(at){if(at.target==this.renderer.scroller&&at.keyCode===se.enter){at.preventDefault();var lt=this.getCursorPosition().row;this.isRowVisible(lt)||this.scrollToLine(lt,!0,!0),this.focus()}},ot;b?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(h.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",q("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",q("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",W.bind(this)),this.commands.addCommand(w),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",q("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",q("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),ot||(ot=new C(this)),ot.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",W.bind(this)),this.commands.removeCommand(w),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),ot&&ot.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(b){this.$textInputAriaLabel=b},initialValue:""},enableMobileMenu:{set:function(b){this.$enableMobileMenu=b},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 U={getText:function(b,w){return(Math.abs(b.selection.lead.row-w)||w+1+(w<9?"·":""))+""},getWidth:function(b,w,W){return Math.max(w.toString().length,(W.lastRow+1).toString().length,2)*W.characterWidth},update:function(b,w){w.renderer.$loop.schedule(w.renderer.CHANGE_GUTTER)},attach:function(b){b.renderer.$gutterLayer.$renderer=this,b.on("changeSelection",this.update),this.update(null,b)},detach:function(b){b.renderer.$gutterLayer.$renderer==this&&(b.renderer.$gutterLayer.$renderer=null),b.off("changeSelection",this.update),this.update(null,b)}};p.Editor=G}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(g,p,Se){var D=g("../lib/dom"),_=function(){function x(a,h){this.element=a,this.canvasHeight=h||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return x.prototype.moveContainer=function(a){D.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},x.prototype.pageChanged=function(a,h){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(h.firstRowScreen*h.lineHeight/this.canvasHeight)},x.prototype.computeLineTop=function(a,h,i){var r=h.firstRowScreen*h.lineHeight,o=Math.floor(r/this.canvasHeight),t=i.documentToScreenRow(a,0)*h.lineHeight;return t-o*this.canvasHeight},x.prototype.computeLineHeight=function(a,h,i){return h.lineHeight*i.getRowLineCount(a)},x.prototype.getLength=function(){return this.cells.length},x.prototype.get=function(a){return this.cells[a]},x.prototype.shift=function(){this.$cacheCell(this.cells.shift())},x.prototype.pop=function(){this.$cacheCell(this.cells.pop())},x.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var h=D.createFragment(this.element),i=0;i<a.length;i++)h.appendChild(a[i].element);this.element.appendChild(h)}else this.cells.push(a),this.element.appendChild(a.element)},x.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var h=D.createFragment(this.element),i=0;i<a.length;i++)h.appendChild(a[i].element);this.element.firstChild?this.element.insertBefore(h,this.element.firstChild):this.element.appendChild(h)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},x.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},x.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},x.prototype.createCell=function(a,h,i,r){var o=this.cellCache.pop();if(!o){var t=D.createElement("div");r&&r(t),this.element.appendChild(t),o={element:t,text:"",row:a}}return o.row=a,o},x}();p.Lines=_}),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(g,p,Se){var D=g("../lib/dom"),_=g("../lib/oop"),x=g("../lib/lang"),a=g("../lib/event_emitter").EventEmitter,h=g("./lines").Lines,i=g("../config").nls,r=function(){function t(e){this.element=D.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new h(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,n){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,n)},t.prototype.removeGutterDecoration=function(e,n){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,n)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var n=0;n<e.length;n++){var s=e[n],f=s.row,m=this.$annotations[f];m||(m=this.$annotations[f]={text:[],type:[],displayText:[]});var A=s.text,E=s.text,S=s.type;A=A?x.escapeHTML(A):s.html||"",E=E||s.html||"",m.text.indexOf(A)===-1&&(m.text.push(A),m.type.push(S),m.displayText.push(E));var C=s.className;C?m.className=C:S==="error"?m.className=" ace_error":S==="security"&&!/\bace_error\b/.test(m.className)?m.className=" ace_security":S==="warning"&&!/\bace_(error|security)\b/.test(m.className)?m.className=" ace_warning":S==="info"&&!m.className?m.className=" ace_info":S==="hint"&&!m.className&&(m.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var n=e.start.row,s=e.end.row-n;if(s!==0)if(e.action=="remove")this.$annotations.splice(n,s+1,null);else{var f=new Array(s+1);f.unshift(n,1),this.$annotations.splice.apply(this.$annotations,f)}}},t.prototype.update=function(e){this.config=e;var n=this.session,s=e.firstRow,f=Math.min(e.lastRow+e.gutterOffset,n.getLength()-1);this.oldLastRow=f,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var m=n.getNextFoldLine(s),A=m?m.start.row:1/0,E=null,S=-1,C=s;;){if(C>A&&(C=m.end.row+1,m=n.getNextFoldLine(C,m),A=m?m.start.row:1/0),C>f){for(;this.$lines.getLength()>S+1;)this.$lines.pop();break}E=this.$lines.get(++S),E?E.row=C:(E=this.$lines.createCell(C,e,this.session,o),this.$lines.push(E)),this.$renderCell(E,e,m,C),C++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var n=this.session,s=n.gutterRenderer||this.$renderer,f=n.$firstLineNumber,m=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||n.$useWrapMode)&&(m=n.getLength()+f-1);var A=s?s.getWidth(n,m,e):m.toString().length*e.characterWidth,E=this.$padding||this.$computePadding();A+=E.left+E.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var n=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<n.length;s++){var f=n[s];if(f.row>=this.$cursorRow){if(f.row>this.$cursorRow){var m=this.session.getFoldLine(this.$cursorRow);if(s>0&&m&&m.start.row==n[s-1].row)f=n[s-1];else break}f.element.className="ace_gutter-active-line "+f.element.className,this.$cursorCell=f;break}}}}},t.prototype.scrollLines=function(e){var n=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(n,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),f=this.oldLastRow;if(this.oldLastRow=s,!n||f<e.firstRow)return this.update(e);if(s<n.firstRow)return this.update(e);if(n.firstRow<e.firstRow)for(var m=this.session.getFoldedRowCount(n.firstRow,e.firstRow-1);m>0;m--)this.$lines.shift();if(f>s)for(var m=this.session.getFoldedRowCount(s+1,f);m>0;m--)this.$lines.pop();e.firstRow<n.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,n.firstRow-1)),s>f&&this.$lines.push(this.$renderLines(e,f+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,n,s){for(var f=[],m=n,A=this.session.getNextFoldLine(m),E=A?A.start.row:1/0;m>E&&(m=A.end.row+1,A=this.session.getNextFoldLine(m,A),E=A?A.start.row:1/0),!(m>s);){var S=this.$lines.createCell(m,e,this.session,o);this.$renderCell(S,e,A,m),f.push(S),m++}return f},t.prototype.$renderCell=function(e,n,s,f){var m=e.element,A=this.session,E=m.childNodes[0],S=m.childNodes[1],C=m.childNodes[2],q=m.childNodes[3],Be=C.firstChild,se=A.$firstLineNumber,j=A.$breakpoints,ct=A.$decorations,G=A.gutterRenderer||this.$renderer,U=this.$showFoldWidgets&&A.foldWidgets,b=s?s.start.row:Number.MAX_VALUE,w=n.lineHeight+"px",W=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",ot=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",at=(G?G.getText(A,f):f+se).toString();if(this.$highlightGutterLine&&(f==this.$cursorRow||s&&f<this.$cursorRow&&f>=b&&this.$cursorRow<=s.end.row)&&(W+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),j[f]&&(W+=j[f]),ct[f]&&(W+=ct[f]),this.$annotations[f]&&f!==b&&(W+=this.$annotations[f].className),U){var lt=U[f];lt==null&&(lt=U[f]=A.getFoldWidget(f))}if(lt){var Mt="ace_fold-widget ace_"+lt,zt=lt=="start"&&f==b&&f<s.end.row;if(zt){Mt+=" ace_closed";for(var hi="",Ht=!1,Vt=f+1;Vt<=s.end.row;Vt++)if(this.$annotations[Vt]){if(this.$annotations[Vt].className===" ace_error"){Ht=!0,hi=" ace_error_fold";break}this.$annotations[Vt].className===" ace_security"?(Ht=!0,hi=" ace_security_fold"):this.$annotations[Vt].className===" ace_warning"&&hi!==" ace_security_fold"&&(Ht=!0,hi=" ace_warning_fold")}W+=hi}else Mt+=" ace_open";S.className!=Mt&&(S.className=Mt),D.setStyle(S.style,"height",w),D.setStyle(S.style,"display","inline-block"),S.setAttribute("role","button"),S.setAttribute("tabindex","-1");var Ut=A.getFoldWidgetRange(f);Ut?S.setAttribute("aria-label",i("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[Ut.start.row+1,Ut.end.row+1])):s?S.setAttribute("aria-label",i("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):S.setAttribute("aria-label",i("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[f+1])),zt?(S.setAttribute("aria-expanded","false"),S.setAttribute("title",i("gutter.code-folding.closed.title","Unfold code"))):(S.setAttribute("aria-expanded","true"),S.setAttribute("title",i("gutter.code-folding.open.title","Fold code")))}else S&&(D.setStyle(S.style,"display","none"),S.setAttribute("tabindex","0"),S.removeAttribute("role"),S.removeAttribute("aria-label"));var Jt=this.session.$gutterCustomWidgets[f];if(Jt?this.$addCustomWidget(f,Jt,e):q&&this.$removeCustomWidget(f,e),Ht&&this.$showFoldedAnnotations){C.className="ace_gutter_annotation",Be.className=ot,Be.className+=hi,D.setStyle(Be.style,"height",w),D.setStyle(C.style,"display","block"),D.setStyle(C.style,"height",w);var di;switch(hi){case" ace_error_fold":di=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[at]);break;case" ace_security_fold":di=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[at]);break;case" ace_warning_fold":di=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[at]);break}C.setAttribute("aria-label",di),C.setAttribute("tabindex","-1"),C.setAttribute("role","button")}else if(this.$annotations[f]){C.className="ace_gutter_annotation",Be.className=ot,this.$useSvgGutterIcons?Be.className+=this.$annotations[f].className:m.classList.add(this.$annotations[f].className.replace(" ","")),D.setStyle(Be.style,"height",w),D.setStyle(C.style,"display","block"),D.setStyle(C.style,"height",w);var di;switch(this.$annotations[f].className){case" ace_error":di=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[at]);break;case" ace_security":di=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[at]);break;case" ace_warning":di=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[at]);break;case" ace_info":di=i("gutter.annotation.aria-label.info","Info, read annotations row $0",[at]);break;case" ace_hint":di=i("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[at]);break}C.setAttribute("aria-label",di),C.setAttribute("tabindex","-1"),C.setAttribute("role","button")}else D.setStyle(C.style,"display","none"),C.removeAttribute("aria-label"),C.removeAttribute("role"),C.setAttribute("tabindex","0");return at!==E.data&&(E.data=at),m.className!=W&&(m.className=W),D.setStyle(e.element.style,"height",this.$lines.computeLineHeight(f,n,A)+"px"),D.setStyle(e.element.style,"top",this.$lines.computeLineTop(f,n,A)+"px"),e.text=at,C.style.display==="none"&&S.style.display==="none"&&!Jt?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?D.addCssClass(this.element,"ace_folding-enabled"):D.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,n){var s=n||this.$getGutterCell(e);if(s&&s.element){var f=s.element.childNodes[1];f&&D.setStyle(f.style,"display","none")}},t.prototype.$showFoldWidget=function(e,n){var s=n||this.$getGutterCell(e);if(s&&s.element){var f=s.element.childNodes[1];f&&this.session.foldWidgets&&this.session.foldWidgets[s.row]&&D.setStyle(f.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var n=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return n[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,n,s){var f=n.className,m=n.label,A=n.title,E=n.callbacks;this.session.$gutterCustomWidgets[e]={className:f,label:m,title:A,callbacks:E},this.$hideFoldWidget(e,s);var S=s||this.$getGutterCell(e);if(S&&S.element){var C=S.element.querySelector(".ace_custom-widget");C&&C.remove(),C=D.createElement("span"),C.className="ace_custom-widget ".concat(f),C.setAttribute("tabindex","-1"),C.setAttribute("role","button"),C.setAttribute("aria-label",m),C.setAttribute("title",A),D.setStyle(C.style,"display","inline-block"),D.setStyle(C.style,"height","inherit"),E&&E.onClick&&C.addEventListener("click",function(q){E.onClick(q,e),q.stopPropagation()}),S.element.appendChild(C)}},t.prototype.$removeCustomWidget=function(e,n){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,n);var s=n||this.$getGutterCell(e);if(s&&s.element){var f=s.element.querySelector(".ace_custom-widget");f&&s.element.removeChild(f)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=D.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var n=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<n.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-n.right)return"foldWidgets"},t}();r.prototype.$fixedWidth=!1,r.prototype.$highlightGutterLine=!0,r.prototype.$renderer="",r.prototype.$showLineNumbers=!0,r.prototype.$showFoldWidgets=!0,_.implement(r.prototype,a);function o(t){var e=document.createTextNode("");t.appendChild(e);var n=D.createElement("span");t.appendChild(n);var s=D.createElement("span");t.appendChild(s);var f=D.createElement("span");return s.appendChild(f),t}p.Gutter=r}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(g,p,Se){var D=g("../range").Range,_=g("../lib/dom"),x=function(){function h(i){this.element=_.createElement("div"),this.element.className="ace_layer ace_marker-layer",i.appendChild(this.element)}return h.prototype.setPadding=function(i){this.$padding=i},h.prototype.setSession=function(i){this.session=i},h.prototype.setMarkers=function(i){this.markers=i},h.prototype.elt=function(i,r){var o=this.i!=-1&&this.element.childNodes[this.i];o?this.i++:(o=document.createElement("div"),this.element.appendChild(o),this.i=-1),o.style.cssText=r,o.className=i},h.prototype.update=function(i){if(i){this.config=i,this.i=0;var r;for(var o in this.markers){var t=this.markers[o];if(!t.range){t.update(r,this,this.session,i);continue}var e=t.range.clipRows(i.firstRow,i.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var n=this.$getTop(e.start.row,i),s=this.$padding+e.start.column*i.characterWidth;t.renderer(r,e,s,n,i)}else t.type=="fullLine"?this.drawFullLineMarker(r,e,t.clazz,i):t.type=="screenLine"?this.drawScreenLineMarker(r,e,t.clazz,i):e.isMultiLine()?t.type=="text"?this.drawTextMarker(r,e,t.clazz,i):this.drawMultiLineMarker(r,e,t.clazz,i):this.drawSingleLineMarker(r,e,t.clazz+" ace_start ace_br15",i)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},h.prototype.$getTop=function(i,r){return(i-r.firstRowScreen)*r.lineHeight},h.prototype.drawTextMarker=function(i,r,o,t,e){for(var n=this.session,s=r.start.row,f=r.end.row,m=s,A=0,E=0,S=n.getScreenLastRowColumn(m),C=new D(m,r.start.column,m,E);m<=f;m++)C.start.row=C.end.row=m,C.start.column=m==s?r.start.column:n.getRowWrapIndent(m),C.end.column=S,A=E,E=S,S=m+1<f?n.getScreenLastRowColumn(m+1):m==f?0:r.end.column,this.drawSingleLineMarker(i,C,o+(m==s?" ace_start":"")+" ace_br"+a(m==s||m==s+1&&r.start.column,A<E,E>S,m==f),t,m==f?0:1,e)},h.prototype.drawMultiLineMarker=function(i,r,o,t,e){var n=this.$padding,s=t.lineHeight,f=this.$getTop(r.start.row,t),m=n+r.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(r.start.row)){var A=r.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(i,A,o+" ace_br1 ace_start",t,null,e)}else this.elt(o+" ace_br1 ace_start","height:"+s+"px;right:"+n+"px;top:"+f+"px;left:"+m+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(r.end.row)){var A=r.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(i,A,o+" ace_br12",t,null,e)}else{f=this.$getTop(r.end.row,t);var E=r.end.column*t.characterWidth;this.elt(o+" ace_br12","height:"+s+"px;width:"+E+"px;top:"+f+"px;left:"+n+"px;"+(e||""))}if(s=(r.end.row-r.start.row-1)*t.lineHeight,!(s<=0)){f=this.$getTop(r.start.row+1,t);var S=(r.start.column?1:0)|(r.end.column?0:8);this.elt(o+(S?" ace_br"+S:""),"height:"+s+"px;right:"+n+"px;top:"+f+"px;left:"+n+"px;"+(e||""))}},h.prototype.drawSingleLineMarker=function(i,r,o,t,e,n){if(this.session.$bidiHandler.isBidiRow(r.start.row))return this.drawBidiSingleLineMarker(i,r,o,t,e,n);var s=t.lineHeight,f=(r.end.column+(e||0)-r.start.column)*t.characterWidth,m=this.$getTop(r.start.row,t),A=this.$padding+r.start.column*t.characterWidth;this.elt(o,"height:"+s+"px;width:"+f+"px;top:"+m+"px;left:"+A+"px;"+(n||""))},h.prototype.drawBidiSingleLineMarker=function(i,r,o,t,e,n){var s=t.lineHeight,f=this.$getTop(r.start.row,t),m=this.$padding,A=this.session.$bidiHandler.getSelections(r.start.column,r.end.column);A.forEach(function(E){this.elt(o,"height:"+s+"px;width:"+(E.width+(e||0))+"px;top:"+f+"px;left:"+(m+E.left)+"px;"+(n||""))},this)},h.prototype.drawFullLineMarker=function(i,r,o,t,e){var n=this.$getTop(r.start.row,t),s=t.lineHeight;r.start.row!=r.end.row&&(s+=this.$getTop(r.end.row,t)-n),this.elt(o,"height:"+s+"px;top:"+n+"px;left:0;right:0;"+(e||""))},h.prototype.drawScreenLineMarker=function(i,r,o,t,e){var n=this.$getTop(r.start.row,t),s=t.lineHeight;this.elt(o,"height:"+s+"px;top:"+n+"px;left:0;right:0;"+(e||""))},h}();x.prototype.$padding=0;function a(h,i,r,o){return(h?1:0)|(i?2:0)|(r?4:0)|(o?8:0)}p.Marker=x}),ace.define("ace/layer/text_util",["require","exports","module"],function(g,p,Se){var D=new Set(["text","rparen","lparen"]);p.isTextToken=function(_){return D.has(_)}}),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(g,p,Se){var D=g("../lib/oop"),_=g("../lib/dom"),x=g("../lib/lang"),a=g("./lines").Lines,h=g("../lib/event_emitter").EventEmitter,i=g("../config").nls,r=g("./text_util").isTextToken,o=function(){function t(e){this.dom=_,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,n=e.getNewLineCharacter()==`
|
218
|
-
`&&e.getNewLineMode()!="windows",s=n?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(n){this._signal("changeCharacterSize",n)}).bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var n=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var f=this.dom.createElement("span");f.className="ace_invisible ace_invisible_tab",f.textContent=x.stringRepeat(this.TAB_CHAR,s),n.push(f)}else n.push(this.dom.createTextNode(x.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var m="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?x.stringRepeat(this.SPACE_CHAR,this.tabSize):x.stringRepeat(" ",this.tabSize),S=this.showTabs?" ace_invisible ace_invisible_tab":"",C=this.showTabs?x.stringRepeat(this.TAB_CHAR,this.tabSize):E,f=this.dom.createElement("span");f.className=m+A,f.textContent=E,this.$tabStrings[" "]=f;var f=this.dom.createElement("span");f.className=m+S,f.textContent=C,this.$tabStrings[" "]=f}},t.prototype.updateLines=function(e,n,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var f=Math.max(n,e.firstRow),m=Math.min(s,e.lastRow),A=this.element.childNodes,E=0,C=e.firstRow;C<f;C++){var q=this.session.getFoldLine(C);if(q)if(q.containsRow(f)){f=q.start.row;break}else C=q.end.row;E++}for(var S=!1,C=f,q=this.session.getNextFoldLine(C),Be=q?q.start.row:1/0;C>Be&&(C=q.end.row+1,q=this.session.getNextFoldLine(C,q),Be=q?q.start.row:1/0),!(C>m);){var se=A[E++];if(se){this.dom.removeChildren(se),this.$renderLine(se,C,C==Be?q:!1),S&&(se.style.top=this.$lines.computeLineTop(C,e,this.session)+"px");var j=e.lineHeight*this.session.getRowLength(C)+"px";se.style.height!=j&&(S=!0,se.style.height=j)}C++}if(S)for(;E<this.$lines.cells.length;){var ct=this.$lines.cells[E++];ct.element.style.top=this.$lines.computeLineTop(ct.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var n=this.config;if(this.config=e,this.$lines.pageChanged(n,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,f=n?n.lastRow:-1;if(!n||f<e.firstRow)return this.update(e);if(s<n.firstRow)return this.update(e);if(!n||n.lastRow<e.firstRow)return this.update(e);if(e.lastRow<n.firstRow)return this.update(e);if(n.firstRow<e.firstRow)for(var m=this.session.getFoldedRowCount(n.firstRow,e.firstRow-1);m>0;m--)this.$lines.shift();if(n.lastRow>e.lastRow)for(var m=this.session.getFoldedRowCount(e.lastRow+1,n.lastRow);m>0;m--)this.$lines.pop();e.firstRow<n.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,n.firstRow-1)),e.lastRow>n.lastRow&&this.$lines.push(this.$renderLinesFragment(e,n.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,n,s){for(var f=[],m=n,A=this.session.getNextFoldLine(m),E=A?A.start.row:1/0;m>E&&(m=A.end.row+1,A=this.session.getNextFoldLine(m,A),E=A?A.start.row:1/0),!(m>s);){var S=this.$lines.createCell(m,e,this.session),C=S.element;this.dom.removeChildren(C),_.setStyle(C.style,"height",this.$lines.computeLineHeight(m,e,this.session)+"px"),_.setStyle(C.style,"top",this.$lines.computeLineTop(m,e,this.session)+"px"),this.$renderLine(C,m,m==E?A:!1),this.$useLineGroups()?C.className="ace_line_group":C.className="ace_line",f.push(S),m++}return f},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var n=e.firstRow,s=e.lastRow,f=this.$lines;f.getLength();)f.pop();f.push(this.$renderLinesFragment(e,n,s))},t.prototype.$renderToken=function(e,n,s,f){for(var m=this,A=/(\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,E=this.dom.createFragment(this.element),S,C=0;S=A.exec(f);){var q=S[1],Be=S[2],se=S[3],j=S[4],ct=S[5];if(!(!m.showSpaces&&Be)){var G=C!=S.index?f.slice(C,S.index):"";if(C=S.index+S[0].length,G&&E.appendChild(this.dom.createTextNode(G,this.element)),q){var U=m.session.getScreenTabSize(n+S.index);E.appendChild(m.$tabStrings[U].cloneNode(!0)),n+=U-1}else if(Be)if(m.showSpaces){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space",b.textContent=x.stringRepeat(m.SPACE_CHAR,Be.length),E.appendChild(b)}else E.appendChild(this.dom.createTextNode(Be,this.element));else if(se){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space ace_invalid",b.textContent=x.stringRepeat(m.SPACE_CHAR,se.length),E.appendChild(b)}else if(j){n+=1;var b=this.dom.createElement("span");b.style.width=m.config.characterWidth*2+"px",b.className=m.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=m.showSpaces?m.SPACE_CHAR:j,E.appendChild(b)}else if(ct){n+=1;var b=this.dom.createElement("span");b.style.width=m.config.characterWidth*2+"px",b.className="ace_cjk",b.textContent=ct,E.appendChild(b)}}}if(E.appendChild(this.dom.createTextNode(C?f.slice(C):f,this.element)),r(s.type))e.appendChild(E);else{var w="ace_"+s.type.replace(/\./g," ace_"),b=this.dom.createElement("span");s.type=="fold"&&(b.style.width=s.value.length*this.config.characterWidth+"px",b.setAttribute("title",i("inline-fold.closed.title","Unfold code"))),b.className=w,b.appendChild(E),e.appendChild(b)}return n+f.length},t.prototype.renderIndentGuide=function(e,n,s){var f=n.search(this.$indentGuideRe);if(f<=0||f>=s)return n;if(n[0]==" "){f-=f%this.tabSize;for(var m=f/this.tabSize,A=0;A<m;A++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),n.substr(f)}else if(n[0]==" "){for(var A=0;A<f;A++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),n.substr(f)}return this.$highlightIndentGuide(),n},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var n=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(n.row))[0].length,f=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:f,start:n.row};var m=this.session.$bracketHighlight;if(m){for(var A=this.session.$bracketHighlight.ranges,E=0;E<A.length;E++)if(n.row!==A[E].start.row){this.$highlightIndentGuideMarker.end=A[E].start.row+1,n.row>A[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[n.row]!==""&&n.column===e[n.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=n.row+1;E<e.length;E++){var S=e[E],C=/^\s*/.exec(S)[0].length;if(S!==""&&(this.$highlightIndentGuideMarker.end=E,C<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(".ace_indent-guide-active"),n=0;n<e.length;n++)e[n].classList.remove("ace_indent-guide-active")},t.prototype.$setIndentGuideActive=function(e,n){var s=this.session.doc.getLine(e.row);if(s!==""){var f=e.element;if(e.element.classList&&e.element.classList.contains("ace_line_group"))if(e.element.childNodes.length>0)f=e.element.childNodes[0];else return;var m=f.childNodes;if(m){var A=m[n-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var n=this.$highlightIndentGuideMarker.indentLevel;if(n!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var f=e[s];if(this.$highlightIndentGuideMarker.end&&f.row>=this.$highlightIndentGuideMarker.start+1){if(f.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(f,n)}}else for(var s=e.length-1;s>=0;s--){var f=e[s];if(this.$highlightIndentGuideMarker.end&&f.row<this.$highlightIndentGuideMarker.start){if(f.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(f,n)}}}},t.prototype.$createLineElement=function(e){var n=this.dom.createElement("div");return n.className="ace_line",n.style.height=this.config.lineHeight+"px",n},t.prototype.$renderWrappedLine=function(e,n,s){var f=0,m=0,A=s[0],E=0,S=this.$createLineElement();e.appendChild(S);for(var C=0;C<n.length;C++){var q=n[C],Be=q.value;if(C==0&&this.displayIndentGuides){if(f=Be.length,Be=this.renderIndentGuide(S,Be,A),!Be)continue;f-=Be.length}if(f+Be.length<A)E=this.$renderToken(S,E,q,Be),f+=Be.length;else{for(;f+Be.length>=A;)E=this.$renderToken(S,E,q,Be.substring(0,A-f)),Be=Be.substring(A-f),f=A,S=this.$createLineElement(),e.appendChild(S),S.appendChild(this.dom.createTextNode(x.stringRepeat(" ",s.indent),this.element)),m++,E=0,A=s[m]||Number.MAX_VALUE;Be.length!=0&&(f+=Be.length,E=this.$renderToken(S,E,q,Be))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(S,E,null,"",!0)},t.prototype.$renderSimpleLine=function(e,n){for(var s=0,f=0;f<n.length;f++){var m=n[f],A=m.value;if(!(f==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(e,A),!A))){if(s+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,m,A);s=this.$renderToken(e,s,m,A)}}},t.prototype.$renderOverflowMessage=function(e,n,s,f,m){s&&this.$renderToken(e,n,s,f.slice(0,this.MAX_LINE_LENGTH-n));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=m?"<hide>":"<click to see more...>",e.appendChild(A)},t.prototype.$renderLine=function(e,n,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(n)),s)var f=this.$getFoldLineTokens(n,s);else var f=this.session.getTokens(n);var m=e;if(f.length){var A=this.session.getRowSplitData(n);if(A&&A.length){this.$renderWrappedLine(e,f,A);var m=e.lastChild}else{var m=e;this.$useLineGroups()&&(m=this.$createLineElement(),e.appendChild(m)),this.$renderSimpleLine(m,f)}}else this.$useLineGroups()&&(m=this.$createLineElement(),e.appendChild(m));if(this.showEOL&&m){s&&(n=s.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=n==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,m.appendChild(E)}},t.prototype.$getFoldLineTokens=function(e,n){var s=this.session,f=[];function m(E,S,C){for(var q=0,Be=0;Be+E[q].value.length<S;)if(Be+=E[q].value.length,q++,q==E.length)return;if(Be!=S){var se=E[q].value.substring(S-Be);se.length>C-S&&(se=se.substring(0,C-S)),f.push({type:E[q].type,value:se}),Be=S+se.length,q+=1}for(;Be<C&&q<E.length;){var se=E[q].value;se.length+Be>C?f.push({type:E[q].type,value:se.substring(0,C-Be)}):f.push(E[q]),Be+=se.length,q+=1}}var A=s.getTokens(e);return n.walk(function(E,S,C,q,Be){E!=null?f.push({type:"fold",value:E}):(Be&&(A=s.getTokens(S)),A.length&&m(A,q,C))},n.end.row,this.session.getLine(n.end.row).length),f},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();o.prototype.EOF_CHAR="¶",o.prototype.EOL_CHAR_LF="¬",o.prototype.EOL_CHAR_CRLF="¤",o.prototype.EOL_CHAR=o.prototype.EOL_CHAR_LF,o.prototype.TAB_CHAR="—",o.prototype.SPACE_CHAR="·",o.prototype.$padding=0,o.prototype.MAX_LINE_LENGTH=1e4,o.prototype.showInvisibles=!1,o.prototype.showSpaces=!1,o.prototype.showTabs=!1,o.prototype.showEOL=!1,o.prototype.displayIndentGuides=!0,o.prototype.$highlightIndentGuides=!0,o.prototype.$tabStrings=[],o.prototype.destroy={},o.prototype.onChangeTabSize=o.prototype.$computeTabString,D.implement(o.prototype,h),p.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(g,p,Se){var D=g("../lib/dom"),_=function(){function x(a){this.element=D.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),D.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return x.prototype.$updateOpacity=function(a){for(var h=this.cursors,i=h.length;i--;)D.setStyle(h[i].style,"opacity",a?"":"0")},x.prototype.$startCssAnimation=function(){for(var a=this.cursors,h=a.length;h--;)a[h].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&D.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},x.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,D.removeCssClass(this.element,"ace_animate-blinking")},x.prototype.setPadding=function(a){this.$padding=a},x.prototype.setSession=function(a){this.session=a},x.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},x.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},x.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,D.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},x.prototype.addCursor=function(){var a=D.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},x.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},x.prototype.hideCursor=function(){this.isVisible=!1,D.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},x.prototype.showCursor=function(){this.isVisible=!0,D.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},x.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,D.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&D.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),D.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var h=(function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){a(!0),h()},this.blinkInterval),h()}},x.prototype.getPixelPosition=function(a,h){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(a),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,a.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),o=(i.row-(h?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:o}},x.prototype.isCursorInView=function(a,h){return a.top>=0&&a.top<h.maxHeight},x.prototype.update=function(a){this.config=a;var h=this.session.$selectionMarkers,i=0,r=0;(h===void 0||h.length===0)&&(h=[{cursor:null}]);for(var i=0,o=h.length;i<o;i++){var t=this.getPixelPosition(h[i].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&i>1)){var e=this.cursors[r++]||this.addCursor(),n=e.style;this.drawCursor?this.drawCursor(e,t,a,h[i],this.session):this.isCursorInView(t,a)?(D.setStyle(n,"display","block"),D.translate(e,t.left,t.top),D.setStyle(n,"width",Math.round(a.characterWidth)+"px"),D.setStyle(n,"height",a.lineHeight+"px")):D.setStyle(n,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},x.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?D.addCssClass(this.element,"ace_overwrite-cursors"):D.removeCssClass(this.element,"ace_overwrite-cursors"))},x.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},x}();_.prototype.$padding=0,_.prototype.drawCursor=null,p.Cursor=_}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(g,p,Se){var D=this&&this.__extends||function(){var e=function(n,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,m){f.__proto__=m}||function(f,m){for(var A in m)Object.prototype.hasOwnProperty.call(m,A)&&(f[A]=m[A])},e(n,s)};return function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function f(){this.constructor=n}n.prototype=s===null?Object.create(s):(f.prototype=s.prototype,new f)}}(),_=g("./lib/oop"),x=g("./lib/dom"),a=g("./lib/event"),h=g("./lib/event_emitter").EventEmitter,i=32768,r=function(){function e(n,s){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),n.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(n){this.element.style.display=n?"":"none",this.isVisible=n,this.coeff=1},e}();_.implement(r.prototype,h);var o=function(e){D(n,e);function n(s,f){var m=e.call(this,s,"-v")||this;return m.scrollTop=0,m.scrollHeight=0,f.$scrollbarWidth=m.width=x.scrollbarWidth(s.ownerDocument),m.inner.style.width=m.element.style.width=(m.width||15)+5+"px",m.$minWidth=0,m}return n.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},n.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},n.prototype.setHeight=function(s){this.element.style.height=s+"px"},n.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>i?(this.coeff=i/s,s=i):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},n.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},n}(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var t=function(e){D(n,e);function n(s,f){var m=e.call(this,s,"-h")||this;return m.scrollLeft=0,m.height=f.$scrollbarWidth,m.inner.style.height=m.element.style.height=(m.height||15)+5+"px",m}return n.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},n.prototype.getHeight=function(){return this.isVisible?this.height:0},n.prototype.setWidth=function(s){this.element.style.width=s+"px"},n.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},n.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},n.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},n}(r);p.ScrollBar=o,p.ScrollBarV=o,p.ScrollBarH=t,p.VScrollBar=o,p.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(g,p,Se){var D=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(s[m]=f[m])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function s(){this.constructor=e}e.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),_=g("./lib/oop"),x=g("./lib/dom"),a=g("./lib/event"),h=g("./lib/event_emitter").EventEmitter;x.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
|
217
|
+
`),this.moveCursorToPosition(w)},b.prototype.setGhostText=function(w,W){this.renderer.setGhostText(w,W)},b.prototype.removeGhostText=function(){this.renderer.removeGhostText()},b.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var w=this.getCursorPosition(),W=w.column;if(W!==0){var ot=this.session.getLine(w.row),at,lt;W<ot.length?(at=ot.charAt(W)+ot.charAt(W-1),lt=new s(w.row,W-1,w.row,W+1)):(at=ot.charAt(W-1)+ot.charAt(W-2),lt=new s(w.row,W-2,w.row,W)),this.session.replace(lt,at),this.session.selection.moveToPosition(lt.end)}}},b.prototype.toLowerCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var W=this.getSelectionRange(),ot=this.session.getTextRange(W);this.session.replace(W,ot.toLowerCase()),this.selection.setSelectionRange(w)},b.prototype.toUpperCase=function(){var w=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var W=this.getSelectionRange(),ot=this.session.getTextRange(W);this.session.replace(W,ot.toUpperCase()),this.selection.setSelectionRange(w)},b.prototype.indent=function(){var w=this.session,W=this.getSelectionRange();if(W.start.row<W.end.row){var ot=this.$getSelectedRows();w.indentRows(ot.first,ot.last," ");return}else if(W.start.column<W.end.column){var at=w.getTextRange(W);if(!/^\s+$/.test(at)){var ot=this.$getSelectedRows();w.indentRows(ot.first,ot.last," ");return}}var lt=w.getLine(W.start.row),Mt=W.start,zt=w.getTabSize(),hi=w.documentToScreenColumn(Mt.row,Mt.column);if(this.session.getUseSoftTabs())var Ht=zt-hi%zt,Vt=a.stringRepeat(" ",Ht);else{for(var Ht=hi%zt;lt[W.start.column-1]==" "&&Ht;)W.start.column--,Ht--;this.selection.setSelectionRange(W),Vt=" "}return this.insert(Vt)},b.prototype.blockIndent=function(){var w=this.$getSelectedRows();this.session.indentRows(w.first,w.last," ")},b.prototype.blockOutdent=function(){var w=this.session.getSelection();this.session.outdentRows(w.getRange())},b.prototype.sortLines=function(){for(var w=this.$getSelectedRows(),W=this.session,ot=[],at=w.first;at<=w.last;at++)ot.push(W.getLine(at));ot.sort(function(zt,hi){return zt.toLowerCase()<hi.toLowerCase()?-1:zt.toLowerCase()>hi.toLowerCase()?1:0});for(var lt=new s(0,0,0,0),at=w.first;at<=w.last;at++){var Mt=W.getLine(at);lt.start.row=at,lt.end.row=at,lt.end.column=Mt.length,W.replace(lt,ot[at-w.first])}},b.prototype.toggleCommentLines=function(){var w=this.session.getState(this.getCursorPosition().row),W=this.$getSelectedRows();this.session.getMode().toggleCommentLines(w,this.session,W.first,W.last)},b.prototype.toggleBlockComment=function(){var w=this.getCursorPosition(),W=this.session.getState(w.row),ot=this.getSelectionRange();this.session.getMode().toggleBlockComment(W,this.session,ot,w)},b.prototype.getNumberAt=function(w,W){var ot=/[\-]?[0-9]+(?:\.[0-9]+)?/g;ot.lastIndex=0;for(var at=this.session.getLine(w);ot.lastIndex<W;){var lt=ot.exec(at);if(lt.index<=W&<.index+lt[0].length>=W){var Mt={value:lt[0],start:lt.index,end:lt.index+lt[0].length};return Mt}}return null},b.prototype.modifyNumber=function(w){var W=this.selection.getCursor().row,ot=this.selection.getCursor().column,at=new s(W,ot-1,W,ot),lt=this.session.getTextRange(at);if(!isNaN(parseFloat(lt))&&isFinite(lt)){var Mt=this.getNumberAt(W,ot);if(Mt){var zt=Mt.value.indexOf(".")>=0?Mt.start+Mt.value.indexOf(".")+1:Mt.end,hi=Mt.start+Mt.value.length-zt,Ht=parseFloat(Mt.value);Ht*=Math.pow(10,hi),zt!==Mt.end&&ot<zt?w*=Math.pow(10,Mt.end-ot-1):w*=Math.pow(10,Mt.end-ot),Ht+=w,Ht/=Math.pow(10,hi);var Vt=Ht.toFixed(hi),Ut=new s(W,Mt.start,W,Mt.end);this.session.replace(Ut,Vt),this.moveCursorTo(W,Math.max(Mt.start+1,ot+Vt.length-Mt.value.length))}}else this.toggleWord()},b.prototype.toggleWord=function(){var w=this.selection.getCursor().row,W=this.selection.getCursor().column;this.selection.selectWord();var ot=this.getSelectedText(),at=this.selection.getWordRange().start.column,lt=ot.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),Mt=W-at-1;Mt<0&&(Mt=0);var zt=0,hi=0,Ht=this;ot.match(/[A-Za-z0-9_]+/)&<.forEach(function(Ci,Ai){hi=zt+Ci.length,Mt>=zt&&Mt<=hi&&(ot=Ci,Ht.selection.clearSelection(),Ht.moveCursorTo(w,zt+at),Ht.selection.selectTo(w,hi+at)),zt=hi});for(var Vt=this.$toggleWordPairs,Ut,Jt=0;Jt<Vt.length;Jt++)for(var di=Vt[Jt],fi=0;fi<=1;fi++){var mi=+!fi,gi=ot.match(new RegExp("^\\s?_?("+a.escapeRegExp(di[fi])+")\\s?$","i"));if(gi){var wi=ot.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(gi[1])+")($|\\s)","g"));wi&&(Ut=ot.replace(new RegExp(a.escapeRegExp(di[fi]),"i"),function(Ci){var Ai=di[mi];return Ci.toUpperCase()==Ci?Ai=Ai.toUpperCase():Ci.charAt(0).toUpperCase()==Ci.charAt(0)&&(Ai=Ai.substr(0,0)+di[mi].charAt(0).toUpperCase()+Ai.substr(1)),Ai}),this.insert(Ut),Ut="")}}},b.prototype.findLinkAt=function(w,W){var ot,at,lt=this.session.getLine(w),Mt=lt.split(/((?:https?|ftp):\/\/[\S]+)/),zt=W;zt<0&&(zt=0);var hi=0,Ht=0,Vt;try{for(var Ut=D(Mt),Jt=Ut.next();!Jt.done;Jt=Ut.next()){var di=Jt.value;if(Ht=hi+di.length,zt>=hi&&zt<=Ht&&di.match(/((?:https?|ftp):\/\/[\S]+)/)){Vt=di.replace(/[\s:.,'";}\]]+$/,"");break}hi=Ht}}catch(fi){ot={error:fi}}finally{try{Jt&&!Jt.done&&(at=Ut.return)&&at.call(Ut)}finally{if(ot)throw ot.error}}return Vt},b.prototype.openLink=function(){var w=this.selection.getCursor(),W=this.findLinkAt(w.row,w.column);return W&&window.open(W,"_blank"),W!=null},b.prototype.removeLines=function(){var w=this.$getSelectedRows();this.session.removeFullLines(w.first,w.last),this.clearSelection()},b.prototype.duplicateSelection=function(){var w=this.selection,W=this.session,ot=w.getRange(),at=w.isBackwards();if(ot.isEmpty()){var lt=ot.start.row;W.duplicateLines(lt,lt)}else{var Mt=at?ot.start:ot.end,zt=W.insert(Mt,W.getTextRange(ot));ot.start=Mt,ot.end=zt,w.setSelectionRange(ot,at)}},b.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},b.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},b.prototype.moveText=function(w,W,ot){return this.session.moveText(w,W,ot)},b.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},b.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},b.prototype.$moveLines=function(w,W){var ot,at,lt=this.selection;if(!lt.inMultiSelectMode||this.inVirtualSelectionMode){var Mt=lt.toOrientedRange();ot=this.$getSelectedRows(Mt),at=this.session.$moveLines(ot.first,ot.last,W?0:w),W&&w==-1&&(at=0),Mt.moveBy(at,0),lt.fromOrientedRange(Mt)}else{var zt=lt.rangeList.ranges;lt.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var hi=0,Ht=0,Vt=zt.length,Ut=0;Ut<Vt;Ut++){var Jt=Ut;zt[Ut].moveBy(hi,0),ot=this.$getSelectedRows(zt[Ut]);for(var di=ot.first,fi=ot.last;++Ut<Vt;){Ht&&zt[Ut].moveBy(Ht,0);var mi=this.$getSelectedRows(zt[Ut]);if(W&&mi.first!=fi)break;if(!W&&mi.first>fi+1)break;fi=mi.last}for(Ut--,hi=this.session.$moveLines(di,fi,W?0:w),W&&w==-1&&(Jt=Ut+1);Jt<=Ut;)zt[Jt].moveBy(hi,0),Jt++;W||(hi=0),Ht+=hi}lt.fromOrientedRange(lt.ranges[0]),lt.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},b.prototype.$getSelectedRows=function(w){return w=(w||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(w.start.row),last:this.session.getRowFoldEnd(w.end.row)}},b.prototype.onCompositionStart=function(w){this.renderer.showComposition(w)},b.prototype.onCompositionUpdate=function(w){this.renderer.setCompositionText(w)},b.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},b.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},b.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},b.prototype.isRowVisible=function(w){return w>=this.getFirstVisibleRow()&&w<=this.getLastVisibleRow()},b.prototype.isRowFullyVisible=function(w){return w>=this.renderer.getFirstFullyVisibleRow()&&w<=this.renderer.getLastFullyVisibleRow()},b.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},b.prototype.$moveByPage=function(w,W){var ot=this.renderer,at=this.renderer.layerConfig,lt=w*Math.floor(at.height/at.lineHeight);W===!0?this.selection.$moveSelection(function(){this.moveCursorBy(lt,0)}):W===!1&&(this.selection.moveCursorBy(lt,0),this.selection.clearSelection());var Mt=ot.scrollTop;ot.scrollBy(0,lt*at.lineHeight),W!=null&&ot.scrollCursorIntoView(null,.5),ot.animateScrolling(Mt)},b.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},b.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},b.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},b.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},b.prototype.scrollPageDown=function(){this.$moveByPage(1)},b.prototype.scrollPageUp=function(){this.$moveByPage(-1)},b.prototype.scrollToRow=function(w){this.renderer.scrollToRow(w)},b.prototype.scrollToLine=function(w,W,ot,at){this.renderer.scrollToLine(w,W,ot,at)},b.prototype.centerSelection=function(){var w=this.getSelectionRange(),W={row:Math.floor(w.start.row+(w.end.row-w.start.row)/2),column:Math.floor(w.start.column+(w.end.column-w.start.column)/2)};this.renderer.alignCursor(W,.5)},b.prototype.getCursorPosition=function(){return this.selection.getCursor()},b.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},b.prototype.getSelectionRange=function(){return this.selection.getRange()},b.prototype.selectAll=function(){this.selection.selectAll()},b.prototype.clearSelection=function(){this.selection.clearSelection()},b.prototype.moveCursorTo=function(w,W){this.selection.moveCursorTo(w,W)},b.prototype.moveCursorToPosition=function(w){this.selection.moveCursorToPosition(w)},b.prototype.jumpToMatching=function(w,W){var ot=this.getCursorPosition(),at=new S(this.session,ot.row,ot.column),lt=at.getCurrentToken(),Mt=0;lt&<.type.indexOf("tag-name")!==-1&&(lt=at.stepBackward());var zt=lt||at.stepForward();if(zt){var hi,Ht=!1,Vt={},Ut=ot.column-zt.start,Jt,di={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(zt.value.match(/[{}()\[\]]/g)){for(;Ut<zt.value.length&&!Ht;Ut++)if(di[zt.value[Ut]])switch(Jt=di[zt.value[Ut]]+"."+zt.type.replace("rparen","lparen"),isNaN(Vt[Jt])&&(Vt[Jt]=0),zt.value[Ut]){case"(":case"[":case"{":Vt[Jt]++;break;case")":case"]":case"}":Vt[Jt]--,Vt[Jt]===-1&&(hi="bracket",Ht=!0);break}}else zt.type.indexOf("tag-name")!==-1&&(isNaN(Vt[zt.value])&&(Vt[zt.value]=0),lt.value==="<"&&Mt>1?Vt[zt.value]++:lt.value==="</"&&Vt[zt.value]--,Vt[zt.value]===-1&&(hi="tag",Ht=!0));Ht||(lt=zt,Mt++,zt=at.stepForward(),Ut=0)}while(zt&&!Ht);if(hi){var fi,mi;if(hi==="bracket")fi=this.session.getBracketRange(ot),fi||(fi=new s(at.getCurrentTokenRow(),at.getCurrentTokenColumn()+Ut-1,at.getCurrentTokenRow(),at.getCurrentTokenColumn()+Ut-1),mi=fi.start,(W||mi.row===ot.row&&Math.abs(mi.column-ot.column)<2)&&(fi=this.session.getBracketRange(mi)));else if(hi==="tag"){if(!zt||zt.type.indexOf("tag-name")===-1)return;if(fi=new s(at.getCurrentTokenRow(),at.getCurrentTokenColumn()-2,at.getCurrentTokenRow(),at.getCurrentTokenColumn()-2),fi.compare(ot.row,ot.column)===0){var gi=this.session.getMatchingTags(ot);gi&&(gi.openTag.contains(ot.row,ot.column)?(fi=gi.closeTag,mi=fi.start):(fi=gi.openTag,gi.closeTag.start.row===ot.row&&gi.closeTag.start.column===ot.column?mi=fi.end:mi=fi.start))}mi=mi||fi.start}mi=fi&&fi.cursor||mi,mi&&(w?fi&&W?this.selection.setRange(fi):fi&&fi.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(mi.row,mi.column):this.selection.moveTo(mi.row,mi.column))}}},b.prototype.gotoLine=function(w,W,ot){this.selection.clearSelection(),this.session.unfold({row:w-1,column:W||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(w-1,W||0),this.isRowFullyVisible(w-1)||this.scrollToLine(w-1,!0,ot)},b.prototype.navigateTo=function(w,W){this.selection.moveTo(w,W)},b.prototype.navigateUp=function(w){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var W=this.selection.anchor.getPosition();return this.moveCursorToPosition(W)}this.selection.clearSelection(),this.selection.moveCursorBy(-w||-1,0)},b.prototype.navigateDown=function(w){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var W=this.selection.anchor.getPosition();return this.moveCursorToPosition(W)}this.selection.clearSelection(),this.selection.moveCursorBy(w||1,0)},b.prototype.navigateLeft=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorLeft();else{var W=this.getSelectionRange().start;this.moveCursorToPosition(W)}this.clearSelection()},b.prototype.navigateRight=function(w){if(this.selection.isEmpty())for(w=w||1;w--;)this.selection.moveCursorRight();else{var W=this.getSelectionRange().end;this.moveCursorToPosition(W)}this.clearSelection()},b.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},b.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},b.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},b.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},b.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},b.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},b.prototype.replace=function(w,W){W&&this.$search.set(W);var ot=this.$search.find(this.session),at=0;return ot&&(this.$tryReplace(ot,w)&&(at=1),this.selection.setSelectionRange(ot),this.renderer.scrollSelectionIntoView(ot.start,ot.end)),at},b.prototype.replaceAll=function(w,W){W&&this.$search.set(W);var ot=this.$search.findAll(this.session),at=0;if(!ot.length)return at;var lt=this.getSelectionRange();this.selection.moveTo(0,0);for(var Mt=ot.length-1;Mt>=0;--Mt)this.$tryReplace(ot[Mt],w)&&at++;return this.selection.setSelectionRange(lt),at},b.prototype.$tryReplace=function(w,W){var ot=this.session.getTextRange(w);return W=this.$search.replace(ot,W),W!==null?(w.end=this.session.replace(w,W),w):null},b.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},b.prototype.find=function(w,W,ot){W||(W={}),typeof w=="string"||w instanceof RegExp?W.needle=w:typeof w=="object"&&_.mixin(W,w);var at=this.selection.getRange();W.needle==null&&(w=this.session.getTextRange(at)||this.$search.$options.needle,w||(at=this.session.getWordRange(at.start.row,at.start.column),w=this.session.getTextRange(at)),this.$search.set({needle:w})),this.$search.set(W),W.start||this.$search.set({start:at});var lt=this.$search.find(this.session);if(W.preventScroll)return lt;if(lt)return this.revealRange(lt,ot),lt;W.backwards?at.start=at.end:at.end=at.start,this.selection.setRange(at)},b.prototype.findNext=function(w,W){this.find({skipCurrent:!0,backwards:!1},w,W)},b.prototype.findPrevious=function(w,W){this.find(w,{skipCurrent:!0,backwards:!0},W)},b.prototype.revealRange=function(w,W){this.session.unfold(w),this.selection.setSelectionRange(w);var ot=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(w.start,w.end,.5),W!==!1&&this.renderer.animateScrolling(ot)},b.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(w){w.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()},b.prototype.setAutoScrollEditorIntoView=function(w){if(w){var W,ot=this,at=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var lt=this.$scrollAnchor;lt.style.cssText="position:absolute",this.container.insertBefore(lt,this.container.firstChild);var Mt=this.on("changeSelection",function(){at=!0}),zt=this.renderer.on("beforeRender",function(){at&&(W=ot.renderer.container.getBoundingClientRect())}),hi=this.renderer.on("afterRender",function(){if(at&&W&&(ot.isFocused()||ot.searchBox&&ot.searchBox.isFocused())){var Ht=ot.renderer,Vt=Ht.$cursorLayer.$pixelPos,Ut=Ht.layerConfig,Jt=Vt.top-Ut.offset;Vt.top>=0&&Jt+W.top<0?at=!0:Vt.top<Ut.height&&Vt.top+W.top+Ut.lineHeight>window.innerHeight?at=!1:at=null,at!=null&&(lt.style.top=Jt+"px",lt.style.left=Vt.left+"px",lt.style.height=Ut.lineHeight+"px",lt.scrollIntoView(at)),at=W=null}});this.setAutoScrollEditorIntoView=function(Ht){Ht||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",Mt),this.renderer.off("afterRender",hi),this.renderer.off("beforeRender",zt))}}},b.prototype.$resetCursorStyle=function(){var w=this.$cursorStyle||"ace",W=this.renderer.$cursorLayer;W&&(W.setSmoothBlinking(/smooth/.test(w)),W.isBlinking=!this.$readOnly&&w!="wide",x.setCssClass(W.element,"ace_slim-cursors",/slim/.test(w)))},b.prototype.prompt=function(w,W,ot){var at=this;E.loadModule("ace/ext/prompt",function(lt){lt.prompt(at,w,W,ot)})},b}();G.$uid=0,G.prototype.curOp=null,G.prototype.prevOp={},G.prototype.$mergeableCommands=["backspace","del","insertstring"],G.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"],["&&","||"],["==","!="]],_.implement(G.prototype,g),E.defineOptions(G.prototype,"editor",{selectionStyle:{set:function(b){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:b})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(b){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(b){var w=this;this.textInput.setReadOnly(b),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(ot){var at=!1;if(ot&&ot.type=="keydown"){if(at=ot&&ot.key&&ot.key.length==1&&!ot.ctrlKey&&!ot.metaKey,!at)return}else ot&&ot.type!=="exec"&&(at=!0);if(at){w.hoverTooltip||(w.hoverTooltip=new ct);var lt=x.createElement("div");lt.textContent=q("editor.tooltip.disable-editing","Editing is disabled"),w.hoverTooltip.isOpen||w.hoverTooltip.showForRange(w,w.getSelectionRange(),lt)}else w.hoverTooltip&&w.hoverTooltip.isOpen&&w.hoverTooltip.hide()});var W=this.textInput.getElement();b?(j.addListener(W,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(j.removeListener(W,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(b){this.textInput.setCopyWithEmptySelection(b)},initialValue:!1},cursorStyle:{set:function(b){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(b){this.setAutoScrollEditorIntoView(b)}},keyboardHandler:{set:function(b){this.setKeyboardHandler(b)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(b){this.session.setValue(b)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(b){this.setSession(b)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(b){this.renderer.$gutterLayer.setShowLineNumbers(b),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),b&&this.$relativeLineNumbers?U.attach(this):U.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(b){this.$showLineNumbers&&b?U.attach(this):U.detach(this)}},placeholder:{set:function(b){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var w=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(w&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),x.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!w&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var W=x.createElement("div");W.className="ace_placeholder",W.textContent=this.$placeholder||"",this.renderer.placeholderNode=W,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!w&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(b){var w={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(at){at.blur(),at.renderer.scroller.focus()},readOnly:!0},W=function(at){if(at.target==this.renderer.scroller&&at.keyCode===se.enter){at.preventDefault();var lt=this.getCursorPosition().row;this.isRowVisible(lt)||this.scrollToLine(lt,!0,!0),this.focus()}},ot;b?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(h.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",q("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",q("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",W.bind(this)),this.commands.addCommand(w),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",q("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",q("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),ot||(ot=new C(this)),ot.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",W.bind(this)),this.commands.removeCommand(w),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),ot&&ot.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(b){this.$textInputAriaLabel=b},initialValue:""},enableMobileMenu:{set:function(b){this.$enableMobileMenu=b},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 U={getText:function(b,w){return(Math.abs(b.selection.lead.row-w)||w+1+(w<9?"·":""))+""},getWidth:function(b,w,W){return Math.max(w.toString().length,(W.lastRow+1).toString().length,2)*W.characterWidth},update:function(b,w){w.renderer.$loop.schedule(w.renderer.CHANGE_GUTTER)},attach:function(b){b.renderer.$gutterLayer.$renderer=this,b.on("changeSelection",this.update),this.update(null,b)},detach:function(b){b.renderer.$gutterLayer.$renderer==this&&(b.renderer.$gutterLayer.$renderer=null),b.off("changeSelection",this.update),this.update(null,b)}};p.Editor=G}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(f,p,Se){var D=f("../lib/dom"),_=function(){function x(a,h){this.element=a,this.canvasHeight=h||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return x.prototype.moveContainer=function(a){D.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},x.prototype.pageChanged=function(a,h){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(h.firstRowScreen*h.lineHeight/this.canvasHeight)},x.prototype.computeLineTop=function(a,h,i){var r=h.firstRowScreen*h.lineHeight,o=Math.floor(r/this.canvasHeight),t=i.documentToScreenRow(a,0)*h.lineHeight;return t-o*this.canvasHeight},x.prototype.computeLineHeight=function(a,h,i){return h.lineHeight*i.getRowLineCount(a)},x.prototype.getLength=function(){return this.cells.length},x.prototype.get=function(a){return this.cells[a]},x.prototype.shift=function(){this.$cacheCell(this.cells.shift())},x.prototype.pop=function(){this.$cacheCell(this.cells.pop())},x.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var h=D.createFragment(this.element),i=0;i<a.length;i++)h.appendChild(a[i].element);this.element.appendChild(h)}else this.cells.push(a),this.element.appendChild(a.element)},x.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var h=D.createFragment(this.element),i=0;i<a.length;i++)h.appendChild(a[i].element);this.element.firstChild?this.element.insertBefore(h,this.element.firstChild):this.element.appendChild(h)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},x.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},x.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},x.prototype.createCell=function(a,h,i,r){var o=this.cellCache.pop();if(!o){var t=D.createElement("div");r&&r(t),this.element.appendChild(t),o={element:t,text:"",row:a}}return o.row=a,o},x}();p.Lines=_}),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(f,p,Se){var D=f("../lib/dom"),_=f("../lib/oop"),x=f("../lib/lang"),a=f("../lib/event_emitter").EventEmitter,h=f("./lines").Lines,i=f("../config").nls,r=function(){function t(e){this.element=D.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new h(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,n){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,n)},t.prototype.removeGutterDecoration=function(e,n){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,n)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var n=0;n<e.length;n++){var s=e[n],g=s.row,m=this.$annotations[g];m||(m=this.$annotations[g]={text:[],type:[],displayText:[]});var A=s.text,E=s.text,S=s.type;A=A?x.escapeHTML(A):s.html||"",E=E||s.html||"",m.text.indexOf(A)===-1&&(m.text.push(A),m.type.push(S),m.displayText.push(E));var C=s.className;C?m.className=C:S==="error"?m.className=" ace_error":S==="security"&&!/\bace_error\b/.test(m.className)?m.className=" ace_security":S==="warning"&&!/\bace_(error|security)\b/.test(m.className)?m.className=" ace_warning":S==="info"&&!m.className?m.className=" ace_info":S==="hint"&&!m.className&&(m.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var n=e.start.row,s=e.end.row-n;if(s!==0)if(e.action=="remove")this.$annotations.splice(n,s+1,null);else{var g=new Array(s+1);g.unshift(n,1),this.$annotations.splice.apply(this.$annotations,g)}}},t.prototype.update=function(e){this.config=e;var n=this.session,s=e.firstRow,g=Math.min(e.lastRow+e.gutterOffset,n.getLength()-1);this.oldLastRow=g,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var m=n.getNextFoldLine(s),A=m?m.start.row:1/0,E=null,S=-1,C=s;;){if(C>A&&(C=m.end.row+1,m=n.getNextFoldLine(C,m),A=m?m.start.row:1/0),C>g){for(;this.$lines.getLength()>S+1;)this.$lines.pop();break}E=this.$lines.get(++S),E?E.row=C:(E=this.$lines.createCell(C,e,this.session,o),this.$lines.push(E)),this.$renderCell(E,e,m,C),C++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var n=this.session,s=n.gutterRenderer||this.$renderer,g=n.$firstLineNumber,m=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||n.$useWrapMode)&&(m=n.getLength()+g-1);var A=s?s.getWidth(n,m,e):m.toString().length*e.characterWidth,E=this.$padding||this.$computePadding();A+=E.left+E.right,A!==this.gutterWidth&&!isNaN(A)&&(this.gutterWidth=A,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",A))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var n=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<n.length;s++){var g=n[s];if(g.row>=this.$cursorRow){if(g.row>this.$cursorRow){var m=this.session.getFoldLine(this.$cursorRow);if(s>0&&m&&m.start.row==n[s-1].row)g=n[s-1];else break}g.element.className="ace_gutter-active-line "+g.element.className,this.$cursorCell=g;break}}}}},t.prototype.scrollLines=function(e){var n=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(n,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),g=this.oldLastRow;if(this.oldLastRow=s,!n||g<e.firstRow)return this.update(e);if(s<n.firstRow)return this.update(e);if(n.firstRow<e.firstRow)for(var m=this.session.getFoldedRowCount(n.firstRow,e.firstRow-1);m>0;m--)this.$lines.shift();if(g>s)for(var m=this.session.getFoldedRowCount(s+1,g);m>0;m--)this.$lines.pop();e.firstRow<n.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,n.firstRow-1)),s>g&&this.$lines.push(this.$renderLines(e,g+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,n,s){for(var g=[],m=n,A=this.session.getNextFoldLine(m),E=A?A.start.row:1/0;m>E&&(m=A.end.row+1,A=this.session.getNextFoldLine(m,A),E=A?A.start.row:1/0),!(m>s);){var S=this.$lines.createCell(m,e,this.session,o);this.$renderCell(S,e,A,m),g.push(S),m++}return g},t.prototype.$renderCell=function(e,n,s,g){var m=e.element,A=this.session,E=m.childNodes[0],S=m.childNodes[1],C=m.childNodes[2],q=m.childNodes[3],Be=C.firstChild,se=A.$firstLineNumber,j=A.$breakpoints,ct=A.$decorations,G=A.gutterRenderer||this.$renderer,U=this.$showFoldWidgets&&A.foldWidgets,b=s?s.start.row:Number.MAX_VALUE,w=n.lineHeight+"px",W=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",ot=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",at=(G?G.getText(A,g):g+se).toString();if(this.$highlightGutterLine&&(g==this.$cursorRow||s&&g<this.$cursorRow&&g>=b&&this.$cursorRow<=s.end.row)&&(W+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),j[g]&&(W+=j[g]),ct[g]&&(W+=ct[g]),this.$annotations[g]&&g!==b&&(W+=this.$annotations[g].className),U){var lt=U[g];lt==null&&(lt=U[g]=A.getFoldWidget(g))}if(lt){var Mt="ace_fold-widget ace_"+lt,zt=lt=="start"&&g==b&&g<s.end.row;if(zt){Mt+=" ace_closed";for(var hi="",Ht=!1,Vt=g+1;Vt<=s.end.row;Vt++)if(this.$annotations[Vt]){if(this.$annotations[Vt].className===" ace_error"){Ht=!0,hi=" ace_error_fold";break}this.$annotations[Vt].className===" ace_security"?(Ht=!0,hi=" ace_security_fold"):this.$annotations[Vt].className===" ace_warning"&&hi!==" ace_security_fold"&&(Ht=!0,hi=" ace_warning_fold")}W+=hi}else Mt+=" ace_open";S.className!=Mt&&(S.className=Mt),D.setStyle(S.style,"height",w),D.setStyle(S.style,"display","inline-block"),S.setAttribute("role","button"),S.setAttribute("tabindex","-1");var Ut=A.getFoldWidgetRange(g);Ut?S.setAttribute("aria-label",i("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[Ut.start.row+1,Ut.end.row+1])):s?S.setAttribute("aria-label",i("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):S.setAttribute("aria-label",i("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[g+1])),zt?(S.setAttribute("aria-expanded","false"),S.setAttribute("title",i("gutter.code-folding.closed.title","Unfold code"))):(S.setAttribute("aria-expanded","true"),S.setAttribute("title",i("gutter.code-folding.open.title","Fold code")))}else S&&(D.setStyle(S.style,"display","none"),S.setAttribute("tabindex","0"),S.removeAttribute("role"),S.removeAttribute("aria-label"));var Jt=this.session.$gutterCustomWidgets[g];if(Jt?this.$addCustomWidget(g,Jt,e):q&&this.$removeCustomWidget(g,e),Ht&&this.$showFoldedAnnotations){C.className="ace_gutter_annotation",Be.className=ot,Be.className+=hi,D.setStyle(Be.style,"height",w),D.setStyle(C.style,"display","block"),D.setStyle(C.style,"height",w);var di;switch(hi){case" ace_error_fold":di=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[at]);break;case" ace_security_fold":di=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[at]);break;case" ace_warning_fold":di=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[at]);break}C.setAttribute("aria-label",di),C.setAttribute("tabindex","-1"),C.setAttribute("role","button")}else if(this.$annotations[g]){C.className="ace_gutter_annotation",Be.className=ot,this.$useSvgGutterIcons?Be.className+=this.$annotations[g].className:m.classList.add(this.$annotations[g].className.replace(" ","")),D.setStyle(Be.style,"height",w),D.setStyle(C.style,"display","block"),D.setStyle(C.style,"height",w);var di;switch(this.$annotations[g].className){case" ace_error":di=i("gutter.annotation.aria-label.error","Error, read annotations row $0",[at]);break;case" ace_security":di=i("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[at]);break;case" ace_warning":di=i("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[at]);break;case" ace_info":di=i("gutter.annotation.aria-label.info","Info, read annotations row $0",[at]);break;case" ace_hint":di=i("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[at]);break}C.setAttribute("aria-label",di),C.setAttribute("tabindex","-1"),C.setAttribute("role","button")}else D.setStyle(C.style,"display","none"),C.removeAttribute("aria-label"),C.removeAttribute("role"),C.setAttribute("tabindex","0");return at!==E.data&&(E.data=at),m.className!=W&&(m.className=W),D.setStyle(e.element.style,"height",this.$lines.computeLineHeight(g,n,A)+"px"),D.setStyle(e.element.style,"top",this.$lines.computeLineTop(g,n,A)+"px"),e.text=at,C.style.display==="none"&&S.style.display==="none"&&!Jt?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?D.addCssClass(this.element,"ace_folding-enabled"):D.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,n){var s=n||this.$getGutterCell(e);if(s&&s.element){var g=s.element.childNodes[1];g&&D.setStyle(g.style,"display","none")}},t.prototype.$showFoldWidget=function(e,n){var s=n||this.$getGutterCell(e);if(s&&s.element){var g=s.element.childNodes[1];g&&this.session.foldWidgets&&this.session.foldWidgets[s.row]&&D.setStyle(g.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var n=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return n[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,n,s){var g=n.className,m=n.label,A=n.title,E=n.callbacks;this.session.$gutterCustomWidgets[e]={className:g,label:m,title:A,callbacks:E},this.$hideFoldWidget(e,s);var S=s||this.$getGutterCell(e);if(S&&S.element){var C=S.element.querySelector(".ace_custom-widget");C&&C.remove(),C=D.createElement("span"),C.className="ace_custom-widget ".concat(g),C.setAttribute("tabindex","-1"),C.setAttribute("role","button"),C.setAttribute("aria-label",m),C.setAttribute("title",A),D.setStyle(C.style,"display","inline-block"),D.setStyle(C.style,"height","inherit"),E&&E.onClick&&C.addEventListener("click",function(q){E.onClick(q,e),q.stopPropagation()}),S.element.appendChild(C)}},t.prototype.$removeCustomWidget=function(e,n){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,n);var s=n||this.$getGutterCell(e);if(s&&s.element){var g=s.element.querySelector(".ace_custom-widget");g&&s.element.removeChild(g)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=D.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var n=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<n.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-n.right)return"foldWidgets"},t}();r.prototype.$fixedWidth=!1,r.prototype.$highlightGutterLine=!0,r.prototype.$renderer="",r.prototype.$showLineNumbers=!0,r.prototype.$showFoldWidgets=!0,_.implement(r.prototype,a);function o(t){var e=document.createTextNode("");t.appendChild(e);var n=D.createElement("span");t.appendChild(n);var s=D.createElement("span");t.appendChild(s);var g=D.createElement("span");return s.appendChild(g),t}p.Gutter=r}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(f,p,Se){var D=f("../range").Range,_=f("../lib/dom"),x=function(){function h(i){this.element=_.createElement("div"),this.element.className="ace_layer ace_marker-layer",i.appendChild(this.element)}return h.prototype.setPadding=function(i){this.$padding=i},h.prototype.setSession=function(i){this.session=i},h.prototype.setMarkers=function(i){this.markers=i},h.prototype.elt=function(i,r){var o=this.i!=-1&&this.element.childNodes[this.i];o?this.i++:(o=document.createElement("div"),this.element.appendChild(o),this.i=-1),o.style.cssText=r,o.className=i},h.prototype.update=function(i){if(i){this.config=i,this.i=0;var r;for(var o in this.markers){var t=this.markers[o];if(!t.range){t.update(r,this,this.session,i);continue}var e=t.range.clipRows(i.firstRow,i.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var n=this.$getTop(e.start.row,i),s=this.$padding+e.start.column*i.characterWidth;t.renderer(r,e,s,n,i)}else t.type=="fullLine"?this.drawFullLineMarker(r,e,t.clazz,i):t.type=="screenLine"?this.drawScreenLineMarker(r,e,t.clazz,i):e.isMultiLine()?t.type=="text"?this.drawTextMarker(r,e,t.clazz,i):this.drawMultiLineMarker(r,e,t.clazz,i):this.drawSingleLineMarker(r,e,t.clazz+" ace_start ace_br15",i)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},h.prototype.$getTop=function(i,r){return(i-r.firstRowScreen)*r.lineHeight},h.prototype.drawTextMarker=function(i,r,o,t,e){for(var n=this.session,s=r.start.row,g=r.end.row,m=s,A=0,E=0,S=n.getScreenLastRowColumn(m),C=new D(m,r.start.column,m,E);m<=g;m++)C.start.row=C.end.row=m,C.start.column=m==s?r.start.column:n.getRowWrapIndent(m),C.end.column=S,A=E,E=S,S=m+1<g?n.getScreenLastRowColumn(m+1):m==g?0:r.end.column,this.drawSingleLineMarker(i,C,o+(m==s?" ace_start":"")+" ace_br"+a(m==s||m==s+1&&r.start.column,A<E,E>S,m==g),t,m==g?0:1,e)},h.prototype.drawMultiLineMarker=function(i,r,o,t,e){var n=this.$padding,s=t.lineHeight,g=this.$getTop(r.start.row,t),m=n+r.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(r.start.row)){var A=r.clone();A.end.row=A.start.row,A.end.column=this.session.getLine(A.start.row).length,this.drawBidiSingleLineMarker(i,A,o+" ace_br1 ace_start",t,null,e)}else this.elt(o+" ace_br1 ace_start","height:"+s+"px;right:"+n+"px;top:"+g+"px;left:"+m+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(r.end.row)){var A=r.clone();A.start.row=A.end.row,A.start.column=0,this.drawBidiSingleLineMarker(i,A,o+" ace_br12",t,null,e)}else{g=this.$getTop(r.end.row,t);var E=r.end.column*t.characterWidth;this.elt(o+" ace_br12","height:"+s+"px;width:"+E+"px;top:"+g+"px;left:"+n+"px;"+(e||""))}if(s=(r.end.row-r.start.row-1)*t.lineHeight,!(s<=0)){g=this.$getTop(r.start.row+1,t);var S=(r.start.column?1:0)|(r.end.column?0:8);this.elt(o+(S?" ace_br"+S:""),"height:"+s+"px;right:"+n+"px;top:"+g+"px;left:"+n+"px;"+(e||""))}},h.prototype.drawSingleLineMarker=function(i,r,o,t,e,n){if(this.session.$bidiHandler.isBidiRow(r.start.row))return this.drawBidiSingleLineMarker(i,r,o,t,e,n);var s=t.lineHeight,g=(r.end.column+(e||0)-r.start.column)*t.characterWidth,m=this.$getTop(r.start.row,t),A=this.$padding+r.start.column*t.characterWidth;this.elt(o,"height:"+s+"px;width:"+g+"px;top:"+m+"px;left:"+A+"px;"+(n||""))},h.prototype.drawBidiSingleLineMarker=function(i,r,o,t,e,n){var s=t.lineHeight,g=this.$getTop(r.start.row,t),m=this.$padding,A=this.session.$bidiHandler.getSelections(r.start.column,r.end.column);A.forEach(function(E){this.elt(o,"height:"+s+"px;width:"+(E.width+(e||0))+"px;top:"+g+"px;left:"+(m+E.left)+"px;"+(n||""))},this)},h.prototype.drawFullLineMarker=function(i,r,o,t,e){var n=this.$getTop(r.start.row,t),s=t.lineHeight;r.start.row!=r.end.row&&(s+=this.$getTop(r.end.row,t)-n),this.elt(o,"height:"+s+"px;top:"+n+"px;left:0;right:0;"+(e||""))},h.prototype.drawScreenLineMarker=function(i,r,o,t,e){var n=this.$getTop(r.start.row,t),s=t.lineHeight;this.elt(o,"height:"+s+"px;top:"+n+"px;left:0;right:0;"+(e||""))},h}();x.prototype.$padding=0;function a(h,i,r,o){return(h?1:0)|(i?2:0)|(r?4:0)|(o?8:0)}p.Marker=x}),ace.define("ace/layer/text_util",["require","exports","module"],function(f,p,Se){var D=new Set(["text","rparen","lparen"]);p.isTextToken=function(_){return D.has(_)}}),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(f,p,Se){var D=f("../lib/oop"),_=f("../lib/dom"),x=f("../lib/lang"),a=f("./lines").Lines,h=f("../lib/event_emitter").EventEmitter,i=f("../config").nls,r=f("./text_util").isTextToken,o=function(){function t(e){this.dom=_,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,n=e.getNewLineCharacter()==`
|
218
|
+
`&&e.getNewLineMode()!="windows",s=n?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(n){this._signal("changeCharacterSize",n)}).bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var n=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var g=this.dom.createElement("span");g.className="ace_invisible ace_invisible_tab",g.textContent=x.stringRepeat(this.TAB_CHAR,s),n.push(g)}else n.push(this.dom.createTextNode(x.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var m="ace_indent-guide",A=this.showSpaces?" ace_invisible ace_invisible_space":"",E=this.showSpaces?x.stringRepeat(this.SPACE_CHAR,this.tabSize):x.stringRepeat(" ",this.tabSize),S=this.showTabs?" ace_invisible ace_invisible_tab":"",C=this.showTabs?x.stringRepeat(this.TAB_CHAR,this.tabSize):E,g=this.dom.createElement("span");g.className=m+A,g.textContent=E,this.$tabStrings[" "]=g;var g=this.dom.createElement("span");g.className=m+S,g.textContent=C,this.$tabStrings[" "]=g}},t.prototype.updateLines=function(e,n,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var g=Math.max(n,e.firstRow),m=Math.min(s,e.lastRow),A=this.element.childNodes,E=0,C=e.firstRow;C<g;C++){var q=this.session.getFoldLine(C);if(q)if(q.containsRow(g)){g=q.start.row;break}else C=q.end.row;E++}for(var S=!1,C=g,q=this.session.getNextFoldLine(C),Be=q?q.start.row:1/0;C>Be&&(C=q.end.row+1,q=this.session.getNextFoldLine(C,q),Be=q?q.start.row:1/0),!(C>m);){var se=A[E++];if(se){this.dom.removeChildren(se),this.$renderLine(se,C,C==Be?q:!1),S&&(se.style.top=this.$lines.computeLineTop(C,e,this.session)+"px");var j=e.lineHeight*this.session.getRowLength(C)+"px";se.style.height!=j&&(S=!0,se.style.height=j)}C++}if(S)for(;E<this.$lines.cells.length;){var ct=this.$lines.cells[E++];ct.element.style.top=this.$lines.computeLineTop(ct.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var n=this.config;if(this.config=e,this.$lines.pageChanged(n,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,g=n?n.lastRow:-1;if(!n||g<e.firstRow)return this.update(e);if(s<n.firstRow)return this.update(e);if(!n||n.lastRow<e.firstRow)return this.update(e);if(e.lastRow<n.firstRow)return this.update(e);if(n.firstRow<e.firstRow)for(var m=this.session.getFoldedRowCount(n.firstRow,e.firstRow-1);m>0;m--)this.$lines.shift();if(n.lastRow>e.lastRow)for(var m=this.session.getFoldedRowCount(e.lastRow+1,n.lastRow);m>0;m--)this.$lines.pop();e.firstRow<n.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,n.firstRow-1)),e.lastRow>n.lastRow&&this.$lines.push(this.$renderLinesFragment(e,n.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,n,s){for(var g=[],m=n,A=this.session.getNextFoldLine(m),E=A?A.start.row:1/0;m>E&&(m=A.end.row+1,A=this.session.getNextFoldLine(m,A),E=A?A.start.row:1/0),!(m>s);){var S=this.$lines.createCell(m,e,this.session),C=S.element;this.dom.removeChildren(C),_.setStyle(C.style,"height",this.$lines.computeLineHeight(m,e,this.session)+"px"),_.setStyle(C.style,"top",this.$lines.computeLineTop(m,e,this.session)+"px"),this.$renderLine(C,m,m==E?A:!1),this.$useLineGroups()?C.className="ace_line_group":C.className="ace_line",g.push(S),m++}return g},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var n=e.firstRow,s=e.lastRow,g=this.$lines;g.getLength();)g.pop();g.push(this.$renderLinesFragment(e,n,s))},t.prototype.$renderToken=function(e,n,s,g){for(var m=this,A=/(\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,E=this.dom.createFragment(this.element),S,C=0;S=A.exec(g);){var q=S[1],Be=S[2],se=S[3],j=S[4],ct=S[5];if(!(!m.showSpaces&&Be)){var G=C!=S.index?g.slice(C,S.index):"";if(C=S.index+S[0].length,G&&E.appendChild(this.dom.createTextNode(G,this.element)),q){var U=m.session.getScreenTabSize(n+S.index);E.appendChild(m.$tabStrings[U].cloneNode(!0)),n+=U-1}else if(Be)if(m.showSpaces){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space",b.textContent=x.stringRepeat(m.SPACE_CHAR,Be.length),E.appendChild(b)}else E.appendChild(this.dom.createTextNode(Be,this.element));else if(se){var b=this.dom.createElement("span");b.className="ace_invisible ace_invisible_space ace_invalid",b.textContent=x.stringRepeat(m.SPACE_CHAR,se.length),E.appendChild(b)}else if(j){n+=1;var b=this.dom.createElement("span");b.style.width=m.config.characterWidth*2+"px",b.className=m.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=m.showSpaces?m.SPACE_CHAR:j,E.appendChild(b)}else if(ct){n+=1;var b=this.dom.createElement("span");b.style.width=m.config.characterWidth*2+"px",b.className="ace_cjk",b.textContent=ct,E.appendChild(b)}}}if(E.appendChild(this.dom.createTextNode(C?g.slice(C):g,this.element)),r(s.type))e.appendChild(E);else{var w="ace_"+s.type.replace(/\./g," ace_"),b=this.dom.createElement("span");s.type=="fold"&&(b.style.width=s.value.length*this.config.characterWidth+"px",b.setAttribute("title",i("inline-fold.closed.title","Unfold code"))),b.className=w,b.appendChild(E),e.appendChild(b)}return n+g.length},t.prototype.renderIndentGuide=function(e,n,s){var g=n.search(this.$indentGuideRe);if(g<=0||g>=s)return n;if(n[0]==" "){g-=g%this.tabSize;for(var m=g/this.tabSize,A=0;A<m;A++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),n.substr(g)}else if(n[0]==" "){for(var A=0;A<g;A++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),n.substr(g)}return this.$highlightIndentGuide(),n},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var n=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(n.row))[0].length,g=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:g,start:n.row};var m=this.session.$bracketHighlight;if(m){for(var A=this.session.$bracketHighlight.ranges,E=0;E<A.length;E++)if(n.row!==A[E].start.row){this.$highlightIndentGuideMarker.end=A[E].start.row+1,n.row>A[E].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[n.row]!==""&&n.column===e[n.row].length){this.$highlightIndentGuideMarker.dir=1;for(var E=n.row+1;E<e.length;E++){var S=e[E],C=/^\s*/.exec(S)[0].length;if(S!==""&&(this.$highlightIndentGuideMarker.end=E,C<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(".ace_indent-guide-active"),n=0;n<e.length;n++)e[n].classList.remove("ace_indent-guide-active")},t.prototype.$setIndentGuideActive=function(e,n){var s=this.session.doc.getLine(e.row);if(s!==""){var g=e.element;if(e.element.classList&&e.element.classList.contains("ace_line_group"))if(e.element.childNodes.length>0)g=e.element.childNodes[0];else return;var m=g.childNodes;if(m){var A=m[n-1];A&&A.classList&&A.classList.contains("ace_indent-guide")&&A.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var n=this.$highlightIndentGuideMarker.indentLevel;if(n!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var g=e[s];if(this.$highlightIndentGuideMarker.end&&g.row>=this.$highlightIndentGuideMarker.start+1){if(g.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,n)}}else for(var s=e.length-1;s>=0;s--){var g=e[s];if(this.$highlightIndentGuideMarker.end&&g.row<this.$highlightIndentGuideMarker.start){if(g.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(g,n)}}}},t.prototype.$createLineElement=function(e){var n=this.dom.createElement("div");return n.className="ace_line",n.style.height=this.config.lineHeight+"px",n},t.prototype.$renderWrappedLine=function(e,n,s){var g=0,m=0,A=s[0],E=0,S=this.$createLineElement();e.appendChild(S);for(var C=0;C<n.length;C++){var q=n[C],Be=q.value;if(C==0&&this.displayIndentGuides){if(g=Be.length,Be=this.renderIndentGuide(S,Be,A),!Be)continue;g-=Be.length}if(g+Be.length<A)E=this.$renderToken(S,E,q,Be),g+=Be.length;else{for(;g+Be.length>=A;)E=this.$renderToken(S,E,q,Be.substring(0,A-g)),Be=Be.substring(A-g),g=A,S=this.$createLineElement(),e.appendChild(S),S.appendChild(this.dom.createTextNode(x.stringRepeat(" ",s.indent),this.element)),m++,E=0,A=s[m]||Number.MAX_VALUE;Be.length!=0&&(g+=Be.length,E=this.$renderToken(S,E,q,Be))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(S,E,null,"",!0)},t.prototype.$renderSimpleLine=function(e,n){for(var s=0,g=0;g<n.length;g++){var m=n[g],A=m.value;if(!(g==0&&this.displayIndentGuides&&(A=this.renderIndentGuide(e,A),!A))){if(s+A.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,m,A);s=this.$renderToken(e,s,m,A)}}},t.prototype.$renderOverflowMessage=function(e,n,s,g,m){s&&this.$renderToken(e,n,s,g.slice(0,this.MAX_LINE_LENGTH-n));var A=this.dom.createElement("span");A.className="ace_inline_button ace_keyword ace_toggle_wrap",A.textContent=m?"<hide>":"<click to see more...>",e.appendChild(A)},t.prototype.$renderLine=function(e,n,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(n)),s)var g=this.$getFoldLineTokens(n,s);else var g=this.session.getTokens(n);var m=e;if(g.length){var A=this.session.getRowSplitData(n);if(A&&A.length){this.$renderWrappedLine(e,g,A);var m=e.lastChild}else{var m=e;this.$useLineGroups()&&(m=this.$createLineElement(),e.appendChild(m)),this.$renderSimpleLine(m,g)}}else this.$useLineGroups()&&(m=this.$createLineElement(),e.appendChild(m));if(this.showEOL&&m){s&&(n=s.end.row);var E=this.dom.createElement("span");E.className="ace_invisible ace_invisible_eol",E.textContent=n==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,m.appendChild(E)}},t.prototype.$getFoldLineTokens=function(e,n){var s=this.session,g=[];function m(E,S,C){for(var q=0,Be=0;Be+E[q].value.length<S;)if(Be+=E[q].value.length,q++,q==E.length)return;if(Be!=S){var se=E[q].value.substring(S-Be);se.length>C-S&&(se=se.substring(0,C-S)),g.push({type:E[q].type,value:se}),Be=S+se.length,q+=1}for(;Be<C&&q<E.length;){var se=E[q].value;se.length+Be>C?g.push({type:E[q].type,value:se.substring(0,C-Be)}):g.push(E[q]),Be+=se.length,q+=1}}var A=s.getTokens(e);return n.walk(function(E,S,C,q,Be){E!=null?g.push({type:"fold",value:E}):(Be&&(A=s.getTokens(S)),A.length&&m(A,q,C))},n.end.row,this.session.getLine(n.end.row).length),g},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();o.prototype.EOF_CHAR="¶",o.prototype.EOL_CHAR_LF="¬",o.prototype.EOL_CHAR_CRLF="¤",o.prototype.EOL_CHAR=o.prototype.EOL_CHAR_LF,o.prototype.TAB_CHAR="—",o.prototype.SPACE_CHAR="·",o.prototype.$padding=0,o.prototype.MAX_LINE_LENGTH=1e4,o.prototype.showInvisibles=!1,o.prototype.showSpaces=!1,o.prototype.showTabs=!1,o.prototype.showEOL=!1,o.prototype.displayIndentGuides=!0,o.prototype.$highlightIndentGuides=!0,o.prototype.$tabStrings=[],o.prototype.destroy={},o.prototype.onChangeTabSize=o.prototype.$computeTabString,D.implement(o.prototype,h),p.Text=o}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(f,p,Se){var D=f("../lib/dom"),_=function(){function x(a){this.element=D.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),D.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return x.prototype.$updateOpacity=function(a){for(var h=this.cursors,i=h.length;i--;)D.setStyle(h[i].style,"opacity",a?"":"0")},x.prototype.$startCssAnimation=function(){for(var a=this.cursors,h=a.length;h--;)a[h].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&D.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},x.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,D.removeCssClass(this.element,"ace_animate-blinking")},x.prototype.setPadding=function(a){this.$padding=a},x.prototype.setSession=function(a){this.session=a},x.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},x.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},x.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,D.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},x.prototype.addCursor=function(){var a=D.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},x.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},x.prototype.hideCursor=function(){this.isVisible=!1,D.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},x.prototype.showCursor=function(){this.isVisible=!0,D.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},x.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,D.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&D.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),D.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var h=(function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){a(!0),h()},this.blinkInterval),h()}},x.prototype.getPixelPosition=function(a,h){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(a),r=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,a.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),o=(i.row-(h?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:o}},x.prototype.isCursorInView=function(a,h){return a.top>=0&&a.top<h.maxHeight},x.prototype.update=function(a){this.config=a;var h=this.session.$selectionMarkers,i=0,r=0;(h===void 0||h.length===0)&&(h=[{cursor:null}]);for(var i=0,o=h.length;i<o;i++){var t=this.getPixelPosition(h[i].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&i>1)){var e=this.cursors[r++]||this.addCursor(),n=e.style;this.drawCursor?this.drawCursor(e,t,a,h[i],this.session):this.isCursorInView(t,a)?(D.setStyle(n,"display","block"),D.translate(e,t.left,t.top),D.setStyle(n,"width",Math.round(a.characterWidth)+"px"),D.setStyle(n,"height",a.lineHeight+"px")):D.setStyle(n,"display","none")}}for(;this.cursors.length>r;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},x.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?D.addCssClass(this.element,"ace_overwrite-cursors"):D.removeCssClass(this.element,"ace_overwrite-cursors"))},x.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},x}();_.prototype.$padding=0,_.prototype.drawCursor=null,p.Cursor=_}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(f,p,Se){var D=this&&this.__extends||function(){var e=function(n,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,m){g.__proto__=m}||function(g,m){for(var A in m)Object.prototype.hasOwnProperty.call(m,A)&&(g[A]=m[A])},e(n,s)};return function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function g(){this.constructor=n}n.prototype=s===null?Object.create(s):(g.prototype=s.prototype,new g)}}(),_=f("./lib/oop"),x=f("./lib/dom"),a=f("./lib/event"),h=f("./lib/event_emitter").EventEmitter,i=32768,r=function(){function e(n,s){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),n.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(n){this.element.style.display=n?"":"none",this.isVisible=n,this.coeff=1},e}();_.implement(r.prototype,h);var o=function(e){D(n,e);function n(s,g){var m=e.call(this,s,"-v")||this;return m.scrollTop=0,m.scrollHeight=0,g.$scrollbarWidth=m.width=x.scrollbarWidth(s.ownerDocument),m.inner.style.width=m.element.style.width=(m.width||15)+5+"px",m.$minWidth=0,m}return n.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},n.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},n.prototype.setHeight=function(s){this.element.style.height=s+"px"},n.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>i?(this.coeff=i/s,s=i):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},n.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},n}(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var t=function(e){D(n,e);function n(s,g){var m=e.call(this,s,"-h")||this;return m.scrollLeft=0,m.height=g.$scrollbarWidth,m.inner.style.height=m.element.style.height=(m.height||15)+5+"px",m}return n.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},n.prototype.getHeight=function(){return this.isVisible?this.height:0},n.prototype.setWidth=function(s){this.element.style.width=s+"px"},n.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},n.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},n.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},n}(r);p.ScrollBar=o,p.ScrollBarV=o,p.ScrollBarH=t,p.VScrollBar=o,p.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(f,p,Se){var D=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,g){s.__proto__=g}||function(s,g){for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(s[m]=g[m])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function s(){this.constructor=e}e.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),_=f("./lib/oop"),x=f("./lib/dom"),a=f("./lib/event"),h=f("./lib/event_emitter").EventEmitter;x.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
|
219
219
|
position: absolute;
|
220
220
|
background: rgba(128, 128, 128, 0.6);
|
221
221
|
-moz-box-sizing: border-box;
|
@@ -253,7 +253,7 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
253
253
|
.ace_editor>.ace_sb_grabbed {
|
254
254
|
z-index: 8;
|
255
255
|
background: #000;
|
256
|
-
}`,"ace_scrollbar.css",!1);var i=function(){function t(e,n){this.element=x.createElement("div"),this.element.className="ace_sb"+n,this.inner=x.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},t}();_.implement(i.prototype,h);var r=function(t){D(e,t);function e(n,s){var
|
256
|
+
}`,"ace_scrollbar.css",!1);var i=function(){function t(e,n){this.element=x.createElement("div"),this.element.className="ace_sb"+n,this.inner=x.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return t.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},t}();_.implement(i.prototype,h);var r=function(t){D(e,t);function e(n,s){var g=t.call(this,n,"-v")||this;return g.scrollTop=0,g.scrollHeight=0,g.parent=n,g.width=g.VScrollWidth,g.renderer=s,g.inner.style.width=g.element.style.width=(g.width||15)+"px",g.$minWidth=0,g}return e.prototype.onMouseDown=function(n,s){if(n==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var g=this,m=s.clientY,A=function(j){m=j.clientY},E=function(){clearInterval(Be)},S=s.clientY,C=this.thumbTop,q=function(){if(m!==void 0){var j=g.scrollTopFromThumbTop(C+m-S);j!==g.scrollTop&&g._emit("scroll",{data:j})}};a.capture(this.inner,A,E);var Be=setInterval(q,20);return a.preventDefault(s)}var se=s.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(se)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.height},e.prototype.scrollTopFromThumbTop=function(n){var s=n*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return s=s>>0,s<0?s=0:s>this.pageHeight-this.viewHeight&&(s=this.pageHeight-this.viewHeight),s},e.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},e.prototype.setHeight=function(n){this.height=Math.max(0,n),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},e.prototype.setScrollHeight=function(n,s){this.pageHeight===n&&!s||(this.pageHeight=n,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})))},e.prototype.setScrollTop=function(n){this.scrollTop=n,n<0&&(n=0),this.thumbTop=n*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},e}(i);r.prototype.setInnerHeight=r.prototype.setScrollHeight;var o=function(t){D(e,t);function e(n,s){var g=t.call(this,n,"-h")||this;return g.scrollLeft=0,g.scrollWidth=0,g.height=g.HScrollHeight,g.inner.style.height=g.element.style.height=(g.height||12)+"px",g.renderer=s,g}return e.prototype.onMouseDown=function(n,s){if(n==="mousedown"&&!(a.getButton(s)!==0||s.detail===2)){if(s.target===this.inner){var g=this,m=s.clientX,A=function(j){m=j.clientX},E=function(){clearInterval(Be)},S=s.clientX,C=this.thumbLeft,q=function(){if(m!==void 0){var j=g.scrollLeftFromThumbLeft(C+m-S);j!==g.scrollLeft&&g._emit("scroll",{data:j})}};a.capture(this.inner,A,E);var Be=setInterval(q,20);return a.preventDefault(s)}var se=s.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(se)}),a.preventDefault(s)}},e.prototype.getHeight=function(){return this.isVisible?this.height:0},e.prototype.scrollLeftFromThumbLeft=function(n){var s=n*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return s=s>>0,s<0?s=0:s>this.pageWidth-this.viewWidth&&(s=this.pageWidth-this.viewWidth),s},e.prototype.setWidth=function(n){this.width=Math.max(0,n),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},e.prototype.setScrollWidth=function(n,s){this.pageWidth===n&&!s||(this.pageWidth=n,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})))},e.prototype.setScrollLeft=function(n){this.scrollLeft=n,n<0&&(n=0),this.thumbLeft=n*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},e}(i);o.prototype.setInnerWidth=o.prototype.setScrollWidth,p.ScrollBar=r,p.ScrollBarV=r,p.ScrollBarH=o,p.VScrollBar=r,p.HScrollBar=o}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(f,p,Se){var D=f("./lib/event"),_=function(){function x(a,h){this.onRender=a,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=h||window;var i=this;this._flush=function(r){i.pending=!1;var o=i.changes;if(o&&(D.blockIdle(100),i.changes=0,i.onRender(o)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}}return x.prototype.schedule=function(a){this.changes=this.changes|a,this.changes&&!this.pending&&(D.nextFrame(this._flush),this.pending=!0)},x.prototype.clear=function(a){var h=this.changes;return this.changes=0,h},x}();p.RenderLoop=_}),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(f,p,Se){var D=f("../lib/oop"),_=f("../lib/dom"),x=f("../lib/lang"),a=f("../lib/event"),h=f("../lib/useragent"),i=f("../lib/event_emitter").EventEmitter,r=512,o=typeof ResizeObserver=="function",t=200,e=function(){function n(s){this.el=_.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=_.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=_.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),s.appendChild(this.el),this.$measureNode.textContent=x.stringRepeat("X",r),this.$characterSize={width:0,height:0},o?this.$addObserver():this.checkForSizeChanges()}return n.prototype.$setMeasureNodeStyles=function(s,g){s.width=s.height="auto",s.left=s.top="0px",s.visibility="hidden",s.position="absolute",s.whiteSpace="pre",h.isIE<8?s["font-family"]="inherit":s.font="inherit",s.overflow=g?"hidden":"visible"},n.prototype.checkForSizeChanges=function(s){if(s===void 0&&(s=this.$measureSizes()),s&&(this.$characterSize.width!==s.width||this.$characterSize.height!==s.height)){this.$measureNode.style.fontWeight="bold";var g=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=s,this.charSizes=Object.create(null),this.allowBoldFonts=g&&g.width===s.width&&g.height===s.height,this._emit("changeCharacterSize",{data:s})}},n.prototype.$addObserver=function(){var s=this;this.$observer=new window.ResizeObserver(function(g){s.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},n.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var s=this;return this.$pollSizeChangesTimer=a.onIdle(function g(){s.checkForSizeChanges(),a.onIdle(g,500)},500)},n.prototype.setPolling=function(s){s?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},n.prototype.$measureSizes=function(s){var g={height:(s||this.$measureNode).clientHeight,width:(s||this.$measureNode).clientWidth/r};return g.width===0||g.height===0?null:g},n.prototype.$measureCharWidth=function(s){this.$main.textContent=x.stringRepeat(s,r);var g=this.$main.getBoundingClientRect();return g.width/r},n.prototype.getCharacterWidth=function(s){var g=this.charSizes[s];return g===void 0&&(g=this.charSizes[s]=this.$measureCharWidth(s)/this.$characterSize.width),g},n.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},n.prototype.$getZoom=function(s){return!s||!s.parentElement?1:(Number(window.getComputedStyle(s).zoom)||1)*this.$getZoom(s.parentElement)},n.prototype.$initTransformMeasureNodes=function(){var s=function(g,m){return["div",{style:"position: absolute;top:"+g+"px;left:"+m+"px;"}]};this.els=_.buildDom([s(0,0),s(t,0),s(0,t),s(t,t)],this.el)},n.prototype.transformCoordinates=function(s,g){if(s){var m=this.$getZoom(this.el);s=C(1/m,s)}function A(Mt,zt,hi){var Ht=Mt[1]*zt[0]-Mt[0]*zt[1];return[(-zt[1]*hi[0]+zt[0]*hi[1])/Ht,(+Mt[1]*hi[0]-Mt[0]*hi[1])/Ht]}function E(Mt,zt){return[Mt[0]-zt[0],Mt[1]-zt[1]]}function S(Mt,zt){return[Mt[0]+zt[0],Mt[1]+zt[1]]}function C(Mt,zt){return[Mt*zt[0],Mt*zt[1]]}this.els||this.$initTransformMeasureNodes();function q(Mt){var zt=Mt.getBoundingClientRect();return[zt.left,zt.top]}var Be=q(this.els[0]),se=q(this.els[1]),j=q(this.els[2]),ct=q(this.els[3]),G=A(E(ct,se),E(ct,j),E(S(se,j),S(ct,Be))),U=C(1+G[0],E(se,Be)),b=C(1+G[1],E(j,Be));if(g){var w=g,W=G[0]*w[0]/t+G[1]*w[1]/t+1,ot=S(C(w[0],U),C(w[1],b));return S(C(1/W/t,ot),Be)}var at=E(s,Be),lt=A(E(U,C(G[0],at)),E(b,C(G[1],at)),at);return C(t,lt)},n}();e.prototype.$characterSize={width:0,height:0},D.implement(e.prototype,i),p.FontMetrics=e}),ace.define("ace/css/editor-css",["require","exports","module"],function(f,p,Se){Se.exports=`
|
257
257
|
.ace_br1 {border-top-left-radius : 3px;}
|
258
258
|
.ace_br2 {border-top-right-radius : 3px;}
|
259
259
|
.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
|
@@ -948,9 +948,9 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
948
948
|
|
949
949
|
.ace_hidden_token {
|
950
950
|
display: none;
|
951
|
-
}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(g,p,Se){var D=g("../lib/dom"),_=g("../lib/oop"),x=g("../lib/event_emitter").EventEmitter,a=function(){function h(i,r){this.canvas=D.createElement("canvas"),this.renderer=r,this.pixelRatio=1,this.maxHeight=r.layerConfig.maxHeight,this.lineHeight=r.layerConfig.lineHeight,this.canvasHeight=i.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=i.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)"},i.element.appendChild(this.canvas)}return h.prototype.$updateDecorators=function(i){var r=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(i){this.maxHeight=i.maxHeight,this.lineHeight=i.lineHeight,this.canvasHeight=i.height;var o=(i.lastRow+1)*this.lineHeight;o<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var t=this.canvas.getContext("2d");function e(ct,G){return ct.priority<G.priority?-1:ct.priority>G.priority?1:0}var n=this.renderer.session.$annotations;if(t.clearRect(0,0,this.canvas.width,this.canvas.height),n){var s={info:1,warning:2,error:3};n.forEach(function(ct){ct.priority=s[ct.type]||null}),n=n.sort(e);for(var f=this.renderer.session.$foldData,m=0;m<n.length;m++){var A=n[m].row,E=this.compensateFoldRows(A,f),S=Math.round((A-E)*this.lineHeight*this.heightRatio),C=Math.round((A-E)*this.lineHeight*this.heightRatio),q=Math.round(((A-E)*this.lineHeight+this.lineHeight)*this.heightRatio),Be=q-C;if(Be<this.minDecorationHeight){var se=(C+q)/2|0;se<this.halfMinDecorationHeight?se=this.halfMinDecorationHeight:se+this.halfMinDecorationHeight>this.canvasHeight&&(se=this.canvasHeight-this.halfMinDecorationHeight),C=Math.round(se-this.halfMinDecorationHeight),q=Math.round(se+this.halfMinDecorationHeight)}t.fillStyle=r[n[m].type]||null,t.fillRect(0,S,this.canvasWidth,q-C)}}var j=this.renderer.session.selection.getCursor();if(j){var E=this.compensateFoldRows(j.row,f),S=Math.round((j.row-E)*this.lineHeight*this.heightRatio);t.fillStyle="rgba(0, 0, 0, 0.5)",t.fillRect(0,S,this.canvasWidth,2)}},h.prototype.compensateFoldRows=function(i,r){var o=0;if(r&&r.length>0)for(var t=0;t<r.length;t++)i>r[t].start.row&&i<r[t].end.row?o+=i-r[t].start.row:i>=r[t].end.row&&(o+=r[t].end.row-r[t].start.row);return o},h}();_.implement(a.prototype,x),p.Decorator=a}),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(g,p,Se){var D=g("./lib/oop"),_=g("./lib/dom"),x=g("./lib/lang"),a=g("./config"),h=g("./layer/gutter").Gutter,i=g("./layer/marker").Marker,r=g("./layer/text").Text,o=g("./layer/cursor").Cursor,t=g("./scrollbar").HScrollBar,e=g("./scrollbar").VScrollBar,n=g("./scrollbar_custom").HScrollBar,s=g("./scrollbar_custom").VScrollBar,f=g("./renderloop").RenderLoop,m=g("./layer/font_metrics").FontMetrics,A=g("./lib/event_emitter").EventEmitter,E=g("./css/editor-css"),S=g("./layer/decorators").Decorator,C=g("./lib/useragent"),q=g("./layer/text_util").isTextToken;_.importCssString(E,"ace_editor.css",!1);var Be=function(){function se(j,ct){var G=this;this.container=j||_.createElement("div"),_.addCssClass(this.container,"ace_editor"),_.HI_DPI&&_.addCssClass(this.container,"ace_hidpi"),this.setTheme(ct),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=_.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=_.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=_.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new h(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new i(this.content);var U=this.$textLayer=new r(this.content);this.canvas=U.element,this.$markerFront=new i(this.content),this.$cursorLayer=new o(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(b){G.$scrollAnimation||G.session.setScrollTop(b.data-G.scrollMargin.top)}),this.scrollBarH.on("scroll",function(b){G.$scrollAnimation||G.session.setScrollLeft(b.data-G.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(b){G.updateCharacterSize(),G.onResize(!0,G.gutterWidth,G.$size.width,G.$size.height),G._signal("changeCharacterSize",b)}),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=!C.isIOS,this.$loop=new f(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return se.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(),_.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},se.prototype.setSession=function(j){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=j,j&&this.scrollMargin.top&&j.getScrollTop()<=0&&j.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(j),this.$markerBack.setSession(j),this.$markerFront.setSession(j),this.$gutterLayer.setSession(j),this.$textLayer.setSession(j),j&&(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))},se.prototype.updateLines=function(j,ct,G){if(ct===void 0&&(ct=1/0),this.$changedLines?(this.$changedLines.firstRow>j&&(this.$changedLines.firstRow=j),this.$changedLines.lastRow<ct&&(this.$changedLines.lastRow=ct)):this.$changedLines={firstRow:j,lastRow:ct},this.$changedLines.lastRow<this.layerConfig.firstRow)if(G)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},se.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},se.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},se.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},se.prototype.updateFull=function(j){j?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},se.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},se.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},se.prototype.onResize=function(j,ct,G,U){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=j?1:0;var b=this.container;U||(U=b.clientHeight||b.scrollHeight),!U&&this.$maxLines&&this.lineHeight>1&&(!b.style.height||b.style.height=="0px")&&(b.style.height="1px",U=b.clientHeight||b.scrollHeight),G||(G=b.clientWidth||b.scrollWidth);var w=this.$updateCachedSize(j,ct,G,U);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!G&&!U)return this.resizing=0;j&&(this.$gutterLayer.$padding=null),j?this.$renderChanges(w|this.$changes,!0):this.$loop.schedule(w|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},se.prototype.$updateCachedSize=function(j,ct,G,U){U-=this.$extraHeight||0;var b=0,w=this.$size,W={width:w.width,height:w.height,scrollerHeight:w.scrollerHeight,scrollerWidth:w.scrollerWidth};if(U&&(j||w.height!=U)&&(w.height=U,b|=this.CHANGE_SIZE,w.scrollerHeight=w.height,this.$horizScroll&&(w.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(w.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",b=b|this.CHANGE_SCROLL),G&&(j||w.width!=G)){b|=this.CHANGE_SIZE,w.width=G,ct==null&&(ct=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=ct,_.setStyle(this.scrollBarH.element.style,"left",ct+"px"),_.setStyle(this.scroller.style,"left",ct+this.margin.left+"px"),w.scrollerWidth=Math.max(0,G-ct-this.scrollBarV.getWidth()-this.margin.h),_.setStyle(this.$gutter.style,"left",this.margin.left+"px");var ot=this.scrollBarV.getWidth()+"px";_.setStyle(this.scrollBarH.element.style,"right",ot),_.setStyle(this.scroller.style,"right",ot),_.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(w.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||j)&&(b|=this.CHANGE_FULL)}return w.$dirty=!G||!U,b&&this._signal("resize",W),b},se.prototype.onGutterResize=function(j){var ct=this.$showGutter?j:0;ct!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,ct,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()},se.prototype.adjustWrapLimit=function(){var j=this.$size.scrollerWidth-this.$padding*2,ct=Math.floor(j/this.characterWidth);return this.session.adjustWrapLimit(ct,this.$showPrintMargin&&this.$printMarginColumn)},se.prototype.setAnimatedScroll=function(j){this.setOption("animatedScroll",j)},se.prototype.getAnimatedScroll=function(){return this.$animatedScroll},se.prototype.setShowInvisibles=function(j){this.setOption("showInvisibles",j),this.session.$bidiHandler.setShowInvisibles(j)},se.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},se.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},se.prototype.setDisplayIndentGuides=function(j){this.setOption("displayIndentGuides",j)},se.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},se.prototype.setHighlightIndentGuides=function(j){this.setOption("highlightIndentGuides",j)},se.prototype.setShowPrintMargin=function(j){this.setOption("showPrintMargin",j)},se.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},se.prototype.setPrintMarginColumn=function(j){this.setOption("printMarginColumn",j)},se.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},se.prototype.getShowGutter=function(){return this.getOption("showGutter")},se.prototype.setShowGutter=function(j){return this.setOption("showGutter",j)},se.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},se.prototype.setFadeFoldWidgets=function(j){this.setOption("fadeFoldWidgets",j)},se.prototype.setHighlightGutterLine=function(j){this.setOption("highlightGutterLine",j)},se.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},se.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var j=_.createElement("div");j.className="ace_layer ace_print-margin-layer",this.$printMarginEl=_.createElement("div"),this.$printMarginEl.className="ace_print-margin",j.appendChild(this.$printMarginEl),this.content.insertBefore(j,this.content.firstChild)}var ct=this.$printMarginEl.style;ct.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",ct.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},se.prototype.getContainerElement=function(){return this.container},se.prototype.getMouseEventTarget=function(){return this.scroller},se.prototype.getTextAreaContainer=function(){return this.container},se.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var j=this.textarea.style,ct=this.$composition;if(!this.$keepTextAreaAtCursor&&!ct){_.translate(this.textarea,-100,0);return}var G=this.$cursorLayer.$pixelPos;if(G){ct&&ct.markerRange&&(G=this.$cursorLayer.getPixelPosition(ct.markerRange.start,!0));var U=this.layerConfig,b=G.top,w=G.left;b-=U.offset;var W=ct&&ct.useTextareaForIME||C.isMobile?this.lineHeight:1;if(b<0||b>U.height-W){_.translate(this.textarea,0,0);return}var ot=1,at=this.$size.height-W;if(!ct)b+=this.lineHeight;else if(ct.useTextareaForIME){var lt=this.textarea.value;ot=this.characterWidth*this.session.$getStringScreenWidth(lt)[0]}else b+=this.lineHeight+2;w-=this.scrollLeft,w>this.$size.scrollerWidth-ot&&(w=this.$size.scrollerWidth-ot),w+=this.gutterWidth+this.margin.left,_.setStyle(j,"height",W+"px"),_.setStyle(j,"width",ot+"px"),_.translate(this.textarea,Math.min(w,this.$size.scrollerWidth-ot),Math.min(b,at))}}},se.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},se.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},se.prototype.getLastFullyVisibleRow=function(){var j=this.layerConfig,ct=j.lastRow,G=this.session.documentToScreenRow(ct,0)*j.lineHeight;return G-this.session.getScrollTop()>j.height-j.lineHeight?ct-1:ct},se.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},se.prototype.setPadding=function(j){this.$padding=j,this.$textLayer.setPadding(j),this.$cursorLayer.setPadding(j),this.$markerFront.setPadding(j),this.$markerBack.setPadding(j),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},se.prototype.setScrollMargin=function(j,ct,G,U){var b=this.scrollMargin;b.top=j|0,b.bottom=ct|0,b.right=U|0,b.left=G|0,b.v=b.top+b.bottom,b.h=b.left+b.right,b.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-b.top),this.updateFull()},se.prototype.setMargin=function(j,ct,G,U){var b=this.margin;b.top=j|0,b.bottom=ct|0,b.right=U|0,b.left=G|0,b.v=b.top+b.bottom,b.h=b.left+b.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},se.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},se.prototype.setHScrollBarAlwaysVisible=function(j){this.setOption("hScrollBarAlwaysVisible",j)},se.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},se.prototype.setVScrollBarAlwaysVisible=function(j){this.setOption("vScrollBarAlwaysVisible",j)},se.prototype.$updateScrollBarV=function(){var j=this.layerConfig.maxHeight,ct=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(j-=(ct-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>j-ct&&(j=this.scrollTop+ct,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(j+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},se.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},se.prototype.freeze=function(){this.$frozen=!0},se.prototype.unfreeze=function(){this.$frozen=!1},se.prototype.$renderChanges=function(j,ct){if(this.$changes&&(j|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!j&&!ct){this.$changes|=j;return}if(this.$size.$dirty)return this.$changes|=j,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",j),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var G=this.layerConfig;if(j&this.CHANGE_FULL||j&this.CHANGE_SIZE||j&this.CHANGE_TEXT||j&this.CHANGE_LINES||j&this.CHANGE_SCROLL||j&this.CHANGE_H_SCROLL){if(j|=this.$computeLayerConfig()|this.$loop.clear(),G.firstRow!=this.layerConfig.firstRow&&G.firstRowScreen==this.layerConfig.firstRowScreen){var U=this.scrollTop+(G.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;U>0&&(this.scrollTop=U,j=j|this.CHANGE_SCROLL,j|=this.$computeLayerConfig()|this.$loop.clear())}G=this.layerConfig,this.$updateScrollBarV(),j&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),_.translate(this.content,-this.scrollLeft,-G.offset);var b=G.width+2*this.$padding+"px",w=G.minHeight+"px";_.setStyle(this.content.style,"width",b),_.setStyle(this.content.style,"height",w)}if(j&this.CHANGE_H_SCROLL&&(_.translate(this.content,-this.scrollLeft,-G.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),j&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(G),this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G),this.$markerBack.update(G),this.$markerFront.update(G),this.$cursorLayer.update(G),this.$moveTextAreaToCursor(),this._signal("afterRender",j);return}if(j&this.CHANGE_SCROLL){this.$changedLines=null,j&this.CHANGE_TEXT||j&this.CHANGE_LINES?this.$textLayer.update(G):this.$textLayer.scrollLines(G),this.$showGutter&&(j&this.CHANGE_GUTTER||j&this.CHANGE_LINES?this.$gutterLayer.update(G):this.$gutterLayer.scrollLines(G)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G),this.$markerBack.update(G),this.$markerFront.update(G),this.$cursorLayer.update(G),this.$moveTextAreaToCursor(),this._signal("afterRender",j);return}j&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(G),this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_LINES?((this.$updateLines()||j&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_TEXT||j&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)),j&this.CHANGE_CURSOR&&(this.$cursorLayer.update(G),this.$moveTextAreaToCursor()),j&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(G),j&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(G),this._signal("afterRender",j)},se.prototype.$autosize=function(){var j=this.session.getScreenLength()*this.lineHeight,ct=this.$maxLines*this.lineHeight,G=Math.min(ct,Math.max((this.$minLines||1)*this.lineHeight,j))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(G+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&G>this.$maxPixelHeight&&(G=this.$maxPixelHeight);var U=G<=2*this.lineHeight,b=!U&&j>ct;if(G!=this.desiredHeight||this.$size.height!=this.desiredHeight||b!=this.$vScroll){b!=this.$vScroll&&(this.$vScroll=b,this.scrollBarV.setVisible(b));var w=this.container.clientWidth;this.container.style.height=G+"px",this.$updateCachedSize(!0,this.$gutterWidth,w,G),this.desiredHeight=G,this._signal("autosize")}},se.prototype.$computeLayerConfig=function(){var j=this.session,ct=this.$size,G=ct.height<=2*this.lineHeight,U=this.session.getScreenLength(),b=U*this.lineHeight,w=this.$getLongestLine(),W=!G&&(this.$hScrollBarAlwaysVisible||ct.scrollerWidth-w-2*this.$padding<0),ot=this.$horizScroll!==W;ot&&(this.$horizScroll=W,this.scrollBarH.setVisible(W));var at=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),G=ct.height<=2*this.lineHeight);var lt=ct.scrollerHeight+this.lineHeight,Mt=!this.$maxLines&&this.$scrollPastEnd?(ct.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;b+=Mt;var zt=this.scrollMargin;this.session.setScrollTop(Math.max(-zt.top,Math.min(this.scrollTop,b-ct.scrollerHeight+zt.bottom))),this.session.setScrollLeft(Math.max(-zt.left,Math.min(this.scrollLeft,w+2*this.$padding-ct.scrollerWidth+zt.right)));var hi=!G&&(this.$vScrollBarAlwaysVisible||ct.scrollerHeight-b+Mt<0||this.scrollTop>zt.top),Ht=at!==hi;Ht&&(this.$vScroll=hi,this.scrollBarV.setVisible(hi));var Vt=this.scrollTop%this.lineHeight,Ut=Math.ceil(lt/this.lineHeight)-1,Jt=Math.max(0,Math.round((this.scrollTop-Vt)/this.lineHeight)),di=Jt+Ut,fi,mi,gi=this.lineHeight;Jt=j.screenToDocumentRow(Jt,0);var wi=j.getFoldLine(Jt);wi&&(Jt=wi.start.row),fi=j.documentToScreenRow(Jt,0),mi=j.getRowLength(Jt)*gi,di=Math.min(j.screenToDocumentRow(di,0),j.getLength()-1),lt=ct.scrollerHeight+j.getRowLength(di)*gi+mi,Vt=this.scrollTop-fi*gi;var Ci=0;return(this.layerConfig.width!=w||ot)&&(Ci=this.CHANGE_H_SCROLL),(ot||Ht)&&(Ci|=this.$updateCachedSize(!0,this.gutterWidth,ct.width,ct.height),this._signal("scrollbarVisibilityChanged"),Ht&&(w=this.$getLongestLine())),this.layerConfig={width:w,padding:this.$padding,firstRow:Jt,firstRowScreen:fi,lastRow:di,lineHeight:gi,characterWidth:this.characterWidth,minHeight:lt,maxHeight:b,offset:Vt,gutterOffset:gi?Math.max(0,Math.ceil((Vt+ct.height-ct.scrollerHeight)/gi)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(w-this.$padding),Ci},se.prototype.$updateLines=function(){if(this.$changedLines){var j=this.$changedLines.firstRow,ct=this.$changedLines.lastRow;this.$changedLines=null;var G=this.layerConfig;if(!(j>G.lastRow+1)&&!(ct<G.firstRow)){if(ct===1/0){this.$showGutter&&this.$gutterLayer.update(G),this.$textLayer.update(G);return}return this.$textLayer.updateLines(G,j,ct),!0}}},se.prototype.$getLongestLine=function(){var j=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(j+=1),this.$textLayer&&j>this.$textLayer.MAX_LINE_LENGTH&&(j=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(j*this.characterWidth))},se.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},se.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},se.prototype.addGutterDecoration=function(j,ct){this.$gutterLayer.addGutterDecoration(j,ct)},se.prototype.removeGutterDecoration=function(j,ct){this.$gutterLayer.removeGutterDecoration(j,ct)},se.prototype.updateBreakpoints=function(j){this._rows=j,this.$loop.schedule(this.CHANGE_GUTTER)},se.prototype.setAnnotations=function(j){this.$gutterLayer.setAnnotations(j),this.$loop.schedule(this.CHANGE_GUTTER)},se.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},se.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},se.prototype.showCursor=function(){this.$cursorLayer.showCursor()},se.prototype.scrollSelectionIntoView=function(j,ct,G){this.scrollCursorIntoView(j,G),this.scrollCursorIntoView(ct,G)},se.prototype.scrollCursorIntoView=function(j,ct,G){if(this.$size.scrollerHeight!==0){var U=this.$cursorLayer.getPixelPosition(j),b=U.left,w=U.top,W=G&&G.top||0,ot=G&&G.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var at=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;at+W>w?(ct&&at+W>w+this.lineHeight&&(w-=ct*this.$size.scrollerHeight),w===0&&(w=-this.scrollMargin.top),this.session.setScrollTop(w)):at+this.$size.scrollerHeight-ot<w+this.lineHeight&&(ct&&at+this.$size.scrollerHeight-ot<w-this.lineHeight&&(w+=ct*this.$size.scrollerHeight),this.session.setScrollTop(w+this.lineHeight+ot-this.$size.scrollerHeight));var lt=this.scrollLeft,Mt=2*this.layerConfig.characterWidth;b-Mt<lt?(b-=Mt,b<this.$padding+Mt&&(b=-this.scrollMargin.left),this.session.setScrollLeft(b)):(b+=Mt,lt+this.$size.scrollerWidth<b+this.characterWidth?this.session.setScrollLeft(Math.round(b+this.characterWidth-this.$size.scrollerWidth)):lt<=this.$padding&&b-lt<this.characterWidth&&this.session.setScrollLeft(0))}},se.prototype.getScrollTop=function(){return this.session.getScrollTop()},se.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},se.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},se.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},se.prototype.scrollToRow=function(j){this.session.setScrollTop(j*this.lineHeight)},se.prototype.alignCursor=function(j,ct){typeof j=="number"&&(j={row:j,column:0});var G=this.$cursorLayer.getPixelPosition(j),U=this.$size.scrollerHeight-this.lineHeight,b=G.top-U*(ct||0);return this.session.setScrollTop(b),b},se.prototype.$calcSteps=function(j,ct){var G=0,U=this.STEPS,b=[],w=function(W,ot,at){return at*(Math.pow(W-1,3)+1)+ot};for(G=0;G<U;++G)b.push(w(G/this.STEPS,j,ct-j));return b},se.prototype.scrollToLine=function(j,ct,G,U){var b=this.$cursorLayer.getPixelPosition({row:j,column:0}),w=b.top;ct&&(w-=this.$size.scrollerHeight/2);var W=this.scrollTop;this.session.setScrollTop(w),G!==!1&&this.animateScrolling(W,U)},se.prototype.animateScrolling=function(j,ct){var G=this.scrollTop;if(!this.$animatedScroll)return;var U=this;if(j==G)return;if(this.$scrollAnimation){var b=this.$scrollAnimation.steps;if(b.length&&(j=b[0],j==G))return}var w=U.$calcSteps(j,G);this.$scrollAnimation={from:j,to:G,steps:w},clearInterval(this.$timer),U.session.setScrollTop(w.shift()),U.session.$scrollTop=G;function W(){U.$timer=clearInterval(U.$timer),U.$scrollAnimation=null,U.$stopAnimation=!1,ct&&ct()}this.$timer=setInterval(function(){if(U.$stopAnimation){W();return}if(!U.session)return clearInterval(U.$timer);w.length?(U.session.setScrollTop(w.shift()),U.session.$scrollTop=G):G!=null?(U.session.$scrollTop=-1,U.session.setScrollTop(G),G=null):W()},10)},se.prototype.scrollToY=function(j){this.scrollTop!==j&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=j)},se.prototype.scrollToX=function(j){this.scrollLeft!==j&&(this.scrollLeft=j),this.$loop.schedule(this.CHANGE_H_SCROLL)},se.prototype.scrollTo=function(j,ct){this.session.setScrollTop(ct),this.session.setScrollLeft(j)},se.prototype.scrollBy=function(j,ct){ct&&this.session.setScrollTop(this.session.getScrollTop()+ct),j&&this.session.setScrollLeft(this.session.getScrollLeft()+j)},se.prototype.isScrollableBy=function(j,ct){if(ct<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||ct>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||j<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||j>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},se.prototype.pixelToScreenCoordinates=function(j,ct){var G;if(this.$hasCssTransforms){G={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([j,ct]);j=U[1]-this.gutterWidth-this.margin.left,ct=U[0]}else G=this.scroller.getBoundingClientRect();var b=j+this.scrollLeft-G.left-this.$padding,w=b/this.characterWidth,W=Math.floor((ct+this.scrollTop-G.top)/this.lineHeight),ot=this.$blockCursor?Math.floor(w):Math.round(w);return{row:W,column:ot,side:w-ot>0?1:-1,offsetX:b}},se.prototype.screenToTextCoordinates=function(j,ct){var G;if(this.$hasCssTransforms){G={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([j,ct]);j=U[1]-this.gutterWidth-this.margin.left,ct=U[0]}else G=this.scroller.getBoundingClientRect();var b=j+this.scrollLeft-G.left-this.$padding,w=b/this.characterWidth,W=this.$blockCursor?Math.floor(w):Math.round(w),ot=Math.floor((ct+this.scrollTop-G.top)/this.lineHeight);return this.session.screenToDocumentPosition(ot,Math.max(W,0),b)},se.prototype.textToScreenCoordinates=function(j,ct){var G=this.scroller.getBoundingClientRect(),U=this.session.documentToScreenPosition(j,ct),b=this.$padding+(this.session.$bidiHandler.isBidiRow(U.row,j)?this.session.$bidiHandler.getPosLeft(U.column):Math.round(U.column*this.characterWidth)),w=U.row*this.lineHeight;return{pageX:G.left+b-this.scrollLeft,pageY:G.top+w-this.scrollTop}},se.prototype.visualizeFocus=function(){_.addCssClass(this.container,"ace_focus")},se.prototype.visualizeBlur=function(){_.removeCssClass(this.container,"ace_focus")},se.prototype.showComposition=function(j){this.$composition=j,j.cssText||(j.cssText=this.textarea.style.cssText),j.useTextareaForIME==null&&(j.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(_.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):j.markerId=this.session.addMarker(j.markerRange,"ace_composition_marker","text")},se.prototype.setCompositionText=function(j){var ct=this.session.selection.cursor;this.addToken(j,"composition_placeholder",ct.row,ct.column),this.$moveTextAreaToCursor()},se.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),_.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var j=this.session.selection.cursor;this.removeExtraToken(j.row,j.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},se.prototype.setGhostText=function(j,ct){var G=this.session.selection.cursor,U=ct||{row:G.row,column:G.column};this.removeGhostText();var b=this.$calculateWrappedTextChunks(j,U);this.addToken(b[0].text,"ghost_text",U.row,U.column),this.$ghostText={text:j,position:{row:U.row,column:U.column}};var w=_.createElement("div");if(b.length>1){var W=this.hideTokensAfterPosition(U.row,U.column),ot;b.slice(1).forEach(function(Ht){var Vt=_.createElement("div"),Ut=_.createElement("span");Ut.className="ace_ghost_text",Ht.wrapped&&(Vt.className="ghost_text_line_wrapped"),Ht.text.length===0&&(Ht.text=" "),Ut.appendChild(_.createTextNode(Ht.text)),Vt.appendChild(Ut),w.appendChild(Vt),ot=Vt}),W.forEach(function(Ht){var Vt=_.createElement("span");q(Ht.type)||(Vt.className="ace_"+Ht.type.replace(/\./g," ace_")),Vt.appendChild(_.createTextNode(Ht.value)),ot.appendChild(Vt)}),this.$ghostTextWidget={el:w,row:U.row,column:U.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var at=this.$cursorLayer.getPixelPosition(U,!0),lt=this.container,Mt=lt.getBoundingClientRect().height,zt=b.length*this.lineHeight,hi=zt<Mt-at.top;if(hi)return;zt<Mt?this.scrollBy(0,(b.length-1)*this.lineHeight):this.scrollToRow(U.row)}},se.prototype.$calculateWrappedTextChunks=function(j,ct){var G=this.$size.scrollerWidth-this.$padding*2,U=Math.floor(G/this.characterWidth)-2;U=U<=0?60:U;for(var b=j.split(/\r?\n/),w=[],W=0;W<b.length;W++){var ot=this.session.$getDisplayTokens(b[W],ct.column),at=this.session.$computeWrapSplits(ot,U,this.session.$tabSize);if(at.length>0){var lt=0;at.push(b[W].length);for(var Mt=0;Mt<at.length;Mt++){var zt=b[W].slice(lt,at[Mt]);w.push({text:zt,wrapped:!0}),lt=at[Mt]}}else w.push({text:b[W],wrapped:!1})}return w},se.prototype.removeGhostText=function(){if(this.$ghostText){var j=this.$ghostText.position;this.removeExtraToken(j.row,j.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},se.prototype.addToken=function(j,ct,G,U){var b=this.session;b.bgTokenizer.lines[G]=null;var w={type:ct,value:j},W=b.getTokens(G);if(U==null||!W.length)W.push(w);else for(var ot=0,at=0;at<W.length;at++){var lt=W[at];if(ot+=lt.value.length,U<=ot){var Mt=lt.value.length-(ot-U),zt=lt.value.slice(0,Mt),hi=lt.value.slice(Mt);W.splice(at,1,{type:lt.type,value:zt},w,{type:lt.type,value:hi});break}}this.updateLines(G,G)},se.prototype.hideTokensAfterPosition=function(j,ct){for(var G=this.session.getTokens(j),U=0,b=!1,w=[],W=0;W<G.length;W++){var ot=G[W];if(U+=ot.value.length,ot.type!=="ghost_text"){if(b){w.push({type:ot.type,value:ot.value}),ot.type="hidden_token";continue}U===ct&&(b=!0)}}return this.updateLines(j,j),w},se.prototype.removeExtraToken=function(j,ct){this.session.bgTokenizer.lines[j]=null,this.updateLines(j,j)},se.prototype.setTheme=function(j,ct){var G=this;if(this.$themeId=j,G._dispatchEvent("themeChange",{theme:j}),!j||typeof j=="string"){var U=j||this.$options.theme.initialValue;a.loadModule(["theme",U],b)}else b(j);function b(w){if(G.$themeId!=j)return ct&&ct();if(!w||!w.cssClass)throw new Error("couldn't load module "+j+" or it didn't call define");w.$id&&(G.$themeId=w.$id),_.importCssString(w.cssText,w.cssClass,G.container),G.theme&&_.removeCssClass(G.container,G.theme.cssClass);var W="padding"in w?w.padding:"padding"in(G.theme||{})?4:G.$padding;G.$padding&&W!=G.$padding&&G.setPadding(W),G.$theme=w.cssClass,G.theme=w,_.addCssClass(G.container,w.cssClass),_.setCssClass(G.container,"ace_dark",w.isDark),G.$size&&(G.$size.width=0,G.$updateSizeAsync()),G._dispatchEvent("themeLoaded",{theme:w}),ct&&ct(),C.isSafari&&G.scroller&&(G.scroller.style.background="red",G.scroller.style.background="")}},se.prototype.getTheme=function(){return this.$themeId},se.prototype.setStyle=function(j,ct){_.setCssClass(this.container,j,ct!==!1)},se.prototype.unsetStyle=function(j){_.removeCssClass(this.container,j)},se.prototype.setCursorStyle=function(j){_.setStyle(this.scroller.style,"cursor",j)},se.prototype.setMouseCursor=function(j){_.setStyle(this.scroller.style,"cursor",j)},se.prototype.attachToShadowRoot=function(){_.importCssString(E,"ace_editor.css",this.container)},se.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},se.prototype.$updateCustomScrollbar=function(j){var ct=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,j===!0?(this.scrollBarV=new s(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollTop(G.data-ct.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollLeft(G.data-ct.scrollMargin.left)}),this.$scrollDecorator=new S(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollTop(G.data-ct.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollLeft(G.data-ct.scrollMargin.left)}))},se.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var j=this;this.$resizeTimer=x.delayedCall(function(){j.destroyed||j.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(ct){var G=ct[0].contentRect.width,U=ct[0].contentRect.height;Math.abs(j.$size.width-G)>1||Math.abs(j.$size.height-U)>1?j.$resizeTimer.delay():j.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},se}();Be.prototype.CHANGE_CURSOR=1,Be.prototype.CHANGE_MARKER=2,Be.prototype.CHANGE_GUTTER=4,Be.prototype.CHANGE_SCROLL=8,Be.prototype.CHANGE_LINES=16,Be.prototype.CHANGE_TEXT=32,Be.prototype.CHANGE_SIZE=64,Be.prototype.CHANGE_MARKER_BACK=128,Be.prototype.CHANGE_MARKER_FRONT=256,Be.prototype.CHANGE_FULL=512,Be.prototype.CHANGE_H_SCROLL=1024,Be.prototype.$changes=0,Be.prototype.$padding=null,Be.prototype.$frozen=!1,Be.prototype.STEPS=8,D.implement(Be.prototype,A),a.defineOptions(Be.prototype,"renderer",{useResizeObserver:{set:function(se){!se&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):se&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(se){this.$textLayer.setShowInvisibles(se)&&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(se){typeof se=="number"&&(this.$printMarginColumn=se),this.$showPrintMargin=!!se,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(se){this.$gutter.style.display=se?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(se){this.$gutterLayer.$useSvgGutterIcons=se},initialValue:!1},showFoldedAnnotations:{set:function(se){this.$gutterLayer.$showFoldedAnnotations=se},initialValue:!1},fadeFoldWidgets:{set:function(se){_.setCssClass(this.$gutter,"ace_fade-fold-widgets",se)},initialValue:!1},showFoldWidgets:{set:function(se){this.$gutterLayer.setShowFoldWidgets(se),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(se){this.$textLayer.setDisplayIndentGuides(se)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(se){this.$textLayer.setHighlightIndentGuides(se)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(se){this.$gutterLayer.setHighlightGutterLine(se),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(se){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(se){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(se){typeof se=="number"&&(se=se+"px"),this.container.style.fontSize=se,this.updateFontSize()},initialValue:12},fontFamily:{set:function(se){this.container.style.fontFamily=se,this.updateFontSize()}},maxLines:{set:function(se){this.updateFull()}},minLines:{set:function(se){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(se){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(se){se=+se||0,this.$scrollPastEnd!=se&&(this.$scrollPastEnd=se,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(se){this.$gutterLayer.$fixedWidth=!!se,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(se){this.$updateCustomScrollbar(se)},initialValue:!1},theme:{set:function(se){this.setTheme(se)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!C.isMobile&&!C.isIE}}),p.VirtualRenderer=Be}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(g,p,Se){var D=g("../lib/oop"),_=g("../lib/net"),x=g("../lib/event_emitter").EventEmitter,a=g("../config");function h(t){var e="importScripts('"+_.qualifyURL(t)+"');";try{return new Blob([e],{type:"application/javascript"})}catch{var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new n;return s.append(e),s.getBlob("application/javascript")}}function i(t){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var e=h(t),n=window.URL||window.webkitURL,s=n.createObjectURL(e);return new Worker(s)}return new Worker(t)}var r=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,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(){D.implement(this,x),this.$createWorkerFromOldConfig=function(t,e,n,s,f){if(g.nameToUrl&&!g.toUrl&&(g.toUrl=g.nameToUrl),a.get("packaged")||!g.toUrl)s=s||a.moduleUrl(e,"worker");else{var m=this.$normalizePath;s=s||m(g.toUrl("ace/worker/worker.js",null,"_"));var A={};t.forEach(function(E){A[E]=m(g.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=i(s),f&&this.send("importScripts",f),this.$worker.postMessage({init:!0,tlns:A,module:e,classname:n}),this.$worker},this.onMessage=function(t){var e=t.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var n=this.callbacks[e.id];n&&(n(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console&&console.log&&console.log.apply(console,e.data);break}},this.reportError=function(t){window.console&&console.error&&console.error(t)},this.$normalizePath=function(t){return _.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(t){t.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,e){this.$worker.postMessage({command:t,args:e})},this.call=function(t,e,n){if(n){var s=this.callbackId++;this.callbacks[s]=n,e.push(s)}this.send(t,e)},this.emit=function(t,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:e.data}})}catch(n){console.error(n.stack)}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;t&&(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(r.prototype);var o=function(t,e,n){var s=null,f=!1,m=Object.create(x),A=[],E=new r({messageBuffer:A,terminate:function(){},postMessage:function(C){A.push(C),s&&(f?setTimeout(S):S())}});E.setEmitSync=function(C){f=C};var S=function(){var C=A.shift();C.command?s[C.command].apply(s,C.args):C.event&&m._signal(C.event,C.data)};return m.postMessage=function(C){E.onMessage({data:C})},m.callback=function(C,q){this.postMessage({type:"call",id:q,data:C})},m.emit=function(C,q){this.postMessage({type:"event",name:C,data:q})},a.loadModule(["worker",e],function(C){for(s=new C[n](m);A.length;)S()}),E};p.UIWorkerClient=o,p.WorkerClient=r,p.createWorker=i}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(g,p,Se){var D=g("./range").Range,_=g("./lib/event_emitter").EventEmitter,x=g("./lib/oop"),a=function(){function h(i,r,o,t,e,n){var s=this;this.length=r,this.session=i,this.doc=i.getDocument(),this.mainClass=e,this.othersClass=n,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})},this.$pos=o;var f=i.getUndoManager().$undoStack||i.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=f.length,this.setup(),i.selection.on("changeCursor",this.$onCursorChange)}return h.prototype.setup=function(){var i=this,r=this.doc,o=this.session;this.selectionBefore=o.selection.toJSON(),o.selection.inMultiSelectMode&&o.selection.toSingleRange(),this.pos=r.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=o.addMarker(new D(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var n=r.createAnchor(e.row,e.column);n.$insertRight=!0,n.detach(),i.others.push(n)}),o.setUndoSelect(!1)},h.prototype.showOtherMarkers=function(){if(!this.othersActive){var i=this.session,r=this;this.othersActive=!0,this.others.forEach(function(o){o.markerId=i.addMarker(new D(o.row,o.column,o.row,o.column+r.length),r.othersClass,null,!1)})}},h.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var i=0;i<this.others.length;i++)this.session.removeMarker(this.others[i].markerId)}},h.prototype.onUpdate=function(i){if(this.$updating)return this.updateAnchors(i);var r=i;if(r.start.row===r.end.row&&r.start.row===this.pos.row){this.$updating=!0;var o=i.action==="insert"?r.end.column-r.start.column:r.start.column-r.end.column,t=r.start.column>=this.pos.column&&r.start.column<=this.pos.column+this.length+1,e=r.start.column-this.pos.column;if(this.updateAnchors(i),t&&(this.length+=o),t&&!this.session.$fromUndo){if(i.action==="insert")for(var n=this.others.length-1;n>=0;n--){var s=this.others[n],f={row:s.row,column:s.column+e};this.doc.insertMergedLines(f,i.lines)}else if(i.action==="remove")for(var n=this.others.length-1;n>=0;n--){var s=this.others[n],f={row:s.row,column:s.column+e};this.doc.remove(new D(f.row,f.column,f.row,f.column-o))}}this.$updating=!1,this.updateMarkers()}},h.prototype.updateAnchors=function(i){this.pos.onChange(i);for(var r=this.others.length;r--;)this.others[r].onChange(i);this.updateMarkers()},h.prototype.updateMarkers=function(){if(!this.$updating){var i=this,r=this.session,o=function(e,n){r.removeMarker(e.markerId),e.markerId=r.addMarker(new D(e.row,e.column,e.row,e.column+i.length),n,null,!1)};o(this.pos,this.mainClass);for(var t=this.others.length;t--;)o(this.others[t],this.othersClass)}},h.prototype.onCursorChange=function(i){if(!(this.$updating||!this.session)){var r=this.session.selection.getCursor();r.row===this.pos.row&&r.column>=this.pos.column&&r.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",i)):(this.hideOtherMarkers(),this._emit("cursorLeave",i))}},h.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},h.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var i=this.session.getUndoManager(),r=(i.$undoStack||i.$undostack).length-this.$undoStackDepth,o=0;o<r;o++)i.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},h}();x.implement(a.prototype,_),p.PlaceHolder=a}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(g,p,Se){var D=g("../lib/event"),_=g("../lib/useragent");function x(h,i){return h.row==i.row&&h.column==i.column}function a(h){var i=h.domEvent,r=i.altKey,o=i.shiftKey,t=i.ctrlKey,e=h.getAccelKey(),n=h.getButton();if(t&&_.isMac&&(n=i.button),h.editor.inMultiSelectMode&&n==2){h.editor.textInput.onContextMenu(h.domEvent);return}if(!t&&!r&&!e){n===0&&h.editor.inMultiSelectMode&&h.editor.exitMultiSelectMode();return}if(n===0){var s=h.editor,f=s.selection,m=s.inMultiSelectMode,A=h.getDocumentPosition(),E=f.getCursor(),S=h.inSelection()||f.isEmpty()&&x(A,E),C=h.x,q=h.y,Be=function(zt){C=zt.clientX,q=zt.clientY},se=s.session,j=s.renderer.pixelToScreenCoordinates(C,q),ct=j,G;if(s.$mouseHandler.$enableJumpToDef)t&&r||e&&r?G=o?"block":"add":r&&s.$blockSelectEnabled&&(G="block");else if(e&&!r){if(G="add",!m&&o)return}else r&&s.$blockSelectEnabled&&(G="block");if(G&&_.isMac&&i.ctrlKey&&s.$mouseHandler.cancelContextMenu(),G=="add"){if(!m&&S)return;if(!m){var U=f.toOrientedRange();s.addSelectionMarker(U)}var b=f.rangeList.rangeAtPoint(A);s.inVirtualSelectionMode=!0,o&&(b=null,U=f.ranges[0]||U,s.removeSelectionMarker(U)),s.once("mouseup",function(){var zt=f.toOrientedRange();b&&zt.isEmpty()&&x(b.cursor,zt.cursor)?f.substractPoint(zt.cursor):(o?f.substractPoint(U.cursor):U&&(s.removeSelectionMarker(U),f.addRange(U)),f.addRange(zt)),s.inVirtualSelectionMode=!1})}else if(G=="block"){h.stop(),s.inVirtualSelectionMode=!0;var w,W=[],ot=function(){var zt=s.renderer.pixelToScreenCoordinates(C,q),hi=se.screenToDocumentPosition(zt.row,zt.column,zt.offsetX);x(ct,zt)&&x(hi,f.lead)||(ct=zt,s.selection.moveToPosition(hi),s.renderer.scrollCursorIntoView(),s.removeSelectionMarkers(W),W=f.rectangularRangeBlock(ct,j),s.$mouseHandler.$clickSelection&&W.length==1&&W[0].isEmpty()&&(W[0]=s.$mouseHandler.$clickSelection.clone()),W.forEach(s.addSelectionMarker,s),s.updateSelectionMarkers())};m&&!e?f.toSingleRange():!m&&e&&(w=f.toOrientedRange(),s.addSelectionMarker(w)),o?j=se.documentToScreenPosition(f.lead):f.moveToPosition(A),ct={row:-1,column:-1};var at=function(zt){ot(),clearInterval(Mt),s.removeSelectionMarkers(W),W.length||(W=[f.toOrientedRange()]),w&&(s.removeSelectionMarker(w),f.toSingleRange(w));for(var hi=0;hi<W.length;hi++)f.addRange(W[hi]);s.inVirtualSelectionMode=!1,s.$mouseHandler.$clickSelection=null},lt=ot;D.capture(s.container,Be,at);var Mt=setInterval(function(){lt()},20);return h.preventDefault()}}}p.onMouseDown=a}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(g,p,Se){p.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(_){_.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(_){_.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(_){_.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(_){_.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(_){_.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(_){_.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(_){_.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(_){_.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(_){_.multiSelect.rangeCount>1?_.multiSelect.joinSelections():_.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(_){_.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(_){_.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(_){_.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],p.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(_){_.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(_){return _&&_.inMultiSelectMode}}];var D=g("../keyboard/hash_handler").HashHandler;p.keyboardHandler=new D(p.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(g,p,Se){var D=g("./range_list").RangeList,_=g("./range").Range,x=g("./selection").Selection,a=g("./mouse/multi_select_handler").onMouseDown,h=g("./lib/event"),i=g("./lib/lang"),r=g("./commands/multi_select_commands");p.commands=r.defaultCommands.concat(r.multiSelectCommands);var o=g("./search").Search,t=new o;function e(E,S,C){return t.$options.wrap=!0,t.$options.needle=S,t.$options.backwards=C==-1,t.find(E)}var n=g("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(n.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,S){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var C=this.toOrientedRange();if(this.rangeList.add(C),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),S||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(C),this.$onAddRange(C)}E.cursor||(E.cursor=E.end);var q=this.rangeList.add(E);return this.$onAddRange(E),q.length&&this.$onRemoveRange(q),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),S||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var S=this.rangeList.removeAll();S.length&&this.$onRemoveRange(S),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var S=this.rangeList.substractPoint(E);if(S)return this.$onRemoveRange(S),S[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var S=this.rangeList.ranges.pop();E.push(S),this.rangeCount=0}for(var C=E.length;C--;){var q=this.ranges.indexOf(E[C]);this.ranges.splice(q,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),S=S||this.ranges[0],S&&!S.isEqual(this.getRange())&&this.fromOrientedRange(S)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new D,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],S=[],C=0;C<E.length;C++){var q=E[C],Be=q.start.row,se=q.end.row;if(Be===se)S.push(q.clone());else{for(S.push(new _(Be,q.start.column,Be,this.session.getLine(Be).length));++Be<se;)S.push(this.getLineRange(Be,!0));S.push(new _(se,0,se,q.end.column))}C==0&&!this.isBackwards()&&(S=S.reverse())}this.toSingleRange();for(var C=S.length;C--;)this.addRange(S[C])},this.joinSelections=function(){var E=this.rangeList.ranges,S=E[E.length-1],C=_.fromPoints(E[0].start,S.end);this.toSingleRange(),this.setSelectionRange(C,S.cursor==S.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,S=E[E.length-1],C=_.fromPoints(E[0].start,S.end);this.toSingleRange(),this.setSelectionRange(C,S.cursor==S.start)}else{var q=this.session.documentToScreenPosition(this.cursor),Be=this.session.documentToScreenPosition(this.anchor),se=this.rectangularRangeBlock(q,Be);se.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,S,C){var q=[],Be=E.column<S.column;if(Be)var se=E.column,j=S.column,ct=E.offsetX,G=S.offsetX;else var se=S.column,j=E.column,ct=S.offsetX,G=E.offsetX;var U=E.row<S.row;if(U)var b=E.row,w=S.row;else var b=S.row,w=E.row;se<0&&(se=0),b<0&&(b=0),b==w&&(C=!0);for(var W,ot=b;ot<=w;ot++){var at=_.fromPoints(this.session.screenToDocumentPosition(ot,se,ct),this.session.screenToDocumentPosition(ot,j,G));if(at.isEmpty()){if(W&&f(at.end,W))break;W=at.end}at.cursor=Be?at.start:at.end,q.push(at)}if(U&&q.reverse(),!C){for(var lt=q.length-1;q[lt].isEmpty()&<>0;)lt--;if(lt>0)for(var Mt=0;q[Mt].isEmpty();)Mt++;for(var zt=lt;zt>=Mt;zt--)q[zt].isEmpty()&&q.splice(zt,1)}return q}}).call(x.prototype);var s=g("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var S=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",S),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var S=this.session.$selectionMarkers.indexOf(E);S!=-1&&this.session.$selectionMarkers.splice(S,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var S=this.session.$selectionMarkers,C=E.length;C--;){var q=E[C];if(q.marker){this.session.removeMarker(q.marker);var Be=S.indexOf(q);Be!=-1&&S.splice(Be,1)}}this.session.selectionMarkerCount=S.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(r.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(r.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var S=E.command,C=E.editor;if(C.multiSelect){if(S.multiSelectAction)S.multiSelectAction=="forEach"?q=C.forEachSelection(S,E.args):S.multiSelectAction=="forEachLine"?q=C.forEachSelection(S,E.args,!0):S.multiSelectAction=="single"?(C.exitMultiSelectMode(),q=S.exec(C,E.args||{})):q=S.multiSelectAction(C,E.args||{});else{var q=S.exec(C,E.args||{});C.multiSelect.addRange(C.multiSelect.toOrientedRange()),C.multiSelect.mergeOverlappingRanges()}return q}},this.forEachSelection=function(E,S,C){if(!this.inVirtualSelectionMode){var q=C&&C.keepOrder,Be=C==!0||C&&C.$byLines,se=this.session,j=this.selection,ct=j.rangeList,G=(q?j:ct).ranges,U;if(!G.length)return E.exec?E.exec(this,S||{}):E(this,S||{});var b=j._eventRegistry;j._eventRegistry={};var w=new x(se);this.inVirtualSelectionMode=!0;for(var W=G.length;W--;){if(Be)for(;W>0&&G[W].start.row==G[W-1].end.row;)W--;w.fromOrientedRange(G[W]),w.index=W,this.selection=se.selection=w;var ot=E.exec?E.exec(this,S||{}):E(this,S||{});!U&&ot!==void 0&&(U=ot),w.toOrientedRange(G[W])}w.detach(),this.selection=se.selection=j,this.inVirtualSelectionMode=!1,j._eventRegistry=b,j.mergeOverlappingRanges(),j.ranges[0]&&j.fromOrientedRange(j.ranges[0]);var at=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),at&&at.from==at.to&&this.renderer.animateScrolling(at.from),U}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var S=this.multiSelect.rangeList.ranges,C=[],q=0;q<S.length;q++)C.push(this.session.getTextRange(S[q]));var Be=this.session.getDocument().getNewLineCharacter();E=C.join(Be),E.length==(C.length-1)*Be.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,S){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var C=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&S==this.multiSelect.anchor)return;var q=S==this.multiSelect.anchor?C.cursor==C.start?C.end:C.start:C.cursor;q.row!=S.row||this.session.$clipPositionToDocument(q.row,q.column).column!=S.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,S,C){if(S=S||{},S.needle=E||S.needle,S.needle==null){var q=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();S.needle=this.session.getTextRange(q)}this.$search.set(S);var Be=this.$search.findAll(this.session);if(!Be.length)return 0;var se=this.multiSelect;C||se.toSingleRange(Be[0]);for(var j=Be.length;j--;)se.addRange(Be[j],!0);return q&&se.rangeList.rangeAtPoint(q.start)&&se.addRange(q,!0),Be.length},this.selectMoreLines=function(E,S){var C=this.selection.toOrientedRange(),q=C.cursor==C.end,Be=this.session.documentToScreenPosition(C.cursor);this.selection.$desiredColumn&&(Be.column=this.selection.$desiredColumn);var se=this.session.screenToDocumentPosition(Be.row+E,Be.column);if(C.isEmpty())var ct=se;else var j=this.session.documentToScreenPosition(q?C.end:C.start),ct=this.session.screenToDocumentPosition(j.row+E,j.column);if(q){var G=_.fromPoints(se,ct);G.cursor=G.start}else{var G=_.fromPoints(ct,se);G.cursor=G.end}if(G.desiredColumn=Be.column,!this.selection.inMultiSelectMode)this.selection.addRange(C);else if(S)var U=C.cursor;this.selection.addRange(G),U&&this.selection.substractPoint(U)},this.transposeSelections=function(E){for(var S=this.session,C=S.multiSelect,q=C.ranges,Be=q.length;Be--;){var se=q[Be];if(se.isEmpty()){var j=S.getWordRange(se.start.row,se.start.column);se.start.row=j.start.row,se.start.column=j.start.column,se.end.row=j.end.row,se.end.column=j.end.column}}C.mergeOverlappingRanges();for(var ct=[],Be=q.length;Be--;){var se=q[Be];ct.unshift(S.getTextRange(se))}E<0?ct.unshift(ct.pop()):ct.push(ct.shift());for(var Be=q.length;Be--;){var se=q[Be],G=se.clone();S.replace(se,ct[Be]),se.start.row=G.start.row,se.start.column=G.start.column}C.fromOrientedRange(C.ranges[0])},this.selectMore=function(E,S,C){var q=this.session,Be=q.multiSelect,se=Be.toOrientedRange();if(!(se.isEmpty()&&(se=q.getWordRange(se.start.row,se.start.column),se.cursor=E==-1?se.start:se.end,this.multiSelect.addRange(se),C))){var j=q.getTextRange(se),ct=e(q,j,E);ct&&(ct.cursor=E==-1?ct.start:ct.end,this.session.unfold(ct),this.multiSelect.addRange(ct),this.renderer.scrollCursorIntoView(null,.5)),S&&this.multiSelect.substractPoint(se.cursor)}},this.alignCursors=function(){var E=this.session,S=E.multiSelect,C=S.ranges,q=-1,Be=C.filter(function(lt){if(lt.cursor.row==q)return!0;q=lt.cursor.row});if(!C.length||Be.length==C.length-1){var se=this.selection.getRange(),j=se.start.row,ct=se.end.row,G=j==ct;if(G){var U=this.session.getLength(),b;do b=this.session.getLine(ct);while(/[=:]/.test(b)&&++ct<U);do b=this.session.getLine(j);while(/[=:]/.test(b)&&--j>0);j<0&&(j=0),ct>=U&&(ct=U-1)}var w=this.session.removeFullLines(j,ct);w=this.$reAlignText(w,G),this.session.insert({row:j,column:0},w.join(`
|
951
|
+
}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(f,p,Se){var D=f("../lib/dom"),_=f("../lib/oop"),x=f("../lib/event_emitter").EventEmitter,a=function(){function h(i,r){this.canvas=D.createElement("canvas"),this.renderer=r,this.pixelRatio=1,this.maxHeight=r.layerConfig.maxHeight,this.lineHeight=r.layerConfig.lineHeight,this.canvasHeight=i.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=i.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)"},i.element.appendChild(this.canvas)}return h.prototype.$updateDecorators=function(i){var r=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(i){this.maxHeight=i.maxHeight,this.lineHeight=i.lineHeight,this.canvasHeight=i.height;var o=(i.lastRow+1)*this.lineHeight;o<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var t=this.canvas.getContext("2d");function e(ct,G){return ct.priority<G.priority?-1:ct.priority>G.priority?1:0}var n=this.renderer.session.$annotations;if(t.clearRect(0,0,this.canvas.width,this.canvas.height),n){var s={info:1,warning:2,error:3};n.forEach(function(ct){ct.priority=s[ct.type]||null}),n=n.sort(e);for(var g=this.renderer.session.$foldData,m=0;m<n.length;m++){var A=n[m].row,E=this.compensateFoldRows(A,g),S=Math.round((A-E)*this.lineHeight*this.heightRatio),C=Math.round((A-E)*this.lineHeight*this.heightRatio),q=Math.round(((A-E)*this.lineHeight+this.lineHeight)*this.heightRatio),Be=q-C;if(Be<this.minDecorationHeight){var se=(C+q)/2|0;se<this.halfMinDecorationHeight?se=this.halfMinDecorationHeight:se+this.halfMinDecorationHeight>this.canvasHeight&&(se=this.canvasHeight-this.halfMinDecorationHeight),C=Math.round(se-this.halfMinDecorationHeight),q=Math.round(se+this.halfMinDecorationHeight)}t.fillStyle=r[n[m].type]||null,t.fillRect(0,S,this.canvasWidth,q-C)}}var j=this.renderer.session.selection.getCursor();if(j){var E=this.compensateFoldRows(j.row,g),S=Math.round((j.row-E)*this.lineHeight*this.heightRatio);t.fillStyle="rgba(0, 0, 0, 0.5)",t.fillRect(0,S,this.canvasWidth,2)}},h.prototype.compensateFoldRows=function(i,r){var o=0;if(r&&r.length>0)for(var t=0;t<r.length;t++)i>r[t].start.row&&i<r[t].end.row?o+=i-r[t].start.row:i>=r[t].end.row&&(o+=r[t].end.row-r[t].start.row);return o},h}();_.implement(a.prototype,x),p.Decorator=a}),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(f,p,Se){var D=f("./lib/oop"),_=f("./lib/dom"),x=f("./lib/lang"),a=f("./config"),h=f("./layer/gutter").Gutter,i=f("./layer/marker").Marker,r=f("./layer/text").Text,o=f("./layer/cursor").Cursor,t=f("./scrollbar").HScrollBar,e=f("./scrollbar").VScrollBar,n=f("./scrollbar_custom").HScrollBar,s=f("./scrollbar_custom").VScrollBar,g=f("./renderloop").RenderLoop,m=f("./layer/font_metrics").FontMetrics,A=f("./lib/event_emitter").EventEmitter,E=f("./css/editor-css"),S=f("./layer/decorators").Decorator,C=f("./lib/useragent"),q=f("./layer/text_util").isTextToken;_.importCssString(E,"ace_editor.css",!1);var Be=function(){function se(j,ct){var G=this;this.container=j||_.createElement("div"),_.addCssClass(this.container,"ace_editor"),_.HI_DPI&&_.addCssClass(this.container,"ace_hidpi"),this.setTheme(ct),a.get("useStrictCSP")==null&&a.set("useStrictCSP",!1),this.$gutter=_.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=_.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=_.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new h(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new i(this.content);var U=this.$textLayer=new r(this.content);this.canvas=U.element,this.$markerFront=new i(this.content),this.$cursorLayer=new o(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.on("scroll",function(b){G.$scrollAnimation||G.session.setScrollTop(b.data-G.scrollMargin.top)}),this.scrollBarH.on("scroll",function(b){G.$scrollAnimation||G.session.setScrollLeft(b.data-G.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(b){G.updateCharacterSize(),G.onResize(!0,G.gutterWidth,G.$size.width,G.$size.height),G._signal("changeCharacterSize",b)}),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=!C.isIOS,this.$loop=new g(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),a.resetOptions(this),a._signal("renderer",this)}return se.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(),_.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},se.prototype.setSession=function(j){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=j,j&&this.scrollMargin.top&&j.getScrollTop()<=0&&j.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(j),this.$markerBack.setSession(j),this.$markerFront.setSession(j),this.$gutterLayer.setSession(j),this.$textLayer.setSession(j),j&&(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))},se.prototype.updateLines=function(j,ct,G){if(ct===void 0&&(ct=1/0),this.$changedLines?(this.$changedLines.firstRow>j&&(this.$changedLines.firstRow=j),this.$changedLines.lastRow<ct&&(this.$changedLines.lastRow=ct)):this.$changedLines={firstRow:j,lastRow:ct},this.$changedLines.lastRow<this.layerConfig.firstRow)if(G)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},se.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},se.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},se.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},se.prototype.updateFull=function(j){j?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},se.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},se.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},se.prototype.onResize=function(j,ct,G,U){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=j?1:0;var b=this.container;U||(U=b.clientHeight||b.scrollHeight),!U&&this.$maxLines&&this.lineHeight>1&&(!b.style.height||b.style.height=="0px")&&(b.style.height="1px",U=b.clientHeight||b.scrollHeight),G||(G=b.clientWidth||b.scrollWidth);var w=this.$updateCachedSize(j,ct,G,U);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!G&&!U)return this.resizing=0;j&&(this.$gutterLayer.$padding=null),j?this.$renderChanges(w|this.$changes,!0):this.$loop.schedule(w|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},se.prototype.$updateCachedSize=function(j,ct,G,U){U-=this.$extraHeight||0;var b=0,w=this.$size,W={width:w.width,height:w.height,scrollerHeight:w.scrollerHeight,scrollerWidth:w.scrollerWidth};if(U&&(j||w.height!=U)&&(w.height=U,b|=this.CHANGE_SIZE,w.scrollerHeight=w.height,this.$horizScroll&&(w.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(w.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",b=b|this.CHANGE_SCROLL),G&&(j||w.width!=G)){b|=this.CHANGE_SIZE,w.width=G,ct==null&&(ct=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=ct,_.setStyle(this.scrollBarH.element.style,"left",ct+"px"),_.setStyle(this.scroller.style,"left",ct+this.margin.left+"px"),w.scrollerWidth=Math.max(0,G-ct-this.scrollBarV.getWidth()-this.margin.h),_.setStyle(this.$gutter.style,"left",this.margin.left+"px");var ot=this.scrollBarV.getWidth()+"px";_.setStyle(this.scrollBarH.element.style,"right",ot),_.setStyle(this.scroller.style,"right",ot),_.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(w.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||j)&&(b|=this.CHANGE_FULL)}return w.$dirty=!G||!U,b&&this._signal("resize",W),b},se.prototype.onGutterResize=function(j){var ct=this.$showGutter?j:0;ct!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,ct,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()},se.prototype.adjustWrapLimit=function(){var j=this.$size.scrollerWidth-this.$padding*2,ct=Math.floor(j/this.characterWidth);return this.session.adjustWrapLimit(ct,this.$showPrintMargin&&this.$printMarginColumn)},se.prototype.setAnimatedScroll=function(j){this.setOption("animatedScroll",j)},se.prototype.getAnimatedScroll=function(){return this.$animatedScroll},se.prototype.setShowInvisibles=function(j){this.setOption("showInvisibles",j),this.session.$bidiHandler.setShowInvisibles(j)},se.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},se.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},se.prototype.setDisplayIndentGuides=function(j){this.setOption("displayIndentGuides",j)},se.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},se.prototype.setHighlightIndentGuides=function(j){this.setOption("highlightIndentGuides",j)},se.prototype.setShowPrintMargin=function(j){this.setOption("showPrintMargin",j)},se.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},se.prototype.setPrintMarginColumn=function(j){this.setOption("printMarginColumn",j)},se.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},se.prototype.getShowGutter=function(){return this.getOption("showGutter")},se.prototype.setShowGutter=function(j){return this.setOption("showGutter",j)},se.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},se.prototype.setFadeFoldWidgets=function(j){this.setOption("fadeFoldWidgets",j)},se.prototype.setHighlightGutterLine=function(j){this.setOption("highlightGutterLine",j)},se.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},se.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var j=_.createElement("div");j.className="ace_layer ace_print-margin-layer",this.$printMarginEl=_.createElement("div"),this.$printMarginEl.className="ace_print-margin",j.appendChild(this.$printMarginEl),this.content.insertBefore(j,this.content.firstChild)}var ct=this.$printMarginEl.style;ct.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",ct.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},se.prototype.getContainerElement=function(){return this.container},se.prototype.getMouseEventTarget=function(){return this.scroller},se.prototype.getTextAreaContainer=function(){return this.container},se.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var j=this.textarea.style,ct=this.$composition;if(!this.$keepTextAreaAtCursor&&!ct){_.translate(this.textarea,-100,0);return}var G=this.$cursorLayer.$pixelPos;if(G){ct&&ct.markerRange&&(G=this.$cursorLayer.getPixelPosition(ct.markerRange.start,!0));var U=this.layerConfig,b=G.top,w=G.left;b-=U.offset;var W=ct&&ct.useTextareaForIME||C.isMobile?this.lineHeight:1;if(b<0||b>U.height-W){_.translate(this.textarea,0,0);return}var ot=1,at=this.$size.height-W;if(!ct)b+=this.lineHeight;else if(ct.useTextareaForIME){var lt=this.textarea.value;ot=this.characterWidth*this.session.$getStringScreenWidth(lt)[0]}else b+=this.lineHeight+2;w-=this.scrollLeft,w>this.$size.scrollerWidth-ot&&(w=this.$size.scrollerWidth-ot),w+=this.gutterWidth+this.margin.left,_.setStyle(j,"height",W+"px"),_.setStyle(j,"width",ot+"px"),_.translate(this.textarea,Math.min(w,this.$size.scrollerWidth-ot),Math.min(b,at))}}},se.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},se.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},se.prototype.getLastFullyVisibleRow=function(){var j=this.layerConfig,ct=j.lastRow,G=this.session.documentToScreenRow(ct,0)*j.lineHeight;return G-this.session.getScrollTop()>j.height-j.lineHeight?ct-1:ct},se.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},se.prototype.setPadding=function(j){this.$padding=j,this.$textLayer.setPadding(j),this.$cursorLayer.setPadding(j),this.$markerFront.setPadding(j),this.$markerBack.setPadding(j),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},se.prototype.setScrollMargin=function(j,ct,G,U){var b=this.scrollMargin;b.top=j|0,b.bottom=ct|0,b.right=U|0,b.left=G|0,b.v=b.top+b.bottom,b.h=b.left+b.right,b.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-b.top),this.updateFull()},se.prototype.setMargin=function(j,ct,G,U){var b=this.margin;b.top=j|0,b.bottom=ct|0,b.right=U|0,b.left=G|0,b.v=b.top+b.bottom,b.h=b.left+b.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},se.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},se.prototype.setHScrollBarAlwaysVisible=function(j){this.setOption("hScrollBarAlwaysVisible",j)},se.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},se.prototype.setVScrollBarAlwaysVisible=function(j){this.setOption("vScrollBarAlwaysVisible",j)},se.prototype.$updateScrollBarV=function(){var j=this.layerConfig.maxHeight,ct=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(j-=(ct-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>j-ct&&(j=this.scrollTop+ct,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(j+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},se.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},se.prototype.freeze=function(){this.$frozen=!0},se.prototype.unfreeze=function(){this.$frozen=!1},se.prototype.$renderChanges=function(j,ct){if(this.$changes&&(j|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!j&&!ct){this.$changes|=j;return}if(this.$size.$dirty)return this.$changes|=j,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",j),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var G=this.layerConfig;if(j&this.CHANGE_FULL||j&this.CHANGE_SIZE||j&this.CHANGE_TEXT||j&this.CHANGE_LINES||j&this.CHANGE_SCROLL||j&this.CHANGE_H_SCROLL){if(j|=this.$computeLayerConfig()|this.$loop.clear(),G.firstRow!=this.layerConfig.firstRow&&G.firstRowScreen==this.layerConfig.firstRowScreen){var U=this.scrollTop+(G.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;U>0&&(this.scrollTop=U,j=j|this.CHANGE_SCROLL,j|=this.$computeLayerConfig()|this.$loop.clear())}G=this.layerConfig,this.$updateScrollBarV(),j&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),_.translate(this.content,-this.scrollLeft,-G.offset);var b=G.width+2*this.$padding+"px",w=G.minHeight+"px";_.setStyle(this.content.style,"width",b),_.setStyle(this.content.style,"height",w)}if(j&this.CHANGE_H_SCROLL&&(_.translate(this.content,-this.scrollLeft,-G.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),j&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(G),this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G),this.$markerBack.update(G),this.$markerFront.update(G),this.$cursorLayer.update(G),this.$moveTextAreaToCursor(),this._signal("afterRender",j);return}if(j&this.CHANGE_SCROLL){this.$changedLines=null,j&this.CHANGE_TEXT||j&this.CHANGE_LINES?this.$textLayer.update(G):this.$textLayer.scrollLines(G),this.$showGutter&&(j&this.CHANGE_GUTTER||j&this.CHANGE_LINES?this.$gutterLayer.update(G):this.$gutterLayer.scrollLines(G)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G),this.$markerBack.update(G),this.$markerFront.update(G),this.$cursorLayer.update(G),this.$moveTextAreaToCursor(),this._signal("afterRender",j);return}j&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(G),this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_LINES?((this.$updateLines()||j&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_TEXT||j&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)):j&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(G),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(G)),j&this.CHANGE_CURSOR&&(this.$cursorLayer.update(G),this.$moveTextAreaToCursor()),j&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(G),j&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(G),this._signal("afterRender",j)},se.prototype.$autosize=function(){var j=this.session.getScreenLength()*this.lineHeight,ct=this.$maxLines*this.lineHeight,G=Math.min(ct,Math.max((this.$minLines||1)*this.lineHeight,j))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(G+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&G>this.$maxPixelHeight&&(G=this.$maxPixelHeight);var U=G<=2*this.lineHeight,b=!U&&j>ct;if(G!=this.desiredHeight||this.$size.height!=this.desiredHeight||b!=this.$vScroll){b!=this.$vScroll&&(this.$vScroll=b,this.scrollBarV.setVisible(b));var w=this.container.clientWidth;this.container.style.height=G+"px",this.$updateCachedSize(!0,this.$gutterWidth,w,G),this.desiredHeight=G,this._signal("autosize")}},se.prototype.$computeLayerConfig=function(){var j=this.session,ct=this.$size,G=ct.height<=2*this.lineHeight,U=this.session.getScreenLength(),b=U*this.lineHeight,w=this.$getLongestLine(),W=!G&&(this.$hScrollBarAlwaysVisible||ct.scrollerWidth-w-2*this.$padding<0),ot=this.$horizScroll!==W;ot&&(this.$horizScroll=W,this.scrollBarH.setVisible(W));var at=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),G=ct.height<=2*this.lineHeight);var lt=ct.scrollerHeight+this.lineHeight,Mt=!this.$maxLines&&this.$scrollPastEnd?(ct.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;b+=Mt;var zt=this.scrollMargin;this.session.setScrollTop(Math.max(-zt.top,Math.min(this.scrollTop,b-ct.scrollerHeight+zt.bottom))),this.session.setScrollLeft(Math.max(-zt.left,Math.min(this.scrollLeft,w+2*this.$padding-ct.scrollerWidth+zt.right)));var hi=!G&&(this.$vScrollBarAlwaysVisible||ct.scrollerHeight-b+Mt<0||this.scrollTop>zt.top),Ht=at!==hi;Ht&&(this.$vScroll=hi,this.scrollBarV.setVisible(hi));var Vt=this.scrollTop%this.lineHeight,Ut=Math.ceil(lt/this.lineHeight)-1,Jt=Math.max(0,Math.round((this.scrollTop-Vt)/this.lineHeight)),di=Jt+Ut,fi,mi,gi=this.lineHeight;Jt=j.screenToDocumentRow(Jt,0);var wi=j.getFoldLine(Jt);wi&&(Jt=wi.start.row),fi=j.documentToScreenRow(Jt,0),mi=j.getRowLength(Jt)*gi,di=Math.min(j.screenToDocumentRow(di,0),j.getLength()-1),lt=ct.scrollerHeight+j.getRowLength(di)*gi+mi,Vt=this.scrollTop-fi*gi;var Ci=0;return(this.layerConfig.width!=w||ot)&&(Ci=this.CHANGE_H_SCROLL),(ot||Ht)&&(Ci|=this.$updateCachedSize(!0,this.gutterWidth,ct.width,ct.height),this._signal("scrollbarVisibilityChanged"),Ht&&(w=this.$getLongestLine())),this.layerConfig={width:w,padding:this.$padding,firstRow:Jt,firstRowScreen:fi,lastRow:di,lineHeight:gi,characterWidth:this.characterWidth,minHeight:lt,maxHeight:b,offset:Vt,gutterOffset:gi?Math.max(0,Math.ceil((Vt+ct.height-ct.scrollerHeight)/gi)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(w-this.$padding),Ci},se.prototype.$updateLines=function(){if(this.$changedLines){var j=this.$changedLines.firstRow,ct=this.$changedLines.lastRow;this.$changedLines=null;var G=this.layerConfig;if(!(j>G.lastRow+1)&&!(ct<G.firstRow)){if(ct===1/0){this.$showGutter&&this.$gutterLayer.update(G),this.$textLayer.update(G);return}return this.$textLayer.updateLines(G,j,ct),!0}}},se.prototype.$getLongestLine=function(){var j=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(j+=1),this.$textLayer&&j>this.$textLayer.MAX_LINE_LENGTH&&(j=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(j*this.characterWidth))},se.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},se.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},se.prototype.addGutterDecoration=function(j,ct){this.$gutterLayer.addGutterDecoration(j,ct)},se.prototype.removeGutterDecoration=function(j,ct){this.$gutterLayer.removeGutterDecoration(j,ct)},se.prototype.updateBreakpoints=function(j){this._rows=j,this.$loop.schedule(this.CHANGE_GUTTER)},se.prototype.setAnnotations=function(j){this.$gutterLayer.setAnnotations(j),this.$loop.schedule(this.CHANGE_GUTTER)},se.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},se.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},se.prototype.showCursor=function(){this.$cursorLayer.showCursor()},se.prototype.scrollSelectionIntoView=function(j,ct,G){this.scrollCursorIntoView(j,G),this.scrollCursorIntoView(ct,G)},se.prototype.scrollCursorIntoView=function(j,ct,G){if(this.$size.scrollerHeight!==0){var U=this.$cursorLayer.getPixelPosition(j),b=U.left,w=U.top,W=G&&G.top||0,ot=G&&G.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var at=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;at+W>w?(ct&&at+W>w+this.lineHeight&&(w-=ct*this.$size.scrollerHeight),w===0&&(w=-this.scrollMargin.top),this.session.setScrollTop(w)):at+this.$size.scrollerHeight-ot<w+this.lineHeight&&(ct&&at+this.$size.scrollerHeight-ot<w-this.lineHeight&&(w+=ct*this.$size.scrollerHeight),this.session.setScrollTop(w+this.lineHeight+ot-this.$size.scrollerHeight));var lt=this.scrollLeft,Mt=2*this.layerConfig.characterWidth;b-Mt<lt?(b-=Mt,b<this.$padding+Mt&&(b=-this.scrollMargin.left),this.session.setScrollLeft(b)):(b+=Mt,lt+this.$size.scrollerWidth<b+this.characterWidth?this.session.setScrollLeft(Math.round(b+this.characterWidth-this.$size.scrollerWidth)):lt<=this.$padding&&b-lt<this.characterWidth&&this.session.setScrollLeft(0))}},se.prototype.getScrollTop=function(){return this.session.getScrollTop()},se.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},se.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},se.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},se.prototype.scrollToRow=function(j){this.session.setScrollTop(j*this.lineHeight)},se.prototype.alignCursor=function(j,ct){typeof j=="number"&&(j={row:j,column:0});var G=this.$cursorLayer.getPixelPosition(j),U=this.$size.scrollerHeight-this.lineHeight,b=G.top-U*(ct||0);return this.session.setScrollTop(b),b},se.prototype.$calcSteps=function(j,ct){var G=0,U=this.STEPS,b=[],w=function(W,ot,at){return at*(Math.pow(W-1,3)+1)+ot};for(G=0;G<U;++G)b.push(w(G/this.STEPS,j,ct-j));return b},se.prototype.scrollToLine=function(j,ct,G,U){var b=this.$cursorLayer.getPixelPosition({row:j,column:0}),w=b.top;ct&&(w-=this.$size.scrollerHeight/2);var W=this.scrollTop;this.session.setScrollTop(w),G!==!1&&this.animateScrolling(W,U)},se.prototype.animateScrolling=function(j,ct){var G=this.scrollTop;if(!this.$animatedScroll)return;var U=this;if(j==G)return;if(this.$scrollAnimation){var b=this.$scrollAnimation.steps;if(b.length&&(j=b[0],j==G))return}var w=U.$calcSteps(j,G);this.$scrollAnimation={from:j,to:G,steps:w},clearInterval(this.$timer),U.session.setScrollTop(w.shift()),U.session.$scrollTop=G;function W(){U.$timer=clearInterval(U.$timer),U.$scrollAnimation=null,U.$stopAnimation=!1,ct&&ct()}this.$timer=setInterval(function(){if(U.$stopAnimation){W();return}if(!U.session)return clearInterval(U.$timer);w.length?(U.session.setScrollTop(w.shift()),U.session.$scrollTop=G):G!=null?(U.session.$scrollTop=-1,U.session.setScrollTop(G),G=null):W()},10)},se.prototype.scrollToY=function(j){this.scrollTop!==j&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=j)},se.prototype.scrollToX=function(j){this.scrollLeft!==j&&(this.scrollLeft=j),this.$loop.schedule(this.CHANGE_H_SCROLL)},se.prototype.scrollTo=function(j,ct){this.session.setScrollTop(ct),this.session.setScrollLeft(j)},se.prototype.scrollBy=function(j,ct){ct&&this.session.setScrollTop(this.session.getScrollTop()+ct),j&&this.session.setScrollLeft(this.session.getScrollLeft()+j)},se.prototype.isScrollableBy=function(j,ct){if(ct<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||ct>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||j<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||j>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},se.prototype.pixelToScreenCoordinates=function(j,ct){var G;if(this.$hasCssTransforms){G={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([j,ct]);j=U[1]-this.gutterWidth-this.margin.left,ct=U[0]}else G=this.scroller.getBoundingClientRect();var b=j+this.scrollLeft-G.left-this.$padding,w=b/this.characterWidth,W=Math.floor((ct+this.scrollTop-G.top)/this.lineHeight),ot=this.$blockCursor?Math.floor(w):Math.round(w);return{row:W,column:ot,side:w-ot>0?1:-1,offsetX:b}},se.prototype.screenToTextCoordinates=function(j,ct){var G;if(this.$hasCssTransforms){G={top:0,left:0};var U=this.$fontMetrics.transformCoordinates([j,ct]);j=U[1]-this.gutterWidth-this.margin.left,ct=U[0]}else G=this.scroller.getBoundingClientRect();var b=j+this.scrollLeft-G.left-this.$padding,w=b/this.characterWidth,W=this.$blockCursor?Math.floor(w):Math.round(w),ot=Math.floor((ct+this.scrollTop-G.top)/this.lineHeight);return this.session.screenToDocumentPosition(ot,Math.max(W,0),b)},se.prototype.textToScreenCoordinates=function(j,ct){var G=this.scroller.getBoundingClientRect(),U=this.session.documentToScreenPosition(j,ct),b=this.$padding+(this.session.$bidiHandler.isBidiRow(U.row,j)?this.session.$bidiHandler.getPosLeft(U.column):Math.round(U.column*this.characterWidth)),w=U.row*this.lineHeight;return{pageX:G.left+b-this.scrollLeft,pageY:G.top+w-this.scrollTop}},se.prototype.visualizeFocus=function(){_.addCssClass(this.container,"ace_focus")},se.prototype.visualizeBlur=function(){_.removeCssClass(this.container,"ace_focus")},se.prototype.showComposition=function(j){this.$composition=j,j.cssText||(j.cssText=this.textarea.style.cssText),j.useTextareaForIME==null&&(j.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(_.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):j.markerId=this.session.addMarker(j.markerRange,"ace_composition_marker","text")},se.prototype.setCompositionText=function(j){var ct=this.session.selection.cursor;this.addToken(j,"composition_placeholder",ct.row,ct.column),this.$moveTextAreaToCursor()},se.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),_.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var j=this.session.selection.cursor;this.removeExtraToken(j.row,j.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},se.prototype.setGhostText=function(j,ct){var G=this.session.selection.cursor,U=ct||{row:G.row,column:G.column};this.removeGhostText();var b=this.$calculateWrappedTextChunks(j,U);this.addToken(b[0].text,"ghost_text",U.row,U.column),this.$ghostText={text:j,position:{row:U.row,column:U.column}};var w=_.createElement("div");if(b.length>1){var W=this.hideTokensAfterPosition(U.row,U.column),ot;b.slice(1).forEach(function(Ht){var Vt=_.createElement("div"),Ut=_.createElement("span");Ut.className="ace_ghost_text",Ht.wrapped&&(Vt.className="ghost_text_line_wrapped"),Ht.text.length===0&&(Ht.text=" "),Ut.appendChild(_.createTextNode(Ht.text)),Vt.appendChild(Ut),w.appendChild(Vt),ot=Vt}),W.forEach(function(Ht){var Vt=_.createElement("span");q(Ht.type)||(Vt.className="ace_"+Ht.type.replace(/\./g," ace_")),Vt.appendChild(_.createTextNode(Ht.value)),ot.appendChild(Vt)}),this.$ghostTextWidget={el:w,row:U.row,column:U.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var at=this.$cursorLayer.getPixelPosition(U,!0),lt=this.container,Mt=lt.getBoundingClientRect().height,zt=b.length*this.lineHeight,hi=zt<Mt-at.top;if(hi)return;zt<Mt?this.scrollBy(0,(b.length-1)*this.lineHeight):this.scrollToRow(U.row)}},se.prototype.$calculateWrappedTextChunks=function(j,ct){var G=this.$size.scrollerWidth-this.$padding*2,U=Math.floor(G/this.characterWidth)-2;U=U<=0?60:U;for(var b=j.split(/\r?\n/),w=[],W=0;W<b.length;W++){var ot=this.session.$getDisplayTokens(b[W],ct.column),at=this.session.$computeWrapSplits(ot,U,this.session.$tabSize);if(at.length>0){var lt=0;at.push(b[W].length);for(var Mt=0;Mt<at.length;Mt++){var zt=b[W].slice(lt,at[Mt]);w.push({text:zt,wrapped:!0}),lt=at[Mt]}}else w.push({text:b[W],wrapped:!1})}return w},se.prototype.removeGhostText=function(){if(this.$ghostText){var j=this.$ghostText.position;this.removeExtraToken(j.row,j.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},se.prototype.addToken=function(j,ct,G,U){var b=this.session;b.bgTokenizer.lines[G]=null;var w={type:ct,value:j},W=b.getTokens(G);if(U==null||!W.length)W.push(w);else for(var ot=0,at=0;at<W.length;at++){var lt=W[at];if(ot+=lt.value.length,U<=ot){var Mt=lt.value.length-(ot-U),zt=lt.value.slice(0,Mt),hi=lt.value.slice(Mt);W.splice(at,1,{type:lt.type,value:zt},w,{type:lt.type,value:hi});break}}this.updateLines(G,G)},se.prototype.hideTokensAfterPosition=function(j,ct){for(var G=this.session.getTokens(j),U=0,b=!1,w=[],W=0;W<G.length;W++){var ot=G[W];if(U+=ot.value.length,ot.type!=="ghost_text"){if(b){w.push({type:ot.type,value:ot.value}),ot.type="hidden_token";continue}U===ct&&(b=!0)}}return this.updateLines(j,j),w},se.prototype.removeExtraToken=function(j,ct){this.session.bgTokenizer.lines[j]=null,this.updateLines(j,j)},se.prototype.setTheme=function(j,ct){var G=this;if(this.$themeId=j,G._dispatchEvent("themeChange",{theme:j}),!j||typeof j=="string"){var U=j||this.$options.theme.initialValue;a.loadModule(["theme",U],b)}else b(j);function b(w){if(G.$themeId!=j)return ct&&ct();if(!w||!w.cssClass)throw new Error("couldn't load module "+j+" or it didn't call define");w.$id&&(G.$themeId=w.$id),_.importCssString(w.cssText,w.cssClass,G.container),G.theme&&_.removeCssClass(G.container,G.theme.cssClass);var W="padding"in w?w.padding:"padding"in(G.theme||{})?4:G.$padding;G.$padding&&W!=G.$padding&&G.setPadding(W),G.$theme=w.cssClass,G.theme=w,_.addCssClass(G.container,w.cssClass),_.setCssClass(G.container,"ace_dark",w.isDark),G.$size&&(G.$size.width=0,G.$updateSizeAsync()),G._dispatchEvent("themeLoaded",{theme:w}),ct&&ct(),C.isSafari&&G.scroller&&(G.scroller.style.background="red",G.scroller.style.background="")}},se.prototype.getTheme=function(){return this.$themeId},se.prototype.setStyle=function(j,ct){_.setCssClass(this.container,j,ct!==!1)},se.prototype.unsetStyle=function(j){_.removeCssClass(this.container,j)},se.prototype.setCursorStyle=function(j){_.setStyle(this.scroller.style,"cursor",j)},se.prototype.setMouseCursor=function(j){_.setStyle(this.scroller.style,"cursor",j)},se.prototype.attachToShadowRoot=function(){_.importCssString(E,"ace_editor.css",this.container)},se.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},se.prototype.$updateCustomScrollbar=function(j){var ct=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,j===!0?(this.scrollBarV=new s(this.container,this),this.scrollBarH=new n(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollTop(G.data-ct.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollLeft(G.data-ct.scrollMargin.left)}),this.$scrollDecorator=new S(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new e(this.container,this),this.scrollBarH=new t(this.container,this),this.scrollBarV.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollTop(G.data-ct.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(G){ct.$scrollAnimation||ct.session.setScrollLeft(G.data-ct.scrollMargin.left)}))},se.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var j=this;this.$resizeTimer=x.delayedCall(function(){j.destroyed||j.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(ct){var G=ct[0].contentRect.width,U=ct[0].contentRect.height;Math.abs(j.$size.width-G)>1||Math.abs(j.$size.height-U)>1?j.$resizeTimer.delay():j.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},se}();Be.prototype.CHANGE_CURSOR=1,Be.prototype.CHANGE_MARKER=2,Be.prototype.CHANGE_GUTTER=4,Be.prototype.CHANGE_SCROLL=8,Be.prototype.CHANGE_LINES=16,Be.prototype.CHANGE_TEXT=32,Be.prototype.CHANGE_SIZE=64,Be.prototype.CHANGE_MARKER_BACK=128,Be.prototype.CHANGE_MARKER_FRONT=256,Be.prototype.CHANGE_FULL=512,Be.prototype.CHANGE_H_SCROLL=1024,Be.prototype.$changes=0,Be.prototype.$padding=null,Be.prototype.$frozen=!1,Be.prototype.STEPS=8,D.implement(Be.prototype,A),a.defineOptions(Be.prototype,"renderer",{useResizeObserver:{set:function(se){!se&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):se&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(se){this.$textLayer.setShowInvisibles(se)&&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(se){typeof se=="number"&&(this.$printMarginColumn=se),this.$showPrintMargin=!!se,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(se){this.$gutter.style.display=se?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(se){this.$gutterLayer.$useSvgGutterIcons=se},initialValue:!1},showFoldedAnnotations:{set:function(se){this.$gutterLayer.$showFoldedAnnotations=se},initialValue:!1},fadeFoldWidgets:{set:function(se){_.setCssClass(this.$gutter,"ace_fade-fold-widgets",se)},initialValue:!1},showFoldWidgets:{set:function(se){this.$gutterLayer.setShowFoldWidgets(se),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(se){this.$textLayer.setDisplayIndentGuides(se)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(se){this.$textLayer.setHighlightIndentGuides(se)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(se){this.$gutterLayer.setHighlightGutterLine(se),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(se){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(se){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(se){typeof se=="number"&&(se=se+"px"),this.container.style.fontSize=se,this.updateFontSize()},initialValue:12},fontFamily:{set:function(se){this.container.style.fontFamily=se,this.updateFontSize()}},maxLines:{set:function(se){this.updateFull()}},minLines:{set:function(se){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(se){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(se){se=+se||0,this.$scrollPastEnd!=se&&(this.$scrollPastEnd=se,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(se){this.$gutterLayer.$fixedWidth=!!se,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(se){this.$updateCustomScrollbar(se)},initialValue:!1},theme:{set:function(se){this.setTheme(se)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!C.isMobile&&!C.isIE}}),p.VirtualRenderer=Be}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(f,p,Se){var D=f("../lib/oop"),_=f("../lib/net"),x=f("../lib/event_emitter").EventEmitter,a=f("../config");function h(t){var e="importScripts('"+_.qualifyURL(t)+"');";try{return new Blob([e],{type:"application/javascript"})}catch{var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new n;return s.append(e),s.getBlob("application/javascript")}}function i(t){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(a.get("loadWorkerFromBlob")){var e=h(t),n=window.URL||window.webkitURL,s=n.createObjectURL(e);return new Worker(s)}return new Worker(t)}var r=function(t){t.postMessage||(t=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=t,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(){D.implement(this,x),this.$createWorkerFromOldConfig=function(t,e,n,s,g){if(f.nameToUrl&&!f.toUrl&&(f.toUrl=f.nameToUrl),a.get("packaged")||!f.toUrl)s=s||a.moduleUrl(e,"worker");else{var m=this.$normalizePath;s=s||m(f.toUrl("ace/worker/worker.js",null,"_"));var A={};t.forEach(function(E){A[E]=m(f.toUrl(E,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=i(s),g&&this.send("importScripts",g),this.$worker.postMessage({init:!0,tlns:A,module:e,classname:n}),this.$worker},this.onMessage=function(t){var e=t.data;switch(e.type){case"event":this._signal(e.name,{data:e.data});break;case"call":var n=this.callbacks[e.id];n&&(n(e.data),delete this.callbacks[e.id]);break;case"error":this.reportError(e.data);break;case"log":window.console&&console.log&&console.log.apply(console,e.data);break}},this.reportError=function(t){window.console&&console.error&&console.error(t)},this.$normalizePath=function(t){return _.qualifyURL(t)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(t){t.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(t,e){this.$worker.postMessage({command:t,args:e})},this.call=function(t,e,n){if(n){var s=this.callbackId++;this.callbacks[s]=n,e.push(s)}this.send(t,e)},this.emit=function(t,e){try{e.data&&e.data.err&&(e.data.err={message:e.data.err.message,stack:e.data.err.stack,code:e.data.err.code}),this.$worker&&this.$worker.postMessage({event:t,data:{data:e.data}})}catch(n){console.error(n.stack)}},this.attachToDocument=function(t){this.$doc&&this.terminate(),this.$doc=t,this.call("setValue",[t.getValue()]),t.on("change",this.changeListener,!0)},this.changeListener=function(t){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),t.action=="insert"?this.deltaQueue.push(t.start,t.lines):this.deltaQueue.push(t.start,t.end)},this.$sendDeltaQueue=function(){var t=this.deltaQueue;t&&(this.deltaQueue=null,t.length>50&&t.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:t}))}}).call(r.prototype);var o=function(t,e,n){var s=null,g=!1,m=Object.create(x),A=[],E=new r({messageBuffer:A,terminate:function(){},postMessage:function(C){A.push(C),s&&(g?setTimeout(S):S())}});E.setEmitSync=function(C){g=C};var S=function(){var C=A.shift();C.command?s[C.command].apply(s,C.args):C.event&&m._signal(C.event,C.data)};return m.postMessage=function(C){E.onMessage({data:C})},m.callback=function(C,q){this.postMessage({type:"call",id:q,data:C})},m.emit=function(C,q){this.postMessage({type:"event",name:C,data:q})},a.loadModule(["worker",e],function(C){for(s=new C[n](m);A.length;)S()}),E};p.UIWorkerClient=o,p.WorkerClient=r,p.createWorker=i}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(f,p,Se){var D=f("./range").Range,_=f("./lib/event_emitter").EventEmitter,x=f("./lib/oop"),a=function(){function h(i,r,o,t,e,n){var s=this;this.length=r,this.session=i,this.doc=i.getDocument(),this.mainClass=e,this.othersClass=n,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=t,this.$onCursorChange=function(){setTimeout(function(){s.onCursorChange()})},this.$pos=o;var g=i.getUndoManager().$undoStack||i.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=g.length,this.setup(),i.selection.on("changeCursor",this.$onCursorChange)}return h.prototype.setup=function(){var i=this,r=this.doc,o=this.session;this.selectionBefore=o.selection.toJSON(),o.selection.inMultiSelectMode&&o.selection.toSingleRange(),this.pos=r.createAnchor(this.$pos.row,this.$pos.column);var t=this.pos;t.$insertRight=!0,t.detach(),t.markerId=o.addMarker(new D(t.row,t.column,t.row,t.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(e){var n=r.createAnchor(e.row,e.column);n.$insertRight=!0,n.detach(),i.others.push(n)}),o.setUndoSelect(!1)},h.prototype.showOtherMarkers=function(){if(!this.othersActive){var i=this.session,r=this;this.othersActive=!0,this.others.forEach(function(o){o.markerId=i.addMarker(new D(o.row,o.column,o.row,o.column+r.length),r.othersClass,null,!1)})}},h.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var i=0;i<this.others.length;i++)this.session.removeMarker(this.others[i].markerId)}},h.prototype.onUpdate=function(i){if(this.$updating)return this.updateAnchors(i);var r=i;if(r.start.row===r.end.row&&r.start.row===this.pos.row){this.$updating=!0;var o=i.action==="insert"?r.end.column-r.start.column:r.start.column-r.end.column,t=r.start.column>=this.pos.column&&r.start.column<=this.pos.column+this.length+1,e=r.start.column-this.pos.column;if(this.updateAnchors(i),t&&(this.length+=o),t&&!this.session.$fromUndo){if(i.action==="insert")for(var n=this.others.length-1;n>=0;n--){var s=this.others[n],g={row:s.row,column:s.column+e};this.doc.insertMergedLines(g,i.lines)}else if(i.action==="remove")for(var n=this.others.length-1;n>=0;n--){var s=this.others[n],g={row:s.row,column:s.column+e};this.doc.remove(new D(g.row,g.column,g.row,g.column-o))}}this.$updating=!1,this.updateMarkers()}},h.prototype.updateAnchors=function(i){this.pos.onChange(i);for(var r=this.others.length;r--;)this.others[r].onChange(i);this.updateMarkers()},h.prototype.updateMarkers=function(){if(!this.$updating){var i=this,r=this.session,o=function(e,n){r.removeMarker(e.markerId),e.markerId=r.addMarker(new D(e.row,e.column,e.row,e.column+i.length),n,null,!1)};o(this.pos,this.mainClass);for(var t=this.others.length;t--;)o(this.others[t],this.othersClass)}},h.prototype.onCursorChange=function(i){if(!(this.$updating||!this.session)){var r=this.session.selection.getCursor();r.row===this.pos.row&&r.column>=this.pos.column&&r.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",i)):(this.hideOtherMarkers(),this._emit("cursorLeave",i))}},h.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},h.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var i=this.session.getUndoManager(),r=(i.$undoStack||i.$undostack).length-this.$undoStackDepth,o=0;o<r;o++)i.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},h}();x.implement(a.prototype,_),p.PlaceHolder=a}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(f,p,Se){var D=f("../lib/event"),_=f("../lib/useragent");function x(h,i){return h.row==i.row&&h.column==i.column}function a(h){var i=h.domEvent,r=i.altKey,o=i.shiftKey,t=i.ctrlKey,e=h.getAccelKey(),n=h.getButton();if(t&&_.isMac&&(n=i.button),h.editor.inMultiSelectMode&&n==2){h.editor.textInput.onContextMenu(h.domEvent);return}if(!t&&!r&&!e){n===0&&h.editor.inMultiSelectMode&&h.editor.exitMultiSelectMode();return}if(n===0){var s=h.editor,g=s.selection,m=s.inMultiSelectMode,A=h.getDocumentPosition(),E=g.getCursor(),S=h.inSelection()||g.isEmpty()&&x(A,E),C=h.x,q=h.y,Be=function(zt){C=zt.clientX,q=zt.clientY},se=s.session,j=s.renderer.pixelToScreenCoordinates(C,q),ct=j,G;if(s.$mouseHandler.$enableJumpToDef)t&&r||e&&r?G=o?"block":"add":r&&s.$blockSelectEnabled&&(G="block");else if(e&&!r){if(G="add",!m&&o)return}else r&&s.$blockSelectEnabled&&(G="block");if(G&&_.isMac&&i.ctrlKey&&s.$mouseHandler.cancelContextMenu(),G=="add"){if(!m&&S)return;if(!m){var U=g.toOrientedRange();s.addSelectionMarker(U)}var b=g.rangeList.rangeAtPoint(A);s.inVirtualSelectionMode=!0,o&&(b=null,U=g.ranges[0]||U,s.removeSelectionMarker(U)),s.once("mouseup",function(){var zt=g.toOrientedRange();b&&zt.isEmpty()&&x(b.cursor,zt.cursor)?g.substractPoint(zt.cursor):(o?g.substractPoint(U.cursor):U&&(s.removeSelectionMarker(U),g.addRange(U)),g.addRange(zt)),s.inVirtualSelectionMode=!1})}else if(G=="block"){h.stop(),s.inVirtualSelectionMode=!0;var w,W=[],ot=function(){var zt=s.renderer.pixelToScreenCoordinates(C,q),hi=se.screenToDocumentPosition(zt.row,zt.column,zt.offsetX);x(ct,zt)&&x(hi,g.lead)||(ct=zt,s.selection.moveToPosition(hi),s.renderer.scrollCursorIntoView(),s.removeSelectionMarkers(W),W=g.rectangularRangeBlock(ct,j),s.$mouseHandler.$clickSelection&&W.length==1&&W[0].isEmpty()&&(W[0]=s.$mouseHandler.$clickSelection.clone()),W.forEach(s.addSelectionMarker,s),s.updateSelectionMarkers())};m&&!e?g.toSingleRange():!m&&e&&(w=g.toOrientedRange(),s.addSelectionMarker(w)),o?j=se.documentToScreenPosition(g.lead):g.moveToPosition(A),ct={row:-1,column:-1};var at=function(zt){ot(),clearInterval(Mt),s.removeSelectionMarkers(W),W.length||(W=[g.toOrientedRange()]),w&&(s.removeSelectionMarker(w),g.toSingleRange(w));for(var hi=0;hi<W.length;hi++)g.addRange(W[hi]);s.inVirtualSelectionMode=!1,s.$mouseHandler.$clickSelection=null},lt=ot;D.capture(s.container,Be,at);var Mt=setInterval(function(){lt()},20);return h.preventDefault()}}}p.onMouseDown=a}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(f,p,Se){p.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(_){_.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(_){_.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(_){_.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(_){_.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(_){_.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(_){_.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(_){_.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(_){_.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(_){_.multiSelect.rangeCount>1?_.multiSelect.joinSelections():_.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(_){_.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(_){_.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(_){_.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],p.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(_){_.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(_){return _&&_.inMultiSelectMode}}];var D=f("../keyboard/hash_handler").HashHandler;p.keyboardHandler=new D(p.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(f,p,Se){var D=f("./range_list").RangeList,_=f("./range").Range,x=f("./selection").Selection,a=f("./mouse/multi_select_handler").onMouseDown,h=f("./lib/event"),i=f("./lib/lang"),r=f("./commands/multi_select_commands");p.commands=r.defaultCommands.concat(r.multiSelectCommands);var o=f("./search").Search,t=new o;function e(E,S,C){return t.$options.wrap=!0,t.$options.needle=S,t.$options.backwards=C==-1,t.find(E)}var n=f("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(n.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(E,S){if(E){if(!this.inMultiSelectMode&&this.rangeCount===0){var C=this.toOrientedRange();if(this.rangeList.add(C),this.rangeList.add(E),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),S||this.fromOrientedRange(E);this.rangeList.removeAll(),this.rangeList.add(C),this.$onAddRange(C)}E.cursor||(E.cursor=E.end);var q=this.rangeList.add(E);return this.$onAddRange(E),q.length&&this.$onRemoveRange(q),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),S||this.fromOrientedRange(E)}},this.toSingleRange=function(E){E=E||this.ranges[0];var S=this.rangeList.removeAll();S.length&&this.$onRemoveRange(S),E&&this.fromOrientedRange(E)},this.substractPoint=function(E){var S=this.rangeList.substractPoint(E);if(S)return this.$onRemoveRange(S),S[0]},this.mergeOverlappingRanges=function(){var E=this.rangeList.merge();E.length&&this.$onRemoveRange(E)},this.$onAddRange=function(E){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(E),this._signal("addRange",{range:E})},this.$onRemoveRange=function(E){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var S=this.rangeList.ranges.pop();E.push(S),this.rangeCount=0}for(var C=E.length;C--;){var q=this.ranges.indexOf(E[C]);this.ranges.splice(q,1)}this._signal("removeRange",{ranges:E}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),S=S||this.ranges[0],S&&!S.isEqual(this.getRange())&&this.fromOrientedRange(S)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new D,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var E=this.ranges.length?this.ranges:[this.getRange()],S=[],C=0;C<E.length;C++){var q=E[C],Be=q.start.row,se=q.end.row;if(Be===se)S.push(q.clone());else{for(S.push(new _(Be,q.start.column,Be,this.session.getLine(Be).length));++Be<se;)S.push(this.getLineRange(Be,!0));S.push(new _(se,0,se,q.end.column))}C==0&&!this.isBackwards()&&(S=S.reverse())}this.toSingleRange();for(var C=S.length;C--;)this.addRange(S[C])},this.joinSelections=function(){var E=this.rangeList.ranges,S=E[E.length-1],C=_.fromPoints(E[0].start,S.end);this.toSingleRange(),this.setSelectionRange(C,S.cursor==S.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var E=this.rangeList.ranges,S=E[E.length-1],C=_.fromPoints(E[0].start,S.end);this.toSingleRange(),this.setSelectionRange(C,S.cursor==S.start)}else{var q=this.session.documentToScreenPosition(this.cursor),Be=this.session.documentToScreenPosition(this.anchor),se=this.rectangularRangeBlock(q,Be);se.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(E,S,C){var q=[],Be=E.column<S.column;if(Be)var se=E.column,j=S.column,ct=E.offsetX,G=S.offsetX;else var se=S.column,j=E.column,ct=S.offsetX,G=E.offsetX;var U=E.row<S.row;if(U)var b=E.row,w=S.row;else var b=S.row,w=E.row;se<0&&(se=0),b<0&&(b=0),b==w&&(C=!0);for(var W,ot=b;ot<=w;ot++){var at=_.fromPoints(this.session.screenToDocumentPosition(ot,se,ct),this.session.screenToDocumentPosition(ot,j,G));if(at.isEmpty()){if(W&&g(at.end,W))break;W=at.end}at.cursor=Be?at.start:at.end,q.push(at)}if(U&&q.reverse(),!C){for(var lt=q.length-1;q[lt].isEmpty()&<>0;)lt--;if(lt>0)for(var Mt=0;q[Mt].isEmpty();)Mt++;for(var zt=lt;zt>=Mt;zt--)q[zt].isEmpty()&&q.splice(zt,1)}return q}}).call(x.prototype);var s=f("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(E){E.cursor||(E.cursor=E.end);var S=this.getSelectionStyle();return E.marker=this.session.addMarker(E,"ace_selection",S),this.session.$selectionMarkers.push(E),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,E},this.removeSelectionMarker=function(E){if(E.marker){this.session.removeMarker(E.marker);var S=this.session.$selectionMarkers.indexOf(E);S!=-1&&this.session.$selectionMarkers.splice(S,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(E){for(var S=this.session.$selectionMarkers,C=E.length;C--;){var q=E[C];if(q.marker){this.session.removeMarker(q.marker);var Be=S.indexOf(q);Be!=-1&&S.splice(Be,1)}}this.session.selectionMarkerCount=S.length},this.$onAddRange=function(E){this.addSelectionMarker(E.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(E){this.removeSelectionMarkers(E.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(E){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(r.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(E){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(r.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(E){var S=E.command,C=E.editor;if(C.multiSelect){if(S.multiSelectAction)S.multiSelectAction=="forEach"?q=C.forEachSelection(S,E.args):S.multiSelectAction=="forEachLine"?q=C.forEachSelection(S,E.args,!0):S.multiSelectAction=="single"?(C.exitMultiSelectMode(),q=S.exec(C,E.args||{})):q=S.multiSelectAction(C,E.args||{});else{var q=S.exec(C,E.args||{});C.multiSelect.addRange(C.multiSelect.toOrientedRange()),C.multiSelect.mergeOverlappingRanges()}return q}},this.forEachSelection=function(E,S,C){if(!this.inVirtualSelectionMode){var q=C&&C.keepOrder,Be=C==!0||C&&C.$byLines,se=this.session,j=this.selection,ct=j.rangeList,G=(q?j:ct).ranges,U;if(!G.length)return E.exec?E.exec(this,S||{}):E(this,S||{});var b=j._eventRegistry;j._eventRegistry={};var w=new x(se);this.inVirtualSelectionMode=!0;for(var W=G.length;W--;){if(Be)for(;W>0&&G[W].start.row==G[W-1].end.row;)W--;w.fromOrientedRange(G[W]),w.index=W,this.selection=se.selection=w;var ot=E.exec?E.exec(this,S||{}):E(this,S||{});!U&&ot!==void 0&&(U=ot),w.toOrientedRange(G[W])}w.detach(),this.selection=se.selection=j,this.inVirtualSelectionMode=!1,j._eventRegistry=b,j.mergeOverlappingRanges(),j.ranges[0]&&j.fromOrientedRange(j.ranges[0]);var at=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),at&&at.from==at.to&&this.renderer.animateScrolling(at.from),U}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var E="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var S=this.multiSelect.rangeList.ranges,C=[],q=0;q<S.length;q++)C.push(this.session.getTextRange(S[q]));var Be=this.session.getDocument().getNewLineCharacter();E=C.join(Be),E.length==(C.length-1)*Be.length&&(E="")}else this.selection.isEmpty()||(E=this.session.getTextRange(this.getSelectionRange()));return E},this.$checkMultiselectChange=function(E,S){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var C=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&S==this.multiSelect.anchor)return;var q=S==this.multiSelect.anchor?C.cursor==C.start?C.end:C.start:C.cursor;q.row!=S.row||this.session.$clipPositionToDocument(q.row,q.column).column!=S.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(E,S,C){if(S=S||{},S.needle=E||S.needle,S.needle==null){var q=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();S.needle=this.session.getTextRange(q)}this.$search.set(S);var Be=this.$search.findAll(this.session);if(!Be.length)return 0;var se=this.multiSelect;C||se.toSingleRange(Be[0]);for(var j=Be.length;j--;)se.addRange(Be[j],!0);return q&&se.rangeList.rangeAtPoint(q.start)&&se.addRange(q,!0),Be.length},this.selectMoreLines=function(E,S){var C=this.selection.toOrientedRange(),q=C.cursor==C.end,Be=this.session.documentToScreenPosition(C.cursor);this.selection.$desiredColumn&&(Be.column=this.selection.$desiredColumn);var se=this.session.screenToDocumentPosition(Be.row+E,Be.column);if(C.isEmpty())var ct=se;else var j=this.session.documentToScreenPosition(q?C.end:C.start),ct=this.session.screenToDocumentPosition(j.row+E,j.column);if(q){var G=_.fromPoints(se,ct);G.cursor=G.start}else{var G=_.fromPoints(ct,se);G.cursor=G.end}if(G.desiredColumn=Be.column,!this.selection.inMultiSelectMode)this.selection.addRange(C);else if(S)var U=C.cursor;this.selection.addRange(G),U&&this.selection.substractPoint(U)},this.transposeSelections=function(E){for(var S=this.session,C=S.multiSelect,q=C.ranges,Be=q.length;Be--;){var se=q[Be];if(se.isEmpty()){var j=S.getWordRange(se.start.row,se.start.column);se.start.row=j.start.row,se.start.column=j.start.column,se.end.row=j.end.row,se.end.column=j.end.column}}C.mergeOverlappingRanges();for(var ct=[],Be=q.length;Be--;){var se=q[Be];ct.unshift(S.getTextRange(se))}E<0?ct.unshift(ct.pop()):ct.push(ct.shift());for(var Be=q.length;Be--;){var se=q[Be],G=se.clone();S.replace(se,ct[Be]),se.start.row=G.start.row,se.start.column=G.start.column}C.fromOrientedRange(C.ranges[0])},this.selectMore=function(E,S,C){var q=this.session,Be=q.multiSelect,se=Be.toOrientedRange();if(!(se.isEmpty()&&(se=q.getWordRange(se.start.row,se.start.column),se.cursor=E==-1?se.start:se.end,this.multiSelect.addRange(se),C))){var j=q.getTextRange(se),ct=e(q,j,E);ct&&(ct.cursor=E==-1?ct.start:ct.end,this.session.unfold(ct),this.multiSelect.addRange(ct),this.renderer.scrollCursorIntoView(null,.5)),S&&this.multiSelect.substractPoint(se.cursor)}},this.alignCursors=function(){var E=this.session,S=E.multiSelect,C=S.ranges,q=-1,Be=C.filter(function(lt){if(lt.cursor.row==q)return!0;q=lt.cursor.row});if(!C.length||Be.length==C.length-1){var se=this.selection.getRange(),j=se.start.row,ct=se.end.row,G=j==ct;if(G){var U=this.session.getLength(),b;do b=this.session.getLine(ct);while(/[=:]/.test(b)&&++ct<U);do b=this.session.getLine(j);while(/[=:]/.test(b)&&--j>0);j<0&&(j=0),ct>=U&&(ct=U-1)}var w=this.session.removeFullLines(j,ct);w=this.$reAlignText(w,G),this.session.insert({row:j,column:0},w.join(`
|
952
952
|
`)+`
|
953
|
-
`),G||(se.start.column=0,se.end.column=w[w.length-1].length),this.selection.setRange(se)}else{Be.forEach(function(lt){S.substractPoint(lt.cursor)});var W=0,ot=1/0,at=C.map(function(lt){var Mt=lt.cursor,zt=E.getLine(Mt.row),hi=zt.substr(Mt.column).search(/\S/g);return hi==-1&&(hi=0),Mt.column>W&&(W=Mt.column),hi<ot&&(ot=hi),hi});C.forEach(function(lt,Mt){var zt=lt.cursor,hi=W-zt.column,Ht=at[Mt]-ot;hi>Ht?E.insert(zt,i.stringRepeat(" ",hi-Ht)):E.remove(new _(zt.row,zt.column,zt.row,zt.column-hi+Ht)),lt.start.column=lt.end.column=W,lt.start.row=lt.end.row=zt.row,lt.cursor=lt.end}),S.fromOrientedRange(C[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,S){var C=!0,q=!0,Be,se,j;return E.map(function(w){var W=w.match(/(\s*)(.*?)(\s*)([=:].*)/);return W?Be==null?(Be=W[1].length,se=W[2].length,j=W[3].length,W):(Be+se+j!=W[1].length+W[2].length+W[3].length&&(q=!1),Be!=W[1].length&&(C=!1),Be>W[1].length&&(Be=W[1].length),se<W[2].length&&(se=W[2].length),j>W[3].length&&(j=W[3].length),W):[w]}).map(S?G:C?q?U:G:b);function ct(w){return i.stringRepeat(" ",w)}function G(w){return w[2]?ct(Be)+w[2]+ct(se-w[2].length+j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function U(w){return w[2]?ct(Be+se-w[2].length)+w[2]+ct(j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function b(w){return w[2]?ct(Be)+w[2]+ct(j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}}}).call(s.prototype);function
|
953
|
+
`),G||(se.start.column=0,se.end.column=w[w.length-1].length),this.selection.setRange(se)}else{Be.forEach(function(lt){S.substractPoint(lt.cursor)});var W=0,ot=1/0,at=C.map(function(lt){var Mt=lt.cursor,zt=E.getLine(Mt.row),hi=zt.substr(Mt.column).search(/\S/g);return hi==-1&&(hi=0),Mt.column>W&&(W=Mt.column),hi<ot&&(ot=hi),hi});C.forEach(function(lt,Mt){var zt=lt.cursor,hi=W-zt.column,Ht=at[Mt]-ot;hi>Ht?E.insert(zt,i.stringRepeat(" ",hi-Ht)):E.remove(new _(zt.row,zt.column,zt.row,zt.column-hi+Ht)),lt.start.column=lt.end.column=W,lt.start.row=lt.end.row=zt.row,lt.cursor=lt.end}),S.fromOrientedRange(C[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(E,S){var C=!0,q=!0,Be,se,j;return E.map(function(w){var W=w.match(/(\s*)(.*?)(\s*)([=:].*)/);return W?Be==null?(Be=W[1].length,se=W[2].length,j=W[3].length,W):(Be+se+j!=W[1].length+W[2].length+W[3].length&&(q=!1),Be!=W[1].length&&(C=!1),Be>W[1].length&&(Be=W[1].length),se<W[2].length&&(se=W[2].length),j>W[3].length&&(j=W[3].length),W):[w]}).map(S?G:C?q?U:G:b);function ct(w){return i.stringRepeat(" ",w)}function G(w){return w[2]?ct(Be)+w[2]+ct(se-w[2].length+j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function U(w){return w[2]?ct(Be+se-w[2].length)+w[2]+ct(j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}function b(w){return w[2]?ct(Be)+w[2]+ct(j)+w[4].replace(/^([=:])\s+/,"$1 "):w[0]}}}).call(s.prototype);function g(E,S){return E.row==S.row&&E.column==S.column}p.onSessionChange=function(E){var S=E.session;S&&!S.multiSelect&&(S.$selectionMarkers=[],S.selection.$initRangeList(),S.multiSelect=S.selection),this.multiSelect=S&&S.multiSelect;var C=E.oldSession;C&&(C.multiSelect.off("addRange",this.$onAddRange),C.multiSelect.off("removeRange",this.$onRemoveRange),C.multiSelect.off("multiSelect",this.$onMultiSelect),C.multiSelect.off("singleSelect",this.$onSingleSelect),C.multiSelect.lead.off("change",this.$checkMultiselectChange),C.multiSelect.anchor.off("change",this.$checkMultiselectChange)),S&&(S.multiSelect.on("addRange",this.$onAddRange),S.multiSelect.on("removeRange",this.$onRemoveRange),S.multiSelect.on("multiSelect",this.$onMultiSelect),S.multiSelect.on("singleSelect",this.$onSingleSelect),S.multiSelect.lead.on("change",this.$checkMultiselectChange),S.multiSelect.anchor.on("change",this.$checkMultiselectChange)),S&&this.inMultiSelectMode!=S.selection.inMultiSelectMode&&(S.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function m(E){E.$multiselectOnSessionChange||(E.$onAddRange=E.$onAddRange.bind(E),E.$onRemoveRange=E.$onRemoveRange.bind(E),E.$onMultiSelect=E.$onMultiSelect.bind(E),E.$onSingleSelect=E.$onSingleSelect.bind(E),E.$multiselectOnSessionChange=p.onSessionChange.bind(E),E.$checkMultiselectChange=E.$checkMultiselectChange.bind(E),E.$multiselectOnSessionChange(E),E.on("changeSession",E.$multiselectOnSessionChange),E.on("mousedown",a),E.commands.addCommands(r.defaultCommands),A(E))}function A(E){if(!E.textInput)return;var S=E.textInput.getElement(),C=!1;h.addListener(S,"keydown",function(Be){var se=Be.keyCode==18&&!(Be.ctrlKey||Be.shiftKey||Be.metaKey);E.$blockSelectEnabled&&se?C||(E.renderer.setMouseCursor("crosshair"),C=!0):C&&q()},E),h.addListener(S,"keyup",q,E),h.addListener(S,"blur",q,E);function q(Be){C&&(E.renderer.setMouseCursor(""),C=!1)}}p.MultiSelect=m,f("./config").defineOptions(s.prototype,"editor",{enableMultiselect:{set:function(E){m(this),E?this.on("mousedown",a):this.off("mousedown",a)},value:!0},enableBlockSelect:{set:function(E){this.$blockSelectEnabled=E},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(f,p,Se){var D=f("../../range").Range,_=p.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(x,a,h){var i=x.getLine(h);return this.foldingStartMarker.test(i)?"start":a=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(x,a,h){return null},this.indentationBlock=function(x,a,h){var i=/\S/,r=x.getLine(a),o=r.search(i);if(o!=-1){for(var t=h||r.length,e=x.getLength(),n=a,s=a;++a<e;){var g=x.getLine(a).search(i);if(g!=-1){if(g<=o){var m=x.getTokenAt(a,0);if(!m||m.type!=="string")break}s=a}}if(s>n){var A=x.getLine(s).length;return new D(n,t,s,A)}}},this.openingBracketBlock=function(x,a,h,i,r){var o={row:h,column:i+1},t=x.$findClosingBracket(a,o,r);if(t){var e=x.foldWidgets[t.row];return e==null&&(e=x.getFoldWidget(t.row)),e=="start"&&t.row>o.row&&(t.row--,t.column=x.getLine(t.row).length),D.fromPoints(o,t)}},this.closingBracketBlock=function(x,a,h,i,r){var o={row:h,column:i},t=x.$findOpeningBracket(a,o);if(t)return t.column++,o.column--,D.fromPoints(t,o)}}).call(_.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(f,p,Se){var D=f("../lib/dom"),_=f("../range").Range,x=f("../config").nls;function a(i,r,o){for(var t=0,e=i.length-1;t<=e;){var n=t+e>>1,s=o(r,i[n]);if(s>0)t=n+1;else if(s<0)e=n-1;else return n}return-(t+1)}function h(i,r,o){var t=i.getAnnotations().sort(_.comparePoints);if(t.length){var e=a(t,{row:r,column:-1},_.comparePoints);e<0&&(e=-e-1),e>=t.length?e=o>0?0:t.length-1:e===0&&o<0&&(e=t.length-1);var n=t[e];if(!(!n||!o)){if(n.row===r){do n=t[e+=o];while(n&&n.row===r);if(!n)return t.slice()}var s=[];r=n.row;do s[o<0?"unshift":"push"](n),n=t[e+=o];while(n&&n.row==r);return s.length&&s}}}p.showErrorMarker=function(i,r){var o=i.session,t=i.getCursorPosition(),e=t.row,n=o.widgetManager.getWidgetsAtRow(e).filter(function(Be){return Be.type=="errorMarker"})[0];n?n.destroy():e-=r;var s=h(o,e,r),g;if(s){var m=s[0];t.column=(m.pos&&typeof m.column!="number"?m.pos.sc:m.column)||0,t.row=m.row,g=i.renderer.$gutterLayer.$annotations[t.row]}else{if(n)return;g={displayText:[x("error-marker.good-state","Looks good!")],className:"ace_ok"}}i.session.unfold(t.row),i.selection.moveToPosition(t);var A={row:t.row,fixedWidth:!0,coverGutter:!0,el:D.createElement("div"),type:"errorMarker"},E=A.el.appendChild(D.createElement("div")),S=A.el.appendChild(D.createElement("div"));S.className="error_widget_arrow "+g.className;var C=i.renderer.$cursorLayer.getPixelPosition(t).left;S.style.left=C+i.renderer.gutterWidth-5+"px",A.el.className="error_widget_wrapper",E.className="error_widget "+g.className,g.displayText.forEach(function(Be,se){E.appendChild(D.createTextNode(Be)),se<g.displayText.length-1&&E.appendChild(D.createElement("br"))}),E.appendChild(D.createElement("div"));var q=function(Be,se,j){if(se===0&&(j==="esc"||j==="return"))return A.destroy(),{command:"null"}};A.destroy=function(){i.$mouseHandler.isMousePressed||(i.keyBinding.removeKeyboardHandler(q),o.widgetManager.removeLineWidget(A),i.off("changeSelection",A.destroy),i.off("changeSession",A.destroy),i.off("mouseup",A.destroy),i.off("change",A.destroy))},i.keyBinding.addKeyboardHandler(q),i.on("changeSelection",A.destroy),i.on("changeSession",A.destroy),i.on("mouseup",A.destroy),i.on("change",A.destroy),i.session.widgetManager.addLineWidget(A),A.el.onmousedown=i.focus.bind(i),i.renderer.scrollCursorIntoView(null,.5,{bottom:A.el.offsetHeight})},D.importCssString(`
|
954
954
|
.error_widget_wrapper {
|
955
955
|
background: inherit;
|
956
956
|
color: inherit;
|
@@ -983,7 +983,7 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
983
983
|
border-left-color: transparent!important;
|
984
984
|
top: -5px;
|
985
985
|
}
|
986
|
-
`,"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(g,p,Se){g("./loader_build")(p);var D=g("./lib/dom"),_=g("./range").Range,x=g("./editor").Editor,a=g("./edit_session").EditSession,h=g("./undomanager").UndoManager,i=g("./virtual_renderer").VirtualRenderer;g("./worker/worker_client"),g("./keyboard/hash_handler"),g("./placeholder"),g("./multi_select"),g("./mode/folding/fold_mode"),g("./theme/textmate"),g("./ext/error_marker"),p.config=g("./config"),p.edit=function(o,t){if(typeof o=="string"){var e=o;if(o=document.getElementById(e),!o)throw new Error("ace.edit can't find div #"+e)}if(o&&o.env&&o.env.editor instanceof x)return o.env.editor;var n="";if(o&&/input|textarea/i.test(o.tagName)){var s=o;n=s.value,o=D.createElement("pre"),s.parentNode.replaceChild(o,s)}else o&&(n=o.textContent,o.innerHTML="");var f=p.createEditSession(n),m=new x(new i(o),f,t),A={document:f,editor:m,onResize:m.resize.bind(m,null)};return s&&(A.textarea=s),m.on("destroy",function(){A.editor.container.env=null}),m.container.env=m.env=A,m},p.createEditSession=function(o,t){var e=new a(o,t);return e.setUndoManager(new h),e},p.Range=_,p.Editor=x,p.EditSession=a,p.UndoManager=h,p.VirtualRenderer=i;var r=p.config.version;p.version=r}),function(){ace.require(["ace/ace"],function(g){g&&(g.config.init(!0),g.define=ace.define);var p=function(){return this}();!p&&typeof window<"u"&&(p=window),!p&&typeof self<"u"&&(p=self),p.ace||(p.ace=g);for(var Se in g)g.hasOwnProperty(Se)&&(p.ace[Se]=g[Se]);p.ace.default=p.ace,c&&(c.exports=p.ace)})}()}(ace$1)),ace$1.exports}var aceExports=requireAce(),modeRuby={exports:{}},hasRequiredModeRuby;function requireModeRuby(){return hasRequiredModeRuby||(hasRequiredModeRuby=1,function(c,u){ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(g,p,Se){var D=g("../lib/oop"),_=g("./text_highlight_rules").TextHighlightRules,x=p.constantOtherSymbol={token:"constant.other.symbol.ruby",regex:"[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"};p.qString={token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},p.qqString={token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},p.tString={token:"string",regex:"[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"};var a=p.constantNumericHex={token:"constant.numeric",regex:"0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"},h=p.constantNumericBinary={token:"constant.numeric",regex:/\b(0[bB][01](?:[01]|_(?=[01]))*)\b/},i=p.constantNumericDecimal={token:"constant.numeric",regex:/\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/},r=p.constantNumericOctal={token:"constant.numeric",regex:/\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/},o=p.constantNumericRational={token:"constant.numeric",regex:/\b([\d]+(?:[./][\d]+)?ri?)\b/},t=p.constantNumericComplex={token:"constant.numeric",regex:/\b([\d]i)\b/},e=p.constantNumericFloat={token:"constant.numeric",regex:"[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"},n=p.instanceVariable={token:"variable.instance",regex:"@{1,2}[a-zA-Z_\\d]+"},s=function(){var f="abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|validates_inclusion_of|validates_numericality_of|validates_with|validates_each|authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|cache|expire_fragment|expire_cache_for|observe|cache_sweeper|has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|private_class_method|remove_method|undef_method",m="alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend",A="true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION",E="$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|$!|root_url|flash|session|cookies|params|request|response|logger|self",S=this.$keywords=this.createKeywordMapper({keyword:m,"constant.language":A,"variable.language":E,"support.function":f,"invalid.deprecated":"debugger"},"identifier"),C=`\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})`,q={"(":")","[":"]","{":"}","<":">","^":"^","|":"|","%":"%"};this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment.multiline",regex:"^=begin(?=$|\\s.*$)",next:"comment"},{token:"string.regexp",regex:/[/](?=.*\/)/,next:"regex"},[{token:["constant.other.symbol.ruby","string.start"],regex:/(:)?(")/,push:[{token:"constant.language.escape",regex:C},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/"/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/`/,push:[{token:"constant.language.escape",regex:C},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/`/,next:"pop"},{defaultToken:"string"}]},{token:["constant.other.symbol.ruby","string.start"],regex:/(:)?(')/,push:[{token:"constant.language.escape",regex:/\\['\\]/},{token:"string.end",regex:/'/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/%[qwx]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="qStateWithoutInterpolation",this.token}},{token:"string.start",regex:/%[QWX]?([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="qStateWithInterpolation",this.token}},{token:"constant.other.symbol.ruby",regex:/%[si]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="sStateWithoutInterpolation",this.token}},{token:"constant.other.symbol.ruby",regex:/%[SI]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="sStateWithInterpolation",this.token}},{token:"string.regexp",regex:/%[r]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="rState",this.token}}],{token:"punctuation",regex:"::"},n,{token:"variable.global",regex:"[$][a-zA-Z_\\d]+"},{token:"support.class",regex:"[A-Z][a-zA-Z_\\d]*"},{token:["punctuation.operator","support.function"],regex:/(\.)([a-zA-Z_\d]+)(?=\()/},{token:["punctuation.operator","identifier"],regex:/(\.)([a-zA-Z_][a-zA-Z_\d]*)/},{token:"string.character",regex:"\\B\\?(?:"+C+"|\\S)"},{token:"punctuation.operator",regex:/\?(?=.+:)/},o,t,x,a,e,h,i,r,{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:S,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"punctuation.separator.key-value",regex:"=>"},{stateName:"heredoc",onMatch:function(Be,se,j){var ct=Be[2]=="-"||Be[2]=="~"?"indentedHeredoc":"heredoc",G=Be.split(this.splitRegex);return j.push(ct,G[3]),[{type:"constant",value:G[1]},{type:"string",value:G[2]},{type:"support.class",value:G[3]},{type:"string",value:G[4]}]},regex:"(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",rules:{heredoc:[{onMatch:function(Be,se,j){return Be===j[1]?(j.shift(),j.shift(),this.next=j[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^ +"},{onMatch:function(Be,se,j){return Be===j[1]?(j.shift(),j.shift(),this.next=j[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(Be,se){return se[0]==="heredoc"||se[0]==="indentedHeredoc"?se[0]:Be}},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]",onMatch:function(Be,se,j){return this.next="",Be=="}"&&j.length>1&&j[1]!="start"&&(j.shift(),this.next=j.shift()),this.token}},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:/[?:,;.]/}],comment:[{token:"comment.multiline",regex:"^=end(?=$|\\s.*$)",next:"start"},{token:"comment",regex:".+"}],qStateWithInterpolation:[{token:"string.start",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"string"}},{token:"constant.language.escape",regex:C},{token:"constant.language.escape",regex:/\\./},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","string")}},{defaultToken:"string"}],qStateWithoutInterpolation:[{token:"string.start",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"string"}},{token:"constant.language.escape",regex:/\\['\\]/},{token:"constant.language.escape",regex:/\\./},{token:"string.end",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","string")}},{defaultToken:"string"}],sStateWithoutInterpolation:[{token:"constant.other.symbol.ruby",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.other.symbol.ruby"}},{token:"constant.other.symbol.ruby",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.other.symbol.ruby")}},{defaultToken:"constant.other.symbol.ruby"}],sStateWithInterpolation:[{token:"constant.other.symbol.ruby",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.other.symbol.ruby"}},{token:"constant.language.escape",regex:C},{token:"constant.language.escape",regex:/\\./},{token:"paren.start",regex:/#{/,push:"start"},{token:"constant.other.symbol.ruby",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.other.symbol.ruby")}},{defaultToken:"constant.other.symbol.ruby"}],rState:[{token:"string.regexp",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.language.escape"}},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.regexp",regex:/\//},{token:"string.regexp",regex:/[)\]>}^|%][imxouesn]*/,onMatch:function(Be,se,j){return j.length&&Be[0]===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.language.escape")}},{include:"regex"},{defaultToken:"string.regexp"}],regex:[{token:"regexp.keyword",regex:/\\[wWdDhHsS]/},{token:"constant.language.escape",regex:/\\[AGbBzZ]/},{token:"constant.language.escape",regex:/\\g<[a-zA-Z0-9]*>/},{token:["constant.language.escape","regexp.keyword","constant.language.escape"],regex:/(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/},{token:["constant.language.escape","invalid","constant.language.escape"],regex:/(\\p{\^?)([^/]*)(})/},{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:/[/][imxouesn]*/,next:"start"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"regexp.keyword",regex:/\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/},{token:"constant.language.escape",regex:/\[\^?/,push:"regex_character_class"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword",regex:/\\[wWdDhHsS]/},{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:/&?&?\[\^?/,push:"regex_character_class"},{token:"constant.language.escape",regex:"]",next:"pop"},{token:"constant.language.escape",regex:"-"},{defaultToken:"string.regexp.characterclass"}]},this.normalizeRules()};D.inherits(s,_),p.RubyHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(g,p,Se){var D=g("../range").Range,_=function(){};(function(){this.checkOutdent=function(x,a){return/^\s+$/.test(x)?/^\s*\}/.test(a):!1},this.autoOutdent=function(x,a){var h=x.getLine(a),i=h.match(/^(\s*\})/);if(!i)return 0;var r=i[1].length,o=x.findMatchingBracket({row:a,column:r});if(!o||o.row==a)return 0;var t=this.$getIndent(x.getLine(o.row));x.replace(new D(a,0,a,r-1),t)},this.$getIndent=function(x){return x.match(/^\s*/)[0]}}).call(_.prototype),p.MatchingBraceOutdent=_}),ace.define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(g,p,Se){var D=g("../../lib/oop"),_=g("./fold_mode").FoldMode,x=g("../../range").Range,a=g("../../token_iterator").TokenIterator,h=p.FoldMode=function(){};D.inherits(h,_),(function(){this.indentKeywords={class:1,def:1,module:1,do:1,unless:1,if:1,while:1,for:1,until:1,begin:1,else:0,elsif:0,rescue:0,ensure:0,when:0,end:-1,case:1,"=begin":1,"=end":-1},this.foldingStartMarker=/(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/,this.foldingStopMarker=/(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/,this.getFoldWidget=function(i,r,o){var t=i.getLine(o),e=this.foldingStartMarker.test(t),n=this.foldingStopMarker.test(t);if(e&&!n){var s=t.match(this.foldingStartMarker);if(s[1]){if((s[1]=="if"||s[1]=="else"||s[1]=="while"||s[1]=="until"||s[1]=="unless")&&(s[1]=="else"&&/^\s*else\s*$/.test(t)===!1||/^\s*(?:if|else|while|until|unless)\s*/.test(t)===!1)||s[1]=="when"&&/\sthen\s/.test(t)===!0)return;if(i.getTokenAt(o,s.index+2).type==="keyword")return"start"}else if(!s[3]||i.getTokenAt(o,s.index+1).type==="comment.multiline")return"start"}if(r!="markbeginend"||!n||e&&n)return"";var s=t.match(this.foldingStopMarker);if(s[3]==="end"){if(i.getTokenAt(o,s.index+1).type==="keyword")return"end"}else if(!s[1]||i.getTokenAt(o,s.index+1).type==="comment.multiline")return"end"},this.getFoldWidgetRange=function(i,r,o){var t=i.doc.getLine(o),e=this.foldingStartMarker.exec(t);if(e)return e[1]||e[3]?this.rubyBlock(i,o,e.index+2):this.openingBracketBlock(i,"{",o,e.index);var e=this.foldingStopMarker.exec(t);if(e)return e[3]==="end"&&i.getTokenAt(o,e.index+1).type==="keyword"?this.rubyBlock(i,o,e.index+1):e[1]==="=end"&&i.getTokenAt(o,e.index+1).type==="comment.multiline"?this.rubyBlock(i,o,e.index+1):this.closingBracketBlock(i,"}",o,e.index+e[0].length)},this.rubyBlock=function(i,G,o,t){var e=new a(i,G,o),n=e.getCurrentToken();if(!(!n||n.type!="keyword"&&n.type!="comment.multiline")){var s=n.value,f=i.getLine(G);switch(n.value){case"if":case"unless":case"while":case"until":var m=new RegExp("^\\s*"+n.value);if(!m.test(f))return;var A=this.indentKeywords[s];break;case"when":if(/\sthen\s/.test(f))return;case"elsif":case"rescue":case"ensure":var A=1;break;case"else":var m=new RegExp("^\\s*"+n.value+"\\s*$");if(!m.test(f))return;var A=1;break;default:var A=this.indentKeywords[s]}var E=[s];if(A){var S=A===-1?i.getLine(G-1).length:i.getLine(G).length,C=G,q=[];if(q.push(e.getCurrentTokenRange()),e.step=A===-1?e.stepBackward:e.stepForward,n.type=="comment.multiline"){for(;n=e.step();)if(n.type==="comment.multiline"){if(A==1){if(S=6,n.value=="=end")break}else if(n.value=="=begin")break}}else for(;n=e.step();){var Be=!1;if(n.type==="keyword"){var se=A*this.indentKeywords[n.value];switch(f=i.getLine(e.getCurrentTokenRow()),n.value){case"do":for(var j=e.$tokenIndex-1;j>=0;j--){var ct=e.$rowTokens[j];if(ct&&(ct.value=="while"||ct.value=="until"||ct.value=="for")){se=0;break}}break;case"else":var m=new RegExp("^\\s*"+n.value+"\\s*$");(!m.test(f)||s=="case")&&(se=0,Be=!0);break;case"if":case"unless":case"while":case"until":var m=new RegExp("^\\s*"+n.value);m.test(f)||(se=0,Be=!0);break;case"when":(/\sthen\s/.test(f)||s=="case")&&(se=0,Be=!0)}if(se>0)E.unshift(n.value);else if(se<=0&&Be===!1){if(E.shift(),!E.length&&((s=="while"||s=="until"||s=="for")&&n.value!="do"||n.value=="do"&&A==-1&&se!=0||n.value!="do"))break;se===0&&E.unshift(n.value)}}}if(!n)return null;if(t)return q.push(e.getCurrentTokenRange()),q;var G=e.getCurrentTokenRow();if(A===-1){if(n.type==="comment.multiline")var U=6;else var U=i.getLine(G).length;return new x(G,U,C-1,S)}return new x(C,S,G-1,i.getLine(G-1).length)}}}}).call(h.prototype)}),ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/ruby"],function(g,p,Se){var D=g("../lib/oop"),_=g("./text").Mode,x=g("./ruby_highlight_rules").RubyHighlightRules,a=g("./matching_brace_outdent").MatchingBraceOutdent,h=g("../range").Range,i=g("./folding/ruby").FoldMode,r=function(){this.HighlightRules=x,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new i,this.indentKeywords=this.foldingRules.indentKeywords};D.inherits(r,_),(function(){this.lineCommentStart="#",this.getNextLineIndent=function(o,t,e){var n=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,o),f=s.tokens;if(f.length&&f[f.length-1].type=="comment")return n;if(o=="start"){var m=t.match(/^.*[\{\(\[]\s*$/),A=t.match(/^\s*(class|def|module)\s.*$/),E=t.match(/.*do(\s*|\s+\|.*\|\s*)$/),S=t.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);(m||A||E||S)&&(n+=e)}return n},this.checkOutdent=function(o,t,e){return/^\s+(end|else|rescue|ensure)$/.test(t+e)||this.$outdent.checkOutdent(t,e)},this.autoOutdent=function(o,t,e){var n=t.getLine(e);if(/}/.test(n))return this.$outdent.autoOutdent(t,e);var s=this.$getIndent(n),f=t.getLine(e-1),m=this.$getIndent(f),A=t.getTabString();m.length<=s.length&&s.slice(-A.length)==A&&t.remove(new h(e,s.length-A.length,e,s.length))},this.getMatching=function(o,t,e){if(t==null){var n=o.selection.lead;e=n.column,t=n.row}var s=o.getTokenAt(t,e);if(s&&s.value in this.indentKeywords)return this.foldingRules.rubyBlock(o,t,e,!0)},this.$id="ace/mode/ruby",this.snippetFileId="ace/snippets/ruby"}).call(r.prototype),p.Mode=r}),function(){ace.require(["ace/mode/ruby"],function(g){c&&(c.exports=g)})}()}(modeRuby)),modeRuby.exports}requireModeRuby();var themeTwilight={exports:{}},hasRequiredThemeTwilight;function requireThemeTwilight(){return hasRequiredThemeTwilight||(hasRequiredThemeTwilight=1,function(c,u){ace.define("ace/theme/twilight-css",["require","exports","module"],function(g,p,Se){Se.exports=`.ace-twilight .ace_gutter {
|
986
|
+
`,"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(f,p,Se){f("./loader_build")(p);var D=f("./lib/dom"),_=f("./range").Range,x=f("./editor").Editor,a=f("./edit_session").EditSession,h=f("./undomanager").UndoManager,i=f("./virtual_renderer").VirtualRenderer;f("./worker/worker_client"),f("./keyboard/hash_handler"),f("./placeholder"),f("./multi_select"),f("./mode/folding/fold_mode"),f("./theme/textmate"),f("./ext/error_marker"),p.config=f("./config"),p.edit=function(o,t){if(typeof o=="string"){var e=o;if(o=document.getElementById(e),!o)throw new Error("ace.edit can't find div #"+e)}if(o&&o.env&&o.env.editor instanceof x)return o.env.editor;var n="";if(o&&/input|textarea/i.test(o.tagName)){var s=o;n=s.value,o=D.createElement("pre"),s.parentNode.replaceChild(o,s)}else o&&(n=o.textContent,o.innerHTML="");var g=p.createEditSession(n),m=new x(new i(o),g,t),A={document:g,editor:m,onResize:m.resize.bind(m,null)};return s&&(A.textarea=s),m.on("destroy",function(){A.editor.container.env=null}),m.container.env=m.env=A,m},p.createEditSession=function(o,t){var e=new a(o,t);return e.setUndoManager(new h),e},p.Range=_,p.Editor=x,p.EditSession=a,p.UndoManager=h,p.VirtualRenderer=i;var r=p.config.version;p.version=r}),function(){ace.require(["ace/ace"],function(f){f&&(f.config.init(!0),f.define=ace.define);var p=function(){return this}();!p&&typeof window<"u"&&(p=window),!p&&typeof self<"u"&&(p=self),p.ace||(p.ace=f);for(var Se in f)f.hasOwnProperty(Se)&&(p.ace[Se]=f[Se]);p.ace.default=p.ace,c&&(c.exports=p.ace)})}()}(ace$1)),ace$1.exports}var aceExports=requireAce(),modeRuby={exports:{}},hasRequiredModeRuby;function requireModeRuby(){return hasRequiredModeRuby||(hasRequiredModeRuby=1,function(c,u){ace.define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(f,p,Se){var D=f("../lib/oop"),_=f("./text_highlight_rules").TextHighlightRules,x=p.constantOtherSymbol={token:"constant.other.symbol.ruby",regex:"[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"};p.qString={token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},p.qqString={token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},p.tString={token:"string",regex:"[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"};var a=p.constantNumericHex={token:"constant.numeric",regex:"0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"},h=p.constantNumericBinary={token:"constant.numeric",regex:/\b(0[bB][01](?:[01]|_(?=[01]))*)\b/},i=p.constantNumericDecimal={token:"constant.numeric",regex:/\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/},r=p.constantNumericOctal={token:"constant.numeric",regex:/\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/},o=p.constantNumericRational={token:"constant.numeric",regex:/\b([\d]+(?:[./][\d]+)?ri?)\b/},t=p.constantNumericComplex={token:"constant.numeric",regex:/\b([\d]i)\b/},e=p.constantNumericFloat={token:"constant.numeric",regex:"[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?i?\\b"},n=p.instanceVariable={token:"variable.instance",regex:"@{1,2}[a-zA-Z_\\d]+"},s=function(){var g="abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|validates_inclusion_of|validates_numericality_of|validates_with|validates_each|authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|cache|expire_fragment|expire_cache_for|observe|cache_sweeper|has_many|has_one|belongs_to|has_and_belongs_to_many|p|warn|refine|using|module_function|extend|alias_method|private_class_method|remove_method|undef_method",m="alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|__ENCODING__|prepend",A="true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|RUBY_PATCHLEVEL|RUBY_REVISION|RUBY_COPYRIGHT|RUBY_ENGINE|RUBY_ENGINE_VERSION|RUBY_DESCRIPTION",E="$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|$!|root_url|flash|session|cookies|params|request|response|logger|self",S=this.$keywords=this.createKeywordMapper({keyword:m,"constant.language":A,"variable.language":E,"support.function":g,"invalid.deprecated":"debugger"},"identifier"),C=`\\\\(?:n(?:[1-7][0-7]{0,2}|0)|[nsrtvfbae'"\\\\]|c(?:\\\\M-)?.|M-(?:\\\\C-|\\\\c)?.|C-(?:\\\\M-)?.|[0-7]{3}|x[\\da-fA-F]{2}|u[\\da-fA-F]{4}|u{[\\da-fA-F]{1,6}(?:\\s[\\da-fA-F]{1,6})*})`,q={"(":")","[":"]","{":"}","<":">","^":"^","|":"|","%":"%"};this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"comment.multiline",regex:"^=begin(?=$|\\s.*$)",next:"comment"},{token:"string.regexp",regex:/[/](?=.*\/)/,next:"regex"},[{token:["constant.other.symbol.ruby","string.start"],regex:/(:)?(")/,push:[{token:"constant.language.escape",regex:C},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/"/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/`/,push:[{token:"constant.language.escape",regex:C},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/`/,next:"pop"},{defaultToken:"string"}]},{token:["constant.other.symbol.ruby","string.start"],regex:/(:)?(')/,push:[{token:"constant.language.escape",regex:/\\['\\]/},{token:"string.end",regex:/'/,next:"pop"},{defaultToken:"string"}]},{token:"string.start",regex:/%[qwx]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="qStateWithoutInterpolation",this.token}},{token:"string.start",regex:/%[QWX]?([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="qStateWithInterpolation",this.token}},{token:"constant.other.symbol.ruby",regex:/%[si]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="sStateWithoutInterpolation",this.token}},{token:"constant.other.symbol.ruby",regex:/%[SI]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="sStateWithInterpolation",this.token}},{token:"string.regexp",regex:/%[r]([(\[<{^|%])/,onMatch:function(Be,se,j){j.length&&(j=[]);var ct=Be[Be.length-1];return j.unshift(ct,se),this.next="rState",this.token}}],{token:"punctuation",regex:"::"},n,{token:"variable.global",regex:"[$][a-zA-Z_\\d]+"},{token:"support.class",regex:"[A-Z][a-zA-Z_\\d]*"},{token:["punctuation.operator","support.function"],regex:/(\.)([a-zA-Z_\d]+)(?=\()/},{token:["punctuation.operator","identifier"],regex:/(\.)([a-zA-Z_][a-zA-Z_\d]*)/},{token:"string.character",regex:"\\B\\?(?:"+C+"|\\S)"},{token:"punctuation.operator",regex:/\?(?=.+:)/},o,t,x,a,e,h,i,r,{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:S,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"punctuation.separator.key-value",regex:"=>"},{stateName:"heredoc",onMatch:function(Be,se,j){var ct=Be[2]=="-"||Be[2]=="~"?"indentedHeredoc":"heredoc",G=Be.split(this.splitRegex);return j.push(ct,G[3]),[{type:"constant",value:G[1]},{type:"string",value:G[2]},{type:"support.class",value:G[3]},{type:"string",value:G[4]}]},regex:"(<<[-~]?)(['\"`]?)([\\w]+)(['\"`]?)",rules:{heredoc:[{onMatch:function(Be,se,j){return Be===j[1]?(j.shift(),j.shift(),this.next=j[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^ +"},{onMatch:function(Be,se,j){return Be===j[1]?(j.shift(),j.shift(),this.next=j[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(Be,se){return se[0]==="heredoc"||se[0]==="indentedHeredoc"?se[0]:Be}},{token:"keyword.operator",regex:"!|\\$|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\||\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]",onMatch:function(Be,se,j){return this.next="",Be=="}"&&j.length>1&&j[1]!="start"&&(j.shift(),this.next=j.shift()),this.token}},{token:"text",regex:"\\s+"},{token:"punctuation.operator",regex:/[?:,;.]/}],comment:[{token:"comment.multiline",regex:"^=end(?=$|\\s.*$)",next:"start"},{token:"comment",regex:".+"}],qStateWithInterpolation:[{token:"string.start",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"string"}},{token:"constant.language.escape",regex:C},{token:"constant.language.escape",regex:/\\./},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.end",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","string")}},{defaultToken:"string"}],qStateWithoutInterpolation:[{token:"string.start",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"string"}},{token:"constant.language.escape",regex:/\\['\\]/},{token:"constant.language.escape",regex:/\\./},{token:"string.end",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","string")}},{defaultToken:"string"}],sStateWithoutInterpolation:[{token:"constant.other.symbol.ruby",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.other.symbol.ruby"}},{token:"constant.other.symbol.ruby",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.other.symbol.ruby")}},{defaultToken:"constant.other.symbol.ruby"}],sStateWithInterpolation:[{token:"constant.other.symbol.ruby",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.other.symbol.ruby"}},{token:"constant.language.escape",regex:C},{token:"constant.language.escape",regex:/\\./},{token:"paren.start",regex:/#{/,push:"start"},{token:"constant.other.symbol.ruby",regex:/[)\]>}^|%]/,onMatch:function(Be,se,j){return j.length&&Be===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.other.symbol.ruby")}},{defaultToken:"constant.other.symbol.ruby"}],rState:[{token:"string.regexp",regex:/[(\[<{]/,onMatch:function(Be,se,j){return j.length&&Be===j[0]?(j.unshift(Be,se),this.token):"constant.language.escape"}},{token:"paren.start",regex:/#{/,push:"start"},{token:"string.regexp",regex:/\//},{token:"string.regexp",regex:/[)\]>}^|%][imxouesn]*/,onMatch:function(Be,se,j){return j.length&&Be[0]===q[j[0]]?(j.shift(),this.next=j.shift(),this.token):(this.next="","constant.language.escape")}},{include:"regex"},{defaultToken:"string.regexp"}],regex:[{token:"regexp.keyword",regex:/\\[wWdDhHsS]/},{token:"constant.language.escape",regex:/\\[AGbBzZ]/},{token:"constant.language.escape",regex:/\\g<[a-zA-Z0-9]*>/},{token:["constant.language.escape","regexp.keyword","constant.language.escape"],regex:/(\\p{\^?)(Alnum|Alpha|Blank|Cntrl|Digit|Graph|Lower|Print|Punct|Space|Upper|XDigit|Word|ASCII|Any|Assigned|Arabic|Armenian|Balinese|Bengali|Bopomofo|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Ethiopic|Georgian|Glagolitic|Gothic|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hebrew|Hiragana|Inherited|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Lao|Latin|Lepcha|Limbu|Linear_B|Lycian|Lydian|Malayalam|Mongolian|Myanmar|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Italic|Old_Persian|Oriya|Osmanya|Phags_Pa|Phoenician|Rejang|Runic|Saurashtra|Shavian|Sinhala|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Ugaritic|Vai|Yi|Ll|Lm|Lt|Lu|Lo|Mn|Mc|Me|Nd|Nl|Pc|Pd|Ps|Pe|Pi|Pf|Po|No|Sm|Sc|Sk|So|Zs|Zl|Zp|Cc|Cf|Cn|Co|Cs|N|L|M|P|S|Z|C)(})/},{token:["constant.language.escape","invalid","constant.language.escape"],regex:/(\\p{\^?)([^/]*)(})/},{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:/[/][imxouesn]*/,next:"start"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?(?:[:=!>]|<'?[a-zA-Z]*'?>|<[=!])|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"regexp.keyword",regex:/\[\[:(?:alnum|alpha|blank|cntrl|digit|graph|lower|print|punct|space|upper|xdigit|word|ascii):\]\]/},{token:"constant.language.escape",regex:/\[\^?/,push:"regex_character_class"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword",regex:/\\[wWdDhHsS]/},{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:/&?&?\[\^?/,push:"regex_character_class"},{token:"constant.language.escape",regex:"]",next:"pop"},{token:"constant.language.escape",regex:"-"},{defaultToken:"string.regexp.characterclass"}]},this.normalizeRules()};D.inherits(s,_),p.RubyHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(f,p,Se){var D=f("../range").Range,_=function(){};(function(){this.checkOutdent=function(x,a){return/^\s+$/.test(x)?/^\s*\}/.test(a):!1},this.autoOutdent=function(x,a){var h=x.getLine(a),i=h.match(/^(\s*\})/);if(!i)return 0;var r=i[1].length,o=x.findMatchingBracket({row:a,column:r});if(!o||o.row==a)return 0;var t=this.$getIndent(x.getLine(o.row));x.replace(new D(a,0,a,r-1),t)},this.$getIndent=function(x){return x.match(/^\s*/)[0]}}).call(_.prototype),p.MatchingBraceOutdent=_}),ace.define("ace/mode/folding/ruby",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(f,p,Se){var D=f("../../lib/oop"),_=f("./fold_mode").FoldMode,x=f("../../range").Range,a=f("../../token_iterator").TokenIterator,h=p.FoldMode=function(){};D.inherits(h,_),(function(){this.indentKeywords={class:1,def:1,module:1,do:1,unless:1,if:1,while:1,for:1,until:1,begin:1,else:0,elsif:0,rescue:0,ensure:0,when:0,end:-1,case:1,"=begin":1,"=end":-1},this.foldingStartMarker=/(?:\s|^)(def|do|while|class|unless|module|if|for|until|begin|else|elsif|case|rescue|ensure|when)\b|({\s*$)|(=begin)/,this.foldingStopMarker=/(=end(?=$|\s.*$))|(^\s*})|\b(end)\b/,this.getFoldWidget=function(i,r,o){var t=i.getLine(o),e=this.foldingStartMarker.test(t),n=this.foldingStopMarker.test(t);if(e&&!n){var s=t.match(this.foldingStartMarker);if(s[1]){if((s[1]=="if"||s[1]=="else"||s[1]=="while"||s[1]=="until"||s[1]=="unless")&&(s[1]=="else"&&/^\s*else\s*$/.test(t)===!1||/^\s*(?:if|else|while|until|unless)\s*/.test(t)===!1)||s[1]=="when"&&/\sthen\s/.test(t)===!0)return;if(i.getTokenAt(o,s.index+2).type==="keyword")return"start"}else if(!s[3]||i.getTokenAt(o,s.index+1).type==="comment.multiline")return"start"}if(r!="markbeginend"||!n||e&&n)return"";var s=t.match(this.foldingStopMarker);if(s[3]==="end"){if(i.getTokenAt(o,s.index+1).type==="keyword")return"end"}else if(!s[1]||i.getTokenAt(o,s.index+1).type==="comment.multiline")return"end"},this.getFoldWidgetRange=function(i,r,o){var t=i.doc.getLine(o),e=this.foldingStartMarker.exec(t);if(e)return e[1]||e[3]?this.rubyBlock(i,o,e.index+2):this.openingBracketBlock(i,"{",o,e.index);var e=this.foldingStopMarker.exec(t);if(e)return e[3]==="end"&&i.getTokenAt(o,e.index+1).type==="keyword"?this.rubyBlock(i,o,e.index+1):e[1]==="=end"&&i.getTokenAt(o,e.index+1).type==="comment.multiline"?this.rubyBlock(i,o,e.index+1):this.closingBracketBlock(i,"}",o,e.index+e[0].length)},this.rubyBlock=function(i,G,o,t){var e=new a(i,G,o),n=e.getCurrentToken();if(!(!n||n.type!="keyword"&&n.type!="comment.multiline")){var s=n.value,g=i.getLine(G);switch(n.value){case"if":case"unless":case"while":case"until":var m=new RegExp("^\\s*"+n.value);if(!m.test(g))return;var A=this.indentKeywords[s];break;case"when":if(/\sthen\s/.test(g))return;case"elsif":case"rescue":case"ensure":var A=1;break;case"else":var m=new RegExp("^\\s*"+n.value+"\\s*$");if(!m.test(g))return;var A=1;break;default:var A=this.indentKeywords[s]}var E=[s];if(A){var S=A===-1?i.getLine(G-1).length:i.getLine(G).length,C=G,q=[];if(q.push(e.getCurrentTokenRange()),e.step=A===-1?e.stepBackward:e.stepForward,n.type=="comment.multiline"){for(;n=e.step();)if(n.type==="comment.multiline"){if(A==1){if(S=6,n.value=="=end")break}else if(n.value=="=begin")break}}else for(;n=e.step();){var Be=!1;if(n.type==="keyword"){var se=A*this.indentKeywords[n.value];switch(g=i.getLine(e.getCurrentTokenRow()),n.value){case"do":for(var j=e.$tokenIndex-1;j>=0;j--){var ct=e.$rowTokens[j];if(ct&&(ct.value=="while"||ct.value=="until"||ct.value=="for")){se=0;break}}break;case"else":var m=new RegExp("^\\s*"+n.value+"\\s*$");(!m.test(g)||s=="case")&&(se=0,Be=!0);break;case"if":case"unless":case"while":case"until":var m=new RegExp("^\\s*"+n.value);m.test(g)||(se=0,Be=!0);break;case"when":(/\sthen\s/.test(g)||s=="case")&&(se=0,Be=!0)}if(se>0)E.unshift(n.value);else if(se<=0&&Be===!1){if(E.shift(),!E.length&&((s=="while"||s=="until"||s=="for")&&n.value!="do"||n.value=="do"&&A==-1&&se!=0||n.value!="do"))break;se===0&&E.unshift(n.value)}}}if(!n)return null;if(t)return q.push(e.getCurrentTokenRange()),q;var G=e.getCurrentTokenRow();if(A===-1){if(n.type==="comment.multiline")var U=6;else var U=i.getLine(G).length;return new x(G,U,C-1,S)}return new x(C,S,G-1,i.getLine(G-1).length)}}}}).call(h.prototype)}),ace.define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/ruby"],function(f,p,Se){var D=f("../lib/oop"),_=f("./text").Mode,x=f("./ruby_highlight_rules").RubyHighlightRules,a=f("./matching_brace_outdent").MatchingBraceOutdent,h=f("../range").Range,i=f("./folding/ruby").FoldMode,r=function(){this.HighlightRules=x,this.$outdent=new a,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new i,this.indentKeywords=this.foldingRules.indentKeywords};D.inherits(r,_),(function(){this.lineCommentStart="#",this.getNextLineIndent=function(o,t,e){var n=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,o),g=s.tokens;if(g.length&&g[g.length-1].type=="comment")return n;if(o=="start"){var m=t.match(/^.*[\{\(\[]\s*$/),A=t.match(/^\s*(class|def|module)\s.*$/),E=t.match(/.*do(\s*|\s+\|.*\|\s*)$/),S=t.match(/^\s*(if|else|when|elsif|unless|while|for|begin|rescue|ensure)\s*/);(m||A||E||S)&&(n+=e)}return n},this.checkOutdent=function(o,t,e){return/^\s+(end|else|rescue|ensure)$/.test(t+e)||this.$outdent.checkOutdent(t,e)},this.autoOutdent=function(o,t,e){var n=t.getLine(e);if(/}/.test(n))return this.$outdent.autoOutdent(t,e);var s=this.$getIndent(n),g=t.getLine(e-1),m=this.$getIndent(g),A=t.getTabString();m.length<=s.length&&s.slice(-A.length)==A&&t.remove(new h(e,s.length-A.length,e,s.length))},this.getMatching=function(o,t,e){if(t==null){var n=o.selection.lead;e=n.column,t=n.row}var s=o.getTokenAt(t,e);if(s&&s.value in this.indentKeywords)return this.foldingRules.rubyBlock(o,t,e,!0)},this.$id="ace/mode/ruby",this.snippetFileId="ace/snippets/ruby"}).call(r.prototype),p.Mode=r}),function(){ace.require(["ace/mode/ruby"],function(f){c&&(c.exports=f)})}()}(modeRuby)),modeRuby.exports}requireModeRuby();var themeTwilight={exports:{}},hasRequiredThemeTwilight;function requireThemeTwilight(){return hasRequiredThemeTwilight||(hasRequiredThemeTwilight=1,function(c,u){ace.define("ace/theme/twilight-css",["require","exports","module"],function(f,p,Se){Se.exports=`.ace-twilight .ace_gutter {
|
987
987
|
background: #232323;
|
988
988
|
color: #E2E2E2
|
989
989
|
}
|
@@ -1113,13 +1113,13 @@ System.register(["./main-3c9571b980a0517d1332.js","vue","./CriticalCmdDialog-D4-
|
|
1113
1113
|
.ace-twilight .ace_indent-guide-active {
|
1114
1114
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;
|
1115
1115
|
}
|
1116
|
-
`}),ace.define("ace/theme/twilight",["require","exports","module","ace/theme/twilight-css","ace/lib/dom"],function(g,p,Se){p.isDark=!0,p.cssClass="ace-twilight",p.cssText=g("./twilight-css");var D=g("../lib/dom");D.importCssString(p.cssText,p.cssClass,!1)}),function(){ace.require(["ace/theme/twilight"],function(g){c&&(c.exports=g)})}()}(themeTwilight)),themeTwilight.exports}requireThemeTwilight();var Gt=Object.defineProperty,Zt=(c,u,g)=>u in c?Gt(c,u,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[u]=g,v=(c,u,g)=>Zt(c,typeof u!="symbol"?u+"":u,g);function mt(c,u){return function(){return c.apply(u,arguments)}}const{toString:Qt}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:de,toStringTag:gt}=Symbol,fe=(c=>u=>{const g=Qt.call(u);return c[g]||(c[g]=g.slice(8,-1).toLowerCase())})(Object.create(null)),$=c=>(c=c.toLowerCase(),u=>fe(u)===c),pe=c=>u=>typeof u===c,{isArray:K}=Array,Y=pe("undefined");function Yt(c){return c!==null&&!Y(c)&&c.constructor!==null&&!Y(c.constructor)&&T(c.constructor.isBuffer)&&c.constructor.isBuffer(c)}const bt=$("ArrayBuffer");function en(c){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(c):u=c&&c.buffer&&bt(c.buffer),u}const tn=pe("string"),T=pe("function"),yt=pe("number"),me=c=>c!==null&&typeof c=="object",nn=c=>c===!0||c===!1,ce=c=>{if(fe(c)!=="object")return!1;const u=Fe(c);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(gt in c)&&!(de in c)},sn=$("Date"),rn=$("File"),on=$("Blob"),cn=$("FileList"),an=c=>me(c)&&T(c.pipe),ln=c=>{let u;return c&&(typeof FormData=="function"&&c instanceof FormData||T(c.append)&&((u=fe(c))==="formdata"||u==="object"&&T(c.toString)&&c.toString()==="[object FormData]"))},un=$("URLSearchParams"),[hn,dn,fn,pn]=["ReadableStream","Request","Response","Headers"].map($),mn=c=>c.trim?c.trim():c.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(c,u,{allOwnKeys:g=!1}={}){if(c===null||typeof c>"u")return;let p,Se;if(typeof c!="object"&&(c=[c]),K(c))for(p=0,Se=c.length;p<Se;p++)u.call(null,c[p],p,c);else{const D=g?Object.getOwnPropertyNames(c):Object.keys(c),_=D.length;let x;for(p=0;p<_;p++)x=D[p],u.call(null,c[x],x,c)}}function wt(c,u){u=u.toLowerCase();const g=Object.keys(c);let p=g.length,Se;for(;p-- >0;)if(Se=g[p],u===Se.toLowerCase())return Se;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_t=c=>!Y(c)&&c!==H;function Te(){const{caseless:c}=_t(this)&&this||{},u={},g=(p,Se)=>{const D=c&&wt(u,Se)||Se;ce(u[D])&&ce(p)?u[D]=Te(u[D],p):ce(p)?u[D]=Te({},p):K(p)?u[D]=p.slice():u[D]=p};for(let p=0,Se=arguments.length;p<Se;p++)arguments[p]&&ee(arguments[p],g);return u}const gn=(c,u,g,{allOwnKeys:p}={})=>(ee(u,(Se,D)=>{g&&T(Se)?c[D]=mt(Se,g):c[D]=Se},{allOwnKeys:p}),c),bn=c=>(c.charCodeAt(0)===65279&&(c=c.slice(1)),c),yn=(c,u,g,p)=>{c.prototype=Object.create(u.prototype,p),c.prototype.constructor=c,Object.defineProperty(c,"super",{value:u.prototype}),g&&Object.assign(c.prototype,g)},wn=(c,u,g,p)=>{let Se,D,_;const x={};if(u=u||{},c==null)return u;do{for(Se=Object.getOwnPropertyNames(c),D=Se.length;D-- >0;)_=Se[D],(!p||p(_,c,u))&&!x[_]&&(u[_]=c[_],x[_]=!0);c=g!==!1&&Fe(c)}while(c&&(!g||g(c,u))&&c!==Object.prototype);return u},_n=(c,u,g)=>{c=String(c),(g===void 0||g>c.length)&&(g=c.length),g-=u.length;const p=c.indexOf(u,g);return p!==-1&&p===g},En=c=>{if(!c)return null;if(K(c))return c;let u=c.length;if(!yt(u))return null;const g=new Array(u);for(;u-- >0;)g[u]=c[u];return g},Sn=(c=>u=>c&&u instanceof c)(typeof Uint8Array<"u"&&Fe(Uint8Array)),xn=(c,u)=>{const g=(c&&c[de]).call(c);let p;for(;(p=g.next())&&!p.done;){const Se=p.value;u.call(c,Se[0],Se[1])}},Rn=(c,u)=>{let g;const p=[];for(;(g=c.exec(u))!==null;)p.push(g);return p},An=$("HTMLFormElement"),On=c=>c.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(u,g,p){return g.toUpperCase()+p}),Je=(({hasOwnProperty:c})=>(u,g)=>c.call(u,g))(Object.prototype),Cn=$("RegExp"),Et=(c,u)=>{const g=Object.getOwnPropertyDescriptors(c),p={};ee(g,(Se,D)=>{let _;(_=u(Se,D,c))!==!1&&(p[D]=_||Se)}),Object.defineProperties(c,p)},Tn=c=>{Et(c,(u,g)=>{if(T(c)&&["arguments","caller","callee"].indexOf(g)!==-1)return!1;const p=c[g];if(T(p)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+g+"'")})}})},kn=(c,u)=>{const g={},p=Se=>{Se.forEach(D=>{g[D]=!0})};return K(c)?p(c):p(String(c).split(u)),g},Nn=()=>{},Pn=(c,u)=>c!=null&&Number.isFinite(c=+c)?c:u;function In(c){return!!(c&&T(c.append)&&c[gt]==="FormData"&&c[de])}const Ln=c=>{const u=new Array(10),g=(p,Se)=>{if(me(p)){if(u.indexOf(p)>=0)return;if(!("toJSON"in p)){u[Se]=p;const D=K(p)?[]:{};return ee(p,(_,x)=>{const a=g(_,Se+1);!Y(a)&&(D[x]=a)}),u[Se]=void 0,D}}return p};return g(c,0)},vn=$("AsyncFunction"),jn=c=>c&&(me(c)||T(c))&&T(c.then)&&T(c.catch),St=((c,u)=>c?setImmediate:u?((g,p)=>(H.addEventListener("message",({source:Se,data:D})=>{Se===H&&D===g&&p.length&&p.shift()()},!1),Se=>{p.push(Se),H.postMessage(g,"*")}))(`axios@${Math.random()}`,[]):g=>setTimeout(g))(typeof setImmediate=="function",T(H.postMessage)),$n=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||St,Fn=c=>c!=null&&T(c[de]),l={isArray:K,isArrayBuffer:bt,isBuffer:Yt,isFormData:ln,isArrayBufferView:en,isString:tn,isNumber:yt,isBoolean:nn,isObject:me,isPlainObject:ce,isReadableStream:hn,isRequest:dn,isResponse:fn,isHeaders:pn,isUndefined:Y,isDate:sn,isFile:rn,isBlob:on,isRegExp:Cn,isFunction:T,isStream:an,isURLSearchParams:un,isTypedArray:Sn,isFileList:cn,forEach:ee,merge:Te,extend:gn,trim:mn,stripBOM:bn,inherits:yn,toFlatObject:wn,kindOf:fe,kindOfTest:$,endsWith:_n,toArray:En,forEachEntry:xn,matchAll:Rn,isHTMLForm:An,hasOwnProperty:Je,hasOwnProp:Je,reduceDescriptors:Et,freezeMethods:Tn,toObjectSet:kn,toCamelCase:On,noop:Nn,toFiniteNumber:Pn,findKey:wt,global:H,isContextDefined:_t,isSpecCompliantForm:In,toJSONObject:Ln,isAsyncFn:vn,isThenable:jn,setImmediate:St,asap:$n,isIterable:Fn};function y(c,u,g,p,Se){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=c,this.name="AxiosError",u&&(this.code=u),g&&(this.config=g),p&&(this.request=p),Se&&(this.response=Se,this.status=Se.status?Se.status:null)}l.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=y.prototype,Rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(c=>{Rt[c]={value:c}}),Object.defineProperties(y,Rt),Object.defineProperty(xt,"isAxiosError",{value:!0}),y.from=(c,u,g,p,Se,D)=>{const _=Object.create(xt);return l.toFlatObject(c,_,function(x){return x!==Error.prototype},x=>x!=="isAxiosError"),y.call(_,c.message,u,g,p,Se),_.cause=c,_.name=c.name,D&&Object.assign(_,D),_};const Un=null;function ke(c){return l.isPlainObject(c)||l.isArray(c)}function At(c){return l.endsWith(c,"[]")?c.slice(0,-2):c}function We(c,u,g){return c?c.concat(u).map(function(p,Se){return p=At(p),!g&&Se?"["+p+"]":p}).join(g?".":""):u}function Dn(c){return l.isArray(c)&&!c.some(ke)}const qn=l.toFlatObject(l,{},null,function(c){return/^is[A-Z]/.test(c)});function ge(c,u,g){if(!l.isObject(c))throw new TypeError("target must be an object");u=u||new FormData,g=l.toFlatObject(g,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!l.isUndefined(e[t])});const p=g.metaTokens,Se=g.visitor||h,D=g.dots,_=g.indexes,x=(g.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(u);if(!l.isFunction(Se))throw new TypeError("visitor must be a function");function a(t){if(t===null)return"";if(l.isDate(t))return t.toISOString();if(!x&&l.isBlob(t))throw new y("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(t)||l.isTypedArray(t)?x&&typeof Blob=="function"?new Blob([t]):Buffer.from(t):t}function h(t,e,n){let s=t;if(t&&!n&&typeof t=="object"){if(l.endsWith(e,"{}"))e=p?e:e.slice(0,-2),t=JSON.stringify(t);else if(l.isArray(t)&&Dn(t)||(l.isFileList(t)||l.endsWith(e,"[]"))&&(s=l.toArray(t)))return e=At(e),s.forEach(function(f,m){!(l.isUndefined(f)||f===null)&&u.append(_===!0?We([e],m,D):_===null?e:e+"[]",a(f))}),!1}return ke(t)?!0:(u.append(We(n,e,D),a(t)),!1)}const i=[],r=Object.assign(qn,{defaultVisitor:h,convertValue:a,isVisitable:ke});function o(t,e){if(!l.isUndefined(t)){if(i.indexOf(t)!==-1)throw Error("Circular reference detected in "+e.join("."));i.push(t),l.forEach(t,function(n,s){(!(l.isUndefined(n)||n===null)&&Se.call(u,n,l.isString(s)?s.trim():s,e,r))===!0&&o(n,e?e.concat(s):[s])}),i.pop()}}if(!l.isObject(c))throw new TypeError("data must be an object");return o(c),u}function Ke(c){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(c).replace(/[!'()~]|%20|%00/g,function(g){return u[g]})}function Ue(c,u){this._pairs=[],c&&ge(c,this,u)}const Ot=Ue.prototype;Ot.append=function(c,u){this._pairs.push([c,u])},Ot.toString=function(c){const u=c?function(g){return c.call(this,g,Ke)}:Ke;return this._pairs.map(function(g){return u(g[0])+"="+u(g[1])},"").join("&")};function Bn(c){return encodeURIComponent(c).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ct(c,u,g){if(!u)return c;const p=g&&g.encode||Bn;l.isFunction(g)&&(g={serialize:g});const Se=g&&g.serialize;let D;if(Se?D=Se(u,g):D=l.isURLSearchParams(u)?u.toString():new Ue(u,g).toString(p),D){const _=c.indexOf("#");_!==-1&&(c=c.slice(0,_)),c+=(c.indexOf("?")===-1?"?":"&")+D}return c}class Xe{constructor(){this.handlers=[]}use(u,g,p){return this.handlers.push({fulfilled:u,rejected:g,synchronous:p?p.synchronous:!1,runWhen:p?p.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){l.forEach(this.handlers,function(g){g!==null&&u(g)})}}const Tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mn=typeof URLSearchParams<"u"?URLSearchParams:Ue,Hn=typeof FormData<"u"?FormData:null,zn=typeof Blob<"u"?Blob:null,Vn={isBrowser:!0,classes:{URLSearchParams:Mn,FormData:Hn,Blob:zn},protocols:["http","https","file","blob","url","data"]},De=typeof window<"u"&&typeof document<"u",Ne=typeof navigator=="object"&&navigator||void 0,Jn=De&&(!Ne||["ReactNative","NativeScript","NS"].indexOf(Ne.product)<0),Wn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Kn=De&&window.location.href||"http://localhost",Xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:De,hasStandardBrowserEnv:Jn,hasStandardBrowserWebWorkerEnv:Wn,navigator:Ne,origin:Kn},Symbol.toStringTag,{value:"Module"})),O={...Xn,...Vn};function Gn(c,u){return ge(c,new O.classes.URLSearchParams,Object.assign({visitor:function(g,p,Se,D){return O.isNode&&l.isBuffer(g)?(this.append(p,g.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)}},u))}function Zn(c){return l.matchAll(/\w+|\[(\w*)]/g,c).map(u=>u[0]==="[]"?"":u[1]||u[0])}function Qn(c){const u={},g=Object.keys(c);let p;const Se=g.length;let D;for(p=0;p<Se;p++)D=g[p],u[D]=c[D];return u}function kt(c){function u(g,p,Se,D){let _=g[D++];if(_==="__proto__")return!0;const x=Number.isFinite(+_),a=D>=g.length;return _=!_&&l.isArray(Se)?Se.length:_,a?(l.hasOwnProp(Se,_)?Se[_]=[Se[_],p]:Se[_]=p,!x):((!Se[_]||!l.isObject(Se[_]))&&(Se[_]=[]),u(g,p,Se[_],D)&&l.isArray(Se[_])&&(Se[_]=Qn(Se[_])),!x)}if(l.isFormData(c)&&l.isFunction(c.entries)){const g={};return l.forEachEntry(c,(p,Se)=>{u(Zn(p),Se,g,0)}),g}return null}function Yn(c,u,g){if(l.isString(c))try{return(u||JSON.parse)(c),l.trim(c)}catch(p){if(p.name!=="SyntaxError")throw p}return(g||JSON.stringify)(c)}const te={transitional:Tt,adapter:["xhr","http","fetch"],transformRequest:[function(c,u){const g=u.getContentType()||"",p=g.indexOf("application/json")>-1,Se=l.isObject(c);if(Se&&l.isHTMLForm(c)&&(c=new FormData(c)),l.isFormData(c))return p?JSON.stringify(kt(c)):c;if(l.isArrayBuffer(c)||l.isBuffer(c)||l.isStream(c)||l.isFile(c)||l.isBlob(c)||l.isReadableStream(c))return c;if(l.isArrayBufferView(c))return c.buffer;if(l.isURLSearchParams(c))return u.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),c.toString();let D;if(Se){if(g.indexOf("application/x-www-form-urlencoded")>-1)return Gn(c,this.formSerializer).toString();if((D=l.isFileList(c))||g.indexOf("multipart/form-data")>-1){const _=this.env&&this.env.FormData;return ge(D?{"files[]":c}:c,_&&new _,this.formSerializer)}}return Se||p?(u.setContentType("application/json",!1),Yn(c)):c}],transformResponse:[function(c){const u=this.transitional||te.transitional,g=u&&u.forcedJSONParsing,p=this.responseType==="json";if(l.isResponse(c)||l.isReadableStream(c))return c;if(c&&l.isString(c)&&(g&&!this.responseType||p)){const Se=!(u&&u.silentJSONParsing)&&p;try{return JSON.parse(c)}catch(D){if(Se)throw D.name==="SyntaxError"?y.from(D,y.ERR_BAD_RESPONSE,this,null,this.response):D}}return c}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(c){return c>=200&&c<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],c=>{te.headers[c]={}});const es=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ts=c=>{const u={};let g,p,Se;return c&&c.split(`
|
1117
|
-
`).forEach(function(D){Se=D.indexOf(":"),
|
1118
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(c){return c instanceof this?c:new this(c)}static concat(c,...u){const g=new this(c);return u.forEach(p=>g.set(p)),g}static accessor(c){const u=(this[Ge]=this[Ge]={accessors:{}}).accessors,g=this.prototype;function p(Se){const D=Z(Se);u[D]||(is(g,Se),u[D]=!0)}return l.isArray(c)?c.forEach(p):p(c),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors(k.prototype,({value:c},u)=>{let g=u[0].toUpperCase()+u.slice(1);return{get:()=>c,set(p){this[g]=p}}}),l.freezeMethods(k);function Ae(c,u){const g=this||te,p=u||g,Se=k.from(p.headers);let D=p.data;return l.forEach(c,function(_){D=_.call(g,D,Se.normalize(),u?u.status:void 0)}),Se.normalize(),D}function Nt(c){return!!(c&&c.__CANCEL__)}function X(c,u,g){y.call(this,c??"canceled",y.ERR_CANCELED,u,g),this.name="CanceledError"}l.inherits(X,y,{__CANCEL__:!0});function Pt(c,u,g){const p=g.config.validateStatus;!g.status||!p||p(g.status)?c(g):u(new y("Request failed with status code "+g.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(g.status/100)-4],g.config,g.request,g))}function os(c){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(c);return u&&u[1]||""}function cs(c,u){c=c||10;const g=new Array(c),p=new Array(c);let Se=0,D=0,_;return u=u!==void 0?u:1e3,function(x){const a=Date.now(),h=p[D];_||(_=a),g[Se]=x,p[Se]=a;let i=D,r=0;for(;i!==Se;)r+=g[i++],i=i%c;if(Se=(Se+1)%c,Se===D&&(D=(D+1)%c),a-_<u)return;const o=h&&a-h;return o?Math.round(r*1e3/o):void 0}}function as(c,u){let g=0,p=1e3/u,Se,D;const _=(x,a=Date.now())=>{g=a,Se=null,D&&(clearTimeout(D),D=null),c.apply(null,x)};return[(...x)=>{const a=Date.now(),h=a-g;h>=p?_(x,a):(Se=x,D||(D=setTimeout(()=>{D=null,_(Se)},p-h)))},()=>Se&&_(Se)]}const ue=(c,u,g=3)=>{let p=0;const Se=cs(50,250);return as(D=>{const _=D.loaded,x=D.lengthComputable?D.total:void 0,a=_-p,h=Se(a),i=_<=x;p=_;const r={loaded:_,total:x,progress:x?_/x:void 0,bytes:a,rate:h||void 0,estimated:h&&x&&i?(x-_)/h:void 0,event:D,lengthComputable:x!=null,[u?"download":"upload"]:!0};c(r)},g)},Ze=(c,u)=>{const g=c!=null;return[p=>u[0]({lengthComputable:g,total:c,loaded:p}),u[1]]},Qe=c=>(...u)=>l.asap(()=>c(...u)),ls=O.hasStandardBrowserEnv?((c,u)=>g=>(g=new URL(g,O.origin),c.protocol===g.protocol&&c.host===g.host&&(u||c.port===g.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,us=O.hasStandardBrowserEnv?{write(c,u,g,p,Se,D){const _=[c+"="+encodeURIComponent(u)];l.isNumber(g)&&_.push("expires="+new Date(g).toGMTString()),l.isString(p)&&_.push("path="+p),l.isString(Se)&&_.push("domain="+Se),D===!0&&_.push("secure"),document.cookie=_.join("; ")},read(c){const u=document.cookie.match(new RegExp("(^|;\\s*)("+c+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove(c){this.write(c,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hs(c){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(c)}function ds(c,u){return u?c.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):c}function It(c,u,g){let p=!hs(u);return c&&(p||g==!1)?ds(c,u):u}const Ye=c=>c instanceof k?{...c}:c;function V(c,u){u=u||{};const g={};function p(h,i,r,o){return l.isPlainObject(h)&&l.isPlainObject(i)?l.merge.call({caseless:o},h,i):l.isPlainObject(i)?l.merge({},i):l.isArray(i)?i.slice():i}function Se(h,i,r,o){if(l.isUndefined(i)){if(!l.isUndefined(h))return p(void 0,h,r,o)}else return p(h,i,r,o)}function D(h,i){if(!l.isUndefined(i))return p(void 0,i)}function _(h,i){if(l.isUndefined(i)){if(!l.isUndefined(h))return p(void 0,h)}else return p(void 0,i)}function x(h,i,r){if(r in u)return p(h,i);if(r in c)return p(void 0,h)}const a={url:D,method:D,data:D,baseURL:_,transformRequest:_,transformResponse:_,paramsSerializer:_,timeout:_,timeoutMessage:_,withCredentials:_,withXSRFToken:_,adapter:_,responseType:_,xsrfCookieName:_,xsrfHeaderName:_,onUploadProgress:_,onDownloadProgress:_,decompress:_,maxContentLength:_,maxBodyLength:_,beforeRedirect:_,transport:_,httpAgent:_,httpsAgent:_,cancelToken:_,socketPath:_,responseEncoding:_,validateStatus:x,headers:(h,i,r)=>Se(Ye(h),Ye(i),r,!0)};return l.forEach(Object.keys(Object.assign({},c,u)),function(h){const i=a[h]||Se,r=i(c[h],u[h],h);l.isUndefined(r)&&i!==x||(g[h]=r)}),g}const Lt=c=>{const u=V({},c);let{data:g,withXSRFToken:p,xsrfHeaderName:Se,xsrfCookieName:D,headers:_,auth:x}=u;u.headers=_=k.from(_),u.url=Ct(It(u.baseURL,u.url,u.allowAbsoluteUrls),c.params,c.paramsSerializer),x&&_.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):"")));let a;if(l.isFormData(g)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)_.setContentType(void 0);else if((a=_.getContentType())!==!1){const[h,...i]=a?a.split(";").map(r=>r.trim()).filter(Boolean):[];_.setContentType([h||"multipart/form-data",...i].join("; "))}}if(O.hasStandardBrowserEnv&&(p&&l.isFunction(p)&&(p=p(u)),p||p!==!1&&ls(u.url))){const h=Se&&D&&us.read(D);h&&_.set(Se,h)}return u},fs=typeof XMLHttpRequest<"u",ps=fs&&function(c){return new Promise(function(u,g){const p=Lt(c);let Se=p.data;const D=k.from(p.headers).normalize();let{responseType:_,onUploadProgress:x,onDownloadProgress:a}=p,h,i,r,o,t;function e(){o&&o(),t&&t(),p.cancelToken&&p.cancelToken.unsubscribe(h),p.signal&&p.signal.removeEventListener("abort",h)}let n=new XMLHttpRequest;n.open(p.method.toUpperCase(),p.url,!0),n.timeout=p.timeout;function s(){if(!n)return;const m=k.from("getAllResponseHeaders"in n&&n.getAllResponseHeaders()),A={data:!_||_==="text"||_==="json"?n.responseText:n.response,status:n.status,statusText:n.statusText,headers:m,config:c,request:n};Pt(function(E){u(E),e()},function(E){g(E),e()},A),n=null}"onloadend"in n?n.onloadend=s:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(s)},n.onabort=function(){n&&(g(new y("Request aborted",y.ECONNABORTED,c,n)),n=null)},n.onerror=function(){g(new y("Network Error",y.ERR_NETWORK,c,n)),n=null},n.ontimeout=function(){let m=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const A=p.transitional||Tt;p.timeoutErrorMessage&&(m=p.timeoutErrorMessage),g(new y(m,A.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,c,n)),n=null},Se===void 0&&D.setContentType(null),"setRequestHeader"in n&&l.forEach(D.toJSON(),function(m,A){n.setRequestHeader(A,m)}),l.isUndefined(p.withCredentials)||(n.withCredentials=!!p.withCredentials),_&&_!=="json"&&(n.responseType=p.responseType),a&&([r,t]=ue(a,!0),n.addEventListener("progress",r)),x&&n.upload&&([i,o]=ue(x),n.upload.addEventListener("progress",i),n.upload.addEventListener("loadend",o)),(p.cancelToken||p.signal)&&(h=m=>{n&&(g(!m||m.type?new X(null,c,n):m),n.abort(),n=null)},p.cancelToken&&p.cancelToken.subscribe(h),p.signal&&(p.signal.aborted?h():p.signal.addEventListener("abort",h)));const f=os(p.url);if(f&&O.protocols.indexOf(f)===-1){g(new y("Unsupported protocol "+f+":",y.ERR_BAD_REQUEST,c));return}n.send(Se||null)})},ms=(c,u)=>{const{length:g}=c=c?c.filter(Boolean):[];if(u||g){let p=new AbortController,Se;const D=function(h){if(!Se){Se=!0,x();const i=h instanceof Error?h:this.reason;p.abort(i instanceof y?i:new X(i instanceof Error?i.message:i))}};let _=u&&setTimeout(()=>{_=null,D(new y(`timeout ${u} of ms exceeded`,y.ETIMEDOUT))},u);const x=()=>{c&&(_&&clearTimeout(_),_=null,c.forEach(h=>{h.unsubscribe?h.unsubscribe(D):h.removeEventListener("abort",D)}),c=null)};c.forEach(h=>h.addEventListener("abort",D));const{signal:a}=p;return a.unsubscribe=()=>l.asap(x),a}},gs=function*(c,u){let g=c.byteLength;if(g<u){yield c;return}let p=0,Se;for(;p<g;)Se=p+u,yield c.slice(p,Se),p=Se},bs=async function*(c,u){for await(const g of ys(c))yield*gs(g,u)},ys=async function*(c){if(c[Symbol.asyncIterator]){yield*c;return}const u=c.getReader();try{for(;;){const{done:g,value:p}=await u.read();if(g)break;yield p}}finally{await u.cancel()}},et=(c,u,g,p)=>{const Se=bs(c,u);let D=0,_,x=a=>{_||(_=!0,p&&p(a))};return new ReadableStream({async pull(a){try{const{done:h,value:i}=await Se.next();if(h){x(),a.close();return}let r=i.byteLength;if(g){let o=D+=r;g(o)}a.enqueue(new Uint8Array(i))}catch(h){throw x(h),h}},cancel(a){return x(a),Se.return()}},{highWaterMark:2})},be=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vt=be&&typeof ReadableStream=="function",ws=be&&(typeof TextEncoder=="function"?(c=>u=>c.encode(u))(new TextEncoder):async c=>new Uint8Array(await new Response(c).arrayBuffer())),jt=(c,...u)=>{try{return!!c(...u)}catch{return!1}},_s=vt&&jt(()=>{let c=!1;const u=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return c=!0,"half"}}).headers.has("Content-Type");return c&&!u}),tt=64*1024,Pe=vt&&jt(()=>l.isReadableStream(new Response("").body)),he={stream:Pe&&(c=>c.body)};be&&(c=>{["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!he[u]&&(he[u]=l.isFunction(c[u])?g=>g[u]():(g,p)=>{throw new y(`Response type '${u}' is not supported`,y.ERR_NOT_SUPPORT,p)})})})(new Response);const Es=async c=>{if(c==null)return 0;if(l.isBlob(c))return c.size;if(l.isSpecCompliantForm(c))return(await new Request(O.origin,{method:"POST",body:c}).arrayBuffer()).byteLength;if(l.isArrayBufferView(c)||l.isArrayBuffer(c))return c.byteLength;if(l.isURLSearchParams(c)&&(c=c+""),l.isString(c))return(await ws(c)).byteLength},Ss=async(c,u)=>l.toFiniteNumber(c.getContentLength())??Es(u),xs=be&&(async c=>{let{url:u,method:g,data:p,signal:Se,cancelToken:D,timeout:_,onDownloadProgress:x,onUploadProgress:a,responseType:h,headers:i,withCredentials:r="same-origin",fetchOptions:o}=Lt(c);h=h?(h+"").toLowerCase():"text";let t=ms([Se,D&&D.toAbortSignal()],_),e;const n=t&&t.unsubscribe&&(()=>{t.unsubscribe()});let s;try{if(a&&_s&&g!=="get"&&g!=="head"&&(s=await Ss(i,p))!==0){let S=new Request(u,{method:"POST",body:p,duplex:"half"}),C;if(l.isFormData(p)&&(C=S.headers.get("content-type"))&&i.setContentType(C),S.body){const[q,Be]=Ze(s,ue(Qe(a)));p=et(S.body,tt,q,Be)}}l.isString(r)||(r=r?"include":"omit");const f="credentials"in Request.prototype;e=new Request(u,{...o,signal:t,method:g.toUpperCase(),headers:i.normalize().toJSON(),body:p,duplex:"half",credentials:f?r:void 0});let m=await fetch(e);const A=Pe&&(h==="stream"||h==="response");if(Pe&&(x||A&&n)){const S={};["status","statusText","headers"].forEach(se=>{S[se]=m[se]});const C=l.toFiniteNumber(m.headers.get("content-length")),[q,Be]=x&&Ze(C,ue(Qe(x),!0))||[];m=new Response(et(m.body,tt,q,()=>{Be&&Be(),n&&n()}),S)}h=h||"text";let E=await he[l.findKey(he,h)||"text"](m,c);return!A&&n&&n(),await new Promise((S,C)=>{Pt(S,C,{data:E,headers:k.from(m.headers),status:m.status,statusText:m.statusText,config:c,request:e})})}catch(f){throw n&&n(),f&&f.name==="TypeError"&&/Load failed|fetch/i.test(f.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,c,e),{cause:f.cause||f}):y.from(f,f&&f.code,c,e)}}),Ie={http:Un,xhr:ps,fetch:xs};l.forEach(Ie,(c,u)=>{if(c){try{Object.defineProperty(c,"name",{value:u})}catch{}Object.defineProperty(c,"adapterName",{value:u})}});const nt=c=>`- ${c}`,Rs=c=>l.isFunction(c)||c===null||c===!1,$t={getAdapter:c=>{c=l.isArray(c)?c:[c];const{length:u}=c;let g,p;const Se={};for(let D=0;D<u;D++){g=c[D];let _;if(p=g,!Rs(g)&&(p=Ie[(_=String(g)).toLowerCase()],p===void 0))throw new y(`Unknown adapter '${_}'`);if(p)break;Se[_||"#"+D]=p}if(!p){const D=Object.entries(Se).map(([x,a])=>`adapter ${x} `+(a===!1?"is not supported by the environment":"is not available in the build"));let _=u?D.length>1?`since :
|
1116
|
+
`}),ace.define("ace/theme/twilight",["require","exports","module","ace/theme/twilight-css","ace/lib/dom"],function(f,p,Se){p.isDark=!0,p.cssClass="ace-twilight",p.cssText=f("./twilight-css");var D=f("../lib/dom");D.importCssString(p.cssText,p.cssClass,!1)}),function(){ace.require(["ace/theme/twilight"],function(f){c&&(c.exports=f)})}()}(themeTwilight)),themeTwilight.exports}requireThemeTwilight();var Gt=Object.defineProperty,Zt=(c,u,f)=>u in c?Gt(c,u,{enumerable:!0,configurable:!0,writable:!0,value:f}):c[u]=f,v=(c,u,f)=>Zt(c,typeof u!="symbol"?u+"":u,f);function mt(c,u){return function(){return c.apply(u,arguments)}}const{toString:Qt}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:de,toStringTag:gt}=Symbol,fe=(c=>u=>{const f=Qt.call(u);return c[f]||(c[f]=f.slice(8,-1).toLowerCase())})(Object.create(null)),$=c=>(c=c.toLowerCase(),u=>fe(u)===c),pe=c=>u=>typeof u===c,{isArray:K}=Array,Y=pe("undefined");function Yt(c){return c!==null&&!Y(c)&&c.constructor!==null&&!Y(c.constructor)&&T(c.constructor.isBuffer)&&c.constructor.isBuffer(c)}const bt=$("ArrayBuffer");function en(c){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(c):u=c&&c.buffer&&bt(c.buffer),u}const tn=pe("string"),T=pe("function"),yt=pe("number"),me=c=>c!==null&&typeof c=="object",nn=c=>c===!0||c===!1,ce=c=>{if(fe(c)!=="object")return!1;const u=Fe(c);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(gt in c)&&!(de in c)},sn=$("Date"),rn=$("File"),on=$("Blob"),cn=$("FileList"),an=c=>me(c)&&T(c.pipe),ln=c=>{let u;return c&&(typeof FormData=="function"&&c instanceof FormData||T(c.append)&&((u=fe(c))==="formdata"||u==="object"&&T(c.toString)&&c.toString()==="[object FormData]"))},un=$("URLSearchParams"),[hn,dn,fn,pn]=["ReadableStream","Request","Response","Headers"].map($),mn=c=>c.trim?c.trim():c.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(c,u,{allOwnKeys:f=!1}={}){if(c===null||typeof c>"u")return;let p,Se;if(typeof c!="object"&&(c=[c]),K(c))for(p=0,Se=c.length;p<Se;p++)u.call(null,c[p],p,c);else{const D=f?Object.getOwnPropertyNames(c):Object.keys(c),_=D.length;let x;for(p=0;p<_;p++)x=D[p],u.call(null,c[x],x,c)}}function wt(c,u){u=u.toLowerCase();const f=Object.keys(c);let p=f.length,Se;for(;p-- >0;)if(Se=f[p],u===Se.toLowerCase())return Se;return null}const H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_t=c=>!Y(c)&&c!==H;function Te(){const{caseless:c}=_t(this)&&this||{},u={},f=(p,Se)=>{const D=c&&wt(u,Se)||Se;ce(u[D])&&ce(p)?u[D]=Te(u[D],p):ce(p)?u[D]=Te({},p):K(p)?u[D]=p.slice():u[D]=p};for(let p=0,Se=arguments.length;p<Se;p++)arguments[p]&&ee(arguments[p],f);return u}const gn=(c,u,f,{allOwnKeys:p}={})=>(ee(u,(Se,D)=>{f&&T(Se)?c[D]=mt(Se,f):c[D]=Se},{allOwnKeys:p}),c),bn=c=>(c.charCodeAt(0)===65279&&(c=c.slice(1)),c),yn=(c,u,f,p)=>{c.prototype=Object.create(u.prototype,p),c.prototype.constructor=c,Object.defineProperty(c,"super",{value:u.prototype}),f&&Object.assign(c.prototype,f)},wn=(c,u,f,p)=>{let Se,D,_;const x={};if(u=u||{},c==null)return u;do{for(Se=Object.getOwnPropertyNames(c),D=Se.length;D-- >0;)_=Se[D],(!p||p(_,c,u))&&!x[_]&&(u[_]=c[_],x[_]=!0);c=f!==!1&&Fe(c)}while(c&&(!f||f(c,u))&&c!==Object.prototype);return u},_n=(c,u,f)=>{c=String(c),(f===void 0||f>c.length)&&(f=c.length),f-=u.length;const p=c.indexOf(u,f);return p!==-1&&p===f},En=c=>{if(!c)return null;if(K(c))return c;let u=c.length;if(!yt(u))return null;const f=new Array(u);for(;u-- >0;)f[u]=c[u];return f},Sn=(c=>u=>c&&u instanceof c)(typeof Uint8Array<"u"&&Fe(Uint8Array)),xn=(c,u)=>{const f=(c&&c[de]).call(c);let p;for(;(p=f.next())&&!p.done;){const Se=p.value;u.call(c,Se[0],Se[1])}},Rn=(c,u)=>{let f;const p=[];for(;(f=c.exec(u))!==null;)p.push(f);return p},An=$("HTMLFormElement"),On=c=>c.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(u,f,p){return f.toUpperCase()+p}),Je=(({hasOwnProperty:c})=>(u,f)=>c.call(u,f))(Object.prototype),Cn=$("RegExp"),Et=(c,u)=>{const f=Object.getOwnPropertyDescriptors(c),p={};ee(f,(Se,D)=>{let _;(_=u(Se,D,c))!==!1&&(p[D]=_||Se)}),Object.defineProperties(c,p)},Tn=c=>{Et(c,(u,f)=>{if(T(c)&&["arguments","caller","callee"].indexOf(f)!==-1)return!1;const p=c[f];if(T(p)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+f+"'")})}})},kn=(c,u)=>{const f={},p=Se=>{Se.forEach(D=>{f[D]=!0})};return K(c)?p(c):p(String(c).split(u)),f},Nn=()=>{},Pn=(c,u)=>c!=null&&Number.isFinite(c=+c)?c:u;function In(c){return!!(c&&T(c.append)&&c[gt]==="FormData"&&c[de])}const Ln=c=>{const u=new Array(10),f=(p,Se)=>{if(me(p)){if(u.indexOf(p)>=0)return;if(!("toJSON"in p)){u[Se]=p;const D=K(p)?[]:{};return ee(p,(_,x)=>{const a=f(_,Se+1);!Y(a)&&(D[x]=a)}),u[Se]=void 0,D}}return p};return f(c,0)},vn=$("AsyncFunction"),jn=c=>c&&(me(c)||T(c))&&T(c.then)&&T(c.catch),St=((c,u)=>c?setImmediate:u?((f,p)=>(H.addEventListener("message",({source:Se,data:D})=>{Se===H&&D===f&&p.length&&p.shift()()},!1),Se=>{p.push(Se),H.postMessage(f,"*")}))(`axios@${Math.random()}`,[]):f=>setTimeout(f))(typeof setImmediate=="function",T(H.postMessage)),$n=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||St,Fn=c=>c!=null&&T(c[de]),l={isArray:K,isArrayBuffer:bt,isBuffer:Yt,isFormData:ln,isArrayBufferView:en,isString:tn,isNumber:yt,isBoolean:nn,isObject:me,isPlainObject:ce,isReadableStream:hn,isRequest:dn,isResponse:fn,isHeaders:pn,isUndefined:Y,isDate:sn,isFile:rn,isBlob:on,isRegExp:Cn,isFunction:T,isStream:an,isURLSearchParams:un,isTypedArray:Sn,isFileList:cn,forEach:ee,merge:Te,extend:gn,trim:mn,stripBOM:bn,inherits:yn,toFlatObject:wn,kindOf:fe,kindOfTest:$,endsWith:_n,toArray:En,forEachEntry:xn,matchAll:Rn,isHTMLForm:An,hasOwnProperty:Je,hasOwnProp:Je,reduceDescriptors:Et,freezeMethods:Tn,toObjectSet:kn,toCamelCase:On,noop:Nn,toFiniteNumber:Pn,findKey:wt,global:H,isContextDefined:_t,isSpecCompliantForm:In,toJSONObject:Ln,isAsyncFn:vn,isThenable:jn,setImmediate:St,asap:$n,isIterable:Fn};function y(c,u,f,p,Se){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=c,this.name="AxiosError",u&&(this.code=u),f&&(this.config=f),p&&(this.request=p),Se&&(this.response=Se,this.status=Se.status?Se.status:null)}l.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=y.prototype,Rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(c=>{Rt[c]={value:c}}),Object.defineProperties(y,Rt),Object.defineProperty(xt,"isAxiosError",{value:!0}),y.from=(c,u,f,p,Se,D)=>{const _=Object.create(xt);return l.toFlatObject(c,_,function(x){return x!==Error.prototype},x=>x!=="isAxiosError"),y.call(_,c.message,u,f,p,Se),_.cause=c,_.name=c.name,D&&Object.assign(_,D),_};const Un=null;function ke(c){return l.isPlainObject(c)||l.isArray(c)}function At(c){return l.endsWith(c,"[]")?c.slice(0,-2):c}function We(c,u,f){return c?c.concat(u).map(function(p,Se){return p=At(p),!f&&Se?"["+p+"]":p}).join(f?".":""):u}function Dn(c){return l.isArray(c)&&!c.some(ke)}const qn=l.toFlatObject(l,{},null,function(c){return/^is[A-Z]/.test(c)});function ge(c,u,f){if(!l.isObject(c))throw new TypeError("target must be an object");u=u||new FormData,f=l.toFlatObject(f,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!l.isUndefined(e[t])});const p=f.metaTokens,Se=f.visitor||h,D=f.dots,_=f.indexes,x=(f.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(u);if(!l.isFunction(Se))throw new TypeError("visitor must be a function");function a(t){if(t===null)return"";if(l.isDate(t))return t.toISOString();if(!x&&l.isBlob(t))throw new y("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(t)||l.isTypedArray(t)?x&&typeof Blob=="function"?new Blob([t]):Buffer.from(t):t}function h(t,e,n){let s=t;if(t&&!n&&typeof t=="object"){if(l.endsWith(e,"{}"))e=p?e:e.slice(0,-2),t=JSON.stringify(t);else if(l.isArray(t)&&Dn(t)||(l.isFileList(t)||l.endsWith(e,"[]"))&&(s=l.toArray(t)))return e=At(e),s.forEach(function(g,m){!(l.isUndefined(g)||g===null)&&u.append(_===!0?We([e],m,D):_===null?e:e+"[]",a(g))}),!1}return ke(t)?!0:(u.append(We(n,e,D),a(t)),!1)}const i=[],r=Object.assign(qn,{defaultVisitor:h,convertValue:a,isVisitable:ke});function o(t,e){if(!l.isUndefined(t)){if(i.indexOf(t)!==-1)throw Error("Circular reference detected in "+e.join("."));i.push(t),l.forEach(t,function(n,s){(!(l.isUndefined(n)||n===null)&&Se.call(u,n,l.isString(s)?s.trim():s,e,r))===!0&&o(n,e?e.concat(s):[s])}),i.pop()}}if(!l.isObject(c))throw new TypeError("data must be an object");return o(c),u}function Ke(c){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(c).replace(/[!'()~]|%20|%00/g,function(f){return u[f]})}function Ue(c,u){this._pairs=[],c&&ge(c,this,u)}const Ot=Ue.prototype;Ot.append=function(c,u){this._pairs.push([c,u])},Ot.toString=function(c){const u=c?function(f){return c.call(this,f,Ke)}:Ke;return this._pairs.map(function(f){return u(f[0])+"="+u(f[1])},"").join("&")};function Bn(c){return encodeURIComponent(c).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ct(c,u,f){if(!u)return c;const p=f&&f.encode||Bn;l.isFunction(f)&&(f={serialize:f});const Se=f&&f.serialize;let D;if(Se?D=Se(u,f):D=l.isURLSearchParams(u)?u.toString():new Ue(u,f).toString(p),D){const _=c.indexOf("#");_!==-1&&(c=c.slice(0,_)),c+=(c.indexOf("?")===-1?"?":"&")+D}return c}class Xe{constructor(){this.handlers=[]}use(u,f,p){return this.handlers.push({fulfilled:u,rejected:f,synchronous:p?p.synchronous:!1,runWhen:p?p.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){l.forEach(this.handlers,function(f){f!==null&&u(f)})}}const Tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mn=typeof URLSearchParams<"u"?URLSearchParams:Ue,Hn=typeof FormData<"u"?FormData:null,zn=typeof Blob<"u"?Blob:null,Vn={isBrowser:!0,classes:{URLSearchParams:Mn,FormData:Hn,Blob:zn},protocols:["http","https","file","blob","url","data"]},De=typeof window<"u"&&typeof document<"u",Ne=typeof navigator=="object"&&navigator||void 0,Jn=De&&(!Ne||["ReactNative","NativeScript","NS"].indexOf(Ne.product)<0),Wn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Kn=De&&window.location.href||"http://localhost",Xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:De,hasStandardBrowserEnv:Jn,hasStandardBrowserWebWorkerEnv:Wn,navigator:Ne,origin:Kn},Symbol.toStringTag,{value:"Module"})),O={...Xn,...Vn};function Gn(c,u){return ge(c,new O.classes.URLSearchParams,Object.assign({visitor:function(f,p,Se,D){return O.isNode&&l.isBuffer(f)?(this.append(p,f.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)}},u))}function Zn(c){return l.matchAll(/\w+|\[(\w*)]/g,c).map(u=>u[0]==="[]"?"":u[1]||u[0])}function Qn(c){const u={},f=Object.keys(c);let p;const Se=f.length;let D;for(p=0;p<Se;p++)D=f[p],u[D]=c[D];return u}function kt(c){function u(f,p,Se,D){let _=f[D++];if(_==="__proto__")return!0;const x=Number.isFinite(+_),a=D>=f.length;return _=!_&&l.isArray(Se)?Se.length:_,a?(l.hasOwnProp(Se,_)?Se[_]=[Se[_],p]:Se[_]=p,!x):((!Se[_]||!l.isObject(Se[_]))&&(Se[_]=[]),u(f,p,Se[_],D)&&l.isArray(Se[_])&&(Se[_]=Qn(Se[_])),!x)}if(l.isFormData(c)&&l.isFunction(c.entries)){const f={};return l.forEachEntry(c,(p,Se)=>{u(Zn(p),Se,f,0)}),f}return null}function Yn(c,u,f){if(l.isString(c))try{return(u||JSON.parse)(c),l.trim(c)}catch(p){if(p.name!=="SyntaxError")throw p}return(f||JSON.stringify)(c)}const te={transitional:Tt,adapter:["xhr","http","fetch"],transformRequest:[function(c,u){const f=u.getContentType()||"",p=f.indexOf("application/json")>-1,Se=l.isObject(c);if(Se&&l.isHTMLForm(c)&&(c=new FormData(c)),l.isFormData(c))return p?JSON.stringify(kt(c)):c;if(l.isArrayBuffer(c)||l.isBuffer(c)||l.isStream(c)||l.isFile(c)||l.isBlob(c)||l.isReadableStream(c))return c;if(l.isArrayBufferView(c))return c.buffer;if(l.isURLSearchParams(c))return u.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),c.toString();let D;if(Se){if(f.indexOf("application/x-www-form-urlencoded")>-1)return Gn(c,this.formSerializer).toString();if((D=l.isFileList(c))||f.indexOf("multipart/form-data")>-1){const _=this.env&&this.env.FormData;return ge(D?{"files[]":c}:c,_&&new _,this.formSerializer)}}return Se||p?(u.setContentType("application/json",!1),Yn(c)):c}],transformResponse:[function(c){const u=this.transitional||te.transitional,f=u&&u.forcedJSONParsing,p=this.responseType==="json";if(l.isResponse(c)||l.isReadableStream(c))return c;if(c&&l.isString(c)&&(f&&!this.responseType||p)){const Se=!(u&&u.silentJSONParsing)&&p;try{return JSON.parse(c)}catch(D){if(Se)throw D.name==="SyntaxError"?y.from(D,y.ERR_BAD_RESPONSE,this,null,this.response):D}}return c}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(c){return c>=200&&c<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],c=>{te.headers[c]={}});const es=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ts=c=>{const u={};let f,p,Se;return c&&c.split(`
|
1117
|
+
`).forEach(function(D){Se=D.indexOf(":"),f=D.substring(0,Se).trim().toLowerCase(),p=D.substring(Se+1).trim(),!(!f||u[f]&&es[f])&&(f==="set-cookie"?u[f]?u[f].push(p):u[f]=[p]:u[f]=u[f]?u[f]+", "+p:p)}),u},Ge=Symbol("internals");function Z(c){return c&&String(c).trim().toLowerCase()}function ae(c){return c===!1||c==null?c:l.isArray(c)?c.map(ae):String(c)}function ns(c){const u=Object.create(null),f=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let p;for(;p=f.exec(c);)u[p[1]]=p[2];return u}const ss=c=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(c.trim());function Re(c,u,f,p,Se){if(l.isFunction(p))return p.call(this,u,f);if(Se&&(u=f),!!l.isString(u)){if(l.isString(p))return u.indexOf(p)!==-1;if(l.isRegExp(p))return p.test(u)}}function rs(c){return c.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(u,f,p)=>f.toUpperCase()+p)}function is(c,u){const f=l.toCamelCase(" "+u);["get","set","has"].forEach(p=>{Object.defineProperty(c,p+f,{value:function(Se,D,_){return this[p].call(this,u,Se,D,_)},configurable:!0})})}let k=class{constructor(c){c&&this.set(c)}set(c,u,f){const p=this;function Se(_,x,a){const h=Z(x);if(!h)throw new Error("header name must be a non-empty string");const i=l.findKey(p,h);(!i||p[i]===void 0||a===!0||a===void 0&&p[i]!==!1)&&(p[i||x]=ae(_))}const D=(_,x)=>l.forEach(_,(a,h)=>Se(a,h,x));if(l.isPlainObject(c)||c instanceof this.constructor)D(c,u);else if(l.isString(c)&&(c=c.trim())&&!ss(c))D(ts(c),u);else if(l.isObject(c)&&l.isIterable(c)){let _={},x,a;for(const h of c){if(!l.isArray(h))throw TypeError("Object iterator must return a key-value pair");_[a=h[0]]=(x=_[a])?l.isArray(x)?[...x,h[1]]:[x,h[1]]:h[1]}D(_,u)}else c!=null&&Se(u,c,f);return this}get(c,u){if(c=Z(c),c){const f=l.findKey(this,c);if(f){const p=this[f];if(!u)return p;if(u===!0)return ns(p);if(l.isFunction(u))return u.call(this,p,f);if(l.isRegExp(u))return u.exec(p);throw new TypeError("parser must be boolean|regexp|function")}}}has(c,u){if(c=Z(c),c){const f=l.findKey(this,c);return!!(f&&this[f]!==void 0&&(!u||Re(this,this[f],f,u)))}return!1}delete(c,u){const f=this;let p=!1;function Se(D){if(D=Z(D),D){const _=l.findKey(f,D);_&&(!u||Re(f,f[_],_,u))&&(delete f[_],p=!0)}}return l.isArray(c)?c.forEach(Se):Se(c),p}clear(c){const u=Object.keys(this);let f=u.length,p=!1;for(;f--;){const Se=u[f];(!c||Re(this,this[Se],Se,c,!0))&&(delete this[Se],p=!0)}return p}normalize(c){const u=this,f={};return l.forEach(this,(p,Se)=>{const D=l.findKey(f,Se);if(D){u[D]=ae(p),delete u[Se];return}const _=c?rs(Se):String(Se).trim();_!==Se&&delete u[Se],u[_]=ae(p),f[_]=!0}),this}concat(...c){return this.constructor.concat(this,...c)}toJSON(c){const u=Object.create(null);return l.forEach(this,(f,p)=>{f!=null&&f!==!1&&(u[p]=c&&l.isArray(f)?f.join(", "):f)}),u}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([c,u])=>c+": "+u).join(`
|
1118
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(c){return c instanceof this?c:new this(c)}static concat(c,...u){const f=new this(c);return u.forEach(p=>f.set(p)),f}static accessor(c){const u=(this[Ge]=this[Ge]={accessors:{}}).accessors,f=this.prototype;function p(Se){const D=Z(Se);u[D]||(is(f,Se),u[D]=!0)}return l.isArray(c)?c.forEach(p):p(c),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors(k.prototype,({value:c},u)=>{let f=u[0].toUpperCase()+u.slice(1);return{get:()=>c,set(p){this[f]=p}}}),l.freezeMethods(k);function Ae(c,u){const f=this||te,p=u||f,Se=k.from(p.headers);let D=p.data;return l.forEach(c,function(_){D=_.call(f,D,Se.normalize(),u?u.status:void 0)}),Se.normalize(),D}function Nt(c){return!!(c&&c.__CANCEL__)}function X(c,u,f){y.call(this,c??"canceled",y.ERR_CANCELED,u,f),this.name="CanceledError"}l.inherits(X,y,{__CANCEL__:!0});function Pt(c,u,f){const p=f.config.validateStatus;!f.status||!p||p(f.status)?c(f):u(new y("Request failed with status code "+f.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(f.status/100)-4],f.config,f.request,f))}function os(c){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(c);return u&&u[1]||""}function cs(c,u){c=c||10;const f=new Array(c),p=new Array(c);let Se=0,D=0,_;return u=u!==void 0?u:1e3,function(x){const a=Date.now(),h=p[D];_||(_=a),f[Se]=x,p[Se]=a;let i=D,r=0;for(;i!==Se;)r+=f[i++],i=i%c;if(Se=(Se+1)%c,Se===D&&(D=(D+1)%c),a-_<u)return;const o=h&&a-h;return o?Math.round(r*1e3/o):void 0}}function as(c,u){let f=0,p=1e3/u,Se,D;const _=(x,a=Date.now())=>{f=a,Se=null,D&&(clearTimeout(D),D=null),c.apply(null,x)};return[(...x)=>{const a=Date.now(),h=a-f;h>=p?_(x,a):(Se=x,D||(D=setTimeout(()=>{D=null,_(Se)},p-h)))},()=>Se&&_(Se)]}const ue=(c,u,f=3)=>{let p=0;const Se=cs(50,250);return as(D=>{const _=D.loaded,x=D.lengthComputable?D.total:void 0,a=_-p,h=Se(a),i=_<=x;p=_;const r={loaded:_,total:x,progress:x?_/x:void 0,bytes:a,rate:h||void 0,estimated:h&&x&&i?(x-_)/h:void 0,event:D,lengthComputable:x!=null,[u?"download":"upload"]:!0};c(r)},f)},Ze=(c,u)=>{const f=c!=null;return[p=>u[0]({lengthComputable:f,total:c,loaded:p}),u[1]]},Qe=c=>(...u)=>l.asap(()=>c(...u)),ls=O.hasStandardBrowserEnv?((c,u)=>f=>(f=new URL(f,O.origin),c.protocol===f.protocol&&c.host===f.host&&(u||c.port===f.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,us=O.hasStandardBrowserEnv?{write(c,u,f,p,Se,D){const _=[c+"="+encodeURIComponent(u)];l.isNumber(f)&&_.push("expires="+new Date(f).toGMTString()),l.isString(p)&&_.push("path="+p),l.isString(Se)&&_.push("domain="+Se),D===!0&&_.push("secure"),document.cookie=_.join("; ")},read(c){const u=document.cookie.match(new RegExp("(^|;\\s*)("+c+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove(c){this.write(c,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hs(c){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(c)}function ds(c,u){return u?c.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):c}function It(c,u,f){let p=!hs(u);return c&&(p||f==!1)?ds(c,u):u}const Ye=c=>c instanceof k?{...c}:c;function V(c,u){u=u||{};const f={};function p(h,i,r,o){return l.isPlainObject(h)&&l.isPlainObject(i)?l.merge.call({caseless:o},h,i):l.isPlainObject(i)?l.merge({},i):l.isArray(i)?i.slice():i}function Se(h,i,r,o){if(l.isUndefined(i)){if(!l.isUndefined(h))return p(void 0,h,r,o)}else return p(h,i,r,o)}function D(h,i){if(!l.isUndefined(i))return p(void 0,i)}function _(h,i){if(l.isUndefined(i)){if(!l.isUndefined(h))return p(void 0,h)}else return p(void 0,i)}function x(h,i,r){if(r in u)return p(h,i);if(r in c)return p(void 0,h)}const a={url:D,method:D,data:D,baseURL:_,transformRequest:_,transformResponse:_,paramsSerializer:_,timeout:_,timeoutMessage:_,withCredentials:_,withXSRFToken:_,adapter:_,responseType:_,xsrfCookieName:_,xsrfHeaderName:_,onUploadProgress:_,onDownloadProgress:_,decompress:_,maxContentLength:_,maxBodyLength:_,beforeRedirect:_,transport:_,httpAgent:_,httpsAgent:_,cancelToken:_,socketPath:_,responseEncoding:_,validateStatus:x,headers:(h,i,r)=>Se(Ye(h),Ye(i),r,!0)};return l.forEach(Object.keys(Object.assign({},c,u)),function(h){const i=a[h]||Se,r=i(c[h],u[h],h);l.isUndefined(r)&&i!==x||(f[h]=r)}),f}const Lt=c=>{const u=V({},c);let{data:f,withXSRFToken:p,xsrfHeaderName:Se,xsrfCookieName:D,headers:_,auth:x}=u;u.headers=_=k.from(_),u.url=Ct(It(u.baseURL,u.url,u.allowAbsoluteUrls),c.params,c.paramsSerializer),x&&_.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):"")));let a;if(l.isFormData(f)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)_.setContentType(void 0);else if((a=_.getContentType())!==!1){const[h,...i]=a?a.split(";").map(r=>r.trim()).filter(Boolean):[];_.setContentType([h||"multipart/form-data",...i].join("; "))}}if(O.hasStandardBrowserEnv&&(p&&l.isFunction(p)&&(p=p(u)),p||p!==!1&&ls(u.url))){const h=Se&&D&&us.read(D);h&&_.set(Se,h)}return u},fs=typeof XMLHttpRequest<"u",ps=fs&&function(c){return new Promise(function(u,f){const p=Lt(c);let Se=p.data;const D=k.from(p.headers).normalize();let{responseType:_,onUploadProgress:x,onDownloadProgress:a}=p,h,i,r,o,t;function e(){o&&o(),t&&t(),p.cancelToken&&p.cancelToken.unsubscribe(h),p.signal&&p.signal.removeEventListener("abort",h)}let n=new XMLHttpRequest;n.open(p.method.toUpperCase(),p.url,!0),n.timeout=p.timeout;function s(){if(!n)return;const m=k.from("getAllResponseHeaders"in n&&n.getAllResponseHeaders()),A={data:!_||_==="text"||_==="json"?n.responseText:n.response,status:n.status,statusText:n.statusText,headers:m,config:c,request:n};Pt(function(E){u(E),e()},function(E){f(E),e()},A),n=null}"onloadend"in n?n.onloadend=s:n.onreadystatechange=function(){!n||n.readyState!==4||n.status===0&&!(n.responseURL&&n.responseURL.indexOf("file:")===0)||setTimeout(s)},n.onabort=function(){n&&(f(new y("Request aborted",y.ECONNABORTED,c,n)),n=null)},n.onerror=function(){f(new y("Network Error",y.ERR_NETWORK,c,n)),n=null},n.ontimeout=function(){let m=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const A=p.transitional||Tt;p.timeoutErrorMessage&&(m=p.timeoutErrorMessage),f(new y(m,A.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,c,n)),n=null},Se===void 0&&D.setContentType(null),"setRequestHeader"in n&&l.forEach(D.toJSON(),function(m,A){n.setRequestHeader(A,m)}),l.isUndefined(p.withCredentials)||(n.withCredentials=!!p.withCredentials),_&&_!=="json"&&(n.responseType=p.responseType),a&&([r,t]=ue(a,!0),n.addEventListener("progress",r)),x&&n.upload&&([i,o]=ue(x),n.upload.addEventListener("progress",i),n.upload.addEventListener("loadend",o)),(p.cancelToken||p.signal)&&(h=m=>{n&&(f(!m||m.type?new X(null,c,n):m),n.abort(),n=null)},p.cancelToken&&p.cancelToken.subscribe(h),p.signal&&(p.signal.aborted?h():p.signal.addEventListener("abort",h)));const g=os(p.url);if(g&&O.protocols.indexOf(g)===-1){f(new y("Unsupported protocol "+g+":",y.ERR_BAD_REQUEST,c));return}n.send(Se||null)})},ms=(c,u)=>{const{length:f}=c=c?c.filter(Boolean):[];if(u||f){let p=new AbortController,Se;const D=function(h){if(!Se){Se=!0,x();const i=h instanceof Error?h:this.reason;p.abort(i instanceof y?i:new X(i instanceof Error?i.message:i))}};let _=u&&setTimeout(()=>{_=null,D(new y(`timeout ${u} of ms exceeded`,y.ETIMEDOUT))},u);const x=()=>{c&&(_&&clearTimeout(_),_=null,c.forEach(h=>{h.unsubscribe?h.unsubscribe(D):h.removeEventListener("abort",D)}),c=null)};c.forEach(h=>h.addEventListener("abort",D));const{signal:a}=p;return a.unsubscribe=()=>l.asap(x),a}},gs=function*(c,u){let f=c.byteLength;if(f<u){yield c;return}let p=0,Se;for(;p<f;)Se=p+u,yield c.slice(p,Se),p=Se},bs=async function*(c,u){for await(const f of ys(c))yield*gs(f,u)},ys=async function*(c){if(c[Symbol.asyncIterator]){yield*c;return}const u=c.getReader();try{for(;;){const{done:f,value:p}=await u.read();if(f)break;yield p}}finally{await u.cancel()}},et=(c,u,f,p)=>{const Se=bs(c,u);let D=0,_,x=a=>{_||(_=!0,p&&p(a))};return new ReadableStream({async pull(a){try{const{done:h,value:i}=await Se.next();if(h){x(),a.close();return}let r=i.byteLength;if(f){let o=D+=r;f(o)}a.enqueue(new Uint8Array(i))}catch(h){throw x(h),h}},cancel(a){return x(a),Se.return()}},{highWaterMark:2})},be=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vt=be&&typeof ReadableStream=="function",ws=be&&(typeof TextEncoder=="function"?(c=>u=>c.encode(u))(new TextEncoder):async c=>new Uint8Array(await new Response(c).arrayBuffer())),jt=(c,...u)=>{try{return!!c(...u)}catch{return!1}},_s=vt&&jt(()=>{let c=!1;const u=new Request(O.origin,{body:new ReadableStream,method:"POST",get duplex(){return c=!0,"half"}}).headers.has("Content-Type");return c&&!u}),tt=64*1024,Pe=vt&&jt(()=>l.isReadableStream(new Response("").body)),he={stream:Pe&&(c=>c.body)};be&&(c=>{["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!he[u]&&(he[u]=l.isFunction(c[u])?f=>f[u]():(f,p)=>{throw new y(`Response type '${u}' is not supported`,y.ERR_NOT_SUPPORT,p)})})})(new Response);const Es=async c=>{if(c==null)return 0;if(l.isBlob(c))return c.size;if(l.isSpecCompliantForm(c))return(await new Request(O.origin,{method:"POST",body:c}).arrayBuffer()).byteLength;if(l.isArrayBufferView(c)||l.isArrayBuffer(c))return c.byteLength;if(l.isURLSearchParams(c)&&(c=c+""),l.isString(c))return(await ws(c)).byteLength},Ss=async(c,u)=>l.toFiniteNumber(c.getContentLength())??Es(u),xs=be&&(async c=>{let{url:u,method:f,data:p,signal:Se,cancelToken:D,timeout:_,onDownloadProgress:x,onUploadProgress:a,responseType:h,headers:i,withCredentials:r="same-origin",fetchOptions:o}=Lt(c);h=h?(h+"").toLowerCase():"text";let t=ms([Se,D&&D.toAbortSignal()],_),e;const n=t&&t.unsubscribe&&(()=>{t.unsubscribe()});let s;try{if(a&&_s&&f!=="get"&&f!=="head"&&(s=await Ss(i,p))!==0){let S=new Request(u,{method:"POST",body:p,duplex:"half"}),C;if(l.isFormData(p)&&(C=S.headers.get("content-type"))&&i.setContentType(C),S.body){const[q,Be]=Ze(s,ue(Qe(a)));p=et(S.body,tt,q,Be)}}l.isString(r)||(r=r?"include":"omit");const g="credentials"in Request.prototype;e=new Request(u,{...o,signal:t,method:f.toUpperCase(),headers:i.normalize().toJSON(),body:p,duplex:"half",credentials:g?r:void 0});let m=await fetch(e);const A=Pe&&(h==="stream"||h==="response");if(Pe&&(x||A&&n)){const S={};["status","statusText","headers"].forEach(se=>{S[se]=m[se]});const C=l.toFiniteNumber(m.headers.get("content-length")),[q,Be]=x&&Ze(C,ue(Qe(x),!0))||[];m=new Response(et(m.body,tt,q,()=>{Be&&Be(),n&&n()}),S)}h=h||"text";let E=await he[l.findKey(he,h)||"text"](m,c);return!A&&n&&n(),await new Promise((S,C)=>{Pt(S,C,{data:E,headers:k.from(m.headers),status:m.status,statusText:m.statusText,config:c,request:e})})}catch(g){throw n&&n(),g&&g.name==="TypeError"&&/Load failed|fetch/i.test(g.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,c,e),{cause:g.cause||g}):y.from(g,g&&g.code,c,e)}}),Ie={http:Un,xhr:ps,fetch:xs};l.forEach(Ie,(c,u)=>{if(c){try{Object.defineProperty(c,"name",{value:u})}catch{}Object.defineProperty(c,"adapterName",{value:u})}});const nt=c=>`- ${c}`,Rs=c=>l.isFunction(c)||c===null||c===!1,$t={getAdapter:c=>{c=l.isArray(c)?c:[c];const{length:u}=c;let f,p;const Se={};for(let D=0;D<u;D++){f=c[D];let _;if(p=f,!Rs(f)&&(p=Ie[(_=String(f)).toLowerCase()],p===void 0))throw new y(`Unknown adapter '${_}'`);if(p)break;Se[_||"#"+D]=p}if(!p){const D=Object.entries(Se).map(([x,a])=>`adapter ${x} `+(a===!1?"is not supported by the environment":"is not available in the build"));let _=u?D.length>1?`since :
|
1119
1119
|
`+D.map(nt).join(`
|
1120
|
-
`):" "+nt(D[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+_,"ERR_NOT_SUPPORT")}return p},adapters:Ie};function Oe(c){if(c.cancelToken&&c.cancelToken.throwIfRequested(),c.signal&&c.signal.aborted)throw new X(null,c)}function st(c){return Oe(c),c.headers=k.from(c.headers),c.data=Ae.call(c,c.transformRequest),["post","put","patch"].indexOf(c.method)!==-1&&c.headers.setContentType("application/x-www-form-urlencoded",!1),$t.getAdapter(c.adapter||te.adapter)(c).then(function(u){return Oe(c),u.data=Ae.call(c,c.transformResponse,u),u.headers=k.from(u.headers),u},function(u){return Nt(u)||(Oe(c),u&&u.response&&(u.response.data=Ae.call(c,c.transformResponse,u.response),u.response.headers=k.from(u.response.headers))),Promise.reject(u)})}const Ft="1.9.0",ye={};["object","boolean","number","function","string","symbol"].forEach((c,u)=>{ye[c]=function(
|
1121
|
-
`+Se):g.stack=Se}catch{}}throw g}}_request(c,u){typeof c=="string"?(u=u||{},u.url=c):u=c||{},u=V(this.defaults,u);const{transitional:g,paramsSerializer:p,headers:Se}=u;g!==void 0&&le.assertOptions(g,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),p!=null&&(l.isFunction(p)?u.paramsSerializer={serialize:p}:le.assertOptions(p,{encode:F.function,serialize:F.function},!0)),u.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?u.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:u.allowAbsoluteUrls=!0),le.assertOptions(u,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),u.method=(u.method||this.defaults.method||"get").toLowerCase();let D=Se&&l.merge(Se.common,Se[u.method]);Se&&l.forEach(["delete","get","head","post","put","patch","common"],t=>{delete Se[t]}),u.headers=k.concat(D,Se);const _=[];let x=!0;this.interceptors.request.forEach(function(t){typeof t.runWhen=="function"&&t.runWhen(u)===!1||(x=x&&t.synchronous,_.unshift(t.fulfilled,t.rejected))});const a=[];this.interceptors.response.forEach(function(t){a.push(t.fulfilled,t.rejected)});let h,i=0,r;if(!x){const t=[st.bind(this),void 0];for(t.unshift.apply(t,_),t.push.apply(t,a),r=t.length,h=Promise.resolve(u);i<r;)h=h.then(t[i++],t[i++]);return h}r=_.length;let o=u;for(i=0;i<r;){const t=_[i++],e=_[i++];try{o=t(o)}catch(n){e.call(this,n);break}}try{h=st.call(this,o)}catch(t){return Promise.reject(t)}for(i=0,r=a.length;i<r;)h=h.then(a[i++],a[i++]);return h}getUri(c){c=V(this.defaults,c);const u=It(c.baseURL,c.url,c.allowAbsoluteUrls);return Ct(u,c.params,c.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(c){z.prototype[c]=function(u,g){return this.request(V(g||{},{method:c,url:u,data:(g||{}).data}))}}),l.forEach(["post","put","patch"],function(c){function u(g){return function(p,Se,D){return this.request(V(D||{},{method:c,headers:g?{"Content-Type":"multipart/form-data"}:{},url:p,data:Se}))}}z.prototype[c]=u(),z.prototype[c+"Form"]=u(!0)});let Os=class Hi{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let g;this.promise=new Promise(function(Se){g=Se});const p=this;this.promise.then(Se=>{if(!p._listeners)return;let D=p._listeners.length;for(;D-- >0;)p._listeners[D](Se);p._listeners=null}),this.promise.then=Se=>{let D;const _=new Promise(x=>{p.subscribe(x),D=x}).then(Se);return _.cancel=function(){p.unsubscribe(D)},_},u(function(Se,D,_){p.reason||(p.reason=new X(Se,D,_),g(p.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const g=this._listeners.indexOf(u);g!==-1&&this._listeners.splice(g,1)}toAbortSignal(){const u=new AbortController,g=p=>{u.abort(p)};return this.subscribe(g),u.signal.unsubscribe=()=>this.unsubscribe(g),u.signal}static source(){let u;return{token:new Hi(function(g){u=g}),cancel:u}}};function Cs(c){return function(u){return c.apply(null,u)}}function Ts(c){return l.isObject(c)&&c.isAxiosError===!0}const Le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Le).forEach(([c,u])=>{Le[u]=c});function Dt(c){const u=new z(c),g=mt(z.prototype.request,u);return l.extend(g,z.prototype,u,{allOwnKeys:!0}),l.extend(g,u,null,{allOwnKeys:!0}),g.create=function(p){return Dt(V(c,p))},g}const R=Dt(te);R.Axios=z,R.CanceledError=X,R.CancelToken=Os,R.isCancel=Nt,R.VERSION=Ft,R.toFormData=ge,R.AxiosError=y,R.Cancel=R.CanceledError,R.all=function(c){return Promise.all(c)},R.spread=Cs,R.isAxiosError=Ts,R.mergeConfig=V,R.AxiosHeaders=k,R.formToJSON=c=>kt(l.isHTMLForm(c)?new FormData(c):c),R.getAdapter=$t.getAdapter,R.HttpStatusCode=Le,R.default=R;const{Axios:Wr,AxiosError:Kr,CanceledError:Xr,isCancel:Gr,CancelToken:Zr,VERSION:Qr,all:Yr,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:si,AxiosHeaders:ri,HttpStatusCode:ii,formToJSON:oi,getAdapter:ci,mergeConfig:ai}=R,qe=R.create({baseURL:location.origin,timeout:6e4,params:{}});qe.interceptors.response.use(c=>c,c=>{var u,g,p,Se,D,_,x,a,h,i,r;if(c.response){if(c.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(e){e&&OpenC3Auth.setTokens()}),c.response.config.headers["Ignore-Errors"]&&c.response.config.headers["Ignore-Errors"].includes(c.response.status.toString()))return Promise.reject(c);let o=`HTTP ${c.response.status} - `;(u=c.response)!=null&&u.statusText&&(o+=`${c.response.statusText} `),(p=(g=c.response)==null?void 0:g.config)!=null&&p.data&&(o+=`${c.response.config.data} `),(D=(Se=c.response)==null?void 0:Se.data)!=null&&D.message?o+=`${c.response.data.message}`:(x=(_=c.response)==null?void 0:_.data)!=null&&x.exception?o+=`${c.response.data.exception}`:(i=(h=(a=c.response)==null?void 0:a.data)==null?void 0:h.error)!=null&&i.message?(c.response.data.error.class&&(o+=`${c.response.data.error.class} `),o+=`${c.response.data.error.message}`):o+=`${(r=c.response)==null?void 0:r.data}`;const{$cosmosNotify:t}=window;throw t&&t.serious({title:"Network error",body:o}),c}else throw c});const re=async function(c,u,{data:g,params:p={},headers:Se,noAuth:D=!1,noScope:_=!1,onUploadProgress:x=!1}={}){if(!D){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}Se.Authorization=localStorage.openc3Token}return Se.manual=!0,!_&&!p.scope&&(p.scope=window.openc3Scope),qe({method:c,url:u,data:g,params:p,headers:Se,onUploadProgress:x})},ve={Accept:"application/json"},it={...ve,"Content-Type":"application/json"},li={get:function(c,{params:u,headers:g=ve,noScope:p,noAuth:Se,onUploadProgress:D}={}){return re("get",c,{params:u,headers:g,noScope:p,noAuth:Se,onUploadProgress:D})},put:function(c,{data:u,params:g,headers:p=it,noScope:Se,noAuth:D,onUploadProgress:_}={}){return re("put",c,{data:u,params:g,headers:p,noScope:Se,noAuth:D,onUploadProgress:_})},post:function(c,{data:u,params:g,headers:p=it,noScope:Se,noAuth:D,onUploadProgress:_}={}){return re("post",c,{data:u,params:g,headers:p,noScope:Se,noAuth:D,onUploadProgress:_})},delete:function(c,{params:u,headers:g=ve,noScope:p,noAuth:Se,onUploadProgress:D}={}){return re("delete",c,{params:u,headers:g,noScope:p,noAuth:Se,onUploadProgress:D})}};let we=()=>({emit(c,...u){for(let g=this.events[c]||[],p=0,Se=g.length;p<Se;p++)g[p](...u)},events:{},on(c,u){var g;return((g=this.events)[c]||(g[c]=[])).push(u),()=>{var p;this.events[c]=(p=this.events[c])==null?void 0:p.filter(Se=>u!==Se)}}});class ne extends Error{constructor(u,g){u instanceof Error?(super(u.message),this.cause=u):super(u),this.reason=g,this.name="ReasonError"}}function qt(c){return c?`{${Object.keys(c).sort().filter(u=>c[u]!==void 0).map(u=>{let g=JSON.stringify(c[u]);return`${JSON.stringify(u)}:${g}`}).join(",")}}`:""}class Ps{constructor(u){this.channel=u,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",u=>{if(u.type==="info"){this._state||(this._state=this.stateFromInfo(u));return}this._state&&(u.type==="join"?this._state[u.id]=u.info:u.type==="leave"&&delete this._state[u.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(u=>u()),this.listeners.length=0}async join(u,g){if(!this._info)return this._info={id:u,info:g},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let u=await this.channel.perform("$presence:leave");return delete this._info,u}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let u=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(u),this._state}finally{delete this._promise}}stateFromInfo(u){return u.records.reduce((g,{id:p,info:Se})=>(g[p]=Se,g),{})}}const B=Symbol("state");class Bt{constructor(u={}){this.emitter=we(),this.params=Object.freeze(u),this.presence=new Ps(this),this.initialConnect=!0,this[B]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=qt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[B]}attached(u){if(this.receiver){if(this.receiver!==u)throw Error("Already connected to a different receiver");return!1}return this.receiver=u,!0}connecting(){this[B]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[B]="connected";let u=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:u})):this.emit("connect",{reconnect:!0,restored:u})}restored(){if(this.state==="connected")throw Error("Already connected");this[B]="connected";let u=!0,g=!0;this.initialConnect=!1,this.emit("connect",{reconnect:g,restored:u})}disconnected(u){this.state==="disconnected"||this.state==="closed"||(this[B]="disconnected",this.presence.reset(),this.emit("disconnect",u))}closed(u){this.state!=="closed"&&(this[B]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",u))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(u,g){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,u,g)}async send(u){return this.perform(void 0,u)}async whisper(u){try{await this.perform("$whisper",u)}catch(g){let p=this.receiver?this.receiver.logger:null;p&&p.warn("whisper failed: ",g)}}receive(u,g){this.emit("message",u,g)}on(u,g){return this.emitter.on(u,g)}once(u,g){let p=this.emitter.on(u,(...Se)=>{p(),g(...Se)});return p}emit(u,...g){return this.emitter.emit(u,...g)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((u,g)=>{let p=[()=>delete this._pendingSubscribe];p.push(this.on("connect",()=>{p.forEach(Se=>Se()),u()})),p.push(this.on("close",Se=>{p.forEach(D=>D()),g(Se||new ne("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Me extends Bt{constructor(u,g){super(g),this.channelId=u}set channelId(u){this._channelId=u}get channelId(){return this._channelId}}v(Me,"identifier","__ghost__");const qs="$pubsub";class je extends Bt{async perform(u,g){if(u.startsWith("$"))return super.perform(u,g);throw Error("not implemented")}}v(je,"identifier",qs);function Ee(c){return cr.test(c)}const cr=/^-?[0-9]+$/;function Wt(c){return ar.test(c)}const ar=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Kt(c,u){const g=Number.parseFloat(c),p=String(g),Se=ut(c),D=ut(p);return!!(Se===D||(u==null?void 0:u.approx)===!0&&!Ee(c)&&D.length>=14&&Se.startsWith(D.substring(0,14)))}let Q=function(c){return c.underflow="underflow",c.overflow="overflow",c.truncate_integer="truncate_integer",c.truncate_float="truncate_float",c}({});function lr(c){if(Kt(c,{approx:!1}))return;if(Ee(c))return Q.truncate_integer;const u=Number.parseFloat(c);return Number.isFinite(u)?u===0?Q.underflow:Q.truncate_float:Q.overflow}function ut(c){return c.replace(ur,"").replace(dr,"").replace(fr,"").replace(hr,"")}const ur=/[eE][+-]?\d+$/,hr=/^-?(0*)?/,dr=/\./,fr=/0+$/;class pr{constructor(u){if(v(this,"isLosslessNumber",!0),!Wt(u))throw new Error(`Invalid number (value: "${u}")`);this.value=u}valueOf(){const u=lr(this.value);if(u===void 0||u===Q.truncate_float)return Number.parseFloat(this.value);if(Ee(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${u} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function mr(c){return c&&typeof c=="object"&&c.isLosslessNumber===!0||!1}function gr(c){return new pr(c)}function br(c,u){return He({"":c},"",c,u)}function He(c,u,g,p){return Array.isArray(g)?p.call(c,u,wr(g,p)):g&&typeof g=="object"&&!mr(g)?p.call(c,u,yr(g,p)):p.call(c,u,g)}function yr(c,u){for(const g of Object.keys(c)){const p=He(c,g,c[g],u);p!==void 0?c[g]=p:delete c[g]}return c}function wr(c,u){for(let g=0;g<c.length;g++)c[g]=He(c,String(g),c[g],u);return c}function _r(c,u){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gr,p=0;const Se=x();return e(Se),s(),u?br(Se,u):Se;function D(){if(c.charCodeAt(p)===Or){p++,h();const b={};let w=!0;for(;p<c.length&&c.charCodeAt(p)!==dt;){w?w=!1:(o(),h());const W=p,ot=i();if(ot===void 0){A();return}h(),t();const at=x();if(at===void 0){se();return}Object.prototype.hasOwnProperty.call(b,ot)&&!$e(at,b[ot])&&E(ot,W+1),b[ot]=at}return c.charCodeAt(p)!==dt&&S(),p++,b}}function _(){if(c.charCodeAt(p)===Cr){p++,h();const b=[];let w=!0;for(;p<c.length&&c.charCodeAt(p)!==ft;){w?w=!1:o();const W=x();n(W),b.push(W)}return c.charCodeAt(p)!==ft&&C(),p++,b}}function x(){h();const b=i()??r()??D()??_()??a("true",!0)??a("false",!1)??a("null",null);return h(),b}function a(b,w){if(c.slice(p,p+b.length)===b)return p+=b.length,w}function h(){for(;Er(c.charCodeAt(p));)p++}function i(){if(c.charCodeAt(p)===Ce){p++;let b="";for(;p<c.length&&c.charCodeAt(p)!==Ce;){if(c.charCodeAt(p)===Ar){const w=c[p+1],W=Rr[w];W!==void 0?(b+=W,p++):w==="u"?ie(c.charCodeAt(p+2))&&ie(c.charCodeAt(p+3))&&ie(c.charCodeAt(p+4))&&ie(c.charCodeAt(p+5))?(b+=String.fromCharCode(Number.parseInt(c.slice(p+2,p+6),16)),p+=5):j(p):Be(p)}else xr(c.charCodeAt(p))?b+=c[p]:q(c[p]);p++}return m(),p++,b}}function r(){const b=p;if(c.charCodeAt(p)===pt&&(p++,f(b)),c.charCodeAt(p)===ze)p++;else if(Sr(c.charCodeAt(p)))for(p++;oe(c.charCodeAt(p));)p++;if(c.charCodeAt(p)===jr)for(p++,f(b);oe(c.charCodeAt(p));)p++;if(c.charCodeAt(p)===qr||c.charCodeAt(p)===Dr)for(p++,(c.charCodeAt(p)===pt||c.charCodeAt(p)===Ir)&&p++,f(b);oe(c.charCodeAt(p));)p++;if(p>b)return g(c.slice(b,p))}function o(){if(c.charCodeAt(p)!==vr)throw new SyntaxError(`Comma ',' expected after value ${U()}`);p++}function t(){if(c.charCodeAt(p)!==$r)throw new SyntaxError(`Colon ':' expected after property name ${U()}`);p++}function e(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${U()}`)}function n(b){if(b===void 0)throw new SyntaxError(`Array item expected ${U()}`)}function s(){if(p<c.length)throw new SyntaxError(`Expected end of input ${U()}`)}function f(b){if(!oe(c.charCodeAt(p))){const w=c.slice(b,p);throw new SyntaxError(`Invalid number '${w}', expecting a digit ${U()}`)}}function m(){if(c.charCodeAt(p)!==Ce)throw new SyntaxError(`End of string '"' expected ${U()}`)}function A(){throw new SyntaxError(`Quoted object key expected ${U()}`)}function E(b,w){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${w}`)}function S(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${U()}`)}function C(){throw new SyntaxError(`Array item or end of array ']' expected ${U()}`)}function q(b){throw new SyntaxError(`Invalid character '${b}' ${ct()}`)}function Be(b){const w=c.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${w}' ${ct()}`)}function se(){throw new SyntaxError(`Object value expected after ':' ${ct()}`)}function j(b){const w=c.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${w}' ${ct()}`)}function ct(){return`at position ${p}`}function G(){return p<c.length?`but got '${c[p]}'`:"but reached end of input"}function U(){return`${G()} ${ct()}`}}function Er(c){return c===Tr||c===kr||c===Nr||c===Pr}function ie(c){return c>=ze&&c<=Ve||c>=Fr&&c<=Br||c>=Ur&&c<=Mr}function oe(c){return c>=ze&&c<=Ve}function Sr(c){return c>=Lr&&c<=Ve}function xr(c){return c>=32&&c<=1114111}function $e(c,u){return c===u?!0:Array.isArray(c)&&Array.isArray(u)?c.length===u.length&&c.every((g,p)=>$e(g,u[p])):ht(c)&&ht(u)?[...new Set([...Object.keys(c),...Object.keys(u)])].every(g=>$e(c[g],u[g])):!1}function ht(c){return typeof c=="object"&&c!==null}const Rr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
1122
|
-
`,r:"\r",t:" "},Ar=92,Or=123,dt=125,Cr=91,ft=93,Tr=32,kr=10,Nr=9,Pr=13,Ce=34,Ir=43,pt=45,ze=48,Lr=49,Ve=57,vr=44,jr=46,$r=58,Fr=65,Ur=97,Dr=69,qr=101,Br=70,Mr=102;function Xt(c,u,g,p){return Se(c);function Se(a,h){if(Array.isArray(p)){const i=p.find(r=>r.test(a));if(i){const r=i.stringify(a);if(typeof r!="string"||!Wt(r))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${r})`);return r}}if(typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a===null||a instanceof Date||a instanceof Boolean||a instanceof Number||a instanceof String)return JSON.stringify(a);if(a!=null&&a.isLosslessNumber||typeof a=="bigint")return a.toString();if(Array.isArray(a))return D(a);if(a&&typeof a=="object")return _(a)}function D(a,h){if(a.length===0)return"[]";let i="[";for(let r=0;r<a.length;r++){const o=a[r];typeof o<"u"&&typeof o!="function"?i+=Se(o):i+="null",r<a.length-1&&(i+=",")}return i+="]",i}function _(a,h){if(typeof a.toJSON=="function")return Xt(a.toJSON(),u,g,void 0);const i=Array.isArray(u)?u.map(String):Object.keys(a);if(i.length===0)return"{}";let r=!0,o="{";for(const t of i){const e=a[t];if(x(t,e)){r?r=!1:o+=",";const n=JSON.stringify(t);o+=`${n}:`,o+=Se(e)}}return o+="}",o}function x(a,h){return typeof h<"u"&&typeof h!="function"&&typeof h!="symbol"}}function Hr(c){return Ee(c)&&!Kt(c)?BigInt(c):parseFloat(c)}class pi{constructor(){v(this,"id",1)}async exec(u,g,p={},Se={},D=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return p.scope=window.openc3Scope,Se.manual=!0,(await qe.post("/openc3-api/api",{jsonrpc:"2.0",method:u,params:g,id:this.id,keyword_params:p},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...Se},timeout:D,transformRequest:[(_,x)=>Xt(_)],transformResponse:[_=>_r(_,void 0,Hr)]})).data.result}catch(_){let x=new Error;throw _.response?(x.name=_.response.data.error.data.class,x.message=_.response.data.error.data.message,x.object=_.response.data.error):_.request?(x.name="Request error",x.message="Request error, no response received"):x=_,x}}decode_openc3_type(u){if(u!==null&&typeof u=="object"&&u.json_class=="Float"&&u.raw){if(u.raw=="NaN")return NaN;if(u.raw=="Infinity")return 1/0;if(u.raw=="-Infinity")return-1/0}return null}encode_openc3_type(u){return Number.isNaN(u)?{json_class:"Float",raw:"NaN"}:u==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:u==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(u=>{u&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(u){return this.exec("set_offline_access",[u])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(u,g){return this.exec("map_target_to_interface",[u,g])}connect_interface(u,...g){return g.length>0?this.exec("connect_interface",[u,...g]):this.exec("connect_interface",[u])}disconnect_interface(u){return this.exec("disconnect_interface",[u])}interface_cmd(u,g,...p){return this.exec("interface_cmd",[u,g,...p])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(u){return this.exec("connect_router",[u])}disconnect_router(u){return this.exec("disconnect_router",[u])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(u){return this.exec("get_tlm_cnts",[u])}get_item(u,g,p){return this.exec("get_item",[u,g,p])}get_param(u,g,p){return this.exec("get_param",[u,g,p])}get_parameter(u,g,p){return this.exec("get_param",[u,g,p])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(u){return this.exec("set_limits_set",[u])}get_target(u){return this.exec("get_target",[u])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(u,g){return this.exec("get_tlm",[u,g])}get_telemetry(u,g){return this.exec("get_tlm",[u,g])}get_all_tlm(u){return this.exec("get_all_tlm",[u])}get_all_telemetry(u){return this.exec("get_all_tlm",[u])}get_all_tlm_names(u,g=!1){return this.exec("get_all_tlm_names",[u],{hidden:g})}get_all_telemetry_names(u){return this.exec("get_all_tlm_names",[u])}get_all_tlm_item_names(u){return this.exec("get_all_tlm_item_names",[u])}async get_tlm_packet(u,g,p,Se=30){const D=await this.exec("get_tlm_packet",[u,g],{type:p,stale_time:Se});if(D!=null){let _=D.length,x=null;for(let a=0;a<_;a++)x=this.decode_openc3_type(D[a][1]),x!==null&&(D[a][1]=x)}return D}get_packet_derived_items(u,g){return this.exec("get_packet_derived_items",[u,g])}get_tlm_buffer(u,g){return this.exec("get_tlm_buffer",[u,g])}async get_tlm_values(u,g=30,p=null){let Se={stale_time:g};p!==null&&(Se.cache_timeout=p);const D=await this.exec("get_tlm_values",[u],Se,{},1e4);let _=D[0].length,x=null;for(let a=0;a<_;a++)x=this.decode_openc3_type(D[0][a]),x!==null&&(D[0][a]=x);return D}get_limits(u,g,p){return this.exec("get_limits",[u,g,p])}async tlm(u,g,p,Se="CONVERTED"){let D=null;if(g===void 0)D=await this.exec("tlm",[u]);else if(p===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(g))D=await this.exec("tlm",[u],{type:g});else{let x=new Error;throw x.name="TypeError",x.message=`Invalid data type ${g}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,x}else D=await this.exec("tlm",[u,g,p],{type:Se});let _=this.decode_openc3_type(D);return _!==null&&(D=_),D}async inject_tlm(u,g,p=null,Se="CONVERTED"){await this.exec("inject_tlm",[u,g,p],{type:Se})}set_tlm(u,g,p,Se){return this.exec("set_tlm",[u,g,p],{type:Se})}override_tlm(u,g,p,Se){return this.exec("override_tlm",[u,g,p],{type:Se})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(u,g,p,Se){return this.exec("normalize_tlm",[u,g,p],{type:Se})}get_all_cmds(u){return this.exec("get_all_cmds",[u])}get_all_commands(u){return this.exec("get_all_cmds",[u])}get_all_cmd_names(u,g=!1){return this.exec("get_all_cmd_names",[u],{hidden:g})}get_all_command_names(u){return this.exec("get_all_cmd_names",[u])}get_cmd(u,g){return this.exec("get_cmd",[u,g])}get_command(u,g){return this.exec("get_cmd",[u,g])}get_cmd_cnts(u){return this.exec("get_cmd_cnts",[u])}get_cmd_value(u,g,p,Se="CONVERTED"){return this.exec("get_cmd_value",[u,g,p,Se])}get_cmd_buffer(u,g){return this.exec("get_cmd_buffer",[u,g])}_cmd(u,g,p,Se,D){let _=null;for(let x in Se)Object.prototype.hasOwnProperty.call(Se,x)&&(_=this.encode_openc3_type(Se[x]),_!==null&&(Se[x]=_));return this.exec(u,[g,p,Se],{},D)}get_cmd_hazardous(u,g,p,Se={}){return g===void 0?this.exec("get_cmd_hazardous",u,{},Se):this._cmd("get_cmd_hazardous",u,g,p,Se)}cmd(u,g,p,Se={}){return g===void 0?this.exec("cmd",u,{},Se):this._cmd("cmd",u,g,p,Se)}cmd_no_range_check(u,g,p,Se={}){return g===void 0?this.exec("cmd_no_range_check",u,{},Se):this._cmd("cmd_no_range_check",u,g,p,Se)}cmd_raw(u,g,p,Se={}){return g===void 0?this.exec("cmd_raw",u,{},Se):this._cmd("cmd_raw",u,g,p,Se)}cmd_raw_no_range_check(u,g,p,Se={}){return g===void 0?this.exec("cmd_raw_no_range_check",u,{},Se):this._cmd("cmd_raw_no_range_check",u,g,p,Se)}cmd_no_hazardous_check(u,g,p,Se={}){return g===void 0?this.exec("cmd_no_hazardous_check",u,{},Se):this._cmd("cmd_no_hazardous_check",u,g,p,Se)}cmd_no_checks(u,g,p,Se={}){return g===void 0?this.exec("cmd_no_checks",u,{},Se):this._cmd("cmd_no_checks",u,g,p,Se)}cmd_raw_no_hazardous_check(u,g,p,Se={}){return g===void 0?this.exec("cmd_raw_no_hazardous_check",u,{},Se):this._cmd("cmd_raw_no_hazardous_check",u,g,p,Se)}cmd_raw_no_checks(u,g,p,Se={}){return g===void 0?this.exec("cmd_raw_no_checks",u,{},Se):this._cmd("cmd_raw_no_checks",u,g,p,Se)}build_cmd(u,g,p){return g===void 0?this.exec("build_cmd",u):this._cmd("build_cmd",u,g,p)}build_command(u,g,p){return g===void 0?this.exec("build_cmd",u):this._cmd("build_cmd",u,g,p)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(u,g){return this.exec("send_raw",[u,g])}list_configs(u){return this.exec("list_configs",[u])}load_config(u,g){return this.exec("load_config",[u,g])}save_config(u,g,p){return this.exec("save_config",[u,g,p])}delete_config(u,g){return this.exec("delete_config",[u,g])}enable_limits(u,g,p){return this.exec("enable_limits",[u,g,p])}disable_limits(u,g,p){return this.exec("disable_limits",[u,g,p])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(u){return this.exec("get_overall_limits_state",[u])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(u){return this.exec("get_setting",[u])}get_settings(u){return this.exec("get_settings",u)}set_setting(u,g){return this.exec("set_setting",[u,g])}update_news(){return this.exec("update_news",[])}save_setting(u,g){return this.exec("set_setting",[u,g])}get_metrics(){return this.exec("get_metrics",[])}async hashString(u){if(window.isSecureContext){const g=new TextEncoder().encode(u),p=await crypto.subtle.digest("SHA-256",g),Se=new Uint8Array(p);return Array.from(Se).map(D=>D.toString(16).padStart(2,"0")).join("")}}}const Utilities={methods:{isFloat(c){return!!(/^\s*[-+]?\d*\.\d+\s*$/.test(c)||/^\s*[-+]?(\d+((\.\d+)?)|(\.\d+))[eE][-+]?\d+\s*$/.test(c))},isInt(c){return!!(/^\s*[-+]?\d+\s*$/.test(c)||/^\s*0[xX][\dabcdefABCDEF]+\s*$/.test(c))},isArray(c){return!!/^\s*\[.*\]\s*$/.test(c)},removeQuotes(c){if(c.length<2)return c;let u=c.charAt(0);if(u!=='"'&&u!=="'")return c;let g=c.charAt(c.length-1);return u!==g?c:c.slice(1,-1)},convertToString(c){let u=0,g="";if(Object.prototype.toString.call(c).slice(8,-1)==="Array"){let p=c.length;for(g="[ ",u=0;u<p;u++)Object.prototype.toString.call(c[u]).slice(8,-1)==="String"?g+='"'+c[u]+'"':g+=c[u],u!==p-1&&(g+=", ");g+=" ]"}else if(Object.prototype.toString.call(c).slice(8,-1)==="Object")if(c.json_class==="String"&&c.raw)for(g="0x",u=0;u<c.raw.length;u++){let p=c.raw[u].toString(16).toUpperCase();p.length<2&&(p="0"+p),g+=p}else c.json_class==="Float"&&c.raw&&(g=c.raw);else g=String(c);return g}}},_sfc_main$1={mixins:[Utilities],props:{modelValue:{type:[String,Number],default:void 0},states:{type:Object,default:()=>null},statesInHex:{type:Boolean,default:!1}},computed:{textFieldValue(){return this.convertToString(this.modelValue)},stateValue(){return this.statesInHex?"0x"+this.modelValue.toString(16):this.modelValue},selectValue(){return this.modelValue===""?null:this.modelValue},stateOptions(){return this.states?Object.keys(this.states).map(c=>({label:c,...this.states[c]})):null},hazardous(){var c,u;return((u=(c=Object.entries(this.states).find(([g,p])=>p.value===this.modelValue))==null?void 0:c.at(1))==null?void 0:u.hazardous)!==void 0},stateClass(){return this.hazardous?"hazardous mr-4":"mr-4"}},methods:{handleChange(c){this.$emit("update:modelValue",c)}}},_hoisted_1$1={key:1,class:"d-flex align-center"};function _sfc_render$1(c,u,g,p,Se,D){const _=resolveComponent("v-text-field"),x=resolveComponent("v-select");return openBlock(),createElementBlock("div",null,[g.states?(openBlock(),createElementBlock("div",_hoisted_1$1,[createVNode(x,{items:D.stateOptions,"model-value":D.selectValue,"onUpdate:modelValue":D.handleChange,"item-title":"label",class:normalizeClass(D.stateClass),"hide-details":"",density:"compact",variant:"outlined",placeholder:"Select...","min-width":"120px","data-test":"cmd-param-select"},null,8,["items","model-value","onUpdate:modelValue","class"]),createVNode(_,{"model-value":D.stateValue,disabled:"","hide-details":"",density:"compact",variant:"outlined","min-width":"60px","data-test":"cmd-param-value"},null,8,["model-value"])])):(openBlock(),createBlock(_,{key:0,"model-value":D.textFieldValue,"onUpdate:modelValue":D.handleChange,"hide-details":"",density:"compact",variant:"filled","data-test":"cmd-param-value"},null,8,["model-value","onUpdate:modelValue"]))])}const CommandParameterEditor=_export_sfc(_sfc_main$1,[["render",_sfc_render$1],["__scopeId","data-v-b19a55d5"]]),_sfc_main={components:{DetailsDialog:P,CriticalCmdDialog:N,TargetPacketItemChooser:we$1,CommandParameterEditor,TopBar:Z$1,Openc3Screen:Ie$1},mixins:[Utilities],data(){return{title:"Command Sender",search:"",headers:[{title:"Name",value:"parameter_name"},{title:"Value or State",value:"val"},{title:"Units",value:"units"},{title:"Range",value:"range"},{title:"Description",value:"description"}],editor:null,targetName:"",commandName:"",commandDescription:"",paramList:"",lastTargetName:"",lastCommandName:"",lastParamList:"",ignoreRangeChecks:!1,statesInHex:!1,showIgnoredParams:!1,cmdRaw:!1,ignoredParams:[],rows:[],interfaces:[],selectedInterface:"",rawCmdFile:null,status:"",history:"",hazardousCommand:"",displaySendHazardous:!1,displayErrorDialog:!1,displaySendRaw:!1,displayCriticalCmd:!1,criticalCmdUuid:null,criticalCmdString:null,criticalCmdUser:null,sendDisabled:!1,api:null,viewDetails:!1,contextMenuShown:!1,parameterName:"",reservedItemNames:[],x:0,y:0,contextMenuOptions:[{title:"Details",action:()=>{this.contextMenuShown=!1,this.viewDetails=!0}}],keywords:[],screenTarget:null,screenName:null,screenDefinition:null,screenCount:0}},computed:{menus:function(){return[{label:"Mode",items:[{label:"Ignore Range Checks",checkbox:!0,checked:this.ignoreRangeChecks,command:()=>{this.ignoreRangeChecks=!this.ignoreRangeChecks}},{label:"Display State Values in Hex",checkbox:!0,checked:this.statesInHex,command:()=>{this.statesInHex=!this.statesInHex}},{label:"Show Ignored Parameters",checkbox:!0,checked:this.showIgnoredParams,command:()=>{this.showIgnoredParams=!this.showIgnoredParams,this.updateCmdParams()}},{label:"Disable Parameter Conversions",checkbox:!0,checked:this.cmdRaw,command:()=>{this.cmdRaw=!this.cmdRaw.checked}}]}]}},created(){li.get("/openc3-api/autocomplete/reserved-item-names").then(c=>{this.reservedItemNames=c.data}),this.api=new pi,this.$route.params.target&&this.$route.params.packet&&this.commandChanged({targetName:this.$route.params.target.toUpperCase(),packetName:this.$route.params.packet.toUpperCase()}),li.get("/openc3-api/autocomplete/keywords/screen").then(c=>{this.keywords=c.data})},mounted(){this.editor=aceExports.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight"),this.editor.session.setMode("ace/mode/ruby"),this.editor.session.setTabSize(2),this.editor.session.setUseWrapMode(!0),this.editor.setHighlightActiveLine(!1),this.editor.setValue(localStorage.command_sender__history),this.history=this.editor.getValue().trim(),this.editor.clearSelection(),this.editor.focus(),this.editor.setAutoScrollEditorIntoView(!0),this.editor.setOption("maxLines",30),this.editor.setOption("minLines",1),this.editor.container.addEventListener("keydown",c=>{if(c.key==="Enter"){c.preventDefault();let u=this.editor.session.getLine(this.editor.getCursorPosition().row);if(u==="")return;let g=u.indexOf('"'),p=u.lastIndexOf('"');u=u.substr(g+1,p-g-1),this.sendCmd(u)}})},beforeUnmount(){this.editor.destroy(),this.editor.container.remove()},methods:{showContextMenu(c,u){c.preventDefault(),this.parameterName=u.item.parameter_name,this.contextMenuShown=!1,this.x=c.clientX,this.y=c.clientY,this.$nextTick(()=>{this.contextMenuShown=!0})},convertToValue(param){if(param.val!==void 0&¶m.states&&!this.cmdRaw)return Object.keys(param.states).find(c=>param.states[c].value===param.val);if(typeof param.val!="string")return param.val;let str=param.val,quotesRemoved=this.removeQuotes(str);if(str===quotesRemoved){let upcaseStr=str.toUpperCase();if((param.type==="STRING"||param.type==="BLOCK")&&upcaseStr.startsWith("0X")){let c=upcaseStr.slice(2);c.length%2!==0&&(c="0"+c);let u={json_class:"String",raw:[]};for(let g=0;g<c.length;g+=2){let p=c.charAt(g)+c.charAt(g+1);u.raw.push(parseInt(p,16))}return u}else return upcaseStr==="INFINITY"?1/0:upcaseStr==="-INFINITY"?-1/0:upcaseStr==="NAN"?NaN:this.isFloat(str)?parseFloat(str):this.isInt(str)?Number.isSafeInteger(Number(str))?parseInt(str):BigInt(str):this.isArray(str)?eval(str):str}else return quotesRemoved},commandChanged(c){(this.targetName!==c.targetName||this.commandName!==c.packetName)&&(this.targetName=c.targetName,this.commandName=c.packetName,this.sendDisabled===!1&&this.updateCmdParams(),this.$router.replace({name:"CommandSender",params:{target:this.targetName,packet:this.commandName}}).catch(u=>{}))},updateCmdParams(){this.sendDisabled=!0,this.ignoredParams=[],this.rows=[],this.api.get_target(this.targetName).then(c=>(this.ignoredParams=c.ignored_parameters,this.api.get_cmd(this.targetName,this.commandName)),c=>{this.displayError("getting ignored parameters",c),this.sendDisabled=!1}).then(c=>{if(c.items.forEach(u=>{if(!this.reservedItemNames.includes(u.name)&&(!this.ignoredParams.includes(u.name)||this.showIgnoredParams)){let g=u.default;!u.states&&u.data_type==="STRING"&&typeof u.default=="string"&&(g=`'${g}'`),u.required&&(g=""),u.format_string&&(g=sprintf(u.format_string,u.default));let p="N/A";u.minimum!=null&&u.maximum!=null&&(u.data_type==="FLOAT"&&(u.minimum<-1e6&&Number.isSafeInteger(u.minimum)&&(u.minimum=u.minimum.toExponential(3)),u.maximum>1e6&&Number.isSafeInteger(u.maximum)&&(u.maximum=u.maximum.toExponential(3))),p=`${u.minimum}..${u.maximum}`),this.rows.push({parameter_name:u.name,val:g,states:u.states,description:u.description,range:p,units:u.units,type:u.data_type})}}),c.screen)this.loadScreen(c.screen[0],c.screen[1]).then(u=>{this.screenTarget=c.screen[0],this.screenName=c.screen[1],this.screenDefinition=u.data,this.screenCount+=1});else{if(c.related_items){this.screenTarget="LOCAL",this.screenName="CMDSENDER";let u=`SCREEN AUTO AUTO 1.0
|
1123
|
-
`;for(const
|
1124
|
-
`;this.screenDefinition=u}else this.screenTarget=null,this.screenName=null,this.screenDefinition=null;this.screenCount+=1}this.commandDescription=c.description,this.sendDisabled=!1,this.status=""},c=>{this.displayError("getting command parameters",c),this.sendDisabled=!1})},createParamList(){let c={};for(const u of this.rows)c[u.parameter_name]=this.convertToValue(u);return c},buildCmd(){this.sendCmd(this.targetName,this.commandName,this.createParamList())},sendCmd(c,u,
|
1125
|
-
${this.history}`),this.editor.setValue(x),this.editor.moveCursorTo(0,0)}if(D+=" sent.",this.status.includes(D)){let x=this.status.split("sent.");if(x[1].includes("(")){let a=parseInt(x[1].substr(2,x[1].indexOf(")")-2));D=x[0]+"sent. ("+(a+1)+")"}else D+=" (2)"}this.status=D}else{let _="sending "+u+" "+g;this.displayError(_,Se,!0)}this.history=this.editor.getValue(),localStorage.command_sender__history=this.editor.getValue(),this.sendDisabled=!1},clearHistory(){this.editor.setValue(""),this.history="",localStorage.removeItem("command_sender__history")},displayError(c,u,g=!1){this.status=`Error ${c} due to ${u.name}`,u.message&&u.message!==""&&(this.status+=": ",this.status+=u.message),this.status.includes("CriticalCmdError")&&(this.status="Critical Command Queued For Approval"),g&&(u.message.includes("CriticalCmdError")?(this.criticalCmdUuid=u.object.data.instance_variables["@uuid"],this.criticalCmdString=u.object.data.instance_variables["@cmd_string"],this.criticalCmdUser=u.object.data.instance_variables["@username"],this.displayCriticalCmd=!0):this.displayErrorDialog=!0)},loadScreen(c,u){return li.get("/openc3-api/screen/"+c+"/"+u,{headers:{Accept:"text/plain"}})}}},_hoisted_1={style:{padding:"10px"}},_hoisted_2={class:"pa-3"},_hoisted_3={ref:"editor",class:"editor","data-test":"sender-history"},_hoisted_4={class:"mx-1"},_hoisted_5=["textContent"],_hoisted_6={class:"openc3-yellow"},_hoisted_7={class:"mx-1"};function _sfc_render(c,u,g,p,Se,D){const _=resolveComponent("top-bar"),x=resolveComponent("target-packet-item-chooser"),a=resolveComponent("v-spacer"),h=resolveComponent("v-text-field"),i=resolveComponent("v-card-title"),r=resolveComponent("command-parameter-editor"),o=resolveComponent("v-data-table"),t=resolveComponent("v-card"),e=resolveComponent("v-col"),n=resolveComponent("v-btn"),s=resolveComponent("v-tooltip"),f=resolveComponent("v-row"),m=resolveComponent("v-card-subtitle"),A=resolveComponent("openc3-screen"),E=resolveComponent("v-list-item-title"),S=resolveComponent("v-list-item"),C=resolveComponent("v-list"),q=resolveComponent("v-menu"),Be=resolveComponent("details-dialog"),se=resolveComponent("critical-cmd-dialog"),j=resolveComponent("v-toolbar"),ct=resolveComponent("v-card-text"),G=resolveComponent("v-dialog"),U=resolveComponent("v-card-actions"),b=resolveComponent("v-select");return openBlock(),createElementBlock("div",null,[createVNode(_,{menus:D.menus,title:Se.title},null,8,["menus","title"]),createVNode(t,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_1,[createVNode(x,{"initial-target-name":c.$route.params.target,"initial-packet-name":c.$route.params.packet,disabled:Se.sendDisabled,"button-text":"Send",mode:"cmd",onOnSet:u[0]||(u[0]=w=>D.commandChanged(w)),onAddItem:u[1]||(u[1]=w=>D.buildCmd(w))},null,8,["initial-target-name","initial-packet-name","disabled"])]),Se.rows.length!==0?(openBlock(),createBlock(t,{key:0},{default:withCtx(()=>[createVNode(i,{class:"d-flex align-center justify-content-space-between"},{default:withCtx(()=>[u[12]||(u[12]=createTextVNode(" Parameters ")),createVNode(a),createVNode(h,{modelValue:Se.search,"onUpdate:modelValue":u[2]||(u[2]=w=>Se.search=w),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),createVNode(o,{headers:Se.headers,items:Se.rows,search:Se.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact","onContextmenu:row":D.showContextMenu},{"item.val":withCtx(({item:w})=>[createVNode(r,{modelValue:w.val,"onUpdate:modelValue":W=>w.val=W,states:w.states,"states-in-hex":Se.statesInHex},null,8,["modelValue","onUpdate:modelValue","states","states-in-hex"])]),_:1},8,["headers","items","search","onContextmenu:row"])]),_:1})):createCommentVNode("",!0),createElementVNode("div",_hoisted_2,"Status: "+toDisplayString(Se.status),1)]),_:1}),u[26]||(u[26]=createElementVNode("div",{style:{height:"15px"}},null,-1)),createVNode(f,{"no-gutters":""},{default:withCtx(()=>[createVNode(e,{class:"pr-4"},{default:withCtx(()=>[createVNode(t,{class:"pb-2"},{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[createVNode(e,{class:"pt-6"},{default:withCtx(()=>u[13]||(u[13]=[createTextVNode(" Editable Command History: (Pressing Enter on the line re-executes the command) ")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createVNode(s,{"open-delay":600,location:"top"},{activator:withCtx(({props:w})=>[createElementVNode("div",mergeProps(w,{class:"float-right"}),[createVNode(n,{icon:"mdi-delete-sweep",variant:"text","data-test":"clear-history",onClick:D.clearHistory},null,8,["onClick"])],16)]),default:withCtx(()=>[u[14]||(u[14]=createElementVNode("span",null," Clear History ",-1))]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(f,{"no-gutters":"",class:"mt-2 mb-2"},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>[createElementVNode("pre",_hoisted_3,null,512)]),_:1})]),_:1})]),_:1})]),_:1}),Se.screenDefinition?(openBlock(),createBlock(e,{key:0,md:"auto"},{default:withCtx(()=>[createVNode(A,{target:Se.screenTarget,screen:Se.screenName,definition:Se.screenDefinition,keywords:Se.keywords,count:Se.screenCount,"show-close":!1},null,8,["target","screen","definition","keywords","count"])]),_:1})):createCommentVNode("",!0)]),_:1}),u[27]||(u[27]=createElementVNode("div",{style:{height:"15px"}},null,-1)),createVNode(q,{modelValue:Se.contextMenuShown,"onUpdate:modelValue":u[3]||(u[3]=w=>Se.contextMenuShown=w),target:[Se.x,Se.y]},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Se.contextMenuOptions,(w,W)=>(openBlock(),createBlock(S,{key:W,onClick:withModifiers(w.action,["stop"])},{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[createTextVNode(toDisplayString(w.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue","target"]),createVNode(Be,{modelValue:Se.viewDetails,"onUpdate:modelValue":u[4]||(u[4]=w=>Se.viewDetails=w),"target-name":Se.targetName,"packet-name":Se.commandName,"item-name":Se.parameterName,type:"cmd"},null,8,["modelValue","target-name","packet-name","item-name"]),createVNode(se,{modelValue:Se.displayCriticalCmd,"onUpdate:modelValue":u[5]||(u[5]=w=>Se.displayCriticalCmd=w),uuid:Se.criticalCmdUuid,"cmd-string":Se.criticalCmdString,"cmd-user":Se.criticalCmdUser},null,8,["modelValue","uuid","cmd-string","cmd-user"]),createVNode(G,{modelValue:Se.displayErrorDialog,"onUpdate:modelValue":u[7]||(u[7]=w=>Se.displayErrorDialog=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[15]||(u[15]=createElementVNode("span",null," Error ",-1)),createVNode(a)]),_:1}),createVNode(ct,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_4,[createVNode(f,{class:"my-2"},{default:withCtx(()=>[createVNode(ct,null,{default:withCtx(()=>[createElementVNode("span",{textContent:toDisplayString(Se.status)},null,8,_hoisted_5)]),_:1})]),_:1}),createVNode(f,null,{default:withCtx(()=>[createVNode(a),createVNode(n,{color:"primary","data-test":"error-dialog-ok",onClick:u[6]||(u[6]=w=>Se.displayErrorDialog=!1)},{default:withCtx(()=>u[16]||(u[16]=[createTextVNode(" Ok ")])),_:1})]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"]),createVNode(G,{modelValue:Se.displaySendHazardous,"onUpdate:modelValue":u[8]||(u[8]=w=>Se.displaySendHazardous=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[17]||(u[17]=createElementVNode("span",null," Hazardous Warning ",-1)),createVNode(a)]),_:1}),createVNode(ct,{class:"mt-6"},{default:withCtx(()=>[createTextVNode(" Warning: Command "+toDisplayString(Se.hazardousCommand)+" is Hazardous. Send? ",1),u[18]||(u[18]=createElementVNode("br",null,null,-1)),createElementVNode("span",_hoisted_6," Description: "+toDisplayString(Se.commandDescription),1)]),_:1}),createVNode(U,{class:"px-2"},{default:withCtx(()=>[createVNode(a),createVNode(n,{variant:"outlined",onClick:D.cancelHazardousCmd},{default:withCtx(()=>u[19]||(u[19]=[createTextVNode(" Cancel ")])),_:1},8,["onClick"]),createVNode(n,{variant:"flat",onClick:D.sendHazardousCmd},{default:withCtx(()=>u[20]||(u[20]=[createTextVNode(" Send ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),createVNode(G,{modelValue:Se.displaySendRaw,"onUpdate:modelValue":u[11]||(u[11]=w=>Se.displaySendRaw=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[21]||(u[21]=createElementVNode("span",null," Send Raw ",-1)),createVNode(a)]),_:1}),createVNode(ct,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_7,[createVNode(f,{class:"my-2"},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>u[22]||(u[22]=[createTextVNode("Interface:")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createVNode(b,{modelValue:Se.selectedInterface,"onUpdate:modelValue":u[9]||(u[9]=w=>Se.selectedInterface=w),variant:"solo","hide-details":"",density:"compact",items:Se.interfaces,"item-title":"label","item-value":"value"},null,8,["modelValue","items"])]),_:1})]),_:1}),createVNode(f,{"no-gutters":""},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>u[23]||(u[23]=[createTextVNode("Filename:")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createElementVNode("input",{type:"file",onChange:u[10]||(u[10]=w=>c.selectRawCmdFile(w))},null,32)]),_:1})]),_:1}),createVNode(f,null,{default:withCtx(()=>[createVNode(a),createVNode(n,{variant:"outlined","data-test":"raw-cancel",onClick:c.cancelRawCmd},{default:withCtx(()=>u[24]||(u[24]=[createTextVNode(" Cancel ")])),_:1},8,["onClick"]),createVNode(n,{class:"bg-primary","data-test":"raw-ok",onClick:c.sendRawCmd},{default:withCtx(()=>u[25]||(u[25]=[createTextVNode(" Ok ")])),_:1},8,["onClick"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const CommandSender=exports("default",_export_sfc(_sfc_main,[["render",_sfc_render],["__scopeId","data-v-80865e28"]]))}}});
|
1120
|
+
`):" "+nt(D[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+_,"ERR_NOT_SUPPORT")}return p},adapters:Ie};function Oe(c){if(c.cancelToken&&c.cancelToken.throwIfRequested(),c.signal&&c.signal.aborted)throw new X(null,c)}function st(c){return Oe(c),c.headers=k.from(c.headers),c.data=Ae.call(c,c.transformRequest),["post","put","patch"].indexOf(c.method)!==-1&&c.headers.setContentType("application/x-www-form-urlencoded",!1),$t.getAdapter(c.adapter||te.adapter)(c).then(function(u){return Oe(c),u.data=Ae.call(c,c.transformResponse,u),u.headers=k.from(u.headers),u},function(u){return Nt(u)||(Oe(c),u&&u.response&&(u.response.data=Ae.call(c,c.transformResponse,u.response),u.response.headers=k.from(u.response.headers))),Promise.reject(u)})}const Ft="1.9.0",ye={};["object","boolean","number","function","string","symbol"].forEach((c,u)=>{ye[c]=function(f){return typeof f===c||"a"+(u<1?"n ":" ")+c}});const rt={};ye.transitional=function(c,u,f){function p(Se,D){return"[Axios v"+Ft+"] Transitional option '"+Se+"'"+D+(f?". "+f:"")}return(Se,D,_)=>{if(c===!1)throw new y(p(D," has been removed"+(u?" in "+u:"")),y.ERR_DEPRECATED);return u&&!rt[D]&&(rt[D]=!0,console.warn(p(D," has been deprecated since v"+u+" and will be removed in the near future"))),c?c(Se,D,_):!0}},ye.spelling=function(c){return(u,f)=>(console.warn(`${f} is likely a misspelling of ${c}`),!0)};function As(c,u,f){if(typeof c!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const p=Object.keys(c);let Se=p.length;for(;Se-- >0;){const D=p[Se],_=u[D];if(_){const x=c[D],a=x===void 0||_(x,D,c);if(a!==!0)throw new y("option "+D+" must be "+a,y.ERR_BAD_OPTION_VALUE);continue}if(f!==!0)throw new y("Unknown option "+D,y.ERR_BAD_OPTION)}}const le={assertOptions:As,validators:ye},F=le.validators;let z=class{constructor(c){this.defaults=c||{},this.interceptors={request:new Xe,response:new Xe}}async request(c,u){try{return await this._request(c,u)}catch(f){if(f instanceof Error){let p={};Error.captureStackTrace?Error.captureStackTrace(p):p=new Error;const Se=p.stack?p.stack.replace(/^.+\n/,""):"";try{f.stack?Se&&!String(f.stack).endsWith(Se.replace(/^.+\n.+\n/,""))&&(f.stack+=`
|
1121
|
+
`+Se):f.stack=Se}catch{}}throw f}}_request(c,u){typeof c=="string"?(u=u||{},u.url=c):u=c||{},u=V(this.defaults,u);const{transitional:f,paramsSerializer:p,headers:Se}=u;f!==void 0&&le.assertOptions(f,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),p!=null&&(l.isFunction(p)?u.paramsSerializer={serialize:p}:le.assertOptions(p,{encode:F.function,serialize:F.function},!0)),u.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?u.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:u.allowAbsoluteUrls=!0),le.assertOptions(u,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),u.method=(u.method||this.defaults.method||"get").toLowerCase();let D=Se&&l.merge(Se.common,Se[u.method]);Se&&l.forEach(["delete","get","head","post","put","patch","common"],t=>{delete Se[t]}),u.headers=k.concat(D,Se);const _=[];let x=!0;this.interceptors.request.forEach(function(t){typeof t.runWhen=="function"&&t.runWhen(u)===!1||(x=x&&t.synchronous,_.unshift(t.fulfilled,t.rejected))});const a=[];this.interceptors.response.forEach(function(t){a.push(t.fulfilled,t.rejected)});let h,i=0,r;if(!x){const t=[st.bind(this),void 0];for(t.unshift.apply(t,_),t.push.apply(t,a),r=t.length,h=Promise.resolve(u);i<r;)h=h.then(t[i++],t[i++]);return h}r=_.length;let o=u;for(i=0;i<r;){const t=_[i++],e=_[i++];try{o=t(o)}catch(n){e.call(this,n);break}}try{h=st.call(this,o)}catch(t){return Promise.reject(t)}for(i=0,r=a.length;i<r;)h=h.then(a[i++],a[i++]);return h}getUri(c){c=V(this.defaults,c);const u=It(c.baseURL,c.url,c.allowAbsoluteUrls);return Ct(u,c.params,c.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(c){z.prototype[c]=function(u,f){return this.request(V(f||{},{method:c,url:u,data:(f||{}).data}))}}),l.forEach(["post","put","patch"],function(c){function u(f){return function(p,Se,D){return this.request(V(D||{},{method:c,headers:f?{"Content-Type":"multipart/form-data"}:{},url:p,data:Se}))}}z.prototype[c]=u(),z.prototype[c+"Form"]=u(!0)});let Os=class Hi{constructor(u){if(typeof u!="function")throw new TypeError("executor must be a function.");let f;this.promise=new Promise(function(Se){f=Se});const p=this;this.promise.then(Se=>{if(!p._listeners)return;let D=p._listeners.length;for(;D-- >0;)p._listeners[D](Se);p._listeners=null}),this.promise.then=Se=>{let D;const _=new Promise(x=>{p.subscribe(x),D=x}).then(Se);return _.cancel=function(){p.unsubscribe(D)},_},u(function(Se,D,_){p.reason||(p.reason=new X(Se,D,_),f(p.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(u){if(this.reason){u(this.reason);return}this._listeners?this._listeners.push(u):this._listeners=[u]}unsubscribe(u){if(!this._listeners)return;const f=this._listeners.indexOf(u);f!==-1&&this._listeners.splice(f,1)}toAbortSignal(){const u=new AbortController,f=p=>{u.abort(p)};return this.subscribe(f),u.signal.unsubscribe=()=>this.unsubscribe(f),u.signal}static source(){let u;return{token:new Hi(function(f){u=f}),cancel:u}}};function Cs(c){return function(u){return c.apply(null,u)}}function Ts(c){return l.isObject(c)&&c.isAxiosError===!0}const Le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Le).forEach(([c,u])=>{Le[u]=c});function Dt(c){const u=new z(c),f=mt(z.prototype.request,u);return l.extend(f,z.prototype,u,{allOwnKeys:!0}),l.extend(f,u,null,{allOwnKeys:!0}),f.create=function(p){return Dt(V(c,p))},f}const R=Dt(te);R.Axios=z,R.CanceledError=X,R.CancelToken=Os,R.isCancel=Nt,R.VERSION=Ft,R.toFormData=ge,R.AxiosError=y,R.Cancel=R.CanceledError,R.all=function(c){return Promise.all(c)},R.spread=Cs,R.isAxiosError=Ts,R.mergeConfig=V,R.AxiosHeaders=k,R.formToJSON=c=>kt(l.isHTMLForm(c)?new FormData(c):c),R.getAdapter=$t.getAdapter,R.HttpStatusCode=Le,R.default=R;const{Axios:Wr,AxiosError:Kr,CanceledError:Xr,isCancel:Gr,CancelToken:Zr,VERSION:Qr,all:Yr,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:si,AxiosHeaders:ri,HttpStatusCode:ii,formToJSON:oi,getAdapter:ci,mergeConfig:ai}=R,qe=R.create({baseURL:location.origin,timeout:6e4,params:{}});qe.interceptors.response.use(c=>c,c=>{var u,f,p,Se,D,_,x,a,h,i,r;if(c.response){if(c.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(e){e&&OpenC3Auth.setTokens()}),c.response.config.headers["Ignore-Errors"]&&c.response.config.headers["Ignore-Errors"].includes(c.response.status.toString()))return Promise.reject(c);let o=`HTTP ${c.response.status} - `;(u=c.response)!=null&&u.statusText&&(o+=`${c.response.statusText} `),(p=(f=c.response)==null?void 0:f.config)!=null&&p.data&&(o+=`${c.response.config.data} `),(D=(Se=c.response)==null?void 0:Se.data)!=null&&D.message?o+=`${c.response.data.message}`:(x=(_=c.response)==null?void 0:_.data)!=null&&x.exception?o+=`${c.response.data.exception}`:(i=(h=(a=c.response)==null?void 0:a.data)==null?void 0:h.error)!=null&&i.message?(c.response.data.error.class&&(o+=`${c.response.data.error.class} `),o+=`${c.response.data.error.message}`):o+=`${(r=c.response)==null?void 0:r.data}`;const{$cosmosNotify:t}=window;throw t&&t.serious({title:"Network error",body:o}),c}else throw c});const re=async function(c,u,{data:f,params:p={},headers:Se,noAuth:D=!1,noScope:_=!1,onUploadProgress:x=!1}={}){if(!D){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}Se.Authorization=localStorage.openc3Token}return Se.manual=!0,!_&&!p.scope&&(p.scope=window.openc3Scope),qe({method:c,url:u,data:f,params:p,headers:Se,onUploadProgress:x})},ve={Accept:"application/json"},it={...ve,"Content-Type":"application/json"},li={get:function(c,{params:u,headers:f=ve,noScope:p,noAuth:Se,onUploadProgress:D}={}){return re("get",c,{params:u,headers:f,noScope:p,noAuth:Se,onUploadProgress:D})},put:function(c,{data:u,params:f,headers:p=it,noScope:Se,noAuth:D,onUploadProgress:_}={}){return re("put",c,{data:u,params:f,headers:p,noScope:Se,noAuth:D,onUploadProgress:_})},post:function(c,{data:u,params:f,headers:p=it,noScope:Se,noAuth:D,onUploadProgress:_}={}){return re("post",c,{data:u,params:f,headers:p,noScope:Se,noAuth:D,onUploadProgress:_})},delete:function(c,{params:u,headers:f=ve,noScope:p,noAuth:Se,onUploadProgress:D}={}){return re("delete",c,{params:u,headers:f,noScope:p,noAuth:Se,onUploadProgress:D})}};let we=()=>({emit(c,...u){for(let f=this.events[c]||[],p=0,Se=f.length;p<Se;p++)f[p](...u)},events:{},on(c,u){var f;return((f=this.events)[c]||(f[c]=[])).push(u),()=>{var p;this.events[c]=(p=this.events[c])==null?void 0:p.filter(Se=>u!==Se)}}});class ne extends Error{constructor(u,f){u instanceof Error?(super(u.message),this.cause=u):super(u),this.reason=f,this.name="ReasonError"}}function qt(c){return c?`{${Object.keys(c).sort().filter(u=>c[u]!==void 0).map(u=>{let f=JSON.stringify(c[u]);return`${JSON.stringify(u)}:${f}`}).join(",")}}`:""}class Ps{constructor(u){this.channel=u,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",u=>{if(u.type==="info"){this._state||(this._state=this.stateFromInfo(u));return}this._state&&(u.type==="join"?this._state[u.id]=u.info:u.type==="leave"&&delete this._state[u.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(u=>u()),this.listeners.length=0}async join(u,f){if(!this._info)return this._info={id:u,info:f},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let u=await this.channel.perform("$presence:leave");return delete this._info,u}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let u=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(u),this._state}finally{delete this._promise}}stateFromInfo(u){return u.records.reduce((f,{id:p,info:Se})=>(f[p]=Se,f),{})}}const B=Symbol("state");class Bt{constructor(u={}){this.emitter=we(),this.params=Object.freeze(u),this.presence=new Ps(this),this.initialConnect=!0,this[B]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=qt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[B]}attached(u){if(this.receiver){if(this.receiver!==u)throw Error("Already connected to a different receiver");return!1}return this.receiver=u,!0}connecting(){this[B]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[B]="connected";let u=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:u})):this.emit("connect",{reconnect:!0,restored:u})}restored(){if(this.state==="connected")throw Error("Already connected");this[B]="connected";let u=!0,f=!0;this.initialConnect=!1,this.emit("connect",{reconnect:f,restored:u})}disconnected(u){this.state==="disconnected"||this.state==="closed"||(this[B]="disconnected",this.presence.reset(),this.emit("disconnect",u))}closed(u){this.state!=="closed"&&(this[B]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",u))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(u,f){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,u,f)}async send(u){return this.perform(void 0,u)}async whisper(u){try{await this.perform("$whisper",u)}catch(f){let p=this.receiver?this.receiver.logger:null;p&&p.warn("whisper failed: ",f)}}receive(u,f){this.emit("message",u,f)}on(u,f){return this.emitter.on(u,f)}once(u,f){let p=this.emitter.on(u,(...Se)=>{p(),f(...Se)});return p}emit(u,...f){return this.emitter.emit(u,...f)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((u,f)=>{let p=[()=>delete this._pendingSubscribe];p.push(this.on("connect",()=>{p.forEach(Se=>Se()),u()})),p.push(this.on("close",Se=>{p.forEach(D=>D()),f(Se||new ne("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Me extends Bt{constructor(u,f){super(f),this.channelId=u}set channelId(u){this._channelId=u}get channelId(){return this._channelId}}v(Me,"identifier","__ghost__");const qs="$pubsub";class je extends Bt{async perform(u,f){if(u.startsWith("$"))return super.perform(u,f);throw Error("not implemented")}}v(je,"identifier",qs);function Ee(c){return cr.test(c)}const cr=/^-?[0-9]+$/;function Wt(c){return ar.test(c)}const ar=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Kt(c,u){const f=Number.parseFloat(c),p=String(f),Se=ut(c),D=ut(p);return!!(Se===D||(u==null?void 0:u.approx)===!0&&!Ee(c)&&D.length>=14&&Se.startsWith(D.substring(0,14)))}let Q=function(c){return c.underflow="underflow",c.overflow="overflow",c.truncate_integer="truncate_integer",c.truncate_float="truncate_float",c}({});function lr(c){if(Kt(c,{approx:!1}))return;if(Ee(c))return Q.truncate_integer;const u=Number.parseFloat(c);return Number.isFinite(u)?u===0?Q.underflow:Q.truncate_float:Q.overflow}function ut(c){return c.replace(ur,"").replace(dr,"").replace(fr,"").replace(hr,"")}const ur=/[eE][+-]?\d+$/,hr=/^-?(0*)?/,dr=/\./,fr=/0+$/;class pr{constructor(u){if(v(this,"isLosslessNumber",!0),!Wt(u))throw new Error(`Invalid number (value: "${u}")`);this.value=u}valueOf(){const u=lr(this.value);if(u===void 0||u===Q.truncate_float)return Number.parseFloat(this.value);if(Ee(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${u} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function mr(c){return c&&typeof c=="object"&&c.isLosslessNumber===!0||!1}function gr(c){return new pr(c)}function br(c,u){return He({"":c},"",c,u)}function He(c,u,f,p){return Array.isArray(f)?p.call(c,u,wr(f,p)):f&&typeof f=="object"&&!mr(f)?p.call(c,u,yr(f,p)):p.call(c,u,f)}function yr(c,u){for(const f of Object.keys(c)){const p=He(c,f,c[f],u);p!==void 0?c[f]=p:delete c[f]}return c}function wr(c,u){for(let f=0;f<c.length;f++)c[f]=He(c,String(f),c[f],u);return c}function _r(c,u){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gr,p=0;const Se=x();return e(Se),s(),u?br(Se,u):Se;function D(){if(c.charCodeAt(p)===Or){p++,h();const b={};let w=!0;for(;p<c.length&&c.charCodeAt(p)!==dt;){w?w=!1:(o(),h());const W=p,ot=i();if(ot===void 0){A();return}h(),t();const at=x();if(at===void 0){se();return}Object.prototype.hasOwnProperty.call(b,ot)&&!$e(at,b[ot])&&E(ot,W+1),b[ot]=at}return c.charCodeAt(p)!==dt&&S(),p++,b}}function _(){if(c.charCodeAt(p)===Cr){p++,h();const b=[];let w=!0;for(;p<c.length&&c.charCodeAt(p)!==ft;){w?w=!1:o();const W=x();n(W),b.push(W)}return c.charCodeAt(p)!==ft&&C(),p++,b}}function x(){h();const b=i()??r()??D()??_()??a("true",!0)??a("false",!1)??a("null",null);return h(),b}function a(b,w){if(c.slice(p,p+b.length)===b)return p+=b.length,w}function h(){for(;Er(c.charCodeAt(p));)p++}function i(){if(c.charCodeAt(p)===Ce){p++;let b="";for(;p<c.length&&c.charCodeAt(p)!==Ce;){if(c.charCodeAt(p)===Ar){const w=c[p+1],W=Rr[w];W!==void 0?(b+=W,p++):w==="u"?ie(c.charCodeAt(p+2))&&ie(c.charCodeAt(p+3))&&ie(c.charCodeAt(p+4))&&ie(c.charCodeAt(p+5))?(b+=String.fromCharCode(Number.parseInt(c.slice(p+2,p+6),16)),p+=5):j(p):Be(p)}else xr(c.charCodeAt(p))?b+=c[p]:q(c[p]);p++}return m(),p++,b}}function r(){const b=p;if(c.charCodeAt(p)===pt&&(p++,g(b)),c.charCodeAt(p)===ze)p++;else if(Sr(c.charCodeAt(p)))for(p++;oe(c.charCodeAt(p));)p++;if(c.charCodeAt(p)===jr)for(p++,g(b);oe(c.charCodeAt(p));)p++;if(c.charCodeAt(p)===qr||c.charCodeAt(p)===Dr)for(p++,(c.charCodeAt(p)===pt||c.charCodeAt(p)===Ir)&&p++,g(b);oe(c.charCodeAt(p));)p++;if(p>b)return f(c.slice(b,p))}function o(){if(c.charCodeAt(p)!==vr)throw new SyntaxError(`Comma ',' expected after value ${U()}`);p++}function t(){if(c.charCodeAt(p)!==$r)throw new SyntaxError(`Colon ':' expected after property name ${U()}`);p++}function e(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${U()}`)}function n(b){if(b===void 0)throw new SyntaxError(`Array item expected ${U()}`)}function s(){if(p<c.length)throw new SyntaxError(`Expected end of input ${U()}`)}function g(b){if(!oe(c.charCodeAt(p))){const w=c.slice(b,p);throw new SyntaxError(`Invalid number '${w}', expecting a digit ${U()}`)}}function m(){if(c.charCodeAt(p)!==Ce)throw new SyntaxError(`End of string '"' expected ${U()}`)}function A(){throw new SyntaxError(`Quoted object key expected ${U()}`)}function E(b,w){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${w}`)}function S(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${U()}`)}function C(){throw new SyntaxError(`Array item or end of array ']' expected ${U()}`)}function q(b){throw new SyntaxError(`Invalid character '${b}' ${ct()}`)}function Be(b){const w=c.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${w}' ${ct()}`)}function se(){throw new SyntaxError(`Object value expected after ':' ${ct()}`)}function j(b){const w=c.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${w}' ${ct()}`)}function ct(){return`at position ${p}`}function G(){return p<c.length?`but got '${c[p]}'`:"but reached end of input"}function U(){return`${G()} ${ct()}`}}function Er(c){return c===Tr||c===kr||c===Nr||c===Pr}function ie(c){return c>=ze&&c<=Ve||c>=Fr&&c<=Br||c>=Ur&&c<=Mr}function oe(c){return c>=ze&&c<=Ve}function Sr(c){return c>=Lr&&c<=Ve}function xr(c){return c>=32&&c<=1114111}function $e(c,u){return c===u?!0:Array.isArray(c)&&Array.isArray(u)?c.length===u.length&&c.every((f,p)=>$e(f,u[p])):ht(c)&&ht(u)?[...new Set([...Object.keys(c),...Object.keys(u)])].every(f=>$e(c[f],u[f])):!1}function ht(c){return typeof c=="object"&&c!==null}const Rr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
1122
|
+
`,r:"\r",t:" "},Ar=92,Or=123,dt=125,Cr=91,ft=93,Tr=32,kr=10,Nr=9,Pr=13,Ce=34,Ir=43,pt=45,ze=48,Lr=49,Ve=57,vr=44,jr=46,$r=58,Fr=65,Ur=97,Dr=69,qr=101,Br=70,Mr=102;function Xt(c,u,f,p){return Se(c);function Se(a,h){if(Array.isArray(p)){const i=p.find(r=>r.test(a));if(i){const r=i.stringify(a);if(typeof r!="string"||!Wt(r))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${r})`);return r}}if(typeof a=="boolean"||typeof a=="number"||typeof a=="string"||a===null||a instanceof Date||a instanceof Boolean||a instanceof Number||a instanceof String)return JSON.stringify(a);if(a!=null&&a.isLosslessNumber||typeof a=="bigint")return a.toString();if(Array.isArray(a))return D(a);if(a&&typeof a=="object")return _(a)}function D(a,h){if(a.length===0)return"[]";let i="[";for(let r=0;r<a.length;r++){const o=a[r];typeof o<"u"&&typeof o!="function"?i+=Se(o):i+="null",r<a.length-1&&(i+=",")}return i+="]",i}function _(a,h){if(typeof a.toJSON=="function")return Xt(a.toJSON(),u,f,void 0);const i=Array.isArray(u)?u.map(String):Object.keys(a);if(i.length===0)return"{}";let r=!0,o="{";for(const t of i){const e=a[t];if(x(t,e)){r?r=!1:o+=",";const n=JSON.stringify(t);o+=`${n}:`,o+=Se(e)}}return o+="}",o}function x(a,h){return typeof h<"u"&&typeof h!="function"&&typeof h!="symbol"}}function Hr(c){return Ee(c)&&!Kt(c)?BigInt(c):parseFloat(c)}class pi{constructor(){v(this,"id",1)}async exec(u,f,p={},Se={},D=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return p.scope=window.openc3Scope,Se.manual=!0,(await qe.post("/openc3-api/api",{jsonrpc:"2.0",method:u,params:f,id:this.id,keyword_params:p},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...Se},timeout:D,transformRequest:[(_,x)=>Xt(_)],transformResponse:[_=>_r(_,void 0,Hr)]})).data.result}catch(_){let x=new Error;throw _.response?(x.name=_.response.data.error.data.class,x.message=_.response.data.error.data.message,x.object=_.response.data.error):_.request?(x.name="Request error",x.message="Request error, no response received"):x=_,x}}decode_openc3_type(u){if(u!==null&&typeof u=="object"&&u.json_class=="Float"&&u.raw){if(u.raw=="NaN")return NaN;if(u.raw=="Infinity")return 1/0;if(u.raw=="-Infinity")return-1/0}return null}encode_openc3_type(u){return Number.isNaN(u)?{json_class:"Float",raw:"NaN"}:u==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:u==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(u=>{u&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(u){return this.exec("set_offline_access",[u])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(u,f){return this.exec("map_target_to_interface",[u,f])}connect_interface(u,...f){return f.length>0?this.exec("connect_interface",[u,...f]):this.exec("connect_interface",[u])}disconnect_interface(u){return this.exec("disconnect_interface",[u])}interface_cmd(u,f,...p){return this.exec("interface_cmd",[u,f,...p])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(u){return this.exec("connect_router",[u])}disconnect_router(u){return this.exec("disconnect_router",[u])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(u){return this.exec("get_tlm_cnts",[u])}get_item(u,f,p){return this.exec("get_item",[u,f,p])}get_param(u,f,p){return this.exec("get_param",[u,f,p])}get_parameter(u,f,p){return this.exec("get_param",[u,f,p])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(u){return this.exec("set_limits_set",[u])}get_target(u){return this.exec("get_target",[u])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(u,f){return this.exec("get_tlm",[u,f])}get_telemetry(u,f){return this.exec("get_tlm",[u,f])}get_all_tlm(u){return this.exec("get_all_tlm",[u])}get_all_telemetry(u){return this.exec("get_all_tlm",[u])}get_all_tlm_names(u,f=!1){return this.exec("get_all_tlm_names",[u],{hidden:f})}get_all_telemetry_names(u){return this.exec("get_all_tlm_names",[u])}get_all_tlm_item_names(u){return this.exec("get_all_tlm_item_names",[u])}async get_tlm_packet(u,f,p,Se=30){const D=await this.exec("get_tlm_packet",[u,f],{type:p,stale_time:Se});if(D!=null){let _=D.length,x=null;for(let a=0;a<_;a++)x=this.decode_openc3_type(D[a][1]),x!==null&&(D[a][1]=x)}return D}get_packet_derived_items(u,f){return this.exec("get_packet_derived_items",[u,f])}get_tlm_buffer(u,f){return this.exec("get_tlm_buffer",[u,f])}async get_tlm_values(u,f=30,p=null){let Se={stale_time:f};p!==null&&(Se.cache_timeout=p);const D=await this.exec("get_tlm_values",[u],Se,{},1e4);let _=D[0].length,x=null;for(let a=0;a<_;a++)x=this.decode_openc3_type(D[0][a]),x!==null&&(D[0][a]=x);return D}get_limits(u,f,p){return this.exec("get_limits",[u,f,p])}async tlm(u,f,p,Se="CONVERTED"){let D=null;if(f===void 0)D=await this.exec("tlm",[u]);else if(p===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(f))D=await this.exec("tlm",[u],{type:f});else{let x=new Error;throw x.name="TypeError",x.message=`Invalid data type ${f}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,x}else D=await this.exec("tlm",[u,f,p],{type:Se});let _=this.decode_openc3_type(D);return _!==null&&(D=_),D}async inject_tlm(u,f,p=null,Se="CONVERTED"){await this.exec("inject_tlm",[u,f,p],{type:Se})}set_tlm(u,f,p,Se){return this.exec("set_tlm",[u,f,p],{type:Se})}override_tlm(u,f,p,Se){return this.exec("override_tlm",[u,f,p],{type:Se})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(u,f,p,Se){return this.exec("normalize_tlm",[u,f,p],{type:Se})}get_all_cmds(u){return this.exec("get_all_cmds",[u])}get_all_commands(u){return this.exec("get_all_cmds",[u])}get_all_cmd_names(u,f=!1){return this.exec("get_all_cmd_names",[u],{hidden:f})}get_all_command_names(u){return this.exec("get_all_cmd_names",[u])}get_cmd(u,f){return this.exec("get_cmd",[u,f])}get_command(u,f){return this.exec("get_cmd",[u,f])}get_cmd_cnts(u){return this.exec("get_cmd_cnts",[u])}get_cmd_value(u,f,p,Se="CONVERTED"){return this.exec("get_cmd_value",[u,f,p,Se])}get_cmd_buffer(u,f){return this.exec("get_cmd_buffer",[u,f])}_cmd(u,f,p,Se,D){let _=null;for(let x in Se)Object.prototype.hasOwnProperty.call(Se,x)&&(_=this.encode_openc3_type(Se[x]),_!==null&&(Se[x]=_));return this.exec(u,[f,p,Se],{},D)}get_cmd_hazardous(u,f,p,Se={}){return f===void 0?this.exec("get_cmd_hazardous",u,{},Se):this._cmd("get_cmd_hazardous",u,f,p,Se)}cmd(u,f,p,Se={}){return f===void 0?this.exec("cmd",u,{},Se):this._cmd("cmd",u,f,p,Se)}cmd_no_range_check(u,f,p,Se={}){return f===void 0?this.exec("cmd_no_range_check",u,{},Se):this._cmd("cmd_no_range_check",u,f,p,Se)}cmd_raw(u,f,p,Se={}){return f===void 0?this.exec("cmd_raw",u,{},Se):this._cmd("cmd_raw",u,f,p,Se)}cmd_raw_no_range_check(u,f,p,Se={}){return f===void 0?this.exec("cmd_raw_no_range_check",u,{},Se):this._cmd("cmd_raw_no_range_check",u,f,p,Se)}cmd_no_hazardous_check(u,f,p,Se={}){return f===void 0?this.exec("cmd_no_hazardous_check",u,{},Se):this._cmd("cmd_no_hazardous_check",u,f,p,Se)}cmd_no_checks(u,f,p,Se={}){return f===void 0?this.exec("cmd_no_checks",u,{},Se):this._cmd("cmd_no_checks",u,f,p,Se)}cmd_raw_no_hazardous_check(u,f,p,Se={}){return f===void 0?this.exec("cmd_raw_no_hazardous_check",u,{},Se):this._cmd("cmd_raw_no_hazardous_check",u,f,p,Se)}cmd_raw_no_checks(u,f,p,Se={}){return f===void 0?this.exec("cmd_raw_no_checks",u,{},Se):this._cmd("cmd_raw_no_checks",u,f,p,Se)}build_cmd(u,f,p){return f===void 0?this.exec("build_cmd",u):this._cmd("build_cmd",u,f,p)}build_command(u,f,p){return f===void 0?this.exec("build_cmd",u):this._cmd("build_cmd",u,f,p)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(u,f){return this.exec("send_raw",[u,f])}list_configs(u){return this.exec("list_configs",[u])}load_config(u,f){return this.exec("load_config",[u,f])}save_config(u,f,p){return this.exec("save_config",[u,f,p])}delete_config(u,f){return this.exec("delete_config",[u,f])}enable_limits(u,f,p){return this.exec("enable_limits",[u,f,p])}disable_limits(u,f,p){return this.exec("disable_limits",[u,f,p])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(u){return this.exec("get_overall_limits_state",[u])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(u){return this.exec("get_setting",[u])}get_settings(u){return this.exec("get_settings",u)}set_setting(u,f){return this.exec("set_setting",[u,f])}update_news(){return this.exec("update_news",[])}save_setting(u,f){return this.exec("set_setting",[u,f])}get_metrics(){return this.exec("get_metrics",[])}async hashString(u){if(window.isSecureContext){const f=new TextEncoder().encode(u),p=await crypto.subtle.digest("SHA-256",f),Se=new Uint8Array(p);return Array.from(Se).map(D=>D.toString(16).padStart(2,"0")).join("")}}}const Utilities={methods:{isFloat(c){return!!(/^\s*[-+]?\d*\.\d+\s*$/.test(c)||/^\s*[-+]?(\d+((\.\d+)?)|(\.\d+))[eE][-+]?\d+\s*$/.test(c))},isInt(c){return!!(/^\s*[-+]?\d+\s*$/.test(c)||/^\s*0[xX][\dabcdefABCDEF]+\s*$/.test(c))},isArray(c){return!!/^\s*\[.*\]\s*$/.test(c)},removeQuotes(c){if(c.length<2)return c;let u=c.charAt(0);if(u!=='"'&&u!=="'")return c;let f=c.charAt(c.length-1);return u!==f?c:c.slice(1,-1)},convertToString(c){let u=0,f="";if(Object.prototype.toString.call(c).slice(8,-1)==="Array"){let p=c.length;for(f="[ ",u=0;u<p;u++)Object.prototype.toString.call(c[u]).slice(8,-1)==="String"?f+='"'+c[u]+'"':f+=c[u],u!==p-1&&(f+=", ");f+=" ]"}else if(Object.prototype.toString.call(c).slice(8,-1)==="Object")if(c.json_class==="String"&&c.raw)for(f="0x",u=0;u<c.raw.length;u++){let p=c.raw[u].toString(16).toUpperCase();p.length<2&&(p="0"+p),f+=p}else c.json_class==="Float"&&c.raw&&(f=c.raw);else f=String(c);return f}}},_sfc_main$1={mixins:[Utilities],props:{modelValue:{type:[String,Number],default:void 0},states:{type:Object,default:()=>null},statesInHex:{type:Boolean,default:!1}},computed:{textFieldValue(){return this.convertToString(this.modelValue)},stateValue(){return this.statesInHex?"0x"+this.modelValue.toString(16):this.modelValue},selectValue(){return this.modelValue===""?null:this.modelValue},stateOptions(){return this.states?Object.keys(this.states).map(c=>({label:c,...this.states[c]})):null},hazardous(){var c,u;return((u=(c=Object.entries(this.states).find(([f,p])=>p.value===this.modelValue))==null?void 0:c.at(1))==null?void 0:u.hazardous)!==void 0},stateClass(){return this.hazardous?"hazardous mr-4":"mr-4"}},methods:{handleChange(c){this.$emit("update:modelValue",c)}}},_hoisted_1$1={key:1,class:"d-flex align-center"};function _sfc_render$1(c,u,f,p,Se,D){const _=resolveComponent("v-text-field"),x=resolveComponent("v-select");return openBlock(),createElementBlock("div",null,[f.states?(openBlock(),createElementBlock("div",_hoisted_1$1,[createVNode(x,{items:D.stateOptions,"model-value":D.selectValue,"onUpdate:modelValue":D.handleChange,"item-title":"label",class:normalizeClass(D.stateClass),"hide-details":"",density:"compact",variant:"outlined",placeholder:"Select...","min-width":"120px","data-test":"cmd-param-select"},null,8,["items","model-value","onUpdate:modelValue","class"]),createVNode(_,{"model-value":D.stateValue,disabled:"","hide-details":"",density:"compact",variant:"outlined","min-width":"60px","data-test":"cmd-param-value"},null,8,["model-value"])])):(openBlock(),createBlock(_,{key:0,"model-value":D.textFieldValue,"onUpdate:modelValue":D.handleChange,"hide-details":"",density:"compact",variant:"filled","data-test":"cmd-param-value"},null,8,["model-value","onUpdate:modelValue"]))])}const CommandParameterEditor=_export_sfc(_sfc_main$1,[["render",_sfc_render$1],["__scopeId","data-v-b19a55d5"]]),_sfc_main={components:{DetailsDialog:P,CriticalCmdDialog:N,TargetPacketItemChooser:we$1,CommandParameterEditor,TopBar:Z$1,Openc3Screen:Ie$1},mixins:[Utilities],data(){return{title:"Command Sender",search:"",headers:[{title:"Name",value:"parameter_name"},{title:"Value or State",value:"val"},{title:"Units",value:"units"},{title:"Range",value:"range"},{title:"Description",value:"description"}],editor:null,targetName:"",commandName:"",commandDescription:"",paramList:"",lastTargetName:"",lastCommandName:"",lastParamList:"",ignoreRangeChecks:!1,statesInHex:!1,showIgnoredParams:!1,cmdRaw:!1,ignoredParams:[],rows:[],interfaces:[],selectedInterface:"",rawCmdFile:null,status:"",history:"",hazardousCommand:"",displaySendHazardous:!1,displayErrorDialog:!1,displaySendRaw:!1,displayCriticalCmd:!1,criticalCmdUuid:null,criticalCmdString:null,criticalCmdUser:null,sendDisabled:!1,api:null,viewDetails:!1,contextMenuShown:!1,parameterName:"",reservedItemNames:[],x:0,y:0,contextMenuOptions:[{title:"Details",action:()=>{this.contextMenuShown=!1,this.viewDetails=!0}}],keywords:[],screenTarget:null,screenName:null,screenDefinition:null,screenCount:0}},computed:{menus:function(){return[{label:"Mode",items:[{label:"Ignore Range Checks",checkbox:!0,checked:this.ignoreRangeChecks,command:()=>{this.ignoreRangeChecks=!this.ignoreRangeChecks}},{label:"Display State Values in Hex",checkbox:!0,checked:this.statesInHex,command:()=>{this.statesInHex=!this.statesInHex}},{label:"Show Ignored Parameters",checkbox:!0,checked:this.showIgnoredParams,command:()=>{this.showIgnoredParams=!this.showIgnoredParams,this.updateCmdParams()}},{label:"Disable Parameter Conversions",checkbox:!0,checked:this.cmdRaw,command:()=>{this.cmdRaw=!this.cmdRaw.checked}}]}]}},created(){li.get("/openc3-api/autocomplete/reserved-item-names").then(c=>{this.reservedItemNames=c.data}),this.api=new pi,this.$route.params.target&&this.$route.params.packet&&this.commandChanged({targetName:this.$route.params.target.toUpperCase(),packetName:this.$route.params.packet.toUpperCase()}),li.get("/openc3-api/autocomplete/keywords/screen").then(c=>{this.keywords=c.data})},mounted(){this.editor=aceExports.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight"),this.editor.session.setMode("ace/mode/ruby"),this.editor.session.setTabSize(2),this.editor.session.setUseWrapMode(!0),this.editor.setHighlightActiveLine(!1),this.editor.setValue(localStorage.command_sender__history),this.history=this.editor.getValue().trim(),this.editor.clearSelection(),this.editor.focus(),this.editor.setAutoScrollEditorIntoView(!0),this.editor.setOption("maxLines",30),this.editor.setOption("minLines",1),this.editor.container.addEventListener("keydown",c=>{if(c.key==="Enter"){c.preventDefault();let u=this.editor.session.getLine(this.editor.getCursorPosition().row);if(u==="")return;let f=u.indexOf('"'),p=u.lastIndexOf('"');u=u.substr(f+1,p-f-1),this.sendCmd(u)}})},beforeUnmount(){this.editor.destroy(),this.editor.container.remove()},methods:{showContextMenu(c,u){c.preventDefault(),this.parameterName=u.item.parameter_name,this.contextMenuShown=!1,this.x=c.clientX,this.y=c.clientY,this.$nextTick(()=>{this.contextMenuShown=!0})},convertToValue(param){if(param.val!==void 0&¶m.states&&!this.cmdRaw)return Object.keys(param.states).find(c=>param.states[c].value===param.val);if(typeof param.val!="string")return param.val;let str=param.val,quotesRemoved=this.removeQuotes(str);if(str===quotesRemoved){let upcaseStr=str.toUpperCase();if((param.type==="STRING"||param.type==="BLOCK")&&upcaseStr.startsWith("0X")){let c=upcaseStr.slice(2);c.length%2!==0&&(c="0"+c);let u={json_class:"String",raw:[]};for(let f=0;f<c.length;f+=2){let p=c.charAt(f)+c.charAt(f+1);u.raw.push(parseInt(p,16))}return u}else return upcaseStr==="INFINITY"?1/0:upcaseStr==="-INFINITY"?-1/0:upcaseStr==="NAN"?NaN:this.isFloat(str)?parseFloat(str):this.isInt(str)?Number.isSafeInteger(Number(str))?parseInt(str):BigInt(str):this.isArray(str)?eval(str):str}else return quotesRemoved},commandChanged(c){(this.targetName!==c.targetName||this.commandName!==c.packetName)&&(this.targetName=c.targetName,this.commandName=c.packetName,this.sendDisabled===!1&&this.updateCmdParams(),this.$router.replace({name:"CommandSender",params:{target:this.targetName,packet:this.commandName}}).catch(u=>{}))},updateCmdParams(){this.sendDisabled=!0,this.ignoredParams=[],this.rows=[],this.api.get_target(this.targetName).then(c=>(this.ignoredParams=c.ignored_parameters,this.api.get_cmd(this.targetName,this.commandName)),c=>{this.displayError("getting ignored parameters",c),this.sendDisabled=!1}).then(c=>{if(c.items.forEach(u=>{if(!this.reservedItemNames.includes(u.name)&&(!this.ignoredParams.includes(u.name)||this.showIgnoredParams)){let f=u.default;!u.states&&u.data_type==="STRING"&&typeof u.default=="string"&&(f=`'${f}'`),u.required&&(f=""),u.format_string&&(f=sprintf(u.format_string,u.default));let p="N/A";u.minimum!=null&&u.maximum!=null&&(u.data_type==="FLOAT"&&(u.minimum<-1e6&&Number.isSafeInteger(u.minimum)&&(u.minimum=u.minimum.toExponential(3)),u.maximum>1e6&&Number.isSafeInteger(u.maximum)&&(u.maximum=u.maximum.toExponential(3))),p=`${u.minimum}..${u.maximum}`),this.rows.push({parameter_name:u.name,val:f,states:u.states,description:u.description,range:p,units:u.units,type:u.data_type})}}),c.screen)this.loadScreen(c.screen[0],c.screen[1]).then(u=>{this.screenTarget=c.screen[0],this.screenName=c.screen[1],this.screenDefinition=u.data,this.screenCount+=1});else{if(c.related_items){this.screenTarget="LOCAL",this.screenName="CMDSENDER";let u=`SCREEN AUTO AUTO 1.0
|
1123
|
+
`;for(const f of c.related_items)u+=`LABELVALUE '${f[0]}' '${f[1]}' '${f[2]}' WITH_UNITS 20
|
1124
|
+
`;this.screenDefinition=u}else this.screenTarget=null,this.screenName=null,this.screenDefinition=null;this.screenCount+=1}this.commandDescription=c.description,this.sendDisabled=!1,this.status=""},c=>{this.displayError("getting command parameters",c),this.sendDisabled=!1})},createParamList(){let c={};for(const u of this.rows)c[u.parameter_name]=this.convertToValue(u);return c},buildCmd(){this.sendCmd(this.targetName,this.commandName,this.createParamList())},sendCmd(c,u,f){this.lastTargetName=c,this.lastCommandName=u,this.lastParamList=f,this.sendDisabled=!0;let p=!1,Se="";this.api.get_cmd_hazardous(c,u,f).then(D=>{if(p=D,p)u===void 0?this.hazardousCommand=c.split(" ").slice(0,2).join(" "):this.hazardousCommand=`${c} ${u}`,this.displaySendHazardous=!0;else{let _;this.cmdRaw?this.ignoreRangeChecks?(Se="cmd_raw_no_range_check",_=this.api.cmd_raw_no_range_check(c,u,f,{"Ignore-Errors":"428"})):(Se="cmd_raw",_=this.api.cmd_raw(c,u,f,{"Ignore-Errors":"428 500"})):this.ignoreRangeChecks?(Se="cmd_no_range_check",_=this.api.cmd_no_range_check(c,u,f,{"Ignore-Errors":"428"})):(Se="cmd",_=this.api.cmd(c,u,f,{"Ignore-Errors":"428 500"})),_.then(x=>{this.processCmdResponse(!0,c,u,Se,x)},x=>{this.processCmdResponse(!1,c,u,Se,x)})}},D=>{this.processCmdResponse(!1,c,u,Se,D)})},sendHazardousCmd(){this.displaySendHazardous=!1;let c="",u="";this.cmdRaw?this.ignoreRangeChecks?(u="cmd_raw_no_range_check",c=this.api.cmd_raw_no_checks(this.lastTargetName,this.lastCommandName,this.lastParamList,{"Ignore-Errors":"428"})):(u="cmd_raw",c=this.api.cmd_raw_no_hazardous_check(this.lastTargetName,this.lastCommandName,this.lastParamList,{"Ignore-Errors":"428 500"})):this.ignoreRangeChecks?(u="cmd_no_range_check",c=this.api.cmd_no_checks(this.lastTargetName,this.lastCommandName,this.lastParamList,{"Ignore-Errors":"428"})):(u="cmd",c=this.api.cmd_no_hazardous_check(this.lastTargetName,this.lastCommandName,this.lastParamList,{"Ignore-Errors":"428 500"})),c.then(f=>{this.processCmdResponse(!0,this.lastTargetName,this.lastCommandName,u,f)},f=>{this.processCmdResponse(!1,this.lastTargetName,this.lastCommandName,u,f)})},cancelHazardousCmd(){this.displaySendHazardous=!1,this.status="Hazardous command not sent",this.sendDisabled=!1},processCmdResponse(c,u,f,p,Se){f===void 0&&([u,f]=u.split(" ").slice(0,2));let D="";if(c){D=`${p}("${Se[0]} ${Se[1]}`;let _=Object.keys(Se[2]);if(_.length>0){D+=" with ";for(let x=0;x<_.length;x++){let a=_[x],h=this.convertToString(Se[2][a]);typeof Se[2][a]=="string"&&h.charAt(0)!=="'"&&h.charAt(0)!=='"'&&(h=`'${h}'`),D+=a+" "+h,x<_.length-1&&(D+=", ")}}if(D+='")',!this.history.includes(D)){let x=D;this.history.length!==0&&(x+=`
|
1125
|
+
${this.history}`),this.editor.setValue(x),this.editor.moveCursorTo(0,0)}if(D+=" sent.",this.status.includes(D)){let x=this.status.split("sent.");if(x[1].includes("(")){let a=parseInt(x[1].substr(2,x[1].indexOf(")")-2));D=x[0]+"sent. ("+(a+1)+")"}else D+=" (2)"}this.status=D}else{let _="sending "+u+" "+f;this.displayError(_,Se,!0)}this.history=this.editor.getValue(),localStorage.command_sender__history=this.editor.getValue(),this.sendDisabled=!1},clearHistory(){this.editor.setValue(""),this.history="",localStorage.removeItem("command_sender__history")},displayError(c,u,f=!1){this.status=`Error ${c} due to ${u.name}`,u.message&&u.message!==""&&(this.status+=": ",this.status+=u.message),this.status.includes("CriticalCmdError")&&(this.status="Critical Command Queued For Approval"),f&&(u.message.includes("CriticalCmdError")?(this.criticalCmdUuid=u.object.data.instance_variables["@uuid"],this.criticalCmdString=u.object.data.instance_variables["@cmd_string"],this.criticalCmdUser=u.object.data.instance_variables["@username"],this.displayCriticalCmd=!0):this.displayErrorDialog=!0)},loadScreen(c,u){return li.get("/openc3-api/screen/"+c+"/"+u,{headers:{Accept:"text/plain"}})}}},_hoisted_1={style:{padding:"10px"}},_hoisted_2={class:"pa-3"},_hoisted_3={ref:"editor",class:"editor","data-test":"sender-history"},_hoisted_4={class:"mx-1"},_hoisted_5=["textContent"],_hoisted_6={class:"openc3-yellow"},_hoisted_7={class:"mx-1"};function _sfc_render(c,u,f,p,Se,D){const _=resolveComponent("top-bar"),x=resolveComponent("target-packet-item-chooser"),a=resolveComponent("v-spacer"),h=resolveComponent("v-text-field"),i=resolveComponent("v-card-title"),r=resolveComponent("command-parameter-editor"),o=resolveComponent("v-data-table"),t=resolveComponent("v-card"),e=resolveComponent("v-col"),n=resolveComponent("v-btn"),s=resolveComponent("v-tooltip"),g=resolveComponent("v-row"),m=resolveComponent("v-card-subtitle"),A=resolveComponent("openc3-screen"),E=resolveComponent("v-list-item-title"),S=resolveComponent("v-list-item"),C=resolveComponent("v-list"),q=resolveComponent("v-menu"),Be=resolveComponent("details-dialog"),se=resolveComponent("critical-cmd-dialog"),j=resolveComponent("v-toolbar"),ct=resolveComponent("v-card-text"),G=resolveComponent("v-dialog"),U=resolveComponent("v-card-actions"),b=resolveComponent("v-select");return openBlock(),createElementBlock("div",null,[createVNode(_,{menus:D.menus,title:Se.title},null,8,["menus","title"]),createVNode(t,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_1,[createVNode(x,{"initial-target-name":c.$route.params.target,"initial-packet-name":c.$route.params.packet,disabled:Se.sendDisabled,"button-text":"Send",mode:"cmd",onOnSet:u[0]||(u[0]=w=>D.commandChanged(w)),onAddItem:u[1]||(u[1]=w=>D.buildCmd(w))},null,8,["initial-target-name","initial-packet-name","disabled"])]),Se.rows.length!==0?(openBlock(),createBlock(t,{key:0},{default:withCtx(()=>[createVNode(i,{class:"d-flex align-center justify-content-space-between"},{default:withCtx(()=>[u[12]||(u[12]=createTextVNode(" Parameters ")),createVNode(a),createVNode(h,{modelValue:Se.search,"onUpdate:modelValue":u[2]||(u[2]=w=>Se.search=w),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),createVNode(o,{headers:Se.headers,items:Se.rows,search:Se.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact","onContextmenu:row":D.showContextMenu},{"item.val":withCtx(({item:w})=>[createVNode(r,{modelValue:w.val,"onUpdate:modelValue":W=>w.val=W,states:w.states,"states-in-hex":Se.statesInHex},null,8,["modelValue","onUpdate:modelValue","states","states-in-hex"])]),_:1},8,["headers","items","search","onContextmenu:row"])]),_:1})):createCommentVNode("",!0),createElementVNode("div",_hoisted_2,"Status: "+toDisplayString(Se.status),1)]),_:1}),u[26]||(u[26]=createElementVNode("div",{style:{height:"15px"}},null,-1)),createVNode(g,{"no-gutters":""},{default:withCtx(()=>[createVNode(e,{class:"pr-4"},{default:withCtx(()=>[createVNode(t,{class:"pb-2"},{default:withCtx(()=>[createVNode(m,null,{default:withCtx(()=>[createVNode(g,null,{default:withCtx(()=>[createVNode(e,{class:"pt-6"},{default:withCtx(()=>u[13]||(u[13]=[createTextVNode(" Editable Command History: (Pressing Enter on the line re-executes the command) ")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createVNode(s,{"open-delay":600,location:"top"},{activator:withCtx(({props:w})=>[createElementVNode("div",mergeProps(w,{class:"float-right"}),[createVNode(n,{icon:"mdi-delete-sweep",variant:"text","data-test":"clear-history",onClick:D.clearHistory},null,8,["onClick"])],16)]),default:withCtx(()=>[u[14]||(u[14]=createElementVNode("span",null," Clear History ",-1))]),_:1})]),_:1})]),_:1})]),_:1}),createVNode(g,{"no-gutters":"",class:"mt-2 mb-2"},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>[createElementVNode("pre",_hoisted_3,null,512)]),_:1})]),_:1})]),_:1})]),_:1}),Se.screenDefinition?(openBlock(),createBlock(e,{key:0,md:"auto"},{default:withCtx(()=>[createVNode(A,{target:Se.screenTarget,screen:Se.screenName,definition:Se.screenDefinition,keywords:Se.keywords,count:Se.screenCount,"show-close":!1},null,8,["target","screen","definition","keywords","count"])]),_:1})):createCommentVNode("",!0)]),_:1}),u[27]||(u[27]=createElementVNode("div",{style:{height:"15px"}},null,-1)),createVNode(q,{modelValue:Se.contextMenuShown,"onUpdate:modelValue":u[3]||(u[3]=w=>Se.contextMenuShown=w),target:[Se.x,Se.y]},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(Se.contextMenuOptions,(w,W)=>(openBlock(),createBlock(S,{key:W,onClick:withModifiers(w.action,["stop"])},{default:withCtx(()=>[createVNode(E,null,{default:withCtx(()=>[createTextVNode(toDisplayString(w.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue","target"]),createVNode(Be,{modelValue:Se.viewDetails,"onUpdate:modelValue":u[4]||(u[4]=w=>Se.viewDetails=w),"target-name":Se.targetName,"packet-name":Se.commandName,"item-name":Se.parameterName,type:"cmd"},null,8,["modelValue","target-name","packet-name","item-name"]),createVNode(se,{modelValue:Se.displayCriticalCmd,"onUpdate:modelValue":u[5]||(u[5]=w=>Se.displayCriticalCmd=w),uuid:Se.criticalCmdUuid,"cmd-string":Se.criticalCmdString,"cmd-user":Se.criticalCmdUser},null,8,["modelValue","uuid","cmd-string","cmd-user"]),createVNode(G,{modelValue:Se.displayErrorDialog,"onUpdate:modelValue":u[7]||(u[7]=w=>Se.displayErrorDialog=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[15]||(u[15]=createElementVNode("span",null," Error ",-1)),createVNode(a)]),_:1}),createVNode(ct,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_4,[createVNode(g,{class:"my-2"},{default:withCtx(()=>[createVNode(ct,null,{default:withCtx(()=>[createElementVNode("span",{textContent:toDisplayString(Se.status)},null,8,_hoisted_5)]),_:1})]),_:1}),createVNode(g,null,{default:withCtx(()=>[createVNode(a),createVNode(n,{color:"primary","data-test":"error-dialog-ok",onClick:u[6]||(u[6]=w=>Se.displayErrorDialog=!1)},{default:withCtx(()=>u[16]||(u[16]=[createTextVNode(" Ok ")])),_:1})]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"]),createVNode(G,{modelValue:Se.displaySendHazardous,"onUpdate:modelValue":u[8]||(u[8]=w=>Se.displaySendHazardous=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[17]||(u[17]=createElementVNode("span",null," Hazardous Warning ",-1)),createVNode(a)]),_:1}),createVNode(ct,{class:"mt-6"},{default:withCtx(()=>[createTextVNode(" Warning: Command "+toDisplayString(Se.hazardousCommand)+" is Hazardous. Send? ",1),u[18]||(u[18]=createElementVNode("br",null,null,-1)),createElementVNode("span",_hoisted_6," Description: "+toDisplayString(Se.commandDescription),1)]),_:1}),createVNode(U,{class:"px-2"},{default:withCtx(()=>[createVNode(a),createVNode(n,{variant:"outlined",onClick:D.cancelHazardousCmd},{default:withCtx(()=>u[19]||(u[19]=[createTextVNode(" Cancel ")])),_:1},8,["onClick"]),createVNode(n,{variant:"flat",onClick:D.sendHazardousCmd},{default:withCtx(()=>u[20]||(u[20]=[createTextVNode(" Send ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),createVNode(G,{modelValue:Se.displaySendRaw,"onUpdate:modelValue":u[11]||(u[11]=w=>Se.displaySendRaw=w),"max-width":"600"},{default:withCtx(()=>[createVNode(t,null,{default:withCtx(()=>[createVNode(j,{height:"24"},{default:withCtx(()=>[createVNode(a),u[21]||(u[21]=createElementVNode("span",null," Send Raw ",-1)),createVNode(a)]),_:1}),createVNode(ct,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_7,[createVNode(g,{class:"my-2"},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>u[22]||(u[22]=[createTextVNode("Interface:")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createVNode(b,{modelValue:Se.selectedInterface,"onUpdate:modelValue":u[9]||(u[9]=w=>Se.selectedInterface=w),variant:"solo","hide-details":"",density:"compact",items:Se.interfaces,"item-title":"label","item-value":"value"},null,8,["modelValue","items"])]),_:1})]),_:1}),createVNode(g,{"no-gutters":""},{default:withCtx(()=>[createVNode(e,null,{default:withCtx(()=>u[23]||(u[23]=[createTextVNode("Filename:")])),_:1}),createVNode(e,null,{default:withCtx(()=>[createElementVNode("input",{type:"file",onChange:u[10]||(u[10]=w=>c.selectRawCmdFile(w))},null,32)]),_:1})]),_:1}),createVNode(g,null,{default:withCtx(()=>[createVNode(a),createVNode(n,{variant:"outlined","data-test":"raw-cancel",onClick:c.cancelRawCmd},{default:withCtx(()=>u[24]||(u[24]=[createTextVNode(" Cancel ")])),_:1},8,["onClick"]),createVNode(n,{class:"bg-primary","data-test":"raw-ok",onClick:c.sendRawCmd},{default:withCtx(()=>u[25]||(u[25]=[createTextVNode(" Ok ")])),_:1},8,["onClick"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const CommandSender=exports("default",_export_sfc(_sfc_main,[["render",_sfc_render],["__scopeId","data-v-80865e28"]]))}}});
|