1import{r as i,m as g,j as e,g as j,k as y,l as ne,I as V,bk as ae,T as B,bl as ie,ak as re}from"./index-u0HMC9Vb.js";import{S as O,a as U,b as W,c as _,d as Y}from"./select-Eu3KdeOX.js";import"./index-DcEnTV8H.js";import"./index-BegspP2X.js";function me(){var F,M,H;const[o,$]=i.useState(""),[p,q]=i.useState("TRESDA â We're Beginning Again"),[S,N]=i.useState(!1),[w,l]=i.useState(null),[T,r]=i.useState(null),[c,G]=i.useState([]),[s,k]=i.useState(""),[u,A]=i.useState(!1),[f,C]=i.useState(!1),[h,E]=i.useState(""),[R,I]=i.useState(!1),[b,J]=i.useState("");i.useEffect(()=>{L()},[]);const L=async()=>{var t;A(!0);try{const a=await g.functions.invoke("getResendAudiences",{});G(((t=a.data)==null?void 0:t.audiences)||[])}catch{r("Could not fetch audiences.")}finally{A(!1)}},K=async t=>{var n;const a=(n=t.target.files)==null?void 0:n[0];if(!a||!s){r("Please select an audience and choose a CSV file");return}C(!0),r(null),l(null);try{const x=(await a.text()).split(` 2`),Z=x[0].split(",").map(m=>m.trim()),P=[];for(let m=1;m<x.length;m++){if(!x[m].trim())continue;const te=x[m].split(",").map(v=>v.trim()),z={};Z.forEach((v,se)=>{z[v]=te[se]}),P.push(z)}const ee=await g.functions.invoke("importResendContacts",{contacts:P,audience_id:s});l(ee.data),await L()}catch(d){r(d.message||"Failed to import contacts")}finally{C(!1)}},D=` 3<!DOCTYPE html> 4<html> 5<head> 6 <meta charset="utf-8"> 7 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 8 <style> 9 body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.6; color: #333; } 10 .container { max-width: 600px; margin: 0 auto; padding: 40px 20px; } 11 .header { margin-bottom: 40px; } 12 .logo { font-size: 24px; font-weight: 600; margin-bottom: 30px; } 13 .content { margin-bottom: 40px; } 14 .content p { margin-bottom: 20px; } 15 .content strong { font-weight: 600; } 16 .section-title { font-size: 16px; font-weight: 600; margin-top: 30px; margin-bottom: 12px; } 17 .section-desc { font-size: 14px; color: #666; margin-bottom: 20px; } 18 .cta-button { display: inline-block; background: #000; color: white; padding: 14px 32px; text-decoration: none; margin: 30px 0; border-radius: 4px; font-weight: 500; } 19 .footer { border-top: 1px solid #eee; padding-top: 30px; margin-top: 50px; font-size: 13px; color: #999; } 20 .footer a { color: #0066cc; text-decoration: none; } 21 </style> 22</head> 23<body> 24 <div class="container"> 25 <div class="header"> 26 <div class="logo">TRESDA</div> 27 <p style="font-size: 14px; color: #666; margin: 0;">Institute of Creative Identity</p> 28 </div> 29 30 <div class="content"> 31 <p>Hi,</p> 32 33 <p>It has been a while since you last heard from us, so we wanted to begin again with clarity.</p> 34 35 <p><strong>TRESDA is the Institute of Creative Identity.</strong></p> 36 37 <p>We are building a new standard for creative process, created to help creatives define, document and protect the thinking behind their work.</p> 38 39 <p><strong>This work matters because the creative world is changing.</strong></p> 40 41 <p>As AI continues to reshape how images, concepts and outputs are produced, the final result can no longer be the only thing that carries value. The process behind the work will become increasingly important. The references gathered, the decisions made, the iterations explored, the identity behind the direction and the reasoning that led to the final outcome.</p> 42 43 <p><strong>That is where TRESDA begins.</strong></p> 44 45 <p>Our mission is to standardise creative process as a form of proof. A way to protect authorship, defend originality and give structure to the invisible thinking that often goes unseen in creative work.</p> 46 47 <p><strong>We are still at the beginning.</strong></p> 48 49 <p>Inside TRESDA is the first environment we are building to support this mission. It brings together three connected parts of our ecosystem:</p> 50 51 <div style="margin: 30px 0; padding: 20px; background: #f9f9f9; border-radius: 4px;"> 52 <div class="section-title">Trace</div> 53 <div class="section-desc">A tool for capturing your creative process as it evolves, from early ideas and references to decisions, iterations and project development.</div> 54 55 <div class="section-title">Studio</div> 56 <div class="section-desc">A developmental space for understanding your creative identity and learning how your thinking becomes direction, language and work.</div> 57 58 <div class="section-title">Residency</div> 59 <div class="section-desc">An application space for turning identity, process and research into more complete cultural and spatial proposals.</div> 60 </div> 61 62 <p><strong>This is not the full extent of what TRESDA will become. It is the foundation.</strong></p> 63 64 <p>
64By joining now, you are entering at the beginning of an infrastructure being built for an AI-shaped creative world, one where process, authorship and identity will matter more than ever.</p> 65 66 <a href="https://inside.tresda.institute" class="cta-button">Enter Inside TRESDA</a> 67 68 <p>Thank you for being here early.</p> 69 70 <p>TRESDA<br/>Institute of Creative Identity</p> 71 72 <div class="footer"> 73 <p>You are receiving this because you signed up to hear from TRESDA.</p> 74 <p><a href="{{unsubscribe_url}}">Unsubscribe</a></p> 75 </div> 76 </div> 77 </div> 78</body> 79</html> 80 `.trim(),Q=async()=>{if(!h){r("Please enter a test email address");return}I(!0),r(null),l(null);try{const t=await g.functions.invoke("sendTestEmail",{to_email:h,subject:p,html:b||D});l({success:!0,message:`Test email sent to ${h}`}),E("")}catch(t){r(t.message||"Failed to send test email")}finally{I(!1)}},X=async()=>{var a;let t=[];if(s){const n=c.find(d=>d.id===s);t=((a=n==null?void 0:n.contacts)==null?void 0:a.map(d=>d.email))||[]}else t=o.split(` 81`).map(n=>n.trim()).filter(n=>n&&n.includes("@"));if(t.length===0){r("Please select an audience or enter at least one email address");return}N(!0),r(null),l(null);try{const n=await g.functions.invoke("sendReintroductionEmail",{emails:t,subject:p,html:b||D});l(n.data)}catch(n){r(n.message||"Failed to send emails")}finally{N(!1)}};return e.jsx("div",{className:"min-h-screen bg-background p-6",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold text-foreground mb-2",children:"Send Reintroduction Campaign"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Send the TRESDA reintroduction email to your Resend audience"})]}),e.jsxs("div",{className:"space-y-6 bg-card rounded-lg border border-border p-6",children:[e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 border border-border/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-3",children:"Step 1: Import Contacts"}),e.jsxs("div",{className:"flex gap-3 items-end",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"block text-xs font-medium text-foreground mb-2",children:"Select Audience"}),e.jsxs(O,{value:s,onValueChange:k,children:[e.jsx(U,{disabled:u,children:e.jsx(W,{placeholder:u?"Loading...":"Choose audience"})}),e.jsx(_,{children:c.map(t=>{var a;return e.jsxs(Y,{value:t.id,children:[t.name," (",((a=t.contacts)==null?void 0:a.length)||0,")"]},t.id)})})]})]}),e.jsxs("label",{className:"relative",children:[e.jsx("input",{type:"file",accept:".csv",onChange:K,disabled:!s||f,className:"hidden"}),e.jsx(j,{asChild:!0,disabled:!s||f,variant:"outline",className:"cursor-pointer",children:e.jsx("span",{children:f?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2 animate-spin"}),"Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-4 h-4 mr-2"}),"Upload CSV"]})})})]})]})]}),e.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-3",children:"Test Email Preview"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(V,{type:"email",value:h,onChange:t=>E(t.target.value),placeholder:"[email protected]"}),e.jsx(j,{onClick:Q,disabled:R||!h,variant:"outline",children:R?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),"Send Test"]})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email Subject"}),e.jsx(V,{value:p,onChange:t=>q(t.target.value),placeholder:"Email subject..."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email Content (HTML)"}),e.jsx(B,{value:b,onChange:t=>J(t.target.value),placeholder:"Paste your custom HTML here, or leave blank to use the default template...",className:"h-80 font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Leave empty to use the default TRESDA reintroduction template"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Or select a Resend Audience"}),e.jsxs(O,{value:s,onValueChange:k,children:[e.jsx(U,{disabled:u,children:e.jsx(W,{placeholder:u?"Loading audiences...":"Select an audie
81nce"})}),e.jsx(_,{children:c.map(t=>{var a;return e.jsxs(Y,{value:t.id,children:[t.name," (",((a=t.contacts)==null?void 0:a.length)||0," contacts)"]},t.id)})})]}),c.length===0&&!u&&e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"No audiences found. Enter emails manually below."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Or paste Email Addresses (one per line)"}),e.jsx(B,{value:o,onChange:t=>$(t.target.value),placeholder:`[email protected] 82[email protected] 83[email protected]`,className:"h-64 font-mono text-xs",disabled:!!s}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[o.split(` 84`).filter(t=>t.trim()&&t.includes("@")).length," valid email(s)"]})]}),T&&e.jsxs("div",{className:"bg-destructive/10 border border-destructive/30 rounded-lg p-4 flex gap-3",children:[e.jsx(ie,{className:"w-5 h-5 text-destructive flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-destructive",children:"Error"}),e.jsx("p",{className:"text-sm text-destructive/80",children:T})]})]}),w&&e.jsxs("div",{className:"bg-success/10 border border-success/30 rounded-lg p-4 flex gap-3",children:[e.jsx(re,{className:"w-5 h-5 text-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-success",children:"Success"}),e.jsx("p",{className:"text-sm text-success/80",children:w.message})]})]}),(s||o.trim())&&e.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 border border-border/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-2",children:"Send Summary"}),s&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Audience: ",e.jsx("span",{className:"font-semibold text-foreground",children:(F=c.find(t=>t.id===s))==null?void 0:F.name})," (",((H=(M=c.find(t=>t.id===s))==null?void 0:M.contacts)==null?void 0:H.length)||0," contacts)"]}),!s&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Recipients: ",e.jsxs("span",{className:"font-semibold text-foreground",children:[o.split(` 85`).filter(t=>t.trim()&&t.includes("@")).length," email(s)"]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Subject: ",e.jsx("span",{className:"font-semibold text-foreground",children:p})]})]}),e.jsx("div",{className:"flex gap-3",children:e.jsx(j,{onClick:X,disabled:S||!s&&!o.trim(),className:"w-full",children:S?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):"Send Campaign"})})]})]})})}export{me 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.