PageSourceSearch

https://reflectra.ai/_next/static/chunks/app/signup/page-82b038c74e849fa3.js

js reflectra.ai collected 2026-10-05 14:42:11 UTC 11,219 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[879],{1763:(e,a,t)=>{Promise.resolve().then(t.bind(t,4747))},3624:(e,a,t)=>{"use strict";var s=t(6024);t.o(s,"useParams")&&t.d(a,{useParams:function(){return s.useParams}}),t.o(s,"usePathname")&&t.d(a,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(a,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(a,{useSearchParams:function(){return s.useSearchParams}})},3749:(e,a,t)=>{"use strict";t.d(a,{R2:()=>r,_2:()=>o,yS:()=>n});let s=t(9958).A.create({baseURL:"https://api.reflectra.ai",headers:{"Content-Type":"application/json"}});s.interceptors.request.use(e=>{{let a=localStorage.getItem("authToken");a&&(e.headers.Authorization="Bearer ".concat(a))}return e},e=>Promise.reject(e)),s.interceptors.response.use(e=>e,e=>{var a,t;let s=(null==(a=e.config)?void 0:a.url)||"",r=s.includes("/api/auth/login")||s.includes("/api/auth/signup")||s.includes("/api/auth/request-password-reset");return(null==(t=e.response)?void 0:t.status)!==401||r||(localStorage.removeItem("authToken"),document.cookie="authToken=; path=/; max-age=0; SameSite=Lax",document.cookie="authToken=; path=/; max-age=0; SameSite=Lax; Secure",window.location.replace("/login")),Promise.reject(e)});let r={login:async(e,a)=>{let t=await s.post("/api/auth/login",{username:e,password:a});if(t.data.access_token&&1){localStorage.setItem("authToken",t.data.access_token);let e="https:"===window.location.protocol;document.cookie="authToken=".concat(t.data.access_token,"; path=/; max-age=2592000; SameSite=Lax").concat(e?"; Secure":"")}return t.data},signup:async(e,a,t,r,n,o,i)=>{let l=new FormData;return l.append("username",e),l.append("email",a),l.append("password",t),l.append("terms_agreed","true"),r&&l.append("first_name",r),n&&l.append("last_name",n),o&&l.append("birth_date",o),l.append("billing_country",i||"US"),(await s.post("/api/auth/signup",l,{headers:{"Content-Type":"multipart/form-data"}})).data},getMe:async()=>(await s.get("/api/auth/me")).data,getUserAvatar:async()=>(await s.get("/api/users/me/avatar")).data,logout:()=>{localStorage.removeItem("authToken"),document.cookie="authToken=; path=/; max-age=0"},requestPasswordReset:async e=>(await s.post("/api/auth/request-password-reset",{email:e})).data,verifyResetToken:async(e,a)=>(await s.post("/api/auth/verify-reset-token",{token:e,new_password:a})).data,createCheckoutSession:async(e,a)=>(await s.post("/api/billing/create-checkout-session",{tier:e,billing_interval:a})).data,createCustomerPortalSession:async()=>(await s.post("/api/billing/create-portal-session")).data,getTrialStatus:async()=>(await s.get("/api/billing/trial-status")).data,getSubscriptionStatus:async()=>(await s.get("/api/billing/subscription-status")).data,getInvoices:async()=>(await s.get("/api/billing/invoices")).data},n={getAll:async()=>(await s.get("/api/personas")).data,getById:async e=>(await s.get("/api/personas/".concat(e))).data,create:async e=>(await s.post("/api/personas",e)).data,update:async(e,a)=>(await s.put("/api/personas/".concat(e),a)).data,delete:async e=>(await s.delete("/api/personas/".concat(e))).data},o={getOwnerActivity:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0,r="/api/personas/owner-activity?limit=".concat(e,"&offset=").concat(a);return t&&(r+="&persona_id=".concat(t)),(await s.get(r)).data},getOwnerActivityUnreadCount:async()=>(await s.get("/api/personas/owner-activity/unread-count")).data,markActivityRead:async e=>(await s.post("/api/personas/owner-activity/".concat(e,"/read"))).data,getUsageAnalytics:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"month",a=arguments.length>1?arguments[1]:void 0,t="/api/usage/analytics?time_range=".concat(e);return a&&(t+="&persona_id=".concat(a)),(await s.get(t)).data},getUsageBreakdown:async()=>(await s.get("/api/usage/breakdown")).data,getCurrentMonthUsage:async()=>(await s.get("/api/usage/current-month")).data}},4747:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>d});var s=t(4799),r=t(4023),n=t(3624),o=t(1463),i=t.n(o),l=t(2371),c=t(3749);function d(){let e=(0,n.useRouter)(),[a,t]=(0,r.useState)({username:"",email:"",password:"",confirmPassword:"",firstName:"",lastName:"",birthDate:"",country:"US"}),[o,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(!1),p=async t=>{if(t.preventDefault(),d(""),a.password!==a.confirmPassword)return void d("Passwords do not match");if(a.password.length<8)return void d("Password must be at least 8 characters");if(!a.birthDate)return void d("Birth date is required");let s=new Date(a.birthDate);if(Number.isNaN(s.getTime()))return void d("Birth date is invali
1d");if((Date.now()-s.getTime())/315576e5<13)return void d("You must be at least 13 years old to create an account");m(!0);try{await c.R2.signup(a.username,a.email,a.password,a.firstName,a.lastName,a.birthDate,a.country),e.push("/login?message=Account created successfully! Please log in.")}catch(e){var r,n;d((null==(n=e.response)||null==(r=n.data)?void 0:r.detail)||"Failed to create account")}finally{m(!1)}};return(0,s.jsx)("main",{className:"min-h-screen bg-gradient-to-b from-teal-50 via-blue-50 to-white flex items-center justify-center px-4 py-12",children:(0,s.jsxs)("div",{className:"max-w-md w-full",children:[(0,s.jsxs)("div",{className:"text-center mb-8",children:[(0,s.jsx)(i(),{href:"/",className:"inline-block mb-6",children:(0,s.jsx)(l.default,{src:"/logo.svg",alt:"Reflectra",width:120,height:40,className:"h-10 w-auto mx-auto"})}),(0,s.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Create your Personas account"}),(0,s.jsx)("p",{className:"text-gray-600",children:"Start using Reflectra Personas today"})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-8",children:[(0,s.jsxs)("form",{onSubmit:p,className:"space-y-6",children:[o&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-red-800 text-sm",children:o})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-2",children:"Username"}),(0,s.jsx)("input",{type:"text",id:"username",required:!0,value:a.username,onChange:e=>t({...a,username:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"Choose a username"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-2",children:"First Name (Optional)"}),(0,s.jsx)("input",{type:"text",id:"firstName",value:a.firstName,onChange:e=>t({...a,firstName:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"First name"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-2",children:"Last Name (Optional)"}),(0,s.jsx)("input",{type:"text",id:"lastName",value:a.lastName,onChange:e=>t({...a,lastName:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"Last name"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),(0,s.jsx)("input",{type:"email",id:"email",required:!0,value:a.email,onChange:e=>t({...a,email:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"[email protected]"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),(0,s.jsx)("input",{type:"password",id:"password",required:!0,value:a.password,onChange:e=>t({...a,password:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"At least 8 characters"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-2",children:"Confirm Password"}),(0,s.jsx)("input",{type:"password",id:"confirmPassword",required:!0,value:a.confirmPassword,onChange:e=>t({...a,confirmPassword:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",placeholder:"Confirm your password"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"birthDate",className:"block text-sm font-medium text-gray-700 mb-2",children:"Birth Date"}),(0,s.jsx)("input",{type:"date",id:"birthDate",required:!0,value:a.birthDate,onChange:e=>t({...a,birthDate:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"country",className:"block text-sm font-medium text-gray-700 mb-2",children:"Country"}),(0,s.jsxs)("select",{id:"country",required:!0,value:a.country,onChange:e=>t({...a,country:e.target.value}),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-teal-500 focus:border-teal-500",children:[(0,s.jsx)("option",{value:"US",children:"United States"}),(0,s.jsx)("option",{value:"CA",children:"Canada"}),(0,s.jsx)("option",{value:"GB",children:"United Kingdom"}),(0,s.jsx)("option",{value:"AU",children:"Australia"}),(0,s.jsx)("option",{value:"DE",children:"Germany"}),(0,s.jsx)("option",{value:"FR",children:"France"}),(0,s.jsx)("option",{value:"ES",children:"Spain"}),(0,s.jsx)("option",{value:"IT",children:"Italy"}),(0,s.jsx)("option",{value:"NL",children:"Netherlands"}),(0,s.jsx)("option",{value:"CH",children:"Switzerland"}),(0,s.jsx)("option",{value:"Other",children:"Other"})]})]}),(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)("input",{type:"checkbox",required:!0,className:"mt-1 rounded border-gray-300 text-teal-600 focus:ring-teal-500"}),(0,s.jsxs)("label",{className:"ml-2 text-sm text-gray-600",children:["I agree to the"," ",(0,s.jsx)(i(),{href:"/terms",className:"text-teal-600 hover:underline",children:"Terms of Service"})," ","and"," ",(0,s.jsx)(i(),{href:"/privacy",className:"text-teal-600 hover:underline",children:"Privacy Policy"})]})]}),(0,s.jsx)("button",{type:"submit",disabled:u,className:"w-full py-3 bg-gradient-to-r from-teal-600 to-blue-600 text-white rounded-lg font-semibold hover:shadow-lg transition disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Creating account...":"Create Personas Account"})]}),(0,s.jsx)("div",{className:"mt-6 text-center",children:(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:["Already have a Personas account?"," ",(0,s.jsx)(i(),{href:"/login",className:"text-teal-600 font-semibold hover:underline",children:"Sign in (Personas)"})]})})]})]})})}}},e=>{e.O(0,[463,371,958,408,89,358],()=>e(e.s=1763)),_N_E=e.O()}]);

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.