PageSourceSearch

https://gigaboost.ai/assets/trial-nurture-Dzt2p8lv.js

js gigaboost.ai collected 2026-10-05 12:01:30 UTC 9,827 bytes, 1 lines download raw bytes

1import{a as n,j as e}from"./vendor-query-DhjOgUDD.js";import{g as T}from"./index-4ZDWxsof.js";import{A as H}from"./layout-B01QTP-e.js";import{r as O,v as A,ab as X,p as I,n as Y,k as z}from"./vendor-icons-443ez2nG.js";import"./vendor-radix-Bi3hcZEw.js";import"./vendor-router-BMMoSqdB.js";import"./vendor-motion-BL_E91F5.js";const U={connect:"Connection note",comment:"Comment on post",dm:"DM",winback:"Winback note"},J=200,_=t=>new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric"}),l="rgba(255,255,255,0.45)",p="rgba(255,255,255,0.3)",m="rgba(255,255,255,0.08)",N="#CFFE25",K={live:{label:"Live",bg:"rgba(207,254,37,0.12)",fg:N},cancelling:{label:"Cancelling",bg:"rgba(251,191,36,0.14)",fg:"#fbbf24"},ended:{label:"Cancelled",bg:"rgba(248,113,113,0.14)",fg:"#f87171"}},Q=[{key:"approved",label:"Drafts approved"},{key:"extensionSeen",label:"Extension"},{key:"domainConnected",label:"Domain"},{key:"working",label:"Active 48h"},{key:"replied",label:"Investor replied"},{key:"dataRoomIncomplete",label:"Data room complete",invert:!0}];function V({on:t,label:f}){return e.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-full whitespace-nowrap",style:t?{background:"rgba(74,222,128,0.14)",color:"#4ade80"}:{background:"rgba(255,255,255,0.05)",color:p},children:[t?"✓ ":"",f]})}function F({t,onSent:f}){const[r,$]=n.useState(t.today.step??(t.status==="ended"?"winback":"dm")),[o,u]=n.useState(""),[x,y]=n.useState(null),[g,b]=n.useState(null),[i,a]=n.useState(!1),[h,k]=n.useState(!1),[v,d]=n.useState(!1),[D,w]=n.useState(null),S=K[t.status],R=s=>{$(s),u(""),y(null),b(null),w(null)},E=async()=>{a(!0),w(null),b(null);try{const c=await(await T("POST",`/api/admin/trial-nurture/${t.id}/draft`,{step:r})).json();y(c?.post??null),c?.draft?u(c.draft):b(c?.note||c?.error||"No draft came back.")}catch(s){w(s?.message||"Couldn't draft that.")}a(!1)},M=async()=>{try{await navigator.clipboard.writeText(o),k(!0),setTimeout(()=>k(!1),1600)}catch{}},P=async()=>{d(!0),w(null);try{await T("POST",`/api/admin/trial-nurture/${t.id}/sent`,{step:r,message:o}),f(t.id,r),u(""),y(null)}catch(s){w(s?.message||"Couldn't record it.")}d(!1)}
1,B=t.name||t.email||"Unknown founder",L=[t.company,t.industry,t.stage,t.raising&&`raising ${t.raising}`].filter(Boolean).join(" · "),W=t.status==="ended"?"Trial cancelled":`Day ${t.day??"?"}${t.daysLeft!=null?` · ${t.daysLeft} day${t.daysLeft===1?"":"s"} left`:""}`,j=r==="connect"?J:null,q=t.status==="ended"?["winback"]:["connect","comment","dm"],G=s=>s==="dm"?t.sent.dm:t.sent[s];return e.jsxs("div",{className:"rounded-xl border p-5 space-y-4",style:{borderColor:m,background:"rgba(255,255,255,0.02)"},"data-testid":`trial-${t.id}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-base font-semibold text-white",children:B}),e.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded-full font-medium",style:{background:S.bg,color:S.fg},children:S.label}),e.jsx("span",{className:"text-xs",style:{color:l},children:W})]}),L&&e.jsx("div",{className:"text-sm mt-1",style:{color:l},children:L}),t.email&&t.name&&e.jsx("div",{className:"text-xs mt-0.5",style:{color:p},children:t.email})]}),t.linkedinUrl?e.jsxs("a",{href:t.linkedinUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-medium",style:{color:N},"data-testid":`link-linkedin-${t.id}`,children:["LinkedIn profile ",e.jsx(A,{className:"h-3.5 w-3.5"})]}):e.jsxs("a",{href:t.linkedinSearchUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-sm",style:{color:l},"data-testid":`link-linkedin-search-${t.id}`,children:[e.jsx(X,{className:"h-3.5 w-3.5"})," No profile given — search LinkedIn"]})]}),e.jsxs("div",{className:"rounded-lg px-4 py-3",style:{background:t.today.step?"rgba(207,254,37,0.08)":"rgba(255,255,255,0.03)",border:`1px solid ${t.today.step?"rgba(207,254,37,0.25)":m}`},"data-testid":`today-${t.id}`,children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"font-semibold",style:{color:t.today.step?N:l},children:"Today:"})," ",e.jsx("span",{className:"text-white font-medium",children:t.today.label})]}),e.jsx("div",{className:"text-xs mt-1",style:{color:l},children:t.today.detail})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Q.map(s=>e.jsx(V,{label:s.label,on:s.invert?!t.facts[s.key]:t.facts[s.key]},s.key))}),e.jsxs("div",{className:"text-sm text-white/80",children:[e.jsx("span",{style:{color:l},children:"Where they're stuck:"})," ",t.nextStep]}),e.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist",children:q.map(s=>{const c=G(s),C=s===r;return e.jsxs("button",{role:"tab","aria-selected":C,onClick:()=>R(s),className:"text-xs px-3 py-1.5 rounded-lg inline-flex items-center gap-1.5",style:{border:`1px solid ${C?N:m}`,color:C?"#fff":l,background:C?"rgba(207,254,37,0.06)":"transparent"},"data-testid":`step-${s}-${t.id}`,children:[c&&e.jsx(I,{className:"h-3 w-3",style:{color:"#4ade80"}}),U[s],c&&e.jsxs("span",{style:{color:p},children:[s==="dm"&&t.sent.dmCount>1?`×${t.sent.dmCount}, last `:"",_(c)]})]},s)})}),x&&e.jsxs("div",{className:"rounded-lg px-3 py-2.5 text-sm",style:{background:"rgba(255,255,255,0.03)",border:`1px solid ${m}`},"data-testid":`post-${t.id}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[e.jsxs("span",{className:"text-xs",style:{color:p},children:["Their latest post",x.postedAt?` · ${_(x.postedAt)}`:""]}),e.jsxs("a",{href:x.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs",style:{color:N},children:["Open post ",e.jsx(A,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"text-white/75 whitespace-pre-line line-clamp-4",children:x.content})]}),g&&e.jsx("div",{className:"text-sm",style:{color:l},children:g}),o?e.jsxs("div",{className:"space-y-2",children:[e.jsx("textarea",{value:o,onChange:s=>u(s.target.value),rows:4,className:"w-full rounded-lg px-3 py-2 text-sm text-white outline-none focus:ring-1",style:{background:"rgba(255,255,255,0.04)",border:`1px solid ${m}`},"data-testid":`textarea-draft-${t.id}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-xs mr-auto tabular-nums",style:{color:j&&o.length>j?"#fbbf24":p},children:[o.length,j?`/${j}`:" characters",j&&o.length>j?" — too long for a connection note":""]}),e.jsx("button",{onClick:E,disabled:i,className:"text-xs px-3 py-1.5 rounded-lg",style:{color:l,border:`1px solid ${m}`},"data-testid":`button-redraft-${t.id}`,children:i?"Drafting…":"Redraft"}),e.jsxs("button",{onClick:M,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg text-white",style:{border:`1px solid ${m}`},"data-testid":`button-copy-${t.id}`,children:[h?e.jsx(I,{className:"h-3.5 w-3.5"}):e.jsx(Y,{className:"h-3.5 w-3.5"})," ",h?"Copied":"Copy"]}),e.jsx("button",{onClick:P,disabled:v,className:"text-xs px-3 py-1.5 rounded-lg font-semibold",style:{background:N,color:"#0C0C0
1F"},"data-testid":`button-mark-sent-${t.id}`,children:v?"Saving…":r==="comment"?"I posted it":"I sent it"})]})]}):e.jsxs("button",{onClick:E,disabled:i,className:"inline-flex items-center gap-2 text-sm px-4 py-2 rounded-lg font-medium text-white",style:{border:`1px solid ${m}`},"data-testid":`button-draft-${t.id}`,children:[i?e.jsx(O,{className:"h-4 w-4 animate-spin"}):e.jsx(z,{className:"h-4 w-4"}),i?r==="comment"?"Reading their posts…":"Drafting…":`Draft the ${U[r].toLowerCase()}`]}),D&&e.jsx("div",{className:"text-xs",style:{color:"#f87171"},children:D})]})}function re(){const[t,f]=n.useState([]),[r,$]=n.useState(!0),[o,u]=n.useState(null),x=()=>T("GET","/api/admin/trial-nurture").then(a=>a.json()).then(a=>{f(a.trials??[]),u(null)}).catch(a=>u(a?.message||"Couldn't load trials.")).finally(()=>$(!1));n.useEffect(()=>{x()},[]);const y=(a,h)=>{const k=new Date().toISOString();f(v=>v.map(d=>d.id!==a?d:{...d,sent:h==="dm"?{...d.sent,dm:k,dmCount:d.sent.dmCount+1}:{...d.sent,[h]:k}})),x()},g=t.filter(a=>a.status!=="ended").sort((a,h)=>+!!h.today.step-+!!a.today.step),b=t.filter(a=>a.today.step).length,i=t.filter(a=>a.status==="ended");return e.jsx(H,{children:e.jsxs("div",{className:"p-6 space-y-6 max-w-4xl",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-white",children:"Trial nurture"}),e.jsx("div",{className:"text-sm mt-1 max-w-2xl",style:{color:l},children:"Everyone on the $1 trial, plus trials cancelled in the last 7 days. Each founder has a plan: connect on day 0, comment on their latest post on day 1–2, DM from day 3. Draft it here, send it from your own LinkedIn, then mark it done. Nothing here sends automatically."})]}),r?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(O,{className:"h-6 w-6 animate-spin",style:{color:p}})}):o?e.jsx("div",{className:"text-sm",style:{color:"#f87171"},children:o}):t.length===0?e.jsx("div",{className:"rounded-xl border px-6 py-12 text-center text-sm",style:{borderColor:m,color:l},children:"No one is on a trial right now. New $1 trials show up here the moment they pay."}):e.jsxs(e.Fragment,{children:[g.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:p},children:["On trial · ",g.length,b?` · ${b} to touch today`:""]}),g.map(a=>e.jsx(F,{t:a,onSent:y},a.id))]}),i.length>0&&e.jsxs("section",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:p},children:["Recently cancelled · ",i.length]}),i.map(a=>e.jsx(F,{t:a,onSent:y},a.id))]})]})]})})}export{re 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.