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