'use client';
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),z=require("react"),n=require("@heroui/react"),H=require("framer-motion"),P=require("./sign-up-form.cjs"),Y=require("../../../hooks/use-config.cjs"),k=require("../../../hooks/use-theme.cjs"),E=s=>s&&s.__esModule?s:{default:s},G=E(z);function I({variant:s="shadow",className:u="",padding:l="lg",radius:m="lg",shadow:d="md",isBlurred:x=!1,methods:g=["password","oauth","magic-link"],email:p,organizationId:f,invitationToken:a,redirectUrl:j,onSuccess:y,onError:h,title:C,subtitle:b,size:N="md",showBranding:S=!0,disabled:v=!1,requireTerms:D=!0,termsUrl:U="/terms",privacyUrl:$="/privacy",footer:c,header:w,maxWidth:i=450,centered:r=!1}){const{components:M,organizationSettings:R}=Y.useConfig(),{getColorValue:K}=k.useTheme(),q=M.SignUpCard;if(q)return e.jsx(q,{variant:s,className:u,padding:l,radius:m,shadow:d,isBlurred:x,methods:g,email:p,organizationId:f,invitationToken:a,redirectUrl:j,onSuccess:y,onError:h,title:C,subtitle:b,size:N,showBranding:S,disabled:v,requireTerms:D,termsUrl:U,privacyUrl:$,footer:c,header:w,maxWidth:i,centered:r});const L={hidden:{opacity:0,y:20,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{duration:.3,ease:"easeOut"}}},A={maxWidth:typeof i=="number"?`${i}px`:i},o=S&&R?.branding,t=G.default.useMemo(()=>{if(!a)return null;try{const V=atob(a);return JSON.parse(V)}catch{return null}},[a]),F=t?{title:`Join ${t.orgName||"Organization"}`,subtitle:t.inviterName?`${t.inviterName} has invited you to join`:"You've been invited to join"}:o?.customSignUpText?{title:o.customSignUpText.title||"Create your account",subtitle:o.customSignUpText.subtitle||"Join us today"}:{title:"Create your account",subtitle:"Join us today"},O=C||F.title,_=b||F.subtitle,B=[r?"flex items-center justify-center min-h-screen p-4":""].filter(Boolean).join(" "),T=e.jsxs(n.Card,{className:`${u} ${r?"w-full":""}`,style:A,shadow:d,radius:m,isBlurred:x,children:[e.jsx(n.CardHeader,{className:`flex flex-col items-center text-center gap-3 p-${l}`,children:w||e.jsxs(e.Fragment,{children:[o?.logoUrl&&e.jsx("img",{src:o.logoUrl,alt:"Organization Logo",className:"h-12 w-auto mb-2"}),O&&e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:O}),_&&e.jsx("p",{className:"text-default-500 text-sm max-w-sm",children:_}),t&&e.jsxs("div",{className:"bg-primary-50 dark:bg-primary-900/20 rounded-lg px-3 py-2 text-sm",children:[e.jsxs("p",{className:"text-primary-600 dark:text-primary-400",children:[e.jsx("span",{className:"font-medium",children:"Role:"})," ",t.role]}),t.expiresAt&&e.jsxs("p",{className:"text-primary-500 text-xs mt-1",children:["Expires: ",new Date(t.expiresAt).toLocaleDateString()]})]})]})}),e.jsx(n.Divider,{}),e.jsx(n.CardBody,{className:`p-${l}`,children:e.jsx(P.SignUpForm,{methods:g,email:p,organizationId:f,invitationToken:a,redirectUrl:j,onSuccess:y,onError:h,title:void 0,subtitle:void 0,size:N,showBranding:!1,disabled:v,requireTerms:D,termsUrl:U,privacyUrl:$,variant:"minimal",className:"space-y-4",showSignInLink:!0,autoFocus:!0})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(n.Divider,{}),e.jsx(n.CardFooter,{className:`p-${l} text-center`,children:c})]})]}),J=e.jsx(H.motion.div,{initial:"hidden",animate:"visible",variants:L,style:{maxWidth:i},className:r?"w-full":"",children:T});return r?e.jsx("div",{className:B,children:J}):J}exports.SignUpCard=I;
//# sourceMappingURL=sign-up-card.cjs.map
