import{f as R,c$ as S,cS as w,cI as F,r as d,cJ as j,cU as G,cX as V,j as y,cL as C,cM as E,o as p}from"./index-55b8aeb0.js";import{a as I}from"./List-131a37dd.js";import{g as M,l as n}from"./ListItem-20c1dcd1.js";const N=(t,e)=>{const{ownerState:a}=t;return[e.root,a.dense&&e.dense,a.alignItems==="flex-start"&&e.alignItemsFlexStart,a.divider&&e.divider,!a.disableGutters&&e.gutters]},P=t=>{const{alignItems:e,classes:a,dense:i,disabled:s,disableGutters:l,divider:c,selected:u}=t,o=E({root:["root",i&&"dense",!l&&"gutters",c&&"divider",s&&"disabled",e==="flex-start"&&"alignItemsFlexStart",u&&"selected"]},M,a);return{...a,...o}},D=R(S,{shouldForwardProp:t=>w(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:N})(F(({theme:t})=>({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},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),T=d.forwardRef(function(e,a){const i=j({props:e,name:"MuiListItemButton"}),{alignItems:s="center",autoFocus:l=!1,component:c="div",children:u,dense:f=!1,disableGutters:o=!1,divider:$=!1,focusVisibleClassName:B,selected:O=!1,className:L,...r}=i,b=d.useContext(I),m=d.useMemo(()=>({dense:f||b.dense||!1,alignItems:s,disableGutters:o}),[s,b.dense,f,o]),v=d.useRef(null);G(()=>{l&&v.current&&v.current.focus()},[l]);const x={...i,alignItems:s,dense:m.dense,disableGutters:o,divider:$,selected:O},g=P(x),k=V(v,a);return y.jsx(I.Provider,{value:m,children:y.jsx(D,{ref:k,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:C(g.focusVisible,B),ownerState:x,className:C(g.root,L),...r,classes:g,children:u})})}),J=T;export{J as L};
