import{m as O,n as k,f as P,d8 as V,cP as j,q as F,r as l,t as U,cT as E,cS as G,j as y,v as C,w as N,y as c}from"./index-83d9c1e2.js";import{e as I}from"./Select-1505055e.js";import{d as x}from"./dividerClasses-f18f0f93.js";import{l as $}from"./listItemTextClasses-fcd068d2.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,q=(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}},A=P(V,{shouldForwardProp:e=>j(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:q})(F(({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},[`& + .${x.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${x.inset}`]:{marginLeft:52},[`& .${$.root}`]:{marginTop:0,marginBottom:0},[`& .${$.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"}}}]}))),J=l.forwardRef(function(t,s){const a=U({props:t,name:"MuiMenuItem"}),{autoFocus:r=!1,component:d="li",dense:o=!1,divider:m=!1,disableGutters:n=!1,focusVisibleClassName:R,role:w="menuitem",tabIndex:g,className:S,...B}=a,f=l.useContext(I),v=l.useMemo(()=>({dense:o||f.dense||!1,disableGutters:n}),[f.dense,o,n]),p=l.useRef(null);E(()=>{r&&p.current&&p.current.focus()},[r]);const L={...a,dense:v.dense,divider:m,disableGutters:n},u=W(a),T=G(p,s);let b;return a.disabled||(b=g!==void 0?g:-1),y.jsx(I.Provider,{value:v,children:y.jsx(A,{ref:T,role:w,tabIndex:b,component:d,focusVisibleClassName:C(u.focusVisible,R),className:C(u.root,S),...B,ownerState:L,classes:u})})}),_=J;export{_ as M,Z as g};
