import{n as e}from"./createLucideIcon-x_DqbPgA.js";import{i as t,t as n}from"./useQuery-qKYvnzn0.js";import{t as r}from"./useMutation-C6r_dxL-.js";import{n as i}from"./chunk-UVKPFVEO-CKgCEGmW.js";import{t as a}from"./sparkles-67qznMb4.js";import{t as o}from"./client-BAPwymp0.js";function s(e={}){let t=new URLSearchParams;e.entity_type&&t.set(`entity_type`,e.entity_type),e.q&&t.set(`q`,e.q),t.set(`limit`,String(e.limit??200));let r=t.toString();return n({queryKey:[`entities`,e],queryFn:()=>o.get(`/api/v1/entities?${r}`)})}function c(e){return n({queryKey:[`entity`,e],queryFn:()=>o.get(`/api/v1/entities/${e}`),enabled:!!e})}function l(e,t=12){return n({queryKey:[`entity-related`,e,t],queryFn:()=>o.get(`/api/v1/entities/${e}/related?limit=${t}`),enabled:!!e})}function u(e){let t=new URLSearchParams;return e&&t.set(`entity_type`,e),t.set(`limit`,`300`),n({queryKey:[`entity-graph`,e],queryFn:()=>o.get(`/api/v1/entities/graph?${t.toString()}`)})}function d(){let e=t();return r({mutationFn:({id:e,force:t})=>o.post(`/api/v1/entities/${e}/synthesize${t?`?force=true`:``}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`entity`,n.id]}),e.invalidateQueries({queryKey:[`entities`]})}})}var f=e(),p={person:`bg-rose-100 text-rose-700 dark:bg-rose-950/60 dark:text-rose-300`,org:`bg-purple-100 text-purple-700 dark:bg-purple-950/60 dark:text-purple-300`,concept:`bg-sky-100 text-sky-700 dark:bg-sky-950/60 dark:text-sky-300`,tool:`bg-emerald-100 text-emerald-700 dark:bg-emerald-950/60 dark:text-emerald-300`,product:`bg-amber-100 text-amber-700 dark:bg-amber-950/60 dark:text-amber-300`,event:`bg-fuchsia-100 text-fuchsia-700 dark:bg-fuchsia-950/60 dark:text-fuchsia-300`,location:`bg-teal-100 text-teal-700 dark:bg-teal-950/60 dark:text-teal-300`,other:`bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300`};function m(e){return p[e]??p.other}function h({entity:e}){return(0,f.jsxs)(i,{to:`/entities/${e.id}`,className:`block rounded-xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm hover:shadow-md transition-all p-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between mb-2 gap-2`,children:[(0,f.jsx)(`h3`,{className:`font-semibold text-gray-900 dark:text-gray-100 text-sm truncate flex-1`,children:e.canonical_name}),e.has_synthesis&&(0,f.jsx)(a,{className:`h-3.5 w-3.5 text-sky-500 flex-shrink-0`})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,f.jsx)(`span`,{className:`inline-block px-2 py-0.5 rounded text-[10px] font-medium ${m(e.entity_type)}`,children:e.entity_type}),(0,f.jsxs)(`span`,{className:`text-[11px] text-gray-500 dark:text-gray-400`,children:[e.item_count,` mention`,e.item_count===1?``:`s`]})]}),e.description&&(0,f.jsx)(`p`,{className:`text-xs text-gray-600 dark:text-gray-400 line-clamp-2`,children:e.description})]})}export{u as a,c as i,m as n,d as o,s as r,l as s,h as t};