import{m as F,i as v,r as t,j as a}from"./vendor-react-DrAK5R0M.js";import{M as y}from"./MemoryGraph-l0gw91mg.js";import{G,f as g}from"./GraphSidebar-CWgKRFgT.js";import{bN as w,bO as I}from"./index-7eqLqzhB.js";import"./vendor-visuals-BHLltLY6.js";import"./vendor-icons-Cu2Ube6F.js";import"./vendor-radix-CwTvaGVy.js";const L=new Set(["context","related","activities","assignments"]);function R(){var m;const{id:o}=F(),{pathname:p}=v(),s=p.startsWith("/contacts")?"contact":"account",{data:c}=w(s==="contact"?o??"":""),{data:l}=I(s==="account"?o??"":""),i=s==="contact"?(()=>{const e=c==null?void 0:c.contact;return e&&([e.first_name,e.last_name].filter(Boolean).join(" ")||e.email)||""})():((m=l==null?void 0:l.account)==null?void 0:m.name)??"",[f,h]=t.useState(null),[u,x]=t.useState(null),[d,S]=t.useState(new Set(L)),[j,N]=t.useState({context:0,related:0,activities:0,assignments:0}),n=t.useRef(null),r=t.useCallback((e,C)=>{h(e),x(C)},[]),b=t.useCallback(e=>{N(e)},[]);return o?a.jsxs("div",{className:"flex flex-row flex-1 min-h-0 h-full overflow-hidden",children:[a.jsx(G,{subjectType:s,subjectName:i,activeFilters:d,filterCounts:j,onFilterChange:S,onFitView:()=>{var e;return(e=n.current)==null?void 0:e.call(n)}}),a.jsx(y,{subjectType:s,subjectId:o,subjectName:i,selectedNodeId:f,onNodeSelect:r,activeFilters:d,fitViewRef:n,onFilterCounts:b}),a.jsx(g,{node:u,onClose:()=>r(null,null),onNodeFocus:e=>r(e,u)})]}):null}export{R as default};
