1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[52190],{52190:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var s=a(95155),r=a(12115);let i=e=>`${(100*e).toFixed(0)}%`;function c(e){return e>=.15?"text-green-400":e>=.05?"text-yellow-400":"text-red-400"}function l(){let[e,t]=(0,r.useState)(null),[a,l]=(0,r.useState)(!1),[x,n]=(0,r.useState)(""),o=(0,r.useCallback)(async()=>{l(!0),n("");try{let e=await fetch("/api/panel-x9k7m2q/winback-report");if(!e.ok)throw Error(String(e.status));t(await e.json())}catch{n("Failed to load win-back report")}finally{l(!1)}},[]);return(0,r.useEffect)(()=>{o()},[o]),(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-800 rounded-xl p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-white",children:"Reason \xd7 reactivation"}),(0,s.jsx)("button",{onClick:o,disabled:a,className:"px-3 py-1.5 bg-gray-800 hover:bg-gray-700 disabled:opacity-50 text-white text-sm rounded-md transition-colors",children:a?"Loadingâ¦":"Refresh"})]}),(0,s.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:"Per exit reason: who left, who was saved in-flow, win-back emails sent, and how many leavers are subscribed again now. Low reactivation = stop spending discount there."}),x&&(0,s.jsx)("div",{className:"bg-red-900/20 border border-red-800 rounded-md p-3 text-red-400 text-sm mb-4",children:x}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bg-gray-800/50",children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Reason"}),(0,s.jsx)("th",{className:"px-4 py-3 text-right text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Left"}),(0,s.jsx)("th",{className:"px-4 py-3 text-right text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Saved in-flow"}),(0,s.jsx)("th",{className:"px-4 py-3 text-right text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Save rate"}),(0,s.jsx)("th",{className:"px-4 py-3 text-right text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Reactivated"}),(0,s.jsx)("th",{className:"px-4 py-3 text-right text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Reactiv. rate"})]})}),(0,s.jsxs)("tbody",{className:"divide-y divide-gray-800",children:[e||a?e&&0===e.rows.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-10 text-center text-gray-500",children:"No cancellation events yet."})}):e?.rows.map(e=>(0,s.jsxs)("tr",{className:"hover:bg-gray-800/30 transition-colors",children:[(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-sm text-white",children:e.label}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-gray-300",children:e.cancels.toLocaleString()}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-gray-300",children:e.offersAccepted.toLocaleString()}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-gray-300",children:i(e.saveRate)}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-gray-300",children:e.reactivated.toLocaleString()}),(0,s.jsx)("td",{className:`px-4 py-3 whitespace-nowrap text-right text-sm font-semibold ${c(e.reactivationRate)}`,children:i(e.reactivationRate)})]},e.reason)):(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-10 text-center text-gray-500",children:"Loadingâ¦"})}),e&&e.rows.length>0&&(0,s.jsxs)("tr",{className:"bg-gray-800/40 font-semibold",children:[(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-sm text-white",children:"All reasons"}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-white",children:e.totals.cancels.toLocaleString()}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-white",children:e.totals.offersAccepted.toLocaleStr
1ing()}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-white",children:i(e.totals.saveRate)}),(0,s.jsx)("td",{className:"px-4 py-3 whitespace-nowrap text-right text-sm text-white",children:e.totals.reactivated.toLocaleString()}),(0,s.jsx)("td",{className:`px-4 py-3 whitespace-nowrap text-right text-sm ${c(e.totals.reactivationRate)}`,children:i(e.totals.reactivationRate)})]})]})]})})]})}}}]);
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.