1import{c as I}from"./DDWbhhPE.js";import{d as K,p as T}from"./BIMjCxgb.js";import{i as O,s as P,E as R,A as j,T as A,a as b,o as H}from"./TkepH7lK.js";import{f as N,u as q}from"./NBwGOTi2.js";import{K as g,av as z,Q as s,H as F,R as G,aa as h,Z as J,J as M,L as Q,V as U,O as W,a1 as y,W as X,X as k,P as Z}from"./pXWkh-vY.js";const re=I("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);let _=Symbol("GroupContext"),Y=g({name:"Switch",emits:{"update:modelValue":t=>!0},props:{as:{type:[Object,String],default:"button"},modelValue:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,optional:!0},form:{type:String,optional:!0},name:{type:String,optional:!0},value:{type:String,optional:!0},id:{type:String,default:null},disabled:{type:Boolean,default:!1},tabIndex:{type:Number,default:0}},inheritAttrs:!1,setup(t,{emit:i,attrs:l,slots:d,expose:x}){var c;let V=(c=t.id)!=null?c:`headlessui-switch-${O()}`,n=z(_,null),[o,p]=K(s(()=>t.modelValue),e=>i("update:modelValue",e),s(()=>t.defaultChecked));function f(){p(!o.value)}let w=M(null),r=n===null?w:n.switchRef,C=P(s(()=>({as:t.as,type:l.type})),r);x({el:r,$el:r});function S(e){e.preventDefault(),f()}function $(e){e.key===b.Space?(e.preventDefault(),f()):e.key===b.Enter&&T(e.currentTarget)}function B(e){e.preventDefault()}let u=s(()=>{var e,a;return(a=(e=H(r))==null?void 0:e.closest)==null?void 0:a.call(e,"form")});return F(()=>{G([u],()=>{if(!u.value||t.defaultChecked===void 0)return;function e(){p(t.defaultChecked)}return u.value.addEventListener("reset",e),()=>{var a;(a=u.value)==null||a.removeEventListener("reset",e)}},{immediate:!0})}),()=>{let{name:e,value:a,form:D,tabIndex:m,...v}=t,E={checked:o.value},L={id:V,ref:r,role:"switch",type:C.value,tabIndex:m===-1?0:m,"aria-checked":o.value,"aria-labelledby":n?.labelledby.value,"aria-describedby":n?.describedby.value,onClick:S,onKeyup:$,onKeypress:B};return h(J,[e!=null&&o.value!=null?h(N,R({features:q.Hidden,as:"input",type:"checkbox",hidden:!0,readOnly:!0,checked:o.value,form:D,disabled:v.disabled,name:e,value:a})):null,j({ourProps:L,theirProps:{...l,...A(v,["modelValue","defaultChecked"])},slot:E,attrs:l,slots:d,name:"Switch"})])}}});const ee={class:"sr-only"},ue=g({__name:"Toggle",props:{modelValue:{type:Boolean},label:{}},emits:["update:modelValue"],setup(t){return(i,l)=>(Q(),U(W(Y),{"model-value":t.modelValue,class:y([t.modelValue?"bg-action":"bg-ink/20","relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border border-transparent transition-colors duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action focus-visible:ring-offset-2 before:absolute before:inset-x-0 before:-inset-y-2.5 before:content-['']"]),"onUpdate:modelValue":l[0]||(l[0]=d=>i.$emit("update:modelValue",d))},{default:X(()=>[k("span",ee,Z(t.label),1),k("span",{"aria-hidden":"true",class:y([t.modelValue?"translate-x-5":"translate-x-0","pointer-events-none relative inline-block h-5 w-5 translate-y-[1.5px] transform rounded-full bg-white shadow-sm transition duration-200 ease-in-out ml-px"])},null,2)]),_:1},8,["model-value","class"]))}});export{re as C,ue as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.