text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-705e543a"],{"4bd4":function(e,s,r){"use strict";r("2532");var t=r("5530"),a=r("58df"),i=r("7e2b"),o=r("3206");s["a"]=Object(a["a"])(i["a"],Object(o["b"])("form")).extend({name:"v-form",provide(){return{form:this}},inheritAttrs:!1,props:{disabled:Boolean,lazyValidation:Boolean,readonly:Boolean,value:Boolean},data:()=>({inputs:[],watchers:[],errorBag:{}}),watch:{errorBag:{handler(e){const s=Object.values(e).includes(!0);this.$emit("input",!s)},deep:!0,immediate:!0}},methods:{watchInput(e){const s=e=>e.$watch("hasError",s=>{this.$set(this.errorBag,e._uid,s)},{immediate:!0}),r={_uid:e._uid,valid:()=>{},shouldValidate:()=>{}};return this.lazyValidation?r.shouldValidate=e.$watch("shouldValidate",t=>{t&&(this.errorBag.hasOwnProperty(e._uid)||(r.valid=s(e)))}):r.valid=s(e),r},validate(){return 0===this.inputs.filter(e=>!e.validate(!0)).length},reset(){this.inputs.forEach(e=>e.reset()),this.resetErrorBag()},resetErrorBag(){this.lazyValidation&&setTimeout(()=>{this.errorBag={}},0)},resetValidation(){this.inputs.forEach(e=>e.resetValidation()),this.resetErrorBag()},register(e){this.inputs.push(e),this.watchers.push(this.watchInput(e))},unregister(e){const s=this.inputs.find(s=>s._uid===e._uid);if(!s)return;const r=this.watchers.find(e=>e._uid===s._uid);r&&(r.valid(),r.shouldValidate()),this.watchers=this.watchers.filter(e=>e._uid!==s._uid),this.inputs=this.inputs.filter(e=>e._uid!==s._uid),this.$delete(this.errorBag,s._uid)}},render(e){return e("form",{staticClass:"v-form",attrs:Object(t["a"])({novalidate:!0},this.attrs$),on:{submit:e=>this.$emit("submit",e)}},this.$slots.default)}})},"61f7":function(e,s,r){"use strict";s["a"]={validPassword:e=>e.length>=8,samePassword:(e,s)=>e&&s&&e===s,validUsername:e=>e&&/^([0-9A-Za-z_-]){5,}$/.test(e),validEmail:e=>e&&/^\S+@\S+\.\S+$/.test(e)}},"73cf":function(e,s,r){"use strict";r.r(s);var t=function(){var e=this,s=e.$createElement,r=e._self._c||s;return r("v-col",{attrs:{lg:"4",md:"6",sm:"8","offset-lg":"4","offset-md":"3","offset-sm":"2"}},[r("v-card",{attrs:{loading:e.registerDisabled}},[r("v-card-title",{staticClass:"d-flex justify-center"},[r("p",{domProps:{textContent:e._s(e.$t("users.Register"))}})]),r("v-card-text",[r("v-row",[r("v-col",{attrs:{cols:"12"}},[r("v-form",[r("v-text-field",{attrs:{id:"username",outlined:"",label:e.$t("users.Username"),"error-messages":e.username&&!e.validUsername?e.$t("errors.ErrUsernameRequirements",{min:5}):e.errors.username,"prepend-inner-icon":"mdi-account",name:"username",type:"text"},on:{keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.submit(s)}},model:{value:e.username,callback:function(s){e.username="string"===typeof s?s.trim():s},expression:"username"}}),r("v-text-field",{attrs:{id:"email",outlined:"",label:e.$t("users.Email"),"error-messages":e.errors.email,"prepend-inner-icon":"mdi-email",name:"email",type:"text"},on:{keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.submit(s)}},model:{value:e.email,callback:function(s){e.email="string"===typeof s?s.trim():s},expression:"email"}}),r("v-text-field",{attrs:{id:"password",outlined:"",label:e.$t("users.Password"),"error-messages":e.password&&!e.validPassword?e.$t("errors.ErrPasswordRequirements",{min:8}):e.errors.password,"prepend-inner-icon":"mdi-lock","append-icon":e.showPassword?"mdi-eye-off":"mdi-eye",name:"password",type:e.showPassword?"text":"password"},on:{"click:append":function(s){e.showPassword=!e.showPassword},keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.submit(s)}},model:{value:e.password,callback:function(s){e.password=s},expression:"password"}}),r("v-text-field",{attrs:{id:"confirmPassword",outlined:"",label:e.$t("users.ConfirmPassword"),"error-messages":""===e.confirmPassword||e.samePassword?"":e.$t("errors.ErrPasswordsNotIdentical"),"prepend-inner-icon":"mdi-lock","append-icon":e.showConfirmPassword?"mdi-eye-off":"mdi-eye",name:"password",type:e.showConfirmPassword?"text":"password"},on:{"click:append":function(s){e.showConfirmPassword=!e.showConfirmPassword},keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.submit(s)}},model:{value:e.confirmPassword,callback:function(s){e.confirmPassword=s},expression:"confirmPassword"}})],1),r("v-btn",{staticClass:"body-1 mb-5",attrs:{color:"primary",large:"",block:"",disabled:!e.canComplete},domProps:{textContent:e._s(e.$t("users.Register"))},on:{click:e.submit}}),r("v-btn",{attrs:{text:"",block:"",to:{name:"Login"}},domProps:{textContent:e._s(e.$t("users.LoginLink"))}})],1)],1)],1)],1)],1)},a=[],i=r("a78e"),o=r.n(i),n=r("61f7"),d=r("7c15"),l=r("5f87"),u={data(){return{username:"",email:"",password:"",confirmPassword:"",registerDisabled:!1,showPassword:!1,showConfirmPassword:!1,errors:{username:"",email:"",password:""}}},computed:{canComplete(){return!this.registerDisabled&&(!(!this.username||!this.validUsername)&&(!(!this.email||!this.validEmail)&&!(!this.validPassword||!this.samePassword)))},validPassword(){return n["a"].validPassword(this.password)},samePassword(){return n["a"].samePassword(this.password,this.confirmPassword)},validUsername(){return n["a"].validUsername(this.username)},validEmail(){return n["a"].validEmail(this.email)}},mounted(){Object(l["a"])()&&this.$router.push({name:"Servers"})},methods:{submit(){if(this.$toast.clearQueue(),this.$toast.getCmp()&&this.$toast.getCmp().close(),this.errors.username="",this.errors.email="",this.errors.password="",!this.username)return void(this.errors.username=this.$t("errors.ErrFieldRequired",{field:this.$t("users.Username")}));if(!this.email)return void(this.errors.email=this.$t("errors.ErrFieldRequired",{field:this.$t("users.Email")}));if(!this.password)return void(this.errors.password=this.$t("errors.ErrFieldRequired",{field:this.$t("users.Password")}));if(!n["a"].validPassword(this.password))return;this.registerDisabled=!0;const e=this;this.axios.post(this.$route.path,{email:this.email,password:this.password,username:this.username}).then(s=>{s.data.token&&""!==s.data.token?(o.a.set("puffer_auth",s.data.token),localStorage.setItem("scopes",JSON.stringify(s.data.scopes||[])),e.$emit("logged-in"),e.$router.push({name:"Servers"})):(this.$toast.success(this.$t("users.RegisterSuccess")),e.$router.push({name:"Login"}))}).catch(Object(d["a"])(e)).finally(()=>{e.registerDisabled=!1})}}},m=u,h=r("2877"),c=r("6544"),p=r.n(c),f=r("8336"),w=r("b0af"),v=r("99d9"),b=r("62ad"),g=r("4bd4"),y=r("0fd9"),k=r("8654"),P=Object(h["a"])(m,t,a,!1,null,null,null);s["default"]=P.exports;p()(P,{VBtn:f["a"],VCard:w["a"],VCardText:v["c"],VCardTitle:v["d"],VCol:b["a"],VForm:g["a"],VRow:y["a"],VTextField:k["a"]})}}]);
  //# sourceMappingURL=chunk-705e543a.b1a3e71f.js.map