1import{r as p,j as e}from"./vendor-clerk-CW4_2MMl.js";import{a1 as u,w as h,a5 as f,L as i,d as g,x as b}from"./index-BvRH0Ky1.js";import{F as j}from"./follow-button-BL5nzWjX.js";import{A as N}from"./site-footer-BZ-gNZJi.js";import{S as o}from"./skeleton-DqQ_WJ0a.js";import{S as y}from"./site-footer-mhDU5e8Y.js";import{P as v}from"./pagination-bar-mjUb1PE-.js";import{M as w}from"./mentioned-article-list-ClcFr_Jp.js";import{A as k}from"./arrow-left-B_HFGD9o.js";import{B as m}from"./building-2-ezGDxofr.js";import{M as A}from"./map-pin-Bo2ON88N.js";import{E as S}from"./external-link-COz2iyRy.js";import{N as l}from"./newspaper-Calo1dI9.js";import"./vendor-editor-Cu-Vhp5u.js";import"./vendor-charts-r3Sr4R8y.js";import"./follows-BrnNe3fc.js";import"./users-DfQNQnqB.js";import"./logo-dark-_3Afpb0J.js";import"./article-url-_HFmwpam.js";import"./search-CUHT-bWd.js";import"./dropdown-menu-CbgVRjno.js";import"./index-BEA706Du.js";import"./Combination-B4XLLUBl.js";import"./index-Cxsgncl7.js";import"./chevron-right-FjOxgymW.js";import"./check-DDxpiGSP.js";import"./confirm-dialog-eyEDlxN3.js";import"./dialog-BMssFU_6.js";import"./index-DyZ7x75t.js";import"./file-text-cvCviHf6.js";import"./image-O8ZNEwDR.js";import"./message-square-B3kbpL74.js";import"./calendar-days-C7AwDUQi.js";import"./mail-CucW84DZ.js";import"./settings-D2K8S7Ub.js";import"./link-2-BogqTHAA.js";import"./trash-2-C_NL6wxH.js";import"./pencil-0wS7JCcZ.js";import"./user-DPk6VhoE.js";import"./clock-BaSqeJln.js";import"./radio-D1L4sgf3.js";import"./article-byline-B84qJlUL.js";import"./author-url-CxjT1ljy.js";import"./article-image-BIRcQYKY.js";import"./media-image-OTCHyz1L.js";import"./camera-BO6oH9sP.js";import"./bookmark-button-CC8_FE-C.js";import"./bookmarks-D7jzdxr6.js";import"./format-B2Tbf7Yc.js";import"./en-US-SgDV8MQn.js";const P={operator:"Operator",noc:"NOC",service_company:"Service Company"},L={operator:"bg-sky-100 text-sky-800 dark:bg-sky-900/40 dark:text-sky-300",noc:"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",service_company:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300"},t=12;function Se(){const s=u().slug,[a,n]=p.useState(1),{data:r,isLoading:d,isError:c}=h({queryKey:["/api/companies",s,a],queryFn:()=>b(`/api/companies/${s}?page=${a}&pageSize=${t}`),enabled:!!s,staleTime:6e4});return e.jsxs("div",{className:"min-h-screen bg-muted",children:[e.jsx(f,{title:r?.name??"Company Profile"}),e.jsxs("div",{className:"min-h-screen bg-background text-foreground max-w-[1440px] mx-auto border-x border-border shadow-xl",children:[e.jsx(y,{}),e.jsxs("main",{className:"flex-1 max-w-screen-xl mx-auto px-4 py-8 w-full",children:[e.jsxs(i,{href:"/companies",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors mb-8",children:[e.jsx(k,{className:"w-4 h-4"}),"Company Directory"]}),d?e.jsxs("div",{className:"space-y-6",children:[e.jsx(o,{className:"h-40 rounded-2xl"}),e.jsx(o,{className:"h-24 rounded-xl"}),e.jsx(o,{className:"h-64 rounded-xl"})]}):c||!r?e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[e.jsx(m,{className:"w-12 h-12 text-muted-foreground/30 mb-4"}),e.jsx("h2",{className:"text-xl font-serif font-bold text-foreground mb-2",children:"Company not found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"This company profile doesn't exist or has been removed."}),e.jsx(i,{href:"/companies",className:"text-primary hover:underline",children:"Browse all companies"})]}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("aside",{className:"lg:col-span-1 space-y-6",children:[e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 flex flex-col items-center text-center",children:[e.jsx("div",{className:"w-20 h-20 rounded-xl bg-muted overflow-hidden flex items-center justify-center border border-border mb-4",children:r.logo?.url?e.jsx("img",{src:r.logo.url,alt:r.logo.alt??r.name,className:"w-full h-full object-contain p-1.5"}
1):e.jsx(m,{className:"w-9 h-9 text-muted-foreground/30"})}),e.jsx("h1",{className:"font-serif font-bold text-2xl text-foreground leading-tight mb-2",children:r.name}),e.jsx("span",{className:g("inline-block text-[11px] font-semibold uppercase tracking-wider px-3 py-1 rounded-full",L[r.type]),children:P[r.type]}),e.jsx("div",{className:"mt-4",children:e.jsx(j,{type:"company",slug:r.slug,label:r.name,size:"sm"})})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-5 space-y-4",children:[r.headquarters&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(A,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Headquarters"}),e.jsx("p",{className:"text-sm text-foreground",children:r.headquarters})]})]}),r.website&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(S,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Website"}),e.jsx("a",{href:r.website.startsWith("http")?r.website:`https://${r.website}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline break-all",children:r.website.replace(/^https?:\/\//,"")})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[r.description&&e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif font-bold text-xl text-foreground mb-3",children:"About"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(l,{className:"w-5 h-5 text-primary"}),e.jsxs("h2",{className:"font-serif font-bold text-xl text-foreground",children:["Mentioned in ",r.totalArticles.toLocaleString()," ",r.totalArticles===1?"story":"stories"]})]}),r.totalArticles===0?e.jsxs("div",{className:"bg-card border border-border rounded-xl p-8 text-center",children:[e.jsx(l,{className:"w-8 h-8 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"No articles yet."})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{articles:r.latestArticles}),r.totalArticles>t&&e.jsx("div",{className:"mt-8",children:e.jsx(v,{page:a,totalPages:Math.ceil(r.totalArticles/t),onPageChange:x=>{n(x),window.scrollTo({top:0,behavior:"smooth"})},total:r.totalArticles,pageSize:t,itemLabel:"articles"})})]})]})]})]})]}),e.jsx(N,{})]})]})}export{Se 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.