PageSourceSearch

https://helloreach.ai/assets/checkout-DB67ZFJG.js

js helloreach.ai collected 2026-10-05 14:52:57 UTC 12,646 bytes, 1 lines download raw bytes

1import{g as Q,w as V,r as l,aU as W,K as L,j as e,B as D,ap as X,C as M,a as Z,b as _,m as F,c as U,E as h,y as ee,p as te,l as se}from"./index-DD4Yu2xy.js";import{I as p}from"./input-b2FJrihT.js";import{L as u}from"./label-DWQa2dQ7.js";import{S as ae}from"./switch-Bhh8hifB.js";import{g as re}from"./lifetime-plans-DWOiv8ky.js";import{E as R}from"./eye-off-Deh7veGE.js";import{E as T}from"./eye-BLrfRXoe.js";import"./index-VIbq_cQu.js";function ue(){const[ie,m]=Q(),{toast:c}=V(),[A,f]=l.useState(!1),[t,B]=l.useState(null),[i,y]=l.useState(!1),[b,q]=l.useState(!1),[k,$]=l.useState(!1),[a,O]=l.useState({email:"",firstName:"",lastName:"",password:"",confirmPassword:""}),{currentCurrency:C,formatCurrency:o}=W(),[Y,g]=l.useState(""),[G,N]=l.useState(""),[H,P]=l.useState(!0),E=new URLSearchParams(window.location.search),j=E.get("plan"),d=E.get("interval"),v=E.get("amount");l.useEffect(()=>{if(d==="annual"&&y(!0),!j){m("/launch");return}if(d==="lifetime"&&v){const s=re(j);s?(B({id:s.id,name:`${s.name} Lifetime`,description:s.description,priceMonthly:parseInt(v),priceAnnual:parseInt(v),monthlySendingLimit:s.yearlyCredits,features:s.features}),y(!1)):m("/lifetime");return}L("GET","/api/pricing-plans").then(s=>{const r=s.find(n=>n.id===j);r?B(r):m("/launch")}).catch(s=>{console.error("Error fetching plan:",s),m("/launch")})},[j,d,v,m]),l.useEffect(()=>{if(!t||t.id==="free"){P(!1);return}(async()=>{P(!0);const n=(i?t.priceAnnual:t.priceMonthly)/100,w=i?t.priceAnnual/12/100:t.priceMonthly/100;if(C==="USD")g(o(n)),N(o(w));else try{const S=(await(await fetch("https://api.exchangerate-api.com/v4/latest/USD")).json()).rates[C];if(S){const K=n*S,z=w*S;g(o(K)),N(o(z))}else g(o(n)),N(o(w))}catch(I){console.error("Currency conversion failed:",I),g(o(n)),N(o(w))}P(!1)})()},[t,i,C,o]);const x=(s,r)=>{O(n=>({...n,[s]:r}))},J=async()=>{if(!t){c({title:"Error",description:"Plan not found. Please try again.",variant:"destructive"});return}if(!a.email||!a.firstName){c({title:"Missing Information",description:"Please fill in all required fields.",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email)){c({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}if(!a.password){c({title:"Password Required",description:"Please enter a password for your account.",variant:"destructive"});return}if(a.password.length<8){c({title:"Password Too Short",description:"Password must be at least 8 characters long.",variant:"destructive"});return}if(a.password!==a.confirmPassword){c({title:"Passwords Don't Match",description:"Please make sure your passwords match.",variant:"destructive"});return}if(t.id==="free"){f(!0);try{await L("POST","/api/register",{email:a.email.trim().toLowerCase(),password:a.password,firstName:a.firstName.trim(),lastName:a.lastName.trim(),planId:"free"}),c({title:"Account Created!",description:"Your free account has been created successfully."}),setTimeout(()=>{window.location.href="/auth"},1500)}catch(r){console.error("Registration error:",r),c({title:"Registration Failed",description:r instanceof Error?r.message:"Unable to create your account. Please try again.",variant:"destructive"}),f(!1)}return}f(!0);try{const r=d==="lifetime"?"lifetime":i?"annual":"monthly",n=await L("POST","/api/store-checkout-session",{email:a.email.trim().toLowerCase(),firstName:a.firstName.trim(),lastName:a.lastName.trim(),password:a.password,planId:t.id,interval:r});window.location.href=`/stripe-checkout?token=${n.token}`}catch(r){console.error("Checkout error:",r),c({title:"Checkout Failed",description:r instanceof Error?r.message:"Unable to process your request. Please try again.",variant:"destructive"}),f(!1)}};return t?(i?t.priceAnnual:t.priceMonthly,i?t.priceAnnual/12/100:t.priceMonthly/100,e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-950 dark:to-slate-900",children:e.jsxs("div",{className:"container mx-auto px-6 py-12",children:[e.jsx("div",{className:"flex items-center gap-4 mb-8",children:e.jsxs(D,{variant:"ghost",onClick:()=>m("/pricing"),className:"text-slate-600 hover:text-slate-900 dark:text-slate-400 dark:hover:text-white",children:[e.jsx(X,{className:"w-4 h-4 mr-2"}),"Back to Plans"]})}),e.jsxs("div",{className:"max-w-4xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-12",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx("h1",{className:"text-3xl font-bold text-slate-900 dark:text-white",children:"Complete Your Purchase"}),e.jsxs(M,{className:"bg-white dark:bg-slate-800 border-0 shadow-lg",children:[e.jsxs(Z,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(_,{className:"text-xl font-bold text-slate-900 dark:text-white",children:[t.name," Plan"]}),t.isPopular&&e.jsx(F,{className:"bg-gradient-to-r from-[#EB4C0E] to-[#FF6B33] text-white",children:"Most Popular"})]}
1),e.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:t.description})]}),e.jsxs(U,{className:"space-y-6",children:[t.id!=="free"&&d!=="lifetime"&&e.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 dark:bg-slate-700 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:`font-medium ${i?"text-slate-500":"text-slate-900 dark:text-white"}`,children:"Monthly"}),e.jsx(ae,{checked:i,onCheckedChange:y,className:"data-[state=checked]:bg-[#EB4C0E]"}),e.jsx("span",{className:`font-medium ${i?"text-slate-900 dark:text-white":"text-slate-500"}`,children:"Annual"})]}),i&&e.jsx(F,{variant:"secondary",className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Save 30%"})]}),d==="lifetime"&&e.jsx("div",{className:"p-4 bg-gradient-to-r from-purple-50 to-pink-50 dark:from-purple-950 dark:to-pink-950 rounded-lg",children:e.jsx(F,{className:"bg-gradient-to-r from-purple-600 to-pink-600 text-white border-0",children:"🚀 Limited Time Lifetime Deal"})}),e.jsx("div",{className:"text-center p-6 bg-gradient-to-br from-[#FFF4EC] to-[#FFF4EC] dark:from-[#EB4C0E]/20 dark:to-[#EB4C0E]/20 rounded-lg",children:t.id==="free"?e.jsx("div",{className:"text-4xl font-bold text-slate-900 dark:text-white",children:"Free"}):H?e.jsx("div",{className:"h-12 w-32 mx-auto animate-pulse bg-gray-200 dark:bg-gray-700 rounded"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-4xl font-bold text-green-600",children:[Y,e.jsx("span",{className:"text-lg font-normal text-slate-500",children:d==="lifetime"?"":i?"/year":"/month"})]}),d==="lifetime"?e.jsx("div",{className:"text-sm text-[#EB4C0E] dark:text-[#FF6B33] mt-2",children:"One-time payment • Lifetime access"}):i?e.jsxs("div",{className:"text-sm text-green-600 mt-2",children:[G,"/month billed annually"]}):null]})}),t.id==="free"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-green-500"}),e.jsxs("span",{className:"text-slate-700 dark:text-slate-300",children:[t.campaignLimit===-1?"Unlimited":t.campaignLimit," email campaigns/month"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-green-500"}),e.jsxs("span",{className:"text-slate-700 dark:text-slate-300",children:[t.monthlySendingLimit===-1?"Unlimited":`~${t.monthlySendingLimit?.toLocaleString()}`," emails/month"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-green-500"}),e.jsx("span",{className:"text-slate-700 dark:text-slate-300",children:"Community support"})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-green-500"}),e.jsx("span",{className:"text-slate-700 dark:text-slate-300",children:"Automated email campaigns"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-green-500"}),e.jsxs("span",{className:"text-slate-700 dark:text-slate-300",children:[t.monthlySendingLimit===-1?"Unlimited":`~${t.monthlySendingLimit?.toLocaleString()}`," emails/",d==="lifetime"?"year":"month"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 pt-4 border-t border-slate-200 dark:border-slate-700",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(ee,{className:"w-6 h-6 text-green-500 mx-auto mb-2"}),e.jsx("div",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Secure Payment"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx(te,{className:"w-6 h-6 text-[#EB4C0E] mx-auto mb-2"}),e.jsx("div",{className:"text-xs text-slate-600 dark:text-slate-400",children:"Instant Access"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx(se,{className:"w-6 h-6 text-[#EB4C0E] mx-auto mb-2"}),e.jsx("div",{className:"text-xs text-slate-600 dark:text-slate-400",children:"No Hidden Fees"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-slate-900 dark:text-white",children:"Account Information"}),e.jsx(M,{className:"bg-white dark:bg-slate-800 border-0 shadow-lg",children:e.jsxs(U,{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(u,{htmlFor:"email",className:"text-slate-700 dark:text-slate-300",children:"Email Address *"}),e.jsx(p,{id:"email",type:"email",placeholder:"[email protected]",value:a.email,onChange:s=>x("email",s.target.value),className:"mt-1",required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(u,{htmlFor:"firstName",className:"text-slate-700 dark:text-slate-300",children:"First Name *"}),e.jsx(p,{id:"firstName",type:"text",placeholder:"John",value:a.firstName,onChange:s=>x("firstName",s.target.value),className:"mt-1",required:!0})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"lastName",className:"text-slate-700 dark:text-slate-300",children:"Last Name"}),e.jsx(p,{id:"lastName",type:"text",placeholder:"Doe",value:a.lastName,onChange:s=>x("lastName",s.target.value),className:"mt-1"})]})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"password",className:"text-slate-700 dark:text-slate-300",children:"Password *"}),e.jsxs("div",{className:"relative",children:[e.jsx(p,{id:"password",type:b?"text":"password",placeholder:"At least 8 characters",value:a.password,onChange:s=>x("password",s.target.value),className:"mt-1 pr-10",required:!0,"data-testid":"input-password"}),e.jsx("button",{type:"button",onClick:()=>q(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200","data-testid":"button-toggle-password",children:b?e.jsx(R,{className:"w-4 h-4"}):e.jsx(T,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx(u,{htmlFor:"confirmPassword",className:"text-slate-700 dark:text-slate-300",children:"Confirm Password *"}),e.jsxs("div",{className:"relative",children:[e.jsx(p,{id:"confirmPassword",type:k?"text":"password",placeholder:"Re-enter your password",value:a.confirmPassword,onChange:s=>x("confirmPassword",s.target.value),className:"mt-1 pr-10",required:!0,"data-testid":"input-confirm-password"}),e.jsx("button",{type:"button",onClick:()=>$(!k),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200","data-testid":"button-toggle-confirm-password",children:k?e.jsx(R,{className:"w-4 h-4"}):e.jsx(T,{className:"w-4 h-4"})})]})]})]}),e.jsx("div",{className:"p-4 bg-slate-50 dark:bg-slate-700 rounded-lg",children:e.jsx("p",{className:"text-xs text-slate-600 dar
1k:text-slate-400",children:"By proceeding, you agree to our Terms of Service and Privacy Policy. You can cancel your subscription at any time."})}),e.jsx(D,{onClick:J,disabled:A,className:"w-full py-4 text-lg font-semibold bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white","data-testid":"button-get-started",children:A?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"animate-spin w-4 h-4 border-2 border-white border-t-transparent rounded-full"}),"Processing..."]}):"Create Account"}),t.id!=="free"&&e.jsx("p",{className:"text-center text-sm text-slate-500 dark:text-slate-400",children:"Secure payment powered by Stripe"})]})})]})]})]})})):e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-950 dark:to-slate-900 flex items-center justify-center",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-[#EB4C0E] border-t-transparent rounded-full"})})}export{ue 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.