PageSourceSearch

https://goexpired.com/assets/Pricing-BoF-eK-H.js

js goexpired.com collected 2026-10-09 22:42:27 UTC 2,737 bytes, 1 lines download raw bytes

1import{c as P,r as s,j as e,y as Y,s as C,Q as h}from"./index-DocTL6Xp.js";import{u as D}from"./useSubscription-BogwARKQ.js";import{G as S,a as U}from"./GxPricingPlans-rj7rU05X.js";import{A as v,b as k,c as G,d as N,e as O,f as E,g as L,h as _}from"./alert-dialog-BL-rbCI7.js";const H=()=>{const o=P(),[l,g]=s.useState(null),{subscriptionData:t,loading:y,createCheckout:c,manageSubscription:m,checkSubscription:x}=D(l),[a,d]=s.useState(!1),[f,i]=s.useState(!1);s.useEffect(()=>{document.title="Pricing - GoExpired.com",(async()=>{const{data:{user:p}}=await C.auth.getUser();if(!p){o("/public-pricing");return}g(p)})()},[o]);const n=t.tier==="pro"||t.tier==="plus",u=n&&t.billing_interval==="year",j=u?"pro_yearly":n?"pro":"free",b=async()=>{try{await c("pro")}catch(r){console.error(r)}},w=async()=>{if(n&&!u){i(!0);return}try{await c("pro_yearly")}catch(r){console.error(r)}},A=async()=>{try{d(!0),await m("upgrade","pro_yearly"),h.success("Upgraded to GX PRO Yearly. Unused time on your monthly plan was credited."),await x(),i(!1)}catch(r){console.error(r),h.error((r==null?void 0:r.message)||"Could not upgrade to yearly.")}finally{d(!1)}};return e.jsxs(S,{isAuthenticated:!!l,children:[e.jsx(U,{currentTier:j,onSelectFree:()=>{},onSelectPro:b,onSelectProYearly:w,proLoading:y,proYearlyLoading:a}),e.jsx(v,{open:f,onOpenChange:r=>{a||i(r)},children:e.jsxs(k,{children:[e.jsxs(G,{children:[e.jsx(N,{children:"Upgrade to GX PRO Yearly?"}),e.jsx(O,{asChild:!0,children:e.jsxs("div",{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("p",{children:["You're switching from ",e.jsx("strong",{children:"$9.99/month"})," to"," ",e.jsx("strong",{children:"$79.99/year"})," — saving around"," ",e.jsx("strong",{children:"$40 per year"})," compared to staying on monthly."]}),e.jsxs("div",{className:"rounded-md border border-border bg-muted/40 p-3",children:[e.jsx("p",{className:"font-medium text-foreground mb-1",children:"How proration works"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1",children:[e.jsx("li",{children:"We credit you for the unused days left on your current monthly billing period."}),e.jsx("li",{children:"That credit is applied against the $79.99 yearly price, and the remaining difference is charged today to the payment method already on file."}),e.jsx("li",{children:"Your next renewal date moves to one year from today."}),e.jsx("li",{children:"Stripe will email you a receipt with the details."})]})]})]})})]}),e.jsxs(E,{children:[e.jsx(L,{disabled:a,children:"Cancel"}),e.jsx(_,{onClick:r=>{r.preventDefault(),A()},disabled:a,children:a?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"mr-2 h-4 w-4 animate-spin"}),"Upgrading..."]}):"Confirm upgrade"})]})]})})]})};export{H 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.