import{j as r}from"./vendor-react-wBh_31cN.js";import{d as f}from"./vendor-router-D1GqFWiT.js";import{d,q as u,a as b,cQ as j,R as y}from"./index-BKr2rJhV.js";import{B as N}from"./badge-nyizWwTN.js";import{b4 as w}from"./vendor-icons-BUUmD6ht.js";const v={wrapper:(s,e,a)=>d("rounded-lg transition-shadow duration-200 hover:shadow-md",e?"cursor-default":"cursor-pointer")},p=(s,e)=>{const a=s.replace(/<\/?em>/g,"");if(!e)return a;const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return a.replace(new RegExp(`(${t})`,"gi"),"<mark>$1</mark>")},q=({children:s,highlights:e,isSelected:a=!1,isLocked:t=!1,onClick:n,onMouseEnter:c})=>{const l=e&&!u(e),[x]=f(),h=x.get("search")??"";return r.jsxs("div",{className:d("flex flex-col",v.wrapper(a,t),l&&"overflow-hidden border border-border shadow-sm [&>[data-slot=card]]:border-0 [&>[data-slot=card]]:shadow-none [&>[data-slot=card]]:rounded-none"),onClick:n,onMouseEnter:c,onFocus:c,onKeyDown:o=>{n&&(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n())},role:"button",tabIndex:n?0:-1,children:[s,l&&r.jsxs("div",{className:"flex flex-col gap-2 border-t border-border bg-card px-4 py-3 font-sans",children:[r.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Matches"}),Object.entries(e).map(([o,i])=>{const g=b(m,j(i),k);return r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(N,{variant:"outline",className:"shrink-0 border-transparent bg-quartz-label-yellow-shade2 text-foreground",children:o}),r.jsx(g,{value:i,searchTerm:h})]},o)})]})]})},m=({value:s,searchTerm:e})=>r.jsx("span",{className:"highlight-content text-xs text-foreground",dangerouslySetInnerHTML:{__html:p(s,e)}}),H=({value:s,searchTerm:e})=>r.jsx("div",{className:"flex flex-col gap-1",children:s.map(a=>Object.entries(a).map(([t,n])=>r.jsxs("div",{className:"flex items-baseline gap-1.5",children:[r.jsxs(y,{children:[t,":"]}),r.jsx("span",{className:"highlight-content text-xs text-foreground",dangerouslySetInnerHTML:{__html:p(n,e)}})]},t)))}),k={String:m,Array:H};function z({value:s,isLock:e=!1,className:a,...t}){return r.jsxs("div",{"data-slot":"project-badge",className:d("inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-card px-2 text-xs font-medium text-quartz-black",a),...t,children:[e&&r.jsx(w,{className:"size-3 text-quartz-gray"}),r.jsx("span",{className:"truncate",children:s})]})}export{z as P,q as W};
