UNPKG

vue-authservice-bulma

Version:
2 lines 76.5 kB
module.exports=function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=11)}([function(e,t){e.exports=function(e,t,r,i,n,s){var o,a=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(o=e,a=e.default);var l="function"==typeof a?a.options:a;t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0),r&&(l.functional=!0),n&&(l._scopeId=n);var c;if(s?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=c):i&&(c=i),c){var d=l.functional,f=d?l.render:l.beforeCreate;d?(l._injectStyles=c,l.render=function(e,t){return c.call(t),f(e,t)}):l.beforeCreate=f?[].concat(f,c):[c]}return{esModule:o,exports:a,options:l}}},function(e,t){e.exports=require("debounce")},function(e,t){e.exports=require("vue-awesome/icons/refresh")},function(e,t,r){"use strict";function i(e){r(21)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(22),u=r(0),l=i,c=u(s.a,a.a,!1,l,null,null);t.default=c.exports},function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(e.registerFields)for(var r=e.registerFields.split(","),i=0;i<r.length;i++)if(r[i].trim()===t)return!0;return!1}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),o=i(s);r(2);var a=r(3),u=i(a);t.default={name:"authservice-navbar",components:{Icon:u.default},props:{loginWithUsername:{type:Boolean,default:!1},signin:{type:Boolean,default:!1},hideRegister:{type:Boolean,default:!1},hideForgot:{type:Boolean,default:!1},hideAvatar:{type:Boolean,default:!1},hideLogout:{type:Boolean,default:!1},registerFields:String,registerResume:String,forgotResume:String,nocomma:String},data:function(){return{email:"philcal@mac.com",password:"mouse123",loggedIn:!1,mode:this.$authservice&&this.$authservice.user?"loggedIn":"login",loginError:"",forgotEmail:"",forgotError:"",forgotInProgress:!1,registerEmail:"",registerUsername:"",registerFirstName:"",registerMiddleName:"",registerLastName:"",registerPassword:"",registerRequiresUsername:n(this,"username"),registerRequiresFirstName:n(this,"first_name"),registerRequiresMiddleName:n(this,"middle_name"),registerRequiresLastName:n(this,"last_name"),registerRequiresPassword:n(this,"password"),user:null,jwt:null,fromCache:!1,registerUsernameState:!1,registerUsernameError:""}},computed:{headerName:function(){return this.$authservice.user?this.$authservice.user.username?this.$authservice.user.username:this.$authservice.user.firstname?this.$authservice.user.firstname:this.$authservice.user.email:"-"}},created:function(){},methods:{keyhandler:function(e){e.stopPropagation()},doLogin:function(e){var t=this;console.log("doLogin("+this.email+", "+this.password+")");var r=this.password;return this.password="",this.loginError="",this.$authservice.login(this.email,r).then(function(e){t.loginError="",t.mode="loggedIn",t.$emit("userchange",t.$authservice.user.id)}).catch(function(e){t.loginError=e,t.mode="login",t.$emit("userchange",0)}),!1},doSignout:function(){this.mode="login",this.email="",this.password="",this.$authservice.logout()},facebookLogin:function(){this.$authservice.initiateOAuth(this,"facebook")},googleLogin:function(){alert("google login, "+this.username+", "+this.password),this.$authservice.initiateOAuth(this,"google")},githubLogin:function(){alert("github login, "+this.username+", "+this.password),this.$authservice.initiateOAuth(this,"github")},validateUsername:function(){return""===this.registerUsername?void(this.registerUsernameError=""):this.registerUsername.length<3?(this.registerUsernameState=!1,void(this.registerUsernameError="Username must be 3 or more characters")):this.validateUsernameRemoteBit()},validateUsernameRemoteBit:(0,o.default)(function(){var e=this;this.validatingUsername=!0,this.registerUsernameError="",this.$authservice.usernameAvailability(this.registerUsername).then(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=null===t}).catch(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=!1})},500),register:function(){var e=this,t={email:this.registerEmail};return this.registerRequiresUsername&&(t.username=this.registerUsername),this.registerRequiresPassword&&(t.pasword=this.registerPassword),this.registerRequiresFirstName&&(t.firstName=this.registerFirstName),this.registerRequiresMiddleName&&(t.middleName=this.registerMiddleName),this.registerRequiresLastName&&(t.lastName=this.registerLastName),this.registerError="",this.registerInProgress=!0,this.$authservice.register(t).then(function(t){console.log("all is okay",t),e.registerError="",e.registerInProgress=!1,e.mode="registerAfter"}).catch(function(t){console.log("have error",t),e.registerError=t,e.registerInProgress=!1}),!1},forgot:function(){var e=this;return this.forgotInProgress=!0,this.$authservice.forgot(this.forgotEmail,{forgotResume:this.forgotResume}).then(function(t){e.forgotError="",e.forgotInProgress=!1,e.mode="forgotAfter"}).catch(function(t){e.forgotError=t,e.forgotInProgress=!1}),!0},setMode:function(e){return this.mode=e,!1}}}},function(e,t,r){"use strict";function i(){return"fa-"+(s++).toString(16)}Object.defineProperty(t,"__esModule",{value:!0});var n={};t.default={name:"icon",props:{name:{type:String,validator:function(e){return e?e in n||(console.warn('Invalid prop: prop "name" is referring to an unregistered icon "'+e+'".\nPlease make sure you have imported this icon before using it.'),!1):(console.warn('Invalid prop: prop "name" is required.'),!1)}},scale:[Number,String],spin:Boolean,inverse:Boolean,pulse:Boolean,flip:{validator:function(e){return"horizontal"===e||"vertical"===e}},label:String},data:function(){return{x:!1,y:!1,childrenWidth:0,childrenHeight:0,outerScale:1}},computed:{normalizedScale:function(){var e=this.scale;return e=void 0===e?1:Number(e),isNaN(e)||e<=0?(console.warn('Invalid prop: prop "scale" should be a number over 0.',this),this.outerScale):e*this.outerScale},klass:function(){return{"fa-icon":!0,"fa-spin":this.spin,"fa-flip-horizontal":"horizontal"===this.flip,"fa-flip-vertical":"vertical"===this.flip,"fa-inverse":this.inverse,"fa-pulse":this.pulse}},icon:function(){return this.name?n[this.name]:null},box:function(){return this.icon?"0 0 "+this.icon.width+" "+this.icon.height:"0 0 "+this.width+" "+this.height},ratio:function(){if(!this.icon)return 1;var e=this.icon,t=e.width,r=e.height;return Math.max(t,r)/16},width:function(){return this.childrenWidth||this.icon&&this.icon.width/this.ratio*this.normalizedScale||0},height:function(){return this.childrenHeight||this.icon&&this.icon.height/this.ratio*this.normalizedScale||0},style:function(){return 1!==this.normalizedScale&&{fontSize:this.normalizedScale+"em"}},raw:function(){if(!this.icon||!this.icon.raw)return null;var e=this.icon.raw,t={};return e=e.replace(/\s(?:xml:)?id=(["']?)([^"')\s]+)\1/g,function(e,r,n){var s=i();return t[n]=s,' id="'+s+'"'}),e=e.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,function(e,r,i,n){var s=r||n;return s&&t[s]?"#"+t[s]:e}),e}},mounted:function(){var e=this;if(!this.icon){this.$children.forEach(function(t){t.outerScale=e.normalizedScale});var t=0,r=0;this.$children.forEach(function(e){t=Math.max(t,e.width),r=Math.max(r,e.height)}),this.childrenWidth=t,this.childrenHeight=r,this.$children.forEach(function(e){e.x=(t-e.width)/2,e.y=(r-e.height)/2})}},register:function(e){for(var t in e){var r=e[t];r.paths||(r.paths=[]),r.d&&r.paths.push({d:r.d}),r.polygons||(r.polygons=[]),r.points&&r.polygons.push({points:r.points}),n[t]=r}},icons:n};var s=870711},function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function n(e,t){return!!e.registerFields&&e.registerFields.indexOf(t)>=0}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),o=i(s);r(2);var a=r(3),u=i(a);t.default={name:"authservice-navbar",components:{Icon:u.default},props:{loginWithUsername:{type:Boolean,default:!1},signin:{type:Boolean,default:!1},hideRegister:{type:Boolean,default:!1},hideForgot:{type:Boolean,default:!1},hideAvatar:{type:Boolean,default:!1},hideLogout:{type:Boolean,default:!1},registerFields:String,registerResume:String,forgotResume:String,nocomma:String},data:function(){return{loggedIn:!1,mode:this.$authservice&&this.$authservice.user?"loggedIn":"login",loginError:"",forgotEmail:"",forgotError:"",forgotInProgress:!1,registerEmail:"",registerUsername:"",registerFirstName:"",registerMiddleName:"",registerLastName:"",registerPassword:"",registerRequiresUsername:n(this,"u"),registerRequiresFirstName:n(this,"f"),registerRequiresMiddleName:n(this,"m"),registerRequiresLastName:n(this,"l"),registerRequiresPassword:n(this,"p"),user:null,jwt:null,fromCache:!1,registerUsernameState:!1,registerUsernameError:""}},computed:{headerName:function(){return this.$authservice.user?this.$authservice.user.username?this.$authservice.user.username:this.$authservice.user.firstname?this.$authservice.user.firstname:this.$authservice.user.email:"-"}},created:function(){},methods:{keyhandler:function(e){e.stopPropagation()},doLogin:function(e){var t=this;console.log("doLogin("+this.email+", "+this.password+")");var r=this.password;return this.password="",this.loginError="",this.$authservice.login(this.email,r).then(function(e){t.loginError="",t.mode="loggedIn",t.$emit("userchange",t.$authservice.user.id)}).catch(function(e){t.loginError=e,t.mode="login",t.$emit("userchange",0)}),!1},doSignout:function(){this.mode="login",this.email="",this.password="",this.$authservice.logout()},facebookLogin:function(){this.$authservice.initiateOAuth(this,"facebook")},githubLogin:function(){this.$authservice.initiateOAuth(this,"github")},googleLogin:function(){this.$authservice.initiateOAuth(this,"google")},linkedInLogin:function(){this.$authservice.initiateOAuth(this,"linkedin")},twitterLogin:function(){this.$authservice.initiateOAuth(this,"twitter")},validateUsername:function(){return""===this.registerUsername?void(this.registerUsernameError=""):this.registerUsername.length<3?(this.registerUsernameState=!1,void(this.registerUsernameError="Username must be 3 or more characters")):this.validateUsernameRemoteBit()},validateUsernameRemoteBit:(0,o.default)(function(){var e=this;this.validatingUsername=!0,this.registerUsernameError="",this.$authservice.usernameAvailability(this.registerUsername).then(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=null===t}).catch(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=!1})},500),register:function(){var e=this,t={email:this.registerEmail};return this.registerRequiresUsername&&(t.username=this.registerUsername),this.registerRequiresPassword&&(t.pasword=this.registerPassword),this.registerRequiresFirstName&&(t.firstName=this.registerFirstName),this.registerRequiresMiddleName&&(t.middleName=this.registerMiddleName),this.registerRequiresLastName&&(t.lastName=this.registerLastName),this.registerError="",this.registerInProgress=!0,this.$authservice.register(t).then(function(t){console.log("all is okay",t),e.registerError="",e.registerInProgress=!1,e.mode="registerAfter"}).catch(function(t){console.log("have error",t),e.registerError=t,e.registerInProgress=!1}),!1},forgot:function(){var e=this;return this.forgotInProgress=!0,this.$authservice.forgot(this.forgotEmail,{forgotResume:this.forgotResume}).then(function(t){e.forgotError="",e.forgotInProgress=!1,e.mode="forgotAfter"}).catch(function(t){e.forgotError=t,e.forgotInProgress=!1}),!0},setMode:function(e){return this.mode=e,!1}}}},function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function n(e,t){return!!e.registerFields&&e.registerFields.indexOf(t)>=0}Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),o=i(s);r(2);var a=r(3),u=i(a);t.default={name:"authservice-navbar",components:{Icon:u.default},props:{loginWithUsername:{type:Boolean,default:!1},signin:{type:Boolean,default:!1},hideRegister:{type:Boolean,default:!1},hideForgot:{type:Boolean,default:!1},hideAvatar:{type:Boolean,default:!1},hideLogout:{type:Boolean,default:!1},registerFields:String,registerResume:String,forgotResume:String,nocomma:String},data:function(){return{loggedIn:!1,mode:this.$authservice&&this.$authservice.user?"loggedIn":"login",loginError:"",forgotEmail:"",forgotError:"",forgotInProgress:!1,registerEmail:"",registerUsername:"",registerFirstName:"",registerMiddleName:"",registerLastName:"",registerPassword:"",registerRequiresUsername:n(this,"u"),registerRequiresFirstName:n(this,"f"),registerRequiresMiddleName:n(this,"m"),registerRequiresLastName:n(this,"l"),registerRequiresPassword:n(this,"p"),user:null,jwt:null,fromCache:!1,registerUsernameState:!1,registerUsernameError:""}},computed:{headerName:function(){return this.$authservice.user?this.$authservice.user.username?this.$authservice.user.username:this.$authservice.user.firstname?this.$authservice.user.firstname:this.$authservice.user.email:"-"}},created:function(){},methods:{keyhandler:function(e){e.stopPropagation()},doLogin:function(e){var t=this;console.log("doLogin("+this.email+", "+this.password+")");var r=this.password;return this.password="",this.loginError="",this.$authservice.login(this.email,r).then(function(e){t.loginError="",t.mode="loggedIn",t.$emit("userchange",t.$authservice.user.id)}).catch(function(e){t.loginError=e,t.mode="login",t.$emit("userchange",0)}),!1},doSignout:function(){this.mode="login",this.email="",this.password="",this.$authservice.logout()},facebookLogin:function(){this.$authservice.initiateOAuth(this,"facebook")},githubLogin:function(){this.$authservice.initiateOAuth(this,"github")},googleLogin:function(){this.$authservice.initiateOAuth(this,"google")},linkedInLogin:function(){this.$authservice.initiateOAuth(this,"linkedin")},twitterLogin:function(){this.$authservice.initiateOAuth(this,"twitter")},validateUsername:function(){return""===this.registerUsername?void(this.registerUsernameError=""):this.registerUsername.length<3?(this.registerUsernameState=!1,void(this.registerUsernameError="Username must be 3 or more characters")):this.validateUsernameRemoteBit()},validateUsernameRemoteBit:(0,o.default)(function(){var e=this;this.validatingUsername=!0,this.registerUsernameError="",this.$authservice.usernameAvailability(this.registerUsername).then(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=null===t}).catch(function(t){e.registerUsernameError=t,e.validatingUsername=!1,e.registerUsernameState=!1})},500),register:function(){var e=this,t={email:this.registerEmail};return this.registerRequiresUsername&&(t.username=this.registerUsername),this.registerRequiresPassword&&(t.pasword=this.registerPassword),this.registerRequiresFirstName&&(t.firstName=this.registerFirstName),this.registerRequiresMiddleName&&(t.middleName=this.registerMiddleName),this.registerRequiresLastName&&(t.lastName=this.registerLastName),this.registerError="",this.registerInProgress=!0,this.$authservice.register(t).then(function(t){console.log("all is okay",t),e.registerError="",e.registerInProgress=!1,e.mode="registerAfter"}).catch(function(t){console.log("have error",t),e.registerError=t,e.registerInProgress=!1}),!1},forgot:function(){var e=this;return this.forgotInProgress=!0,this.$authservice.forgot(this.forgotEmail,{forgotResume:this.forgotResume}).then(function(t){e.forgotError="",e.forgotInProgress=!1,e.mode="forgotAfter"}).catch(function(t){e.forgotError=t,e.forgotInProgress=!1}),!0},setMode:function(e){return this.mode=e,!1}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"my-component",props:{text:{type:String,default:"Test text",required:!0}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"authservice-firstname"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"authservice-fullname"}},function(e,t,r){e.exports=r(12)},function(e,t,r){"use strict";(function(e){function i(e){return e&&e.__esModule?e:{default:e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="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},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),a=r(18),u=r(38),l=i(u),c=r(39),d=i(c),f=r(40),h=i(f),g=(r(41),r(42));console.log("(index.js) 1"),console.log("(index.js) 2");var m=function(){function t(e){n(this,t),console.log("&&& Authservice constructor",e),this.host=e.host?e.host:"api.authservice.io",this.port=e.port?e.port:80,this.version=e.version?e.version:"v2",this.apikey=e.apikey,this.registerResume=e.registerResume,this.forgetResume=e.forgetResume,this.user=null,this.jwt=null,this.fromCache=!1}return o(t,[{key:"init",value:function(e){console.log("&&& MyComponent init")}},{key:"endpoint",value:function(){return(this.protocol?this.protocol:"http")+"://"+this.host+":"+this.port+"/"+this.version+"/"+this.apikey}},{key:"checkInitialLoginStatus",value:function(e){e=!0,console.log("+++++ checkInitialLoginStatus ++++++");var t=this.getURLParameterByName("AUTHSERVICE_JWT");if(t){e&&(console.log("***"),console.log("***"),console.log("*** AUTHSERVICE_JWT IN URL"),console.log("***"),console.log("***"));return this.setCurrentUserFromJWT(t,!1)?(this.setCookie("authservice-jwt",t,3),!0):(this.removeCookie("authservice-jwt"),!1)}if(t=this.getCookie("authservice-jwt")){e&&(console.log("***"),console.log("***"),console.log("*** AUTHSERVICE_JWT IN A COOKIE"),console.log("***"),console.log("***"));return!!this.setCurrentUserFromJWT(t,!1)||(this.removeCookie("authservice-jwt"),!1)}e&&(console.log("***"),console.log("***"),console.log("*** AUTHSERVICE_JWT NOT IN URL OR COOKIE"),console.log("***"),console.log("***"));return this.setCurrentUserFromJWT(null,!1),!1}},{key:"login",value:function(e,t){var r=this;return new Promise(function(i,n){console.log("login(email="+e+")"),(0,d.default)({method:"post",url:r.endpoint()+"/email/login",headers:{"Content-Type":"application/json",Accept:"application/json"},data:{email:e,password:t}}).then(function(e){if("ok"===e.data.status){var t=e.data.jwt;return r.setCurrentUserFromJWT(t,!1)?(r.setCookie("authservice-jwt",t,3),void i(r.user.id)):(console.log("ok 4"),r.removeCookie("authservice-jwt"),console.log("ok 5"),void n("Invalid credentials"))}return r.setCurrentUserFromJWT(null,!1),r.removeCookie("authservice-jwt"),void n(e.data.message)}).catch(function(e){r.setCurrentUserFromJWT(null,!1),r.removeCookie("authservice-jwt"),n(e.response.data.message)})})}},{key:"initiateOAuth",value:function(t,r,i,n){console.log("initiateOAuth(me, "+r+")");var s=window.location,o=s.protocol+"//"+s.hostname;s.port&&(o+=":"+s.port),console.log("\n\nbaseURL=",o);var a;if(i)a=o+i;else{console.log("resume to current page",s);var u=h.default.parse(s.search);console.log(u),delete u.AUTHSERVICE_JWT,delete u.AUTHSERVICE_ERROR;var l=h.default.stringify(u);a=s.protocol+"//"+s.host+s.pathname,l&&(a+="?"+l),a+=s.hash,console.log("\n\nresumeURL=",a),console.log(new e(a).toString("base64"))}var c=new e(a).toString("base64"),d=h.default.stringify({next:c}),f=o+"/authservice-bounce?"+d+"#";console.log("\n\nbounceURL=",f);var g,m=f;g=n?o+n:f,console.log("successURL="+m),console.log("successURL="+encodeURIComponent(m)),console.log("failURL="+g);var v="http://"+this.host+":"+this.port+"/"+this.version+"/oauth2/initiate/"+this.apikey+"/"+r;v+="?success="+encodeURIComponent(m),v+="&fail="+encodeURIComponent(g),window.location=v}},{key:"logout",value:function(){var e=this;return new Promise(function(t,r){e.setCurrentUserFromJWT(null,!1),e.removeCookie("authservice-jwt"),t(0)})}},{key:"register",value:function(e){var t=this;return console.log("$authservice.register()",e),console.log("ok 0"),new Promise(function(r,i){switch(console.log("ok 0a"),s(e.email)){case"string":e.email.indexOf("@")<1&&i("Please enter a valid email address");break;case"undefined":return i("options.email must be provided");default:return i("options.email must be a string")}switch(s(t.registerResume)){case"string":break;case"undefined":return i("options.registerResume must be provided");default:return i("options.registerResume must be a string")}var n={email:e.email,resume:t.registerResume};switch(console.log("username is "+e.username),s(e.username)){case"string":var o=e.username.trim().toLowerCase();if(o.indexOf(" ")>=0)return void i("Username may not contain spaces");if(o.indexOf("@")>=0)return void i("Username may not contain @");n.username=o;break;case"undefined":n.username=n.email;break;default:return i("If provided, options.username must be a string")}switch(console.log("ok 1"),s(e.password)){case"string":if(e.password.length<5)return i("Please enter a longer password");n.password=e.password;break;case"undefined":break;default:return i("If provided, options.password must be a string")}switch(console.log("ok 2"),s(e.firstName)){case"string":if(e.firstName.length<1)return i("Please enter a first name");n.firstName=e.firstName;break;case"undefined":break;default:return i("If provided, options.firstName must be a string")}switch(console.log("ok 3"),s(e.middleName)){case"string":if(e.middleName.length<1)return i("Please enter a middle name");n.middleName=e.middleName;break;case"undefined":break;default:return i("If provided, options.middleName must be a string")}switch(console.log("ok 4"),s(e.lastName)){case"string":if(e.lastName.length<1)return i("Please enter a last name");n.lastName=e.lastName;break;case"undefined":break;default:return i("If provided, options.lastName must be a string")}console.log("params=",n),(0,d.default)({method:"put",url:t.endpoint()+"/email/register",headers:{"Content-Type":"application/json",Accept:"application/json"},data:n}).then(function(e){if(console.log("response is ",e),e.data&&"ok"===e.data.status){if(e.jwt){var n=e.jwt;t.setCurrentUserFromJWT(n,!1)?t.setCookie("authservice-jwt",n,3):t.removeCookie("authservice-jwt")}return void r(n)}var s=e.data&&e.data.message?e.data.message:"Error while registering";return void i(s)}).catch(function(e){var t=e.response.data&&e.response.data.Error?e.response.data.Error:"Error while registering";i(t)})})}},{key:"forgot",value:function(t,r){var i=this;return new Promise(function(n,s){if(null===t||t.indexOf("@")<1){return void s("Please enter a valid email address")}var o=window.location,a=o.protocol+"//"+o.hostname;o.port&&(a+=":"+o.port),console.log("\n\nbaseURL=",a);var u;if(r&&r.forgotResume)u=a+r.forgotResume;else{console.log("resume to current page",o);var l=h.default.parse(o.search);console.log(l),delete l.AUTHSERVICE_JWT,delete l.AUTHSERVICE_ERROR;var c=h.default.stringify(l);u=o.protocol+"//"+o.host+o.pathname,c&&(u+="?"+c),u+=o.hash,console.log("\n\nresumeURL=",u),console.log(new e(u).toString("base64"))}var f=new e(u).toString("base64"),g=h.default.stringify({next:f}),m=o.protocol+"//"+o.host+"?"+g+"#/authservice-bounce";console.log("\n\nbounceURL=",m),console.log("params=",g),(0,d.default)({method:"post",url:i.endpoint()+"/email/forgot",headers:{"Content-Type":"application/json",Accept:"application/json"},data:{email:t,resume:m}}).then(function(e){if("ok"===e.data.status)return void n(e.data);var t=e.data&&e.data.message?e.data.message:"Error while sending email";return void s(t)}).catch(function(e){var t=e.response.data&&e.response.data.message?e.response.data.message:"Error while sending email";s(t)})})}},{key:"getURLParameterByName",value:function(e){var t=RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);return t&&decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"setCurrentUserFromJWT",value:function(e,t){var r=!1,i=null;if(e)try{var n=(0,l.default)(e);console.log("decoded=",n),i=n.identity,r=!0}catch(e){console.log("Error decoding JWT: ",e),r=!1}if(r){var s={tenant:i.tenant,authority:i.authority,avatar:i.avatar,email:i.email,entityType:i.entity_type,firstname:i.first_name,fullname:i.full_name,gender:i.gender,id:i.id,isAdmin:i.is_admin,languages:i.languages,lastname:i.last_name,locale:i.locale,location:i.location,mediaPage:i.media_page,middlename:i.middle_name,privileges:i.privileges,status:i.status,timezone:i.timezone,username:i.username};return this.user=s,this.jwt=e,this.fromCache=t,!0}return this.user=null,this.jwt=null,this.fromCache=!1,!1}},{key:"usernameAvailability",value:function(e){var t=this;return new Promise(function(r,i){if(e=e.trim().toLowerCase(),e.length<3)return void i("Username must be 3 or more characters");var n=t.endpoint()+"/username-availability/"+encodeURIComponent(e);(0,d.default)({method:"get",url:n,headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(function(e){return"available"===e.data.status?void r(null):void r(e.data.error)}).catch(function(e){var t=e.response.data.Error?e.response.data.Error:"Could not check availability";i(t)})})}},{key:"setCookie",value:function(e,t,r){t?console.log("setting cookie ("+e+")"):console.log("clearing cookie ("+e+")");var i=new Date;i.setTime(i.getTime()+24*r*60*60*1e3);var n="expires="+i.toUTCString();document.cookie=e+"="+t+";"+n+";path=/"}},{key:"getCookie",value:function(e){for(var t=e+"=",r=document.cookie.split(";"),i=0;i<r.length;i++){for(var n=r[i];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return""}},{key:"removeCookie",value:function(e){this.setCookie(e,null,0)}}]),t}();m.install=a.install,m.version="__VERSION__",g.inBrowser&&window.Vue&&window.Vue.use(m),t.default=m}).call(t,r(13).Buffer)},function(e,t,r){"use strict";(function(e){function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function n(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=s.prototype):(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,r){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return o(this,e,t,r)}function o(e,t,r,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?f(e,t,r,i):"string"==typeof t?c(e,t,r):h(e,t)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,r,i){return a(t),t<=0?n(e,t):void 0!==r?"string"==typeof i?n(e,t).fill(r,i):n(e,t).fill(r):n(e,t)}function l(e,t){if(a(t),e=n(e,t<0?0:0|g(t)),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function c(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|v(t,r);e=n(e,i);var o=e.write(t,r);return o!==i&&(e=e.slice(0,o)),e}function d(e,t){var r=t.length<0?0:0|g(t.length);e=n(e,r);for(var i=0;i<r;i+=1)e[i]=255&t[i];return e}function f(e,t,r,i){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,r):new Uint8Array(t,r,i),s.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=s.prototype):e=d(e,t),e}function h(e,t){if(s.isBuffer(t)){var r=0|g(t.length);return e=n(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||G(t.length)?n(e,0):d(e,t);if("Buffer"===t.type&&Z(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),s.alloc(+e)}function v(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return W(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function b(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:w(e,t,r,i,n);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,i,n){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}var l;if(n){var c=-1;for(l=r;l<a;l++)if(s(e,l)===s(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*o}else-1!==c&&(l-=l-c),c=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var d=!0,f=0;f<u;f++)if(s(e,l+f)!==s(t,f)){d=!1;break}if(d)return l}return-1}function _(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o<i;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[r+o]=a}return o}function k(e,t,r,i){return H(W(t,e.length-r),e,r,i)}function E(e,t,r,i){return H(D(t),e,r,i)}function C(e,t,r,i){return E(e,t,r,i)}function R(e,t,r,i){return H(J(t),e,r,i)}function U(e,t,r,i){return H(V(t,e.length-r),e,r,i)}function P(e,t,r){return 0===t&&r===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var s=e[n],o=null,a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){var u,l,c,d;switch(a){case 1:s<128&&(o=s);break;case 2:u=e[n+1],128==(192&u)&&(d=(31&s)<<6|63&u)>127&&(o=d);break;case 3:u=e[n+1],l=e[n+2],128==(192&u)&&128==(192&l)&&(d=(15&s)<<12|(63&u)<<6|63&l)>2047&&(d<55296||d>57343)&&(o=d);break;case 4:u=e[n+1],l=e[n+2],c=e[n+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(d=(15&s)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&d<1114112&&(o=d)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=a}return x(i)}function x(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=Q));return r}function L(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function S(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function A(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=t;s<r;++s)n+=z(e[s]);return n}function O(e,t,r){for(var i=e.slice(t,r),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function $(e,t,r,i,n,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function T(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,s=Math.min(e.length-r,2);n<s;++n)e[r+n]=(t&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function M(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,s=Math.min(e.length-r,4);n<s;++n)e[r+n]=t>>>8*(i?n:3-n)&255}function B(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,i,n){return n||B(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,r,i,23,4),r+4}function j(e,t,r,i,n){return n||B(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,r,i,52,8),r+8}function q(e){if(e=Y(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function Y(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function W(e,t){t=t||1/0;for(var r,i=e.length,n=null,s=[],o=0;o<i;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function D(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function V(e,t){for(var r,i,n,s=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function J(e){return X.toByteArray(q(e))}function H(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function G(e){return e!==e}var X=r(15),K=r(16),Z=r(17);t.Buffer=s,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=i(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,r){return o(null,e,t,r)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,r){return u(null,e,t,r)},s.allocUnsafe=function(e){return l(null,e)},s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Z(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=s.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var o=e[r];if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length}return i},s.byteLength=v,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):p.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,r,i,n){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;for(var o=n-i,a=r-t,u=Math.min(o,a),l=this.slice(i,n),c=e.slice(t,r),d=0;d<u;++d)if(l[d]!==c[d]){o=l[d],a=c[d];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},s.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return E(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return R(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=s.prototype;else{var n=t-e;i=new s(n,void 0);for(var o=0;o<n;++o)i[o]=this[o+e]}return i},s.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i},s.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},s.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var i=t,n=1,s=this[e+--i];i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},s.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),K.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),K.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),K.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),K.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t|=0,r|=0,!i){$(this,e,t,r,Math.pow(2,8*r)-1,0)}var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t|=0,r|=0,!i){$(this,e,t,r,Math.pow(2,8*r)-1,0)}var n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);$(this,e,t,r,n-1,-n)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},s.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);$(this,e,t,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||$(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n,o=i-r;if(this===e&&r<t&&t<i)for(n=o-1;n>=0;--n)e[n+t]=this[n+r];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},s.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=s.isBuffer(e)?e:W(new s(e,i).toString()),u=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(14))},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports=require("base64-js")},function(e,t){e.exports=require("ieee754")},function(e,t){e.exports=require("isarray")},function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function n(e){if(console.log("&&& authservice-vue install"),!n.installed){n.installed=!0,t._Vue=p=e;var r=function(e){return void 0!==e};e.mixin({beforeCreate:function(){r(this.$options.authservice)?(console.log("Initialise the root"),this._authserviceRoot=this,this._authservice=this.$options.authservice,e.util.defineReactive(this,"_authservice",this.$authservice),console.log("Checking login status from beforeCreate()"),this._authservice.checkInitialLoginStatus(!1)):this._authserviceRoot=this.$parent&&this.$parent._authserviceRoot||this},destroyed:function(){}}),Object.defineProperty(e.prototype,"$authservice",{get:function(){return this._authserviceRoot._authservice}}),e.component("authservice-navbar",o.default),e.component("authservice-navbar-blu",u.default),e.component("authservice-bulma",c.default),e.component("my-component",f.default),e.component("authservice-firstname",g.default),e.component("authservice-fullname",v.default)}}Object.defineProperty(t,"__esModule",{value:!0}),t._Vue=void 0,t.install=n;var s=r(19),o=i(s),a=r(24),u=i(a),l=r(27),c=i(l),d=r(30),f=i(d),h=r(32),g=i(h),m=r(35),v=i(m),p=t._Vue=void 0;console.log("HIIIWUWUU 81 (install.js)")},function(e,t,r){"use strict";function i(e){r(20)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(23),u=r(0),l=i,c=u(s.a,a.a,!1,l,"data-v-51115e98",null);t.default=c.exports},function(e,t){},function(e,t){},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("svg",{class:e.klass,style:e.style,attrs:{version:"1.1",role:e.label?"img":"presentation","aria-label":e.label,x:e.x,y:e.y,width:e.width,height:e.height,viewBox:e.box}},[e._t("default",[e.icon&&e.icon.paths?e._l(e.icon.paths,function(t,i){return r("path",e._b({key:"path-"+i},"path",t,!1))}):e._e(),e._v(" "),e.icon&&e.icon.polygons?e._l(e.icon.polygons,function(t,i){return r("polygon",e._b({key:"polygon-"+i},"polygon",t,!1))}):e._e(),e._v(" "),e.icon&&e.icon.raw?[r("g",{domProps:{innerHTML:e._s(e.raw)}})]:e._e()])],2)},n=[],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-nav-item-dropdown",{attrs:{text:null!=e.$authservice.user?e.headerName:e.signin?"Sign in":"Login",right:"right"}},["loggedIn"===e.mode?r("b-form",[r("b-dropdown-header",[r("strong",[e._v(e._s(e.$authservice.user.firstname)+"  "+e._s(e.$authservice.user.lastname))]),e.$authservice.user.avatar?r("img",{attrs:{src:e.$authservice.user.avatar,alt:""}}):e._e()]),r("b-dropdown-item",[r("router-link",{attrs:{to:"/applications"}},[e._v("Settings")])],1),r("b-dropdown-divider"),r("b-dropdown-item",{on:{click:function(t){e.doSignout()}}},[e._v(e._s(e.signin?"Sign out":"Logout"))])],1):e._e(),"login"===e.mode?r("b-form",{staticClass:"login-form",attrs:{href:""}},[r("b-dropdown-header",[r("h4",[e._v("Login")]),r("b-form-group",{attrs:{label:"Username / Email"}},[r("b-form-input",{attrs:{type:"text",tabindex:"31"},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.email,callback:function(t){e.email="string"==typeof t?t.trim():t},expression:"email"}})],1),r("b-form-group",{attrs:{label:"Password"}},[r("b-form-input",{attrs:{type:"password",tabindex:"32",autocomplete:"current-password"},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.password,callback:function(t){e.password="string"==typeof t?t.trim():t},expression:"password"}})],1),e.loginError?r("b-alert",{attrs:{variant:"danger",show:"show"}},[e._v(e._s(e.loginError))]):e._e(),r("b-button",{attrs:{variant:"primary",tabindex:"33"},on:{click:e.doLogin}},[e._v("Login")])],1),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{staticClass:"my-button",attrs:{size:"sm",variant:"link",tabindex:"34"},on:{click:function(t){e.setMode("forgot")}}},[e._v("Forgot password")]),r("br"),r("b-button",{attrs:{size:"sm",variant:"link",tabindex:"35"},on:{click:function(t){e.setMode("register")}}},[e._v("Register")])],1),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{staticClass:"my-button",attrs:{variant:"primary",tabindex:"36"},on:{click:function(t){e.facebookLogin()}}},[e._v("Login with Facebook")]),r("br"),r("b-button",{staticClass:"my-button",attrs:{variant:"danger",tabindex:"37"},on:{click:function(t){e.googleLogin()}}},[e._v("Login with Google")]),r("br"),r("b-button",{staticClass:"my-button",attrs:{variant:"secondary",tabindex:"38"},on:{click:function(t){e.githubLogin()}}},[e._v("Login with Github")])],1)],1):e._e(),"register"===e.mode?r("b-form",{staticClass:"register-form"},[r("b-dropdown-header",[r("h4",[e._v("Register")]),r("div",{staticClass:"register-text"},[e._v("Hi!\nEnter your details and we'll be happy to sign you up.")]),e.registerRequiresUsername?r("b-form-group",{attrs:{label:"Username",placeholder:"Choose a user name"}},[r("b-form-input",{attrs:{type:"text",state:e.registerUsernameState,autocomplete:"off"},on:{input:e.validateUsername},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerUsername,callback:function(t){e.registerUsername="string"==typeof t?t.trim():t},expression:"registerUsername"}}),r("b-form-feedback",{attrs:{id:"input-feedback"}},[e._v(e._s(e.registerUsernameError))])],1):e._e(),r("b-form-group",{attrs:{label:"Email"}},[r("b-form-input",{attrs:{type:"text"},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerEmail,callback:function(t){e.registerEmail="string"==typeof t?t.trim():t},expression:"registerEmail"}})],1),e.registerRequiresPassword?r("b-form-group",{attrs:{label:"Password"}},[r("b-form-input",{attrs:{type:"password",autocomplete:"off"},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerPassword,callback:function(t){e.registerPassword="string"==typeof t?t.trim():t},expression:"registerPassword"}})],1):e._e(),e.registerRequiresFirstName?r("b-form-group",{attrs:{label:"First name"}},[r("b-form-input",{nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerFirstName,callback:function(t){e.registerFirstName="string"==typeof t?t.trim():t},expression:"registerFirstName"}})],1):e._e(),e.registerRequiresMiddleName?r("b-form-group",{attrs:{label:"Middle name"}},[r("b-form-input",{nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerMiddleName,callback:function(t){e.registerMiddleName="string"==typeof t?t.trim():t},expression:"registerMiddleName"}})],1):e._e(),e.registerRequiresLastName?r("b-form-group",{attrs:{label:"Last name"}},[r("b-form-input",{nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.registerLastName,callback:function(t){e.registerLastName="string"==typeof t?t.trim():t},expression:"registerLastName"}})],1):e._e()],1),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{attrs:{variant:"primary"},on:{click:e.register}},[e._v("Register")]),r("b-button",{attrs:{size:"sm",variant:"link"},on:{click:function(t){e.setMode("login")}}},[e._v("Cancel")])],1)],1):e._e(),"registerAfter"===e.mode?r("b-form",[r("b-dropdown-header",[r("p",[e._v("Congratulations, you now have a user account.\nWe have sent you an email to verify your email address.")]),r("p",[e._v("Please take a moment to check your email and complete\nthe registration process.")])]),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{staticClass:"btn btn-default",attrs:{type:"submit",size:"sm",variant:"primary"},on:{click:function(t){e.setMode("login")}}},[e._v("ok")])],1)],1):e._e(),"forgot"===e.mode?r("b-form",{staticClass:"forgot-form"},[r("b-dropdown-header",[r("h4",[e._v("Forgotten Password")]),r("div",{staticClass:"forgot-text"},[e._v("Forgot your password? No problem. Enter your email address below and we'll\nwell send an email with a link to reset your password.")]),r("b-form-group",{attrs:{label:"Email Address"}},[r("b-form-input",{attrs:{type:"text"},nativeOn:{keydown:function(t){return e.keyhandler(t)}},model:{value:e.forgotEmail,callback:function(t){e.forgotEmail="string"==typeof t?t.trim():t},expression:"forgotEmail"}})],1),e.forgotError?r("b-alert",{attrs:{variant:"danger",show:"show"}},[e._v(e._s(e.forgotError))]):e._e()],1),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{attrs:{variant:"primary"},on:{click:e.forgot}},[e.forgotInProgress?r("span",[r("icon",{attrs:{name:"refresh",spin:"spin"}}),e._v("  ")],1):e._e(),e._v("Send the Email")]),e._v(" "),r("b-button",{attrs:{size:"sm",variant:"link",right:"right"},on:{click:function(t){e.setMode("login")}}},[e._v("Cancel")])],1)],1):e._e(),"forgotAfter"===e.mode?r("b-form",{staticClass:"forgot-form"},[r("b-dropdown-header",[r("h4",[e._v("Forgotten Password")]),r("div",{staticClass:"forgot-text"},[e._v("We have sent an email to "+e._s(e.forgotEmail)+" with\ninstructions to reset your password.")])]),r("b-dropdown-divider"),r("b-dropdown-header",[r("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:function(t){e.setMode("login")}}},[e._v("Ok")])],1)],1):e._e()],1)},n=[],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";function i(e){r(25)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(26),u=r(0),l=i,c=u(s.a,a.a,!1,l,"data-v-c656b5bc",null);t.default=c.exports},function(e,t){},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[r("a",{staticClass:"navbar-link",attrs:{href:""}},[e._v(e._s(null!=e.$authservice.user?e.headerName:e.signin?"Sign in":"Login"))]),r("div",{staticClass:"navbar-dropdown is-right is-boxed"},["login"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"label"},[e._v("Username / Email")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.email,expression:"email",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text",placeholder:"Text input"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),r("div",{staticClass:"label"},[e._v("Password")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.password,expression:"password",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"password",autocomplete:"current-password"},domProps:{value:e.password},on:{input:function(t){t.target.composing||(e.password=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.loginError?r("alert",{attrs:{type:"danger"}},[e._v(e._s(e.loginError))]):e._e(),r("div",{staticClass:"button is-primary",on:{click:e.doLogin}},[e._v("Login")])],1)]),r("div",{staticClass:"navbar-divider"}),r("a",{staticClass:"navbar-item",attrs:{size:"sm"},on:{click:function(t){e.setMode("forgot")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Forgot password")]),r("a",{staticClass:"navbar-item",attrs:{size:"sm"},on:{click:function(t){e.setMode("register")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Register")]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary",on:{click:function(t){e.facebookLogin()}}},[e._v("Login with Facebook")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.githubLogin()}}},[e._v("Login with Github")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-danger",on:{click:function(t){e.googleLogin()}}},[e._v("Login with Google")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.linkedInLogin()}}},[e._v("Login with LinkedIn")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.twitterLogin()}}},[e._v("Login with Twitter")])])]):e._e(),"loggedIn"===e.mode?r("div",[r("router-link",{staticClass:"navbar-item",attrs:{to:"/applications"}},[e._v("Settings")]),r("a",{staticClass:"navbar-item is-white",on:{click:function(t){e.doSignout()}}},[e._v(e._s(e.signin?"Sign out":"Logout"))])],1):e._e(),"forgot"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"label"},[e._v("Forgotten password")]),r("div",{staticClass:"forgot-text"},[e._v("Forgot your password? No problem. Enter your email address below and we'll\nwell send an email with a link to reset your password.")]),r("div",{staticClass:"label"},[e._v("Email Address")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.forgotEmail,expression:"forgotEmail",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text"},domProps:{value:e.forgotEmail},on:{input:function(t){t.target.composing||(e.forgotEmail=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.forgotError?r("alert",{attrs:{type:"danger"}},[e._v(e._s(e.forgotError))]):e._e()],1)]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary small is-right",on:{click:function(t){e.forgot()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Send Email")]),e._v("  "),r("div",{staticClass:"button is-white small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Cancel")])])]):e._e(),"forgotAfter"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"forgot-text"},[e._v("We have sent an email to "+e._s(e.forgotEmail)+" with\ninstructions to reset your password.")])])]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"button is-primary small",on:{click:function(t){e.setMode("login")}}},[e._v("Ok")])]):e._e(),"register"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"register-text"},[e._v("Hi!\nEnter your details and we'll be happy to sign you up.")]),e.registerRequiresUsername?r("div",[r("div",{staticClass:"label"},[e._v("Username")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerUsername,expression:"registerUsername",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text",placeholder:"Choose a user name"},domProps:{value:e.registerUsername},on:{input:[function(t){t.target.composing||(e.registerUsername=t.target.value.trim())},e.validateUsername],blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),r("div",{staticClass:"label"},[e._v("Email")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerEmail,expression:"registerEmail",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text"},domProps:{value:e.registerEmail},on:{input:function(t){t.target.composing||(e.registerEmail=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.registerRequiresPassword?r("div"):e._e(),r("div",{staticClass:"label"},[e._v("Password")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerPassword,expression:"registerPassword",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"password",autocomplete:"off"},domProps:{value:e.registerPassword},on:{input:function(t){t.target.composing||(e.registerPassword=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.registerRequiresFirstName?r("div",[r("div",{staticClass:"label"},[e._v("First name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerFirstName,expression:"registerFirstName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerFirstName},on:{input:function(t){t.target.composing||(e.registerFirstName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),e.registerRequiresMiddleName?r("div",[r("div",{staticClass:"label"},[e._v("Middle name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerMiddleName,expression:"registerMiddleName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerMiddleName},on:{input:function(t){t.target.composing||(e.registerMiddleName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),e.registerRequiresLastName?r("div",[r("div",{staticClass:"label"},[e._v("Last name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerLastName,expression:"registerLastName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerLastName},on:{input:function(t){t.target.composing||(e.registerLastName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e()])]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary small",on:{click:e.register}},[e._v("Register")]),e._v("  "),r("div",{staticClass:"button is-white small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Cancel")])])]):e._e(),"registerAfter"===e.mode?r("div",[e._m(0),r("div",{staticClass:"navbar-divider"},[r("div",{staticClass:"button is-primary small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Ok")])])]):e._e()])])},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"label"},[e._v("Registration")]),r("p",[e._v("Congratulations, you now have a user account.\nWe have sent you an email to verify your email address.")]),r("p",[e._v("Please take a moment to check your email and complete\nthe registration process.")])])}],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";function i(e){r(28)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(29),u=r(0),l=i,c=u(s.a,a.a,!1,l,"data-v-d5573460",null);t.default=c.exports},function(e,t){},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"navbar-item has-dropdown is-hoverable"},[r("a",{staticClass:"navbar-link",attrs:{href:""}},[e._v(e._s(null!=e.$authservice.user?e.headerName:e.signin?"Sign in":"Login"))]),r("div",{staticClass:"navbar-dropdown is-right is-boxed"},["login"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"label"},[e._v("Username / Email")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.email,expression:"email",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text",placeholder:"Text input"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),r("div",{staticClass:"label"},[e._v("Password")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.password,expression:"password",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"password",autocomplete:"current-password"},domProps:{value:e.password},on:{input:function(t){t.target.composing||(e.password=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.loginError?r("alert",{attrs:{type:"danger"}},[e._v(e._s(e.loginError))]):e._e(),r("div",{staticClass:"button is-primary",on:{click:e.doLogin}},[e._v("Login")])],1)]),r("div",{staticClass:"navbar-divider"}),r("a",{staticClass:"navbar-item",attrs:{size:"sm"},on:{click:function(t){e.setMode("forgot")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Forgot password")]),r("a",{staticClass:"navbar-item",attrs:{size:"sm"},on:{click:function(t){e.setMode("register")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Register")]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary",on:{click:function(t){e.facebookLogin()}}},[e._v("Login with Facebook")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.githubLogin()}}},[e._v("Login with Github")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-danger",on:{click:function(t){e.googleLogin()}}},[e._v("Login with Google")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.linkedInLogin()}}},[e._v("Login with LinkedIn")])]),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-dark",on:{click:function(t){e.twitterLogin()}}},[e._v("Login with Twitter")])])]):e._e(),"loggedIn"===e.mode?r("div",[r("router-link",{staticClass:"navbar-item",attrs:{to:"/applications"}},[e._v("Settings")]),r("a",{staticClass:"navbar-item is-white",on:{click:function(t){e.doSignout()}}},[e._v(e._s(e.signin?"Sign out":"Logout"))])],1):e._e(),"forgot"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"label"},[e._v("Forgotten password")]),r("div",{staticClass:"forgot-text"},[e._v("Forgot your password? No problem. Enter your email address below and we'll\nwell send an email with a link to reset your password.")]),r("div",{staticClass:"label"},[e._v("Email Address")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.forgotEmail,expression:"forgotEmail",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text"},domProps:{value:e.forgotEmail},on:{input:function(t){t.target.composing||(e.forgotEmail=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.forgotError?r("alert",{attrs:{type:"danger"}},[e._v(e._s(e.forgotError))]):e._e()],1)]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary small is-right",on:{click:function(t){e.forgot()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Send Email")]),e._v("  "),r("div",{staticClass:"button is-white small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Cancel")])])]):e._e(),"forgotAfter"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"forgot-text"},[e._v("We have sent an email to "+e._s(e.forgotEmail)+" with\ninstructions to reset your password.")])])]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"button is-primary small",on:{click:function(t){e.setMode("login")}}},[e._v("Ok")])]):e._e(),"register"===e.mode?r("div",[r("div",{staticClass:"navbar-item"},[r("form",[r("div",{staticClass:"register-text"},[e._v("Hi!\nEnter your details and we'll be happy to sign you up.")]),e.registerRequiresUsername?r("div",[r("div",{staticClass:"label"},[e._v("Username")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerUsername,expression:"registerUsername",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text",placeholder:"Choose a user name"},domProps:{value:e.registerUsername},on:{input:[function(t){t.target.composing||(e.registerUsername=t.target.value.trim())},e.validateUsername],blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),r("div",{staticClass:"label"},[e._v("Email")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerEmail,expression:"registerEmail",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"text"},domProps:{value:e.registerEmail},on:{input:function(t){t.target.composing||(e.registerEmail=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.registerRequiresPassword?r("div"):e._e(),r("div",{staticClass:"label"},[e._v("Password")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerPassword,expression:"registerPassword",modifiers:{trim:!0}}],staticClass:"input",attrs:{type:"password",autocomplete:"off"},domProps:{value:e.registerPassword},on:{input:function(t){t.target.composing||(e.registerPassword=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})]),e.registerRequiresFirstName?r("div",[r("div",{staticClass:"label"},[e._v("First name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerFirstName,expression:"registerFirstName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerFirstName},on:{input:function(t){t.target.composing||(e.registerFirstName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),e.registerRequiresMiddleName?r("div",[r("div",{staticClass:"label"},[e._v("Middle name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerMiddleName,expression:"registerMiddleName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerMiddleName},on:{input:function(t){t.target.composing||(e.registerMiddleName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e(),e.registerRequiresLastName?r("div",[r("div",{staticClass:"label"},[e._v("Last name")]),r("p",{staticClass:"control"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.registerLastName,expression:"registerLastName",modifiers:{trim:!0}}],staticClass:"input",domProps:{value:e.registerLastName},on:{input:function(t){t.target.composing||(e.registerLastName=t.target.value.trim())},blur:function(t){e.$forceUpdate()}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}})])]):e._e()])]),r("div",{staticClass:"navbar-divider"}),r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"button is-primary small",on:{click:e.register}},[e._v("Register")]),e._v("  "),r("div",{staticClass:"button is-white small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Cancel")])])]):e._e(),"registerAfter"===e.mode?r("div",[e._m(0),r("div",{staticClass:"navbar-divider"},[r("div",{staticClass:"button is-primary small is-right",on:{click:function(t){e.setMode("login")}},nativeOn:{keydown:function(t){return e.keyhandler(t)}}},[e._v("Ok")])])]):e._e()])])},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"navbar-item"},[r("div",{staticClass:"label"},[e._v("Registration")]),r("p",[e._v("Congratulations, you now have a user account.\nWe have sent you an email to verify your email address.")]),r("p",[e._v("Please take a moment to check your email and complete\nthe registration process.")])])}],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(8),n=r.n(i);for(var s in i)"default"!==s&&function(e){r.d(t,e,function(){return i[e]})}(s);var o=r(31),a=r(0),u=a(n.a,o.a,!1,null,null,null);t.default=u.exports},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("strong",[e._v(e._s(e.text))])},n=[],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";function i(e){r(33)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(34),u=r(0),l=i,c=u(s.a,a.a,!1,l,null,null);t.default=c.exports},function(e,t){},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",{staticClass:"authservice-firstname"},[e._v(e._s(e.$authservice.user.firstname))])},n=[],s={render:i,staticRenderFns:n};t.a=s},function(e,t,r){"use strict";function i(e){r(36)}Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),s=r.n(n);for(var o in n)"default"!==o&&function(e){r.d(t,e,function(){return n[e]})}(o);var a=r(37),u=r(0),l=i,c=u(s.a,a.a,!1,l,"data-v-10a4567a",null);t.default=c.exports},function(e,t){},function(e,t,r){"use strict";var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"fullname"},[e._v(e._s(e.$authservice.user.firstname)+" "+e._s(e.$authservice.user.lastname))])},n=[],s={render:i,staticRenderFns:n};t.a=s},function(e,t){e.exports=require("jwt-decode")},function(e,t){e.exports=require("axios")},function(e,t){e.exports=require("query-string")},function(e,t,r){"use strict";function i(e,t){if(!e)throw new Error("[vue-router] "+t)}function n(e,t){}function s(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=i,t.warn=n,t.isError=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.inBrowser="undefined"!=typeof window}]);
//# sourceMappingURL=authservice-vue.min.js.map