@voidwalkers/void-client
Advanced tools
Comparing version 0.1.11 to 0.1.12
/*! For license information please see index.browser.js.LICENSE.txt */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],t):"object"==typeof exports?exports.voidClient=t(require("@ololoepepe/api-wrapper"),require("axios")):e.voidClient=t(e["@ololoepepe/api-wrapper"],e.axios)}(self,((e,t)=>(()=>{var n={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return e._maxListeners===undefined?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(u(n),(i=e._events)===undefined?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==undefined&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),a===undefined)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:undefined,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(r===undefined)return[];var o=r[t];return o===undefined?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(t!==undefined){var n=t[e];if("function"==typeof n)return 1;if(n!==undefined)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){this._events!==undefined&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(s===undefined)return!1;if("function"==typeof s)r(s,this,t);else{var c=s.length,f=d(s,c);for(n=0;n<c;++n)r(f[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),(r=this._events)===undefined)return this;if((n=r[e])===undefined)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),r.removeListener!==undefined&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===undefined)return this;if(n.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):n[e]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t!==undefined)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},22:t=>{"use strict";t.exports=e},300:e=>{"use strict";e.exports=t},61:(e,t,n)=>{var r=n(698)["default"];function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports["default"]=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new T(r||[]);return u(i,"_invoke",{value:P(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",w="executing",m="completed",g={};function b(){}function x(){}function k(){}var O={};p(O,c,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(D([])));_&&_!==i&&a.call(_,c)&&(O=_);var L=k.prototype=b.prototype=Object.create(O);function E(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&a.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(l).then((function(e){f.value=e,u(f)}),(function(e){return n("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function P(e,n,r){var o=v;return function(i,a){if(o===w)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=M(u,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=w;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?m:y,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return x.prototype=k,u(L,"constructor",{value:k,configurable:!0}),u(k,"constructor",{value:x,configurable:!0}),x.displayName=p(k,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,p(e,l,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},E(S.prototype),p(S.prototype,f,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new S(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(L),p(L,l,"Generator"),p(L,c,(function(){return this})),p(L,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},n.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(W),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),W(n),g}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;W(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},698:e=>{function t(n){return e.exports=t="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.exports.__esModule=!0,e.exports["default"]=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports["default"]=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="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},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}o.r(i),o.d(i,{StorageDriver:()=>s,StorageDriverLocalStorage:()=>k,VoidClient:()=>Ve});var u,s=function(){function t(){e(this,t)}return a(t,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),t}();function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function p(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,d(e,t,"get"))}function y(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,d(e,t,"set"),n),n}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function m(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function g(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}var b=new WeakMap,x=new WeakMap,k=function(t){l(r,t);var n=w(r);function r(){var t,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=o.prefix,a=void 0===i?"void":i,u=o.storageType,s=void 0===u?r.StorageType.LocalStorage:u;return e(this,r),m(c(t=n.call(this)),b,{writable:!0,value:null}),m(c(t),x,{writable:!0,value:null}),y(c(t),b,a),y(c(t),x,g(r,r,O).call(r,s)),t}return a(r,[{key:"load",value:function(e){var t=v(this,x).getItem("".concat(v(this,b),"/").concat(e));return null===t?null:JSON.parse(t)}},{key:"save",value:function(e,t){v(this,x).setItem("".concat(v(this,b),"/").concat(e),JSON.stringify(t))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),r}(s);function O(e){switch(e){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=k;var j=o(22);function _(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){L(i,r,o,a,u,"next",e)}function u(e){L(i,r,o,a,u,"throw",e)}a(undefined)}))}}var S=o(687);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function W(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var T=new WeakMap,D=function(t){l(u,t);var n,r,o,i=R(u);function u(t){var n,r=t.storageDriver;return e(this,u),W(c(n=i.call(this)),T,{writable:!0,value:null}),y(c(n),T,r),n}return a(u,[{key:"authenticate",value:(o=E(S.mark((function f(e,t){var n,r,o,i;return S.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return",null);case 2:return n=t.id,r=t.token_refresh,a.next=5,e.callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/refresh"}});case 5:return o=a.sent,i=o.data,a.abrupt("return",M(M({},t),{},{id:n,token_access:i.token_access}));case 8:case"end":return a.stop()}}),f)}))),function(e,t){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,T).load(s.StorageKey.Session);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e!==undefined){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,v(this,T).save(s.StorageKey.Session,e);case 4:case"end":return t.stop()}}),h,this)}))),function(e){return n.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var A=function(t){l(r,t);var n=C(r);function r(){return e(this,r),n.apply(this,arguments)}return a(r,[{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}}]),r}(j.ApiRealtimeTransport),N=o(300);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function q(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function z(e,t,n){var r,o,i,a=e.apiWrapperOptions,u=e.methodData,s=e.payload,c=u.actionName,f=u.method;return[null==s?void 0:s[t],null==a||null===(r=a[c])||void 0===r?void 0:r[t],null==a||null===(o=a[f])||void 0===o?void 0:o[t],null==a||null===(i=a["default"])||void 0===i?void 0:i[t],n].find((function(e){return e!==undefined}))}var G=new WeakMap,I=new WeakMap,K=new WeakMap,J=function(t){l(o,t);var n,r=U(o);function o(t){var n,i=t.getExtraRequestData,a=t.project;e(this,o),q(c(n=r.call(this)),G,{writable:!0,value:null}),q(c(n),I,{writable:!0,value:null}),q(c(n),K,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(n),G,N.create({baseURL:"https://void.void-walkers.com",headers:{Authorization:"Bearer ".concat(s)},timeout:3e4})),y(c(n),I,i),y(c(n),K,u),n}return a(o,[{key:"callMethod",value:(n=E(S.mark((function i(e){var t,n,r,o,a,u,s,c,f,l,p,h,d,y;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.authenticationData,n=e.methodData,r=e.requestData,o=r.apiWrapperOptions,a=r.payload,u=z({apiWrapperOptions:o,methodData:n,payload:a},"data"),s=z({apiWrapperOptions:o,methodData:n,payload:a},"headers",{}),c=z({apiWrapperOptions:o,methodData:n,payload:a},"method",n.method),f=z({apiWrapperOptions:o,methodData:n,payload:a},"prefix","/projects/".concat(v(this,K))),l=z({apiWrapperOptions:o,methodData:n,payload:a},"timeout",3e4),p=z({apiWrapperOptions:o,methodData:n,payload:a},"url"),h=v(this,I).call(this),d="function"==typeof s?s(a,h):s,y=null!=t&&t.token_access?B({"X-Void-Auth":t.token_access},d):d,i.prev=11,i.next=14,v(this,G).request({timeout:l,data:"function"==typeof u?u(a,h):u,headers:y,method:"function"==typeof c?c(a,h):c,url:f+("function"==typeof p?p(a,h):p)});case 14:return i.abrupt("return",i.sent);case 17:throw i.prev=17,i.t0=i["catch"](11),console.warn(i.t0,i.t0.response),i.t0;case 21:case"end":return i.stop()}}),i,this,[[11,17]])}))),function(e){return n.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(e){var t;return 403===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}},{key:"isSessionExpiredError",value:function(e){var t;return 401===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}}]),o}(j.ApiTransport);function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var Y={delay:1e3,delayFactor:2,maxDelay:4e3},X=function(t){l(r,t);var n=V(r);function r(t){var o=t.config,i=void 0===o?{}:o,a=t.project,u=t.storageDriver;return e(this,r),n.call(this,{authenticator:new D({storageDriver:u}),realtimeTransport:new A,reconnectConfig:(null==i?void 0:i.reconnectConfig)||Y,transport:new J({project:a,getExtraRequestData:(null==i?void 0:i.getExtraRequestData)||function(){return{}}})})}return a(r)}(j.ApiWrapper),H=o(187),Q="authenticate",Z="register";function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function ee(e,t){ne(e,t),t.add(e)}function te(e,t,n){ne(e,t),t.set(e,n)}function ne(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function re(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var oe=new WeakMap,ie=new WeakMap,ae=new WeakSet,ue=new WeakSet,se=new WeakSet,ce=function(t){l(f,t);var n,r,o,i,u=$(f);function f(t){var n,r=t.apiWrapper,o=t.storageDriver;return e(this,f),ee(c(n=u.call(this)),se),ee(c(n),ue),ee(c(n),ae),te(c(n),oe,{writable:!0,value:null}),te(c(n),ie,{writable:!0,value:null}),y(c(n),oe,r),y(c(n),ie,o),n}return a(f,[{key:"getCurrentUser",value:(i=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).load(s.StorageKey.CurrentUser);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return i.apply(this,arguments)})},{key:"signInCustom",value:(o=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Q,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),h,this)}))),function(e){return o.apply(this,arguments)})},{key:"signOut",value:(r=E(S.mark((function d(){var e,t,n,r,o=arguments;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=o.length>0&&o[0]!==undefined&&o[0],i.next=3,v(this,oe).getAuthenticator().loadAuthenticationData();case 3:return t=i.sent,n=t.id,r=t.token_refresh,i.prev=6,i.next=9,v(this,oe).callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/deauthenticate"}});case 9:i.next=16;break;case 11:if(i.prev=11,i.t0=i["catch"](6),e){i.next=15;break}throw i.t0;case 15:console.warn(i.t0);case 16:return i.next=18,re(this,ue,pe).call(this,null);case 18:return i.next=20,re(this,se,de).call(this,null);case 20:case"end":return i.stop()}}),d,this,[[6,11]])}))),function(){return r.apply(this,arguments)})},{key:"signUpCustom",value:(n=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Z,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return n.apply(this,arguments)})}]),f}(H);function fe(e,t){return le.apply(this,arguments)}function le(){return(le=E(S.mark((function e(t,n){var r,o,i,a;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,oe).callMethod({method:"post"},{payload:{data:{payload:n},url:"/auth/users/".concat(t)}});case 2:return r=e.sent,o=r.data,i=o.session,a=o.user,e.next=7,re(this,se,de).call(this,i);case 7:return e.next=9,re(this,ue,pe).call(this,a);case 9:return e.abrupt("return",{session:i,user:a});case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function pe(e){return he.apply(this,arguments)}function he(){return(he=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.CurrentUser,t);case 2:this.emit("currentUserChange");case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function de(e){return ve.apply(this,arguments)}function ve(){return(ve=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.Session,t);case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function ye(e,t,n){we(e,t),t.set(e,n)}function we(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}var me=new WeakMap,ge=new WeakMap,be=new WeakSet,xe=function(){function t(n){var r,o,i=n.apiWrapper;e(this,t),we(r=this,o=be),o.add(r),ye(this,me,{writable:!0,value:null}),ye(this,ge,{writable:!0,value:new Map}),y(this,me,i)}return a(t,[{key:"getFunction",value:function(e){var t=this,n=v(this,ge).get(e);return n||(n=function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}(t,be,ke)).call.apply(n,[t,e].concat(o))},v(this,ge).set(e,n)),n}}]),t}();function ke(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=E(S.mark((function e(t,n){var r;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,me).callMethod({method:"post"},{payload:{data:n,url:"/functions/".concat(t)}},!0);case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function je(e,t,n){_e(e,t),t.set(e,n)}function _e(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Ee=new WeakMap,Se=new WeakMap,Pe=new WeakMap,Me=new WeakSet,Re=function(){function t(n){var r,o,i=n.apiWrapper,a=n.database,u=n.name;e(this,t),_e(r=this,o=Me),o.add(r),je(this,Ee,{writable:!0,value:null}),je(this,Se,{writable:!0,value:null}),je(this,Pe,{writable:!0,value:null}),y(this,Ee,i),y(this,Se,a),y(this,Pe,u)}var n,r,o,i,u,s,c,f,l,p;return a(t,[{key:"deleteMany",value:(p=E(S.mark((function h(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteMany",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),h,this)}))),function(){return p.apply(this,arguments)})},{key:"deleteOne",value:(l=E(S.mark((function d(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteOne",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),d,this)}))),function(){return l.apply(this,arguments)})},{key:"find",value:(f=E(S.mark((function v(){var e,t,n=arguments;return S.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=n.length>0&&n[0]!==undefined?n[0]:{},t=n.length>1&&n[1]!==undefined?n[1]:{},r.next=4,Le(this,Me,We).call(this,"find",{filter:e,options:t});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),v,this)}))),function(){return f.apply(this,arguments)})},{key:"findOne",value:(c=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"findOne",{filter:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return c.apply(this,arguments)})},{key:"findOneAndUpdate",value:(s=E(S.mark((function m(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"findOneAndUpdate",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"insertMany",value:(u=E(S.mark((function g(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertMany",{docs:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),g,this)}))),function(e){return u.apply(this,arguments)})},{key:"insertOne",value:(i=E(S.mark((function b(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertOne",{doc:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),b,this)}))),function(e){return i.apply(this,arguments)})},{key:"replaceOne",value:(o=E(S.mark((function x(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"replaceOne",{filter:e,options:n,replacement:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateMany",value:(r=E(S.mark((function k(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateMany",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),k,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateOne",value:(n=E(S.mark((function O(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateOne",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}();function We(e){return Te.apply(this,arguments)}function Te(){return Te=E(S.mark((function e(t){var n,r,o=arguments;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&o[1]!==undefined?o[1]:{},e.next=3,v(this,Ee).callMethod({method:"post"},{payload:{data:{method:t,params:n,collection:v(this,Pe)},url:"/mongo/".concat(v(this,Se).name,"/query")}},!0);case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),Te.apply(this,arguments)}function De(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ce=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,Fe=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),De(this,Ce,{writable:!0,value:null}),De(this,Ae,{writable:!0,value:new Map}),De(this,Ne,{writable:!0,value:null}),y(this,Ce,r),y(this,Ne,o)}return a(t,[{key:"collection",value:function(e){var t=v(this,Ae).get(e);return t||(t=new Re({name:e,apiWrapper:v(this,Ce),database:this}),v(this,Ae).set(e,t)),t}},{key:"name",get:function(){return v(this,Ne)}}]),t}();function Be(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ue=new WeakMap,qe=new WeakMap,ze=function(){function t(n){var r=n.apiWrapper;e(this,t),Be(this,Ue,{writable:!0,value:null}),Be(this,qe,{writable:!0,value:new Map}),y(this,Ue,r)}return a(t,[{key:"collection",value:function(e){return this.db().collection(e)}},{key:"db",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",t=v(this,qe).get(e);return t||(t=new Fe({name:e,apiWrapper:v(this,Ue)}),v(this,qe).set(e,t)),t}}]),t}();function Ge(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ie=new WeakMap,Ke=new WeakMap,Je=new WeakMap,Ve=function(){function t(n){var r=n.apiWrapperConfig,o=void 0===r?{}:r,i=n.project,a=n.storageDriver;e(this,t),Ge(this,Ie,{writable:!0,value:null}),Ge(this,Ke,{writable:!0,value:null}),Ge(this,Je,{writable:!0,value:null}),a||(a="undefined"!=typeof window&&"undefined"!=typeof window.document?new k:null);var u=new X({project:i,storageDriver:a,config:o});y(this,Ie,new ce({apiWrapper:u,storageDriver:a})),y(this,Ke,new xe({apiWrapper:u})),y(this,Je,new ze({apiWrapper:u}))}return a(t,[{key:"auth",get:function(){return v(this,Ie)}},{key:"function",value:function(e){return v(this,Ke).getFunction(e)}},{key:"mongo",get:function(){return v(this,Je)}}]),t}()})(),i})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ololoepepe/api-wrapper"),require("axios")):"function"==typeof define&&define.amd?define(["@ololoepepe/api-wrapper","axios"],t):"object"==typeof exports?exports.voidClient=t(require("@ololoepepe/api-wrapper"),require("axios")):e.voidClient=t(e["@ololoepepe/api-wrapper"],e.axios)}(self,((e,t)=>(()=>{var n={187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,n)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=undefined,i.prototype._eventsCount=0,i.prototype._maxListeners=undefined;var a=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return e._maxListeners===undefined?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,a,c;if(u(n),(i=e._events)===undefined?(i=e._events=Object.create(null),e._eventsCount=0):(i.newListener!==undefined&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),a===undefined)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=s(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:undefined,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(r===undefined)return[];var o=r[t];return o===undefined?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(t!==undefined){var n=t[e];if("function"==typeof n)return 1;if(n!==undefined)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){this._events!==undefined&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return s(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(i!==undefined)o=o&&i.error===undefined;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[e];if(s===undefined)return!1;if("function"==typeof s)r(s,this,t);else{var c=s.length,f=d(s,c);for(n=0;n<c;++n)r(f[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,a;if(u(t),(r=this._events)===undefined)return this;if((n=r[e])===undefined)return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),r.removeListener!==undefined&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===undefined)return this;if(n.removeListener===undefined)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):n[e]!==undefined&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t!==undefined)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},22:t=>{"use strict";t.exports=e},300:e=>{"use strict";e.exports=t},61:(e,t,n)=>{var r=n(698)["default"];function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports["default"]=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new T(r||[]);return u(i,"_invoke",{value:P(e,n,a)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var v="suspendedStart",y="suspendedYield",w="executing",m="completed",g={};function b(){}function x(){}function k(){}var O={};p(O,c,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(D([])));_&&_!==i&&a.call(_,c)&&(O=_);var L=k.prototype=b.prototype=Object.create(O);function E(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==r(l)&&a.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(l).then((function(e){f.value=e,u(f)}),(function(e){return n("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function P(e,n,r){var o=v;return function(i,a){if(o===w)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var s=M(u,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=w;var c=d(e,n,r);if("normal"===c.type){if(o=r.done?m:y,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function W(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return x.prototype=k,u(L,"constructor",{value:k,configurable:!0}),u(k,"constructor",{value:x,configurable:!0}),x.displayName=p(k,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===x||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,p(e,l,"GeneratorFunction")),e.prototype=Object.create(L),e},n.awrap=function(e){return{__await:e}},E(S.prototype),p(S.prototype,f,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new S(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(L),p(L,l,"Generator"),p(L,c,(function(){return this})),p(L,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},n.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(W),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),W(n),g}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;W(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},n}e.exports=o,e.exports.__esModule=!0,e.exports["default"]=e.exports},698:e=>{function t(n){return e.exports=t="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.exports.__esModule=!0,e.exports["default"]=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports["default"]=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(o){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(e){var t=r[e];if(t!==undefined)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="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},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}o.r(i),o.d(i,{StorageDriver:()=>s,StorageDriverLocalStorage:()=>k,VoidClient:()=>Ve});var u,s=function(){function t(){e(this,t)}return a(t,[{key:"load",value:function(){throw new Error("[StorageDriver.load] Method not implemented")}},{key:"save",value:function(){throw new Error("[StorageDriver.save] Method not implemented")}}],[{key:"StorageKey",get:function(){return{CurrentUser:"current_user",Session:"session"}}}]),t}();function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function l(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function p(e,n){if(n&&("object"===t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function v(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,d(e,t,"get"))}function y(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,d(e,t,"set"),n),n}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function m(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function g(e,t,n){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),n}var b=new WeakMap,x=new WeakMap,k=function(t){l(r,t);var n=w(r);function r(){var t,o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=o.prefix,a=void 0===i?"void":i,u=o.storageType,s=void 0===u?r.StorageType.LocalStorage:u;return e(this,r),m(c(t=n.call(this)),b,{writable:!0,value:null}),m(c(t),x,{writable:!0,value:null}),y(c(t),b,a),y(c(t),x,g(r,r,O).call(r,s)),t}return a(r,[{key:"load",value:function(e){var t=v(this,x).getItem("".concat(v(this,b),"/").concat(e));return null===t?null:JSON.parse(t)}},{key:"save",value:function(e,t){v(this,x).setItem("".concat(v(this,b),"/").concat(e),JSON.stringify(t))}}],[{key:"StorageType",get:function(){return{LocalStorage:"localStorage",SessionStorage:"sessionStorage"}}}]),r}(s);function O(e){switch(e){case u.StorageType.LocalStorage:return window.localStorage;case u.StorageType.SessionStorage:return window.sessionStorage;default:return null}}u=k;var j=o(22);function _(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){L(i,r,o,a,u,"next",e)}function u(e){L(i,r,o,a,u,"throw",e)}a(undefined)}))}}var S=o(687);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function W(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var T=new WeakMap,D=function(t){l(u,t);var n,r,o,i=R(u);function u(t){var n,r=t.storageDriver;return e(this,u),W(c(n=i.call(this)),T,{writable:!0,value:null}),y(c(n),T,r),n}return a(u,[{key:"authenticate",value:(o=E(S.mark((function f(e,t){var n,r,o,i;return S.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(t){a.next=2;break}return a.abrupt("return",null);case 2:return n=t.id,r=t.token_refresh,a.next=5,e.callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/refresh"}});case 5:return o=a.sent,i=o.data,a.abrupt("return",M(M({},t),{},{id:n,token_access:i.token_access}));case 8:case"end":return a.stop()}}),f)}))),function(e,t){return o.apply(this,arguments)})},{key:"loadAuthenticationData",value:(r=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,T).load(s.StorageKey.Session);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return r.apply(this,arguments)})},{key:"saveAuthenticationData",value:(n=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e!==undefined){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,v(this,T).save(s.StorageKey.Session,e);case 4:case"end":return t.stop()}}),h,this)}))),function(e){return n.apply(this,arguments)})}]),u}(j.ApiAuthenticator);function C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var A=function(t){l(r,t);var n=C(r);function r(){return e(this,r),n.apply(this,arguments)}return a(r,[{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}}]),r}(j.ApiRealtimeTransport),N=o(300);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function q(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function z(e,t,n){var r,o,i,a=e.apiWrapperOptions,u=e.methodData,s=e.payload,c=u.actionName,f=u.method;return[null==s?void 0:s[t],null==a||null===(r=a[c])||void 0===r?void 0:r[t],null==a||null===(o=a[f])||void 0===o?void 0:o[t],null==a||null===(i=a["default"])||void 0===i?void 0:i[t],n].find((function(e){return e!==undefined}))}var G=new WeakMap,I=new WeakMap,K=new WeakMap,J=function(t){l(o,t);var n,r=U(o);function o(t){var n,i=t.getExtraRequestData,a=t.project;e(this,o),q(c(n=r.call(this)),G,{writable:!0,value:null}),q(c(n),I,{writable:!0,value:null}),q(c(n),K,{writable:!0,value:null});var u=a.slug,s=a.tokenPublic;return y(c(n),G,N.create({baseURL:"https://void.void-walkers.com",headers:{Authorization:"Bearer ".concat(s)},timeout:3e4})),y(c(n),I,i),y(c(n),K,u),n}return a(o,[{key:"callMethod",value:(n=E(S.mark((function i(e){var t,n,r,o,a,u,s,c,f,l,p,h,d,y;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.authenticationData,n=e.methodData,r=e.requestData,o=r.apiWrapperOptions,a=r.payload,u=z({apiWrapperOptions:o,methodData:n,payload:a},"data"),s=z({apiWrapperOptions:o,methodData:n,payload:a},"headers",{}),c=z({apiWrapperOptions:o,methodData:n,payload:a},"method",n.method),f=z({apiWrapperOptions:o,methodData:n,payload:a},"prefix","/projects/".concat(v(this,K))),l=z({apiWrapperOptions:o,methodData:n,payload:a},"timeout",3e4),p=z({apiWrapperOptions:o,methodData:n,payload:a},"url"),h=v(this,I).call(this),d="function"==typeof s?s(a,h):s,y=null!=t&&t.token_access?B({"X-Void-Auth":t.token_access},d):d,i.prev=11,i.next=14,v(this,G).request({timeout:l,data:"function"==typeof u?u(a,h):u,headers:y,method:"function"==typeof c?c(a,h):c,url:f+("function"==typeof p?p(a,h):p)});case 14:return i.abrupt("return",i.sent);case 17:throw i.prev=17,i.t0=i["catch"](11),console.warn(i.t0,i.t0.response),i.t0;case 21:case"end":return i.stop()}}),i,this,[[11,17]])}))),function(e){return n.apply(this,arguments)})},{key:"getCreateMethodData",value:function(){return{actionName:"create",method:"post"}}},{key:"getDeleteMethodData",value:function(){return{actionName:"delete",method:"delete"}}},{key:"getReadMethodData",value:function(){return{actionName:"read",method:"get"}}},{key:"getUpdateMethodData",value:function(){return{actionName:"update",method:"patch"}}},{key:"isAuthenticationFailedError",value:function(e){var t;return 403===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}},{key:"isSessionExpiredError",value:function(e){var t;return 401===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)}}]),o}(j.ApiTransport);function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}var Y={delay:1e3,delayFactor:2,maxDelay:4e3},X=function(t){l(r,t);var n=V(r);function r(t){var o=t.config,i=void 0===o?{}:o,a=t.project,u=t.storageDriver;return e(this,r),n.call(this,{authenticator:new D({storageDriver:u}),realtimeTransport:new A,reconnectConfig:(null==i?void 0:i.reconnectConfig)||Y,transport:new J({project:a,getExtraRequestData:(null==i?void 0:i.getExtraRequestData)||function(){return{}}})})}return a(r)}(j.ApiWrapper),H=o(187),Q="authenticate",Z="register";function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function ee(e,t){ne(e,t),t.add(e)}function te(e,t,n){ne(e,t),t.set(e,n)}function ne(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function re(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var oe=new WeakMap,ie=new WeakMap,ae=new WeakSet,ue=new WeakSet,se=new WeakSet,ce=function(t){l(f,t);var n,r,o,i,u=$(f);function f(t){var n,r=t.apiWrapper,o=t.storageDriver;return e(this,f),ee(c(n=u.call(this)),se),ee(c(n),ue),ee(c(n),ae),te(c(n),oe,{writable:!0,value:null}),te(c(n),ie,{writable:!0,value:null}),y(c(n),oe,r),y(c(n),ie,o),n}return a(f,[{key:"getCurrentUser",value:(i=E(S.mark((function p(){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).load(s.StorageKey.CurrentUser);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),p,this)}))),function(){return i.apply(this,arguments)})},{key:"signInCustom",value:(o=E(S.mark((function h(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Q,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),h,this)}))),function(e){return o.apply(this,arguments)})},{key:"signOut",value:(r=E(S.mark((function d(){var e,t,n,r,o=arguments;return S.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=o.length>0&&o[0]!==undefined&&o[0],i.next=3,v(this,oe).getAuthenticator().loadAuthenticationData();case 3:return t=i.sent,n=t.id,r=t.token_refresh,i.prev=6,i.next=9,v(this,oe).callMethod({method:"post"},{payload:{data:{session_id:n,token_refresh:r},url:"/auth/users/deauthenticate"}});case 9:i.next=16;break;case 11:if(i.prev=11,i.t0=i["catch"](6),e){i.next=15;break}throw i.t0;case 15:console.warn(i.t0);case 16:return i.next=18,re(this,ue,pe).call(this,null);case 18:return i.next=20,re(this,se,de).call(this,null);case 20:case"end":return i.stop()}}),d,this,[[6,11]])}))),function(){return r.apply(this,arguments)})},{key:"signUpCustom",value:(n=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,re(this,ae,fe).call(this,Z,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return n.apply(this,arguments)})}]),f}(H);function fe(e,t){return le.apply(this,arguments)}function le(){return(le=E(S.mark((function e(t,n){var r,o,i,a;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,oe).callMethod({method:"post"},{payload:{data:{payload:n},url:"/auth/users/".concat(t)}});case 2:return r=e.sent,o=r.data,i=o.session,a=o.user,e.next=7,re(this,se,de).call(this,i);case 7:return e.next=9,re(this,ue,pe).call(this,a);case 9:return e.abrupt("return",{session:i,user:a});case 10:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function pe(e){return he.apply(this,arguments)}function he(){return(he=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.CurrentUser,t);case 2:this.emit("currentUserChange",t);case 3:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function de(e){return ve.apply(this,arguments)}function ve(){return(ve=E(S.mark((function e(t){return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,ie).save(s.StorageKey.Session,t);case 2:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function ye(e,t,n){we(e,t),t.set(e,n)}function we(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}var me=new WeakMap,ge=new WeakMap,be=new WeakSet,xe=function(){function t(n){var r,o,i=n.apiWrapper;e(this,t),we(r=this,o=be),o.add(r),ye(this,me,{writable:!0,value:null}),ye(this,ge,{writable:!0,value:new Map}),y(this,me,i)}return a(t,[{key:"getFunction",value:function(e){var t=this,n=v(this,ge).get(e);return n||(n=function(){for(var n,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}(t,be,ke)).call.apply(n,[t,e].concat(o))},v(this,ge).set(e,n)),n}}]),t}();function ke(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=E(S.mark((function e(t,n){var r;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v(this,me).callMethod({method:"post"},{payload:{data:n,url:"/functions/".concat(t)}},!0);case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function je(e,t,n){_e(e,t),t.set(e,n)}function _e(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Ee=new WeakMap,Se=new WeakMap,Pe=new WeakMap,Me=new WeakSet,Re=function(){function t(n){var r,o,i=n.apiWrapper,a=n.database,u=n.name;e(this,t),_e(r=this,o=Me),o.add(r),je(this,Ee,{writable:!0,value:null}),je(this,Se,{writable:!0,value:null}),je(this,Pe,{writable:!0,value:null}),y(this,Ee,i),y(this,Se,a),y(this,Pe,u)}var n,r,o,i,u,s,c,f,l,p;return a(t,[{key:"deleteMany",value:(p=E(S.mark((function h(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteMany",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),h,this)}))),function(){return p.apply(this,arguments)})},{key:"deleteOne",value:(l=E(S.mark((function d(){var e,t=arguments;return S.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=t.length>0&&t[0]!==undefined?t[0]:{},n.next=3,Le(this,Me,We).call(this,"deleteOne",{filter:e});case 3:return n.abrupt("return",n.sent);case 4:case"end":return n.stop()}}),d,this)}))),function(){return l.apply(this,arguments)})},{key:"find",value:(f=E(S.mark((function v(){var e,t,n=arguments;return S.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e=n.length>0&&n[0]!==undefined?n[0]:{},t=n.length>1&&n[1]!==undefined?n[1]:{},r.next=4,Le(this,Me,We).call(this,"find",{filter:e,options:t});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),v,this)}))),function(){return f.apply(this,arguments)})},{key:"findOne",value:(c=E(S.mark((function w(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"findOne",{filter:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),w,this)}))),function(e){return c.apply(this,arguments)})},{key:"findOneAndUpdate",value:(s=E(S.mark((function m(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"findOneAndUpdate",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),m,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"insertMany",value:(u=E(S.mark((function g(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertMany",{docs:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),g,this)}))),function(e){return u.apply(this,arguments)})},{key:"insertOne",value:(i=E(S.mark((function b(e){return S.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Le(this,Me,We).call(this,"insertOne",{doc:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),b,this)}))),function(e){return i.apply(this,arguments)})},{key:"replaceOne",value:(o=E(S.mark((function x(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"replaceOne",{filter:e,options:n,replacement:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),x,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateMany",value:(r=E(S.mark((function k(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateMany",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),k,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateOne",value:(n=E(S.mark((function O(e,t){var n,r=arguments;return S.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return n=r.length>2&&r[2]!==undefined?r[2]:{},o.next=3,Le(this,Me,We).call(this,"updateOne",{filter:e,options:n,update:t});case 3:return o.abrupt("return",o.sent);case 4:case"end":return o.stop()}}),O,this)}))),function(e,t){return n.apply(this,arguments)})}]),t}();function We(e){return Te.apply(this,arguments)}function Te(){return Te=E(S.mark((function e(t){var n,r,o=arguments;return S.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&o[1]!==undefined?o[1]:{},e.next=3,v(this,Ee).callMethod({method:"post"},{payload:{data:{method:t,params:n,collection:v(this,Pe)},url:"/mongo/".concat(v(this,Se).name,"/query")}},!0);case 3:return r=e.sent,e.abrupt("return",r.data);case 5:case"end":return e.stop()}}),e,this)}))),Te.apply(this,arguments)}function De(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ce=new WeakMap,Ae=new WeakMap,Ne=new WeakMap,Fe=function(){function t(n){var r=n.apiWrapper,o=n.name;e(this,t),De(this,Ce,{writable:!0,value:null}),De(this,Ae,{writable:!0,value:new Map}),De(this,Ne,{writable:!0,value:null}),y(this,Ce,r),y(this,Ne,o)}return a(t,[{key:"collection",value:function(e){var t=v(this,Ae).get(e);return t||(t=new Re({name:e,apiWrapper:v(this,Ce),database:this}),v(this,Ae).set(e,t)),t}},{key:"name",get:function(){return v(this,Ne)}}]),t}();function Be(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ue=new WeakMap,qe=new WeakMap,ze=function(){function t(n){var r=n.apiWrapper;e(this,t),Be(this,Ue,{writable:!0,value:null}),Be(this,qe,{writable:!0,value:new Map}),y(this,Ue,r)}return a(t,[{key:"collection",value:function(e){return this.db().collection(e)}},{key:"db",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default",t=v(this,qe).get(e);return t||(t=new Fe({name:e,apiWrapper:v(this,Ue)}),v(this,qe).set(e,t)),t}}]),t}();function Ge(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}var Ie=new WeakMap,Ke=new WeakMap,Je=new WeakMap,Ve=function(){function t(n){var r=n.apiWrapperConfig,o=void 0===r?{}:r,i=n.project,a=n.storageDriver;e(this,t),Ge(this,Ie,{writable:!0,value:null}),Ge(this,Ke,{writable:!0,value:null}),Ge(this,Je,{writable:!0,value:null}),a||(a="undefined"!=typeof window&&"undefined"!=typeof window.document?new k:null);var u=new X({project:i,storageDriver:a,config:o});y(this,Ie,new ce({apiWrapper:u,storageDriver:a})),y(this,Ke,new xe({apiWrapper:u})),y(this,Je,new ze({apiWrapper:u}))}return a(t,[{key:"auth",get:function(){return v(this,Ie)}},{key:"function",value:function(e){return v(this,Ke).getFunction(e)}},{key:"mongo",get:function(){return v(this,Je)}}]),t}()})(),i})())); | ||
//# sourceMappingURL=index.browser.js.map |
{ | ||
"name": "@voidwalkers/void-client", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "Client lib for Void Walkers Void", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -76,3 +76,3 @@ import EventEmitter from 'events'; | ||
this.emit('currentUserChange'); | ||
this.emit('currentUserChange', user); | ||
} | ||
@@ -79,0 +79,0 @@ |
Sorry, the diff of this file is not supported yet
154146