!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="091fe2e4-6092-4f3e-bbdf-268181c30f8f",e._sentryDebugIdIdentifier="sentry-dbid-091fe2e4-6092-4f3e-bbdf-268181c30f8f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801],{32846:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sign-up",function(){return r(50081)}])},50081:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSG:function(){return q},default:function(){return $}});var a=r(52676),s=r(77934),i=r(38981),n=r(69465),o=r(18393),l=r(79580),c=r(73317),d=r(32702),u=r(54401),h=r(69848),p=r(75271);let m=()=>{let e=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]');e&&e.remove()},g=e=>!!document.querySelector(`#${e}`),f=()=>{let e=document.querySelector(".grecaptcha-badge");if(e&&e.parentNode){let t=e.parentNode;t&&t instanceof Element&&t.remove()}},x=e=>{f();let t=document.querySelector(`#${e}`);t&&t.remove(),m()},w=e=>{let{onLoad:t,reCaptchaKey:r,scriptId:a}=e;if(g(a)){t();return}let s=`https://www.google.com/recaptcha/enterprise.js?render=${r}`,i=document.createElement("script");i.id=a,i.src=s,i.defer=!0,i.async=!0,i.onload=t;let n=document.querySelector("head");n?.appendChild(i)},b=(0,p.createContext)({executeRecaptcha:()=>{throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called inside component wrapped by GoogleRecaptchaProvider")}}),{Consumer:j}=b;function y(e){let{reCaptchaKey:t,children:r}=e,[s,i]=(0,p.useState)(null);(0,p.useEffect)(()=>{if(!t)return;let e="google-recaptcha";return w({onLoad:()=>{grecaptcha.enterprise&&grecaptcha.enterprise.ready(()=>{i(grecaptcha.enterprise)})},reCaptchaKey:t,scriptId:e}),()=>{x(e)}},[t]);let n=(0,p.useCallback)(e=>{if(!s||!s.execute)throw Error("Google Recaptcha has not been loaded");return s.execute(t,{action:e})},[s,t]),o=(0,p.useMemo)(()=>({executeRecaptcha:s?n:void 0}),[n,s]);return(0,a.jsx)(b.Provider,{value:o,children:r})}let v=()=>(0,p.useContext)(b);var N=r(15638),A=r(11434),_=r(85137),E=r.n(_),S=r(31194),C=r(54594),k=r(55912);let I=()=>{let e=(0,C.useTranslations)(),t=(0,S.useRouter)(),{executeRecaptcha:r}=v(),[n,m]=(0,p.useState)(""),{mutateAsync:g,isPending:f,isSuccess:x}=(0,o.J)(),w=(0,A.Nq)({redirect_uri:`${window.location.origin}/provider-auth?src=sign-up`,ux_mode:"redirect",flow:"auth-code"}),{register:b,handleSubmit:j,watch:y,formState:{errors:_}}=(0,k.cI)({defaultValues:{email:"",password:""},resolver:(0,N.X)(h.JJ)}),I=j(async t=>{if(m(""),!r){m(e("Errors.auth.reCaptchaNotAvailable"));return}let a=await r("signup");await g({userData:{email:t.email||"",password:t.password||""},token:a}).then(()=>{}).catch(e=>{m(e.message)})}),G={title:e("Auth.verifyEmail.default.title"),body:e("Auth.verifyEmail.default.description",{email:y("email")}),button:{action:()=>void t.push("/log-in"),actionName:"Got it! (Log in from Thank You Screen)",title:e("Auth.gotIt")}};return x?(0,a.jsx)(i.G,{content:G}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"mx-2 max-w-lg rounded-lg bg-white p-8 sm:mx-auto sm:w-full",children:[(0,a.jsx)("div",{className:"pb-1",children:(0,a.jsx)("h1",{className:"text-2xl font-medium",children:e("Auth.createNewAccount")})}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-sm",children:[e("Auth.haveAccount"),(0,a.jsx)(E(),{className:"underline",href:"/log-in",children:e("Auth.logInHere")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pb-3 pt-8",children:[(0,a.jsx)(s.z,{variant:"inverse",leadingIcon:u._,actionName:"Sign up with Google",onClick:w,className:"bg-white",size:"sm",children:e("Auth.signUpWithGoogle")}),(0,a.jsx)(d.X,{actionType:"sign-up",className:"bg-white"})]}),(0,a.jsxs)("div",{className:"relative h-14",children:[(0,a.jsx)("div",{className:"absolute left-0 top-1/2 h-px w-full bg-tan-700/20"}),(0,a.jsx)("div",{className:"absolute left-0 top-0 flex size-full items-center justify-center",children:(0,a.jsx)("span",{className:"bg-white px-3 text-center",children:"or"})})]}),(0,a.jsxs)("form",{id:"short-sign-up-form",className:"w-full",onSubmit:e=>{e.preventDefault(),I(e)},children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("div",{className:"flex-col items-stretch",children:[(0,a.jsx)(l.II,{id:"email",...b("email"),type:"email","data-testid":"email",autoComplete:l.L$.Email,label:e("Auth.forms.email"),variant:"border"}),(0,a.jsx)(c.J,{error:_.email?.message})]}),(0,a.jsxs)("div",{className:"flex-col items-stretch",children:[(0,a.jsx)(l.II,{id:"password",...b("password"),type:"password","data-testid":"password",autoComplete:l.L$.NewPassword,label:e("Auth.forms.password"),variant:"border"}),(0,a.jsx)(c.J,{error:_.password?.message})]})]}),(0,a.jsx)(s.z,{type:"submit",actionName:"Create Account",isLoading:f,"data-testid":"submit",size:"sm",children:e("Auth.createAccount")}),!!n&&(0,a.jsx)("div",{"data-testid":"error",children:(0,a.jsx)(c.J,{error:n})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap justify-center gap-1 pt-4 align-baseline text-sm",children:["By continuing, I agree to Hume AI's"," ",(0,a.jsx)(E(),{className:"underline",target:"_blank",href:"https://beta.hume.ai/policies/terms-of-use",children:"Terms of Use"})," ","and"," ",(0,a.jsx)(E(),{className:"underline",target:"_blank",href:"https://beta.hume.ai/policies/privacy-policy",children:"Privacy Policy"})]})]}),(0,a.jsxs)("div",{className:"pt-6 text-center text-xs",children:[e("Auth.reCaptchaText.protectedPage")," ",(0,a.jsx)("a",{href:"https://policies.google.com/privacy",className:"underline",target:"_blank",rel:"noreferrer noopener",children:e("Auth.reCaptchaText.privacyPolicy")})," ",e("Auth.reCaptchaText.and")," ",(0,a.jsx)("a",{href:"https://policies.google.com/terms",className:"underline",target:"_blank",rel:"noreferrer noopener",children:e("Auth.reCaptchaText.termsOfService")})," ","apply."]})]})})};var G=r(70288),P=r(20977),T=r(57221),L=r(71376),R=r(292),U=r(8275),z=r(46838),D=r.n(z),J=r(48991),q=!0,$=(0,U.K)(()=>{let e=(0,C.useTranslations)(),{user:t,googleSignUpError:r,googleAuthIsLoading:o,clearGoogleSignUpError:l,loginRejected:c,userNotAuth:d,initializing:u,logOut:h,appleSignUpError:p,appleAuthIsLoading:m,clearAppleSignUpError:g}=(0,R.a)(),f=(0,J.EQ)({googleSignUpError:r,appleSignUpError:p,isLoading:o||m||u,loginRejected:c,userNotAuth:d}).with({loginRejected:"not-allowlisted",googleSignUpError:J.P.nullish,appleSignUpError:J.P.nullish,isLoading:!1},e=>(0,a.jsx)(n.K,{status:e.loginRejected})).with({googleSignUpError:J.P.string,isLoading:!1},t=>{let r={body:t.googleSignUpError,button:{action:l,actionName:"Got it! (back from sign up error screen)",title:e("Auth.gotIt")}};return(0,a.jsx)(i.G,{content:r})}).with({appleSignUpError:J.P.string,isLoading:!1},t=>{let r={body:t.appleSignUpError,button:{action:g,actionName:"Got it! (back from sign up error screen)",title:e("Auth.gotIt")}};return(0,a.jsx)(i.G,{content:r})}).with({userNotAuth:!0,isLoading:!1},()=>{let t={body:e("Auth.userDoesNotExist.description"),button:{action:h,actionName:"Got it! (back from sign up error screen)",title:e("Auth.gotIt")}};return(0,a.jsx)(i.G,{content:t})}).otherwise(()=>(0,a.jsx)(I,{}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(D(),{children:[(0,a.jsx)("title",{children:(0,L.JL)`Sign up`}),(0,a.jsx)("meta",{name:"description",content:"Sign in or create an account with Hume AI. Enter your email and password. Access the leading developer platform for expressive communication."})]}),(0,a.jsx)(P.h,{children:(0,a.jsx)(s.z,{actionName:"try public demo",href:"/",size:"sm",children:"Try it out"})}),!t||T.v.recaptchaKey?(0,a.jsx)(y,{reCaptchaKey:T.v.recaptchaKey,children:(0,a.jsx)(G.g,{children:f})}):null]})})}},function(e){e.O(0,[390,705,57,633,888,774,179],function(){return e(e.s=32846)}),_N_E=e.O()}]);