import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,H as n,K as r,L as i,U as a,Vt as o,W as s,dt as c,ft as l,tt as u,ut as d,wt as f}from"./mui-B6lh3XSP.js";import{_ as p,m}from"./List-D4mHuGFJ.js";import{$t as h}from"./index-KVuxnkWj.js";var g=e(o(),1);function _(e){return c(`MuiSwitch`,e)}var v=d(`MuiSwitch`,[`root`,`edgeStart`,`edgeEnd`,`switchBase`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`,`checked`,`disabled`,`input`,`thumb`,`track`]),y=f(),b=e=>{let{classes:t,edge:r,size:i,color:a,checked:o,disabled:s}=e,c=u({root:[`root`,r&&`edge${n(r)}`,`size${n(i)}`],switchBase:[`switchBase`,`color${n(a)}`,o&&`checked`,s&&`disabled`],thumb:[`thumb`],track:[`track`],input:[`input`]},_,t);return{...t,...c}},x=r(`span`,{name:`MuiSwitch`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.edge&&t[`edge${n(r.edge)}`],t[`size${n(r.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,[`& .${v.thumb}`]:{width:16,height:16},[`& .${v.switchBase}`]:{padding:4,[`&.${v.checked}`]:{transform:`translateX(16px)`}}}}]}),S=r(h,{name:`MuiSwitch`,slot:`SwitchBase`,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.switchBase,{[`& .${v.input}`]:t.input},r.color!=="default"&&t[`color${n(r.color)}`]]}})(s(({theme:e})=>({position:`absolute`,top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode===`light`?e.palette.common.white:e.palette.grey[300]}`,...i(e,[`left`,`transform`],{duration:e.transitions.duration.shortest}),[`&.${v.checked}`]:{transform:`translateX(20px)`},[`&.${v.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode===`light`?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${v.checked} + .${v.track}`]:{opacity:.5},[`&.${v.disabled} + .${v.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode===`light`?.12:.2}`},[`& .${v.input}`]:{left:`-100%`,width:`300%`}})),s(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[...Object.entries(e.palette).filter(t([`light`])).map(([t])=>({props:{color:t},style:{[`&.${v.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${v.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${v.checked} + .${v.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),C=r(`span`,{name:`MuiSwitch`,slot:`Track`})(s(({theme:e})=>({height:`100%`,width:`100%`,borderRadius:14/2,zIndex:-1,...i(e,[`opacity`,`background-color`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{boxSizing:`border-box`,border:`1px solid ButtonBorder`},backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode===`light`?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode===`light`?.38:.3}`}))),w=r(`span`,{name:`MuiSwitch`,slot:`Thumb`})(s(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:`currentColor`,boxSizing:`border-box`,border:`1px solid transparent`,width:20,height:20,borderRadius:`50%`}))),T=g.forwardRef(function(e,t){let n=a({props:e,name:`MuiSwitch`}),{className:r,color:i=`primary`,edge:o=!1,size:s=`medium`,sx:c,slots:u={},slotProps:d={},...f}=n,h={...n,color:i,edge:o,size:s},g=b(h),_=d.input,v={slots:u,slotProps:d},[T,E]=m(`root`,{className:l(g.root,r),elementType:x,externalForwardedProps:v,ownerState:h,additionalProps:{sx:c}}),[D,O]=m(`thumb`,{className:g.thumb,elementType:w,externalForwardedProps:v,ownerState:h}),k=(0,y.jsx)(D,{...O}),[A,j]=m(`track`,{className:g.track,elementType:C,externalForwardedProps:v,ownerState:h});return(0,y.jsxs)(T,{...E,children:[(0,y.jsx)(S,{type:`checkbox`,icon:k,checkedIcon:k,ref:t,ownerState:h,...f,classes:{...g,root:g.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...d.switchBase&&{root:typeof d.switchBase==`function`?d.switchBase(h):d.switchBase},input:p(typeof _==`function`?_(h):_,{role:`switch`})}}),(0,y.jsx)(A,{...j})]})});export{T as t};