"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[11363],{11363:(e,r,t)=>{t.d(r,{C0:()=>p,N_:()=>l,kS:()=>s,dd:()=>y,f0:()=>E,GR:()=>R,Hr:()=>V,o3:()=>z,T4:()=>te});var n=t(62812),o=t(54461),a=function(e,r,t){return n.V0.fetch("/api-v1/auth/login",n.w$.POST,{username:e,password:r,captchaToken:t})},u=function(e,r){var t=e.name,a=e.username,u=e.password,i=e.newsletter;return n.V0.fetch("/api-v1/auth/register",n.w$.POST,{name:t,username:a,password:u,newsletter:i},{headers:{"x-selected-language":r||o.lI.es_ES}})},i=function(e,r,t){var a=e.captchaToken,u=e.username;return n.V0.fetch("/api-v1/user/password-reset-request",n.w$.POST,{captchaToken:a,username:u},{headers:{"x-selected-language":r||o.lI.es_ES,"x-domain-extension":t||o.Pp.COM}})},c=function(e){var r=e.password,t=e.token;return n.V0.fetch("/api-v1/user/password-reset",n.w$.PUT,{password:r,token:t})},s=function(){return n.V0.fetch("/api-v1/auth/logout",n.w$.POST)},l=function(e){return n.V0.fetch("/api-v1/auth/login-google",n.w$.POST,{token:e})},f=t(67294);var p="redirectReferrer",y=function(){var e=document.cookie.replace(/(?:(?:^|.*;\s*)redirectReferrer\s*=\s*([^;]*).*$)|^.*$/,"$1");if(e){document.cookie="".concat(p,"=;path=/;expires=-1;");var r=decodeURIComponent(e);window.location.assign(r)}else 0===document.referrer.indexOf(location.protocol+"//"+location.host)&&document.referrer!==window.location.href?("undefined"!==typeof window&&window.Cypress&&Object.defineProperty(document,"referrer",{get:function(){return"/"}}),window.location.assign(document.referrer)):window.location.assign("/")},d=function(e){return!!(0,n.Kn)(e)&&("username"in e&&"string"===typeof e.username&&"expireDateTime"in e&&("string"===typeof e.expireDateTime||"number"===typeof e.expireDateTime||(r=e.expireDateTime,null!=(t=Date)&&"undefined"!==typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](r):r instanceof t)));var r,t},b=function(e){try{var r=window.atob(e),t=window.atob(r.split(".")[1]),n=JSON.parse(t),o=d(a=n)&&new Date(a.expireDateTime)>new Date;return{token:o?r:void 0,username:o?n.username:void 0}}catch(e){return{}}var a},h=t(91085),m=t(89652);function w(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]5&&o.push(h.Z5.RECOVERY_PASSWORD)}),[o,i.loginAttempts]),d=(r=g((function(e){var r,n,o,u;return j(this,(function(s){switch(s.label){case 0:if(r=e.username,n=e.password,i.loading)return[3,4];c((function(e){return P(S({},e),{loading:!0})})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,a(r,n,i.captchaToken)];case 2:return(o=s.sent()).ok?(t&&t.user.userLoginOk(),y()):(u=Date.now(),c((function(e){return P(S({},e),{showErrMsg:!0,loading:!1,captchaId:u})})),t&&t.user.userLoginError(),p(o.err)),[3,4];case 3:return s.sent(),m.Z,[3,4];case 4:return[2]}}))})),function(e){return r.apply(this,arguments)});return(0,f.useEffect)((function(){if(!l.current){l.current=!0;var e,r=function(){var e=g((function(){var e,r;return j(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,n.V0.fetch("/api-v1/auth/login-attempts",n.w$.POST,{})];case 1:return(e=t.sent()).ok?(r=e.data,c((function(e){return P(S({},e),{loginAttempts:(null===r||void 0===r?void 0:r.attempts)||e.loginAttempts})}))):p(e.err),[3,3];case 2:return t.sent(),m.Z,[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(e=document.getElementById("login-form"))&&(e.onsubmit=function(e){return e.stopImmediatePropagation()}),r(),s.current=localStorage.getItem("newPassword"),localStorage.removeItem("newPassword"),localStorage.removeItem("username")}}),[p]),{captchaId:i.captchaId,captchaToken:i.captchaToken,hasNewPassword:s,loading:i.loading,login:d,loginAttempts:i.loginAttempts,maxLoginAttempts:5,setState:c,showErrMsg:i.showErrMsg}},A=t(16550);function I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0&&void 0!==arguments[0]?arguments[0]:"",t=Y((0,f.useState)(J(H({},F),{username:r})),2),n=t[0],a=t[1],u=(0,G.v9)(o.lE),c=(0,G.v9)(o.Fc),s=(e=W((function(){var e;return q(this,(function(r){switch(r.label){case 0:a(J(H({},n),{token:"",isResendDisabled:!0,loading:!0})),e=Date.now(),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i({captchaToken:n.token,username:n.username},u,c)];case 2:return r.sent().ok&&a(J(H({},n),{captchaId:e,isResendDisabled:!0,loading:!1,username:""})),[3,4];case 3:return r.sent(),[3,4];case 4:return[2]}}))})),function(){return e.apply(this,arguments)});return{handleResendPasswordLink:s,setState:a,state:n}};function Q(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]