import{e as k,G as _,f as o,o as A,c as S,a as m,B as C,u as r,C as B,I as p,m as $,j as I,W as N}from"./vue.runtime.esm-bundler.4a881941.js";import{P,A as j}from"./Phone.f8349cb0.js";import w from"./check-_5Up9njX.dcda18cb.js";import"./links.125d59c9.js";import"./default-i18n.3881921e.js";import"./isArrayLikeObject.ab8f4241.js";import"./preload-helper.27958db9.js";import"./_plugin-vue_export-helper.abeb2ae0.js";const M=["for","aria-checked"],D=["id","checked","disabled","name"],L=k({inheritAttrs:!1,__name:"MazCheckbox",props:{style:{type:[String,Array,Object],default:void 0},class:{type:[String,Array,Object],default:void 0},modelValue:{type:[Boolean,Array],default:void 0},id:{type:String,default:void 0},color:{type:String,default:"primary"},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:"m-checkbox"},size:{type:String,default:"md"},disabled:{type:Boolean,default:!1}},emits:["update:model-value","change"],setup(l,{emit:f}){_(a=>({"3a21591b":x.value,"4953c77d":v.value,d5250ce8:h.value,"105d84cf":g.value}));const y=N(),e=l,n=f,s=j({componentName:"MazCheckbox",instance:y,providedId:e.id}),u=o(()=>typeof e.value!="boolean"&&Array.isArray(e.modelValue)?e.modelValue.includes(e.value):typeof e.modelValue=="boolean"?e.modelValue:!1),v=o(()=>{switch(e.size){case"xl":return"2.25rem";case"lg":return"2rem";default:return"1.625rem";case"sm":return"1.425rem";case"xs":return"1.325rem";case"mini":return"1.2rem"}}),b=o(()=>{switch(e.size){case"xl":return"maz-text-2xl";case"lg":return"maz-text-xl";default:return"maz-text-lg";case"sm":return"maz-text-base";case"xs":return"maz-text-sm";case"mini":return"maz-text-xs"}}),x=o(()=>`var(--maz-color-${e.color}-contrast)`),h=o(()=>`var(--maz-color-${e.color})`),g=o(()=>["black","transparent"].includes(e.color)?"var(--maz-color-muted)":`var(--maz-color-${e.color}-alpha)`);function z(a){["Space"].includes(a.code)&&(a.preventDefault(),c(e.value??!e.modelValue))}function V(a){return typeof a=="boolean"&&(typeof e.modelValue=="boolean"||e.modelValue===void 0||e.modelValue===null)?!e.modelValue:Array.isArray(e.modelValue)&&typeof a!="boolean"?e.modelValue.includes(a)?e.modelValue.filter(t=>t!==a):[...e.modelValue,a]:[a]}function c(a){const t=V(a);n("update:model-value",t),n("change",t)}return(a,t)=>(A(),S("label",{for:r(s),class:p(["m-checkbox",[{"--disabled":l.disabled},e.class]]),tabindex:"0",style:I(l.style),role:"checkbox","aria-checked":u.value,onKeydown:z},[m("input",C({id:r(s),checked:u.value},a.$attrs,{tabindex:"-1",disabled:l.disabled,name:l.name,type:"checkbox",onChange:t[0]||(t[0]=i=>{var d;return c(l.value??((d=i==null?void 0:i.target)==null?void 0:d.checked))})}),null,16,D),m("span",null,[B(r(w),{class:p(["check-icon",b.value])},null,8,["class"])]),$(a.$slots,"default",{},void 0,!0)],46,M))}}),F=P(L,[["__scopeId","data-v-05f6558f"]]);export{F as default};
