import{r as $}from"./redux-1.0.63-Df-eBzJn.js";import{h as A,g as D,j as C,c as G,k as H,l as J,r as K}from"./Typography-1.0.63-mecuj_Wl.js";import{u as M}from"./Select-1.0.63-BMejr8a7.js";import{j as w}from"./cm-1.0.63-CSIRHMXC.js";import{X as Q}from"./index-1.0.63-oIDff4nA.js";import{B as T}from"./ButtonBase-1.0.63-CF10PFMS.js";function V(s){return A("PrivateSwitchBase",s)}D("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const W=s=>{const{classes:t,checked:r,disabled:c,edge:a}=s,d={root:["root",r&&"checked",c&&"disabled",a&&`edge${H(a)}`],input:["input"]};return J(d,V,t)},Y=C(T)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:s,ownerState:t})=>s==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:s,ownerState:t})=>s==="end"&&t.size!=="small",style:{marginRight:-12}}]}),Z=C("input",{shouldForwardProp:K})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ne=$.forwardRef(function(t,r){const{autoFocus:c,checked:a,checkedIcon:d,className:y,defaultChecked:u,disabled:S,disableFocusRipple:p=!1,edge:x=!1,icon:F,id:R,inputProps:P,inputRef:z,name:I,onBlur:h,onChange:f,onFocus:m,readOnly:j,required:E=!1,tabIndex:U,type:i,value:g,...v}=t,[B,L]=Q({controlled:a,default:!!u,name:"SwitchBase",state:"checked"}),o=M(),N=e=>{m&&m(e),o&&o.onFocus&&o.onFocus(e)},q=e=>{h&&h(e),o&&o.onBlur&&o.onBlur(e)},O=e=>{if(e.nativeEvent.defaultPrevented)return;const b=e.target.checked;L(b),f&&f(e,b)};let n=S;o&&typeof n>"u"&&(n=o.disabled);const X=i==="checkbox"||i==="radio",l={...t,checked:B,disabled:n,disableFocusRipple:p,edge:x},k=W(l);return w.jsxs(Y,{component:"span",className:G(k.root,y),centerRipple:!0,focusRipple:!p,disabled:n,tabIndex:null,role:void 0,onFocus:N,onBlur:q,ownerState:l,ref:r,...v,children:[w.jsx(Z,{autoFocus:c,checked:a,defaultChecked:u,className:k.input,disabled:n,id:X?R:void 0,name:I,onChange:O,readOnly:j,ref:z,required:E,ownerState:l,tabIndex:U,type:i,...i==="checkbox"&&g===void 0?{}:{value:g},...P}),B?d:F]})});export{ne as S};
