text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[4],{"8b24":function(e,r,t){"use strict";t.r(r);var s=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("loginForm")},a=[],o=function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{class:e.varsFromWordpress.divSize?e.varsFromWordpress.divSize:"q-pa-xl"},[t("q-stepper",{ref:"stepper",attrs:{color:"primary",animated:"","done-color":"green","header-nagivation":!1,"no-header-navigation":""},scopedSlots:e._u([{key:"navigation",fn:function(){return[t("q-stepper-navigation",[t("div",{staticClass:"row"},[t("q-btn",{staticClass:"col-3 responsive-button",staticStyle:{color:"##0c71c3","min-width":"5%","max-height":"35px"},attrs:{color:"primary",label:2===e.step?e.varsFromWordpress.strings["btnEnter"]:e.varsFromWordpress.strings["btnNext"]},on:{click:function(r){return e.nextStep()}}}),1==e.step?t("div",{staticClass:"col-7 responsive-div"}):e._e(),e.BtnPassword?t("div",{staticClass:"col-5 responsive-div"}):e._e(),1==e.step?t("q-btn",{staticClass:"col-2 responsive-button",attrs:{flat:"",color:"primary",label:e.varsFromWordpress.strings["btnRegister"]},on:{click:function(r){return e.redirect_register()}}}):e._e(),e.BtnPassword?t("q-btn",{staticClass:"col-4 responsive-button",staticStyle:{color:"#e31e17"},attrs:{flat:"",label:e.varsFromWordpress.strings["btnPassword"]},on:{click:function(r){return e.redirect_password()}}}):e._e()],1)])]},proxy:!0}]),model:{value:e.step,callback:function(r){e.step=r},expression:"step"}},[t("q-step",{attrs:{name:1,icon:"email",done:e.step>1,title:"email"}},[e.varsFromWordpress.textHeader?t("div",{staticClass:"q-ma-none q-pb-lg"},[t("div",{staticClass:"text-h4 text-weight-thin"},[e._v("\n          "+e._s(e.varsFromWordpress.textHeader)+"\n        ")]),t("hr")]):e._e(),t("q-input",{ref:"email",attrs:{filled:"",autofocus:"",type:"email",label:e.varsFromWordpress.strings["emailLabel"],rules:[function(r){return""!==r.email||e.varsFromWordpress.strings["emailErrorNull"]},function(r){return-1!==r.indexOf("@")||e.varsFromWordpress.strings["emailErrorNotDomain"]},function(r){return e.errorInput.errorEmail||e.varsFromWordpress.strings["emailErrorNotUser"]},function(r){return r.indexOf("@")!==r.length-1||e.varsFromWordpress.strings["emailErrorNotValid"]}],"lazy-rules":"ondemand",loading:e.loadingState},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),e.nextStep(r))}},model:{value:e.formulario.email,callback:function(r){e.$set(e.formulario,"email",r)},expression:"formulario.email"}})],1),t("q-step",{attrs:{name:2,icon:"password",done:e.step>2,title:"Senha"}},[e.varsFromWordpress.textHeader?t("div",{staticClass:"q-ma-none q-pb-lg"},[t("div",{staticClass:"text-h4 text-weight-thin"},[e._v("\n          "+e._s(e.varsFromWordpress.textHeader)+"\n        ")]),t("hr")]):e._e(),t("q-input",{ref:"senha",attrs:{filled:"",label:e.varsFromWordpress.strings["passwordLabel"],type:e.isPwd?"password":"text",autocomplete:"off",rules:[function(r){return e.errorInput.errorPassword||e.varsFromWordpress.strings["passwordError"]},e.checkButton],loading:e.loadingState,"lazy-rules":"ondemand"},on:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.preventDefault(),e.nextStep(r))}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.isPwd?"visibility_off":"visibility"},on:{click:function(r){e.isPwd=!e.isPwd}}})]},proxy:!0}]),model:{value:e.formulario.senha,callback:function(r){e.$set(e.formulario,"senha",r)},expression:"formulario.senha"}})],1)],1)],1)},i=[],n=(t("e6cf"),t("758b")),l=login_whmcs_content,d=login_whmcs_size,c=email_label,p=email_error_null,u=email_error_not_domain,m=email_error_not_user,h=email_error_not_valid,f=password_label,v=password_error,g=btn_next,w=btn_enter,_=btn_register,b=btn_password,x={emailLabel:c,emailErrorNull:p,emailErrorNotDomain:u,emailErrorNotUser:m,emailErrorNotValid:h,passwordLabel:f,passwordError:v,btnNext:g,btnEnter:w,btnRegister:_,btnPassword:b},y={data(){return{step:1,loadingState:!1,isPwd:!0,urls:"",BtnPassword:!1,formulario:{senha:"",email:"",idCliente:"",passwordhash:""},errorInput:{errorEmail:!0,errorPassword:!0},varsFromWordpress:{textHeader:l,divSize:d,strings:x}}},methods:{async login(){this.$refs.senha.validate(),this.$refs.senha.hasError||""===this.formulario.senha?(this.errorInput.errorPassword=!1,this.$refs.senha.validate(),this.errorInput.errorPassword=!0,this.BtnPassword=!0):(this.loadingState=!0,n["a"].post("",{action:"ValidateLogin",email:this.formulario.email,senha:this.formulario.senha,idCliente:this.formulario.idCliente}).then((e=>{"success"===e.data.result?(this.url=e.data.redirect_url,window.location.href=this.url,this.loadingState=!1):"password"===e.data.result&&(this.BtnPassword=!0,this.loadingState=!1,this.errorInput.errorPassword=!1,this.$refs.senha.validate(),this.errorInput.errorPassword=!0)})).catch((e=>{this.loadingState=!1,console.log(e)})))},nextStep(){1===this.step?(this.$refs.email.validate(),this.$refs.email.hasError||""===this.formulario.email?(this.$refs.email.validate(),this.$refs.email.focus()):this.checkEmail()):this.login()},async checkEmail(){this.loadingState=!0,n["a"].post("",{action:"checkEmail",email:this.formulario.email}).then((e=>{"success"===e.data.result?(this.formulario.idCliente=e.data.clients.client[0].id,this.$refs.email.validate(),this.$refs.stepper.next(),setTimeout((()=>{this.$refs.senha.focus()}),200)):"notin"===e.data.result&&(this.errorInput.errorEmail=!1,this.$refs.email.validate(),this.errorInput.errorEmail=!0),this.loadingState=!1})).catch((e=>{this.loadingState=!1,console.log(e)}))},async redirect_password(){n["a"].post("",{action:"resetpassword",email:this.formulario.email}).then((e=>{console.log(e.data.result),"success"===e.data.result?this.$q.notify({message:"E-mail de recuperação enviado.",color:"green"}):this.$q.notify({message:"E-mail de recuperação não enviado.",color:"red"})})).catch((e=>{this.loadingState=!1,console.log(e)}))},redirect_register(){n["a"].post("",{action:"url_redirect"}).then((e=>{this.urls=e.data,window.location.href=this.urls.register}))}}},E=y,k=t("2877"),S=t("f531"),F=t("87fe"),P=t("27f9"),W=t("0016"),$=t("b19c"),q=t("9c40"),C=t("eebe"),I=t.n(C),N=Object(k["a"])(E,o,i,!1,null,null,null),B=N.exports;I()(N,"components",{QStepper:S["a"],QStep:F["a"],QInput:P["a"],QIcon:W["a"],QStepperNavigation:$["a"],QBtn:q["a"]});var z={components:{loginForm:B},name:"PageIndex",created(){},methods:{myTweak(e){return{minHeight:"10px"}}}},H=z,O=Object(k["a"])(H,s,a,!1,null,null,null);r["default"]=O.exports}}]);