(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e5060"],{"935e":function(e,r,t){"use strict";t.r(r);var o=t("f2bf");const s={class:"mt-2 relative flex justify-center min-h-screen items-center"},a={class:"head mb-10"},i={class:"font-bold text-3xl text-start mb-2"},c={class:"text-textHeaderColor text-start"},l={class:"mb-6"},n=["placeholder"],m=["placeholder"],d=["min"],p=["placeholder"],u=["placeholder"],h={class:"flex flex-col items-center space-y-3"},b=["disabled"],$={class:"flex items-center justify-center gap-x-2 mt-4"};function g(e,r,t,g,w,O){const j=Object(o["resolveComponent"])("multiselect"),f=Object(o["resolveComponent"])("FieldWrapper"),v=Object(o["resolveComponent"])("router-link");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",s,[Object(o["createElementVNode"])("form",{onSubmit:r[11]||(r[11]=Object(o["withModifiers"])((...r)=>e.register&&e.register(...r),["prevent"])),class:"w-540 max-w-full flex flex-col bg-white p-8 rounded-lg shadow border"},[Object(o["createElementVNode"])("div",a,[Object(o["createElementVNode"])("h1",i,Object(o["toDisplayString"])(e.$t("register.form_title")),1),Object(o["createElementVNode"])("p",c,Object(o["toDisplayString"])(e.trial&&e.trial.trial_weeks?e.$t("register.form_subtitle",{weeks:e.trial.trial_weeks}):e.$t("register.form_subtitle_no_trial")),1)]),Object(o["createElementVNode"])("div",l,[Object(o["createVNode"])(f,{label:"auth.price",name:"price",errors:e.v$.registerForm.price.$errors},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(j,{class:Object(o["normalizeClass"])({error:e.v$.registerForm.price.$error}),modelValue:e.registerForm.price,"onUpdate:modelValue":r[0]||(r[0]=r=>e.registerForm.price=r),options:e.$store.state.products,"group-values":"prices","group-label":"name","custom-label":e.priceLabel,selectLabel:e.$t("select"),deselectLabel:"",selectedLabel:e.$t("selected"),placeholder:e.$t("selectOption"),"allow-empty":!1},{noResult:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("NoOptionsMatching")),1)]),noOptions:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("NoOptionsAvailable")),1)]),_:1},8,["class","modelValue","options","custom-label","selectLabel","selectedLabel","placeholder"])]),_:1},8,["errors"]),Object(o["createVNode"])(f,{label:"auth.email",name:"email",errors:e.v$.registerForm.email.$errors},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{name:"email",type:"email",class:Object(o["normalizeClass"])([{error:e.v$.registerForm.email.$error},"focus:shadow"]),"onUpdate:modelValue":r[1]||(r[1]=r=>e.registerForm.email=r),placeholder:e.$t("auth.email_placeholder"),onBlur:r[2]||(r[2]=(...r)=>e.v$.registerForm.email.$touch&&e.v$.registerForm.email.$touch(...r))},null,42,n),[[o["vModelText"],e.registerForm.email]])]),_:1},8,["errors"]),Object(o["createVNode"])(f,{label:"company",name:"company",errors:e.v$.registerForm.companyName.$errors},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{name:"company",type:"text",class:Object(o["normalizeClass"])([{error:e.v$.registerForm.companyName.$error},"focus:shadow"]),"onUpdate:modelValue":r[3]||(r[3]=r=>e.registerForm.companyName=r),placeholder:e.$t("company_placeholder"),onBlur:r[4]||(r[4]=(...r)=>e.v$.registerForm.companyName.$touch&&e.v$.registerForm.companyName.$touch(...r))},null,42,m),[[o["vModelText"],e.registerForm.companyName]])]),_:1},8,["errors"]),Object(o["createVNode"])(f,{label:"register.howManyBranches",name:"howManyBranches",errors:e.v$.registerForm.howManyBranches.$errors},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{name:"howManyBranches",type:"number",min:e.minimumBranchesNumber,class:Object(o["normalizeClass"])([{error:e.v$.registerForm.howManyBranches.$error},"focus:shadow"]),"onUpdate:modelValue":r[5]||(r[5]=r=>e.registerForm.howManyBranches=r),onBlur:r[6]||(r[6]=(...r)=>e.v$.registerForm.howManyBranches.$touch&&e.v$.registerForm.howManyBranches.$touch(...r))},null,42,d),[[o["vModelText"],e.registerForm.howManyBranches]])]),_:1},8,["errors"]),Object(o["createVNode"])(f,{label:"auth.password",name:"password",errors:e.v$.registerForm.password.$errors,hint:`${e.$t("register.password_length")} ${e.$t("register.password_not_strong")}`},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{name:"password",type:"password",class:Object(o["normalizeClass"])([{error:e.v$.registerForm.password.$error},"focus:shadow"]),"onUpdate:modelValue":r[7]||(r[7]=r=>e.registerForm.password=r),placeholder:e.$t("auth.password_placeholder"),onBlur:r[8]||(r[8]=(...r)=>e.v$.registerForm.password.$touch&&e.v$.registerForm.password.$touch(...r))},null,42,p),[[o["vModelText"],e.registerForm.password]])]),_:1},8,["errors","hint"]),Object(o["createVNode"])(f,{label:"auth.password_confirm",name:"passwordConfirm",errors:e.v$.registerForm.passwordConfirm.$errors,hint:`${e.$t("register.password_length")} ${e.$t("register.password_not_strong")}`},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{name:"passwordConfirm",type:"password",class:Object(o["normalizeClass"])([{error:e.v$.registerForm.passwordConfirm.$error},"focus:shadow"]),"onUpdate:modelValue":r[9]||(r[9]=r=>e.registerForm.passwordConfirm=r),placeholder:e.$t("auth.password_confirm_placeholder"),onBlur:r[10]||(r[10]=(...r)=>e.v$.registerForm.passwordConfirm.$touch&&e.v$.registerForm.passwordConfirm.$touch(...r))},null,42,u),[[o["vModelText"],e.registerForm.passwordConfirm]])]),_:1},8,["errors","hint"])]),Object(o["createElementVNode"])("div",h,[Object(o["createElementVNode"])("button",{type:"submit",class:"primary w-full h-11",disabled:e.v$.registerForm.invalid},Object(o["toDisplayString"])(e.$t("register.submit")),9,b)]),Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.$t("register.account")),1),Object(o["createVNode"])(v,{to:"/auth",class:"block text-primary font-bold hover:underline text-left"},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.$t("register.login")),1)]),_:1})])],32)])}var w=t("5502"),O=t("25a0"),j=t("633c"),f=t("28dc"),v=Object(o["defineComponent"])({name:"Register",setup:()=>{const e=Object(w["b"])();return e.commit("setVuelidateExternalResults",{registerForm:{}}),{v$:Object(O["a"])({$externalResults:Object(o["reactive"])(e.state.vuelidateExternalResults),$autoDirty:!0})}},data:function(){return{registerForm:{price:null,email:"",password:"",passwordConfirm:"",companyName:"",howManyBranches:1,token:null},minimumBranchesNumber:1}},validations:function(){return{registerForm:{price:{required:j["f"]},email:{required:j["f"],email:j["a"]},password:{required:j["f"]},passwordConfirm:{required:j["f"],sameAs:Object(j["g"])(this.registerForm.password)},companyName:{required:j["f"]},howManyBranches:{required:j["f"],minValue:Object(j["b"])(this.minimumBranchesNumber)}}}},components:{FieldWrapper:f["a"]},computed:{trial(){return this.$store.state.discounts?this.$store.state.discounts.find(e=>e.trial_weeks&&e.trial_weeks>0):null}},methods:{priceLabel(e){return`${e.unit_amount/100} ${e.currency.toUpperCase()}${e.recurring&&e.recurring.interval?" /"+this.$t(e.recurring.interval):""}/${this.$t("branch").toLowerCase()}`},async register(){const e=await this.v$.registerForm.$validate();if(!e)return;await this.$recaptchaLoaded();const r=await this.$recaptcha("login");this.registerForm.token=r,this.$store.dispatch("register",this.registerForm)}},beforeMount(){this.$store.dispatch("getProducts").then(()=>{if(this.$route.query){const e=this.$route.query.price;this.$store.state.products.forEach(r=>{const t=r.prices?r.prices.find(r=>r.id===e):null;this.registerForm.price=t||this.registerForm.price})}})}}),y=t("d959"),F=t.n(y);const N=F()(v,[["render",g]]);r["default"]=N}}]); //# sourceMappingURL=chunk-2d0e5060.01d582d2.js.map