import{A as e,E as o,O as a,S as t,W as r,_t as i,b as s,gt as n,lt as l,mt as d,o as p,pt as c,s as g,x as u,yt as m}from"./render-cqdoDfd9.js";function y(e){return d("MuiIconButton",e)}var b=r("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),h=m(i()),v=l(),f=e(g,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,a)=>{const{ownerState:t}=e;return[a.root,t.loading&&a.loading,"default"!==t.color&&a[`color${o(t.color)}`],t.edge&&a[`edge${o(t.edge)}`],a[`size${o(t.size)}`]]}})(t(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),t(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(u()).map(([o])=>({props:{color:o},style:{color:(e.vars||e).palette[o].main}})),...Object.entries(e.palette).filter(u()).map(([o])=>({props:{color:o},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[o].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${b.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${b.loading}`]:{color:"transparent"}}))),z=e("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),I=h.forwardRef(function(e,t){const r=a({props:e,name:"MuiIconButton"}),{edge:i=!1,children:l,className:d,color:g="default",disabled:u=!1,disableFocusRipple:m=!1,size:b="medium",id:h,loading:I=null,loadingIndicator:R,...x}=r,B=s(h),S=R??(0,v.jsx)(p,{"aria-labelledby":B,color:"inherit",size:16}),$={...r,edge:i,color:g,disabled:u,disableFocusRipple:m,loading:I,loadingIndicator:S,size:b},j=(e=>{const{classes:a,disabled:t,color:r,edge:i,size:s,loading:n}=e;return c({root:["root",n&&"loading",t&&"disabled","default"!==r&&`color${o(r)}`,i&&`edge${o(i)}`,`size${o(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},y,a)})($);return(0,v.jsxs)(f,{id:I?B:h,className:n(j.root,d),centerRipple:!0,focusRipple:!m,disabled:u||I,ref:t,...x,ownerState:$,children:["boolean"==typeof I&&(0,v.jsx)("span",{className:j.loadingWrapper,style:{display:"contents"},children:(0,v.jsx)(z,{className:j.loadingIndicator,ownerState:$,children:I&&S})}),l]})});export{I as t};