text: (self.webpackChunk=self.webpackChunk||[]).push([[887],{4228:(e,a,t)=>{"use strict";t.d(a,{Z:()=>n});const s={props:["type","placeholder","label-placeholder","value"],name:"input-vs",computed:{getlabelPlaceholder:function(){return null!=this.labelPlaceholder},isIcon:function(){return null!=this.$slots.icon}},data:function(){return{invalue:this.value}},methods:{handleInput:function(e){this.$emit("input",this.invalue)}}};const n=(0,t(1900).Z)(s,(function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"input-main"},[t("div",{staticClass:"input-parent"},[t("div",{staticClass:"content-vs"},["checkbox"===e.type?t("input",{directives:[{name:"model",rawName:"v-model",value:e.invalue,expression:"invalue"}],staticClass:"input-vs",class:{"input-vs--has-icon":e.isIcon},attrs:{type:"checkbox"},domProps:{value:e.value,checked:Array.isArray(e.invalue)?e._i(e.invalue,e.value)>-1:e.invalue},on:{input:e.handleInput,change:function(a){var t=e.invalue,s=a.target,n=!!s.checked;if(Array.isArray(t)){var r=e.value,o=e._i(t,r);s.checked?o<0&&(e.invalue=t.concat([r])):o>-1&&(e.invalue=t.slice(0,o).concat(t.slice(o+1)))}else e.invalue=n}}}):"radio"===e.type?t("input",{directives:[{name:"model",rawName:"v-model",value:e.invalue,expression:"invalue"}],staticClass:"input-vs",class:{"input-vs--has-icon":e.isIcon},attrs:{type:"radio"},domProps:{value:e.value,checked:e._q(e.invalue,e.value)},on:{input:e.handleInput,change:function(a){e.invalue=e.value}}}):t("input",{directives:[{name:"model",rawName:"v-model",value:e.invalue,expression:"invalue"}],staticClass:"input-vs",class:{"input-vs--has-icon":e.isIcon},attrs:{type:e.type},domProps:{value:e.value,value:e.invalue},on:{input:[function(a){a.target.composing||(e.invalue=a.target.value)},e.handleInput]}}),e._v(" "),""==e.invalue?t("label",{staticClass:"label-vs",class:{"label-vs--placeholder":e.getlabelPlaceholder}},[e._v(e._s(e.labelPlaceholder||e.placeholder))]):e._e(),e._v(" "),e.isIcon?t("span",{staticClass:"icon-vs"},[e._t("icon")],2):e._e()])]),e._v(" "),t("div",{staticClass:"vs-input__message vs-input__message--danger"},[e._t("error")],2)])}),[],!1,null,null,null).exports},2887:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>n});const s={components:{InputVs:t(4228).Z},data:function(){return{data:{email:"",password:"",remember:!1},errors:{},disabled:!1,error:!1,errorMessage:"",color:"danger"}},created:function(){window.token&&this.$router.replace({name:"home"})},computed:{loginDisabled:function(){return this.disabled}},methods:{login:function(){var e=this;this.errors={},this.disabled=!0,this.error=!1;var a=this.$vs.loading({target:this.$refs.login,scale:"0.6",background:"primary",opacity:1,color:"#fff"});axios.post("login",this.data).then((function(t){e.disabled=!1,a.close(),e.$swal({title:t.data.message,toast:!0,position:"top-center",showConfirmButton:!1,timer:3e3,timerProgressBar:!0,icon:"success"}),e.$store.dispatch("login",t.data),e.$router.replace({name:"home"})})).catch((function(t){console.log(t),a.close(),e.disabled=!1,422==t.response.status&&(e.errors=t.response.data.errors),e.error=!0,e.color="danger",e.errorMessage=t.response.data.message}))}}};const n=(0,t(1900).Z)(s,(function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",[t("transition",{attrs:{name:"zoom-fade",mode:"out-in",appear:""}},[t("h4",[e._v("Login")])]),e._v(" "),t("p",{staticClass:"text-muted mb-4"},[e._v("Sign in to continue to ചാറ്റ് മുറി.")]),e._v(" "),t("transition",{attrs:{name:"zoom-fade",mode:"out-in",appear:""}},[t("div",{staticClass:"new-card p-4"},[t("vs-alert",{attrs:{closable:"",color:e.color},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" "+e._s(e.errorMessage)+" ")]},proxy:!0}]),model:{value:e.error,callback:function(a){e.error=a},expression:"error"}}),e._v(" "),t("div",{staticClass:"pt-4"},[t("input-vs",{attrs:{type:"text","label-placeholder":"EMail"},model:{value:e.data.email,callback:function(a){e.$set(e.data,"email",a)},expression:"data.email"}},[t("div",{attrs:{slot:"icon"},slot:"icon"},[t("i",{staticClass:"bx bx-mail-send"})]),e._v(" "),e.errors.hasOwnProperty("email")?t("div",{attrs:{slot:"error"},slot:"error"},[e._v("\n            "+e._s(e.errors.email[0])+"\n          ")]):e._e()])],1),e._v(" "),t("div",{staticClass:"pt-4"},[t("input-vs",{attrs:{type:"password",labelPlaceholder:"Password"},model:{value:e.data.password,callback:function(a){e.$set(e.data,"password",a)},expression:"data.password"}},[t("div",{attrs:{slot:"icon"},slot:"icon"},[t("i",{staticClass:"bx bx-lock"})]),e._v(" "),e.errors.hasOwnProperty("password")?t("div",{attrs:{slot:"error"},slot:"error"},[e._v("\n            "+e._s(e.errors.password[0])+"\n          ")]):e._e()])],1),e._v(" "),t("div",{staticClass:"center pl-4"},[t("vs-checkbox",{model:{value:e.data.remember,callback:function(a){e.$set(e.data,"remember",a)},expression:"data.remember"}},[e._v(" Remember Me ? ")])],1),e._v(" "),t("vs-button",{ref:"login",attrs:{block:"",active:"",disabled:e.loginDisabled},on:{click:e.login}},[e._v("Login")])],1)]),e._v(" "),t("div",{staticClass:"mt-5 text-center"},[t("p",[e._v("\n      Don't have an account ?\n      "),t("router-link",{staticClass:"font-weight-medium text-primary",attrs:{to:{name:"register"}}},[e._v("\n        Signup now\n      ")])],1)])],1)}),[],!1,null,null,null).exports}}]);