text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bundle.users"],{"04b1":function(e,t,n){e.exports=n.p+"img/spinner-icon.bbf63906.gif"},"5eaa":function(e,t,n){!function(t,n){e.exports=n()}(window,(function(){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}n.r(t);var i={maxNotifications:10,animationDuration:300,position:"bottom-right",labels:{tip:"Tip",info:"Info",success:"Success",warning:"Attention",alert:"Error",async:"Loading",confirm:"Confirmation required",confirmOk:"OK",confirmCancel:"Cancel"},icons:{tip:"question-circle",info:"info-circle",success:"check-circle",warning:"exclamation-circle",alert:"exclamation-triangle",async:"cog fa-spin",confirm:"exclamation-triangle",prefix:"<i class='fa fas fa-fw fa-",suffix:"'></i>",enabled:!0},replacements:{tip:null,info:null,success:null,warning:null,alert:null,async:null,"async-block":null,modal:null,confirm:null,general:{"<script>":"","<\/script>":""}},messages:{tip:"",info:"",success:"Action has been succeeded",warning:"",alert:"Action has been failed",confirm:"This action can't be undone. Continue?",async:"Please, wait...","async-block":"Loading"},formatError:function(e){if(e.response){if(!e.response.data)return"500 API Server Error";if(e.response.data.errors)return e.response.data.errors.map((function(e){return e.detail})).join("<br>");if(e.response.statusText)return"".concat(e.response.status," ").concat(e.response.statusText,": ").concat(e.response.data)}return e.message?e.message:e},durations:{global:5e3,success:null,info:null,tip:null,warning:null,alert:null},minDurations:{async:1e3,"async-block":1e3}},o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object.assign(this,this.defaultsDeep(n,t))}var t,n,o;return t=e,(n=[{key:"icon",value:function(e){return this.icons.enabled?"".concat(this.icons.prefix).concat(this.icons[e]).concat(this.icons.suffix):""}},{key:"label",value:function(e){return this.labels[e]}},{key:"duration",value:function(e){var t=this.durations[e];return null===t?this.durations.global:t}},{key:"toSecs",value:function(e){return"".concat(e/1e3,"s")}},{key:"applyReplacements",value:function(e,t){if(!e)return this.messages[t]||"";for(var n=0,a=["general",t];n<a.length;n++){var r=a[n];if(this.replacements[r])for(var i in this.replacements[r])e=e.replace(i,this.replacements[r][i])}return e}},{key:"override",value:function(t){return t?new e(t,this):this}},{key:"defaultsDeep",value:function(e,t){var n={};for(var r in e)t.hasOwnProperty(r)?n[r]="object"===a(e[r])&&null!==e[r]?this.defaultsDeep(e[r],t[r]):t[r]:n[r]=e[r];return n}}])&&r(t.prototype,n),o&&r(t,o),e}(),s={popup:"".concat("awn","-popup"),toast:"".concat("awn","-toast"),btn:"".concat("awn","-btn"),confirm:"".concat("awn","-confirm")},c={prefix:s.toast,klass:{label:"".concat(s.toast,"-label"),content:"".concat(s.toast,"-content"),icon:"".concat(s.toast,"-icon"),progressBar:"".concat(s.toast,"-progress-bar"),progressBarPause:"".concat(s.toast,"-progress-bar-paused")},ids:{container:"".concat(s.toast,"-container")}},l={prefix:s.popup,klass:{buttons:"".concat("awn","-buttons"),button:s.btn,successBtn:"".concat(s.btn,"-success"),cancelBtn:"".concat(s.btn,"-cancel"),title:"".concat(s.popup,"-title"),body:"".concat(s.popup,"-body"),content:"".concat(s.popup,"-content"),dotAnimation:"".concat(s.popup,"-loading-dots")},ids:{wrapper:"".concat(s.popup,"-wrapper"),confirmOk:"".concat(s.confirm,"-ok"),confirmCancel:"".concat(s.confirm,"-cancel")}},u={klass:{hiding:"".concat("awn","-hiding")},lib:"awn"};function f(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var d=function(){function e(t,n,a,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.newNode=document.createElement("div"),n&&(this.newNode.id=n),a&&(this.newNode.className=a),r&&(this.newNode.style.cssText=r),this.parent=t,this.options=i}var t,n,a;return t=e,(n=[{key:"beforeInsert",value:function(){}},{key:"afterInsert",value:function(){}},{key:"insert",value:function(){return this.beforeInsert(),this.el=this.parent.appendChild(this.newNode),this.afterInsert(),this}},{key:"replace",value:function(e){var t=this;if(this.getElement())return this.beforeDelete().then((function(){return t.updateType(e.type),t.parent.replaceChild(e.newNode,t.el),t.el=t.getElement(e.newNode),t.afterInsert(),t}))}},{key:"beforeDelete",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el,n=0;return this.start&&(n=this.options.minDurations[this.type]+this.start-Date.now())<0&&(n=0),new Promise((function(a){setTimeout((function(){t.classList.add(u.klass.hiding),setTimeout(a,e.options.animationDuration)}),n)}))}},{key:"delete",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el;return this.getElement(t)?this.beforeDelete(t).then((function(){t.remove(),e.afterDelete()})):null}},{key:"afterDelete",value:function(){}},{key:"getElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el;return e?document.getElementById(e.id):null}},{key:"addEvent",value:function(e,t){this.el.addEventListener(e,t)}},{key:"toggleClass",value:function(e){this.el.classList.toggle(e)}},{key:"updateType",value:function(e){this.type=e,this.duration=this.options.duration(this.type)}}])&&f(t.prototype,n),a&&f(t,a),e}();function p(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var m=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.callback=t,this.remaining=n,this.resume()}var t,n,a;return t=e,(n=[{key:"pause",value:function(){this.paused=!0,window.clearTimeout(this.timerId),this.remaining-=new Date-this.start}},{key:"resume",value:function(){var e=this;this.paused=!1,this.start=new Date,window.clearTimeout(this.timerId),this.timerId=window.setTimeout((function(){window.clearTimeout(e.timerId),e.callback()}),this.remaining)}},{key:"toggle",value:function(){this.paused?this.resume():this.pause()}}])&&p(t.prototype,n),a&&p(t,a),e}();function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function y(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var w=function(e){function t(e,n,a,r){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=y(this,b(t).call(this,r,"".concat(c.prefix,"-").concat(Math.floor(Date.now()-100*Math.random())),"".concat(c.prefix," ").concat(c.prefix,"-").concat(n),"animation-duration: ".concat(a.toSecs(a.animationDuration),";"),a))).updateType(n),i.setInnerHtml(e),i}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(t,e),n=t,(a=[{key:"setInnerHtml",value:function(e){"alert"===this.type&&e&&(e=this.options.formatError(e)),e=this.options.applyReplacements(e,this.type),this.newNode.innerHTML='<div class="awn-toast-wrapper">'.concat(this.progressBar).concat(this.label,'<div class="').concat(c.klass.content,'">').concat(e,'</div><span class="').concat(c.klass.icon,'">').concat(this.options.icon(this.type),"</span></div>")}},{key:"beforeInsert",value:function(){var e=this;if(this.parent.childElementCount>=this.options.maxNotifications){var t=Array.from(this.parent.getElementsByClassName(c.prefix));this.delete(t.find((function(t){return!e.isDeleted(t)})))}}},{key:"afterInsert",value:function(){var e=this;if("async"==this.type)return this.start=Date.now();if(this.addEvent("click",(function(){return e.delete()})),!(this.duration<=0)){this.timer=new m((function(){return e.delete()}),this.duration);for(var t=0,n=["mouseenter","mouseleave"];t<n.length;t++){var a=n[t];this.addEvent(a,(function(){e.isDeleted()||(e.toggleClass(c.klass.progressBarPause),e.timer.toggle())}))}}}},{key:"isDeleted",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.el;return e.classList.contains(u.klass.hiding)}},{key:"progressBar",get:function(){return this.duration<=0||"async"===this.type?"":"<div class='".concat(c.klass.progressBar,"' style=\"animation-duration:").concat(this.options.toSecs(this.duration),';"></div>')}},{key:"label",get:function(){return'<b class="'.concat(c.klass.label,'">').concat(this.options.label(this.type),"</b>")}}])&&h(n.prototype,a),r&&h(n,r),t}(d);function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function C(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var j=function(e){function t(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"modal",r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var s="animation-duration: ".concat(r.toSecs(r.animationDuration),";");return(n=C(this,x(t).call(this,document.body,l.ids.wrapper,null,s,r)))[l.ids.confirmOk]=i,n[l.ids.confirmCancel]=o,n.className="".concat(l.prefix,"-").concat(a),["confirm","async-block","modal"].includes(a)||(a="modal"),n.updateType(a),n.setInnerHtml(e),n.insert(),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(t,e),n=t,(a=[{key:"setInnerHtml",value:function(e){var t=this.options.applyReplacements(e,this.type);switch(this.type){case"confirm":var n=["<button class='".concat(l.klass.button," ").concat(l.klass.successBtn,"'id='").concat(l.ids.confirmOk,"'>").concat(this.options.labels.confirmOk,"</button>")];!1!==this[l.ids.confirmCancel]&&n.push("<button class='".concat(l.klass.button," ").concat(l.klass.cancelBtn,"'id='").concat(l.ids.confirmCancel,"'>").concat(this.options.labels.confirmCancel,"</button>")),t="".concat(this.options.icon(this.type),"<div class='").concat(l.klass.title,"'>").concat(this.options.label(this.type),'</div><div class="').concat(l.klass.content,'">').concat(t,"</div><div class='").concat(l.klass.buttons," ").concat(l.klass.buttons,"-").concat(n.length,"'>").concat(n.join(""),"</div>");break;case"async-block":t="".concat(t,'<div class="').concat(l.klass.dotAnimation,'"></div>')}this.newNode.innerHTML='<div class="'.concat(l.klass.body," ").concat(this.className,'">').concat(t,"</div>")}},{key:"keyupListener",value:function(e){if("async-block"===this.type)return e.preventDefault();switch(e.code){case"Escape":e.preventDefault(),this.delete();case"Tab":if(e.preventDefault(),"confirm"!==this.type||!1===this[l.ids.confirmCancel])return!0;var t=this.okBtn;e.shiftKey?document.activeElement.id==l.ids.confirmOk&&(t=this.cancelBtn):document.activeElement.id!==l.ids.confirmCancel&&(t=this.cancelBtn),t.focus()}}},{key:"afterInsert",value:function(){var e=this;switch(this.listener=function(t){return e.keyupListener(t)},window.addEventListener("keydown",this.listener),this.type){case"async-block":this.start=Date.now();break;case"confirm":this.okBtn.focus(),this.addEvent("click",(function(t){if("BUTTON"!==t.target.nodeName)return!1;e.delete(),e[t.target.id]&&e[t.target.id]()}));break;default:document.activeElement.blur(),this.addEvent("click",(function(t){t.target.id===e.newNode.id&&e.delete()}))}}},{key:"afterDelete",value:function(){window.removeEventListener("keydown",this.listener)}},{key:"okBtn",get:function(){return document.getElementById(l.ids.confirmOk)}},{key:"cancelBtn",get:function(){return document.getElementById(l.ids.confirmCancel)}}])&&_(n.prototype,a),r&&_(n,r),t}(d);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}n.d(t,"default",(function(){return S}));var S=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=new o(t)}var t,n,a;return t=e,(n=[{key:"tip",value:function(e,t){return this._addToast(e,"tip",t).el}},{key:"info",value:function(e,t){return this._addToast(e,"info",t).el}},{key:"success",value:function(e,t){return this._addToast(e,"success",t).el}},{key:"warning",value:function(e,t){return this._addToast(e,"warning",t).el}},{key:"alert",value:function(e,t){return this._addToast(e,"alert",t).el}},{key:"async",value:function(e,t,n,a,r){var i=this._addToast(a,"async",r);return this._afterAsync(e,t,n,r,i)}},{key:"confirm",value:function(e,t,n,a){return this._addPopup(e,"confirm",a,t,n)}},{key:"asyncBlock",value:function(e,t,n,a,r){var i=this._addPopup(a,"async-block",r);return this._afterAsync(e,t,n,r,i)}},{key:"modal",value:function(e,t,n){return this._addPopup(e,t,n)}},{key:"closeToasts",value:function(){for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild)}},{key:"_addPopup",value:function(e,t,n,a,r){return new j(e,t,this.options.override(n),a,r)}},{key:"_addToast",value:function(e,t,n,a){n=this.options.override(n);var r=new w(e,t,n,this.container);return a?a instanceof j?a.delete().then((function(){return r.insert()})):a.replace(r):r.insert()}},{key:"_afterAsync",value:function(e,t,n,a,r){return e.then(this._responseHandler(t,"success",a,r),this._responseHandler(n,"alert",a,r))}},{key:"_responseHandler",value:function(e,t,n,a){var r=this;return function(i){switch(E(e)){case"undefined":case"string":var o="alert"===t?e||i:e;r._addToast(o,t,n,a);break;default:a.delete().then((function(){e&&e(i)}))}}}},{key:"_createContainer",value:function(){return new d(document.body,c.ids.container,"awn-".concat(this.options.position)).insert().el}},{key:"container",get:function(){return document.getElementById(c.ids.container)||this._createContainer()}}])&&T(t.prototype,n),a&&T(t,a),e}()}])}))},"7edd":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container-fluid"},[e._m(0),n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"card"},[n("div",{staticClass:"card-body"},[n("form",{attrs:{novalidate:"","data-vv-scope":"create-user-form"}},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6 form-group"},[n("label",[e._v("Firstname")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.user.name,expression:"user.name"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],staticClass:"form-control",attrs:{type:"text",name:"name"},domProps:{value:e.user.name},on:{input:function(t){t.target.composing||e.$set(e.user,"name",t.target.value)}}}),e.errors.has("create-user-form.name")?n("div",{staticClass:"invalid-feedback"},[e._v(" "+e._s(e.errors.first("create-user-form.name"))+" ")]):e._e()]),n("div",{staticClass:"col-lg-6 form-group"},[n("label",[e._v("Last Name")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.user.lastname,expression:"user.lastname"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],staticClass:"form-control",attrs:{type:"text",name:"lastname"},domProps:{value:e.user.lastname},on:{input:function(t){t.target.composing||e.$set(e.user,"lastname",t.target.value)}}}),e.errors.has("create-user-form.lastname")?n("div",{staticClass:"invalid-feedback"},[e._v(" "+e._s(e.errors.first("create-user-form.lastname"))+" ")]):e._e()]),n("div",{staticClass:"col-lg-6 form-group"},[n("label",[e._v("Address")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.user.address,expression:"user.address"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],staticClass:"form-control",attrs:{type:"text",name:"address"},domProps:{value:e.user.address},on:{input:function(t){t.target.composing||e.$set(e.user,"address",t.target.value)}}}),e.errors.has("create-user-form.address")?n("div",{staticClass:"invalid-feedback"},[e._v(" "+e._s(e.errors.first("create-user-form.address"))+" ")]):e._e()]),n("div",{staticClass:"col-lg-6 form-group"},[n("label",[e._v("Email")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.user.email,expression:"user.email"},{name:"validate",rawName:"v-validate",value:{required:!0,email:!0},expression:"{ required: true, email: true }"}],staticClass:"form-control",attrs:{type:"email",name:"email"},domProps:{value:e.user.email},on:{input:function(t){t.target.composing||e.$set(e.user,"email",t.target.value)}}}),e.errors.has("create-user-form.email")?n("div",{staticClass:"invalid-feedback"},[e._v(" "+e._s(e.errors.first("create-user-form.email"))+" ")]):e._e()])])]),n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12 d-flex"},[n("div",{staticClass:"ml-auto"},[n("button",{staticClass:"btn btn-lg btn-primary mr-2",on:{click:function(t){return e.saveUser()}}},[e._v(" Save ")]),n("button",{staticClass:"btn btn-lg btn-secondary",on:{click:function(t){return e.cancel()}}},[e._v(" Cancel ")])])])])])])])])])},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h2",[e._v("Add new user")])])])}],i=(n("96cf"),n("1da1")),o=n("5530"),s=n("2f62"),c=n("c40d"),l={name:"CreateUser",data:function(){return{user:{name:"",lastname:"",address:"",email:"",onloan:"",loan_history:[]}}},methods:Object(o["a"])({},Object(s["b"])(["addUserAction"]),{saveUser:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$validator.validateAll("create-user-form").then(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=8;break}if(void 0!==e.getUserByEmail(e.user.email)){t.next=7;break}return t.next=4,e.addUserAction(e.user);case 4:e.$router.push({name:"home"}),t.next=8;break;case 7:c["a"].alert("User cant created because this email <b>".concat(e.user.email,"</b> exists "));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},cancel:function(){this.$router.push({name:"home"})}}),computed:Object(o["a"])({},Object(s["c"])(["getUserByEmail"]))},u=l,f=n("2877"),d=Object(f["a"])(u,a,r,!1,null,null,null);t["default"]=d.exports},b798:function(e,t,n){},c40d:function(e,t,n){"use strict";var a=n("5eaa"),r=n.n(a),i={icons:{enabled:!1}},o=new r.a(i);t["a"]=o},c428:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"row text-center justify-content-center",staticStyle:{height:"calc(100vh - 60px)"}},[a("div",{staticClass:"col-sm-12 align-self-center"},[a("img",{attrs:{src:n("04b1"),height:"90",width:"90"}}),a("h2",[e._v(e._s(e.msg))])])])},r=[],i={name:"Loader",props:{msg:{type:String,default:"Getting data please be patient"}}},o=i,s=n("2877"),c=Object(s["a"])(o,a,r,!1,null,null,null);t["a"]=c.exports},c655:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container-fluid"},[e.loading?n("Loading",{attrs:{msg:e.message}}):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h2",[e._v("Users Available "+e._s(e.users.length))])])]),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],staticClass:"form-row"},e._l(e.users,(function(t){return n("div",{key:t._id,staticClass:"col-lg-6 mb-2 flex-column"},[n("div",{staticClass:"card h-100"},[n("div",{staticClass:"card-header d-flex"},[n("h4",{staticClass:"text-truncate flex-grow-1 flex-shrink-1 mb-0 pb-1 align-self-center",attrs:{title:t.name}},[e._v(" "+e._s(e.fullname(t))+" ("+e._s(t.email)+") ")]),n("button",{staticClass:"btn btn-lg btn-link flex-grow-0 flex-shrink-0",on:{click:function(n){return e.askToDelete(t)}}},[e._v(" Delete user ")])]),n("div",{staticClass:"card-body"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-lg-6"},[n("h5",{staticClass:"card-title"},[e._v(" Address ")]),e._v(" "+e._s(t.address)+" ")]),n("div",{staticClass:"col-lg-6"},[n("label",[e._v(e._s(t.loan_history.filter((function(e){return!0===e.is_loaned})).length)+" Copies loaned")]),t.loan_history.length>0?n("ul",e._l(t.loan_history,(function(t,a){return n("li",{directives:[{name:"show",rawName:"v-show",value:!0===t.is_loaned,expression:"loan.is_loaned === true"}],key:a},[e._v(" "+e._s(t.title)+" ")])})),0):e._e()])])])])])})),0)],1)},r=[],i=(n("99af"),n("4de4"),n("d81d"),n("b0c0"),n("5530")),o=(n("96cf"),n("1da1")),s=n("2f62"),c=n("c428"),l=n("c40d"),u={name:"ManageUsers",components:{Loading:c["a"]},data:function(){return{message:"",loading:!1}},created:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.loadUsers();case 2:case"end":return t.stop()}}),t)})))()},methods:Object(i["a"])({},Object(s["b"])(["getUsersAction","deleteUserAction"]),{loadUsers:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.message="Getting users please be patient",e.loading=!0,t.next=4,e.getUsersAction();case 4:e.message="",e.loading=!1;case 6:case"end":return t.stop()}}),t)})))()},fullname:function(e){return"".concat(e.name," ").concat(e.lastname)},askToDelete:function(e){var t=this;if(0===e.loan_history.filter((function(e){return!0===e.is_loaned})).length){var n=function(){return t.deleteUser(e)},a=function(){};l["a"].confirm("Are you sure you want to delete <b>".concat(e.name," ").concat(e.lastname,"</b>"),n,a,{labels:{confirm:"Delete confirmation"}})}else l["a"].alert("User cant deleted because has loaned <b>".concat(e.loan_history.map((function(e){return e.title})),"</b>"))},deleteUser:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!e){n.next=3;break}return n.next=3,t.deleteUserAction(e);case 3:case"end":return n.stop()}}),n)})))()}}),computed:Object(i["a"])({},Object(s["d"])(["users"]))},f=u,d=(n("ee52"),n("2877")),p=Object(d["a"])(f,a,r,!1,null,"c1cded48",null);t["default"]=p.exports},d81d:function(e,t,n){"use strict";var a=n("23e7"),r=n("b727").map,i=n("1dde"),o=n("ae40"),s=i("map"),c=o("map");a({target:"Array",proto:!0,forced:!s||!c},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},ee52:function(e,t,n){"use strict";var a=n("b798"),r=n.n(a);r.a}}]);
  //# sourceMappingURL=bundle.users.a1bceec5.js.map