import{r as d,ar as F,as as G,at as m,au as N,av as u,aw as V,X as I,ax as $,ay as j,az as E,aA as P,aB as w,aC as D,aD as n,aE as p}from"./index-CYy8zBsj.js";const _=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],M=(t,a)=>{const{ownerState:e}=t;return[a.root,e.dense&&a.dense,e.alignItems==="flex-start"&&a.alignItemsFlexStart,e.divider&&a.divider,!e.disableGutters&&a.gutters]},S=t=>{const{alignItems:a,classes:e,dense:s,disabled:o,disableGutters:l,divider:c,selected:f}=t,i=j({root:["root",s&&"dense",!l&&"gutters",c&&"divider",o&&"disabled",a==="flex-start"&&"alignItemsFlexStart",f&&"selected"]},E,e);return u({},e,i)},z=P(w,{shouldForwardProp:t=>D(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:M})(({theme:t,ownerState:a})=>u({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${n.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${n.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${n.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${n.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},a.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},a.alignItems==="flex-start"&&{alignItems:"flex-start"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.dense&&{paddingTop:4,paddingBottom:4})),T=d.forwardRef(function(a,e){const s=F({props:a,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:l=!1,component:c="div",children:f,dense:v=!1,disableGutters:i=!1,divider:B=!1,focusVisibleClassName:O,selected:k=!1,className:L}=s,r=G(s,_),x=d.useContext(m),C=d.useMemo(()=>({dense:v||x.dense||!1,alignItems:o,disableGutters:i}),[o,x.dense,v,i]),b=d.useRef(null);N(()=>{l&&b.current&&b.current.focus()},[l]);const y=u({},s,{alignItems:o,dense:C.dense,disableGutters:i,divider:B,selected:k}),g=S(y),R=V(b,e);return I.jsx(m.Provider,{value:C,children:I.jsx(z,u({ref:R,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:$(g.focusVisible,O),ownerState:y,className:$(g.root,L)},r,{classes:g,children:f}))})});export{T as L};
