1import{u as e}from"./3Pj12Ctb.js";import{_ as t}from"./D1tRHIU9.js";import s from"./CdFh0n3O.js";import a from"./BdDx9hpI.js";import{m as o}from"./CH1OnSMH.js";import{a_ as i,aM as n,v as l,J as r,bK as c,G as d,t as m,u,av as h,I as p,bc as f,w as g,cP as b,cS as M,cT as L,cU as y,cV as x,ca as k,cN as R,cM as w,cL as S,cW as _,cX as C,cR as T,cY as j,cQ as N,cB as v,cl as D}from"./rPzCxgu2.js";import{M as B}from"./DDW8loC3.js";import{_ as E}from"./BCo6x5W8.js";import"./CUlxn__V.js";import"./D1DH0B25.js";import"./DH8wk0CJ.js";import"./Cigs5uJq.js";import"./D_8At7Qg.js";import"./DRJczjAW.js";import"./CflUcBGO.js";import"./DnYcdI46.js";/* empty css *//* empty css *//* empty css *//* empty css */const{ModalManager:F}=window[v],P="modallogin",$=["href"],A=E({name:"ModalLogin",props:["root","next"],mixins:[o],emits:[],data:()=>({modalOptions:{closeClickDimmed:!0},msTimeToWaitRedirect:3e3,title:"ÐвÑоÑизаÑиÑ",mtlsDomainLink:!1,urlForm:"/local/api/login/ajax.php",urlSuccessRedirect:"/cabinet/",successRedirect:'ÐÑ Ð±ÑдеÑе пеÑенапÑÐ°Ð²Ð»ÐµÐ½Ñ Ð½Ð° ÑÑÑаниÑÑ <a class="b-modal__text--green" href="%url%">лиÑного кабинеÑа</a>',successNoRedirect:'ÐÑ Ð¼Ð¾Ð¶ÐµÑе войÑи на ÑÑÑаниÑÑ <a class="b-modal__text--green" href="%url%">лиÑного кабинеÑа</a>',mNamespace:P,isMobileRes:!1,messagesReady:!1,abortModal:!1}),setup(){const{breakpoints:t}=e();return{breakpoints:t}},async created(){this.setName("ModalLogin"),this.setBemBlock("b-modal"),this.open(),await this.init({transform:this.transformData,after:this.afterInit}),this.setMtlsDomainLink(),await w({after:this.initButton,ms:150}),this.setFocus(),this.breakpoints.watchBreakpoints(e=>this.updIsMobileRes())},methods:{getSuccessData(e={}){const{refresh:t=!0,"sms-token":s=null,type:a=null,redirectUrl:o=null,"sms-live":i=!0}=e;let[n,l]=["",""];this.trace("getSuccessData:",e);const r=e=>window.location.href=e,c=e=>{w({ms:this.msTimeToWaitRedirect,after:e=>t?r(this.urlSuccessRedirect):void 0})};if(o&&(e=>{w({ms:this.msTimeToWaitRedirect,after:t=>r(e)})})(o),s){if(s){const t=this;F.close("ModalLogin",{before(e){t.close()},after(e){F.setStore("ModalAuthChoice",{[B.isFromLoginKey]:!0,smsLive:i}),e.open("ModalAuthChoice")},storeParams:{module:"ModalAuthChoice",payload:{...e,"sms-token":s,type:a}}})}}else{l=t?this.messages.successRedirect:this.messages.successNoRedirect,n=this.gm(P,"title-success");const{successTitle:e,successMessage:s,successNext:a}=F.getStore("ModalLogin",R`successTitle successMessage successNext`),o=this;F.close("ModalLogin",{before(e){o.close()},after(e){e.open("ModalSuccess",{next:e=>a?a():c()})},async nextAfter(){await w({ms:o.msTimeToWaitRedirect,after:e=>a?a():c()})},storeParams:{module:"ModalSuccess",payload:{title:e||n,message:s||l,successNext:a}}})}},login(e){this.elButtonSend.click()},async handleSend(e){let t=!1;if(this.trace("ModalLogin.handleSend(payload)",e),"send"!==e.action)return!1;const{fieldLogin:s,fieldPassword:a,fieldRemember:o,fieldCaptcha:i}=this.extractFieldsId(e),{modelLogin:n,modelPassword:l,modelRemember:r,modelCaptcha:c}=this.extractModels(e,{fieldLogin:s,fieldPassword:a,fieldRemember:o,fieldCaptcha:i});this.trace("ModalLogin.handleSend(payload):",{login:[s,n],password:[a,l],remember:[o,r],captcha:[i,c]});const d=await C(async e=>await(T("info")?.catch(e=>this.fatal("ModalLogin.handleSend / exec('info')",e))),async({csrfToken:e})=>{const t=await j("model-auth",{csrf:e}).catch(e=>this.fatal("ModalLogin.handleSend / exec('model-auth')",e)),[s,a,o,i]=[k("l",R`login fieldName`,t),k("p",R`password fieldName`,t),k("r",R`remember fieldName`,t),k("c",R`captcha fieldName`,t)];return{csrf:e,payload:{keyLogin:s,keyPassword:a,keyRemember:o,keyCaptcha:i,modelLogin:n,modelRemember:r,modelPassword:l,modelCaptcha:c}}},async e=>await j("auth",e).catch(e=>{t=!0,this.fatal("ModalLogin.handleSend / exec('auth')",e),this.processError(e)}));if(t)return!1;const{type:m="",message:u=null}=d;return this.trace("ModalLogin.handleSend(payload) fetch data",{res:d}),N(this.handleError,this.handleSuccess)({type:m,params:{res:d,message:u}}),!0},handleError(e={}){const{type:t,params:s={}}=e;if("error"!==t)return!1;const{message:a=null}=s,o=this.gm(P,"title-error"),i=this;
1return this.processError({isForceError:!0,title:o,error:o,message:a,next(){const[e,t]=[0,6],s=F.getStore("ModalLogin","fail")||e;F.setStore("ModalLogin","fail",s+1),i.warn("Login Fail",`${s+1} / ${t}`),s+1>=t?i.fatal("ACCESS ERROR! The maximum number of authorization attempts has been exceeded",{maxCount:t,count:s+1}):F.open("ModalLogin")}}),!0},handleSuccess(e={}){const{type:t,params:s={}}=e,{res:a={}}=s,{redirectUrl:o=null}=a;return o&&(window.location.href=o),"ok"===t&&(this.onSuccess({...a}),!0)},extractFieldsId:(e={})=>({fieldLogin:k(1,R`sendData data params context loginFieldId`,e),fieldPassword:k(2,R`sendData data params context passwordFieldId`,e),fieldRemember:k(3,R`sendData data params context rememberFieldId`,e),fieldCaptcha:k(4,R`sendData data params context captchaFieldId`,e)}),extractModels(e,t={}){const{fieldLogin:s=null,fieldPassword:a=null,fieldRemember:o=null,fieldCaptcha:i=null}=t,n=S(R`sendData data fields`,e),{model:l=null}=n.find(({id:e})=>s===e),{model:r=null}=n.find(({id:e})=>a===e),{model:c=null}=n.find(({id:e})=>o===e),d=n.find(({id:e})=>i===e);return{modelLogin:l,modelPassword:r,modelRemember:c,modelCaptcha:_(d)?null:d.model}},signUp(){const e=this;F.close("ModalLogin",{before:t=>e.close(),async nextAfter(e){await w({ms:250,after(){e.open("ModalSignUp",{})}})}})},remember(){const e=this;F.close("ModalLogin",{before:t=>e.close(),async nextAfter(e){await w({ms:250,after(){e.open("ModalRemember",{})}})}})},setMtlsDomainLink(){this.mtlsDomainLink=k(!1,R`params context mtlsDomainLink`,this.data)},getActionButtonText(){return k("ÐойÑи",R`params context actionButtonText`,this.data)},updIsMobileRes(){this.isMobileRes=!!this.breakpoints.is(["@media-nano","@media-nano-sm","@media-sm-md"])},async afterInit(){await this.setLocalizationMessages(),this.injectButton(),this.modalReady=!0},async setLocalizationMessages(){const e=await this.getMessages(P,{noCache:!0});this.setterMessages(P,e,{"msg-success-redirect":["successRedirect",this.successRedirect,{lib:{url:this.urlSuccessRedirect}}],"msg-success-noredirect":["successNoRedirect",this.successNoRedirect,{lib:{url:this.urlSuccessRedirect}}],"title-success":[null,"УÑпеÑÐ½Ð°Ñ Ð°Ð²ÑоÑизаÑиÑ"],"title-error":[null,"ÐÑибка авÑоÑизаÑии"],"msg-bottom-question":[null,"У Ð²Ð°Ñ Ð½ÐµÑ Ð°ÐºÐºÐ°ÑнÑа?"],"msg-text-button-reg":[null,"ÐаÑегиÑÑÑиÑоваÑÑÑÑ"],"msg-forget-question":[null,"ÐабÑли паÑолÑ?"],"msg-mtls-auth-text":[null,"ÐойÑи ÑеÑез TLS ÐÐСТ"],"msg-text-button":["textButton",this.getActionButtonText()]}),this.messagesReady=!0},injectButton(){if(!this.data)return null;const e=b(".form-generator__body-item:nth-child(3)","one"),t=b(".form-generator__body-item:nth-child(3) .form-generator__group","one",e),s=L("div",{class:"form-generator__field form-generator__field_align:end:md"}),a=L("button",{class:"b-modal__link-button",text:this.gm(P,"msg-forget-question")});a.addEventListener("click",e=>this.remember(e)),y({element:t,add:"form-generator__group_align:baseline"}),this.abortModal||(x(a,s),x(s,t))},transformData(e){const{fields:t}=e,s=[0,1];return t.forEach((e,t)=>(s.includes(t)&&(e.events||(e.events={}),e.events.blur=!1),e)),e},setFocus(){const e=this,t=[...b(".input-control__input","all"),b(".b-button","one")];let s=null;t.forEach((e,t,a)=>{const o=t+1<=a.length-1?a[t+1]:null;0===t&&(M(e,"autofocus",!0),e.focus()),"checkbox"!==e.type&&(M(e,"tabindex",D(t+1)),e.classList.contains("input-control__input")&&(s=e),e.addEventListener("keydown",e=>{const{key:t,keyCode:s}=e;"Enter"!==t&&13!==s||o&&o.focus()}))}),s&&s.addEventListener("keydown",t=>{const{key:s,keyCode:a}=t;"Enter"!==s&&13!==a||e.login(t)})},closeModalLocal(){this.abortModal=!0,this.closeModal()}},computed:{isModalLoaded(){return null!==this.data&&this.messagesReady}},components:{ModalSide:t,Tooltip:s,ComponentStatus:a}},[["render",function(e,t,s,a,o,b){const M=i("ComponentStatus"),L=i("FormGenerator"),y=i("Tooltip"),x=i("StdButton"),k=i("ModalSide"),R=i("Modal");return n(),l("div",{ref:"root",class:h(e.$bem(e=>e.e("scene")))},[r(R,{"model-value":e.isOpen,options:o.modalOptions,close:b.closeModalLocal,class:h(e.$bem([e.$bem(e=>e.e("body-wrapper")),e.$bem(e=>e.e("body-wrapper").m("modallogin"))]))},{default:c(()=>[r(k,{onClose:b.closeModalLocal},d({title:c(()=>[p(f(e.textTitle),1)]),default:c(()=>[b.isModalLoaded?u("",!0):(n(),m(M,{key:0,enumType:"loading",isUseShadow:!1})),b.isModalLoaded?(n(),m(L,{key:1,class:h(["form-generator_login","form-generator_for:modals","form-generator_hide:footer-buttons","form-generator_hide:title"]),dataForm:e.data,updateData:e.dataUpdate,onTrigger:t[0]||(t[0]=t=>e.action(t,b.handleSend))},null,8,["dataForm","updateData"])):u("",!0)]),_:2},[b.isModalLoaded?{name:"footer",fn:c(()=>[o.mtlsDomainLink&&!o.isMobileRes?(n(),l("div",{key:0,class:h(e.$bem(e=>e.e("message").m("mb:n","mt:s","d:flex","g:x","ai:center")))},[g("a",{class:h(e.$bem(e=>e.e("link"))),href:o.mtlsDomainLink+"/cabinet"},f(e.gm(o.mNamespace,"msg-mtls-auth-text")),11,$),r(y,null,{content:c(()=>
1[...t[2]||(t[2]=[p(" ÐÐ»Ñ Ð°Ð²ÑоÑизаÑии ÑеÑез TLS ÐÐСТ вам поÑÑебÑеÑÑÑ ",-1),g("a",{href:"/products/vipnet-pki-client/"},"ViPNet PKI Client",-1),p(".",-1),g("br",null,null,-1),g("br",null,null,-1),p(" Ð ÑлÑÑае, еÑли пÑи попÑÑке войÑи Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ ÑеÑÑиÑикаÑа возникнÑÑ Ð¿ÑоблемÑ, пÑоÑÑба напÑавиÑÑ Ð¾Ð±ÑаÑение на ÑлекÑÑоннÑÑ Ð¿Ð¾ÑÑÑ ",-1),g("a",{href:"mailto:[email protected]"},"[email protected]",-1),p(". ",-1)])]),_:1})],2)):u("",!0),g("div",{class:h(e.$bem(e=>e.e("buttons-wrapper")))},[r(x,{BEMBlockProp:"b-button",params:{classes:{button:e.$bem({[e.$bem(e=>e.e("button"))]:!0,[e.$bem(e=>e.b("b-button").m("primary"))]:!0},{type:"string"})},texts:{text:e.gm(o.mNamespace,"textButton")}},onAction:b.login},null,8,["params","onAction"])],2),g("p",{class:h(e.$bem(e=>e.e("message")))},[p(f(e.gm(o.mNamespace,"msg-bottom-question"))+" ",1),g("button",{class:h(e.$bem(e=>e.e("link-button"))),onClick:t[1]||(t[1]=(...e)=>b.signUp&&b.signUp(...e))},f(e.gm(o.mNamespace,"msg-text-button-reg")),3)],2)]),key:"0"}:void 0]),1032,["onClose"])]),_:1},8,["model-value","options","close","class"])],2)}]]);export{A as default};
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.