PageSourceSearch

https://www.bizware.ai/assets/checkout.return-kE9GaIYg.js

js bizware.ai collected 2026-10-05 11:52:55 UTC 7,146 bytes, 1 lines download raw bytes

1import{U as W,b as z,u as U,r,j as e,B as l,L,s as d,t as q}from"./index-BI34Wull.js";import{I as m}from"./input-DSEt1Ik3.js";import{L as u}from"./label-B11EJTGs.js";import{D as $,a as G,b as H,c as M,d as T,e as V}from"./dialog-CchBIL7t.js";import{d as J}from"./payments.functions-CZi9RQ9j.js";import{c as E}from"./subscription-claim.functions-BCMqpECy.js";import{g as K}from"./stripe-Css1BWh0.js";import{c as Q}from"./createLucideIcon-4AT48GiE.js";import{C as X}from"./circle-check-BXt0MKno.js";import{L as y}from"./loader-circle-RJ_lzir4.js";import{A as j}from"./arrow-right-Bz8PyTzT.js";import"./index-Bv6t4qTQ.js";import"./index-CneZgM9-.js";import"./index-DYIppBmS.js";import"./Combination-BhuTL0bJ.js";import"./index-B4j4u9tl.js";import"./x-CYSo_sK4.js";const Z=[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],ee=Q("mail-check",Z);function ye(){const{session_id:n}=W.useSearch(),{user:p,loading:_}=z(),F=U(),[o,Y]=r.useState(null),[i,h]=r.useState(!1),[a,w]=r.useState("unconfirmed"),[f,b]=r.useState(""),[c,k]=r.useState(""),[x,I]=r.useState(""),[N,v]=r.useState(!1),[B,g]=r.useState(!1);r.useEffect(()=>{typeof window<"u"&&window.fbq&&window.fbq("track","Subscribe")},[]),r.useEffect(()=>{if(w("unconfirmed"),!n){h(!0);return}h(!1);let s=!1;return(async()=>{try{const t=await J({data:{sessionId:n,environment:K()}});!s&&"email"in t&&(w(t.outcome),Y(t.email),t.name&&b(t.name),t.phone&&k(t.phone))}catch{}finally{s||h(!0)}})(),()=>{s=!0}},[n]),r.useEffect(()=>{p&&E({}).catch(()=>{})},[p]);const O=!_&&!p,C=a==="trial"||a==="paid"||a==="complete",P=i?a==="trial"?"Your free trial has started":a==="paid"?"Payment complete":a==="complete"?"Checkout complete":a==="pending"?"Your payment is processing":"Checkout status unavailable":"Confirming your checkout";async function R(s){if(s.preventDefault(),!!o){v(!0);try{const{data:t,error:S}=await d.auth.signUp({email:o,password:x,options:{emailRedirectTo:`${window.location.origin}/app/onboarding`,data:{display_name:f||o.split("@")[0],...c?{phone:c}:{},terms_accepted:!0,terms_accepted_at:new Date().toISOString()}}});if(S)throw S;if(!t.session){const{error:A}=await d.auth.signInWithPassword({email:o,password:x});if(A){g(!0);return}}const{data:D}=await d.auth.getUser();D.user&&await d.from("profiles").upsert({user_id:D.user.id,display_name:f||o.split("@")[0],...c?{phone:c}:{}},{onConflict:"user_id"}).then(()=>{},()=>{}),await E({}).catch(()=>{}),await F({to:"/app/onboarding"})}catch(t){q.error(t instanceof Error?t.message:"Could not create your account")}finally{v(!1)}}}return e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-6",style:{background:"var(--gradient-hero)"},children:[e.jsx($,{open:B,onOpenChange:g,children:e.jsxs(G,{children:[e.jsxs(H,{
1children:[e.jsx("div",{className:"mx-auto mb-2 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:e.jsx(ee,{className:"h-6 w-6 text-primary"})}),e.jsx(M,{className:"text-center",children:"Check your email"}),e.jsxs(T,{className:"space-y-3 pt-2",children:[e.jsxs("span",{className:"block",children:["We sent a confirmation link to"," ",e.jsx("span",{className:"font-semibold text-foreground",children:o}),". Click it to verify your email and we'll take you straight into setting up your playbook."]}),e.jsxs("span",{className:"block",children:["Don't see it? Check your ",e.jsx("span",{className:"font-semibold text-foreground",children:"spam or junk folder"}),"."]})]})]}),e.jsx(V,{children:e.jsx(l,{onClick:()=>g(!1),className:"w-full",children:"Got it"})})]})}),e.jsxs("div",{className:"max-w-md w-full rounded-3xl border border-border p-10 text-center",style:{background:"var(--gradient-card)",boxShadow:"var(--shadow-card)"},children:[e.jsx("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-emerald-500/10",children:C?e.jsx(X,{className:"h-7 w-7 text-emerald-500"}):e.jsx(y,{className:`h-7 w-7 text-primary ${i?"":"animate-spin"}`})}),e.jsx("h1",{className:"text-3xl mb-3",children:P}),!i||!C?e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:i?a==="pending"?"We’re waiting for payment confirmation. Please check back shortly.":"We couldn’t confirm this checkout. Check your email for a receipt or contact support before trying again.":"Checking your checkout details…"}):O?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:[a==="trial"?"$0 today. ":a==="paid"?"Your payment was successful. ":"","One last step — create your login and we'll set up Biz for your team.",o&&e.jsxs(e.Fragment,{children:[" We'll use ",e.jsx("span",{className:"font-semibold text-foreground",children:o}),"."]})]}),i?o?e.jsxs("form",{onSubmit:R,className:"space-y-4 text-left",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"name",children:"Your name"}),e.jsx(m,{id:"name",value:f,onChange:s=>b(s.target.value),placeholder:"Jane Doe"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"email",children:"Email"}),e.jsx(m,{id:"email",value:o,readOnly:!0,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"phone",children:"Phone"}),e.jsx(m,{id:"phone",type:"tel",value:c,onChange:s=>k(s.target.value),placeholder:"(555) 555-5555"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"password",children:"Create a password"}),e.jsx(m,{id:"password",type:"password",required:!0,minLength:6,value:x,onChange:s=>I(s.target.value),placeholder:"At least 6 characters"})]}),e.jsx(l,{type:"submit",disabled:N,className:"w-full uppercase tracking-wider",style:{background:"var(--gradient-primary)"},children:N?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:["Create my account ",e.jsx(j,{className:"ml-1.5 h-4 w-4"})]})}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"No email to verify — you'll go straight into building your playbook."})]}):e.jsx(L,{to:"/auth",search:{mode:"signup",next:"/app/onboarding"},children:e.jsxs(l,{className:"w-full uppercase tracking-wider",style:{background:"var(--gradient-primary)"},children:["Create your account ",e.jsx(j,{className:"ml-1.5 h-4 w-4"})]})}):e.jsx(l,{disabled:!0,className:"w-full uppercase tracking-wider",style:{background:"var(--gradient-primary)"},children:e.jsx(y,{className:"h-4 w-4 animate-spin"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:a==="trial"?"Your free trial has started. Nothing was charged today.":a==="paid"?"Your payment was successful. You can continue to Bizware.":"Your checkout is complete. You can continue to Bizware."}),e.jsx(L,{to:"/app",children:e.jsxs(l,{className:"w-full uppercase tracking-wider",style:{background:"var(--gradient-primary)"},children:["Continue to Bizware ",e.jsx(j,{className:"ml-1.5 h-4 w-4"})]})})]}),n&&e.jsxs("p",{className:"mt-4 text-[10px] text-muted-foreground
1/60 break-all",children:["Ref: ",n]})]})]})}export{ye 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.