{var i;return`${(i=t==null?void 0:t[o])!=null?i:`{${o}}`}`}),x$e=e=>{const t=ee(()=>M(e).name),n=ee(()=>g4(function(o){const i=o.replace(/(-[a-z])/g,function(a){return a.replace("-","").toLocaleUpperCase()});return dI(i)}(t.value||""))),r=Jn(e)?e:de(e);return{lang:t,name:n,locale:r,t:A$e(e)}},fI=e=>x$e(ee(()=>e.value||Vde)),ya=(e,t,n)=>t.map(r=>(r.label=e("props."+r.value)||r.label,r)),er=(e,t,n)=>n.map(r=>(r.field==="formCreate$required"?r.title=e("validate.required")||r.title:r.field&&r.field!=="_optionType"&&(r.title=e("com."+t+"."+r.field)||r.title),r.type==="template"&&Lr.trueArray(r.children)&&(r.children=er(e,t,r.children)),r)),pI=e=>{const t=[];return e&&e.forEach(n=>{if(n._fc_drag_tag){const r={id:n.__fc__.id,rule:n,children:pI(n.children)};r.children.length||delete r.children,t.push(r)}else t.push(...pI(n.children))}),t},$de=e=>{const t=n=>{const r=[];return n&&n.forEach(o=>{o.field?(o.children=t(o.children||[]),o.children.length||delete o.children,r.push(o)):r.push(...t(o.children||[]))}),r};return t(e)},Ude=e=>{const t=n=>{const r=[];return n&&n.forEach(o=>{if(typeof o=="object")if(o._fc_drag_tag){const i={_fc_id:o._fc_id,type:o.type,field:o.field,title:o.title,name:o.name,slot:o.slot,props:{...o.props||{}},children:t(o.children||[])};o.children&&typeof o.children[0]=="string"&&(i.content=o.children[0]),i.children.length||delete i.children,r.push(i)}else r.push(...t(o.children))}),r};return t(e)};function Wde(e){return{name:"$inject",columns:[{label:"$inject.api",info:e("event.inject.api"),type:"Api"},{label:"$inject.rule",info:e("event.inject.rule"),type:"Rule[]"},{label:"$inject.self",info:e("event.inject.self"),type:"Rule"},{label:"$inject.option",info:e("event.inject.option"),type:"Object"},{label:"$inject.args",info:e("event.inject.args"),type:"Array"}]}}function Eg(e){return["",null,void 0].indexOf(e)!==-1}function Gde({t:e}){return[{type:"input",field:">formName",value:"",title:e("form.formName")},{type:"radio",field:"labelPosition",value:"left",title:e("form.labelPosition"),options:ya(e,[{value:"left",label:"left"},{value:"right",label:"right"},{value:"top",label:"top"}])},{type:"radio",field:"size",value:"small",title:e("form.size"),options:ya(e,[{value:"large",label:"large"},{value:"default",label:"default"},{value:"small",label:"small"}])},{type:"input",field:"labelSuffix",value:"",title:e("form.labelSuffix"),style:{width:"150px"}},{type:"SizeInput",field:"labelWidth",value:"125px",title:e("form.labelWidth")},{type:"switch",field:"hideRequiredAsterisk",value:!1,title:e("form.hideRequiredAsterisk")},{type:"switch",field:"showMessage",value:!0,title:e("form.showMessage")},{type:"switch",field:"inlineMessage",value:!1,title:e("form.inlineMessage")},{type:"switch",field:"_submitBtn>show",value:!0,title:e("form.submitBtn")},{type:"switch",field:"_resetBtn>show",value:!1,title:e("form.resetBtn")},{type:"FnConfig",field:">_event",info:{type:"tooltip",native:!0,effect:"light",align:"left",content:e("form.document")+'\uFF1Ahttps://form-create.com/v3/guide/global-event',rawContent:!0},value:{},col:{show:!0},props:{eventConfig:[{name:"onSubmit",args:["formData","api"]},{name:"onCreated",args:["api"]},{name:"onMounted",args:["api"]},{name:"onChange",args:["field","value","options"]},{name:"beforeFetch",args:["config","data"]}]},title:e("form.event")}]}function y4({t:e}){return[{type:"FieldInput",field:"field",value:"",title:e("form.field")},{type:"input",field:"title",value:"",title:e("form.title")},{type:"input",field:"info",value:"",title:e("form.info")},{type:"SizeInput",field:"formCreateWrap>labelWidth",value:"",title:e("form.labelWidth")},{type:"Struct",field:"_control",value:[],title:e("form.control"),info:{type:"tooltip",native:!0,effect:"light",align:"left",content:e("form.document")+'\uFF1Ahttps://form-create.com/v3/guide/control',rawContent:!0},props:{defaultValue:[],validate:t=>!!Array.isArray(t)&&(!t.length||!t.some(({rule:n})=>!Array.isArray(n)))}}]}function qde({t:e}){return[{type:"Required",field:"$required",title:e("validate.required")},{type:"validate",field:"validate",title:e("validate.rule"),value:[]}]}function _$e(e){e=e||new Map;const t={$on(n,r){const o=e.get(n);o&&o.push(r)||e.set(n,[r])},$once(n,r){r._once=!0,t.$on(n,r)},$off(n,r){const o=e.get(n);o&&o.splice(o.indexOf(r)>>>0,1)},$emit(n,...r){(e.get(n)||[]).slice().map(o=>{o._once&&(t.$off(n,o),delete o._once),o(...r)}),(e.get("*")||[]).slice().map(o=>{o(n,r)})}};return t}let E$e=0;function vr(){const e=370+ ++E$e;return"F"+Math.random().toString(36).substr(3,3)+(+`${Date.now()}`).toString(36)+e.toString(36)+"c"}const hI="radio",C$e={menu:"main",icon:"icon-radio",label:"\u5355\u9009\u6846",name:hI,event:["change"],validate:["string","number"],rule:({t:e})=>({type:hI,field:vr(),title:e("com.radio.name"),info:"",effect:{fetch:""},$required:!1,props:{},options:fp(e("props.option"),{label:"label",value:"value"},1)}),props:(e,{t})=>er(t,hI+".props",[kx(t,"options"),{type:"switch",field:"disabled"},{type:"switch",field:"type",props:{activeValue:"button",inactiveValue:"default"}},{type:"ColorInput",field:"textColor"},{type:"ColorInput",field:"fill"}])},vI="checkbox",S$e={menu:"main",icon:"icon-checkbox",label:"\u591A\u9009\u6846",name:vI,event:["change"],validate:["array"],rule:({t:e})=>({type:vI,field:vr(),title:e("com.checkbox.name"),info:"",effect:{fetch:""},$required:!1,props:{},options:fp(e("props.option"),{label:"label",value:"value"},1)}),props:(e,{t})=>er(t,vI+".props",[kx(t,"options"),{type:"switch",field:"disabled"},{type:"switch",field:"type",props:{activeValue:"button",inactiveValue:"default"}},{field:"min",type:"inputNumber",props:{min:0}},{field:"max",type:"inputNumber",props:{min:0}},{type:"ColorInput",field:"textColor"},{type:"ColorInput",field:"fill"}])},mI="input",k$e={menu:"main",icon:"icon-input",label:"\u8F93\u5165\u6846",name:mI,event:["blur","focus","change","input","clear"],validate:["string","url","email"],rule:({t:e})=>({type:mI,field:vr(),title:e("com.input.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,mI+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"readonly"},{type:"inputNumber",field:"maxlength",props:{min:0}},{type:"inputNumber",field:"minlength",props:{min:0}},{type:"input",field:"placeholder"},{type:"switch",field:"clearable"}])},Kde="textarea",D$e={menu:"main",icon:"icon-textarea",label:"\u591A\u884C\u8F93\u5165\u6846",name:Kde,event:["blur","focus","change","input"],validate:["string"],rule:({t:e})=>({type:"input",field:vr(),title:e("com.textarea.name"),info:"",$required:!1,props:{type:"textarea"}}),props:(e,{t})=>er(t,Kde+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"readonly"},{type:"inputNumber",field:"maxlength",props:{min:0}},{type:"inputNumber",field:"minlength",props:{min:0}},{type:"switch",field:"showWordLimit"},{type:"input",field:"placeholder"},{type:"inputNumber",field:"rows",props:{min:0}},{type:"switch",field:"autosize"}])},Yde="password",O$e={menu:"main",icon:"icon-password",label:"\u5BC6\u7801\u8F93\u5165\u6846",name:Yde,event:["blur","focus","change","input","clear"],validate:["string"],rule:({t:e})=>({type:"input",field:vr(),title:e("com.password.name"),info:"",$required:!1,props:{type:"password"}}),props:(e,{t})=>er(t,Yde+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"readonly"},{type:"inputNumber",field:"maxlength",props:{min:0}},{type:"inputNumber",field:"minlength",props:{min:0}},{type:"input",field:"placeholder"},{type:"switch",field:"clearable"}])},gI="inputNumber",T$e={menu:"main",icon:"icon-number",label:"\u8BA1\u6570\u5668",name:gI,event:["blur","focus","change"],validate:["number","integer","float"],rule:({t:e})=>({type:gI,field:vr(),title:e("com.inputNumber.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,gI+".props",[{type:"switch",field:"disabled"},{type:"inputNumber",field:"min"},{type:"inputNumber",field:"max"},{type:"inputNumber",field:"step",props:{min:0}},{type:"switch",field:"stepStrictly"},{type:"switch",field:"controls",value:!0},{type:"select",field:"controlsPosition",options:ya(t,[{label:"default",value:""},{label:"right",value:"right"}])},{type:"input",field:"placeholder"}])},yI="select",M$e={menu:"main",icon:"icon-select",label:"\u9009\u62E9\u5668",name:yI,event:["change","visibleChange","removeTag","clear","blur","focus"],validate:["string","number","array"],rule:({t:e})=>({type:yI,field:vr(),title:e("com.select.name"),info:"",effect:{fetch:""},$required:!1,props:{},options:fp(e("props.option"),{label:"label",value:"value"},1)}),watch:{multiple({rule:e}){e.key=vr()}},props:(e,{t})=>er(t,yI+".props",[kx(t,"options"),{type:"switch",field:"multiple"},{type:"switch",field:"disabled"},{type:"switch",field:"clearable"},{type:"switch",field:"collapseTags"},{type:"inputNumber",field:"multipleLimit",props:{min:0}},{type:"input",field:"placeholder"},{type:"switch",field:"filterable"},{type:"switch",field:"remote"},{type:"FnEditor",field:"remoteMethod",props:{body:!0,button:!0,fnx:!0,name:"remoteMethod",args:[Wde(t)]}},{type:"switch",field:"allowCreate"},{type:"input",field:"noMatchText"},{type:"input",field:"noDataText"},{type:"switch",field:"reserveKeyword"},{type:"switch",field:"defaultFirstOption"}])},bI="switch",N$e={menu:"main",icon:"icon-switch",label:"\u5F00\u5173",name:bI,event:["change"],rule:({t:e})=>({type:bI,field:vr(),title:e("com.switch.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,bI+".props",[{type:"switch",field:"disabled"},{type:"inputNumber",field:"width",props:{min:0}},{type:"input",field:"activeText"},{type:"input",field:"inactiveText"},{type:"input",field:"activeValue"},{type:"input",field:"inactiveValue"},{type:"ColorInput",field:"activeColor"},{type:"ColorInput",field:"inactiveColor"}])},AI="slider",F$e={menu:"main",icon:"icon-slider",label:"\u6ED1\u5757",name:AI,event:["change","input"],validate:["number","array"],rule:({t:e})=>({type:AI,field:vr(),title:e("com.slider.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,AI+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"range"},{type:"inputNumber",field:"min",props:{min:0}},{type:"inputNumber",field:"max",props:{min:0}},{type:"inputNumber",field:"step",props:{min:0}},{type:"switch",field:"showInput"},{type:"switch",field:"showInputControls",value:!0},{type:"switch",field:"showStops"},{type:"switch",field:"vertical"},{type:"input",field:"height"}])},wI="timePicker",R$e={menu:"main",icon:"icon-time",label:"\u65F6\u95F4",name:wI,event:["change","blur","focus","visibleChange"],rule:({t:e})=>({type:wI,field:vr(),title:e("com.timePicker.name"),info:"",$required:!1,props:{}}),watch:{isRange({rule:e}){e.key=vr()}},props:(e,{t})=>er(t,wI+".props",[{type:"switch",field:"readonly"},{type:"switch",field:"disabled"},{type:"switch",field:"isRange"},{type:"switch",field:"clearable",value:!0},{type:"Struct",field:"pickerOptions",props:{defaultValue:{}}},{type:"switch",field:"editable",value:!0},{type:"input",field:"placeholder"},{type:"input",field:"startPlaceholder"},{type:"input",field:"endPlaceholder"},{type:"switch",field:"arrowControl"},{type:"select",field:"align",options:ya(t,[{label:"left",value:"left"},{label:"center",value:"center"},{label:"right",value:"right"}])}])},I$e={menu:"main",icon:"icon-time",label:"\u65F6\u95F4\u533A\u95F4",name:"timeRange",event:["change","blur","focus","visibleChange"],rule:({t:e})=>({type:"timePicker",field:vr(),title:e("com.timeRange.name"),info:"",$required:!1,props:{isRange:!0}}),props:(e,{t})=>er(t,"timePicker.props",[{type:"switch",field:"readonly"},{type:"switch",field:"disabled"},{type:"switch",field:"clearable",value:!0},{type:"Struct",field:"pickerOptions",props:{defaultValue:{}}},{type:"switch",field:"editable",value:!0},{type:"input",field:"startPlaceholder"},{type:"input",field:"endPlaceholder"},{type:"switch",field:"arrowControl"},{type:"select",field:"align",options:ya(t,[{label:"left",value:"left"},{label:"center",value:"center"},{label:"right",value:"right"}])}])},xI="datePicker",B$e={menu:"main",icon:"icon-date",label:"\u65E5\u671F",name:xI,event:["change","blur","focus","calendarChange","panelChange","visibleChange"],rule:({t:e})=>({type:xI,field:vr(),title:e("com.datePicker.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,xI+".props",[{type:"switch",field:"readonly"},{type:"switch",field:"disabled"},{type:"select",field:"type",options:ya(t,[{label:"year",value:"year"},{label:"month",value:"month"},{label:"date",value:"date"},{label:"dates",value:"dates"},{label:"week",value:"week"},{label:"datetime",value:"datetime"},{label:"datetimerange",value:"datetimerange"},{label:"daterange",value:"daterange"},{label:"monthrange",value:"monthrange"}])},{type:"switch",field:"clearable",value:!0},{type:"Struct",field:"pickerOptions",props:{defaultValue:{}}},{type:"switch",field:"editable",value:!0},{type:"input",field:"placeholder"},{type:"input",field:"startPlaceholder"},{type:"input",field:"endPlaceholder"},{type:"input",field:"format"},{type:"select",field:"align",options:ya(t,[{label:"left",value:"left"},{label:"center",value:"center"},{label:"right",value:"right"}])},{type:"input",field:"rangeSeparator"},{type:"switch",field:"unlinkPanels"}])},L$e={menu:"main",icon:"icon-date",label:"\u65E5\u671F\u533A\u95F4",name:"dateRange",event:["change","blur","focus","calendarChange","panelChange","visibleChange"],rule:({t:e})=>({type:"datePicker",field:vr(),title:e("com.dateRange.name"),info:"",$required:!1,props:{type:"datetimerange"}}),props:(e,{t})=>er(t,"datePicker.props",[{type:"switch",field:"readonly"},{type:"switch",field:"disabled"},{type:"select",field:"type",options:ya(t,[{label:"datetimerange",value:"datetimerange"},{label:"daterange",value:"daterange"},{label:"monthrange",value:"monthrange"}])},{type:"switch",field:"clearable",value:!0},{type:"Struct",field:"pickerOptions",props:{defaultValue:{}}},{type:"switch",field:"editable",value:!0},{type:"input",field:"startPlaceholder"},{type:"input",field:"endPlaceholder"},{type:"input",field:"format"},{type:"select",field:"align",options:ya(t,[{label:"left",value:"left"},{label:"center",value:"center"},{label:"right",value:"right"}])},{type:"input",field:"rangeSeparator"},{type:"switch",field:"unlinkPanels"}])},_I="rate",P$e={menu:"main",icon:"icon-rate",label:"\u8BC4\u5206",name:_I,event:["change"],validate:["number"],rule:({t:e})=>({type:_I,field:vr(),title:e("com.rate.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,_I+".props",[{type:"inputNumber",field:"max",props:{min:0}},{type:"switch",field:"disabled"},{type:"switch",field:"allowHalf"},{type:"ColorInput",field:"voidColor"},{type:"ColorInput",field:"disabledVoidColor"},{type:"input",field:"voidIconClass"},{type:"input",field:"disabledVoidIconClass"},{type:"switch",field:"showScore"},{type:"ColorInput",field:"textColor"},{type:"input",field:"scoreTemplate"}])},EI="colorPicker",j$e={menu:"main",icon:"icon-color",label:"\u989C\u8272\u9009\u62E9\u5668",name:EI,event:["change","activeChange","focus","blur"],validate:["string"],rule:({t:e})=>({type:EI,field:vr(),title:e("com.colorPicker.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,EI+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"showAlpha"},{type:"select",field:"colorFormat",options:[{label:"hsl",value:"hsl"},{label:"hsv",value:"hsv"},{label:"hex",value:"hex"},{label:"rgb",value:"rgb"}]},{type:"tableOptions",field:"predefine",props:{column:[{label:t("props.value"),key:"value"}],valueType:"string"}}])},CI="fcRow",V$e={menu:"layout",icon:"icon-row",label:"\u6805\u683C\u5E03\u5C40",name:CI,mask:!1,children:"col",childrenLen:2,rule:()=>({type:CI,props:{},children:[]}),props:(e,{t})=>er(t,CI+".props",[{type:"inputNumber",field:"gutter",props:{min:0}},{type:"switch",field:"type",props:{activeValue:"flex",inactiveValue:"default"}},{type:"select",field:"justify",options:[{label:"start",value:"start"},{label:"end",value:"end"},{label:"center",value:"center"},{label:"space-around",value:"space-around"},{label:"space-between",value:"space-between"}]},{type:"select",field:"align",options:[{label:"top",value:"top"},{label:"middle",value:"middle"},{label:"bottom",value:"bottom"}]}])},SI="col",z$e={name:SI,label:"\u683C\u5B50",drag:!0,dragBtn:!1,inside:!0,mask:!1,rule:()=>({type:SI,props:{span:12},children:[]}),props:(e,{t})=>er(t,SI+".props",[{type:"slider",field:"span",value:12,props:{min:0,max:24}},{type:"slider",field:"offset",props:{min:0,max:24}},{type:"slider",field:"push",props:{min:0,max:24}},{type:"slider",field:"pull",props:{min:0,max:24}}])},kI="elTabPane",H$e={label:"\u9009\u9879\u5361",name:kI,inside:!0,drag:!0,dragBtn:!1,mask:!1,rule:({t:e})=>({type:kI,props:{label:e("com.elTabPane.name")},children:[]}),props:(e,{t})=>er(t,kI+".props",[{type:"input",field:"label"},{type:"switch",field:"disabled"},{type:"input",field:"name"},{type:"switch",field:"lazy"}])},DI="elDivider",$$e={menu:"aide",icon:"icon-divider",label:"\u5206\u5272\u7EBF",name:DI,rule:({t:e})=>({type:DI,props:{},children:[e("com.elDivider.name")]}),props:(e,{t})=>er(t,DI+".props",[{type:"input",field:"formCreateChild"},{type:"select",field:"contentPosition",options:ya(t,[{label:"left",value:"left"},{label:"right",value:"right"},{label:"center",value:"center"}])}])},Ox="cascader",U$e={menu:"main",icon:"icon-cascader",label:"\u7EA7\u8054\u9009\u62E9\u5668",name:Ox,event:["change","expandChange","blur","focus","visibleChange","removeTag"],validate:["string","number","array"],rule:({t:e})=>({type:Ox,field:vr(),title:e("com.cascader.name"),info:"",effect:{fetch:""},$required:!1,props:{options:fp(e("props.option"),{label:"label",value:"value"},3)}}),props:(e,{t})=>er(t,Ox+".props",[Dx({t,to:"props.options"}),{type:"switch",field:"disabled"},{type:"switch",field:"clearable"},{type:"input",field:"placeholder"},{type:"Object",field:"props",props:{rule:er(t,Ox+".propsOpt",[{type:"switch",field:"multiple"},{type:"select",field:"expandTrigger",options:ya(t,[{label:"click",value:"click"},{label:"hover",value:"hover"}])},{type:"switch",field:"checkStrictly"},{type:"switch",field:"emitPath",value:!0},{type:"input",field:"value",value:"value"},{type:"input",field:"label",value:"label"},{type:"input",field:"children",value:"children"},{type:"input",field:"disabled",value:"disabled"},{type:"input",field:"leaf"}])}},{type:"switch",field:"showAllLevels",value:!0},{type:"switch",field:"collapseTags"},{type:"switch",field:"collapseTagsTooltip"},{type:"input",field:"separator"},{type:"switch",field:"filterable"},{type:"select",field:"tagType",options:[{label:"success",value:"success"},{label:"info",value:"info"},{label:"warning",value:"warning"},{label:"danger",value:"danger"}]}])},OI="upload",W$e={menu:"main",icon:"icon-upload",label:"\u4E0A\u4F20",name:OI,event:["change","remove"],validate:["array"],rule:({t:e})=>({type:OI,field:vr(),title:e("com.upload.name"),info:"",$required:!1,props:{action:"/",onSuccess(t,n){n.url=t.data.url}}}),props:(e,{t})=>er(t,OI+".props",[{type:"switch",field:"disabled"},{type:"select",field:"listType",value:"text",options:ya(t,[{label:"text",value:"text"},{label:"picture",value:"picture"},{label:"picture-card",value:"picture-card"}])},{type:"switch",field:"multiple"},{type:"input",field:"action"},{type:"FnEditor",field:"onSuccess",info:t("com.upload.info"),props:{args:["res","file"],name:"onSuccess",button:!0}},{type:"TableOptions",field:"headers",props:{column:[{label:t("props.key"),key:"label"},{label:t("props.value"),key:"value"}],valueType:"object"}},{type:"TableOptions",field:"data",props:{column:[{label:t("props.key"),key:"label"},{label:t("props.value"),key:"value"}],valueType:"object"}},{type:"input",field:"name"},{type:"switch",field:"withCredentials"},{type:"input",field:"accept"},{type:"switch",field:"autoUpload",value:!0},{type:"inputNumber",field:"limit",props:{min:0}}])},TI="elTransfer",G$e={menu:"main",icon:"icon-transfer",label:"\u7A7F\u68AD\u6846",name:TI,event:["change","leftCheckChange","rightCheckChange"],validate:["string","number","array"],rule:({t:e})=>({type:TI,field:vr(),title:e("com.elTransfer.name"),info:"",$required:!1,props:{data:fp(e("props.option"),{label:"label",value:"key"},1)}}),props:(e,{t})=>er(t,TI+".props",[Dx({t,to:"props.data",label:"label",value:"key"}),{type:"switch",field:"filterable"},{type:"input",field:"filterPlaceholder"},{type:"select",field:"targetOrder",info:t("com.elTransfer.targetOrderInfo"),options:[{label:"original",value:"original"},{label:"push",value:"push"},{label:"unshift",value:"unshift"}]},{type:"TableOptions",field:"titles",props:{column:[{label:t("props.value"),key:"value"}],valueType:"string",max:2}},{type:"TableOptions",field:"buttonTexts",props:{column:[{label:t("props.value"),key:"value"}],valueType:"string",max:2}}])},MI="tree",q$e={menu:"main",icon:"icon-tree",label:"\u6811\u5F62\u63A7\u4EF6",name:MI,event:["nodeClick","nodeContextmenu","checkChange","check","currentChange","nodeExpand","nodeCollapse","nodeDragStart","nodeDragEnter","nodeDragLeave","nodeDragOver","nodeDragEnd","nodeDrop"],validate:["string","number","array"],rule:({t:e})=>({type:MI,field:vr(),title:e("com.tree.name"),info:"",effect:{fetch:""},$required:!1,props:{props:{label:"label"},showCheckbox:!0,nodeKey:"id",data:fp(e("props.option"),{label:"label",value:"id"},3)}}),props:(e,{t})=>er(t,MI+".props",[Dx({t,to:"props.data",label:"label",value:"id"}),{type:"input",field:"emptyText"},{type:"TableOptions",field:"props",props:{column:[{label:t("props.key"),key:"label"},{label:t("props.value"),key:"value"}],valueType:"object"}},{type:"switch",field:"renderAfterExpand",value:!0},{type:"switch",field:"defaultExpandAll"},{type:"switch",field:"expandOnClickNode",value:!0},{type:"switch",field:"checkOnClickNode"},{type:"switch",field:"autoExpandParent",value:!0},{type:"switch",field:"checkStrictly"},{type:"switch",field:"accordion"},{type:"inputNumber",field:"indent"},{type:"input",field:"nodeKey"}])},NI="elAlert",K$e={menu:"aide",icon:"icon-alert",label:"\u63D0\u793A",name:NI,event:["close"],rule:({t:e})=>({type:NI,props:{title:e("com.elAlert.name"),description:e("com.elAlert.description"),type:"success",effect:"dark"},children:[]}),props:(e,{t})=>er(t,NI+".props",[{type:"input",field:"title"},{type:"select",field:"type",options:[{label:"success",value:"success"},{label:"warning",value:"warning"},{label:"info",value:"info"},{label:"error",value:"error"}]},{type:"input",field:"description"},{type:"switch",field:"closable",value:!0},{type:"switch",field:"center",value:!0},{type:"input",field:"closeText"},{type:"switch",field:"showIcon"},{type:"select",field:"effect",options:[{label:"light",value:"light"},{label:"dark",value:"dark"}]}])},Xde="text",Y$e={menu:"aide",icon:"icon-span",label:"\u6587\u5B57",name:Xde,rule:({t:e})=>({type:"div",title:"",native:!0,children:[e("com.text.name")]}),watch:{formCreateNative({value:e,rule:t}){e&&(t.title="")}},props:(e,{t})=>er(t,Xde+".props",[{type:"switch",field:"formCreateNative",props:{activeValue:!1,inactiveValue:!0},control:[{value:!1,rule:["formCreateTitle"]}]},{type:"input",field:"formCreateTitle"},{type:"input",field:"formCreateChild",props:{type:"textarea"}}])},Qde="space",X$e={menu:"layout",icon:"icon-space",label:"\u95F4\u8DDD",name:Qde,rule:()=>({type:"div",wrap:{show:!1},native:!0,style:{width:"100%",height:"20px"},children:[]}),props:(e,{t})=>[{type:"object",field:"formCreateStyle",native:!0,props:{rule:er(t,Qde+".props",[{type:"input",field:"height",title:"height"}])}}]},FI="elTabs",Q$e={menu:"layout",icon:"icon-tab",label:"\u6807\u7B7E\u9875",name:FI,mask:!1,event:["tabClick","tabChange","tabRemove","tabAdd","edit"],children:"elTabPane",rule:()=>({type:FI,style:{width:"100%"},children:[]}),props:(e,{t})=>er(t,FI+".props",[{type:"select",field:"type",options:[{label:"card",value:"card"},{label:"border-card",value:"border-card"}]},{type:"switch",field:"closable"},{type:"select",field:"tabPosition",options:ya(t,[{label:"top",value:"top"},{label:"right",value:"right"},{label:"left",value:"left"}])},{type:"switch",field:"stretch"}])},RI="elButton",J$e={menu:"aide",icon:"icon-button",label:"\u6309\u94AE",name:RI,mask:!0,event:["click"],rule:({t:e})=>({type:RI,props:{},children:[e("com.elButton.name")]}),props:(e,{t})=>er(t,RI+".props",[{type:"input",field:"formCreateChild"},{type:"select",field:"size",options:ya(t,[{label:"large",value:"large"},{label:"default",value:"default"},{label:"small",value:"small"}])},{type:"select",field:"type",options:[{label:"primary",value:"primary"},{label:"success",value:"success"},{label:"warning",value:"warning"},{label:"danger",value:"danger"},{label:"info",value:"info"}]},{type:"switch",field:"plain"},{type:"switch",field:"round"},{type:"switch",field:"circle"},{type:"switch",field:"loading"},{type:"switch",field:"disabled"}])},II="fcEditor",Z$e={menu:"main",icon:"icon-editor",label:"\u5BCC\u6587\u672C\u6846",name:II,event:["change"],validate:["string"],rule:({t:e})=>({type:II,field:vr(),title:e("com.fcEditor.name"),info:"",$required:!1,props:{}}),props:(e,{t})=>er(t,II+".props",[{type:"switch",field:"disabled"}])},Jde="group",eUe={menu:"subform",icon:"icon-subform",label:"\u5B50\u8868\u5355",name:Jde,inside:!1,drag:!0,dragBtn:!0,mask:!1,event:["change"],subForm:"array",loadRule(e){e.children=e.props.rule||[],e.type="FcRow",delete e.props.rule},parseRule(e){e.props.rule=e.children,e.type="group",delete e.children,delete e.props.mode},rule:({t:e})=>({type:"fcRow",field:vr(),title:e("com.group.name"),info:"",$required:!1,props:{},children:[]}),props:(e,{t})=>er(t,Jde+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"syncDisabled",value:!0},{type:"switch",field:"button",value:!0},{type:"switch",field:"sortBtn",value:!0},{type:"inputNumber",field:"expand"},{type:"inputNumber",field:"min"},{type:"inputNumber",field:"max"}])},Zde="subForm",tUe={menu:"subform",icon:"icon-group",label:"\u5206\u7EC4",name:Zde,inside:!1,drag:!0,dragBtn:!0,mask:!1,subForm:"object",event:["change"],loadRule(e){e.children=e.props.rule||[],e.type="FcRow",delete e.props.rule},parseRule(e){e.props.rule=e.children,e.type="subForm",delete e.children},rule:({t:e})=>({type:"fcRow",field:vr(),title:e("com.subForm.name"),info:"",$required:!1,props:{},children:[]}),props:(e,{t})=>er(t,Zde+".props",[{type:"switch",field:"disabled"},{type:"switch",field:"syncDisabled",value:!0}])},BI="elCard",nUe={menu:"layout",icon:"icon-card",label:"\u5361\u7247",name:BI,drag:!0,inside:!1,mask:!1,rule:({t:e})=>({type:BI,props:{header:e("com.elCard.props.header")},style:{width:"100%"},children:[]}),props:(e,{t})=>er(t,BI+".props",[{type:"input",field:"header"},{type:"select",field:"shadow",value:"always",options:ya(t,[{label:"always",value:"always"},{label:"never",value:"never"},{label:"hover",value:"hover"}])}])},LI="elCollapse",rUe={menu:"layout",icon:"icon-collapse",label:"\u6298\u53E0\u9762\u677F",name:LI,mask:!1,children:"elCollapseItem",event:["change"],rule:()=>({type:LI,props:{},style:{width:"100%"},children:[]}),props:(e,{t})=>er(t,LI+".props",[{type:"switch",field:"accordion"}])},PI="elCollapseItem",oUe={icon:"icon-cell",label:"\u9762\u677F",name:PI,drag:!0,dragBtn:!1,inside:!0,mask:!1,rule:({t:e})=>({type:PI,props:{title:e("com.elCollapseItem.name")},style:{},children:[]}),props:(e,{t})=>er(t,PI+".props",[{type:"input",field:"title"},{type:"input",field:"name"},{type:"switch",field:"disabled"}])},jI="elTreeSelect",iUe={menu:"main",icon:"icon-tree-select",label:"\u6811\u5F62\u9009\u62E9",name:jI,event:["change","visibleChange","removeTag","clear","blur","focus"],validate:["string","number","array"],rule:({t:e})=>({type:jI,field:vr(),title:e("com.elTreeSelect.name"),info:"",effect:{fetch:""},$required:!1,props:{nodeKey:"value",showCheckbox:!0,data:fp(e("props.option"),{label:"label",value:"value"},3)}}),watch:{multiple({rule:e}){e.key=vr()}},props:(e,{t})=>er(t,jI+".props",[Dx({t,to:"props.data",label:"label",value:"value"}),{type:"switch",field:"multiple"},{type:"switch",field:"disabled"},{type:"switch",field:"clearable"},{type:"switch",field:"collapseTags"},{type:"inputNumber",field:"multipleLimit",props:{min:0}},{type:"input",field:"placeholder"},{type:"TableOptions",field:"props",props:{column:[{label:t("props.key"),key:"label"},{label:t("props.value"),key:"value"}],valueType:"object"}},{type:"switch",field:"renderAfterExpand",value:!0},{type:"switch",field:"defaultExpandAll"},{type:"switch",field:"expandOnClickNode",value:!0},{type:"switch",field:"checkOnClickNode"},{type:"input",field:"nodeKey"}])},VI="elTag",aUe={menu:"aide",icon:"icon-tag",label:"\u6807\u7B7E",name:VI,mask:!0,event:["click","close"],rule:({t:e})=>({type:VI,title:"",native:!0,children:[e("com.elTag.name")]}),watch:{formCreateNative({value:e,rule:t}){e&&(t.title="")}},props:(e,{t})=>er(t,VI+".props",[{type:"switch",field:"formCreateNative",props:{activeValue:!1,inactiveValue:!0},control:[{value:!1,rule:["formCreateTitle"]}]},{type:"input",field:"formCreateTitle"},{type:"input",field:"formCreateChild"},{type:"select",field:"type",options:[{label:"primary",value:"primary"},{label:"success",value:"success"},{label:"warning",value:"warning"},{label:"danger",value:"danger"},{label:"info",value:"info"}]},{type:"select",field:"size",options:ya(t,[{label:"large",value:"large"},{label:"default",value:"default"},{label:"small",value:"small"}])},{type:"select",field:"effect",options:[{label:"dark",value:"dark"},{label:"light",value:"light"},{label:"plain",value:"plain"}]},{type:"switch",field:"closable"},{type:"switch",field:"disableTransitions"},{type:"switch",field:"hit"},{type:"switch",field:"round"},{type:"ColorInput",field:"color"}])},zI="html",lUe={menu:"aide",icon:"icon-html",label:"HTML",name:zI,rule:()=>({type:zI,title:"",native:!0,attrs:{innerHTML:""},children:[`
html html html html html html html html html
`]}),watch:{formCreateNative({value:e,rule:t}){e&&(t.title="")}},props:(e,{t})=>er(t,zI+".props",[{type:"switch",field:"formCreateNative",props:{activeValue:!1,inactiveValue:!0},control:[{value:!1,rule:["formCreateTitle"]}]},{type:"input",field:"formCreateTitle"},{type:"HtmlEditor",field:"formCreateChild"}])},HI="fcTable",sUe={menu:"layout",icon:"icon-table",label:"\u8868\u683C\u5E03\u5C40",name:HI,inside:!1,mask:!1,rule:()=>({type:HI,props:{rule:{row:3,col:4,style:{},class:{},layout:[]}},children:[]}),props:(e,{t})=>er(t,HI+".props",[{type:"switch",field:"border",value:!0},{type:"ColorInput",field:"borderColor"},{type:"input",field:"borderWidth"}])},$I="tableForm",uUe={menu:"subform",icon:"icon-table-form",label:"\u8868\u683C\u8868\u5355",name:$I,mask:!1,subForm:"array",event:["change","add","delete"],children:"tableFormColumn",loadRule(e){e.props||(e.props={});const t=e.props.columns||[];e.children=t.map(n=>({type:"tableFormColumn",_fc_drag_tag:"tableFormColumn",props:{label:n.label,width:n.style.width||"",color:n.style.color||""},children:n.rule||[]})),delete e.props.columns},parseRule(e){const t=e.children||[];e.props.columns=t.map(n=>({label:n.props.label,style:{width:n.props.width,color:n.props.color},rule:n.children||[]})),e.children=[]},rule:({t:e})=>({type:$I,field:vr(),title:e("com.tableForm.name"),info:"",props:{},children:[]}),props:(e,{t})=>er(t,$I+".props",[{type:"switch",field:"disabled"},{type:"inputNumber",field:"max",props:{min:0}}])},UI="tableFormColumn",cUe={icon:"icon-cell",name:UI,drag:!0,dragBtn:!1,mask:!1,rule:({t:e})=>({type:UI,props:{label:e("com.tableFormColumn.label"),width:"auto"},children:[]}),props:(e,{t})=>er(t,UI+".props",[{type:"input",field:"label"},{type:"input",field:"width"},{type:"ColorInput",field:"color"}])},dUe=[k$e,D$e,O$e,T$e,C$e,S$e,M$e,N$e,P$e,R$e,I$e,F$e,B$e,L$e,j$e,U$e,W$e,G$e,q$e,iUe,Z$e,eUe,tUe,uUe,cUe,K$e,J$e,Y$e,lUe,$$e,aUe,V$e,sUe,Q$e,X$e,nUe,rUe,z$e,H$e,oUe];function efe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t=0)&&(c[s]=a[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function qd(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Kd=qd(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),b4=qd(/Edge/i),tfe=qd(/firefox/i),A4=qd(/safari/i)&&!qd(/chrome/i)&&!qd(/android/i),nfe=qd(/iP(ad|od|hone)/i),hUe=qd(/chrome/i)&&qd(/android/i),rfe={capture:!1,passive:!1};function $r(e,t,n){e.addEventListener(t,n,!Kd&&rfe)}function Ir(e,t,n){e.removeEventListener(t,n,!Kd&&rfe)}function Tx(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function vUe(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Pc(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Tx(e,t):Tx(e,t))||r&&e===n)return e;if(e===n)break}while(e=vUe(e))}return null}var w4,ofe=/\s+/g;function ms(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(ofe," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(ofe," ")}}function Rn(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function Cg(e,t){var n="";if(typeof e=="string")n=e;else do{var r=Rn(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function ife(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o=Ni(r)[n]))return r;if(r===jc())break;r=hp(r,!1)}return!1}function Sg(e,t,n,r){for(var o=0,i=0,a=e.children;i2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,o=pUe(n,gUe);x4.pluginEvent.bind(In)(e,t,Lc({dragEl:Wt,parentEl:Po,ghostEl:ir,rootEl:Co,nextEl:v1,lastDownEl:Mx,cloneEl:Zo,cloneHidden:vp,dragStarted:E4,putSortable:ba,activeSortable:In.active,originalEvent:r,oldIndex:Dg,oldDraggableIndex:_4,newIndex:ys,newDraggableIndex:mp,hideGhostForTarget:gfe,unhideGhostForTarget:yfe,cloneNowHidden:function(){vp=!0},cloneNowShown:function(){vp=!1},dispatchSortableEvent:function(i){il({sortable:t,name:i,originalEvent:r})}},o))};function il(e){(function(t){var n=t.sortable,r=t.rootEl,o=t.name,i=t.targetEl,a=t.cloneEl,l=t.toEl,s=t.fromEl,u=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,f=t.newDraggableIndex,p=t.originalEvent,m=t.putSortable,v=t.extraEventProperties;if(n=n||r&&r[gs]){var g,b=n.options,y="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Kd||b4?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=l||r,g.from=s||r,g.item=i||r,g.clone=a,g.oldIndex=u,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=f,g.originalEvent=p,g.pullMode=m?m.lastPutMode:void 0;var w=Lc(Lc({},v),x4.getEventProperties(o,n));for(var x in w)g[x]=w[x];r&&r.dispatchEvent(g),b[y]&&b[y].call(n,g)}})(Lc({putSortable:ba,cloneEl:Zo,targetEl:Wt,rootEl:Co,oldIndex:Dg,oldDraggableIndex:_4,newIndex:ys,newDraggableIndex:mp},e))}var Wt,Po,ir,Co,v1,Mx,Zo,vp,Dg,ys,_4,mp,Nx,ba,m1,ju,YI,XI,dfe,ffe,E4,Og,C4,Fx,Ta,Tg=!1,Rx=!1,Ix=[],S4=!1,Bx=!1,QI=[],JI=!1,Lx=[],Px=typeof document<"u",jx=nfe,pfe=b4||Kd?"cssFloat":"float",yUe=Px&&!hUe&&!nfe&&"draggable"in document.createElement("div"),hfe=function(){if(Px){if(Kd)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),vfe=function(e,t){var n=Rn(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Sg(e,0,t),i=Sg(e,1,t),a=o&&Rn(o),l=i&&Rn(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ni(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ni(i).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var c=a.float==="left"?"left":"right";return!i||l.clear!=="both"&&l.clear!==c?"horizontal":"vertical"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||s>=r&&n[pfe]==="none"||i&&n[pfe]==="none"&&s+u>r)?"vertical":"horizontal"},mfe=function(e){function t(o,i){return function(a,l,s,u){var c=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(o==null&&(i||c))return!0;if(o==null||o===!1)return!1;if(i&&o==="clone")return o;if(typeof o=="function")return t(o(a,l,s,u),i)(a,l,s,u);var d=(i?a:l).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var n={},r=e.group;(!r||WI(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},gfe=function(){!hfe&&ir&&Rn(ir,"display","none")},yfe=function(){!hfe&&ir&&Rn(ir,"display","")};Px&&document.addEventListener("click",function(e){if(Rx)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Rx=!1,!1},!0);var g1=function(e){if(Wt){var t=function(o,i){var a;return Ix.some(function(l){var s=l[gs].options.emptyInsertThreshold;if(s&&!GI(l)){var u=Ni(l),c=o>=u.left-s&&o<=u.right+s,d=i>=u.top-s&&i<=u.bottom+s;if(c&&d)return a=l}}),a}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[gs]._onDragOver(n)}}},bUe=function(e){Wt&&Wt.parentNode[gs]._isOutsideThisEl(e.target)};function In(e,t){if(!e||!e.nodeType||e.nodeType!==1)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Gd({},t),e[gs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return vfe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:In.supportPointer!==!1&&"PointerEvent"in window&&!A4,emptyInsertThreshold:5};for(var r in x4.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var o in mfe(t),this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&yUe,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?$r(e,"pointerdown",this._onTapStart):($r(e,"mousedown",this._onTapStart),$r(e,"touchstart",this._onTapStart)),this.nativeDraggable&&($r(e,"dragover",this),$r(e,"dragenter",this)),Ix.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Gd(this,mUe())}function Vx(e,t,n,r,o,i,a,l){var s,u,c=e[gs],d=c.options.onMove;return!window.CustomEvent||Kd||b4?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=o||t,s.relatedRect=i||Ni(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),d&&(u=d.call(c,s,a)),u}function ZI(e){e.draggable=!1}function AUe(){JI=!1}function wUe(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function zx(e){return setTimeout(e,0)}function eB(e){return clearTimeout(e)}In.prototype={constructor:In,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Og=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Wt):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,i=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if(function(c){Lx.length=0;for(var d=c.getElementsByTagName("input"),f=d.length;f--;){var p=d[f];p.checked&&Lx.push(p)}}(n),!Wt&&!(/mousedown|pointerdown/.test(i)&&e.button!==0||r.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!A4||!l||l.tagName.toUpperCase()!=="SELECT")&&!((l=Pc(l,r.draggable,n,!1))&&l.animated||Mx===l)){if(Dg=tu(l),_4=tu(l,r.draggable),typeof u=="function"){if(u.call(this,e,l,this))return il({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),Rl("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(u&&(u=u.split(",").some(function(c){if(c=Pc(s,c.trim(),n,!1))return il({sortable:t,rootEl:c,name:"filter",targetEl:l,fromEl:n,toEl:n}),Rl("filter",t,{evt:e}),!0}),u))return void(o&&e.cancelable&&e.preventDefault());r.handle&&!Pc(s,r.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var r,o=this,i=o.el,a=o.options,l=i.ownerDocument;if(n&&!Wt&&n.parentNode===i){var s=Ni(n);if(Co=i,Po=(Wt=n).parentNode,v1=Wt.nextSibling,Mx=n,Nx=a.group,In.dragged=Wt,m1={target:Wt,clientX:(t||e).clientX,clientY:(t||e).clientY},dfe=m1.clientX-s.left,ffe=m1.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Wt.style["will-change"]="all",r=function(){Rl("delayEnded",o,{evt:e}),In.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!tfe&&o.nativeDraggable&&(Wt.draggable=!0),o._triggerDragStart(e,t),il({sortable:o,name:"choose",originalEvent:e}),ms(Wt,a.chosenClass,!0))},a.ignore.split(",").forEach(function(u){ife(Wt,u.trim(),ZI)}),$r(l,"dragover",g1),$r(l,"mousemove",g1),$r(l,"touchmove",g1),$r(l,"mouseup",o._onDrop),$r(l,"touchend",o._onDrop),$r(l,"touchcancel",o._onDrop),tfe&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Wt.draggable=!0),Rl("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(b4||Kd))r();else{if(In.eventCanceled)return void this._onDrop();$r(l,"mouseup",o._disableDelayedDrag),$r(l,"touchend",o._disableDelayedDrag),$r(l,"touchcancel",o._disableDelayedDrag),$r(l,"mousemove",o._delayedDragTouchMoveHandler),$r(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&$r(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Wt&&ZI(Wt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ir(e,"mouseup",this._disableDelayedDrag),Ir(e,"touchend",this._disableDelayedDrag),Ir(e,"touchcancel",this._disableDelayedDrag),Ir(e,"mousemove",this._delayedDragTouchMoveHandler),Ir(e,"touchmove",this._delayedDragTouchMoveHandler),Ir(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?$r(document,"pointermove",this._onTouchMove):$r(document,t?"touchmove":"mousemove",this._onTouchMove):($r(Wt,"dragend",this),$r(Co,"dragstart",this._onDragStart));try{document.selection?zx(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Tg=!1,Co&&Wt){Rl("dragStarted",this,{evt:t}),this.nativeDraggable&&$r(document,"dragover",bUe);var n=this.options;!e&&ms(Wt,n.dragClass,!1),ms(Wt,n.ghostClass,!0),In.active=this,e&&this._appendGhost(),il({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ju){this._lastX=ju.clientX,this._lastY=ju.clientY,gfe();for(var e=document.elementFromPoint(ju.clientX,ju.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ju.clientX,ju.clientY))!==t;)t=e;if(Wt.parentNode[gs]._isOutsideThisEl(e),t)do{if(t[gs]&&t[gs]._onDragOver({clientX:ju.clientX,clientY:ju.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);yfe()}},_onTouchMove:function(e){if(m1){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=ir&&Cg(ir,!0),a=ir&&i&&i.a,l=ir&&i&&i.d,s=jx&&Ta&&lfe(Ta),u=(o.clientX-m1.clientX+r.x)/(a||1)+(s?s[0]-QI[0]:0)/(a||1),c=(o.clientY-m1.clientY+r.y)/(l||1)+(s?s[1]-QI[1]:0)/(l||1);if(!In.active&&!Tg){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))G.right+z||P.clientX<=G.right&&P.clientY>G.bottom&&P.clientX>=G.left:P.clientX>G.right&&P.clientY>G.top||P.clientX<=G.right&&P.clientY>G.bottom+z}(e,o,this)&&!v.animated){if(v===Wt)return L(!1);if(v&&i===e.target&&(a=v),a&&(n=Ni(a)),Vx(Co,i,Wt,t,a,n,e,!!a)!==!1)return B(),i.appendChild(Wt),Po=i,V(),L(!0)}else if(v&&function(P,H,U){var G=Ni(Sg(U.el,0,U.options,!0)),z=10;return H?P.clientXne+te*$/2:Xse-Fx)return-C4}else if(X>ne+te*(1-z)/2&&Xse-te*$/2)?X>ne+te/2?1:-1:0}(e,a,n,o,_?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Bx,Og===a),b!==0){var k=tu(Wt);do k-=b,w=Po.children[k];while(w&&(Rn(w,"display")==="none"||w===ir))}if(b===0||w===a)return L(!1);Og=a,C4=b;var I=a.nextElementSibling,O=!1,F=Vx(Co,i,Wt,t,a,n,e,O=b===1);if(F!==!1)return(F===1||F===-1)&&(O=F===1),JI=!0,setTimeout(AUe,30),B(),O&&!I?i.appendChild(Wt):a.parentNode.insertBefore(Wt,O?I:a),C&&ufe(C,0,T-C.scrollTop),Po=Wt.parentNode,y!==void 0&&!Bx&&(Fx=Math.abs(y-Ni(a)[E])),V(),L(!0)}if(i.contains(Wt))return L(!1)}return!1}function N(P,H){Rl(P,p,Lc({evt:e,isOwner:c,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:d,fromSortable:f,target:a,completed:L,onMove:function(U,G){return Vx(Co,i,Wt,t,U,Ni(U),e,G)},changed:V},H))}function B(){N("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function L(P){return N("dragOverCompleted",{insertion:P}),P&&(c?u._hideClone():u._showClone(p),p!==f&&(ms(Wt,ba?ba.options.ghostClass:u.options.ghostClass,!1),ms(Wt,l.ghostClass,!0)),ba!==p&&p!==In.active?ba=p:p===In.active&&ba&&(ba=null),f===p&&(p._ignoreWhileAnimating=a),p.animateAll(function(){N("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(a===Wt&&!Wt.animated||a===i&&!a.animated)&&(Og=null),!l.dragoverBubble&&!e.rootEl&&a!==document&&(Wt.parentNode[gs]._isOutsideThisEl(e.target),!P&&g1(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function V(){ys=tu(Wt),mp=tu(Wt,l.draggable),il({sortable:p,name:"change",toEl:i,newIndex:ys,newDraggableIndex:mp,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ir(document,"mousemove",this._onTouchMove),Ir(document,"touchmove",this._onTouchMove),Ir(document,"pointermove",this._onTouchMove),Ir(document,"dragover",g1),Ir(document,"mousemove",g1),Ir(document,"touchmove",g1)},_offUpEvents:function(){var e=this.el.ownerDocument;Ir(e,"mouseup",this._onDrop),Ir(e,"touchend",this._onDrop),Ir(e,"pointerup",this._onDrop),Ir(e,"touchcancel",this._onDrop),Ir(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ys=tu(Wt),mp=tu(Wt,n.draggable),Rl("drop",this,{evt:e}),Po=Wt&&Wt.parentNode,ys=tu(Wt),mp=tu(Wt,n.draggable),In.eventCanceled||(Tg=!1,Bx=!1,S4=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),eB(this.cloneId),eB(this._dragStartId),this.nativeDraggable&&(Ir(document,"drop",this),Ir(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),A4&&Rn(document.body,"user-select",""),Rn(Wt,"transform",""),e&&(E4&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ir&&ir.parentNode&&ir.parentNode.removeChild(ir),(Co===Po||ba&&ba.lastPutMode!=="clone")&&Zo&&Zo.parentNode&&Zo.parentNode.removeChild(Zo),Wt&&(this.nativeDraggable&&Ir(Wt,"dragend",this),ZI(Wt),Wt.style["will-change"]="",E4&&!Tg&&ms(Wt,ba?ba.options.ghostClass:this.options.ghostClass,!1),ms(Wt,this.options.chosenClass,!1),il({sortable:this,name:"unchoose",toEl:Po,newIndex:null,newDraggableIndex:null,originalEvent:e}),Co!==Po?(ys>=0&&(il({rootEl:Po,name:"add",toEl:Po,fromEl:Co,originalEvent:e}),il({sortable:this,name:"remove",toEl:Po,originalEvent:e}),il({rootEl:Po,name:"sort",toEl:Po,fromEl:Co,originalEvent:e}),il({sortable:this,name:"sort",toEl:Po,originalEvent:e})),ba&&ba.save()):ys!==Dg&&ys>=0&&(il({sortable:this,name:"update",toEl:Po,originalEvent:e}),il({sortable:this,name:"sort",toEl:Po,originalEvent:e})),In.active&&((ys==null||ys===-1)&&(ys=Dg,mp=_4),il({sortable:this,name:"end",toEl:Po,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Rl("nulling",this),Co=Wt=Po=ir=v1=Zo=Mx=vp=m1=ju=E4=ys=mp=Dg=_4=Og=C4=ba=Nx=In.dragged=In.ghost=In.clone=In.active=null,Lx.forEach(function(e){e.checked=!0}),Lx.length=YI=XI=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Wt&&(this._onDragOver(e),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,i=this.options;re.replace(_Ue,(t,n)=>n.toUpperCase())),xfe=["Start","Add","Remove","Update","End"],_fe=["Choose","Unchoose","Sort","Filter","Clone"],Efe=["Move"],CUe=[Efe,xfe,_fe].flatMap(e=>e).map(e=>`on${e}`),uB={manage:Efe,manageAndEmit:xfe,emit:_fe},SUe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function Cfe(e){return["id","class","role","style"].includes(e)||e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("on")}function Sfe(e){return e.reduce((t,[n,r])=>(t[n]=r,t),{})}function kfe(e){return Object.entries(e).filter(([t,n])=>!Cfe(t)).map(([t,n])=>[EUe(t),n]).filter(([t,n])=>!function(r){return CUe.indexOf(r)!==-1}(t))}const Dfe=({el:e})=>e,Ofe=e=>e.__draggable_context;let kUe=class{constructor({nodes:{header:e,default:t,footer:n},root:r,realList:o}){this.defaultNodes=t,this.children=[...e,...t,...n],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=o}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,t){const{tag:n,children:r,_isRootComponent:o}=this;return e(n,t,o?{default:()=>r}:r)}updated(){const{defaultNodes:e,realList:t}=this;e.forEach((n,r)=>{((o,i)=>{o.__draggable_context=i})(Dfe(n),{element:t[r],index:r})})}getUnderlyingVm(e){return Ofe(e)}getVmIndexFromDomIndex(e,t){const{defaultNodes:n}=this,{length:r}=n,o=t.children,i=o.item(e);if(i===null)return r;const a=Ofe(i);if(a)return a.index;if(r===0)return 0;const l=Dfe(n[0]),s=[...o].findIndex(u=>u===l);return efunction(v,g){const b=v[g];return b?b():[]}(a,m)),{item:f}=a;if(!f)throw new Error("draggable element must have an item slot");const p=u.flatMap((m,v)=>f({element:m,index:v}).map(g=>(g.key=s(m),g.props={...g.props||{},"data-draggable":!0},g)));if(p.length!==u.length)throw new Error("Item slot must have only one child");return{header:c,footer:d,default:p}}({$slots:e,realList:n,getKey:r}),i=DUe(t);return new kUe({nodes:o,root:i,realList:n})}function Tfe(e,t){St(()=>this.$emit(e.toLowerCase(),t))}function Mfe(e){return(t,n)=>{if(this.realList!==null)return this[`onDrag${e}`](t,n)}}function TUe(e){const t=Mfe.call(this,e);return(n,r)=>{t.call(this,n,r),Tfe.call(this,e,n)}}let cB=null;const MUe={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},NUe=["update:modelValue","change",...[...uB.manageAndEmit,...uB.emit].map(e=>e.toLowerCase())],dB=Te({name:"draggable",inheritAttrs:!1,props:MUe,emits:NUe,data:()=>({error:!1}),render(){try{this.error=!1;const{$slots:e,$attrs:t,tag:n,componentData:r,realList:o,getKey:i}=this,a=OUe({$slots:e,tag:n,realList:o,getKey:i});this.componentStructure=a;const l=function({$attrs:s,componentData:u={}}){return{...Sfe(Object.entries(s).filter(([c,d])=>Cfe(c))),...u}}({$attrs:t,componentData:r});return a.render(pn,l)}catch(e){return this.error=!0,pn("pre",{style:{color:"red"}},e.stack)}},created(){this.list!==null&&this.modelValue!==null&&xUe.error("modelValue and list props are mutually exclusive! Please set one or another.")},mounted(){if(this.error)return;const{$attrs:e,$el:t,componentStructure:n}=this;n.updated();const r=function({$attrs:i,callBackBuilder:a}){const l=Sfe(kfe(i));Object.entries(a).forEach(([u,c])=>{uB[u].forEach(d=>{l[`on${d}`]=c(d)})});const s=`[data-draggable]${l.draggable||""}`;return{...l,draggable:s}}({$attrs:e,callBackBuilder:{manageAndEmit:i=>TUe.call(this,i),emit:i=>Tfe.bind(this,i),manage:i=>Mfe.call(this,i)}}),o=t.nodeType===1?t:t.parentElement;this._sortable=new In(o,r),this.targetDomElement=o,o.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){const{list:e}=this;return e||this.modelValue},getKey(){const{itemKey:e}=this;return typeof e=="function"?e:t=>t[e]}},watch:{$attrs:{handler(e){const{_sortable:t}=this;!t||kfe(e).forEach(([n,r])=>{t.option(n,r)})},deep:!0}},methods:{getUnderlyingVm(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent:e=>e.__draggable_component__,emitChanges(e){St(()=>this.$emit("change",e))},alterList(e){if(this.list)return void e(this.list);const t=[...this.modelValue];e(t),this.$emit("update:modelValue",t)},spliceList(){this.alterList(e=>e.splice(...arguments))},updatePosition(e,t){this.alterList(n=>n.splice(t,0,n.splice(e,1)[0]))},getRelatedContextFromMoveEvent({to:e,related:t}){const n=this.getUnderlyingPotencialDraggableComponent(e);if(!n)return{component:n};const r=n.realList,o={list:r,component:n};return e!==t&&r?{...n.getUnderlyingVm(t)||{},...o}:o},getVmIndexFromDomIndex(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),cB=e.item},onDragAdd(e){const t=e.item._underlying_vm_;if(t===void 0)return;sB(e.item);const n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);const r={element:t,newIndex:n};this.emitChanges({added:r})},onDragRemove(e){if(wfe(this.$el,e.item,e.oldIndex),e.pullMode==="clone")return void sB(e.clone);const{index:t,element:n}=this.context;this.spliceList(t,1);const r={element:n,oldIndex:t};this.emitChanges({removed:r})},onDragUpdate(e){sB(e.item),wfe(e.from,e.item,e.oldIndex);const t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);const r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex(e,t){if(!e.element)return 0;const n=[...t.to.children].filter(i=>i.style.display!=="none"),r=n.indexOf(t.related),o=e.component.getVmIndexFromDomIndex(r);return n.indexOf(cB)===-1&&t.willInsertAfter?o+1:o},onDragMove(e,t){const{move:n,realList:r}=this;if(!n||!r)return!0;const o=this.getRelatedContextFromMoveEvent(e),i=this.computeFutureIndex(o,e),a={...this.context,futureIndex:i};return n({...e,relatedContext:o,draggedContext:a},t)},onDragEnd(){cB=null}}}),Ux=_d,Br=_d.factory();let Nfe=null,Ffe=de(null);function fB(...e){return Nfe(...e)}const Rfe=e=>{Ffe.value=e||Vde;const t=fI(Ffe);return Nfe=t.t,t};Rfe(),typeof globalThis<"u"||typeof window<"u"||(typeof global<"u"?global:typeof self<"u");var Ife,Bfe={exports:{}};function Wx(){return Ife||(Ife=1,Bfe.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),a=r||o||i,l=a&&(r?document.documentMode||6:+(i||o)[1]),s=!i&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!i&&/Chrome\/(\d+)/.exec(e),d=c&&+c[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),v=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),b=/Android/.test(e),y=g||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),w=g||/Mac/.test(t),x=/\bCrOS\b/.test(e),_=/win/i.test(t),E=f&&e.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(f=!1,s=!0);var C=w&&(u||f&&(E==null||E<12.11)),T=n||a&&l>=9;function k(h){return new RegExp("(^|\\s)"+h+"(?:$|\\s)\\s*")}var I,O=function(h,A){var D=h.className,S=k(A).exec(D);if(S){var R=D.slice(S.index+S[0].length);h.className=D.slice(0,S.index)+(R?S[1]+R:"")}};function F(h){for(var A=h.childNodes.length;A>0;--A)h.removeChild(h.firstChild);return h}function N(h,A){return F(h).appendChild(A)}function B(h,A,D,S){var R=document.createElement(h);if(D&&(R.className=D),S&&(R.style.cssText=S),typeof A=="string")R.appendChild(document.createTextNode(A));else if(A)for(var j=0;j=A)return q+(A-j);q+=Q-j,q+=D-q%D,j=Q+1}}g?G=function(h){h.selectionStart=0,h.selectionEnd=h.value.length}:a&&(G=function(h){try{h.select()}catch{}});var te=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};function ne(h,A){for(var D=0;D=A)return S+Math.min(q,A-R);if(R+=j-S,S=j+1,(R+=D-R%D)>=A)return S}}var ve=[""];function Ae(h){for(;ve.length<=h;)ve.push(Ce(ve)+" ");return ve[h]}function Ce(h){return h[h.length-1]}function _e(h,A){for(var D=[],S=0;S"\x80"&&(h.toUpperCase()!=h.toLowerCase()||rt.test(h))}function We(h,A){return A?!!(A.source.indexOf("\\w")>-1&&ge(h))||A.test(h):ge(h)}function st(h){for(var A in h)if(h.hasOwnProperty(A)&&h[A])return!1;return!0}var At=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ve(h){return h.charCodeAt(0)>=768&&At.test(h)}function it(h,A,D){for(;(D<0?A>0:AD?-1:1;;){if(A==D)return A;var R=(A+D)/2,j=S<0?Math.ceil(R):Math.floor(R);if(j==A)return h(j)?A:D;h(j)?D=j:A=j+S}}function ot(h,A,D,S){if(!h)return S(A,D,"ltr",0);for(var R=!1,j=0;jA||A==D&&q.to==A)&&(S(Math.max(q.from,A),Math.min(q.to,D),q.level==1?"rtl":"ltr",j),R=!0)}R||S(A,D,"ltr")}var je=null;function we(h,A,D){var S;je=null;for(var R=0;RA)return R;j.to==A&&(j.from!=j.to&&D=="before"?S=R:je=R),j.from==A&&(j.from!=j.to&&D!="before"?S=R:je=R)}return S??je}var ze=function(){var h="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",A="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function D(ae){return ae<=247?h.charAt(ae):1424<=ae&&ae<=1524?"R":1536<=ae&&ae<=1785?A.charAt(ae-1536):1774<=ae&&ae<=2220?"r":8192<=ae&&ae<=8203?"w":ae==8204?"b":"L"}var S=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,R=/[stwN]/,j=/[LRr]/,q=/[Lb1n]/,Q=/[1n]/;function re(ae,Se,De){this.level=ae,this.from=Se,this.to=De}return function(ae,Se){var De=Se=="ltr"?"L":"R";if(ae.length==0||Se=="ltr"&&!S.test(ae))return!1;for(var Ue=ae.length,Ge=[],at=0;at-1&&(S[A]=R.slice(0,j).concat(R.slice(j+1)))}}}function vt(h,A){var D=ht(h,A);if(D.length)for(var S=Array.prototype.slice.call(arguments,2),R=0;R0}function rn(h){h.prototype.on=function(A,D){Ie(this,A,D)},h.prototype.off=function(A,D){gt(this,A,D)}}function zn(h){h.preventDefault?h.preventDefault():h.returnValue=!1}function tt(h){h.stopPropagation?h.stopPropagation():h.cancelBubble=!0}function kt(h){return h.defaultPrevented!=null?h.defaultPrevented:h.returnValue==0}function An(h){zn(h),tt(h)}function _n(h){return h.target||h.srcElement}function po(h){var A=h.which;return A==null&&(1&h.button?A=1:2&h.button?A=3:4&h.button&&(A=2)),w&&h.ctrlKey&&A==1&&(A=3),A}var Qr,Ar,Jr=function(){if(a&&l<9)return!1;var h=B("div");return"draggable"in h||"dragDrop"in h}();function Ao(h){if(Qr==null){var A=B("span","\u200B");N(h,B("span",[A,document.createTextNode("x")])),h.firstChild.offsetHeight!=0&&(Qr=A.offsetWidth<=1&&A.offsetHeight>2&&!(a&&l<8))}var D=Qr?B("span","\u200B"):B("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return D.setAttribute("cm-text",""),D}function pl(h){if(Ar!=null)return Ar;var A=N(h,document.createTextNode("A\u062EA")),D=I(A,0,1).getBoundingClientRect(),S=I(A,1,2).getBoundingClientRect();return F(h),!(!D||D.left==D.right)&&(Ar=S.right-D.right<3)}var Go=`
b`.split(/\n/).length!=3?function(h){for(var A=0,D=[],S=h.length;A<=S;){var R=h.indexOf(`
`,A);R==-1&&(R=h.length);var j=h.slice(A,h.charAt(R-1)=="\r"?R-1:R),q=j.indexOf("\r");q!=-1?(D.push(j.slice(0,q)),A+=q+1):(D.push(j),A=R+1)}return D}:function(h){return h.split(/\r\n?|\n/)},za=window.getSelection?function(h){try{return h.selectionStart!=h.selectionEnd}catch{return!1}}:function(h){var A;try{A=h.ownerDocument.selection.createRange()}catch{}return!(!A||A.parentElement()!=h)&&A.compareEndPoints("StartToEnd",A)!=0},sa=function(){var h=B("div");return"oncopy"in h||(h.setAttribute("oncopy","return;"),typeof h.oncopy=="function")}(),He=null;function lt(h){if(He!=null)return He;var A=N(h,B("span","x")),D=A.getBoundingClientRect(),S=I(A,0,1).getBoundingClientRect();return He=Math.abs(D.left-S.left)>1}var Et={},Kt={};function gr(h,A){arguments.length>2&&(A.dependencies=Array.prototype.slice.call(arguments,2)),Et[h]=A}function Bn(h,A){Kt[h]=A}function Ne(h){if(typeof h=="string"&&Kt.hasOwnProperty(h))h=Kt[h];else if(h&&typeof h.name=="string"&&Kt.hasOwnProperty(h.name)){var A=Kt[h.name];typeof A=="string"&&(A={name:A}),(h=$e(A,h)).name=A.name}else{if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(h))return Ne("application/xml");if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(h))return Ne("application/json")}return typeof h=="string"?{name:h}:h||{name:"null"}}function Tt(h,A){A=Ne(A);var D=Et[A.name];if(!D)return Tt(h,"text/plain");var S=D(h,A);if(Oe.hasOwnProperty(A.name)){var R=Oe[A.name];for(var j in R)!R.hasOwnProperty(j)||(S.hasOwnProperty(j)&&(S["_"+j]=S[j]),S[j]=R[j])}if(S.name=A.name,A.helperType&&(S.helperType=A.helperType),A.modeProps)for(var q in A.modeProps)S[q]=A.modeProps[q];return S}var Oe={};function nt(h,A){K(A,Oe.hasOwnProperty(h)?Oe[h]:Oe[h]={})}function ut(h,A){if(A===!0)return A;if(h.copyState)return h.copyState(A);var D={};for(var S in A){var R=A[S];R instanceof Array&&(R=R.concat([])),D[S]=R}return D}function xt(h,A){for(var D;h.innerMode&&(D=h.innerMode(A))&&D.mode!=h;)A=D.state,h=D.mode;return D||{mode:h,state:A}}function En(h,A,D){return!h.startState||h.startState(A,D)}var ln=function(h,A,D){this.pos=this.start=0,this.string=h,this.tabSize=A||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=D};function Ct(h,A){if((A-=h.first)<0||A>=h.size)throw new Error("There is no line "+(A+h.first)+" in the document.");for(var D=h;!D.lines;)for(var S=0;;++S){var R=D.children[S],j=R.chunkSize();if(A=h.first&&AD?Ee(D,Ct(h,D).text.length):Ef(A,Ct(h,A.line).text.length)}function Ef(h,A){var D=h.ch;return D==null||D>A?Ee(h.line,A):D<0?Ee(h.line,0):h}function gd(h,A){for(var D=[],S=0;S=this.string.length},ln.prototype.sol=function(){return this.pos==this.lineStart},ln.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ln.prototype.next=function(){if(this.posA},ln.prototype.eatSpace=function(){for(var h=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>h},ln.prototype.skipToEnd=function(){this.pos=this.string.length},ln.prototype.skipTo=function(h){var A=this.string.indexOf(h,this.pos);if(A>-1)return this.pos=A,!0},ln.prototype.backUp=function(h){this.pos-=h},ln.prototype.column=function(){return this.lastColumnPos0?null:(S&&A!==!1&&(this.pos+=S[0].length),S)}var R=function(j){return D?j.toLowerCase():j};if(R(this.string.substr(this.pos,h.length))==R(h))return A!==!1&&(this.pos+=h.length),!0},ln.prototype.current=function(){return this.string.slice(this.start,this.pos)},ln.prototype.hideFirstChars=function(h,A){this.lineStart+=h;try{return A()}finally{this.lineStart-=h}},ln.prototype.lookAhead=function(h){var A=this.lineOracle;return A&&A.lookAhead(h)},ln.prototype.baseToken=function(){var h=this.lineOracle;return h&&h.baseToken(this.pos)};var Yl=function(h,A){this.state=h,this.lookAhead=A},Ps=function(h,A,D,S){this.state=A,this.doc=h,this.line=D,this.maxLookAhead=S||0,this.baseTokens=null,this.baseTokenPos=1};function om(h,A,D,S){var R=[h.state.modeGen],j={};$Se(h,A.text,h.doc.mode,D,function(ae,Se){return R.push(ae,Se)},j,S);for(var q=D.state,Q=function(ae){D.baseTokens=R;var Se=h.state.overlays[ae],De=1,Ue=0;D.state=!0,$Se(h,A.text,Se.mode,D,function(Ge,at){for(var yt=De;UeGe&&R.splice(De,1,Ge,R[De+1],Ot),De+=2,Ue=Math.min(Ge,Ot)}if(at)if(Se.opaque)R.splice(yt,De-yt,Ge,"overlay "+at),De=yt+2;else for(;yth.options.maxHighlightLength&&ut(h.doc.mode,S.state),j=om(h,A,S);R&&(S.state=R),A.stateAfter=S.save(!R),A.styles=j.styles,j.classes?A.styleClasses=j.classes:A.styleClasses&&(A.styleClasses=null),D===h.doc.highlightFrontier&&(h.doc.modeFrontier=Math.max(h.doc.modeFrontier,++h.doc.highlightFrontier))}return A.styles}function yd(h,A,D){var S=h.doc,R=h.display;if(!S.mode.startState)return new Ps(S,!0,A);var j=swt(h,A,D),q=j>S.first&&Ct(S,j-1).stateAfter,Q=q?Ps.fromSaved(S,q,j):new Ps(S,En(S.mode),j);return S.iter(j,A,function(re){t0(h,re.text,Q);var ae=Q.line;re.stateAfter=ae==A-1||ae%5==0||ae>=R.viewFrom&&aeA.start)return j}throw new Error("Mode "+h.name+" failed to advance stream.")}Ps.prototype.lookAhead=function(h){var A=this.doc.getLine(this.line+h);return A!=null&&h>this.maxLookAhead&&(this.maxLookAhead=h),A},Ps.prototype.baseToken=function(h){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=h;)this.baseTokenPos+=2;var A=this.baseTokens[this.baseTokenPos+1];return{type:A&&A.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-h}},Ps.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ps.fromSaved=function(h,A,D){return A instanceof Yl?new Ps(h,ut(h.mode,A.state),D,A.lookAhead):new Ps(h,ut(h.mode,A),D)},Ps.prototype.save=function(h){var A=h!==!1?ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Yl(A,this.maxLookAhead):A};var im=function(h,A,D){this.start=h.start,this.end=h.pos,this.string=h.current(),this.type=A||null,this.state=D};function zSe(h,A,D,S){var R,j,q=h.doc,Q=q.mode,re=Ct(q,(A=gn(q,A)).line),ae=yd(h,A.line,D),Se=new ln(re.text,h.options.tabSize,ae);for(S&&(j=[]);(S||Se.posh.options.maxHighlightLength?(Q=!1,q&&t0(h,A,S,De.pos),De.pos=A.length,re=null):re=HSe(n0(D,De,S.state,Ue),j),Ue){var Ge=Ue[0].name;Ge&&(re="m-"+(re?Ge+" "+re:Ge))}if(!Q||Se!=re){for(;aeq;--Q){if(Q<=j.first)return j.first;var re=Ct(j,Q-1),ae=re.stateAfter;if(ae&&(!D||Q+(ae instanceof Yl?ae.lookAhead:0)<=j.modeFrontier))return Q;var Se=X(re.text,null,h.options.tabSize);(R==null||S>Se)&&(R=Q-1,S=Se)}return R}function uwt(h,A){if(h.modeFrontier=Math.min(h.modeFrontier,A),!(h.highlightFrontierD;S--){var R=Ct(h,S).stateAfter;if(R&&(!(R instanceof Yl)||S+R.lookAhead=A:j.to>A);(S||(S=[])).push(new GD(q,j.from,Q?null:j.to))}}return S}function vwt(h,A,D){var S;if(h)for(var R=0;R=A:j.to>A)||j.from==A&&q.type=="bookmark"&&(!D||j.marker.insertLeft)){var Q=j.from==null||(q.inclusiveLeft?j.from<=A:j.from0&&Q)for(var It=0;It0)){var Se=[re,1],De=Ze(ae.from,Q.from),Ue=Ze(ae.to,Q.to);(De<0||!q.inclusiveLeft&&!De)&&Se.push({from:ae.from,to:Q.from}),(Ue>0||!q.inclusiveRight&&!Ue)&&Se.push({from:Q.to,to:ae.to}),R.splice.apply(R,Se),re+=Se.length-3}}return R}function GSe(h){var A=h.markedSpans;if(A){for(var D=0;DA)&&(!D||yX(D,j.marker)<0)&&(D=j.marker)}return D}function XSe(h,A,D,S,R){var j=Ct(h,A),q=Cf&&j.markedSpans;if(q)for(var Q=0;Q=0&&De<=0||Se<=0&&De>=0)&&(Se<=0&&(re.marker.inclusiveRight&&R.inclusiveLeft?Ze(ae.to,D)>=0:Ze(ae.to,D)>0)||Se>=0&&(re.marker.inclusiveRight&&R.inclusiveLeft?Ze(ae.from,S)<=0:Ze(ae.from,S)<0)))return!0}}}function uc(h){for(var A;A=YSe(h);)h=A.find(-1,!0).line;return h}function ywt(h){for(var A;A=YD(h);)h=A.find(1,!0).line;return h}function bwt(h){for(var A,D;A=YD(h);)h=A.find(1,!0).line,(D||(D=[])).push(h);return D}function bX(h,A){var D=Ct(h,A),S=uc(D);return D==S?A:cr(S)}function QSe(h,A){if(A>h.lastLine())return A;var D,S=Ct(h,A);if(!r0(h,S))return A;for(;D=YD(S);)S=D.find(1,!0).line;return cr(S)+1}function r0(h,A){var D=Cf&&A.markedSpans;if(D){for(var S=void 0,R=0;RA.maxLineLength&&(A.maxLineLength=R,A.maxLine=S)})}var r3=function(h,A,D){this.text=h,qSe(this,A),this.height=D?D(this):1};function Awt(h,A,D,S){h.text=A,h.stateAfter&&(h.stateAfter=null),h.styles&&(h.styles=null),h.order!=null&&(h.order=null),GSe(h),qSe(h,D);var R=S?S(h):1;R!=h.height&&jr(h,R)}function wwt(h){h.parent=null,GSe(h)}r3.prototype.lineNo=function(){return cr(this)},rn(r3);var xwt={},_wt={};function JSe(h,A){if(!h||/^\s*$/.test(h))return null;var D=A.addModeClass?_wt:xwt;return D[h]||(D[h]=h.replace(/\S+/g,"cm-$&"))}function ZSe(h,A){var D=L("span",null,null,s?"padding-right: .1px":null),S={pre:L("pre",[D],"CodeMirror-line"),content:D,col:0,pos:0,cm:h,trailingSpace:!1,splitSpaces:h.getOption("lineWrapping")};A.measure={};for(var R=0;R<=(A.rest?A.rest.length:0);R++){var j=R?A.rest[R-1]:A.line,q=void 0;S.pos=0,S.addToken=Cwt,pl(h.display.measure)&&(q=me(j,h.doc.direction))&&(S.addToken=kwt(S.addToken,q)),S.map=[],Dwt(j,S,n3(h,j,A!=h.display.externalMeasured&&cr(j))),j.styleClasses&&(j.styleClasses.bgClass&&(S.bgClass=U(j.styleClasses.bgClass,S.bgClass||"")),j.styleClasses.textClass&&(S.textClass=U(j.styleClasses.textClass,S.textClass||""))),S.map.length==0&&S.map.push(0,0,S.content.appendChild(Ao(h.display.measure))),R==0?(A.measure.map=S.map,A.measure.cache={}):((A.measure.maps||(A.measure.maps=[])).push(S.map),(A.measure.caches||(A.measure.caches=[])).push({}))}if(s){var Q=S.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(S.content.className="cm-tab-wrap-hack")}return vt(h,"renderLine",h,A.line,S.pre),S.pre.className&&(S.textClass=U(S.pre.className,S.textClass||"")),S}function Ewt(h){var A=B("span","\u2022","cm-invalidchar");return A.title="\\u"+h.charCodeAt(0).toString(16),A.setAttribute("aria-label",A.title),A}function Cwt(h,A,D,S,R,j,q){if(A){var Q,re=h.splitSpaces?Swt(A,h.trailingSpace):A,ae=h.cm.state.specialChars,Se=!1;if(ae.test(A)){Q=document.createDocumentFragment();for(var De=0;;){ae.lastIndex=De;var Ue=ae.exec(A),Ge=Ue?Ue.index-De:A.length-De;if(Ge){var at=document.createTextNode(re.slice(De,De+Ge));a&&l<9?Q.appendChild(B("span",[at])):Q.appendChild(at),h.map.push(h.pos,h.pos+Ge,at),h.col+=Ge,h.pos+=Ge}if(!Ue)break;De+=Ge+1;var yt=void 0;if(Ue[0]==" "){var Ot=h.cm.options.tabSize,Yt=Ot-h.col%Ot;(yt=Q.appendChild(B("span",Ae(Yt),"cm-tab"))).setAttribute("role","presentation"),yt.setAttribute("cm-text"," "),h.col+=Yt}else Ue[0]=="\r"||Ue[0]==`
`?((yt=Q.appendChild(B("span",Ue[0]=="\r"?"\u240D":"\u2424","cm-invalidchar"))).setAttribute("cm-text",Ue[0]),h.col+=1):((yt=h.cm.options.specialCharPlaceholder(Ue[0])).setAttribute("cm-text",Ue[0]),a&&l<9?Q.appendChild(B("span",[yt])):Q.appendChild(yt),h.col+=1);h.map.push(h.pos,h.pos+1,yt),h.pos++}}else h.col+=A.length,Q=document.createTextNode(re),h.map.push(h.pos,h.pos+A.length,Q),a&&l<9&&(Se=!0),h.pos+=A.length;if(h.trailingSpace=re.charCodeAt(A.length-1)==32,D||S||R||Se||j||q){var Jt=D||"";S&&(Jt+=S),R&&(Jt+=R);var It=B("span",[Q],Jt,j);if(q)for(var tn in q)q.hasOwnProperty(tn)&&tn!="style"&&tn!="class"&&It.setAttribute(tn,q[tn]);return h.content.appendChild(It)}h.content.appendChild(Q)}}function Swt(h,A){if(h.length>1&&!/ /.test(h))return h;for(var D=A,S="",R=0;Rae&&De.from<=ae);Ue++);if(De.to>=Se)return h(D,S,R,j,q,Q,re);h(D,S.slice(0,De.to-ae),R,j,null,Q,re),j=null,S=S.slice(De.to-ae),ae=De.to}}}function eke(h,A,D,S){var R=!S&&D.widgetNode;R&&h.map.push(h.pos,h.pos+A,R),!S&&h.cm.display.input.needsContentAttribute&&(R||(R=h.content.appendChild(document.createElement("span"))),R.setAttribute("cm-marker",D.id)),R&&(h.cm.display.input.setUneditable(R),h.content.appendChild(R)),h.pos+=A,h.trailingSpace=!1}function Dwt(h,A,D){var S=h.markedSpans,R=h.text,j=0;if(S)for(var q,Q,re,ae,Se,De,Ue,Ge=R.length,at=0,yt=1,Ot="",Yt=0;;){if(Yt==at){re=ae=Se=Q="",Ue=null,De=null,Yt=1/0;for(var Jt=[],It=void 0,tn=0;tnat||fn.collapsed&&en.to==at&&en.from==at)){if(en.to!=null&&en.to!=at&&Yt>en.to&&(Yt=en.to,ae=""),fn.className&&(re+=" "+fn.className),fn.css&&(Q=(Q?Q+";":"")+fn.css),fn.startStyle&&en.from==at&&(Se+=" "+fn.startStyle),fn.endStyle&&en.to==Yt&&(It||(It=[])).push(fn.endStyle,en.to),fn.title&&((Ue||(Ue={})).title=fn.title),fn.attributes)for(var ro in fn.attributes)(Ue||(Ue={}))[ro]=fn.attributes[ro];fn.collapsed&&(!De||yX(De.marker,fn)<0)&&(De=en)}else en.from>at&&Yt>en.from&&(Yt=en.from)}if(It)for(var Zr=0;Zr=Ge)break;for(var ho=Math.min(Ge,Yt);;){if(Ot){var Cu=at+Ot.length;if(!De){var Jl=Cu>ho?Ot.slice(0,ho-at):Ot;A.addToken(A,Jl,q?q+re:re,Se,at+Jl.length==Yt?ae:"",Q,Ue)}if(Cu>=ho){Ot=Ot.slice(ho-at),at=ho;break}at=Cu,Se=""}Ot=R.slice(j,j=D[yt++]),q=JSe(D[yt++],A.cm.options)}}else for(var Bo=1;Bo2&&j.push((re.bottom+ae.top)/2-D.top)}}j.push(D.bottom-D.top)}}function ske(h,A,D){if(h.line==A)return{map:h.measure.map,cache:h.measure.cache};if(h.rest){for(var S=0;SD)return{map:h.measure.maps[R],cache:h.measure.caches[R],before:!0}}}function jwt(h,A){var D=cr(A=uc(A)),S=h.display.externalMeasured=new tke(h.doc,A,D);S.lineN=D;var R=S.built=ZSe(h,S);return S.text=R.pre,N(h.display.lineMeasure,R.pre),S}function uke(h,A,D,S){return Ad(h,i3(h,A),D,S)}function CX(h,A){if(A>=h.display.viewFrom&&A=D.lineN&&AA)&&(R=(j=re-Q)-1,A>=re&&(q="right")),R!=null){if(S=h[ae+2],Q==re&&D==(S.insertLeft?"left":"right")&&(q=D),D=="left"&&R==0)for(;ae&&h[ae-2]==h[ae-3]&&h[ae-1].insertLeft;)S=h[2+(ae-=3)],q="left";if(D=="right"&&R==re-Q)for(;ae=0&&(D=h[R]).left==D.right;R--);return D}function zwt(h,A,D,S){var R,j=dke(A.map,D,S),q=j.node,Q=j.start,re=j.end,ae=j.collapse;if(q.nodeType==3){for(var Se=0;Se<4;Se++){for(;Q&&Ve(A.line.text.charAt(j.coverStart+Q));)--Q;for(;j.coverStart+re0&&(ae=S="right"),R=h.options.lineWrapping&&(De=q.getClientRects()).length>1?De[S=="right"?De.length-1:0]:q.getBoundingClientRect()}if(a&&l<9&&!Q&&(!R||!R.left&&!R.right)){var Ue=q.parentNode.getClientRects()[0];R=Ue?{left:Ue.left,right:Ue.left+l3(h.display),top:Ue.top,bottom:Ue.bottom}:cke}for(var Ge=R.top-A.rect.top,at=R.bottom-A.rect.top,yt=(Ge+at)/2,Ot=A.view.measure.heights,Yt=0;Yt=S.text.length?(re=S.text.length,ae="before"):re<=0&&(re=0,ae="after"),!Q)return q(ae=="before"?re-1:re,ae=="before");function Se(at,yt,Ot){return q(Ot?at-1:at,Q[yt].level==1!=Ot)}var De=we(Q,re,ae),Ue=je,Ge=Se(re,De,ae=="before");return Ue!=null&&(Ge.other=Se(re,Ue,ae!="before")),Ge}function gke(h,A){var D=0;A=gn(h.doc,A),h.options.lineWrapping||(D=l3(h.display)*A.ch);var S=Ct(h.doc,A.line),R=Sf(S)+JD(h.display);return{left:D,right:D,top:R,bottom:R+S.height}}function kX(h,A,D,S,R){var j=Ee(h,A,D);return j.xRel=R,S&&(j.outside=S),j}function DX(h,A,D){var S=h.doc;if((D+=h.display.viewOffset)<0)return kX(S.first,0,null,-1,-1);var R=Ha(S,D),j=S.first+S.size-1;if(R>j)return kX(S.first+S.size-1,Ct(S,j).text.length,null,1,1);A<0&&(A=0);for(var q=Ct(S,R);;){var Q=$wt(h,q,R,A,D),re=gwt(q,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!re)return Q;var ae=re.find(1);if(ae.line==R)return ae;q=Ct(S,R=ae.line)}}function yke(h,A,D,S){S-=SX(A);var R=A.text.length,j=dt(function(q){return Ad(h,D,q-1).bottom<=S},R,0);return R=dt(function(q){return Ad(h,D,q).top>S},j,R),{begin:j,end:R}}function bke(h,A,D,S){return D||(D=i3(h,A)),yke(h,A,D,ZD(h,A,Ad(h,D,S),"line").top)}function OX(h,A,D,S){return!(h.bottom<=D)&&(h.top>D||(S?h.left:h.right)>A)}function $wt(h,A,D,S,R){R-=Sf(A);var j=i3(h,A),q=SX(A),Q=0,re=A.text.length,ae=!0,Se=me(A,h.doc.direction);if(Se){var De=(h.options.lineWrapping?Wwt:Uwt)(h,A,D,j,Se,S,R);Q=(ae=De.level!=1)?De.from:De.to-1,re=ae?De.to:De.from-1}var Ue,Ge,at=null,yt=null,Ot=dt(function(en){var fn=Ad(h,j,en);return fn.top+=q,fn.bottom+=q,!!OX(fn,S,R,!1)&&(fn.top<=R&&fn.left<=S&&(at=en,yt=fn),!0)},Q,re),Yt=!1;if(yt){var Jt=S-yt.left=tn.bottom?1:0}return kX(D,Ot=it(A.text,Ot,1),Ge,Yt,S-Ue)}function Uwt(h,A,D,S,R,j,q){var Q=dt(function(De){var Ue=R[De],Ge=Ue.level!=1;return OX(cc(h,Ee(D,Ge?Ue.to:Ue.from,Ge?"before":"after"),"line",A,S),j,q,!0)},0,R.length-1),re=R[Q];if(Q>0){var ae=re.level!=1,Se=cc(h,Ee(D,ae?re.from:re.to,ae?"after":"before"),"line",A,S);OX(Se,j,q,!0)&&Se.top>q&&(re=R[Q-1])}return re}function Wwt(h,A,D,S,R,j,q){var Q=yke(h,A,S,q),re=Q.begin,ae=Q.end;/\s/.test(A.text.charAt(ae-1))&&ae--;for(var Se=null,De=null,Ue=0;Ue=ae||Ge.to<=re)){var at=Ad(h,S,Ge.level!=1?Math.min(ae,Ge.to)-1:Math.max(re,Ge.from)).right,yt=atyt)&&(Se=Ge,De=yt)}}return Se||(Se=R[R.length-1]),Se.fromae&&(Se={from:Se.from,to:ae,level:Se.level}),Se}function a3(h){if(h.cachedTextHeight!=null)return h.cachedTextHeight;if(lm==null){lm=B("pre",null,"CodeMirror-line-like");for(var A=0;A<49;++A)lm.appendChild(document.createTextNode("x")),lm.appendChild(B("br"));lm.appendChild(document.createTextNode("x"))}N(h.measure,lm);var D=lm.offsetHeight/50;return D>3&&(h.cachedTextHeight=D),F(h.measure),D||1}function l3(h){if(h.cachedCharWidth!=null)return h.cachedCharWidth;var A=B("span","xxxxxxxxxx"),D=B("pre",[A],"CodeMirror-line-like");N(h.measure,D);var S=A.getBoundingClientRect(),R=(S.right-S.left)/10;return R>2&&(h.cachedCharWidth=R),R||10}function TX(h){for(var A=h.display,D={},S={},R=A.gutters.clientLeft,j=A.gutters.firstChild,q=0;j;j=j.nextSibling,++q){var Q=h.display.gutterSpecs[q].className;D[Q]=j.offsetLeft+j.clientLeft+R,S[Q]=j.clientWidth}return{fixedPos:MX(A),gutterTotalWidth:A.gutters.offsetWidth,gutterLeft:D,gutterWidth:S,wrapperWidth:A.wrapper.clientWidth}}function MX(h){return h.scroller.getBoundingClientRect().left-h.sizer.getBoundingClientRect().left}function Ake(h){var A=a3(h.display),D=h.options.lineWrapping,S=D&&Math.max(5,h.display.scroller.clientWidth/l3(h.display)-3);return function(R){if(r0(h.doc,R))return 0;var j=0;if(R.widgets)for(var q=0;q0&&(re=Ct(h.doc,ae.line).text).length==ae.ch){var Se=X(re,re.length,h.options.tabSize)-re.length;ae=Ee(ae.line,Math.max(0,Math.round((j-lke(h.display).left)/l3(h.display))-Se))}return ae}function um(h,A){if(A>=h.display.viewTo||(A-=h.display.viewFrom)<0)return null;for(var D=h.display.view,S=0;SA)&&(R.updateLineNumbers=A),h.curOp.viewChanged=!0,A>=R.viewTo)Cf&&bX(h.doc,A)R.viewFrom?i0(h):(R.viewFrom+=S,R.viewTo+=S);else if(A<=R.viewFrom&&D>=R.viewTo)i0(h);else if(A<=R.viewFrom){var j=tO(h,D,D+S,1);j?(R.view=R.view.slice(j.index),R.viewFrom=j.lineN,R.viewTo+=S):i0(h)}else if(D>=R.viewTo){var q=tO(h,A,A,-1);q?(R.view=R.view.slice(0,q.index),R.viewTo=q.lineN):i0(h)}else{var Q=tO(h,A,A,-1),re=tO(h,D,D+S,1);Q&&re?(R.view=R.view.slice(0,Q.index).concat(QD(h,Q.lineN,re.lineN)).concat(R.view.slice(re.index)),R.viewTo+=S):i0(h)}var ae=R.externalMeasured;ae&&(D=R.lineN&&A=S.viewTo)){var j=S.view[um(h,A)];if(j.node!=null){var q=j.changes||(j.changes=[]);ne(q,D)==-1&&q.push(D)}}}function i0(h){h.display.viewFrom=h.display.viewTo=h.doc.first,h.display.view=[],h.display.viewOffset=0}function tO(h,A,D,S){var R,j=um(h,A),q=h.display.view;if(!Cf||D==h.doc.first+h.doc.size)return{index:j,lineN:D};for(var Q=h.display.viewFrom,re=0;re0){if(j==q.length-1)return null;R=Q+q[j].size-A,j++}else R=Q-A;A+=R,D+=R}for(;bX(h.doc,D)!=D;){if(j==(S<0?0:q.length-1))return null;D+=S*q[j-(S<0?1:0)].size,j+=S}return{index:j,lineN:D}}function Gwt(h,A,D){var S=h.display;S.view.length==0||A>=S.viewTo||D<=S.viewFrom?(S.view=QD(h,A,D),S.viewFrom=A):(S.viewFrom>A?S.view=QD(h,A,S.viewFrom).concat(S.view):S.viewFromD&&(S.view=S.view.slice(0,um(h,D)))),S.viewTo=D}function wke(h){for(var A=h.display.view,D=0,S=0;S=h.display.viewTo||re.to().line0?q:h.defaultCharWidth())+"px"}if(S.other){var Q=D.appendChild(B("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Q.style.display="",Q.style.left=S.other.left+"px",Q.style.top=S.other.top+"px",Q.style.height=.85*(S.other.bottom-S.other.top)+"px"}}function nO(h,A){return h.top-A.top||h.left-A.left}function qwt(h,A,D){var S=h.display,R=h.doc,j=document.createDocumentFragment(),q=lke(h.display),Q=q.left,re=Math.max(S.sizerWidth,am(h)-S.sizer.offsetLeft)-q.right,ae=R.direction=="ltr";function Se(It,tn,en,fn){tn<0&&(tn=0),tn=Math.round(tn),fn=Math.round(fn),j.appendChild(B("div",null,"CodeMirror-selected","position: absolute; left: "+It+`px;
top: `+tn+"px; width: "+(en??re-It)+`px;
height: `+(fn-tn)+"px"))}function De(It,tn,en){var fn,ro,Zr=Ct(R,It),Ql=Zr.text.length;function ho(Bo,ml){return eO(h,Ee(It,Bo),"div",Zr,ml)}function Cu(Bo,ml,Ua){var si=bke(h,Zr,null,Bo),Ko=ml=="ltr"==(Ua=="after")?"left":"right";return ho(Ua=="after"?si.begin:si.end-(/\s/.test(Zr.text.charAt(si.end-1))?2:1),Ko)[Ko]}var Jl=me(Zr,R.direction);return ot(Jl,tn||0,en??Ql,function(Bo,ml,Ua,si){var Ko=Ua=="ltr",ui=ho(Bo,Ko?"left":"right"),gl=ho(ml-1,Ko?"right":"left"),d0=tn==null&&Bo==0,pc=en==null&&ml==Ql,Ca=si==0,ci=!Jl||si==Jl.length-1;if(gl.top-ui.top<=3){var iQ=(ae?pc:d0)&&ci,Tf=(ae?d0:pc)&&Ca?Q:(Ko?ui:gl).left,hm=iQ?re:(Ko?gl:ui).right;Se(Tf,ui.top,hm-Tf,ui.bottom)}else{var vm,Wa,A3,aQ;Ko?(vm=ae&&d0&&Ca?Q:ui.left,Wa=ae?re:Cu(Bo,Ua,"before"),A3=ae?Q:Cu(ml,Ua,"after"),aQ=ae&&pc&&ci?re:gl.right):(vm=ae?Cu(Bo,Ua,"before"):Q,Wa=!ae&&d0&&Ca?re:ui.right,A3=!ae&&pc&&ci?Q:gl.left,aQ=ae?Cu(ml,Ua,"after"):re),Se(vm,ui.top,Wa-vm,ui.bottom),ui.bottom0?A.blinker=setInterval(function(){h.hasFocus()||s3(h),A.cursorDiv.style.visibility=(D=!D)?"":"hidden"},h.options.cursorBlinkRate):h.options.cursorBlinkRate<0&&(A.cursorDiv.style.visibility="hidden")}}function _ke(h){h.hasFocus()||(h.display.input.focus(),h.state.focused||BX(h))}function IX(h){h.state.delayingBlurEvent=!0,setTimeout(function(){h.state.delayingBlurEvent&&(h.state.delayingBlurEvent=!1,h.state.focused&&s3(h))},100)}function BX(h,A){h.state.delayingBlurEvent&&!h.state.draggingText&&(h.state.delayingBlurEvent=!1),h.options.readOnly!="nocursor"&&(h.state.focused||(vt(h,"focus",h,A),h.state.focused=!0,H(h.display.wrapper,"CodeMirror-focused"),!h.curOp&&h.display.selForContextMenu!=h.doc.sel&&(h.display.input.reset(),s&&setTimeout(function(){return h.display.input.reset(!0)},20)),h.display.input.receivedFocus()),RX(h))}function s3(h,A){h.state.delayingBlurEvent||(h.state.focused&&(vt(h,"blur",h,A),h.state.focused=!1,O(h.display.wrapper,"CodeMirror-focused")),clearInterval(h.display.blinker),setTimeout(function(){h.state.focused||(h.display.shift=!1)},150))}function rO(h){for(var A=h.display,D=A.lineDiv.offsetTop,S=Math.max(0,A.scroller.getBoundingClientRect().top),R=A.lineDiv.getBoundingClientRect().top,j=0,q=0;q.005||Ge<-.005)&&(Rh.display.sizerWidth){var yt=Math.ceil(Se/l3(h.display));yt>h.display.maxLineLength&&(h.display.maxLineLength=yt,h.display.maxLine=Q.line,h.display.maxLineChanged=!0)}}}Math.abs(j)>2&&(A.scroller.scrollTop+=j)}function Eke(h){if(h.widgets)for(var A=0;A=q&&(j=Ha(A,Sf(Ct(A,re))-h.wrapper.clientHeight),q=re)}return{from:j,to:Math.max(q,j+1)}}function Kwt(h,A){if(!qt(h,"scrollCursorIntoView")){var D=h.display,S=D.sizer.getBoundingClientRect(),R=null,j=D.wrapper.ownerDocument;if(A.top+S.top<0?R=!0:A.bottom+S.top>(j.defaultView.innerHeight||j.documentElement.clientHeight)&&(R=!1),R!=null&&!v){var q=B("div","\u200B",null,`position: absolute;
top: `+(A.top-D.viewOffset-JD(h.display))+`px;
height: `+(A.bottom-A.top+bd(h)+D.barHeight)+`px;
left: `+A.left+"px; width: "+Math.max(2,A.right-A.left)+"px;");h.display.lineSpace.appendChild(q),q.scrollIntoView(R),h.display.lineSpace.removeChild(q)}}}function Ywt(h,A,D,S){var R;S==null&&(S=0),!h.options.lineWrapping&&A==D&&(D=A.sticky=="before"?Ee(A.line,A.ch+1,"before"):A,A=A.ch?Ee(A.line,A.sticky=="before"?A.ch-1:A.ch,"after"):A);for(var j=0;j<5;j++){var q=!1,Q=cc(h,A),re=D&&D!=A?cc(h,D):Q,ae=LX(h,R={left:Math.min(Q.left,re.left),top:Math.min(Q.top,re.top)-S,right:Math.max(Q.left,re.left),bottom:Math.max(Q.bottom,re.bottom)+S}),Se=h.doc.scrollTop,De=h.doc.scrollLeft;if(ae.scrollTop!=null&&(rw(h,ae.scrollTop),Math.abs(h.doc.scrollTop-Se)>1&&(q=!0)),ae.scrollLeft!=null&&(cm(h,ae.scrollLeft),Math.abs(h.doc.scrollLeft-De)>1&&(q=!0)),!q)break}return R}function Xwt(h,A){var D=LX(h,A);D.scrollTop!=null&&rw(h,D.scrollTop),D.scrollLeft!=null&&cm(h,D.scrollLeft)}function LX(h,A){var D=h.display,S=a3(h.display);A.top<0&&(A.top=0);var R=h.curOp&&h.curOp.scrollTop!=null?h.curOp.scrollTop:D.scroller.scrollTop,j=EX(h),q={};A.bottom-A.top>j&&(A.bottom=A.top+j);var Q=h.doc.height+_X(D),re=A.topQ-S;if(A.topR+j){var Se=Math.min(A.top,(ae?Q:A.bottom)-j);Se!=R&&(q.scrollTop=Se)}var De=h.options.fixedGutter?0:D.gutters.offsetWidth,Ue=h.curOp&&h.curOp.scrollLeft!=null?h.curOp.scrollLeft:D.scroller.scrollLeft-De,Ge=am(h)-D.gutters.offsetWidth,at=A.right-A.left>Ge;return at&&(A.right=A.left+Ge),A.left<10?q.scrollLeft=0:A.leftGe+Ue-3&&(q.scrollLeft=A.right+(at?0:10)-Ge),q}function PX(h,A){A!=null&&(iO(h),h.curOp.scrollTop=(h.curOp.scrollTop==null?h.doc.scrollTop:h.curOp.scrollTop)+A)}function u3(h){iO(h);var A=h.getCursor();h.curOp.scrollToPos={from:A,to:A,margin:h.options.cursorScrollMargin}}function nw(h,A,D){(A!=null||D!=null)&&iO(h),A!=null&&(h.curOp.scrollLeft=A),D!=null&&(h.curOp.scrollTop=D)}function Qwt(h,A){iO(h),h.curOp.scrollToPos=A}function iO(h){var A=h.curOp.scrollToPos;A&&(h.curOp.scrollToPos=null,Cke(h,gke(h,A.from),gke(h,A.to),A.margin))}function Cke(h,A,D,S){var R=LX(h,{left:Math.min(A.left,D.left),top:Math.min(A.top,D.top)-S,right:Math.max(A.right,D.right),bottom:Math.max(A.bottom,D.bottom)+S});nw(h,R.scrollLeft,R.scrollTop)}function rw(h,A){Math.abs(h.doc.scrollTop-A)<2||(n||VX(h,{top:A}),Ske(h,A,!0),n&&VX(h),aw(h,100))}function Ske(h,A,D){A=Math.max(0,Math.min(h.display.scroller.scrollHeight-h.display.scroller.clientHeight,A)),(h.display.scroller.scrollTop!=A||D)&&(h.doc.scrollTop=A,h.display.scrollbars.setScrollTop(A),h.display.scroller.scrollTop!=A&&(h.display.scroller.scrollTop=A))}function cm(h,A,D,S){A=Math.max(0,Math.min(A,h.display.scroller.scrollWidth-h.display.scroller.clientWidth)),(!(D?A==h.doc.scrollLeft:Math.abs(h.doc.scrollLeft-A)<2)||S)&&(h.doc.scrollLeft=A,Mke(h),h.display.scroller.scrollLeft!=A&&(h.display.scroller.scrollLeft=A),h.display.scrollbars.setScrollLeft(A))}function ow(h){var A=h.display,D=A.gutters.offsetWidth,S=Math.round(h.doc.height+_X(h.display));return{clientHeight:A.scroller.clientHeight,viewHeight:A.wrapper.clientHeight,scrollWidth:A.scroller.scrollWidth,clientWidth:A.scroller.clientWidth,viewWidth:A.wrapper.clientWidth,barLeft:h.options.fixedGutter?D:0,docHeight:S,scrollHeight:S+bd(h)+A.barHeight,nativeBarWidth:A.nativeBarWidth,gutterWidth:D}}var dm=function(h,A,D){this.cm=D;var S=this.vert=B("div",[B("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),R=this.horiz=B("div",[B("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");S.tabIndex=R.tabIndex=-1,h(S),h(R),Ie(S,"scroll",function(){S.clientHeight&&A(S.scrollTop,"vertical")}),Ie(R,"scroll",function(){R.clientWidth&&A(R.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};dm.prototype.update=function(h){var A=h.scrollWidth>h.clientWidth+1,D=h.scrollHeight>h.clientHeight+1,S=h.nativeBarWidth;if(D){this.vert.style.display="block",this.vert.style.bottom=A?S+"px":"0";var R=h.viewHeight-(A?S:0);this.vert.firstChild.style.height=Math.max(0,h.scrollHeight-h.clientHeight+R)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(A){this.horiz.style.display="block",this.horiz.style.right=D?S+"px":"0",this.horiz.style.left=h.barLeft+"px";var j=h.viewWidth-h.barLeft-(D?S:0);this.horiz.firstChild.style.width=Math.max(0,h.scrollWidth-h.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&h.clientHeight>0&&(S==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:D?S:0,bottom:A?S:0}},dm.prototype.setScrollLeft=function(h){this.horiz.scrollLeft!=h&&(this.horiz.scrollLeft=h),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},dm.prototype.setScrollTop=function(h){this.vert.scrollTop!=h&&(this.vert.scrollTop=h),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},dm.prototype.zeroWidthHack=function(){var h=w&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=h,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new te,this.disableVert=new te},dm.prototype.enableZeroWidthBar=function(h,A,D){function S(){var R=h.getBoundingClientRect();(D=="vert"?document.elementFromPoint(R.right-1,(R.top+R.bottom)/2):document.elementFromPoint((R.right+R.left)/2,R.bottom-1))!=h?h.style.visibility="hidden":A.set(1e3,S)}h.style.visibility="",A.set(1e3,S)},dm.prototype.clear=function(){var h=this.horiz.parentNode;h.removeChild(this.horiz),h.removeChild(this.vert)};var iw=function(){};function c3(h,A){A||(A=ow(h));var D=h.display.barWidth,S=h.display.barHeight;kke(h,A);for(var R=0;R<4&&D!=h.display.barWidth||S!=h.display.barHeight;R++)D!=h.display.barWidth&&h.options.lineWrapping&&rO(h),kke(h,ow(h)),D=h.display.barWidth,S=h.display.barHeight}function kke(h,A){var D=h.display,S=D.scrollbars.update(A);D.sizer.style.paddingRight=(D.barWidth=S.right)+"px",D.sizer.style.paddingBottom=(D.barHeight=S.bottom)+"px",D.heightForcer.style.borderBottom=S.bottom+"px solid transparent",S.right&&S.bottom?(D.scrollbarFiller.style.display="block",D.scrollbarFiller.style.height=S.bottom+"px",D.scrollbarFiller.style.width=S.right+"px"):D.scrollbarFiller.style.display="",S.bottom&&h.options.coverGutterNextToScrollbar&&h.options.fixedGutter?(D.gutterFiller.style.display="block",D.gutterFiller.style.height=S.bottom+"px",D.gutterFiller.style.width=A.gutterWidth+"px"):D.gutterFiller.style.display=""}iw.prototype.update=function(){return{bottom:0,right:0}},iw.prototype.setScrollLeft=function(){},iw.prototype.setScrollTop=function(){},iw.prototype.clear=function(){};var Dke={native:dm,null:iw};function Oke(h){h.display.scrollbars&&(h.display.scrollbars.clear(),h.display.scrollbars.addClass&&O(h.display.wrapper,h.display.scrollbars.addClass)),h.display.scrollbars=new Dke[h.options.scrollbarStyle](function(A){h.display.wrapper.insertBefore(A,h.display.scrollbarFiller),Ie(A,"mousedown",function(){h.state.focused&&setTimeout(function(){return h.display.input.focus()},0)}),A.setAttribute("cm-not-content","true")},function(A,D){D=="horizontal"?cm(h,A):rw(h,A)},h),h.display.scrollbars.addClass&&H(h.display.wrapper,h.display.scrollbars.addClass)}var Jwt=0;function fm(h){h.curOp={cm:h,viewChanged:!1,startHeight:h.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jwt,markArrays:null},Owt(h.curOp)}function pm(h){var A=h.curOp;A&&Mwt(A,function(D){for(var S=0;S=D.viewTo)||D.maxLineChanged&&A.options.lineWrapping,h.update=h.mustUpdate&&new aO(A,h.mustUpdate&&{top:h.scrollTop,ensure:h.scrollToPos},h.forceUpdate)}function t7t(h){h.updatedDisplay=h.mustUpdate&&jX(h.cm,h.update)}function n7t(h){var A=h.cm,D=A.display;h.updatedDisplay&&rO(A),h.barMeasure=ow(A),D.maxLineChanged&&!A.options.lineWrapping&&(h.adjustWidthTo=uke(A,D.maxLine,D.maxLine.text.length).left+3,A.display.sizerWidth=h.adjustWidthTo,h.barMeasure.scrollWidth=Math.max(D.scroller.clientWidth,D.sizer.offsetLeft+h.adjustWidthTo+bd(A)+A.display.barWidth),h.maxScrollLeft=Math.max(0,D.sizer.offsetLeft+h.adjustWidthTo-am(A))),(h.updatedDisplay||h.selectionChanged)&&(h.preparedSelection=D.input.prepareSelection())}function r7t(h){var A=h.cm;h.adjustWidthTo!=null&&(A.display.sizer.style.minWidth=h.adjustWidthTo+"px",h.maxScrollLeft=h.display.viewTo)){var D=+new Date+h.options.workTime,S=yd(h,A.highlightFrontier),R=[];A.iter(S.line,Math.min(A.first+A.size,h.display.viewTo+500),function(j){if(S.line>=h.display.viewFrom){var q=j.styles,Q=j.text.length>h.options.maxHighlightLength?ut(A.mode,S.state):null,re=om(h,j,S,!0);Q&&(S.state=Q),j.styles=re.styles;var ae=j.styleClasses,Se=re.classes;Se?j.styleClasses=Se:ae&&(j.styleClasses=null);for(var De=!q||q.length!=j.styles.length||ae!=Se&&(!ae||!Se||ae.bgClass!=Se.bgClass||ae.textClass!=Se.textClass),Ue=0;!De&&UeD)return aw(h,h.options.workDelay),!0}),A.highlightFrontier=S.line,A.modeFrontier=Math.max(A.modeFrontier,S.line),R.length&&Xl(h,function(){for(var j=0;j=D.viewFrom&&A.visible.to<=D.viewTo&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo)&&D.renderedView==D.view&&wke(h)==0)return!1;Nke(h)&&(i0(h),A.dims=TX(h));var R=S.first+S.size,j=Math.max(A.visible.from-h.options.viewportMargin,S.first),q=Math.min(R,A.visible.to+h.options.viewportMargin);D.viewFromq&&D.viewTo-q<20&&(q=Math.min(R,D.viewTo)),Cf&&(j=bX(h.doc,j),q=QSe(h.doc,q));var Q=j!=D.viewFrom||q!=D.viewTo||D.lastWrapHeight!=A.wrapperHeight||D.lastWrapWidth!=A.wrapperWidth;Gwt(h,j,q),D.viewOffset=Sf(Ct(h.doc,D.viewFrom)),h.display.mover.style.top=D.viewOffset+"px";var re=wke(h);if(!Q&&re==0&&!A.force&&D.renderedView==D.view&&(D.updateLineNumbers==null||D.updateLineNumbers>=D.viewTo))return!1;var ae=l7t(h);return re>4&&(D.lineDiv.style.display="none"),u7t(h,D.updateLineNumbers,A.dims),re>4&&(D.lineDiv.style.display=""),D.renderedView=D.view,s7t(ae),F(D.cursorDiv),F(D.selectionDiv),D.gutters.style.height=D.sizer.style.minHeight=0,Q&&(D.lastWrapHeight=A.wrapperHeight,D.lastWrapWidth=A.wrapperWidth,aw(h,400)),D.updateLineNumbers=null,!0}function Tke(h,A){for(var D=A.viewport,S=!0;;S=!1){if(S&&h.options.lineWrapping&&A.oldDisplayWidth!=am(h))S&&(A.visible=oO(h.display,h.doc,D));else if(D&&D.top!=null&&(D={top:Math.min(h.doc.height+_X(h.display)-EX(h),D.top)}),A.visible=oO(h.display,h.doc,D),A.visible.from>=h.display.viewFrom&&A.visible.to<=h.display.viewTo)break;if(!jX(h,A))break;rO(h);var R=ow(h);tw(h),c3(h,R),HX(h,R),A.force=!1}A.signal(h,"update",h),(h.display.viewFrom!=h.display.reportedViewFrom||h.display.viewTo!=h.display.reportedViewTo)&&(A.signal(h,"viewportChange",h,h.display.viewFrom,h.display.viewTo),h.display.reportedViewFrom=h.display.viewFrom,h.display.reportedViewTo=h.display.viewTo)}function VX(h,A){var D=new aO(h,A);if(jX(h,D)){rO(h),Tke(h,D);var S=ow(h);tw(h),c3(h,S),HX(h,S),D.finish()}}function u7t(h,A,D){var S=h.display,R=h.options.lineNumbers,j=S.lineDiv,q=j.firstChild;function Q(at){var yt=at.nextSibling;return s&&w&&h.display.currentWheelTarget==at?at.style.display="none":at.parentNode.removeChild(at),yt}for(var re=S.view,ae=S.viewFrom,Se=0;Se-1&&(Ue=!1),nke(h,De,ae,D)),Ue&&(F(De.lineNumber),De.lineNumber.appendChild(document.createTextNode(xe(h.options,ae)))),q=De.node.nextSibling}else{var Ge=Bwt(h,De,ae,D);j.insertBefore(Ge,q)}ae+=De.size}for(;q;)q=Q(q)}function zX(h){var A=h.gutters.offsetWidth;h.sizer.style.marginLeft=A+"px",Vi(h,"gutterChanged",h)}function HX(h,A){h.display.sizer.style.minHeight=A.docHeight+"px",h.display.heightForcer.style.top=A.docHeight+"px",h.display.gutters.style.height=A.docHeight+h.display.barHeight+bd(h)+"px"}function Mke(h){var A=h.display,D=A.view;if(A.alignWidgets||A.gutters.firstChild&&h.options.fixedGutter){for(var S=MX(A)-A.scroller.scrollLeft+h.doc.scrollLeft,R=A.gutters.offsetWidth,j=S+"px",q=0;qQ.clientWidth,ae=Q.scrollHeight>Q.clientHeight;if(S&&re||R&&ae){if(R&&w&&s){e:for(var Se=A.target,De=q.view;Se!=Q;Se=Se.parentNode)for(var Ue=0;Ue=0&&Ze(h,S.to())<=0)return D}return-1};var Vr=function(h,A){this.anchor=h,this.head=A};function dc(h,A,D){var S=h&&h.options.selectionsMayTouch,R=A[D];A.sort(function(Ue,Ge){return Ze(Ue.from(),Ge.from())}),D=ne(A,R);for(var j=1;j0:re>=0){var ae=Pn(Q.from(),q.from()),Se=on(Q.to(),q.to()),De=Q.empty()?q.from()==q.head:Q.from()==Q.head;j<=D&&--D,A.splice(--j,2,new Vr(De?Se:ae,De?ae:Se))}}return new js(A,D)}function a0(h,A){return new js([new Vr(h,A||h)],0)}function l0(h){return h.text?Ee(h.from.line+h.text.length-1,Ce(h.text).length+(h.text.length==1?h.from.ch:0)):h.to}function Bke(h,A){if(Ze(h,A.from)<0)return h;if(Ze(h,A.to)<=0)return l0(A);var D=h.line+A.text.length-(A.to.line-A.from.line)-1,S=h.ch;return h.line==A.to.line&&(S+=l0(A).ch-A.to.ch),Ee(D,S)}function UX(h,A){for(var D=[],S=0;S1&&h.remove(Q.line+1,at-1),h.insert(Q.line+1,Yt)}Vi(h,"change",h,A)}function s0(h,A,D){function S(R,j,q){if(R.linked)for(var Q=0;Q1&&!h.done[h.done.length-2].ranges?(h.done.pop(),Ce(h.done)):void 0}function Hke(h,A,D,S){var R=h.history;R.undone.length=0;var j,q,Q=+new Date;if((R.lastOp==S||R.lastOrigin==A.origin&&A.origin&&(A.origin.charAt(0)=="+"&&R.lastModTime>Q-(h.cm?h.cm.options.historyEventDelay:500)||A.origin.charAt(0)=="*"))&&(j=h7t(R,R.lastOp==S)))q=Ce(j.changes),Ze(A.from,A.to)==0&&Ze(A.from,q.to)==0?q.to=l0(A):j.changes.push(qX(h,A));else{var re=Ce(R.done);for((!re||!re.ranges)&&uO(h.sel,R.done),j={changes:[qX(h,A)],generation:R.generation},R.done.push(j);R.done.length>R.undoDepth;)R.done.shift(),R.done[0].ranges||R.done.shift()}R.done.push(D),R.generation=++R.maxGeneration,R.lastModTime=R.lastSelTime=Q,R.lastOp=R.lastSelOp=S,R.lastOrigin=R.lastSelOrigin=A.origin,q||vt(h,"historyAdded")}function v7t(h,A,D,S){var R=A.charAt(0);return R=="*"||R=="+"&&D.ranges.length==S.ranges.length&&D.somethingSelected()==S.somethingSelected()&&new Date-h.history.lastSelTime<=(h.cm?h.cm.options.historyEventDelay:500)}function m7t(h,A,D,S){var R=h.history,j=S&&S.origin;D==R.lastSelOp||j&&R.lastSelOrigin==j&&(R.lastModTime==R.lastSelTime&&R.lastOrigin==j||v7t(h,j,Ce(R.done),A))?R.done[R.done.length-1]=A:uO(A,R.done),R.lastSelTime=+new Date,R.lastSelOrigin=j,R.lastSelOp=D,S&&S.clearRedo!==!1&&zke(R.undone)}function uO(h,A){var D=Ce(A);D&&D.ranges&&D.equals(h)||A.push(h)}function $ke(h,A,D,S){var R=A["spans_"+h.id],j=0;h.iter(Math.max(h.first,D),Math.min(h.first+h.size,S),function(q){q.markedSpans&&((R||(R=A["spans_"+h.id]={}))[j]=q.markedSpans),++j})}function g7t(h){if(!h)return null;for(var A,D=0;D-1&&(Ce(Q)[De]=ae[De],delete ae[De])}}}return S}function KX(h,A,D,S){if(S){var R=h.anchor;if(D){var j=Ze(A,R)<0;j!=Ze(D,R)<0?(R=A,A=D):j!=Ze(A,D)<0&&(A=D)}return new Vr(R,A)}return new Vr(D||A,A)}function cO(h,A,D,S,R){R==null&&(R=h.cm&&(h.cm.display.shift||h.extend)),Ea(h,new js([KX(h.sel.primary(),A,D,R)],0),S)}function Wke(h,A,D){for(var S=[],R=h.cm&&(h.cm.display.shift||h.extend),j=0;j=A.ch:Q.to>A.ch))){if(R&&(vt(re,"beforeCursorEnter"),re.explicitlyCleared)){if(j.markedSpans){--q;continue}break}if(!re.atomic)continue;if(D){var De=re.find(S<0?1:-1),Ue=void 0;if((S<0?Se:ae)&&(De=Qke(h,De,-S,De&&De.line==A.line?j:null)),De&&De.line==A.line&&(Ue=Ze(De,D))&&(S<0?Ue<0:Ue>0))return f3(h,De,A,S,R)}var Ge=re.find(S<0?-1:1);return(S<0?ae:Se)&&(Ge=Qke(h,Ge,S,Ge.line==A.line?j:null)),Ge?f3(h,Ge,A,S,R):null}}return A}function fO(h,A,D,S,R){var j=S||1;return f3(h,A,D,j,R)||!R&&f3(h,A,D,j,!0)||f3(h,A,D,-j,R)||!R&&f3(h,A,D,-j,!0)||(h.cantEdit=!0,Ee(h.first,0))}function Qke(h,A,D,S){return D<0&&A.ch==0?A.line>h.first?gn(h,Ee(A.line-1)):null:D>0&&A.ch==(S||Ct(h,A.line)).text.length?A.line=0;--R)eDe(h,{from:S[R].from,to:S[R].to,text:R?[""]:A.text,origin:A.origin});else eDe(h,A)}}function eDe(h,A){if(A.text.length!=1||A.text[0]!=""||Ze(A.from,A.to)!=0){var D=UX(h,A);Hke(h,A,D,h.cm?h.cm.curOp.id:NaN),uw(h,A,D,gX(h,A));var S=[];s0(h,function(R,j){!j&&ne(S,R.history)==-1&&(oDe(R.history,A),S.push(R.history)),uw(R,A,null,gX(R,A))})}}function pO(h,A,D){var S=h.cm&&h.cm.state.suppressEdits;if(!S||D){for(var R,j=h.history,q=h.sel,Q=A=="undo"?j.done:j.undone,re=A=="undo"?j.undone:j.done,ae=0;ae=0;--Ge){var at=Ue(Ge);if(at)return at.v}}}}function tDe(h,A){if(A!=0&&(h.first+=A,h.sel=new js(_e(h.sel.ranges,function(R){return new Vr(Ee(R.anchor.line+A,R.anchor.ch),Ee(R.head.line+A,R.head.ch))}),h.sel.primIndex),h.cm)){hl(h.cm,h.first,h.first-A,A);for(var D=h.cm.display,S=D.viewFrom;Sh.lastLine())){if(A.from.linej&&(A={from:A.from,to:Ee(j,Ct(h,j).text.length),text:[A.text[0]],origin:A.origin}),A.removed=Fn(h,A.from,A.to),D||(D=UX(h,A)),h.cm?A7t(h.cm,A,S):GX(h,A,S),dO(h,D,J),h.cantEdit&&fO(h,Ee(h.firstLine(),0))&&(h.cantEdit=!1)}}function A7t(h,A,D){var S=h.doc,R=h.display,j=A.from,q=A.to,Q=!1,re=j.line;h.options.lineWrapping||(re=cr(uc(Ct(S,j.line))),S.iter(re,q.line+1,function(Ge){if(Ge==R.maxLine)return Q=!0,!0})),S.sel.contains(A.from,A.to)>-1&&mn(h),GX(S,A,D,Ake(h)),h.options.lineWrapping||(S.iter(re,j.line+A.text.length,function(Ge){var at=XD(Ge);at>R.maxLineLength&&(R.maxLine=Ge,R.maxLineLength=at,R.maxLineChanged=!0,Q=!1)}),Q&&(h.curOp.updateMaxLine=!0)),uwt(S,j.line),aw(h,400);var ae=A.text.length-(q.line-j.line)-1;A.full?hl(h):j.line!=q.line||A.text.length!=1||Pke(h.doc,A)?hl(h,j.line,q.line+1,ae):o0(h,j.line,"text");var Se=Zt(h,"changes"),De=Zt(h,"change");if(De||Se){var Ue={from:j,to:q,text:A.text,removed:A.removed,origin:A.origin};De&&Vi(h,"change",h,Ue),Se&&(h.curOp.changeObjs||(h.curOp.changeObjs=[])).push(Ue)}h.display.selForContextMenu=null}function h3(h,A,D,S,R){var j;S||(S=D),Ze(S,D)<0&&(D=(j=[S,D])[0],S=j[1]),typeof A=="string"&&(A=h.splitLines(A)),p3(h,{from:D,to:S,text:A,origin:R})}function nDe(h,A,D,S){D1||!(this.children[0]instanceof dw))){var Q=[];this.collapse(Q),this.children=[new dw(Q)],this.children[0].parent=this}},collapse:function(h){for(var A=0;A