PageSourceSearch

https://flightscan.com/build/assets/Index-DlP4RSoB.js

js flightscan.com collected 2026-09-25 11:09:28 UTC 5,195 bytes, 1 lines download raw bytes

1import{a as o,u as $,j as e,H as I,r as u}from"./app-CMNUi8hz.js";import{A as k,M as T}from"./AdminLayout-DQ9WC4xq.js";import{C as j}from"./Card-BGYEdFTS.js";import{B as t}from"./Button-BJrQXHQm.js";import{I as D}from"./Input-mERZ7Uzh.js";import{P as A}from"./plus-CHE0UzTe.js";import{P as L}from"./pencil-Ci9P_Xls.js";import{S as q}from"./send-C_kPMSD-.js";import{T as z}from"./trash-2-BnCjByad.js";import"./createLucideIcon-9FmARqOf.js";import"./dollar-sign-CMad3K74.js";import"./x-HdgbVzKN.js";import"./tag-BiZU32zi.js";import"./users-DBUr9X9C.js";import"./mail-ckbZOLpZ.js";import"./file-text-BYn6y269.js";import"./key-round-CbMiDTv9.js";import"./shield-alert-BELcVVaG.js";const H={draft:"bg-slate-800 text-slate-400",queued:"bg-amber-950 text-amber-400 border border-amber-800",sending:"bg-primary-950 text-primary-400 border border-primary-800",sent:"bg-emerald-950 text-emerald-400 border border-emerald-800",failed:"bg-red-950 text-red-400 border border-red-800"};function se({campaigns:c=[],activeSubscriberCount:a}){const[b,r]=o.useState(!1),[l,i]=o.useState(null),[f,m]=o.useState(null),{data:x,setData:n,post:g,put:N,processing:y,errors:d,reset:h}=$({subject:"",body:""}),v=()=>{h(),i(null),r(!0)},S=s=>{n({subject:s.subject,body:s.body}),i(s.id),r(!0)},w=s=>{s.preventDefault();const p=()=>{r(!1),i(null),h()};l?N(`/admin/campaigns/${l}`,{onSuccess:p}):g("/admin/campaigns",{onSuccess:p})},C=s=>{confirm("Delete this draft campaign?")&&u.delete(`/admin/campaigns/${s}`,{preserveScroll:!0})},E=s=>{confirm(`Send "${s.subject}" to ${a} active subscriber${a===1?"":"s"}? This cannot be undone once queued.`)&&(m(s.id),u.post(`/admin/campaigns/${s.id}/send`,{},{preserveScroll:!0,onFinish:()=>m(null)}))};return e.jsxs(k,{children:[e.jsx(I,{title:"Campaigns"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-extrabold text-white tracking-tight",children:"Email Campaigns"}),e.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[a," active subscriber",a===1?"":"s"," would receive a new send."]})]}),e.jsxs(t,{onClick:v,variant:"accent",size:"sm",children:[e.jsx(A,{className:"w-4 h-4 mr-2"})," New Campaign"]})]}),b&&e.jsxs(j,{className:"border-primary-500/40",children:[e.jsx("h3",{className:"font-bold text-base text-white mb-4",children:l?"Edit Draft":"Create Campaign"}),e.jsxs("form",{onSubmit:w,className:"space-y-4",children:[e.jsx(D,{label:"Subject",placeholder:"Your July flight deals are here",value:x.subject,onChange:s=>n("subject",s.target.value),error:d.subject,required:!0}),e.jsxs("div",{children:[e.jsx("label",{className:"input-label",children:"Body (HTML)"}),e.jsx("textarea",{value:x.body,onChange:s=>n("body",s.target.value),rows:10,className:"input-field font-mono text-xs",placeholder:"<p>Hey there — here's what's new...</p>",required:!0}),d.body&&e.jsx("p",{className:"mt-1 text-xs text-red-400 font-medium",children:d.body}),e.jsx("p",{className:"mt-1 text-[11px] text-slate-500",children:"An unsubscribe link is added automatically — no need to include one."})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-slate-800",children:[e.jsx(t,{type:"button",variant:"ghost",onClick:()=>r(!1),children:"Cancel"}),e.jsx(t,{variant:"accent",isLoading:y,children:"Save Draft"})]})]})]}),e.jsx(j,{className:"p-0 overflow-hidden border-slate-800",children:e.jsxs("table",{className:"w-full text-left text-xs",children:[e.jsx("thead",{className:"bg-slate-950 text-slate-400 uppercase font-semibold border-b border-slate-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-4",children:"Subject"}),e.jsx("th",{className:"p-4",children:"Status"}),e.jsx("th",{className:"p-4",children:"Recipients"}),e.jsx("th",{className:"p-4 text-right",children:"Actions"})]})}),e.jsxs("tbody",{className:"divide-y divide-slate-800/80",children:[c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"p-6 text-center text-slate-500",children:"No campaigns yet."})}),c.map(s=>e.jsxs("tr",{className:"hover:bg-slate-900/40",children:[e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-semibold text-white flex items-center gap-1.5",children:[e.jsx(T,{className:"w-3.5 h-3.5 text-primary-400"})," ",s.subject]})}),e.jsx("td",{className:"p-4",children:e.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold ${H[s.status]}`,children:s.status.toUpperCase()})}),e.jsx("td",{className:"p-4 text-slate-300",children:s.status==="draft"?"—":`${s.sent_count} / ${s.recipient_count} sent`}),e.jsx("td",{className:"p-4 text-right space-x-1",children:s.status==="draft"&&e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"ghost",size:"sm",onClick:()=>S(s),children:e.jsx(L,{className:"w-3.5 h-3.5"})}),e.jsx(t,{variant:"ghost",size:"sm",isLoading:f===s.id,onClick:()=>E(s),className:"text-emerald-400 hover:text-emerald-300",children:e.jsx(q,{className:"w-3.5 h-3.5"})}),e.jsx(t,{variant:"ghost",size:"sm",onClick:()=>C(s.id),className:"text-red-400 hover:text-red-300",children:e.jsx(z,{className:"w-3.5 h-3.5"})})]})})]},s.id))]})]})})]})]})}export{se 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.