1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["index.CRLvso-D.js","app.C9rH3Nfe.js","vendor.kmuNf4Gr.js","css/styles.BuZ8GZAp.css","input-mixin.BU399U4z.js"])))=>i.map(i=>d[i]); 2import{_,a as T,r,e as l,L as m}from"./app.C9rH3Nfe.js";import{r as F,d as h,y as u,u as s,D as C,x as a,h as p,f as g,C as f,H as v,w as y,E as R,G as b,I as E,z as S}from"./vendor.kmuNf4Gr.js";/* empty css */const A={name:"TwoFactor",emits:["success","submit","error"],props:{dataForTwoFactor:Object,permissionResendCode:Boolean,errorMessage:String},data(){return{loading:!1,processingTwoFactor:!1,processing:!1,code:"",recipient:{},twoFactorAuthType:"",interval:!1,secondsLeft:0,timeoutForResetCode:0}},methods:{onTwoFactorGenerate(...e){return r("TwoFactor.onTwoFactorGenerate",async(t,o=!1)=>{const n=await m.getTwoFactorInfo(t);n.result==="error"?this.$emit("error",n):(this.processingTwoFactor=!0,this.$emit("success",n),this.twoFactorAuthType=n.two_factor_auth_type,this.recipient=n.recipient,this.timeoutForResetCode=n.timeout_for_reset_code,o&&this.$showSuccess(this.$t("portal","Successfully sent"),4),this.initTimer()),this.loading=!1},this,e)},initTimer(...e){return r("TwoFactor.initTimer",()=>{this.secondsLeft=this.timeoutForResetCode;const t=setInterval(()=>{if(this.showResendCodeTimer){this.secondsLeft-=1;return}clearTimeout(t),this.updatePermissionResendCodeState()},1e3)},this,e)},updatePermissionResendCodeState(...e){return r("TwoFactor.updatePermissionResendCodeState",async()=>{const t=await m.availabilityToResendCode();this.$emit("success",t)},this,e)},resendCode(...e){return r("TwoFactor.resendCode",()=>{if(!this.permissionResendCode)return!1;this.loading=!0,this.onTwoFactorGenerate({login:this.dataForTwoFactor.login,security_code_1:this.dataForTwoFactor.security_code_1,security_code_2:this.dataForTwoFactor.security_code_2,resend_code:!0},!0)},this,e)},setEnteredCode(...e){return r("TwoFactor.setEnteredCode",()=>{this.$emit("submit",this.code)},this,e)}},computed:{codePlaceholder(...e){return r("TwoFactor.codePlaceholder",()=>{switch(this.twoFactorAuthType){case"mail_sms":return this.$t("portal","Enter confirmation code");case"sms":return this.$t("portal","Enter code from SMS");case"mail":return this.$t("portal","Enter code from email address");default:return""}},this,e)},twoFactorInfo(...e){return r("TwoFactor.twoFactorInfo",()=>{let t="";if(!this.processingTwoFactor)return t;if(l(this.recipient))return this.$t("portal","Enter the 2-factor verification code");let o=this.twoFactorAuthType;return o==="mail_sms"&&!l(this.recipient.email)&&!l(this.recipient.phone)?this.$t("portal","A confirmation code was sent to your phone number {phone} and email address {email}",{phone:this.recipient.phone,email:this.recipient.email}):(o==="sms"||o==="mail_sms")&&!l(this.recipient.phone)?this.$t("portal","A confirmation code was sent to your phone number ending in {phone}",{phone:this.recipient.phone}):(o==="mail"||o==="mail_sms")&&!l(this.recipient.email)?this.$t("portal","A confirmation code was sent to your email address {email}",{email:this.recipient.email}):t},this,e)},showResendCodeTimer(...e){return r("TwoFactor.showResendCodeTimer",()=>this.secondsLeft>0,this,e)},resendCodeClasses(...e){return r("TwoFactor.resendCodeClasses",()=>({disabled:this.showResendCodeTimer}),this,e)}},components:{XTextField:S(()=>T(()=>import("./index.CRLvso-D.js"),__vite__mapDeps([0,1,2,3,4])))}},I={class:"login-portal-info"},L={class:"color-danger"},P={class:"form-input-group"},k={class:"col-form-label"},$={key:0,id:"error"},x={id:"static",class:"login-error"},V={class:"login-footer"},D=["value"],M={id:"seconds-left",class:"form-input-group"},B={class:"resend-message"};function G(e,t,o,n,d,i){const w=F("x-text-field");return h(),u("div",null,[s("div",I,[C(a(i.twoFactorInfo)+" ",1),s("div",L,a(e.$t("portal","It may take up to two minutes to arrive.")),1)]),s("div",P,[s("label",k,a(e.$t("portal","Code")),1),p(w,{ref:"codeInput","model-value":d.code,options:{id:"code-input",autocomplete:"code",name:"LoginForm[code]",placeholder:i.codePlaceholder,disabled:d.loading,required:d.processingTwoFactor},"onUpdate:modelValue":t[0]||(t[0]=c=>d.code=c)}
2,null,8,["model-value","options"])]),o.errorMessage?(h(),u("div",$,[s("div",x,a(o.errorMessage),1)])):g("",!0),s("div",V,[s("input",{id:"submit-code",type:"submit",class:"btn btn-primary",value:e.$t("portal","Sign in"),onClick:t[1]||(t[1]=f((...c)=>i.setEnteredCode&&i.setEnteredCode(...c),["prevent"]))},null,8,D),s("a",{id:"resend-code",class:v(["link",i.resendCodeClasses]),href:"javascript:void(0)",onClick:t[2]||(t[2]=f((...c)=>i.resendCode&&i.resendCode(...c),["prevent"]))},a(e.$t("portal","Resend code")),3)]),p(E,{name:"slide"},{default:y(()=>[R(s("div",M,[s("span",B,a(e.$t("portal","{seconds} seconds to resend again",{seconds:d.secondsLeft})),1)],512),[[b,i.showResendCodeTimer]])]),_:1})])}const O=_(A,[["render",G]]);export{O as default}; 3//# sourceMappingURL=TwoFactor.-N5dQ6W3.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.