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QAASrC,EAASqC,WAGnB,IAAIT,WAAW4E,SAAS,IAAI5E,WAAWc,eAAe,CACzDiD,YAAY4E,GACR,MAAMC,EAASxK,EAAS6C,KAAK4H,YACzB7D,GACAA,EAAmB,CAAEyD,QAAS,EAAGD,iBAAkB,EAAGD,cAAc,IAAIG,kBAE5E3E,eAAe+E,IACX,MAAM,KAAEC,EAAI,MAAE9J,SAAgB2J,EAAOE,OACrC,GAAIC,EACAJ,EAAWK,YADf,CAIA,GAAIhE,EAAoB,CACpBwD,GAAoBvJ,EAAMsG,WAE1BP,EAAmB,CAAEyD,QADU,IAAfF,EAAmB,EAAIC,EAAmBD,EAC5BC,mBAAkBD,cAActJ,EAClE,CACA0J,EAAWM,QAAQhK,SACb6J,GAPN,CAQJ,CACMA,EACV,IACA,CACAvK,OAAQH,EAASG,OACjBC,WAAYJ,EAASI,WACrBiC,QAASrC,EAASqC,SAE1B,EGnSJ,MAAMyI,EAAkBC,IAEpB,MAAMtF,EAAK,CAACxB,EAAO/D,IAAYqF,EAAGyF,OAAO/G,EAAOhD,EAAiB8J,EAAU7K,IAC3E,IAAK,MAAM4C,KAAUQ,EAEjBmC,EAAG3C,GAAU,CAACmB,EAAO/D,IAAYqF,EAAGyF,OAAO/G,EAAOhD,EAAiB8J,EAAU7K,EAAS,CAAE4C,YAK5F,OAHA2C,EAAGuF,OAAUC,GAAgBH,EAAe7J,EAAiBgK,IAC7DxF,EAAGyF,OAAUD,GAAgBH,EAAe7J,EAAiB8J,EAAUE,IACvExF,EAAG3B,KAAOA,EACH2B,CAAE,EAGb,EADWqF","sources":["webpack://endrun/./node_modules/ky/distribution/errors/HTTPError.js","webpack://endrun/./node_modules/ky/distribution/errors/TimeoutError.js","webpack://endrun/./node_modules/ky/distribution/utils/is.js","webpack://endrun/./node_modules/ky/distribution/utils/merge.js","webpack://endrun/./node_modules/ky/distribution/core/constants.js","webpack://endrun/./node_modules/ky/distribution/utils/normalize.js","webpack://endrun/./node_modules/ky/distribution/errors/DOMException.js","webpack://endrun/./node_modules/ky/distribution/core/Ky.js","webpack://endrun/./node_modules/ky/distribution/utils/delay.js","webpack://endrun/./node_modules/ky/distribution/utils/timeout.js","webpack://endrun/./node_modules/ky/distribution/index.js"],"sourcesContent":["// eslint-lint-disable-next-line @typescript-eslint/naming-convention\nexport class HTTPError extends Error {\n constructor(response, request, options) {\n const code = (response.status || response.status === 0) ? response.status : '';\n const title = response.statusText || '';\n const status = `${code} ${title}`.trim();\n const reason = status ? `status code ${status}` : 'an unknown error';\n super(`Request failed with ${reason}`);\n Object.defineProperty(this, \"response\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"request\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = 'HTTPError';\n this.response = response;\n this.request = request;\n this.options = options;\n }\n}\n//# sourceMappingURL=HTTPError.js.map","export class TimeoutError extends Error {\n constructor(request) {\n super('Request timed out');\n Object.defineProperty(this, \"request\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = 'TimeoutError';\n this.request = request;\n }\n}\n//# sourceMappingURL=TimeoutError.js.map","// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isObject = (value) => value !== null && typeof value === 'object';\n//# sourceMappingURL=is.js.map","import { isObject } from './is.js';\nexport const validateAndMerge = (...sources) => {\n for (const source of sources) {\n if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n throw new TypeError('The `options` argument must be an object');\n }\n }\n return deepMerge({}, ...sources);\n};\nexport const mergeHeaders = (source1 = {}, source2 = {}) => {\n const result = new globalThis.Headers(source1);\n const isHeadersInstance = source2 instanceof globalThis.Headers;\n const source = new globalThis.Headers(source2);\n for (const [key, value] of source.entries()) {\n if ((isHeadersInstance && value === 'undefined') || value === undefined) {\n result.delete(key);\n }\n else {\n result.set(key, value);\n }\n }\n return result;\n};\n// TODO: Make this strongly-typed (no `any`).\nexport const deepMerge = (...sources) => {\n let returnValue = {};\n let headers = {};\n for (const source of sources) {\n if (Array.isArray(source)) {\n if (!Array.isArray(returnValue)) {\n returnValue = [];\n }\n returnValue = [...returnValue, ...source];\n }\n else if (isObject(source)) {\n for (let [key, value] of Object.entries(source)) {\n if (isObject(value) && key in returnValue) {\n value = deepMerge(returnValue[key], value);\n }\n returnValue = { ...returnValue, [key]: value };\n }\n if (isObject(source.headers)) {\n headers = mergeHeaders(headers, source.headers);\n returnValue.headers = headers;\n }\n }\n }\n return returnValue;\n};\n//# sourceMappingURL=merge.js.map","export const supportsRequestStreams = (() => {\n let duplexAccessed = false;\n let hasContentType = false;\n const supportsReadableStream = typeof globalThis.ReadableStream === 'function';\n const supportsRequest = typeof globalThis.Request === 'function';\n if (supportsReadableStream && supportsRequest) {\n hasContentType = new globalThis.Request('https://a.com', {\n body: new globalThis.ReadableStream(),\n method: 'POST',\n // @ts-expect-error - Types are outdated.\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n }\n return duplexAccessed && !hasContentType;\n})();\nexport const supportsAbortController = typeof globalThis.AbortController === 'function';\nexport const supportsResponseStreams = typeof globalThis.ReadableStream === 'function';\nexport const supportsFormData = typeof globalThis.FormData === 'function';\nexport const requestMethods = ['get', 'post', 'put', 'patch', 'head', 'delete'];\nconst validate = () => undefined;\nvalidate();\nexport const responseTypes = {\n json: 'application/json',\n text: 'text/*',\n formData: 'multipart/form-data',\n arrayBuffer: '*/*',\n blob: '*/*',\n};\n// The maximum value of a 32bit int (see issue #117)\nexport const maxSafeTimeout = 2147483647;\nexport const stop = Symbol('stop');\n//# sourceMappingURL=constants.js.map","import { requestMethods } from '../core/constants.js';\nexport const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;\nconst retryMethods = ['get', 'put', 'head', 'delete', 'options', 'trace'];\nconst retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];\nconst retryAfterStatusCodes = [413, 429, 503];\nconst defaultRetryOptions = {\n limit: 2,\n methods: retryMethods,\n statusCodes: retryStatusCodes,\n afterStatusCodes: retryAfterStatusCodes,\n maxRetryAfter: Number.POSITIVE_INFINITY,\n backoffLimit: Number.POSITIVE_INFINITY,\n};\nexport const normalizeRetryOptions = (retry = {}) => {\n if (typeof retry === 'number') {\n return {\n ...defaultRetryOptions,\n limit: retry,\n };\n }\n if (retry.methods && !Array.isArray(retry.methods)) {\n throw new Error('retry.methods must be an array');\n }\n if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n throw new Error('retry.statusCodes must be an array');\n }\n return {\n ...defaultRetryOptions,\n ...retry,\n afterStatusCodes: retryAfterStatusCodes,\n };\n};\n//# sourceMappingURL=normalize.js.map","// DOMException is supported on most modern browsers and Node.js 18+.\n// @see https://developer.mozilla.org/en-US/docs/Web/API/DOMException#browser_compatibility\nconst isDomExceptionSupported = Boolean(globalThis.DOMException);\n// TODO: When targeting Node.js 18, use `signal.throwIfAborted()` (https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted)\nexport function composeAbortError(signal) {\n /*\n NOTE: Use DomException with AbortError name as specified in MDN docs (https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)\n > When abort() is called, the fetch() promise rejects with an Error of type DOMException, with name AbortError.\n */\n if (isDomExceptionSupported) {\n return new DOMException(signal?.reason ?? 'The operation was aborted.', 'AbortError');\n }\n // DOMException not supported. Fall back to use of error and override name.\n const error = new Error(signal?.reason ?? 'The operation was aborted.');\n error.name = 'AbortError';\n return error;\n}\n//# sourceMappingURL=DOMException.js.map","import { HTTPError } from '../errors/HTTPError.js';\nimport { TimeoutError } from '../errors/TimeoutError.js';\nimport { deepMerge, mergeHeaders } from '../utils/merge.js';\nimport { normalizeRequestMethod, normalizeRetryOptions } from '../utils/normalize.js';\nimport timeout from '../utils/timeout.js';\nimport delay from '../utils/delay.js';\nimport { maxSafeTimeout, responseTypes, stop, supportsAbortController, supportsFormData, supportsResponseStreams, supportsRequestStreams, } from './constants.js';\nexport class Ky {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n static create(input, options) {\n const ky = new Ky(input, options);\n const fn = async () => {\n if (ky._options.timeout > maxSafeTimeout) {\n throw new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n }\n // Delay the fetch so that body method shortcuts can set the Accept header\n await Promise.resolve();\n let response = await ky._fetch();\n for (const hook of ky._options.hooks.afterResponse) {\n // eslint-disable-next-line no-await-in-loop\n const modifiedResponse = await hook(ky.request, ky._options, ky._decorateResponse(response.clone()));\n if (modifiedResponse instanceof globalThis.Response) {\n response = modifiedResponse;\n }\n }\n ky._decorateResponse(response);\n if (!response.ok && ky._options.throwHttpErrors) {\n let error = new HTTPError(response, ky.request, ky._options);\n for (const hook of ky._options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n throw error;\n }\n // If `onDownloadProgress` is passed, it uses the stream API internally\n /* istanbul ignore next */\n if (ky._options.onDownloadProgress) {\n if (typeof ky._options.onDownloadProgress !== 'function') {\n throw new TypeError('The `onDownloadProgress` option must be a function');\n }\n if (!supportsResponseStreams) {\n throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n }\n return ky._stream(response.clone(), ky._options.onDownloadProgress);\n }\n return response;\n };\n const isRetriableMethod = ky._options.retry.methods.includes(ky.request.method.toLowerCase());\n const result = (isRetriableMethod ? ky._retry(fn) : fn());\n for (const [type, mimeType] of Object.entries(responseTypes)) {\n result[type] = async () => {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ky.request.headers.set('accept', ky.request.headers.get('accept') || mimeType);\n const awaitedResult = await result;\n const response = awaitedResult.clone();\n if (type === 'json') {\n if (response.status === 204) {\n return '';\n }\n const arrayBuffer = await response.clone().arrayBuffer();\n const responseSize = arrayBuffer.byteLength;\n if (responseSize === 0) {\n return '';\n }\n if (options.parseJson) {\n return options.parseJson(await response.text());\n }\n }\n return response[type]();\n };\n }\n return result;\n }\n // eslint-disable-next-line complexity\n constructor(input, options = {}) {\n Object.defineProperty(this, \"request\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"abortController\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_retryCount\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 0\n });\n Object.defineProperty(this, \"_input\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_options\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this._input = input;\n this._options = {\n // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n credentials: this._input.credentials || 'same-origin',\n ...options,\n headers: mergeHeaders(this._input.headers, options.headers),\n hooks: deepMerge({\n beforeRequest: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: [],\n }, options.hooks),\n method: normalizeRequestMethod(options.method ?? this._input.method),\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n prefixUrl: String(options.prefixUrl || ''),\n retry: normalizeRetryOptions(options.retry),\n throwHttpErrors: options.throwHttpErrors !== false,\n timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n fetch: options.fetch ?? globalThis.fetch.bind(globalThis),\n };\n if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n throw new TypeError('`input` must be a string, URL, or Request');\n }\n if (this._options.prefixUrl && typeof this._input === 'string') {\n if (this._input.startsWith('/')) {\n throw new Error('`input` must not begin with a slash when using `prefixUrl`');\n }\n if (!this._options.prefixUrl.endsWith('/')) {\n this._options.prefixUrl += '/';\n }\n this._input = this._options.prefixUrl + this._input;\n }\n if (supportsAbortController) {\n this.abortController = new globalThis.AbortController();\n if (this._options.signal) {\n const originalSignal = this._options.signal;\n this._options.signal.addEventListener('abort', () => {\n this.abortController.abort(originalSignal.reason);\n });\n }\n this._options.signal = this.abortController.signal;\n }\n if (supportsRequestStreams) {\n // @ts-expect-error - Types are outdated.\n this._options.duplex = 'half';\n }\n this.request = new globalThis.Request(this._input, this._options);\n if (this._options.searchParams) {\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const textSearchParams = typeof this._options.searchParams === 'string'\n ? this._options.searchParams.replace(/^\\?/, '')\n : new URLSearchParams(this._options.searchParams).toString();\n // eslint-disable-next-line unicorn/prevent-abbreviations\n const searchParams = '?' + textSearchParams;\n const url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n if (((supportsFormData && this._options.body instanceof globalThis.FormData)\n || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n this.request.headers.delete('content-type');\n }\n // The spread of `this.request` is required as otherwise it misses the `duplex` option for some reason and throws.\n this.request = new globalThis.Request(new globalThis.Request(url, { ...this.request }), this._options);\n }\n if (this._options.json !== undefined) {\n this._options.body = JSON.stringify(this._options.json);\n this.request.headers.set('content-type', this._options.headers.get('content-type') ?? 'application/json');\n this.request = new globalThis.Request(this.request, { body: this._options.body });\n }\n }\n _calculateRetryDelay(error) {\n this._retryCount++;\n if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n if (error instanceof HTTPError) {\n if (!this._options.retry.statusCodes.includes(error.response.status)) {\n return 0;\n }\n const retryAfter = error.response.headers.get('Retry-After');\n if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n let after = Number(retryAfter);\n if (Number.isNaN(after)) {\n after = Date.parse(retryAfter) - Date.now();\n }\n else {\n after *= 1000;\n }\n if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n return 0;\n }\n return after;\n }\n if (error.response.status === 413) {\n return 0;\n }\n }\n const BACKOFF_FACTOR = 0.3;\n return Math.min(this._options.retry.backoffLimit, BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000);\n }\n return 0;\n }\n _decorateResponse(response) {\n if (this._options.parseJson) {\n response.json = async () => this._options.parseJson(await response.text());\n }\n return response;\n }\n async _retry(fn) {\n try {\n return await fn();\n // eslint-disable-next-line @typescript-eslint/no-implicit-any-catch\n }\n catch (error) {\n const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n if (ms !== 0 && this._retryCount > 0) {\n await delay(ms, { signal: this._options.signal });\n for (const hook of this._options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n const hookResult = await hook({\n request: this.request,\n options: this._options,\n error: error,\n retryCount: this._retryCount,\n });\n // If `stop` is returned from the hook, the retry process is stopped\n if (hookResult === stop) {\n return;\n }\n }\n return this._retry(fn);\n }\n throw error;\n }\n }\n async _fetch() {\n for (const hook of this._options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(this.request, this._options);\n if (result instanceof Request) {\n this.request = result;\n break;\n }\n if (result instanceof Response) {\n return result;\n }\n }\n if (this._options.timeout === false) {\n return this._options.fetch(this.request.clone());\n }\n return timeout(this.request.clone(), this.abortController, this._options);\n }\n /* istanbul ignore next */\n _stream(response, onDownloadProgress) {\n const totalBytes = Number(response.headers.get('content-length')) || 0;\n let transferredBytes = 0;\n if (response.status === 204) {\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 1, totalBytes, transferredBytes }, new Uint8Array());\n }\n return new globalThis.Response(null, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n }\n return new globalThis.Response(new globalThis.ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n if (onDownloadProgress) {\n onDownloadProgress({ percent: 0, transferredBytes: 0, totalBytes }, new Uint8Array());\n }\n async function read() {\n const { done, value } = await reader.read();\n if (done) {\n controller.close();\n return;\n }\n if (onDownloadProgress) {\n transferredBytes += value.byteLength;\n const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n onDownloadProgress({ percent, transferredBytes, totalBytes }, value);\n }\n controller.enqueue(value);\n await read();\n }\n await read();\n },\n }), {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n }\n}\n//# sourceMappingURL=Ky.js.map","// https://github.com/sindresorhus/delay/tree/ab98ae8dfcb38e1593286c94d934e70d14a4e111\nimport { composeAbortError } from '../errors/DOMException.js';\nexport default async function delay(ms, { signal }) {\n return new Promise((resolve, reject) => {\n if (signal) {\n if (signal.aborted) {\n reject(composeAbortError(signal));\n return;\n }\n signal.addEventListener('abort', handleAbort, { once: true });\n }\n function handleAbort() {\n reject(composeAbortError(signal));\n clearTimeout(timeoutId);\n }\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', handleAbort);\n resolve();\n }, ms);\n });\n}\n//# sourceMappingURL=delay.js.map","import { TimeoutError } from '../errors/TimeoutError.js';\n// `Promise.race()` workaround (#91)\nexport default async function timeout(request, abortController, options) {\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n if (abortController) {\n abortController.abort();\n }\n reject(new TimeoutError(request));\n }, options.timeout);\n void options\n .fetch(request)\n .then(resolve)\n .catch(reject)\n .then(() => {\n clearTimeout(timeoutId);\n });\n });\n}\n//# sourceMappingURL=timeout.js.map","/*! MIT License © Sindre Sorhus */\nimport { Ky } from './core/Ky.js';\nimport { requestMethods, stop } from './core/constants.js';\nimport { validateAndMerge } from './utils/merge.js';\nconst createInstance = (defaults) => {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n const ky = (input, options) => Ky.create(input, validateAndMerge(defaults, options));\n for (const method of requestMethods) {\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n ky[method] = (input, options) => Ky.create(input, validateAndMerge(defaults, options, { method }));\n }\n ky.create = (newDefaults) => createInstance(validateAndMerge(newDefaults));\n ky.extend = (newDefaults) => createInstance(validateAndMerge(defaults, newDefaults));\n ky.stop = stop;\n return ky;\n};\nconst ky = createInstance();\nexport default ky;\nexport { HTTPError } from './errors/HTTPError.js';\nexport { TimeoutError } from './errors/TimeoutError.js';\n//# sourceMappingURL=index.js.map"],"names":["HTTPError","Error","constructor","response","request","options","status","statusText","trim","super","Object","defineProperty","this","enumerable","configurable","writable","value","name","TimeoutError","isObject","validateAndMerge","sources","source","Array","isArray","TypeError","deepMerge","mergeHeaders","source1","source2","result","globalThis","Headers","isHeadersInstance","key","entries","undefined","delete","set","returnValue","headers","supportsRequestStreams","duplexAccessed","hasContentType","supportsReadableStream","ReadableStream","supportsRequest","Request","body","method","duplex","has","supportsAbortController","AbortController","supportsResponseStreams","supportsFormData","FormData","requestMethods","responseTypes","json","text","formData","arrayBuffer","blob","maxSafeTimeout","stop","Symbol","normalizeRequestMethod","input","includes","toUpperCase","retryAfterStatusCodes","defaultRetryOptions","limit","methods","statusCodes","afterStatusCodes","maxRetryAfter","Number","POSITIVE_INFINITY","backoffLimit","normalizeRetryOptions","retry","isDomExceptionSupported","Boolean","DOMException","composeAbortError","signal","reason","error","Ky","static","ky","fn","async","_options","timeout","RangeError","Promise","resolve","_fetch","hook","hooks","afterResponse","modifiedResponse","_decorateResponse","clone","Response","ok","throwHttpErrors","beforeError","onDownloadProgress","_stream","toLowerCase","_retry","type","mimeType","get","byteLength","parseJson","_input","credentials","beforeRequest","beforeRetry","prefixUrl","String","fetch","bind","URL","startsWith","endsWith","abortController","originalSignal","addEventListener","abort","searchParams","replace","URLSearchParams","toString","url","JSON","stringify","_calculateRetryDelay","_retryCount","retryAfter","after","isNaN","Date","parse","now","BACKOFF_FACTOR","Math","min","ms","reject","aborted","handleAbort","once","clearTimeout","timeoutId","setTimeout","removeEventListener","delay","retryCount","then","catch","totalBytes","transferredBytes","percent","Uint8Array","controller","reader","getReader","read","done","close","enqueue","createInstance","defaults","create","newDefaults","extend"],"sourceRoot":""}