1import{r as d,cu as o,j as e,F as i,c as n,aQ as u,a7 as x,aN as c,i as m,x as r,aF as h,ad as f,l as p,y as j}from"./index-Cm2t7kDb.js";function N({type:s}){switch(s){case"form":return e.jsx(i,{className:"h-4 w-4"});case"envelope":return e.jsx(x,{className:"h-4 w-4"});case"cma":return e.jsx(f,{className:"h-4 w-4"});case"email":return e.jsx(m,{className:"h-4 w-4"});case"workflow":return e.jsx(h,{className:"h-4 w-4"});case"document":return e.jsx(i,{className:"h-4 w-4"})}}function g({status:s}){switch(s){case"sent":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[e.jsx(r,{className:"h-2.5 w-2.5"})," Sent"]});case"signed":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[e.jsx(r,{className:"h-2.5 w-2.5"})," Signed"]});case"filled":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-blue-700 dark:text-blue-400",children:[e.jsx(r,{className:"h-2.5 w-2.5"})," Filled"]});case"generated":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-violet-700 dark:text-violet-400",children:[e.jsx(r,{className:"h-2.5 w-2.5"})," Generated"]});case"completed":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-green-700 dark:text-green-400",children:[e.jsx(r,{className:"h-2.5 w-2.5"})," Complete"]});case"draft":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-400",children:[e.jsx(j,{className:"h-2.5 w-2.5"})," Draft"]});case"failed":return e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] font-medium text-red-700 dark:text-red-400",children:[e.jsx(p,{className:"h-2.5 w-2.5"})," Failed"]})}}function w(s){const t=Date.now()-s,a=Math.floor(t/6e4);if(a<1)return"Just now";if(a<60)return`${a}m ago`;const l=Math.floor(a/60);return l<24?`${l}h ago`:new Date(s).toLocaleDateString()}function y({messages:s,onSendPrompt:t}){const a=d.useMemo(()=>o(s),[s]);return a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-8 space-y-3",children:[e.jsx(i,{className:"h-10 w-10 text-muted-foreground/30"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No documents yet"}),e.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Forms, envelopes, CMAs, and other documents generated during this conversation will appear here."})]})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"px-4 py-2.5 border-b flex-shrink-0 flex items-center justify-between",children:e.jsxs("p",{className:"text-xs font-semibold text-foreground",children:["Documents (",a.length,")"]})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e.jsx("div",{className:"p-3 space-y-2",children:a.map(l=>e.jsx(v,{doc:l,onSendPrompt:t},l.toolCallId))})})]})}function v({doc:s,onSendPrompt:t}){return e.jsxs("div",{className:"rounded-lg border border-border/60 bg-background p-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground",children:e.jsx(N,{type:s.type})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:s.name}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate mt-0.5",children:s.detail}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(g,{status:s.status}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:w(s.createdAt)})]})]})]}),e.jsxs("div",{className:"flex gap-1.5 mt-2.5 ml-10",children:[s.downloadUrl&&e.jsx("a",{href:s.downloadUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",children:[e.jsx(u,{className:"mr-0.5 h-2.5 w-2.5"})," Download"]})}),s.type==="form"&&t&&e.jsxs(e.Fragment,{children:[e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>t(`Send ${s.name} to my client`),children:[e.jsx(x,{className:"mr-0.5 h-2.5 w-2.5"})," Send"]}),e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>t(`Review the fields filled in ${s.name}`),children:[e.jsx(c,{className:"mr-0.5 h-2.5 w-2.5"})," Review"]})]}),s.type==="envelope"&&s.status==="draft"&&t&&e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>t(`Send ${s.name} to recipients for signing`),children:[e.jsx(x,{className:"mr-0.5 h-2.5 w-2.5"})," Send for Signing"]}),s.type==="envelope"&&s.status==="sent"&&t&&e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>t(`Check the signing status of ${s.name}`),children:[e.jsx(c,{className:"mr-0.5 h-2.5 w-2.5"})," Check Status"]}),s.type==="cma"&&t&&e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>t("Email the CMA report to my client"),children:[e.jsx(m,{className:"mr-0.5 h-2.5 w-2.5"})," Email"]}),s.type==="email"&&e.jsxs(n,{variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",disabled:!0,children:[e.jsx(r,{className:"mr-0.5 h-2.5 w-2.5"})," Delivered"]})]})]})}export{y as DocumentsPanel,o as extractDocuments};
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.