PageSourceSearch

https://vraust.ai/assets/HistoryOverlay-9jJUSG5T.js

js vraust.ai collected 2026-10-05 13:50:12 UTC 22,353 bytes, 4 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DOc5RAp9.js","assets/index-fV_-e-MA.css"])))=>i.map(i=>d[i]);
2import{u as X,r as d,h as T,j as e,B as y,aw as U,au as B,e as he,a3 as me,at as R,M as ue,b as pe,ak as ge,ax as G,ay as K,az as Q,a9 as fe,F as z,aA as ve,I as be,X as je,aB as P,m as A,T as O,C as ke,aC as Y,z as Z,i as q,a7 as H,aD as Ne,ad as ye,aE as we,aF as Se,aG as Ce}from"./index-DOc5RAp9.js";import{R as _e,P as $e,S as Re}from"./server-B2YN5rIX.js";import{F as Ee}from"./filter-C9bpBb9O.js";const F=40,Ae=[{value:"all",label:"All surfaces"},{value:"web",label:"Web"},{value:"mobile",label:"Mobile"},{value:"extension",label:"Extension"},{value:"call",label:"Calls"},{value:"email",label:"Email"},{value:"external",label:"API"}],De={web:U,mobile:me,extension:$e,call:R,email:ue,external:Re};function Le(){const{user:l}=X(),[r,c]=d.useState([]),[f,m]=d.useState("all"),[j,w]=d.useState(!0),[_,S]=d.useState(!1),[i,o]=d.useState(!1),[p,k]=d.useState(null),v=d.useCallback(async t=>{if(!l)return[];let s=T.from("unified_activity").select("id, surface, kind, subtype, score, band, title, host, origin_table, origin_id, created_at").eq("user_id",l.id).order("created_at",{ascending:!1}).limit(F);f!=="all"&&(s=s.eq("surface",f)),t&&(s=s.lt("created_at",t));const{data:x,error:L}=await s;return L?(k(L.message),[]):(k(null),x??[])},[l,f]),u=d.useCallback(async()=>{w(!0),o(!1);const t=await v(null);c(t),o(t.length<F),w(!1)},[v]);d.useEffect(()=>{u()},[u]);const $=async()=>{const t=r[r.length-1];if(!t)return;S(!0);const s=await v(t.created_at);c(x=>[...x,...s]),o(s.length<F),S(!1)},D=d.useMemo(()=>{const t=new Map;for(const s of r)t.set(s.surface,(t.get(s.surface)??0)+1);return t},[r]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ae.map(t=>{const s=f===t.value;return e.jsxs("button",{type:"button",onClick:()=>m(t.value),"aria-pressed":s,className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors ${s?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:text-foreground"}`,children:[t.label,t.value!=="all"&&D.get(t.value)?e.jsx("span",{className:"ml-1.5 text-[10px] tabular-nums opacity-70",children:D.get(t.value)}):null]},t.value)}),e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>void u(),"aria-label":"Refresh activity",children:e.jsx(_e,{className:`h-3.5 w-3.5 ${j?"animate-spin":""}`,"aria-hidden":"true"})})]}),p&&e.jsx("p",{className:"text-xs text-destructive",children:p}),j?e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,s)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl bg-muted/40"},s))}):r.length===0?e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No activity yet on this account. Scans from the web app, the extension and the mobile app all appear here."}):e.jsx("ul",{className:"space-y-2",children:r.map(t=>{const s=De[t.surface]??U,x=B(t.score);return e.jsxs("li",{className:"flex items-center justify-between gap-4 rounded-xl border border-border bg-card px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(s,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-foreground",children:t.title||t.host||t.kind}),e.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[t.surface," · ",t.subtype||t.kind," ·"," ",new Date(t.created_at).toLocaleString("en-CA",{dateStyle:"medium",timeStyle:"short"})]})]})]}),t.score!==null&&e.jsx("span",{className:`shrink-0 rounded-md px-2 py-1 text-xs font-semibold tabular-nums ${x.bgClass} ${x.textClass}`,children:t.score})]},`${t.origin_table}:${t.origin_id}`)})}),!j&&!i&&r.length>0&&e.jsx("div",{className:"flex justify-center",children:e.jsxs(y,{variant:"outline",size:"sm",disabled:_,onClick:()=>void $(),children:[_?e.jsx(he,{className:"mr-2 h-3.5 w-3.5 animate-spin","aria-hidden":"true"}):null,"Load more"]})})]})}const Me=[{value:"all",label:"All"},{value:"safe",label:"Safe (0-25)"},{value:"low",label:"Caution (26-55)"},{value:"medium",label:"Suspicious (56-75)"},{value:"high",label:"High risk (76-100)"}],J=l=>{const r=B(l);return{label:r.label,color:r.textClass,bg:r.bgClass,bar:r.barClass,filter:Ne(l)??"all"}},I=l=>{const r=[{regex:/phishing/i,label:"Phishing"},{regex:/investment\s*scam/i,label:"Investment Scam"},{regex:/romance\s*scam/i,label:"Romance Scam"},{regex:/voice\s*clone|ai\s*voice/i,label:"AI Voice Clone"}
2,{regex:/tech\s*support/i,label:"Tech Support"},{regex:/impersonat/i,label:"Impersonation"},{regex:/malware|virus/i,label:"Malware"},{regex:/crypto/i,label:"Crypto Fraud"}];for(const c of r)if(c.regex.test(l))return c.label;return"General Fraud"},Fe=l=>{const r=[],c=l.split(`
3`);for(const f of c){const m=f.replace(/^[-*•]\s*/,"").replace(/\*\*/g,"").trim();if(m.length>15&&m.length<200&&/signal|indicator|suspicious|detected|risk|warning|pattern|scam|fraud/i.test(m)&&(r.push(m),r.length>=4))break}return r};function V(l){return new Date(l).toLocaleDateString("en-CA",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ee(l){const r=Date.now()-l;return r<6e4?"Just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:r<1728e5?"Yesterday":new Date(l).toLocaleDateString("en-CA",{month:"short",day:"numeric"})}function qe({onClose:l}){const[r,c]=d.useState("scans"),[f,m]=d.useState([]),[j,w]=d.useState([]),[_,S]=d.useState(!1),[i,o]=d.useState(""),[p,k]=d.useState("all"),[v,u]=d.useState(null),[$,D]=d.useState(!1),{toast:t}=pe(),{user:s,profile:x,refreshProfile:L}=X(),{open:Te,close:se}=ge();d.useEffect(()=>{x!=null&&x.history_risk_filter&&x.history_risk_filter!==p&&k(x.history_risk_filter)},[x==null?void 0:x.id]);const ae=async a=>{if(k(a),s){const{supabase:n}=await ye(async()=>{const{supabase:h}=await import("./index-DOc5RAp9.js").then(b=>b.bi);return{supabase:h}},__vite__mapDeps([0,1]));await n.from("profiles").update({history_risk_filter:a}).eq("id",s.id),L()}};d.useEffect(()=>{m(G(s==null?void 0:s.id)),K(s==null?void 0:s.id).then(m)},[s==null?void 0:s.id]),d.useEffect(()=>{if(!(s!=null&&s.id))return;let a=!1;return S(!0),T.from("call_sessions").select("id, started_at, ended_at, duration_seconds, final_risk_score, final_risk_level, flags_summary, full_transcript").eq("user_id",s.id).order("started_at",{ascending:!1}).limit(50).then(({data:n,error:h})=>{a||(!h&&n&&w(n),S(!1))}),()=>{a=!0}},[s==null?void 0:s.id]);const te=async a=>{if(!(s!=null&&s.id))return;const{error:n}=await T.from("call_sessions").delete().eq("id",a).eq("user_id",s.id);if(n){t({title:"Could not remove call",variant:"destructive"});return}w(h=>h.filter(b=>b.id!==a)),v===a&&u(null),t({title:"Call removed"})},g=d.useMemo(()=>f.filter(a=>a.riskScore!==null),[f]),M=d.useMemo(()=>{let a=g;if(i){const n=i.toLowerCase();a=a.filter(h=>h.userMessage.toLowerCase().includes(n)||h.response.toLowerCase().includes(n)||I(h.response).toLowerCase().includes(n))}return p!=="all"&&(a=a.filter(n=>J(n.riskScore).filter===p)),a},[g,i,p]),re=a=>{we(a,s==null?void 0:s.id),m(G(s==null?void 0:s.id)),K(s==null?void 0:s.id).then(m),v===a&&u(null),t({title:"Scan removed"})},le=()=>{Se(s==null?void 0:s.id),m([]),u(null),t({title:"All history cleared"})},ie=()=>{const a=["Date,Risk Score,Threat Type,Scanned Content",...M.map(C=>`"${V(C.timestamp)}",${C.riskScore},"${I(C.response)}","${C.userMessage.replace(/"/g,'""')}"`)].join(`
4`),n=new Blob([a],{type:"text/csv"}),h=URL.createObjectURL(n),b=document.createElement("a");b.href=h,b.download=`vraust-scan-history-${new Date().toISOString().split("T")[0]}.csv`,b.click(),URL.revokeObjectURL(h),t({title:"Exported",description:`${M.length} scans exported as CSV`})},ne=g.filter(a=>(a.riskScore??0)>75).length,de=g.filter(a=>(a.riskScore??0)>55&&(a.riskScore??0)<=75).length,ce=g.filter(a=>(a.riskScore??0)<=25).length;return e.jsxs("div",{className:"px-6 py-6 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-1 p-1 rounded-xl bg-white/[0.04] border border-[hsl(var(--dark-border))] w-fit",children:[e.jsxs("button",{onClick:()=>{c("scans"),u(null)},className:`flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-xs font-medium transition-colors ${r==="scans"?"bg-white/[0.08] text-[hsl(var(--dark-fg))]":"text-[hsl(var(--dark-muted))] hover:text-[hsl(var(--dark-fg))]"}`,children:[e.jsx(Q,{className:"h-3.5 w-3.5"}),"Scans",e.jsx("span",{className:"ml-1 text-[10px] tabular-nums opacity-70",children:g.length})]}),e.jsxs("button",{onClick:()=>{c("calls"),u(null)},className:`flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-xs font-medium transition-colors ${r==="calls"?"bg-emerald-500/[0.14] text-emerald-200":"text-[hsl(var(--dark-muted))] hover:text-[hsl(var(--dark-fg))]"}`,children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Calls",e.jsx("span",{className:"ml-1 text-[10px] tabular-nums opacity-70",children:j.length})]}),e.jsxs("button",{onClick:()=>{c("all"),u(null)},className:`flex items-center gap-2 px-3.5 py-1.5 rounded-lg text-xs font-medium transition-colors ${r==="all"?"bg-white/[0.08] text-[hsl(var(--dark-fg))]":"text-[hsl(var(--dark-muted))] hover:text-[hsl(var(--dark-fg))]"}`,children:[e.jsx(U,{className:"h-3.5 w-3.5"}),"All activity"]})]}),r==="all"?e.jsx(Le,{}):r==="calls"?e.jsx(Ie,{calls:j,loading:_,expandedId:v,setExpandedId:u,onDelete:te,onStartNewCall:()=>{se(),window.dispatchEvent(new CustomEvent("vraust:open-call-overlay"))}}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-end justify-between gap-4 flex-wrap",children:[e.jsxs("p",{className:"text-sm text-[hsl(var(--dark-muted))]",children:[g.length," confirmed scan",g.length!==1?"s":""]}),g.length>0&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",size:"sm",onClick:ie,className:"bg-transparent border-[hsl(var(--dark-border))] text-[hsl(var(--dark-fg))] hover:bg-white/5 rounded-lg gap-1.5",children:[e.jsx(fe,{className:"h-3.5 w-3.5"}),"Export CSV"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:le,className:"bg-transparent border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-lg gap-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5"}),"Clear All"]})]})]}),g.length>0&&e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(E,{label:"High Risk",count:ne,color:"bg-[hsl(var(--risk-danger)/0.14)] text-[hsl(var(--risk-danger))]"}),e.jsx(E,{label:"Suspicious",count:de,color:"bg-[hsl(var(--risk-warning)/0.
414)] text-[hsl(var(--risk-warning))]"}),e.jsx(E,{label:"Safe",count:ce,color:"bg-[hsl(var(--risk-safe)/0.14)] text-[hsl(var(--risk-safe))]"})]}),g.length>0&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ve,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[hsl(var(--dark-muted))]"}),e.jsx(be,{value:i,onChange:a=>o(a.target.value),placeholder:"Search scans, threats, content...",className:"h-10 pl-10 bg-white/5 border-[hsl(var(--dark-border))] text-[hsl(var(--dark-fg))] placeholder:text-[hsl(var(--dark-muted))] rounded-lg"}),i&&e.jsx("button",{onClick:()=>o(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-[hsl(var(--dark-muted))] hover:text-[hsl(var(--dark-fg))]",children:e.jsx(je,{className:"h-3.5 w-3.5"})})]}),e.jsxs("button",{onClick:()=>D(!$),className:`flex items-center gap-1.5 px-3 py-2 rounded-lg border text-sm transition-colors ${p!=="all"?"border-white/20 bg-white/[0.06] text-[hsl(var(--dark-fg))]":"border-[hsl(var(--dark-border))] text-[hsl(var(--dark-muted))] hover:bg-white/[0.04]"}`,children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),"Filter"]})]}),e.jsx(P,{children:$&&e.jsx(A.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"flex gap-2 flex-wrap",children:Me.map(a=>e.jsx("button",{onClick:()=>ae(a.value),className:`px-3 py-1.5 rounded-full text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/30 ${p===a.value?"bg-white/10 text-[hsl(var(--dark-fg))]":"bg-white/[0.03] text-[hsl(var(--dark-muted))] hover:bg-white/[0.06]"}`,children:a.label},a.value))})}),M.length>0?e.jsx("div",{className:"space-y-2",children:M.map(a=>{const n=J(a.riskScore),h=I(a.response),b=v===a.id,C=Fe(a.response);return e.jsxs(A.div,{layout:!0,className:"rounded-xl overflow-hidden bg-white/[0.04] border border-[hsl(var(--dark-border))]",children:[e.jsxs("button",{onClick:()=>u(b?null:a.id),className:"w-full flex items-center gap-3 px-4 py-3.5 hover:bg-white/[0.02] transition-colors text-left",children:[e.jsx("div",{className:`h-10 w-10 rounded-lg flex items-center justify-center shrink-0 ${n.bg}`,children:(a.riskScore??0)>50?e.jsx(O,{className:`h-4 w-4 ${n.color}`}):e.jsx(ke,{className:`h-4 w-4 ${n.color}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-[hsl(var(--dark-fg))] truncate",children:a.userMessage||"Attachment scan"}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx("span",{className:"text-xs text-[hsl(var(--dark-muted))]",children:h}),e.jsx("span",{className:"text-[10px] text-[hsl(var(--dark-muted))]",children:"•"}),e.jsx("span",{className:"text-xs text-[hsl(var(--dark-muted))]",children:ee(a.timestamp)})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:`text-lg font-bold ${n.color}`,children:a.riskScore}),e.jsx("span",{className:"text-xs text-[hsl(var(--dark-muted))]",children:"/100"})]}),b?e.jsx(Y,{className:"h-4 w-4 text-[hsl(var(--dark-muted))]"}):e.jsx(Z,{className:"h-4 w-4 text-[hsl(var(--dark-muted))]"})]})]}),e.jsx(P,{children:b&&e.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:e.jsxs("div",{className:"px-4 pb-4 pt-1 border-t border-[hsl(var(--dark-border))]",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1.5",children:[e.jsx("span",{className:"text-[hsl(var(--dark-muted))]",children:"Risk Level"}),e.jsx("span",{className:`font-medium ${n.color}`,children:n.label})]}),e.jsx("div",{className:"h-2 rounded-full bg-white/5 overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${n.bar}`,style:{width:`${a.riskScore??0}%`}})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsx(N,{icon:q,label:"Scanned",value:V(a.timestamp)}),e.jsx(N,{icon:Q,label:"Type",value:h}),e.jsx(N,{icon:H,label:"Risk Score",value:`${a.riskScore}/100`}),e.jsx(N,{icon:O,label:"Classification",value:n.label})]}),C.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs font-medium text-[hsl(var(--dark-fg))] mb-2",children:"Key Findings"}),e.jsx("ul",{className:"space-y-1.5",children:C.map((oe,xe)=>e.jsxs("li",{className:"flex items-start gap-2 text-xs text-[hsl(var(--dark-muted))]",children:[e.jsx("div",{className:"h-1 w-1 rounded-full bg-[hsl(var(--dark-muted))] mt-1.5 shrink-0"}),oe]},xe))})]}),a.userMessage&&e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-xs font-medium text-[hsl(var(--dark-fg))] mb-1.5",children:"Scanned Content"}),e.jsx("div",{className:"p-3 rounded-lg bg-white/[0.03] border border-[hsl(var(--dark-border))]",children:e.jsx("p",{className:"text-xs text-[hsl(var(--dark-muted))] whitespace-pre-wrap line-clamp-4",children:a.userMessage})})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>re(a.id),className:"bg-transparent border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-lg gap-1.5",children:[e.jsx(z,{className:"h-3 w-3"}),"Remove"]})})]})})})]},a.id)})}):g.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(H,{className:"h-10 w-10 mx-auto mb-3 text-[hsl(var(--dark-muted))] opacity-40"}),e.jsx("p",{className:"text-sm text-[hsl(var(--dark-fg))] mb-1",children:"No scans yet"}),e.jsx("p",{className:"text-xs text-[hsl(var(--dark-muted))]",children:"Start scanning to build your protection history."})]}):e.jsx("div",{className:"py-12 text-center text-sm text-[hsl(var(--dark-muted))]",children:"No scans match your filters."})]})]})}function E({label:l,count:r,color:c}){return e.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium ${c}`,children:[e.jsx("span",{children:l}),e.jsx("span",{className:"opacity-80",children:r})]})}function N({icon:l,label:r,value:c}){return e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(l,{className:"h-3.5 w-3.5 text-[hsl(var(--dark-muted))] mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--dark-muted))]",children:r}),e.jsx("p",{className:"text-xs text-[hsl(var(--dark-fg))] truncate",children:c})]})]})}function W(l){if(!l||l<=0)return",";const r=Math.floor(l/60),c=String(l%60).padStart(2,"0");return`${r}:${c}`}function Ie({calls:l,loading:r,expandedId:c,setExpandedId:f,onDelete:m,onStartNewCall:j}){if(r)return e.jsx("div",{className:"py-16 text-center text-sm text-[hsl(var(--dark-muted))]",children:"Loading c
4alls…"});if(l.length===0)return e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(R,{className:"h-10 w-10 mx-auto mb-3 text-[hsl(var(--dark-muted))] opacity-40"}),e.jsx("p",{className:"text-sm text-[hsl(var(--dark-fg))] mb-1",children:"No calls yet"}),e.jsx("p",{className:"text-xs text-[hsl(var(--dark-muted))] mb-4",children:"Start a live Vraust Call session to log it here."}),e.jsxs(y,{onClick:j,size:"sm",className:"bg-emerald-500/15 border border-emerald-500/30 text-emerald-200 hover:bg-emerald-500/25 rounded-lg gap-1.5",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Start Vrausting"]})]});const w=l.filter(i=>(i.final_risk_score??0)>=76).length,_=l.filter(i=>{const o=i.final_risk_score??0;return o>=56&&o<=75}).length,S=l.filter(i=>(i.final_risk_score??0)<=25).length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-end justify-between gap-3 flex-wrap",children:[e.jsxs("p",{className:"text-sm text-[hsl(var(--dark-muted))]",children:[l.length," call",l.length!==1?"s":""," analyzed"]}),e.jsxs(y,{onClick:j,size:"sm",className:"bg-emerald-500/15 border border-emerald-500/30 text-emerald-200 hover:bg-emerald-500/25 rounded-lg gap-1.5",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Start Vrausting"]})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(E,{label:"High Risk",count:w,color:"bg-[hsl(var(--risk-danger)/0.14)] text-[hsl(var(--risk-danger))]"}),e.jsx(E,{label:"Suspicious",count:_,color:"bg-[hsl(var(--risk-warning)/0.14)] text-[hsl(var(--risk-warning))]"}),e.jsx(E,{label:"Safe",count:S,color:"bg-[hsl(var(--risk-safe)/0.14)] text-[hsl(var(--risk-safe))]"})]}),e.jsx("div",{className:"space-y-2",children:l.map(i=>{const o=B(i.final_risk_score),p=c===i.id,k=new Date(i.started_at).getTime(),v=!!i.ended_at;return e.jsxs(A.div,{layout:!0,className:"rounded-xl overflow-hidden bg-white/[0.04] border border-[hsl(var(--dark-border))]",children:[e.jsxs("button",{onClick:()=>f(p?null:i.id),className:"w-full flex items-center gap-3 px-4 py-3.5 hover:bg-white/[0.02] transition-colors text-left",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${o.hex}26`},children:v?e.jsx(Ce,{className:"h-4 w-4",style:{color:o.hex}}):e.jsx(R,{className:"h-4 w-4",style:{color:o.hex}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm text-[hsl(var(--dark-fg))] truncate",children:[v?"Call analyzed":"Call in progress",e.jsxs("span",{className:"ml-2 text-xs text-[hsl(var(--dark-muted))]",children:["· ",W(i.duration_seconds)]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx("span",{className:"text-xs",style:{color:o.hex},children:o.label}),e.jsx("span",{className:"text-[10px] text-[hsl(var(--dark-muted))]",children:"•"}),e.jsx("span",{className:"text-xs text-[hsl(var(--dark-muted))]",children:ee(k)})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"text-right",children:[e.jsx("span",{className:"text-lg font-bold",style:{color:o.hex},children:i.final_risk_score??","}),e.jsx("span",{className:"text-xs text-[hsl(var(--dark-muted))]",children:"/100"})]}),p?e.jsx(Y,{className:"h-4 w-4 text-[hsl(var(--dark-muted))]"}):e.jsx(Z,{className:"h-4 w-4 text-[hsl(var(--dark-muted))]"})]})]}),e.jsx(P,{children:p&&e.jsx(A.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:e.jsxs("div",{className:"px-4 pb-4 pt-1 border-t border-[hsl(var(--dark-border))] space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(N,{icon:q,label:"Started",value:V(k)}),e.jsx(N,{icon:q,label:"Duration",value:W(i.duration_seconds)}),e.jsx(N,{icon:H,label:"Risk Score",value:`${i.final_risk_score??","}/100`}),e.jsx(N,{icon:O,label:"Verdict",value:o.label})]}),i.flags_summary&&i.flags_summary.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-[hsl(var(--dark-fg))] mb-2",children:"Detected signals"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.flags_summary.map((u,$)=>e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[11px] bg-white/[0.04] border border-[hsl(var(--dark-border))] text-[hsl(var(--dark-fg))]/85",children:u},$))})]}),i.full_transcript&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-[hsl(var(--dark-fg))] mb-1.5",children:"Transcript"}),e.jsx("div",{className:"p-3 rounded-lg bg-white/[0.03] border border-[hsl(var(--dark-border))] max-h-60 overflow-y-auto",children:e.jsx("p",{className:"text-xs text-[hsl(var(--dark-muted))] whitespace-pre-wrap",children:i.full_transcript})})]}),e.jsx("div",{className:"flex gap-2 pt-1",children:e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>m(i.id),className:"bg-transparent border-red-400/20 text-red-400 hover:bg-red-400/10 rounded-lg gap-1.5",children:[e.jsx(z,{className:"h-3 w-3"}),"Remove"]})})]})})})]},i.id)})})]})}export{qe 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.