PageSourceSearch

https://chattypilot.ai/_next/static/chunks/app/login/page-80b41e031f986445.js

js chattypilot.ai collected 2026-10-05 11:55:29 UTC 4,448 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{34340:(e,s,a)=>{Promise.resolve().then(a.bind(a,70017))},70017:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>h});var t=a(95155),l=a(12115),i=a(20063),r=a(22663),n=a(65380),o=a(90960),u=a(11337),d=a(52619),g=a.n(d),c=a(75662),m=a(55609),p=a(60893),x=a(86601);let h=()=>{let{t:e,i18n:s}=(0,c.Bd)(),a=(0,u.V)(),[d,h]=(0,l.useState)({email:"",password:""}),[f,b]=(0,l.useState)({}),[w,y]=(0,l.useState)({}),[j,v]=(0,l.useState)(null),[N,E]=(0,l.useState)(!1),k=(0,i.useRouter)(),{login:A,isAuthenticated:C}=(0,n.A)(),O=(0,l.useCallback)(async()=>{try{let e=await o.uE.getBusinesses();if(0===e.length)return void k.push("/create-business");try{if((await o.uE.getSocialAccounts(e[0].id)).length>0)return void k.push("/dashboard")}catch(e){}}catch(e){k.push("/create-business");return}k.replace("/accounts")},[k]),S=(0,l.useCallback)(s=>{let a={};return s.email?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.email)||(a.email=e("forms.validation.emailInvalid")):a.email=e("forms.validation.emailRequired"),s.password||(a.password=e("forms.validation.passwordRequired")),a},[e]),_=(0,l.useCallback)((a,t)=>a instanceof Error?"auth.userAlreadyExists"===a.message?e("pages.login.userAlreadyExists"):s.exists(a.message)?e(a.message):a.message:e(t),[e,s]);(0,l.useEffect)(()=>{C&&O()},[C,O]),(0,l.useEffect)(()=>{b(Object.fromEntries(Object.entries(S(d)).filter(e=>{let[s]=e;return w[s]})))},[d,w,S]);let I=async s=>{s.preventDefault();let a=S(d);if(Object.keys(a).length>0){b(a),y({email:!0,password:!0});return}E(!0),v(null);try{var t,l;let s=await o.uE.login({email:d.email,password:d.password});if(s.requiresVerification){sessionStorage.setItem("otp_session",JSON.stringify({email:null!=(t=s.email)?t:d.email,type:"EMAIL_VERIFICATION"})),(0,r.Ay)(e("pages.login.toastVerifyEmail"),{icon:"\uD83D\uDCE7"}),k.push("/verify-otp");return}if(s.requires2FA){sessionStorage.setItem("otp_session",JSON.stringify({email:null!=(l=s.email)?l:d.email,type:"TWO_FACTOR"})),(0,r.Ay)(e("pages.login.toast2fa"),{icon:"\uD83D\uDD10"}),k.push("/verify-otp");return}s.token&&(A(s.token),r.Ay.success(e("pages.login.toastWelcomeBack")))}catch(e){v(_(e,"pages.login.invalidCredentials"))}finally{E(!1)}};return C?(0,t.jsx)(x.D,{}):(0,t.jsxs)(p.k,{variant:"login",children:[(0,t.jsxs)("div",{className:"text-center mb-7",children:[(0,t.jsx)("h1",{className:"text-2xl font-extrabold text-slate-900 tracking-tight",children:e("pages.login.loginTitle")}),(0,t.jsx)("p",{className:"text-sm text-slate-500 mt-1.5",children:e("pages.login.loginSubtitle")})]}),(0,t.jsxs)("form",{onSubmit:I,className:"space-y-4",children:[(0,t.jsx)(m.lO,{id:"login-email",label:e("pages.login.labelEmail"),type:"email",value:d.email,onChange:e=>h(s=>({...s,email:e.target.value})),onBlur:()=>y(e=>({...e,email:!0})),placeholder:e("pages.login.placeholderEmail"),autoComplete:"email",required:!0,error:f.email}),(0,t.jsx)(m.lO,{id:"login-password",label:e("pages.login.labelPassword"),type:"password",value:d.password,onChange:e=>h(s=>({...s,password:e.target.value})),onBlur:()=>y(e=>({...e,password:!0})),placeholder:e("pages.login.placeholderPasswordLogin"),autoComplete:"current-password",required:!0,error:f.password}),(0,t.jsx)("div",{className:"flex justify-end -mt-1",children:(0,t.jsx)(g(),{href:"/forgot-password",className:"text-xs text-blue-600 hover:text-blue-800 font-medium transition-colors",children:e("pages.login.forgotPasswordLink")})}),j&&(0,t.jsx)(m.Db,{message:j}),(0,t.jsx)(m.jn,{type:"submit",disabled:N,loading:N,label:e("pages.login.signIn"),loadingLabel:e("pages.login.signingIn")})]}),a&&(0,t.jsxs)("div",{className:"mt-6 rounded-2xl border border-blue-100 bg-blue-50/80 p-4 text-center",children:[(0,t.jsx)("h2",{className:"mt-1 text-base font-extrabold text-slate-900",children:e("pages.login.waitlistTitle")}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-slate-600 leading-relaxed",children:e("pages.login.waitlistBody")}),(0,t.jsx)(g(),{href:"/waitlist",className:"btn-primary mt-4 w-full text-sm py-3",children:e("pages.login.joinWaitlist")})]}),!a&&(0,t.jsxs)("p",{className:"mt-6 text-center text-sm text-slate-500",children:[e("pages.login.noAccount")," ",(0,t.jsx)(g(),{href:"/signup",className:"font-semibold text-blue-600 hover:text-blue-800 transition-colors",children:e("pages.login.signUp")})]})]})}}},e=>{e.O(0,[5662,2619,7506,1290,6325,2663,6e3,960,295,8441,1255,7358],()=>e(e.s=34340)),_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.