1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{15116:(e,a,s)=>{Promise.resolve().then(s.bind(s,70017))},70017:(e,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>f});var t=s(95155),i=s(12115),r=s(36489),n=s(20063),l=s(80997),o=s(33885),c=s(52619),u=s.n(c),d=s(15239),h=s(35299),m=s(70532),p=s(57828),x=s(6368),g=s(59527),j=s(12361);s(61282);var v=s(18955);function b(){let e=new URLSearchParams(window.location.search).get("callbackUrl");return e&&e.startsWith("/")&&!e.startsWith("//")&&!e.startsWith("/\\")?e:window.location.pathname.startsWith("/login/extension")?"/extension":"/dashboard"}function f(){let e=(0,v.c)(),[a,s]=(0,i.useState)(""),[c,f]=(0,i.useState)(""),[w,N]=(0,i.useState)(!1),[y,C]=(0,i.useState)(""),[k,S]=(0,i.useState)(null),I=(0,n.useRouter)(),P=((0,n.usePathname)()||"").startsWith("/login/extension"),{status:D}=(0,r.useSession)();(0,i.useEffect)(()=>{"authenticated"===D&&I.replace(b())},[D,I]);let O=async s=>{if(s.preventDefault(),!l.j)return void C(e("auth.serviceIndisponible"));C(""),S("email");try{let s=await (0,o.x9)(l.j,a,c),t=await s.user.getIdToken(),i=await (0,r.signIn)("credentials",{idToken:t,provenance:(0,g.U)(),redirect:!1});(null==i?void 0:i.error)?C(e("auth.emailOuMdpIncorrect")):I.push(b())}catch(s){console.error(s);let a=String((null==s?void 0:s.code)||"");C("auth/invalid-credential"===a||"auth/invalid-login-credentials"===a||"auth/user-not-found"===a||"auth/wrong-password"===a?e("auth.emailOuMdpIncorrect"):(0,j.o)(s,e("auth.erreurConnexionGenerale")))}finally{S(null)}},_=async()=>{if(!l.j)return void C(e("auth.serviceIndisponible"));if("authenticated"===D)return void I.replace(b());C(""),S("google");try{let a=new o.HF,s=await (0,o.df)(l.j,a),t=await s.user.getIdToken(),i=await (0,r.signIn)("credentials",{idToken:t,provenance:(0,g.U)(),redirect:!1});(null==i?void 0:i.error)?C(e("auth.erreurGoogleConnexion")):I.push(b())}catch(a){console.error(a),C((0,j.o)(a,e("auth.erreurConnexionGoogle")))}finally{S(null)}},A=null!==k||"loading"===D||"authenticated"===D;return(0,t.jsxs)("main",{className:"auth-page",children:[(0,t.jsx)("div",{className:"left",children:(0,t.jsxs)("div",{className:"form-wrap",children:[(0,t.jsxs)(u(),{href:"/",className:"brand",children:[(0,t.jsx)(d.default,{src:"/assets/tt-logo-blue.svg",alt:"Tiktrack",width:36,height:36,priority:!0}),(0,t.jsx)("span",{className:"name",children:"Tiktrack"}),(0,t.jsx)("span",{className:"beta",children:"Beta"})]}),(0,t.jsx)("div",{className:"h1",children:e("auth.bonRetour")}),(0,t.jsx)("div",{className:"sub",children:e("auth.bonRetourSous")}),(0,t.jsxs)("button",{type:"button",className:"btn-google",onClick:_,disabled:A,children:["google"===k?(0,t.jsx)(h.A,{size:18,className:"spin"}):(0,t.jsx)(d.default,{src:"/google-icon.svg",alt:"",width:18,height:18}),"google"===k?e("auth.connexion"):e("auth.continuerGoogle")]}),(0,t.jsx)("div",{className:"divider",children:e("auth.ou")}),(0,t.jsxs)("form",{onSubmit:O,children:[(0,t.jsxs)("div",{className:"field",children:[(0,t.jsx)("label",{htmlFor:"email",children:e("auth.email")}),(0,t.jsx)("div",{className:"input-wrap",children:(0,t.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",placeholder:e("ecrans.motDePasseOublie.placeholder"),value:a,onChange:e=>s(e.target.value),required:!0})})]}),(0,t.jsxs)("div",{className:"field",children:[(0,t.jsx)("label",{htmlFor:"password",children:e("auth.motDePasse")}),(0,t.jsxs)("div",{className:"input-wrap",children:[(0,t.jsx)("input",{id:"password",name:"password",className:"has-trailing",type:w?"text":"password",autoComplete:"current-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:c,onChange:e=>f(e.target.value),required:!0}),(0,t.jsx)("button",{type:"button",className:"eye",onClick:()=>N(e=>!e),"aria-label":w?e("auth.masquerMotDePasse"):e("auth.afficherMotDePasse"),children:w?(0,t.jsx)(m.A,{size:18}):(0,t.jsx)(p.A,{size:18})})]})]}),(0,t.jsx)("div",{className:"forgot",children:(0,t.jsx)(u(),{href:"/password-reset",children:e("auth.motDePasseOublie")})}),y&&(0,t.jsx)("div",{role:"alert",className:"alert",children:y}),(0,t.jsxs)("button",{type:"submit",className:"btn-primary",disabled:A,children:["email"===k&&(0,t.jsx)(h.A,{size:16,className:"spin"}),"email"===k?e("auth.connexion"):e("auth.seConnecter")]})]}),(0,t.jsxs)("div",{className:"swap",children:[e("auth.pasEncoreDeCompte")," ",(0,t.jsx)(u(),{href:P?"/register/extension":"/register",children:e("auth.creerUnCompte")})]})]})}),(0,t.jsx)(x.A,{})]})}}},e=>{e.O(0,[7261,7811,1567,6489,2619,5239,3135,1370,8441,1255,7358],()=>e(e.s=15116)),_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.