import{g as T,f as P,r as R,b as j,D as v,c as M,j as d,E as r,d as D,s as u,m as p,F as E}from"./render-D1ZqzUbP.js";import{S as I}from"./SwitchBase-BdpsuNf_.js";function N(t){return T("MuiSwitch",t)}const o=P("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),U=t=>{const{classes:a,edge:s,size:l,color:h,checked:w,disabled:g}=t,S={root:["root",s&&`edge${r(s)}`,`size${r(l)}`],switchBase:["switchBase",`color${r(h)}`,w&&"checked",g&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},b=D(S,N,a);return{...a,...b}},F=u("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.root,s.edge&&a[`edge${r(s.edge)}`],a[`size${r(s.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${o.thumb}`]:{width:16,height:16},[`& .${o.switchBase}`]:{padding:4,[`&.${o.checked}`]:{transform:"translateX(16px)"}}}}]}),O=u(I,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.switchBase,{[`& .${o.input}`]:a.input},s.color!=="default"&&a[`color${r(s.color)}`]]}})(p(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${o.checked}`]:{transform:"translateX(20px)"},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${o.checked} + .${o.track}`]:{opacity:.5},[`&.${o.disabled} + .${o.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${o.input}`]:{left:"-100%",width:"300%"}})),p(({theme:t})=>({"&:hover":{backgroundColor:t.alpha((t.vars||t).palette.action.active,(t.vars||t).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(E(["light"])).map(([a])=>({props:{color:a},style:{[`&.${o.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.alpha((t.vars||t).palette[a].main,(t.vars||t).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?t.lighten(t.palette[a].main,.62):t.darken(t.palette[a].main,.55)}`}},[`&.${o.checked} + .${o.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]}))),A=u("span",{name:"MuiSwitch",slot:"Track"})(p(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),X=u("span",{name:"MuiSwitch",slot:"Thumb"})(p(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),q=R.forwardRef(function(a,s){const l=j({props:a,name:"MuiSwitch"}),{className:h,color:w="primary",edge:g=!1,size:S="medium",sx:b,slots:c={},slotProps:e={},...f}=l,i={...l,color:w,edge:g,size:S},n=U(i),k={slots:c,slotProps:e},[y,m]=v("root",{className:M(n.root,h),elementType:F,externalForwardedProps:k,ownerState:i,additionalProps:{sx:b}}),[x,C]=v("thumb",{className:n.thumb,elementType:X,externalForwardedProps:k,ownerState:i}),$=d.jsx(x,{...C}),[B,z]=v("track",{className:n.track,elementType:A,externalForwardedProps:k,ownerState:i});return d.jsxs(y,{...m,children:[d.jsx(O,{type:"checkbox",icon:$,checkedIcon:$,ref:s,ownerState:i,...f,classes:{...n,root:n.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...e.switchBase&&{root:typeof e.switchBase=="function"?e.switchBase(i):e.switchBase},input:{role:"switch"},...e.input&&{input:typeof e.input=="function"?e.input(i):e.input}}}),d.jsx(B,{...z})]})});export{q as S};
//# sourceMappingURL=Switch-BSAzmogT.js.map
