(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{277:function(t,e,i){"use strict";i.r(e);var s={name:"Auth",components:{CustomerLogin:function(){return i.e(46).then(i.bind(null,381))},CustomerActivation:function(){return i.e(43).then(i.bind(null,382))},MessageBox:function(){return i.e(119).then(i.bind(null,358))}},props:{parameters:{type:Object,default:null}},data:function(){return{showPage:!1,showLogin:!0,loggingIn:!1,usingForgotPassword:!1,showAgeVerification:!1,redirected:!1,fromGuest:!1,redirectPage:"",currentYear:""}},watch:{showLogin:function(t){var e=this;setTimeout((function(){t?e.$root.helper.setFocus(e.$refs.login.$refs.username,100):e.$refs.customerActivation&&e.$root.helper.setFocus(e.$refs.customerActivation.$refs.accountNumber,100)}),10)}},mounted:function(){var t=this;this.currentYear=this.$root.moment().format("YYYY"),this.redirected=null!==this.parameters&&this.parameters.redirected,this.fromGuest=null!==this.parameters&&this.parameters.fromGuest,this.showLogin=null===this.parameters||!this.parameters.showActivation||this.fromGuest,this.showAgeVerification=!this.redirected,null!==this.parameters&&this.parameters.page&&(this.redirectPage=this.parameters.page),this.showLogin?this.$root.api.get("user-session").then((function(e){if(0===e.code){var i=function(){t.redirected&&t.redirectPage.length>0?t.$root.router.go(t.redirectPage,{redirected:!0,purchase:t.parameters.purchase}):t.$refs.login.login(),t.$root.$off("deliveryStopsLoaded",i)};t.$root.$on("deliveryStopsLoaded",i),t.$root.loadIntitialData()}else t.show()})):this.show()},methods:{login:function(t){var e=this;this.showLogin=!0,this.$nextTick((function(){e.$refs.login.loginCheck(t.username,t.password)}))},signUp:function(t){t&&(this.$root.$emit("sign-up-click"),this.$root.router.go("SignUpCheckAvailability"))},verifying:function(t){this.loggingIn=t},show:function(){var t=this;this.showPage=!0,this.$nextTick((function(){t.$root.setTopMenu(!1),t.$root.helper.setFocus(t.$refs.login.$refs.username,100)})),this.redirected&&this.$nextTick((function(){t.$refs.login.login()}))}}},o=i(0),n=Object(o.a)(s,(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"show",rawName:"v-show",value:t.showPage,expression:"showPage"}],attrs:{id:"mw-auth-page"}},[t.showLogin?e("div",{directives:[{name:"show",rawName:"v-show",value:!t.redirected,expression:"!redirected"}],staticClass:"mw-auth-login"},[e("customer-login",{ref:"login",attrs:{referer:t.redirectPage,"easy-pay":null!==t.parameters&&null!==t.parameters.easyPay?t.parameters.easyPay:null},on:{verifying:t.verifying,showActivation:function(e){t.showLogin=!1}}}),t._v(" "),e("div",{staticClass:"mw-auth-divider"}),t._v(" "),e("div",{staticClass:"mw-auth-additional-options"},[!t.loggingIn&&t.$root.settings.allowExistingCustomerSignup?e("div",{staticClass:"mw-auth-button-label activate-account"},[e("label",{staticClass:"mw-auth-button-activate-description"},[t._v(t._s(t.lang.alreadyReceiveService))]),t._v(" "),!t.loggingIn&&t.$root.settings.allowExistingCustomerSignup?e("button",{staticClass:"mw-auth-button activate-account-button",on:{click:function(e){t.showLogin=!t.showLogin}}},[t._v(t._s(t.lang.activateAccount))]):t._e()]):t._e(),t._v(" "),t.$root.isMangoWeb&&!t.loggingIn&&t.$root.settings.allowNewSignUps?e("span",{staticClass:"mw-auth-button-label create-account"},[e("label",{staticClass:"mw-auth-button-create-account-description"},[t._v(t._s(t.lang.dontHaveAnAccount))]),t._v(" "),t.$root.isMangoWeb&&!t.loggingIn&&t.$root.settings.allowNewSignUps?e("button",{staticClass:"mw-auth-button create-account-button",on:{click:t.signUp}},[t._v(t._s(t.lang.createAccount))]):t._e()]):t._e()]),t._v(" "),t.loggingIn?t._e():e("label",{staticClass:"mw-auth-build"},[t._v(t._s(t.lang.mangoWebVersion)+" "+t._s(t.$root.settings.mangoWebVersion))]),t._v(" "),t.loggingIn?t._e():e("label",{staticClass:"mw-auth-copyright"},[e("i",{staticClass:"fas fa-copyright"}),t._v(" "+t._s(t.currentYear)+" "+t._s(t.$root.advantageRouteSystems))])],1):e("div",{staticClass:"mw-auth-login"},[e("customer-activation",{ref:"customerActivation",on:{activationSuccess:t.login}}),t._v(" "),e("button",{staticClass:"mw-auth-back",on:{click:function(e){t.showLogin=!t.showLogin}}},[t._v(t._s(t.lang.back))])],1),t._v(" "),t.showAgeVerification&&t.$root.settings.ageVerification&&t.$root.settings.messageAgeVerification.length>0?e("message-box",{staticClass:"mw-sign-out-message",attrs:{text:t.$root.settings.messageAgeVerification,"first-button":t.lang.okButton,"second-button":"",image:"info"},on:{click:function(e){t.showAgeVerification=!1}}}):t._e()],1)}),[],!1,null,null,null);e.default=n.exports}}]);