@opengis/form 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1269 -841
- package/dist/index.umd.cjs +5 -5
- package/package.json +63 -61
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.FormBuilder={},e.Vue))})(this,function(exports,vue){"use strict";const _hoisted_1$z={class:"w-full relative"},_hoisted_2$c={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},_hoisted_3$6={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$5={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$E=vue.defineComponent({__name:"vs-layout-default",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$z,[e.ua||e.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$c,[vue.createElementVNode("span",null,vue.toDisplayString(e.ua||e.label),1),e.item?.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$6,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$5,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$y={class:"w-full relative flex flex-row items-center gap-2"},_hoisted_2$b={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12"},_hoisted_3$5={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$4={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$D=vue.defineComponent({__name:"vs-layout-horizontal",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$y,[e.item?.type!=="html"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$b,[vue.createTextVNode(vue.toDisplayString(e.ua||e.label)+" ",1),e.item?.rules?.includes("required")&&(e.ua||e.label)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$5,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$4,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$x={class:"w-full relative"},_hoisted_2$a={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$C=vue.defineComponent({__name:"vs-layout-inline",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$x,[vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$a,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),layouts$1={default:_sfc_main$E,horizontal:_sfc_main$D,inline:_sfc_main$C};function useStyle(e){return{inputClass:vue.computed(()=>{const n=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return e?.size==="sm"?n+"h-[32px]":n+"h-[38px]"})}}const _hoisted_1$w=["placeholder","disabled"],_sfc_main$B=vue.defineComponent({__name:"vs-input-text",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue");return(o,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(n),{"!border-red-600":e.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$w)),[[vue.vModelText,r.value]])}}),_hoisted_1$v=["placeholder"],_sfc_main$A=vue.defineComponent({__name:"vs-input-number",props:vue.mergeModels({style:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue");return(o,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number","onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l),placeholder:e.placeholder,class:vue.normalizeClass(["py-1.5 px-3 block w-full",[vue.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$v)),[[vue.vModelText,r.value]])}}),_export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},_sfc_main$z={},_hoisted_1$u={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function _sfc_render$d(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$u,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const IconCheck=_export_sfc(_sfc_main$z,[["render",_sfc_render$d]]),_hoisted_1$t={class:"flex items-center gap-[4px]"},_hoisted_2$9=["value","id","disabled"],_hoisted_3$4=["for"],_hoisted_4$3={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},_sfc_main$y=vue.defineComponent({__name:"vs-checkbox-default",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},modelValue:Boolean,info:{type:String,default:()=>""},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=e,o=vue.computed({get:()=>r.modelValue,set:s=>n("update:modelValue",s)});return(s,l)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$t,[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",value:e.value,"onUpdate:modelValue":l[0]||(l[0]=i=>o.value=i),class:vue.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":e.disabled}]),id:e.id,disabled:e.disabled},null,10,_hoisted_2$9),[[vue.vModelCheckbox,o.value]]),vue.createElementVNode("label",{for:e.id,class:vue.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":e.disabled}])},[vue.createElementVNode("div",{class:vue.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[o.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",e.error?"border-red-600":""]])},[vue.createVNode(IconCheck,{height:"12",width:"12"})],2),vue.createElementVNode("span",_hoisted_4$3,[vue.renderSlot(s.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],10,_hoisted_3$4)]))}}),_hoisted_1$s=["name","value","disabled"],_hoisted_2$8={class:"flex items-center gap-[6px] text-[14px]"},_hoisted_3$3={key:0,class:"text-[16px]"},_hoisted_4$2=["src"],_sfc_main$x=vue.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{type:[String,Number],default:""},modelValue:{type:[Array,String,Boolean],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},icon:{type:String},imgUrl:{type:String},style:{type:Object,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=vue.computed({get:()=>n.modelValue,set:i=>{r("update:modelValue",i)}}),s=vue.computed(()=>Array.isArray(o.value)?o.value.includes(n.value):o.value===!0||o.value===n.value),l=vue.computed(()=>n.style?.size==="xs"?"p-1.5 text-xs":n.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,c)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[l.value,s.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",class:"hidden",name:e.id,value:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),disabled:e.disabled},null,8,_hoisted_1$s),[[vue.vModelCheckbox,o.value]]),vue.createElementVNode("span",_hoisted_2$8,[e.icon||e.imgUrl?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$3,[e.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(e.icon)},null,2)):vue.createCommentVNode("",!0),e.imgUrl?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:e.imgUrl,width:"16",height:"16",alt:"icon"},null,8,_hoisted_4$2)):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(i.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],2))}}),VsCheckboxViews={"vs-checkbox-default":_sfc_main$y,"vs-checkbox-buttons":_sfc_main$x},_hoisted_1$r={class:"flex items-center"},_sfc_main$w=vue.defineComponent({__name:"vs-input-checkbox-item",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},view:{type:String,default:()=>"default"},modelValue:{type:[Array,Boolean],default:!1},icon:{type:String},imgUrl:{type:String},slots:{type:Object,default:()=>null},option:{type:[Object,String]},style:{type:String,default:()=>null},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=`radio-${Math.floor(Math.random()*1e4)}`,s=vue.computed({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:i=>{if(Array.isArray(n.modelValue)){let c=[...n.modelValue];i?c.includes(n.value)||c.push(n.value):c=c.filter(u=>u!==n.value),r("update:modelValue",c)}else r("update:modelValue",i)}}),l=vue.ref(`vs-checkbox-${n.view||"default"}`);return(i,c)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$r,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(VsCheckboxViews)?.[l.value]),{value:e.value,label:e.label,info:e.option?.info,disabled:e.disabled,modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),id:o,icon:e.icon,imgUrl:e.imgUrl,style:vue.normalizeStyle(e.style),error:e.error},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),_sfc_main$v={},_hoisted_1$q={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function _sfc_render$c(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$q,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const IconChevronDown=_export_sfc(_sfc_main$v,[["render",_sfc_render$c]]),_sfc_main$u={},_hoisted_1$p={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$b(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$p,t[0]||(t[0]=[vue.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),vue.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const IconChevronTopBottom=_export_sfc(_sfc_main$u,[["render",_sfc_render$b]]),_sfc_main$t={},_hoisted_1$o={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function _sfc_render$a(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$o,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),vue.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const IconClose=_export_sfc(_sfc_main$t,[["render",_sfc_render$a]]),_sfc_main$s={},_hoisted_1$n={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$9(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$n,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M12 9h.01"},null,-1),vue.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),vue.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const IconInfo=_export_sfc(_sfc_main$s,[["render",_sfc_render$9]]),_hoisted_1$m={key:0,class:"flex items-start gap-x-1"},_hoisted_2$7={key:0,class:"text-red-500 text-[14px]"},_hoisted_3$2=["title"],_hoisted_4$1=["disabled"],_sfc_main$r=vue.defineComponent({__name:"vs-input-switcher",props:vue.mergeModels({view:{type:String,default:"switch"},label:{type:String,default:""},rules:{type:Array,default:()=>[]},i:{type:String,default:""},text:{type:String,default:""},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""},error:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(n,r)=>e.view==="checkbox"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$m,[vue.createVNode(_sfc_main$w,{modelValue:t.value,"onUpdate:modelValue":r[0]||(r[0]=o=>t.value=o),label:e.text,error:e.error},null,8,["modelValue","label","error"]),e.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$7,"*")):vue.createCommentVNode("",!0),e.i?(vue.openBlock(),vue.createElementBlock("button",{key:1,class:"cursor-pointer",title:e.i,onClick:r[1]||(r[1]=vue.withModifiers(()=>{},["prevent"]))},[vue.createVNode(vue.unref(IconInfo),{class:"text-gray-500 w-[14px] h-[14px]"})],8,_hoisted_3$2)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("button",{key:1,type:"button",class:vue.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[`bg-${e.style?.primaryColor||"blue"}-500`,e.customClass]]),disabled:e.disabled,onClick:r[2]||(r[2]=o=>t.value=!t.value)},[vue.createElementVNode("span",{"data-state":"checked",class:vue.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[t.value?"translate-x-4":"translate-x-0"]])},null,2)],10,_hoisted_4$1))}}),_hoisted_1$l=["innerHTML"],_sfc_main$q=vue.defineComponent({__name:"vs-input-static",props:{html:{type:String,default:""},customClass:{type:String,default:""}},setup(e){return(t,n)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(e.customClass),innerHTML:e.html},null,10,_hoisted_1$l))}}),_hoisted_1$k=["placeholder","disabled"],_sfc_main$p=vue.defineComponent({__name:"vs-input-mask",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue");return(o,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$k)),[[vue.vModelText,r.value]])}}),_hoisted_1$j=["innerHTML"],_sfc_main$o=vue.defineComponent({__name:"vs-input-html",props:{text:{type:String,default:""}},setup(e){const t=e;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{innerHTML:t?.text},null,8,_hoisted_1$j)]))}}),_hoisted_1$i=["value","disabled"],_hoisted_2$6={class:"text-[13px] text-gray-700"},_sfc_main$n=vue.defineComponent({__name:"vs-input-radio-default",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(n,r)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center gap-0",[e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=o=>t.value=o),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$i),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",{class:vue.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${e.style?.primaryColor||"blue"}-500`,e.disabled?"opacity-50 cursor-not-allowed":""]])},[t.value==e.value?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${e.style?.primaryColor||"blue"}-500`]])},null,2)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("span",_hoisted_2$6,vue.toDisplayString(e.text),1)],2))}}),_hoisted_1$h=["value","disabled"],_hoisted_2$5={class:"text-[13px] text-gray-700"},_sfc_main$m=vue.defineComponent({__name:"vs-input-radio-buttons",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(n,r)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==e.value?`ring-2 ring-ring ring-${e.style?.primaryColor||"blue"}-500`:"",e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=o=>t.value=o),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$h),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",_hoisted_2$5,vue.toDisplayString(e.text),1)],2))}}),layouts={"vs-input-radio-default":_sfc_main$n,"vs-input-radio-buttons":_sfc_main$m},_sfc_main$l=vue.defineComponent({__name:"vs-input-radio",props:vue.mergeModels({options:{type:Array,required:!0},position:{type:String,default:"vertical"},view:{type:String,default:"default"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=vue.useModel(e,"modelValue"),r=vue.computed(()=>layouts[`vs-input-radio-${t.view}`]);return(o,s)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([e.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.options,l=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.value),vue.mergeProps({key:l?.id,text:l.text,value:l.id.toString(),checked:n.value===l.id,modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=i=>n.value=i)},{ref_for:!0},o.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}});function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{const n=toString.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),isArray(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),l=s.length;let i;for(r=0;r<l;r++)i=s[r],t.call(null,e[i],i,e)}}function findKey(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},n=(r,o)=>{const s=e&&findKey(t,o)||o;isPlainObject(t[s])&&isPlainObject(r)?t[s]=merge(t[s],r):isPlainObject(r)?t[s]=merge({},r):isArray(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&forEach(arguments[r],n);return t}const extend=(e,t,n,{allOwnKeys:r}={})=>(forEach(t,(o,s)=>{n&&isFunction(o)?e[s]=bind(o,n):e[s]=o},{allOwnKeys:r}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,r)=>{let o,s,l;const i={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)l=o[s],(!r||r(l,e,t))&&!i[l]&&(t[l]=e[l],i[l]=!0);e=n!==!1&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const r=(e&&e[iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},matchAll=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),hasOwnProperty=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};forEach(n,(o,s)=>{let l;(l=t(o,s,e))!==!1&&(r[s]=l||o)}),Object.defineProperties(e,r)},freezeMethods=e=>{reduceDescriptors(e,(t,n)=>{if(isFunction(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(isFunction(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return isArray(e)?r(e):r(String(e).split(t)),n},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[toStringTag]==="FormData"&&e[iterator])}const toJSONObject=e=>{const t=new Array(10),n=(r,o)=>{if(isObject(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=isArray(r)?[]:{};return forEach(r,(l,i)=>{const c=n(l,o+1);!isUndefined(c)&&(s[i]=c)}),t[o]=void 0,s}}return r};return n(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((n,r)=>(_global.addEventListener("message",({source:o,data:s})=>{o===_global&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),_global.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction(e[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,n,r,o,s)=>{const l=Object.create(prototype$1);return utils$1.toFlatObject(e,l,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),AxiosError$1.call(l,e.message,t,n,r,o),l.cause=e,l.name=e.name,s&&Object.assign(l,s),l};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map(function(o,s){return o=removeBrackets(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(t){return/^is[A-Z]/.test(t)});function toFormData$1(e,t,n){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=utils$1.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,m){return!utils$1.isUndefined(m[v])});const r=n.metaTokens,o=n.visitor||a,s=n.dots,l=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(utils$1.isDate(p))return p.toISOString();if(utils$1.isBoolean(p))return p.toString();if(!c&&utils$1.isBlob(p))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(p)||utils$1.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,v,m){let g=p;if(p&&!m&&typeof p=="object"){if(utils$1.endsWith(v,"{}"))v=r?v:v.slice(0,-2),p=JSON.stringify(p);else if(utils$1.isArray(p)&&isFlatArray(p)||(utils$1.isFileList(p)||utils$1.endsWith(v,"[]"))&&(g=utils$1.toArray(p)))return v=removeBrackets(v),g.forEach(function($,_){!(utils$1.isUndefined($)||$===null)&&t.append(l===!0?renderKey([v],_,s):l===null?v:v+"[]",u($))}),!1}return isVisitable(p)?!0:(t.append(renderKey(m,v,s),u(p)),!1)}const d=[],f=Object.assign(predicates,{defaultVisitor:a,convertValue:u,isVisitable});function h(p,v){if(!utils$1.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(p),utils$1.forEach(p,function(g,x){(!(utils$1.isUndefined(g)||g===null)&&o.call(t,g,utils$1.isString(x)?x.trim():x,v,f))===!0&&h(g,v?v.concat(x):[x])}),d.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return h(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,n){this._pairs.push([t,n])},prototype.toString=function(t){const n=t?function(r){return t.call(this,r,encode$1)}:encode$1;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,n){if(!t)return e;const r=n&&n.encode||encode;utils$1.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(r),s){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(r){r!==null&&t(r)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return platform.isNode&&utils$1.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function formDataToJSON(e){function t(n,r,o,s){let l=n[s++];if(l==="__proto__")return!0;const i=Number.isFinite(+l),c=s>=n.length;return l=!l&&utils$1.isArray(o)?o.length:l,c?(utils$1.hasOwnProp(o,l)?o[l]=[o[l],r]:o[l]=r,!i):((!o[l]||!utils$1.isObject(o[l]))&&(o[l]=[]),t(n,r,o[l],s)&&utils$1.isArray(o[l])&&(o[l]=arrayToObject(o[l])),!i)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const n={};return utils$1.forEachEntry(e,(r,o)=>{t(parsePropPath(r),o,n,0)}),n}return null}function stringifySafely(e,t,n){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=utils$1.isObject(t);if(s&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return o?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)||utils$1.isReadableStream(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((i=utils$1.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return toFormData$1(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function(t){const n=this.transitional||defaults.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(utils$1.isResponse(t)||utils$1.isReadableStream(t))return t;if(t&&utils$1.isString(t)&&(r&&!this.responseType||o)){const l=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(i){if(l)throw i.name==="SyntaxError"?AxiosError$1.from(i,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults.headers[e]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let n,r,o;return e&&e.split(`
|
|
2
|
-
`).forEach(function(l){
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[$internals]=this[$internals]={accessors:{}}).accessors,o=this.prototype;function s(l){const i=normalizeHeader(l);r[i]||(buildAccessors(o,l),r[i]=!0)}return utils$1.isArray(t)?t.forEach(s):s(t),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(e,t){const n=this||defaults,r=t||n,o=AxiosHeaders$1.from(r.headers);let s=r.data;return utils$1.forEach(e,function(i){s=i.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function isCancel$1(e){return!!(e&&e.__CANCEL__)}function CanceledError$1(e,t,n){AxiosError$1.call(this,e??"canceled",AxiosError$1.ERR_CANCELED,t,n),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new AxiosError$1("Request failed with status code "+n.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,l;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),a=r[s];l||(l=u),n[o]=c,r[o]=u;let d=s,f=0;for(;d!==o;)f+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-l<t)return;const h=a&&u-a;return h?Math.round(f*1e3/h):void 0}}function throttle(e,t){let n=0,r=1e3/t,o,s;const l=(u,a=Date.now())=>{n=a,o=null,s&&(clearTimeout(s),s=null),e.apply(null,u)};return[(...u)=>{const a=Date.now(),d=a-n;d>=r?l(u,a):(o=u,s||(s=setTimeout(()=>{s=null,l(o)},r-d)))},()=>o&&l(o)]}const progressEventReducer=(e,t,n=3)=>{let r=0;const o=speedometer(50,250);return throttle(s=>{const l=s.loaded,i=s.lengthComputable?s.total:void 0,c=l-r,u=o(c),a=l<=i;r=l;const d={loaded:l,total:i,progress:i?l/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i&&a?(i-l)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(d)},n)},progressEventDecorator=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap(()=>e(...t)),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const l=[e+"="+encodeURIComponent(t)];utils$1.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),utils$1.isString(r)&&l.push("path="+r),utils$1.isString(o)&&l.push("domain="+o),s===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,n){let r=!isAbsoluteURL(t);return e&&(r||n==!1)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const n={};function r(u,a,d,f){return utils$1.isPlainObject(u)&&utils$1.isPlainObject(a)?utils$1.merge.call({caseless:f},u,a):utils$1.isPlainObject(a)?utils$1.merge({},a):utils$1.isArray(a)?a.slice():a}function o(u,a,d,f){if(utils$1.isUndefined(a)){if(!utils$1.isUndefined(u))return r(void 0,u,d,f)}else return r(u,a,d,f)}function s(u,a){if(!utils$1.isUndefined(a))return r(void 0,a)}function l(u,a){if(utils$1.isUndefined(a)){if(!utils$1.isUndefined(u))return r(void 0,u)}else return r(void 0,a)}function i(u,a,d){if(d in t)return r(u,a);if(d in e)return r(void 0,u)}const c={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:i,headers:(u,a,d)=>o(headersToObject(u),headersToObject(a),d,!0)};return utils$1.forEach(Object.keys(Object.assign({},e,t)),function(a){const d=c[a]||o,f=d(e[a],t[a],a);utils$1.isUndefined(f)&&d!==i||(n[a]=f)}),n}const resolveConfig=e=>{const t=mergeConfig$1({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:l,auth:i}=t;t.headers=l=AxiosHeaders$1.from(l),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&l.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let c;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[u,...a]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];l.setContentType([u||"multipart/form-data",...a].join("; "))}}if(platform.hasStandardBrowserEnv&&(r&&utils$1.isFunction(r)&&(r=r(t)),r||r!==!1&&isURLSameOrigin(t.url))){const u=o&&s&&cookies.read(s);u&&l.set(o,u)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(n,r){const o=resolveConfig(e);let s=o.data;const l=AxiosHeaders$1.from(o.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:u}=o,a,d,f,h,p;function v(){h&&h(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function g(){if(!m)return;const $=AxiosHeaders$1.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!i||i==="text"||i==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:$,config:e,request:m};settle(function(S){n(S),v()},function(S){r(S),v()},k),m=null}"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(g)},m.onabort=function(){m&&(r(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let _=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const k=o.transitional||transitionalDefaults;o.timeoutErrorMessage&&(_=o.timeoutErrorMessage),r(new AxiosError$1(_,k.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,m)),m=null},s===void 0&&l.setContentType(null),"setRequestHeader"in m&&utils$1.forEach(l.toJSON(),function(_,k){m.setRequestHeader(k,_)}),utils$1.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),i&&i!=="json"&&(m.responseType=o.responseType),u&&([f,p]=progressEventReducer(u,!0),m.addEventListener("progress",f)),c&&m.upload&&([d,h]=progressEventReducer(c),m.upload.addEventListener("progress",d),m.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(a=$=>{m&&(r(!$||$.type?new CanceledError$1(null,e,m):$),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));const x=parseProtocol(o.url);if(x&&platform.protocols.indexOf(x)===-1){r(new AxiosError$1("Unsupported protocol "+x+":",AxiosError$1.ERR_BAD_REQUEST,e));return}m.send(s||null)})},composeSignals=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const s=function(u){if(!o){o=!0,i();const a=u instanceof Error?u:this.reason;r.abort(a instanceof AxiosError$1?a:new CanceledError$1(a instanceof Error?a.message:a))}};let l=t&&setTimeout(()=>{l=null,s(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))},t);const i=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>utils$1.asap(i),c}},streamChunk=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},readBytes=async function*(e,t){for await(const n of readStream(e))yield*streamChunk(n,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},trackStream=(e,t,n,r)=>{const o=readBytes(e,t);let s=0,l,i=c=>{l||(l=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:a}=await o.next();if(u){i(),c.close();return}let d=a.byteLength;if(n){let f=s+=d;n(f)}c.enqueue(new Uint8Array(a))}catch(u){throw i(u),u}},cancel(c){return i(c),o.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,r)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,t)=>{const n=utils$1.toFiniteNumber(e.getContentLength());return n??getBodyLength(t)},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:l,onDownloadProgress:i,onUploadProgress:c,responseType:u,headers:a,withCredentials:d="same-origin",fetchOptions:f}=resolveConfig(e);u=u?(u+"").toLowerCase():"text";let h=composeSignals([o,s&&s.toAbortSignal()],l),p;const v=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&supportsRequestStream&&n!=="get"&&n!=="head"&&(m=await resolveBodyLength(a,r))!==0){let k=new Request(t,{method:"POST",body:r,duplex:"half"}),E;if(utils$1.isFormData(r)&&(E=k.headers.get("content-type"))&&a.setContentType(E),k.body){const[S,C]=progressEventDecorator(m,progressEventReducer(asyncDecorator(c)));r=trackStream(k.body,DEFAULT_CHUNK_SIZE,S,C)}}utils$1.isString(d)||(d=d?"include":"omit");const g="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",credentials:g?d:void 0});let x=await fetch(p,f);const $=supportsResponseStream&&(u==="stream"||u==="response");if(supportsResponseStream&&(i||$&&v)){const k={};["status","statusText","headers"].forEach(B=>{k[B]=x[B]});const E=utils$1.toFiniteNumber(x.headers.get("content-length")),[S,C]=i&&progressEventDecorator(E,progressEventReducer(asyncDecorator(i),!0))||[];x=new Response(trackStream(x.body,DEFAULT_CHUNK_SIZE,S,()=>{C&&C(),v&&v()}),k)}u=u||"text";let _=await resolvers[utils$1.findKey(resolvers,u)||"text"](x,e);return!$&&v&&v(),await new Promise((k,E)=>{settle(k,E,{data:_,headers:AxiosHeaders$1.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:p})})}catch(g){throw v&&v(),g&&g.name==="TypeError"&&/Load failed|fetch/i.test(g.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,p),{cause:g.cause||g}):AxiosError$1.from(g,g&&g.code,e,p)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){n=e[s];let l;if(r=n,!isResolvedHandle(n)&&(r=knownAdapters[(l=String(n)).toLowerCase()],r===void 0))throw new AxiosError$1(`Unknown adapter '${l}'`);if(r)break;o[l||"#"+s]=r}if(!r){const s=Object.entries(o).map(([i,c])=>`adapter ${i} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?s.length>1?`since :
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.FormBuilder={},e.Vue))})(this,(function(exports,vue){"use strict";const _hoisted_1$A={class:"w-full relative"},_hoisted_2$d={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},_hoisted_3$6={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$5={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$F=vue.defineComponent({__name:"vs-layout-default",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,o)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$A,[e.ua||e.label?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$d,[vue.createElementVNode("span",null,vue.toDisplayString(e.ua||e.label),1),e.item?.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$6,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$5,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$z={class:"w-full relative flex flex-row items-center gap-2"},_hoisted_2$c={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},_hoisted_3$5={key:0,class:"text-red-500 text-[14px]"},_hoisted_4$4={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$E=vue.defineComponent({__name:"vs-layout-horizontal",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,o)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$z,[e.item?.type!=="html"?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$c,[vue.createTextVNode(vue.toDisplayString(e.ua||e.label)+" ",1),e.item?.rules?.includes("required")&&(e.ua||e.label)?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$5,"*")):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$4,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),_hoisted_1$y={class:"w-full relative"},_hoisted_2$b={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_sfc_main$D=vue.defineComponent({__name:"vs-layout-inline",props:{ua:{type:String,default:""},item:{type:Object,default:()=>({})},error:{type:String,default:""},label:{type:String,default:""}},setup(e){return(t,o)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$y,[vue.renderSlot(t.$slots,"default",vue.normalizeProps(vue.guardReactiveProps(t.$attrs))),e.error?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$b,vue.toDisplayString(e.error),1)):vue.createCommentVNode("",!0)]))}}),layouts$1={default:_sfc_main$F,horizontal:_sfc_main$E,inline:_sfc_main$D};function useStyle(e){return{inputClass:vue.computed(()=>{const o=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return e?.size==="sm"?o+"h-[32px]":o+"h-[38px]"})}}const _hoisted_1$x=["placeholder","disabled"],_sfc_main$C=vue.defineComponent({__name:"vs-input-text",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue");return(r,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(o),{"!border-red-600":e.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$x)),[[vue.vModelText,n.value]])}}),_hoisted_1$w=["placeholder"],_sfc_main$B=vue.defineComponent({__name:"vs-input-number",props:vue.mergeModels({style:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue");return(r,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"number","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:e.placeholder,class:vue.normalizeClass(["py-1.5 px-3 block w-full",[vue.unref(o)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$w)),[[vue.vModelText,n.value]])}}),_export_sfc=(e,t)=>{const o=e.__vccOpts||e;for(const[n,r]of t)o[n]=r;return o},_sfc_main$A={},_hoisted_1$v={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function _sfc_render$d(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$v,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const IconCheck=_export_sfc(_sfc_main$A,[["render",_sfc_render$d]]),_hoisted_1$u={class:"flex items-center gap-[4px]"},_hoisted_2$a=["value","id","disabled"],_hoisted_3$4=["for"],_hoisted_4$3={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},_sfc_main$z=vue.defineComponent({__name:"vs-checkbox-default",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},modelValue:Boolean,info:{type:String,default:()=>""},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,n=e,r=vue.computed({get:()=>n.modelValue,set:s=>o("update:modelValue",s)});return(s,l)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$u,[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",value:e.value,"onUpdate:modelValue":l[0]||(l[0]=i=>r.value=i),class:vue.normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":e.disabled}]),id:e.id,disabled:e.disabled},null,10,_hoisted_2$a),[[vue.vModelCheckbox,r.value]]),vue.createElementVNode("label",{for:e.id,class:vue.normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":e.disabled}])},[vue.createElementVNode("div",{class:vue.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[r.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",e.error?"border-red-600":""]])},[vue.createVNode(IconCheck,{height:"12",width:"12"})],2),vue.createElementVNode("span",_hoisted_4$3,[vue.renderSlot(s.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],10,_hoisted_3$4)]))}}),_hoisted_1$t=["name","value","disabled"],_hoisted_2$9={class:"flex items-center gap-[6px] text-[14px]"},_hoisted_3$3={key:0,class:"text-[16px]"},_hoisted_4$2=["src"],_sfc_main$y=vue.defineComponent({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{type:[String,Number],default:""},modelValue:{type:[Array,String,Boolean],default:""},disabled:{type:Boolean,default:!1},id:{type:[String,Number]},icon:{type:String},imgUrl:{type:String},style:{type:Object,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,n=t,r=vue.computed({get:()=>o.modelValue,set:i=>{n("update:modelValue",i)}}),s=vue.computed(()=>Array.isArray(r.value)?r.value.includes(o.value):r.value===!0||r.value===o.value),l=vue.computed(()=>o.style?.size==="xs"?"p-1.5 text-xs":o.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,c)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[l.value,s.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[vue.withDirectives(vue.createElementVNode("input",{type:"checkbox",class:"hidden",name:e.id,value:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),disabled:e.disabled},null,8,_hoisted_1$t),[[vue.vModelCheckbox,r.value]]),vue.createElementVNode("span",_hoisted_2$9,[e.icon||e.imgUrl?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$3,[e.icon?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:vue.normalizeClass(e.icon)},null,2)):vue.createCommentVNode("",!0),e.imgUrl?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:e.imgUrl,width:"16",height:"16",alt:"icon"},null,8,_hoisted_4$2)):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),vue.renderSlot(i.$slots,"default",{},()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)])])],2))}}),VsCheckboxViews={"vs-checkbox-default":_sfc_main$z,"vs-checkbox-buttons":_sfc_main$y},_hoisted_1$s={class:"flex items-center"},_sfc_main$x=vue.defineComponent({__name:"vs-input-checkbox-item",props:{value:{type:[String,Number],default:""},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},view:{type:String,default:()=>"default"},modelValue:{type:[Array,Boolean],default:!1},icon:{type:String},imgUrl:{type:String},slots:{type:Object,default:()=>null},option:{type:[Object,String]},style:{type:String,default:()=>null},error:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,n=t,r=`radio-${Math.floor(Math.random()*1e4)}`,s=vue.computed({get:()=>Array.isArray(o.modelValue)?Array.isArray(o.modelValue)&&o.modelValue.includes(o.value):o.modelValue,set:i=>{if(Array.isArray(o.modelValue)){let c=[...o.modelValue];i?c.includes(o.value)||c.push(o.value):c=c.filter(u=>u!==o.value),n("update:modelValue",c)}else n("update:modelValue",i)}}),l=vue.ref(`vs-checkbox-${o.view||"default"}`);return(i,c)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$s,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(VsCheckboxViews)?.[l.value]),{value:e.value,label:e.label,info:e.option?.info,disabled:e.disabled,modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),id:r,icon:e.icon,imgUrl:e.imgUrl,style:vue.normalizeStyle(e.style),error:e.error},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(e.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),_sfc_main$w={},_hoisted_1$r={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function _sfc_render$c(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$r,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const IconChevronDown=_export_sfc(_sfc_main$w,[["render",_sfc_render$c]]),_sfc_main$v={},_hoisted_1$q={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$b(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$q,t[0]||(t[0]=[vue.createElementVNode("path",{d:"m7 15 5 5 5-5"},null,-1),vue.createElementVNode("path",{d:"m7 9 5-5 5 5"},null,-1)]))}const IconChevronTopBottom=_export_sfc(_sfc_main$v,[["render",_sfc_render$b]]),_sfc_main$u={},_hoisted_1$p={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function _sfc_render$a(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$p,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),vue.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const IconClose=_export_sfc(_sfc_main$u,[["render",_sfc_render$a]]),_sfc_main$t={},_hoisted_1$o={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$9(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$o,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M12 9h.01"},null,-1),vue.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),vue.createElementVNode("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const IconInfo=_export_sfc(_sfc_main$t,[["render",_sfc_render$9]]),_hoisted_1$n={key:0,class:"flex items-start gap-x-1"},_hoisted_2$8={key:0,class:"text-red-500 text-[14px]"},_hoisted_3$2=["title"],_hoisted_4$1=["disabled"],_sfc_main$s=vue.defineComponent({__name:"vs-input-switcher",props:vue.mergeModels({view:{type:String,default:"switch"},label:{type:String,default:""},rules:{type:Array,default:()=>[]},i:{type:String,default:""},text:{type:String,default:""},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""},error:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(o,n)=>e.view==="checkbox"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$n,[vue.createVNode(_sfc_main$x,{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=r=>t.value=r),label:e.text,error:e.error},null,8,["modelValue","label","error"]),e.rules?.includes("required")?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$8,"*")):vue.createCommentVNode("",!0),e.i?(vue.openBlock(),vue.createElementBlock("button",{key:1,class:"cursor-pointer",title:e.i,onClick:n[1]||(n[1]=vue.withModifiers(()=>{},["prevent"]))},[vue.createVNode(vue.unref(IconInfo),{class:"text-gray-500 w-[14px] h-[14px]"})],8,_hoisted_3$2)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("button",{key:1,type:"button",class:vue.normalizeClass(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[t.value?`bg-${e.style?.primaryColor||"blue"}-500`:"bg-stone-200",e.customClass]]),disabled:e.disabled,onClick:n[2]||(n[2]=r=>t.value=!t.value)},[vue.createElementVNode("span",{"data-state":"checked",class:vue.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[t.value?"translate-x-4":"translate-x-0"]])},null,2)],10,_hoisted_4$1))}}),_hoisted_1$m=["innerHTML"],_sfc_main$r=vue.defineComponent({__name:"vs-input-static",props:{html:{type:String,default:""},text:{type:String,default:""},customClass:{type:String,default:""}},setup(e){return(t,o)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(e.customClass),innerHTML:(e.html==="",e.text)},null,10,_hoisted_1$m))}}),_hoisted_1$l=["placeholder","disabled"],_sfc_main$q=vue.defineComponent({__name:"vs-input-mask",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},mask:{type:String,default:""},placeholderChar:{type:String,default:"_"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue"),r=vue.ref(""),s={9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},l=vue.computed(()=>t.mask.split("")),i=vue.computed(()=>l.value.filter(d=>s[d]).length),c=vue.computed({get(){let d="",f=0;const m=i.value,p=r.value.slice(0,m);for(const h of l.value)s[h]?f<p.length?(d+=p[f],f++):d+=t.placeholderChar:d+=h;return d},set(d){const f=[],m=l.value,p=i.value;let h=0;for(let v=0;v<m.length;v++){const b=m[v];if(s[b]){for(;h<d.length;){const x=d[h];if(h++,s[b].test(x)){f.push(x);break}}if(f.length>=p)break}}r.value=f.join(""),n.value=d}});function u(d){const f=d.target,m=[],p=l.value,h=i.value;let v=0;for(let b=0;b<p.length;b++){const x=p[b];if(s[x]){for(;v<f.value.length;){const k=f.value[v];if(v++,s[x].test(k)){m.push(k);break}}if(m.length>=h)break}}r.value=m.join(""),console.log(r.value),n.value=c.value}function a(d){d.key==="Backspace"&&(d.preventDefault(),r.value=r.value.slice(0,-1),n.value=c.value)}return(d,f)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"text","onUpdate:modelValue":f[0]||(f[0]=m=>c.value=m),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(o)]]),style:{border:"1px solid #CFD9E0"},onInput:u,onKeydown:a},null,42,_hoisted_1$l)),[[vue.vModelText,c.value]])}}),_hoisted_1$k=["innerHTML"],_sfc_main$p=vue.defineComponent({__name:"vs-input-html",props:{text:{type:String,default:""}},setup(e){const t=e;return(o,n)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{innerHTML:t?.text},null,8,_hoisted_1$k)]))}}),_hoisted_1$j={class:"relative w-full bg-white rounded-lg"},_hoisted_2$7=["placeholder","disabled"],_sfc_main$o=vue.defineComponent({__name:"vs-input-email",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},error:{type:String,default:null}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue");return(r,s)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[s[1]||(s[1]=vue.createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),vue.withDirectives(vue.createElementVNode("input",{type:"email","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(o),{"!border-red-600":e.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_2$7),[[vue.vModelText,n.value]])]))}}),_hoisted_1$i=["value","disabled"],_hoisted_2$6={class:"text-[13px] text-gray-700"},_sfc_main$n=vue.defineComponent({__name:"vs-input-radio-default",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(o,n)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center gap-0",[e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=r=>t.value=r),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$i),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",{class:vue.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${e.style?.primaryColor||"blue"}-500`,e.disabled?"opacity-50 cursor-not-allowed":""]])},[t.value==e.value?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${e.style?.primaryColor||"blue"}-500`]])},null,2)):vue.createCommentVNode("",!0)],2),vue.createElementVNode("span",_hoisted_2$6,vue.toDisplayString(e.text),1)],2))}}),_hoisted_1$h=["value","disabled"],_hoisted_2$5={class:"text-[13px] text-gray-700"},_sfc_main$m=vue.defineComponent({__name:"vs-input-radio-buttons",props:vue.mergeModels({text:{type:String,required:!0},value:{type:String,required:!0},style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},customClass:{type:String,default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=vue.useModel(e,"modelValue");return(o,n)=>(vue.openBlock(),vue.createElementBlock("label",{class:vue.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[t.value==e.value?`ring-2 ring-ring ring-${e.style?.primaryColor||"blue"}-500`:"",e.customClass]])},[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=r=>t.value=r),type:"radio",value:e.value,disabled:e.disabled,class:"hidden"},null,8,_hoisted_1$h),[[vue.vModelRadio,t.value]]),vue.createElementVNode("span",_hoisted_2$5,vue.toDisplayString(e.text),1)],2))}}),layouts={"vs-input-radio-default":_sfc_main$n,"vs-input-radio-buttons":_sfc_main$m},_sfc_main$l=vue.defineComponent({__name:"vs-input-radio",props:vue.mergeModels({options:{type:Array,required:!0},position:{type:String,default:"vertical"},view:{type:String,default:"default"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,o=vue.useModel(e,"modelValue"),n=vue.computed(()=>layouts[`vs-input-radio-${t.view}`]);return(r,s)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([e.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(e.options,l=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(n.value),vue.mergeProps({key:l?.id,text:l.text,value:l.id.toString(),checked:o.value===l.id,modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=i=>o.value=i)},{ref_for:!0},r.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}});function bind(e,t){return function(){return e.apply(t,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{const o=toString.call(t);return e[o]||(e[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&isArrayBuffer(e.buffer),t}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject=e=>e!==null&&typeof e=="object",isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!=="object")return!1;const t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isEmptyObject=e=>{if(!isObject(e)||isBuffer(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=e=>isObject(e)&&isFunction(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(e,t,{allOwnKeys:o=!1}={}){if(e===null||typeof e>"u")return;let n,r;if(typeof e!="object"&&(e=[e]),isArray(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(isBuffer(e))return;const s=o?Object.getOwnPropertyNames(e):Object.keys(e),l=s.length;let i;for(n=0;n<l;n++)i=s[n],t.call(null,e[i],i,e)}}function findKey(e,t){if(isBuffer(e))return null;t=t.toLowerCase();const o=Object.keys(e);let n=o.length,r;for(;n-- >0;)if(r=o[n],t===r.toLowerCase())return r;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){const{caseless:e}=isContextDefined(this)&&this||{},t={},o=(n,r)=>{const s=e&&findKey(t,r)||r;isPlainObject(t[s])&&isPlainObject(n)?t[s]=merge(t[s],n):isPlainObject(n)?t[s]=merge({},n):isArray(n)?t[s]=n.slice():t[s]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&forEach(arguments[n],o);return t}const extend=(e,t,o,{allOwnKeys:n}={})=>(forEach(t,(r,s)=>{o&&isFunction(r)?e[s]=bind(r,o):e[s]=r},{allOwnKeys:n}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,o,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject=(e,t,o,n)=>{let r,s,l;const i={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)l=r[s],(!n||n(l,e,t))&&!i[l]&&(t[l]=e[l],i[l]=!0);e=o!==!1&&getPrototypeOf(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,o)=>{e=String(e),(o===void 0||o>e.length)&&(o=e.length),o-=t.length;const n=e.indexOf(t,o);return n!==-1&&n===o},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{const n=(e&&e[iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},matchAll=(e,t)=>{let o;const n=[];for(;(o=e.exec(t))!==null;)n.push(o);return n},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,n,r){return n.toUpperCase()+r}),hasOwnProperty=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),n={};forEach(o,(r,s)=>{let l;(l=t(r,s,e))!==!1&&(n[s]=l||r)}),Object.defineProperties(e,n)},freezeMethods=e=>{reduceDescriptors(e,(t,o)=>{if(isFunction(e)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const n=e[o];if(isFunction(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},toObjectSet=(e,t)=>{const o={},n=r=>{r.forEach(s=>{o[s]=!0})};return isArray(e)?n(e):n(String(e).split(t)),o},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[toStringTag]==="FormData"&&e[iterator])}const toJSONObject=e=>{const t=new Array(10),o=(n,r)=>{if(isObject(n)){if(t.indexOf(n)>=0)return;if(isBuffer(n))return n;if(!("toJSON"in n)){t[r]=n;const s=isArray(n)?[]:{};return forEach(n,(l,i)=>{const c=o(l,r+1);!isUndefined(c)&&(s[i]=c)}),t[r]=void 0,s}}return n};return o(e,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=e=>e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((o,n)=>(_global.addEventListener("message",({source:r,data:s})=>{r===_global&&s===o&&n.length&&n.shift()()},!1),r=>{n.push(r),_global.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction(e[iterator]),utils$1={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(e,t,o,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),o&&(this.config=o),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}utils$1.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$1.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(e,t,o,n,r,s)=>{const l=Object.create(prototype$1);return utils$1.toFlatObject(e,l,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),AxiosError$1.call(l,e.message,t,o,n,r),l.cause=e,l.name=e.name,s&&Object.assign(l,s),l};const httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,o){return e?e.concat(t).map(function(r,s){return r=removeBrackets(r),!o&&s?"["+r+"]":r}).join(o?".":""):t}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}const predicates=utils$1.toFlatObject(utils$1,{},null,function(t){return/^is[A-Z]/.test(t)});function toFormData$1(e,t,o){if(!utils$1.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,o=utils$1.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,v){return!utils$1.isUndefined(v[h])});const n=o.metaTokens,r=o.visitor||a,s=o.dots,l=o.indexes,c=(o.Blob||typeof Blob<"u"&&Blob)&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(r))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(utils$1.isDate(p))return p.toISOString();if(utils$1.isBoolean(p))return p.toString();if(!c&&utils$1.isBlob(p))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$1.isArrayBuffer(p)||utils$1.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function a(p,h,v){let b=p;if(p&&!v&&typeof p=="object"){if(utils$1.endsWith(h,"{}"))h=n?h:h.slice(0,-2),p=JSON.stringify(p);else if(utils$1.isArray(p)&&isFlatArray(p)||(utils$1.isFileList(p)||utils$1.endsWith(h,"[]"))&&(b=utils$1.toArray(p)))return h=removeBrackets(h),b.forEach(function(k,E){!(utils$1.isUndefined(k)||k===null)&&t.append(l===!0?renderKey([h],E,s):l===null?h:h+"[]",u(k))}),!1}return isVisitable(p)?!0:(t.append(renderKey(v,h,s),u(p)),!1)}const d=[],f=Object.assign(predicates,{defaultVisitor:a,convertValue:u,isVisitable});function m(p,h){if(!utils$1.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(p),utils$1.forEach(p,function(b,x){(!(utils$1.isUndefined(b)||b===null)&&r.call(t,b,utils$1.isString(x)?x.trim():x,h,f))===!0&&m(b,h?h.concat(x):[x])}),d.pop()}}if(!utils$1.isObject(e))throw new TypeError("data must be an object");return m(e),t}function encode$1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData$1(e,this,t)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(t,o){this._pairs.push([t,o])},prototype.toString=function(t){const o=t?function(n){return t.call(this,n,encode$1)}:encode$1;return this._pairs.map(function(r){return o(r[0])+"="+o(r[1])},"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,o){if(!t)return e;const n=o&&o.encode||encode;utils$1.isFunction(o)&&(o={serialize:o});const r=o&&o.serialize;let s;if(r?s=r(t,o):s=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,o).toString(n),s){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class InterceptorManager{constructor(){this.handlers=[]}use(t,o,n){return this.handlers.push({fulfilled:t,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){utils$1.forEach(this.handlers,function(n){n!==null&&t(n)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils,...platform$1};function toURLEncodedForm(e,t){return toFormData$1(e,new platform.classes.URLSearchParams,{visitor:function(o,n,r,s){return platform.isNode&&utils$1.isBuffer(o)?(this.append(n,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function arrayToObject(e){const t={},o=Object.keys(e);let n;const r=o.length;let s;for(n=0;n<r;n++)s=o[n],t[s]=e[s];return t}function formDataToJSON(e){function t(o,n,r,s){let l=o[s++];if(l==="__proto__")return!0;const i=Number.isFinite(+l),c=s>=o.length;return l=!l&&utils$1.isArray(r)?r.length:l,c?(utils$1.hasOwnProp(r,l)?r[l]=[r[l],n]:r[l]=n,!i):((!r[l]||!utils$1.isObject(r[l]))&&(r[l]=[]),t(o,n,r[l],s)&&utils$1.isArray(r[l])&&(r[l]=arrayToObject(r[l])),!i)}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){const o={};return utils$1.forEachEntry(e,(n,r)=>{t(parsePropPath(n),r,o,0)}),o}return null}function stringifySafely(e,t,o){if(utils$1.isString(e))try{return(t||JSON.parse)(e),utils$1.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(o||JSON.stringify)(e)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){const n=o.getContentType()||"",r=n.indexOf("application/json")>-1,s=utils$1.isObject(t);if(s&&utils$1.isHTMLForm(t)&&(t=new FormData(t)),utils$1.isFormData(t))return r?JSON.stringify(formDataToJSON(t)):t;if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)||utils$1.isReadableStream(t))return t;if(utils$1.isArrayBufferView(t))return t.buffer;if(utils$1.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(t,this.formSerializer).toString();if((i=utils$1.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return toFormData$1(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||r?(o.setContentType("application/json",!1),stringifySafely(t)):t}],transformResponse:[function(t){const o=this.transitional||defaults.transitional,n=o&&o.forcedJSONParsing,r=this.responseType==="json";if(utils$1.isResponse(t)||utils$1.isReadableStream(t))return t;if(t&&utils$1.isString(t)&&(n&&!this.responseType||r)){const l=!(o&&o.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(i){if(l)throw i.name==="SyntaxError"?AxiosError$1.from(i,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$1.forEach(["delete","get","head","post","put","patch"],e=>{defaults.headers[e]={}});const ignoreDuplicateOf=utils$1.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=e=>{const t={};let o,n,r;return e&&e.split(`
|
|
2
|
+
`).forEach(function(l){r=l.indexOf(":"),o=l.substring(0,r).trim().toLowerCase(),n=l.substring(r+1).trim(),!(!o||t[o]&&ignoreDuplicateOf[o])&&(o==="set-cookie"?t[o]?t[o].push(n):t[o]=[n]:t[o]=t[o]?t[o]+", "+n:n)}),t},$internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=o.exec(e);)t[n[1]]=n[2];return t}const isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,o,n,r){if(utils$1.isFunction(n))return n.call(this,t,o);if(r&&(t=o),!!utils$1.isString(t)){if(utils$1.isString(n))return t.indexOf(n)!==-1;if(utils$1.isRegExp(n))return n.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,o,n)=>o.toUpperCase()+n)}function buildAccessors(e,t){const o=utils$1.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+o,{value:function(r,s,l){return this[n].call(this,t,r,s,l)},configurable:!0})})}let AxiosHeaders$1=class{constructor(t){t&&this.set(t)}set(t,o,n){const r=this;function s(i,c,u){const a=normalizeHeader(c);if(!a)throw new Error("header name must be a non-empty string");const d=utils$1.findKey(r,a);(!d||r[d]===void 0||u===!0||u===void 0&&r[d]!==!1)&&(r[d||c]=normalizeValue(i))}const l=(i,c)=>utils$1.forEach(i,(u,a)=>s(u,a,c));if(utils$1.isPlainObject(t)||t instanceof this.constructor)l(t,o);else if(utils$1.isString(t)&&(t=t.trim())&&!isValidHeaderName(t))l(parseHeaders(t),o);else if(utils$1.isObject(t)&&utils$1.isIterable(t)){let i={},c,u;for(const a of t){if(!utils$1.isArray(a))throw TypeError("Object iterator must return a key-value pair");i[u=a[0]]=(c=i[u])?utils$1.isArray(c)?[...c,a[1]]:[c,a[1]]:a[1]}l(i,o)}else t!=null&&s(o,t,n);return this}get(t,o){if(t=normalizeHeader(t),t){const n=utils$1.findKey(this,t);if(n){const r=this[n];if(!o)return r;if(o===!0)return parseTokens(r);if(utils$1.isFunction(o))return o.call(this,r,n);if(utils$1.isRegExp(o))return o.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,o){if(t=normalizeHeader(t),t){const n=utils$1.findKey(this,t);return!!(n&&this[n]!==void 0&&(!o||matchHeaderValue(this,this[n],n,o)))}return!1}delete(t,o){const n=this;let r=!1;function s(l){if(l=normalizeHeader(l),l){const i=utils$1.findKey(n,l);i&&(!o||matchHeaderValue(n,n[i],i,o))&&(delete n[i],r=!0)}}return utils$1.isArray(t)?t.forEach(s):s(t),r}clear(t){const o=Object.keys(this);let n=o.length,r=!1;for(;n--;){const s=o[n];(!t||matchHeaderValue(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const o=this,n={};return utils$1.forEach(this,(r,s)=>{const l=utils$1.findKey(n,s);if(l){o[l]=normalizeValue(r),delete o[s];return}const i=t?formatHeader(s):String(s).trim();i!==s&&delete o[s],o[i]=normalizeValue(r),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const o=Object.create(null);return utils$1.forEach(this,(n,r)=>{n!=null&&n!==!1&&(o[r]=t&&utils$1.isArray(n)?n.join(", "):n)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,o])=>t+": "+o).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...o){const n=new this(t);return o.forEach(r=>n.set(r)),n}static accessor(t){const n=(this[$internals]=this[$internals]={accessors:{}}).accessors,r=this.prototype;function s(l){const i=normalizeHeader(l);n[i]||(buildAccessors(r,l),n[i]=!0)}return utils$1.isArray(t)?t.forEach(s):s(t),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[o]=n}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(e,t){const o=this||defaults,n=t||o,r=AxiosHeaders$1.from(n.headers);let s=n.data;return utils$1.forEach(e,function(i){s=i.call(o,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function isCancel$1(e){return!!(e&&e.__CANCEL__)}function CanceledError$1(e,t,o){AxiosError$1.call(this,e??"canceled",AxiosError$1.ERR_CANCELED,t,o),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(e,t,o){const n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(new AxiosError$1("Request failed with status code "+o.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const o=new Array(e),n=new Array(e);let r=0,s=0,l;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),a=n[s];l||(l=u),o[r]=c,n[r]=u;let d=s,f=0;for(;d!==r;)f+=o[d++],d=d%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),u-l<t)return;const m=a&&u-a;return m?Math.round(f*1e3/m):void 0}}function throttle(e,t){let o=0,n=1e3/t,r,s;const l=(u,a=Date.now())=>{o=a,r=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const a=Date.now(),d=a-o;d>=n?l(u,a):(r=u,s||(s=setTimeout(()=>{s=null,l(r)},n-d)))},()=>r&&l(r)]}const progressEventReducer=(e,t,o=3)=>{let n=0;const r=speedometer(50,250);return throttle(s=>{const l=s.loaded,i=s.lengthComputable?s.total:void 0,c=l-n,u=r(c),a=l<=i;n=l;const d={loaded:l,total:i,progress:i?l/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i&&a?(i-l)/u:void 0,event:s,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(d)},o)},progressEventDecorator=(e,t)=>{const o=e!=null;return[n=>t[0]({lengthComputable:o,total:e,loaded:n}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap(()=>e(...t)),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>o=>(o=new URL(o,platform.origin),e.protocol===o.protocol&&e.host===o.host&&(t||e.port===o.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,o,n,r,s){const l=[e+"="+encodeURIComponent(t)];utils$1.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),utils$1.isString(n)&&l.push("path="+n),utils$1.isString(r)&&l.push("domain="+r),s===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,o){let n=!isAbsoluteURL(t);return e&&(n||o==!1)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const o={};function n(u,a,d,f){return utils$1.isPlainObject(u)&&utils$1.isPlainObject(a)?utils$1.merge.call({caseless:f},u,a):utils$1.isPlainObject(a)?utils$1.merge({},a):utils$1.isArray(a)?a.slice():a}function r(u,a,d,f){if(utils$1.isUndefined(a)){if(!utils$1.isUndefined(u))return n(void 0,u,d,f)}else return n(u,a,d,f)}function s(u,a){if(!utils$1.isUndefined(a))return n(void 0,a)}function l(u,a){if(utils$1.isUndefined(a)){if(!utils$1.isUndefined(u))return n(void 0,u)}else return n(void 0,a)}function i(u,a,d){if(d in t)return n(u,a);if(d in e)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:i,headers:(u,a,d)=>r(headersToObject(u),headersToObject(a),d,!0)};return utils$1.forEach(Object.keys({...e,...t}),function(a){const d=c[a]||r,f=d(e[a],t[a],a);utils$1.isUndefined(f)&&d!==i||(o[a]=f)}),o}const resolveConfig=e=>{const t=mergeConfig$1({},e);let{data:o,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:s,headers:l,auth:i}=t;t.headers=l=AxiosHeaders$1.from(l),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&l.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let c;if(utils$1.isFormData(o)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((c=l.getContentType())!==!1){const[u,...a]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];l.setContentType([u||"multipart/form-data",...a].join("; "))}}if(platform.hasStandardBrowserEnv&&(n&&utils$1.isFunction(n)&&(n=n(t)),n||n!==!1&&isURLSameOrigin(t.url))){const u=r&&s&&cookies.read(s);u&&l.set(r,u)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(o,n){const r=resolveConfig(e);let s=r.data;const l=AxiosHeaders$1.from(r.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:u}=r,a,d,f,m,p;function h(){m&&m(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let v=new XMLHttpRequest;v.open(r.method.toUpperCase(),r.url,!0),v.timeout=r.timeout;function b(){if(!v)return;const k=AxiosHeaders$1.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:k,config:e,request:v};settle(function(S){o(S),h()},function(S){n(S),h()},_),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(b)},v.onabort=function(){v&&(n(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,v)),v=null)},v.onerror=function(){n(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const _=r.transitional||transitionalDefaults;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),n(new AxiosError$1(E,_.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,v)),v=null},s===void 0&&l.setContentType(null),"setRequestHeader"in v&&utils$1.forEach(l.toJSON(),function(E,_){v.setRequestHeader(_,E)}),utils$1.isUndefined(r.withCredentials)||(v.withCredentials=!!r.withCredentials),i&&i!=="json"&&(v.responseType=r.responseType),u&&([f,p]=progressEventReducer(u,!0),v.addEventListener("progress",f)),c&&v.upload&&([d,m]=progressEventReducer(c),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(a=k=>{v&&(n(!k||k.type?new CanceledError$1(null,e,v):k),v.abort(),v=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const x=parseProtocol(r.url);if(x&&platform.protocols.indexOf(x)===-1){n(new AxiosError$1("Unsupported protocol "+x+":",AxiosError$1.ERR_BAD_REQUEST,e));return}v.send(s||null)})},composeSignals=(e,t)=>{const{length:o}=e=e?e.filter(Boolean):[];if(t||o){let n=new AbortController,r;const s=function(u){if(!r){r=!0,i();const a=u instanceof Error?u:this.reason;n.abort(a instanceof AxiosError$1?a:new CanceledError$1(a instanceof Error?a.message:a))}};let l=t&&setTimeout(()=>{l=null,s(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))},t);const i=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>utils$1.asap(i),c}},streamChunk=function*(e,t){let o=e.byteLength;if(o<t){yield e;return}let n=0,r;for(;n<o;)r=n+t,yield e.slice(n,r),n=r},readBytes=async function*(e,t){for await(const o of readStream(e))yield*streamChunk(o,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:o,value:n}=await t.read();if(o)break;yield n}}finally{await t.cancel()}},trackStream=(e,t,o,n)=>{const r=readBytes(e,t);let s=0,l,i=c=>{l||(l=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:a}=await r.next();if(u){i(),c.close();return}let d=a.byteLength;if(o){let f=s+=d;o(f)}c.enqueue(new Uint8Array(a))}catch(u){throw i(u),u}},cancel(c){return i(c),r.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?o=>o[t]():(o,n)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,n)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,t)=>{const o=utils$1.toFiniteNumber(e.getContentLength());return o??getBodyLength(t)},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:o,data:n,signal:r,cancelToken:s,timeout:l,onDownloadProgress:i,onUploadProgress:c,responseType:u,headers:a,withCredentials:d="same-origin",fetchOptions:f}=resolveConfig(e);u=u?(u+"").toLowerCase():"text";let m=composeSignals([r,s&&s.toAbortSignal()],l),p;const h=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(c&&supportsRequestStream&&o!=="get"&&o!=="head"&&(v=await resolveBodyLength(a,n))!==0){let _=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(utils$1.isFormData(n)&&(C=_.headers.get("content-type"))&&a.setContentType(C),_.body){const[S,B]=progressEventDecorator(v,progressEventReducer(asyncDecorator(c)));n=trackStream(_.body,DEFAULT_CHUNK_SIZE,S,B)}}utils$1.isString(d)||(d=d?"include":"omit");const b="credentials"in Request.prototype;p=new Request(t,{...f,signal:m,method:o.toUpperCase(),headers:a.normalize().toJSON(),body:n,duplex:"half",credentials:b?d:void 0});let x=await fetch(p,f);const k=supportsResponseStream&&(u==="stream"||u==="response");if(supportsResponseStream&&(i||k&&h)){const _={};["status","statusText","headers"].forEach(V=>{_[V]=x[V]});const C=utils$1.toFiniteNumber(x.headers.get("content-length")),[S,B]=i&&progressEventDecorator(C,progressEventReducer(asyncDecorator(i),!0))||[];x=new Response(trackStream(x.body,DEFAULT_CHUNK_SIZE,S,()=>{B&&B(),h&&h()}),_)}u=u||"text";let E=await resolvers[utils$1.findKey(resolvers,u)||"text"](x,e);return!k&&h&&h(),await new Promise((_,C)=>{settle(_,C,{data:E,headers:AxiosHeaders$1.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:p})})}catch(b){throw h&&h(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,p),{cause:b.cause||b}):AxiosError$1.from(b,b&&b.code,e,p)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let o,n;const r={};for(let s=0;s<t;s++){o=e[s];let l;if(n=o,!isResolvedHandle(o)&&(n=knownAdapters[(l=String(o)).toLowerCase()],n===void 0))throw new AxiosError$1(`Unknown adapter '${l}'`);if(n)break;r[l||"#"+s]=n}if(!n){const s=Object.entries(r).map(([i,c])=>`adapter ${i} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=t?s.length>1?`since :
|
|
4
4
|
`+s.map(renderReason).join(`
|
|
5
|
-
`):" "+renderReason(s[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return
|
|
6
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig$1(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),o!=null&&(utils$1.isFunction(o)?n.paramsSerializer={serialize:o}:validator.assertOptions(o,{encode:validators.function,serialize:validators.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&utils$1.merge(s.common,s[n.method]);s&&utils$1.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=AxiosHeaders$1.concat(l,s);const i=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,i.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let a,d=0,f;if(!c){const p=[dispatchRequest.bind(this),void 0];for(p.unshift.apply(p,i),p.push.apply(p,u),f=p.length,a=Promise.resolve(n);d<f;)a=a.then(p[d++],p[d++]);return a}f=i.length;let h=n;for(d=0;d<f;){const p=i[d++],v=i[d++];try{h=p(h)}catch(m){v.call(this,m);break}}try{a=dispatchRequest.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,f=u.length;d<f;)a=a.then(u[d++],u[d++]);return a}getUri(t){t=mergeConfig$1(this.defaults,t);const n=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(n,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function(t){Axios$1.prototype[t]=function(n,r){return this.request(mergeConfig$1(r||{},{method:t,url:n,data:(r||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(t){function n(r){return function(s,l,i){return this.request(mergeConfig$1(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}Axios$1.prototype[t]=n(),Axios$1.prototype[t+"Form"]=n(!0)});let CancelToken$1=class R{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const l=new Promise(i=>{r.subscribe(i),s=i}).then(o);return l.cancel=function(){r.unsubscribe(s)},l},t(function(s,l,i){r.reason||(r.reason=new CanceledError$1(s,l,i),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new R(function(o){t=o}),cancel:t}}};function spread$1(e){return function(n){return e.apply(null,n)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return createInstance(mergeConfig$1(e,o))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,_sfc_main$k=vue.defineComponent({__name:"vs-input-checkbox",props:{options:{type:Array,default:()=>[]},modelValue:{type:[Boolean,Array],default:!1},position:{default:()=>"vertical"},slots:{type:Object,default:()=>null},view:{type:String,default:()=>null},colSpan:{type:Number,default:()=>0},data:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=vue.ref([]),s=vue.reactive({}),l=a=>a?.value||a?.id||a?.text||a,i=a=>a.text||String(a),c=a=>`lg:col-span-${a||12}`,u=async()=>{try{const{data:a}=await axios.get(`/api/suggest/${n.data}`);o.value=a?.data||a}catch(a){console.error(a)}};return vue.watch(()=>n.modelValue,a=>{if(typeof a=="boolean"&&o.value.length===1){const d=l(o.value[0]);s[d]=a}else if(Array.isArray(a)){const d=new Set(a);o.value.forEach(f=>{if(!f.disabled){const h=l(f);s[h]=d.has(h)}})}},{immediate:!0}),vue.watch(s,()=>{if(!o.value.length){r("update:modelValue",null);return}const a=Object.entries(s).filter(([,d])=>d).map(([d])=>d);r("update:modelValue",a.length===0?null:a)},{deep:!0}),vue.onMounted(()=>{if(n.data)u().then(()=>{if(typeof n.modelValue=="boolean"&&o.value.length===1){const a=l(o.value[0]);s[a]=n.modelValue}else if(Array.isArray(n.modelValue)){const a=new Set(n.modelValue);o.value.forEach(d=>{if(!d.disabled){const f=l(d);s[f]=a.has(f)}})}});else if(o.value=n.options,typeof n.modelValue=="boolean"&&o.value.length===1){const a=l(o.value[0]);s[a]=n.modelValue}else if(Array.isArray(n.modelValue)){const a=new Set(n.modelValue);o.value.forEach(d=>{if(!d.disabled){const f=l(d);s[f]=a.has(f)}})}}),(a,d)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["p-0 w-full gap-[6px]",[e.position==="vertical"?"flex-col":"",e.colSpan?"grid":"flex justify-start"]])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.value,f=>(vue.openBlock(),vue.createBlock(_sfc_main$w,{modelValue:s[l(f)],"onUpdate:modelValue":h=>s[l(f)]=h,value:l(f),class:vue.normalizeClass(c(e.colSpan)),disabled:f.disabled,label:i(f),key:l(f),icon:f?.icon,imgUrl:f?.imgUrl,option:f,slots:e.slots,view:e.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","slots","view"]))),128))],2))}}),VsInputCheckbox=_export_sfc(_sfc_main$k,[["__scopeId","data-v-9685f778"]]),_hoisted_1$g=["placeholder","disabled"],_sfc_main$j=vue.defineComponent({__name:"vs-input-date1",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue");return(o,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"date","onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$g)),[[vue.vModelText,r.value]])}}),fileUpload=async(e,t,n,r)=>{try{const o=new FormData;o.append("unique","true"),o.append("file",e);const{data:s}=await axios.post(`/file/upload/uploads?id=${t||""}&form=${n||""}&table=${r||""}`,o);return s}catch(o){console.error(o)}},fileDelete=async e=>{try{return await axios.get(`file/delete${e}`),!0}catch(t){return console.error(t),!1}},fileDownload=async e=>{try{const t=await axios.get(`file/download/files/uploads${e}`,{responseType:"arraybuffer",headers:{"Content-Type":"application/json"}}),n=t.headers["content-type"],r=new TextDecoder("utf-8").decode(t.data),o=new Blob([r],{type:n}),s=document.createElement("a");s.setAttribute("download",e),s.href=window.URL.createObjectURL(o),s.click()}catch(t){console.error(t.message)}},_sfc_main$i={},_hoisted_1$f={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$8(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$f,t[0]||(t[0]=[vue.createElementVNode("path",{d:"M5 12h14"},null,-1),vue.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const IconPlus=_export_sfc(_sfc_main$i,[["render",_sfc_render$8]]),_sfc_main$h={},_hoisted_1$e={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$7(e,t,n,r,o,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const iconPdf=_export_sfc(_sfc_main$h,[["render",_sfc_render$7]]),_sfc_main$g={},_hoisted_1$d={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$6(e,t,n,r,o,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$d,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),vue.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),vue.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const IconCsv=_export_sfc(_sfc_main$g,[["render",_sfc_render$6]]),_sfc_main$f={},_hoisted_1$c={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"};function _sfc_render$5(e,t,n,r,o,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$c,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const IconFile=_export_sfc(_sfc_main$f,[["render",_sfc_render$5]]),_sfc_main$e={},_hoisted_1$b={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$4(e,t,n,r,o,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$b,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const IconZip=_export_sfc(_sfc_main$e,[["render",_sfc_render$4]]),_sfc_main$d={},_hoisted_1$a={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$3(e,t,n,r,o,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$a,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const IconGeojson=_export_sfc(_sfc_main$d,[["render",_sfc_render$3]]),getFileType=e=>{if(!e)return"";const t=e?.split(".");return t[t.length-1]},fileFormatPreview=e=>{const t=getFileType(e),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(t)?"img":n.sheetsFormat.includes(t)?IconCsv:n.textsFormat.includes(t)?IconGeojson:n.documentsFormat.includes(t)?iconPdf:n.archivesFormat.includes(t)?IconZip:IconFile},_sfc_main$c={},_hoisted_1$9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function _sfc_render$2(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$9,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const IconDelete=_export_sfc(_sfc_main$c,[["render",_sfc_render$2]]),_sfc_main$b={},_hoisted_1$8={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$1(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$8,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconDownload=_export_sfc(_sfc_main$b,[["render",_sfc_render$1]]),_hoisted_1$7={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},_hoisted_2$4={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},_sfc_main$a=vue.defineComponent({__name:"vs-input-file-list-item",props:vue.mergeModels({multiple:{type:Boolean}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(e){const t=vue.useModel(e,"value"),n=vue.useModel(e,"item"),r=e;return(o,s)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(fileFormatPreview)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:s[0]||(s[0]=l=>vue.unref(fileDownload)(n.value))},null,8,["src"])),vue.createElementVNode("div",_hoisted_2$4,[vue.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=l=>{vue.unref(fileDelete)(n.value),t.value=r.multiple?t.value?.filter(i=>i!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[vue.createVNode(IconDelete,{class:"w-4 h-4"})]),vue.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=l=>vue.unref(fileDownload)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[vue.createVNode(IconDownload,{class:"w-4 h-4"})])])]))}}),VsInputFileListItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-bc0f6d32"]]),_hoisted_1$6={class:"flex items-center gap-x-2"},_hoisted_2$3={key:1,class:"flex items-center flex-wrap gap-2"},_sfc_main$9=vue.defineComponent({__name:"vs-input-file",props:vue.mergeModels({multiple:{type:Boolean},format:{},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=vue.useModel(e,"modelValue"),r=vue.ref(null),o=l=>Array.isArray(n.value)&&n.value[l]||"",s=async l=>{if(t.format){const u=l.target.files?.[0];if(!u||!u.name.endsWith(t.format))return}const i=l.target.files?.[0];if(!i)return;const c=await fileUpload(i,"1","form","table");n.value=t.multiple?[...n.value||[],c.result?.file_path]:c.result?.file_path};return(l,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:r,type:"file",onChange:s},null,544),!l.multiple&&n.value?(vue.openBlock(),vue.createBlock(VsInputFileListItem,{key:0,item:n.value,"onUpdate:item":i[0]||(i[0]=c=>n.value=c),value:n.value,"onUpdate:value":i[1]||(i[1]=c=>n.value=c)},null,8,["item","value"])):l.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.value,(c,u)=>(vue.openBlock(),vue.createBlock(VsInputFileListItem,{multiple:l.multiple,key:u,value:n.value,"onUpdate:value":i[2]||(i[2]=a=>n.value=a),item:o(u)},null,8,["multiple","value","item"]))),128)),vue.createElementVNode("div",{onClick:i[3]||(i[3]=c=>!l.disabled&&r.value?.click()),class:vue.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2)])):vue.createCommentVNode("",!0),l.multiple?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=c=>r.value?.click()),class:vue.normalizeClass([l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2))]))}}),_hoisted_1$5={class:"flex items-center justify-between"},_hoisted_2$2={class:"text-[16px] text-gray-900 font-medium"},_hoisted_3$1={class:"grid gap-3"},_sfc_main$8=vue.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,n=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,r=>{n.value=r}),(r,o)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$5,[vue.createElementVNode("p",_hoisted_2$2,vue.toDisplayString(e.title),1),vue.createVNode(_sfc_main$r,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),style:vue.normalizeStyle(e.style)},null,8,["modelValue","style"])]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_3$1,[vue.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[vue.vShow,n.value]])]),_:3})]))}}),VsContainerSwitcher=_export_sfc(_sfc_main$8,[["__scopeId","data-v-479564a3"]]),_hoisted_1$4={class:"text-[16px] text-gray-900 font-medium"},_hoisted_2$1={class:"grid gap-3"},_sfc_main$7=vue.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,n=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,r=>{n.value=r}),(r,o)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("button",{type:"button",onClick:o[0]||(o[0]=s=>n.value=!n.value),class:"flex items-center gap-2"},[vue.createVNode(vue.unref(IconChevronDown),{class:vue.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),vue.createElementVNode("span",_hoisted_1$4,vue.toDisplayString(e.title),1)]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,[vue.renderSlot(r.$slots,"default",{},void 0,!0)],512),[[vue.vShow,n.value]])]),_:3})]))}}),VsContainerAccordion=_export_sfc(_sfc_main$7,[["__scopeId","data-v-a37284e6"]]),_hoisted_1$3={class:"flex items-center justify-between"},_sfc_main$6=vue.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(e){return(t,n)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$3,[vue.createElementVNode("p",null,vue.toDisplayString(e.title),1)]),vue.renderSlot(t.$slots,"default")]))}}),views={switcher:VsContainerSwitcher,accordion:VsContainerAccordion,default:_sfc_main$6},FormConditionsTypes={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},checkEqual=(e,t)=>e===t,checkInequal=(e,t)=>e!==t,checkHigher=(e,t)=>e>t,checkHigherOrEqual=(e,t)=>e>=t,checkLower=(e,t)=>e<t,checkLowerOrEqual=(e,t)=>e<=t,checkBetween=(e,t)=>Array.isArray(t)&&t.length===2?e>=t[0]&&e<=t[1]:!1,checkStartWith=(e,t)=>String(e).startsWith(String(t)),checkEndWith=(e,t)=>String(e).endsWith(String(t)),checkContain=(e,t)=>String(e).includes(String(t)),checkIn=(e,t)=>Array.isArray(t)?t.includes(e):!1,checkNotIn=(e,t)=>Array.isArray(t)?!t.includes(e):!0,isVisible=(e,t)=>{if(!t)return!0;switch(t?.[1]){case FormConditionsTypes.Equal:return checkEqual(e,t?.[2]);case FormConditionsTypes.Inequal:return checkInequal(e,t?.[2]);case FormConditionsTypes.Higer:return checkHigher(e,t?.[2]);case FormConditionsTypes.HigerOrEqual:return checkHigherOrEqual(e,t?.[2]);case FormConditionsTypes.Lower:return checkLower(e,t?.[2]);case FormConditionsTypes.LowerOrEqual:return checkLowerOrEqual(e,t?.[2]);case FormConditionsTypes.Between:return checkBetween(e,t?.[2]);case FormConditionsTypes.StartWith:return checkStartWith(e,t?.[2]);case FormConditionsTypes.EndWith:return checkEndWith(e,t?.[2]);case FormConditionsTypes.Contain:return checkContain(e,t?.[2]);case FormConditionsTypes.In:return checkIn(e,t?.[2]);case FormConditionsTypes.NotIn:return checkNotIn(e,t?.[2]);default:return!0}},_sfc_main$5=vue.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(e){const t=e,n=vue.inject("formValues",{default:{}}),r=vue.inject("form"),o=vue.computed(()=>t.schema?.filter(l=>{const i=l?.conditions;if(!i)return!0;const c=Array.isArray(i)?i[0]:i,u=n?.value?.[c];return isVisible(u,i)})),s=vue.computed(()=>views[t.view]);return(l,i)=>e.schema?.length?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(s.value),{key:0,title:e.title,style:vue.normalizeStyle(e.style)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.value,c=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:c.name},{ref_for:!0},c,{item:c,modelValue:vue.unref(n)[c.name],"onUpdate:modelValue":u=>vue.unref(n)[c.name]=u,style:e.style,error:vue.unref(r)?.errors?.[c.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):vue.createCommentVNode("",!0)}}),dynamicPosition=async(e,t,n,r=10)=>{if(!t||!n)return;await vue.nextTick();const o=await n?.getBoundingClientRect(),s=await t?.getBoundingClientRect();if(!s||!o)return;const l=await parseInt(t?.getBoundingClientRect()?.height.toString()),i=await parseInt(t?.getBoundingClientRect()?.width.toString()),c=await parseInt(n?.getBoundingClientRect()?.height.toString()),u=await parseInt(n?.getBoundingClientRect()?.width.toString()),a=await window.innerHeight,d=await window.innerWidth;let f=0,h=0;const p=s.bottom+r+c;switch(e){case"top":s.top-o.height-r<0?f=s.top-o.height+r+c+l:f=s.top-o.height-r,d>u+s.right+30?h=s.left-o.width/2+s.width/2:h=d-30-u;break;case"bottom":a>p?f=s.bottom+r:f=s.bottom-r-c-l,h=s.left-o.width/2+s.width/2;break;case"left":f=s.top-o.height/2+s.height/2,s.left-o.width-r>0?h=s.left-o.width-r:h=10;break;case"right":f=s.top-o.height/2+s.height/2,d-i>u?h=s.right+r:h=d-30-u;break;case"top-right":s.top-o.height-r<0?f=s.top-o.height+r+c+l:f=s.top-o.height-r,d-i>u?h=s.right+r:h=d-30-u;break;case"top-left":s.top-o.height-r<0?f=s.top-o.height+r+c+l:f=s.top-o.height-r,s.left-o.width-r>0?h=s.left-o.width-r:h=10;break;case"top-start":s.top-o.height-r<0?f=s.top-o.height+r+c+l:f=s.top-o.height-r,s.left>0?h=s.left:h=10;break;case"bottom-right":a>p?f=s.bottom+r:f=s.bottom-r-c-l,d-i>u?h=s.left:h=d-30-u;break;case"bottom-left":a>p?f=s.bottom+r:f=s.bottom-r-c-l,s.left>0?h=s.right-u:h=10;break;case"bottom-start":a>p?f=s.bottom+r:f=s.bottom-r-c-l,s.left>0?h=s.left:h=10;break}f+c>a?f=a-c-r:f<0&&(f=r),h+u>d?h=d-u-r:h<0&&(h=r),n instanceof HTMLElement&&(n.style.top=`${f}px`,n.style.left=`${h}px`,n.style.position="fixed")},_sfc_main$4={},_hoisted_1$2={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function _sfc_render(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$2,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),vue.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const IconMagnifyingGlass=_export_sfc(_sfc_main$4,[["render",_sfc_render]]),_hoisted_1$1=["disabled"],_hoisted_2={key:1},_hoisted_3={key:2,class:"text-gray-400"},_hoisted_4={class:"absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none"},_hoisted_5={key:0,class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"},_hoisted_6={class:"h-[30px] shrink-0 flex items-center relative justify-center"},_hoisted_7=["onClick"],_hoisted_8={class:"flex items-center gap-[8px] w-full"},_hoisted_9={key:2},_sfc_main$3=vue.defineComponent({__name:"vs-input-select",props:vue.mergeModels({placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:null},options:{default:()=>[]},maxHeight:{default:400},slots:{default:null},customClass:{default:""},style:{default:()=>({})},disabled:{type:Boolean},mode:{},api:{},search:{type:Boolean},error:{default:null}},{modelValue:{type:[Number,String],default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=vue.computed(()=>t.mode||(t.api||t.search?"search":null)),{inputClass:r}=useStyle(t.style),o=vue.useModel(e,"modelValue"),s=vue.ref({}),l=vue.ref(null),i=vue.ref(null),c=vue.ref(!1),u=vue.ref(null),a=vue.ref([]),d=vue.ref(-1),f=vue.ref([]),h=vue.ref(""),p=vue.ref(null);let v=null;const m=vue.computed(()=>{if(a.value?.length){const y=a.value?.filter(b=>b?.id!==u.value?.id);return[u.value].concat(y)?.filter(b=>b!==null)}return[]}),g=async()=>{try{const{data:y}=await axios.get(`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${h.value}`);return y.data}catch{return[]}},x=async y=>{document.body.click(),c.value=y!==void 0?y:!c.value,c.value&&!a.value?.length&&(!t.options?.length&&t.data?a.value=await g():t.options?.length&&(a.value=[...t.options])),c.value&&l.value?(s.value.width=`${l.value.getBoundingClientRect()?.width}px`,t.mode==="search"&&p.value?.focus(),i.value&&dynamicPosition("bottom-start",l.value,i.value)):d.value=-1},$=()=>c.value?x(!1):null,_=y=>{u.value=y,o.value=y.id,x(!1)},k=(y,b)=>{if(!y||!b)return;const w=y.offsetTop,A=w+y.offsetHeight,V=b.scrollTop,O=V+b.clientHeight;w<V?Object.assign(b,{scrollTop:w-80}):A>O&&Object.assign(b,{scrollTop:A-b.clientHeight+4})},E=y=>{if(!c.value)return;const{keyCode:b}=y;if([38,40,13].includes(b)&&y.preventDefault(),b===38){if(d.value===0)return;d.value-=1,k(f.value[d.value],i.value)}else if(b===40){if(d.value+1>=m.value?.length)return;d.value+=1,k(f.value[d.value],i.value)}else if(b===13){const w=m.value[d.value];w&&_(w)}},S=async y=>{if(c.value)return;const{keyCode:b}=y;[38,40].includes(b)&&(await y.preventDefault(),d.value=0,setTimeout(()=>x()))},C=y=>{c.value&&l.value&&i.value&&!i.value.contains(y.target)&&(c.value=!1)},B=y=>{y?.key==="Escape"&&c.value&&x(!1)};return vue.onMounted(async()=>{addEventListener("click",$),addEventListener("keydown",E),addEventListener("scroll",C,!0),addEventListener("keydown",B),t.options&&(a.value=t.options),o.value&&!t.options?.length&&t.data&&(a.value=await g()),u.value=a.value?.find(y=>y?.id.toString()===o.value?.toString())||null}),vue.onUnmounted(()=>{removeEventListener("click",$),removeEventListener("keydown",E),removeEventListener("scroll",C,!0),removeEventListener("keydown",B)}),vue.watch(h,y=>{let b=!1;(y===""||y.trimStart().length!==0)&&(b=!0),b&&(v&&clearTimeout(v),v=setTimeout(async()=>{!t.options?.length&&t.data?a.value=await g():a.value=t.options.filter(w=>w.text.toLowerCase().includes(y.toLowerCase()))},200))}),(y,b)=>(vue.openBlock(),vue.createElementBlock("div",{class:"relative w-full",ref_key:"select",ref:l,onClick:b[5]||(b[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis",[c.value?`ring-rind ring-2 ring-${y.style?.primaryColor||"blue"}-500`:"",u.value?.text?"pr-[50px]":"pr-[25px]",vue.unref(r),y.customClass,{"!border-red-600":y.error}]]),onKeydown:S,onClick:b[0]||(b[0]=w=>x(!c.value)),disabled:y.disabled,style:{border:"1px solid #CFD9E0"}},[u.value?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:u.value?.color})},null,4)):vue.createCommentVNode("",!0),u.value?.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2,vue.toDisplayString(u.value?.text),1)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_3,vue.toDisplayString(y.placeholder),1))],42,_hoisted_1$1),vue.createElementVNode("span",_hoisted_4,[vue.createVNode(vue.unref(IconChevronTopBottom),{height:"14",width:"14"})]),u.value?.text?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",onClick:b[1]||(b[1]=w=>{o.value=null,u.value=null}),class:"absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"},[vue.createVNode(vue.unref(IconClose),{height:"14",width:"14"})])):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("ul",{class:"z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",ref_key:"list",ref:i,style:vue.normalizeStyle({width:s.value.width,maxHeight:y.maxHeight+"px",backgroundColor:"white"}),onClick:b[4]||(b[4]=vue.withModifiers(()=>{},["stop"]))},[n.value==="search"?(vue.openBlock(),vue.createElementBlock("li",_hoisted_5,[vue.createElementVNode("div",_hoisted_6,[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":b[2]||(b[2]=w=>h.value=w),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref_key:"inputRef",ref:p},null,512),[[vue.vModelText,h.value]]),vue.createVNode(IconMagnifyingGlass,{width:"15px",height:"15px",class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),h.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(IconClose),{key:0,width:"15px",height:"15px",onClick:b[3]||(b[3]=w=>h.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0),m.value?.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[b[6]||(b[6]=vue.createElementVNode("li",{class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"}," Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ",-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(m.value,(w,A)=>(vue.openBlock(),vue.createElementBlock("li",{onClick:V=>_(w),key:w?.id,ref_for:!0,ref:V=>f.value[A]=V,class:vue.normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg",[d.value==A?"bg-gray-100":""]])},[vue.createElementVNode("span",_hoisted_8,[w?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:w?.color})},null,4)):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(w?.text),1)]),o.value==w?.id?(vue.openBlock(),vue.createBlock(vue.unref(IconCheck),{key:0,height:"14",width:"14","stroke-width":"2",class:"absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"})):vue.createCommentVNode("",!0)],10,_hoisted_7))),128))],64)):(vue.openBlock(),vue.createElementBlock("li",_hoisted_9,"Дані відсутні"))],4),[[vue.vShow,c.value]])]))],512))}}),_hoisted_1=["placeholder","disabled"],_sfc_main$2=vue.defineComponent({__name:"vs-input-textarea",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue");return(o,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("textarea",{"onUpdate:modelValue":s[0]||(s[0]=l=>r.value=l),placeholder:e.placeholder,disabled:e.disabled,row:"2",class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[vue.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1)),[[vue.vModelText,r.value]])}}),inputs={VsInputText:_sfc_main$B,VsInputRadio:_sfc_main$l,"vs-input-text":_sfc_main$B,"vs-input-textarea":_sfc_main$2,"vs-input-mask":_sfc_main$p,"vs-input-number":_sfc_main$A,"vs-input-radio":_sfc_main$l,"vs-input-select":_sfc_main$3,"vs-input-switcher":_sfc_main$r,"vs-input-static":_sfc_main$q,"vs-input-container":_sfc_main$5,"vs-input-date":_sfc_main$j,"vs-input-checkbox":VsInputCheckbox,"vs-input-file":_sfc_main$9,"vs-input-html":_sfc_main$o},_sfc_main$1=vue.defineComponent({__name:"vs-compact-form-layout",props:{type:{type:String,default:""},style:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},layout:{type:String,default:"default"}},setup(e){const t=e,n=vue.computed(()=>layouts$1[`${t.layout}`]),r=vue.computed(()=>inputs?.[`vs-input-${t.type}`]);return(o,s)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(n.value),vue.mergeProps(o.$attrs,{style:e.style,item:e.item}),{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(r.value),vue.mergeProps(o.$attrs,{style:e.style}),null,16,["style"]))]),_:1},16,["style","item"]))}}),formErrorsUa={required:"Це поле є обов’язковим",email:"Неправильний email"},required=e=>e?!1:formErrorsUa.required,email=e=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&e?formErrorsUa.email:!1,regexp=(e,t)=>!(typeof t.pattern=="string"?new RegExp(t.pattern):t.pattern).test(e)&&e?t.message:!1,custom=(value,customRule)=>{const func=eval(customRule.function);return func(value)?!1:customRule.message},checkFormRules=(e,t)=>{switch(typeof t=="string"?t:t.type){case"required":return required(e);case"email":return email(e);case"regexp":return regexp(e,t);case"custom":return custom(e,t);default:return!1}},mathTable={autocomplete:"select",combobox:"select",email:"text",datepicker:"date",markedtext:"text"};function convertType(e){const t=e.toLowerCase();return mathTable[t]||t}function convertSchema(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach(n=>{const r={name:n[0],...n[1],type:convertType(n[1].type),label:n[1].label||n[1].ua,rules:n[1].rules||n[1].validators};n[1].data&&(r.api=`/api/suggest/${n[1].data}`),t.push(r)}),t}function useForm(e,t){const n=convertSchema(t),r=vue.ref({});function o(c){const u=c?.conditions;if(!u)return!0;const a=Array.isArray(u)?u[0]:u,d=e?.value?.[a];return isVisible(d,u)}const s=(c=n,u=!0)=>(c.forEach(a=>{if(a.rules){if(!o(a)){console.log(a.name,"skip hidden"),delete r.value[a.name];return}a.rules.forEach(d=>{const f=checkFormRules(e.value[a.name],d);f?r.value[a.name]=f:delete r.value[a.name]})}a.schema&&s(a.schema,!1)}),u&&Object.values(r.value).some(Boolean)?r.value:null),l=vue.computed(()=>n?.filter(c=>o(c)));return{errors:r,validate:s,reset:()=>{e.value={},r.value={}},visibleSchema:l}}const _sfc_main=vue.defineComponent({__name:"vs-compact-form",props:vue.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},layout:{default:()=>"default"}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:vue.mergeModels(["handle-submit"],["update:form","update:values"]),setup(e,{emit:t}){const n=t,r=e,o=vue.useAttrs(),s=vue.useModel(e,"form"),l=vue.useModel(e,"values"),{errors:i,validate:c,reset:u,visibleSchema:a}=useForm(l,r.schema),d=()=>{c(),n("handle-submit",l.value)};return vue.onMounted(()=>{s.value.value=l.value,s.value.errors=i.value,s.value.reset=u,s.value.validate=c}),vue.provide("form",s),vue.provide("values",l),(f,h)=>(vue.openBlock(),vue.createElementBlock("form",{onSubmit:vue.withModifiers(d,["prevent"]),class:vue.normalizeClass(["grid grid-cols-12",f.layout==="default"?"gap-6":"gap-4"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(a),p=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:p.name,class:f.layout==="horizontal"?"col-span-12":`col-span-${p.col||12} `},{ref_for:!0},{...vue.unref(o),...f.style,...p},{item:p,layout:f.layout,modelValue:l.value[p.name],"onUpdate:modelValue":v=>l.value[p.name]=v,style:f.style,error:vue.unref(i)[p.name]}),null,16,["class","item","layout","modelValue","onUpdate:modelValue","style","error"]))),128))],34))}});_sfc_main.install=function e(t){t.component("VForm",_sfc_main)},exports.VForm=_sfc_main,exports.VsInputText=_sfc_main$B,exports.default=_sfc_main,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
5
|
+
`):" "+renderReason(s[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return n},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(e.adapter||defaults.adapter)(e).then(function(n){return throwIfCancellationRequested(e),n.data=transformData.call(e,e.transformResponse,n),n.headers=AxiosHeaders$1.from(n.headers),n},function(n){return isCancel$1(n)||(throwIfCancellationRequested(e),n&&n.response&&(n.response.data=transformData.call(e,e.transformResponse,n.response),n.response.headers=AxiosHeaders$1.from(n.response.headers))),Promise.reject(n)})}const VERSION$1="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function(t,o,n){function r(s,l){return"[Axios v"+VERSION$1+"] Transitional option '"+s+"'"+l+(n?". "+n:"")}return(s,l,i)=>{if(t===!1)throw new AxiosError$1(r(l," has been removed"+(o?" in "+o:"")),AxiosError$1.ERR_DEPRECATED);return o&&!deprecatedWarnings[l]&&(deprecatedWarnings[l]=!0,console.warn(r(l," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(s,l,i):!0}},validators$1.spelling=function(t){return(o,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function assertOptions(e,t,o){if(typeof e!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const s=n[r],l=t[s];if(l){const i=e[s],c=i===void 0||l(i,s,e);if(c!==!0)throw new AxiosError$1("option "+s+" must be "+c,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new AxiosError$1("Unknown option "+s,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,o){try{return await this._request(t,o)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+s):n.stack=s}catch{}}throw n}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=mergeConfig$1(this.defaults,o);const{transitional:n,paramsSerializer:r,headers:s}=o;n!==void 0&&validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r!=null&&(utils$1.isFunction(r)?o.paramsSerializer={serialize:r}:validator.assertOptions(r,{encode:validators.function,serialize:validators.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),validator.assertOptions(o,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let l=s&&utils$1.merge(s.common,s[o.method]);s&&utils$1.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),o.headers=AxiosHeaders$1.concat(l,s);const i=[];let c=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(o)===!1||(c=c&&h.synchronous,i.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let a,d=0,f;if(!c){const p=[dispatchRequest.bind(this),void 0];for(p.unshift(...i),p.push(...u),f=p.length,a=Promise.resolve(o);d<f;)a=a.then(p[d++],p[d++]);return a}f=i.length;let m=o;for(d=0;d<f;){const p=i[d++],h=i[d++];try{m=p(m)}catch(v){h.call(this,v);break}}try{a=dispatchRequest.call(this,m)}catch(p){return Promise.reject(p)}for(d=0,f=u.length;d<f;)a=a.then(u[d++],u[d++]);return a}getUri(t){t=mergeConfig$1(this.defaults,t);const o=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(o,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function(t){Axios$1.prototype[t]=function(o,n){return this.request(mergeConfig$1(n||{},{method:t,url:o,data:(n||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(t){function o(n){return function(s,l,i){return this.request(mergeConfig$1(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}Axios$1.prototype[t]=o(),Axios$1.prototype[t+"Form"]=o(!0)});let CancelToken$1=class F{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});const n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const l=new Promise(i=>{n.subscribe(i),s=i}).then(r);return l.cancel=function(){n.unsubscribe(s)},l},t(function(s,l,i){n.reason||(n.reason=new CanceledError$1(s,l,i),o(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=n=>{t.abort(n)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new F(function(r){t=r}),cancel:t}}};function spread$1(e){return function(o){return e.apply(null,o)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),o=bind(Axios$1.prototype.request,t);return utils$1.extend(o,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(o,t,null,{allOwnKeys:!0}),o.create=function(r){return createInstance(mergeConfig$1(e,r))},o}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,_sfc_main$k=vue.defineComponent({__name:"vs-input-checkbox",props:{options:{type:Array,default:()=>[]},modelValue:{type:[Boolean,Array],default:!1},position:{default:()=>"vertical"},slots:{type:Object,default:()=>null},view:{type:String,default:()=>null},colSpan:{type:Number,default:()=>0},data:{type:String,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,n=t,r=vue.ref([]),s=vue.reactive({}),l=a=>a?.value||a?.id||a?.text||a,i=a=>a.text||String(a),c=a=>`lg:col-span-${a||12}`,u=async()=>{try{const{data:a}=await axios.get(`/api/suggest/${o.data}`);r.value=a?.data||a}catch(a){console.error(a)}};return vue.watch(()=>o.modelValue,a=>{if(typeof a=="boolean"&&r.value.length===1){const d=l(r.value[0]);s[d]=a}else if(Array.isArray(a)){const d=new Set(a);r.value.forEach(f=>{if(!f.disabled){const m=l(f);s[m]=d.has(m)}})}},{immediate:!0}),vue.watch(s,()=>{if(!r.value.length){n("update:modelValue",null);return}const a=Object.entries(s).filter(([,d])=>d).map(([d])=>d);n("update:modelValue",a.length===0?null:a)},{deep:!0}),vue.onMounted(()=>{if(o.data)u().then(()=>{if(typeof o.modelValue=="boolean"&&r.value.length===1){const a=l(r.value[0]);s[a]=o.modelValue}else if(Array.isArray(o.modelValue)){const a=new Set(o.modelValue);r.value.forEach(d=>{if(!d.disabled){const f=l(d);s[f]=a.has(f)}})}});else if(r.value=o.options,typeof o.modelValue=="boolean"&&r.value.length===1){const a=l(r.value[0]);s[a]=o.modelValue}else if(Array.isArray(o.modelValue)){const a=new Set(o.modelValue);r.value.forEach(d=>{if(!d.disabled){const f=l(d);s[f]=a.has(f)}})}}),(a,d)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["p-0 w-full gap-[6px]",[e.position==="vertical"?"flex-col":"",e.colSpan?"grid":"flex justify-start"]])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,f=>(vue.openBlock(),vue.createBlock(_sfc_main$x,{modelValue:s[l(f)],"onUpdate:modelValue":m=>s[l(f)]=m,value:l(f),class:vue.normalizeClass(c(e.colSpan)),disabled:f.disabled,label:i(f),key:l(f),icon:f?.icon,imgUrl:f?.imgUrl,option:f,slots:e.slots,view:e.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","slots","view"]))),128))],2))}}),VsInputCheckbox=_export_sfc(_sfc_main$k,[["__scopeId","data-v-9685f778"]]),_hoisted_1$g=["placeholder","disabled"],_sfc_main$j=vue.defineComponent({__name:"vs-input-date1",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue");return(r,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("input",{type:"date","onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:e.placeholder,disabled:e.disabled,class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[vue.unref(o)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1$g)),[[vue.vModelText,n.value]])}}),$=(e,t)=>{const o=e.__vccOpts||e;for(const[n,r]of t)o[n]=r;return o};vue.defineComponent({props:{modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1}},data(){return{}},mounted(){this.modelValue||this.$emit("update:modelValue",!1)},computed:{modelState:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},labelCursorClasses(){return[{"cursor-not-allowed":this.disabled},{"cursor-pointer":!this.disabled}]}},methods:{handleEnterDown(e){const{keyCode:t}=e;t===13&&(this.modelState=!this.modelState)},addKeyHandler(){window.addEventListener("keydown",this.handleEnterDown)},removeKeyHandler(){window.removeEventListener("keydown",this.handleEnterDown)}}});const Vt={},zt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function Et(e,t){return vue.openBlock(),vue.createElementBlock("svg",zt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Lt=$(Vt,[["render",Et]]),jt={},Mt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function Pt(e,t){return vue.openBlock(),vue.createElementBlock("svg",Mt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))}const Tt=$(jt,[["render",Pt]]),It={},Rt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function Ot(e,t){return vue.openBlock(),vue.createElementBlock("svg",Rt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)]))}const Dt=$(It,[["render",Ot]]),Ht={},Nt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function At(e,t){return vue.openBlock(),vue.createElementBlock("svg",Nt,t[0]||(t[0]=[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))}const Kt=$(Ht,[["render",At]]),qt={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},Ut={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},Wt={class:"flex-1"},Gt={class:"font-medium text-gray-900"},Zt={class:"mt-0.5 text-sm text-gray-700"},le=vue.defineComponent({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(e){const t={success:Lt,warning:Tt,error:Kt,info:Dt};return(o,n)=>(vue.openBlock(),vue.createElementBlock("div",qt,[vue.createElementVNode("div",Ut,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(t[o.type]))),vue.createElementVNode("div",Wt,[vue.createElementVNode("strong",Gt,vue.toDisplayString(o.title),1),vue.createElementVNode("p",Zt,vue.toDisplayString(o.message),1)]),n[0]||(n[0]=vue.createElementVNode("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[vue.createElementVNode("span",{class:"sr-only"},"Dismiss popup"),vue.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}});vue.reactive({visible:!0});const H={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},jo=e=>{const{type:t="info",title:o,message:n,position:r="right-bottom"}=e||{};let s=document.querySelector("#notify-root");s||(s=document.createElement("div"),s.id="notify-root",s.className=`fixed z-[100] flex flex-col gap-3 ${H[r]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(s)),s.className.includes(H[r])||(Object.values(H).forEach(c=>{s.classList.remove(...c.split(" "))}),s.classList.add(...H[r].split(" ")));const l=document.createElement("div");s.appendChild(l);const i=vue.createApp({render(){return vue.h(le,{type:t,title:o,message:n,onClose:()=>{i.unmount(),l.remove()}})}});i.mount(l),l.querySelector("button")?.addEventListener("click",()=>{l.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),l.remove()},350)}),setTimeout(()=>{l.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{i.unmount(),l.remove()},350)},3500)},fileUpload=async(e,t,o,n)=>{try{const r=new FormData;r.append("unique","true"),r.append("file",e);const{data:s}=await axios.post(`/file/upload/uploads?id=${t||""}&form=${o||""}&table=${n||""}`,r);return s}catch(r){jo({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",r)}},fileDelete=async e=>{try{return await axios.get(`file/delete${e}`),!0}catch(t){return console.error(t),!1}},fileDownload=async e=>{try{const t=await axios.get(`file/download/files/uploads${e}`,{responseType:"arraybuffer",headers:{"Content-Type":"application/json"}}),o=t.headers["content-type"],n=new TextDecoder("utf-8").decode(t.data),r=new Blob([n],{type:o}),s=document.createElement("a");s.setAttribute("download",e),s.href=window.URL.createObjectURL(r),s.click()}catch(t){console.error(t.message)}},_sfc_main$i={},_hoisted_1$f={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$8(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$f,t[0]||(t[0]=[vue.createElementVNode("path",{d:"M5 12h14"},null,-1),vue.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const IconPlus=_export_sfc(_sfc_main$i,[["render",_sfc_render$8]]),_sfc_main$h={},_hoisted_1$e={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$7(e,t,o,n,r,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const iconPdf=_export_sfc(_sfc_main$h,[["render",_sfc_render$7]]),_sfc_main$g={},_hoisted_1$d={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$6(e,t,o,n,r,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$d,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),vue.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),vue.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const IconCsv=_export_sfc(_sfc_main$g,[["render",_sfc_render$6]]),_sfc_main$f={},_hoisted_1$c={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"};function _sfc_render$5(e,t,o,n,r,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$c,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const IconFile=_export_sfc(_sfc_main$f,[["render",_sfc_render$5]]),_sfc_main$e={},_hoisted_1$b={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$4(e,t,o,n,r,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$b,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const IconZip=_export_sfc(_sfc_main$e,[["render",_sfc_render$4]]),_sfc_main$d={},_hoisted_1$a={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function _sfc_render$3(e,t,o,n,r,s){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$a,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const IconGeojson=_export_sfc(_sfc_main$d,[["render",_sfc_render$3]]),getFileType=e=>{if(!e)return"";const t=e?.split(".");return t[t.length-1]},fileFormatPreview=e=>{const t=getFileType(e),o={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return o.imageFormat.includes(t)?"img":o.sheetsFormat.includes(t)?IconCsv:o.textsFormat.includes(t)?IconGeojson:o.documentsFormat.includes(t)?iconPdf:o.archivesFormat.includes(t)?IconZip:IconFile},_sfc_main$c={},_hoisted_1$9={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function _sfc_render$2(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$9,t[0]||(t[0]=[vue.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const IconDelete=_export_sfc(_sfc_main$c,[["render",_sfc_render$2]]),_sfc_main$b={},_hoisted_1$8={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function _sfc_render$1(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$8,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),vue.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),vue.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const IconDownload=_export_sfc(_sfc_main$b,[["render",_sfc_render$1]]),_hoisted_1$7={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},_hoisted_2$4={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},_sfc_main$a=vue.defineComponent({__name:"vs-input-file-list-item",props:vue.mergeModels({multiple:{type:Boolean}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(e){const t=vue.useModel(e,"value"),o=vue.useModel(e,"item"),n=e;return(r,s)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(fileFormatPreview)(o.value)),{src:o.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:s[0]||(s[0]=l=>vue.unref(fileDownload)(o.value))},null,8,["src"])),vue.createElementVNode("div",_hoisted_2$4,[vue.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=l=>{vue.unref(fileDelete)(o.value),t.value=n.multiple?t.value?.filter(i=>i!==o.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[vue.createVNode(IconDelete,{class:"w-4 h-4"})]),vue.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=l=>vue.unref(fileDownload)(o.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[vue.createVNode(IconDownload,{class:"w-4 h-4"})])])]))}}),VsInputFileListItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-bc0f6d32"]]),_hoisted_1$6={class:"flex items-center gap-x-2"},_hoisted_2$3={key:1,class:"flex items-center flex-wrap gap-2"},_sfc_main$9=vue.defineComponent({__name:"vs-input-file",props:vue.mergeModels({multiple:{type:Boolean},format:{},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,o=vue.useModel(e,"modelValue"),n=vue.ref(null),r=l=>Array.isArray(o.value)&&o.value[l]||"",s=async l=>{if(t.format){const u=l.target.files?.[0];if(!u||!u.name.endsWith(t.format))return}const i=l.target.files?.[0];if(!i)return;const c=await fileUpload(i,"1","form","table");o.value=t.multiple?[...o.value||[],c.result?.file_path]:c.result?.file_path};return(l,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:n,type:"file",onChange:s},null,544),!l.multiple&&o.value?(vue.openBlock(),vue.createBlock(VsInputFileListItem,{key:0,item:o.value,"onUpdate:item":i[0]||(i[0]=c=>o.value=c),value:o.value,"onUpdate:value":i[1]||(i[1]=c=>o.value=c)},null,8,["item","value"])):l.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.value,(c,u)=>(vue.openBlock(),vue.createBlock(VsInputFileListItem,{multiple:l.multiple,key:u,value:o.value,"onUpdate:value":i[2]||(i[2]=a=>o.value=a),item:r(u)},null,8,["multiple","value","item"]))),128)),vue.createElementVNode("div",{onClick:i[3]||(i[3]=c=>!l.disabled&&n.value?.click()),class:vue.normalizeClass(["h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2)])):vue.createCommentVNode("",!0),l.multiple?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=c=>n.value?.click()),class:vue.normalizeClass([l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[vue.createVNode(IconPlus,{class:"w-6 h-6"})],2))]))}}),_hoisted_1$5={class:"flex items-center justify-between"},_hoisted_2$2={class:"text-[16px] text-gray-900 font-medium"},_hoisted_3$1={class:"grid gap-3"},_sfc_main$8=vue.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,o=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,n=>{o.value=n}),(n,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$5,[vue.createElementVNode("p",_hoisted_2$2,vue.toDisplayString(e.title),1),vue.createVNode(_sfc_main$s,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),style:vue.normalizeStyle(e.style)},null,8,["modelValue","style"])]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_3$1,[vue.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[vue.vShow,o.value]])]),_:3})]))}}),VsContainerSwitcher=_export_sfc(_sfc_main$8,[["__scopeId","data-v-479564a3"]]),_hoisted_1$4={class:"text-[16px] text-gray-900 font-medium"},_hoisted_2$1={class:"grid gap-3"},_sfc_main$7=vue.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(e){const t=e,o=vue.ref(t.isOpen);return vue.watch(()=>t.isOpen,n=>{o.value=n}),(n,r)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=s=>o.value=!o.value),class:"flex items-center gap-2"},[vue.createVNode(vue.unref(IconChevronDown),{class:vue.normalizeClass(["h-4 w-4 duration-300",[o.value?"-rotate-180":""]])},null,8,["class"]),vue.createElementVNode("span",_hoisted_1$4,vue.toDisplayString(e.title),1)]),vue.createVNode(vue.Transition,{name:"slide-fade"},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,[vue.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[vue.vShow,o.value]])]),_:3})]))}}),VsContainerAccordion=_export_sfc(_sfc_main$7,[["__scopeId","data-v-a37284e6"]]),_hoisted_1$3={class:"flex items-center justify-between"},_sfc_main$6=vue.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(e){return(t,o)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$3,[vue.createElementVNode("p",null,vue.toDisplayString(e.title),1)]),vue.renderSlot(t.$slots,"default")]))}}),views={switcher:VsContainerSwitcher,accordion:VsContainerAccordion,default:_sfc_main$6},FormConditionsTypes={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},checkEqual=(e,t)=>e===t,checkInequal=(e,t)=>e!==t,checkHigher=(e,t)=>e>t,checkHigherOrEqual=(e,t)=>e>=t,checkLower=(e,t)=>e<t,checkLowerOrEqual=(e,t)=>e<=t,checkBetween=(e,t)=>Array.isArray(t)&&t.length===2?e>=t[0]&&e<=t[1]:!1,checkStartWith=(e,t)=>String(e).startsWith(String(t)),checkEndWith=(e,t)=>String(e).endsWith(String(t)),checkContain=(e,t)=>String(e).includes(String(t)),checkIn=(e,t)=>Array.isArray(t)?t.includes(e):!1,checkNotIn=(e,t)=>Array.isArray(t)?!t.includes(e):!0,isVisible=(e,t)=>{if(!t)return!0;switch(t?.[1]){case FormConditionsTypes.Equal:return checkEqual(e,t?.[2]);case FormConditionsTypes.Inequal:return checkInequal(e,t?.[2]);case FormConditionsTypes.Higer:return checkHigher(e,t?.[2]);case FormConditionsTypes.HigerOrEqual:return checkHigherOrEqual(e,t?.[2]);case FormConditionsTypes.Lower:return checkLower(e,t?.[2]);case FormConditionsTypes.LowerOrEqual:return checkLowerOrEqual(e,t?.[2]);case FormConditionsTypes.Between:return checkBetween(e,t?.[2]);case FormConditionsTypes.StartWith:return checkStartWith(e,t?.[2]);case FormConditionsTypes.EndWith:return checkEndWith(e,t?.[2]);case FormConditionsTypes.Contain:return checkContain(e,t?.[2]);case FormConditionsTypes.In:return checkIn(e,t?.[2]);case FormConditionsTypes.NotIn:return checkNotIn(e,t?.[2]);default:return!0}},_sfc_main$5=vue.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(e){const t=e,o=vue.inject("formValues",{default:{}}),n=vue.inject("form"),r=vue.computed(()=>t.schema?.filter(l=>{const i=l?.conditions;if(!i)return!0;const c=Array.isArray(i)?i[0]:i,u=o?.value?.[c];return isVisible(u,i)})),s=vue.computed(()=>views[t.view]);return(l,i)=>e.schema?.length?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(s.value),{key:0,title:e.title,style:vue.normalizeStyle(e.style)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.value,c=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:c.name},{ref_for:!0},c,{item:c,modelValue:vue.unref(o)[c.name],"onUpdate:modelValue":u=>vue.unref(o)[c.name]=u,style:e.style,error:vue.unref(n)?.errors?.[c.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):vue.createCommentVNode("",!0)}}),dynamicPosition=async(e,t,o,n=10)=>{if(!t||!o)return;await vue.nextTick();const r=await o?.getBoundingClientRect(),s=await t?.getBoundingClientRect();if(!s||!r)return;const l=await parseInt(t?.getBoundingClientRect()?.height.toString()),i=await parseInt(t?.getBoundingClientRect()?.width.toString()),c=await parseInt(o?.getBoundingClientRect()?.height.toString()),u=await parseInt(o?.getBoundingClientRect()?.width.toString()),a=await window.innerHeight,d=await window.innerWidth;let f=0,m=0;const p=s.bottom+n+c;switch(e){case"top":s.top-r.height-n<0?f=s.top-r.height+n+c+l:f=s.top-r.height-n,d>u+s.right+30?m=s.left-r.width/2+s.width/2:m=d-30-u;break;case"bottom":a>p?f=s.bottom+n:f=s.bottom-n-c-l,m=s.left-r.width/2+s.width/2;break;case"left":f=s.top-r.height/2+s.height/2,s.left-r.width-n>0?m=s.left-r.width-n:m=10;break;case"right":f=s.top-r.height/2+s.height/2,d-i>u?m=s.right+n:m=d-30-u;break;case"top-right":s.top-r.height-n<0?f=s.top-r.height+n+c+l:f=s.top-r.height-n,d-i>u?m=s.right+n:m=d-30-u;break;case"top-left":s.top-r.height-n<0?f=s.top-r.height+n+c+l:f=s.top-r.height-n,s.left-r.width-n>0?m=s.left-r.width-n:m=10;break;case"top-start":s.top-r.height-n<0?f=s.top-r.height+n+c+l:f=s.top-r.height-n,s.left>0?m=s.left:m=10;break;case"bottom-right":a>p?f=s.bottom+n:f=s.bottom-n-c-l,d-i>u?m=s.left:m=d-30-u;break;case"bottom-left":a>p?f=s.bottom+n:f=s.bottom-n-c-l,s.left>0?m=s.right-u:m=10;break;case"bottom-start":a>p?f=s.bottom+n:f=s.bottom-n-c-l,s.left>0?m=s.left:m=10;break}f+c>a?f=a-c-n:f<0&&(f=n),m+u>d?m=d-u-n:m<0&&(m=n),o instanceof HTMLElement&&(o.style.top=`${f}px`,o.style.left=`${m}px`,o.style.position="fixed")},_sfc_main$4={},_hoisted_1$2={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function _sfc_render(e,t){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$2,t[0]||(t[0]=[vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),vue.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),vue.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const IconMagnifyingGlass=_export_sfc(_sfc_main$4,[["render",_sfc_render]]),_hoisted_1$1=["disabled"],_hoisted_2={key:1},_hoisted_3={key:2,class:"text-gray-400"},_hoisted_4={class:"absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none"},_hoisted_5={key:0,class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"},_hoisted_6={class:"h-[30px] shrink-0 flex items-center relative justify-center"},_hoisted_7=["onClick"],_hoisted_8={class:"flex items-center gap-[8px] w-full"},_hoisted_9={key:2},_hoisted_10={class:"relative"},_hoisted_11={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},_hoisted_12={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},_hoisted_13={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},_hoisted_14={class:"p-4 mim-h-0 h-full overflow-auto"},_hoisted_15={class:"vs-form__head mb-5 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},_sfc_main$3=vue.defineComponent({__name:"vs-input-select",props:vue.mergeModels({placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:null},options:{default:()=>[]},maxHeight:{default:400},slots:{default:null},customClass:{default:""},style:{default:()=>({})},disabled:{type:Boolean},mode:{},add:{},api:{},search:{type:Boolean},error:{default:null}},{modelValue:{type:[Number,String],default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,o=vue.computed(()=>t.mode||(t.api||t.search?"search":null)),{inputClass:n}=useStyle(t.style),r=vue.useModel(e,"modelValue"),s=vue.ref({}),l=vue.ref(null),i=vue.ref(null),c=vue.ref(!1),u=vue.ref(null),a=vue.ref([]),d=vue.ref(-1),f=vue.ref([]),m=vue.ref(""),p=vue.ref(null);let h=null;const v=vue.ref(!1),b=vue.ref(null),x=vue.ref({}),k=vue.ref({}),E=vue.computed(()=>{if(a.value?.length){const g=a.value?.filter(y=>y?.id!==u.value?.id);return[u.value].concat(g)?.filter(y=>y!==null)}return[]}),_=async()=>{try{const{data:g}=await axios.get(`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${m.value}`);return g.data}catch{return[]}},C=async g=>{document.body.click(),c.value=g!==void 0?g:!c.value,c.value&&!a.value?.length&&(!t.options?.length&&t.data?a.value=await _():t.options?.length&&(a.value=[...t.options])),c.value&&l.value?(s.value.width=`${l.value.getBoundingClientRect()?.width}px`,t.mode==="search"&&p.value?.focus(),i.value&&dynamicPosition("bottom-start",l.value,i.value)):d.value=-1},S=()=>c.value?C(!1):null,B=g=>{u.value=g,r.value=g.id,C(!1)},V=(g,y)=>{if(!g||!y)return;const w=g.offsetTop,A=w+g.offsetHeight,N=y.scrollTop,L=N+y.clientHeight;w<N?Object.assign(y,{scrollTop:w-80}):A>L&&Object.assign(y,{scrollTop:A-y.clientHeight+4})},O=g=>{if(!c.value)return;const{keyCode:y}=g;if([38,40,13].includes(y)&&g.preventDefault(),y===38){if(d.value===0)return;d.value-=1,V(f.value[d.value],i.value)}else if(y===40){if(d.value+1>=E.value?.length)return;d.value+=1,V(f.value[d.value],i.value)}else if(y===13){const w=E.value[d.value];w&&B(w)}},M=async g=>{if(c.value)return;const{keyCode:y}=g;[38,40].includes(y)&&(await g.preventDefault(),d.value=0,setTimeout(()=>C()))},R=g=>{c.value&&l.value&&i.value&&!i.value.contains(g.target)&&(c.value=!1)},T=g=>{g?.key==="Escape"&&c.value&&C(!1)};vue.onMounted(async()=>{addEventListener("click",S),addEventListener("keydown",O),addEventListener("scroll",R,!0),addEventListener("keydown",T),t.options&&(a.value=t.options),r.value&&!t.options?.length&&t.data&&(a.value=await _()),u.value=a.value?.find(g=>g?.id.toString()===r.value?.toString())||null}),vue.onUnmounted(()=>{removeEventListener("click",S),removeEventListener("keydown",O),removeEventListener("scroll",R,!0),removeEventListener("keydown",T)}),vue.watch(m,g=>{let y=!1;(g===""||g.trimStart().length!==0)&&(y=!0),y&&(h&&clearTimeout(h),h=setTimeout(async()=>{!t.options?.length&&t.data?a.value=await _():a.value=t.options.filter(w=>w.text.toLowerCase().includes(g.toLowerCase()))},200))});async function D(){v.value=!0;const g=await fetch(`/api/template/form/${t.add.form}`).then(y=>y.json());b.value=g.schema}async function j(){k.value.validate()||(await fetch("/api/table/"+t.add.token,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x.value)}).then(y=>y.json()),v.value=!1)}return(g,y)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"relative w-full",ref_key:"select",ref:l,onClick:y[5]||(y[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis",[c.value?`ring-rind ring-2 ring-${g.style?.primaryColor||"blue"}-500`:"",u.value?.text?"pr-[50px]":"pr-[25px]",vue.unref(n),g.customClass,{"!border-red-600":g.error}]]),onKeydown:M,onClick:y[0]||(y[0]=w=>C(!c.value)),disabled:g.disabled,style:{border:"1px solid #CFD9E0"}},[u.value?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:u.value?.color})},null,4)):vue.createCommentVNode("",!0),u.value?.text?(vue.openBlock(),vue.createElementBlock("span",_hoisted_2,vue.toDisplayString(u.value?.text),1)):(vue.openBlock(),vue.createElementBlock("span",_hoisted_3,vue.toDisplayString(g.placeholder),1))],42,_hoisted_1$1),vue.createElementVNode("span",_hoisted_4,[vue.createVNode(vue.unref(IconChevronTopBottom),{height:"14",width:"14"})]),u.value?.text?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",onClick:y[1]||(y[1]=w=>{r.value=null,u.value=null}),class:"absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"},[vue.createVNode(vue.unref(IconClose),{height:"14",width:"14"})])):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("ul",{class:"z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",ref_key:"list",ref:i,style:vue.normalizeStyle({width:s.value.width,maxHeight:g.maxHeight+"px",backgroundColor:"white"}),onClick:y[4]||(y[4]=vue.withModifiers(()=>{},["stop"]))},[o.value==="search"?(vue.openBlock(),vue.createElementBlock("li",_hoisted_5,[vue.createElementVNode("div",_hoisted_6,[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":y[2]||(y[2]=w=>m.value=w),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref_key:"inputRef",ref:p},null,512),[[vue.vModelText,m.value]]),vue.createVNode(IconMagnifyingGlass,{width:"15px",height:"15px",class:"absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"}),m.value!=""?(vue.openBlock(),vue.createBlock(vue.unref(IconClose),{key:0,width:"15px",height:"15px",onClick:y[3]||(y[3]=w=>m.value=""),class:"absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"})):vue.createCommentVNode("",!0)])])):vue.createCommentVNode("",!0),E.value?.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[y[10]||(y[10]=vue.createElementVNode("li",{class:"sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"}," Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ",-1)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(E.value,(w,A)=>(vue.openBlock(),vue.createElementBlock("li",{onClick:N=>B(w),key:w?.id,ref_for:!0,ref:N=>f.value[A]=N,class:vue.normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg",[d.value==A?"bg-gray-100":""]])},[vue.createElementVNode("span",_hoisted_8,[w?.color?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block",style:vue.normalizeStyle({backgroundColor:w?.color})},null,4)):vue.createCommentVNode("",!0),vue.createTextVNode(" "+vue.toDisplayString(w?.text),1)]),r.value==w?.id?(vue.openBlock(),vue.createBlock(vue.unref(IconCheck),{key:0,height:"14",width:"14","stroke-width":"2",class:"absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"})):vue.createCommentVNode("",!0)],10,_hoisted_7))),128))],64)):(vue.openBlock(),vue.createElementBlock("li",_hoisted_9,"Дані відсутні"))],4),[[vue.vShow,c.value]])]))],512),t.add?(vue.openBlock(),vue.createElementBlock("button",{key:0,onClick:D,class:"ml-auto bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10px] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40px] gap-[8px] flex items-center"},y[11]||(y[11]=[vue.createElementVNode("svg",{class:"vpbnr cp61q",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[vue.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"})],-1),vue.createElementVNode("span",null,"Додати",-1)]))):vue.createCommentVNode("",!0),(vue.openBlock(),vue.createBlock(vue.Teleport,{to:"body"},[vue.withDirectives(vue.createElementVNode("div",_hoisted_10,[vue.createElementVNode("div",_hoisted_11,[vue.createElementVNode("div",_hoisted_12,[vue.createElementVNode("div",_hoisted_13,[y[13]||(y[13]=vue.createElementVNode("h3",{class:"font-medium text-gray-800 dark:text-[#ffffff]"},"Додати",-1)),vue.createElementVNode("button",{onClick:y[6]||(y[6]=w=>v.value=!1),type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},y[12]||(y[12]=[vue.createElementVNode("span",{class:"sr-only"},"Close",-1),vue.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[vue.createElementVNode("path",{d:"M18 6 6 18"}),vue.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),vue.createElementVNode("div",_hoisted_14,[b.value?(vue.openBlock(),vue.createBlock(_sfc_main,{key:0,schema:b.value,values:x.value,"onUpdate:values":y[7]||(y[7]=w=>x.value=w),form:k.value,"onUpdate:form":y[8]||(y[8]=w=>k.value=w)},null,8,["schema","values","form"])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_15,[vue.createElementVNode("button",{type:"button",onClick:y[9]||(y[9]=w=>v.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),vue.createElementVNode("button",{onClick:j,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])])],512),[[vue.vShow,v.value]])]))],64))}}),_hoisted_1=["placeholder","disabled"],_sfc_main$2=vue.defineComponent({__name:"vs-input-textarea",props:vue.mergeModels({style:{type:Object,default:()=>({})},customClass:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,{inputClass:o}=useStyle(t.style),n=vue.useModel(e,"modelValue");return(r,s)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("textarea",{"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),placeholder:e.placeholder,disabled:e.disabled,row:"2",class:vue.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[vue.unref(o)]]),style:{border:"1px solid #CFD9E0"}},null,10,_hoisted_1)),[[vue.vModelText,n.value]])}}),inputs={VsInputText:_sfc_main$C,VsInputRadio:_sfc_main$l,"vs-input-text":_sfc_main$C,"vs-input-textarea":_sfc_main$2,"vs-input-mask":_sfc_main$q,"vs-input-number":_sfc_main$B,"vs-input-radio":_sfc_main$l,"vs-input-select":_sfc_main$3,"vs-input-switcher":_sfc_main$s,"vs-input-static":_sfc_main$r,"vs-input-container":_sfc_main$5,"vs-input-date":_sfc_main$j,"vs-input-checkbox":VsInputCheckbox,"vs-input-file":_sfc_main$9,"vs-input-html":_sfc_main$p,"vs-input-email":_sfc_main$o},_sfc_main$1=vue.defineComponent({__name:"vs-compact-form-layout",props:{type:{type:String,default:""},style:{type:Object,default:()=>({})},item:{type:Object,default:()=>({})},layout:{type:String,default:"default"}},setup(e){const t=e,o=vue.computed(()=>layouts$1[`${t.layout}`]),n=vue.computed(()=>inputs?.[`vs-input-${t.type}`]);return(r,s)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(o.value),vue.mergeProps(r.$attrs,{style:e.style,item:e.item}),{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(n.value),vue.mergeProps(r.$attrs,{style:e.style}),null,16,["style"]))]),_:1},16,["style","item"]))}}),formErrorsUa={required:"Це поле є обов’язковим",email:"Неправильний email"},required=e=>e?!1:formErrorsUa.required,email=e=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&e?formErrorsUa.email:!1,regexp=(e,t)=>!(typeof t.pattern=="string"?new RegExp(t.pattern):t.pattern).test(e)&&e?t.message:!1,custom=(value,customRule)=>{const func=eval(customRule.function);return func(value)?!1:customRule.message},checkFormRules=(e,t)=>{switch(typeof t=="string"?t:t.type){case"required":return required(e);case"email":return email(e);case"regexp":return regexp(e,t);case"custom":return custom(e,t);default:return!1}},mathTable={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",filelist:"file"};function convertType(e){const t=e.toLowerCase();return mathTable[t]||t}function convertSchema(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach(o=>{const n={name:o[0],...o[1],type:convertType(o[1].type),label:o[1].label||o[1].ua,rules:o[1].rules||o[1].validators};o[1].type.includes("list")&&(n.multiple=!0),o[1].data&&(n.api=`/api/suggest/${o[1].data}`),t.push(n)}),t}function useForm(e,t){const o=convertSchema(t),n=vue.ref({});function r(c){const u=c?.conditions;if(!u)return!0;const a=Array.isArray(u)?u[0]:u,d=e?.value?.[a];return isVisible(d,u)}const s=(c=o,u=!0)=>(c.forEach(a=>{if(a.rules){if(!r(a)){console.log(a.name,"skip hidden"),delete n.value[a.name];return}a.rules.forEach(d=>{const f=checkFormRules(e.value[a.name],d);f?n.value[a.name]=f:delete n.value[a.name]})}a.schema&&s(a.schema,!1)}),u&&Object.values(n.value).some(Boolean)?n.value:null),l=vue.computed(()=>o?.filter(c=>r(c)));return{errors:n,validate:s,reset:()=>{e.value={},n.value={}},visibleSchema:l}}const _sfc_main=vue.defineComponent({__name:"vs-compact-form",props:vue.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},layout:{default:()=>"default"}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:vue.mergeModels(["handle-submit"],["update:form","update:values"]),setup(e,{emit:t}){const o=t,n=e,r=vue.useAttrs(),s=vue.useModel(e,"form"),l=vue.useModel(e,"values"),{errors:i,validate:c,reset:u,visibleSchema:a}=useForm(l,n.schema),d=()=>{c(),o("handle-submit",l.value)};return vue.onMounted(()=>{s.value.value=l.value,s.value.errors=i.value,s.value.reset=u,s.value.validate=c}),vue.provide("form",s),vue.provide("values",l),(f,m)=>(vue.openBlock(),vue.createElementBlock("form",{onSubmit:vue.withModifiers(d,["prevent"]),class:vue.normalizeClass(["grid grid-cols-12",f.layout==="default"?"gap-6":"gap-4"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(a),p=>(vue.openBlock(),vue.createBlock(_sfc_main$1,vue.mergeProps({key:p.name,class:f.layout==="horizontal"?"col-span-12":`col-span-${p.col||12} `},{ref_for:!0},{...vue.unref(r),...f.style,...p},{item:p,layout:f.layout,modelValue:l.value[p.name],"onUpdate:modelValue":h=>l.value[p.name]=h,style:f.style,error:vue.unref(i)[p.name]}),null,16,["class","item","layout","modelValue","onUpdate:modelValue","style","error"]))),128))],34))}});_sfc_main.install=function e(t){t.component("VForm",_sfc_main)},exports.VForm=_sfc_main,exports.VsInputText=_sfc_main$C,exports.default=_sfc_main,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|