"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["265"],{81170:function(t,e,i){i.r(e),i.d(e,{WaitlistModal:()=>D,Waitlist:()=>z});var l=i(61564),n=i(90231),r=i(23707),a=i(63269),o=i(8640),s=i(90451),c=i(22861),d=i(44607),h=i(54132),u=i(42265);i(50036),i(1589);var m=i(52454),Y=i(76153),p=i(4468),g=i(46245),f=i(18272),w=i(58920),v=i(84901),A=i(98388),b=i(4964),I=i(44374);let y=t=>{let e=(0,n.ho)(),i=(0,a.f0)(),o=(0,v.m)(),{navigate:d}=(0,b.r)(),h=(0,s.Y)(),{formState:u}=t,y=(0,g.X)({onNextStep:()=>i.setError(void 0)}),z=async t=>{t.preventDefault(),o.setLoading(),i.setLoading(),i.setError(void 0);let l={emailAddress:u.emailAddress.value};await e.joinWaitlist(l).then(()=>{y.nextStep(),setTimeout(()=>{h.afterJoinWaitlistUrl&&d(h.afterJoinWaitlistUrl)},2e3)}).catch(t=>{(0,p.H4)(t,[u.emailAddress],i.setError)}).finally(()=>{o.setIdle(),i.setIdle()})};return(0,l.FD)(g.s,{...y.props,children:[(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,c.G)("waitlist.start.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,c.G)("waitlist.start.subtitle")})]}),(0,l.Y)(r.Z.Alert,{children:i.error}),(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.FD)(m.l.Root,{onSubmit:z,gap:8,children:[(0,l.Y)(f.fv,{gap:6,children:(0,l.Y)(m.l.ControlRow,{elementId:"emailAddress",children:(0,l.Y)(m.l.PlainInput,{...u.emailAddress.props,isRequired:!0})})}),(0,l.Y)(f.fv,{center:!0,children:(0,l.Y)(m.l.SubmitButton,{localizationKey:(0,c.G)("waitlist.start.formButton")})})]})})]}),(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,c.G)("waitlist.success.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,c.G)("waitlist.success.subtitle")})]}),h.afterJoinWaitlistUrl&&(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.Y)(f.fv,{center:!0,children:(0,l.FD)(f.so,{gap:2,align:"center",children:[(0,l.Y)(f.In,{icon:A.A,sx:t=>({margin:"auto",width:t.sizes.$6,height:t.sizes.$6,animation:"".concat(I.W.spinning," 1s linear infinite")})}),(0,l.Y)(f.EY,{colorScheme:"secondary",localizationKey:(0,c.G)("waitlist.success.message")})]})})})]})]})},z=(0,a.dm)(()=>{let t=(0,n.ho)(),e=(0,s.Y)(),{signInUrl:i}=e,a=e.initialValues||{},h={emailAddress:(0,o.tJ)("emailAddress",a.emailAddress||"",{type:"email",label:(0,c.G)("formFieldLabel__emailAddress"),placeholder:(0,c.G)("formFieldInputPlaceholder__emailAddress")})};return(0,l.Y)(d.n.Root,{flow:"waitlist",children:(0,l.FD)(r.Z.Root,{children:[(0,l.Y)(r.Z.Content,{children:(0,l.Y)(y,{formState:h})}),(0,l.Y)(r.Z.Footer,{children:(0,l.FD)(r.Z.Action,{elementId:"waitlist",children:[(0,l.Y)(r.Z.ActionText,{localizationKey:(0,c.G)("waitlist.start.actionText")}),(0,l.Y)(r.Z.ActionLink,{localizationKey:(0,c.G)("waitlist.start.actionLink"),to:t.buildUrlWithAuth(i)})]})})]})})}),D=t=>{let e={signInUrl:"/".concat(h.I,"/sign-in"),...t,routing:"virtual"};return(0,l.Y)(u.q,{path:"waitlist",children:(0,l.Y)(s.r.Provider,{value:{...e,componentName:"Waitlist",mode:"modal"},children:(0,l.Y)("div",{children:(0,l.Y)(z,{})})})})}},90451:function(t,e,i){i.d(e,{Y:()=>h,r:()=>d}),i(98114);var l=i(14173),n=i(35074),r=i(97697),a=i(62366),o=i(4964),s=i(42117);let c=["email_address"],d=(0,n.createContext)(null),h=()=>{let t=(0,n.useContext)(d),{displayConfig:e}=(0,r.O)(),i=(0,a.II)(),{queryString:h}=(0,o.r)(),u=(0,n.useMemo)(()=>(0,s.tf)(h,c),[]);if(!t||"Waitlist"!==t.componentName)throw Error("Clerk: useWaitlistContext called outside Waitlist.");let{componentName:m,...Y}=t,p=Y.signInUrl||i.signInUrl||e.signInUrl;return p=(0,l.kZ)({base:p},{stringify:!0}),{...Y,componentName:m,signInUrl:p,initialValues:{...u}}}}}]);