New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pubkeeper/client

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pubkeeper/client - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

189

dist/pubkeeper-client.js

@@ -283,3 +283,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
/* eslint-env browser */
var __read = (this && this.__read) || function (o, n) {

@@ -552,3 +552,2 @@ var m = typeof Symbol === "function" && o[Symbol.iterator];

/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))

@@ -1129,188 +1128,2 @@ /***/ }),

/***/ "./node_modules/process/browser.js":
/*!*****************************************!*\
!*** ./node_modules/process/browser.js ***!
\*****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
}
else {
cachedSetTimeout = defaultSetTimout;
}
}
catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
}
else {
cachedClearTimeout = defaultClearTimeout;
}
}
catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
}());
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
}
catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
}
catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
}
catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
}
catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
}
else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() { }
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return []; };
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/'; };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () { return 0; };
/***/ }),
/***/ "./src/client.ts":

@@ -1317,0 +1130,0 @@ /*!***********************!*\

2

dist/pubkeeper-client.min.js

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){(function(n){var o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"object"==typeof console&&console.log&&console.log.apply(console,i(e))},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(3)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(2))},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function c(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new s(r,n||e,i),a=o?o+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,s=new Array(i);n<i;n++)s[n]=r[n].fn;return s},u.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,n,i,s){var c=o?o+e:e;if(!this._events[c])return!1;var a,u,f=this._events[c],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,r),!0;case 4:return f.fn.call(f.context,t,r,n),!0;case 5:return f.fn.call(f.context,t,r,n,i),!0;case 6:return f.fn.call(f.context,t,r,n,i,s),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];f.fn.apply(f.context,a)}else{var p,h=f.length;for(u=0;u<h;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),l){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,r);break;case 4:f[u].fn.call(f[u].context,t,r,n);break;default:if(!a)for(p=1,a=new Array(l-1);p<l;p++)a[p-1]=arguments[p];f[u].fn.apply(f[u].context,a)}}return!0},u.prototype.on=function(e,t,r){return c(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return c(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,n){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||n&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,u=[],f=s.length;c<f;c++)(s[c].fn!==t||n&&!s[c].once||r&&s[c].context!==r)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=o,u.EventEmitter=u,e.exports=u},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,u=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!f){var e=c(p);f=!0;for(var t=u.length;t;){for(a=u,u=[];++l<t;)a&&a[l].run();l=-1,t=u.length}a=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||f||c(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};e.exports=function(e){function t(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){var r;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(o.enabled){var i=o,s=Number(new Date),c=s-(r||s);i.diff=c,i.prev=r,i.curr=s,r=s,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var s=e[a];t=o.call(i,s),e.splice(a,1),a--}return t}),n.formatArgs.call(i,e),(i.log||n.log).apply(i,e)}}return o.namespace=e,o.enabled=n.enabled(e),o.useColors=n.useColors(),o.color=t(e),o.destroy=i,o.extend=s,"function"==typeof n.init&&n.init(o),n.instances.push(o),o}function i(){var e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function s(e,t){var r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){var e=o(n.names.map(c),n.skips.map(c).map(function(e){return"-"+e})).join(",");return n.enable(""),e},n.enable=function(e){var t;n.save(e),n.names=[],n.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){var i=n.instances[t];i.enabled=n.enabled(i.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(4),Object.keys(e).forEach(function(t){n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=60*r,o=60*n,i=24*o,s=7*i,c=365.25*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return a(e,t,i,"day");if(t>=o)return a(e,t,o,"hour");if(t>=n)return a(e,t,n,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";r.r(t);var n,o=r(0),i=r.n(o),s=r(1),c=r.n(s),a=function(e,t,r){return Math.max(e,Math.min(t,r))};!function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.DISCONNECTED="disconnected",e.DEAD="dead"}(n||(n={}));var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},f=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};function l(e,t){void 0===t&&(t={});var r=t.options,n=void 0===r?{}:r,o=t.callback;if(0===e.length)return[n,o];if(1===e.length){var i=f(e,1)[0];return"function"==typeof i?[n,i]:"object"==typeof i?[u({},n,i),o]:[n,o]}var s=f(e.slice(0,2),2),c=s[0],a=s[1];return"object"!=typeof c?[n,o]:"function"!=typeof a?[n,o]:[u({},n,c),a]}var p,h=(p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r},y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},C=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e},m=Symbol("event:failed"),_=Symbol("event:ready"),w=i()("pk:client:info"),g=function(e){throw new Error(e)},b=0,E=function(e){function t(t){var r=e.call(this)||this;r._attempt=0,r._retryID=null,r._status=n.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(e){var t=e.target;r.setStatus(n.CONNECTED),w("connected"),r.emit("connected"),r._wsc=t,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(e){r.emit("error",e)},fail:function(e,t){e instanceof Error?r.emit("error",e):"string"==typeof e&&r.emit("error",new Error(e)),r.disconnect("number"==typeof e?e:t)},ready:function(){r.emit(_)},send:function(e){t.send(e)}};if(r._protocols.has(t.protocol)){var i=r._protocols.get(t.protocol);r._protocol=new i(r._protocolConfig,o),r._brewers.forEach(function(e,t){r._protocol.addBrewer(t,e,!1)}),r._patrons.forEach(function(e,t){r._protocol.addPatron(t,e,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+t.protocol+"'")},r._onClose=function(e){var t=e.target,o=e.code,i=e.reason;if(t.removeEventListener("open",r._onOpen),t.removeEventListener("close",r._onClose),r._protocol&&t.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(n.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(m),void w("closed");if(w("closed with unexpected code (%d): %j",o,i),r._attempt>r._maxRetries)return w("too many attempts, giving up"),r._attempt=0,r.setStatus(n.DEAD),void r.emit(m);r.setStatus(n.RECONNECTING);var s=r._attempt-1,c=Math.pow(2,s),u=Math.floor(a(0,r._maxTimeout,100*(c+Math.random()*c)));w("waiting "+u+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},u)};var o=t.maxRetries,i=void 0===o?1/0:o,s=t.maxTimeout,c=void 0===s?1e4:s,u=t.protocols,f=void 0===u?new Map:u,l=t.server,p=void 0===l?g('"server" key is required in config'):l,h=t.WebSocket,y=void 0===h?WebSocket||g('"webSocket" key is required in config'):h,b=t.brews,E=void 0===b?[]:b,F=t.crypto,O=void 0===F?new Map:F,x=t.jwt,N=void 0===x?g('"jwt" key is required in config'):x,T=v(t,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=y,r._maxTimeout=c,r._maxRetries=i,r._protocols=new Map(C(f.entries())),r._server=p,r._protocolConfig=d({brews:C(E),crypto:new Map(C(O.entries())),jwt:N},T),r}return h(t,e),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.connect=function(e){var t=this,r=(void 0===e?{}:e).wait,n=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var o=n?new Promise(function(e,r){var n=function(){t.removeListener(_,e),r(new Error("unable to connect"))};t.once(_,function(){t.removeListener(m,n),e(t)}),t.once(m,n)}):Promise.resolve(this);return this.tryConnect(),o},t.prototype.disconnect=function(e){var t=this;void 0===e&&(e=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(e,r){return t._protocol.removeBrewer(r)}),this._patrons.forEach(function(e,r){return t._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(e),1e3===e&&(this._attempt=0)},t.prototype.addBrewer=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.brewer_"+b+++"["+e+"]")}(e),i=y(l(t),2),s=[e,i[0],i[1]];return this._brewers.set(o,s),this._status===n.CONNECTED&&this._protocol.addBrewer(o,s,!0),o},t.prototype.removeBrewer=function(e){if(!this._brewers.delete(e))throw new Error("brewer wasn't registered");this._status===n.CONNECTED&&this._protocol.removeBrewer(e)},t.prototype.addPatron=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.patron_"+b+++"["+e+"]")}(e),i=y(l(t),2),s=[e,i[0],i[1]];return this._patrons.set(o,s),this._status===n.CONNECTED&&this._protocol.addPatron(o,s,!0),o},t.prototype.removePatron=function(e){if(!this._patrons.delete(e))throw new Error("patron wasn't registered");this._status===n.CONNECTED&&this._protocol.removePatron(e)},t.prototype.setStatus=function(e){this._status=e,this.emit("statuschange",{target:this,status:e})},t.prototype.tryConnect=function(){this._attempt+=1,w("attempting connection"),this.setStatus(n.CONNECTING);var e=C(this._protocols.keys()),t=new this._webSocket(this._server,e);t.binaryType="arraybuffer",t.addEventListener("open",this._onOpen),t.addEventListener("close",this._onClose)},t.CONNECTING=n.CONNECTING,t.CONNECTED=n.CONNECTED,t.RECONNECTING=n.RECONNECTING,t.DISCONNECTED=n.DISCONNECTED,t.DEAD=n.DEAD,t}(c.a);r.d(t,"PubkeeperClient",function(){return E})}])});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};t.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"object"==typeof console&&console.log&&console.log.apply(console,o(e))},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(2)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function s(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function c(e,t,r,n,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var c=new i(r,n||e,s),a=o?o+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],c]:e._events[a].push(c):(e._events[a]=c,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function u(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(o=!1)),u.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},u.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,i=new Array(s);n<s;n++)i[n]=r[n].fn;return i},u.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,n,s,i){var c=o?o+e:e;if(!this._events[c])return!1;var a,u,f=this._events[c],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,r),!0;case 4:return f.fn.call(f.context,t,r,n),!0;case 5:return f.fn.call(f.context,t,r,n,s),!0;case 6:return f.fn.call(f.context,t,r,n,s,i),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];f.fn.apply(f.context,a)}else{var p,d=f.length;for(u=0;u<d;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),l){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,r);break;case 4:f[u].fn.call(f[u].context,t,r,n);break;default:if(!a)for(p=1,a=new Array(l-1);p<l;p++)a[p-1]=arguments[p];f[u].fn.apply(f[u].context,a)}}return!0},u.prototype.on=function(e,t,r){return c(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return c(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,n){var s=o?o+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var i=this._events[s];if(i.fn)i.fn!==t||n&&!i.once||r&&i.context!==r||a(this,s);else{for(var c=0,u=[],f=i.length;c<f;c++)(i[c].fn!==t||n&&!i[c].once||r&&i[c].context!==r)&&u.push(i[c]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new s,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=o,u.EventEmitter=u,e.exports=u},function(e,t,r){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};e.exports=function(e){function t(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){var r;function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(o.enabled){var s=o,i=Number(new Date),c=i-(r||i);s.diff=c,s.prev=r,s.curr=i,r=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var i=e[a];t=o.call(s,i),e.splice(a,1),a--}return t}),n.formatArgs.call(s,e),(s.log||n.log).apply(s,e)}}return o.namespace=e,o.enabled=n.enabled(e),o.useColors=n.useColors(),o.color=t(e),o.destroy=s,o.extend=i,"function"==typeof n.init&&n.init(o),n.instances.push(o),o}function s(){var e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function i(e,t){var r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){var e=o(n.names.map(c),n.skips.map(c).map(function(e){return"-"+e})).join(",");return n.enable(""),e},n.enable=function(e){var t;n.save(e),n.names=[],n.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){var s=n.instances[t];s.enabled=n.enabled(s.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(3),Object.keys(e).forEach(function(t){n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=60*r,o=60*n,s=24*o,i=7*s,c=365.25*s;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?function(e){var t=Math.abs(e);if(t>=s)return a(e,t,s,"day");if(t>=o)return a(e,t,o,"hour");if(t>=n)return a(e,t,n,"minute");if(t>=r)return a(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=s)return Math.round(e/s)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";r.r(t);var n,o=r(0),s=r.n(o),i=r(1),c=r.n(i),a=function(e,t,r){return Math.max(e,Math.min(t,r))};!function(e){e.CONNECTING="connecting",e.CONNECTED="connected",e.RECONNECTING="reconnecting",e.DISCONNECTED="disconnected",e.DEAD="dead"}(n||(n={}));var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},f=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i};function l(e,t){void 0===t&&(t={});var r=t.options,n=void 0===r?{}:r,o=t.callback;if(0===e.length)return[n,o];if(1===e.length){var s=f(e,1)[0];return"function"==typeof s?[n,s]:"object"==typeof s?[u({},n,s),o]:[n,o]}var i=f(e.slice(0,2),2),c=i[0],a=i[1];return"object"!=typeof c?[n,o]:"function"!=typeof a?[n,o]:[u({},n,c),a]}var p,d=(p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h=function(){return(h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r},C=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},y=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(C(arguments[t]));return e},m=Symbol("event:failed"),_=Symbol("event:ready"),g=s()("pk:client:info"),w=function(e){throw new Error(e)},b=0,F=function(e){function t(t){var r=e.call(this)||this;r._attempt=0,r._retryID=null,r._status=n.DISCONNECTED,r._wsc=null,r._brewers=new Map,r._patrons=new Map,r._onOpen=function(e){var t=e.target;r.setStatus(n.CONNECTED),g("connected"),r.emit("connected"),r._wsc=t,r._protocol&&(r._protocol.close(),r._protocol=void 0);var o={error:function(e){r.emit("error",e)},fail:function(e,t){e instanceof Error?r.emit("error",e):"string"==typeof e&&r.emit("error",new Error(e)),r.disconnect("number"==typeof e?e:t)},ready:function(){r.emit(_)},send:function(e){t.send(e)}};if(r._protocols.has(t.protocol)){var s=r._protocols.get(t.protocol);r._protocol=new s(r._protocolConfig,o),r._brewers.forEach(function(e,t){r._protocol.addBrewer(t,e,!1)}),r._patrons.forEach(function(e,t){r._protocol.addPatron(t,e,!1)}),r._wsc.addEventListener("message",r._protocol.onMessage),r._protocol.open()}else r._wsc.close(4999,"unacceptable protocol: '"+t.protocol+"'")},r._onClose=function(e){var t=e.target,o=e.code,s=e.reason;if(t.removeEventListener("open",r._onOpen),t.removeEventListener("close",r._onClose),r._protocol&&t.removeEventListener("close",r._protocol.onMessage),r._wsc=null,r.emit("closed"),1e3!==o&&1001!==o||(r._attempt=0),1e3===o)return r.setStatus(n.DISCONNECTED),r._protocol&&(r._protocol.close(),r._protocol=void 0),r.emit(m),void g("closed");if(g("closed with unexpected code (%d): %j",o,s),r._attempt>r._maxRetries)return g("too many attempts, giving up"),r._attempt=0,r.setStatus(n.DEAD),void r.emit(m);r.setStatus(n.RECONNECTING);var i=r._attempt-1,c=Math.pow(2,i),u=Math.floor(a(0,r._maxTimeout,100*(c+Math.random()*c)));g("waiting "+u+"ms"),r._retryID=setTimeout(function(){r._retryID=null,r.tryConnect()},u)};var o=t.maxRetries,s=void 0===o?1/0:o,i=t.maxTimeout,c=void 0===i?1e4:i,u=t.protocols,f=void 0===u?new Map:u,l=t.server,p=void 0===l?w('"server" key is required in config'):l,d=t.WebSocket,C=void 0===d?WebSocket||w('"webSocket" key is required in config'):d,b=t.brews,F=void 0===b?[]:b,E=t.crypto,O=void 0===E?new Map:E,N=t.jwt,x=void 0===N?w('"jwt" key is required in config'):N,S=v(t,["maxRetries","maxTimeout","protocols","server","WebSocket","brews","crypto","jwt"]);return r._webSocket=C,r._maxTimeout=c,r._maxRetries=s,r._protocols=new Map(y(f.entries())),r._server=p,r._protocolConfig=h({brews:y(F),crypto:new Map(y(O.entries())),jwt:x},S),r}return d(t,e),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.connect=function(e){var t=this,r=(void 0===e?{}:e).wait,n=void 0===r||r;if(null!==this._wsc&&this._wsc.readyState<=1)return Promise.resolve(this);var o=n?new Promise(function(e,r){var n=function(){t.removeListener(_,e),r(new Error("unable to connect"))};t.once(_,function(){t.removeListener(m,n),e(t)}),t.once(m,n)}):Promise.resolve(this);return this.tryConnect(),o},t.prototype.disconnect=function(e){var t=this;void 0===e&&(e=1e3),null!==this._retryID&&(clearTimeout(this._retryID),this._retryID=null),this._protocol&&(this._brewers.forEach(function(e,r){return t._protocol.removeBrewer(r)}),this._patrons.forEach(function(e,r){return t._protocol.removePatron(r)})),null!==this._wsc&&this._wsc.close(e),1e3===e&&(this._attempt=0)},t.prototype.addBrewer=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.brewer_"+b+++"["+e+"]")}(e),s=C(l(t),2),i=[e,s[0],s[1]];return this._brewers.set(o,i),this._status===n.CONNECTED&&this._protocol.addBrewer(o,i,!0),o},t.prototype.removeBrewer=function(e){if(!this._brewers.delete(e))throw new Error("brewer wasn't registered");this._status===n.CONNECTED&&this._protocol.removeBrewer(e)},t.prototype.addPatron=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=function(e){return Symbol("pk.patron_"+b+++"["+e+"]")}(e),s=C(l(t),2),i=[e,s[0],s[1]];return this._patrons.set(o,i),this._status===n.CONNECTED&&this._protocol.addPatron(o,i,!0),o},t.prototype.removePatron=function(e){if(!this._patrons.delete(e))throw new Error("patron wasn't registered");this._status===n.CONNECTED&&this._protocol.removePatron(e)},t.prototype.setStatus=function(e){this._status=e,this.emit("statuschange",{target:this,status:e})},t.prototype.tryConnect=function(){this._attempt+=1,g("attempting connection"),this.setStatus(n.CONNECTING);var e=y(this._protocols.keys()),t=new this._webSocket(this._server,e);t.binaryType="arraybuffer",t.addEventListener("open",this._onOpen),t.addEventListener("close",this._onClose)},t.CONNECTING=n.CONNECTING,t.CONNECTED=n.CONNECTED,t.RECONNECTING=n.RECONNECTING,t.DISCONNECTED=n.DISCONNECTED,t.DEAD=n.DEAD,t}(c.a);r.d(t,"PubkeeperClient",function(){return F})}])});
{
"name": "@pubkeeper/client",
"version": "4.0.0",
"version": "4.0.1",
"description": "Pubkeeper javascript SDK",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -8,2 +8,3 @@ const path = require('path');

devtool: 'hidden-source-map',
node: false,
output: {

@@ -10,0 +11,0 @@ libraryTarget: 'umd',

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc