1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["index.CKGmuCIR.js","app.6-zBPm55.js","vendor.kmuNf4Gr.js","css/styles.BuZ8GZAp.css","index.CmYDeezW.js","input-mixin.BU399U4z.js","TwoFactor.DTMea1RF.js","index.DFNe3OJX.js"])))=>i.map(i=>d[i]); 2import{_ as C,a as d,e as w,r as s,m as _,b as E,c as k}from"./app.6-zBPm55.js";import{r as c,d as u,y as p,u as a,x as l,h as m,w as F,B as S,f,C as I,e as P,D as N,E as M,G as V,H as D,z as h,A as x}from"./vendor.kmuNf4Gr.js";/* empty css */k(["LoginForm.mounted"]);const R="app_portal_login",A={name:"LoginForm",emits:["hideForm","logged"],props:{dataForTwoFactor:{type:Object,default:()=>{}}},data(){return{url:"/portal/login",loading:!1,formData:{login:"",code:""},errorName:"",password:"",security_code_1:"",security_code_2:"",showTwoFactorForm:!1,hideMainFormForInsertTwoFactorCode:!1,dataForTwoFactorProcess:{},permissionResendCode:!1}},mounted(...r){return s("LoginForm.mounted",()=>{this.security_code_1=this.model.security_code_1,this.security_code_2=this.model.security_code_2},this,r)},methods:{submitForm(...r){return s("LoginForm.submitForm",()=>{if(this.$refs.form.$el.reportValidity())if(this.two_factor_authentication_status&&w(this.formData.code))this.processTwoFactorStep();else{const e=this.getParamsForReturn("return");e!==null&&(this.url+=`?return=${e}`),this.$nextTick(()=>{this.$refs.form.submit()})}},this,r)},processTwoFactorStep(...r){return s("LoginForm.processTwoFactorStep",()=>{this.loading=!0,this.dataForTwoFactorProcess={login:this.formData.login,security_code_1:this.security_code_1,security_code_2:this.password_hash(this.password,this.security_code_2)},this.$refs.twoFactor.onTwoFactorGenerate(this.dataForTwoFactorProcess)},this,r)},getParamsForReturn(...r){return s("LoginForm.getParamsForReturn",e=>{let i={};return window.location.href.replace(window.location.hash,"").replace(/[?&]+([^=&]+)=?([^&]*)?/gi,(g,t,o)=>{i[t]=o!==void 0?o:""}),i[e]?i[e]:null},this,r)},password_hash(...r){return s("LoginForm.password_hash",(e,i)=>_(E(_(e)+_(i))),this,r)},beforeSend(...r){return s("LoginForm.beforeSend",e=>(e.security_code_1=this.security_code_1,e.security_code_2=this.password_hash(this.password,this.security_code_2),e),this,r)},onFormSuccess(...r){return s("LoginForm.onFormSuccess",e=>{this.loading=!1,e.result==="success"?this.successHandler(e):e.result==="new_codes"?(this.setNewCodes(e),this.submitForm()):e.result==="error"?this.errorName=e.data:e.result==="regenerate_csrf"?(this.setNewCodes(e),window.csrf.setCsrfToken("_csrf_token",e.csrf_token),this.errorName=e.data):this.errorName=e.data},this,r)},successHandler(...r){return s("LoginForm.successHandler",e=>{if(this.isIframe){window.open(`${window.location.origin}/portal/dashboard`,"_blank"),this.$emit("logged");return}if(e.return){let{hash:i}=document.location;window.top.location.href=e.return+(i||"")}else window.top.location.href="/portal/dashboard"},this,r)},setNewCodes(...r){return s("LoginForm.setNewCodes",e=>{this.security_code_1=e.security_code_1,this.security_code_2=e.security_code_2},this,r)},errorTwoFactor(...r){return s("LoginForm.errorTwoFactor",e=>{this.loading=!1,this.errorName=e.data},this,r)},successTwoFactor(...r){return s("LoginForm.successTwoFactor",e=>{this.loading=!1,e.permission_resend_code&&(this.permissionResendCode=e.permission_resend_code),this.hideMainFormForInsertTwoFactorCode=!0,this.errorName=e.data},this,r)},setEnteredCode(...r){return s("LoginForm.setEnteredCode",e=>{this.formData.code=e,this.submitForm()},this,r)},changeModelValue(...r){return s("LoginForm.changeModelValue",()=>{this.errorName=""},this,r)}},computed:{...x(R,["auth_by","isIframe","model","attributes_meta","two_factor_authentication_status","reset_password"]),errorMessage(){let r="";switch(this.errorName){case"incorrect_login":r=this.$t("portal","Login or password incorrect");break;case"incorrect_code":r=this.$t("portal","Incorrect code");break;case"incorrect_csrf":r=this.$t("common","The session has expired. Please re-login.");break;case"incorrect_data":r=this.$t("common","The data is incorrect. Please contact our technical support.");break;default:r="";break}return r},attributesMeta(){return this.attributes_meta.attributes},placeholderForAuthBy(){return this.auth_by==="email"?this.$t("portal","Enter email"):this.$t("portal","Enter login")},labelForAuthBy(){return this.auth_by==="email"?this.$t("portal","Email"):this.$t("portal","Login")},formTitle(){return this.isIframe?this.$t("portal","Customer portal"):this.hideMainFormForInsertTwoFactorCode?this.$t("portal","Two-factor authentication"):this.$t("portal","Sign in")},hasError(){return!w(this.errorName)}},components:{XForm:h(()=>d(()=>import("./index.CKGmuCIR.js"),__vite__mapDeps([0,1,2,3]))),XTextField:h(()=>d(()=>import("./index.CmYDeezW.js"),__vite__mapDeps([4,1,2,3,5]))),TwoFactor:h(()=>d(()=>import("./TwoFactor.DTMea1RF.js"),__vite__mapDeps([6,1,2,3]))),XInputPassword:h(()=>d(()=>import("./index.DFNe3OJX.js"),__vite__mapDeps([7,1,2,3,5])))}},B={class:"form-holder"},O={class:"login-portal-heading"},H={class:"form-input-group"},G={class:"col-form-label"},U={class:"form-input-group"},X={class:"col-form-label"},q={key:0,id:"error"},z={id:"static",class:"login-error"},j={class:"login-footer"},W=["value"];function J(r,e,i,g,t,o){const b=c("x-text-field"),y=c("x-input-password"),T=c("RouterLink"),L=c("two-factor"),v=c("x-form");return u(),p("div",B,[a("div",O,l(o.formTitle),1),m(v,{id:"loginForm",ref:"form",method:"POST",role:"form",autocomplete:"on",data:t.formData,class:D(["form-signin",{"has-error":o.hasError}]),"form-data-send":!0,url:t.url,"attributes-meta":o.attributesMeta,"check-unsaved-data-before-leave-page":!1,"before-send":o.beforeSend,onSuccess:o.onFormSuccess},{default:F(()=>[t.hideMainFormForInsertTwoFactorCode?f("",!0):(u(),p(S,{key:0},[a("div",H,[a("label",G,l(o.labelForAuthBy),1),m(b,{id:"login",ref:"loginInput","model-value":t.formData.login,options:{tabindex:"1",autocomplete:"username",placeholder:o.placeholderForAuthBy,disabled:t.loading,autofocus:!0,required:!0},"onUpdate:modelValue":e[0]||(e[0]=n=>t.formData.login=n),onInput:o.changeModelValue}
2,null,8,["model-value","options","onInput"])]),a("div",U,[a("label",X,l(r.$t("portal","Password")),1),m(y,{"model-value":t.password,"generate-password":!1,"allow-autocomplete":!0,options:{tabindex:"2",id:"password",name:"LoginForm[password]",autocomplete:"old-password",disabled:t.loading,autofocus:!0,required:!0,placeholder:r.$t("portal","Enter password")},"onUpdate:modelValue":e[1]||(e[1]=n=>t.password=n),onInput:o.changeModelValue},null,8,["model-value","options","onInput"])]),t.errorName?(u(),p("div",q,[a("div",z,l(o.errorMessage),1)])):f("",!0),a("div",j,[a("input",{id:"submit",type:"submit",class:"btn btn-primary",value:r.$t("portal","Sign in"),onClick:e[2]||(e[2]=I((...n)=>o.submitForm&&o.submitForm(...n),["prevent"]))},null,8,W),r.reset_password&&!r.isIframe?(u(),P(T,{key:0,to:{name:"portal.reset_password"},class:"link reset-password-link"},{default:F(()=>[N(l(r.$t("portal","Forgot your password?")),1)]),_:1})):f("",!0)])],64)),M(m(L,{ref:"twoFactor","data-for-two-factor":t.dataForTwoFactorProcess,"permission-resend-code":t.permissionResendCode,"error-message":o.errorMessage,onError:o.errorTwoFactor,onSuccess:o.successTwoFactor,onSubmit:o.setEnteredCode},null,8,["data-for-two-factor","permission-resend-code","error-message","onError","onSuccess","onSubmit"]),[[V,t.hideMainFormForInsertTwoFactorCode]])]),_:1},8,["data","class","url","attributes-meta","before-send","onSuccess"])])}const Z=C(A,[["render",J]]);export{Z as default}; 3//# sourceMappingURL=LoginForm.BPq3iriM.js.map
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.