import{r as c,j as d,c as B}from"./app-7TQoRINg.js";import{a as D,P as x,e as M,c as A,h as H,g as L}from"./checkbox-wEG3odM0.js";import{u as C,a as S}from"./button-B14hYptM.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"b85bb7b5dc83f935fd7d75fdf93418434f2e0da2"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8fcbbbac-9d02-4169-a908-fe9768729c12",t._sentryDebugIdIdentifier="sentry-dbid-8fcbbbac-9d02-4169-a908-fe9768729c12")})()}catch{}var m="Switch",[U]=D(m),[q,z]=U(m),E=c.forwardRef((t,o)=>{const{__scopeSwitch:e,name:a,checked:s,defaultChecked:r,required:i,disabled:n,value:f="on",onCheckedChange:w,form:l,...g}=t,[u,p]=c.useState(null),v=C(o,h=>p(h)),y=c.useRef(!1),k=u?l||!!u.closest("form"):!0,[b,I]=M({prop:s,defaultProp:r??!1,onChange:w,caller:m});return d.jsxs(q,{scope:e,checked:b,disabled:n,children:[d.jsx(x.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":N(b),"data-disabled":n?"":void 0,disabled:n,value:f,...g,ref:v,onClick:A(t.onClick,h=>{I(j=>!j),k&&(y.current=h.isPropagationStopped(),y.current||h.stopPropagation())})}),k&&d.jsx(P,{control:u,bubbles:!y.current,name:a,value:f,checked:b,required:i,disabled:n,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var _="SwitchThumb",R=c.forwardRef((t,o)=>{const{__scopeSwitch:e,...a}=t,s=z(_,e);return d.jsx(x.span,{"data-state":N(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:o})});R.displayName=_;var O="SwitchBubbleInput",P=c.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:a=!0,...s},r)=>{const i=c.useRef(null),n=C(i,r),f=H(e),w=L(o);return c.useEffect(()=>{const l=i.current;if(!l)return;const g=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==e&&p){const v=new Event("click",{bubbles:a});p.call(l,e),l.dispatchEvent(v)}},[f,e,a]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...s,tabIndex:-1,ref:n,style:{...s.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});P.displayName=O;function N(t){return t?"checked":"unchecked"}var T=E,$=R;const F=c.forwardRef((t,o)=>{const e=B.c(10);let a,s;e[0]!==t?({className:a,...s}=t,e[0]=t,e[1]=a,e[2]=s):(a=e[1],s=e[2]);let r;e[3]!==a?(r=S("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-300 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",a),e[3]=a,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx($,{className:S("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")}),e[5]=i):i=e[5];let n;return e[6]!==s||e[7]!==o||e[8]!==r?(n=d.jsx(T,{className:r,...s,ref:o,children:i}),e[6]=s,e[7]=o,e[8]=r,e[9]=n):n=e[9],n});F.displayName=T.displayName;export{F as S};
//# sourceMappingURL=switch-CCntLJ-I.js.map
