import{cH as C,cG as L,f as h,r as a,cK as N,j as r,cL as v,cM as B,cJ as K,cC as V}from"./index-d895656a.js";import{b as x,h as w}from"./Menu-1728e1dd.js";import{i as Y}from"./isMuiElement-424c145f.js";function q(e){return C("MuiListItem",e)}L("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function dt(e){return C("MuiListItemButton",e)}const O=L("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Q=O;function W(e){return C("MuiListItemSecondaryAction",e)}L("MuiListItemSecondaryAction",["root","disableGutters"]);const X=e=>{const{disableGutters:t,classes:s}=e;return B({root:["root",t&&"disableGutters"]},W,s)},Z=h("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,s.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),U=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItemSecondaryAction"}),{className:n,...l}=o,p=a.useContext(x),i={...o,disableGutters:p.disableGutters},g=X(i);return r.jsx(Z,{className:v(g.root,n),ownerState:i,ref:s,...l})});U.muiName="ListItemSecondaryAction";const _=U,tt=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.alignItems==="flex-start"&&t.alignItemsFlexStart,s.divider&&t.divider,!s.disableGutters&&t.gutters,!s.disablePadding&&t.padding,s.hasSecondaryAction&&t.secondaryAction]},et=e=>{const{alignItems:t,classes:s,dense:o,disableGutters:n,disablePadding:l,divider:p,hasSecondaryAction:i}=e;return B({root:["root",o&&"dense",!n&&"gutters",!l&&"padding",p&&"divider",t==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},q,s)},st=h("div",{name:"MuiListItem",slot:"Root",overridesResolver:tt})(K(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${Q.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),ot=h("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),nt=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItem"}),{alignItems:n="center",children:l,className:p,component:i,components:g={},componentsProps:$={},ContainerComponent:S="li",ContainerProps:{className:k,...F}={},dense:A=!1,disableGutters:y=!1,disablePadding:D=!1,divider:E=!1,secondaryAction:R,slotProps:T={},slots:H={},...z}=o,P=a.useContext(x),b=a.useMemo(()=>({dense:A||P.dense||!1,alignItems:n,disableGutters:y}),[n,P.dense,A,y]),J=a.useRef(null),d=a.Children.toArray(l),M=d.length&&Y(d[d.length-1],["ListItemSecondaryAction"]),f={...o,alignItems:n,dense:b.dense,disableGutters:y,disablePadding:D,divider:E,hasSecondaryAction:M},G=et(f),j=V(J,s),I=H.root||g.Root||st,m=T.root||$.root||{},u={className:v(G.root,m.className,p),...z};let c=i||"li";return M?(c=!u.component&&!i?"div":c,S==="li"&&(c==="li"?c="div":u.component==="li"&&(u.component="div")),r.jsx(x.Provider,{value:b,children:r.jsxs(ot,{as:S,className:v(G.container,k),ref:j,ownerState:f,...F,children:[r.jsx(I,{...m,...!w(I)&&{as:c,ownerState:{...f,...m.ownerState}},...u,children:d}),d.pop()]})})):r.jsx(x.Provider,{value:b,children:r.jsxs(I,{...m,as:c,ref:j,...!w(I)&&{ownerState:{...f,...m.ownerState}},...u,children:[d,R&&r.jsx(_,{children:R})]})})}),ct=nt;export{ct as L,_ as a,dt as g,Q as l};
