1import{r as i,j as e,B as f,v as P,s as u,S as O,C as K,f as X,h as we,u as be,w as Se,L as U,A as z,x as Q,m as J,b as ie,d as ne,e as oe}from"./index-CCiodsGZ.js";import{L as N,I as w}from"./label-D25ZngxJ.js";import{T as Ce,a as Pe,b as le,c as ce}from"./tabs-DtWjlgjv.js";import{G as ke,T as V,C as Te}from"./checkbox-C9uLko79.js";import{l as Ie}from"./logo-optimized-RNPzBF3e.js";import{B as Fe,A as Ae,F as De}from"./Footer-PrjI15B1.js";import{P as me,a as ue}from"./PasswordRequirementsBar-D2dWbDwv.js";import{u as xe}from"./usePlatform-D6nQr5aX.js";import{I as he}from"./IOSSubscriptionNotice-D8jKmxiB.js";import{D as Ee,b as qe,c as Me,d as $e,e as Le,C as ee,B as Z,S as E}from"./badge-Bhbic_E_.js";import{a as se,E as ae}from"./eye-D1Jq1KWC.js";import{Z as pe}from"./zap-LO1uc2t-.js";import{T as Be}from"./trending-up-DKmTJJoN.js";import{S as te}from"./shield-zXXJe2-L.js";import{W as Ue,T as Re,U as Oe}from"./ContactSupportDialog-C8uPuSlv.js";import{M as R}from"./mail-SOMQrZEj.js";import{L as de}from"./lock-COuw8W6B.js";import{L as H}from"./loader-circle-BFr5KSsv.js";import"./index-eg0c1132.js";import"./index-70QQoWkT.js";import"./circle-alert-DrLLMRx2.js";import"./circle-check-big-Bs1xPWrp.js";import"./progress-BmUuFGwy.js";import"./smartphone-FE115O3M.js";const We=({open:d,onOpenChange:a,billingCycle:x})=>{const[r,n]=i.useState({email:"",password:"",fullName:""}),[T,o]=i.useState(!1),[y,s]=i.useState(!1),[j,q]=i.useState(!0),[I,M]=i.useState(!1),[W,Y]=i.useState(!1),{isIOSApp:S}=xe(),F=x==="monthly"?"$7.99/month":"$67.12/year (Save 30%)",_=async h=>{if(h.preventDefault(),!r.email||!r.password||!r.fullName){P.error("Please fill in all fields");return}if(!y){P.error("Please meet all password requirements");return}if(!j){P.error("This password has been exposed in data breaches");return}o(!0);try{const{data:C,error:A}=await u.auth.signUp({email:r.email,password:r.password,options:{data:{full_name:r.fullName},emailRedirectTo:`${window.location.origin}/`}});if(A){const m=(A.message||"").toLowerCase();if(m.includes("already registered")||m.includes("user already exists")){const{error:p}=await u.auth.signInWithPassword({email:r.email,password:r.password});if(p)throw p}else throw A}else if(!C.user)throw new Error("Failed to create account");const $=[200,400,800,1600];let D=!1;for(const m of $){const{data:{session:p}}=await u.auth.getSession();if(p!=null&&p.user){D=!0;break}await new Promise(B=>setTimeout(B,m))}if(!D){P.error("Could not verify your session. Please sign in and try again.");return}if(S){P.success("Account ready! Open the subscription screen to purchase via Apple."),a(!1),o(!1);return}const G=x==="monthly"?O.standard.monthly:O.standard.yearly,{data:b,error:L}=await u.functions.invoke("create-checkout",{body:{priceId:G,tier:"standard",billingCycle:x}});if(L)throw L;b!=null&&b.url&&window.open(b.url,"_blank")}catch(C){console.error("Quick signup error:",C),P.error(C.message||"Failed to create account")}finally{o(!1)}};return e.jsx(Ee,{open:d,onOpenChange:a,children:e.jsxs(qe,{className:"sm:max-w-md",children:[e.jsxs(Me,{children:[e.jsx($e,{children:"Create Account & Subscribe"}),e.jsx(Le,{children:S?`Sign up for the ${x} plan`:`Sign up to subscribe to the ${x} plan at ${F}`})]}),e.jsxs("form",{onSubmit:_,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"quick-name",children:"Full Name"}),e.jsx(w,{id:"quick-name",type:"text",placeholder:"John Doe",value:r.fullName,onChange:h=>n({...r,fullName:h.target.value}),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"quick-email",children:"Email"}),e.jsx(w,{id:"quick-email",type:"email",placeholder:"[email protected]",value:r.email,onChange:h=>n({...r,email:h.target.value}),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"quick-password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(w,{id:"quick-password",type:I?"text":"password",placeholder:"Create a strong password",className:"pr-10",value:r.password,onChange:h=>n({...r,password:h.target.value}),required:!0}),e.jsx("button",{type:"button",onClick:()=>M(!I),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,
1children:I?e.jsx(se,{className:"w-4 h-4"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Must be at least 8 characters and include uppercase, lowercase, number, and at least 2 special characters."}),e.jsx(me,{password:r.password,onChange:s}),e.jsx(ue,{password:r.password,onChange:q})]}),e.jsx(f,{type:"submit",className:"w-full",disabled:T||!y||!j,children:T?"Creating Account...":S?"Create Account & Start Free Trial":"Create Account & Subscribe"})]}),e.jsx(he,{open:W,onOpenChange:Y})]})})},Ye=()=>{const d=[{title:"Core Features",icon:e.jsx(pe,{className:"w-5 h-5"}),color:"text-primary",features:[{name:"Unlimited envelopes"},{name:"Unlimited receipt scans"},{name:"Unlimited statement uploads"},{name:"CSV import/export"},{name:"Multi-currency support"},{name:"Multi-language support",comingSoon:!0}]},{title:"Smart Features",icon:e.jsx(Fe,{className:"w-5 h-5"}),color:"text-secondary",features:[{name:"AI-Powered Transaction Categorization",isAI:!0},{name:"AI Budget Assistant",isAI:!0},{name:"Envelope templates"}]},{title:"Advanced Features",icon:e.jsx(Be,{className:"w-5 h-5"}),color:"text-success",features:[{name:"Savings goals tracking"},{name:"Envelope rollover to next month",isNew:!0},{name:"Bank account connections",isNew:!0}]}];return e.jsx("div",{className:"space-y-6",children:d.map((a,x)=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:`flex items-center gap-2 ${a.color}`,children:[a.icon,e.jsx("h4",{className:"font-semibold",children:a.title})]}),e.jsx("div",{className:"grid gap-2",children:a.features.map((r,n)=>e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg group",children:[e.jsx(ee,{className:"w-4 h-4 text-primary shrink-0 group-hover:scale-110 transition-transform"}),e.jsx("span",{className:"text-sm flex-1",children:r.name}),r.isAI&&e.jsxs(Z,{variant:"secondary",className:"text-xs",children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),"AI"]}),r.comingSoon&&e.jsx(Z,{variant:"default",className:"text-xs bg-blue-500 hover:bg-blue-600",children:"Coming Soon"}),r.isNew&&e.jsx(Z,{variant:"default",className:"text-xs bg-amber-500 hover:bg-amber-600 text-white",children:"New"})]},n))})]},x))})},_e=()=>{const d=[{icon:e.jsx(te,{className:"w-6 h-6 text-primary"}),title:"Bank-Level Security",description:"256-bit encryption"},{icon:e.jsx(pe,{className:"w-6 h-6 text-secondary"}),title:"AI-Powered",description:"Smart automation"},{icon:e.jsx(Ue,{className:"w-6 h-6 text-success"}),title:"Zero Budget Limits",description:"Unlimited envelopes"},{icon:e.jsx(ke,{className:"w-6 h-6 text-warning"}),title:"Multi-Language",description:"Coming Soon"}];return e.jsx("div",{className:"py-12 border-t bg-muted/20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h3",{className:"text-2xl font-bold text-center mb-8",children:"Why Choose SmartPenny"}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 max-w-4xl mx-auto",children:d.map((a,x)=>e.jsx(K,{className:"text-center hover:shadow-medium transition-shadow",children:e.jsxs(X,{className:"pt-6 pb-6 space-y-2",children:[e.jsx("div",{className:"flex justify-center",children:a.icon}),e.jsx("p",{className:"font-semibold text-sm",children:a.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.description})]})},x))})]})})},k={name:"SmartPenny Plus",monthlyPrice:7.99,yearlyPrice:67.12,features:["Unlimited envelopes","Unlimited receipt scans","Unlimited statement uploads","CSV import/export","Multi-currency support","ð§ Smart transaction learning","Savings goals tracking","AI Budget Assistant","Envelope templates","ð§ Enhanced smart learning","Envelope rollover to next month","Bank account connections"]},gs=()=>{const d=we(),{toast:a}=be(),[x,r]=i.useState("signup"),[n,T]=i.useState("monthly"),[o,y]=i.useState(!1),[s,j]=i.useState({email:"",password:"",fullName:"",agreedToTerms:!1}),[q,I]=i.useState(!1),[M,W]=i.useState(!0),[Y,S]=i.useState(!1),[F,_]=i.useState(!1),[h,C]=i.useState(!1),[A,$]=i.useState(!1),[D,G]=i.useState(!1),[b,L]=i.useState(null),{isIOSApp:m}=xe(),[p]=Se(),B=p.get("error"),l=p.get("returnUrl"),[ge,fe]=i.useState(!1);i.useEffect(()=>{const t=p.get("mode");(t==="signin"||t==="signup")&&r(t)},[p]);const re=B?{invalid_session:"Your session became invalid during checkout. Please sign in again.",no_session:"You are not signed in. Please sign in to continue.",sync_timeout:"Subscription sync timed out. Please sign in again."}
1[B]??"Please sign in again.":null,ye=async()=>{try{await u.auth.signOut()}finally{try{localStorage.clear()}catch{}window.location.replace("/get-started")}},je=async t=>{if(t.preventDefault(),!s.email||!s.password||!s.fullName){a({variant:"destructive",title:"Missing Information",description:"Please fill in all fields."});return}if(!s.agreedToTerms){a({variant:"destructive",title:"Terms Required",description:"Please agree to the Terms of Service and Privacy Policy."});return}if(!q){a({variant:"destructive",title:"Password Requirements Not Met",description:"Password must meet all complexity requirements."});return}if(!M){a({variant:"destructive",title:"Insecure Password",description:"This password has been exposed in data breaches. Please choose a different password."});return}y(!0);try{const{data:c,error:g}=await u.auth.signUp({email:s.email,password:s.password,options:{data:{full_name:s.fullName},emailRedirectTo:`${window.location.origin}/`}});if(g)throw g;if(!c.user)throw new Error("Failed to create account");try{await u.functions.invoke("send-welcome-email",{body:{email:s.email,fullName:s.fullName}}),console.log("Welcome email sent")}catch(v){console.error("Error sending welcome email:",v)}if(l!=null&&l.includes("/invite/")){const{data:{session:v}}=await u.auth.getSession();v!=null&&v.user?(console.log("[GetStarted] Post-signup session live â navigating directly to invite URL:",l),a({title:"Account created!",description:"Redirecting you to accept the invitation..."}),d(l)):(console.log("[GetStarted] Post-signup session not live â confirmation required for invite URL:",l),L(l),G(!0),a({title:"Account created!",description:"Check your email to confirm your address, then return to accept the invitation."}))}else a({title:"Welcome to SmartPenny!",description:"You're now signed in! Your 7-day free trial has started."}),d(l||"/")}catch(c){console.error("Sign up error:",c),a({variant:"destructive",title:"Sign Up Failed",description:c.message||"Failed to create account. Please try again."})}finally{y(!1)}},ve=async t=>{if(t.preventDefault(),!s.email||!s.password){a({variant:"destructive",title:"Missing Information",description:"Please enter your email and password."});return}y(!0);try{const{data:c,error:g}=await u.auth.signInWithPassword({email:s.email,password:s.password});if(g)throw g;c.user&&(a({title:"Welcome back!",description:l!=null&&l.includes("/invite/")?"Redirecting you to accept your invitation...":"You've successfully signed in."}),d(l||"/"))}catch(c){console.error("Sign in error:",c),a({variant:"destructive",title:"Sign In Failed",description:c.message||"Invalid email or password."})}finally{y(!1)}},Ne=async()=>{if(m){$(!0);return}const{data:{user:t}}=await u.auth.getUser();if(!t){S(!0);return}y(!0);try{const c=n==="monthly"?O.standard.monthly:O.standard.yearly,{data:g,error:v}=await u.functions.invoke("create-checkout",{body:{priceId:c,tier:"standard",billingCycle:n}});if(v)throw v;g!=null&&g.url&&window.open(g.url,"_blank")}catch(c){console.error("Checkout error:",c),a({variant:"destructive",title:"Checkout Failed",description:c.message||"Failed to start checkout"})}finally{y(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx("header",{className:"sticky top-[calc(var(--sat)+0px)] z-50 border-b border-border/50 backdrop-blur-lg bg-gradient-to-r from-primary/5 via-secondary/5 to-primary/5",children:e.jsx("div",{className:"container mx-auto px-4 py-5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:Ie,alt:"SmartPenny logo",className:"w-10 h-10"}),e.jsx("h1",{className:"text-2xl font-bold bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent",children:"SmartPenny"})]}),e.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[e.jsx(Re,{}),e.jsx(U,{to:"/",children:e.jsxs(f,{variant:"ghost",size:"sm",className:"gap-1",children:[e.jsx(Ae,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Top"})]})})]})]})})}),!ge&&re&&e.jsx("div",{className:"bg-background",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs(z,{variant:"destructive",className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(Q,{children:"We need you to sign in again"}),e.jsx(J,{children:re})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"outline",onClick:()=>fe(!0),children:"Dismiss"}),e.jsx(f,{onClick:ye,children:"Reset session and sign in"})]})]})})}),D&&b&&e.jsx("div",{className:"bg-background border-b",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs(z,{className:"bg-primary/5 border-primary/20",children:[e.jsx(R,{className:"h-4 w-4 text-primary"}),e.jsx(Q,{className:"text-primary",children:"Account created â confirm your email first"}),e.jsxs(J,{className:"space-y-3",children:[e.jsxs("p",{children:["We sent a confirmation link to ",e.jsx("strong",{children:s.email}),". Click that link to verify your account, then come back and click below."]}),e.jsx(f,{size:"sm",variant:"default",onClick:()=>d(b),children:"Continue to Invitation"})]})]})})}),!D&&(l==null?void 0:l.includes("/invite/"))&&e.jsx("div",{className:"bg-background border-b",children:e.jsx("div",{className:"container mx-auto px-4 py-4",children:e.jsxs(z,{className:"bg-primary/5 border-primary/20",children:[e.jsx(R,{className:"h-4 w-4 text-primary"}),e.jsx(Q,{className:"text-primary",children:"Joint Account Invitation"}),e.jsx(J,{children:"You've been invited to join a joint budget account. Sign up or sign in to continue."})]})})}),e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-primary/10 via-secondary/10 to-primary/5 py-16 lg:py-24",children:[e.jsx("div",{className:"absolute inset-0 bg-grid-pattern opacity-[0.03]"}),e.jsx("div",{className:"container mx-auto px-4 relative z-10",children:e.jsxs("div",{className:"text-center max-w-3xl mx-auto
1space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20",children:[e.jsx(E,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium text-primary",children:"Start Your Free Trial Today"})]}),e.jsxs("h2",{className:"text-4xl lg:text-6xl font-bold text-foreground leading-tight",children:["Take Control of Your",e.jsx("span",{className:"bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent",children:" Finances"})]}),e.jsxs("p",{className:"text-lg lg:text-xl text-muted-foreground max-w-2xl mx-auto",children:["Transform your budgeting with AI-powered insights and envelope budgeting.",e.jsx("strong",{className:"text-foreground",children:" Sign up and start saving money."})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-6 text-sm text-muted-foreground pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-primary"}),e.jsx("span",{children:"Bank-level encryption"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-4 h-4 text-secondary"}),e.jsx("span",{children:"7-day free trial"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-success"}),e.jsx("span",{children:"Start saving today"})]})]})]})})]}),e.jsx("div",{className:"flex-1 py-12",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"grid grid-cols-1 gap-8 max-w-3xl mx-auto",children:[e.jsxs(K,{className:"shadow-strong border-border/50 hover:shadow-xl transition-all duration-300 animate-fade-in",children:[e.jsxs(ie,{children:[e.jsx(ne,{className:"text-3xl font-bold",children:"Get Started"}),e.jsx(oe,{className:"text-base",children:"Create your account or sign in to continue"})]}),e.jsx(X,{children:e.jsxs(Ce,{value:x,onValueChange:t=>r(t),children:[e.jsxs(Pe,{className:"grid w-full grid-cols-2 mb-6",children:[e.jsx(le,{value:"signup",children:"Sign Up"}),e.jsx(le,{value:"signin",children:"Sign In"})]}),e.jsx(ce,{value:"signup",children:e.jsxs("form",{onSubmit:je,className:"space-y-4",id:"signup-form",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"name",className:"text-sm font-medium",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(Oe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(w,{id:"name",placeholder:"John Doe",className:"pl-10",value:s.fullName,onChange:t=>j({...s,fullName:t.target.value}),disabled:o,required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(R,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(w,{id:"email",type:"email",placeholder:"[email protected]",className:"pl-10",value:s.email,onChange:t=>j({...s,email:t.target.value}),disabled:o,required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(w,{id:"password",type:F?"text":"password",className:"pl-10 pr-10",value:s.password,onChange:t=>j({...s,password:t.target.value}),disabled:o,required:!0}),e.jsx("button",{type:"button",onClick:()=>_(!F),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:F?e.jsx(se,{className:"w-4 h-4"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Must be at least 8 characters and include uppercase, lowercase, number, and at least 2 special characters (!#$%^&*()_+/*-+)."}),e.jsx(me,{password:s.password,onChange:I}),e.jsx(ue,{password:s.password,onChange:W})]}),e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(Te,{id:"terms",checked:s.agreedToTerms,onCheckedChange:t=>j({...s,agreedToTerms:t})}),e.jsxs("label",{htmlFor:"terms",className:"text-sm text-muted-foreground leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["I agree to the"," ",e.jsx(U,{to:"/terms",className:"text-primary hover:underline",children:"Terms of Service"}),","," ",e.jsx(U,{to:"/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),", and"," ",e.jsx(U,{to:"/disclaimer",className:"text-primary hover:underline",children:"Disclaimer"})]})]}),e.jsx(f,{type:"submit",className:"w-full h-12 text-base font-semibold bg-gradient-to-r from-primary to-secondary hover:from-primary/90 hover:to-secondary/90 shadow-medium hover:shadow-strong transition-all hover:scale-[1.02]",disabled:o||!s.agreedToTerms||!q||!M,children:o?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating Account..."]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),"Start Free Trial"]})})]})}),e.jsx(ce,{value:"signin",children:e.jsxs("form",{onSubmit:ve,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"signin-email",className:"text-sm font-medium",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(R,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(w,{id:"signin-email",type:"email",placeholder:"[email protected]",className:"pl-10",value:s.email,onChange:t=>j({...s,email:t.target.value}),disabled:o,required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{htmlFor:"signin-password",className:"text-sm font-medium",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(de,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(w,{id:"signin-password",type:h?"text":"password",className:"pl-10 pr-10",value:s.password,onChange:t=>j({...s,password:t.target.value}),disabled:o,required:!0}),e.jsx("button",{type:"button",onClick:()=>C(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,
1children:h?e.jsx(se,{className:"w-4 h-4"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"text-right",children:e.jsx(f,{type:"button",variant:"link",className:"text-sm text-primary hover:underline p-0 h-auto",onClick:()=>d("/reset-password"),children:"Forgot password?"})})]}),e.jsx(f,{type:"submit",className:"w-full h-12 text-base font-semibold bg-gradient-to-r from-primary to-secondary hover:from-primary/90 hover:to-secondary/90 shadow-medium hover:shadow-strong transition-all hover:scale-[1.02]",disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),"Signing in..."]}):"Sign In"})]})})]})})]}),e.jsxs(K,{className:"border-2 border-primary/50 shadow-strong bg-gradient-to-br from-card to-primary/5 hover:shadow-xl hover:scale-[1.01] transition-all duration-300 animate-slide-up",children:[e.jsxs(ie,{children:[e.jsx(ne,{className:"text-3xl font-bold",children:"SmartPenny Plus"}),e.jsx(oe,{className:"text-base",children:"Everything you need for smart budgeting"})]}),e.jsxs(X,{className:"space-y-6",children:[e.jsx(Ye,{}),e.jsxs("div",{className:"border-t pt-6 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground font-medium text-center",children:"Select billing cycle:"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx("button",{type:"button",onClick:()=>T("monthly"),className:`relative p-6 rounded-lg border-2 transition-all text-left ${n==="monthly"?"border-primary ring-2 ring-primary/20 bg-primary/5":"border-border hover:border-primary/50 bg-card"}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Monthly"}),e.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${n==="monthly"?"border-primary bg-primary":"border-muted-foreground"}`,children:n==="monthly"&&e.jsx(ee,{className:"w-3 h-3 text-primary-foreground"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-4xl font-bold text-foreground",children:["$",k.monthlyPrice]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"/month"}),e.jsxs("p",{className:"text-sm text-primary font-medium mt-2",children:["$",(k.monthlyPrice*12).toFixed(2),"/year"]})]}),e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(V,{className:"w-4 h-4 text-success"}),e.jsx("span",{children:"$0.27/day"})]}),e.jsx("div",{className:"text-sm h-5","aria-hidden":"true"})]})]})}),e.jsxs("button",{type:"button",onClick:()=>T("yearly"),className:`relative p-6 rounded-lg border-2 transition-all text-left ${n==="yearly"?"border-primary ring-2 ring-primary/20 bg-primary/5":"border-border hover:border-primary/50 bg-card"}`,children:[!m&&e.jsx("div",{className:"absolute -top-3 -right-3",children:e.jsx("div",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full bg-success text-success-foreground text-xs font-semibold shadow-md",children:"Save 30%"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Yearly"}),e.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${n==="yearly"?"border-primary bg-primary":"border-muted-foreground"}`,children:n==="yearly"&&e.jsx(ee,{className:"w-3 h-3 text-primary-foreground"})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-4xl font-bold text-foreground",children:["$",k.yearlyPrice]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"/year"}),!m&&e.jsxs("p",{className:"text-sm text-primary font-medium mt-2",children:["$",(k.yearlyPrice/12).toFixed(2),"/month"]})]}),e.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(V,{className:"w-4 h-4 text-success"}),e.jsx("span",{children:"$0.18/day"})]}),!m&&e.jsxs("div",{className:"text-sm text-success font-medium",children:["ð° Save $",(k.monthlyPrice*12-k.yearlyPrice).toFixed(2),"/year"]})]})]})]})]}),!m&&e.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground pt-2",children:[e.jsx(te,{className:"w-3 h-3"}),e.jsx("span",{children:"30-day money-back guarantee"})]})]}),e.jsx(f,{onClick:Ne,className:"w-full h-12 text-base font-semibold bg-gradient-to-r from-primary to-secondary hover:from-primary/90 hover:to-secondary/90 shadow-medium hover:shadow-strong transition-all hover:scale-[1.02]",disabled:o,children:o?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"w-4 h-4 mr-2"}),m?"Start Free Trial":"Subscribe Now"]})}),m&&e.jsx(f,{variant:"outline",className:"w-full",onClick:async()=>{try{const{error:t}=await u.functions.invoke("check-subscription");if(t)throw t;a({title:"Purchases restored successfully"}),d("/")}catch{a({title:"No purchases found to restore",variant:"destructive"})}},children:"Restore Purchases"})]})]})]})]})})}),e.jsx(_e,{}),e.jsx(De,{}),e.jsx(We,{open:Y,onOpenChange:S,billingCycle:n}),e.jsx(he,{open:A,onOpenChange:$})]})};export{gs 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.