import{cF as O,cG as k,f as T,c$ as U,cS as V,cI as j,r as l,cJ as G,cU as P,cX as E,j as y,cL as C,cM as N,o as c}from"./index-7d3dbb9c.js";import{a as I}from"./List-d7c020ab.js";import{d as $}from"./dividerClasses-59256fce.js";import{l as x}from"./listItemTextClasses-626eaddb.js";function Z(e){return O("MuiListItemIcon",e)}const D=k("MuiListItemIcon",["root","alignItemsFlexStart"]),M=D;function H(e){return O("MuiMenuItem",e)}const z=k("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),i=z,J=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.divider&&t.divider,!s.disableGutters&&t.gutters]},W=e=>{const{disabled:t,dense:s,divider:a,disableGutters:r,selected:d,classes:o}=e,n=N({root:["root",s&&"dense",t&&"disabled",!r&&"gutters",a&&"divider",d&&"selected"]},H,o);return{...o,...n}},X=T(U,{shouldForwardProp:e=>V(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:J})(j(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${i.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:c(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${i.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:c(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${i.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:c(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:c(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${i.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${i.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${$.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${$.inset}`]:{marginLeft:52},[`& .${x.root}`]:{marginTop:0,marginBottom:0},[`& .${x.inset}`]:{paddingLeft:36},[`& .${M.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${M.root} svg`]:{fontSize:"1.25rem"}}}]}))),q=l.forwardRef(function(t,s){const a=G({props:t,name:"MuiMenuItem"}),{autoFocus:r=!1,component:d="li",dense:o=!1,divider:m=!1,disableGutters:n=!1,focusVisibleClassName:R,role:S="menuitem",tabIndex:g,className:w,...L}=a,f=l.useContext(I),v=l.useMemo(()=>({dense:o||f.dense||!1,disableGutters:n}),[f.dense,o,n]),p=l.useRef(null);P(()=>{r&&p.current&&p.current.focus()},[r]);const B={...a,dense:v.dense,divider:m,disableGutters:n},u=W(a),F=E(p,s);let b;return a.disabled||(b=g!==void 0?g:-1),y.jsx(I.Provider,{value:v,children:y.jsx(X,{ref:F,role:S,tabIndex:b,component:d,focusVisibleClassName:C(u.focusVisible,R),className:C(u.root,w),...L,ownerState:B,classes:u})})}),_=q;export{_ as M,Z as g};
