import{I as S,J as c,h as w,K as g,v as m,S as B,U as V,o as n,c as s,a as d,Q as q,aw as $,P as A,B as t,M as I,d as N,t as b,z as u}from"./entry.RGd0w9hd.js";import{u as j}from"./selectMenu.C9lwG85K.js";import{u as M}from"./useFormGroup.Y2N1Wpzd.js";import{_ as O}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./uid.KLLbMoZc.js";import"./index.g8c07QCY.js";const U={wrapper:"relative flex items-start",container:"flex items-center h-5",base:"h-4 w-4 dark:checked:bg-current dark:checked:border-transparent dark:indeterminate:bg-current dark:indeterminate:border-transparent disabled:opacity-50 disabled:cursor-not-allowed focus:ring-0 focus:ring-transparent focus:ring-offset-transparent",form:"form-checkbox",rounded:"rounded",color:"text-{color}-500 dark:text-{color}-400",background:"bg-white dark:bg-gray-900",border:"border border-gray-300 dark:border-gray-700",ring:"focus-visible:ring-2 focus-visible:ring-{color}-500 dark:focus-visible:ring-{color}-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-gray-900",inner:"ms-3 flex flex-col",label:"text-sm font-medium text-gray-700 dark:text-gray-200",required:"text-sm text-red-500 dark:text-red-400",help:"text-sm text-gray-500 dark:text-gray-400",default:{color:"primary"}},y=S(c.ui.strategy,c.ui.checkbox,U),z=w({inheritAttrs:!1,props:{id:{type:String,default:()=>null},value:{type:[String,Number,Boolean,Object],default:null},modelValue:{type:[Boolean,Array],default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},help:{type:String,default:null},label:{type:String,default:null},required:{type:Boolean,default:!1},color:{type:String,default:()=>y.default.color,validator(e){return c.ui.colors.includes(e)}},inputClass:{type:String,default:""},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},emits:["update:modelValue","change"],setup(e,{emit:a}){const{ui:r,attrs:f}=j("checkbox",g(e,"ui"),y,g(e,"class")),{emitFormChange:p,color:l,name:o,inputId:k}=M(e),h=m({get(){return e.modelValue},set(i){a("update:modelValue",i)}}),v=i=>{a("change",i),p()},C=m(()=>B(V(r.value.base,r.value.form,r.value.rounded,r.value.background,r.value.border,l.value&&r.value.ring.replaceAll("{color}",l.value),l.value&&r.value.color.replaceAll("{color}",l.value)),e.inputClass));return{ui:r,attrs:f,toggle:h,inputId:k,name:o,inputClass:C,onChange:v}}}),D=["id","name","required","value","disabled","checked","indeterminate"],F=["for"];function J(e,a,r,f,p,l){return n(),s("div",{class:t(e.ui.wrapper)},[d("div",{class:t(e.ui.container)},[q(d("input",A({id:e.inputId,"onUpdate:modelValue":a[0]||(a[0]=o=>e.toggle=o),name:e.name,required:e.required,value:e.value,disabled:e.disabled,checked:e.checked,indeterminate:e.indeterminate,type:"checkbox",class:e.inputClass},e.attrs,{onChange:a[1]||(a[1]=(...o)=>e.onChange&&e.onChange(...o))}),null,16,D),[[$,e.toggle]])],2),e.label||e.$slots.label?(n(),s("div",{key:0,class:t(e.ui.inner)},[d("label",{for:e.inputId,class:t(e.ui.label)},[I(e.$slots,"label",{},()=>[N(b(e.label),1)]),e.required?(n(),s("span",{key:0,class:t(e.ui.required)},"*",2)):u("",!0)],10,F),e.help?(n(),s("p",{key:0,class:t(e.ui.help)},b(e.help),3)):u("",!0)],2)):u("",!0)],2)}const T=O(z,[["render",J]]);export{T as default};
