import{aa as r,aR as k,ac as b}from"./index.02c939b6.js";import{d as g,u as V,c,o as n,i as o,F as I,t as A,e as u,m as B}from"./index.9838a17e.js";const S={class:"my-4"},z={key:0,class:"text-input-placeholder"},C={class:"inline-flex cursor-pointer items-center"},F=["checked","onInput"],L={class:"checkbox-label text-input-size text-theme-700 select-none"},E=g({__name:"InputCheckboxMulti",props:{modelValue:{type:[Array,String],default:()=>[]},list:{type:Array,default:()=>{}}},emits:["update:modelValue"],setup(d,{emit:m}){const a=d,p=V(),i=c(()=>{var e;return k((e=a.list)!=null?e:[])}),h=c(()=>typeof a.modelValue=="string"?a.modelValue.split(",").map(e=>e.trim()):a.modelValue),s=c({get:()=>{var e;return(e=h.value)!=null?e:[]},set:e=>{m("update:modelValue",e)}}),f=e=>{var t;return!!(e&&((t=s.value)==null?void 0:t.includes(e)))},v=e=>{const t=s.value.indexOf(e);t>-1&&(s.value.splice(t,1),s.value=[...s.value])},_=e=>{const t=e.value;!t||(s.value.includes(t)?v(t):s.value=[...s.value,t])},x=["form-checkbox","mr-4","h-5","w-5","appearance-none","rounded-md","border","focus:outline-none","focus:ring-0","border-theme-300","hover:border-theme-400","text-theme-500","bg-theme-100"];return(e,t)=>(n(),o("div",S,[r(i).length==0?(n(),o("div",z,"No Items")):(n(!0),o(I,{key:1},A(r(i),(l,y)=>(n(),o("div",{key:y,class:"my-2"},[u("label",C,[u("input",B(r(p),{type:"checkbox",class:x,checked:f(l.value),onInput:N=>_(l)}),null,16,F),u("span",L,b(l.name),1)])]))),128))]))}});export{E as default};
