"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[437,442],{2582:(e,t,a)=>{a.d(t,{Z:()=>s});var n=a(2325);class s{constructor(e){this.element=document.body.querySelector("."+e.className),this.container=document.createElement("div"),this.container.className="container center-align",this.imageDiv=document.createElement("div"),this.imageDiv.className="auth-image",this.title=document.createElement("h4"),e.titleLangKey&&this.title.append((0,n.ag)(e.titleLangKey)),this.subtitle=document.createElement("p"),this.subtitle.className="subtitle",e.subtitleLangKey&&this.subtitle.append((0,n.ag)(e.subtitleLangKey)),this.container.append(this.imageDiv,this.title,this.subtitle),e.withInputWrapper&&(this.inputWrapper=document.createElement("div"),this.inputWrapper.className="input-wrapper",this.container.append(this.inputWrapper)),this.element.append(this.container)}}},9437:(e,t,a)=>{a.r(t),a.d(t,{default:()=>v});var n=a(279),s=a(4755),i=a(4874),r=a(4494),l=a(6830),o=a(4425),p=a(2325),c=a(2582),u=a(3910),d=a(2738),h=a(2614),m=a(5565),g=a(1656),b=a(8115),w=a(3512);let y;const v=new i.Z("page-password",!0,(()=>{const e=new c.Z({className:"page-password",withInputWrapper:!0,titleLangKey:"Login.Password.Title",subtitleLangKey:"Login.Password.Subtitle"}),t=(0,r.Z)("btn-primary btn-color-primary"),i=new p.ZP.IntlElement({key:"Login.Next"});t.append(i.element);const v=new l.Z({label:"LoginPassword",name:"password"});let L;y=v.input,e.inputWrapper.append(v.container,t);const Z=()=>(L||(L=window.setInterval(Z,1e4)),w.Z.managers.passwordManager.getState().then((e=>{k=e,k.hint?(0,m.Z)(v.label,(0,h.Z)((0,b.Z)(k.hint))):v.setLabel()})));let k;const S=e=>{if(e&&(0,u.Z)(e),!y.value.length)return void y.classList.add("error");const s=(0,g.Z)([y,t],!0),r=y.value;i.update({key:"PleaseWait"});const l=(0,n.y)(t);v.setValueSilently(""+Math.random()),v.setValueSilently(r),w.Z.managers.passwordManager.check(r,k).then((e=>{"auth.authorization"===e._?(clearInterval(L),a.e(781).then(a.bind(a,5436)).then((e=>{e.default.mount()})),E&&E.remove()):(t.removeAttribute("disabled"),i.update({key:e._}),l.remove())})).catch((e=>{s(),v.input.classList.add("error"),e.type,i.update({key:"PASSWORD_HASH_INVALID"}),y.select(),l.remove(),Z()}))};(0,d.fc)(t,S),y.addEventListener("keypress",(function(e){if(this.classList.remove("error"),i.update({key:"Login.Next"}),"Enter"===e.key)return S()}));const N=s.Z.isMobile?100:166,E=new o.Z(v,N);return e.imageDiv.append(E.container),Promise.all([E.load(),Z()])}),null,(()=>{y.focus(),w.Z.managers.appStateManager.pushToState("authState",{_:"authStatePassword"})}))}}]);
//# sourceMappingURL=437.37bcbe9db9cbb8d8a753.chunk.js.map