import{aJ as c,cc as g,cd as p,ao as e,L as E,ba as C,a_ as M,av as P,bC as _}from"./app-k0jcl5PQ.js";import{P as k}from"./CPXlV0fg.chunk.js";const y="shared.breadcrumbComponent",B=E.encloseNamespace(y),F=64,h=48,o=c.forwardRef((a,n)=>{const{breadcrumb:{name:t,appLink:s,active:u},withBackIcon:m,linkClassName:d}=a;let l=t,r=null;return l.length>h&&(l=t.slice(0,h)+"...",r=t),e.jsx("li",{className:`breadcrumb-item${u?" active":""}`,title:r,children:u?e.jsx("strong",{children:l}):e.jsxs(C,{appLink:s,ref:n,className:s?d:"",children:[m&&e.jsx(M,{svg:_,size:P.Small}),e.jsx("span",{className:m?"ms-2":"",children:l})]})})}),I=({breadcrumbs:a,linkClassName:n})=>{const t=g(p.XS),s=(a==null?void 0:a.length)||0,[u,m]=c.useState(!1),[d,l]=c.useState(!1),r=c.useRef(null);c.useEffect(()=>{const i=(a==null?void 0:a.reduce((x,b)=>x+b.name.length,0))??0;s>4&&i>F&&m(!0)},[a==null?void 0:a.length]),c.useLayoutEffect(()=>{var i;d&&((i=r.current)==null||i.focus())},[r.current,d]);function j(){m(!1),l(!0)}if(!s||t&&s<2)return e.jsx(e.Fragment,{});if(t)return e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"breadcrumb m-0 p-0",children:e.jsx(o,{breadcrumb:a[s-2],withBackIcon:!0,linkClassName:n})})});const f=e.jsx(o,{breadcrumb:a[0],linkClassName:n}),S=s>2?e.jsx(o,{breadcrumb:a[1],linkClassName:n}):e.jsx(e.Fragment,{}),L=s>3?e.jsx(o,{breadcrumb:a[s-2],linkClassName:n}):e.jsx(e.Fragment,{}),v=s>1?e.jsx(o,{breadcrumb:a[s-1],linkClassName:n}):e.jsx(e.Fragment,{}),N=a.slice(2,s-2);return e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsxs("ol",{className:"breadcrumb m-0 p-0",children:[f,S,u?e.jsx("li",{className:"breadcrumb-item",children:e.jsx("button",{className:"btn-link",onClick:j,"aria-label":B("expand"),children:"..."})}):N.map((i,x)=>e.jsx(o,{breadcrumb:i,ref:x===0?r:null,linkClassName:n},x)),L,v]})})},T=c.memo(function({numItems:a=3}){return g(p.XS)?e.jsx("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"breadcrumb m-0 p-0",children:k.getPartialLoadingItems({numItems:a}).map(({width:t},s)=>e.jsx("li",{className:"breadcrumb-item",children:e.jsx("span",{className:"d-inline-block partial-loading-background",style:{width:t},dangerouslySetInnerHTML:{__html:"&nbsp"}})},s))})})});export{I as B,T as P};
//# sourceMappingURL=CCtuxSlD.chunk.js.map
