import{c0 as P,c1 as R,r as j,c2 as M,cg as k,b9 as u,c4 as O,j as p,ch as r,c5 as D,b_ as d,ci as I,av as y,cj as N,fz as U,fA as A}from"./index-CCv_8omK.js";function E(t){return R("MuiSwitch",t)}const s=P("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),F=t=>{const{classes:a,edge:o,size:l,color:h,checked:w,disabled:g}=t,b={root:["root",o&&`edge${r(o)}`,`size${r(l)}`],switchBase:["switchBase",`color${r(h)}`,w&&"checked",g&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},v=D(b,E,a);return{...a,...v}},X=u("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.root,o.edge&&a[`edge${r(o.edge)}`],a[`size${r(o.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,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,[`& .${s.thumb}`]:{width:16,height:16},[`& .${s.switchBase}`]:{padding:4,[`&.${s.checked}`]:{transform:"translateX(16px)"}}}}]}),L=u(I,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.switchBase,{[`& .${s.input}`]:a.input},o.color!=="default"&&a[`color${r(o.color)}`]]}})(d(({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}),[`&.${s.checked}`]:{transform:"translateX(20px)"},[`&.${s.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${s.checked} + .${s.track}`]:{opacity:.5},[`&.${s.disabled} + .${s.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${s.input}`]:{left:"-100%",width:"300%"}})),d(({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:y(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(N(["light"])).map(([a])=>({props:{color:a},style:{[`&.${s.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[a].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:y(t.palette[a].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${s.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?U(t.palette[a].main,.62):A(t.palette[a].main,.55)}`}},[`&.${s.checked} + .${s.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]}))),V=u("span",{name:"MuiSwitch",slot:"Track"})(d(({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}`}))),_=u("span",{name:"MuiSwitch",slot:"Thumb"})(d(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),G=j.forwardRef(function(a,o){const l=M({props:a,name:"MuiSwitch"}),{className:h,color:w="primary",edge:g=!1,size:b="medium",sx:v,slots:c={},slotProps:e={},...f}=l,i={...l,color:w,edge:g,size:b},n=F(i),S={slots:c,slotProps:e},[m,x]=k("root",{className:O(n.root,h),elementType:X,externalForwardedProps:S,ownerState:i,additionalProps:{sx:v}}),[C,B]=k("thumb",{className:n.thumb,elementType:_,externalForwardedProps:S,ownerState:i}),$=p.jsx(C,{...B}),[z,T]=k("track",{className:n.track,elementType:V,externalForwardedProps:S,ownerState:i});return p.jsxs(m,{...x,children:[p.jsx(L,{type:"checkbox",icon:$,checkedIcon:$,ref:o,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},...e.input&&{input:typeof e.input=="function"?e.input(i):e.input}}}),p.jsx(z,{...T})]})});export{G as S};
