'use client';
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),S=require("./sign-up-form.cjs"),h=require("./sign-up-modal.cjs"),U=require("./sign-up-card.cjs"),C=e=>e&&e.__esModule?e:{default:e},u=C(g);function i({mode:e="form",modalProps:a={},cardProps:d={},formProps:o={},autoMode:c=!1,...r}){const s=u.default.useMemo(()=>c?typeof window<"u"&&document.querySelector("[data-modal-backdrop]")?"modal":typeof window<"u"&&document.querySelector("[data-card-container]")?"card":"form":e,[c,e]);switch(c?s:e){case"modal":return t.jsx(h.SignUpModal,{...r,...a});case"card":return t.jsx(U.SignUpCard,{...r,...d});case"form":default:return t.jsx(S.SignUpForm,{...r,...o})}}function x(e){return t.jsx(i,{...e,mode:"form"})}function v(e){return t.jsx(i,{...e,mode:"modal"})}function b(e){return t.jsx(i,{...e,mode:"card"})}function j({invitationToken:e,organizationName:a,inviterInfo:d,title:o,subtitle:c,...r}){const s=u.default.useMemo(()=>{try{const p=atob(e);return JSON.parse(p)}catch{return null}},[e]),l=a||s?.orgName||"the organization",n=d?.name||s?.inviterName,m=o||`Join ${l}`,f=c||(n?`${n} has invited you to join ${l}`:`You've been invited to join ${l}`);return t.jsx(i,{...r,invitationToken:e,organizationId:s?.orgId,title:m,subtitle:f,showBranding:!0})}function y(e){return t.jsx(i,{...e,formProps:{variant:"compact",collectFields:["firstName","lastName"],...e.formProps}})}function N(e){return t.jsx(i,{...e,formProps:{variant:"default",collectFields:["firstName","lastName","username","phoneNumber"],passwordRequirements:{minLength:12,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSymbols:!0},...e.formProps}})}function w(e){return t.jsx(i,{...e,methods:["oauth"],title:"Create your account",subtitle:"Sign up with your social account"})}function q(e){return t.jsx(i,{...e,methods:["magic-link","passkey","oauth"],title:"Create your account",subtitle:"Sign up without a password"})}function k({onSuccess:e,...a}){const[d,o]=u.default.useState("basic"),[c,r]=u.default.useState(null),s=u.default.useCallback(n=>{n.status==="complete"?e?.(n):n.status==="needs_verification"?(r(n),o("verification")):(r(n),o("detailed"))},[e]),l=u.default.useCallback(n=>{n.status==="complete"?e?.(n):(r(n),o("verification"))},[e]);switch(u.default.useCallback(n=>{e?.(n)},[e]),d){case"detailed":return t.jsx(i,{...a,title:"Complete your profile",subtitle:"Tell us a bit more about yourself",formProps:{collectFields:["firstName","lastName","username"],autoFocus:!0,...a.formProps},onSuccess:l});case"verification":return t.jsxs("div",{className:"text-center space-y-4",children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Check your email"}),t.jsx("p",{className:"text-default-500",children:"We've sent a verification link to your email address"}),t.jsx("button",{onClick:()=>o("basic"),className:"text-primary hover:underline",children:"Use a different email"})]});case"basic":default:return t.jsx(i,{...a,formProps:{variant:"minimal",collectFields:[],...a.formProps},onSuccess:s})}}exports.ComprehensiveSignUp=N;exports.OrganizationInviteSignUp=j;exports.PasswordlessSignUp=q;exports.ProgressiveSignUp=k;exports.QuickSignUp=y;exports.SignUp=i;exports.SignUpCardComponent=b;exports.SignUpFormComponent=x;exports.SignUpModalComponent=v;exports.SocialSignUp=w;
//# sourceMappingURL=sign-up.cjs.map
