(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7757],{1445:e=>{e.exports={white:"loader_white__n6unS",l7:"loader_l7__nkKAr",black:"loader_black__p1jiV",blue:"loader_blue__ZBLWJ"}},4631:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(95155),s=a(12515);function o(e){let{error:t}=e;return(0,n.jsx)(n.Fragment,{children:t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),(0,n.jsxs)("div",{className:"d-flex justify-content-center pb-2",role:"alert",children:[(0,n.jsx)("div",{children:(0,n.jsx)(s.ItP,{style:{minWidth:"17px",height:"17px",marginTop:"-3px"}})}),"\xa0\xa0",(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:t}})]})]})})}},30806:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f,dynamic:()=>p});var n=a(95155),s=a(94545),o=a.n(s),r=a(45507),l=a(35695),i=a(66766),c=a(6874),u=a.n(c),d=a(43626),h=a(84408),m=a(12115),g=a(4631),x=a(66983);function f(){let e=(0,l.useRouter)(),t=(0,l.useSearchParams)().get("ref"),[a,s]=(0,m.useState)(!0),[c,f]=(0,m.useState)(""),[p,v]=(0,m.useState)(""),[j,b]=(0,m.useState)(""),[w,y]=(0,m.useState)(window.location.hostname),{user:_}=(0,m.useContext)(x.E0);async function N(t){t.preventDefault(),b(""),v("");let a=!0;if(/^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/i.test(c)||(v("is-invalid"),a=!1),a){s(!0);let t=await (0,d.A)("/auth/otp","POST",{email:c});(null==t?void 0:t.status)==="ok"?(localStorage.setItem("verifyEmail",c),e.push("/auth/verify")):(s(!1),b((null==t?void 0:t.message)||"Reset request failed"))}}return(0,m.useEffect)(()=>{(null==_?void 0:_.loggedIn)===!0?(console.log("Logged in, redirecting to /dashboard"),s(!0),e.push("/dashboard")):(null==_?void 0:_.loggedIn)===!1&&s(!1)},[_]),(0,n.jsxs)("div",{className:"d-flex flex-column",children:["google"===t?(0,n.jsx)("div",{className:"align-self-center m-2 py-3 px-3 rounded-4 shadow ".concat(o().authForm),children:(0,n.jsxs)("div",{className:"d-flex",children:[(0,n.jsx)(i.default,{src:"/img/google-icon.png",alt:"Google Logo",width:80,height:80,className:"".concat(o().googleIcon," me-3")}),(0,n.jsxs)("p",{className:"m-0",children:["Google Login can only be used with the domain ",(0,n.jsx)("b",{children:"browser.lol"}),". You are currently using ",(0,n.jsx)("b",{children:w}),", so this Login Method is not available. However, you can log in with your Google Account using a One Time Password."]})]})}):(0,n.jsx)(n.Fragment,{}),(0,n.jsxs)("div",{className:"align-self-center m-2 p-lg-5 py-5 px-3 rounded-4 shadow ".concat(o().authForm),children:[(0,n.jsxs)("h1",{className:"text-center gradientText antipasto",children:[(0,n.jsx)(h.IeK,{style:{marginTop:"-8px"},className:"gradientTextIcon"})," One-Time Login"]}),(0,n.jsxs)("form",{children:[(0,n.jsxs)("p",{className:"text-center pb-3 mb-3",children:["Don't have an account yet? ",(0,n.jsx)(u(),{href:"/auth/register",children:"Register here."})]}),(0,n.jsxs)("div",{className:"position-relative mb-4",children:[(0,n.jsx)("label",{htmlFor:"email",className:"form-label fs-base",children:"Email"}),(0,n.jsx)("input",{type:"email",id:"email",autoComplete:"email",name:"email",value:c,onChange:function(e){f(e.target.value),v("")},className:"form-control form-control-lg ".concat(p),required:""})]}),a?(0,n.jsx)("button",{className:"btn btn-primary shadow-primary btn-lg w-100",disabled:!0,children:(0,n.jsx)(r.A,{})}):(0,n.jsx)("button",{className:"btn btn-primary shadow-primary btn-lg w-100",onClick:N,children:"Get your Access Code"}),(0,n.jsx)(g.A,{error:j}),(0,n.jsx)(u(),{href:"/auth",className:"btn btn-link btn-lg w-100",children:"Login with Password instead?"})]})]})]})}let p="force-static"},35695:(e,t,a)=>{"use strict";var n=a(18999);a.o(n,"usePathname")&&a.d(t,{usePathname:function(){return n.usePathname}}),a.o(n,"useRouter")&&a.d(t,{useRouter:function(){return n.useRouter}}),a.o(n,"useSearchParams")&&a.d(t,{useSearchParams:function(){return n.useSearchParams}})},43626:(e,t,a)=>{"use strict";async function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{console.log("Requesting ".concat(t," to ").concat(e," with options: ").concat(JSON.stringify(a)));let n=localStorage.getItem("auth");if(""!==e)return await s(e,t,n,a);return{status:"ok"}}catch(e){return console.error("Error in fetchApi: ".concat(e.message)),{status:"error",message:e.message||"An unknown error occurred"}}}async function s(e,t,a,n){try{var s;let o,r;o=((s="api.browser.lol",void 0===s)?void 0:s.length)>0?"https://".concat("api.browser.lol","/v7").concat(e):"".concat(window.location.origin,"/v7").concat(e),r="GET"===t?await fetch(o,{method:t,headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}}):await fetch(o,{method:t,headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(n)});let l=await r.json();if(null==l?void 0:l.status)return console.log("Request succeeded to ".concat(e,": ").concat(JSON.stringify(l))),!0===l.forceLogout?(console.warn("Unauthorized. Cleaning up..."),localStorage.removeItem("auth")):(null==l?void 0:l.authToken)&&localStorage.setItem("auth",l.authToken),l;return console.log("Request failed to ".concat(e,": ").concat(JSON.stringify(l))),{status:"error",message:"Invalid server response"}}catch(e){return console.error("Error in fetchUrl: ".concat(e.message)),{status:"error",message:"Failed to connect to server. Please try again later."}}}a.d(t,{A:()=>n})},45507:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(95155),s=a(1445),o=a.n(s);function r(e){let{color:t}=e;return"black"===t?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:o().black})}):"blue"===t?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:o().blue})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:o().white})})}},66983:(e,t,a)=>{"use strict";a.d(t,{E0:()=>m,Ft:()=>d,default:()=>g});var n=a(95155),s=a(87017),o=a(26715),r=a(95799),l=a(12115),i=a(31195);a(71711);var c=a(50192),u=a(15666);let d=null,h=new s.E,m=(0,l.createContext)();function g(e){let{children:t}=e,[a,s]=(0,l.useState)({});return(0,l.useEffect)(()=>{i.Ay.initialize("AW-16989828804")},[]),(0,n.jsx)(m.Provider,{value:{user:a,setUser:s},children:(0,n.jsxs)(o.Ht,{client:h,children:[(0,n.jsxs)(u.zE,{children:[(0,n.jsx)(r.N9,{position:"top-center"}),t]}),(0,n.jsx)(c.E,{initialIsOpen:!1})]})})}},75670:(e,t,a)=>{Promise.resolve().then(a.bind(a,30806))},94545:e=>{e.exports={authForm:"auth_authForm__QAWb9",titleIcon:"auth_titleIcon__C54Ot",googleIcon:"auth_googleIcon__V63xd"}}},e=>{var t=t=>e(e.s=t);e.O(0,[5318,5798,5479,1348,8520,2995,6967,5799,4903,6766,8441,1684,7358],()=>t(75670)),_N_E=e.O()}]);