1import{r as a,j as e,D as y,V as g}from"./index-D2iBRmQq.js";import{A as f}from"./AppPublicShell-WeKnFAm3.js";import{D as b}from"./DocumentMarkdown-BQhwKEX6.js";import{D as j,P as N,p as _,G as w}from"./pdf.worker.min-NzlXhexi.js";import{A as P}from"./arrow-left-C7KDslkE.js";import{E as S}from"./external-link-ZtruuIWO.js";import"./Header-WAjt7-wr.js";import"./useTrialOffer-B7QgnkGM.js";import"./moreMenu-BAtjm6BV.js";import"./building-2-DeXomUa1.js";import"./landmark-D8ZSQl76.js";import"./trending-down-DCZLPlMh.js";import"./chart-pie-CY3jkrXi.js";import"./sparkles-etIivWcV.js";import"./arrow-left-right-CzWJ7o1z.js";import"./layout-grid-BaqecSaz.js";import"./wallet-DaPdKx1W.js";import"./globe-DUC0fLoP.js";import"./chart-line-CTjrIucU.js";import"./screenerCatalog-C2fl8hDh.js";import"./chevron-down-CvOzQ5Lm.js";import"./search-BufhsDV6.js";import"./message-square-7SDGrDSZ.js";import"./sun-DRlk8M0L.js";import"./credit-card-CUeAZmMx.js";import"./shield-MW4r7hsj.js";import"./safeUrl-CAt1KeFn.js";import"./index-BuL004sn.js";import"./tiny-invariant-CopsF_GD.js";w.workerSrc=_;function k({pageNumber:x,width:r,aspect:l}){const u=a.useRef(null),[o,t]=a.useState(x<=2);a.useEffect(()=>{if(o)return;const p=u.current;if(!p||typeof IntersectionObserver>"u"){t(!0);return}const d=new IntersectionObserver(h=>{h.some(n=>n.isIntersecting)&&(t(!0),d.disconnect())},{rootMargin:"1200px 0px"});return d.observe(p),()=>d.disconnect()},[o]);const c=Math.round(r*l);return e.jsx("div",{ref:u,style:{minHeight:o?void 0:c},className:"mb-3",children:o?e.jsx(N,{pageNumber:x,width:r,renderAnnotationLayer:!1,className:"rounded border border-[var(--border-primary)] shadow-sm bg-white",loading:e.jsx("div",{style:{height:c},className:"rounded border border-[var(--border-subtle)] bg-[var(--bg-secondary)]"})}):e.jsx("div",{style:{height:c},className:"rounded border border-[var(--border-subtle)] bg-[var(--bg-secondary)]"})})}function A({url:x,onError:r}){const l=a.useRef(null),[u,o]=a.useState(0),[t,c]=a.useState(0),[p,d]=a.useState(11/8.5);a.useEffect(()=>{const n=l.current;if(!n)return;const i=()=>o(Math.max(0,Math.floor(n.clientWidth)));i();const s=new ResizeObserver(i);return s.observe(n),()=>s.disconnect()},[]);const h=e.jsx("div",{className:"py-10 text-center text-sm text-[var(--text-tertiary)]",children:"Loading PDFâ¦"});return e.jsxs("div",{ref:l,className:"min-w-0",children:[u>0&&e.jsx(j,{file:x,loading:h,onLoadSuccess:async n=>{c(n.numPages);try{const i=await n.getPage(1),[,,s,m]=i.view;s>0&&m>0&&d(m/s)}catch{}},onLoadError:()=>r==null?void 0:r(),onSourceError:()=>r==null?void 0:r(),error:e.jsx("div",{className:"py-10 text-center text-sm text-[var(--text-tertiary)]",children:"Couldnât render this PDF."}),children:Array.from({length:t},(n,i)=>e.jsx(k,{pageNumber:i+1,width:u,aspect:p},i+1))}),t>0&&e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-tertiary)]",children:[t," page",t===1?"":"s"]})]})}const v="https://api.signals.ai";function ae(){var i;const{id:x}=y(),[r,l]=a.useState({status:"loading",data:null}),[u,o]=a.useState(!1);a.useEffect(()=>{let s=!1;return l({status:"loading",data:null}),o(!1),fetch(`${v}/api/d/${encodeURIComponent(x)}`).then(m=>m.ok?m.json():Promise.reject(m.status)).then(m=>!s&&l({status:"ok",data:m})).catch(()=>!s&&l({status:"missing",data:null})),()=>{s=!0}},[x]);const t=r.data;a.useEffect(()=>{document.title=t?`${t.display_title||t.title||"Investor document"} | Signals.AI`:"Investor document | Signals.AI"},[t]);const c=a.useMemo(()=>{try{return t!=null&&t.source_url?new URL(t.source_url).hostname:null}catch{return null}},[t]);if(r.status==="loading")return e.jsx(f,{children:e.jsx("div",{className:"py-20 text-center text-[var(--text-secondary)]",children:"Loading documentâ¦"})});if(r.status==="missing")return e.jsx(f,{children:e.jsxs("div",{className:"py-16 text-center",children:[e.jsx("h1",{className:"font-display text-3xl font-semibold text-[var(--text-primary)]",children:"Document not found"}),e.jsx("p",{className:"mx-auto mt-4 max-w-md text-[var(--text-secondary)]",children:"This citation link does not match a document we serve. It may have been mistyped, or the document may not be in our
1corpus."}),e.jsxs(g,{to:"/",className:"mt-6 inline-flex items-center gap-2 text-sm font-semibold text-accent",children:[e.jsx(P,{className:"h-4 w-4"})," Signals.AI"]})]})});const p=!!t.pdf_url&&!u,d=t.published_at?String(t.published_at).slice(0,10):null,h=t.retrieved_at?String(t.retrieved_at).slice(0,10):null,n=[t.fiscal_period,t.fiscal_year].filter(Boolean).join(" ");return e.jsx(f,{children:e.jsxs("article",{className:"mx-auto max-w-3xl py-10",children:[e.jsxs("header",{className:"border-b border-[var(--border-subtle)] pb-6",children:[e.jsx("p",{className:"font-mono text-xs uppercase tracking-[0.14em] text-[var(--text-tertiary)]",children:(t.doc_type||"document").replace(/_/g," ")}),e.jsx("h1",{className:"mt-2 font-display text-3xl font-semibold text-[var(--text-primary)]",children:t.display_title||t.title}),e.jsxs("p",{className:"mt-2 text-sm text-[var(--text-secondary)]",children:[t.ticker,n?` · ${n}`:"",d?` · Published ${d}`:"",t.pages?` · ${t.pages} pages`:""]}),t.source_url&&e.jsxs("a",{href:t.source_url,target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-flex items-center gap-2 text-sm font-semibold text-accent",children:["View the original",c?` at ${c}`:"",e.jsx(S,{className:"h-3.5 w-3.5"})]}),e.jsxs("p",{className:"mt-4 text-xs leading-relaxed text-[var(--text-tertiary)]",children:[t.attribution,h?` Text as read on ${h}.`:""]})]}),t.summary&&e.jsxs("section",{className:"border-b border-[var(--border-subtle)] py-6",children:[e.jsx("h2",{className:"font-display text-base font-semibold text-[var(--text-primary)]",children:"Summary"}),e.jsx("p",{className:"mt-2 text-[15px] leading-relaxed text-[var(--text-secondary)]",children:t.summary})]}),((i=t.outline)==null?void 0:i.length)>0&&e.jsxs("section",{className:"border-b border-[var(--border-subtle)] py-6",children:[e.jsx("h2",{className:"font-display text-base font-semibold text-[var(--text-primary)]",children:"Pages"}),e.jsx("ol",{className:"mt-3 flex flex-col gap-1.5",children:t.outline.map(s=>e.jsxs("li",{id:`page=${s.page}`,className:"text-sm text-[var(--text-secondary)]",children:[e.jsx("span",{className:"font-mono text-xs text-[var(--text-tertiary)]",children:String(s.page).padStart(2,"0")})," ",s.summary]},s.page))})]}),p&&e.jsx("section",{className:"py-6",children:e.jsx(A,{url:`${v}${t.pdf_url}`,onError:()=>o(!0)})}),e.jsx("section",{className:"py-6",children:t.text_available&&p?e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:"Extracted text"}),e.jsx("div",{className:"mt-4",children:e.jsx(b,{text:t.text})})]}):t.text_available?e.jsx(b,{text:t.text}):e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["We hold this document but have not extracted its text yet.",t.source_url?" The issuerâs copy above is the document.":""]})})]})})}export{ae 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.