PageSourceSearch

https://www.techi.com/_next/static/chunks/78398.01c7da8da452d7b3.js

js techi.com collected 2026-10-02 03:15:35 UTC 3,078 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78398],{78398:(e,s,t)=>{t.r(s),t.d(s,{QuoteResearchAssistant:()=>o});var n=t(81068),a=t(14484),r=t(69440),l=t(51615),i=t.n(l);function o({symbol:e,initiallyOpen:s=!1,onDismiss:t}){let l=(0,r.useRef)(null),[d,c]=(0,r.useState)(s),[u,h]=(0,r.useState)(""),[m,x]=(0,r.useState)(!1),[b,p]=(0,r.useState)(null);return(0,r.useEffect)(()=>{s&&l.current?.showModal()},[s]),(0,n.jsxs)(n.Fragment,{children:[s?null:(0,n.jsxs)("button",{type:"button",onClick:()=>{c(!0),l.current?.showModal()},className:"inline-flex min-h-10 items-center gap-2 rounded-md border border-border bg-card px-3 text-sm font-semibold hover:bg-muted",children:[(0,n.jsx)(a.A,{className:"h-4 w-4","aria-hidden":!0})," Ask TECHi about ",e]}),(0,n.jsx)("dialog",{onClose:t,ref:l,"aria-labelledby":"quote-assistant-title",className:"m-auto max-h-[90dvh] w-[min(95vw,40rem)] overflow-auto rounded-xl border bg-background p-5 text-foreground backdrop:bg-black/50",children:d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("h2",{id:"quote-assistant-title",className:"text-lg font-semibold",children:["Ask TECHi about ",e]}),(0,n.jsx)("button",{className:"rounded border p-2",onClick:()=>l.current?.close(),children:"Close"})]}),(0,n.jsxs)("form",{className:"mt-4 space-y-3",onSubmit:async s=>{if(s.preventDefault(),!m){x(!0);try{let s=await fetch("/api/stocks/research-assistant/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({symbol:e,question:u})});p(await s.json())}catch{p({error:"Connection interrupted. Please try again."})}finally{x(!1)}}},children:[(0,n.jsxs)("label",{className:"grid gap-1 text-sm",children:["Research question",(0,n.jsx)("input",{name:"research-question",value:u,onChange:e=>h(e.target.value),required:!0,maxLength:400,className:"rounded border bg-transparent p-2"})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:["What changed since earnings?","Why is forward P/E lower than trailing?","What would hurt the thesis?",`Compare ${e} and AMD margins.`].map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>h(e),className:"rounded border p-2 text-xs",children:e},e))}),(0,n.jsx)("button",{disabled:m,className:"rounded border px-4 py-2 font-semibold",children:m?"Finding evidence…":"Ask"})]}),(0,n.jsxs)("div",{className:"mt-4 space-y-3 text-sm","aria-live":"polite",children:[b?.error?(0,n.jsxs)("p",{children:[b.error," ",b.error.startsWith("Sign in")?(0,n.jsx)(i(),{href:"/login/",className:"underline",children:"Sign in"}):null]}):null,b?.mode?(0,n.jsx)("p",{className:"font-semibold",children:b.mode}):null,b?.answer?.map(e=>(0,n.jsxs)("p",{children:[e.text," ",(0,n.jsx)(i(),{className:"underline",href:e.href,children:e.source}),e.asOf?` \xb7 ${e.asOf.slice(0,10)}`:""]},e.id)),b?.answer?.length===0?(0,n.jsx)("p",{children:"No available evidence directly answers that question."}):null,b?.note?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:b.note}):null]})]}):null})]})}}}]);

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.