1import{r as e,j as s,L as a}from"./tanstack-vendor-CS1CrX_F.js";import{H as t}from"./Header-Bd2UT19w.js";import{F as r}from"./Footer-B-i9eznR.js";import{u as i,a as n,b as o,c as l,S as d,B as c}from"./main-Jgt0N5_-.js";import{u as m}from"./convex-vendor-WzfSowvj.js";import{A as u,b as x,S as h,c as g,L as p}from"./ui-vendor-D-i1wnoC.js";import"./react-vendor-Gmj5k1uE.js";import"./Logo-Djd3VdPF.js";import"./dialog-DNnXgsy2.js";import"./use-mobile-CN3QnUkO.js";import"./select-fbM8f4d0.js";const f={"pro-monthly":"21890e40-109d-4e29-a81f-647bc1bba390","pro-annual":"4feacbd8-778f-4b66-8bf1-5ab75c471bce"},j=[{id:"free",name:"Free",price:"$0",period:"forever",description:"For casual learners",features:["5 video analyses per month","50 AI chat messages per month","Video notes on 5 videos (text, voice, drawing)","5 highlights per video (key points only)","Quiz & flashcards: View only","English PDF export only","Access all analyzed videos"],cta:"Current Plan",highlighted:!1},{id:"pro-monthly",name:"Pro",price:"$6.99",period:"/month",description:"For dedicated learners",badge:"Popular",features:["50 video analyses per month","500 AI chat messages per month","Unlimited video notes (text, voice, drawing)","Unlimited highlights with attached notes","Full quiz access with progress tracking","Flashcards with spaced repetition","Priority processing queue","PDF export in all languages","Early access to new features"],cta:"Upgrade to Pro",highlighted:!0},{id:"pro-annual",name:"Pro Annual",price:"$59",period:"/year",description:"Best value",badge:"Save 30%",features:["Everything in Pro","$4.92/month effective rate","Annual billing"],cta:"Upgrade to Pro",highlighted:!1}];function b(){const{isSignedIn:b}=i(),{tier:v,isTrial:N,trialDaysLeft:y,isPro:w,isLoading:P}=n(),[k,F]=e.useState(null),[C,S]=e.useState(null),A=m(o.polar.generateCheckoutLink);return s.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-background to-secondary/30",children:[s.jsx(t,{}),s.jsxs("main",{className:"flex-1 container mx-auto px-4 py-12",children:[s.jsxs(a,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground mb-8",children:[s.jsx(u,{className:"w-4 h-4"}),"Back to home"]}),s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Choose Your Plan"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:N?`You have ${y} days left in your Pro trial. Upgrade now to keep unlimited access.`:"Unlock unlimited learning with BrightClips Pro"})]}),C&&s.jsxs("div",{className:"max-w-md mx-auto mb-8 p-4 bg-destructive/10 border border-destructive/20 rounded-lg text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:C}),s.jsx("button",{onClick:()=>S(null),className:"text-xs text-destructive/70 hover:text-destructive mt-2",children:"Dismiss"})]}),s.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-5xl mx-auto",children:j.map(e=>{const a="free"===e.id&&"free"===v||("pro-monthly"===e.id||"pro-annual"===e.id)&&w,t="pro-monthly"===e.id||"pro-annual"===e.id,r=k===e.id;return s.jsxs("div",{className:l("relative rounded-2xl border bg-card p-6 shadow-sm",e.highlighted?"border-primary ring-2 ring-primary/20":"border-border"),children:[e.badge&&s.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:s.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-xs font-medium bg-primary text-primary-foreground",children:["Popular"===e.badge&&s.jsx(x,{className:"w-3 h-3"}),"Save 30%"===e.badge&&s.jsx(h,{className:"w-3 h-3"}),e.badge]})}),s.jsxs("div",{className:"text-center mb-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:e.name}),s.jsxs("div",{className:"flex items-baseline justify-center gap-1",children:[s.jsx("span",{className:"text-4xl font-bold text-foreground",children:e.price}),s.jsx("span",{className:"text-muted-foreground",children:e.period})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:e.description})]}),s.jsx("ul",{className:"space-y-3 mb-6",children:e.features.map((e,a)=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(g,{className:"w-4 h-4 text-primary mt-0.5 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground",children:e})]},a))}),t&&!b?s.jsx(d,{mode:"modal",children:s.jsx(c,{className:"w-full",variant:e.highlighted?"default":"outline",children:"Sign in to Upgrade"})}):t&&!a?s.jsx(c,{className:"w-full",variant:e.highlighted?"default":"outline",disabled:r||P,onClick:()=>(async e=>{if(b){F(e),S(null);try{const s=f[e],a=await A({productIds:[s],origin:window.location.origin,successUrl:`${window.location.origin}/account?upgraded=true`});a?.url?window.location.href=a.url:S("Failed to generate checkout link. Please try again.")}catch(s){let e="Something went wrong. Please try again.";if(s instanceof Error){const a=s.message,t=a.match(/\]\s*(.+)$/);t&&t[1]?e=t[1].trim():a.includes("[CONVEX")||(e=a)}S(e)}finally{F(null)}}})(e.id),children:r?s.jsxs(s.Fragment,{children:[s.jsx(p,{className:"w-4 h-4 mr-2 animate-spin"}),"Loading..."]}):e.cta}):s.jsx(c,{className:"w-full",variant:e.highlighted?"default":"outline",disabled:!0,children:a?"Current Plan":N&&"free"===e.id?"After Trial":e.cta})]},e.id)})}),N&&s.jsx("div",{className:"mt-12 text-center",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your trial includes all Pro features."," ",s.jsxs("span",{className:"font-medium text-foreground",children:[y," days remaining"]})]})}),s.jsx("div",{className:"mt-12 text-center",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Have questions?"," ",s.jsx(a,{to:"/faq",className:"text-primary hover:underline",children:"Check our FAQ"})]})})]}),s.jsx(r,{})]})}
1export{b as component};
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.