import{_ as g}from"./ErrorMessage.95951ea8.js";import{s as B,c as y,o as t,a as r,b as u,n as p,u as o,v as l,H as f,t as i,e as b,l as v,w as $}from"./entry.b4d59ffc.js";const S={class:"my-1 flex cursor-pointer items-center"},C=["name","checked","disabled"],q={key:0,class:"ml-2 leading-none"},E={key:0,class:"text-error"},w={key:1},L={key:2},D={key:3,class:"inline w-full"},N={key:0,class:"text-error"},V={key:1},M={key:2},P={key:3,class:"w-full text-right"},j={__name:"Checkbox",props:{checkboxPosition:{type:[String],default:"self-start"},checked:{type:[Boolean],required:!0},disabled:{type:[Boolean],default:!1},id:{type:[String],required:!0},name:{type:[String],default:""},label:{type:[String],default:""},expandLabel:{type:[String],default:null},isExpandable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{type:[Boolean],default:!1},errors:{type:[Object],default:null},anyDirty:{type:[Boolean],default:!0},theme:{type:[String],default:"rounded"}},emits:["change"],setup(e){const n=e,s=B(!1),m=y(()=>{var a;return n.anyDirty&&n.errors&&((a=n.errors)==null?void 0:a[n.name])}),k=y(()=>n.errors[n.name]instanceof Array?n.errors[n.name][0]:n.errors[n.name]),h=y(()=>n.theme==="rounded"?"rounded-full":"rounded border-primary");return(a,d)=>{const x=g;return t(),r("div",null,[u("label",S,[u("input",{type:"checkbox",value:"1",class:p(["relative h-[18px] w-[18px] cursor-pointer",[e.error?"border-error text-error":"border-primary",e.checkboxPosition,o(h)]]),name:e.name,checked:e.checked,disabled:e.disabled,onChange:d[0]||(d[0]=c=>a.$emit("change",c.target.checked))},null,42,C),e.label?(t(),r("span",{key:1,class:p(["ml-2 leading-none",{"text-error":o(m)}])},[e.required?(t(),r("span",N,"*")):l("",!0),b(i(e.label),1),e.required&&!e.expandLabel?(t(),r("span",V,"*")):l("",!0),o(s)?(t(),r("span",M,i(e.expandLabel),1)):l("",!0),e.expandLabel?(t(),r("div",P,[u("button",{type:"button",class:"ml-1 underline",onClick:d[2]||(d[2]=c=>s.value=!o(s))},i(o(s)?a.$t("action.collapse"):a.$t("action.expand")),1)])):l("",!0)],2)):(t(),r("span",q,[e.required?(t(),r("span",E,"*")):l("",!0),o(s)?l("",!0):(t(),r("span",w,[f(a.$slots,"default")])),o(s)?(t(),r("span",L,[f(a.$slots,"expandLabel")])):l("",!0),e.isExpandable?(t(),r("div",D,[u("button",{type:"button",class:"ml-1 underline",onClick:d[1]||(d[1]=c=>s.value=!o(s))},i(o(s)?a.$t("action.collapse"):a.$t("action.expand")),1)])):l("",!0)]))]),o(m)?(t(),v(x,{key:0},{default:$(()=>[b(i(a.$t(o(k))),1)]),_:1})):l("",!0)])}}},H=j;export{H as _};