import{K as R,L as k,s as D,ae as N,ac as _,af as d,O as F,_ as G,ag as T,a8 as U,c as C,P as E}from"./defaultI18nProvider-C_r1y4tu.js";import{_ as n,j as x}from"./assertThisInitialized-ClXgY4BW.js";import{r as c}from"./index-BP8_t0zE.js";import{L as $}from"./TextField-z9WrHgJg.js";import{l as I,b as M}from"./listItemTextClasses-C7xWMLDP.js";function Y(e){return k("MuiDivider",e)}const O=R("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);function H(e){return k("MuiMenuItem",e)}const r=R("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),S=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],W=(e,t)=>{const{ownerState:a}=e;return[t.root,a.dense&&t.dense,a.divider&&t.divider,!a.disableGutters&&t.gutters]},z=e=>{const{disabled:t,dense:a,divider:s,disableGutters:l,selected:p,classes:o}=e,i=E({root:["root",a&&"dense",t&&"disabled",!l&&"gutters",s&&"divider",p&&"selected"]},H,o);return n({},o,i)},A=D(N,{shouldForwardProp:e=>_(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:W})(({theme:e,ownerState:t})=>n({},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"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${r.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:d(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${r.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:d(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${r.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:d(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})`:d(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${r.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${r.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${O.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${O.inset}`]:{marginLeft:52},[`& .${I.root}`]:{marginTop:0,marginBottom:0},[`& .${I.inset}`]:{paddingLeft:36},[`& .${M.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&n({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${M.root} svg`]:{fontSize:"1.25rem"}}))),Z=c.forwardRef(function(t,a){const s=F({props:t,name:"MuiMenuItem"}),{autoFocus:l=!1,component:p="li",dense:o=!1,divider:f=!1,disableGutters:i=!1,focusVisibleClassName:V,role:w="menuitem",tabIndex:v,className:L}=s,B=G(s,S),b=c.useContext($),m=c.useMemo(()=>({dense:o||b.dense||!1,disableGutters:i}),[b.dense,o,i]),u=c.useRef(null);T(()=>{l&&u.current&&u.current.focus()},[l]);const P=n({},s,{dense:m.dense,divider:f,disableGutters:i}),g=z(s),j=U(u,a);let y;return s.disabled||(y=v!==void 0?v:-1),x.jsx($.Provider,{value:m,children:x.jsx(A,n({ref:j,role:w,tabIndex:y,component:p,focusVisibleClassName:C(g.focusVisible,V),className:C(g.root,L)},B,{ownerState:P,classes:g}))})});export{Z as M,Y as g};
