1import{r as a,j as t,L as g,I as n}from"./index-pyc-rVim.js";import{_ as y,F as w}from"./three-spritetext-DxXmnkh5.js";import{C as j}from"./Card-DyWpcozy.js";import{B as C}from"./TransparencyRoutes-DItLE8d4.js";import{S as m}from"./StatCard-BzHDOLJA.js";import{v as S}from"./useData-B1ibUzqt.js";import"./Paired-C_DowH9W.js";const x={director:"#C5982D",corporation:"#C8102E"};function z(){const c=a.useRef(null),[p,b]=a.useState(""),[r,h]=a.useState(null),[u,f]=a.useState(1),{data:l,isLoading:k}=S("interlocking",{search:p||void 0,min_shared:u}),i=a.useMemo(()=>l?{nodes:(l.nodes||[]).map(e=>({id:e.id,name:e.label||e.name||e.id,type:e.type||"corporation",val:e.weight||1,...e})),links:(l.links||[]).map(e=>({source:e.source,target:e.target,shared:e.shared_directors||1,...e}))}:{nodes:[],links:[]},[l]),d=a.useMemo(()=>{if(!i)return{corporations:0,directors:0,links:0};const e=i.nodes.filter(o=>o.type==="corporation").length,s=i.nodes.filter(o=>o.type==="director").length;return{corporations:e,directors:s,links:i.links.length}},[i]),N=a.useCallback(e=>{if(h(e),c.current){const o=1+120/Math.hypot(e.x||0,e.y||0,e.z||0);c.current.cameraPosition({x:(e.x||0)*o,y:(e.y||0)*o,z:(e.z||0)*o},e,1e3)}},[]),v=a.useCallback(e=>{const s=new y(e.name);return s.color="#0B1D32",s.textHeight=2.5,s.backgroundColor="rgba(247,243,237,0.8)",s.borderRadius=2,s.padding=[1,2],s},[]);return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-heading font-light text-ink",children:"Interlocking Directorates"}),t.jsx("p",{className:"text-steel mt-1",children:"Corporations that share directors, revealing hidden power networks."})]}),t.jsxs(g,{to:"/transparency/network",className:"flex items-center gap-2 text-sm text-crimson hover:text-crimson/80 transition-colors",children:[t.jsx(n,{icon:"mdi:graph",className:"text-base"}),"Full Network"]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[t.jsx(m,{label:"Corporations",value:d.corporations,icon:t.jsx(n,{icon:"mdi:domain"}),format:"compact"}),t.jsx(m,{label:"Directors",value:d.directors,icon:t.jsx(n,{icon:"mdi:account-multiple"}),color:"blue",format:"compact"}),t.jsx(m,{label:"Interlock Links",value:d.links,icon:t.jsx(n,{icon:"mdi:link-variant"}),color:"green",format:"compact"})]}),t.jsx(j,{children:t.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[t.jsxs("div",{className:"flex-1 min-w-[200px] max-w-sm",children:[t.jsx("label",{className:"block text-xs font-medium text-steel uppercase tracking-wider mb-1",children:"Search corporation"}),t.jsx("input",{type:"text",value:p,onChange:e=>b(e.target.value),placeholder:"Filter by corporation name...",className:"bg-white border border-rule/40 text-ink text-sm rounded-lg px-4 py-2 outline-none focus:border-crimson/30 w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium text-steel uppercase tracking-wider mb-1",children:"Min
1shared directors"}),t.jsx("select",{value:u,onChange:e=>f(Number(e.target.value)),className:"bg-white border border-rule/40 text-ink text-sm rounded-lg px-3 py-2 outline-none focus:border-crimson/30",children:[1,2,3,5].map(e=>t.jsxs("option",{value:e,children:[e,"+"]},e))})]})]})}),t.jsx("div",{className:"flex gap-4",children:Object.entries(x).map(([e,s])=>t.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-steel",children:[t.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:s}}),t.jsx("span",{className:"capitalize",children:e})]},e))}),t.jsxs("div",{className:"relative bg-parchment rounded border border-rule overflow-hidden",style:{height:"65vh"},children:[k&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-parchment/90 z-10",children:t.jsx("div",{className:"text-steel",children:"Loading network..."})}),t.jsx(w,{ref:c,graphData:i,backgroundColor:"#F7F3ED",nodeColor:e=>x[e.type]||"#4A6274",nodeVal:e=>e.val,nodeLabel:e=>`${e.name} (${e.type})`,nodeThreeObject:v,nodeThreeObjectExtend:!0,linkColor:()=>"rgba(11,29,50,0.12)",linkWidth:e=>Math.min((e.shared||1)*.5,3),linkOpacity:.4,onNodeClick:N,warmupTicks:50,cooldownTicks:100})]}),r&&t.jsx(j,{children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:x[r.type]||"#4A6274"}}),t.jsx(C,{color:r.type==="director"?"amber":"red",children:r.type})]}),t.jsx("h3",{className:"text-lg font-heading text-ink",children:r.name}),r.province&&t.jsx("p",{className:"text-sm text-steel mt-0.5",children:r.province})]}),t.jsxs("div",{className:"flex gap-2",children:[r.type==="corporation"&&t.jsx(g,{to:`/transparency/corporations/${r.id}`,className:"text-sm text-crimson hover:text-crimson/80 transition-colors",children:"View details"}),t.jsx("button",{onClick:()=>h(null),className:"text-steel/60 hover:text-ink transition-colors",children:t.jsx(n,{icon:"mdi:close",className:"text-lg"})})]})]})})]})}export{z as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.