PageSourceSearch

https://jmc.laempe.ai/build/assets/Index-CNNnjfZ9.js

js laempe.ai collected 2026-10-05 14:12:43 UTC 10,293 bytes, 1 lines download raw bytes

1import{r as v,j as e,M as N,k as w,U as g,h as _}from"./app-YI4vRmAj.js";import S from"./AdminLayout-B7qYMyO1.js";import{M as m}from"./metric-card-Dokz5j78.js";import{C}from"./circle-minus-DFo7ckH6.js";import{C as A}from"./circle-pause-GsnUsn3R.js";import{B as O}from"./badge-percent-DZJUIxlS.js";import{S as E}from"./search-CrP0_A7-.js";import{E as M}from"./eye-B2FRuvG-.js";/* empty css            */import"./logo-CPMoNfwC.js";import"./user-cog-VokTojBy.js";import"./users-C1suUJCG.js";import"./shopping-bag-fUiXVPoH.js";import"./credit-card-BOcEHagY.js";import"./log-out-TyKIMfPy.js";import"./menu-Chh9_bb4.js";import"./house-K2sg8HlZ.js";import"./chevron-right-Dky2MwOp.js";import"./card-0sY0ag3o.js";const x={found_alternative:"Found another service",not_using:"Doesn't use it",unhappy_with_product:"Unhappy with product",unhappy_with_support:"Unhappy with support",custom:"Custom reason"},u={open:"In progress",abandoned:"Abandoned",paused:"Paused",offer_accepted:"Offer accepted",cancelled:"Cancelled",kept:"Kept"};function $(s){switch(s){case"cancelled":return"bg-red-100 text-red-800";case"paused":return"bg-blue-100 text-blue-800";case"offer_accepted":return"bg-green-100 text-green-800";case"kept":return"bg-teal-100 text-teal-800";case"abandoned":return"bg-gray-100 text-gray-800";default:return"bg-yellow-100 text-yellow-800"}}function p({data:s,labels:l,referenceNote:c}){const d=Object.values(s).reduce((n,a)=>n+a,0);return d===0?e.jsx("p",{className:"text-sm text-gray-500",children:"No data yet."}):e.jsxs("div",{className:"space-y-2",children:[Object.entries(s).map(([n,a])=>{const o=Math.round(a/d*100);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-700",children:(l==null?void 0:l[n])??n}),e.jsxs("span",{className:"text-gray-500",children:[a," (",o,"%)"]})]}),e.jsx("div",{className:"h-2 w-full rounded-full bg-gray-100",children:e.jsx("div",{className:"h-2 rounded-full bg-blue-500",style:{width:`${o}%`}})})]},n)}),c&&e.jsx("p",{className:"pt-1 text-xs text-gray-400",children:c})]})}function X({sessions:s,filters:l,outcomes:c,reasons:d,types:n,stats:a}){const[o,j]=v.useState(l.search);function i(t){_.get(route("admin.cancellation-flows.index"),{search:o,outcome:l.outcome,reason:l.reason,type:l.type,...t},{preserveState:!0})}const f=[{label:"Started",value:a.funnel.started},{label:"Subscription selected",value:a.funnel.subscription_selected},{label:"Reason submitted",value:a.funnel.reason_submitted},{label:"Pause offer shown",value:a.funnel.pause_shown},{label:"50% offer shown",value:a.funnel.offer_shown},{label:"Sent to Stripe",value:a.funnel.portal_redirected},{label:"Completed",value:a.funnel.completed}],b=a.pauses.reduce((t,r)=>t+r.count,0),y=a.pauses.reduce((t,r)=>t+r.revenue_cents,0);return e.jsxs(S,{title:"Cancellation Flows",children:[e.jsx(N,{title:"Cancellation Flows"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsx(m,{title:"Sessions total",value:a.funnel.started,icon:w,color:"blue"}),e.jsx(m,{title:"Cancelled",value:a.outcomes.cancelled??0,icon:C,color:"red"}),e.jsx(m,{title:"Pauses sold (advertised value)",subtitle:`${(y/100).toFixed(2)} € advertised`,value:b,icon:A,color:"purple"}),e.jsx(m,{title:"50% offers accepted",value:a.outcomes.offer_accepted??0,icon:O,color:"green"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Funnel"}),e.jsx("div",{className:"space-y-2",children:f.map(t=>{const r=a.funnel.started===0?0:Math.round(t.value/a.funnel.started*100);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-gray-700",children:t.label}),e.jsxs("span",{className:"text-gray-500",children:[t.value," (",r,"%)"]})]}),e.jsx("div",{className:"h-2 w-full rounded-full bg-gray-100",children:e.jsx("div",{className:"h-2 rounded-full bg-indigo-500",style:{width:`${r}%`}})})]},t.label)})})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Cancellation reasons"}),e.jsx(p,{data:a.reasons,labels:x}),e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mt-5 mb-3",children:"Outcomes"}),e.jsx(p,{data:a.outcomes,labels:u})]}),e.jsxs("div",{className:"bg-white rounded-lg shadow p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Position of chosen reason"}),e.jsx(p,{data:Object.fromEntries(Object.entries(a.positions).map(([t,r])=>[`Position ${t}`,r])),referenceNote:"Options are shuffled per session — with honest answers each position should sit near 20%. A spike at position 1 means people click the top option."}),e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mt-5 mb-3",children:"Pauses by duration (advertised value)"}),a.pauses.length===0?e.jsx("p",{className:"text-sm text-gray-500",children:"No pauses yet."}):e.jsx("ul",{className:"space-y-1 text-sm text-gray-700",children:a.pauses.map(t=>e.jsxs("li",{className:"flex justify-between",children:[e.jsxs("span",{children:[t.duration_months," ",t.duration_months===1?"month":"months"]}),e.jsxs("span",{className:"text-gray-500",children:[t.count,"× · ",(t.revenue_cents/100).toFixed(2)," €"]})]},t.duration_months))})]})]}),e.jsxs("div",{className:"mb-4 flex items-center gap-3 flex-wrap",children:[e.jsxs("form",{onSubmit:t=>{t.preventDefault(),i({search:o})},className:"flex gap-2 flex-1 min-w-[240px]",children:[e.jsxs("div",{className:"relative flex-grow",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(E,{className:"h-4 w-4 text-gray-400"})}),e.jsx("input",{type:"text",placeholder:"Search by user or email...",className:"pl-10 h-10 px-4 block w-full rounded-md border border-gray-300 focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50 text-sm",value:o,onChange:t=>j(t.target.value)})]}),e.jsx("button",{type:"submit",className:"bg-blue-500 text-white px-4 h-10 rounded-md text-sm font-medium hover:bg-blue-600 transition-colors inline-flex items-center justify-center",children:"Search"})]}),e.jsxs("select",{value:l.outcome,onChange:t=>i({outcome:t.target.value}),className:"h-10 px-3 rounded-md border border-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"All outcomes"}),e.jsx("option",{value:"open",children:"In progress"}),c.map(t=>e.jsx("option",{value:t,children:u[t]??t},t))]}),e.jsxs("select",{value:l.reason,onChange:t=>i({reason:t.target.value}),className:"h-10 px-3 rounded-md border border-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"All reasons"}),d.map(t=>e.jsx("option",{value:t,children:x[t]??t},t))]}
1),e.jsxs("select",{value:l.type,onChange:t=>i({type:t.target.value}),className:"h-10 px-3 rounded-md border border-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"All subscriptions"}),n.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),e.jsx("div",{className:"overflow-x-auto bg-white rounded-lg shadow",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsx("tr",{children:["ID","User","Subscription","Reason","Position","Outcome","Started",""].map(t=>e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:t},t))})}),e.jsxs("tbody",{className:"bg-white divide-y divide-gray-200",children:[s.data.map(t=>{var r,h;return e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.id}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:((r=t.user)==null?void 0:r.name)||"Unknown"}),e.jsx("div",{className:"text-sm text-gray-500",children:((h=t.user)==null?void 0:h.email)||"N/A"})]}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.subscription_type??"—"}),e.jsxs("td",{className:"px-6 py-4 text-sm text-gray-700 max-w-xs",children:[e.jsx("div",{children:t.reason?x[t.reason]??t.reason:"—"}),t.reason_detail&&e.jsxs("div",{className:"text-xs text-gray-500 truncate",title:t.reason_detail,children:["“",t.reason_detail,"”"]})]}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.selected_position??"—"}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${$(t.outcome)}`,children:t.outcome?u[t.outcome]??t.outcome:"In progress"})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.created_at?new Date(t.created_at).toLocaleString("de-DE"):"—"}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm",children:e.jsxs(g,{href:route("admin.cancellation-flows.show",t.id),className:"inline-flex items-center text-blue-600 hover:text-blue-800",children:[e.jsx(M,{className:"w-4 h-4 mr-1"}),"View"]}
1)})]},t.id)}),s.data.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-6 py-8 text-center text-sm text-gray-500",children:"No sessions found."})})]})]})}),e.jsx("div",{className:"mt-6",children:e.jsxs("nav",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-700",children:s.meta.total>0?`Showing ${s.meta.from} to ${s.meta.to} of ${s.meta.total} sessions`:"No sessions found"}),e.jsx("ul",{className:"flex space-x-1",children:s.meta.links.map(t=>e.jsx("li",{children:t.url===null?e.jsx("span",{className:"px-4 py-2 text-gray-400 rounded-md text-sm font-medium",children:e.jsx("span",{dangerouslySetInnerHTML:{__html:t.label}})}):e.jsx(g,{href:t.url,className:`px-4 py-2 rounded-md text-sm font-medium ${t.active?"bg-blue-600 text-white":"text-gray-700 hover:bg-blue-50"}`,children:e.jsx("span",{dangerouslySetInnerHTML:{__html:t.label}})})},`pagination-${t.label}`))})]})})]})}export{u as OUTCOME_LABELS,x as REASON_LABELS,X as default,$ as outcomeBadgeColor};

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.