@mora-light/vue
Version:
Mora Light Vue
1 lines • 406 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var vue=require("vue"),candid=require("@mora-light/core/types/candid"),common=require("@mora-light/core/types/common"),running=require("@mora-light/core/types/running"),types=require("@mora-light/core/types"),transform=require("@mora-light/core/types/transform"),source=require("@mora-light/core/types/source"),useClipboard=require("vue-clipboard3"),elementPlus=require("element-plus"),FileSaver=require("file-saver"),XLSX=require("xlsx"),agent=require("@dfinity/agent"),authClient=require("@dfinity/auth-client"),sdkWeb=require("@astrox/sdk-web"),iconsVue=require("@element-plus/icons-vue");const _hoisted_1$1l={class:"bool-input-content"},_hoisted_2$1e=["checked","disabled"];var script$1m=vue.defineComponent({__name:"BoolInput",props:{trueText:{type:String,default:"true"},falseText:{type:String,default:"false"},initial:{type:Boolean,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(n.initial);let a=!1;vue.onBeforeMount((()=>u())),vue.watch((()=>n.initial),((e,t)=>{common.same(e,t)||u()}));const u=()=>{const e=!!n.initial;a&&i.value===e||(i.value=e,a=!0,r())};vue.watch((()=>i.value),(()=>r()));const o=()=>i.value=!i.value,r=()=>t("changed",a?{ok:i.value}:{err:{message:"bool input has not been initial."}});return(t,a)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1l,[vue.createElementVNode("input",{type:"checkbox",checked:i.value,disabled:n.disabled,onChange:o},null,40,_hoisted_2$1e),vue.createElementVNode("span",null,vue.toDisplayString(i.value?e.trueText?e.trueText:"true":e.falseText?e.falseText:"false"),1)]))}});script$1m.__scopeId="data-v-62af7cab",script$1m.__file="src/light/components/constant/basic/BoolInput.vue";const _hoisted_1$1k={class:"integer-input-content"},_hoisted_2$1d=["disabled","placeholder"],_hoisted_3$X={key:0,class:"tip"};var script$1l=vue.defineComponent({__name:"IntegerInput",props:{isBigInt:{type:Boolean,required:!0},regex:{type:String,required:!0},error:{type:String,required:!0},placeholder:{type:String,required:!0},maxValue:{type:String,required:!0},minValue:{type:String,required:!0},initial:{validator:e=>["number","bigint","string"].includes(typeof e),required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(`${n.initial}`),u=vue.computed((()=>{if(!a.value.match(n.regex))return;const e=a.value;return n.isBigInt?BigInt(e):parseInt(e)})),o=vue.computed((()=>{if(!a.value.match(n.regex))return!1;const e=u.value;if(void 0===e)return!1;if("number"==typeof e){if(""!==n.maxValue){if(e>parseInt(n.maxValue))return!1}if(""!==n.minValue){if(e<parseInt(n.minValue))return!1}}else{if(""!==n.maxValue){if(e>BigInt(n.maxValue))return!1}if(""!==n.minValue){if(e<BigInt(n.minValue))return!1}}return!0})),r=vue.computed((()=>{if(""!==n.minValue&&n.maxValue===n.minValue)return`${n.error}, Unique value: ${n.minValue}`;let e=""+(""!==n.minValue?`, Minimum:${n.minValue}`:"");return e=e+""+(""!==n.maxValue?`, Maximum:${n.maxValue}`:""),`${n.error}${""!==n.maxValue&&""!==n.minValue?`, scope: [${n.minValue},${n.maxValue}]`:`${e}`}`}));let l=!1;vue.onBeforeMount((()=>s())),vue.watch((()=>[n.placeholder,n.regex,n.maxValue,n.minValue,n.isBigInt,n.error,n.initial]),((e,t)=>{common.same(e,t)||s()}));const s=()=>{const e=`${n.initial}`;l&&a.value===e||(a.value=e,l=!0,d())};vue.watch((()=>a.value),(()=>d()));const c=()=>{let e=a.value.trim();e!==a.value&&(a.value=e)},d=()=>common.checkAndExecute(!!i.value,(()=>t("changed",(()=>{if(!l)return{err:{message:"integer input has not been initial."}};const e=u.value;return o.value&&void 0!==e?{ok:e}:{err:{message:"value is not a valid number",el:i.value}}})())),d);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1k,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:n.placeholder?n.placeholder:r.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),onInput:c,ref_key:"inputRef",ref:i},null,40,_hoisted_2$1d),[[vue.vModelText,a.value]]),o.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$X,[vue.createElementVNode("p",null,vue.toDisplayString(r.value?r.value:"Please enter the number that meets the requirements"),1)]))]))}});script$1l.__scopeId="data-v-224f21d1",script$1l.__file="src/light/components/constant/basic/IntegerInput.vue";const _hoisted_1$1j={class:"float-input-content"},_hoisted_2$1c=["disabled","placeholder"],_hoisted_3$W={key:0,class:"tip"};var script$1k=vue.defineComponent({__name:"FloatInput",props:{regex:{type:String,required:!0},error:{type:String,required:!0},placeholder:{type:String,required:!0},decimal:{type:Number,required:!0},initial:{type:[Number,String],required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(`${n.initial}`),u=vue.computed((()=>{if(!a.value.match(n.regex))return;const e=a.value;return parseFloat(e)})),o=vue.computed((()=>{if(!a.value.match(n.regex))return!1;const e=u.value;if(void 0===e)return!1;const t=`${e}`,i=t.indexOf(".");return!(i>=0&&t.split(/e|E/)[0].length-i-1>n.decimal)})),r=vue.computed((()=>`${n.error}, Maximum accuracy: ${n.decimal}`));let l=!1;vue.onBeforeMount((()=>s())),vue.watch((()=>[n.placeholder,n.regex,n.error,n.initial]),((e,t)=>{common.same(e,t)||s()}));const s=()=>{const e=`${n.initial}`;l&&a.value===e||(a.value=e,l=!0,d())};vue.watch((()=>a.value),(()=>d()));const c=()=>{let e=a.value.trim();e!==a.value&&(a.value=e)},d=()=>common.checkAndExecute(!!i.value,(()=>t("changed",(()=>{if(!l)return{err:{message:"float input has not been initial."}};const e=u.value;return o.value&&void 0!==e?{ok:e}:{err:{message:"value is not a valid number",el:i.value}}})())),d);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1j,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:n.placeholder?n.placeholder:r.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),onInput:c,ref_key:"inputRef",ref:i},null,40,_hoisted_2$1c),[[vue.vModelText,a.value]]),o.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$W,[vue.createElementVNode("p",null,vue.toDisplayString(r.value?r.value:"Please enter the number that meets the requirements"),1)]))]))}});script$1k.__scopeId="data-v-10f981b3",script$1k.__file="src/light/components/constant/basic/FloatInput.vue";const _hoisted_1$1i={class:"null-input-content"};var script$1j=vue.defineComponent({__name:"NullInput",emits:["changed"],setup(e,{emit:t}){const n=vue.ref();let i=!1;vue.onBeforeMount((()=>a()));const a=()=>{i=!0,u()},u=()=>common.checkAndExecute(!!n.value,(()=>t("changed",i?{ok:null}:{err:{message:"null input has not been initial."}})),u);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1i,[vue.createElementVNode("span",{ref_key:"inputRef",ref:n},vue.toDisplayString("null"),512)]))}});script$1j.__scopeId="data-v-004f92ae",script$1j.__file="src/light/components/constant/basic/NullInput.vue";const _hoisted_1$1h={class:"text-input-content"},_hoisted_2$1b=["disabled","placeholder"],_hoisted_3$V={key:0,class:"tip"};var script$1i=vue.defineComponent({__name:"TextInput",props:{validator:{type:[String,Function],required:!0},placeholder:{type:String,required:!0},trim:{type:Boolean,required:!0},maxLength:{type:Number,required:!0},error:{type:String,required:!0},initial:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(n.initial),u=vue.computed((()=>n.trim?a.value.trim():a.value)),o=vue.computed((()=>{if(n.validator)if("function"==typeof n.validator){if(!n.validator.call(null,u.value))return!1}else if(!u.value.match(n.validator))return!1;return u.value.length<=n.maxLength})),r=vue.computed((()=>n.error+(4096===n.maxLength?"":`, The maximum length: ${n.maxLength}`)));let l=!1;vue.onBeforeMount((()=>s())),vue.watch((()=>n.initial),((e,t)=>{common.same(e,t)||s()}));const s=()=>{const e=n.initial;l&&a.value===e||(a.value=e,l=!0,c())};vue.watch((()=>u.value),(()=>c()));const c=()=>common.checkAndExecute(!!i.value,(()=>t("changed",l?o.value?{ok:u.value}:{err:{message:"value is not valid",el:i.value}}:{err:{message:"text input has not been initial."}})),c);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1h,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:n.placeholder?n.placeholder:r.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),ref_key:"inputRef",ref:i},null,8,_hoisted_2$1b),[[vue.vModelText,a.value]]),o.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$V,[vue.createElementVNode("p",null,vue.toDisplayString(r.value?r.value:"Please enter the content that meets the requirements"),1)]))]))}});script$1i.__scopeId="data-v-8d696470",script$1i.__file="src/light/components/constant/basic/TextInput.vue";const _hoisted_1$1g={class:"principal-input-content"},_hoisted_2$1a=["disabled","placeholder"],_hoisted_3$U={key:0,class:"tip"};var script$1h=vue.defineComponent({__name:"PrincipalInput",props:{placeholder:{type:String,required:!0},error:{type:String,required:!0},initial:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(n.initial),u=vue.computed((()=>candid.isPrincipal(a.value)));let o=!1;vue.onBeforeMount((()=>r())),vue.watch((()=>n.initial),((e,t)=>{common.same(e,t)||r()}));const r=()=>{const e=n.initial;o&&a.value===e||(a.value=e,o=!0,s())};vue.watch((()=>a.value),(()=>s()));const l=()=>a.value=a.value.trim(),s=()=>common.checkAndExecute(!!i.value,(()=>t("changed",o?u.value?{ok:a.value}:{err:{message:"value is not valid",el:i.value}}:{err:{message:"principal input has not been initial."}})),s);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1g,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:n.placeholder?n.placeholder:n.error,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),onInput:l,ref_key:"inputRef",ref:i},null,40,_hoisted_2$1a),[[vue.vModelText,a.value]]),u.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$U,[vue.createElementVNode("p",null,vue.toDisplayString(n.error?n.error:"Please enter the requirements of the required requirements"),1)]))]))}});script$1h.__scopeId="data-v-4cf231a1",script$1h.__file="src/light/components/constant/basic/PrincipalInput.vue";const _withScopeId$B=e=>(vue.pushScopeId("data-v-a5b2d528"),e=e(),vue.popScopeId(),e),_hoisted_1$1f={class:"vec-input-content"},_hoisted_2$19={class:"left"},_hoisted_3$T=_withScopeId$B((()=>vue.createElementVNode("span",{class:"colon"},":",-1))),_hoisted_4$I={class:"right"},_hoisted_5$D={class:"main"},_hoisted_6$B={key:0,class:"delete"},_hoisted_7$y=["onClick"];var script$1g=vue.defineComponent({__name:"VecInput",props:{layer:{type:Number,required:!0},recItems:{type:Array,required:!0},subtype:{type:Object,required:!0},length:{type:Number,required:!1},initial:{type:Array,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=(e,t,n,i)=>{if(e=[...e],void 0!==t){for(;e.length<t;)e.push(candid.getInitialCandidTypeValue(n,i,[]));for(;e.length>t;)e.splice(e.length-1,1)}return e};let a=n.recItems,u=candid.copyCandidType(n.subtype),o=n.length;const r=vue.ref(i(n.initial,n.length,n.subtype,n.recItems));let l=common.parseDataResultArray(r.value),s=!1;vue.onBeforeMount((()=>c())),vue.watch((()=>[n.recItems,n.subtype,n.initial,n.length]),((e,t)=>{common.same(e,t)||c()}));const c=()=>{const e=n.recItems,t=candid.copyCandidType(n.subtype),c=n.length,d=i(n.initial,c,t,e),m=common.parseDataResultArray(d);s&&common.same(a,e)&&common.same(u,t)&&common.same(o,c)&&common.same(r.value,d)&&common.same(l,m)||(a=e,u=t,o=c,r.value=d,l=m,s=!0,v())},d=()=>{r.value.push(candid.getInitialCandidTypeValue(n.subtype,n.recItems,[])),l.push({ok:r.value[r.value.length-1]}),v()},v=()=>common.checkAndExecute(l.length>=r.value.length,(()=>t("changed",(()=>{if(!s)return{err:{message:"vec input has not been initial."}};const e=[];for(let t=0;t<r.value.length;t++){const n=l[t];if(void 0!==n.err)return{err:n.err};e.push(n.ok)}return{ok:e}})())),v);return(t,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1f,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,((t,i)=>(vue.openBlock(),vue.createElementBlock("div",{class:"item",key:i},[vue.createElementVNode("div",_hoisted_2$19,[vue.createElementVNode("span",null,vue.toDisplayString(`${i}`),1),_hoisted_3$T]),vue.createElementVNode("div",_hoisted_4$I,[vue.createElementVNode("div",_hoisted_5$D,[vue.createCommentVNode(' <span class="label" v-if="subtype.label">{{ subtype.label }}</span> '),vue.createVNode(script$15,{layer:n.layer+1,recItems:n.recItems,initial:{type:e.subtype,value:t},disabled:n.disabled,onChanged:e=>((e,t)=>{l[e]=t,void 0!==t.ok&&(r.value[e]=t.ok),v()})(i,e)},null,8,["layer","recItems","initial","disabled","onChanged"])]),void 0===e.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$B,[vue.createElementVNode("div",{onClick:e=>(e=>{r.value.length>e&&(r.value.splice(e,1),l.splice(e,1),v())})(i)},"-",8,_hoisted_7$y)])):vue.createCommentVNode("v-if",!0)])])))),128)),void 0===e.length?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"push",onClick:d},"+")):vue.createCommentVNode("v-if",!0)]))}});script$1g.__scopeId="data-v-a5b2d528",script$1g.__file="src/light/components/constant/combined/VecInput.vue";const _hoisted_1$1e={class:"opt-input-content"},_hoisted_2$18={key:0,class:"control"},_hoisted_3$S=["checked","disabled"];var script$1f=vue.defineComponent({__name:"OptInput",props:{layer:{type:Number,required:!0},showNull:{type:Boolean,required:!0},recItems:{type:Array,required:!0},subtype:{type:Object,required:!0},has:{type:Boolean,require:!1},initial:{type:Array,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=(e,t,n,i)=>(e=[...e],void 0!==t&&t&&0===e.length&&(e=[candid.getInitialCandidTypeValue(n,i,[])]),e);let a=n.recItems,u=candid.copyCandidType(n.subtype);const o=vue.ref(i(n.initial,n.has,n.subtype,n.recItems)),r=vue.ref(!!o.value.length);let l={ok:o.value.length?o.value[0]:candid.getInitialCandidTypeValue(n.subtype,n.recItems,[])},s=!1;vue.onBeforeMount((()=>c())),vue.watch((()=>[n.recItems,n.subtype,n.initial]),((e,t)=>{common.same(e,t)||c()}));const c=()=>{const e=n.recItems,t=candid.copyCandidType(n.subtype),c=i(n.initial,n.has,t,e),d=!!c.length,v={ok:c.length?c[0]:candid.getInitialCandidTypeValue(t,e,[])};s&&common.same(a,e)&&common.same(u,t)&&common.same(o.value,c)&&common.same(r.value,d)&&common.same(l,v)||(a=e,u=t,o.value=c,r.value=d,l=v,s=!0,m())},d=()=>{if(r.value=!r.value,r.value&&void 0!==l.err){const e=candid.getInitialCandidTypeValue(n.subtype,n.recItems,[]);o.value=[e],l={ok:e}}m()},v=e=>{l=e,void 0!==e.ok&&(o.value=[e.ok]),m()},m=()=>t("changed",s?r.value?void 0!==l.err?{err:l.err}:{ok:[l.ok]}:{ok:[]}:{err:{message:"opt input has not been initial."}});return(t,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1e,[void 0===n.has?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$18,[vue.createElementVNode("input",{type:"checkbox",checked:r.value,disabled:n.disabled,onChange:d},null,40,_hoisted_3$S),vue.createElementVNode("span",null,vue.toDisplayString(r.value?"Value":"None"),1)])):vue.createCommentVNode("v-if",!0),r.value&&("null"!==e.subtype.type||n.showNull)?(vue.openBlock(),vue.createBlock(script$15,{key:1,class:"value-input",layer:n.layer+1,recItems:n.recItems,initial:{type:e.subtype,value:o.value.length?o.value[0]:vue.unref(candid.getInitialCandidTypeValue)(e.subtype,n.recItems,[])},disabled:n.disabled,onChanged:v},null,8,["layer","recItems","initial","disabled"])):vue.createCommentVNode("v-if",!0)]))}});script$1f.__scopeId="data-v-15ff412d",script$1f.__file="src/light/components/constant/combined/OptInput.vue";const _hoisted_1$1d={class:"record-input-content"},_hoisted_2$17=["onUpdate:modelValue"];var script$1e=vue.defineComponent({__name:"RecordInput",props:{layer:{type:Number,required:!0},recItems:{type:Array,required:!0},subitems:{type:Array,required:!0},initial:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e;let i=n.recItems;const a=vue.ref(n.subitems.map((e=>({key:e.key,type:candid.copyCandidType(e.type),value:n.initial[e.key]??candid.getInitialCandidTypeValue(e.type,n.recItems,[])}))));let u=common.parseDataResultArray(a.value.map((e=>e.value))),o=!1;vue.onBeforeMount((()=>r())),vue.watch((()=>[n.recItems,n.subitems,n.initial]),((e,t)=>{common.same(e,t)||r()}));const r=()=>{const e=n.recItems,t=n.subitems.map((t=>({key:t.key,type:candid.copyCandidType(t.type),value:n.initial[t.key]??candid.getInitialCandidTypeValue(t.type,e,[])}))),r=common.parseDataResultArray(t.map((e=>e.value)));o&&common.same(i,e)&&common.same(a.value,t)&&common.same(u,r)||(i=e,a.value=t,u=r,o=!0,l())},l=()=>common.checkAndExecute(u.length>=a.value.length,(()=>t("changed",(()=>{if(!o)return{err:{message:"record input has not been initial."}};const e={};for(let t=0;t<a.value.length;t++){const n=u[t];if(void 0!==n.err)return{err:n.err};e[a.value[t].key]=n.ok}return{ok:e}})())),l);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1d,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,((e,t)=>(vue.openBlock(),vue.createElementBlock("div",{class:"item",key:t},[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:"","onUpdate:modelValue":t=>e.key=t},null,8,_hoisted_2$17),[[vue.vModelText,e.key]]),vue.createVNode(script$15,{layer:n.layer+1,recItems:n.recItems,initial:{type:e.type,value:e.value},disabled:n.disabled,onChanged:e=>((e,t)=>{u[e]=t,void 0!==t.ok&&(a.value[e].value=t.ok),l()})(t,e)},null,8,["layer","recItems","initial","disabled","onChanged"])])))),128))]))}});script$1e.__scopeId="data-v-108fc213",script$1e.__file="src/light/components/constant/combined/RecordInput.vue";const _hoisted_1$1c={class:"variant-input-content"},_hoisted_2$16=["value"];var script$1d=vue.defineComponent({__name:"VariantInput",props:{layer:{type:Number,required:!0},showNull:{type:Boolean,required:!0},recItems:{type:Array,required:!0},subitems:{type:Array,required:!0},select:{type:String,required:!1},initial:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e;let i=n.recItems;const a=vue.ref(n.subitems.map((e=>({key:e.key,type:candid.copyCandidType(e.type),value:n.initial[e.key]??candid.getInitialCandidTypeValue(e.type,n.recItems,[])})))),u=vue.ref(n.select??"");let o=common.parseDataResultArray(a.value.map((e=>e.value))),r=!1;vue.onBeforeMount((()=>l())),vue.watch((()=>[n.recItems,n.subitems,n.select,n.initial]),((e,t)=>{common.same(e,t)||l()}));const l=()=>{const e=n.recItems,t=n.subitems.map((t=>({key:t.key,type:candid.copyCandidType(t.type),value:n.initial[t.key]??candid.getInitialCandidTypeValue(t.type,e,[])})));let l=n.select??"";for(let e=0;e<t.length;e++)void 0!==n.initial[t[e].key]&&(l=t[e].key);const c=common.parseDataResultArray(t.map((e=>e.value)));r&&common.same(i,e)&&common.same(a.value,t)&&common.same(u.value,l)&&common.same(o,c)||(i=e,a.value=t,u.value=l,o=c,r=!0,s())};vue.watch((()=>u.value),(()=>s()));const s=()=>common.checkAndExecute(o.length>=a.value.length,(()=>t("changed",(()=>{if(!r)return{err:{message:"variant input has not been initial."}};const e={};for(let t=0;t<a.value.length;t++){const n=a.value[t].key;if(n===u.value){const i=o[t];if(void 0!==i.err)return{err:i.err};e[n]=i.ok;break}}return{ok:e}})())),s);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1c,[vue.createCommentVNode(' <template v-for="(subitem, i) in subitems" :key="i">\n <div class="item" v-if="!props.select || props.select === subitem.key">\n <template v-if="!props.select">\n <div class="radio">\n <input :value="subitem.key" v-model="current" type="radio" />\n </div>\n </template>\n <input class="key" type="text" disabled v-model="subitem.key" />\n <ConstantInputVue\n v-if="\n (current === subitem.key || props.select === subitem.key) &&\n (subitem.type.type !== \'null\' || props.showNull)\n "\n :layer="props.layer + 1"\n :recItems="props.recItems"\n :initial="{ type: subitem.type, value: subitem.value }"\n :disabled="props.disabled"\n @changed="(r) => onChanged(i, r)"\n />\n </div>\n </template> '),vue.withDirectives(vue.createElementVNode("select",{class:"select","onUpdate:modelValue":t[0]||(t[0]=e=>u.value=e)},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,(e=>(vue.openBlock(),vue.createElementBlock("option",{key:e.key,value:e.key},vue.toDisplayString(e.key),9,_hoisted_2$16)))),128))],512),[[vue.vModelSelect,u.value]]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,((e,t)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:e.key},[u.value!==e.key&&n.select!==e.key||"null"===e.type.type&&!n.showNull?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(script$15,{key:0,layer:n.layer+1,recItems:n.recItems,initial:{type:e.type,value:e.value},disabled:n.disabled,onChanged:e=>((e,t)=>{o[e]=t,void 0!==t.ok&&(a.value[e].value=t.ok),s()})(t,e)},null,8,["layer","recItems","initial","disabled","onChanged"]))],64)))),128))]))}});script$1d.__scopeId="data-v-4a1e06ca",script$1d.__file="src/light/components/constant/combined/VariantInput.vue";const _withScopeId$A=e=>(vue.pushScopeId("data-v-fa830f90"),e=e(),vue.popScopeId(),e),_hoisted_1$1b={class:"tuple-input-content"},_hoisted_2$15=_withScopeId$A((()=>vue.createElementVNode("span",{class:"colon"},":",-1)));var script$1c=vue.defineComponent({__name:"TupleInput",props:{layer:{type:Number,required:!0},recItems:{type:Array,required:!0},subitems:{type:Array,required:!0},initial:{type:Array,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e;let i=n.recItems;const a=vue.ref(n.subitems.map((e=>({key:e.key,type:candid.copyCandidType(e.type),value:n.initial[e.key]??candid.getInitialCandidTypeValue(e.type,n.recItems,[])}))));let u=common.parseDataResultArray(a.value.map((e=>e.value))),o=!1;vue.onBeforeMount((()=>r())),vue.watch((()=>[n.recItems,n.subitems,n.initial]),((e,t)=>{common.same(e,t)||r()}));const r=()=>{const e=n.recItems,t=[];for(let i=0;i<n.subitems.length;i++){const a=n.subitems[i];t[i]={key:a.key,type:candid.copyCandidType(a.type),value:n.initial[i]??candid.getInitialCandidTypeValue(a.type,e,[])}}const r=common.parseDataResultArray(t.map((e=>e.value)));o&&common.same(i,e)&&common.same(a.value,t)&&common.same(u,r)||(i=e,a.value=t,u=r,o=!0,l())},l=()=>common.checkAndExecute(u.length>=a.value.length,(()=>t("changed",(()=>{if(!o)return{err:{message:"tuple input has not been initial."}};const e=[];for(let t=0;t<a.value.length;t++){const n=u[t];if(void 0!==n.err)return{err:n.err};e[t]=n.ok}return{ok:e}})())),l);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1b,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(a.value,((e,t)=>(vue.openBlock(),vue.createElementBlock("div",{class:"item",key:t},[vue.createElementVNode("span",null,vue.toDisplayString(`${t}`),1),_hoisted_2$15,vue.createVNode(script$15,{layer:n.layer+1,recItems:n.recItems,initial:{type:e.type,value:e.value},disabled:n.disabled,onChanged:e=>((e,t)=>{u[e]=t,void 0!==t.ok&&(a.value[e].value=t.ok),l()})(t,e)},null,8,["layer","recItems","initial","disabled","onChanged"])])))),128))]))}});script$1c.__scopeId="data-v-fa830f90",script$1c.__file="src/light/components/constant/combined/TupleInput.vue";const _hoisted_1$1a={class:"rec-input-content"};var script$1b=vue.defineComponent({__name:"RecInput",props:{layer:{type:Number,required:!0},recItems:{type:Array,required:!0},id:{type:Number,required:!0},subtype:{type:Object,required:!1},initial:{validator:e=>void 0!==e,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=(e,t,n)=>{if(void 0!==e)return e;const i=candid.findRecType(t,n);if(void 0===i)throw new Error("can not find rec type");return common.deepClone(i.subtype)};let a=n.recItems,u=n.id,o=n.subtype;const r=vue.ref(i(n.subtype,n.recItems,n.id)),l=vue.ref(n.initial);let s={ok:l.value},c=!1;vue.onBeforeMount((()=>d())),vue.watch((()=>[n.recItems,n.id,n.subtype,n.initial]),((e,t)=>{common.same(e,t)||d()}));const d=()=>{const e=n.recItems,t=n.id,d=n.subtype,v=i(d,e,t),p=n.initial;if(!candid.checkCandidValue(v,p,e))throw new Error("wrong value for rec type");const h={ok:p};c&&common.same(a,e)&&common.same(u,t)&&common.same(o,d)&&common.same(r.value,v)&&common.same(l.value,p)&&common.same(s,h)||(a=e,u=t,o=d,r.value=v,l.value=p,s=h,c=!0,m())},v=e=>{s=e,void 0!==e.ok&&(l.value=e.ok),m()},m=()=>t("changed",c?void 0!==s.err?{err:s.err}:{ok:s.ok}:{err:{message:"rec input has not been initial."}});return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1a,[vue.createVNode(script$15,{layer:n.layer+1,recItems:n.recItems,initial:{type:r.value,value:l.value},disabled:n.disabled,onChanged:v},null,8,["layer","recItems","initial","disabled"])]))}});script$1b.__scopeId="data-v-e3400020",script$1b.__file="src/light/components/constant/combined/RecInput.vue";const _hoisted_1$19={class:"unknown-input-content"};var script$1a=vue.defineComponent({__name:"UnknownInput",emits:["changed"],setup(e,{emit:t}){const n=vue.ref();let i=!1;vue.onBeforeMount((()=>a()));const a=()=>{i=!0,u()},u=()=>common.checkAndExecute(!!n.value,(()=>t("changed",i?{err:{message:"unknown type has no value",el:n.value}}:{err:{message:"unknown input has not been initial."}})),u);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$19,[vue.createElementVNode("span",{ref_key:"inputRef",ref:n},vue.toDisplayString("The UNKNOWN type is not worth it"),512)]))}});script$1a.__scopeId="data-v-0b70a445",script$1a.__file="src/light/components/constant/basic/UnknownInput.vue";const _hoisted_1$18={class:"empty-input-content"};var script$19=vue.defineComponent({__name:"EmptyInput",emits:["changed"],setup(e,{emit:t}){const n=vue.ref();let i=!1;vue.onBeforeMount((()=>a()));const a=()=>{i=!0,u()},u=()=>common.checkAndExecute(!!n.value,(()=>t("changed",i?{err:{message:"empty type has no value",el:n.value}}:{err:{message:"empty input has not been initial."}})),u);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$18,[vue.createElementVNode("span",{ref_key:"inputRef",ref:n},vue.toDisplayString("EMPTY type is not valuable"),512)]))}});script$19.__scopeId="data-v-108e443c",script$19.__file="src/light/components/constant/basic/EmptyInput.vue";const _hoisted_1$17={class:"reserved-input-content"};var script$18=vue.defineComponent({__name:"ReservedInput",emits:["changed"],setup(e,{emit:t}){const n=vue.ref();let i=!1;vue.onBeforeMount((()=>a()));const a=()=>{i=!0,u()},u=()=>common.checkAndExecute(!!n.value,(()=>t("changed",i?{ok:null}:{err:{message:"reserved input has not been initial."}})),u);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$17,[vue.createElementVNode("span",{ref_key:"inputRef",ref:n},vue.toDisplayString("null"),512)]))}});script$18.__scopeId="data-v-6b69d0ad",script$18.__file="src/light/components/constant/basic/ReservedInput.vue";const _withScopeId$z=e=>(vue.pushScopeId("data-v-1f6bca11"),e=e(),vue.popScopeId(),e),_hoisted_1$16={class:"func-input-content"},_hoisted_2$14={class:"service"},_hoisted_3$R=_withScopeId$z((()=>vue.createElementVNode("span",null," Service ",-1))),_hoisted_4$H={class:"input"},_hoisted_5$C=["disabled"],_hoisted_6$A={key:0},_hoisted_7$x={class:"method"},_hoisted_8$w=_withScopeId$z((()=>vue.createElementVNode("span",null," Method ",-1))),_hoisted_9$q={class:"input"},_hoisted_10$j={key:0};var script$17=vue.defineComponent({__name:"FuncInput",props:{initial:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(),u=vue.ref(n.initial.service),o=vue.ref(n.initial.method),r=vue.computed((()=>candid.isCanisterId(u.value))),l=vue.computed((()=>!!o.value.trim()));let s=!1;vue.onBeforeMount((()=>c())),vue.watch((()=>n.initial),((e,t)=>{common.same(e,t)||c()}));const c=()=>{const e=n.initial.service,t=n.initial.method;s&&u.value===e&&o.value===t||(u.value=e,o.value=t,s=!0,v())};vue.watch((()=>u.value),(()=>v())),vue.watch((()=>o.value),(()=>v()));const d=()=>u.value=u.value.trim(),v=()=>common.checkAndExecute(!!i.value&&!!a.value,(()=>t("changed",s?r.value?l.value?{ok:{service:u.value,method:o.value.trim()}}:{err:{message:"func method is not valid",el:a.value}}:{err:{message:"func service is not valid",el:i.value}}:{err:{message:"func input has not been initial."}})),v);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$16,[vue.createElementVNode("div",_hoisted_2$14,[_hoisted_3$R,vue.createElementVNode("div",_hoisted_4$H,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:"Please enter the canister ID of service","onUpdate:modelValue":t[0]||(t[0]=e=>u.value=e),onInput:d,ref_key:"serviceInputRef",ref:i},null,40,_hoisted_5$C),[[vue.vModelText,u.value]]),r.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",_hoisted_6$A,vue.toDisplayString("Please enter the canister ID of service")))])]),vue.createElementVNode("div",_hoisted_7$x,[_hoisted_8$w,vue.createElementVNode("div",_hoisted_9$q,[vue.withDirectives(vue.createElementVNode("input",{type:"text",placeholder:"Please enter Method","onUpdate:modelValue":t[1]||(t[1]=e=>o.value=e),ref_key:"methodInputRef",ref:a},null,512),[[vue.vModelText,o.value]]),l.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",_hoisted_10$j,vue.toDisplayString("Please enter Method")))])])]))}});script$17.__scopeId="data-v-1f6bca11",script$17.__file="src/light/components/constant/basic/FuncInput.vue";const _hoisted_1$15={class:"service-input-content"},_hoisted_2$13=["disabled","placeholder"],_hoisted_3$Q={key:0};var script$16=vue.defineComponent({__name:"ServiceInput",props:{placeholder:{type:String,required:!0},error:{type:String,required:!0},initial:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=vue.ref(),a=vue.ref(n.initial),u=vue.computed((()=>candid.isCanisterId(a.value)));let o=!1;vue.onBeforeMount((()=>r())),vue.watch((()=>n.initial),((e,t)=>{common.same(e,t)||r()}));const r=()=>{const e=n.initial;o&&a.value===e||(a.value=e,o=!0,s())};vue.watch((()=>a.value),(()=>s()));const l=()=>a.value=a.value.trim(),s=()=>common.checkAndExecute(!!i.value,(()=>t("changed",o?u.value?{ok:a.value}:{err:{message:"value is not valid",el:i.value}}:{err:{message:"service input has not been initial."}})),s);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$15,[vue.withDirectives(vue.createElementVNode("input",{type:"text",disabled:n.disabled,placeholder:n.placeholder?n.placeholder:n.error,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),onInput:l,ref_key:"inputRef",ref:i},null,40,_hoisted_2$13),[[vue.vModelText,a.value]]),u.value?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$Q,vue.toDisplayString(n.error?n.error:"Please enter the correct Canister ID"),1))]))}});script$16.__scopeId="data-v-5a22123a",script$16.__file="src/light/components/constant/basic/ServiceInput.vue";const _hoisted_1$14={class:"constant-input-content"},_hoisted_2$12={key:28};var script$15=vue.defineComponent({__name:"ConstantInput",props:{layer:{type:Number,default:1},recItems:{type:Array,default:[]},initial:{type:Object,required:!0},disabled:{type:Boolean,default:!1}},emits:["changed"],setup(e,{emit:t}){const n=e,i=(e,t)=>{switch(e.type){case"nat":case"int":case"nat64":case"int64":return BigInt(t.value);case"principal":case"func":case"service":return t.value}return t},a=(e,t)=>{switch(e.type){case"nat":case"int":case"nat64":case"int64":return{type:"bigint",value:`${t}`};case"principal":return{type:"principal",value:t};case"func":return{type:"func",value:t};case"service":return{type:"service",value:t}}return t},u=(e,t,n,a)=>{const u=candid.checkCandidTypeAndCandidValue(e,n,t,a);return void 0!==u.err?{err:u.err}:{ok:i(e,n)}},o=vue.ref();let r=n.recItems;const l=vue.ref(candid.copyCandidType(n.initial.type)),s=vue.ref(n.initial.value);let c=u(l.value,n.recItems,s.value,o.value);const d=vue.computed((()=>{const e=void 0!==n.initial.value?n.initial.value:candid.getInitialCandidTypeValue(l.value,n.recItems,[]);return i(l.value,e)}));let v=!1;vue.onBeforeMount((()=>m())),vue.watch((()=>[n.recItems,n.initial]),((e,t)=>{common.same(e,t)||m()}));const m=()=>{const e=n.recItems,t=candid.copyCandidType(n.initial.type),i=void 0!==n.initial.value?n.initial.value:candid.getInitialCandidTypeValue(l.value,n.recItems,[]),a=u(t,e,i,o.value);v&&common.same(r,e)&&common.same(l.value,t)&&common.same(s.value,i)&&common.same(c,a)||(r=e,l.value=t,s.value=i,c=a,v=!0,h())},p=e=>{c=e,void 0!==e.ok&&(s.value=a(l.value,e.ok)),h()},h=()=>common.checkAndExecute(!!o.value,(()=>t("changed",v?void 0!==c.err?{err:c.err}:{ok:a(l.value,c.ok)}:{err:{message:"constant input has not been initial."}})),h);return(e,t)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$14,["bool"===l.value.type?(vue.openBlock(),vue.createBlock(script$1m,{key:0,trueText:"True",falseText:"False",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["initial","disabled"])):"nat"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:1,isBigInt:!0,regex:vue.unref(candid.NAT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:"",minValue:"0",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","initial","disabled"])):"int"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:2,isBigInt:!0,regex:vue.unref(candid.INT_REGEX),error:"Please enter the integer",placeholder:"",maxValue:"",minValue:"",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","initial","disabled"])):"nat8"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:3,isBigInt:!1,regex:vue.unref(candid.NAT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.NAT8_MAX)}`,minValue:`${vue.unref(candid.NAT_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"nat16"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:4,isBigInt:!1,regex:vue.unref(candid.NAT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.NAT16_MAX)}`,minValue:`${vue.unref(candid.NAT_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"nat32"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:5,isBigInt:!1,regex:vue.unref(candid.NAT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.NAT32_MAX)}`,minValue:`${vue.unref(candid.NAT_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"nat64"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:6,isBigInt:!0,regex:vue.unref(candid.NAT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.NAT64_MAX)}`,minValue:`${vue.unref(candid.NAT_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"int8"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:7,isBigInt:!1,regex:vue.unref(candid.INT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.INT8_MAX)}`,minValue:`${vue.unref(candid.INT8_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"int16"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:8,isBigInt:!1,regex:vue.unref(candid.INT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.INT16_MAX)}`,minValue:`${vue.unref(candid.INT16_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"int32"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:9,isBigInt:!1,regex:vue.unref(candid.INT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.INT32_MAX)}`,minValue:`${vue.unref(candid.INT32_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"int64"===l.value.type?(vue.openBlock(),vue.createBlock(script$1l,{key:10,isBigInt:!0,regex:vue.unref(candid.INT_REGEX),error:"Please enter the non-negative integer",placeholder:"",maxValue:`${vue.unref(candid.INT64_MAX)}`,minValue:`${vue.unref(candid.INT64_MIN)}`,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","maxValue","minValue","initial","disabled"])):"float32"===l.value.type?(vue.openBlock(),vue.createBlock(script$1k,{key:11,regex:vue.unref(candid.FLOAT32_REGEX),error:"Please enter the single precision floating point number",placeholder:"",decimal:6,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","initial","disabled"])):"float64"===l.value.type?(vue.openBlock(),vue.createBlock(script$1k,{key:12,regex:vue.unref(candid.FLOAT64_REGEX),error:"Please enter the dual -precision floating point number",placeholder:"",decimal:15,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["regex","initial","disabled"])):"null"===l.value.type?(vue.openBlock(),vue.createBlock(script$1j,{key:13,onChanged:p,ref_key:"inputRef",ref:o},null,512)):"text"===l.value.type?(vue.openBlock(),vue.createBlock(script$1i,{key:14,validator:"",placeholder:"",trim:!1,maxLength:4096,error:"Please enter the text",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["initial","disabled"])):"principal"===l.value.type?(vue.openBlock(),vue.createBlock(script$1h,{key:15,placeholder:"",error:"Please enter principal",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["initial","disabled"])):"blob"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:16},[(vue.openBlock(),vue.createBlock(script$1g,{key:0,layer:n.layer,recItems:n.recItems,subtype:{type:"nat8"},length:void 0,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","initial","disabled"]))],64)):"vec"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:17},[(vue.openBlock(),vue.createBlock(script$1g,{key:0,layer:n.layer,recItems:n.recItems,subtype:l.value.subtype,length:void 0,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","subtype","initial","disabled"]))],64)):"opt"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:18},[(vue.openBlock(),vue.createBlock(script$1f,{key:0,layer:n.layer,showNull:!0,recItems:n.recItems,subtype:l.value.subtype,has:void 0,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","subtype","initial","disabled"]))],64)):"record"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:19},[l.value.subitems.length?(vue.openBlock(),vue.createBlock(script$1e,{key:0,layer:n.layer,recItems:n.recItems,subitems:l.value.subitems,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","subitems","initial","disabled"])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"empty-record",ref_key:"inputRef",ref:o},"{}",512))],64)):"variant"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:20},[l.value.subitems.length?(vue.openBlock(),vue.createBlock(script$1d,{key:0,layer:n.layer,showNull:!0,recItems:n.recItems,subitems:l.value.subitems,select:void 0,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","subitems","initial","disabled"])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"empty-variant",ref_key:"inputRef",ref:o},"{}",512))],64)):"tuple"===l.value.type?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:21},[l.value.subitems.length?(vue.openBlock(),vue.createBlock(script$1c,{key:0,layer:n.layer,recItems:n.recItems,subitems:l.value.subitems,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","subitems","initial","disabled"])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"empty-tuple",ref_key:"inputRef",ref:o},"[]",512))],64)):"rec"===l.value.type?(vue.openBlock(),vue.createBlock(script$1b,{key:22,layer:n.layer,recItems:void 0!==l.value.subtype?[...n.recItems,{id:l.value.id,type:l.value}]:n.recItems,id:l.value.id,subtype:l.value.subtype,initial:s.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["layer","recItems","id","subtype","initial","disabled"])):"unknown"===l.value.type?(vue.openBlock(),vue.createBlock(script$1a,{key:23,onChanged:p,ref_key:"inputRef",ref:o},null,512)):"empty"===l.value.type?(vue.openBlock(),vue.createBlock(script$19,{key:24,onChanged:p,ref_key:"inputRef",ref:o},null,512)):"reserved"===l.value.type?(vue.openBlock(),vue.createBlock(script$18,{key:25,onChanged:p,ref_key:"inputRef",ref:o},null,512)):"func"===l.value.type?(vue.openBlock(),vue.createBlock(script$17,{key:26,initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["initial","disabled"])):"service"===l.value.type?(vue.openBlock(),vue.createBlock(script$16,{key:27,placeholder:"",error:"Please enter the canister ID of service",initial:d.value,disabled:n.disabled,onChanged:p,ref_key:"inputRef",ref:o},null,8,["initial","disabled"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$12,vue.toDisplayString(`type ${l.value.type} is not support.`),1))]))}});script$15.__scopeId="data-v-4ffdea52",script$15.__file="src/light/components/constant/ConstantInput.vue",script$15.name="ConstantInput",script$15.install=e=>{e.component(script$15.name,script$15)};const _withScopeId$y=e=>(vue.pushScopeId("data-v-446fb087"),e=e(),vue.popScopeId(),e),_hoisted_1$13={class:"running-blob-argument-constraint-content"},_hoisted_2$11={key:1,class:"tip"},_hoisted_3$P=["blob-index"],_hoisted_4$G=_withScopeId$y((()=>vue.createElementVNode("span",{class:"colon"},":",-1)));var script$14=vue.defineComponent({__name:"RunningBlobArgumentConstraint",props:{layer:{type:Number,required:!0},status:{type:String,required:!0},parentSourceId:{type:Number,required:!0},runningLight:{type:Object,required:!0},values:{type:Object,required:!0},calling:{type:Number,required:!0},recItems:{type:Array,required:!0},type:{type:Object,required:!0},canExportValues:{type:Boolean,required:!0},index:{type:Number,required:!1},initial:{type:Object,required:!0},hasLabel:{type:Boolean,required:!0},triggerRefresh:{type:Number,required:!0}},emits:["changed"],setup(e,{emit:t}){const n=e,i=(e,t,n,i,a,u,o)=>{let r,l,s=[...a.outerValues],c=[...a.propValues],d=[...a.innerValues];if(void 0!==t&&(r=running.checkDataSource(t,i,{outerValues:s,propValues:c,innerValues:d},u),s=r.values.outerValues,d=r.values.innerValues),void 0!==n){l=[];for(let t=0;t<n.length;t++){const a=n[t]?.constraint;if(void 0!==a){const u=running.checkArgumentConstraint(a,i&&e>0,{outerValues:s,propValues:c,innerValues:d},o[t]);l[t]=u.result.err?{err:u.result.err}:{ok:n[t]},s=u.values.outerValues,d=u.values.innerValues}else l[t]={ok:n[t]}}}return{lengthResult:r?.result,subitemsResults:l}},a=vue.ref(),u=vue.ref([]);let o=n.type,r=n.canExportValues,l=[...n.values.innerValues],s=[...n.values.outerValues];const c=vue.ref(n.initial.constant),d=vue.ref(n.initial.length),v=vue.ref(n.initial.subitems),m=vue.ref(n.initial.subitems2??[]),p=vue.ref([]);let{lengthResult:h,subitemsResults:g}=i(c.value,d.value,v.value,n.canExportValues,{outerValues:[...n.values.outerValues],propValues:n.values.propValues,innerValues:[...n.values.innerValues]},a.value,u.value);const k=vue.computed((()=>{if(c.value>=0)return c.value;const e=common.readRuntime(d.value?source.findDataSourceType(d.value):void 0);if(void 0!==e?.ok){const t=e.ok;return t>=0?t:-1}return-1})),f=()=>{const e=k.value;if(e<=0)return void(m.value=[]);if(void 0===v.value)return;if(void 0===n.initial.default)return;const t=m.value;for(;t.length>e;)t.splice(t.length-1,1);for(;p.value.length>e;)p.value.splice(t.length-1,1);for(let i=0;i<e;i++){if(void 0!==t[i])continue;const e=v.value[i],a=e?.constraint??common.deepClone(n.initial.default),u=p.value[i];void 0!==u?common.assignRuntime(a,{ok:u}):common.deleteRuntime(a),t[i]=a}m.value=t};f(),vue.watch((()=>[k.value,v.value,n.initial.default]),((e,t)=>{common.same(e,t)||f()}));const _=vue.computed((()=>void 0===d.value||void 0===v.value||void 0===n.initial.default?[]:((e,t,n,i,a,u,o)=>{const r=[];let l=[...t];r[0]=[...l];const s=Math.max(n,i.length);if(s>0)for(let t=1;t<s;t++){const n=a[t-1]??i[t].constraint??u;let s=[...l];o(n,{propValues:e},s),l=s,r[t]=[...l]}return r})(n.values.propValues,(()=>{const e=[...n.values.innerValues];return running.findInnerValueItemsByDataSource(d.value,{propValues:n.values.propValues},e),e})(),k.value,v.value,m.value,n.initial.default,running.findInnerValueItemsByArgumentConstraint))),y=vue.computed((()=>void 0===d.value||void 0===v.value||void 0===n.initial.default?[]:((e,t,n,i,a,u,o,r)=>{const l=[];let s=[...n];l[0]=[...s];const c=Math.max(i,a.length);if(c>0)for(let n=1;n<c;n++){const i=u[n-1]??a[n].constraint??o;let c=[...s];r(i,{propValues:e,innerValues:[...t[n]]},c),s=c,l[n]=[...s]}return l})(n.values.propValues,_.value,(e=>{const t=[...n.values.outerValues];return running.findOuterValueItemsByDataSource(d.value,{propValues:n.values.propValues,innerValues:[...e]},t),t})(_.value[0]),k.value,v.value,m.value,n.initial.default,running.findOuterValueItemsByArgumentConstraint)));let V=!1;vue.onBeforeMount((()=>b())),vue.watch((()=>[n.type,n.canExportValues,n.values,n.initial]),((e,t)=>{common.same(e,t)||b()}));const b=()=>{const e=n.type,t=n.canExportValues,m=[...n.values.innerValues],k=[...n.values.outerValues],f=n.initial.constant,_=n.initial.length,y=n.initial.subitems,{lengthResult:b,subitemsResults:C}=i(f,_,y,t,{outerValues:[...k],propValues:n.values.propValues,innerValues:[...m]},a.value,u.value);let I=p.value;candid.isSameCandidType(o,e)||(I=[]),V&&common.same(o,e)&&common.same(r,t)&&common.same(l,m)&&common.same(s,k)&&common.same(c.value,f)&&common.same(d.value,_)&&common.same(v.value,y)&&common.same(h,b)&&common.same(g,C)&&common.same(p.value,I)||(o=e,r=t,l=m,s=k,c.value=f,d.value=_,v.value=y,h=b,g=C,p.value=I,V=!0,B())},C=e=>{h=e,void 0!==e.ok&&(d.value=e.ok),B()},B=()=>common.checkAndExecute("using"!==n.status||!!a.value&&(k.value<=0||u.value.filter((e=>!!e)).length>=k.value),(()=>t("changed",(()=>{if(!V)return{err:{message:`${n.status} blob argument constraint has not been initial.`}};if(void 0!==h?.err)return{err:h.err};const e=n.initial;if(h?.ok?e.length=h.ok:delete e.length,common.deleteRuntime(e),delete e.items2,0===k.value)return common.assignRuntime(e,{ok:[]}),{ok:e};if(g){for(let e=0;e<g.length;e++){const t=g[e].err;if(t)return{err:t}}e.items=g.map((e=>e.ok)),e.items2=m.value}if(k.value>0){let t=[];for(let e=0;e<k.value;e++){const n=p.value[e];if(void 0===n){t=void 0;break}t[e]=n}return void 0!==t&&common.assignRuntime(e,{ok:t}),{ok:e}}return{ok:e}})())),B);return(t,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$13,[d.value?(vue.openBlock(),vue.createBlock(script$k,{key:0,status:n.status,parentSourceId:n.parentSourceId,runningLight:n.runningLight,values:n.values,calling:n.calling,canExportValues:n.canExportValues,index:n.index,initial:d.value,triggerRefresh:n.triggerRefresh,onChanged:C,ref_key:"lengthRef",ref:a,"blob-length":d.value.source},null,8,["status","parentSourceId","runningLight","values","calling","canExportValues","index","initial","triggerRefresh","blob-length"])):vue.createCommentVNode("v-if",!0),"using"===n.status&&d.value&&vue.unref(running.hasUIByDataSource)(d.value)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$11," List ")):vue.createCommentVNode("v-if",!0),"using"!==n.status&&k.value>0?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(["items",{"margin-top":d.value&&vue.unref(running.hasUIByDataSource)(d.value)}])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(m.value,((t,i)=>(vue.openBlock(),vue.createElementBlock("div",{class:"item",key:i,"blob-index":i},[vue.createElementVNode("span",null,vue.toDisplayString(`${i}`),1),_hoisted_4$G,vue.createVNode(script$Z,{layer:n.layer+1,status:n.status,parentSourceId:n.parentSourceId,runningLight:n.runningLight,values:{outerValues:y.value[i],propValues:n.values.propValues,innerValues:_.value[i]},calling:n.calling,canExportValues:e.canExportValues&&c.value>0,i