import{C as i,E as r}from"./m6q5jxyf.js";import{p,P as b,a1 as u,aa as h,Q as n,aA as m,u as a,W as k,C as f,a3 as v,U as _,X as x}from"./vendor/json-editor-vue-llkaejaf.js";const C=["checked","disabled"],V=["disabled"],y={class:"n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base n-transition"},E=p({__name:"NCheckbox",props:{modelValue:{type:[Boolean,null],default:!1},disabled:{type:Boolean,default:!1}},setup(t,{emit:c}){const e=i(t,"modelValue",c,{passive:!0});return(o,s)=>{const d=r;return u(),b("label",{class:"n-checkbox hover:n-checkbox-hover select-none items-center n-disabled:n-disabled",checked:a(e)||null,disabled:o.disabled||null},[h(n("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>f(e)?e.value=l:null),type:"checkbox",class:"peer absolute op0",disabled:o.disabled,onKeypress:s[1]||(s[1]=k(l=>e.value=!a(e),["enter"]))},null,40,V),[[m,a(e)]]),n("span",y,[v(d,{class:"n-checkbox-icon scale-0 transform op0 n-transition n-checked:scale-100 n-checked:op100"})]),n("span",{class:x([a(e)?"":"op50","n-transition"])},[_(o.$slots,"default")],2)],8,C)}}});export{E as _};
