tweb/public/53.8bfa61ba024fd632fdde.chunk.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2022-11-18 11:21:09 +01:00
"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[53,63,709,392,810,641,776],{9638:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(3910),o=n(2738),i=n(4541),r=n(2325),s=n(3512),d=n(4494),c=n(279);let l,u=!1;function p(e){u||(l||(l=s.Z.managers.apiManager.getConfig().then((e=>e.suggested_lang_code!==r.ZP.lastRequestedLangCode?Promise.all([e,r.ZP.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),r.ZP.getCacheLangPack()]):[])))).then((([t,n])=>{if(!t)return;const l=[];n.forEach((e=>{const t=r.ZP.strings.get(e.key);t&&(l.push(t),r.ZP.strings.set(e.key,e))}));const p="Login.ContinueOnLanguage",g=(0,d.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:p});g.lastElementChild.classList.remove("i18n"),(0,i.Z)({text:[r.ZP.format(p,!0)]}).then((()=>{window.requestAnimationFrame((()=>{e.append(g)}))})),s.Z.addEventListener("language_change",(()=>{g.remove()}),{once:!0}),l.forEach((e=>{r.ZP.strings.set(e.key,e)})),(0,o.fc)(g,(e=>{(0,a.Z)(e),u=!0,g.disabled=!0,(0,c.y)(g),r.ZP.getLangPack(t.suggested_lang_code)}))}))}},6392:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var a=n(4755),o=n(4874),i=n(810),r=n(3083),s=n(4489),d=n(2325),c=n(144),l=n(5565),u=n(3512);let p,g=null,h=null,m=null;const y=new o.Z("page-authCode",!0,(()=>{const e=g.type.length,t=new s.Z({label:"Code",name:(0,c.a)(),length:e,onFill:e=>{h(e)}});p=t.input,y.pageEl.querySelector(".input-wrapper").append(t.container),y.pageEl.querySelector(".phone-edit").addEventListener("click",(function(){return i.default.mount()}));const o=()=>{setTimeout((()=>{f.remove()}),300)},h=e=>{p.setAttribute("disabled","true");const a={phone_number:g.phone_number,phone_code_hash:g.phone_code_hash,phone_code:e};u.Z.managers.apiManager.invokeApi("auth.signIn",a,{ignoreErrors:!0}).then((e=>{switch(e._){case"auth.authorization":u.Z.managers.apiManager.setUser(e.user),n.e(781).then(n.bind(n,5436)).then((e=>{e.default.mount()})),o();break;case"auth.authorizationSignUpRequired":n.e(813).then(n.bind(n,8339)).then((e=>{e.default.mount({phone_number:g.phone_number,phone_code_hash:g.phone_code_hash})})),o()}})).catch((e=>{return a=void 0,o=void 0,r=function*(){let a=!1;switch(e.type){case"SESSION_PASSWORD_NEEDED":a=!0,e.handled=!0,yield(yield n.e(774).then(n.bind(n,9437))).default.mount(),setTimeout((()=>{p.value=""}),300);break;case"PHONE_CODE_EXPIRED":p.classList.add("error"),(0,l.Z)(t.label,(0,d.ag)("PHONE_CODE_EXPIRED"));break;case"PHONE_CODE_EMPTY":case"PHONE_CODE_INVALID":p.classList.add("error"),(0,l.Z)(t.label,(0,d.ag)("PHONE_CODE_INVALID"));break;default:t.label.innerText=e.type}a||t.select(),p.removeAttribute("disabled")},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{d(r.next(e))}catch(e){t(e)}}function s(e){try{d(r.throw(e))}catch(e){t(e)}}function d(t){var a;t.done?e(t.value):(a=t.value,a instanceof i?a:new i((function(e){e(a)}))).then(n,s)}d((r=r.apply(a,o||[])).next())}));var a,o,i,r}))},m=y.pageEl.querySelector(".auth-image"),v=a.Z.isMobile?100:166,f=new r.Z(t,v);return m.append(f.container),f.load()}),(e=>{if(g=e,h){p.value="";const e=document.createEvent("HTMLEvents");e.initEvent("input",!1,!0),p.dispatchEvent(e)}else h=y.pageEl.getElementsByClassName("phone")[0],m=y.pageEl.getElementsByClassName("sent-type")[0];let t,n;switch(h.innerText=g.phone_number,g.type._){case"auth.sentCodeTypeSms":t="Login.Code.SentSms";break;case"auth.sentCodeTypeApp":t="Login.Code.SentInApp";break;case"auth.sentCodeTypeCall":t="Login.Code.SentCall";break;default:t="Login.Code.SentUnknown",n=[g.type._]}(0,l.Z)(m,(0,d.ag)(t,n)),u.Z.managers.appStateManager.pushToState("authState",{_:"authStateAuthCode",sentCode:e})}),(()=>{p.focus()})),v=y},810:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var a=n(279),o=n(4874),i=n(9807),r=n(4494),s=n(5432),d=n(4159),c=n(2325),l=n(1447),u=n(1405),p=n(9709),g=n(9638),h=n(3910),m=n(2738),y=n(5565),v=n(1656),f=n(7487),_=n(2398),Z=n(7922),E=n(3512),b=n(709),L=n(3855),S=n(5431);let w,k=null;const P=new o.Z("page-sign",!0,(()=>{const e=document.createElement("div");let t,o;e.classList.add("input-wrapper");const u=new S.Z({onCountryChange:(
2022-11-28 15:34:59 +01:00
//# sourceMappingURL=53.8bfa61ba024fd632fdde.chunk.js.map