1 | {"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __extends, __awaiter, __generator } from 'tslib';\nimport { Observable, ApolloLink } from 'apollo-link';\n\nfunction buildDelayFunction(delayOptions) {\n var _a = delayOptions || {}, _b = _a.initial, initial = _b === void 0 ? 300 : _b, _c = _a.jitter, jitter = _c === void 0 ? true : _c, _d = _a.max, max = _d === void 0 ? Infinity : _d;\n var baseDelay = jitter ? initial : initial / 2;\n return function delayFunction(count) {\n var delay = Math.min(max, baseDelay * Math.pow(2, count));\n if (jitter) {\n delay = Math.random() * delay;\n }\n return delay;\n };\n}\n\nfunction buildRetryFunction(retryOptions) {\n var _a = retryOptions || {}, retryIf = _a.retryIf, _b = _a.max, max = _b === void 0 ? 5 : _b;\n return function retryFunction(count, operation, error) {\n if (count >= max)\n return false;\n return retryIf ? retryIf(error, operation) : !!error;\n };\n}\n\nvar RetryableOperation = (function () {\n function RetryableOperation(operation, nextLink, delayFor, retryIf) {\n var _this = this;\n this.operation = operation;\n this.nextLink = nextLink;\n this.delayFor = delayFor;\n this.retryIf = retryIf;\n this.retryCount = 0;\n this.values = [];\n this.complete = false;\n this.canceled = false;\n this.observers = [];\n this.currentSubscription = null;\n this.onNext = function (value) {\n _this.values.push(value);\n for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) {\n var observer = _a[_i];\n if (!observer)\n continue;\n observer.next(value);\n }\n };\n this.onComplete = function () {\n _this.complete = true;\n for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) {\n var observer = _a[_i];\n if (!observer)\n continue;\n observer.complete();\n }\n };\n this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () {\n var shouldRetry, _i, _a, observer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n this.retryCount += 1;\n return [4, this.retryIf(this.retryCount, this.operation, error)];\n case 1:\n shouldRetry = _b.sent();\n if (shouldRetry) {\n this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));\n return [2];\n }\n this.error = error;\n for (_i = 0, _a = this.observers; _i < _a.length; _i++) {\n observer = _a[_i];\n if (!observer)\n continue;\n observer.error(error);\n }\n return [2];\n }\n });\n }); };\n }\n RetryableOperation.prototype.subscribe = function (observer) {\n if (this.canceled) {\n throw new Error(\"Subscribing to a retryable link that was canceled is not supported\");\n }\n this.observers.push(observer);\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var value = _a[_i];\n observer.next(value);\n }\n if (this.complete) {\n observer.complete();\n }\n else if (this.error) {\n observer.error(this.error);\n }\n };\n RetryableOperation.prototype.unsubscribe = function (observer) {\n var index = this.observers.indexOf(observer);\n if (index < 0) {\n throw new Error(\"RetryLink BUG! Attempting to unsubscribe unknown observer!\");\n }\n this.observers[index] = null;\n if (this.observers.every(function (o) { return o === null; })) {\n this.cancel();\n }\n };\n RetryableOperation.prototype.start = function () {\n if (this.currentSubscription)\n return;\n this.try();\n };\n RetryableOperation.prototype.cancel = function () {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n }\n clearTimeout(this.timerId);\n this.timerId = null;\n this.currentSubscription = null;\n this.canceled = true;\n };\n RetryableOperation.prototype.try = function () {\n this.currentSubscription = this.nextLink(this.operation).subscribe({\n next: this.onNext,\n error: this.onError,\n complete: this.onComplete,\n });\n };\n RetryableOperation.prototype.scheduleRetry = function (delay) {\n var _this = this;\n if (this.timerId) {\n throw new Error(\"RetryLink BUG! Encountered overlapping retries\");\n }\n this.timerId = setTimeout(function () {\n _this.timerId = null;\n _this.try();\n }, delay);\n };\n return RetryableOperation;\n}());\nvar RetryLink = (function (_super) {\n __extends(RetryLink, _super);\n function RetryLink(options) {\n var _this = _super.call(this) || this;\n var _a = options || {}, attempts = _a.attempts, delay = _a.delay;\n _this.delayFor =\n typeof delay === 'function' ? delay : buildDelayFunction(delay);\n _this.retryIf =\n typeof attempts === 'function' ? attempts : buildRetryFunction(attempts);\n return _this;\n }\n RetryLink.prototype.request = function (operation, nextLink) {\n var retryable = new RetryableOperation(operation, nextLink, this.delayFor, this.retryIf);\n retryable.start();\n return new Observable(function (observer) {\n retryable.subscribe(observer);\n return function () {\n retryable.unsubscribe(observer);\n };\n });\n };\n return RetryLink;\n}(ApolloLink));\n\nexport { RetryLink };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["__awaiter","__generator","__extends","Observable","ApolloLink"],"mappings":";;;;;;;AAGA,SAAS,kBAAkB,CAAC,YAAY,EAAE;AAC1C,IAAI,IAAI,EAAE,GAAG,YAAY,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;AAC3L,IAAI,IAAI,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC;AACnD,IAAI,OAAO,SAAS,aAAa,CAAC,KAAK,EAAE;AACzC,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAClE,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;AAC1C,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK,CAAC;AACN,CAAC;AACD;AACA,SAAS,kBAAkB,CAAC,YAAY,EAAE;AAC1C,IAAI,IAAI,EAAE,GAAG,YAAY,IAAI,EAAE,EAAE,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GA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