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