import{r as c,$ as L,a0 as C,a1 as O,a2 as w,j as y,a3 as F,a4 as I,a5 as S,a6 as j,a7 as G,a8 as V,a9 as E,aa as n}from"./index-DR3HTfO6.js";const N=(s,t)=>{const{ownerState:a}=s;return[t.root,a.dense&&t.dense,a.alignItems==="flex-start"&&t.alignItemsFlexStart,a.divider&&t.divider,!a.disableGutters&&t.gutters]},P=s=>{const{alignItems:t,classes:a,dense:i,disabled:e,disableGutters:l,divider:d,selected:p}=s,o=S({root:["root",i&&"dense",!l&&"gutters",d&&"divider",e&&"disabled",t==="flex-start"&&"alignItemsFlexStart",p&&"selected"]},j,a);return{...a,...o}},D=F(G,{shouldForwardProp:s=>V(s)||s==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:N})(E(({theme:s})=>({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:s.transitions.create("background-color",{duration:s.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(s.vars||s).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${n.selected}`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,(s.vars||s).palette.action.selectedOpacity),[`&.${n.focusVisible}`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,`${(s.vars||s).palette.action.selectedOpacity} + ${(s.vars||s).palette.action.focusOpacity}`)}},[`&.${n.selected}:hover`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,`${(s.vars||s).palette.action.selectedOpacity} + ${(s.vars||s).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:s.alpha((s.vars||s).palette.primary.main,(s.vars||s).palette.action.selectedOpacity)}},[`&.${n.focusVisible}`]:{backgroundColor:(s.vars||s).palette.action.focus},[`&.${n.disabled}`]:{opacity:(s.vars||s).palette.action.disabledOpacity},variants:[{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(s.vars||s).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.dense,style:{paddingTop:4,paddingBottom:4}}]}))),T=c.forwardRef(function(t,a){const i=L({props:t,name:"MuiListItemButton"}),{alignItems:e="center",autoFocus:l=!1,component:d="div",children:p,dense:u=!1,disableGutters:o=!1,divider:m=!1,focusVisibleClassName:B,selected:$=!1,className:k,...r}=i,g=c.useContext(C),b=c.useMemo(()=>({dense:u||g.dense||!1,alignItems:e,disableGutters:o}),[e,g.dense,u,o]),f=c.useRef(null);O(()=>{l&&f.current&&f.current.focus()},[l]);const x={...i,alignItems:e,dense:b.dense,disableGutters:o,divider:m,selected:$},v=P(x),R=w(f,a);return y.jsx(C.Provider,{value:b,children:y.jsx(D,{ref:R,href:r.href||r.to,component:(r.href||r.to)&&d==="div"?"button":d,focusVisibleClassName:I(v.focusVisible,B),ownerState:x,className:I(v.root,k),...r,classes:v,children:p})})});export{T as L};
