(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ed51246e"],{bc1a:function(e,t,r){"use strict";r.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app flex-row align-items-center"},[t("div",{staticClass:"container"},[t("b-row",{staticClass:"justify-content-center"},[t("b-col",{attrs:{cols:"12",md:"6"}},[t("b-card",{staticClass:"mx-4",attrs:{"no-body":""}},[t("b-card-body",{staticClass:"p-4"},[t("b-form",{on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t=>e.resolveStep(t,e.step)).apply(null,arguments)}}},[t("h1",[e._v(e._s(e.$t("register")))]),"info"==e.step?[t("p",{staticClass:"text-muted"},[e._v(e._s(e.$t("basicInformation")))]),t("b-form-group",[t("InputField",{attrs:{name:"name",label:this.$t("name"),rules:{required:!0,length:{min:2}}},on:{error:e.fieldError},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}})],1),t("b-form-group",[t("InputField",{attrs:{name:"email",type:"email",label:this.$t("email"),errors:e.httpErrors.email,rules:{required:!0,length:{min:2}}},on:{error:e.fieldError},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}})],1),t("b-form-group",[t("InputField",{attrs:{name:"project_name",label:this.$t("projectName"),rules:{length:{min:2,max:30}}},on:{error:e.fieldError},model:{value:e.project_name,callback:function(t){e.project_name=t},expression:"project_name"}})],1),t("b-form-group",[t("InputField",{attrs:{type:"password",name:"password",label:this.$t("password"),rules:{required:!0,length:{min:2}}},on:{error:e.fieldError},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),t("b-form-group",[t("InputField",{attrs:{type:"password",name:"confirm_password",label:this.$t("confirmPassword"),errors:e.extendErrors["confirm_password"],rules:{required:!0,length:{min:2}}},on:{error:e.fieldError},model:{value:e.confirm_password,callback:function(t){e.confirm_password=t},expression:"confirm_password"}})],1),e.template?t("b-button",{attrs:{variant:"success",block:""},on:{click:t=>e.resolveStep(t,"info")}},[e._v(e._s(e.$t("confirm")))]):t("b-button",{attrs:{variant:"success",block:"",disadbled:e.registering},on:{click:t=>e.register(t)}},[e.registering?t("span",[t("b-spinner",{attrs:{small:""}})],1):t("span",[e._v(" "+e._s(e.$t("register"))+" ")])])]:e._e(),"template"==e.step?[t("b-row",{staticClass:"mb-4"},[t("b-col",{attrs:{cols:"12"}},[t("a",{staticStyle:{"text-decoration":"underline"},on:{click:function(t){e.showTemplate=!0}}},[t("small",[e._v(e._s(e.$t("registrationTemplateInstallDisclaimer",{name:this.$translateLabel(this.template.template.label)}))+" ")])])]),t("b-sidebar",{attrs:{id:"template",title:e.$translateLabel(e.template.label),right:"","no-header":"",backdrop:""},model:{value:e.showTemplate,callback:function(t){e.showTemplate=t},expression:"showTemplate"}},[t("div",{staticClass:"px-3 py-2"},[t("Description",{attrs:{item:e.template,type:"single"}})],1)])],1),e.activationCode?t("b-button",{attrs:{variant:"success",block:"",disabled:e.registering},on:{click:t=>e.resolveStep(t,"template")}},[e.registering?t("span",[t("b-spinner",{attrs:{small:""}})],1):t("span",[e._v(e._s(e.$t("register"))+" ")])]):t("b-button",{attrs:{variant:"success",block:"",disabled:e.registering},on:{click:t=>e.resolveStep(t,"template")}},[e.registering?t("span",[t("b-spinner",{attrs:{small:""}})],1):t("span",[e._v(e._s(e.$t("registerAndBuy"))+" "+e._s(e.price)+" "+e._s(e.currency)+" ")])])]:e._e(),t("div",{staticClass:"col-md-12 text-center",staticStyle:{"margin-top":"20px"}},[t("h3",[e._v("- "+e._s(e.$t("or"))+" -")])]),t("div",{staticClass:"col-md-12 text-center",staticStyle:{"margin-top":"20px"}},[t("router-link",{attrs:{to:"/login"}},[e._v(" "+e._s(e.$t("signIn"))+" ")])],1)],2)],1)],1)],1)],1)],1)])},i=[],a=r("7187"),o=r("8e09"),n=r("9600"),l=r("f1fb"),c=r("f6bc"),d=r("e7d7"),p=r("5939"),m=r("46f4"),u={components:{IdentityFields:a["default"],InputField:o["a"],SelectField:n["a"],cSwitch:l["b"],PaymentInfo:c["a"],Description:m["a"]},name:"Register",data:function(){return{step:"info",appMode:"production",name:"",email:"",project_name:"My Company",password:"",ref:"",confirm_password:"",errors:[],registering:!1,httpErrors:[],extendErrors:{},template:null,showTemplate:!1,fields:{name:{key:"name",type:"text",module:"input",name:this.$t("name"),constraints:{required:!0,length:{min:3},not_allowed_words:""}},email:{key:"email",type:"email",module:"input",name:this.$t("email"),constraints:{required:!0,not_allowed_words:""}},project:{key:"project",type:"text",module:"input",name:this.$t("projectName"),constraints:{length:{min:2,max:55},not_allowed_words:""}},password:{key:"password",type:"password",module:"input",name:this.$t("password"),constraints:{required:!0,length:{min:7,max:50}}},confirmPassword:{key:"confirm_password",type:"password",module:"input",name:this.$t("confirmPassword"),constraints:{required:!0,length:{min:7,max:50}}}}}},methods:{fieldError(e){let t=this.errors.find((t,r)=>t.field==e.field);void 0===t?this.errors.push(e):this.errors.map(r=>{t.field==r.field&&(r.error=e.error)})},translate(e){try{return e.locales[this.locale]}catch{return!1}},checkForErrors(){return this.errors.find((e,t)=>e.error)},register(e){if(e.preventDefault(),this.registering=!0,this.checkForErrors())return void this.$bvModal.msgBoxOk(this.$t("fieldsNotValid"));let t=[];this.template&&t.push({product_type:"template",reference:this.template.template.id,source:"template"}),this.$http.post("/v1/user/register_legacy",{name:this.name,email:this.email,password:this.password,project_name:this.project_name,ref:this.ref,products:t}).then(e=>{let t=e.data;this.$gtag.event("register_completed",{project:t}),100==e.status&&this.$bvToast.toast(this.$t("failedToSetupTrialOnRegister"),{type:"warning"}),this.$bvModal.msgBoxOk(this.$t("confirmationEmail")).then(()=>{this.$router.push("/login")})}).catch(e=>{if(this.registering=!1,void 0!==e.response){if(500==e.response.status)return void this.$serverErrorModal(e);if(417==e.response.status){let t=e.response.data.errors;void 0!==t["email"]&&(this.step="info"),this.httpErrors=t}this.$bvModal.msgBoxOk(e.response.data.message)}this.$debugLog(e),this.$bvToast.toast(this.$t("unexpectedError"),{title:this.$t("error"),variant:"danger"})})},back(e){this.errors=[],this.step=e},proceed(e,t){e.preventDefault(),this.checkForErrors()?this.$bvModal.msgBoxOk(this.$t("fieldsNotValid")):this.step=t},resolveStep(e,t){this.step=t,this.steps[t](e)}},computed:{steps(){return{info:e=>this.template?this.proceed(e,"template"):this.register(e),template:e=>this.register(e)}},locale(){return this.$route.query.lang?this.$route.query.lang:this.$store.getters.getLocale},activationCode(){return this.$route.query.activation_code},price(){return new d["a"](this.template).priceInCurrency(this.currency)},currency(){return this.$route.query.currency||"usd"}},watch:{confirm_password:function(e,t){e!=this.password?this.extendErrors["confirm_password"]=["password_not_match"]:delete this.extendErrors["confirm_password"]},password:function(e,t){e==this.password&&delete this.extendErrors["confirm_password"]},email:function(e,t){delete this.httpErrors["email"]}},mounted(){this.ref=this.$route.query.ref,this.$route.query.template&&p["a"].get("/v1/project/template/"+this.$route.query.template).then(e=>{this.template=new d["a"](e.data,this.locale,this.activationCode)})}},h=u,f=r("2877"),b=Object(f["a"])(h,s,i,!1,null,null,null);t["default"]=b.exports},f6bc:function(e,t,r){"use strict";var s=function(){var e=this,t=e._self._c;return t("div",[t("b-row",[t("b-col",{attrs:{sm:"12",lg:"8"}},[t("InputField",{attrs:{type:"text",name:"cardholder_name",label:this.$t("cardHolderName"),rules:{required:!0}},on:{error:e.onError},model:{value:e.creditcard.name,callback:function(t){e.$set(e.creditcard,"name",t)},expression:"creditcard.name"}}),t("InputField",{attrs:{type:"text",name:"card_number",label:this.$t("creditCardNumber"),descrption:this.$t("creditCardNumberWithoutSpaces"),rules:{required:!0,placeholder:"************4321",length:{min:16}},maxLength:"16"},on:{error:e.onError},model:{value:e.creditcard.number,callback:function(t){e.$set(e.creditcard,"number",t)},expression:"creditcard.number"}}),t("b-row",[t("b-col",{attrs:{sm:"6"}},[t("b-form-group",[t("InputField",{attrs:{type:"text",name:"expires",label:this.$t("expires"),rules:{required:!0,placeholder:"mm/yy",length:{min:5,max:5}},maxLength:"5"},on:{error:e.onError},model:{value:e.creditcard.expires,callback:function(t){e.$set(e.creditcard,"expires",t)},expression:"creditcard.expires"}})],1)],1),t("b-col",{attrs:{sm:"6"}},[t("b-form-group",[t("InputField",{attrs:{type:"text",name:"cvv",label:this.$t("cvv"),rules:{required:!0,length:{min:3,max:4}},maxLength:"4"},on:{error:e.onError},model:{value:e.creditcard.cvv,callback:function(t){e.$set(e.creditcard,"cvv",t)},expression:"creditcard.cvv"}})],1)],1)],1)],1),t("b-col",{attrs:{sm:"12",lg:"4"}},[e._t("sidebar"),t("img",{attrs:{src:"/img/256bit.png",width:"100%"}}),t("img",{attrs:{src:"/img/2checkout-logo.png",width:"100%"}})],2)],1)],1)},i=[],a=r("8e09"),o={name:"PaymentInfo",components:{InputField:a["a"]},props:{value:{type:Object}},data:function(){return{errors:{}}},computed:{creditcard:{get(){return this.value},set(e){this.$emit("input",e)}}},watch:{"creditcard.expires":function(e,t){2==e.length&&(this.creditcard.expires+="/")}},methods:{onError(e){this.errors[e.field]=e.error;let t=!0;Object.keys(this.errors).forEach(e=>{const r=this.errors[e];t=!!r}),t?this.$emit("error"):(console.log("NO ERRORS"),this.$emit("success"))}}},n=o,l=r("2877"),c=Object(l["a"])(n,s,i,!1,null,null,null);t["a"]=c.exports}}]);
//# sourceMappingURL=chunk-ed51246e.4f975b95.js.map