Socket
Socket
Sign inDemoInstall

@twilio/operation-retrier

Package Overview
Dependencies
2
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.10-rc.1 to 4.0.11-rc.2

92

builds/browser.js

@@ -517,2 +517,3 @@ /*

function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

@@ -522,5 +523,8 @@ /**

*/
var Retrier = /*#__PURE__*/function (_EventEmitter) {
_inherits__default["default"](Retrier, _EventEmitter);
var _super = _createSuper$1(Retrier);
// fibonacci strategy

@@ -533,16 +537,11 @@

var _this;
_classCallCheck__default["default"](this, Retrier);
_this = _super.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "minDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initialDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxAttemptsCount", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxAttemptsTime", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "randomness", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "prevDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "currDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "timeout", null);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "inProgress", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "attemptNum", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "startTimestamp", -1);
_this.minDelay = options.min;

@@ -560,2 +559,3 @@ _this.maxDelay = options.max;

}
_createClass__default["default"](Retrier, [{

@@ -568,2 +568,3 @@ key: "attempt",

}
this.attemptNum++;

@@ -580,5 +581,7 @@ this.emit("attempt", this);

}
if (this.attemptNum == 0) {
return this.initialDelay;
}
if (this.attemptNum == 1) {

@@ -588,4 +591,6 @@ this.currDelay = this.minDelay;

}
this.prevDelay = this.currDelay;
var delay = this.currDelay + this.prevDelay;
if (this.maxDelay && delay > this.maxDelay) {

@@ -595,2 +600,3 @@ this.currDelay = this.maxDelay;

}
this.currDelay = delay;

@@ -610,2 +616,3 @@ return delay;

var _this2 = this;
if (this.maxAttemptsCount && this.attemptNum >= this.maxAttemptsCount) {

@@ -616,4 +623,6 @@ this.cleanup();

}
var delay = this.nextDelay(delayOverride);
delay = this.randomize(delay);
if (this.maxAttemptsTime && this.startTimestamp + this.maxAttemptsTime < Date.now() + delay) {

@@ -624,2 +633,3 @@ this.cleanup();

}
this.timeout = setTimeout(function () {

@@ -636,2 +646,3 @@ return _this2.attempt();

}
this.inProgress = false;

@@ -648,2 +659,3 @@ this.attemptNum = 0;

}
this.inProgress = true;

@@ -662,5 +674,5 @@ this.startTimestamp = Date.now();

}
}
// @todo Must be a T here, so the entire Retrier must be typed on this value type.
} // @todo Must be a T here, so the entire Retrier must be typed on this value type.
// eslint-disable-next-line
}, {

@@ -677,5 +689,7 @@ key: "succeeded",

}
this.scheduleAttempt(nextAttemptDelayOverride);
}
}]);
return Retrier;

@@ -690,22 +704,30 @@ }(EventEmitter);

*/
var AsyncRetrier = /*#__PURE__*/function (_EventEmitter2) {
_inherits__default["default"](AsyncRetrier, _EventEmitter2);
var _super2 = _createSuper$1(AsyncRetrier);
// This any must be T typed directly on the AsyncRetrier
// eslint-disable-next-line
function AsyncRetrier(options) {
var _this3;
_classCallCheck__default["default"](this, AsyncRetrier);
_this3 = _super2.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "retrier", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "resolve", function () {
return void 0;
});
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "reject", function () {
return void 0;
});
_this3.retrier = new Retrier(options);
return _this3;
}
_createClass__default["default"](AsyncRetrier, [{

@@ -715,2 +737,3 @@ key: "run",

var _this4 = this;
this.retrier.on("attempt", function () {

@@ -735,2 +758,3 @@ handler().then(function (v) {

_this4.reject = reject;
_this4.retrier.start();

@@ -745,2 +769,3 @@ });

}]);
return AsyncRetrier;

@@ -750,50 +775,69 @@ }(EventEmitter);

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function isDef(value) {
return value !== undefined && value !== null;
}
var Backoff = /*#__PURE__*/function (_EventEmitter) {
_inherits__default["default"](Backoff, _EventEmitter);
var _super = _createSuper(Backoff);
function Backoff(options) {
var _this;
_classCallCheck__default["default"](this, Backoff);
_this = _super.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initialDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "factor", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "randomisationFactor", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "backoffDelay", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "nextBackoffDelay", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "backoffNumber", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "timeoutID", null);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxNumberOfRetry", -1);
options = options || {};
var _options = options,
initialDelay = _options.initialDelay,
maxDelay = _options.maxDelay,
randomisationFactor = _options.randomisationFactor,
factor = _options.factor;
initialDelay = _options.initialDelay,
maxDelay = _options.maxDelay,
randomisationFactor = _options.randomisationFactor,
factor = _options.factor;
if (isDef(initialDelay) && initialDelay < 1) {
throw new Error("The initial timeout must be equal to or greater than 1.");
}
if (isDef(maxDelay) && maxDelay <= 1) {
throw new Error("The maximal timeout must be greater than 1.");
}
if (isDef(randomisationFactor) && (randomisationFactor < 0 || randomisationFactor > 1)) {
throw new Error("The randomisation factor must be between 0 and 1.");
}
if (isDef(factor) && factor <= 1) {
throw new Error("Exponential factor should be greater than 1.");
}
_this.initialDelay = initialDelay || 100;
_this.maxDelay = maxDelay || 10000;
if (_this.maxDelay <= _this.initialDelay) {
throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");
}
_this.randomisationFactor = randomisationFactor || 0;
_this.factor = factor || 2;
_this.reset();
return _this;
}
_createClass__default["default"](Backoff, [{

@@ -819,5 +863,7 @@ key: "backoff",

this.backoffNumber = 0;
if (this.timeoutID) {
clearTimeout(this.timeoutID);
}
this.timeoutID = null;

@@ -831,2 +877,3 @@ }

}
this.maxNumberOfRetry = maxNumberOfRetry;

@@ -855,2 +902,3 @@ }

}]);
return Backoff;

@@ -857,0 +905,0 @@ }(EventEmitter);

@@ -46,2 +46,3 @@ /*

function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

@@ -51,5 +52,8 @@ /**

*/
var Retrier = /*#__PURE__*/function (_EventEmitter) {
_inherits__default["default"](Retrier, _EventEmitter);
var _super = _createSuper$1(Retrier);
// fibonacci strategy

@@ -62,16 +66,11 @@

var _this;
_classCallCheck__default["default"](this, Retrier);
_this = _super.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "minDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initialDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxAttemptsCount", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxAttemptsTime", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "randomness", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "prevDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "currDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "timeout", null);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "inProgress", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "attemptNum", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "startTimestamp", -1);
_this.minDelay = options.min;

@@ -89,2 +88,3 @@ _this.maxDelay = options.max;

}
_createClass__default["default"](Retrier, [{

@@ -97,2 +97,3 @@ key: "attempt",

}
this.attemptNum++;

@@ -109,5 +110,7 @@ this.emit("attempt", this);

}
if (this.attemptNum == 0) {
return this.initialDelay;
}
if (this.attemptNum == 1) {

@@ -117,4 +120,6 @@ this.currDelay = this.minDelay;

}
this.prevDelay = this.currDelay;
var delay = this.currDelay + this.prevDelay;
if (this.maxDelay && delay > this.maxDelay) {

@@ -124,2 +129,3 @@ this.currDelay = this.maxDelay;

}
this.currDelay = delay;

@@ -139,2 +145,3 @@ return delay;

var _this2 = this;
if (this.maxAttemptsCount && this.attemptNum >= this.maxAttemptsCount) {

@@ -145,4 +152,6 @@ this.cleanup();

}
var delay = this.nextDelay(delayOverride);
delay = this.randomize(delay);
if (this.maxAttemptsTime && this.startTimestamp + this.maxAttemptsTime < Date.now() + delay) {

@@ -153,2 +162,3 @@ this.cleanup();

}
this.timeout = setTimeout(function () {

@@ -165,2 +175,3 @@ return _this2.attempt();

}
this.inProgress = false;

@@ -177,2 +188,3 @@ this.attemptNum = 0;

}
this.inProgress = true;

@@ -191,5 +203,5 @@ this.startTimestamp = Date.now();

}
}
// @todo Must be a T here, so the entire Retrier must be typed on this value type.
} // @todo Must be a T here, so the entire Retrier must be typed on this value type.
// eslint-disable-next-line
}, {

@@ -206,5 +218,7 @@ key: "succeeded",

}
this.scheduleAttempt(nextAttemptDelayOverride);
}
}]);
return Retrier;

@@ -219,22 +233,30 @@ }(events.EventEmitter);

*/
var AsyncRetrier = /*#__PURE__*/function (_EventEmitter2) {
_inherits__default["default"](AsyncRetrier, _EventEmitter2);
var _super2 = _createSuper$1(AsyncRetrier);
// This any must be T typed directly on the AsyncRetrier
// eslint-disable-next-line
function AsyncRetrier(options) {
var _this3;
_classCallCheck__default["default"](this, AsyncRetrier);
_this3 = _super2.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "retrier", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "resolve", function () {
return void 0;
});
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this3), "reject", function () {
return void 0;
});
_this3.retrier = new Retrier(options);
return _this3;
}
_createClass__default["default"](AsyncRetrier, [{

@@ -244,2 +266,3 @@ key: "run",

var _this4 = this;
this.retrier.on("attempt", function () {

@@ -264,2 +287,3 @@ handler().then(function (v) {

_this4.reject = reject;
_this4.retrier.start();

@@ -274,2 +298,3 @@ });

}]);
return AsyncRetrier;

@@ -279,50 +304,69 @@ }(events.EventEmitter);

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function isDef(value) {
return value !== undefined && value !== null;
}
var Backoff = /*#__PURE__*/function (_EventEmitter) {
_inherits__default["default"](Backoff, _EventEmitter);
var _super = _createSuper(Backoff);
function Backoff(options) {
var _this;
_classCallCheck__default["default"](this, Backoff);
_this = _super.call(this);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "initialDelay", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "factor", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "randomisationFactor", void 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "backoffDelay", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "nextBackoffDelay", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "backoffNumber", 0);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "timeoutID", null);
_defineProperty__default["default"](_assertThisInitialized__default["default"](_this), "maxNumberOfRetry", -1);
options = options || {};
var _options = options,
initialDelay = _options.initialDelay,
maxDelay = _options.maxDelay,
randomisationFactor = _options.randomisationFactor,
factor = _options.factor;
initialDelay = _options.initialDelay,
maxDelay = _options.maxDelay,
randomisationFactor = _options.randomisationFactor,
factor = _options.factor;
if (isDef(initialDelay) && initialDelay < 1) {
throw new Error("The initial timeout must be equal to or greater than 1.");
}
if (isDef(maxDelay) && maxDelay <= 1) {
throw new Error("The maximal timeout must be greater than 1.");
}
if (isDef(randomisationFactor) && (randomisationFactor < 0 || randomisationFactor > 1)) {
throw new Error("The randomisation factor must be between 0 and 1.");
}
if (isDef(factor) && factor <= 1) {
throw new Error("Exponential factor should be greater than 1.");
}
_this.initialDelay = initialDelay || 100;
_this.maxDelay = maxDelay || 10000;
if (_this.maxDelay <= _this.initialDelay) {
throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");
}
_this.randomisationFactor = randomisationFactor || 0;
_this.factor = factor || 2;
_this.reset();
return _this;
}
_createClass__default["default"](Backoff, [{

@@ -348,5 +392,7 @@ key: "backoff",

this.backoffNumber = 0;
if (this.timeoutID) {
clearTimeout(this.timeoutID);
}
this.timeoutID = null;

@@ -360,2 +406,3 @@ }

}
this.maxNumberOfRetry = maxNumberOfRetry;

@@ -384,2 +431,3 @@ }

}]);
return Backoff;

