import{c as v,j as a,a3 as d,a7 as $,a9 as z,c9 as R,aY as E,aZ as A,r as i,$ as N,ca as T,a4 as U,a5 as L,J as O}from"./index-DR3HTfO6.js";const q=v(a.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),D=d($,{name:"MuiBreadcrumbCollapsed"})(z(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:R(e.palette.grey[200],.12)}:{backgroundColor:R(e.palette.grey[600],.12)}}}))),H=d(q)({width:24,height:16});function J(e){const{slots:s={},slotProps:t={},...l}=e,r=e;return a.jsx("li",{children:a.jsx(D,{focusRipple:!0,...l,ownerState:r,children:a.jsx(H,{as:s.CollapsedIcon,ownerState:r,...t.collapsedIcon})})})}function V(e){return A("MuiBreadcrumbs",e)}const W=E("MuiBreadcrumbs",["root","ol","li","separator"]),Y=e=>{const{classes:s}=e;return L({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},V,s)},Z=d(O,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,s)=>[{[`& .${W.li}`]:s.li},s.root]})({}),F=d("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),G=d("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function K(e,s,t,l){return e.reduce((r,p,n)=>(n<e.length-1?r=r.concat(p,a.jsx(G,{"aria-hidden":!0,className:s,ownerState:l,children:t},`separator-${n}`)):r.push(p),r),[])}const X=i.forwardRef(function(s,t){const l=N({props:s,name:"MuiBreadcrumbs"}),{children:r,className:p,component:n="nav",slots:C={},slotProps:I={},expandText:h="Show path",itemsAfterCollapse:g=1,itemsBeforeCollapse:m=1,maxItems:f=8,separator:y="/",...M}=l,[B,k]=i.useState(!1),c={...l,component:n,expanded:B,expandText:h,itemsAfterCollapse:g,itemsBeforeCollapse:m,maxItems:f,separator:y},u=Y(c),w=T({elementType:C.CollapsedIcon,externalSlotProps:I.collapsedIcon,ownerState:c}),S=i.useRef(null),P=o=>{const x=()=>{k(!0);const j=S.current.querySelector("a[href],button,[tabindex]");j&&j.focus()};return m+g>=o.length?o:[...o.slice(0,m),a.jsx(J,{"aria-label":h,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:w},onClick:x},"ellipsis"),...o.slice(o.length-g,o.length)]},b=i.Children.toArray(r).filter(o=>i.isValidElement(o)).map((o,x)=>a.jsx("li",{className:u.li,children:o},`child-${x}`));return a.jsx(Z,{ref:t,component:n,color:"textSecondary",className:U(u.root,p),ownerState:c,...M,children:a.jsx(F,{className:u.ol,ref:S,ownerState:c,children:K(B||f&&b.length<=f?b:P(b),u.separator,y,c)})})});export{X as B};
