import{c as e,s as t,z as n}from"./useRouterState-DyVgzXuA.js";import{St as r,r as i,t as a}from"./button-cdxnqcgzwko8ooha-DePtDphh.js";import{S as o}from"./api-CJ3Zq7MY.js";import{t as s}from"./Copy.es-87yIntv6.js";var c=e(),l=n(t(),1),u=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),d=(e,t)=>(Math.random()*(t-e)+e).toFixed(2),f=({minWidth:e=30,maxWidth:t=100,minDuration:n=1.3,maxDuration:i=1.7,minDelay:a=0,maxDelay:o=.5,blockHeight:s,className:f})=>{let{width:p,duration:m,delay:h}=(0,l.useMemo)(()=>({width:u(e,t),duration:d(n,i),delay:d(a,o)}),[e,t,n,i,a,o]),g={"--skeleton-width":`${p}%`,"--shimmer-duration":`${m}s`,"--shimmer-delay":`${h}s`},_=(0,c.jsx)(`div`,{className:r(`skeleton-line`,f),style:g});return s===void 0?_:(0,c.jsx)(`div`,{className:`flex items-center`,style:{height:typeof s==`number`?`${s}px`:s},children:_})},p={size:{sm:{classes:`text-sm h-10 gap-0.5`,description:`Compact breadcrumbs for dense UIs`},base:{classes:`text-base h-12 gap-1`,description:`Default breadcrumbs size`}}},m={size:`base`};function h({size:e=m.size}={}){return r(`group mr-4 flex min-w-0 grow items-center overflow-hidden whitespace-nowrap`,p.size[e].classes)}var g=({href:e,icon:t,children:n})=>(0,c.jsxs)(i(),{to:e,className:`flex min-w-0 max-w-full items-center gap-1 text-kumo-subtle no-underline`,children:[!!t&&(0,c.jsx)(`span`,{className:`flex shrink-0 items-center`,children:t}),(0,c.jsx)(`span`,{className:`truncate`,children:n})]});function _({children:e,icon:t,loading:n}){return n?(0,c.jsxs)(`div`,{className:`flex w-[125px] min-w-0 items-center gap-1`,children:[t&&(0,c.jsx)(`span`,{className:`flex shrink-0 items-center`,children:t}),(0,c.jsx)(f,{})]}):(0,c.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-1 font-medium`,"aria-current":`page`,children:[t&&(0,c.jsx)(`span`,{className:`flex shrink-0 items-center`,children:t}),(0,c.jsx)(`span`,{className:`truncate`,children:e})]})}function v(){return(0,c.jsx)(`span`,{className:`flex shrink-0 items-center text-kumo-inactive`,"aria-hidden":`true`,children:(0,c.jsx)(`svg`,{width:`24`,height:`24`,fill:`none`,viewBox:`0 0 24 24`,children:(0,c.jsx)(`path`,{stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,d:`M10.75 8.75L14.25 12L10.75 15.25`})})})}function y(){return(0,c.jsx)(`span`,{className:`flex shrink-0 items-center text-kumo-subtle`,"aria-hidden":!0,children:`...`})}function b({text:e}){let[t,n]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,c.jsx)(a,{variant:`ghost`,shape:`square`,size:`sm`,className:`opacity-0 transition-[opacity] group-hover:opacity-100`,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0)}catch(e){console.error(`Failed to copy deeplink:`,e)}},title:`Click to copy`,"aria-label":`Copy`,children:t?(0,c.jsx)(o,{weight:`bold`,className:`text-kumo-success`}):(0,c.jsx)(s,{weight:`regular`})})}function x({children:e,size:t=`base`,className:n}){let i=l.Children.toArray(e),a=C(i);return(0,c.jsxs)(`nav`,{className:r(h({size:t}),n),"aria-label":`breadcrumb`,children:[(0,c.jsx)(`div`,{className:`contents sm:hidden`,children:a}),(0,c.jsx)(`div`,{className:`hidden sm:contents`,children:i})]})}function S(e,t){return(0,l.isValidElement)(e)&&e.type===t}function C(e){let t=e.filter(e=>S(e,g)||S(e,_));if(t.length<=2)return e;let[n,r]=t.slice(-2),i=[(0,c.jsx)(y,{},`kumo-breadcrumb-mobile-ellipsis`),(0,c.jsx)(v,{},`kumo-breadcrumb-mobile-separator-leading`),(0,l.cloneElement)(n,{key:`kumo-breadcrumb-mobile-parent`}),(0,c.jsx)(v,{},`kumo-breadcrumb-mobile-separator-trailing`),(0,l.cloneElement)(r,{key:`kumo-breadcrumb-mobile-current`})],a=e.filter(e=>!S(e,g)&&!S(e,_)&&!S(e,v));return[...i,...a]}x.Link=g,x.Current=_,x.Separator=v,x.Clipboard=b;function w({children:e,icon:t,items:n,title:r}){return(0,c.jsxs)(`div`,{className:`box-border flex min-h-14.5 shrink-0 items-center gap-2 border-b border-kumo-fill bg-kumo-elevated px-6 text-sm`,children:[(0,c.jsxs)(x,{children:[(0,c.jsx)(x.Current,{icon:(0,c.jsx)(t,{className:`h-4 w-4`}),children:r}),n.map((e,t)=>(0,c.jsxs)(l.Fragment,{children:[(0,c.jsx)(x.Separator,{}),e]},t))]}),e]})}export{x as n,f as r,w as t};