@@ -386,0 +434,0 @@ }(events.EventEmitter);

@@ -18,2 +18,2 @@ /*

*/
var Retrier=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),o={},i=function(t){try{return!!t()}catch(t){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),c=a,s=Function.prototype.call,f=c?s.bind(s):function(){return s.apply(s,arguments)},l={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,v=p&&!h.call({1:2},1);l.f=v?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var m,y,d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b=a,g=Function.prototype,w=g.call,O=b&&g.bind.bind(w,w),j=b?O:function(t){return function(){return w.apply(t,arguments)}},x=j,D=x({}.toString),E=x("".slice),T=function(t){return E(D(t),8,-1)},S=i,_=T,P=Object,k=j("".split),R=S((function(){return!P("z").propertyIsEnumerable(0)}))?function(t){return"String"==_(t)?k(t,""):P(t)}:P,C=function(t){return null==t},L=C,N=TypeError,A=function(t){if(L(t))throw N("Can't call method on "+t);return t},M=R,I=A,F=function(t){return M(I(t))},B="object"==typeof document&&document.all,U={all:B,IS_HTMLDDA:void 0===B&&void 0!==B},z=U.all,G=U.IS_HTMLDDA?function(t){return"function"==typeof t||t===z}:function(t){return"function"==typeof t},W=G,H=U.all,q=U.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:W(t)||t===H}:function(t){return"object"==typeof t?null!==t:W(t)},K=r,V=G,J=function(t){return V(t)?t:void 0},X=function(t,e){return arguments.length<2?J(K[t]):K[t]&&K[t][e]},Y=j({}.isPrototypeOf),$=X("navigator","userAgent")||"",Q=r,Z=$,tt=Q.process,et=Q.Deno,nt=tt&&tt.versions||et&&et.version,rt=nt&&nt.v8;rt&&(y=(m=rt.split("."))[0]>0&&m[0]<4?1:+(m[0]+m[1])),!y&&Z&&(!(m=Z.match(/Edge\/(\d+)/))||m[1]>=74)&&(m=Z.match(/Chrome\/(\d+)/))&&(y=+m[1]);var ot=y,it=ot,ut=i,at=!!Object.getOwnPropertySymbols&&!ut((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&it&&it<41})),ct=at&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=X,ft=G,lt=Y,ht=Object,pt=ct?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ft(e)&&lt(e.prototype,ht(t))},vt=String,mt=function(t){try{return vt(t)}catch(t){return"Object"}},yt=G,dt=mt,bt=TypeError,gt=function(t){if(yt(t))return t;throw bt(dt(t)+" is not a function")},wt=gt,Ot=C,jt=function(t,e){var n=t[e];return Ot(n)?void 0:wt(n)},xt=f,Dt=G,Et=q,Tt=TypeError,St={exports:{}},_t=r,Pt=Object.defineProperty,kt=function(t,e){try{Pt(_t,t,{value:e,configurable:!0,writable:!0})}catch(n){_t[t]=e}return e},Rt=kt,Ct="__core-js_shared__",Lt=r[Ct]||Rt(Ct,{}),Nt=Lt;(St.exports=function(t,e){return Nt[t]||(Nt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var At=A,Mt=Object,It=function(t){return Mt(At(t))},Ft=j({}.hasOwnProperty),Bt=Object.hasOwn||function(t,e){return Ft(It(t),e)},Ut=j,zt=0,Gt=Math.random(),Wt=Ut(1..toString),Ht=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Wt(++zt+Gt,36)},qt=r,Kt=St.exports,Vt=Bt,Jt=Ht,Xt=at,Yt=ct,$t=Kt("wks"),Qt=qt.Symbol,Zt=Qt&&Qt.for,te=Yt?Qt:Qt&&Qt.withoutSetter||Jt,ee=function(t){if(!Vt($t,t)||!Xt&&"string"!=typeof $t[t]){var e="Symbol."+t;Xt&&Vt(Qt,t)?$t[t]=Qt[t]:$t[t]=Yt&&Zt?Zt(e):te(e)}return $t[t]},ne=f,re=q,oe=pt,ie=jt,ue=function(t,e){var n,r;if("string"===e&&Dt(n=t.toString)&&!Et(r=xt(n,t)))return r;if(Dt(n=t.valueOf)&&!Et(r=xt(n,t)))return r;if("string"!==e&&Dt(n=t.toString)&&!Et(r=xt(n,t)))return r;throw Tt("Can't convert object to primitive value")},ae=TypeError,ce=ee("toPrimitive"),se=function(t,e){if(!re(t)||oe(t))return t;var n,r=ie(t,ce);if(r){if(void 0===e&&(e="default"),n=ne(r,t,e),!re(n)||oe(n))return n;throw ae("Can't convert object to primitive value")}return void 0===e&&(e="number"),ue(t,e)},fe=pt,le=function(t){var e=se(t,"string");return fe(e)?e:e+""},he=q,pe=r.document,ve=he(pe)&&he(pe.createElement),me=function(t){return ve?pe.createElement(t):{}},ye=me,de=!u&&!i((function(){return 7!=Object.defineProperty(ye("div"),"a",{get:function(){return 7}}).a})),be=u,ge=f,we=l,Oe=d,je=F,xe=le,De=Bt,Ee=de,Te=Object.getOwnPropertyDescriptor;o.f=be?Te:function(t,e){if(t=je(t),e=xe(e),Ee)try{return Te(t,e)}catch(t){}if(De(t,e))return Oe(!ge(we.f,t,e),t[e])};var Se={},_e=u&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Pe=q,ke=String,Re=TypeError,Ce=function(t){if(Pe(t))return t;throw Re(ke(t)+" is not an object")},Le=u,Ne=de,Ae=_e,Me=Ce,Ie=le,Fe=TypeError,Be=Object.defineProperty,Ue=Object.getOwnPropertyDescriptor,ze="enumerable",Ge="configurable",We="writable";Se.f=Le?Ae?function(t,e,n){if(Me(t),e=Ie(e),Me(n),"function"==typeof t&&"prototype"===e&&"value"in n&&We in n&&!n[We]){var r=Ue(t,e);r&&r[We]&&(t[e]=n.value,n={configurable:Ge in n?n[Ge]:r[Ge],enumerable:ze in n?n[ze]:r[ze],writable:!1})}return Be(t,e,n)}:Be:function(t,e,n){if(Me(t),e=Ie(e),Me(n),Ne)try{return Be(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Fe("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var He=Se,qe=d,Ke=u?function(t,e,n){return He.f(t,e,qe(1,n))}:function(t,e,n){return t[e]=n,t},Ve={exports:{}},Je=u,Xe=Bt,Ye=Function.prototype,$e=Je&&Object.getOwnPropertyDescriptor,Qe=Xe(Ye,"name"),Ze={EXISTS:Qe,PROPER:Qe&&"something"===function(){}.name,CONFIGURABLE:Qe&&(!Je||Je&&$e(Ye,"name").configurable)},tn=G,en=Lt,nn=j(Function.toString);tn(en.inspectSource)||(en.inspectSource=function(t){return nn(t)});var rn,on,un,an=en.inspectSource,cn=G,sn=r.WeakMap,fn=cn(sn)&&/native code/.test(String(sn)),ln=St.exports,hn=Ht,pn=ln("keys"),vn=function(t){return pn[t]||(pn[t]=hn(t))},mn={},yn=fn,dn=r,bn=q,gn=Ke,wn=Bt,On=Lt,jn=vn,xn=mn,Dn="Object already initialized",En=dn.TypeError,Tn=dn.WeakMap;if(yn||On.state){var Sn=On.state||(On.state=new Tn);Sn.get=Sn.get,Sn.has=Sn.has,Sn.set=Sn.set,rn=function(t,e){if(Sn.has(t))throw En(Dn);return e.facade=t,Sn.set(t,e),e},on=function(t){return Sn.get(t)||{}},un=function(t){return Sn.has(t)}}else{var _n=jn("state");xn[_n]=!0,rn=function(t,e){if(wn(t,_n))throw En(Dn);return e.facade=t,gn(t,_n,e),e},on=function(t){return wn(t,_n)?t[_n]:{}},un=function(t){return wn(t,_n)}}var Pn={set:rn,get:on,has:un,enforce:function(t){return un(t)?on(t):rn(t,{})},getterFor:function(t){return function(e){var n;if(!bn(e)||(n=on(e)).type!==t)throw En("Incompatible receiver, "+t+" required");return n}}},kn=i,Rn=G,Cn=Bt,Ln=u,Nn=Ze.CONFIGURABLE,An=an,Mn=Pn.enforce,In=Pn.get,Fn=Object.defineProperty,Bn=Ln&&!kn((function(){return 8!==Fn((function(){}),"length",{value:8}).length})),Un=String(String).split("String"),zn=Ve.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Cn(t,"name")||Nn&&t.name!==e)&&(Ln?Fn(t,"name",{value:e,configurable:!0}):t.name=e),Bn&&n&&Cn(n,"arity")&&t.length!==n.arity&&Fn(t,"length",{value:n.arity});try{n&&Cn(n,"constructor")&&n.constructor?Ln&&Fn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=Mn(t);return Cn(r,"source")||(r.source=Un.join("string"==typeof e?e:"")),t};Function.prototype.toString=zn((function(){return Rn(this)&&In(this).source||An(this)}),"toString");var Gn=G,Wn=Se,Hn=Ve.exports,qn=kt,Kn=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(Gn(n)&&Hn(n,i,r),r.global)o?t[e]=n:qn(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:Wn.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Vn={},Jn=Math.ceil,Xn=Math.floor,Yn=Math.trunc||function(t){var e=+t;return(e>0?Xn:Jn)(e)},$n=function(t){var e=+t;return e!=e||0===e?0:Yn(e)},Qn=$n,Zn=Math.max,tr=Math.min,er=$n,nr=Math.min,rr=function(t){return t>0?nr(er(t),9007199254740991):0},or=function(t){return rr(t.length)},ir=F,ur=function(t,e){var n=Qn(t);return n<0?Zn(n+e,0):tr(n,e)},ar=or,cr=function(t){return function(e,n,r){var o,i=ir(e),u=ar(i),a=ur(r,u);if(t&&n!=n){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},sr={includes:cr(!0),indexOf:cr(!1)},fr=Bt,lr=F,hr=sr.indexOf,pr=mn,vr=j([].push),mr=function(t,e){var n,r=lr(t),o=0,i=[];for(n in r)!fr(pr,n)&&fr(r,n)&&vr(i,n);for(;e.length>o;)fr(r,n=e[o++])&&(~hr(i,n)||vr(i,n));return i},yr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dr=mr,br=yr.concat("length","prototype");Vn.f=Object.getOwnPropertyNames||function(t){return dr(t,br)};var gr={};gr.f=Object.getOwnPropertySymbols;var wr=X,Or=Vn,jr=gr,xr=Ce,Dr=j([].concat),Er=wr("Reflect","ownKeys")||function(t){var e=Or.f(xr(t)),n=jr.f;return n?Dr(e,n(t)):e},Tr=Bt,Sr=Er,_r=o,Pr=Se,kr=i,Rr=G,Cr=/#|\.prototype\./,Lr=function(t,e){var n=Ar[Nr(t)];return n==Ir||n!=Mr&&(Rr(e)?kr(e):!!e)},Nr=Lr.normalize=function(t){return String(t).replace(Cr,".").toLowerCase()},Ar=Lr.data={},Mr=Lr.NATIVE="N",Ir=Lr.POLYFILL="P",Fr=Lr,Br=r,Ur=o.f,zr=Ke,Gr=Kn,Wr=kt,Hr=function(t,e,n){for(var r=Sr(e),o=Pr.f,i=_r.f,u=0;u<r.length;u++){var a=r[u];Tr(t,a)||n&&Tr(n,a)||o(t,a,i(e,a))}},qr=Fr,Kr=function(t,e){var n,r,o,i,u,a=t.target,c=t.global,s=t.stat;if(n=c?Br:s?Br[a]||Wr(a,{}):(Br[a]||{}).prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(u=Ur(n,r))&&u.value:n[r],!qr(c?r:a+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Hr(i,o)}(t.sham||o&&o.sham)&&zr(i,"sham",!0),Gr(n,r,i,t)}},Vr=Se.f,Jr=Bt,Xr=ee("toStringTag"),Yr=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Jr(t,Xr)&&Vr(t,Xr,{configurable:!0,value:e})},$r=r,Qr=Yr;Kr({global:!0},{Reflect:{}}),Qr($r.Reflect,"Reflect",!0);var Zr=a,to=Function.prototype,eo=to.apply,no=to.call,ro="object"==typeof Reflect&&Reflect.apply||(Zr?no.bind(eo):function(){return no.apply(eo,arguments)}),oo=j([].slice),io=j,uo=gt,ao=q,co=Bt,so=oo,fo=a,lo=Function,ho=io([].concat),po=io([].join),vo={},mo=function(t,e,n){if(!co(vo,e)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";vo[e]=lo("C,a","return new C("+po(r,",")+")")}return vo[e](t,n)},yo=fo?lo.bind:function(t){var e=uo(this),n=e.prototype,r=so(arguments,1),o=function(){var n=ho(r,so(arguments));return this instanceof o?mo(e,n.length,n):e.apply(t,n)};return ao(n)&&(o.prototype=n),o},bo={};bo[ee("toStringTag")]="z";var go="[object z]"===String(bo),wo=go,Oo=G,jo=T,xo=ee("toStringTag"),Do=Object,Eo="Arguments"==jo(function(){return arguments}()),To=wo?jo:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Do(t),xo))?n:Eo?jo(e):"Object"==(r=jo(e))&&Oo(e.callee)?"Arguments":r},So=j,_o=i,Po=G,ko=To,Ro=an,Co=function(){},Lo=[],No=X("Reflect","construct"),Ao=/^\s*(?:class|function)\b/,Mo=So(Ao.exec),Io=!Ao.exec(Co),Fo=function(t){if(!Po(t))return!1;try{return No(Co,Lo,t),!0}catch(t){return!1}},Bo=function(t){if(!Po(t))return!1;switch(ko(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Io||!!Mo(Ao,Ro(t))}catch(t){return!0}};Bo.sham=!0;var Uo=!No||_o((function(){var t;return Fo(Fo.call)||!Fo(Object)||!Fo((function(){t=!0}))||t}))?Bo:Fo,zo=Uo,Go=mt,Wo=TypeError,Ho=function(t){if(zo(t))return t;throw Wo(Go(t)+" is not a constructor")},qo={},Ko=mr,Vo=yr,Jo=Object.keys||function(t){return Ko(t,Vo)},Xo=u,Yo=_e,$o=Se,Qo=Ce,Zo=F,ti=Jo;qo.f=Xo&&!Yo?Object.defineProperties:function(t,e){Qo(t);for(var n,r=Zo(e),o=ti(e),i=o.length,u=0;i>u;)$o.f(t,n=o[u++],r[n]);return t};var ei,ni=X("document","documentElement"),ri=Ce,oi=qo,ii=yr,ui=mn,ai=ni,ci=me,si="prototype",fi="script",li=vn("IE_PROTO"),hi=function(){},pi=function(t){return"<"+fi+">"+t+"</"+fi+">"},vi=function(t){t.write(pi("")),t.close();var e=t.parentWindow.Object;return t=null,e},mi=function(){try{ei=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;mi="undefined"!=typeof document?document.domain&&ei?vi(ei):(e=ci("iframe"),n="java"+fi+":",e.style.display="none",ai.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(pi("document.F=Object")),t.close(),t.F):vi(ei);for(var r=ii.length;r--;)delete mi[si][ii[r]];return mi()};ui[li]=!0;var yi=Object.create||function(t,e){var n;return null!==t?(hi[si]=ri(t),n=new hi,hi[si]=null,n[li]=t):n=mi(),void 0===e?n:oi.f(n,e)},di=Kr,bi=ro,gi=yo,wi=Ho,Oi=Ce,ji=q,xi=yi,Di=i,Ei=X("Reflect","construct"),Ti=Object.prototype,Si=[].push,_i=Di((function(){function t(){}return!(Ei((function(){}),[],t)instanceof t)})),Pi=!Di((function(){Ei((function(){}))})),ki=_i||Pi;function Ri(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ci(t){return Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(t)}function Li(t){var e=function(t,e){if("object"!==Ci(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Ci(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ci(e)?e:String(e)}function Ni(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Li(r.key),r)}}function Ai(t,e,n){return e&&Ni(t.prototype,e),n&&Ni(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Fi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ii(t,e)}function Bi(t,e){if(e&&("object"===Ci(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Mi(t)}function Ui(t){return Ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ui(t)}function zi(t,e,n){return(e=Li(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}di({target:"Reflect",stat:!0,forced:ki,sham:ki},{construct:function(t,e){wi(t),Oi(e);var n=arguments.length<3?t:wi(arguments[2]);if(Pi&&!_i)return Ei(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return bi(Si,r,e),new(bi(gi,t,r))}var o=n.prototype,i=xi(ji(o)?o:Ti),u=bi(t,i,e);return ji(u)?u:i}});var Gi=To,Wi=go?{}.toString:function(){return"[object "+Gi(this)+"]"};go||Kn(Object.prototype,"toString",Wi,{unsafe:!0});var Hi,qi,Ki,Vi,Ji="process"==T(r.process),Xi=G,Yi=String,$i=TypeError,Qi=j,Zi=Ce,tu=function(t){if("object"==typeof t||Xi(t))return t;throw $i("Can't set "+Yi(t)+" as a prototype")},eu=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Qi(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Zi(n),tu(r),e?t(n,r):n.__proto__=r,n}}():void 0),nu=X,ru=Se,ou=u,iu=ee("species"),uu=Y,au=TypeError,cu=Ce,su=Ho,fu=C,lu=ee("species"),hu=T,pu=j,vu=function(t){if("Function"===hu(t))return pu(t)},mu=gt,yu=a,du=vu(vu.bind),bu=function(t,e){return mu(t),void 0===e?t:yu?du(t,e):function(){return t.apply(e,arguments)}},gu=TypeError,wu=/(?:ipad|iphone|ipod).*applewebkit/i.test($),Ou=r,ju=ro,xu=bu,Du=G,Eu=Bt,Tu=i,Su=ni,_u=oo,Pu=me,ku=function(t,e){if(t<e)throw gu("Not enough arguments");return t},Ru=wu,Cu=Ji,Lu=Ou.setImmediate,Nu=Ou.clearImmediate,Au=Ou.process,Mu=Ou.Dispatch,Iu=Ou.Function,Fu=Ou.MessageChannel,Bu=Ou.String,Uu=0,zu={},Gu="onreadystatechange";try{Hi=Ou.location}catch(t){}var Wu=function(t){if(Eu(zu,t)){var e=zu[t];delete zu[t],e()}},Hu=function(t){return function(){Wu(t)}},qu=function(t){Wu(t.data)},Ku=function(t){Ou.postMessage(Bu(t),Hi.protocol+"//"+Hi.host)};Lu&&Nu||(Lu=function(t){ku(arguments.length,1);var e=Du(t)?t:Iu(t),n=_u(arguments,1);return zu[++Uu]=function(){ju(e,void 0,n)},qi(Uu),Uu},Nu=function(t){delete zu[t]},Cu?qi=function(t){Au.nextTick(Hu(t))}:Mu&&Mu.now?qi=function(t){Mu.now(Hu(t))}:Fu&&!Ru?(Vi=(Ki=new Fu).port2,Ki.port1.onmessage=qu,qi=xu(Vi.postMessage,Vi)):Ou.addEventListener&&Du(Ou.postMessage)&&!Ou.importScripts&&Hi&&"file:"!==Hi.protocol&&!Tu(Ku)?(qi=Ku,Ou.addEventListener("message",qu,!1)):qi=Gu in Pu("script")?function(t){Su.appendChild(Pu("script"))[Gu]=function(){Su.removeChild(this),Wu(t)}}:function(t){setTimeout(Hu(t),0)});var Vu,Ju,Xu,Yu,$u,Qu,Zu,ta,ea={set:Lu,clear:Nu},na=r,ra=/ipad|iphone|ipod/i.test($)&&void 0!==na.Pebble,oa=/web0s(?!.*chrome)/i.test($),ia=r,ua=bu,aa=o.f,ca=ea.set,sa=wu,fa=ra,la=oa,ha=Ji,pa=ia.MutationObserver||ia.WebKitMutationObserver,va=ia.document,ma=ia.process,ya=ia.Promise,da=aa(ia,"queueMicrotask"),ba=da&&da.value;ba||(Vu=function(){var t,e;for(ha&&(t=ma.domain)&&t.exit();Ju;){e=Ju.fn,Ju=Ju.next;try{e()}catch(t){throw Ju?Yu():Xu=void 0,t}}Xu=void 0,t&&t.enter()},sa||ha||la||!pa||!va?!fa&&ya&&ya.resolve?((Zu=ya.resolve(void 0)).constructor=ya,ta=ua(Zu.then,Zu),Yu=function(){ta(Vu)}):ha?Yu=function(){ma.nextTick(Vu)}:(ca=ua(ca,ia),Yu=function(){ca(Vu)}):($u=!0,Qu=va.createTextNode(""),new pa(Vu).observe(Qu,{characterData:!0}),Yu=function(){Qu.data=$u=!$u}));var ga=ba||function(t){var e={fn:t,next:void 0};Xu&&(Xu.next=e),Ju||(Ju=e,Yu()),Xu=e},wa=r,Oa=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ja=function(){this.head=null,this.tail=null};ja.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var xa=ja,Da=r.Promise,Ea="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Ta=!Ea&&!Ji&&"object"==typeof window&&"object"==typeof document,Sa=r,_a=Da,Pa=G,ka=Fr,Ra=an,Ca=ee,La=Ta,Na=Ea,Aa=ot;_a&&_a.prototype;var Ma=Ca("species"),Ia=!1,Fa=Pa(Sa.PromiseRejectionEvent),Ba=ka("Promise",(function(){var t=Ra(_a),e=t!==String(_a);if(!e&&66===Aa)return!0;if(!Aa||Aa<51||!/native code/.test(t)){var n=new _a((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};if((n.constructor={})[Ma]=r,!(Ia=n.then((function(){}))instanceof r))return!0}return!e&&(La||Na)&&!Fa})),Ua={CONSTRUCTOR:Ba,REJECTION_EVENT:Fa,SUBCLASSING:Ia},za={},Ga=gt,Wa=TypeError,Ha=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw Wa("Bad Promise constructor");e=t,n=r})),this.resolve=Ga(e),this.reject=Ga(n)};za.f=function(t){return new Ha(t)};var qa,Ka,Va,Ja=Kr,Xa=Ji,Ya=r,$a=f,Qa=Kn,Za=eu,tc=Yr,ec=function(t){var e=nu(t),n=ru.f;ou&&e&&!e[iu]&&n(e,iu,{configurable:!0,get:function(){return this}})},nc=gt,rc=G,oc=q,ic=function(t,e){if(uu(e,t))return t;throw au("Incorrect invocation")},uc=function(t,e){var n,r=cu(t).constructor;return void 0===r||fu(n=cu(r)[lu])?e:su(n)},ac=ea.set,cc=ga,sc=function(t,e){var n=wa.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))},fc=Oa,lc=xa,hc=Pn,pc=Da,vc=za,mc="Promise",yc=Ua.CONSTRUCTOR,dc=Ua.REJECTION_EVENT,bc=Ua.SUBCLASSING,gc=hc.getterFor(mc),wc=hc.set,Oc=pc&&pc.prototype,jc=pc,xc=Oc,Dc=Ya.TypeError,Ec=Ya.document,Tc=Ya.process,Sc=vc.f,_c=Sc,Pc=!!(Ec&&Ec.createEvent&&Ya.dispatchEvent),kc="unhandledrejection",Rc=function(t){var e;return!(!oc(t)||!rc(e=t.then))&&e},Cc=function(t,e){var n,r,o,i=e.value,u=1==e.state,a=u?t.ok:t.fail,c=t.resolve,s=t.reject,f=t.domain;try{a?(u||(2===e.rejection&&Ic(e),e.rejection=1),!0===a?n=i:(f&&f.enter(),n=a(i),f&&(f.exit(),o=!0)),n===t.promise?s(Dc("Promise-chain cycle")):(r=Rc(n))?$a(r,n,c,s):c(n)):s(i)}catch(t){f&&!o&&f.exit(),s(t)}},Lc=function(t,e){t.notified||(t.notified=!0,cc((function(){for(var n,r=t.reactions;n=r.get();)Cc(n,t);t.notified=!1,e&&!t.rejection&&Ac(t)})))},Nc=function(t,e,n){var r,o;Pc?((r=Ec.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),Ya.dispatchEvent(r)):r={promise:e,reason:n},!dc&&(o=Ya["on"+t])?o(r):t===kc&&sc("Unhandled promise rejection",n)},Ac=function(t){$a(ac,Ya,(function(){var e,n=t.facade,r=t.value;if(Mc(t)&&(e=fc((function(){Xa?Tc.emit("unhandledRejection",r,n):Nc(kc,n,r)})),t.rejection=Xa||Mc(t)?2:1,e.error))throw e.value}))},Mc=function(t){return 1!==t.rejection&&!t.parent},Ic=function(t){$a(ac,Ya,(function(){var e=t.facade;Xa?Tc.emit("rejectionHandled",e):Nc("rejectionhandled",e,t.value)}))},Fc=function(t,e,n){return function(r){t(e,r,n)}},Bc=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Lc(t,!0))},Uc=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Dc("Promise can't be resolved itself");var r=Rc(e);r?cc((function(){var n={done:!1};try{$a(r,e,Fc(Uc,n,t),Fc(Bc,n,t))}catch(e){Bc(n,e,t)}})):(t.value=e,t.state=1,Lc(t,!1))}catch(e){Bc({done:!1},e,t)}}};if(yc&&(xc=(jc=function(t){ic(this,xc),nc(t),$a(qa,this);var e=gc(this);try{t(Fc(Uc,e),Fc(Bc,e))}catch(t){Bc(e,t)}}).prototype,(qa=function(t){wc(this,{type:mc,done:!1,notified:!1,parent:!1,reactions:new lc,rejection:!1,state:0,value:void 0})}).prototype=Qa(xc,"then",(function(t,e){var n=gc(this),r=Sc(uc(this,jc));return n.parent=!0,r.ok=!rc(t)||t,r.fail=rc(e)&&e,r.domain=Xa?Tc.domain:void 0,0==n.state?n.reactions.add(r):cc((function(){Cc(r,n)})),r.promise})),Ka=function(){var t=new qa,e=gc(t);this.promise=t,this.resolve=Fc(Uc,e),this.reject=Fc(Bc,e)},vc.f=Sc=function(t){return t===jc||undefined===t?new Ka(t):_c(t)},rc(pc)&&Oc!==Object.prototype)){Va=Oc.then,bc||Qa(Oc,"then",(function(t,e){var n=this;return new jc((function(t,e){$a(Va,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete Oc.constructor}catch(t){}Za&&Za(Oc,xc)}Ja({global:!0,constructor:!0,wrap:!0,forced:yc},{Promise:jc}),tc(jc,mc,!1),ec(mc);var zc={},Gc=zc,Wc=ee("iterator"),Hc=Array.prototype,qc=To,Kc=jt,Vc=C,Jc=zc,Xc=ee("iterator"),Yc=function(t){if(!Vc(t))return Kc(t,Xc)||Kc(t,"@@iterator")||Jc[qc(t)]},$c=f,Qc=gt,Zc=Ce,ts=mt,es=Yc,ns=TypeError,rs=f,os=Ce,is=jt,us=bu,as=f,cs=Ce,ss=mt,fs=function(t){return void 0!==t&&(Gc.Array===t||Hc[Wc]===t)},ls=or,hs=Y,ps=function(t,e){var n=arguments.length<2?es(t):e;if(Qc(n))return Zc($c(n,t));throw ns(ts(t)+" is not iterable")},vs=Yc,ms=function(t,e,n){var r,o;os(t);try{if(!(r=is(t,"return"))){if("throw"===e)throw n;return n}r=rs(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return os(r),n},ys=TypeError,ds=function(t,e){this.stopped=t,this.result=e},bs=ds.prototype,gs=function(t,e,n){var r,o,i,u,a,c,s,f=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),p=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),m=us(e,f),y=function(t){return r&&ms(r,"normal",t),new ds(!0,t)},d=function(t){return l?(cs(t),v?m(t[0],t[1],y):m(t[0],t[1])):v?m(t,y):m(t)};if(h)r=t.iterator;else if(p)r=t;else{if(!(o=vs(t)))throw ys(ss(t)+" is not iterable");if(fs(o)){for(i=0,u=ls(t);u>i;i++)if((a=d(t[i]))&&hs(bs,a))return a;return new ds(!1)}r=ps(t,o)}for(c=h?t.next:r.next;!(s=as(c,r)).done;){try{a=d(s.value)}catch(t){ms(r,"throw",t)}if("object"==typeof a&&a&&hs(bs,a))return a}return new ds(!1)},ws=ee("iterator"),Os=!1;try{var js=0,xs={next:function(){return{done:!!js++}},return:function(){Os=!0}};xs[ws]=function(){return this},Array.from(xs,(function(){throw 2}))}catch(t){}var Ds=Da,Es=function(t,e){if(!e&&!Os)return!1;var n=!1;try{var r={};r[ws]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ts=Ua.CONSTRUCTOR||!Es((function(t){Ds.all(t).then(void 0,(function(){}))})),Ss=f,_s=gt,Ps=za,ks=Oa,Rs=gs;Kr({target:"Promise",stat:!0,forced:Ts},{all:function(t){var e=this,n=Ps.f(e),r=n.resolve,o=n.reject,i=ks((function(){var n=_s(e.resolve),i=[],u=0,a=1;Rs(t,(function(t){var c=u++,s=!1;a++,Ss(n,e,t).then((function(t){s||(s=!0,i[c]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise}});var Cs=Kr,Ls=Ua.CONSTRUCTOR,Ns=Da,As=X,Ms=G,Is=Kn,Fs=Ns&&Ns.prototype;if(Cs({target:"Promise",proto:!0,forced:Ls,real:!0},{catch:function(t){return this.then(void 0,t)}}),Ms(Ns)){var Bs=As("Promise").prototype.catch;Fs.catch!==Bs&&Is(Fs,"catch",Bs,{unsafe:!0})}var Us=f,zs=gt,Gs=za,Ws=Oa,Hs=gs;Kr({target:"Promise",stat:!0,forced:Ts},{race:function(t){var e=this,n=Gs.f(e),r=n.reject,o=Ws((function(){var o=zs(e.resolve);Hs(t,(function(t){Us(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var qs=f,Ks=za;Kr({target:"Promise",stat:!0,forced:Ua.CONSTRUCTOR},{reject:function(t){var e=Ks.f(this);return qs(e.reject,void 0,t),e.promise}});var Vs=Ce,Js=q,Xs=za,Ys=Kr,$s=Ua.CONSTRUCTOR,Qs=function(t,e){if(Vs(t),Js(e)&&e.constructor===t)return e;var n=Xs.f(t);return(0,n.resolve)(e),n.promise};function Zs(){}function tf(){tf.init.call(this)}function ef(t){return void 0===t._maxListeners?tf.defaultMaxListeners:t._maxListeners}function nf(t,e,n){if(e)t.call(n);else for(var r=t.length,o=lf(t,r),i=0;i<r;++i)o[i].call(n)}function rf(t,e,n,r){if(e)t.call(n,r);else for(var o=t.length,i=lf(t,o),u=0;u<o;++u)i[u].call(n,r)}function of(t,e,n,r,o){if(e)t.call(n,r,o);else for(var i=t.length,u=lf(t,i),a=0;a<i;++a)u[a].call(n,r,o)}function uf(t,e,n,r,o,i){if(e)t.call(n,r,o,i);else for(var u=t.length,a=lf(t,u),c=0;c<u;++c)a[c].call(n,r,o,i)}function af(t,e,n,r){if(e)t.apply(n,r);else for(var o=t.length,i=lf(t,o),u=0;u<o;++u)i[u].apply(n,r)}function cf(t,e,n,r){var o,i,u,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((i=t._events)?(i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),u=i[e]):(i=t._events=new Zs,t._eventsCount=0),u){if("function"==typeof u?u=i[e]=r?[n,u]:[u,n]:r?u.unshift(n):u.push(n),!u.warned&&(o=ef(t))&&o>0&&u.length>o){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=u.length,a=c,"function"==typeof console.warn?console.warn(a):console.log(a)}}else u=i[e]=n,++t._eventsCount;return t}function sf(t,e,n){var r=!1;function o(){t.removeListener(e,o),r||(r=!0,n.apply(t,arguments))}return o.listener=n,o}function ff(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function lf(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}function hf(t){var e=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(t){return!1}}();return function(){var n,r=Ui(t);if(e){var o=Ui(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Bi(this,n)}}X("Promise"),Ys({target:"Promise",stat:!0,forced:$s},{resolve:function(t){return Qs(this,t)}}),Zs.prototype=Object.create(null),tf.EventEmitter=tf,tf.usingDomains=!1,tf.prototype.domain=void 0,tf.prototype._events=void 0,tf.prototype._maxListeners=void 0,tf.defaultMaxListeners=10,tf.init=function(){this.domain=null,tf.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Zs,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},tf.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},tf.prototype.getMaxListeners=function(){return ef(this)},tf.prototype.emit=function(t){var e,n,r,o,i,u,a,c="error"===t;if(u=this._events)c=c&&null==u.error;else if(!c)return!1;if(a=this.domain,c){if(e=arguments[1],!a){if(e instanceof Error)throw e;var s=new Error('Uncaught, unspecified "error" event. ('+e+")");throw s.context=e,s}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(n=u[t]))return!1;var f="function"==typeof n;switch(r=arguments.length){case 1:nf(n,f,this);break;case 2:rf(n,f,this,arguments[1]);break;case 3:of(n,f,this,arguments[1],arguments[2]);break;case 4:uf(n,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];af(n,f,this,o)}return!0},tf.prototype.addListener=function(t,e){return cf(this,t,e,!1)},tf.prototype.on=tf.prototype.addListener,tf.prototype.prependListener=function(t,e){return cf(this,t,e,!0)},tf.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,sf(this,t,e)),this},tf.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,sf(this,t,e)),this},tf.prototype.removeListener=function(t,e){var n,r,o,i,u;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener&&n.listener===e)0==--this._eventsCount?this._events=new Zs:(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length;i-- >0;)if(n[i]===e||n[i].listener&&n[i].listener===e){u=n[i].listener,o=i;break}if(o<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new Zs,this;delete r[t]}else!function(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}(n,o);r.removeListener&&this.emit("removeListener",t,u||e)}return this},tf.prototype.off=function(t,e){return this.removeListener(t,e)},tf.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new Zs,this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=new Zs:delete n[t]),this;if(0===arguments.length){for(var r,o=Object.keys(n),i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new Zs,this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},tf.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[]},tf.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):ff.call(t,e)},tf.prototype.listenerCount=ff,tf.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var pf=function(t){Fi(n,t);var e=hf(n);function n(t){var r;return Ri(this,n),zi(Mi(r=e.call(this)),"minDelay",void 0),zi(Mi(r),"maxDelay",void 0),zi(Mi(r),"initialDelay",void 0),zi(Mi(r),"maxAttemptsCount",void 0),zi(Mi(r),"maxAttemptsTime",void 0),zi(Mi(r),"randomness",void 0),zi(Mi(r),"prevDelay",void 0),zi(Mi(r),"currDelay",void 0),zi(Mi(r),"timeout",null),zi(Mi(r),"inProgress",void 0),zi(Mi(r),"attemptNum",void 0),zi(Mi(r),"startTimestamp",-1),r.minDelay=t.min,r.maxDelay=t.max,r.initialDelay=t.initial||0,r.maxAttemptsCount=t.maxAttemptsCount||0,r.maxAttemptsTime=t.maxAttemptsTime||0,r.randomness=t.randomness||0,r.inProgress=!1,r.attemptNum=0,r.prevDelay=0,r.currDelay=0,r}return Ai(n,[{key:"attempt",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.attemptNum++,this.emit("attempt",this)}},{key:"nextDelay",value:function(t){if("number"==typeof t)return this.prevDelay=0,this.currDelay=t,t;if(0==this.attemptNum)return this.initialDelay;if(1==this.attemptNum)return this.currDelay=this.minDelay,this.currDelay;this.prevDelay=this.currDelay;var e=this.currDelay+this.prevDelay;return this.maxDelay&&e>this.maxDelay&&(this.currDelay=this.maxDelay,e=this.maxDelay),this.currDelay=e,e}},{key:"randomize",value:function(t){var e=t*this.randomness,n=Math.round(Math.random()*e*2-e);return Math.max(0,t+n)}},{key:"scheduleAttempt",value:function(t){var e=this;if(this.maxAttemptsCount&&this.attemptNum>=this.maxAttemptsCount)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt count limit reached"));var n=this.nextDelay(t);if(n=this.randomize(n),this.maxAttemptsTime&&this.startTimestamp+this.maxAttemptsTime<Date.now()+n)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt time limit reached"));this.timeout=setTimeout((function(){return e.attempt()}),n)}},{key:"cleanup",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.inProgress=!1,this.attemptNum=0,this.prevDelay=0,this.currDelay=0}},{key:"start",value:function(){if(this.inProgress)throw new Error("Retrier is already in progress");this.inProgress=!0,this.startTimestamp=Date.now(),this.scheduleAttempt(this.initialDelay)}},{key:"cancel",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null,this.inProgress=!1,this.emit("cancelled"))}},{key:"succeeded",value:function(t){this.emit("succeeded",t)}},{key:"failed",value:function(t,e){if(this.timeout)throw new Error("Retrier attempt is already in progress");this.scheduleAttempt(e)}}]),n}(tf),vf=function(t){Fi(n,t);var e=hf(n);function n(t){var r;return Ri(this,n),zi(Mi(r=e.call(this)),"retrier",void 0),zi(Mi(r),"resolve",(function(){})),zi(Mi(r),"reject",(function(){})),r.retrier=new pf(t),r}return Ai(n,[{key:"run",value:function(t){var e=this;return this.retrier.on("attempt",(function(){t().then((function(t){return e.retrier.succeeded(t)})).catch((function(t){return e.retrier.failed(t)}))})),this.retrier.on("succeeded",(function(t){return e.resolve(t)})),this.retrier.on("cancelled",(function(){return e.reject(new Error("Cancelled"))})),this.retrier.on("failed",(function(t){return e.reject(t)})),new Promise((function(t,n){e.resolve=t,e.reject=n,e.retrier.start()}))}},{key:"cancel",value:function(){this.retrier.cancel()}}]),n}(tf);function mf(t){var e=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(t){return!1}}();return function(){var n,r=Ui(t);if(e){var o=Ui(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Bi(this,n)}}function yf(t){return null!=t}var df=function(t){Fi(n,t);var e=mf(n);function n(t){var r;Ri(this,n),zi(Mi(r=e.call(this)),"maxDelay",void 0),zi(Mi(r),"initialDelay",void 0),zi(Mi(r),"factor",void 0),zi(Mi(r),"randomisationFactor",void 0),zi(Mi(r),"backoffDelay",0),zi(Mi(r),"nextBackoffDelay",0),zi(Mi(r),"backoffNumber",0),zi(Mi(r),"timeoutID",null),zi(Mi(r),"maxNumberOfRetry",-1);var o=t=t||{},i=o.initialDelay,u=o.maxDelay,a=o.randomisationFactor,c=o.factor;if(yf(i)&&i<1)throw new Error("The initial timeout must be equal to or greater than 1.");if(yf(u)&&u<=1)throw new Error("The maximal timeout must be greater than 1.");if(yf(a)&&(a<0||a>1))throw new Error("The randomisation factor must be between 0 and 1.");if(yf(c)&&c<=1)throw new Error("Exponential factor should be greater than 1.");if(r.initialDelay=i||100,r.maxDelay=u||1e4,r.maxDelay<=r.initialDelay)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");return r.randomisationFactor=a||0,r.factor=c||2,r.reset(),r}return Ai(n,[{key:"backoff",value:function(t){null==this.timeoutID&&(this.backoffNumber===this.maxNumberOfRetry?(this.emit("fail",t),this.reset()):(this.backoffDelay=this.next(),this.timeoutID=setTimeout(this.onBackoff.bind(this),this.backoffDelay),this.emit("backoff",this.backoffNumber,this.backoffDelay,t)))}},{key:"reset",value:function(){this.backoffDelay=0,this.nextBackoffDelay=this.initialDelay,this.backoffNumber=0,this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=null}},{key:"failAfter",value:function(t){if(t<=0)throw new Error("Expected a maximum number of retry greater than 0 but got ".concat(t));this.maxNumberOfRetry=t}},{key:"next",value:function(){this.backoffDelay=Math.min(this.nextBackoffDelay,this.maxDelay),this.nextBackoffDelay=this.backoffDelay*this.factor;var t=1+Math.random()*this.randomisationFactor;return Math.min(this.maxDelay,Math.round(this.backoffDelay*t))}},{key:"onBackoff",value:function(){this.timeoutID=null,this.emit("ready",this.backoffNumber,this.backoffDelay),this.backoffNumber++}}],[{key:"exponential",value:function(t){return new n(t)}}]),n}(tf);return t.AsyncRetrier=vf,t.Backoff=df,t.Retrier=pf,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var Retrier=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),o={},i=function(t){try{return!!t()}catch(t){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c={},a={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,s=f&&!a.call({1:2},1);c.f=s?function(t){var e=f(this,t);return!!e&&e.enumerable}:a;var l,h,p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,v=function(t){return y.call(t).slice(8,-1)},m=v,d="".split,b=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==m(t)?d.call(t,""):Object(t)}:Object,w=b,j=function(t){return g(w(t))},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=r,E=function(t){return"function"==typeof t?t:void 0},D=function(t,e){return arguments.length<2?E(O[t]):O[t]&&O[t][e]},_=D("navigator","userAgent")||"",k=r,T=_,S=k.process,P=k.Deno,L=S&&S.versions||P&&P.version,R=L&&L.v8;R?h=(l=R.split("."))[0]<4?1:l[0]+l[1]:T&&(!(l=T.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=T.match(/Chrome\/(\d+)/))&&(h=l[1]);var M=h&&+h,A=M,C=i,N=!!Object.getOwnPropertySymbols&&!C((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&A&&A<41})),I=N&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,F=D,B=I?function(t){return"symbol"==typeof t}:function(t){var e=F("Symbol");return"function"==typeof e&&Object(t)instanceof e},z=x,U={exports:{}},W=r,q=function(t,e){try{Object.defineProperty(W,t,{value:e,configurable:!0,writable:!0})}catch(n){W[t]=e}return e},K=q,G="__core-js_shared__",H=r[G]||K(G,{}),V=H;(U.exports=function(t,e){return V[t]||(V[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.17.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var X=b,Y=function(t){return Object(X(t))},J={}.hasOwnProperty,Q=Object.hasOwn||function(t,e){return J.call(Y(t),e)},Z=0,$=Math.random(),tt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++Z+$).toString(36)},et=r,nt=U.exports,rt=Q,ot=tt,it=N,ut=I,ct=nt("wks"),at=et.Symbol,ft=ut?at:at&&at.withoutSetter||ot,st=function(t){return rt(ct,t)&&(it||"string"==typeof ct[t])||(it&&rt(at,t)?ct[t]=at[t]:ct[t]=ft("Symbol."+t)),ct[t]},lt=x,ht=B,pt=function(t,e){var n,r;if("string"===e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!z(r=n.call(t)))return r;if("string"!==e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},yt=st("toPrimitive"),vt=function(t,e){if(!lt(t)||ht(t))return t;var n,r=t[yt];if(void 0!==r){if(void 0===e&&(e="default"),n=r.call(t,e),!lt(n)||ht(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),pt(t,e)},mt=B,dt=function(t){var e=vt(t,"string");return mt(e)?e:String(e)},bt=x,gt=r.document,wt=bt(gt)&&bt(gt.createElement),jt=function(t){return wt?gt.createElement(t):{}},xt=jt,Ot=!u&&!i((function(){return 7!=Object.defineProperty(xt("div"),"a",{get:function(){return 7}}).a})),Et=u,Dt=c,_t=p,kt=j,Tt=dt,St=Q,Pt=Ot,Lt=Object.getOwnPropertyDescriptor;o.f=Et?Lt:function(t,e){if(t=kt(t),e=Tt(e),Pt)try{return Lt(t,e)}catch(t){}if(St(t,e))return _t(!Dt.f.call(t,e),t[e])};var Rt={},Mt=x,At=function(t){if(!Mt(t))throw TypeError(String(t)+" is not an object");return t},Ct=u,Nt=Ot,It=At,Ft=dt,Bt=Object.defineProperty;Rt.f=Ct?Bt:function(t,e,n){if(It(t),e=Ft(e),It(n),Nt)try{return Bt(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var zt=Rt,Ut=p,Wt=u?function(t,e,n){return zt.f(t,e,Ut(1,n))}:function(t,e,n){return t[e]=n,t},qt={exports:{}},Kt=H,Gt=Function.toString;"function"!=typeof Kt.inspectSource&&(Kt.inspectSource=function(t){return Gt.call(t)});var Ht,Vt,Xt,Yt=Kt.inspectSource,Jt=Yt,Qt=r.WeakMap,Zt="function"==typeof Qt&&/native code/.test(Jt(Qt)),$t=U.exports,te=tt,ee=$t("keys"),ne=function(t){return ee[t]||(ee[t]=te(t))},re={},oe=Zt,ie=x,ue=Wt,ce=Q,ae=H,fe=ne,se=re,le="Object already initialized",he=r.WeakMap;if(oe||ae.state){var pe=ae.state||(ae.state=new he),ye=pe.get,ve=pe.has,me=pe.set;Ht=function(t,e){if(ve.call(pe,t))throw new TypeError(le);return e.facade=t,me.call(pe,t,e),e},Vt=function(t){return ye.call(pe,t)||{}},Xt=function(t){return ve.call(pe,t)}}else{var de=fe("state");se[de]=!0,Ht=function(t,e){if(ce(t,de))throw new TypeError(le);return e.facade=t,ue(t,de,e),e},Vt=function(t){return ce(t,de)?t[de]:{}},Xt=function(t){return ce(t,de)}}var be={set:Ht,get:Vt,has:Xt,enforce:function(t){return Xt(t)?Vt(t):Ht(t,{})},getterFor:function(t){return function(e){var n;if(!ie(e)||(n=Vt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ge=r,we=Wt,je=Q,xe=q,Oe=Yt,Ee=be.get,De=be.enforce,_e=String(String).split("String");(qt.exports=function(t,e,n,r){var o,i=!!r&&!!r.unsafe,u=!!r&&!!r.enumerable,c=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof e||je(n,"name")||we(n,"name",e),(o=De(n)).source||(o.source=_e.join("string"==typeof e?e:""))),t!==ge?(i?!c&&t[e]&&(u=!0):delete t[e],u?t[e]=n:we(t,e,n)):u?t[e]=n:xe(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ee(this).source||Oe(this)}));var ke={},Te=Math.ceil,Se=Math.floor,Pe=function(t){return isNaN(t=+t)?0:(t>0?Se:Te)(t)},Le=Pe,Re=Math.min,Me=function(t){return t>0?Re(Le(t),9007199254740991):0},Ae=Pe,Ce=Math.max,Ne=Math.min,Ie=j,Fe=Me,Be=function(t,e){var n=Ae(t);return n<0?Ce(n+e,0):Ne(n,e)},ze=function(t){return function(e,n,r){var o,i=Ie(e),u=Fe(i.length),c=Be(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},Ue={includes:ze(!0),indexOf:ze(!1)},We=Q,qe=j,Ke=Ue.indexOf,Ge=re,He=function(t,e){var n,r=qe(t),o=0,i=[];for(n in r)!We(Ge,n)&&We(r,n)&&i.push(n);for(;e.length>o;)We(r,n=e[o++])&&(~Ke(i,n)||i.push(n));return i},Ve=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xe=He,Ye=Ve.concat("length","prototype");ke.f=Object.getOwnPropertyNames||function(t){return Xe(t,Ye)};var Je={};Je.f=Object.getOwnPropertySymbols;var Qe=ke,Ze=Je,$e=At,tn=D("Reflect","ownKeys")||function(t){var e=Qe.f($e(t)),n=Ze.f;return n?e.concat(n(t)):e},en=Q,nn=tn,rn=o,on=Rt,un=i,cn=/#|\.prototype\./,an=function(t,e){var n=sn[fn(t)];return n==hn||n!=ln&&("function"==typeof e?un(e):!!e)},fn=an.normalize=function(t){return String(t).replace(cn,".").toLowerCase()},sn=an.data={},ln=an.NATIVE="N",hn=an.POLYFILL="P",pn=an,yn=r,vn=o.f,mn=Wt,dn=qt.exports,bn=q,gn=function(t,e){for(var n=nn(e),r=on.f,o=rn.f,i=0;i<n.length;i++){var u=n[i];en(t,u)||r(t,u,o(e,u))}},wn=pn,jn=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?yn:f?yn[c]||bn(c,{}):(yn[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=vn(n,r))&&u.value:n[r],!wn(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;gn(i,o)}(t.sham||o&&o.sham)&&mn(i,"sham",!0),dn(n,r,i,t)}},xn=Rt.f,On=Q,En=st("toStringTag"),Dn=function(t,e,n){t&&!On(t=n?t:t.prototype,En)&&xn(t,En,{configurable:!0,value:e})},_n=r,kn=Dn;jn({global:!0},{Reflect:{}}),kn(_n.Reflect,"Reflect",!0);var Tn,Sn=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Pn=He,Ln=Ve,Rn=Object.keys||function(t){return Pn(t,Ln)},Mn=Rt,An=At,Cn=Rn,Nn=u?Object.defineProperties:function(t,e){An(t);for(var n,r=Cn(e),o=r.length,i=0;o>i;)Mn.f(t,n=r[i++],e[n]);return t},In=D("document","documentElement"),Fn=At,Bn=Nn,zn=Ve,Un=re,Wn=In,qn=jt,Kn=ne("IE_PROTO"),Gn=function(){},Hn=function(t){return"<script>"+t+"</"+"script>"},Vn=function(t){t.write(Hn("")),t.close();var e=t.parentWindow.Object;return t=null,e},Xn=function(){try{Tn=new ActiveXObject("htmlfile")}catch(t){}var t,e;Xn="undefined"!=typeof document?document.domain&&Tn?Vn(Tn):((e=qn("iframe")).style.display="none",Wn.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Hn("document.F=Object")),t.close(),t.F):Vn(Tn);for(var n=zn.length;n--;)delete Xn.prototype[zn[n]];return Xn()};Un[Kn]=!0;var Yn=Object.create||function(t,e){var n;return null!==t?(Gn.prototype=Fn(t),n=new Gn,Gn.prototype=null,n[Kn]=t):n=Xn(),void 0===e?n:Bn(n,e)},Jn=Sn,Qn=x,Zn=[].slice,$n={},tr=function(t,e,n){if(!(e in $n)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";$n[e]=Function("C,a","return new C("+r.join(",")+")")}return $n[e](t,n)},er=Function.bind||function(t){var e=Jn(this),n=Zn.call(arguments,1),r=function(){var o=n.concat(Zn.call(arguments));return this instanceof r?tr(e,o.length,o):e.apply(t,o)};return Qn(e.prototype)&&(r.prototype=e.prototype),r},nr=jn,rr=Sn,or=At,ir=x,ur=Yn,cr=er,ar=i,fr=D("Reflect","construct"),sr=ar((function(){function t(){}return!(fr((function(){}),[],t)instanceof t)})),lr=!ar((function(){fr((function(){}))})),hr=sr||lr;function pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function vr(t,e,n){return e&&yr(t.prototype,e),n&&yr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function mr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dr(t,e){return dr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},dr(t,e)}function br(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dr(t,e)}function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function wr(t,e){if(e&&("object"===gr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return mr(t)}function jr(t){return jr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jr(t)}function xr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}nr({target:"Reflect",stat:!0,forced:hr,sham:hr},{construct:function(t,e){rr(t),or(e);var n=arguments.length<3?t:rr(arguments[2]);if(lr&&!sr)return fr(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(cr.apply(t,r))}var o=n.prototype,i=ur(ir(o)?o:Object.prototype),u=Function.apply.call(t,i,e);return ir(u)?u:i}});var Or={};Or[st("toStringTag")]="z";var Er="[object z]"===String(Or),Dr=Er,_r=v,kr=st("toStringTag"),Tr="Arguments"==_r(function(){return arguments}()),Sr=Dr?_r:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),kr))?n:Tr?_r(e):"Object"==(r=_r(e))&&"function"==typeof e.callee?"Arguments":r},Pr=Sr,Lr=Er?{}.toString:function(){return"[object "+Pr(this)+"]"},Rr=Er,Mr=qt.exports,Ar=Lr;Rr||Mr(Object.prototype,"toString",Ar,{unsafe:!0});var Cr=r.Promise,Nr=qt.exports,Ir=x,Fr=At,Br=function(t){if(!Ir(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},zr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Fr(n),Br(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Ur=D,Wr=Rt,qr=u,Kr=st("species"),Gr={},Hr=Gr,Vr=st("iterator"),Xr=Array.prototype,Yr=Sn,Jr=function(t,e,n){if(Yr(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},Qr=Sr,Zr=Gr,$r=st("iterator"),to=function(t){if(null!=t)return t[$r]||t["@@iterator"]||Zr[Qr(t)]},eo=At,no=to,ro=At,oo=At,io=function(t){return void 0!==t&&(Hr.Array===t||Xr[Vr]===t)},uo=Me,co=Jr,ao=function(t,e){var n=arguments.length<2?no(t):e;if("function"!=typeof n)throw TypeError(String(t)+" is not iterable");return eo(n.call(t))},fo=to,so=function(t,e,n){var r,o;ro(t);try{if(void 0===(r=t.return)){if("throw"===e)throw n;return n}r=r.call(t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return ro(r),n},lo=function(t,e){this.stopped=t,this.result=e},ho=st("iterator"),po=!1;try{var yo=0,vo={next:function(){return{done:!!yo++}},return:function(){po=!0}};vo[ho]=function(){return this},Array.from(vo,(function(){throw 2}))}catch(t){}var mo,bo,go,wo,jo=At,xo=Sn,Oo=st("species"),Eo=/(?:ipad|iphone|ipod).*applewebkit/i.test(_),Do="process"==v(r.process),_o=r,ko=i,To=Jr,So=In,Po=jt,Lo=Eo,Ro=Do,Mo=_o.setImmediate,Ao=_o.clearImmediate,Co=_o.process,No=_o.MessageChannel,Io=_o.Dispatch,Fo=0,Bo={},zo="onreadystatechange";try{mo=_o.location}catch(t){}var Uo=function(t){if(Bo.hasOwnProperty(t)){var e=Bo[t];delete Bo[t],e()}},Wo=function(t){return function(){Uo(t)}},qo=function(t){Uo(t.data)},Ko=function(t){_o.postMessage(String(t),mo.protocol+"//"+mo.host)};Mo&&Ao||(Mo=function(t){for(var e=[],n=arguments.length,r=1;n>r;)e.push(arguments[r++]);return Bo[++Fo]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},bo(Fo),Fo},Ao=function(t){delete Bo[t]},Ro?bo=function(t){Co.nextTick(Wo(t))}:Io&&Io.now?bo=function(t){Io.now(Wo(t))}:No&&!Lo?(wo=(go=new No).port2,go.port1.onmessage=qo,bo=To(wo.postMessage,wo,1)):_o.addEventListener&&"function"==typeof postMessage&&!_o.importScripts&&mo&&"file:"!==mo.protocol&&!ko(Ko)?(bo=Ko,_o.addEventListener("message",qo,!1)):bo=zo in Po("script")?function(t){So.appendChild(Po("script")).onreadystatechange=function(){So.removeChild(this),Uo(t)}}:function(t){setTimeout(Wo(t),0)});var Go,Ho,Vo,Xo,Yo,Jo,Qo,Zo,$o={set:Mo,clear:Ao},ti=r,ei=/ipad|iphone|ipod/i.test(_)&&void 0!==ti.Pebble,ni=/web0s(?!.*chrome)/i.test(_),ri=r,oi=o.f,ii=$o.set,ui=Eo,ci=ei,ai=ni,fi=Do,si=ri.MutationObserver||ri.WebKitMutationObserver,li=ri.document,hi=ri.process,pi=ri.Promise,yi=oi(ri,"queueMicrotask"),vi=yi&&yi.value;vi||(Go=function(){var t,e;for(fi&&(t=hi.domain)&&t.exit();Ho;){e=Ho.fn,Ho=Ho.next;try{e()}catch(t){throw Ho?Xo():Vo=void 0,t}}Vo=void 0,t&&t.enter()},ui||fi||ai||!si||!li?!ci&&pi&&pi.resolve?((Qo=pi.resolve(void 0)).constructor=pi,Zo=Qo.then,Xo=function(){Zo.call(Qo,Go)}):Xo=fi?function(){hi.nextTick(Go)}:function(){ii.call(ri,Go)}:(Yo=!0,Jo=li.createTextNode(""),new si(Go).observe(Jo,{characterData:!0}),Xo=function(){Jo.data=Yo=!Yo}));var mi=vi||function(t){var e={fn:t,next:void 0};Vo&&(Vo.next=e),Ho||(Ho=e,Xo()),Vo=e},di={},bi=Sn,gi=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=bi(e),this.reject=bi(n)};di.f=function(t){return new gi(t)};var wi,ji,xi,Oi,Ei=At,Di=x,_i=di,ki=r,Ti="object"==typeof window,Si=jn,Pi=r,Li=D,Ri=Cr,Mi=qt.exports,Ai=function(t,e,n){for(var r in e)Nr(t,r,e[r],n);return t},Ci=zr,Ni=Dn,Ii=function(t){var e=Ur(t),n=Wr.f;qr&&e&&!e[Kr]&&n(e,Kr,{configurable:!0,get:function(){return this}})},Fi=x,Bi=Sn,zi=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},Ui=Yt,Wi=function(t,e,n){var r,o,i,u,c,a,f,s=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),y=co(e,s,1+l+p),v=function(t){return r&&so(r,"normal",t),new lo(!0,t)},m=function(t){return l?(oo(t),p?y(t[0],t[1],v):y(t[0],t[1])):p?y(t,v):y(t)};if(h)r=t;else{if("function"!=typeof(o=fo(t)))throw TypeError("Target is not iterable");if(io(o)){for(i=0,u=uo(t.length);u>i;i++)if((c=m(t[i]))&&c instanceof lo)return c;return new lo(!1)}r=ao(t,o)}for(a=r.next;!(f=a.call(r)).done;){try{c=m(f.value)}catch(t){so(r,"throw",t)}if("object"==typeof c&&c&&c instanceof lo)return c}return new lo(!1)},qi=function(t,e){if(!e&&!po)return!1;var n=!1;try{var r={};r[ho]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ki=function(t,e){var n,r=jo(t).constructor;return void 0===r||null==(n=jo(r)[Oo])?e:xo(n)},Gi=$o.set,Hi=mi,Vi=function(t,e){if(Ei(t),Di(e)&&e.constructor===t)return e;var n=_i.f(t);return(0,n.resolve)(e),n.promise},Xi=function(t,e){var n=ki.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))},Yi=di,Ji=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Qi=be,Zi=pn,$i=Ti,tu=Do,eu=M,nu=st("species"),ru="Promise",ou=Qi.get,iu=Qi.set,uu=Qi.getterFor(ru),cu=Ri&&Ri.prototype,au=Ri,fu=cu,su=Pi.TypeError,lu=Pi.document,hu=Pi.process,pu=Yi.f,yu=pu,vu=!!(lu&&lu.createEvent&&Pi.dispatchEvent),mu="function"==typeof PromiseRejectionEvent,du="unhandledrejection",bu=!1,gu=Zi(ru,(function(){var t=Ui(au),e=t!==String(au);if(!e&&66===eu)return!0;if(eu>=51&&/native code/.test(t))return!1;var n=new au((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};return(n.constructor={})[nu]=r,!(bu=n.then((function(){}))instanceof r)||!e&&$i&&!mu})),wu=gu||!qi((function(t){au.all(t).catch((function(){}))})),ju=function(t){var e;return!(!Fi(t)||"function"!=typeof(e=t.then))&&e},xu=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;Hi((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var u,c,a,f=n[i++],s=o?f.ok:f.fail,l=f.resolve,h=f.reject,p=f.domain;try{s?(o||(2===t.rejection&&_u(t),t.rejection=1),!0===s?u=r:(p&&p.enter(),u=s(r),p&&(p.exit(),a=!0)),u===f.promise?h(su("Promise-chain cycle")):(c=ju(u))?c.call(u,l,h):l(u)):h(r)}catch(t){p&&!a&&p.exit(),h(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Eu(t)}))}},Ou=function(t,e,n){var r,o;vu?((r=lu.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),Pi.dispatchEvent(r)):r={promise:e,reason:n},!mu&&(o=Pi["on"+t])?o(r):t===du&&Xi("Unhandled promise rejection",n)},Eu=function(t){Gi.call(Pi,(function(){var e,n=t.facade,r=t.value;if(Du(t)&&(e=Ji((function(){tu?hu.emit("unhandledRejection",r,n):Ou(du,n,r)})),t.rejection=tu||Du(t)?2:1,e.error))throw e.value}))},Du=function(t){return 1!==t.rejection&&!t.parent},_u=function(t){Gi.call(Pi,(function(){var e=t.facade;tu?hu.emit("rejectionHandled",e):Ou("rejectionhandled",e,t.value)}))},ku=function(t,e,n){return function(r){t(e,r,n)}},Tu=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,xu(t,!0))},Su=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw su("Promise can't be resolved itself");var r=ju(e);r?Hi((function(){var n={done:!1};try{r.call(e,ku(Su,n,t),ku(Tu,n,t))}catch(e){Tu(n,e,t)}})):(t.value=e,t.state=1,xu(t,!1))}catch(e){Tu({done:!1},e,t)}}};if(gu&&(fu=(au=function(t){zi(this,au,ru),Bi(t),wi.call(this);var e=ou(this);try{t(ku(Su,e),ku(Tu,e))}catch(t){Tu(e,t)}}).prototype,(wi=function(t){iu(this,{type:ru,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Ai(fu,{then:function(t,e){var n=uu(this),r=pu(Ki(this,au));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=tu?hu.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&xu(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),ji=function(){var t=new wi,e=ou(t);this.promise=t,this.resolve=ku(Su,e),this.reject=ku(Tu,e)},Yi.f=pu=function(t){return t===au||t===xi?new ji(t):yu(t)},"function"==typeof Ri&&cu!==Object.prototype)){Oi=cu.then,bu||(Mi(cu,"then",(function(t,e){var n=this;return new au((function(t,e){Oi.call(n,t,e)})).then(t,e)}),{unsafe:!0}),Mi(cu,"catch",fu.catch,{unsafe:!0}));try{delete cu.constructor}catch(t){}Ci&&Ci(cu,fu)}function Pu(){}function Lu(){Lu.init.call(this)}function Ru(t){return void 0===t._maxListeners?Lu.defaultMaxListeners:t._maxListeners}function Mu(t,e,n){if(e)t.call(n);else for(var r=t.length,o=Uu(t,r),i=0;i<r;++i)o[i].call(n)}function Au(t,e,n,r){if(e)t.call(n,r);else for(var o=t.length,i=Uu(t,o),u=0;u<o;++u)i[u].call(n,r)}function Cu(t,e,n,r,o){if(e)t.call(n,r,o);else for(var i=t.length,u=Uu(t,i),c=0;c<i;++c)u[c].call(n,r,o)}function Nu(t,e,n,r,o,i){if(e)t.call(n,r,o,i);else for(var u=t.length,c=Uu(t,u),a=0;a<u;++a)c[a].call(n,r,o,i)}function Iu(t,e,n,r){if(e)t.apply(n,r);else for(var o=t.length,i=Uu(t,o),u=0;u<o;++u)i[u].apply(n,r)}function Fu(t,e,n,r){var o,i,u,c;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((i=t._events)?(i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),u=i[e]):(i=t._events=new Pu,t._eventsCount=0),u){if("function"==typeof u?u=i[e]=r?[n,u]:[u,n]:r?u.unshift(n):u.push(n),!u.warned&&(o=Ru(t))&&o>0&&u.length>o){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=u.length,c=a,"function"==typeof console.warn?console.warn(c):console.log(c)}}else u=i[e]=n,++t._eventsCount;return t}function Bu(t,e,n){var r=!1;function o(){t.removeListener(e,o),r||(r=!0,n.apply(t,arguments))}return o.listener=n,o}function zu(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function Uu(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}function Wu(t){var e=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(t){return!1}}();return function(){var n,r=jr(t);if(e){var o=jr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wr(this,n)}}Si({global:!0,wrap:!0,forced:gu},{Promise:au}),Ni(au,ru,!1),Ii(ru),xi=Li(ru),Si({target:ru,stat:!0,forced:gu},{reject:function(t){var e=pu(this);return e.reject.call(void 0,t),e.promise}}),Si({target:ru,stat:!0,forced:gu},{resolve:function(t){return Vi(this,t)}}),Si({target:ru,stat:!0,forced:wu},{all:function(t){var e=this,n=pu(e),r=n.resolve,o=n.reject,i=Ji((function(){var n=Bi(e.resolve),i=[],u=0,c=1;Wi(t,(function(t){var a=u++,f=!1;i.push(void 0),c++,n.call(e,t).then((function(t){f||(f=!0,i[a]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=pu(e),r=n.reject,o=Ji((function(){var o=Bi(e.resolve);Wi(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),Pu.prototype=Object.create(null),Lu.EventEmitter=Lu,Lu.usingDomains=!1,Lu.prototype.domain=void 0,Lu.prototype._events=void 0,Lu.prototype._maxListeners=void 0,Lu.defaultMaxListeners=10,Lu.init=function(){this.domain=null,Lu.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Pu,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Lu.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},Lu.prototype.getMaxListeners=function(){return Ru(this)},Lu.prototype.emit=function(t){var e,n,r,o,i,u,c,a="error"===t;if(u=this._events)a=a&&null==u.error;else if(!a)return!1;if(c=this.domain,a){if(e=arguments[1],!c){if(e instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=c,e.domainThrown=!1,c.emit("error",e),!1}if(!(n=u[t]))return!1;var s="function"==typeof n;switch(r=arguments.length){case 1:Mu(n,s,this);break;case 2:Au(n,s,this,arguments[1]);break;case 3:Cu(n,s,this,arguments[1],arguments[2]);break;case 4:Nu(n,s,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];Iu(n,s,this,o)}return!0},Lu.prototype.addListener=function(t,e){return Fu(this,t,e,!1)},Lu.prototype.on=Lu.prototype.addListener,Lu.prototype.prependListener=function(t,e){return Fu(this,t,e,!0)},Lu.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,Bu(this,t,e)),this},Lu.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Bu(this,t,e)),this},Lu.prototype.removeListener=function(t,e){var n,r,o,i,u;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener&&n.listener===e)0==--this._eventsCount?this._events=new Pu:(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length;i-- >0;)if(n[i]===e||n[i].listener&&n[i].listener===e){u=n[i].listener,o=i;break}if(o<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new Pu,this;delete r[t]}else!function(t,e){for(var n=e,r=n+1,o=t.length;r<o;n+=1,r+=1)t[n]=t[r];t.pop()}(n,o);r.removeListener&&this.emit("removeListener",t,u||e)}return this},Lu.prototype.off=function(t,e){return this.removeListener(t,e)},Lu.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new Pu,this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=new Pu:delete n[t]),this;if(0===arguments.length){for(var r,o=Object.keys(n),i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new Pu,this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},Lu.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[]},Lu.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):zu.call(t,e)},Lu.prototype.listenerCount=zu,Lu.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var qu=function(t){br(n,t);var e=Wu(n);function n(t){var r;return pr(this,n),xr(mr(r=e.call(this)),"timeout",null),xr(mr(r),"startTimestamp",-1),r.minDelay=t.min,r.maxDelay=t.max,r.initialDelay=t.initial||0,r.maxAttemptsCount=t.maxAttemptsCount||0,r.maxAttemptsTime=t.maxAttemptsTime||0,r.randomness=t.randomness||0,r.inProgress=!1,r.attemptNum=0,r.prevDelay=0,r.currDelay=0,r}return vr(n,[{key:"attempt",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.attemptNum++,this.emit("attempt",this)}},{key:"nextDelay",value:function(t){if("number"==typeof t)return this.prevDelay=0,this.currDelay=t,t;if(0==this.attemptNum)return this.initialDelay;if(1==this.attemptNum)return this.currDelay=this.minDelay,this.currDelay;this.prevDelay=this.currDelay;var e=this.currDelay+this.prevDelay;return this.maxDelay&&e>this.maxDelay&&(this.currDelay=this.maxDelay,e=this.maxDelay),this.currDelay=e,e}},{key:"randomize",value:function(t){var e=t*this.randomness,n=Math.round(Math.random()*e*2-e);return Math.max(0,t+n)}},{key:"scheduleAttempt",value:function(t){var e=this;if(this.maxAttemptsCount&&this.attemptNum>=this.maxAttemptsCount)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt count limit reached"));var n=this.nextDelay(t);if(n=this.randomize(n),this.maxAttemptsTime&&this.startTimestamp+this.maxAttemptsTime<Date.now()+n)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt time limit reached"));this.timeout=setTimeout((function(){return e.attempt()}),n)}},{key:"cleanup",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.inProgress=!1,this.attemptNum=0,this.prevDelay=0,this.currDelay=0}},{key:"start",value:function(){if(this.inProgress)throw new Error("Retrier is already in progress");this.inProgress=!0,this.startTimestamp=Date.now(),this.scheduleAttempt(this.initialDelay)}},{key:"cancel",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null,this.inProgress=!1,this.emit("cancelled"))}},{key:"succeeded",value:function(t){this.emit("succeeded",t)}},{key:"failed",value:function(t,e){if(this.timeout)throw new Error("Retrier attempt is already in progress");this.scheduleAttempt(e)}}]),n}(Lu),Ku=function(t){br(n,t);var e=Wu(n);function n(t){var r;return pr(this,n),xr(mr(r=e.call(this)),"resolve",(function(){})),xr(mr(r),"reject",(function(){})),r.retrier=new qu(t),r}return vr(n,[{key:"run",value:function(t){var e=this;return this.retrier.on("attempt",(function(){t().then((function(t){return e.retrier.succeeded(t)})).catch((function(t){return e.retrier.failed(t)}))})),this.retrier.on("succeeded",(function(t){return e.resolve(t)})),this.retrier.on("cancelled",(function(){return e.reject(new Error("Cancelled"))})),this.retrier.on("failed",(function(t){return e.reject(t)})),new Promise((function(t,n){e.resolve=t,e.reject=n,e.retrier.start()}))}},{key:"cancel",value:function(){this.retrier.cancel()}}]),n}(Lu);function Gu(t){var e=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(t){return!1}}();return function(){var n,r=jr(t);if(e){var o=jr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wr(this,n)}}function Hu(t){return null!=t}var Vu=function(t){br(n,t);var e=Gu(n);function n(t){var r;pr(this,n),xr(mr(r=e.call(this)),"backoffDelay",0),xr(mr(r),"nextBackoffDelay",0),xr(mr(r),"backoffNumber",0),xr(mr(r),"timeoutID",null),xr(mr(r),"maxNumberOfRetry",-1);var o=t=t||{},i=o.initialDelay,u=o.maxDelay,c=o.randomisationFactor,a=o.factor;if(Hu(i)&&i<1)throw new Error("The initial timeout must be equal to or greater than 1.");if(Hu(u)&&u<=1)throw new Error("The maximal timeout must be greater than 1.");if(Hu(c)&&(c<0||c>1))throw new Error("The randomisation factor must be between 0 and 1.");if(Hu(a)&&a<=1)throw new Error("Exponential factor should be greater than 1.");if(r.initialDelay=i||100,r.maxDelay=u||1e4,r.maxDelay<=r.initialDelay)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");return r.randomisationFactor=c||0,r.factor=a||2,r.reset(),r}return vr(n,[{key:"backoff",value:function(t){null==this.timeoutID&&(this.backoffNumber===this.maxNumberOfRetry?(this.emit("fail",t),this.reset()):(this.backoffDelay=this.next(),this.timeoutID=setTimeout(this.onBackoff.bind(this),this.backoffDelay),this.emit("backoff",this.backoffNumber,this.backoffDelay,t)))}},{key:"reset",value:function(){this.backoffDelay=0,this.nextBackoffDelay=this.initialDelay,this.backoffNumber=0,this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=null}},{key:"failAfter",value:function(t){if(t<=0)throw new Error("Expected a maximum number of retry greater than 0 but got ".concat(t));this.maxNumberOfRetry=t}},{key:"next",value:function(){this.backoffDelay=Math.min(this.nextBackoffDelay,this.maxDelay),this.nextBackoffDelay=this.backoffDelay*this.factor;var t=1+Math.random()*this.randomisationFactor;return Math.min(this.maxDelay,Math.round(this.backoffDelay*t))}},{key:"onBackoff",value:function(){this.timeoutID=null,this.emit("ready",this.backoffNumber,this.backoffDelay),this.backoffNumber++}}],[{key:"exponential",value:function(t){return new n(t)}}]),n}(Lu);return t.AsyncRetrier=Ku,t.Backoff=Vu,t.Retrier=qu,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
{
"name": "@twilio/operation-retrier",
"version": "4.0.10-rc.1",
"version": "4.0.11-rc.2",
"description": "RTD retrier",

@@ -48,4 +48,4 @@ "author": "Sergei Chertkov",

"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"async-test-tools": "^1.0.7",

@@ -61,6 +61,6 @@ "eslint": "^7.27.0",

"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^3.0.2",
"rollup-plugin-ts": "^2.0.7",
"ts-jest": "^27.0.2",
"tslib": "^2.4.0",
"typescript": "^4.8.4"
"typescript": "^4.3.2"
},

@@ -67,0 +67,0 @@ "browserslist": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc