import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{Ei as s,Mi as t,ki as a}from"./vendor-frame-CwiylG4Y.js";import{$ as i}from"./shared-frame-DbQbH4Yr.js";import{nt as r}from"./index-C9LAU4f-.js";var n=e(t()),l=a(),c=(0,n.memo)(({id:e,name:t,nameMatches:a,icon:c,isSelected:d,onSelect:o,description:x,statusLabel:m,badge:p,action:f,expanded:h,isEnabled:j=!0,ariaDisabled:u=!1,className:b})=>{const v=(0,n.useCallback)(()=>{u||o?.(e)},[e,o,u]),g=`${e}-nav-item-description`,N=(0,l.jsxs)(l.Fragment,{children:[c&&(0,l.jsx)("span",{className:s("flex-shrink-0 flex items-center justify-center size-6 text-text-300",{"opacity-50":!j}),children:c}),(0,l.jsxs)("div",{className:"flex flex-col flex-1 min-w-0",children:[(0,l.jsxs)("span",{className:"flex items-center gap-1.5 min-w-0",children:[(0,l.jsx)("span",{className:s("truncate",d?"font-semibold":""),children:(0,l.jsx)(r,{text:t,matches:a})}),p]}),x&&(0,l.jsx)("span",{id:u?g:void 0,className:"font-small text-text-400 truncate",title:"string"==typeof x?x:void 0,children:x})]}),m&&(0,l.jsx)("span",{className:"text-xs text-text-500 shrink-0",children:m}),void 0!==h&&(0,l.jsx)("span",{"aria-hidden":"true",className:"shrink-0 flex items-center text-muted",children:(0,l.jsx)(i,{name:h?"CaretDown":"CaretRight",size:"xs"})})]}),k=void 0!==o&&!u,y=s("rounded-lg text-sm transition-colors w-full",d?"bg-bg-300":k?"hover:bg-bg-200":void 0,j?"text-text-100":"text-text-500",b),w={type:"button","aria-current":d?"true":void 0,"aria-expanded":h,onClick:v,...u?{"aria-disabled":!0,"aria-describedby":x?g:void 0}:{}};if(f)return(0,l.jsxs)("div",{className:s("flex items-center gap-1 pr-3",y),children:[(0,l.jsx)("button",{...w,className:s("flex flex-1 items-center gap-3 px-3 py-1.5 rounded-lg text-left min-w-0",k&&"cursor-pointer"),children:N}),(0,l.jsx)("div",{className:"shrink-0",children:f})]});const C="flex items-center gap-3 px-3 py-1.5 text-left";return void 0!==o||u?(0,l.jsx)("button",{...w,className:s(C,k&&"cursor-pointer",y),children:N}):(0,l.jsx)("div",{className:s(C,y),children:N})});export{c as t};