1import{L as ue,d as J,e as Z,A as d,m as y,o as r,y as K,u as se,b as re,j as l,i as t,B as E,g as k,z as X,a2 as pe,F as v,n as w,aL as ge,r as N,l as _,t as n,bf as xe,am as be,aZ as F,k as A,p as m,a1 as me,f as H,s as ee,q as Q,as as te,P as ye,db as ke,dc as ve}from"./index.js";import{m as fe}from"./vue3-apexcharts.js";import{e as u,a as he,c as ae,B as _e,b as we,T as I,s as $e}from"./format.js";import{C as Ce}from"./chevron-left.js";import{A as je}from"./arrow-left.js";import{D as Se}from"./download.js";import{L as Re}from"./link-2.js";import{I as Ae}from"./info.js";/** 2 * @license lucide-vue-next v0.469.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Le=ue("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),De=J({__name:"OverTimeChart",props:{timeline:{}},setup(U){const S=U,D=y(()=>S.timeline.map(x=>K(x.date).format("MMM D"))),B=y(()=>[{name:"Opens",type:"area",data:S.timeline.map(x=>x.opens)},{name:"Clicks",type:"line",data:S.timeline.map(x=>x.clicks)}]),o=y(()=>({chart:{toolbar:{show:!1},zoom:{enabled:!1},fontFamily:"Inter, sans-serif",background:"transparent",animations:{enabled:!0}},colors:["#92BB42","#60A5FA"],dataLabels:{enabled:!1},stroke:{curve:"smooth",width:[2.5,2.5]},fill:{type:["gradient","solid"],opacity:[.2,1],gradient:{shadeIntensity:.4,opacityFrom:.28,opacityTo:.02}},legend:{show:!0,position:"top",horizontalAlign:"right",fontSize:"12px",labels:{colors:"#9CA3AF"},markers:{width:11,height:3,radius:2},itemMargin:{horizontal:8}},grid:{borderColor:"rgba(148,163,184,0.16)",strokeDashArray:0,xaxis:{lines:{show:!1}},padding:{left:4,right:4}},xaxis:{categories:D.value,labels:{style:{colors:"#9CA3AF",fontSize:"11px"}},axisBorder:{show:!1},axisTicks:{show:!1},tooltip:{enabled:!1}},yaxis:{labels:{style:{colors:"#6B7280",fontSize:"11px"},formatter:x=>`${Math.round(x)}`}},tooltip:{theme:"dark",shared:!0,intersect:!1}}));return(x,p)=>(r(),Z(d(fe),{type:"area",height:"240",options:o.value,series:B.value},null,8,["options","series"]))}}),Be={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 overflow-hidden"},ze={class:"flex items-center justify-end gap-2.5 flex-wrap p-4 md:px-5 border-b border-gray-200 dark:border-gray-700"},Oe={class:"relative flex items-center"},Me=["value"],Ne={class:"overflow-x-auto"},Ue={class:"w-full min-w-[680px] border-collapse"},qe={class:"border-b border-gray-200 dark:border-gray-700"},Te={key:0},Ie=["colspan"],Fe={key:1},Ee=["colspan"],Ve={class:"px-5 py-3.5 max-w-[260px]"},Ge={class:"text-[13px] font-medium text-gray-800 dark:text-gray-200 truncate"},Pe={key:0,class:"text-[11px] text-gray-500 truncate"},Ye={class:"px-5 py-3.5"},We={class:"flex items-center gap-1.5 flex-wrap"},He={class:"px-5 py-3.5 text-[13px] text-gray-600 dark:text-gray-400 whitespace-nowrap"},Qe={class:"px-5 py-3.5 text-[13px] text-gray-600 dark:text-gray-400"},Ze={class:"px-5 py-3.5 text-[13px] text-gray-600 dark:text-gray-400 whitespace-nowrap"},Je={class:"px-5 py-3.5 text-[13px] text-gray-500 max-w-[200px] truncate"},Ke={class:"flex items-center justify-between gap-3 flex-wrap p-4 md:px-5"},Xe={class:"text-[13px] text-gray-500"},et={class:"text-gray-700 dark:text-gray-300"},tt={class:"text-gray-700 dark:text-gray-300"},at={class:"flex items-center gap-1.5"},st=["disabled"],rt={class:"text-[13px] font-medium text-gray-600 dark:text-gray-300 px-2"},ot=["disabled"],nt=J({__name:"RecipientsTable",props:{campaignId:{}},setup(U,{expose:S}){const D=U,B=se(),o=N([]),x=X({q:"",status:""}),p=X({page:1,per_page:20,total:0,last_page:1,from:0,to:0}),$=["Recipient","Status","Opened","Opens","Clicked","Email client"],V=[{value:"",label:"All statuses"},{value:"delivered",label:"Delivered"},{value:"opened",label:"Opened"},{value:"bounced",label:"Bounced"},{value:"complained",label:"Complained"},{value:"rejected",label:"Rejected"},{value:"unsubscribed",label:"Unsubscribed"}],{state:z,execute:O}=re({fire:"immediately",action:()=>B.guestbook.getCampaignRecipients(D.campaignId,{page:p.page,per_page:p.per_page,q:x.q||void 0,status:x.status||void 0}),onSuccess:c=>{o.value=c.data.data,p.page=c.data.current_page,p.total=c.data.total,p.last_page=c.data.last_page,p.from=c.data.from,p.to=c.data.to}});function C(){p.page=1,O()}function M(c){c<1||c>p.last_page||(p.page=c,O())}const f=be(C,450);function G(c){x.status=c,C()}S({applyStatus:G});const h={clicked:"bg-green-100 text-green-800 dark:bg-dinesurf-green-base/14 dark:text-[#bfe07a]",opened:"bg-blue-100 text-blue-800 dark:bg-blue-400/14 dark:text-blue-300",delivered:"bg-gray-100 text-gray-700 dark:bg-gray-500/14 dark:text-gray-300",bounced:"bg-red-100 text-red-800 dark:bg-red-400/14 dark:text-red-300",warn:"bg-amber-100 text-amber-800 dark:bg-amber-400/14 dark:text-amber-300",unsub:"bg-rose-100 text-rose-800 dark:bg-rose-400/14 dark:text-rose-300"};function q(c){if(c.is_clicked)return{label:"Clicked",class:h.clicked};if(c.is_opened)return{label:"Opened",class:h.opened};switch(c.status){case"bounced":return{label:"Bounced",class:h.bounced};case"rejected":return{label:"Rejected",class:h.bounced};case"complained":return{label:"Complained",class:h.warn};case"delivered":return{label:"Delivered",class:h.delivered};default:return{label:"Sent",class:h.delivered}}}function T(c){return c.opened_at?K(c.opened_at).format("h:mm A"):"â"}function P(c){return["bounced","rejected","complained"].includes(c.status)?"â":String(c.open_count??0)}function Y(c){var i;const g=((i=c.clicked_links)==null?void 0:i.length)??0;return g?`${g} link${g===1?"":"s"}`:"â"}return(c,g)=>(r(),l("div",Be,[t("div",ze,[t("div",Oe,[k(d(xe),{size:15,class:"absolute left-3 text-gray-400 dark:text-gray-500"}),E(t("input",{"onUpdate:modelValue":g[0]||(g[0]=i=>x.q=i),onInput:g[1]||(g[1]=(...i)=>d(f)&&d(f)(...i)),placeholder:"Search recipients",class:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg pl-9 pr-3 py-2 text-sm text-gray-900 dark:text-gray-50 outline-none focus:ring-1 focus:ring-dinesurf-green-base/40 w-[190p
6x]"},null,544),[[pe,x.q]])]),E(t("select",{"onUpdate:modelValue":g[2]||(g[2]=i=>x.status=i),onChange:g[3]||(g[3]=i=>C()),class:"bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-sm text-gray-700 dark:text-gray-300 outline-none focus:ring-1 focus:ring-dinesurf-green-base/40 cursor-pointer"},[(r(),l(v,null,w(V,i=>t("option",{key:i.value,value:i.value},n(i.label),9,Me)),64))],544),[[ge,x.status]])]),t("div",Ne,[t("table",Ue,[t("thead",null,[t("tr",qe,[(r(),l(v,null,w($,i=>t("th",{key:i,class:"text-left font-semibold text-[11px] uppercase tracking-wide text-gray-500 px-5 py-3 whitespace-nowrap"},n(i),1)),64))])]),t("tbody",null,[d(z)===d(F).LOADING?(r(),l("tr",Te,[t("td",{colspan:$.length,class:"px-5 py-10 text-center text-sm text-gray-500"}," Loading recipients⦠",8,Ie)])):o.value.length?(r(!0),l(v,{key:2},w(o.value,i=>(r(),l("tr",{key:i.id,class:"border-b border-gray-100 dark:border-gray-700/50 last:border-0"},[t("td",Ve,[t("div",Ge,n(i.email),1),i.name?(r(),l("div",Pe,n(i.name),1)):A("",!0)]),t("td",Ye,[t("div",We,[t("span",{class:m(["inline-flex font-semibold text-[11px] px-2.5 py-1 rounded-md",q(i).class])},n(q(i).label),3),i.unsubscribed?(r(),l("span",{key:0,class:m(["inline-flex font-semibold text-[11px] px-2.5 py-1 rounded-md",h.unsub])},"Unsubscribed",2)):A("",!0)])]),t("td",He,n(T(i)),1),t("td",Qe,n(P(i)),1),t("td",Ze,n(Y(i)),1),t("td",Je,n(i.device||"â"),1)]))),128)):(r(),l("tr",Fe,[t("td",{colspan:$.length,class:"px-5 py-10 text-center text-sm text-gray-500"}," No recipients match these filters. ",8,Ee)]))])])]),t("div",Ke,[t("span",Xe,[g[6]||(g[6]=_(" Showing ",-1)),t("span",et,n(p.from||0)+"â"+n(p.to||0),1),g[7]||(g[7]=_(" of ",-1)),t("span",tt,n(d(u)(p.total)),1)]),t("div",at,[t("button",{class:"inline-flex items-center justify-center w-[34px] h-[34px] rounded-lg border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-50 dark:hover:bg-gray-700/40",disabled:p.page<=1||d(z)===d(F).LOADING,onClick:g[4]||(g[4]=i=>M(p.page-1))},[k(d(Ce),{size:16})],8,st),t("span",rt," Page "+n(p.page)+" of "+n(Math.max(p.last_page,1)),1),t("button",{class:"inline-flex items-center justify-center w-[34px] h-[34px] rounded-lg border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-50 dark:hover:bg-gray-700/40",disabled:p.page>=p.last_page||d(z)===d(F).LOADING,onClick:g[5]||(g[5]=i=>M(p.page+1))},[k(d(Le),{size:16})],8,ot)])])]))}}),lt={class:"sm:px-6 px-0 py-4 w-full self-stretch min-h-[inherit] flex flex-col"},it={key:0,class:"flex flex-col gap-4"},dt={class:"grid grid-cols-2 lg:grid-cols-5 gap-3.5"},ct={key:1,class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/40 px-7 py-14 text-center"},ut={class:"flex items-start justify-between gap-5 flex-wrap mb-6"},pt={class:"min-w-0"},gt={class:"flex items-center gap-2 mb-3"},xt={class:"text-gray-900 dark:text-gray-50 font-bold text-2xl md:text-[28px] leading-tight tracking-tight max-w-[620px]"},bt={class:"flex items-center gap-4 flex-wrap text-[13px] font-medium text-gray-500 dark:text-gray-400 mt-3"},mt={class:"inline-flex items-center gap-1.5"},yt={class:"inline-flex items-center gap-1.5"},kt={class:"grid grid-cols-2 lg:grid-cols-5 gap-3.5 mb-5"},vt={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-2.5"},ft={key:0,class:"w-full mt-3 mb-0.5",height:"30",viewBox:"0 0 120 34",preserveAspectRatio:"none"},ht=["points"],_t={class:"mt-auto pt-2.5"},wt={class:"text-xs font-semibold text-gray-700 dark:text-gray-300"},$t={key:0,class:"text-[11px] text-gray-500 mt-0.5"},Ct={class:"grid grid-cols-1 lg:grid-cols-[minmax(0,360px)_minmax(0,1fr)] gap-3.5 mb-5"},jt={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 p-5"},St={class:"flex flex-col gap-4"},Rt={class:"flex items-baseline justify-between mb-1.5"},At={class:"text-[13px] font-semibold text-gray-700 dark:text-gray-300"},Lt={class:"text-[15px] font-bold text-gray-900 dark:text-gray-50"},Dt={class:"h-3 rounded-md bg-gray-100 dark:bg-gray-900 overflow-hidden"},Bt={class:"text-[11px] text-gray-500 mt-1.5"},zt={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 p-5"},Ot={key:1,class:"h-[200px] flex items-center justify-center text-sm text-gray-500"},Mt={class:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_minmax(0,440px)] gap-3.5 mb-5"},Nt={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 p-5"},Ut={class:"text-xs text-gray-500 mb-4"},qt={key:0,class:"flex flex-col gap-3.5"},Tt={class:"flex items-start justify-between gap-3 mb-2"},It={class:"flex items-center gap-2.5 min-w-0"},Ft={class:"min-w-0"},Et={key:0,class:"text-[11px] text-gray-400 dark:text-gray-600 truncate max-w-[320px]"},Vt={class:"text-right shrink-0"},Gt={class:"text-sm font-bold text-gray-700 dark:text-gray-300"},Pt={key:0,class:"h-[7px] rounded bg-gray-100 dark:bg-gray-900 overflow-hidden"},Yt={key:1,class:"text-[11px] text-gray-400 dark:text-gray-600"},Wt={key:1,class:"text-sm text-gray-500 py-6 text-center"},Ht={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 p-5"},Qt={class:"flex items-center justify-between gap-3 mb-4"},Zt={class:"flex bg-gray-100 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg p-0.5 gap-0.5"},Jt=["onClick"],Kt={class:"flex justify-center bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-xl p-4"},Xt=["srcdoc"],ea={key:1,class:"h-[300px] flex items-center justify-center text-sm text-gray-500"},ta={class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 overflow-hidden"},aa={class:"flex items-center gap-1 p-1 mx-4 md:mx-5 mt-4 md:mt-5 w-max bg-gray-100 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-xl"},sa=["onClick"],ra={class:"p-4 md:p-5"},oa={class:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-6"},na={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-2"},la={class:"flex items-baseline gap-2"},ia={class:"text-xs font-semibold text-gray-500"},da={class:"rounded-lg bg-gray-50 dark:bg-gray-900 border border-gray-200 dark:border-gray-700 px-4 py-3.5 flex items-center justify-between gap-3 flex-wrap"},ca={class:"text-[13px] text-gray-600 dark:text-gray-400"},ua={class:"font-semibold text-gray-800 dark:text-gray-200"},pa={key:2,class:"flex items-start gap-2 text-[13px] text-gray-500 dark:text-gray-400 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 px-5 py-4"},ha=J({__name:"CampaignReport",setup(U){const S=me(),D=se(),B=S.params.id,o=N(null),x=N(null),p=N("desktop"),$=N("recipients"),V=[{value:"recipients",label:"Recipients"},{value:"deliverability",label:"Deliverability"}],{state:z}=re({fire:"immediately",action:()=>D.guestbook.getCampaign(B),onSuccess:e=>{o.value=e.data}}),O=y(()=>{var e;return((e=o.value)==null?void 0:e.type)==="email"}),C=y(()=>{var e;return $e(((e=o.value)==null?void 0:e.status)??"completed")}),M=y(()=>{var s;const e=K((s=o.value)==null?void 0:s.created_at);return e.isValid()?e.format("MMM D, YYYY [at] h:mm A"):"â"}),f=e=>`${e}%`,G=y(()=>{const e=o.value.stats;return O.value?[{label:"Delivered",value:f(e.rates.delivery),tone:"neutral",a:`${u(e.delivered)} of ${u(e.sent)} sent`,b:`${e.bounced} bounced · ${e.complained} spam · ${e.rejected} rejected`},{label:"Open rate",value:f(e.rates.open),tone:"green",a:`${u(e.opened)} unique opens`,b:`${u(e.total_opens)} total incl. re-opens`,spark:i.value},{label:"Click rate",value:f(e.rates.click),tone:"green",a:`${u(e.clicked)} unique clickers`,b:`${u(e.total_clicks)} total clicks`,spark:oe.value},{label:"Click-to-open",value:f(e.rates.click_to_open),tone:"blue",a:"of openers clicked",b:`${u(e.clicked)} of ${u(e.opened)} opens`},{label:"Unsubscribed",value:f(e.rates.unsubscribe),tone:"muted",a:`${u(e.unsubscribed)} people`,b:e.complained?`${e.complained} spam complaint${e.complained===1?"":"s"}`:""}]:[{label:"Recipients",value:u(e.recipients),tone:"neutral",a:"Total sent",b:""},{label:"Delivered",value:f(e.rates.delivery),tone:"neutral",a:`${u(e.delivered)} of ${u(e.sent)} sent`,b:""},{label:"Unsubscribed",value:f(e.rates.unsubscribe),tone:"muted",a:`${u(e.unsubscribed)} from this campaign`,b:""}]}),h=y(()=>{const e=o.value.stats;return[{label:"Sent",value:u(e.sent),width:"100%",color:"bg-slate-500",sub:"Queued to recipients"},{label:"Delivered",value:u(e.delivered),width:`${e.rates.delivery}%`,color:"bg-blue-500",sub:`${e.rates.delivery}% of sent`},{label:"Opened",value:u(e.opened),width:`${e.rates.open}%`,color:"bg-dinesurf-green-base",sub:`${e.rates.open}% of delivered`},{label:"Clicked",value:u(e.clicked),width:`${e.rates.click}
6%`,color:"bg-dinesurf-green-600",sub:`${e.rates.click_to_open}% of opens`}]}),q=y(()=>{const e=o.value.stats;return[{label:"Delivered",value:u(e.delivered),pct:`${e.rates.delivery}%`,tone:I.green},{label:"Bounced",value:u(e.bounced),pct:`${e.rates.bounce}%`,tone:"text-red-600 dark:text-red-300"},{label:"Complained",value:u(e.complained),pct:T(e.complained,e.sent),tone:I.warn},{label:"Rejected",value:u(e.rejected),pct:T(e.rejected,e.sent),tone:I.muted}]});function T(e,s){return s?`${(Math.round(e/s*1e3)/10).toFixed(1)}%`:"0%"}const P=y(()=>{var s;const e=(((s=o.value)==null?void 0:s.links)??[]).filter(b=>!b.is_system);return Math.max(1,...e.map(b=>b.clicks))});function Y(e){return`${Math.max(2,e/P.value*100)}%`}function c(e){return e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")}function g(e){if(!e.length)return"";const s=120,b=34,a=3,j=Math.max(...e),L=Math.min(...e),R=j-L||1;return e.map((W,ie)=>{const de=a+ie*(s-2*a)/Math.max(e.length-1,1),ce=b-a-(W-L)/R*(b-2*a);return`${de.toFixed(1)},${ce.toFixed(1)}`}).join(" ")}const i=y(()=>{var e,s;return g(((s=(e=o.value)==null?void 0:e.timeline)==null?void 0:s.map(b=>b.opens))??[])}),oe=y(()=>{var e,s;return g(((s=(e=o.value)==null?void 0:e.timeline)==null?void 0:s.map(b=>b.clicks))??[])});function ne(){var e;$.value="recipients",(e=x.value)==null||e.applyStatus("bounced")}function le(){if(!o.value)return;const e=o.value.stats,b=[["Campaign",o.value.subject],["Sent",M.value],[],["Metric","Value","Rate"],["Recipients",e.recipients,""],["Delivered",e.delivered,`${e.rates.delivery}%`],["Opened (unique)",e.opened,`${e.rates.open}%`],["Total opens",e.total_opens,""],["Clicked (unique)",e.clicked,`${e.rates.click}%`],["Total clicks",e.total_clicks,""],["Bounced",e.bounced,`${e.rates.bounce}%`],["Complained",e.complained,""],["Rejected",e.rejected,""],["Unsubscribed",e.unsubscribed,`${e.rates.unsubscribe}%`],[],["Top links","Clicks","Unique clickers"],...o.value.links.map(R=>[R.url,R.clicks,R.unique_clickers])].map(R=>R.map(W=>`"${String(W).replace(/"/g,'""')}"`).join(",")).join(` 7`),a=new Blob([b],{type:"text/csv;charset=utf-8"}),j=URL.createObjectURL(a),L=document.createElement("a");L.href=j,L.download=`campaign-${o.value.id}-summary.csv`,L.click(),URL.revokeObjectURL(j)}return(e,s)=>{const b=ye("RouterLink");return r(),l("div",lt,[k(b,{to:{name:"dashboard.guestbook.campaign-history"},class:"inline-flex items-center gap-2 text-sm font-medium text-gray-500 dark:text-gray-400 hover:underline w-max mb-5"},{default:H(()=>[k(d(je),{size:16,"stroke-width":2}),s[0]||(s[0]=_(" Back to Campaign history ",-1))]),_:1}),d(z)===d(F).LOADING&&!o.value?(r(),l("div",it,[s[1]||(s[1]=t("div",{class:"h-8 w-2/3 max-w-md rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)),t("div",dt,[(r(),l(v,null,w(5,a=>t("div",{key:a,class:"h-[150px] rounded-xl bg-gray-200 dark:bg-gray-700 animate-pulse"})),64))]),s[2]||(s[2]=t("div",{class:"h-72 rounded-xl bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))])):o.value?(r(),l(v,{key:2},[t("div",ut,[t("div",pt,[t("div",gt,[t("span",{class:m(["font-semibold text-[11px] px-2.5 py-1 rounded-md",d(he)(o.value.type)])},n(d(ae)(o.value.type)),3),t("span",{class:m(["inline-flex items-center gap-1.5 font-semibold text-[11px] px-2.5 py-1 rounded-md",C.value.class])},[t("span",{class:m(["w-1.5 h-1.5 rounded-full",[C.value.dot,C.value.pulse&&"animate-pulse"]])},null,2),_(" "+n(C.value.label),1)],2)]),t("h1",xt,n(o.value.subject||"Untitled campaign"),1),t("div",bt,[t("span",mt,[k(d(ke),{size:15,"stroke-width":1.8}),_(" "+n(M.value),1)]),t("span",yt,[k(d(ve),{size:15,"stroke-width":1.8}),_(" "+n(d(u)(o.value.stats.recipients))+" recipients ",1)])])]),k(ee,{variant:"outline",size:"sm",onClick:le},{default:H(()=>[k(d(Se),{size:15,"stroke-width":1.8,class:"mr-2"}),s[4]||(s[4]=_(" Export CSV ",-1))]),_:1})]),o.value.status==="failed"?(r(),l("div",{key:0,class:m(["flex items-center gap-2.5 rounded-lg border px-4 py-3 text-sm font-medium mb-6",d(_e).failed])},[t("span",{class:m(["w-2 h-2 rounded-full shrink-0",d(we).failed])},null,2),s[5]||(s[5]=_(" Delivery failed â sender domain not verified. No recipients were reached. ",-1))],2)):A("",!0),t("div",kt,[(r(!0),l(v,null,w(G.value,a=>(r(),l("div",{key:a.label,class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/60 p-4 md:p-[17px] flex flex-col"},[t("div",vt,n(a.label),1),t("div",{class:m(["text-2xl md:text-[28px] font-bold leading-none tracking-tight",d(I)[a.tone]])},n(a.value),3),a.spark?(r(),l("svg",ft,[t("polyline",{points:a.spark,fill:"none",stroke:"#92BB42","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,ht)])):A("",!0),t("div",_t,[t("div",wt,n(a.a),1),a.b?(r(),l("div",$t,n(a.b),1)):A("",!0)])]))),128))]),O.value?(r(),l(v,{key:1},[t("div",Ct,[t("div",jt,[s[6]||(s[6]=t("h3",{class:"font-bold text-[15px] text-gray-900 dark:text-gray-50"}," Engagement funnel ",-1)),s[7]||(s[7]=t("p",{class:"text-xs text-gray-500 mb-4"},"From queued to clicked.",-1)),t("div",St,[(r(!0),l(v,null,w(h.value,a=>(r(),l("div",{key:a.label},[t("div",Rt,[t("span",At,n(a.label),1),t("span",Lt,n(a.value),1)]),t("div",Dt,[t("div",{class:m(["h-full rounded-md",a.color]),style:Q({width:a.width})},null,6)]),t("div",Bt,n(a.sub),1)]))),128))])]),t("div",zt,[s[8]||(s[8]=t("h3",{class:"font-bold text-[15px] text-gray-900 dark:text-gray-50"}," Opens & clicks over time ",-1)),s[9]||(s[9]=t("p",{class:"text-xs text-gray-500 mb-1"}," Engagement since the campaign was sent. ",-1)),o.value.timeline.length?(r(),Z(De,{key:0,timeline:o.value.timeline},null,8,["timeline"])):(r(),l("div",Ot," No engagement recorded yet. "))])]),t("div",Mt,[t("div",Nt,[s[11]||(s[11]=t("h3",{class:"font-bold text-[15px] text-gray-900 dark:text-gray-50"}," Top clicked links ",-1)),t("p",Ut," Grouped by destination · "+n(d(u)(o.value.stats.total_clicks))+" total clicks. Did the email drive bookings? ",1),o.value.links.length?(r(),l("div",qt,[(r(!0),l(v,null,w(o.value.links,(a,j)=>(r(),l("div",{key:j},[t("div",Tt,[t("div",It,[a.is_system?(r(),Z(d(Re),{key:0,size:16,class:"shrink-0 text-gray-400 dark:text-gray-600"})):A("",!0),t("div",Ft,[t("div",{class:m(["text-[13px] font-semibold truncate",a.is_system?"text-gray-500 dark:text-gray-400":"text-gray-900 dark:text-gray-50"])},n(a.is_system?a.url:c(a.url)),3),a.is_system?A("",!0):(r(),l("div",Et,n(a.url),1))])]),t("div",Vt,[t("span",Gt,n(d(u)(a.clicks)),1),s[10]||(s[10]=t("span",{class:"text-[11px] text-gray-400 dark:text-gray-600"}
7," clicks",-1))])]),a.is_system?(r(),l("div",Yt," Unsubscribe & tracking pixels â grouped from per-recipient URLs, demoted. ")):(r(),l("div",Pt,[t("div",{class:"h-full rounded bg-gradient-to-r from-dinesurf-green-600 to-dinesurf-green-base",style:Q({width:Y(a.clicks)})},null,4)]))]))),128))])):(r(),l("div",Wt," No link clicks recorded yet. "))]),t("div",Ht,[t("div",Qt,[s[12]||(s[12]=t("h3",{class:"font-bold text-[15px] text-gray-900 dark:text-gray-50"}," Email preview ",-1)),t("div",Zt,[(r(),l(v,null,w(["desktop","mobile"],a=>t("button",{key:a,onClick:j=>p.value=a,class:m(["px-3 py-1.5 rounded-md text-xs font-semibold capitalize transition-colors",p.value===a?"bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-50 shadow-sm":"text-gray-500 dark:text-gray-400"])},n(a),11,Jt)),64))])]),t("div",Kt,[o.value.template?(r(),l("iframe",{key:0,srcdoc:o.value.template,sandbox:"",title:"Email preview",class:"bg-white rounded-lg border border-gray-200 w-full h-[440px] transition-all duration-200",style:Q({maxWidth:p.value==="mobile"?"320px":"100%"})},null,12,Xt)):(r(),l("div",ea," No template available. "))])])]),t("div",ta,[t("div",aa,[(r(),l(v,null,w(V,a=>t("button",{key:a.value,onClick:j=>$.value=a.value,class:m(["px-3.5 py-2 rounded-lg text-[13px] font-semibold transition-colors",$.value===a.value?"bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-50 shadow-sm":"text-gray-500 dark:text-gray-400"])},n(a.label),11,sa)),64))]),t("div",ra,[E(t("div",null,[k(nt,{ref_key:"recipientsRef",ref:x,"campaign-id":o.value.id},null,8,["campaign-id"])],512),[[te,$.value==="recipients"]]),E(t("div",null,[t("div",oa,[(r(!0),l(v,null,w(q.value,a=>(r(),l("div",{key:a.label,class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900 px-4 py-3.5"},[t("div",na,n(a.label),1),t("div",la,[t("span",{class:m(["text-[22px] font-bold leading-none",a.tone])},n(a.value),3),t("span",ia,n(a.pct),1)])]))),128))]),t("div",da,[t("div",ca,[t("span",ua,n(d(u)(o.value.stats.bounced)),1),_(" message"+n(o.value.stats.bounced===1?"":"s")+" didn't reach the inbox. ",1)]),k(ee,{variant:"light",size:"sm",onClick:ne},{default:H(()=>[...s[13]||(s[13]=[_("View bounced recipients",-1)])]),_:1})])],512),[[te,$.value==="deliverability"]])])])],64)):(r(),l("div",pa,[k(d(Ae),{size:16,class:"shrink-0 mt-0.5"}),t("span",null," Open & click tracking isn't available for "+n(d(ae)(o.value.type))+" campaigns â this report shows the send summary only. ",1)]))],64)):(r(),l("div",ct,[...s[3]||(s[3]=[t("h3",{class:"text-gray-900 dark:text-gray-50 font-bold text-lg mb-2"}," Campaign not found ",-1),t("p",{class:"text-gray-500 dark:text-gray-400 text-sm"}," This campaign may have been removed, or you don't have access to it. ",-1)])]))])}}});export{ha 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.