import{U as $,V as t,ap as I,au as d,as as l,ay as A,bX as v,bg as E,bf as N,r as p,ao as U,bY as _,av as T,aw as L,q}from"./index-DWFi48i_.js";const H=$(t.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"}),"MoreHoriz"),O=["slots","slotProps"],V=d(A)(({theme:e})=>l({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":l({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":l({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:v(e.palette.grey[200],.12)}:{backgroundColor:v(e.palette.grey[600],.12)})})),W=d(H)({width:24,height:16});function D(e){const{slots:s={},slotProps:n={}}=e,a=I(e,O),r=e;return t.jsx("li",{children:t.jsx(V,l({focusRipple:!0},a,{ownerState:r,children:t.jsx(W,l({as:s.CollapsedIcon,ownerState:r},n.collapsedIcon))}))})}function X(e){return N("MuiBreadcrumbs",e)}const Y=E("MuiBreadcrumbs",["root","ol","li","separator"]),F=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],G=e=>{const{classes:s}=e;return L({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},X,s)},J=d(q,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,s)=>[{[`& .${Y.li}`]:s.li},s.root]})({}),K=d("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,s)=>s.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),Q=d("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,s)=>s.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function Z(e,s,n,a){return e.reduce((r,u,c)=>(c<e.length-1?r=r.concat(u,t.jsx(Q,{"aria-hidden":!0,className:s,ownerState:a,children:n},`separator-${c}`)):r.push(u),r),[])}const se=p.forwardRef(function(s,n){const a=U({props:s,name:"MuiBreadcrumbs"}),{children:r,className:u,component:c="nav",slots:h={},slotProps:P={},expandText:y="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:b=1,maxItems:f=8,separator:B="/"}=a,w=I(a,F),[S,M]=p.useState(!1),i=l({},a,{component:c,expanded:S,expandText:y,itemsAfterCollapse:m,itemsBeforeCollapse:b,maxItems:f,separator:B}),g=G(i),k=_({elementType:h.CollapsedIcon,externalSlotProps:P.collapsedIcon,ownerState:i}),R=p.useRef(null),z=o=>{const C=()=>{M(!0);const j=R.current.querySelector("a[href],button,[tabindex]");j&&j.focus()};return b+m>=o.length?o:[...o.slice(0,b),t.jsx(D,{"aria-label":y,slots:{CollapsedIcon:h.CollapsedIcon},slotProps:{collapsedIcon:k},onClick:C},"ellipsis"),...o.slice(o.length-m,o.length)]},x=p.Children.toArray(r).filter(o=>p.isValidElement(o)).map((o,C)=>t.jsx("li",{className:g.li,children:o},`child-${C}`));return t.jsx(J,l({ref:n,component:c,color:"text.secondary",className:T(g.root,u),ownerState:i},w,{children:t.jsx(K,{className:g.ol,ref:R,ownerState:i,children:Z(S||f&&x.length<=f?x:z(x),g.separator,B,i)})}))});export{se as B};
