PageSourceSearch

https://socialloop.ai/_next/static/chunks/6452.05d9c7fcf6fc3739.js

js socialloop.ai collected 2026-10-05 12:47:03 UTC 2,706 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6452],{86452:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var s=a(95155),l=a(12115),n=a(10639),r=a(55619);let c={draft:"Draft",preparing:"Counting audience",ready:"Audience prepared",scheduled:"Scheduled",sending:"Sending",sent:"Sent",completed:"Sent",canceled:"Stopped",cancelled:"Stopped",failed:"Failed"};function i(e){let{value:t,onChange:a,label:i}=e,d=(0,n.Kg)(),u=(0,l.useRef)(0),[o,m]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),[x,b]=(0,l.useState)([]),[g,j]=(0,l.useState)(null),[f,k]=(0,l.useState)(!1),[N,S]=(0,l.useState)("");(0,l.useEffect)(()=>{let e=++u.current;return m(""),b([]),j(null),p(!1),S(""),k(!1),t&&d("get",{campaignId:t}).then(t=>{u.current===e&&m(t.campaign.name||t.campaign.subject||"Selected campaign")}).catch(()=>{u.current===e&&S("The selected email history is unavailable. Choose another campaign.")}),()=>{u.current++}},[d,t]);let w=async e=>{let t=u.current;k(!0),S("");try{let a=await d("list",{...e&&{cursor:e}});if(u.current!==t)return;b(t=>[...e?t:[],...a.campaigns.filter(e=>2===e.schemaVersion)]),j(a.nextCursor)}catch(e){u.current===t&&S(e.message)}finally{u.current===t&&k(!1)}};return(0,s.jsxs)("div",{className:"min-w-0 text-sm",children:[(0,s.jsx)("button",{type:"button","aria-label":i,className:"rounded-lg border border-white/15 p-2 max-w-full text-left break-words",onClick:()=>{p(!0),w()},children:o||(t?"Selected campaign":"Choose an earlier campaign")}),N&&!h&&(0,s.jsx)("p",{role:"alert",className:"text-xs mt-2",children:N}),h&&(0,s.jsx)(r.A,{title:"Choose email history",onClose:()=>p(!1),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-t2",children:"Pick an email this workspace sent. People who weren’t sent it count as unknown."}),x.map(e=>{let t;return(0,s.jsxs)("button",{className:"block text-left w-full rounded-xl border border-white/10 p-4",onClick:()=>{a(e.id),p(!1)},children:[(0,s.jsx)("strong",{className:"block",children:e.name||e.subject||"Untitled email"}),(0,s.jsxs)("span",{className:"text-xs text-t2",children:[(t=e.status)?c[t]||(t.charAt(0).toUpperCase()+t.slice(1)).replaceAll("_"," "):"Draft",e.subject&&e.name!==e.subject?" \xb7 ".concat(e.subject):""]})]},e.id)}),!x.length&&!f&&!N&&(0,s.jsx)("p",{className:"text-sm text-t2",children:"No earlier emails yet."}),f&&(0,s.jsx)("p",{role:"status",children:"Loading emails…"}),N&&(0,s.jsx)("p",{role:"alert",children:N}),g&&(0,s.jsx)("button",{disabled:f,className:"text-sm underline",onClick:()=>void w(g),children:"Load more emails"}),N&&(0,s.jsx)("button",{disabled:f,className:"text-sm underline",onClick:()=>void w(),children:"Try again"})]})})]})}}}]);

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.